Procházet zdrojové kódy

[hot] login fix in base.html

version-14
Rushabh Mehta před 10 roky
rodič
revize
d0b33a7239
3 změnil soubory, kde provedl 12 přidání a 9 odebrání
  1. +2
    -2
      frappe/public/js/frappe/misc/utils.js
  2. +6
    -2
      frappe/public/js/lib/microtemplate.js
  3. +4
    -5
      frappe/templates/base.html

+ 2
- 2
frappe/public/js/frappe/misc/utils.js Zobrazit soubor

@@ -465,7 +465,7 @@ frappe.utils = {

frappe.utils.if_notify_permitted(function() {
var notify = new Notify(subject, {
body: body,
body: body.replace(/<[^>]*>/g, ""),
notifyClick: onclick
});
notify.show();
@@ -475,7 +475,7 @@ frappe.utils = {
set_title: function(title) {
frappe._original_title = title;
if(frappe._title_prefix) {
title = frappe._title_prefix + " " + title;
title = frappe._title_prefix + " " + title.replace(/<[^>]*>/g, "");
}
document.title = title;
},


+ 6
- 2
frappe/public/js/lib/microtemplate.js Zobrazit soubor

@@ -7,11 +7,15 @@ frappe.template.compile = function(str, name) {
if(str.indexOf("'")!==-1) {
console.warn("Warning: Single quotes (') may not work in templates");
}

// repace jinja style tags
str = str.replace(/{{/g, "{%=").replace(/}}/g, "%}");

if(!frappe.template.compiled[key]) {
fn_str = "var p=[],print=function(){p.push.apply(p,arguments)};" +

// Introduce the data as local variables using with(){}
"with(obj){p.push('" +
"with(obj){\np.push('" +

// Convert the template into pure JavaScript
str
@@ -19,7 +23,7 @@ frappe.template.compile = function(str, name) {
.split("{%").join("\t")
.replace(/((^|%})[^\t]*)'/g, "$1\r")
.replace(/\t=(.*?)%}/g, "',$1,'")
.split("\t").join("');")
.split("\t").join("');\n")
.split("%}").join("\np.push('")
.split("\r").join("\\'")
+ "');}return p.join('');";


+ 4
- 5
frappe/templates/base.html Zobrazit soubor

@@ -89,6 +89,10 @@
</div>
</div>
</div>
<!-- js should be loaded in body! -->
{%- for link in web_include_js %}
<script type="text/javascript" src="{{ link|with_leading_slash }}"></script>
{%- endfor -%}

{%- block script %}
<script data-html-block="script">
@@ -102,10 +106,5 @@
</script>
{%- endblock -%}
{%- block body_include %}{{ body_include or "" }}{% endblock -%}

<!-- js should be loaded in body! -->
{%- for link in web_include_js %}
<script type="text/javascript" src="{{ link|with_leading_slash }}"></script>
{%- endfor -%}
</body>
</html>

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