From c9456c18dc7c10627eb9079b8c534530fe4c49a4 Mon Sep 17 00:00:00 2001 From: Anand Doshi Date: Wed, 28 Mar 2012 17:48:30 +0530 Subject: [PATCH] listviews --- css/all-app.css | 4 +- css/all-web.css | 4 +- .../doctype/payable_voucher/listview.js | 39 ++++++++++++++++++ .../doctype/receivable_voucher/listview.js | 6 ++- erpnext/selling/doctype/customer/listview.js | 18 +++++++++ erpnext/selling/doctype/enquiry/listview.js | 37 +++++++++++++++++ erpnext/selling/doctype/lead/listview.js | 2 +- erpnext/selling/doctype/quotation/listview.js | 40 +++++++++++++++++++ .../selling/doctype/sales_order/listview.js | 6 +-- erpnext/stock/doctype/item/listview.js | 22 ++++++++++ .../doctype/support_ticket/listview.js | 9 ++++- js/all-app.js | 16 ++++---- js/all-web.js | 16 ++++---- version.num | 2 +- 14 files changed, 195 insertions(+), 26 deletions(-) create mode 100644 erpnext/accounts/doctype/payable_voucher/listview.js create mode 100644 erpnext/selling/doctype/customer/listview.js create mode 100644 erpnext/selling/doctype/enquiry/listview.js create mode 100644 erpnext/selling/doctype/quotation/listview.js create mode 100644 erpnext/stock/doctype/item/listview.js diff --git a/css/all-app.css b/css/all-app.css index c2a67306cf..f30d1cfaca 100644 --- a/css/all-app.css +++ b/css/all-app.css @@ -1589,10 +1589,12 @@ div.list-row table { div.list-row table td { overflow: hidden; - padding-right: 3px; + /*padding-right: 3px;*/ + padding: 0px 3px; vertical-align: middle; height: 24px; max-height: 24px; + word-wrap: break-word; } div.paging-button { diff --git a/css/all-web.css b/css/all-web.css index d818b7f81f..ad1304ba1f 100644 --- a/css/all-web.css +++ b/css/all-web.css @@ -1674,10 +1674,12 @@ div.list-row table { div.list-row table td { overflow: hidden; - padding-right: 3px; + /*padding-right: 3px;*/ + padding: 0px 3px; vertical-align: middle; height: 24px; max-height: 24px; + word-wrap: break-word; } div.paging-button { diff --git a/erpnext/accounts/doctype/payable_voucher/listview.js b/erpnext/accounts/doctype/payable_voucher/listview.js new file mode 100644 index 0000000000..6dc8f99b93 --- /dev/null +++ b/erpnext/accounts/doctype/payable_voucher/listview.js @@ -0,0 +1,39 @@ +// render +wn.doclistviews['Payable Voucher'] = wn.views.ListView.extend({ + init: function(d) { + this._super(d); + this.fields = this.fields.concat([ + '`tabPayable Voucher`.supplier_name', + '`tabPayable Voucher`.currency', + 'IFNULL(`tabPayable Voucher`.grand_total_import, 0) as grand_total_import', + 'IFNULL(`tabPayable Voucher`.grand_total, 0) as grand_total', + 'IFNULL(`tabPayable Voucher`.outstanding_amount, 0) as outstanding_amount', + ]); + this.stats = this.stats.concat(['company']); + }, + + prepare_data: function(data) { + this._super(data); + data.paid = flt( + ((data.grand_total - data.outstanding_amount) / data.grand_total) * 100, + 2); + }, + + columns: [ + {width: '5%', content: 'avatar'}, + {width: '3%', content: 'docstatus'}, + {width: '15%', content: 'name'}, + {width: '37%', content: 'tags+supplier_name', css: {color: '#aaa'}}, + { + width: '18%', + content: function(parent, data) { + $(parent).html(data.currency + ' ' + fmt_money(data.grand_total_import)) + }, + css: {'text-align':'right'} + }, + {width: '10%', content: 'paid', type:'bar-graph', label:'Paid'}, + {width: '12%', content:'modified', css: { + 'text-align': 'right', 'color':'#777' + }}, + ] +}); diff --git a/erpnext/accounts/doctype/receivable_voucher/listview.js b/erpnext/accounts/doctype/receivable_voucher/listview.js index d30431ff32..ebedd516b6 100644 --- a/erpnext/accounts/doctype/receivable_voucher/listview.js +++ b/erpnext/accounts/doctype/receivable_voucher/listview.js @@ -3,12 +3,14 @@ wn.doclistviews['Receivable Voucher'] = wn.views.ListView.extend({ init: function(d) { this._super(d) this.fields = this.fields.concat([ - "`tabReceivable Voucher`.customer", + "`tabReceivable Voucher`.customer_name", "ifnull(`tabReceivable Voucher`.outstanding_amount,0) as outstanding_amount", "ifnull(`tabReceivable Voucher`.grand_total,0) as grand_total", "`tabReceivable Voucher`.currency", "ifnull(`tabReceivable Voucher`.grand_total_export,0) as grand_total_export" ]); + + this.stats = this.stats.concat(['company']); }, prepare_data: function(data) { this._super(data); @@ -18,7 +20,7 @@ wn.doclistviews['Receivable Voucher'] = wn.views.ListView.extend({ {width: '5%', content:'avatar'}, {width: '3%', content:'docstatus'}, {width: '15%', content:'name'}, - {width: '37%', content:'tags+customer', css: {color:'#aaa'}}, + {width: '37%', content:'tags+customer_name', css: {color:'#aaa'}}, { width: '18%', content: function(parent, data) { diff --git a/erpnext/selling/doctype/customer/listview.js b/erpnext/selling/doctype/customer/listview.js new file mode 100644 index 0000000000..3ac705aa49 --- /dev/null +++ b/erpnext/selling/doctype/customer/listview.js @@ -0,0 +1,18 @@ +// render +wn.doclistviews['Customer'] = wn.views.ListView.extend({ + init: function(d) { + this._super(d) + this.fields = this.fields.concat([ + "`tabCustomer`.customer_name", + "`tabCustomer`.territory", + ]); + }, + + columns: [ + {width: '5%', content:'avatar'}, + {width: '53%', content:'name'}, + {width: '10%', content:'tags'}, + {width: '20%', content:'territory', css: {'color': '#aaa'}}, + {width: '12%', content:'modified', css: {'text-align': 'right', 'color':'#777'}} + ] +}); diff --git a/erpnext/selling/doctype/enquiry/listview.js b/erpnext/selling/doctype/enquiry/listview.js new file mode 100644 index 0000000000..1bd1b96e94 --- /dev/null +++ b/erpnext/selling/doctype/enquiry/listview.js @@ -0,0 +1,37 @@ +wn.doclistviews['Enquiry'] = wn.views.ListView.extend({ + init: function(d) { + this._super(d) + this.fields = this.fields.concat([ + 'tabEnquiry.enquiry_from', + 'tabEnquiry.lead_name', + 'tabEnquiry.customer_name', + 'tabEnquiry.status', + ]); + this.stats = this.stats.concat(['status', 'source', 'enquiry_from', 'company']); + }, + + prepare_data: function(data) { + this._super(data); + if(['Order Confirmed', 'Quotation Sent'] + .indexOf(data.status)!=-1) { + data.label_type = 'success'; + } else if(data.status == 'Draft') { + data.label_type = 'info'; + } else if(data.status == 'Submit') { + data.label_type = 'important'; + } + data.status_html = repl('%(status)s', data); + if(data.enquiry_from == 'Lead') { + data.enquiry_name = repl('[%(enquiry_from)s] %(lead_name)s', data); + } else { + data.enquiry_name = repl('[%(enquiry_from)s] %(customer_name)s', data); + } + }, + + columns: [ + {width: '15%', content:'name'}, + {width: '18%', content:'status_html'}, + {width: '55%', content:'tags+enquiry_name', css: {color:'#aaa'}}, + {width: '12%', content:'modified', css: {'text-align': 'right', 'color':'#777'}} + ] +}) diff --git a/erpnext/selling/doctype/lead/listview.js b/erpnext/selling/doctype/lead/listview.js index b5ed6b8c80..4751c64e23 100644 --- a/erpnext/selling/doctype/lead/listview.js +++ b/erpnext/selling/doctype/lead/listview.js @@ -7,7 +7,7 @@ wn.doclistviews['Lead'] = wn.views.ListView.extend({ 'tabLead.source', 'tabLead.rating' ]); - this.stats = this.stats.concat(['status', 'source', 'rating']); + this.stats = this.stats.concat(['status', 'source', 'rating', 'company']); }, prepare_data: function(data) { diff --git a/erpnext/selling/doctype/quotation/listview.js b/erpnext/selling/doctype/quotation/listview.js new file mode 100644 index 0000000000..1489df3479 --- /dev/null +++ b/erpnext/selling/doctype/quotation/listview.js @@ -0,0 +1,40 @@ +// render +wn.doclistviews['Quotation'] = wn.views.ListView.extend({ + init: function(d) { + this._super(d) + this.fields = this.fields.concat([ + "`tabQuotation`.quotation_to", + "`tabQuotation`.lead_name", + "`tabQuotation`.customer_name", + "`tabQuotation`.currency", + "ifnull(`tabQuotation`.grand_total_export,0) as grand_total_export" + ]); + this.stats = this.stats.concat(['status', 'quotation_to', 'company']); + }, + + prepare_data: function(data) { + this._super(data); + if(data.quotation_to == 'Lead') { + data.quotation_name = repl('[%(quotation_to)s] %(lead_name)s', data); + } else { + data.quotation_name = repl('[%(quotation_to)s] %(customer_name)s', data); + } + }, + + columns: [ + {width: '5%', content:'avatar'}, + {width: '3%', content:'docstatus'}, + {width: '15%', content:'name'}, + {width: '47%', content:'tags+quotation_name', css: {color:'#aaa'}}, + { + width: '18%', + content: function(parent, data) { + $(parent).html(data.currency + ' ' + fmt_money(data.grand_total_export)) + }, + css: {'text-align':'right'} + }, + {width: '12%', content:'modified', css: {'text-align': 'right', 'color':'#777'}} + ] + +}); + diff --git a/erpnext/selling/doctype/sales_order/listview.js b/erpnext/selling/doctype/sales_order/listview.js index c0b3895d8a..3b764d191a 100644 --- a/erpnext/selling/doctype/sales_order/listview.js +++ b/erpnext/selling/doctype/sales_order/listview.js @@ -9,14 +9,14 @@ wn.doclistviews['Sales Order'] = wn.views.ListView.extend({ "`tabSales Order`.currency", "ifnull(`tabSales Order`.grand_total_export,0) as grand_total_export" ]); - this.stats = this.stats.concat(['status']); + this.stats = this.stats.concat(['status', 'company']); }, columns: [ {width: '5%', content:'avatar'}, {width: '3%', content:'docstatus'}, {width: '15%', content:'name'}, - {width: '37%', content:'tags+customer_name', css: {color:'#aaa'}}, + {width: '35%', content:'tags+customer_name', css: {color:'#aaa'}}, { width: '18%', content: function(parent, data) { @@ -26,7 +26,7 @@ wn.doclistviews['Sales Order'] = wn.views.ListView.extend({ }, {width: '8%', content: 'per_delivered', type:'bar-graph', label:'Delivered'}, {width: '8%', content: 'per_billed', type:'bar-graph', label:'Billed'}, - {width: '10%', content:'modified', css: {'text-align': 'right', 'color':'#777'}} + {width: '12%', content:'modified', css: {'text-align': 'right', 'color':'#777'}} ] }); diff --git a/erpnext/stock/doctype/item/listview.js b/erpnext/stock/doctype/item/listview.js new file mode 100644 index 0000000000..af41abfdc9 --- /dev/null +++ b/erpnext/stock/doctype/item/listview.js @@ -0,0 +1,22 @@ +// render +wn.doclistviews['Item'] = wn.views.ListView.extend({ + init: function(d) { + this._super(d) + this.fields = this.fields.concat([ + "`tabItem`.item_name", + "`tabItem`.description", + ]); + }, + + prepare_data: function(data) { + this._super(data); + data.description = repl("[%(item_name)s] %(description)s", data); + }, + + columns: [ + {width: '5%', content:'avatar'}, + {width: '20%', content:'name'}, + {width: '63%', content:'description', css: {'color': '#aaa'}}, + {width: '12%', content:'modified', css: {'text-align': 'right', 'color':'#777'}} + ] +}); diff --git a/erpnext/support/doctype/support_ticket/listview.js b/erpnext/support/doctype/support_ticket/listview.js index 87c122491d..67ba9ea457 100644 --- a/erpnext/support/doctype/support_ticket/listview.js +++ b/erpnext/support/doctype/support_ticket/listview.js @@ -1,5 +1,7 @@ // render wn.doclistviews['Support Ticket'] = wn.views.ListView.extend({ + me: this, + init: function(d) { this._super(d) this.fields = this.fields.concat([ @@ -26,8 +28,13 @@ wn.doclistviews['Support Ticket'] = wn.views.ListView.extend({ data.status = 'Waiting' } data.status_html = repl('%(status)s', data); + var a = $(data.status_html).click(function() { + me.set_filter('status', $(this).text()); + }); - data.description = data.description + ' | ' + data.subject; + // replace double quote with blank string + data.description = cstr(data.subject).replace(/"/gi, '') + + " | " + cstr(data.description).replace(/"/gi, ''); // description if(data.description && data.description.length > 50) { diff --git a/js/all-app.js b/js/all-app.js index 564ee1eee0..b0d4061ef5 100644 --- a/js/all-app.js +++ b/js/all-app.js @@ -387,7 +387,7 @@ this.listview.parent=this;},init_list:function(){this.make({method:'webnotes.wid Delete',function(){me.delete_items();},'.btn-filter')}},delete_items:function(){var me=this;var dl=$.map(me.$page.find('.list-delete:checked'),function(e){return $(e).data('name');});if(!dl.length) return;if(!confirm('This is PERMANENT action and you cannot undo. Continue?')){return;} me.set_working(true);wn.call({method:'webnotes.widgets.doclistview.delete_items',args:{items:dl,doctype:me.doctype},callback:function(){me.set_working(false);me.refresh();}})},init_stats:function(){var me=this -wn.call({method:'webnotes.widgets.doclistview.get_stats',args:{stats:me.listview.stats,doctype:me.doctype},callback:function(r){$.each(r.message,function(field,stat){me.render_stat(field,stat);});}});},render_stat:function(field,stat){var me=this;if(!stat||!stat.length){if(field=='_user_tags'){this.$page.find('.layout-side-section').append('

Tags

\ +wn.call({method:'webnotes.widgets.doclistview.get_stats',args:{stats:me.listview.stats,doctype:me.doctype},callback:function(r){$.each(me.listview.stats,function(i,v){me.render_stat(v,r.message[v]);});}});},render_stat:function(field,stat){var me=this;if(!stat||!stat.length){if(field=='_user_tags'){this.$page.find('.layout-side-section').append('

Tags

\
No records tagged.

\ To add a tag, open the document and click on \ "Add Tag" on the sidebar
');} @@ -408,16 +408,16 @@ args.label=v[0];args.width=flt(v[1])/max*100;args.count=v[1];args.field=field;$i this.run();}});wn.views.ListView=Class.extend({init:function(doclistview){this.doclistview=doclistview;this.doctype=doclistview.doctype;var t="`tab"+this.doctype+"`.";this.fields=[t+'name',t+'owner',t+'docstatus',t+'_user_tags',t+'modified'];this.stats=['_user_tags'];if(!this.doclistview.can_delete){this.columns=$.map(this.columns,function(v,i){if(v.content!='check')return v});}},columns:[{width:'3%',content:'check'},{width:'4%',content:'avatar'},{width:'3%',content:'docstatus',css:{"text-align":"center"}},{width:'35%',content:'name'},{width:'40%',content:'tags',css:{'color':'#aaa'}},{width:'15%',content:'modified',css:{'text-align':'right','color':'#777'}}],render_column:function(data,parent,opts){var me=this;if(opts.css){$.each(opts.css,function(k,v){$(parent).css(k,v)});} if(opts.content.indexOf&&opts.content.indexOf('+')!=-1){$.map(opts.content.split('+'),function(v){me.render_column(data,parent,{content:v});});return;} if(typeof opts.content=='function'){opts.content(parent,data);} -else if(opts.content=='name'){$(parent).html(repl('%(name)s',data));} -else if(opts.content=='avatar'){$(parent).html(repl('%(name)s',data));} +else if(opts.content=='avatar'){$(parent).append(repl('',data));} -else if(opts.content=='check'){$(parent).html('');$(parent).find('input').data('name',data.name);} -else if(opts.content=='docstatus'){$(parent).html(repl('');$(parent).find('input').data('name',data.name);} +else if(opts.content=='docstatus'){$(parent).append(repl('',data));} else if(opts.content=='tags'){this.add_user_tags(parent,data);} else if(opts.content=='modified'){$(parent).append(data.when);} else if(opts.type=='bar-graph'){args={percent:data[opts.content],fully_delivered:(data[opts.content]>99?'bar-complete':''),label:opts.label} -$(parent).html(repl('\ \ @@ -455,7 +455,7 @@ throw"Incomplete Request";}} wn.request.cleanup=function(opts,r){if(opts.btn)$(opts.btn).done_working();if(opts.show_spinner)hide_loading();if(opts.freeze)unfreeze();if(wn.boot.sid&&wn.get_cookie('sid')!=wn.boot.sid){msgprint('Session expired');setTimeout('redirect_to_login()',3000);return;} if(r.server_messages)msgprint(r.server_messages) if(r.exc){errprint(r.exc);console.log(r.exc);};if(r.docs)LocalDB.sync(r.docs);} -wn.request.call=function(opts){wn.request.prepare(opts);$.ajax({url:opts.url||wn.request.url,data:opts.args,type:opts.type||'POST',dataType:opts.dataType||'json',success:function(r,xhr){wn.request.cleanup(opts,r);opts.success(r,xhr.responseText);},error:function(xhr,textStatus){wn.request.cleanup(opts,{});msgprint('Unable to complete request: '+textStatus) +wn.request.call=function(opts){wn.request.prepare(opts);$.ajax({url:opts.url||wn.request.url,data:opts.args,type:opts.type||'POST',dataType:opts.dataType||'json',success:function(r,xhr){wn.request.cleanup(opts,r);opts.success(r,xhr.responseText);},error:function(xhr,textStatus){wn.request.cleanup(opts,{});show_alert('Unable to complete request: '+textStatus) if(opts.error)opts.error(xhr)}})} wn.call=function(opts){var args=$.extend({},opts.args) if(opts.module&&opts.page){args.cmd=opts.module+'.page.'+opts.page+'.'+opts.page+'.'+opts.method}else if(opts.method){args.cmd=opts.method;} @@ -511,7 +511,7 @@ var strip=function(s,chars){var s=lstrip(s,chars) s=rstrip(s,chars);return s;} var lstrip=function(s,chars){if(!chars)chars=['\n','\t',' '];var first_char=s.substr(0,1);while(in_list(chars,first_char)){var s=s.substr(1);first_char=s.substr(0,1);} return s;} -var rstrip=function(s,chars){if(!chars)chars=['\n','\t',' '];var last_char=s.substr(s.length-1);while(in_list(chars,last_char)){var s=s.substr(0,this.length-1);last_char=s.substr(this.length-1);} +var rstrip=function(s,chars){if(!chars)chars=['\n','\t',' '];var last_char=s.substr(s.length-1);while(in_list(chars,last_char)){var s=s.substr(0,s.length-1);last_char=s.substr(s.length-1);} return s;} function repl_all(s,s1,s2){var idx=s.indexOf(s1);while(idx!=-1){s=s.replace(s1,s2);idx=s.indexOf(s1);} return s;} diff --git a/js/all-web.js b/js/all-web.js index fffcdcb513..7cb875ff53 100644 --- a/js/all-web.js +++ b/js/all-web.js @@ -301,7 +301,7 @@ this.listview.parent=this;},init_list:function(){this.make({method:'webnotes.wid Delete',function(){me.delete_items();},'.btn-filter')}},delete_items:function(){var me=this;var dl=$.map(me.$page.find('.list-delete:checked'),function(e){return $(e).data('name');});if(!dl.length) return;if(!confirm('This is PERMANENT action and you cannot undo. Continue?')){return;} me.set_working(true);wn.call({method:'webnotes.widgets.doclistview.delete_items',args:{items:dl,doctype:me.doctype},callback:function(){me.set_working(false);me.refresh();}})},init_stats:function(){var me=this -wn.call({method:'webnotes.widgets.doclistview.get_stats',args:{stats:me.listview.stats,doctype:me.doctype},callback:function(r){$.each(r.message,function(field,stat){me.render_stat(field,stat);});}});},render_stat:function(field,stat){var me=this;if(!stat||!stat.length){if(field=='_user_tags'){this.$page.find('.layout-side-section').append('

Tags

\ +wn.call({method:'webnotes.widgets.doclistview.get_stats',args:{stats:me.listview.stats,doctype:me.doctype},callback:function(r){$.each(me.listview.stats,function(i,v){me.render_stat(v,r.message[v]);});}});},render_stat:function(field,stat){var me=this;if(!stat||!stat.length){if(field=='_user_tags'){this.$page.find('.layout-side-section').append('

Tags

\
No records tagged.

\ To add a tag, open the document and click on \ "Add Tag" on the sidebar
');} @@ -322,16 +322,16 @@ args.label=v[0];args.width=flt(v[1])/max*100;args.count=v[1];args.field=field;$i this.run();}});wn.views.ListView=Class.extend({init:function(doclistview){this.doclistview=doclistview;this.doctype=doclistview.doctype;var t="`tab"+this.doctype+"`.";this.fields=[t+'name',t+'owner',t+'docstatus',t+'_user_tags',t+'modified'];this.stats=['_user_tags'];if(!this.doclistview.can_delete){this.columns=$.map(this.columns,function(v,i){if(v.content!='check')return v});}},columns:[{width:'3%',content:'check'},{width:'4%',content:'avatar'},{width:'3%',content:'docstatus',css:{"text-align":"center"}},{width:'35%',content:'name'},{width:'40%',content:'tags',css:{'color':'#aaa'}},{width:'15%',content:'modified',css:{'text-align':'right','color':'#777'}}],render_column:function(data,parent,opts){var me=this;if(opts.css){$.each(opts.css,function(k,v){$(parent).css(k,v)});} if(opts.content.indexOf&&opts.content.indexOf('+')!=-1){$.map(opts.content.split('+'),function(v){me.render_column(data,parent,{content:v});});return;} if(typeof opts.content=='function'){opts.content(parent,data);} -else if(opts.content=='name'){$(parent).html(repl('%(name)s',data));} -else if(opts.content=='avatar'){$(parent).html(repl('%(name)s',data));} +else if(opts.content=='avatar'){$(parent).append(repl('',data));} -else if(opts.content=='check'){$(parent).html('');$(parent).find('input').data('name',data.name);} -else if(opts.content=='docstatus'){$(parent).html(repl('');$(parent).find('input').data('name',data.name);} +else if(opts.content=='docstatus'){$(parent).append(repl('',data));} else if(opts.content=='tags'){this.add_user_tags(parent,data);} else if(opts.content=='modified'){$(parent).append(data.when);} else if(opts.type=='bar-graph'){args={percent:data[opts.content],fully_delivered:(data[opts.content]>99?'bar-complete':''),label:opts.label} -$(parent).html(repl('\ \ @@ -369,7 +369,7 @@ throw"Incomplete Request";}} wn.request.cleanup=function(opts,r){if(opts.btn)$(opts.btn).done_working();if(opts.show_spinner)hide_loading();if(opts.freeze)unfreeze();if(wn.boot.sid&&wn.get_cookie('sid')!=wn.boot.sid){msgprint('Session expired');setTimeout('redirect_to_login()',3000);return;} if(r.server_messages)msgprint(r.server_messages) if(r.exc){errprint(r.exc);console.log(r.exc);};if(r.docs)LocalDB.sync(r.docs);} -wn.request.call=function(opts){wn.request.prepare(opts);$.ajax({url:opts.url||wn.request.url,data:opts.args,type:opts.type||'POST',dataType:opts.dataType||'json',success:function(r,xhr){wn.request.cleanup(opts,r);opts.success(r,xhr.responseText);},error:function(xhr,textStatus){wn.request.cleanup(opts,{});msgprint('Unable to complete request: '+textStatus) +wn.request.call=function(opts){wn.request.prepare(opts);$.ajax({url:opts.url||wn.request.url,data:opts.args,type:opts.type||'POST',dataType:opts.dataType||'json',success:function(r,xhr){wn.request.cleanup(opts,r);opts.success(r,xhr.responseText);},error:function(xhr,textStatus){wn.request.cleanup(opts,{});show_alert('Unable to complete request: '+textStatus) if(opts.error)opts.error(xhr)}})} wn.call=function(opts){var args=$.extend({},opts.args) if(opts.module&&opts.page){args.cmd=opts.module+'.page.'+opts.page+'.'+opts.page+'.'+opts.method}else if(opts.method){args.cmd=opts.method;} @@ -425,7 +425,7 @@ var strip=function(s,chars){var s=lstrip(s,chars) s=rstrip(s,chars);return s;} var lstrip=function(s,chars){if(!chars)chars=['\n','\t',' '];var first_char=s.substr(0,1);while(in_list(chars,first_char)){var s=s.substr(1);first_char=s.substr(0,1);} return s;} -var rstrip=function(s,chars){if(!chars)chars=['\n','\t',' '];var last_char=s.substr(s.length-1);while(in_list(chars,last_char)){var s=s.substr(0,this.length-1);last_char=s.substr(this.length-1);} +var rstrip=function(s,chars){if(!chars)chars=['\n','\t',' '];var last_char=s.substr(s.length-1);while(in_list(chars,last_char)){var s=s.substr(0,s.length-1);last_char=s.substr(s.length-1);} return s;} function repl_all(s,s1,s2){var idx=s.indexOf(s1);while(idx!=-1){s=s.replace(s1,s2);idx=s.indexOf(s1);} return s;} diff --git a/version.num b/version.num index 805a9f80ae..3bd8434bbd 100644 --- a/version.num +++ b/version.num @@ -1 +1 @@ -1460 \ No newline at end of file +1492 \ No newline at end of file