[11385] | 1 | function raffraichir() { |
---|
| 2 | n = 1; |
---|
| 3 | // jQuery("#form_set_plugins").submit(); |
---|
| 4 | } |
---|
[11497] | 5 | |
---|
| 6 | //=============================================================================== |
---|
| 7 | function send_val(datas) { |
---|
| 8 | jQuery.ajax({ |
---|
| 9 | method: 'GET', |
---|
| 10 | // url: get_post, |
---|
| 11 | data: datas, |
---|
| 12 | async: true, |
---|
| 13 | dataType: 'json', |
---|
| 14 | success: function (data) { |
---|
| 15 | if (jQuery("#progressbar").length > 0) { |
---|
| 16 | |
---|
| 17 | } else |
---|
| 18 | jQuery("#titrePage").before( |
---|
| 19 | '<img id="progressbar" alt = "" width="300px" title = ""' + |
---|
| 20 | 'src = "./plugins/set_plugins/js/icon/ajax-loader-bar.gif"' + '>' |
---|
| 21 | ); |
---|
| 22 | // location.reload(); |
---|
| 23 | if (!data) return; |
---|
| 24 | |
---|
| 25 | if (data['liste_plugins'] != undefined) |
---|
| 26 | liste_des_plugins_activés = data['liste_plugins']; |
---|
| 27 | if (data['config']['liste_visible']) |
---|
| 28 | jQuery("#liste_visible").val(data['config']['liste_visible']); |
---|
| 29 | |
---|
| 30 | } |
---|
| 31 | }); |
---|
| 32 | } //send val |
---|
| 33 | //=================================================================================== |
---|
| 34 | |
---|
[11462] | 35 | jQuery().ready(function () { |
---|
| 36 | jQuery('.cluetip').tipTip({ maxWidth:'600px' ,'delay': 0, 'fadeIn': 200, 'fadeOut': 200 }); |
---|
[11484] | 37 | |
---|
| 38 | }); var post = {}; |
---|
[11276] | 39 | jQuery("fieldset").hide(); |
---|
| 40 | jQuery(document).ready(function () { |
---|
| 41 | jQuery(window).unload(function () { |
---|
[11497] | 42 | |
---|
[11276] | 43 | }); |
---|
| 44 | if (typeof plus_path == "undefined") { |
---|
| 45 | var plus_path = './plugins/set_plugins/js/icon/plus.png'; |
---|
| 46 | var minus_path = './plugins/set_plugins/js/icon/minus.png'; |
---|
| 47 | } |
---|
| 48 | var h_min = 0; |
---|
[11497] | 49 | var liste_des_plugins_activés = new Array(); |
---|
[11484] | 50 | |
---|
| 51 | jQuery(window).load(function (event) { |
---|
| 52 | n = post; |
---|
| 53 | var link = event.target.location.href; |
---|
| 54 | if (link.indexOf("?") != -1) { |
---|
| 55 | link = link.replace(/\"/ig, ""); |
---|
| 56 | var query = link.split("?")[1]; |
---|
| 57 | eval("query = {" + query.replace(/&/ig, "\",").replace(/=/ig, ":\"") + "\"};"); |
---|
| 58 | } |
---|
| 59 | |
---|
| 60 | if (query.plugin) |
---|
| 61 | jQuery('#add_plugins').val(query.plugin); |
---|
| 62 | |
---|
[11385] | 63 | if (jQuery(".titrePage").length >= 1) { |
---|
| 64 | if (jQuery("span.sort").length >= 1) |
---|
| 65 | jQuery("#titrePage").before(jQuery("span.sort")); |
---|
| 66 | jQuery(".titrePage ").hide(); |
---|
| 67 | } |
---|
[11249] | 68 | |
---|
[11276] | 69 | if (jQuery("fieldset").length >= 1) { |
---|
| 70 | var reg = new RegExp("[,]", "g"); |
---|
| 71 | liste_visible = jQuery("input[name=list_visible]").val(); |
---|
[11385] | 72 | if (typeof liste_visible == "undefined") { |
---|
| 73 | liste_visible = "on,on,on,on"; |
---|
| 74 | jQuery("input[name=list_visible]").val(liste_visible); |
---|
| 75 | } |
---|
[11497] | 76 | if (typeof (liste_visible)=="string") |
---|
| 77 | liste_visible = liste_visible.split(reg); |
---|
[11276] | 78 | reg = new RegExp("['off']", "g"); |
---|
[11462] | 79 | h_min = jQuery("fieldset legend").height(); |
---|
| 80 | h_min = 0; |
---|
[11497] | 81 | jQuery("fieldset").each(function (i) { |
---|
| 82 | id0 = jQuery(this).attr("id"); |
---|
| 83 | if (id0 == "") jQuery(this).attr("id", "fieldset_" + i); |
---|
| 84 | jQuery(this).attr("rel", i); |
---|
| 85 | if (!jQuery(this).hasClass("field_set")) |
---|
| 86 | jQuery(this).addClass("field_set"); |
---|
| 87 | if (liste_visible[i] == "off") { |
---|
| 88 | liste_visible[i] = "off"; |
---|
| 89 | jQuery(this).height(h_min + 0); |
---|
| 90 | jQuery("#" + this.id + ' legend').prepend( |
---|
| 91 | '<img alt = "" title = ""' + 'src = "' + plus_path + '"' + '> ' |
---|
| 92 | ); |
---|
| 93 | } else { |
---|
| 94 | liste_visible[i] = "on"; |
---|
| 95 | jQuery(this).addClass("visible"); |
---|
| 96 | jQuery("#" + this.id + ' legend').prepend( |
---|
| 97 | '<img alt = "" title = ""' + |
---|
| 98 | 'src = "' + minus_path + '"' + '> ' |
---|
| 99 | ); |
---|
| 100 | } |
---|
| 101 | jQuery("#" + this.id + ' legend').css('cursor', 'pointer'); |
---|
| 102 | id0 = jQuery(this).attr("id"); |
---|
[11249] | 103 | |
---|
[11497] | 104 | jQuery("#" + id0 + ' legend').click(function (event) { |
---|
| 105 | n = jQuery(this).parent().hasClass("visible"); |
---|
| 106 | i = jQuery(jQuery(this).parent()).attr("rel"); |
---|
[11249] | 107 | |
---|
[11497] | 108 | if (typeof liste_visible == "undefined") { |
---|
| 109 | liste_visible = "on,on,on,on"; |
---|
| 110 | jQuery("input[name=list_visible]").val(liste_visible); |
---|
| 111 | } |
---|
| 112 | liste_visible = jQuery("input[name=list_visible]").val().split(","); |
---|
| 113 | // src = jQuery(this).find("img").attr("src"); |
---|
| 114 | if (n) { |
---|
| 115 | jQuery(this).parent().height(h_min + 0); |
---|
| 116 | jQuery(this).parent().removeClass("visible"); |
---|
| 117 | liste_visible[i] = "off"; |
---|
| 118 | jQuery(this).find("img").attr({ |
---|
| 119 | src: plus_path |
---|
| 120 | }); |
---|
[11276] | 121 | } else { |
---|
[11497] | 122 | jQuery(this).parent().css("height", "auto"); |
---|
| 123 | jQuery(this).parent().addClass("visible"); |
---|
| 124 | liste_visible[i] = "on"; |
---|
| 125 | jQuery(this).find("img").attr({ |
---|
| 126 | src: minus_path |
---|
| 127 | }); |
---|
[11276] | 128 | } |
---|
[11497] | 129 | val = liste_visible.join(","); |
---|
| 130 | jQuery("input[name=list_visible]").val(val); |
---|
| 131 | |
---|
| 132 | jQuery("#set").click(); |
---|
[11249] | 133 | |
---|
| 134 | |
---|
[11497] | 135 | }); // click |
---|
| 136 | }); //each fieldset |
---|
[11484] | 137 | //========================================================== |
---|
[11249] | 138 | |
---|
[11484] | 139 | var liste_action = { active: "", deactive: "" }; |
---|
[11497] | 140 | jQuery("input[name=list_visible]").val(liste_visible.join(",")); |
---|
[11276] | 141 | jQuery("fieldset").show(); |
---|
| 142 | } // fielset |
---|
| 143 | //==================================================================== |
---|
[11484] | 144 | jQuery(".plugin_list").each(function (i) { |
---|
[11497] | 145 | liste_des_plugins_activés.push(jQuery(this).attr('id')); |
---|
| 146 | }); |
---|
| 147 | |
---|
[11484] | 148 | //============================================================== |
---|
[11497] | 149 | jQuery("input.button").each( |
---|
[11462] | 150 | function (i) { |
---|
| 151 | jQuery(this).click(function (event) { |
---|
| 152 | jQuery(this).css("color", "red"); |
---|
| 153 | jQuery('#set').val("true"); |
---|
[11497] | 154 | jQuery("#titrePage").before( |
---|
| 155 | '<img id="progressbar" alt = "" width="300px" title = ""' + |
---|
| 156 | 'src = "./plugins/set_plugins/js/icon/ajax-loader-bar.gif"' + '>' |
---|
| 157 | ); |
---|
| 158 | send_val({liste_visible:liste_visible, |
---|
| 159 | set: "true" |
---|
| 160 | |
---|
| 161 | }); |
---|
| 162 | |
---|
[11462] | 163 | }); // click |
---|
| 164 | |
---|
| 165 | }); //each |
---|
[11484] | 166 | |
---|
[11385] | 167 | jQuery(".pluginBox a").click(function (event) { |
---|
| 168 | var link = event.target.href; |
---|
| 169 | if (link.indexOf("?") != -1) { |
---|
| 170 | var query = link.split("?")[1]; |
---|
| 171 | eval("query = {" + query.replace(/&/ig, "\",").replace(/=/ig, ":\"") + "\"};"); |
---|
| 172 | jQuery('#add_plugins').val(query.plugin); |
---|
| 173 | jQuery('#set').val("true"); |
---|
[11484] | 174 | n = query.pwg_token; |
---|
| 175 | action = query.action; |
---|
[11497] | 176 | val = liste_visible.join(","); |
---|
| 177 | val2 = liste_des_plugins_activés.join(","); |
---|
| 178 | send_val({ |
---|
| 179 | liste_des_plugins_activés: liste_des_plugins_activés, |
---|
| 180 | add_plugins: query.plugin, |
---|
| 181 | set: "true", |
---|
| 182 | action: query.action |
---|
[11385] | 183 | }); |
---|
[11484] | 184 | /* */ |
---|
[11276] | 185 | } |
---|
| 186 | |
---|
[11497] | 187 | }); |
---|
[11276] | 188 | }); // load |
---|
[11497] | 189 | }); //ready |
---|
[11249] | 190 | |
---|