desktop icons
This commit is contained in:
parent
eaaf65131b
commit
db62876bc9
@ -168,9 +168,9 @@ div.std-footer-item {
|
||||
}
|
||||
|
||||
.layout_wrapper, .layout-wrapper {
|
||||
-moz-box-shadow: 1px 1px 8px #555;
|
||||
-webkit-box-shadow: 1px 1px 8px #555;
|
||||
box-shadow: 1px 1px 8px #555;
|
||||
-moz-box-shadow: 1px 1px 6px #AAA;
|
||||
-webkit-box-shadow: 1px 1px 6px #AAA;
|
||||
box-shadow: 1px 1px 6px #AAA;
|
||||
background-color: #fff;
|
||||
padding: 15px;
|
||||
}
|
||||
@ -212,21 +212,6 @@ div.std-footer-item {
|
||||
clear: both;
|
||||
}
|
||||
|
||||
.well {
|
||||
min-height: 20px;
|
||||
padding: 19px;
|
||||
margin-bottom: 20px;
|
||||
background-color: #f5f5f5;
|
||||
border: 1px solid #eee;
|
||||
border: 1px solid rgba(0, 0, 0, 0.05);
|
||||
-webkit-border-radius: 4px;
|
||||
-moz-border-radius: 4px;
|
||||
border-radius: 4px;
|
||||
-webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.05);
|
||||
-moz-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.05);
|
||||
box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.05);
|
||||
}
|
||||
|
||||
/*
|
||||
* lib/css/legacy/menus.css
|
||||
*/
|
||||
@ -3095,7 +3080,7 @@ body {
|
||||
.module-icons-stock{ background-position: 0 -660px; }
|
||||
.module-icons-support{ background-position: 0 -726px; }
|
||||
|
||||
.topbar-new-comments {
|
||||
.navbar-new-comments {
|
||||
margin: -3px 0px;
|
||||
padding: 2px;
|
||||
font-size: 14px;
|
||||
|
@ -168,9 +168,9 @@ div.std-footer-item {
|
||||
}
|
||||
|
||||
.layout_wrapper, .layout-wrapper {
|
||||
-moz-box-shadow: 1px 1px 8px #555;
|
||||
-webkit-box-shadow: 1px 1px 8px #555;
|
||||
box-shadow: 1px 1px 8px #555;
|
||||
-moz-box-shadow: 1px 1px 6px #AAA;
|
||||
-webkit-box-shadow: 1px 1px 6px #AAA;
|
||||
box-shadow: 1px 1px 6px #AAA;
|
||||
background-color: #fff;
|
||||
padding: 15px;
|
||||
}
|
||||
@ -212,21 +212,6 @@ div.std-footer-item {
|
||||
clear: both;
|
||||
}
|
||||
|
||||
.well {
|
||||
min-height: 20px;
|
||||
padding: 19px;
|
||||
margin-bottom: 20px;
|
||||
background-color: #f5f5f5;
|
||||
border: 1px solid #eee;
|
||||
border: 1px solid rgba(0, 0, 0, 0.05);
|
||||
-webkit-border-radius: 4px;
|
||||
-moz-border-radius: 4px;
|
||||
border-radius: 4px;
|
||||
-webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.05);
|
||||
-moz-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.05);
|
||||
box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.05);
|
||||
}
|
||||
|
||||
/*
|
||||
* lib/css/legacy/menus.css
|
||||
*/
|
||||
@ -1650,7 +1635,7 @@ body {
|
||||
.module-icons-stock{ background-position: 0 -660px; }
|
||||
.module-icons-support{ background-position: 0 -726px; }
|
||||
|
||||
.topbar-new-comments {
|
||||
.navbar-new-comments {
|
||||
margin: -3px 0px;
|
||||
padding: 2px;
|
||||
font-size: 14px;
|
||||
|
@ -57,21 +57,25 @@
|
||||
|
||||
.case-label {
|
||||
color: white;
|
||||
font-size: 14px;
|
||||
/*font-size: 12px;*/
|
||||
padding-top: 10px;
|
||||
text-align: center;
|
||||
text-shadow: 1px 1px 5px #000, 3px 3px 5px #000;
|
||||
}
|
||||
|
||||
/* Hover and click effects */
|
||||
.case-border:hover {
|
||||
animation: hover-effect 0.5s;
|
||||
-moz-animation: hover-effect 0.5s; /* Firefox */
|
||||
-webkit-animation: hover-effect 0.5s; /* Safari and Chrome */
|
||||
.case-border:hover, .circle:hover {
|
||||
animation: hover-effect 0.1s;
|
||||
-moz-animation: hover-effect 0.1s; /* Firefox */
|
||||
-webkit-animation: hover-effect 0.05s; /* Safari and Chrome */
|
||||
|
||||
animation-timing-function:linear;
|
||||
-moz-animation-timing-function:linear; /* Firefox */
|
||||
-webkit-animation-timing-function:linear; /* Safari and Chrome */
|
||||
box-shadow: 0 0 2px 0 black, 0 0 10px 1px white;
|
||||
}
|
||||
|
||||
.case-border:active, .case-border:focus {
|
||||
.case-border:active, .case-border:focus, .circle:active, .circle:focus {
|
||||
box-shadow: 0 0 5px 2px black;
|
||||
}
|
||||
|
||||
@ -93,3 +97,27 @@
|
||||
to {box-shadow: 0 0 2px 0 black, 0 0 10px 1px white;}
|
||||
}
|
||||
|
||||
.circle {
|
||||
border-radius: 100%;
|
||||
height: 15px;
|
||||
min-width: 15px;
|
||||
background: #B00D07;
|
||||
padding: 3px;
|
||||
z-index: 2;
|
||||
float: right;
|
||||
margin-top: -10px;
|
||||
margin-right: 10px;
|
||||
border: 2px solid white;
|
||||
box-shadow: 0 0 10px 1px black;
|
||||
}
|
||||
|
||||
.circle-text {
|
||||
color: white;
|
||||
font-size: 12px;
|
||||
vertical-align: middle;
|
||||
text-align: center;
|
||||
display: inline-block;
|
||||
margin-top: -2px;
|
||||
text-shadow: 1px 1px 5px #000;
|
||||
}
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
<div style="min-height: 300px; background: None; text-align: center;
|
||||
<div style="min-height: 500px; background: None; text-align: center;
|
||||
margin: 0px auto;">
|
||||
<div id="icon-grid">
|
||||
</div>
|
||||
|
@ -19,20 +19,23 @@ erpnext.desktop.refresh = function() {
|
||||
|
||||
erpnext.desktop.add_classes = function() {
|
||||
var classes = [
|
||||
{ name: 'red', start: '#A90329', middle: '#8F0222', end: '#6D0019' },
|
||||
{ name: 'brown', start: '#723e02', middle: '#633501', end: '#4a2700' },
|
||||
{ name: 'green', start: '#4b5602', middle: '#3f4901', end: '#313800' },
|
||||
{ name: 'blue', start: '#026584', middle: '#025770', end: '#004256' },
|
||||
{ name: 'yellow', start: '#be7902', middle: '#a66a02', end: '#865500' },
|
||||
{ name: 'purple', start: '#4d017d', middle: '#410169', end: '#310050' },
|
||||
{ name: 'ocean', start: '#02a47e', middle: '#018d6c', end: '#006a51' },
|
||||
{ name: 'pink', start: '#a40281', middle: '#8d016e', end: '#6a0053' },
|
||||
{ name: 'grey', start: '#545454', middle: '#484848', end: '#363636' },
|
||||
{ name: 'dark-red', start: '#68021a', middle: '#590116', end: '#440010' },
|
||||
{ name: 'leaf-green', start: '#b0a400', middle: '#968c00', end: '#726a00' },
|
||||
{ name: 'dark-blue', start: '#023bae', middle: '#013295', end: '#002672' },
|
||||
{ name: 'bright-green', start: '#03ad1f', middle: '#02941a', end: '#007213' },
|
||||
{ name: 'bright-yellow', start: '#ffd65e', middle: '#febf04', end: '#ed9017' },
|
||||
{ name: 'red', start: '#A90329', middle: '#8F0222', end: '#6D0019' },
|
||||
{ name: 'brown', start: '#723e02', middle: '#633501', end: '#4a2700' },
|
||||
{ name: 'green', start: '#4b5602', middle: '#3f4901', end: '#313800' },
|
||||
{ name: 'blue', start: '#026584', middle: '#025770', end: '#004256' },
|
||||
{ name: 'yellow', start: '#be7902', middle: '#a66a02', end: '#865500' },
|
||||
{ name: 'purple', start: '#4d017d', middle: '#410169', end: '#310050' },
|
||||
{ name: 'ocean', start: '#02a47e', middle: '#018d6c', end: '#006a51' },
|
||||
{ name: 'pink', start: '#a40281', middle: '#8d016e', end: '#6a0053' },
|
||||
{ name: 'grey', start: '#545454', middle: '#484848', end: '#363636' },
|
||||
{ name: 'dark-red', start: '#68021a', middle: '#590116', end: '#440010' },
|
||||
{ name: 'leaf-green', start: '#b0a400', middle: '#968c00', end: '#726a00' },
|
||||
//{ name: 'dark-blue', start: '#023bae', middle: '#013295', end: '#002672' },
|
||||
{ name: 'bright-green', start: '#03ad1f', middle: '#02941a', end: '#007213' },
|
||||
{ name: 'bright-yellow', start: '#ffd65e', middle: '#febf04', end: '#ed9017' },
|
||||
{ name: 'peacock', start: '#026584', middle: '#026584', end: '#322476' },
|
||||
{ name: 'violet', start: '#50448e', middle: '#473b7f', end: '#3a3169' },
|
||||
{ name: 'ultra-dark-green', start: '#014333', middle: '#01372b', end: '#002a20' },
|
||||
];
|
||||
$.each(classes, function(i, v) {
|
||||
$(repl(erpnext.desktop.gradient, v)).appendTo('head');
|
||||
@ -48,7 +51,7 @@ erpnext.desktop.render = function() {
|
||||
{ gradient: 'red', sprite: 'buying', label: 'Buying', link: '#!buying-home' },
|
||||
{ gradient: 'purple', sprite: 'support', label: 'Support', link: '#!support-home' },
|
||||
{ gradient: 'ocean', sprite: 'hr', label: 'Human<br />Resources', link: '#!hr-home' },
|
||||
{ gradient: 'red', sprite: 'project', label: 'Projects', link: '#!projects-home' },
|
||||
{ gradient: 'violet', sprite: 'project', label: 'Projects', link: '#!projects-home' },
|
||||
{ gradient: 'dark-red', sprite: 'production', label: 'Production', link: '#!production-home' },
|
||||
{ gradient: 'leaf-green', sprite: 'website', label: 'Website', link: '#!website-home' },
|
||||
{ gradient: 'grey', sprite: 'setting', label: 'Settings', link: '#!Setup' },
|
||||
@ -56,13 +59,13 @@ erpnext.desktop.render = function() {
|
||||
//{ gradient: 'dark-blue', sprite: 'report', label: 'Report' },
|
||||
{ gradient: 'pink', sprite: 'messages', label: 'Messages', link: '#!messages' },
|
||||
{ gradient: 'bright-yellow', sprite: 'todo', label: 'To Do', link: '#!todo' },
|
||||
{ gradient: 'red', sprite: 'calendar', label: 'Calendar', link: '#!calendar' },
|
||||
{ gradient: 'red', sprite: 'kb', label: 'Knowledge<br />Base', link: '#!questions' },
|
||||
{ gradient: 'peacock', sprite: 'calendar', label: 'Calendar', link: '#!calendar' },
|
||||
{ gradient: 'ultra-dark-green', sprite: 'kb', label: 'Knowledge<br />Base', link: '#!questions' },
|
||||
]
|
||||
|
||||
$.each(icons, function(i, v) {
|
||||
var icon_case = $('#icon-grid').append(repl('\
|
||||
<div class="case-wrapper"><a href=%(link)s>\
|
||||
<div id="%(sprite)s" class="case-wrapper"><a href="%(link)s">\
|
||||
<div class="case-border case-%(gradient)s">\
|
||||
<div class="sprite-image sprite-%(sprite)s"></div>\
|
||||
</div></a>\
|
||||
@ -70,6 +73,16 @@ erpnext.desktop.render = function() {
|
||||
</div>', v));
|
||||
});
|
||||
|
||||
erpnext.desktop.show_pending_notifications();
|
||||
|
||||
}
|
||||
|
||||
erpnext.desktop.show_pending_notifications = function() {
|
||||
$('#messages a:first').prepend('<div id="msg_count" class="circle">\
|
||||
<span class="circle-text"></span></div>');
|
||||
$('#msg_count').toggle(false);
|
||||
update_messages();
|
||||
|
||||
}
|
||||
|
||||
pscript.onload_desktop = function() {
|
||||
|
@ -15,6 +15,7 @@
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
import webnotes
|
||||
import _mysql_exceptions
|
||||
|
||||
def execute():
|
||||
from webnotes.modules import reload_doc
|
||||
@ -28,10 +29,16 @@ def execute():
|
||||
reload_doc('projects', 'page', 'projects_home')
|
||||
reload_doc('website', 'page', 'website_home')
|
||||
reload_doc('home', 'page', 'desktop')
|
||||
reload_doc('utilities', 'page', 'todo')
|
||||
reload_doc('utilities', 'page', 'calendar')
|
||||
|
||||
webnotes.conn.commit()
|
||||
webnotes.conn.sql("""create table __SchedulerLog (
|
||||
`timestamp` timestamp,
|
||||
method varchar(200),
|
||||
error text
|
||||
) engine=MyISAM""")
|
||||
|
||||
try:
|
||||
webnotes.conn.sql("""create table __SchedulerLog (
|
||||
`timestamp` timestamp,
|
||||
method varchar(200),
|
||||
error text
|
||||
) engine=MyISAM""")
|
||||
except _mysql_exceptions.OperationalError, e:
|
||||
pass
|
||||
|
@ -44,7 +44,7 @@ body {
|
||||
.module-icons-stock{ background-position: 0 -660px; }
|
||||
.module-icons-support{ background-position: 0 -726px; }
|
||||
|
||||
.topbar-new-comments {
|
||||
.navbar-new-comments {
|
||||
margin: -3px 0px;
|
||||
padding: 2px;
|
||||
font-size: 14px;
|
||||
|
@ -97,13 +97,22 @@ ModulePage = function(parent, module_name, module_label, help_page, callback) {
|
||||
var update_messages = function() {
|
||||
// Updates Team Messages
|
||||
|
||||
if(inList(['Guest', 'Administrator'], user)) { return; }
|
||||
if(inList(['Guest'], user)) { return; }
|
||||
|
||||
$c_page('home', 'event_updates', 'get_unread_messages', null,
|
||||
function(r,rt) {
|
||||
if(!r.exc) {
|
||||
// This function is defined in toolbar.js
|
||||
page_body.wntoolbar.set_new_comments(r.message);
|
||||
var circle = $('#msg_count')
|
||||
if(circle) {
|
||||
if(r.message.length) {
|
||||
circle.find('span:first').text(r.message.length);
|
||||
circle.toggle(true);
|
||||
} else {
|
||||
circle.toggle(false);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
);
|
||||
@ -117,7 +126,7 @@ erpnext.startup.set_periodic_updates = function() {
|
||||
clearInterval(wn.updates.id);
|
||||
}
|
||||
|
||||
wn.updates.id = setInterval(update_messages, 180000);
|
||||
wn.updates.id = setInterval(update_messages, 60000);
|
||||
}
|
||||
|
||||
// =======================================
|
||||
|
@ -211,7 +211,8 @@ wn.versions.check();$(document).bind('ready',function(){var base=window.location
|
||||
* lib/js/legacy/globals.js
|
||||
*/
|
||||
wn.provide('wn.widgets.form');wn.provide('wn.widgets.report');wn.provide('wn.utils');wn.provide('wn.model');wn.provide('wn.profile');wn.provide('wn.session');wn.provide('_f');wn.provide('_p');wn.provide('_r');wn.provide('_c');wn.provide('_e');wn.provide('_startup_data')
|
||||
wn.settings.no_history=1;var NEWLINE='\n';var login_file='';var version='v170';var profile=null;var session={};var is_testing=false;var user=null;var user_defaults=null;var user_roles=null;var user_fullname=null;var user_email=null;var user_img={};var home_page=null;var hide_autosuggest=null;var page_body=null;var pscript={};var selector=null;var top_index=91;var _f={};var _p={};var _e={};var _r={};var FILTER_SEP='\1';var frms={};var cur_frm=null;var pscript={};var validated=true;var validation_message='';var tinymce_loaded=null;var cur_autosug=null;
|
||||
wn.settings.no_history=1;var NEWLINE='\n';var login_file='';var version='v170';var profile=null;var session={};var is_testing=false;var user=null;var user_defaults=null;var user_roles=null;var user_fullname=null;var user_email=null;var user_img={};var home_page=null;var hide_autosuggest=null;var page_body=null;var pscript={};var selector=null;var top_index=91;var _f={};var _p={};var _e={};var _r={};var FILTER_SEP='\1';var _c={};var widget_files={'_f.FrmContainer':'form.compressed.js','_c.CalendarPopup':'widgets/form/date_picker.js','_r.ReportContainer':'report.compressed.js','_p.PrintQuery':'widgets/print_query.js','Calendar':'widgets/calendar.js','Recommendation':'widgets/recommend.js','RatingWidget':'widgets/rating.js'}
|
||||
var frms={};var cur_frm=null;var pscript={};var validated=true;var validation_message='';var tinymce_loaded=null;var cur_autosug=null;
|
||||
/*
|
||||
* lib/js/legacy/utils/datatype.js
|
||||
*/
|
||||
@ -850,8 +851,7 @@ Listing.prototype.std_cell=function(cell,ri,ci,d){var has_headrow=this.colnames?
|
||||
*/
|
||||
wn.widgets.Listing=function(opts){this.opts=opts;this.page_length=20;this.btns={};this.start=0;var me=this;this.make=function(opts){this.wrapper=$a(this.opts.parent,'div');this.filters_area=$a(this.wrapper,'div','listing-filters');this.toolbar_area=$a(this.wrapper,'div','listing-toolbar');this.results_area=$a(this.wrapper,'div','listing-results');this.more_button_area=$a(this.wrapper,'div','listing-more');this.no_results_area=$a(this.wrapper,'div','help_box',{display:'none'},(this.opts.no_result_message?this.opts.no_result_message:'No results'));if(opts)this.opts=opts;this.page_length=this.opts.page_length?this.opts.page_length:this.page_length;this.make_toolbar();this.make_filters();this.make_more_button();}
|
||||
this.make_filters=function(){if(this.opts.filters){$ds(this.filters_area);this.filters=new wn.widgets.FieldGroup(this.filters_area,this.opts.fields);}}
|
||||
this.make_toolbar=function(){if(!(this.opts.hide_refresh||this.opts.no_refresh)){if(this.opts.title){$a(this.toolbar_area,'h3','',{display:'inline-block',marginRight:'15px'},this.opts.title);}
|
||||
this.ref_img=$a(this.toolbar_area,'span','link_type',{color:'#888'},'[refresh]');this.ref_img.onclick=function(){me.run();}
|
||||
this.make_toolbar=function(){if(!(this.opts.hide_refresh||this.opts.no_refresh)){this.ref_img=$a(this.toolbar_area,'span','link_type',{color:'#888'},'[refresh]');this.ref_img.onclick=function(){me.run();}
|
||||
this.loading_img=$a(this.toolbar_area,'img','lib/images/ui/button-load.gif',{display:'none',marginLeft:'3px',marginBottom:'-2px'});}
|
||||
if(this.opts.new_doctype){this.new_btn=$btn(this.toolbar_area,'New '+get_doctype_label(this.opts.new_doctype),function(){newdoc(me.opts.new_doctype,me.opts.new_doc_onload,me.opts.new_doc_indialog,me.opts.new_doc_onsave);},{marginLeft:'7px'});}}
|
||||
this.make_more_button=function(){this.more_btn=$btn(this.more_button_area,'More...',function(){me.more_btn.set_working();me.run(function(){me.more_btn.done_working();},1);},'',0,1);$y(this.more_btn.loading_img,{marginBottom:'0px'});}
|
||||
@ -1202,7 +1202,8 @@ function get_local(dt,dn){return locals[dt]?locals[dt][dn]:null;}
|
||||
LocalDB.sync=function(list){if(list._kl)list=expand_doclist(list);for(var i=0;i<list.length;i++){var d=list[i];if(!d.name)
|
||||
d.name=LocalDB.get_localname(d.doctype);LocalDB.add(d.doctype,d.name);locals[d.doctype][d.name]=d;if(d.doctype=='DocType'){fields_list[d.name]=[];}else if(d.doctype=='DocField'){if(!d.parent){alert('Error: No parent specified for field "'+d.label+'"');}
|
||||
if(!fields_list[d.parent])fields_list[d.parent]=[];fields_list[d.parent][fields_list[d.parent].length]=d;if(!fields[d.parent])
|
||||
fields[d.parent]={};if(d.fieldname){fields[d.parent][d.fieldname]=d;}else if(d.label){fields[d.parent][d.label]=d;}}
|
||||
fields[d.parent]={};if(d.fieldname){fields[d.parent][d.fieldname]=d;}else if(d.label){fields[d.parent][d.label]=d;}}else if(d.doctype=='Event'){if((!d.localname)&&_c.calendar&&(!_c.calendar.has_event[d.name]))
|
||||
_c.calendar.set_event(d);}
|
||||
if(d.localname)
|
||||
notify_rename_observers(d.doctype,d.localname,d.name);}}
|
||||
local_name_idx={};LocalDB.get_localname=function(doctype){if(!local_name_idx[doctype])local_name_idx[doctype]=1;var n='New '+get_doctype_label(doctype)+' '+local_name_idx[doctype];local_name_idx[doctype]++;return n;}
|
||||
@ -2187,7 +2188,8 @@ d.innerHTML=html
|
||||
$(d).printElement();}
|
||||
_p.preview=function(html){var w=window.open('');w.document.write(html)
|
||||
w.document.close();}
|
||||
var resize_observers=[]
|
||||
function setup_calendar(){var p=new Page('_calendar');p.wrapper.style.height='100%';p.wrapper.onshow=function(){wn.require('lib/js/legacy/widgets/calendar.js');if(!_c.calendar){_c.calendar=new Calendar();_c.calendar.init(p.cont);rename_observers.push(_c.calendar);}}}
|
||||
startup_list.push(setup_calendar);var resize_observers=[]
|
||||
function set_resize_observer(fn){if(resize_observers.indexOf(fn)==-1)resize_observers.push(fn);}
|
||||
window.onresize=function(){return;var ht=get_window_height();for(var i=0;i<resize_observers.length;i++){resize_observers[i](ht);}}
|
||||
get_window_height=function(){var ht=window.innerHeight?window.innerHeight:document.documentElement.offsetHeight?document.documentElement.offsetHeight:document.body.offsetHeight;return ht;}
|
||||
@ -2212,10 +2214,11 @@ loadpage(nm,call_back);}
|
||||
ModulePage=function(parent,module_name,module_label,help_page,callback){this.parent=parent;page_body.cur_page.module_page=this;this.wrapper=$a(parent,'div');this.module_name=module_name;this.transactions=[];this.page_head=new PageHeader(this.wrapper,module_label);if(help_page){var btn=this.page_head.add_button('Help',function(){loadpage(this.help_page)},1,'ui-icon-help')
|
||||
btn.help_page=help_page;}
|
||||
if(callback)this.callback=function(){callback();}}
|
||||
var update_messages=function(){if(inList(['Guest','Administrator'],user)){return;}
|
||||
$c_page('home','event_updates','get_unread_messages',null,function(r,rt){if(!r.exc){page_body.wntoolbar.set_new_comments(r.message);}});}
|
||||
var update_messages=function(){if(inList(['Guest'],user)){return;}
|
||||
$c_page('home','event_updates','get_unread_messages',null,function(r,rt){if(!r.exc){page_body.wntoolbar.set_new_comments(r.message);var circle=$('#msg_count')
|
||||
if(circle){if(r.message.length){circle.find('span:first').text(r.message.length);circle.toggle(true);}else{circle.toggle(false);}}}});}
|
||||
erpnext.startup.set_periodic_updates=function(){wn.updates={};if(wn.updates.id){clearInterval(wn.updates.id);}
|
||||
wn.updates.id=setInterval(update_messages,180000);}
|
||||
wn.updates.id=setInterval(update_messages,60000);}
|
||||
$(document).bind('startup',function(){erpnext.startup.start();});
|
||||
/*
|
||||
* erpnext/startup/modules.js
|
||||
|
@ -137,7 +137,8 @@ wn.versions.check();$(document).bind('ready',function(){var base=window.location
|
||||
* lib/js/legacy/globals.js
|
||||
*/
|
||||
wn.provide('wn.widgets.form');wn.provide('wn.widgets.report');wn.provide('wn.utils');wn.provide('wn.model');wn.provide('wn.profile');wn.provide('wn.session');wn.provide('_f');wn.provide('_p');wn.provide('_r');wn.provide('_c');wn.provide('_e');wn.provide('_startup_data')
|
||||
wn.settings.no_history=1;var NEWLINE='\n';var login_file='';var version='v170';var profile=null;var session={};var is_testing=false;var user=null;var user_defaults=null;var user_roles=null;var user_fullname=null;var user_email=null;var user_img={};var home_page=null;var hide_autosuggest=null;var page_body=null;var pscript={};var selector=null;var top_index=91;var _f={};var _p={};var _e={};var _r={};var FILTER_SEP='\1';var frms={};var cur_frm=null;var pscript={};var validated=true;var validation_message='';var tinymce_loaded=null;var cur_autosug=null;
|
||||
wn.settings.no_history=1;var NEWLINE='\n';var login_file='';var version='v170';var profile=null;var session={};var is_testing=false;var user=null;var user_defaults=null;var user_roles=null;var user_fullname=null;var user_email=null;var user_img={};var home_page=null;var hide_autosuggest=null;var page_body=null;var pscript={};var selector=null;var top_index=91;var _f={};var _p={};var _e={};var _r={};var FILTER_SEP='\1';var _c={};var widget_files={'_f.FrmContainer':'form.compressed.js','_c.CalendarPopup':'widgets/form/date_picker.js','_r.ReportContainer':'report.compressed.js','_p.PrintQuery':'widgets/print_query.js','Calendar':'widgets/calendar.js','Recommendation':'widgets/recommend.js','RatingWidget':'widgets/rating.js'}
|
||||
var frms={};var cur_frm=null;var pscript={};var validated=true;var validation_message='';var tinymce_loaded=null;var cur_autosug=null;
|
||||
/*
|
||||
* lib/js/legacy/utils/datatype.js
|
||||
*/
|
||||
@ -665,8 +666,7 @@ this.widgets[d[1]]=b;}}
|
||||
*/
|
||||
wn.widgets.Listing=function(opts){this.opts=opts;this.page_length=20;this.btns={};this.start=0;var me=this;this.make=function(opts){this.wrapper=$a(this.opts.parent,'div');this.filters_area=$a(this.wrapper,'div','listing-filters');this.toolbar_area=$a(this.wrapper,'div','listing-toolbar');this.results_area=$a(this.wrapper,'div','listing-results');this.more_button_area=$a(this.wrapper,'div','listing-more');this.no_results_area=$a(this.wrapper,'div','help_box',{display:'none'},(this.opts.no_result_message?this.opts.no_result_message:'No results'));if(opts)this.opts=opts;this.page_length=this.opts.page_length?this.opts.page_length:this.page_length;this.make_toolbar();this.make_filters();this.make_more_button();}
|
||||
this.make_filters=function(){if(this.opts.filters){$ds(this.filters_area);this.filters=new wn.widgets.FieldGroup(this.filters_area,this.opts.fields);}}
|
||||
this.make_toolbar=function(){if(!(this.opts.hide_refresh||this.opts.no_refresh)){if(this.opts.title){$a(this.toolbar_area,'h3','',{display:'inline-block',marginRight:'15px'},this.opts.title);}
|
||||
this.ref_img=$a(this.toolbar_area,'span','link_type',{color:'#888'},'[refresh]');this.ref_img.onclick=function(){me.run();}
|
||||
this.make_toolbar=function(){if(!(this.opts.hide_refresh||this.opts.no_refresh)){this.ref_img=$a(this.toolbar_area,'span','link_type',{color:'#888'},'[refresh]');this.ref_img.onclick=function(){me.run();}
|
||||
this.loading_img=$a(this.toolbar_area,'img','lib/images/ui/button-load.gif',{display:'none',marginLeft:'3px',marginBottom:'-2px'});}
|
||||
if(this.opts.new_doctype){this.new_btn=$btn(this.toolbar_area,'New '+get_doctype_label(this.opts.new_doctype),function(){newdoc(me.opts.new_doctype,me.opts.new_doc_onload,me.opts.new_doc_indialog,me.opts.new_doc_onsave);},{marginLeft:'7px'});}}
|
||||
this.make_more_button=function(){this.more_btn=$btn(this.more_button_area,'More...',function(){me.more_btn.set_working();me.run(function(){me.more_btn.done_working();},1);},'',0,1);$y(this.more_btn.loading_img,{marginBottom:'0px'});}
|
||||
@ -899,7 +899,8 @@ function get_local(dt,dn){return locals[dt]?locals[dt][dn]:null;}
|
||||
LocalDB.sync=function(list){if(list._kl)list=expand_doclist(list);for(var i=0;i<list.length;i++){var d=list[i];if(!d.name)
|
||||
d.name=LocalDB.get_localname(d.doctype);LocalDB.add(d.doctype,d.name);locals[d.doctype][d.name]=d;if(d.doctype=='DocType'){fields_list[d.name]=[];}else if(d.doctype=='DocField'){if(!d.parent){alert('Error: No parent specified for field "'+d.label+'"');}
|
||||
if(!fields_list[d.parent])fields_list[d.parent]=[];fields_list[d.parent][fields_list[d.parent].length]=d;if(!fields[d.parent])
|
||||
fields[d.parent]={};if(d.fieldname){fields[d.parent][d.fieldname]=d;}else if(d.label){fields[d.parent][d.label]=d;}}
|
||||
fields[d.parent]={};if(d.fieldname){fields[d.parent][d.fieldname]=d;}else if(d.label){fields[d.parent][d.label]=d;}}else if(d.doctype=='Event'){if((!d.localname)&&_c.calendar&&(!_c.calendar.has_event[d.name]))
|
||||
_c.calendar.set_event(d);}
|
||||
if(d.localname)
|
||||
notify_rename_observers(d.doctype,d.localname,d.name);}}
|
||||
local_name_idx={};LocalDB.get_localname=function(doctype){if(!local_name_idx[doctype])local_name_idx[doctype]=1;var n='New '+get_doctype_label(doctype)+' '+local_name_idx[doctype];local_name_idx[doctype]++;return n;}
|
||||
@ -1026,7 +1027,8 @@ d.innerHTML=html
|
||||
$(d).printElement();}
|
||||
_p.preview=function(html){var w=window.open('');w.document.write(html)
|
||||
w.document.close();}
|
||||
var resize_observers=[]
|
||||
function setup_calendar(){var p=new Page('_calendar');p.wrapper.style.height='100%';p.wrapper.onshow=function(){wn.require('lib/js/legacy/widgets/calendar.js');if(!_c.calendar){_c.calendar=new Calendar();_c.calendar.init(p.cont);rename_observers.push(_c.calendar);}}}
|
||||
startup_list.push(setup_calendar);var resize_observers=[]
|
||||
function set_resize_observer(fn){if(resize_observers.indexOf(fn)==-1)resize_observers.push(fn);}
|
||||
window.onresize=function(){return;var ht=get_window_height();for(var i=0;i<resize_observers.length;i++){resize_observers[i](ht);}}
|
||||
get_window_height=function(){var ht=window.innerHeight?window.innerHeight:document.documentElement.offsetHeight?document.documentElement.offsetHeight:document.body.offsetHeight;return ht;}
|
||||
@ -1051,10 +1053,11 @@ loadpage(nm,call_back);}
|
||||
ModulePage=function(parent,module_name,module_label,help_page,callback){this.parent=parent;page_body.cur_page.module_page=this;this.wrapper=$a(parent,'div');this.module_name=module_name;this.transactions=[];this.page_head=new PageHeader(this.wrapper,module_label);if(help_page){var btn=this.page_head.add_button('Help',function(){loadpage(this.help_page)},1,'ui-icon-help')
|
||||
btn.help_page=help_page;}
|
||||
if(callback)this.callback=function(){callback();}}
|
||||
var update_messages=function(){if(inList(['Guest','Administrator'],user)){return;}
|
||||
$c_page('home','event_updates','get_unread_messages',null,function(r,rt){if(!r.exc){page_body.wntoolbar.set_new_comments(r.message);}});}
|
||||
var update_messages=function(){if(inList(['Guest'],user)){return;}
|
||||
$c_page('home','event_updates','get_unread_messages',null,function(r,rt){if(!r.exc){page_body.wntoolbar.set_new_comments(r.message);var circle=$('#msg_count')
|
||||
if(circle){if(r.message.length){circle.find('span:first').text(r.message.length);circle.toggle(true);}else{circle.toggle(false);}}}});}
|
||||
erpnext.startup.set_periodic_updates=function(){wn.updates={};if(wn.updates.id){clearInterval(wn.updates.id);}
|
||||
wn.updates.id=setInterval(update_messages,180000);}
|
||||
wn.updates.id=setInterval(update_messages,60000);}
|
||||
$(document).bind('startup',function(){erpnext.startup.start();});
|
||||
/*
|
||||
* erpnext/website/js/topbar.js
|
||||
|
@ -1 +1 @@
|
||||
669
|
||||
674
|
Loading…
x
Reference in New Issue
Block a user