[(#REM) ACS (Plugin Spip) http://acs.geomaticien.org Copyright Daniel FAIVRE, 2007-2012 Copyleft: licence GPL - Cf. LICENCES.txt JS interface d'admin d'ACS - ACS admin GUI ]#HTTP_HEADER{'Content-Type: text/javascript'} [(#INCLURE{fond=javascript/acs_lib.js})] function detail() { imgp = $(".imgp_spip_params").attr("src"); if (imgp) { plon = $(".imgon_spip_params").attr("src"); if (imgp == plon) return "&detail=2"; } return ""; } function mode_source() { if ($("#mode_source").attr("name") == "srcon") return "&mode=source"; return ""; } [(#REM) creation d'une nouvelle instance d'un composant] var instance_create_input = false; function instance_create(nic) { if (instance_create_input == false) { $("#form_instance_create").append(''); instance_create_input = true; return false; } return true; } [(#REM) suppression de l'instance active d'un composant] function instance_delete(msg) { if (confirm(msg)) return true; else return false; } jQuery(document).ready( function() { acs_ecrire_init(false); onAjaxLoad(acs_ecrire_init); } ); function acs_ecrire_init(ajax) { initWidgets(); if (detail() != "&detail=2") jQuery(".pliable").each(function(i) {jQuery(this).hide();}); else jQuery(".pliable:not(.spip_params)").each(function(i) {jQuery(this).hide();}); [(#REM) Attribue une position absolue à l'aide contextuelle ]jQuery(".contexthelp").css('position', 'absolute'); if (ajax == false) { [(#REM) on document ready] [(#REM) Retourne les infos sur la page avec le niveau de détail défini par le plieur get page infos with detail level setted by plieur ]jQuery(".page_lien").each( function(i,link) { link.onclick = function(e) { AjaxSqueeze("?exec=acs_page_get_infos&pg=" + link.title + detail() + mode_source(), "page_infos"); document.location.href = "#page_infos"; return false; } } ); [(#ENV{jquery_version}|=={1}|?{ [(#INCLURE{javascript/acs_dragdrop.js})], [(#INCLURE{javascript/acs_dragdrop_for_older_jquery.js})] })] } else { [(#REM) on ajax load] [(#REM) Donne leur fonction onclick aux plieurs (générique)] jQuery(".acs_plieur").each( function(i, plieur) { var cap = plieur.name.substr(7); //classe à plier if ((typeof plieur.onclick) != "undefined") { plieur.clic = plieur.onclick.toString(); } plieur.onclick = function(e) { e.preventDefault(); e.stopPropagation(); imgp = jQuery(".imgp_" + cap).attr("src"); ploff = jQuery(".imgoff_" + cap).attr("src"); plon = jQuery(".imgon_" + cap).attr("src"); if (imgp == ploff) jQuery(".imgp_" + cap).attr("src", plon) else jQuery(".imgp_" + cap).attr("src", ploff) jQuery("." + cap).each( function(i, cap) { jQuery(cap).slideToggle("slow"); } ); if ((typeof plieur.clic) != "undefined") { eval(plieur.clic + ";onclick(e);"); } return false; } } ); $("#mode_source").each( function(i, link) { link.onclick = function(e) { AjaxSqueeze("?exec=acs_page_get_infos&pg=" + link.title + detail() + "&mode=source", "page_infos"); document.location.href = "#page_infos"; return false; } } ); $("#mode_schema").each( function(i, link) { link.onclick = function(e) { AjaxSqueeze("?exec=acs_page_get_infos&pg=" + link.title + detail() + "&mode=schema", "page_infos"); document.location.href = "#page_infos"; return false; } } ); } }