|
15 | 15 | * along with this program. If not, see <http://www.gnu.org/licenses/>.
|
16 | 16 | */
|
17 | 17 |
|
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 |
| - |
34 | 18 | // jQuery selectors for global elements
|
35 | 19 | var DomElements = {
|
36 | 20 | FORM: "#process",
|
37 |
| - STARTHIDDEN: ".starthidden" |
| 21 | + INPUTS: "textarea, input" |
38 | 22 | };
|
39 | 23 |
|
40 | 24 | // Servlets
|
@@ -66,62 +50,8 @@ new function ($)
|
66 | 50 | }
|
67 | 51 | }(jQuery);
|
68 | 52 |
|
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 |
| - |
119 | 53 | // Message
|
120 | 54 | var Message = {
|
121 |
| - INPUT: "input", |
122 |
| - INVALID_INPUT: "input-invalid", |
123 |
| - INPUT2: "input2", |
124 |
| - INVALID_INPUT2: "input2-invalid", |
125 | 55 | VALID: "valid",
|
126 | 56 | RESULTS: "results"
|
127 | 57 | };
|
@@ -281,7 +211,7 @@ var main = function()
|
281 | 211 | input2.reset();
|
282 | 212 |
|
283 | 213 | // Grab the necessary input fields
|
284 |
| - var $inputs = $form.find(FormElements.INPUTS); |
| 214 | + var $inputs = $form.find(DomElements.INPUTS); |
285 | 215 |
|
286 | 216 | // Serialize all of the form -- _very_ convenient, that!
|
287 | 217 | // Note that unchecked checkboxes will not be taken into account; as to
|
|
0 commit comments