Skip to content

Commit b6be502

Browse files
committed
common.js cleanup
1 parent 1bad048 commit b6be502

File tree

1 file changed

+2
-72
lines changed

1 file changed

+2
-72
lines changed

src/main/webapp/js/common.js

Lines changed: 2 additions & 72 deletions
Original file line numberDiff line numberDiff line change
@@ -15,26 +15,10 @@
1515
* along with this program. If not, see <http://www.gnu.org/licenses/>.
1616
*/
1717

18-
/*
19-
* This file contains common elements between (for now) the two existing,
20-
* "active" pages.
21-
*/
22-
23-
var TextAreas = {
24-
fillJson: function(selector, value)
25-
{
26-
$(selector).val(JSON.stringify(value, undefined, 4));
27-
},
28-
clear: function(selector)
29-
{
30-
$(selector).val("");
31-
}
32-
};
33-
3418
// jQuery selectors for global elements
3519
var DomElements = {
3620
FORM: "#process",
37-
STARTHIDDEN: ".starthidden"
21+
INPUTS: "textarea, input"
3822
};
3923

4024
// Servlets
@@ -66,62 +50,8 @@ new function ($)
6650
}
6751
}(jQuery);
6852

69-
// Function to report a parse error
70-
function reportParseError(parseError, msgHandle, textArea)
71-
{
72-
// Find the inner link element -- there is only one, so this is "safe".
73-
var link = msgHandle.find("a");
74-
75-
link.text("line " + parseError["line"]);
76-
77-
// Add an onclick hook to the link. When clicking on the link, the caret
78-
// in the text area will move to the position of the error.
79-
link.on("click", function(e)
80-
{
81-
e.preventDefault();
82-
textArea.focus().setCursorPosition(parseError["offset"]);
83-
});
84-
85-
link.qtip("destroy");
86-
link.qtip({
87-
content: parseError["message"],
88-
show: "mouseover",
89-
hide: "mouseout",
90-
position: {
91-
corner: {
92-
target: "topMiddle",
93-
tooltip: "bottomMiddle"
94-
}
95-
}
96-
});
97-
// Show the message
98-
msgHandle.show();
99-
}
100-
101-
// jQuery selectors for input form elements
102-
var FormElements = {
103-
INPUTS: "textarea, input",
104-
INPUT: "#input",
105-
INPUT2: "#input2",
106-
INVALID_INPUT: "#input-invalid",
107-
INVALID_INPUT2: "#input2-invalid",
108-
INVALID_QTIP: "#qtip-input",
109-
INVALID_QTIP2: "#qtip-input2"
110-
};
111-
112-
// jQuery selectors for result pane elements
113-
var ResultPane = {
114-
RESULTS: "textarea#results",
115-
PROCESSING_SUCCESS: "#processingSuccess",
116-
PROCESSING_FAILURE: "#processingFailure"
117-
};
118-
11953
// Message
12054
var Message = {
121-
INPUT: "input",
122-
INVALID_INPUT: "input-invalid",
123-
INPUT2: "input2",
124-
INVALID_INPUT2: "input2-invalid",
12555
VALID: "valid",
12656
RESULTS: "results"
12757
};
@@ -281,7 +211,7 @@ var main = function()
281211
input2.reset();
282212

283213
// Grab the necessary input fields
284-
var $inputs = $form.find(FormElements.INPUTS);
214+
var $inputs = $form.find(DomElements.INPUTS);
285215

286216
// Serialize all of the form -- _very_ convenient, that!
287217
// Note that unchecked checkboxes will not be taken into account; as to

0 commit comments

Comments
 (0)