Procházet zdrojové kódy

Merge branch 'develop'

version-14
Pratik Vyas před 11 roky
rodič
revize
02336b5823
5 změnil soubory, kde provedl 19 přidání a 9 odebrání
  1. +1
    -1
      config.json
  2. +8
    -7
      public/js/wn/model/meta.js
  3. +1
    -1
      public/js/wn/ui/editor.js
  4. +3
    -0
      webnotes/build.py
  5. +6
    -0
      webnotes/translate.py

+ 1
- 1
config.json Zobrazit soubor

@@ -1,6 +1,6 @@
{ {
"base_template": "lib/website/templates/base.html", "base_template": "lib/website/templates/base.html",
"framework_version": "3.8.0",
"framework_version": "3.9.0",
"modules": { "modules": {
"Calendar": { "Calendar": {
"color": "#2980b9", "color": "#2980b9",


+ 8
- 7
public/js/wn/model/meta.js Zobrazit soubor

@@ -93,13 +93,8 @@ $.extend(wn.meta, {
}, },
get_print_formats: function(doctype) { 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}) var print_formats = wn.model.get("Print Format", {doc_type: doctype})
.sort(function(a, b) { return (a > b) ? 1 : -1; }); .sort(function(a, b) { return (a > b) ? 1 : -1; });
@@ -107,6 +102,12 @@ $.extend(wn.meta, {
if(!in_list(print_format_list, d.name)) if(!in_list(print_format_list, d.name))
print_format_list.push(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; return print_format_list;
}, },


+ 1
- 1
public/js/wn/ui/editor.js Zobrazit soubor

@@ -125,7 +125,7 @@ bsEditor = Class.extend({
clean_html: function() { clean_html: function() {
var html = this.editor.html() || ""; var html = this.editor.html() || "";
if(!strip(this.editor.text())) html = "";
if(!strip(this.editor.text()) && !(this.editor.find("img"))) html = "";
// html = html.replace(/(<br>|\s|<div><br><\/div>|&nbsp;)*$/, ''); // html = html.replace(/(<br>|\s|<div><br><\/div>|&nbsp;)*$/, '');


// remove custom typography (use CSS!) // remove custom typography (use CSS!)


+ 3
- 0
webnotes/build.py Zobrazit soubor

@@ -55,6 +55,9 @@ def clear_pyc_files():
from webnotes.utils import get_base_path from webnotes.utils import get_base_path
for path, folders, files in os.walk(get_base_path()): for path, folders, files in os.walk(get_base_path()):
if 'locale' in folders: folders.remove('locale') 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: for f in files:
if f.decode("utf-8").endswith(".pyc"): if f.decode("utf-8").endswith(".pyc"):
os.remove(os.path.join(path, f)) os.remove(os.path.join(path, f))


+ 6
- 0
webnotes/translate.py Zobrazit soubor

@@ -277,6 +277,9 @@ def export_messages(lang, outfile):
messages = {} messages = {}
# extract messages # extract messages
for (basepath, folders, files) in os.walk('.'): 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): def _get_messages(messages, basepath, mtype):
mlist = get_messages(basepath, mtype) mlist = get_messages(basepath, mtype)
if not mlist: if not mlist:
@@ -309,6 +312,9 @@ def import_messages(lang, infile):
data = dict(get_all_messages_from_file(infile)) data = dict(get_all_messages_from_file(infile))
for (basepath, folders, files) in os.walk('.'): 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): def _update_lang_file(mtype):
"""create a langauge file for the given message type""" """create a langauge file for the given message type"""
messages = get_messages(basepath, mtype) messages = get_messages(basepath, mtype)


Načítá se…
Zrušit
Uložit