Edit C:\Users\Administrator\Desktop\Back\galaxie - Copy\js\edeal\views\link.js
Views.Link = Views.Base.extend({ classType: "Views.Link", tagName: "div", listenEvents: function() { //See Views.Base listenDefaultEvents() this.on("oninitialize", this.onInitialize); this.on("onrender", this.onRender); }, onInitialize: function() { }, onRender: function() { var that = this; this.normalizeOptions(); this.normalizeUrl(); this.$el.removeAttr("target"); this.$el.on("dblclick", function() {return false;}); if (this.options.js) { if (this.options.target == "SELF") { this.$el.attr("href", "javascript:void(0);"); this.$el.on("click", {js: this.options.js}, that.jsSELF); } else if (this.options.target == "OPENER") { if (window.top.opener) { this.$el.attr("href", "javascript:void(0);"); this.$el.on("click", {js: this.options.js}, that.jsOPENER); } else { this.$el.attr("href", this.options.normalizedUrl); this.$el.on("click", {js: this.options.js}, that.jsSELF); } } else if (this.options.target == "POPUP") { this.$el.attr("href", "javascript:void(0);"); this.$el.on("click", {js: this.options.js}, that.jsPOPUP); } else if (this.options.target == "DIALOG") { this.$el.attr("href", "javascript:void(0);"); this.$el.on("click", {js: this.options.js, dialogId: that.options.options.id, dialogOptions: that.options.options}, that.jsDIALOG); } } else { if (this.options.url) { if (this.options.target == "SELF") { this.$el.attr("href", this.options.normalizedUrl); this.$el.on("click", {url: this.options.normalizedUrl}, that.urlSELF); } else if (this.options.target == "OPENER") { if (window.top.opener) { this.$el.attr("href", "javascript:void(0);"); this.$el.on("click", {url: this.options.normalizedUrl}, that.urlOPENER); } else { this.$el.attr("href", this.options.normalizedUrl); this.$el.on("click", {url: this.options.normalizedUrl}, that.urlSELF); } } else if (this.options.target == "POPUP") { this.generatePopupOptions(); this.$el.attr("href", "javascript:void(0);"); this.$el.on("click", {url: this.options.normalizedUrl, popupId: that.options.options.id, popupOptions: that.options.popupOptions}, that.urlPOPUP); } else if (this.options.target == "DIALOG") { this.$el.attr("href", "javascript:void(0);"); this.$el.on("click", {url: this.options.normalizedUrl, dialogId: that.options.options.id, dialogOptions: that.options.options}, that.urlDIALOG); } } } return this; }, jsSELF: function(event) { eval(event.data.js); }, jsOPENER: function(event) { window.top.opener.eval(event.data.js); }, jsPOPUP: function(event) { /* TODO : check if a possibly window with the optionnal id is already opened and, if yes, execute js in it * */ eval(event.data.js); }, jsDIALOG: function(event) { /* TODO : check if a possibly dialog with the optionnal id is already opened and, if yes, execute js in it * */ eval(event.data.js); }, urlSELF: function(event) { //this test below is here to deal with iframe, for example used in dashboards if (window.parent === window) { //window.location.href = event.data.url; } else { window.parent.location.href = event.data.url; } }, urlOPENER: function(event) { window.top.opener.location.href = event.data.url; }, urlPOPUP: function(event) { /* TODO : * Update a list of opened dialog box in order to reuse them if link is clicked again * */ //console.log(event.data.popupOptions); var aWindow = window.open(event.data.url, event.data.popupId, event.data.popupOptions); }, urlDIALOG: function(event) { /* TODO : create a dialog box * Update a list of opened dialog box in order to reuse them if link is clicked again * */ Utils.openDialog(event.data.dialogOptions.title, {url:event.data.url}, event.data.dialogOptions, event.data.dialogId); }, normalizeUrl: function() { this.options.normalizedUrl = "javascript:void(0);"; if (this.options.url) { this.options.normalizedUrl = this.options.url; if (this.options.isrelativetoapplicationpath) { this.options.normalizedUrl = edApplication().path + this.options.normalizedUrl; } if (edApplication().softwareid != "" && this.options.target != "DIALOG" && this.options.url.toLowerCase().substring(0,7) != "http://") { this.options.normalizedUrl = this.options.normalizedUrl + (this.options.normalizedUrl.indexOf("?")>0?"&":"?") + "SfwID=" + edApplication().softwareid; } } /*if (this.options.url) { if (this.options.url.toLowerCase().substring(0,7) != "http://" && this.options.url.toLowerCase().substring(0,3) != "www") { this.options.normalizedUrl = edApplication().path + this.options.url; } else { this.options.normalizedUrl = this.options.url; } if (edApplication().softwareid != "" && this.options.target != "DIALOG") { this.options.normalizedUrl = this.options.normalizedUrl + "&SfwID=" + edApplication().softwareid; } }*/ }, normalizeOptions: function() { if (!this.options.target) { this.options.target = "SELF"; } if (!this.options.options) { this.options.options = {}; } if (!this.options.options.id) { this.options.options.id = this.id + "_" + Math.floor(Math.random()*5001); } if (!this.options.options.title) { this.options.options.title = this.options.options.id; } if (!this.options.options.resizable) { this.options.options.resizable = true; } if (!this.options.options.scrollable) { this.options.options.scrollable = true; } if (!this.options.options.menubar) { this.options.options.menubar = "no"; } if (!this.options.options.height) { this.options.options.height = "780"; } if (!this.options.options.width) { this.options.options.width = "800"; } if (!this.options.options.linkTo) { this.options.options.linkTo = this.$el; } }, generatePopupOptions: function() { if (!this.options.popupOptions) { //window.open options are like "Select", "resizeable=yes,scrollbars=yes,menubar=no,toolbar=no,height=780,width =800" this.options.popupOptions = "resizable="; if (this.options.options.resizable) { this.options.popupOptions = this.options.popupOptions + "yes, "; } else { this.options.popupOptions = this.options.popupOptions + "no, "; } this.options.popupOptions = this.options.popupOptions + "scrollbars="; if (this.options.options.scrollable) { this.options.popupOptions = this.options.popupOptions + "yes, "; } else { this.options.popupOptions = this.options.popupOptions + "no, "; } this.options.popupOptions = this.options.popupOptions + "menubar="; if (this.options.options.menubar) { this.options.popupOptions = this.options.popupOptions + "yes, "; } else { this.options.popupOptions = this.options.popupOptions + "no, "; } this.options.popupOptions = this.options.popupOptions + "height=" + this.options.options.height; this.options.popupOptions = this.options.popupOptions + ", width=" + this.options.options.width; if (!this.options.options.top) { this.options.popupOptions = this.options.popupOptions + ", top=" + (($(window).height()/2)-(this.options.options.height/2)); } else { this.options.popupOptions = this.options.popupOptions + ", top=" + this.options.options.top; } if (!this.options.options.left) { this.options.popupOptions = this.options.popupOptions + ", left=" + (($(window).width()/2)-(this.options.options.width/2)); } else { this.options.popupOptions = this.options.popupOptions + ", left=" + this.options.options.left; } } return this.options.popupOptions; } }); Views.LinkList = Views.BaseList.extend({ classType: "Views.LinkList" });
Ms-Dos/Windows
Unix
Write backup
jsp File Browser version 1.2 by
www.vonloesch.de