[javascript] provide a simple function to limit textarea size (+minor cosmetic changes) stable
authorAdrien Di Mascio <Adrien.DiMascio@logilab.fr>
Mon, 22 Jun 2009 07:35:38 +0200
branchstable
changeset 2130 caa5acbecc08
parent 2125 19861294506f
child 2131 00e6d1cb18ea
[javascript] provide a simple function to limit textarea size (+minor cosmetic changes)
server/schemaserial.py
web/data/cubicweb.htmlhelpers.js
web/facet.py
--- a/server/schemaserial.py	Fri Jun 19 09:19:27 2009 +0200
+++ b/server/schemaserial.py	Mon Jun 22 07:35:38 2009 +0200
@@ -109,7 +109,7 @@
                                                        ETYPE_NAME_MAP[etype])
                 print sql
                 sqlcu.execute(sql)
-        # other table renaming done once schema has been readen
+        # other table renaming done once schema has been read
     # print 'reading schema from the database...'
     index = {}
     permsdict = deserialize_ertype_permissions(session)
--- a/web/data/cubicweb.htmlhelpers.js	Fri Jun 19 09:19:27 2009 +0200
+++ b/web/data/cubicweb.htmlhelpers.js	Mon Jun 22 07:35:38 2009 +0200
@@ -247,6 +247,11 @@
     }
 }
 
+function limitTextAreaSize(textarea, size) {
+    var $area = jQuery(textarea);
+    $area.val($area.val().slice(0, size));
+}
+
 //============= page loading events ==========================================//
 function roundedCornersOnLoad() {
     jQuery('div.sideBox').corner('bottom 6px');
--- a/web/facet.py	Fri Jun 19 09:19:27 2009 +0200
+++ b/web/facet.py	Mon Jun 22 07:35:38 2009 +0200
@@ -744,7 +744,7 @@
                % (cssclass, html_escape(unicode(self.value))))
         self.w(u'<div class="facetCheckBoxWidget">')
         self.w(u'<img src="%s" alt="%s" cubicweb:unselimg="true" />&nbsp;' % (imgsrc, imgalt))
-        self.w(u'<label class="facetTitle" cubicweb:facetName="%s"><a href="javascript: {}">%s</a></label>' % (facetid,title))
+        self.w(u'<label class="facetTitle" cubicweb:facetName="%s"><a href="javascript: {}">%s</a></label>' % (facetid, title))
         self.w(u'</div>\n')
         self.w(u'</div>\n')
         self.w(u'</div>\n')