diff --git a/frappe/__init__.py b/frappe/__init__.py index e17a925e46..9f5c5d65fc 100644 --- a/frappe/__init__.py +++ b/frappe/__init__.py @@ -14,7 +14,7 @@ import os, sys, importlib, inspect, json from .exceptions import * from .utils.jinja import get_jenv, get_template, render_template -__version__ = '8.3.6' +__version__ = '8.3.7' __title__ = "Frappe Framework" local = Local() diff --git a/frappe/docs/user/en/guides/basics/apps.md b/frappe/docs/user/en/guides/basics/apps.md index 13731f8b2c..5805ad38af 100755 --- a/frappe/docs/user/en/guides/basics/apps.md +++ b/frappe/docs/user/en/guides/basics/apps.md @@ -12,7 +12,7 @@ Frappe ships with a boiler plate for a new app. The command `bench make-app app-name` helps you start a new app by starting an interactive shell. - % bench make-app sample_app + % bench new-app sample_app App Name: sample_app App Title: Sample App App Description: This is a sample app. diff --git a/frappe/docs/user/fr/tutorial/web-views.md b/frappe/docs/user/fr/tutorial/web-views.md index e6f301082f..9b0f80a0e9 100644 --- a/frappe/docs/user/fr/tutorial/web-views.md +++ b/frappe/docs/user/fr/tutorial/web-views.md @@ -1,7 +1,7 @@ # Les vues web Frappe a deux principaux environnements, le **bureau** et **le web**. Le **bureau** est un environnement riche AJAX alors -que **le web** est une collection plus traditionnelle de fichers HTML pour la consultation publique. Les vues web peuvent +que **le web** est une collection plus traditionnelle de fichiers HTML pour la consultation publique. Les vues web peuvent aussi être générées pour créer des vues plus controllées pour les utilisateurs qui peuvent se connecter mais qui n'ont pas accès au desk. diff --git a/frappe/public/js/frappe/form/control.js b/frappe/public/js/frappe/form/control.js index cc7c4f35e9..a6b4a1130b 100755 --- a/frappe/public/js/frappe/form/control.js +++ b/frappe/public/js/frappe/form/control.js @@ -1166,6 +1166,7 @@ frappe.ui.form.ControlAttachImage = frappe.ui.form.ControlAttach.extend({ this.set_image(); }, refresh_input: function() { + this._super(); $(this.wrapper).find('.btn-attach').addClass('hidden'); this.set_image(); if(this.get_status()=="Read") { @@ -1723,11 +1724,10 @@ frappe.ui.form.ControlTextEditor = frappe.ui.form.ControlCode.extend({ }); }, onChange: function(value) { - if(this._setting_value) return; me.parse_validate_and_set_in_model(value); }, onKeydown: function(e) { - this._last_change_on = new Date(); + me._last_change_on = new Date(); var key = frappe.ui.keys.get_key(e); // prevent 'New DocType (Ctrl + B)' shortcut in editor if(['ctrl+b', 'meta+b'].indexOf(key) !== -1) { @@ -1846,20 +1846,34 @@ frappe.ui.form.ControlTextEditor = frappe.ui.form.ControlCode.extend({ this.last_value = value; }, set_in_editor: function(value) { - // set value after user has stopped editing + // set values in editor only if + // 1. value not be set in the last 500ms + // 2. user has not typed anything in the last 3seconds + // --- + // we will attempt to cleanup the user's DOM, hence if this happens + // in the middle of the user is typing, it creates a lot of issues + // also firefox tends to reset the cursor for some reason if the values + // are reset + + if(this.__setting_value) { // we don't understand how the internal triggers work, // so quit return; } - if(!this._last_change_on || (moment() - moment(this._last_change_on) > 3000)) { + let time_since_last_keystroke = moment() - moment(this._last_change_on); + + if(!this._last_change_on || (time_since_last_keystroke > 3000)) { this.__setting_value = setTimeout(() => this.__setting_value = null, 500); this.editor.summernote('code', value); } else { this._setting_value = setInterval(() => { - if(moment() - moment(this._last_change_on) > 3000) { - this.editor.summernote('code', this.last_value); + if(time_since_last_keystroke > 3000) { + if(this.last_value !== this.get_input_value()) { + // if not already in sync, reset + this.editor.summernote('code', this.last_value); + } clearInterval(this._setting_value); this._setting_value = null; } diff --git a/frappe/website/doctype/web_form/templates/web_form.html b/frappe/website/doctype/web_form/templates/web_form.html index a1cbbb0240..476f084b22 100644 --- a/frappe/website/doctype/web_form/templates/web_form.html +++ b/frappe/website/doctype/web_form/templates/web_form.html @@ -350,9 +350,10 @@ {% block script %}