Rushabh Mehta | 66ac2b0 | 2011-09-05 18:43:09 +0530 | [diff] [blame] | 1 | <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> |
| 2 | <head> |
| 3 | <meta charset="utf-8"> |
| 4 | <title>ERPNext</title> |
| 5 | <meta name="author" content=""> |
Rushabh Mehta | c8d2e73 | 2012-01-27 15:57:17 +0530 | [diff] [blame^] | 6 | <script type="text/javascript">window._version_number="228"; |
Rushabh Mehta | 843db59 | 2012-01-20 17:43:37 +0530 | [diff] [blame] | 7 | |
| 8 | /* |
| 9 | * lib/js/wn/class.js |
| 10 | */ |
| 11 | /* |
| 12 | |
| 13 | Inheritence "Class" |
| 14 | ------------------- |
| 15 | see: http://ejohn.org/blog/simple-javascript-inheritance/ |
| 16 | To subclass, use: |
| 17 | |
| 18 | var MyClass = Class.extend({ |
| 19 | init: function |
| 20 | }) |
| 21 | |
| 22 | */ |
| 23 | |
| 24 | /* Simple JavaScript Inheritance |
| 25 | * By John Resig http://ejohn.org/ |
| 26 | * MIT Licensed. |
| 27 | */ |
| 28 | // Inspired by base2 and Prototype |
| 29 | |
| 30 | (function(){ |
| 31 | var initializing = false, fnTest = /xyz/.test(function(){xyz;}) ? /\b_super\b/ : /.*/; |
| 32 | // The base Class implementation (does nothing) |
| 33 | this.Class = function(){}; |
| 34 | |
| 35 | // Create a new Class that inherits from this class |
| 36 | Class.extend = function(prop) { |
| 37 | var _super = this.prototype; |
| 38 | |
| 39 | // Instantiate a base class (but only create the instance, |
| 40 | // don't run the init constructor) |
| 41 | initializing = true; |
| 42 | var prototype = new this(); |
| 43 | initializing = false; |
| 44 | |
| 45 | // Copy the properties over onto the new prototype |
| 46 | for (var name in prop) { |
| 47 | // Check if we're overwriting an existing function |
| 48 | prototype[name] = typeof prop[name] == "function" && |
| 49 | typeof _super[name] == "function" && fnTest.test(prop[name]) ? |
| 50 | (function(name, fn){ |
| 51 | return function() { |
| 52 | var tmp = this._super; |
| 53 | |
| 54 | // Add a new ._super() method that is the same method |
| 55 | // but on the super-class |
| 56 | this._super = _super[name]; |
| 57 | |
| 58 | // The method only need to be bound temporarily, so we |
| 59 | // remove it when we're done executing |
| 60 | var ret = fn.apply(this, arguments); |
| 61 | this._super = tmp; |
| 62 | |
| 63 | return ret; |
| 64 | }; |
| 65 | })(name, prop[name]) : |
| 66 | prop[name]; |
| 67 | } |
| 68 | |
| 69 | // The dummy class constructor |
| 70 | function Class() { |
| 71 | // All construction is actually done in the init method |
| 72 | if ( !initializing && this.init ) |
| 73 | this.init.apply(this, arguments); |
| 74 | } |
| 75 | |
| 76 | // Populate our constructed prototype object |
| 77 | Class.prototype = prototype; |
| 78 | |
| 79 | // Enforce the constructor to be what we expect |
| 80 | Class.prototype.constructor = Class; |
| 81 | |
| 82 | // And make this class extendable |
| 83 | Class.extend = arguments.callee; |
| 84 | |
| 85 | return Class; |
| 86 | }; |
| 87 | })(); |
| 88 | |
| 89 | /* |
| 90 | * lib/js/wn/provide.js |
| 91 | */ |
Rushabh Mehta | 764fdb9 | 2012-01-20 12:07:56 +0530 | [diff] [blame] | 92 | |
Rushabh Mehta | d1ae089 | 2011-09-06 16:40:11 +0530 | [diff] [blame] | 93 | wn={} |
| 94 | wn.provide=function(namespace){var nsl=namespace.split('.');var l=nsl.length;var parent=window;for(var i=0;i<l;i++){var n=nsl[i];if(!parent[n]){parent[n]={}} |
| 95 | parent=parent[n];}} |
Rushabh Mehta | 843db59 | 2012-01-20 17:43:37 +0530 | [diff] [blame] | 96 | wn.provide('wn.settings');wn.provide('wn.ui'); |
| 97 | /* |
| 98 | * lib/js/wn/xmlhttp.js |
| 99 | */ |
| 100 | |
| 101 | wn.xmlhttp={request:function(){if(window.XMLHttpRequest) |
Rushabh Mehta | d1ae089 | 2011-09-06 16:40:11 +0530 | [diff] [blame] | 102 | return new XMLHttpRequest();else if(window.ActiveXObject) |
Rushabh Mehta | cbaae20 | 2011-09-08 19:07:14 +0530 | [diff] [blame] | 103 | return new ActiveXObject("MsXml2.XmlHttp");},complete:function(req,callback,url){if(req.status==200||req.status==304){callback(req.responseText);}else{alert(url+' request error: '+req.statusText+' ('+req.status+')');}},get:function(url,callback,args,async){if(async===null)async=true;var req=wn.xmlhttp.request();req.onreadystatechange=function(){if(req.readyState==4){wn.xmlhttp.complete(req,callback,url)}} |
Rushabh Mehta | 9b03ec4 | 2011-09-15 12:46:07 +0530 | [diff] [blame] | 104 | var sep=((args&&args.indexOf('?'))==-1)?'?':'&';var u=args?(url+sep+args):url;req.open('GET',u,async);req.send(null);if(!async){wn.xmlhttp.complete(req,callback,url)}}} |
Rushabh Mehta | 843db59 | 2012-01-20 17:43:37 +0530 | [diff] [blame] | 105 | /* |
| 106 | * lib/js/wn/versions.js |
| 107 | */ |
| 108 | |
Rushabh Mehta | a7b3c01 | 2012-01-09 16:01:31 +0530 | [diff] [blame] | 109 | wn.versions={check:function(){if(localStorage){if(window._version_number==-1||parseInt(localStorage._version_number)!=parseInt(window._version_number)){localStorage.clear();} |
| 110 | localStorage.setItem('_version_number',window._version_number);}}} |
Rushabh Mehta | 843db59 | 2012-01-20 17:43:37 +0530 | [diff] [blame] | 111 | /* |
| 112 | * lib/js/wn/assets.js |
| 113 | */ |
| 114 | |
Rushabh Mehta | 1e11cb4 | 2011-09-14 13:25:10 +0530 | [diff] [blame] | 115 | wn.assets={executed_:{},exists:function(src){if('localStorage'in window&&localStorage.getItem(src)) |
Rushabh Mehta | 9b03ec4 | 2011-09-15 12:46:07 +0530 | [diff] [blame] | 116 | return true},add:function(src,txt){if('localStorage'in window){localStorage.setItem(src,txt);}},get:function(src){return localStorage.getItem(src);},extn:function(src){if(src.indexOf('?')!=-1){src=src.split('?').slice(-1)[0];} |
Rushabh Mehta | 8c309be | 2012-01-20 13:47:16 +0530 | [diff] [blame] | 117 | return src.split('.').slice(-1)[0];},load:function(src){var t=src;wn.xmlhttp.get(t,function(txt){wn.assets.add(src,txt);},'q='+Math.floor(Math.random()*1000),false)},execute:function(src){if(!wn.assets.exists(src)){wn.assets.load(src);} |
Rushabh Mehta | d1ae089 | 2011-09-06 16:40:11 +0530 | [diff] [blame] | 118 | var type=wn.assets.extn(src);if(wn.assets.handler[type]){wn.assets.handler[type](wn.assets.get(src),src);wn.assets.executed_[src]=1;}},handler:{js:function(txt,src){wn.dom.eval(txt);},css:function(txt,src){var se=document.createElement('style');se.type="text/css";if(se.styleSheet){se.styleSheet.cssText=txt;}else{se.appendChild(document.createTextNode(txt));} |
Rushabh Mehta | 8c309be | 2012-01-20 13:47:16 +0530 | [diff] [blame] | 119 | document.getElementsByTagName('head')[0].appendChild(se);},cgi:function(txt,src){wn.dom.eval(txt)}}} |
Rushabh Mehta | 843db59 | 2012-01-20 17:43:37 +0530 | [diff] [blame] | 120 | /* |
| 121 | * lib/js/wn/require.js |
| 122 | */ |
| 123 | |
Rushabh Mehta | d1ae089 | 2011-09-06 16:40:11 +0530 | [diff] [blame] | 124 | wn.require=function(items){if(typeof items==="string"){items=[items];} |
Rushabh Mehta | 9b03ec4 | 2011-09-15 12:46:07 +0530 | [diff] [blame] | 125 | var l=items.length;for(var i=0;i<l;i++){var src=items[i];if(!(src in wn.assets.executed_)){wn.assets.execute(src);}}} |
Rushabh Mehta | 843db59 | 2012-01-20 17:43:37 +0530 | [diff] [blame] | 126 | /* |
| 127 | * lib/js/wn/dom.js |
| 128 | */ |
| 129 | |
Rushabh Mehta | d1ae089 | 2011-09-06 16:40:11 +0530 | [diff] [blame] | 130 | wn.provide('wn.dom');wn.dom.by_id=function(id){return document.getElementById(id);} |
| 131 | wn.dom.eval=function(txt){var el=document.createElement('script');el.appendChild(document.createTextNode(txt));document.getElementsByTagName('head')[0].appendChild(el);} |
| 132 | wn.dom.add=function(parent,newtag,className,cs,innerHTML,onclick){if(parent&&parent.substr)parent=wn.dom.by_id(parent);var c=document.createElement(newtag);if(parent) |
| 133 | parent.appendChild(c);if(className){if(newtag.toLowerCase()=='img') |
| 134 | c.src=className |
| 135 | else |
| 136 | c.className=className;} |
| 137 | if(cs)wn.dom.css(c,cs);if(innerHTML)c.innerHTML=innerHTML;if(onclick)c.onclick=onclick;return c;} |
| 138 | wn.dom.css=function(ele,s){if(ele&&s){for(var i in s)ele.style[i]=s[i];};return ele;} |
| 139 | wn.dom.hide=function(ele){ele.style.display='none';} |
| 140 | wn.dom.show=function(ele,value){if(!value)value='block';ele.style.display=value;} |
Rushabh Mehta | 843db59 | 2012-01-20 17:43:37 +0530 | [diff] [blame] | 141 | /* |
| 142 | * lib/js/wn/page.js |
| 143 | */ |
| 144 | |
Rushabh Mehta | d1ae089 | 2011-09-06 16:40:11 +0530 | [diff] [blame] | 145 | wn.page={set:function(src){var new_selection=$('.inner div.content[_src="'+src+'"]');if(!new_selection.length){wn.assets.execute(src);new_selection=$('.inner div.content[_src="'+src+'"]');} |
| 146 | $('.inner .current_page').removeClass('current_page');new_selection.addClass('current_page');var title=$('nav ul li a[href*="'+src+'"]').attr('title')||'No Title' |
Rushabh Mehta | 5ede3e8 | 2011-09-08 14:16:34 +0530 | [diff] [blame] | 147 | state=window.location.hash;if(state!=src){window.location.hash=state;} |
Rushabh Mehta | d1ae089 | 2011-09-06 16:40:11 +0530 | [diff] [blame] | 148 | else{document.title=title;}}} |
Rushabh Mehta | 843db59 | 2012-01-20 17:43:37 +0530 | [diff] [blame] | 149 | /* |
| 150 | * lib/js/lib/json2.js |
| 151 | */ |
| 152 | |
Rushabh Mehta | d1ae089 | 2011-09-06 16:40:11 +0530 | [diff] [blame] | 153 | var JSON;if(!JSON){JSON={};} |
| 154 | (function(){"use strict";function f(n){return n<10?'0'+n:n;} |
| 155 | if(typeof Date.prototype.toJSON!=='function'){Date.prototype.toJSON=function(key){return isFinite(this.valueOf())?this.getUTCFullYear()+'-'+ |
| 156 | f(this.getUTCMonth()+1)+'-'+ |
| 157 | f(this.getUTCDate())+'T'+ |
| 158 | f(this.getUTCHours())+':'+ |
| 159 | f(this.getUTCMinutes())+':'+ |
| 160 | f(this.getUTCSeconds())+'Z':null;};String.prototype.toJSON=Number.prototype.toJSON=Boolean.prototype.toJSON=function(key){return this.valueOf();};} |
| 161 | var cx=/[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,escapable=/[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,gap,indent,meta={'\b':'\\b','\t':'\\t','\n':'\\n','\f':'\\f','\r':'\\r','"':'\\"','\\':'\\\\'},rep;function quote(string){escapable.lastIndex=0;return escapable.test(string)?'"'+string.replace(escapable,function(a){var c=meta[a];return typeof c==='string'?c:'\\u'+('0000'+a.charCodeAt(0).toString(16)).slice(-4);})+'"':'"'+string+'"';} |
| 162 | function str(key,holder){var i,k,v,length,mind=gap,partial,value=holder[key];if(value&&typeof value==='object'&&typeof value.toJSON==='function'){value=value.toJSON(key);} |
| 163 | if(typeof rep==='function'){value=rep.call(holder,key,value);} |
| 164 | switch(typeof value){case'string':return quote(value);case'number':return isFinite(value)?String(value):'null';case'boolean':case'null':return String(value);case'object':if(!value){return'null';} |
| 165 | gap+=indent;partial=[];if(Object.prototype.toString.apply(value)==='[object Array]'){length=value.length;for(i=0;i<length;i+=1){partial[i]=str(i,value)||'null';} |
| 166 | v=partial.length===0?'[]':gap?'[\n'+gap+partial.join(',\n'+gap)+'\n'+mind+']':'['+partial.join(',')+']';gap=mind;return v;} |
| 167 | if(rep&&typeof rep==='object'){length=rep.length;for(i=0;i<length;i+=1){if(typeof rep[i]==='string'){k=rep[i];v=str(k,value);if(v){partial.push(quote(k)+(gap?': ':':')+v);}}}}else{for(k in value){if(Object.prototype.hasOwnProperty.call(value,k)){v=str(k,value);if(v){partial.push(quote(k)+(gap?': ':':')+v);}}}} |
| 168 | v=partial.length===0?'{}':gap?'{\n'+gap+partial.join(',\n'+gap)+'\n'+mind+'}':'{'+partial.join(',')+'}';gap=mind;return v;}} |
| 169 | if(typeof JSON.stringify!=='function'){JSON.stringify=function(value,replacer,space){var i;gap='';indent='';if(typeof space==='number'){for(i=0;i<space;i+=1){indent+=' ';}}else if(typeof space==='string'){indent=space;} |
| 170 | rep=replacer;if(replacer&&typeof replacer!=='function'&&(typeof replacer!=='object'||typeof replacer.length!=='number')){throw new Error('JSON.stringify');} |
| 171 | return str('',{'':value});};} |
| 172 | if(typeof JSON.parse!=='function'){JSON.parse=function(text,reviver){var j;function walk(holder,key){var k,v,value=holder[key];if(value&&typeof value==='object'){for(k in value){if(Object.prototype.hasOwnProperty.call(value,k)){v=walk(value,k);if(v!==undefined){value[k]=v;}else{delete value[k];}}}} |
| 173 | return reviver.call(holder,key,value);} |
| 174 | text=String(text);cx.lastIndex=0;if(cx.test(text)){text=text.replace(cx,function(a){return'\\u'+ |
| 175 | ('0000'+a.charCodeAt(0).toString(16)).slice(-4);});} |
| 176 | if(/^[\],:{}\s]*$/.test(text.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,'@').replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,']').replace(/(?:^|:|,)(?:\s*\[)+/g,''))){j=eval('('+text+')');return typeof reviver==='function'?walk({'':j},''):j;} |
Rushabh Mehta | 843db59 | 2012-01-20 17:43:37 +0530 | [diff] [blame] | 177 | throw new SyntaxError('JSON.parse');};}}()); |
| 178 | /* |
| 179 | * lib/js/core.js |
| 180 | */ |
| 181 | |
| 182 | wn.versions.check();wn.require("lib/js/lib/jquery.min.js");wn.require("lib/js/lib/history/history.min.js");$(document).bind('ready',function(){var base=window.location.href.split('#')[0];$.each($('a[softlink!="false"]'),function(i,v){if(v.href.substr(0,base.length)==base){var path=(v.href.substr(base.length));if(path.substr(0,1)!='#'){v.href=base+'#'+path;}}});if(!wn.settings.no_history&&window.location.hash){wn.page.set(window.location.hash.substr(1));}});</script> |
Rushabh Mehta | 66ac2b0 | 2011-09-05 18:43:09 +0530 | [diff] [blame] | 183 | </head> |
| 184 | <body> |
Rushabh Mehta | 8c309be | 2012-01-20 13:47:16 +0530 | [diff] [blame] | 185 | <header></header> |
Rushabh Mehta | 66ac2b0 | 2011-09-05 18:43:09 +0530 | [diff] [blame] | 186 | <div id="startup_div" style="padding: 8px; font-size: 14px;"></div> |
Rushabh Mehta | 66ac2b0 | 2011-09-05 18:43:09 +0530 | [diff] [blame] | 187 | <!-- Main Starts --> |
| 188 | <div id="body_div"> |
Rushabh Mehta | 66ac2b0 | 2011-09-05 18:43:09 +0530 | [diff] [blame] | 189 | <!--static (no script) content--> |
Rushabh Mehta | 8c309be | 2012-01-20 13:47:16 +0530 | [diff] [blame] | 190 | <div class="no_script" style='font-family: Lucida Grande, Verdana, Sans; font-size: 12px'> |
Anand Doshi | 9c6a293 | 2012-01-12 15:18:12 +0530 | [diff] [blame] | 191 | Loading... |
Rushabh Mehta | 66ac2b0 | 2011-09-05 18:43:09 +0530 | [diff] [blame] | 192 | </div> |
Rushabh Mehta | 66ac2b0 | 2011-09-05 18:43:09 +0530 | [diff] [blame] | 193 | </div> |
Rushabh Mehta | 865c00a | 2012-01-24 14:33:21 +0530 | [diff] [blame] | 194 | <footer></footer> |
Rushabh Mehta | 11c6be0 | 2011-09-06 15:50:01 +0530 | [diff] [blame] | 195 | <script>wn.require('js/app.js');</script> |
Rushabh Mehta | 32e00cb | 2011-09-16 16:28:35 +0530 | [diff] [blame] | 196 | <div id="dialog_back"></div> |
Anand Doshi | 9c6a293 | 2012-01-12 15:18:12 +0530 | [diff] [blame] | 197 | </body> |