source: main/trunk/greenstone3/web/interfaces/oran/js/gui_div.js@ 22474

Last change on this file since 22474 was 22474, checked in by sjb48, 14 years ago

Added div tags to metadata components. Each div can be expanded/contracted and removed. Drag and drop partially works but currently has issues. Wrote some javascript to implement this.

File size: 2.0 KB
Line 
1$(document).ready(function(){
2
3 //function () {
4 $('a.minmax').bind('click', toggleContent);
5 $('a.remove').bind('click', removeContent);
6 $('div.blockWrapper').sortable(
7 {
8 accept: 'block',
9 helperclass: 'sortHelper',
10 activeclass : 'sortableactive',
11 hoverclass : 'sortablehover',
12 handle: 'div.header',
13 tolerance: 'pointer',
14 onChange : function(ser)
15 {
16 },
17 onStart : function()
18 {
19 $.iAutoscroller.start(this, document.getElementsByTagName('body'));
20 },
21 onStop : function()
22 {
23 $.iAutoscroller.stop();
24 }
25 }
26 );
27 //}
28//};
29
30 $(".block").mouseover(function() {
31 //$(this).parents().animate({ backgroundColor: "white" }, 500);
32 //$(this).animate({ backgroundColor: "yellow" }, 50);
33 $(this).parents().css("border", "");
34 $(this).css("border", "1px solid blue");
35 }).mouseout(function(){
36 //$(this).animate({ backgroundColor: "white" }, 500);
37 $(this).css("border", "");
38 });
39
40
41 $("button").click(function () {
42 //var parentTag = $(this).parent().get(0).titleName;
43 //alert("Removing div " + parentTag);
44 $(this).parent().parent().remove();
45 });
46
47});
48
49var removeContent = (function () {
50 //var parentTag = $(this).parent().get(0).titleName;
51 //alert("Removing div " + parentTag);
52 $(this).parent().parent().remove();
53 });
54
55
56var toggleContent = function(e)
57{
58 var targetContent = $('div.content', this.parentNode.parentNode);
59 if (targetContent.css('display') == 'none') {
60 targetContent.slideDown(300);
61 $(this).html('[-]');
62 } else {
63 targetContent.slideUp(300);
64 $(this).html('[+]');
65 }
66 return false;
67};
68
69function serialize(s)
70{
71 serial = $.SortSerialize(s);
72 alert(serial.hash);
73};
74
75
Note: See TracBrowser for help on using the repository browser.