Changeset 11385 for extensions/set_plugins/js/field_set.js
- Timestamp:
- Jun 15, 2011, 7:07:49 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/set_plugins/js/field_set.js
r11276 r11385 1 function raffraichir() { 2 n = 1; 3 // jQuery("#form_set_plugins").submit(); 4 } 5 6 7 1 8 jQuery("fieldset").hide(); 2 9 jQuery(document).ready(function () { … … 10 17 } 11 18 var h_min = 0; 19 var liste_des_plugins = {}; 20 jQuery(window).load(function () { 21 if (jQuery(".titrePage").length >= 1) { 22 if (jQuery("span.sort").length >= 1) 23 jQuery("#titrePage").before(jQuery("span.sort")); 24 jQuery(".titrePage ").hide(); 25 } 12 26 13 jQuery(window).load(function () {14 27 if (jQuery("fieldset").length >= 1) { 15 16 jQuery("div.titrePage h2").parent().hide();17 18 28 var reg = new RegExp("[,]", "g"); 19 29 liste_visible = jQuery("input[name=list_visible]").val(); 20 n1 = liste_visible; 21 liste = n1.split(reg); 30 if (typeof liste_visible == "undefined") { 31 liste_visible = "on,on,on,on"; 32 jQuery("input[name=list_visible]").val(liste_visible); 33 } 34 liste = liste_visible.split(reg); 22 35 reg = new RegExp("['off']", "g"); 23 36 jQuery("fieldset").each( … … 35 48 liste[i] = "off"; 36 49 37 h_min = jQuery("#" + this.id + ' legend').height();38 jQuery(this).height(h_min + 5);50 h_min = jQuery("#" + this.id + ' legend').height(); 51 jQuery(this).height(h_min + 0); 39 52 40 53 jQuery("#" + this.id + ' legend').prepend( … … 58 71 59 72 n = jQuery(this).parent().hasClass("visible"); 60 jQuery(this).css("color", "red");73 // jQuery(this).css("color", "red"); 61 74 62 75 i = jQuery(jQuery(this).parent()).attr("rel"); 63 76 liste_visible = jQuery("input[name=list_visible]").val(); 64 liste = liste_visible.split(","); 77 if (typeof liste_visible == "undefined") { 78 liste_visible = "on,on,on,on"; 79 jQuery("input[name=list_visible]").val(liste_visible); 80 } 81 // src = jQuery(this).find("img").attr("src"); 65 82 if (n) { 66 jQuery(this).parent().height(h_min + 5);83 jQuery(this).parent().height(h_min + 0); 67 84 jQuery(this).parent().removeClass("visible"); 68 85 liste[i] = "off"; 86 jQuery(this).find("img").attr({ 87 src: plus_path 88 89 }); 69 90 } 70 91 else { … … 72 93 jQuery(this).parent().addClass("visible"); 73 94 liste[i] = "on"; 95 jQuery(this).find("img").attr({ 96 src: minus_path 97 98 }); 74 99 } 75 76 77 100 val = liste.join(","); 78 101 jQuery("input[name=list_visible]").val(val); 102 jQuery('#set').val("true"); 79 103 80 104 jQuery.ajax({ 81 105 type: "POST", 82 106 async: true, 83 data: "list_visible=" + val,107 data: { list_visible: val, set: "true" }, 84 108 success: function (msg) { 85 jQuery("#form_set_plugins").submit();109 // jQuery("#form_set_plugins").submit(); 86 110 } 87 111 }); … … 97 121 jQuery(this).click(function (event) { 98 122 jQuery(this).css("color", "red"); 99 action = jQuery(this).attr('rel'); 100 if (action == "Deactivate") 101 liste_plugins = jQuery(this).parent().parent().text(); 102 else if (action == "Activate") 103 liste_plugins = jQuery(this).parent().parent().text(); 104 123 jQuery('#set').val("true"); 105 124 }); // click 106 125 107 126 }); //each 108 109 127 jQuery("input[name=list_visible]").val(liste.join(",")); 110 128 jQuery("fieldset").show(); 111 129 } // fielset 112 130 //==================================================================== 113 jQuery("td a").click(function (event) { 114 l1 = jQuery('#liste').text(); 115 l = l1.split(new RegExp("\n", "g")); 131 jQuery(".pluginBox a").click(function (event) { 132 var link = event.target.href; 133 if (link.indexOf("?") != -1) { 134 var query = link.split("?")[1]; 135 eval("query = {" + query.replace(/&/ig, "\",").replace(/=/ig, ":\"") + "\"};"); 136 jQuery('#add_plugins').val(query.plugin); 137 jQuery('#set').val("true"); 138 val = liste.join(","); 116 139 117 list = jQuery('liste_plugins'); 140 jQuery.ajax({ 141 type: "POST", 142 async: true, 143 data: { add_plugins: query.plugin, 144 set: "true", 145 list_visible: val 146 } 147 , 148 success: function (data) { 149 // jQuery("#form_set_plugins").submit(); 118 150 119 var reg = new RegExp("[?]", "g"); 120 ret_args = new Array; 121 var args = event.target.href.split(reg)[1]; 122 reg = new RegExp("[&]", "g"); 123 var tableau = args.split(reg); 124 for (i = 0; i < tableau.length; i++) { 125 vals = tableau[i].split("="); 126 ret_args[vals[0]] = vals[1]; 151 } 152 }); 153 127 154 } 128 if (ret_args['action'] == "deactivate") {129 130 list = jQuery('list');131 n = 1;132 } else if (ret_args['action'] == "activate") {133 134 list = jQuery('liste_plugins');135 n = 0;136 }137 138 155 139 156 }) 140 157 141 158 }); // load 142 }); //ready159 }); //ready 143 160
Note: See TracChangeset
for help on using the changeset viewer.