PageSourceSearch

https://www.forbicolla.it/iw/adm/res_js/common.js?v=2

js forbicolla.it collected 2026-09-27 03:20:21 UTC 9,953 bytes, 328 lines download raw bytes

1function IwPage() {
2  this.initialize();
3  this.okBtId="btOk";
4  this.cancelBtId="btCancel";
5  this.cancelUrl="/";
6  this.bar=null;
7  this.barName=null;
8  this.initBarAsapCounter=0; // per debugging
9  this.initBarAsapInterval=null;
10  this.notifyPageLoadedInterval=null;
11  this.notifyPageLoadedCounter=0; // per debugging
12  this.currentTab=null;
13  this.pageLoadedListeners=new Array();
14  this.restoreFormListeners=new Array();
15}
16IwPage.prototype.initialize = function() {
17  this.confirmBeforeUnload=false;
18}
19IwPage.prototype.checkUnload = function() {
20  if (false && this.confirmBeforeUnload) {
21    return "-----\nVuoi veramente uscire senza salvare?\n-----\n";
22  }
23}
24IwPage.prototype.formUpdated = function(comp) {
25  this.confirmBeforeUnload=true;
26  var okBt=getObj(this.okBtId);
27  okBt.disabled=false;
28}
29IwPage.prototype.ok = function(comp) {
30  this.confirmBeforeUnload=false;
31}
32IwPage.prototype.cancel = function(comp) {
33  this.confirmBeforeUnload=false;
34  document.location=this.cancelUrl;
35}
36IwPage.prototype.getBar = function() {
37  return this.bar;
38}
39IwPage.prototype.initBar = function() {
40  if (this.bar==null) { // la barra e' ancora da inizializzare
41    if (checkBar()) {
42      this.bar=parent.iwShare.bar;
43      if (this.bar!=null) {
44        this.bar=setBar(this.bar);
45      }
46    }
47  }
48}
49IwPage.prototype.setBarName = function(barName) {
50  this.barName=barName;
51  this.bar=null;
52  this.initBarAsap();
53}
54IwPage.prototype.initBarAsap = function() {
55  if (this.initBarAsapInterval!=null) {
56    window.clearInterval(this.initBarAsapInterval);
57  }
58  if (this.bar==null && this.barName!=null) { // se e' ancora da inizializzare proviamo ad inizializzarla
59    this.initBar();
60  }
61  if (this.bar==null) { // se initBar non e' riuscito a settare l'oggetto this.bar riproviamo piu' tardi
62    this.initBarAsapInterval=window.setInterval("iwPage.initBarAsap()",200);
63  }
64}
65IwPage.prototype.backupForm = function(form) {
66  var share=parent.iwShare;
67  if (share!=null) {
68    var formValues=new Array();
69    share["formBackup_"+form.name]=formValues;
70    var elements=form.elements;
71    for (var i=0;i<elements.length;i++) {
72      var e=elements[i];
73      if (e.name != null) {
74        if (e.type!="radio" || e.checked) {
75          formValues[e.name]=e.value;
76        }
77      }
78    }
79  }
80}
81IwPage.prototype.restoreForm = function(form) {
82  var share=parent.iwShare;
83  if (share!=null) {
84    var formValues=share["formBackup_"+form.name];
85    if (formValues!=null) {
86      var elements=form.elements;
87      for (var i=0;i<elements.length;i++) {
88        var e=elements[i];
89        if (e.name != null) {
90          if (e.type=="radio") {
91            e.checked=formValues[e.name]==e.value;
92          } else if (e.type!="button" && e.type!="submit") {
93            var v=formValues[e.name];
94            if (typeof(v) != 'undefined') {
95              e.value=formValues[e.name];
96            }
97          }
98        }
99      }
100    }
101  }
102  this.notifyRestoreFormListeners(form);
103}
104
105IwPage.prototype.clearFormBackup = function(form) {
106  var share=parent.iwShare;
107  if (share!=null) {
108    share["formBackup_"+form.name]=null;
109  }
110}
111
112IwPage.prototype.clearFormBackup = function(form) {
113  var share=parent.iwShare;
114  if (share!=null) {
115    share["formBackup_"+form.name]=null;
116  }
117}
118
119IwPage.prototype.addPageLoadedListener = function(listener) {
120  this.pageLoadedListeners.push(listener);
121}
122
123IwPage.prototype.pageLoadedNotified = function(listenerId) {
124  // alert('pageLoadedNotified:'+listenerId);
125  for (var i=0;i<this.pageLoadedListeners.length;i++) {
126    if (this.pageLoadedListeners[i]!=null && this.pageLoadedListeners[i].listenerId==listenerId) {
127      this.pageLoadedListeners[i]=null;
128    }
129  }
130}
131IwPage.prototype.notifyPageLoaded = function() {
132  // alert('notifyPageLoaded');
133}
134IwPage.prototype.notifyPageLoaded_FROZEN = function() {
135  var retry=false;
136  var lastFailureCause=null;
137  if (this.notifyPageLoadedInterval==null) {
138    this.notifyPageLoadedInterval=window.setInterval("iwPage.notifyPageLoaded()",1000);
139  } else {
140    window.clearInterval(this.notifyPageLoadedInterval);
141    this.notifyPageLoadedCounter++;
142    for (var i=0;i<this.pageLoadedListeners.length;i++) {
143      if (this.pageLoadedListeners[i]!=null) {
144        if (!this.pageLoadedListeners[i].pageLoaded(this)) {
145          //this.pageLoadedListeners[i]=null;
146        //} else {
147          retry=true;
148          lastFailureCause=this.pageLoadedListeners[i].exception;
149        }
150      }
151    }
152    if (retry) {
153      var s="iwPage.notifyPageLoaded ha fallito "+this.notifyPageLoadedCounter+" volte";
154      s+="\nLa causa dell'ultimo fallimento e' stata: "+lastFailureCause;
155      s+="\nVuoi riprovare?";
156      if (true || this.notifyPageLoadedCounter <= 1 || confirm(s)) {
157        this.notifyPageLoadedInterval=window.setInterval("iwPage.notifyPageLoaded()",5000);
158      }
159    }
160  }
161}
162IwPage.prototype.addRestoreFormListener = function(listener) {
163  this.restoreFormListeners.push(listener);
164}
165IwPage.prototype.notifyRestoreFormListeners = function(form) {
166  while (this.restoreFormListeners.length > 0) {
167    var e = this.restoreFormListeners.shift();
168    e.restoreListener(form);
169  }
170}
171
172function IwPageLoadedFlashListener(flashInstance,componentId) {
173  this.flashInstance=flashInstance;
174  this.componentId=componentId==null ? '_root' : componentId;
175  this.exception=null;
176  this.listenerId="swf:"+this.flashInstance.name;
177}
178
179IwPageLoadedFlashListener.prototype.pageLoaded = function(page) {
180  var notified=false;
181  var flash=getObj(this.flashInstance.name);
182  if (flash!=null) {
183    var s="";
184    s+="notifying pageLoaded:";
185    s+="\n- this.listenerId="+this.listenerId;
186    s+="\n- this.flashInstance.name="+this.flashInstance.name;
187    s+="\n- this.componentId="+this.componentId;
188    // alert(s);
189    try {
190      flash.TGotoLabel(this.componentId+".jsActions","iwPageLoaded");
191      notified=true;
192    } catch (e) {
193      notified=false;
194      this.exception=e;
195    }
196  }
197  return false; // riprova finche' il flash non si autocancella
198}
199
200var bar=null;
201// definizioni javascript comuni a tutta l'amministrazione di instantweb
202function confirmAndRemoveBlock(articleId,index,nextPage) {
203  if (confirm("confermi la rimozione del blocco?")) {
204    removeBlock(articleId,index,nextPage);
205  }
206}
207function removeBlock(articleId,index,nextPage) {
208  nextPageWithAction(nextPage,"/article/jsp/removeBlock.jsp?articleId="+articleId+"&index="+index);
209}
210function nextPageWithAction(nextPage,action,form) {
211  var iwAction=null;
212  if (form!=null) {
213    iwAction=escape(action+"?"+encodeFormFields(form));
214  } else {
215    iwAction=escape(action);
216  }
217  var location=nextPage;
218  if (location.indexOf('?')==-1) {
219    location+="?iwAction="+iwAction;
220  } else {
221    location+="&iwAction="+iwAction;
222  }
223  document.location=location;
224}
225function fireNewMouseEvent(eventType,comp) {
226  if (msie()) {
227    var newEvent=document.createEventObject();
228    if (comp.fireEvent) {
229      comp.fireEvent("on"+eventType,newEvent);
230    }
231  } else {
232    var newEvent=document.createEvent("MouseEvents");
233    // rif: http://developer.mozilla.org/en/docs/DOM:event.initMouseEvent
234    newEvent.initMouseEvent(eventType,true, true, window, 0, 0, 0, 0, 0, false, false, false, false, 0, null);
235    if (comp.dispatchEvent) {
236      comp.dispatchEvent(newEvent);
237    }
238  }
239}
240function fireMouseOver(comp) {
241  fireNewMouseEvent("mouseOver",comp);
242}
243function fireMouseOut(comp) {
244  fireNewMouseEvent("mouseOut",comp);
245}
246function fillHeadTooltip(flashId) {
247  // window.status="fillHeadTooltip: flashId="+flashId;
248  var comp=getObject(flashId);
249  if (typeof(comp)=='NodeList') {
250    comp=comp[0];
251  }
252  if (comp!=null) {
253    if (window.iw.i18n!=null) {
254      comp.title=window.iw.i18n.get("/js/iwskin/common/editTooltip.html");
255    }
256    fireMouseOver(comp);
257  }
258}
259function emptyHeadTooltip(flashId) {
260  // window.status="emptyHeadTooltip: flashId="+flashId;
261  var comp=getObject(flashId);
262  if (comp!=null) {
263    comp.title="";
264    fireMouseOut(comp);
265  }
266}
267// comunicazione con la barra
268function setFlashId(x,flashId,flashComponentId) {
269  if (bar!=null) {
270    bar.setFlashId(x,flashId,flashComponentId);
271  }
272}
273function iwClick(x,flashId,flashComponentId,blkFlashId,blkFlashComponentId) {
274  if (bar!=null) {
275    if (flashId!=null) {
276      bar.iwClick(x,flashId,flashComponentId,blkFlashId,blkFlashComponentId);
277    } else {
278      bar.iwClick(x.id);
279    }
280  }
281}
282function iwDblClick(x,flashId,flashComponentId) {
283  if (bar!=null) {
284    if (flashId!=null) {
285      bar.iwDblClick(x,flashId,flashComponentId);
286    } else {
287      bar.iwDblClick(x.id);
288    }
289  }
290}
291function iwMouseOver(x) {
292  if (bar!=null) {
293    bar.iwMouseOver(x.id);
294  }
295}
296function iwMouseOut(x) {
297  if (bar!=null) {
298    bar.iwMouseOut(x.id);
299  }
300}
301function checkBar() {
302  if (!parent.iwShare) {
303    document.location="/iw/adm/main/index.jsp?main="+escape(document.location);
304    return false;
305  } else {
306    return true;
307  }
308}
309function changeBar(barName) {
310  console.log("changeBar:"+barName+".");
311  if (barName=='empty' && parent.iwShare && parent.iwShare.bar) {
312    parent.iwShare.bar.barName=barName;
313    parent.iwShare.bar.update();
314  } else if (checkBar()) {
315    iwPage.setBarName(barName);
316  }
317}
318function loginBarIfNeeded(nextPage) {
319  if (parent.iwShare && parent.barFrame.bar) {
320    var loc=nextPage==null ? document.location : nextPage;
321    // if (window.iw.i18n) window.iw.i18n.alert("/js/adm/sessionExpired");
322    parent.location="/iw/adm/main/index.jsp?main="+escape(loc);
323  }
324}
325function menu1ButtonAreas(level) {
326  return new Array("horizontal",new Object({from:0,to:103,name:"page"}),new Object({from:103,to:123,name:"openclose"}));
327}
328

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.