diff --git a/config.json b/config.json index 6ca9e453c8..51d656b777 100644 --- a/config.json +++ b/config.json @@ -1,6 +1,6 @@ { "base_template": "lib/website/templates/base.html", - "framework_version": "3.8.0", + "framework_version": "3.9.0", "modules": { "Calendar": { "color": "#2980b9", diff --git a/public/js/wn/model/meta.js b/public/js/wn/model/meta.js index b98d7ffa71..355b3d6b5a 100644 --- a/public/js/wn/model/meta.js +++ b/public/js/wn/model/meta.js @@ -93,13 +93,8 @@ $.extend(wn.meta, { }, get_print_formats: function(doctype) { - // if default print format is given, use it - var print_format_list = []; - if(locals.DocType[doctype].default_print_format) - print_format_list.push(locals.DocType[doctype].default_print_format) - - if(!in_list(print_format_list, "Standard")) - print_format_list.push("Standard"); + var print_format_list = ["Standard"]; + var default_print_format = locals.DocType[doctype].default_print_format; var print_formats = wn.model.get("Print Format", {doc_type: doctype}) .sort(function(a, b) { return (a > b) ? 1 : -1; }); @@ -107,6 +102,12 @@ $.extend(wn.meta, { if(!in_list(print_format_list, d.name)) print_format_list.push(d.name); }); + + if(default_print_format && default_print_format != "Standard") { + var index = print_format_list.indexOf(default_print_format) - 1; + print_format_list.sort().splice(index, 1); + print_format_list.unshift(default_print_format); + } return print_format_list; }, diff --git a/public/js/wn/ui/editor.js b/public/js/wn/ui/editor.js index c1d6d705b5..e2574f125b 100644 --- a/public/js/wn/ui/editor.js +++ b/public/js/wn/ui/editor.js @@ -125,7 +125,7 @@ bsEditor = Class.extend({ clean_html: function() { var html = this.editor.html() || ""; - if(!strip(this.editor.text())) html = ""; + if(!strip(this.editor.text()) && !(this.editor.find("img"))) html = ""; // html = html.replace(/(
|\s|

<\/div>| )*$/, ''); // remove custom typography (use CSS!) diff --git a/webnotes/build.py b/webnotes/build.py index 72837522d1..d83328a948 100644 --- a/webnotes/build.py +++ b/webnotes/build.py @@ -55,6 +55,9 @@ def clear_pyc_files(): from webnotes.utils import get_base_path for path, folders, files in os.walk(get_base_path()): if 'locale' in folders: folders.remove('locale') + if 'files' in folders: folders.remove('files') + if 'backups' in folders: folders.remove('backups') + for f in files: if f.decode("utf-8").endswith(".pyc"): os.remove(os.path.join(path, f)) diff --git a/webnotes/translate.py b/webnotes/translate.py index 41f6bd3c20..476ce19b97 100644 --- a/webnotes/translate.py +++ b/webnotes/translate.py @@ -277,6 +277,9 @@ def export_messages(lang, outfile): messages = {} # extract messages for (basepath, folders, files) in os.walk('.'): + if 'files' in folders: folders.remove('files') + if 'backups' in folders: folders.remove('backups') + def _get_messages(messages, basepath, mtype): mlist = get_messages(basepath, mtype) if not mlist: @@ -309,6 +312,9 @@ def import_messages(lang, infile): data = dict(get_all_messages_from_file(infile)) for (basepath, folders, files) in os.walk('.'): + if 'files' in folders: folders.remove('files') + if 'backups' in folders: folders.remove('backups') + def _update_lang_file(mtype): """create a langauge file for the given message type""" messages = get_messages(basepath, mtype)