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_album in morceaux["" + id_groupe])
35 { for(var id_morceau in morceaux["" + id_groupe]["" + id_album])
37 "<option value=\"" + id_morceau + "\">" + morceaux["" + id_groupe]["" + id_album]["" + id_morceau] + "</option>";
43 $("#morceau_select").html(content);
46 function init_reference_select()
47 { $("#is_derivation").click
49 { if($(this).get(0).checked) $("#derivation_input").slideDown(200);
50 else $("#derivation_input").slideUp(200);
53 $("#is_reference").click
55 { if($(this).get(0).checked)
56 { $("#original_form").slideUp(200);
57 $("#reference_form").slideDown(200);
60 { $("#reference_form").slideUp(200);
61 $("#original_form").slideDown(200);
67 function add_document()
69 var id_document = last_document_id;
70 var content = "<div class=\"document\" id=\"document_" + id_document + "\">\n"
71 + " <div class=\"delete\"><a href=\"#\" onclick=\"del_document('" + id_document + "'); return false;\">Enlever ce fichier</a></div>\n"
72 + " <label for=\"document_nom_" + id_document + "\">nom</label>\n"
73 + " <input type=\"text\" class=\"long_text\" name=\"document_nom_" + id_document + "\" id=\"document_nom_" + id_document + "\" value=\"\" />\n"
74 + " <div class=\"clear\"><!-- --></div>\n"
75 + " <label for=\"document_url_" + id_document + "\">url</label>\n"
76 + " <input type=\"text\" size=\"48\" name=\"document_url_" + id_document + "\" id=\"document_url_" + id_document + "\" value=\"\" />\n"
78 $("#documents").append(content);
81 function del_document(id_document)
82 { $("#document_" + id_document).remove();
85 function init_tinymce()
88 { tinyMCE.execCommand("mceAddControl", true, $(this).attr("id"));
93 function init_toggle_edit_derivation_content(id_derivation)
94 { $("#derivation_edit_" + id_derivation + " .use_edit_derivation_content").click
96 { var id_derivation_content = $(this).attr("id");
97 if(id_derivation_content.length > 28)
98 { id_derivation_content = id_derivation_content.substr(28);
99 if($(this).get(0).checked)
100 { $("#derivation_edit_" + id_derivation_content + " span").slideDown(200);
103 { $("#derivation_edit_" + id_derivation_content + " span").slideUp(200);
110 function init_derivations()
111 { if(typeof(derivations) != "undefined")
112 { for(var id_derivation in derivations)
113 { init_toggle_edit_derivation_content(id_derivation);
114 $("#derivation_infos_" + id_derivation).slideDown(200);
119 function init_toggle_edit_reference_content(){
120 $("#reference_edit .use_edit_reference_content").click(
122 if($(this).get(0).checked){
123 $("#reference_edit span").slideDown(200);
126 $("#reference_edit span").slideUp(200);
132 function init_reference()
133 { init_toggle_edit_reference_content();
134 if(typeof(is_reference) != "undefined")
135 { if(is_reference) $("#reference_form").slideDown(200);
139 function add_derivation(id_source, id_source_derivation)
141 { index_derivation++;
142 id_source_derivation = index_derivation;
145 ( { url: mw_site_url + "index.php?e=content/sources/xml_form&id=" + id_source + "&derivation=" + id_source_derivation + "&form=" + (id_source ? "edit" : "add"),
147 success: function(content)
148 { $("#derivations_items").append(content);
149 init_toggle_edit_derivation_content(id_source_derivation);
150 $("#derivation_infos_" + id_source_derivation).slideDown(200);
156 function del_sml_xf(id_xf)
157 { $("#" + id_xf).slideUp(200, function () { $(this).remove(); });