mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-27 00:44:45 +00:00
Merge branch 'master' into production
This commit is contained in:
@@ -7,10 +7,11 @@
|
||||
"app/public/js/startup.css"
|
||||
],
|
||||
"public/js/all-web.js": [
|
||||
"app/public/js/startup.js",
|
||||
"app/public/js/conf.js"
|
||||
"app/public/js/website_utils.js"
|
||||
],
|
||||
"public/js/all-app.js": [
|
||||
"app/public/js/startup.js",
|
||||
"app/public/js/conf.js",
|
||||
"app/public/js/modules.js",
|
||||
"app/public/js/toolbar.js",
|
||||
"app/public/js/feature_setup.js",
|
||||
|
||||
@@ -94,7 +94,7 @@ EditableText = function(args) {
|
||||
<textarea class="ed-text-input %(inp_class)s hide"></textarea>\
|
||||
<div class="help hide"><br>Formatted as <a href="#markdown-reference"\
|
||||
target="_blank">markdown</a></div>\
|
||||
<button class="btn btn-small btn-info hide ed-text-save">Save</button>\
|
||||
<button class="btn btn-info hide ed-text-save">Save</button>\
|
||||
<a class="ed-text-cancel hide" style="cursor: pointer;">Cancel</a>\
|
||||
</div>', args)).appendTo(me.parent);
|
||||
|
||||
|
||||
@@ -136,23 +136,6 @@ erpnext.startup.set_periodic_updates = function() {
|
||||
wn.updates.id = setInterval(erpnext.update_messages, 60000);
|
||||
}
|
||||
|
||||
// subject, sender, description
|
||||
erpnext.send_message = function(opts) {
|
||||
if(opts.btn) {
|
||||
$(opts.btn).start_working();
|
||||
}
|
||||
wn.call({
|
||||
method: 'website.send_message',
|
||||
args: opts,
|
||||
callback: function(r) {
|
||||
if(opts.btn) {
|
||||
$(opts.btn).done_working();
|
||||
}
|
||||
if(opts.callback)opts.callback(r)
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
erpnext.hide_naming_series = function() {
|
||||
if(cur_frm.fields_dict.naming_series) {
|
||||
hide_field('naming_series');
|
||||
|
||||
53
public/js/website_utils.js
Normal file
53
public/js/website_utils.js
Normal file
@@ -0,0 +1,53 @@
|
||||
|
||||
var erpnext = {};
|
||||
|
||||
// subject, sender, description
|
||||
erpnext.send_message = function(opts) {
|
||||
if(opts.btn) {
|
||||
$(opts.btn).attr("disabled", "disabled");
|
||||
}
|
||||
|
||||
$.ajax({
|
||||
method: "POST",
|
||||
url: "server.py",
|
||||
data: {
|
||||
cmd: "website.send_message",
|
||||
subject: opts.subject,
|
||||
sender: opts.sender,
|
||||
message: typeof opts.message == "string"
|
||||
? opts.message
|
||||
: JSON.stringify(opts.message)
|
||||
},
|
||||
dataType: "json",
|
||||
success: function(data) {
|
||||
if(opts.btn) {
|
||||
$(opts.btn).attr("disabled", false);
|
||||
}
|
||||
if(opts.callback)
|
||||
opts.callback(data);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function valid_email(id) {
|
||||
if(id.toLowerCase().search("[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?")==-1)
|
||||
return 0; else return 1; }
|
||||
|
||||
function get_url_arg(name) {
|
||||
name = name.replace(/[\[]/,"\\\[").replace(/[\]]/,"\\\]");
|
||||
var regexS = "[\\?&]"+name+"=([^&#]*)";
|
||||
var regex = new RegExp( regexS );
|
||||
var results = regex.exec( window.location.href );
|
||||
if(results == null)
|
||||
return "";
|
||||
else
|
||||
return decodeURIComponent(results[1]);
|
||||
}
|
||||
|
||||
function repl(s, dict) {
|
||||
if(s==null)return '';
|
||||
for(key in dict) {
|
||||
s = s.split("%("+key+")s").join(dict[key]);
|
||||
}
|
||||
return s;
|
||||
}
|
||||
Reference in New Issue
Block a user