You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ofbiz.apache.org by de...@apache.org on 2017/10/28 11:21:34 UTC
svn commit: r1813609 - in /ofbiz/ofbiz-framework/trunk/themes/common:
template/macro/HtmlFormMacroLibrary.ftl webapp/common/js/util/OfbizUtil.js
widget/Theme.xml
Author: deepak
Date: Sat Oct 28 11:21:34 2017
New Revision: 1813609
URL: http://svn.apache.org/viewvc?rev=1813609&view=rev
Log:
Replace Inline Javascript with External Javascript (OFBIZ-9465)
Applied patch from jira ticket, Removed inline code for masking and elrte (WYSISYG editor).
Thanks Aditya Sharma for your contribution.
Modified:
ofbiz/ofbiz-framework/trunk/themes/common/template/macro/HtmlFormMacroLibrary.ftl
ofbiz/ofbiz-framework/trunk/themes/common/webapp/common/js/util/OfbizUtil.js
ofbiz/ofbiz-framework/trunk/themes/common/widget/Theme.xml
Modified: ofbiz/ofbiz-framework/trunk/themes/common/template/macro/HtmlFormMacroLibrary.ftl
URL: http://svn.apache.org/viewvc/ofbiz/ofbiz-framework/trunk/themes/common/template/macro/HtmlFormMacroLibrary.ftl?rev=1813609&r1=1813608&r2=1813609&view=diff
==============================================================================
--- ofbiz/ofbiz-framework/trunk/themes/common/template/macro/HtmlFormMacroLibrary.ftl (original)
+++ ofbiz/ofbiz-framework/trunk/themes/common/template/macro/HtmlFormMacroLibrary.ftl Sat Oct 28 11:21:34 2017
@@ -50,9 +50,7 @@ under the License.
<#macro renderTextField name className alert value textSize maxlength id event action disabled clientAutocomplete ajaxUrl ajaxEnabled mask tabindex readonly placeholder="" delegatorName="default">
<#if mask?has_content>
- <script type="text/javascript">
- jQuery(function($){jQuery("#${id}").mask("${mask}");});
- </script>
+ <#local className = className + " maskIt">
</#if>
<input type="text" name="${name?default("")?html}"<#t/>
<@renderClass className alert />
@@ -61,6 +59,7 @@ under the License.
<#if maxlength?has_content> maxlength="${maxlength}"</#if><#rt/>
<#if disabled?has_content && disabled> disabled="disabled"</#if><#rt/>
<#if readonly?has_content && readonly> readonly="readonly"</#if><#rt/>
+ <#if mask?has_content> data-mask="${mask}"</#if><#rt/>
<#if id?has_content> id="${id}"</#if><#rt/>
<#if event?has_content && action?has_content> ${event}="${action}"</#if><#rt/>
<#if clientAutocomplete?has_content && clientAutocomplete=="false"> autocomplete="off"</#if><#rt/>
@@ -76,6 +75,9 @@ under the License.
</#macro>
<#macro renderTextareaField name className alert cols rows maxlength id readonly value visualEditorEnable buttons tabindex language="">
+ <#if visualEditorEnable?has_content>
+ <#local className = className + " enableVisualEditor">
+ </#if>
<textarea name="${name}"<#t/>
<@renderClass className alert />
<#if cols?has_content> cols="${cols}"</#if><#rt/>
Modified: ofbiz/ofbiz-framework/trunk/themes/common/webapp/common/js/util/OfbizUtil.js
URL: http://svn.apache.org/viewvc/ofbiz/ofbiz-framework/trunk/themes/common/webapp/common/js/util/OfbizUtil.js?rev=1813609&r1=1813608&r2=1813609&view=diff
==============================================================================
--- ofbiz/ofbiz-framework/trunk/themes/common/webapp/common/js/util/OfbizUtil.js (original)
+++ ofbiz/ofbiz-framework/trunk/themes/common/webapp/common/js/util/OfbizUtil.js Sat Oct 28 11:21:34 2017
@@ -49,6 +49,25 @@ function bindObservers(bind_element) {
if (jQuery(".selectAll").is(":checked")) {
jQuery(".selectAll").removeAttr("checked").trigger("click");
}
+ jQuery(bind_element).find(".maskIt").each(function(){
+ var element = jQuery(this);
+ var mask = element.data('mask');
+ element.mask(mask);
+ });
+ jQuery(bind_element).find(".enableVisualEditor").each(function(){
+ var element = jQuery(this);
+ var toolbar = element.data('toolbar');
+ var language = element.data('language');
+ var opts = {
+ cssClass : 'el-rte',
+ lang : language,
+ toolbar : toolbar,
+ doctype : '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">', //'<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN">',
+ cssfiles : ['/images/jquery/plugins/elrte-1.3/css/elrte-inner.css']
+ }
+ element.elrte(opts);
+ });
+
}
/* SelectAll: This utility can be used when we need to use parent and child box combination over any page. Here is the list of tasks it will do:
Modified: ofbiz/ofbiz-framework/trunk/themes/common/widget/Theme.xml
URL: http://svn.apache.org/viewvc/ofbiz/ofbiz-framework/trunk/themes/common/widget/Theme.xml?rev=1813609&r1=1813608&r2=1813609&view=diff
==============================================================================
--- ofbiz/ofbiz-framework/trunk/themes/common/widget/Theme.xml (original)
+++ ofbiz/ofbiz-framework/trunk/themes/common/widget/Theme.xml Sat Oct 28 11:21:34 2017
@@ -76,7 +76,9 @@ under the License.
<property name="VT_HDR_JAVASCRIPT['add']" value="/common/js/jquery/plugins/jsTree/jquery.jstree.js"/>
<property name="VT_HDR_JAVASCRIPT['add']" value="/common/js/jquery/ui/js/jquery.cookie-1.4.0.js"/>
<property name="VT_HDR_JAVASCRIPT['add']" value="/common/js/plugins/date/FromThruDateCheck.js"/>
- <!--Css style-->
+ <property name="VT_HDR_JAVASCRIPT['add']" value="/images/jquery/plugins/elrte-1.3/js/elrte.min.js"/>
+ <!--Css style-->
+ <property name="VT_STYLESHEET['add']" value="/images/jquery/plugins/elrte-1.3/css/elrte.min.css"/>
</theme-properties>
<templates><!-- Freemarker template use by this theme to render widget model-->