From b691fd1df55c9a7d59c82746eadecd2bc01ccba0 Mon Sep 17 00:00:00 2001 From: Rushabh Mehta Date: Thu, 7 May 2015 16:05:05 +0530 Subject: [PATCH] [minor] form sidebar extension --- frappe/public/js/frappe/form/form_sidebar.html | 3 +++ frappe/public/js/lib/microtemplate.js | 13 +++++++------ 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/frappe/public/js/frappe/form/form_sidebar.html b/frappe/public/js/frappe/form/form_sidebar.html index 9f45716c1e..b77400f0fb 100644 --- a/frappe/public/js/frappe/form/form_sidebar.html +++ b/frappe/public/js/frappe/form/form_sidebar.html @@ -40,3 +40,6 @@
  • +{% if(frappe.get_form_sidebar_extension) { %} + {{ frappe.get_form_sidebar_extension() }} +{% } %} diff --git a/frappe/public/js/lib/microtemplate.js b/frappe/public/js/lib/microtemplate.js index 27aa366082..7ba68d0b13 100644 --- a/frappe/public/js/lib/microtemplate.js +++ b/frappe/public/js/lib/microtemplate.js @@ -4,14 +4,15 @@ frappe.template = {compiled: {}, debug:{}}; frappe.template.compile = function(str, name) { var key = name || str; - 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]) { + if(str.indexOf("'")!==-1) { + console.warn("Warning: Single quotes (') may not work in templates"); + } + + // repace jinja style tags + str = str.replace(/{{/g, "{%=").replace(/}}/g, "%}"); + fn_str = "var _p=[],print=function(){_p.push.apply(_p,arguments)};" + // Introduce the data as local variables using with(){}