diff --git a/.eslintrc b/.eslintrc index 3711a7dbe6..eadbd5eb52 100644 --- a/.eslintrc +++ b/.eslintrc @@ -58,8 +58,6 @@ "frappe": true, "Vue": true, "__": true, - "_p": true, - "_f": true, "repl": true, "Class": true, "locals": true, diff --git a/frappe/public/js/frappe/form/form.js b/frappe/public/js/frappe/form/form.js index 5935232548..9ee755d605 100644 --- a/frappe/public/js/frappe/form/form.js +++ b/frappe/public/js/frappe/form/form.js @@ -500,7 +500,7 @@ frappe.ui.form.Form = class FrappeForm { }).then(() => { me.show_success_action(); }).catch((e) => { - console.error(e); + console.error(e); // eslint-disable-line }); } @@ -929,10 +929,6 @@ frappe.ui.form.Form = class FrappeForm { } } - set_print_heading(txt) { - this.pformat[this.docname] = txt; - } - show_success_action() { const route = frappe.get_route(); if (route[0] !== 'Form') return; @@ -1027,7 +1023,7 @@ frappe.ui.form.Form = class FrappeForm { toggle_enable(fnames, enable) { this.field_map(fnames, function(field) { field.read_only = enable ? 0 : 1; - }) + }); } toggle_reqd(fnames, mandatory) { @@ -1346,11 +1342,11 @@ frappe.validated = 0; // Proxy for frappe.validated Object.defineProperty(window, 'validated', { get: function() { - console.warn('Please use `frappe.validated` instead of `validated`. It will be deprecated soon.'); + console.warn('Please use `frappe.validated` instead of `validated`. It will be deprecated soon.'); // eslint-disable-line return frappe.validated; }, set: function(value) { - console.warn('Please use `frappe.validated` instead of `validated`. It will be deprecated soon.'); + console.warn('Please use `frappe.validated` instead of `validated`. It will be deprecated soon.'); // eslint-disable-line frappe.validated = value; return frappe.validated; } diff --git a/frappe/public/js/frappe/utils/jquery_plugins.js b/frappe/public/js/frappe/utils/jquery_plugins.js index a1caaea1da..10c86797b4 100644 --- a/frappe/public/js/frappe/utils/jquery_plugins.js +++ b/frappe/public/js/frappe/utils/jquery_plugins.js @@ -4,20 +4,19 @@ // create options for(var i=0, j=options_list.length; i').html(cstr(label)) @@ -28,12 +27,12 @@ // select the first option this.selectedIndex = 0; return $(this); - } + }; $.fn.set_working = function() { this.prop('disabled', true); - } + }; $.fn.done_working = function() { this.prop('disabled', false); - } + }; })(jQuery); diff --git a/frappe/public/js/frappe/utils/tools.js b/frappe/public/js/frappe/utils/tools.js index cac4e5ab4f..7d6fc5b2f1 100644 --- a/frappe/public/js/frappe/utils/tools.js +++ b/frappe/public/js/frappe/utils/tools.js @@ -56,7 +56,7 @@ frappe.markdown = function(txt) { var txt1 = []; $.each(txt.split("\n"), function(i, t) { txt1.push(t.substr(whitespace_len)); - }) + }); txt = txt1.join("\n"); } diff --git a/frappe/public/js/frappe/utils/urllib.js b/frappe/public/js/frappe/utils/urllib.js index e6aba73717..bcbd71058a 100644 --- a/frappe/public/js/frappe/utils/urllib.js +++ b/frappe/public/js/frappe/utils/urllib.js @@ -1,7 +1,7 @@ frappe.urllib = { // get argument from url get_arg: function(name) { - name = name.replace(/[\[]/,"\\\[").replace(/[\]]/,"\\\]"); + name = name.replace(/[[]/, "\\[").replace(/[\]]/,"\\]"); var regexS = "[\\?&]"+name+"=([^&#]*)"; var regex = new RegExp( regexS ); var results = regex.exec( window.location.href ); @@ -13,7 +13,7 @@ frappe.urllib = { // returns url dictionary get_dict: function() { - var d = {} + var d = {}; var t = window.location.href.split('?')[1]; if(!t) return d; @@ -31,9 +31,9 @@ frappe.urllib = { // returns the base url with http + domain + path (-index.cgi or # or ?) get_base_url: function() { // var url= (frappe.base_url || window.location.href).split('#')[0].split('?')[0].split('desk')[0]; - var url = (frappe.base_url || window.location.origin) - if(url.substr(url.length-1, 1)=='/') url = url.substr(0, url.length-1) - return url + var url = (frappe.base_url || window.location.origin); + if(url.substr(url.length-1, 1)=='/') url = url.substr(0, url.length-1); + return url; }, // returns absolute url