PageSourceSearch

https://portal.ecotricity.co.nz/powercommerce/eco/fo/portal/resources/js/core/misc/spring.min.js

js ecotricity.co.nz collected 2026-10-04 20:11:06 UTC 5,695 bytes, 1 lines download raw bytes

1Spring={};Spring.debug=true;Spring.decorations={};Spring.decorations.applied=false;Spring.initialize=function(){Spring.applyDecorations();Spring.remoting=new Spring.RemotingHandler()};Spring.addDecoration=function(d){if(!Spring.decorations[d.elementId]){Spring.decorations[d.elementId]=[];Spring.decorations[d.elementId].push(d)}else{var c=false;for(var a=0;a<Spring.decorations[d.elementId].length;a++){var b=Spring.decorations[d.elementId][a];if(b.equals(d)){if(b.cleanup!=undefined){b.cleanup()}Spring.decorations[d.elementId][a]=d;c=true;break}}if(!c){Spring.decorations[d.elementId].push(d)}}if(Spring.decorations.applied){d.apply()}};Spring.applyDecorations=function(){if(!Spring.decorations.applied){for(var b in Spring.decorations){for(var a=0;a<Spring.decorations[b].length;a++){Spring.decorations[b][a].apply()}}Spring.decorations.applied=true}};Spring.validateAll=function(){var c=true;for(var b in Spring.decorations){for(var a=0;a<Spring.decorations[b].length;a++){if(Spring.decorations[b][a].widget&&!Spring.decorations[b][a].validate()){c=false}}}return c};Spring.validateRequired=function(){var c=true;for(var b in Spring.decorations){for(var a=0;a<Spring.decorations[b].length;a++){if(Spring.decorations[b][a].widget&&Spring.decorations[b][a].isRequired()&&!Spring.decorations[b][a].validate()){c=false}}}return c};Spring.AbstractElementDecoration=function(){};Spring.AbstractElementDecoration.prototype={elementId:"",widgetType:"",widgetModule:"",widget:null,widgetAttrs:{},apply:function(){},validate:function(){},isRequired:function(){},equals:function(a){}};Spring.AbstractValidateAllDecoration=function(){};Spring.AbstractValidateAllDecoration.prototype={event:"",elementId:"",apply:function(){},cleanup:function(){},handleEvent:function(a){},equals:function(a){}};Spring.AbstractCommandLinkDecoration=function(){};Spring.AbstractCommandLinkDecoration.prototype={elementId:"",linkHtml:"",apply:function(){},submitFormFromLink:function(c,b,a){},equals:function(a){}};Spring.AbstractAjaxEventDecoration=function(){};Spring.AbstractAjaxEventDecoration.prototype={event:"",elementId:"",sourceId:"",formId:"",popup:false,params:{},apply:function(){},cleanup:function(){},submit:function(a){},equals:function(a){}};Spring.AbstractRemotingHandler=function(){};Spring.AbstractRemotingHandler.prototype={submitForm:function(c,b,a){},getLinkedResource:function(a,c,b){},getResource:function(c,b,a){},handleResponse:function(){},handleError:function(){}};Spring.RemotingHandler=function(){};Spring.RemotingHandler.prototype=new Spring.AbstractRemotingHandler();Spring.RemotingHandler.prototype.xhr=null;Spring.RemotingHandler.prototype.submitForm=function(d,f,e){if(f.length==0){console.error("Cannot use Spring.remoting.submitForm without formId specified")}var c=new Object();for(var a in e){c[a]=e[a]}if(typeof d=="string"&&d.length>0){var b=$("#"+d);if(b!=null){if(b.value!=undefined&&b.type&&("button,submit,reset").indexOf(b.type)<0){c[d]=b.value}else{if(b.name!=undefined){c[b.name]=b.name}else{c[d]=d}}}}if(!c.ajaxSource){c.ajaxSource=d}$.each($("#"+f).serializeArray(),function(g,h){c[h.name]=h.value});Spring.RemotingHandler.xhr=$.ajax({beforeSend:function(g){g.setRequestHeader("Accept","text/html;type=ajax")},url:$("#"+f).attr("action"),data:c,success:Spring.RemotingHandler.prototype.handleResponse,error:Spring.RemotingHandler.prototype.handleError,dataType:"text",type:"POST"})};Spring.RemotingHandler.prototype.handleResponse=function(response,status,xmlHtppRequest){var redirectURL=Spring.RemotingHandler.xhr.getResponseHeader("Spring-Redirect-URL");var modalViewHeader=Spring.RemotingHandler.xhr.getResponseHeader("Spring-Modal-View");var modalView=(((typeof modalViewHeader)=="string"&&modalViewHeader.length>0));if((typeof redirectURL)=="string"&&redirectURL.length>0){if(modalView){alert("modal view not supported yet");return response}else{if(redirectURL.indexOf("/")>=0){window.location=window.location.protocol+"//"+window.location.host+redirectURL}else{var location=window.location.protocol+"//"+window.location.host+window.location.pathname;var appendIndex=location.lastIndexOf("/");location=location.substr(0,appendIndex+1)+redirectURL;if(location==window.location){alert("relative redirect is not supported yet")}else{window.location=location}}return response}}$(response).each(function(){if(this.id!=null&&this.id!=""){var target=$("#"+this.id
1);if(0==target.length){console.error("An existing DOM elment with id '"+this.id+"' could not be found for replacement.")}else{target.html(this.innerHTML)}}});$(response).each(function(){if(this.tagName&&this.tagName.toUpperCase()=="SCRIPT"){eval(this.text)}});return response};Spring.RemotingHandler.prototype.handleError=function(c,d,b){console.error("HTTP status code: ",c.status);if(Spring.debug&&c.status!=200){var a=$("<iframe style=\"min-width: 600px;\" id='dialogFrame'></iframe>");$("body").append(a);a.dialog({height:480,width:640,modal:true});a[0].contentDocument.open();a[0].contentDocument.write(c.responseText);a[0].contentDocument.close()}};Spring.RemotingHandler.getLinkedResource=function(c,b,a){this.getResource($("#"+c).attr("href"),b,a)};Spring.RemotingHandler.getResource=function(b,c,a){Spring.RemotingHandler.xhr=$.ajax({beforeSend:function(d){d.setRequestHeader("Accept","text/html;type=ajax")},url:b,data:c,success:this.handleResponse,error:this.handleError,dataType:"text",type:"GET"})};Spring.RemotingHandler.prototype.renderURLToModalDialog=function(b,a){alert("renderURLToModalDialog not implemented")};Spring.RemotingHandler.prototype.renderNodeListToModalDialog=function(a){var b=$(a);b.dialog({height:480,width:640,modal:true})};$(document).ready(function(){Spring.initialize()});

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.