added selling-home
This commit is contained in:
@@ -861,7 +861,7 @@ Listing.prototype.std_cell=function(cell,ri,ci,d){var has_headrow=this.colnames?
|
||||
$di(this.more_btn);}}
|
||||
Listing.prototype.make_headings=function(t,nr,nc){for(var ci=0;ci<nc;ci++){var tmp=make_table($td(t,0,ci),1,2,'100%',['','0px'],this.opts.head_style);$y(tmp,{tableLayout:'fixed',borderCollapse:'collapse'});$y($td(t,0,ci),this.opts.head_main_style);$td(t,0,ci).sort_cell=$td(tmp,0,1);$td(t,0,ci).label_cell=$td(tmp,0,0);$td(tmp,0,1).style.padding='0px';$td(tmp,0,0).innerHTML=this.colnames[ci]?this.colnames[ci]:' ';if(this.sort_list[ci])this.set_sort($td(t,0,ci),ci,this.sort_list[ci]);var div=$a($td(t,0,ci),'div');$td(t,0,ci).style.borderBottom='1px solid #CCC';if(this.coltypes&&this.coltypes[ci]&&in_list(['Currency','Float','Int'],this.coltypes[ci]))$y($td(t,0,ci).label_cell,{textAlign:'right'})}}
|
||||
Listing.prototype.std_cell=function(cell,ri,ci,d){var has_headrow=this.colnames?1:0;cell.div=$a(cell,'div');$s(cell.div,d[ri][ci],this.coltypes?this.coltypes[ci+(this.no_index?0:1)]:null,this.coloptions?this.coloptions[ci+(this.no_index?0:1)]:null);}
|
||||
/*
|
||||
/*
|
||||
* lib/js/wn/ui/listing.js
|
||||
*/
|
||||
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();}
|
||||
@@ -873,8 +873,9 @@ if(this.onrun)this.onrun();if(this.opts.onrun)this.opts.onrun();}
|
||||
this.clear=function(){this.results_area.innerHTML='';this.table=null;$ds(this.results_area);$dh(this.no_results_area);}
|
||||
this.make_results=function(r,rt){if(this.start==0)this.clear();$dh(this.more_button_area);if(this.loading_img)$dh(this.loading_img)
|
||||
if(r.values&&r.values.length){this.values=r.values;var m=Math.min(r.values.length,this.page_length);for(var i=0;i<m;i++){var row=this.add_row();this.opts.render_row(row,r.values[i],this,i);}
|
||||
this.start+=m;if(r.values.length>this.page_length)$ds(this.more_button_area);}else{if(this.start==0){$dh(this.results_area);$ds(this.no_results_area);}}
|
||||
if(this.onrun)this.onrun();if(this.opts.onrun)this.opts.onrun();}
|
||||
this.start+=m;if(r.values.length>this.page_length)$ds(this.more_button_area);}else{if(this.start==0){$dh(this.results_area);$ds(this.no_results_area);}}
|
||||
if(this.onrun)this.onrun();if(this.opts.onrun)this.opts.onrun();}
|
||||
this.add_row=function(){return $a(this.results_area,'div','',(opts.cell_style?opts.cell_style:{padding:'3px 0px'}));}
|
||||
this.run=function(callback,append){if(callback)
|
||||
this.onrun=callback;if(!append)
|
||||
this.start=0;if(!this.opts.method){this.query=this.opts.get_query?this.opts.get_query():this.opts.query;this.add_limits();var args={query_max:this.query_max||this.opts.query_max||'',as_dict:1}
|
||||
@@ -1161,21 +1162,21 @@ $c('webnotes.widgets.page.getpage',{'name':page_name,stylesheets:JSON.stringify(
|
||||
if(pdoc.stylesheet){set_style(locals.Stylesheet[pdoc.stylesheet].stylesheet);stylesheets.push(pdoc.stylesheet);}
|
||||
var p=new Page(page_name,pdoc._Page__content?pdoc._Page__content:pdoc.content);var script=pdoc.__script?pdoc.__script:pdoc.script;p.doc=pdoc;if(script){eval(script);}
|
||||
page_body.change_to(page_name);return p;}
|
||||
function refresh_page(page_name){var fn=function(r,rt){render_page(page_name)}
|
||||
$c('webnotes.widgets.page.getpage',{'name':page_name,stylesheets:JSON.stringify(stylesheets)},fn);}
|
||||
function refresh_page(page_name){var fn=function(r,rt){render_page(page_name)}
|
||||
$c('webnotes.widgets.page.getpage',{'name':page_name,stylesheets:JSON.stringify(stylesheets)},fn);}
|
||||
/*
|
||||
* lib/js/legacy/wn/page_layout.js
|
||||
*/
|
||||
wn.PageLayout=function(args){$.extend(this,args)
|
||||
this.wrapper=$a(this.parent,'div','layout-wrapper layout-wrapper-background');this.main=$a(this.wrapper,'div','layout-main-section');this.sidebar_area=$a(this.wrapper,'div','layout-side-section');$a(this.wrapper,'div','',{clear:'both'});this.head=$a(this.main,'div');this.toolbar_area=$a(this.main,'div');this.body=$a(this.main,'div');this.footer=$a(this.main,'div');if(this.heading){this.page_head=new PageHeader(this.head,this.heading);}}
|
||||
/*
|
||||
/*
|
||||
* lib/js/legacy/wn/widgets/page_sidebar.js
|
||||
*/
|
||||
wn.widgets.PageSidebar=function(parent,opts){this.opts=opts
|
||||
this.sections={}
|
||||
this.wrapper=$a(parent,'div','psidebar-wrapper')
|
||||
this.wrapper=$a(parent,'div','psidebar')
|
||||
this.refresh=function(){this.wrapper.innerHTML=''
|
||||
if(this.opts.title)
|
||||
if(this.opts.title)
|
||||
this.make_head();for(var i=0;i<this.opts.sections.length;i++){var section=this.opts.sections[i];if((section.display&§ion.display())||!section.display){this.sections[section.title]=new wn.widgets.PageSidebarSection(this,section);}}
|
||||
if(this.opts.onrefresh){this.opts.onrefresh(this)}}
|
||||
this.make_head=function(){this.head=$a(this.wrapper,'div','head','',this.opts.title);}
|
||||
@@ -1186,7 +1187,7 @@ else
|
||||
this.items[item.label]=new wn.widgets.PageSidebarButton(this,this.opts.items[i],div);else if(item.type.toLowerCase()=='html')
|
||||
this.items[item.label]=new wn.widgets.PageSidebarHTML(this,this.opts.items[i],div);}
|
||||
this.add_icon=function(parent,icon){if(icon.substr(0,3)=='ic-'){var img=$a(parent,'div','wn-icon '+icon,{cssFloat:'left',marginRight:'7px',marginBottom:'-3px'});}else{var img=$a(parent,'img','',{marginRight:'7px',marginBottom:'-3px'});img.src='lib/images/icons/'+icon;}}
|
||||
this.refresh=function(){this.body.innerHTML='';if(this.opts.render){this.opts.render(this.body);}
|
||||
this.refresh=function(){this.body.innerHTML='';if(this.opts.render){this.opts.render(this.body);}
|
||||
else
|
||||
this.make_items();}
|
||||
this.refresh();}
|
||||
|
||||
Reference in New Issue
Block a user