felix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cziege...@apache.org
Subject svn commit: r1648350 - in /felix/trunk/webconsole: pom.xml src/main/resources/res/lib/jquery.autosize.min.js src/main/resources/res/lib/support.js src/main/resources/res/ui/config.js src/main/resources/templates/main_header.html
Date Mon, 29 Dec 2014 14:24:04 GMT
Author: cziegeler
Date: Mon Dec 29 14:24:03 2014
New Revision: 1648350

URL: http://svn.apache.org/r1648350
Log:
FELIX-4007 : enable multiline inputs in Web Console Configuration. Apply patch from Oliver
Lietz

Added:
    felix/trunk/webconsole/src/main/resources/res/lib/jquery.autosize.min.js   (with props)
Modified:
    felix/trunk/webconsole/pom.xml
    felix/trunk/webconsole/src/main/resources/res/lib/support.js
    felix/trunk/webconsole/src/main/resources/res/ui/config.js
    felix/trunk/webconsole/src/main/resources/templates/main_header.html

Modified: felix/trunk/webconsole/pom.xml
URL: http://svn.apache.org/viewvc/felix/trunk/webconsole/pom.xml?rev=1648350&r1=1648349&r2=1648350&view=diff
==============================================================================
--- felix/trunk/webconsole/pom.xml (original)
+++ felix/trunk/webconsole/pom.xml Mon Dec 29 14:24:03 2014
@@ -184,6 +184,7 @@
                         <exclude>src/main/resources/res/lib/jquery-1.8.3.js</exclude>
                         <exclude>src/main/resources/res/lib/jquery-ui-1.9.2.js</exclude>
                         <exclude>src/main/resources/res/lib/jquery-ui-i18n-1.7.2.js</exclude>
+                        <exclude>src/main/resources/res/lib/jquery.autosize.min.js</exclude>
                         <exclude>src/main/resources/res/lib/jquery.cookies-2.2.0.js</exclude>
                         <exclude>src/main/resources/res/lib/jquery.multifile-1.4.6.js</exclude>
                         <exclude>src/main/resources/res/lib/jquery.tablesorter-2.0.3.js</exclude>

Added: felix/trunk/webconsole/src/main/resources/res/lib/jquery.autosize.min.js
URL: http://svn.apache.org/viewvc/felix/trunk/webconsole/src/main/resources/res/lib/jquery.autosize.min.js?rev=1648350&view=auto
==============================================================================
--- felix/trunk/webconsole/src/main/resources/res/lib/jquery.autosize.min.js (added)
+++ felix/trunk/webconsole/src/main/resources/res/lib/jquery.autosize.min.js Mon Dec 29 14:24:03
2014
@@ -0,0 +1,7 @@
+/*!
+	Autosize v1.18.9 - 2014-05-27
+	Automatically adjust textarea height based on user input.
+	(c) 2014 Jack Moore - http://www.jacklmoore.com/autosize
+	license: http://www.opensource.org/licenses/mit-license.php
+*/
+(function(e){var t,o={className:"autosizejs",id:"autosizejs",append:"",callback:!1,resizeDelay:10,placeholder:!0},i='<textarea
tabindex="-1" style="position:absolute; top:-999px; left:0; right:auto; bottom:auto; border:0;
padding: 0; -moz-box-sizing:content-box; -webkit-box-sizing:content-box; box-sizing:content-box;
word-wrap:break-word; height:0 !important; min-height:0 !important; overflow:hidden; transition:none;
-webkit-transition:none; -moz-transition:none;"/>',n=["fontFamily","fontSize","fontWeight","fontStyle","letterSpacing","textTransform","wordSpacing","textIndent"],s=e(i).data("autosize",!0)[0];s.style.lineHeight="99px","99px"===e(s).css("lineHeight")&&n.push("lineHeight"),s.style.lineHeight="",e.fn.autosize=function(i){return
this.length?(i=e.extend({},o,i||{}),s.parentNode!==document.body&&e(document.body).append(s),this.each(function(){function
o(){var t,o=window.getComputedStyle?window.getComputedStyle(u,null):!1;o?(t=u.getBoundingClientRect().width,(0===t||"number"!
 =typeof t)&&(t=parseInt(o.width,10)),e.each(["paddingLeft","paddingRight","borderLeftWidth","borderRightWidth"],function(e,i){t-=parseInt(o[i],10)})):t=p.width(),s.style.width=Math.max(t,0)+"px"}function
a(){var a={};if(t=u,s.className=i.className,s.id=i.id,d=parseInt(p.css("maxHeight"),10),e.each(n,function(e,t){a[t]=p.css(t)}),e(s).css(a).attr("wrap",p.attr("wrap")),o(),window.chrome){var
r=u.style.width;u.style.width="0px",u.offsetWidth,u.style.width=r}}function r(){var e,n;t!==u?a():o(),s.value=!u.value&&i.placeholder?(p.attr("placeholder")||"")+i.append:u.value+i.append,s.style.overflowY=u.style.overflowY,n=parseInt(u.style.height,10),s.scrollTop=0,s.scrollTop=9e4,e=s.scrollTop,d&&e>d?(u.style.overflowY="scroll",e=d):(u.style.overflowY="hidden",c>e&&(e=c)),e+=w,n!==e&&(u.style.height=e+"px",f&&i.callback.call(u,u))}function
l(){clearTimeout(h),h=setTimeout(function(){var e=p.width();e!==g&&(g=e,r())},parseInt(i.resizeDelay,10))}var
d,c,h,u=this,p=e(u),w=0,f=e.isFunction(i.callb
 ack),z={height:u.style.height,overflow:u.style.overflow,overflowY:u.style.overflowY,wordWrap:u.style.wordWrap,resize:u.style.resize},g=p.width(),y=p.css("resize");p.data("autosize")||(p.data("autosize",!0),("border-box"===p.css("box-sizing")||"border-box"===p.css("-moz-box-sizing")||"border-box"===p.css("-webkit-box-sizing"))&&(w=p.outerHeight()-p.height()),c=Math.max(parseInt(p.css("minHeight"),10)-w||0,p.height()),p.css({overflow:"hidden",overflowY:"hidden",wordWrap:"break-word"}),"vertical"===y?p.css("resize","none"):"both"===y&&p.css("resize","horizontal"),"onpropertychange"in
u?"oninput"in u?p.on("input.autosize keyup.autosize",r):p.on("propertychange.autosize",function(){"value"===event.propertyName&&r()}):p.on("input.autosize",r),i.resizeDelay!==!1&&e(window).on("resize.autosize",l),p.on("autosize.resize",r),p.on("autosize.resizeIncludeStyle",function(){t=null,r()}),p.on("autosize.destroy",function(){t=null,clearTimeout(h),e(window).off("resize",l),p.off("autosize").off(".aut
 osize").css(z).removeData("autosize")}),r())})):this}})(window.jQuery||window.$);

Propchange: felix/trunk/webconsole/src/main/resources/res/lib/jquery.autosize.min.js
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: felix/trunk/webconsole/src/main/resources/res/lib/jquery.autosize.min.js
------------------------------------------------------------------------------
    svn:keywords = Id

Propchange: felix/trunk/webconsole/src/main/resources/res/lib/jquery.autosize.min.js
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Modified: felix/trunk/webconsole/src/main/resources/res/lib/support.js
URL: http://svn.apache.org/viewvc/felix/trunk/webconsole/src/main/resources/res/lib/support.js?rev=1648350&r1=1648349&r2=1648350&view=diff
==============================================================================
--- felix/trunk/webconsole/src/main/resources/res/lib/support.js (original)
+++ felix/trunk/webconsole/src/main/resources/res/lib/support.js Mon Dec 29 14:24:03 2014
@@ -241,6 +241,10 @@ function Xdialog(text) {
 
 	sb.push(">");
 
+    if (name == "textarea") {
+        sb.push("</textarea>");
+    }
+
 	var el = $(sb.join(""));
 
 	if (cssClass) {

Modified: felix/trunk/webconsole/src/main/resources/res/ui/config.js
URL: http://svn.apache.org/viewvc/felix/trunk/webconsole/src/main/resources/res/ui/config.js?rev=1648350&r1=1648349&r2=1648350&view=diff
==============================================================================
--- felix/trunk/webconsole/src/main/resources/res/ui/config.js (original)
+++ felix/trunk/webconsole/src/main/resources/res/ui/config.js Mon Dec 29 14:24:03 2014
@@ -132,6 +132,9 @@ function displayConfigForm(obj) {
 		.attr('__location', obj.bundleLocation?obj.bundleLocation:'')
 		.dialog('option', 'title', obj.title)
 		.dialog('open'));
+
+	// autosize
+	$('textarea').trigger('autosize.resize');
 }
 
 /* Element */ function addDefaultValue( /* Element */ element ) {
@@ -357,15 +360,21 @@ var spanCounter = 0;
         
     	return selectEl;
         
-    } else { // Simple 
-	// Metatype 1.2: Attr type 12 is PASSWORD
-	var elType = (type == 12) ? "password" : "text";
+    } else if (type == 12) { // Metatype 1.2: Attr type 12 is PASSWORD
         return createElement( "input", null, {
-                type: elType,
-                name: prop,
-                value: value,
-                style: { width: width }
-            });
+            type: "password",
+            name: prop,
+            value: value,
+            style: { width: width }
+        });
+    } else { // Simple
+        var textareaEl = createElement( "textarea", null, {
+            name: prop,
+            style: { width: width }
+        });
+        addText(textareaEl, value.toString());
+        $(textareaEl).autosize();
+        return textareaEl;
     }
 }
 

Modified: felix/trunk/webconsole/src/main/resources/templates/main_header.html
URL: http://svn.apache.org/viewvc/felix/trunk/webconsole/src/main/resources/templates/main_header.html?rev=1648350&r1=1648349&r2=1648350&view=diff
==============================================================================
--- felix/trunk/webconsole/src/main/resources/templates/main_header.html [UTF-8] (original)
+++ felix/trunk/webconsole/src/main/resources/templates/main_header.html [UTF-8] Mon Dec 29
14:24:03 2014
@@ -23,6 +23,7 @@
 	<script src="${appRoot}/res/lib/jquery-ui-i18n-1.7.2.js" type="text/javascript"></script>
 	<script src="${appRoot}/res/lib/jquery.cookies-2.2.0.js" type="text/javascript"></script>
 	<script src="${appRoot}/res/lib/jquery.tablesorter-2.0.3.js" type="text/javascript"></script>
+	<script src="${appRoot}/res/lib/jquery.autosize.min.js" type="text/javascript"></script>
 	<script src="${appRoot}/res/lib/support.js" type="text/javascript"></script>
 
     <script type="text/javascript">



Mime
View raw message