Subversion Repository Public Repository

Nextrek

Diff Revisions 776 vs 777 for /legal-map/js/articolo.js

Diff revisions: vs.
  @@ -1,3 +1,32 @@
1 + function showLinkPopup(artEl, folderPopup, filenamePopup) {
2 + function ajaxResShowLinkPopup(data) {
3 + alert(data);
4 + }
5 +
6 + if (false) { //da inserire blocco nel caso in cui il popup sia stato già creato in precedenza
7 +
8 + } else {
9 + $.ajax({
10 + url: "./ajax/openArticle.php",
11 + data: {
12 + html: folderPopup+"/"+filenamePopup
13 + },
14 + dataType: "HTML",
15 + type: "GET",
16 + success: function(data) {
17 + ajaxResShowLinkPopup(data);
18 + },
19 + error: function(request) {
20 + if (request.status == 404) {
21 + alert("File non trovato: "+folderPopup+"/"+filenamePopup);
22 + } else {
23 + alert("Errore nell'apertura del popup");
24 + }
25 + }
26 + });
27 + }
28 + }
29 +
1 30 function reduceTab(clicked, folder, filename) {
2 31 var parentEl = clicked.parent();
3 32 var articoloEl = clicked.closest("articolo");
  @@ -5,12 +34,6 @@
5 34
6 35 $("#articolo-"+folder+"_"+filename+" ."+tabRef+"-tab").removeClass("selected");
7 36 $("#articolo-"+folder+"_"+filename+" ."+tabRef).css("display", "none");
8 -
9 - /*if (tabRef == "originale" || tabRef == "ristrutturato") {
10 -
11 - } else if (tabRef == "schema") {
12 -
13 - }*/
14 37 }
15 38
16 39 function expandTab(clicked, folder, filename) {
  @@ -120,6 +143,17 @@
120 143 e.stopImmediatePropagation();
121 144 changeTabArticolo($(this), folder, filename);
122 145 });
146 +
147 + $("#articolo-"+folder+"_"+filename+" a").click(function (e) {
148 + e.preventDefault();
149 + e.stopImmediatePropagation();
150 + var href = $(this).attr("href");
151 + var splittedHref = href.substring(href.indexOf("#")+1).split("_");
152 + var folderPopup = splittedHref[0]+"_"+splittedHref[1];
153 + var filenamePopup = splittedHref[2]+".htm";
154 +
155 + showLinkPopup($("#articolo-"+folder+"_"+filename), folderPopup, filenamePopup);
156 + });
123 157 }
124 158
125 159 if ($("#articolo-"+folder+"_"+filename).length > 0) {