1 |
|
---|
2 | console.log("Loading gui_div.js\n");
|
---|
3 |
|
---|
4 | // var initialised_iframe = "false";
|
---|
5 |
|
---|
6 | function onTextChange(item, text)
|
---|
7 | {
|
---|
8 | console.log("I have set "+item+".value to "+text);
|
---|
9 | item.setAttribute("value",text);
|
---|
10 | }
|
---|
11 |
|
---|
12 | function onSelectChange(item)
|
---|
13 | {
|
---|
14 | console.log("I have set "+item.value+".selected to selected");
|
---|
15 | for (var i=0; i<item.options.length; i++)
|
---|
16 | {
|
---|
17 | if(item.selectedIndex == i)
|
---|
18 | item.options[i].setAttribute("selected", "selected");
|
---|
19 | else
|
---|
20 | item.options[i].removeAttribute("selected");
|
---|
21 | }
|
---|
22 | //item.options[item.selectedIndex].selected = "selected";
|
---|
23 | //item.setAttribute("selected","selected");
|
---|
24 | }
|
---|
25 |
|
---|
26 |
|
---|
27 | //function createFormatStatement()
|
---|
28 | //{
|
---|
29 |
|
---|
30 | //var formatDiv = document.getElementById('formatStatement');
|
---|
31 | //var formatStatement = innerXHTML(formatDiv);
|
---|
32 | //console.log(formatStatement);
|
---|
33 |
|
---|
34 | // find collection name
|
---|
35 |
|
---|
36 | //var myurl = document.URL;
|
---|
37 | //console.log(myurl);
|
---|
38 | //var first = myurl.indexOf("&c")+3;
|
---|
39 | //var last = myurl.indexOf("&", first);
|
---|
40 |
|
---|
41 | //var collection_name = getSubstring(myurl, "&c", "&"); //myurl.substring(first,last); ///&c=(.*)&/.exec(myurl);
|
---|
42 | //console.log(collection_name);
|
---|
43 |
|
---|
44 | //first = myurl.indexOf("&s")+3;
|
---|
45 | //last = myurl.indexOf("&", first);
|
---|
46 |
|
---|
47 | //var service_name = myurl.substring(first,last);
|
---|
48 | //console.log(service_name);
|
---|
49 |
|
---|
50 | //var classifier_name = null;
|
---|
51 |
|
---|
52 | //if(service_name == "ClassifierBrowse")
|
---|
53 | //{
|
---|
54 | // first = myurl.indexOf("&cl")+4;
|
---|
55 | // last = myurl.indexOf("&", first);
|
---|
56 |
|
---|
57 | // classifier_name = myurl.substring(first,last);
|
---|
58 | // console.log(classifier_name);
|
---|
59 | //}
|
---|
60 |
|
---|
61 | //var myurl = 'http://localhost:8080/greenstone3/format?a=s&sa=s&t='+formatStatement;
|
---|
62 |
|
---|
63 | //jQuery.post( url, [ data ], [ success(data, textStatus, XMLHttpRequest) ], [ dataType ] )
|
---|
64 |
|
---|
65 | // How do I find out my collection name?
|
---|
66 |
|
---|
67 | function getSubstring(str, first, last)
|
---|
68 | {
|
---|
69 | var first_index = str.indexOf(first)+first.length+1;
|
---|
70 | var last_index = str.indexOf(last, first_index);
|
---|
71 |
|
---|
72 | var substring = str.substring(first_index, last_index);
|
---|
73 |
|
---|
74 | console.log(substring);
|
---|
75 |
|
---|
76 | return substring;
|
---|
77 | }
|
---|
78 |
|
---|
79 | function getFormatStatement()
|
---|
80 | {
|
---|
81 | var formatDiv = document.getElementById('formatStatement');
|
---|
82 | var formatStatement = innerXHTML(formatDiv);
|
---|
83 | return formatStatement;
|
---|
84 | }
|
---|
85 |
|
---|
86 | function updateFormatStatement()
|
---|
87 | {
|
---|
88 | var formatStatement = getFormatStatement();
|
---|
89 |
|
---|
90 | var myurl = document.URL;
|
---|
91 |
|
---|
92 | var collection_name = getSubstring(myurl, "&c", "&");
|
---|
93 | var service_name = getSubstring(myurl, "&s", "&");
|
---|
94 | var classifier_name = null;
|
---|
95 |
|
---|
96 | if(service_name == "ClassifierBrowse")
|
---|
97 | classifier_name = getSubstring(myurl, "&cl", "&");
|
---|
98 |
|
---|
99 | var post_url = "http://localhost:8989/greenstone3/format?a=f&sa=update&c=" + collection_name +"&s=" + service_name;
|
---|
100 |
|
---|
101 | if(classifier_name != null)
|
---|
102 | post_url = post_url + "&cl=" + classifier_name;
|
---|
103 |
|
---|
104 | $.post(post_url, {data: formatStatement}, function(data) {
|
---|
105 | //$('.result').innerHTML = data; //html(data);
|
---|
106 | console.log("Success, we have received data");
|
---|
107 | console.log(data);
|
---|
108 | }, 'html');
|
---|
109 | }
|
---|
110 |
|
---|
111 | function saveFormatStatement()
|
---|
112 | {
|
---|
113 | var formatStatement = getFormatStatement();
|
---|
114 |
|
---|
115 | var myurl = document.URL;
|
---|
116 |
|
---|
117 | var collection_name = getSubstring(myurl, "&c", "&");
|
---|
118 | var service_name = getSubstring(myurl, "&s", "&");
|
---|
119 | var classifier_name = null;
|
---|
120 |
|
---|
121 | if(service_name == "ClassifierBrowse")
|
---|
122 | classifier_name = getSubstring(myurl, "&cl", "&");
|
---|
123 |
|
---|
124 | var post_url = "http://localhost:8989/greenstone3/format?a=f&sa=save&c=" + collection_name +"&s=" + service_name;
|
---|
125 |
|
---|
126 | if(classifier_name != null)
|
---|
127 | post_url = post_url + "&cl=" + classifier_name;
|
---|
128 |
|
---|
129 | $.post(post_url, {data: formatStatement}, function(data) {
|
---|
130 | //$('.result').innerHTML = data; //html(data);
|
---|
131 | console.log("Success, we have received data");
|
---|
132 | console.log(data);
|
---|
133 | }, 'html');
|
---|
134 | }
|
---|
135 |
|
---|
136 | /*
|
---|
137 | $.ajax({
|
---|
138 | type: "POST",
|
---|
139 | url: "http://localhost:8080/greenstone3/format?a=s&sa=s",
|
---|
140 | data: formatStatement,
|
---|
141 | processData: false,
|
---|
142 | success: function(data) {
|
---|
143 | //$('.result').html(data);
|
---|
144 | console.log("Success, we have received data");
|
---|
145 | //console.log(data);
|
---|
146 | }
|
---|
147 | });
|
---|
148 | */
|
---|
149 | /*
|
---|
150 | $.ajax({
|
---|
151 | url: myurl,
|
---|
152 | success: function(data) {
|
---|
153 | //$('.result').html(data);
|
---|
154 | console.log("Success, we have received data");
|
---|
155 | console.log(data);
|
---|
156 | }
|
---|
157 | });
|
---|
158 | */
|
---|
159 | //if(formatStatement.hasChildNodes())
|
---|
160 | //{
|
---|
161 | //var formatstring = traverse(formatStatement, "");
|
---|
162 | //console.log(formatstring);
|
---|
163 |
|
---|
164 | // var children = $(formatStatement).children('div');
|
---|
165 | // for(var i=0; i < children.length; i++)
|
---|
166 | // traverse(children[i], formatstring)
|
---|
167 |
|
---|
168 | /*
|
---|
169 | var children = formatStatement.childNodes; //[]getChildNodes();
|
---|
170 | var current;
|
---|
171 | for(var i = 0; i < formatStatement.childNodes.length; i++)
|
---|
172 | {
|
---|
173 | current = formatStatement.childNodes[i];
|
---|
174 | //console.log(current.nodeName);
|
---|
175 | //console.log(current.nodeType);
|
---|
176 | if(current.nodeName=='DIV')
|
---|
177 | {
|
---|
178 | //console.log(current);
|
---|
179 | //console.log(current.className);
|
---|
180 | var gsf = find_class(current);
|
---|
181 | console.log(gsf);
|
---|
182 | }
|
---|
183 | }
|
---|
184 | */
|
---|
185 | //}
|
---|
186 | //}
|
---|
187 |
|
---|
188 | function traverse(node, formatstring)
|
---|
189 | {
|
---|
190 | //console.log("node=("+node.nodeName+","+node.nodeType+")");
|
---|
191 |
|
---|
192 | if(node.nodeName=='DIV')
|
---|
193 | {
|
---|
194 | console.log("Found a div" +node.nodeName+","+node.nodeType);
|
---|
195 | formatstring = formatstring + find_class(node);
|
---|
196 | console.log(formatstring);
|
---|
197 | }
|
---|
198 |
|
---|
199 | var children = $(node).children();
|
---|
200 | for(var i=0; i < children.length; i++)
|
---|
201 | formatstring = formatstring + traverse(children[i], formatstring);
|
---|
202 |
|
---|
203 | return formatstring;
|
---|
204 | }
|
---|
205 |
|
---|
206 |
|
---|
207 | /*
|
---|
208 | console.log("node=("+node.nodeName+","+node.nodeType+")");
|
---|
209 |
|
---|
210 | if(node.children.length == 0) //hasChildNodes())
|
---|
211 | {
|
---|
212 | console.log("No children so return");
|
---|
213 | return "";
|
---|
214 | }
|
---|
215 |
|
---|
216 | if(node.nodeName=='DIV')
|
---|
217 | {
|
---|
218 | console.log("Found a div");
|
---|
219 | formatstring = formatstring + find_class(node);
|
---|
220 | }
|
---|
221 |
|
---|
222 | for(var i = 0; i < node.children.length; i++)
|
---|
223 | return recursiveTraverse(node.children[i], formatstring);
|
---|
224 |
|
---|
225 |
|
---|
226 | return formatstring;
|
---|
227 | }
|
---|
228 | */
|
---|
229 |
|
---|
230 | function find_class(current)
|
---|
231 | {
|
---|
232 | var classes = current.className.split(' ');
|
---|
233 | var none = "";
|
---|
234 | for(var i = 0; i < classes.length; i++)
|
---|
235 | {
|
---|
236 | switch(classes[i])
|
---|
237 | {
|
---|
238 | case 'gsf_template':
|
---|
239 | return create_gsf_template(current);
|
---|
240 | default:
|
---|
241 | {
|
---|
242 | console.log("Class not found");
|
---|
243 | return none;
|
---|
244 | }
|
---|
245 | }
|
---|
246 | }
|
---|
247 | }
|
---|
248 |
|
---|
249 | function create_gsf_template(current)
|
---|
250 | {
|
---|
251 | // find match text which is an input with class match
|
---|
252 | var match = $(current).find('.match')[0].value;
|
---|
253 | console.log(match);
|
---|
254 |
|
---|
255 | // find mode text which is an input with class mode
|
---|
256 | var mode = $(current).find('.mode')[0].value;
|
---|
257 | console.log(mode);
|
---|
258 |
|
---|
259 | // "<gsf:template match=\"classifierNode\" mode=\"horizontal\">"
|
---|
260 | var gsf = "<gsf:template match=\"" + match + "\"";
|
---|
261 | if(mode != "vertical")
|
---|
262 | gsf = gsf + " mode=\"" + mode + "\"";
|
---|
263 | gsf = gsf + ">";
|
---|
264 |
|
---|
265 | return gsf;
|
---|
266 |
|
---|
267 | }
|
---|
268 |
|
---|
269 | /*
|
---|
270 | $("#iframe").ready(function(){
|
---|
271 | console.log("iframe is ready ...");
|
---|
272 | var iframe = document.getElementById('iframe');
|
---|
273 | var iframe_document = iframe.document;
|
---|
274 |
|
---|
275 | if(iframe.contentDocument)
|
---|
276 | {
|
---|
277 | iframe_document = iframe.contentDocument; // For NS6
|
---|
278 | console.log("Chose content document");
|
---|
279 | }
|
---|
280 | else if(iframe.contentWindow)
|
---|
281 | {
|
---|
282 | iframe_document = iframe.contentWindow.document; // For IE5.5 and IE6
|
---|
283 | console.log("Chose content window");
|
---|
284 | }
|
---|
285 |
|
---|
286 | console.log(iframe_document.documentElement.innerHTML); //document.documentElement.outerHTML
|
---|
287 |
|
---|
288 | $(iframe_document.documentElement.innerHTML).find('a').each(function() {
|
---|
289 | console.log("data "+$(this).data('href'));
|
---|
290 | console.log("getAttribute "+$(this).getAttribute('href'));
|
---|
291 | console.log("attr "+$(this).attr('href'));
|
---|
292 | console.log("this.href "+this.href);
|
---|
293 | var original = this.href; //$(this).attr('href');
|
---|
294 | // check if greenstone link ie. starts with format
|
---|
295 | //var original = $(this).data('href');
|
---|
296 | var modified = original.toString().concat("&excerptid=gs_content");
|
---|
297 | console.log(modified);
|
---|
298 | this.href = modified;
|
---|
299 | //$(this).attr('href',modified);
|
---|
300 | //$(this).data('href', modified);
|
---|
301 | //console.log($(this).attr('href'));
|
---|
302 | console.log("data "+$(this).data('href'));
|
---|
303 | console.log("getAttribute "+$(this).getAttribute('href'));
|
---|
304 | console.log("attr "+$(this).attr('href'));
|
---|
305 | console.log("this.href "+this.href);
|
---|
306 | console.log("**********");
|
---|
307 |
|
---|
308 | });
|
---|
309 | }); */
|
---|
310 | /*
|
---|
311 | function loadXMLDoc()
|
---|
312 | {
|
---|
313 | if (window.XMLHttpRequest)
|
---|
314 | {// code for IE7+, Firefox, Chrome, Opera, Safari
|
---|
315 | xmlhttp=new XMLHttpRequest();
|
---|
316 | }
|
---|
317 | else
|
---|
318 | {// code for IE6, IE5
|
---|
319 | xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
|
---|
320 | }
|
---|
321 |
|
---|
322 | xmlhttp.onreadystatechange=function()
|
---|
323 | {
|
---|
324 | console.log("state changed to " + xmlhttp.readyState);
|
---|
325 | console.log("status is " + xmlhttp.status);
|
---|
326 | if (xmlhttp.readyState==4 && xmlhttp.status==200)
|
---|
327 | {
|
---|
328 | console.log("get code");
|
---|
329 | console.log(xmlhttp.responseText);
|
---|
330 | document.getElementById("gs_content").innerHTML=xmlhttp.responseText;
|
---|
331 | }
|
---|
332 | }
|
---|
333 |
|
---|
334 | xmlhttp.open("GET","http://localhost:8080/greenstone3/format?a=b&rt=s&s=ClassifierBrowse&c=simpleht&cl=CL1&excerptid=gs_content",true);
|
---|
335 | //xmlhttp.open("GET","http://www.cs.waikato.ac.nz",true);
|
---|
336 | //xmlhttp.open("GET","http://wand.net.nz/~sjb48/index.html",true);
|
---|
337 | xmlhttp.send();
|
---|
338 | }
|
---|
339 | */
|
---|
340 | $(document).ready(function(){
|
---|
341 |
|
---|
342 | console.log("Document ready function\n");
|
---|
343 |
|
---|
344 | var CURRENT_SELECT_VALUE = "";
|
---|
345 |
|
---|
346 | /*
|
---|
347 | var iframe = document.getElementById('iframe');
|
---|
348 | var iframe_document = iframe.document;
|
---|
349 |
|
---|
350 | if(iframe.contentDocument)
|
---|
351 | {
|
---|
352 | iframe_document = iframe.contentDocument; // For NS6
|
---|
353 | console.log("Chose content document");
|
---|
354 | }
|
---|
355 | else if(iframe.contentWindow)
|
---|
356 | {
|
---|
357 | iframe_document = iframe.contentWindow.document; // For IE5.5 and IE6
|
---|
358 | console.log("Chose content window");
|
---|
359 | }
|
---|
360 |
|
---|
361 | // Edit the hrefs in preview_html - search for <a href="format?a=b&rt=r&s=ClassifierBrowse&c=simpleht&cl=CL1.2">
|
---|
362 | var start_index = 0;
|
---|
363 | var end_index = 0;
|
---|
364 | while(start_index != -1)
|
---|
365 | {
|
---|
366 | start_index = preview_html.indexOf("href=\"format", start_index);
|
---|
367 | console.log("start index = " + start_index);
|
---|
368 | if(start_index != -1)
|
---|
369 | {
|
---|
370 | end_index = preview_html.indexOf("\">", start_index);
|
---|
371 | console.log("end_index = " + end_index);
|
---|
372 | a = preview_html.substring(0,end_index);
|
---|
373 | b = preview_html.substring(end_index);
|
---|
374 | preview_html = a.concat("&excerptid=results", b);
|
---|
375 | console.log(preview_html);
|
---|
376 | start_index = end_index + "&excerptid=results\">".length;
|
---|
377 | }
|
---|
378 | }
|
---|
379 |
|
---|
380 | // Split the html code in to three parts
|
---|
381 | var first_index = preview_html.indexOf("<ul id=\"results\"");
|
---|
382 | console.log("First index is "+first_index);
|
---|
383 | var second_index = preview_html.indexOf("</ul>", first_index) + "</ul>".length;
|
---|
384 | console.log("Second index is "+second_index);
|
---|
385 |
|
---|
386 | var first_half = preview_html.substring(0, first_index);
|
---|
387 | var iframe_code = preview_html.substring(first_index, second_index);
|
---|
388 | var second_half = preview_html.substring(second_index);
|
---|
389 |
|
---|
390 | //$('#my_categories').innerHTML = first_half.concat(second_half);
|
---|
391 | document.getElementById("my_categories").innerHTML = first_half.concat(second_half);
|
---|
392 |
|
---|
393 | // Put the content in the iframe
|
---|
394 | if(initialised_iframe == "false")
|
---|
395 | {
|
---|
396 | console.log("Initialised iframe with preview html");
|
---|
397 | console.log(preview_html);
|
---|
398 | iframe_document.open();
|
---|
399 | iframe_document.writeln(iframe_code); //.concat("&excerptid=gs_content"));
|
---|
400 | iframe_document.close();
|
---|
401 | initialised_iframe = "true";
|
---|
402 | }
|
---|
403 | */
|
---|
404 |
|
---|
405 | /*
|
---|
406 | $(iframe_document.documentElement.innerHTML).find('a').each(function() {
|
---|
407 | console.log("data "+$(this).data('href'));
|
---|
408 | console.log("getAttribute "+this.getAttribute('href'));
|
---|
409 | console.log("attr "+$(this).attr('href'));
|
---|
410 | console.log("this.href "+this.href);
|
---|
411 | var original = this.href; //$(this).attr('href');
|
---|
412 | // check if greenstone link ie. starts with format
|
---|
413 | //var original = $(this).data('href');
|
---|
414 | var modified = original.toString().concat("&excerptid=gs_content");
|
---|
415 | console.log("* *");
|
---|
416 | console.log(modified);
|
---|
417 | console.log("* *");
|
---|
418 | //this.href = modified;
|
---|
419 | //$(this).attr('href',modified);
|
---|
420 | //$(this).data('href', modified);
|
---|
421 | $(this).attr({ 'href': modified });
|
---|
422 | //console.log($(this).attr('href'));
|
---|
423 | console.log("data "+$(this).data('href'));
|
---|
424 | console.log("getAttribute "+this.getAttribute('href'));
|
---|
425 | console.log("attr "+$(this).attr('href'));
|
---|
426 | console.log("this.href "+this.href);
|
---|
427 | console.log("***********************");
|
---|
428 | });
|
---|
429 | */
|
---|
430 |
|
---|
431 | /******************************************/
|
---|
432 | /* DRAGGABLES */
|
---|
433 | /******************************************/
|
---|
434 |
|
---|
435 | $(".draggable_gsf_template").draggable({
|
---|
436 | cursor: 'crosshair',
|
---|
437 | connectToSortable: '#formatStatement',
|
---|
438 | helper: 'clone',
|
---|
439 | revert: 'invalid'
|
---|
440 | });
|
---|
441 |
|
---|
442 | $(".draggable_table").draggable({
|
---|
443 | cursor: 'crosshair',
|
---|
444 | connectToSortable: '.gsf_template',
|
---|
445 | helper: 'clone',
|
---|
446 | revert: 'invalid'
|
---|
447 | });
|
---|
448 |
|
---|
449 | $(".draggable_tr").draggable({
|
---|
450 | cursor: 'crosshair',
|
---|
451 | connectToSortable: '.gsf_table',
|
---|
452 | helper: 'clone',
|
---|
453 | revert: 'invalid'
|
---|
454 | })
|
---|
455 |
|
---|
456 | $(".draggable_td").draggable({
|
---|
457 | cursor: 'crosshair',
|
---|
458 | //connectToSortable: '.td',
|
---|
459 | helper: 'clone',
|
---|
460 | revert: 'invalid'
|
---|
461 | })
|
---|
462 |
|
---|
463 | $(".draggable_gsf_text").draggable({
|
---|
464 | cursor: 'crosshair',
|
---|
465 | connectToSortable: '.td-div, .gsf_when, .gsf_otherwise, .gsf_link, .gsf_choose_metadata, .gsf_default',
|
---|
466 | helper: 'clone',
|
---|
467 | revert: 'invalid'
|
---|
468 | });
|
---|
469 |
|
---|
470 | $(".draggable_gsf_choose_metadata").draggable({
|
---|
471 | cursor: 'crosshair',
|
---|
472 | connectToSortable: '.td-div, .gsf_link, .gsf_when, .gsf_otherwise',
|
---|
473 | helper: 'clone',
|
---|
474 | revert: 'invalid'
|
---|
475 | });
|
---|
476 |
|
---|
477 | //$(".element_type_gsf_metadata").draggable({
|
---|
478 | $(".draggable_gsf_metadata").draggable({
|
---|
479 | cursor: 'crosshair',
|
---|
480 | connectToSortable: '.gsf_choose_metadata, .gsf_when, .gsf_otherwise, .gsf_link, .td-div',
|
---|
481 | helper: 'clone',
|
---|
482 | revert: 'invalid'
|
---|
483 | });
|
---|
484 |
|
---|
485 | $(".draggable_gsf_link").draggable({
|
---|
486 | cursor: 'crosshair',
|
---|
487 | connectToSortable: '.td-div, .gsf_when, .gsf_otherwise, .gsf_link',
|
---|
488 | helper: 'clone',
|
---|
489 | revert: 'invalid'
|
---|
490 | });
|
---|
491 |
|
---|
492 | // switch, when, otherwise, icon
|
---|
493 | $(".draggable_gsf_switch").draggable({
|
---|
494 | cursor: 'crosshair',
|
---|
495 | connectToSortable: '.td-div, .gsf_link',
|
---|
496 | helper: 'clone',
|
---|
497 | revert: 'invalid'
|
---|
498 | });
|
---|
499 |
|
---|
500 | $(".draggable_gsf_when").draggable({
|
---|
501 | cursor: 'crosshair',
|
---|
502 | connectToSortable: '.gsf_switch',
|
---|
503 | helper: 'clone',
|
---|
504 | revert: 'invalid'
|
---|
505 | });
|
---|
506 |
|
---|
507 | $(".draggable_gsf_otherwise").draggable({
|
---|
508 | cursor: 'crosshair',
|
---|
509 | connectToSortable: '.gsf_switch',
|
---|
510 | helper: 'clone',
|
---|
511 | revert: 'invalid'
|
---|
512 | });
|
---|
513 |
|
---|
514 | $(".draggable_gsf_icon").draggable({
|
---|
515 | cursor: 'crosshair',
|
---|
516 | connectToSortable: '.td-div, .gsf_link, .gsf_choose, .gsf_when, .gsf_otherwise',
|
---|
517 | helper: 'clone',
|
---|
518 | revert: 'invalid'
|
---|
519 | });
|
---|
520 |
|
---|
521 |
|
---|
522 | /******************************************/
|
---|
523 | /* SORTABLES */
|
---|
524 | /******************************************/
|
---|
525 |
|
---|
526 | bind_td_sortable();
|
---|
527 | bind_all_sortables();
|
---|
528 |
|
---|
529 | $('#formatStatement').sortable({
|
---|
530 | cursor: 'pointer',
|
---|
531 | tolerance: 'pointer',
|
---|
532 | items: '.gsf_template',
|
---|
533 | placeholder:'placeholder',
|
---|
534 | //'nested':'div'
|
---|
535 | stop: function(event, ui) {
|
---|
536 | if (ui.item.hasClass("ui-draggable") && ui.item.hasClass('css_gsf_template')) { replace_with(ui.item,gsf_template_element); }
|
---|
537 | }
|
---|
538 | });
|
---|
539 |
|
---|
540 | $('div.gsf_template').children(".block,.table").slideUp(300);
|
---|
541 | });
|
---|
542 |
|
---|
543 | /*******************************************************************************/
|
---|
544 |
|
---|
545 | function bind_all_sortables()
|
---|
546 | {
|
---|
547 | console.log('function bind_all_sortables()');
|
---|
548 | bind_template_sortable();
|
---|
549 | //bind_table_sortable();
|
---|
550 | //bind_tr_sortable();
|
---|
551 | //bind_td_sortable();
|
---|
552 | bind_choose_metadata_sortable();
|
---|
553 | bind_link_sortable();
|
---|
554 | bind_switch_sortable();
|
---|
555 | bind_when_sortable();
|
---|
556 | bind_otherwise_sortable();
|
---|
557 |
|
---|
558 | bind_tables();
|
---|
559 |
|
---|
560 | bind_block_mouseover();
|
---|
561 | bind_minmax_remove();
|
---|
562 | }
|
---|
563 |
|
---|
564 | function bind_tables()
|
---|
565 | {
|
---|
566 | console.log('function bind_tables()');
|
---|
567 | //$('.tr').resize_tables($(this)); //equalHeights();
|
---|
568 |
|
---|
569 |
|
---|
570 | $('td').click(function () {
|
---|
571 | console.log('td click *');
|
---|
572 | return false;
|
---|
573 | });
|
---|
574 |
|
---|
575 | $(".td-div").resizable({
|
---|
576 | alsoResize: 'parent',
|
---|
577 | //containment: 'parent',
|
---|
578 | handles: 'w,e',
|
---|
579 | stop: function(event, ui) {
|
---|
580 | console.log('Resize table on stop');
|
---|
581 | resize_tables($(this));
|
---|
582 | //$(this).parent().parent().equalHeights();
|
---|
583 | }, });
|
---|
584 |
|
---|
585 | //$(".droppable").sortable({
|
---|
586 | // 'cursor':'pointer',
|
---|
587 | // 'tolerance': 'pointer',
|
---|
588 | // 'items':'.column, .td-div',
|
---|
589 | // 'placeholder':'placeholder'
|
---|
590 | //});
|
---|
591 |
|
---|
592 | $(".droppable").droppable({
|
---|
593 | accept: '.element_type_td',
|
---|
594 | tolerance: 'pointer',
|
---|
595 | activate: function(event, ui) { $(this).addClass("droppable_hl");}, // console.log("droppable activated")},
|
---|
596 | deactivate: function(event, ui) { $(this).removeClass("droppable_hl"); }, // console.log("droppable deactivated")},
|
---|
597 | drop: function(event, ui) {
|
---|
598 | //if ($(this).hasClass("ui-draggable"))
|
---|
599 | //if (ui.helper.hasClass("ui-draggable"))
|
---|
600 | //{
|
---|
601 | var neverempty = document.createElement("div");
|
---|
602 | neverempty.setAttribute("class","neverempty block");
|
---|
603 | neverempty.setAttribute("style","height:50px");
|
---|
604 | neverempty.setAttribute("style","display:block");
|
---|
605 | var text = document.createTextNode('NEVER EMPTY');
|
---|
606 | neverempty.appendChild(text);
|
---|
607 | var td = document.createElement("td");
|
---|
608 | var div = document.createElement("div"); // class=\"td block\" title=\"td-div\"");
|
---|
609 | div.setAttribute("title","td-div");
|
---|
610 | div.setAttribute("class","td-div block");
|
---|
611 | div.setAttribute("style","margin-left:0px");
|
---|
612 | div.setAttribute("width","25px");
|
---|
613 | td.appendChild(div);
|
---|
614 | div.appendChild(neverempty);
|
---|
615 | var sep = document.createElement("td");
|
---|
616 | sep.setAttribute("class","droppable");
|
---|
617 | sep.setAttribute("width","10px");
|
---|
618 | $(this).after(sep);
|
---|
619 | $(this).after(td);
|
---|
620 | bind_tables();
|
---|
621 | resize_tables($(this));
|
---|
622 | bind_td_sortable();
|
---|
623 | bind_block_mouseover();
|
---|
624 | //bind_all_sortables();
|
---|
625 | //}
|
---|
626 | //else
|
---|
627 | //{
|
---|
628 | // console.log("Attempting to add");
|
---|
629 | //$(this).appendTo(ui.draggable[0]);
|
---|
630 | // $(this).prepend(ui.draggable[0]);
|
---|
631 | //$(ui.draggable[0]).appendTo($(this));
|
---|
632 | //}
|
---|
633 | }
|
---|
634 | });
|
---|
635 |
|
---|
636 | }
|
---|
637 |
|
---|
638 | function replace_with(item, me)
|
---|
639 | {
|
---|
640 | // Search me for select
|
---|
641 | if(me.search("select") != -1)
|
---|
642 | {
|
---|
643 | // If select exists, then find CURRENT_SELECT_VALUE
|
---|
644 | var index = me.search(CURRENT_SELECT_VALUE);
|
---|
645 | if(index == -1)
|
---|
646 | console.log("Did not find " + CURRENT_SELECT_VALUE);
|
---|
647 | else
|
---|
648 | console.log("Found " + CURRENT_SELECT_VALUE + " at index " + index);
|
---|
649 | index = index + CURRENT_SELECT_VALUE.length + 1;
|
---|
650 | console.log("Attempt inserting select at new index "+index);
|
---|
651 | a = me.substring(0,index);
|
---|
652 | b = me.substring(index);
|
---|
653 | me = a.concat("selected",b);
|
---|
654 | }
|
---|
655 |
|
---|
656 | //console.log('function replace_with(item, me)');
|
---|
657 | item.replaceWith(me); //'<div class="element element-txt">This text box has been added!</div>');
|
---|
658 | //item.find('select').attr("value", CURRENT_SELECT_VALUE);
|
---|
659 |
|
---|
660 |
|
---|
661 | //if(select != null){
|
---|
662 | // console.log("Attempting to select " + CURRENT_SELECT_VALUE);
|
---|
663 | // console.log("length = "+select.length);
|
---|
664 | // for(index = 0; index < select.length; index++) {
|
---|
665 | // console.log(select[index].value);
|
---|
666 | // if(select[index].value == CURRENT_SELECT_VALUE)
|
---|
667 | // console.log("Found "+CURRENT_SELECT_VALUE+" at index " + index);
|
---|
668 | // select.selectedIndex = index;
|
---|
669 | // }
|
---|
670 | // }
|
---|
671 |
|
---|
672 | resize_tables(item);
|
---|
673 |
|
---|
674 | bind_all_sortables();
|
---|
675 | }
|
---|
676 |
|
---|
677 | function resize_tables(item)
|
---|
678 | {
|
---|
679 | //console.log('function resize_tables(item)');
|
---|
680 | var max_height = 0;
|
---|
681 | (item.parents('.table')).each(function(index) {
|
---|
682 | $(this).children().children().children().each(function() {
|
---|
683 | var sum_one = 0;
|
---|
684 | var sum_two = 0;
|
---|
685 | $(this).children('.block').each(function() { sum_one = sum_one + $(this).height();
|
---|
686 | $(this).children('.block').each(function() { sum_two = sum_two + $(this).height(); } );
|
---|
687 | console.log("My height is " + $(this).height() + ", sum height 2 is " + sum_two);
|
---|
688 | });
|
---|
689 | console.log("My height is " + $(this).height() + ", sum height 1 is " + sum_one);
|
---|
690 | if (sum_two > max_height)
|
---|
691 | max_height = sum_two;
|
---|
692 | });
|
---|
693 | });
|
---|
694 | equalHeights(item,max_height);
|
---|
695 | }
|
---|
696 |
|
---|
697 | function bind_template_sortable()
|
---|
698 | {
|
---|
699 | //console.log('function bind_template_sortable()');
|
---|
700 | $('.gsf_template').sortable({
|
---|
701 | 'cursor':'pointer',
|
---|
702 | 'tolerance': 'pointer',
|
---|
703 | 'items':'.table', //.gsf_choose_metadata, .gsf_metadata',
|
---|
704 | 'placeholder':'placeholder',
|
---|
705 | //'nested':'.gsf:metadata'
|
---|
706 | stop: function(event, ui) {
|
---|
707 | //if (ui.item.hasClass("ui-draggable") && ui.item.hasClass('css_table')) { replace_with(ui.item, "<table border=\"1\" width=\"100%\" height=\"50px\"><tr><td><div class=\"td block\" title=\"td-div\">XXXXXXXXXXXXXXXXXXXXXXXX</div></td></tr></table>"); }
|
---|
708 | if (ui.item.hasClass("ui-draggable") && ui.item.hasClass('draggable_table')) { replace_with(ui.item, "<table class=\"table\" border=\"2\"></table>"); }
|
---|
709 | if (ui.item.hasClass("ui-draggable") && ui.item.hasClass('draggable_gsf_choose_metadata')) { replace_with(ui.item, gsf_choose_metadata_element); }
|
---|
710 | if (ui.item.hasClass("ui-draggable") && ui.item.hasClass('draggable_gsf_metadata')) { replace_with(ui.item, gsf_metadata_element); }
|
---|
711 | if (ui.item.hasClass("ui-draggable") && ui.item.hasClass('draggable_gsf_link')) { replace_with(ui.item, gsf_link_element); }
|
---|
712 | if (ui.item.hasClass("ui-draggable") && ui.item.hasClass('draggable_gsf_switch')) { replace_with(ui.item, gsf_switch_element); }
|
---|
713 | }
|
---|
714 | });
|
---|
715 |
|
---|
716 | $('.gsf_template').click(function () {
|
---|
717 | console.log('gsf_template class click');
|
---|
718 | return false;
|
---|
719 | });
|
---|
720 |
|
---|
721 | }
|
---|
722 |
|
---|
723 | function bind_td_sortable()
|
---|
724 | {
|
---|
725 |
|
---|
726 | $('tr').sortable({
|
---|
727 | 'cursor':'pointer',
|
---|
728 | 'tolerance': 'intersect',
|
---|
729 | 'items':'.column',
|
---|
730 | 'placeholder':'placeholder_td',
|
---|
731 | 'connectWith':'column'});
|
---|
732 |
|
---|
733 | //$('.column').sortable({
|
---|
734 | // connectWith:['.column'],
|
---|
735 | // placeholder: 'placeholder',
|
---|
736 | // items:'td-div'
|
---|
737 | //});
|
---|
738 |
|
---|
739 |
|
---|
740 | //$('.column').sortable({
|
---|
741 | // 'cursor':'pointer',
|
---|
742 | // 'tolerance': 'pointer',
|
---|
743 | // 'items':'.td-div',
|
---|
744 | // 'placeholder':'placeholder',
|
---|
745 | // 'connectWith':'.column'
|
---|
746 | //'nested':'.gsf:metadata'
|
---|
747 | //receive: function(event, ui) { alert("Attempted to receive"); },
|
---|
748 | //stop: function(event, ui) {
|
---|
749 | // if (ui.item.hasClass("ui-draggable") && ui.item.hasClass('element_type_gsf_metadata')) { replace_with(ui.item, gsf_metadata_element); }
|
---|
750 |
|
---|
751 | //});
|
---|
752 |
|
---|
753 | //console.log('function bind_td_sortable()');
|
---|
754 | $('.td-div').sortable({
|
---|
755 | 'cursor':'pointer',
|
---|
756 | 'tolerance': 'pointer',
|
---|
757 | 'items':'.gsf_metadata, .gsf_choose_metadata, .gsf_link, .gsf_switch',
|
---|
758 | 'placeholder':'placeholder',
|
---|
759 | //'connectWith':'.td-div',
|
---|
760 | //'nested':'.gsf:metadata'
|
---|
761 | receive: function(event, ui) { alert("Attempted to receive"); },
|
---|
762 | stop: function(event, ui) {
|
---|
763 | // gsf metadata
|
---|
764 | if (ui.item.hasClass("ui-draggable") && ui.item.hasClass('draggable_gsf_metadata')) { replace_with(ui.item, gsf_metadata_element); }
|
---|
765 | // gsf choose metadata
|
---|
766 | if (ui.item.hasClass("ui-draggable") && ui.item.hasClass('draggable_gsf_choose_metadata')) { replace_with(ui.item, gsf_choose_metadata_element); }
|
---|
767 | // gsf link
|
---|
768 | if (ui.item.hasClass("ui-draggable") && ui.item.hasClass('draggable_gsf_link')) { replace_with(ui.item, gsf_link_element); }
|
---|
769 | // gsf switch
|
---|
770 | if (ui.item.hasClass("ui-draggable") && ui.item.hasClass('draggable_gsf_switch')) { replace_with(ui.item, gsf_switch_element); }
|
---|
771 |
|
---|
772 | }
|
---|
773 |
|
---|
774 | });
|
---|
775 |
|
---|
776 | $('.td-div').click(function () {
|
---|
777 | //console.log('td class click');
|
---|
778 | return true;
|
---|
779 | });
|
---|
780 |
|
---|
781 |
|
---|
782 |
|
---|
783 | }
|
---|
784 |
|
---|
785 |
|
---|
786 | function bind_choose_metadata_sortable()
|
---|
787 | {
|
---|
788 | //console.log('function bind_choose_metadata_sortable()');
|
---|
789 | $('.gsf_choose_metadata').sortable({
|
---|
790 | 'cursor':'pointer',
|
---|
791 | 'tolerance': 'pointer',
|
---|
792 | 'items':'.gsf_metadata, .gsf_text, .gsf_default',
|
---|
793 | 'placeholder':'placeholder',
|
---|
794 | 'connectWith':'.gsf_choose_metadata',
|
---|
795 | //'nested':'.gsf:metadata'
|
---|
796 | stop: function(event, ui) {
|
---|
797 | // gsf metadata
|
---|
798 | if (ui.item.hasClass("ui-draggable") && ui.item.hasClass('draggable_gsf_metadata')) { replace_with(ui.item, gsf_metadata_element); }
|
---|
799 | // gsf text
|
---|
800 | if (ui.item.hasClass("ui-draggable") && ui.item.hasClass('draggable_gsf_text')) { replace_with(ui.item, gsf_text_element); }
|
---|
801 | // gsf default
|
---|
802 | if (ui.item.hasClass("ui-draggable") && ui.item.hasClass('draggable_gsf_default')) { replace_with(ui.item, gsf_default_element); }
|
---|
803 |
|
---|
804 | bind_all_sortables();
|
---|
805 | }
|
---|
806 | });
|
---|
807 | }
|
---|
808 |
|
---|
809 | function bind_link_sortable()
|
---|
810 | {
|
---|
811 | //console.log('function bind_link_sortable()');
|
---|
812 | $('.gsf_link').sortable({
|
---|
813 | 'cursor':'pointer',
|
---|
814 | 'tolerance': 'pointer',
|
---|
815 | 'items':'.leaf, .gsf_link, .gsf_switch, .gsf_choose',
|
---|
816 | 'placeholder':'placeholder',
|
---|
817 | 'connectWith':'.gsf_link',
|
---|
818 | //'nested':'.gsf:metadata'
|
---|
819 | stop: function(event, ui) {
|
---|
820 | // gsf icon
|
---|
821 | if (ui.item.hasClass("ui-draggable") && ui.item.hasClass('draggable_gsf_icon')) { replace_with(ui.item, gsf_icon_element); }
|
---|
822 | // gsf text
|
---|
823 | if (ui.item.hasClass("ui-draggable") && ui.item.hasClass('draggable_gsf_text')) { replace_with(ui.item, "<input type=\"text\" name=\"rawtextinput\" size=\"10\"/>"); }
|
---|
824 | // gsf metadata
|
---|
825 | if (ui.item.hasClass("ui-draggable") && ui.item.hasClass('draggable_gsf_metadata')) { replace_with(ui.item, gsf_metadata_element); }
|
---|
826 | // gsf link
|
---|
827 | if (ui.item.hasClass("ui-draggable") && ui.item.hasClass('draggable_gsf_link')) { replace_with(ui.item, gsf_link_element); }
|
---|
828 | // gsf switch
|
---|
829 | if (ui.item.hasClass("ui-draggable") && ui.item.hasClass('draggable_gsf_switch')) { replace_with(ui.item, gsf_switch_element); }
|
---|
830 | // gsf choose
|
---|
831 | if (ui.item.hasClass("ui-draggable") && ui.item.hasClass('draggable_gsf_choose_metadata')) { replace_with(ui.item, gsf_choose_metadata_element); }
|
---|
832 | }
|
---|
833 | });
|
---|
834 | }
|
---|
835 |
|
---|
836 | function bind_switch_sortable()
|
---|
837 | {
|
---|
838 | //console.log('function bind_switch_sortable()');
|
---|
839 | $('.gsf_switch').sortable({
|
---|
840 | 'cursor':'pointer',
|
---|
841 | 'tolerance': 'pointer',
|
---|
842 | 'items':'.gsf_metadata, .gsf_when, .gsf_otherwise, .gsf_text',
|
---|
843 | 'placeholder':'placeholder',
|
---|
844 | 'connectWith':'.gsf_switch',
|
---|
845 | //'nested':'.gsf:metadata'
|
---|
846 | stop: function(event, ui) {
|
---|
847 | // gsf when
|
---|
848 | if (ui.item.hasClass("ui-draggable") && ui.item.hasClass('draggable_gsf_when')) { replace_with(ui.item, gsf_when_element); }
|
---|
849 | // gsf otherwise
|
---|
850 | if (ui.item.hasClass("ui-draggable") && ui.item.hasClass('draggable_gsf_otherwise')) { replace_with(ui.item, gsf_otherwise_element); }
|
---|
851 | // gsf metadata
|
---|
852 | if (ui.item.hasClass("ui-draggable") && ui.item.hasClass('draggable_gsf_metadata')) { replace_with(ui.item, gsf_metadata_element); }
|
---|
853 | // gsf text
|
---|
854 | if (ui.item.hasClass("ui-draggable") && ui.item.hasClass('draggable_gsf_text')) { replace_with(ui.item, gsf_text_element); }
|
---|
855 | }
|
---|
856 | });
|
---|
857 | }
|
---|
858 |
|
---|
859 | function bind_when_sortable()
|
---|
860 | {
|
---|
861 | //console.log('function bind_when_sortable()');
|
---|
862 | $('.gsf_when').sortable({
|
---|
863 | 'cursor':'pointer',
|
---|
864 | 'tolerance': 'pointer',
|
---|
865 | 'items':'.leaf, .gsf_link, .gsf_choose',
|
---|
866 | 'placeholder':'placeholder',
|
---|
867 | //'nested':'.gsf:metadata'
|
---|
868 | stop: function(event, ui) {
|
---|
869 | // gsf metadata
|
---|
870 | if (ui.item.hasClass("ui-draggable") && ui.item.hasClass('draggable_gsf_metadata')) { replace_with(ui.item, gsf_metadata_element); }
|
---|
871 | // gsf icon
|
---|
872 | if (ui.item.hasClass("ui-draggable") && ui.item.hasClass('draggable_gsf_icon')) { replace_with(ui.item, gsf_icon_element); }
|
---|
873 | // gsf text
|
---|
874 | if (ui.item.hasClass("ui-draggable") && ui.item.hasClass('draggable_gsf_text')) { replace_with(ui.item, gsf_text_element); }
|
---|
875 | // gsf link
|
---|
876 | if (ui.item.hasClass("ui-draggable") && ui.item.hasClass('draggable_gsf_link')) { replace_with(ui.item, gsf_link_element); }
|
---|
877 | // gsf choose
|
---|
878 | if (ui.item.hasClass("ui-draggable") && ui.item.hasClass('draggable_gsf_choose')) { replace_with(ui.item, gsf_choose_element); }
|
---|
879 | }
|
---|
880 | });
|
---|
881 | }
|
---|
882 |
|
---|
883 | function bind_otherwise_sortable()
|
---|
884 | {
|
---|
885 | //console.log('function bind_otherwise_sortable()');
|
---|
886 | $('.gsf_otherwise').sortable({
|
---|
887 | 'cursor':'pointer',
|
---|
888 | 'tolerance': 'pointer',
|
---|
889 | 'items':'.leaf, .gsf_link, .gsf_choose',
|
---|
890 | 'placeholder':'placeholder',
|
---|
891 | //'nested':'.gsf:metadata'
|
---|
892 | stop: function(event, ui) {
|
---|
893 | // gsf metadata
|
---|
894 | if (ui.item.hasClass("ui-draggable") && ui.item.hasClass('draggable_gsf_metadata')) { replace_with(ui.item, gsf_metadata_element); }
|
---|
895 | // gsf text
|
---|
896 | if (ui.item.hasClass("ui-draggable") && ui.item.hasClass('draggable_text')) { replace_with(ui.item, "<input type=\"text\" name=\"rawtextinput\" size=\"10\"/>"); }
|
---|
897 | // gsf icon
|
---|
898 | if (ui.item.hasClass("ui-draggable") && ui.item.hasClass('draggable_gsf_icon')) { replace_with(ui.item, gsf_icon_element); }
|
---|
899 | // gsf link
|
---|
900 | if (ui.item.hasClass("ui-draggable") && ui.item.hasClass('draggable_gsf_link')) { replace_with(ui.item, gsf_link_element); }
|
---|
901 | // gsf choose
|
---|
902 | if (ui.item.hasClass("ui-draggable") && ui.item.hasClass('draggable_gsf_choose')) { replace_with(ui.item, gsf_choose_element); }
|
---|
903 | }
|
---|
904 | });
|
---|
905 | }
|
---|
906 |
|
---|
907 | function bind_block_mouseover()
|
---|
908 | {
|
---|
909 | //console.log('function bind_block_mouseover()');
|
---|
910 | $(".block").mouseover(function()
|
---|
911 | {
|
---|
912 | $(this).parents().css("border", "");
|
---|
913 | $(this).css("border", "2px solid blue");
|
---|
914 | return false;
|
---|
915 | }).mouseout(function(){
|
---|
916 | $(this).css("border", "");
|
---|
917 | return false;
|
---|
918 | });
|
---|
919 | }
|
---|
920 |
|
---|
921 | function bind_minmax_remove()
|
---|
922 | {
|
---|
923 | console.log('function bind_minmax_remove()');
|
---|
924 | $('a.minmax').bind('click', toggleContent);
|
---|
925 | $('a.remove').bind('click', removeContent);
|
---|
926 | };
|
---|
927 |
|
---|
928 | var removeContent = (function () {
|
---|
929 | //console.log('var removeContent = (function ()');
|
---|
930 | // this -> a -> td -> tr -> tbody -> table -> div
|
---|
931 | //$(this).parent().parent().parent().parent().parent().remove();
|
---|
932 | $(this).closest(".block").remove();
|
---|
933 | });
|
---|
934 |
|
---|
935 |
|
---|
936 | var toggleContent = function(e)
|
---|
937 | {
|
---|
938 | //console.log('var toggleContent = function(e)');
|
---|
939 | console.log('parent: ' + $(this).html());
|
---|
940 | if ($(this).html() == '[+]'){ //targetContent.css('display') == 'none') {
|
---|
941 | //$(this).parent().parent().parent().parent().parent().children(".block,.table").slideDown(300);
|
---|
942 | //$(this).parents().children(".block,.table").stopPropagation().slideDown(300);
|
---|
943 | //var x = $(this).parent().parent().parent().parent().parent();
|
---|
944 | //var y = $(this).parent().parent().parent().parent().parent().children(".block,.table");
|
---|
945 | //var z = $(this).closest(".block").children(".table, .block");
|
---|
946 | $(this).closest(".block").children(".table, .block").slideDown(300);
|
---|
947 | $(this).html('[-]');
|
---|
948 | $(this).removeClass("ui-icon-plusthick");
|
---|
949 | $(this).addClass("ui-icon-minusthick");
|
---|
950 | } else {
|
---|
951 | //$(this).parent().parent().parent().parent().parent().children(".block,.table").slideUp(300);
|
---|
952 | //$(this).parents().children(".block,.table").slideUp(300);
|
---|
953 | $(this).closest(".block").children(".table, .block").slideUp(300);
|
---|
954 | $(this).html('[+]');
|
---|
955 | $(this).removeClass("ui-icon-minusthick");
|
---|
956 | $(this).addClass("ui-icon-plusthick");
|
---|
957 | }
|
---|
958 | return false;
|
---|
959 | };
|
---|
960 |
|
---|
961 | function serialize(s)
|
---|
962 | {
|
---|
963 | serial = $.SortSerialize(s);
|
---|
964 | alert(serial.hash);
|
---|
965 | };
|
---|
966 |
|
---|
967 | function equalHeights(item, height) {
|
---|
968 | //console.log('function equalHeights(item, height)');
|
---|
969 | (item.parents('.table')).each(function(index) {
|
---|
970 | $(this).children().children().children().each(function() {
|
---|
971 | $(this).height(height);
|
---|
972 | $(this).children().height(height);
|
---|
973 | });
|
---|
974 | });
|
---|
975 | };
|
---|
976 |
|
---|