Commit 4fa8da90 authored by Łukasz Nowak's avatar Łukasz Nowak

Checkpoint: own ellipsis.

Unfortunately ellipsis libraires are not capable to do ellipsis on not shown
elements.

Even worse: they add dynamic styling in order to apply ellipsis.

Implement own ellipsis algorithm. It is work in progress: we need to unhide
elements early in order to have height calculation.
parent 77363972
......@@ -55,7 +55,6 @@
return (\'jquery/core/jquery.js\',\n
\'vifib_hosting_js/jquery.ba-hashchange.min.js\',\n
\'vifib_hosting_js/jquery.ba-bbq.min.js\',\n
\'vifib_hosting_js/jquery.dotdotdot.min.js\',\n
\'vifib_hosting_js/vifib_hosting.js\',\n
\'vifib_hosting_js/slap.js\',\n
\'vifib_hosting_js/vifib.js\',\n
......
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="File" module="OFS.Image"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_EtagSupport__etag</string> </key>
<value> <string>ts22041866.38</string> </value>
</item>
<item>
<key> <string>__name__</string> </key>
<value> <string>jquery.dotdotdot.min.js</string> </value>
</item>
<item>
<key> <string>content_type</string> </key>
<value> <string>application/javascript</string> </value>
</item>
<item>
<key> <string>data</string> </key>
<value> <string encoding="cdata"><![CDATA[
/*\t\r\n
*\tjQuery dotdotdot 1.3.0\r\n
*\t\r\n
*\tCopyright (c) 2011 Fred Heusschen\r\n
*\twww.frebsite.nl\r\n
*\r\n
*\tPlugin website:\r\n
*\tdotdotdot.frebsite.nl\r\n
*\r\n
*\tDual licensed under the MIT and GPL licenses.\r\n
*\thttp://en.wikipedia.org/wiki/MIT_License\r\n
*\thttp://en.wikipedia.org/wiki/GNU_General_Public_License\r\n
*/\r\n
\r\n
eval(function(p,a,c,k,e,r){e=function(c){return(c<a?\'\':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!\'\'.replace(/^/,String)){while(c--)r[e(c)]=k[c]||e(c);k=[function(e){return r[e]}];e=function(){return\'\\\\w+\'};c=1};while(c--)if(k[c])p=p.replace(new RegExp(\'\\\\b\'+e(c)+\'\\\\b\',\'g\'),k[c]);return p}(\'(4($){2($.L.j)5;$.L.j=4(o){2(s.k==0){Y(v,\\\'1w 1x 1y C "\\\'+s.1z+\\\'".\\\');5 s}2(s.k>1){5 s.1A(4(){$(s).j(o)})}6 d=s,$Z=s[0];2(d.11(\\\'j\\\')){d.M(\\\'1d\\\')}d.1e=4(){d.D(\\\'N.A\\\',4(e,a){e.1f();8.12=(q 8.w==\\\'1B\\\')?8.w:1g(d);8.12+=8.1h;$r.O();$r.B(f.1i(v));6 b=7,E=7;2(u.P){b=u.P.1i(v);u.P.F()}2(G($r,8)){2(8.13==\\\'H\\\'){E=H($r,8,b)}p{E=x($r,$r,8,b)}}u.9=E;5 E});d.D(\\\'9.A\\\',4(e,a){6 t=u.9;2(q a==\\\'4\\\'){a.1j($Z,t)}5 t});d.D(\\\'1C.A\\\',4(e,a){6 c=f;2(q a==\\\'4\\\'){a.1j($Z,c)}5 c});d.D(\\\'1d.A\\\',4(e){e.1f();d.14();d.1k();d.O();d.B(f);d.11(\\\'j\\\',7)})};d.1k=4(){d.1D(\\\'.A\\\')};d.I=4(){d.14();2(8.I==\\\'J\\\'){$(J).D(\\\'1E.A\\\',4(){2(y){1l(y)}y=1F(4(){d.M(\\\'N\\\')},10)})}p{K=Q(d);y=1G(4(){6 a=Q(d);2(K.R!=a.R||K.w!=a.w){d.M(\\\'N\\\');K=Q(d)}},1H)}};d.14=4(){2(y){1l(y)}};6 f=d.15(),8=$.1I(v,{},$.L.j.1m,o),u={},K={},y=16,$r=d.1J(\\\'<\\\'+8.1n+\\\' 1K="j" />\\\').H();u.P=1o(8.17,$r);u.9=7;$r.1p({\\\'w\\\':\\\'1q\\\',\\\'R\\\':\\\'1q\\\'});d.11(\\\'j\\\',v);d.1e();d.M(\\\'N\\\');2(8.I){d.I()}5 d};$.L.j.1m={\\\'1n\\\':\\\'1L\\\',\\\'x\\\':\\\'... \\\',\\\'13\\\':\\\'1M\\\',\\\'1h\\\':0,\\\'17\\\':16,\\\'w\\\':16,\\\'I\\\':7,\\\'Y\\\':7};4 H(b,o,c){6 d=b.H(),9=7;b.O();C(6 a=0,l=d.k;a<l;a++){6 e=d.1r(a);b.B(e);2(c){b.B(c)}2(G(b,o)){e.F();9=v;18}p{2(c){c.F()}}}5 9}4 x(b,c,o,d){6 f=b.15(),9=7;b.O();6 g=\\\'1N, 1O, 1P, 1Q, 1R, 1S, 1T, 1s, 1U, 1V, 1W, 1X, 1Y, 1Z, 20, 21, 22, 23, 24\\\';C(6 a=0,l=f.k;a<l;a++){2(9){18}6 e=f[a],$e=$(e);2(q e==\\\'S\\\'){25}b.B($e);2(d){6 h=(b.26(g))?\\\'17\\\':\\\'B\\\';b[h](d)}2(e.27==3){2(G(c,o)){9=19($e,c,o,d)}}p{9=x($e,c,o,d)}2(!9){2(d){d.F()}}}5 9}4 19(b,c,o,d){6 f=7,e=b[0];2(q e==\\\'S\\\'){5 7}6 g=(o.13==\\\'28\\\')?\\\'\\\':\\\' \\\',T=U(e).29(g);1a(e,T.2a(g)+o.x);C(6 a=T.k-1;a>=0;a--){2(G(c,o)){6 h=U(e).k-(T[a].k+g.k+o.x.k),1t=(h>0)?U(e).2b(0,h):\\\'\\\';1a(e,1t+o.x)}p{f=v;18}}2(!f){6 i=b.2c();b.F();$n=i.15().1r(-1);f=19($n,c,o,d)}5 f}4 G(a,o){5 a.1b()>o.12}4 Q(a){5{\\\'R\\\':a.2d(),\\\'w\\\':a.1b()}}4 1a(e,a){2(e.V){e.V=a}p 2(e.W){e.W=a}p 2(e.X){e.X=a}}4 U(e){2(e.V){5 e.V}p 2(e.W){5 e.W}p 2(e.X){5 e.X}p{5""}}4 1o(e,a){2(q e==\\\'S\\\'){5 7}2(!e){5 7}2(q e==\\\'1u\\\'){e=$(e,a);5(e.k)?e:7}2(q e==\\\'1s\\\'){5(q e.2e==\\\'S\\\')?7:e}5 7}4 1g(b){6 h=b.1b(),a=[\\\'2f\\\',\\\'2g\\\'];C(z=0,l=a.k;z<l;z++){6 m=2h(b.1p(a[z]));2(2i(m))m=0;h-=m}5 h}4 Y(d,m){2(!d)5 7;2(q m==\\\'1u\\\')m=\\\'j: \\\'+m;p m=[\\\'j:\\\',m];2(J.1c&&J.1c.1v)J.1c.1v(m);5 7}})(2j);\',62,144,\'||if||function|return|var|false|opts|isTruncated||||||||||dotdotdot|length|||||else|typeof|inr|this||conf|true|height|ellipsis|watchInt||dot|append|for|bind|trunc|remove|test|children|watch|window|watchOrg|fn|trigger|update|empty|afterElement|getSizes|width|undefined|textArr|getTextContent|innerText|nodeValue|textContent|debug|tt0||data|maxHeight|wrap|unwatch|contents|null|after|break|ellipsisElement|setTextContent|innerHeight|console|destroy|bind_events|stopPropagation|getTrueInnerHeight|tolerance|clone|call|unbind_events|clearInterval|defaults|wrapper|getElement|css|auto|eq|object|txt|string|log|No|element|found|selector|each|number|originalContent|unbind|resize|setTimeout|setInterval|100|extend|wrapInner|class|div|word|table|thead|tbody|tfoot|tr|col|colgroup|embed|param|ol|ul|dl|select|optgroup|option|textarea|script|style|continue|is|nodeType|letter|split|join|substring|parent|innerWidth|jquery|paddingTop|paddingBottom|parseInt|isNaN|jQuery\'.split(\'|\'),0,{}))
]]></string> </value>
</item>
<item>
<key> <string>precondition</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>size</string> </key>
<value> <int>3848</int> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
......@@ -8,7 +8,7 @@
<dictionary>
<item>
<key> <string>_EtagSupport__etag</string> </key>
<value> <string>ts22054505.11</string> </value>
<value> <string>ts22060359.91</string> </value>
</item>
<item>
<key> <string>__name__</string> </key>
......@@ -61,23 +61,25 @@ function getSoftwareReleaseEntry(item) {\n
img_div.append(img);\n
var title_div = $(\'<div>\');\n
title_div.addClass(\'software_release_title\');\n
var wrapper_div = $(\'<div>\');\n
var title_p = $(\'<p>\');\n
var title = $(\'<span>\');\n
title.addClass(\'software_release_title\');\n
title.html(item.title);\n
title_div.html(item.title)\n
var description_div = $(\'<div>\');\n
description_div.addClass(\'software_release_description\');\n
var description = $(\'<span>\');\n
description.addClass(\'software_release_description\');\n
description.html(item.description);\n
title_p.append(title);\n
title_p.append($(\'<br/>\'));\n
title_p.append(description);\n
wrapper_div.append(title_p);\n
title_div.append(wrapper_div);\n
description_div.append(description);\n
maxh = description_div.height();\n
description.text(item.description);\n
while(description.height() > maxh) {\n
description.text(description.text().slice(0, description.text().length -1));\n
}\n
t = description.text().slice(0, description.text().length-3);\n
t += \'...\';\n
description.text(t);\n
var entry_div = $(\'<div>\');\n
entry_div.addClass(\'software_release_entry\');\n
entry_div.append(img_div);\n
entry_div.append(title_div);\n
entry_div.append(description_div);\n
entry_div.append($(\'<div>\').addClass(\'reset\'));\n
li.append(entry_div);\n
return li;\n
......@@ -236,7 +238,8 @@ function hashController ()\n
query = query_kw[\'query\'];\n
if (software_release) { requestController(software_release);}\n
else {softwareReleaseController(query);}\n
$(window).load(function() {$(\'div.software_release_title\').dotdotdot();});\n
// $(window).load(function() {$(\'div.software_release_title\').dotdotdot();});\n
// $(window).ajaxComplete(function() {$(\'div.software_release_title\').dotdotdot();});\n
}\n
......@@ -248,7 +251,7 @@ function hashController ()\n
</item>
<item>
<key> <string>size</string> </key>
<value> <int>6925</int> </value>
<value> <int>7170</int> </value>
</item>
<item>
<key> <string>title</string> </key>
......
......@@ -211,12 +211,11 @@ div.software_release_more {position:relative, width:100%;cursor: pointer; font-s
li.software_release_more:hover {background-color: #D2E7F4;}\n
\n
\n
.software_release_title {font-size:22px; color: #1a8d8d}\n
div.software_release_title {float:left; padding: 2px 2px 2px 2px; width: 340px; height: 120px;}\n
div.software_release_title {float:left; padding: 2px 2px 2px 2px; width: 340px; height: 25px; font-size:22px; color: #1a8d8d; white-space:nowrap; overflow:hidden;text-overflow:ellipsis;}\n
.software_release_icon {height: 100px; max-width: 175px;}\n
div.software_release_icon {float: left; padding: 4px 4px 4px 4px; border: 1px solid #8bc8c7; text-align: center; width:180px}\n
.software_release_description {font-size:16px; color: black}\n
div.software_release_description {float:left;}\n
div.software_release_description {float:left;padding: 2px 2px 2px 2px;border: 1px solid green; width: 340px; height: 77px;}\n
span.software_release_description {font-size:14px; color: black;}\n
div.reset {position:relative;clear:both;}\n
input.software_release_search {height: 30px}\n
\n
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment