Merge branch 'latest' of github.com:webnotes/erpnext into latest

This commit is contained in:
Anand Doshi 2012-01-20 14:50:45 +05:30
commit af4b0a9e90
7 changed files with 56 additions and 60 deletions

View File

@ -632,7 +632,7 @@ pscript.complete_registration = function(is_complete) {
var d = new Dialog(400, 200, "Please Complete Your Registration"); var d = new Dialog(400, 200, "Please Complete Your Registration");
if(user != 'Administrator'){ if(user != 'Administrator'){
d.no_cancel(); // Hide close image d.no_cancel(); // Hide close image
$dh(page_body.wntoolbar.wrapper); $('header').toggle(false);
} }
d.make_body([ d.make_body([
@ -672,7 +672,7 @@ pscript.complete_registration = function(is_complete) {
$c_obj('Setup Control','setup_account',JSON.stringify(args),function(r, rt){ $c_obj('Setup Control','setup_account',JSON.stringify(args),function(r, rt){
sys_defaults = r.message; sys_defaults = r.message;
d.hide(); d.hide();
$ds(page_body.wntoolbar.wrapper); $('header').toggle(true);
}); });
} }
} }

View File

@ -10,28 +10,18 @@ var user_full_nm = {};
// check if session user is system manager // check if session user is system manager
if(inList(user_roles,'System Manager')) is_system_manager = 1; if(inList(user_roles,'System Manager')) is_system_manager = 1;
wn.require('erpnext/startup/toolbar.js');
function startup_setup() { function startup_setup() {
pscript.is_erpnext_saas = cint(locals['Control Panel']['Control Panel'].sync_with_gateway) pscript.is_erpnext_saas = cint(locals['Control Panel']['Control Panel'].sync_with_gateway)
if(get_url_arg('embed')) { if(get_url_arg('embed')) {
// hide header, footer // hide header, footer
$dh(page_body.banner_area); $('.topbar').css('display', 'none');
$dh(page_body.wntoolbar);
$dh(page_body.footer); $dh(page_body.footer);
return; return;
} }
// page structure
// --------------
if(page_body.wntoolbar) {
$td(page_body.wntoolbar.body_tab,0,0).innerHTML = '<i><b>erp</b>next</i>';
$y($td(page_body.wntoolbar.body_tab,0,0), {
width:'140px',
color:'#FFF',
paddingLeft:'8px',
paddingRight:'8px',
fontSize:'14px'
});
}
$dh(page_body.banner_area); $dh(page_body.banner_area);
// sidebar // sidebar
@ -43,7 +33,7 @@ function startup_setup() {
page_body.footer.innerHTML = '<div class="erpnext-footer">Powered by <a href="https://erpnext.com">ERPNext</a></div>'; page_body.footer.innerHTML = '<div class="erpnext-footer">Powered by <a href="https://erpnext.com">ERPNext</a></div>';
// setup toolbar // setup toolbar
pscript.startup_setup_toolbar(); erpnext.toolbar.setup();
} }
// ==================================================================== // ====================================================================
@ -418,37 +408,6 @@ pscript.startup_set_module_order = function() {
$c_obj('Home Control', 'get_module_order', '', callback) $c_obj('Home Control', 'get_module_order', '', callback)
} }
// ====================================================================
pscript.startup_setup_toolbar = function() {
var menu_tab = page_body.wntoolbar.menu_table_right;
// help
// ----
$td(menu_tab,0,0).innerHTML = '<a style="font-weight: bold; color: #FFF" href="http://erpnext.blogspot.com/2011/03/erpnext-help.html" target="_blank">Help</a>';
$td(menu_tab,0,1).innerHTML = '<a style="font-weight: bold; color: #FFF" href="http://groups.google.com/group/erpnext-user-forum" target="_blank">Forum</a>';
if(pscript.is_erpnext_saas){
// Live Chat Help
// --------------
$td(menu_tab,0,2).innerHTML = '<a style="font-weight: bold; color: #FFF" href="http://www.providesupport.com?messenger=iwebnotes" target="_blank">Chat</a>';
// Manage account
// --------------
if(is_system_manager) {
$td(menu_tab,0,3).innerHTML = '<a style="font-weight: bold; color: #FFF;" href="#!billing">Billing</a>';
}
}
else{
$dh($td(menu_tab,0,2));
$dh($td(menu_tab,0,3));
}
$y(cell, page_body.wntoolbar.right_table_style);
}
// chart of accounts // chart of accounts
// ==================================================================== // ====================================================================
show_chart_browser = function(nm, chart_type){ show_chart_browser = function(nm, chart_type){

View File

@ -0,0 +1,27 @@
/* toolbar settings */
wn.provide('erpnext.toolbar');
erpnext.toolbar.setup = function() {
// profile
$('#toolbar-user').append('<li><a href="#profile-settings">Profile Settings</a></li>')
// help
$('.topbar .secondary-nav').append('<li class="dropdown">\
<a class="dropdown-toggle" href="#" onclick="return false;">Help</a>\
<ul class="dropdown-menu" id="toolbar-help">\
</ul></li>')
$('#toolbar-help').append('<li><a href="http://erpnext.blogspot.com/2011/03/erpnext-help.html" target="_blank">\
Documentation</a></li>')
$('#toolbar-help').append('<li><a href="http://groups.google.com/group/erpnext-user-forum" target="_blank">\
Forum</a></li>')
$('#toolbar-help').append('<li><a href="http://www.providesupport.com?messenger=iwebnotes" target="_blank">\
Live Chat (Office Hours)</a></li>')
// billing
if(pscript.is_erpnext_saas && is_system_manager) {
$('#toolbar-user').append('<li><a href="#billing">Billing</a></li>')
}
}

View File

@ -3,7 +3,7 @@
<meta charset="utf-8"> <meta charset="utf-8">
<title>ERPNext</title> <title>ERPNext</title>
<meta name="author" content=""> <meta name="author" content="">
<script type="text/javascript">window._version_number="52" <script type="text/javascript">window._version_number="82"
wn={} wn={}
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]={}} 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]={}}
@ -16,10 +16,9 @@ wn.versions={check:function(){if(localStorage){if(window._version_number==-1||pa
localStorage.setItem('_version_number',window._version_number);}}} localStorage.setItem('_version_number',window._version_number);}}}
wn.assets={executed_:{},exists:function(src){if('localStorage'in window&&localStorage.getItem(src)) wn.assets={executed_:{},exists:function(src){if('localStorage'in window&&localStorage.getItem(src))
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];} 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];}
return src.split('.').slice(-1)[0];},html_src:function(src){if(src.indexOf('/')!=-1){var t=src.split('/').slice(0,-1);t.push('src');t=t.join('/')+'/'+a.split('/').slice(-1)[0];}else{var t='src/'+src;} 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);}
return t;},load:function(src){var t=wn.assets.extn(src)=='html'?wn.assets.html_src(src):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);}
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));} 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));}
document.getElementsByTagName('head')[0].appendChild(se);},html:function(txt,src){var page=wn.dom.add($('.outer .inner').get(0),'div','content',null,txt);page.setAttribute("_src",src);},cgi:function(txt,src){wn.dom.eval(txt)}}} document.getElementsByTagName('head')[0].appendChild(se);},cgi:function(txt,src){wn.dom.eval(txt)}}}
wn.require=function(items){if(typeof items==="string"){items=[items];} wn.require=function(items){if(typeof items==="string"){items=[items];}
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);}}} 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);}}}
wn.provide('wn.dom');wn.dom.by_id=function(id){return document.getElementById(id);} wn.provide('wn.dom');wn.dom.by_id=function(id){return document.getElementById(id);}
@ -64,13 +63,12 @@ if(/^[\],:{}\s]*$/.test(text.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,'@').
throw new SyntaxError('JSON.parse');};}}());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> throw new SyntaxError('JSON.parse');};}}());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>
</head> </head>
<body> <body>
<header></header>
<div id="startup_div" style="padding: 8px; font-size: 14px;"></div> <div id="startup_div" style="padding: 8px; font-size: 14px;"></div>
<!-- Main Starts --> <!-- Main Starts -->
<div id="body_div"> <div id="body_div">
<!--static (no script) content--> <!--static (no script) content-->
<div class="no_script" style='font-family: verdana, sans'> <div class="no_script" style='font-family: Lucida Grande, Verdana, Sans; font-size: 12px'>
Loading... Loading...
</div> </div>
</div> </div>

View File

@ -1,3 +1,12 @@
wn.app = {
name: 'ERPNext',
license: 'GNU/GPL - Usage Condition: All "erpnext" branding must be kept as it is',
source: 'https://github.com/webnotes/erpnext',
publisher: 'Web Notes Technologies Pvt Ltd, Mumbai',
copyright: '&copy; Web Notes Technologies Pvt Ltd',
version: '2.' + window._version_number
}
wn.settings.no_history = true; wn.settings.no_history = true;
wn.require('lib/js/lib/jquery.min.js'); wn.require('lib/js/lib/jquery.min.js');
@ -12,3 +21,7 @@ wn.require('lib/css/legacy/default.css');
$(document).bind('ready', function() { $(document).bind('ready', function() {
startup(); startup();
}); });
$(document).bind('toolbar_setup', function() {
$('.brand').html('<b>erp</b>next');
})

View File

@ -6,13 +6,12 @@
<script type="text/javascript">%s</script> <script type="text/javascript">%s</script>
</head> </head>
<body> <body>
<header></header>
<div id="startup_div" style="padding: 8px; font-size: 14px;"></div> <div id="startup_div" style="padding: 8px; font-size: 14px;"></div>
<!-- Main Starts --> <!-- Main Starts -->
<div id="body_div"> <div id="body_div">
<!--static (no script) content--> <!--static (no script) content-->
<div class="no_script" style='font-family: verdana, sans'> <div class="no_script" style='font-family: Lucida Grande, Verdana, Sans; font-size: 12px'>
Loading... Loading...
</div> </div>
</div> </div>

View File

@ -1 +1 @@
52 82