瀏覽代碼

Merge branch 'develop'

version-14
Nabin Hait 8 年之前
父節點
當前提交
cd27a947d0
共有 5 個檔案被更改,包括 25 行新增10 行删除
  1. +1
    -1
      frappe/__init__.py
  2. +1
    -1
      frappe/docs/user/en/guides/basics/apps.md
  3. +1
    -1
      frappe/docs/user/fr/tutorial/web-views.md
  4. +20
    -6
      frappe/public/js/frappe/form/control.js
  5. +2
    -1
      frappe/website/doctype/web_form/templates/web_form.html

+ 1
- 1
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()


+ 1
- 1
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.


+ 1
- 1
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.



+ 20
- 6
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;
}


+ 2
- 1
frappe/website/doctype/web_form/templates/web_form.html 查看文件

@@ -350,9 +350,10 @@
{% block script %}

<script>
{% set seccess_msg = success_message.replace("'", "\'") %}
window.web_form_settings = {
allow_incomplete: {{ allow_incomplete or 0 }},
success_link: '<p>{{ success_message or _("Your information has been submitted") }}</p><p><a href="{{ success_url or "/" }}" class="btn btn-sm btn-default">{{ _("Continue") }}</a></p>',
success_link: '<p>{{ success_msg or _("Your information has been submitted") }}</p><p><a href="{{ success_url or "/" }}" class="btn btn-sm btn-default">{{ _("Continue") }}</a></p>',
datepicker_format: "{{ frappe.date_format }}",
web_form_doctype: "{{ doc_type }}",
web_form_name: "{{ name }}",


Loading…
取消
儲存