3 { init_reference_select();
10 var last_document_id = 1;
12 function select_groupe(id_groupe)
14 "<label for=\"album\">album</label>"
16 + "<select name=\"album\" id=\"album\">"
17 + "<option value=\"0\" selected=\"selected\">hors album</option>";
18 for(var id_album in albums["" + id_groupe])
20 "<option value=\"" + id_album + "\">" + albums["" + id_groupe]["" + id_album] + "</option>";
25 $("#album_select").html(content);
28 function select_morceaux_groupe(id_groupe)
30 "<label for=\"morceau\">morceau</label>"
32 + "<select name=\"morceau\" id=\"morceau\">"
33 + "<option value=\"0\" selected=\"selected\">hors morceau</option>";
34 for(var id_morceau in morceaux["" + id_groupe])
36 "<option value=\"" + id_morceau + "\">" + morceaux["" + id_groupe]["" + id_morceau] + "</option>";
41 $("#morceau_select").html(content);
44 function init_reference_select()
45 { $("#is_derivation").click
47 { if($(this).get(0).checked) $("#derivation_input").slideDown(200);
48 else $("#derivation_input").slideUp(200);
51 $("#is_reference").click
53 { if($(this).get(0).checked)
54 { $("#original_form").slideUp(200);
55 $("#reference_form").slideDown(200);
58 { $("#reference_form").slideUp(200);
59 $("#original_form").slideDown(200);
65 function add_document()
67 var id_document = last_document_id;
68 var content = "<div class=\"document\" id=\"document_" + id_document + "\">\n"
69 + " <div class=\"delete\"><a href=\"#\" onclick=\"del_document('" + id_document + "'); return false;\">Enlever ce fichier</a></div>\n"
70 + " <label for=\"document_nom_" + id_document + "\">nom</label>\n"
71 + " <input type=\"text\" class=\"long_text\" name=\"document_nom_" + id_document + "\" id=\"document_nom_" + id_document + "\" value=\"\" />\n"
72 + " <div class=\"clear\"><!-- --></div>\n"
73 + " <label for=\"document_url_" + id_document + "\">url</label>\n"
74 + " <input type=\"text\" size=\"48\" name=\"document_url_" + id_document + "\" id=\"document_url_" + id_document + "\" value=\"\" />\n"
76 $("#documents").append(content);
79 function del_document(id_document)
80 { $("#document_" + id_document).remove();
83 function init_tinymce()
86 { tinyMCE.execCommand("mceAddControl", true, $(this).attr("id"));
91 function init_toggle_edit_derivation_content(id_derivation)
92 { $("#derivation_edit_" + id_derivation + " .use_edit_derivation_content").click
94 { var id_derivation_content = $(this).attr("id");
95 if(id_derivation_content.length > 28)
96 { id_derivation_content = id_derivation_content.substr(28);
97 if($(this).get(0).checked)
98 { $("#derivation_edit_" + id_derivation_content + " span").slideDown(200);
101 { $("#derivation_edit_" + id_derivation_content + " span").slideUp(200);
108 function init_derivations()
109 { if(typeof(derivations) != "undefined")
110 { for(var id_derivation in derivations)
111 { init_toggle_edit_derivation_content(id_derivation);
112 $("#derivation_infos_" + id_derivation).slideDown(200);
117 function init_toggle_edit_reference_content(){
118 $("#reference_edit .use_edit_reference_content").click(
120 if($(this).get(0).checked){
121 $("#reference_edit span").slideDown(200);
124 $("#reference_edit span").slideUp(200);
130 function init_reference()
131 { init_toggle_edit_reference_content();
132 if(typeof(is_reference) != "undefined")
133 { if(is_reference) $("#reference_form").slideDown(200);
137 function add_derivation(id_source, id_source_derivation)
139 { index_derivation++;
140 id_source_derivation = index_derivation;
143 ( { url: mw_site_url + "index.php?e=content/sources/xml_form&id=" + id_source + "&derivation=" + id_source_derivation + "&form=" + (id_source ? "edit" : "add"),
145 success: function(content)
146 { $("#derivations_items").append(content);
147 init_toggle_edit_derivation_content(id_source_derivation);
148 $("#derivation_infos_" + id_source_derivation).slideDown(200);
154 function del_sml_xf(id_xf)
155 { $("#" + id_xf).slideUp(200, function () { $(this).remove(); });