# HG changeset patch # User veltr # Date 1327944021 -3600 # Node ID 46c0f7a935d1f75ab27f94fc9df3d203ff57589f # Parent e7086d345a7c902a507f35a676d386540c884377 Prototype HDAlab, quelques changements diff -r e7086d345a7c -r 46c0f7a935d1 hdalab/css/OpenSans-Bold.ttf Binary file hdalab/css/OpenSans-Bold.ttf has changed diff -r e7086d345a7c -r 46c0f7a935d1 hdalab/css/OpenSans-Italic.ttf Binary file hdalab/css/OpenSans-Italic.ttf has changed diff -r e7086d345a7c -r 46c0f7a935d1 hdalab/css/OpenSans-Regular.ttf Binary file hdalab/css/OpenSans-Regular.ttf has changed diff -r e7086d345a7c -r 46c0f7a935d1 hdalab/css/style.css --- a/hdalab/css/style.css Tue Jan 17 00:19:27 2012 +0100 +++ b/hdalab/css/style.css Mon Jan 30 18:20:21 2012 +0100 @@ -1,9 +1,28 @@ +@font-face +{ + font-family: "Open Sans"; src: url(OpenSans-Regular.ttf); +} + +@font-face +{ + font-family: "Open Sans"; font-weight: bold; src: url(OpenSans-Bold.ttf); +} + +@font-face +{ + font-family: "Open Sans"; font-style: italic; src: url(OpenSans-Italic.ttf); +} + body { - margin: 0; padding: 0; font-family: Arial, Helvetica, sans-serif; + margin: 0; padding: 0; font-family: "Open Sans", Arial, Helvetica, sans-serif; background: #ffffff; color: #000000; font-size: 10px; } +input { + font-family: "Open Sans", Arial, Helvetica, sans-serif; +} + a { text-decoration: none; } @@ -16,8 +35,25 @@ position: relative; width: 960px; margin: 0 auto; } +.barrebloc { + float: left; width: 473px; border: 1px solid #b0b0b0; + background: #e0e0e0; cursor: pointer; cursor: hand; +} + +.barrebloc h2 { + margin: 4px 0; font-size: 16px; text-align: center; +} + +.bloc, #bloc_gestvue { + float: left; width: 475px; margin-bottom: 10px; +} + +.corpsbloc { + float: left; width: 465px; border: 1px solid #b0b0b0; padding: 8px 4px; border-top-style: none; +} + h1 { - float: left; margin: 5px 0; font-size: 20px; + float: left; width: 475px; margin: 5px 0; font-size: 20px; } #sessionname { @@ -32,19 +68,31 @@ display: inline; margin: 0; padding: 0; font-size: 18px; font-weight: bold; } -#onglets { - float: right; list-style: none; margin: 2px 0; padding: 0; +#apartager { + float: right; font-size: 14px; +} + +#vues { + float: right; text-align: right; width: 475px; margin: 2px 0; padding: 0; } -#onglets li { - float: left; padding: 3px; margin-right: 2px; font-size: 13px; font-weight: bold; +#vuestitre { + display: inline; padding: 2px 4px; font-size: 15px; } -#onglets a { +#ongletsvues { + display: inline; list-style: none; margin: 0; padding: 0; +} + +li.lienvue { + display: inline; padding: 3px; font-size: 13px; font-weight: bold; +} + +.lienvue a, #apartager a { color: #666666; } -#onglets a.actif { +.lienvue.actif a, #apartager.actif a { color: #990000; } @@ -58,7 +106,7 @@ } #timeline { - float: left; width: 100%; margin: 5px 0; + float: left; width: 100%; margin: 15px 0; } #dates { @@ -70,15 +118,29 @@ } div.datelabel { - width: 60px; margin: 5px 0 0 -30px; font-size: 10px; text-align: center; + width: 60px; margin: 4px 0 0 -30px; font-size: 10px; text-align: center; opacity: .8; } #dateheat { float: left; width: 100%; height: 20px; z-index: 1; } -#dateslider { - float: left; width: 100%; height: 12px; margin: 5px 0; +.handle { + position: absolute; width: 0; z-index: 2; cursor: pointer; cursor: hand; +} + +.handleinner { + float: left; border: 5px solid #999; background: #fff; + height: 30px; width: 10px; margin-top: -10px; border-radius: 4px; + opacity: .8; +} + +.handleinner:hover { + background: #ccc; +} + +.ui-draggable-dragging .handleinner { + background: #660000; color: #ffffff; } #leftcol { @@ -86,7 +148,7 @@ } #bandefiltre { - float: left; width: 100%; margin: 10px 0 5px; + float: left; width: 100%; margin-top: 10px; } #filtertitle { @@ -97,10 +159,6 @@ list-style: none; float: left; margin: 0 20px; padding: 0; font-size: 12px; } -.inactif #filters, .inactif #filtertitle { - opacity: .3; -} - #filters li { float: left; padding: 2px 3px; margin-right: 5px; font-weight: bold; } @@ -125,16 +183,8 @@ display: inline; margin: 0; padding: 0; font-size: 11px; } -#affres { - float: left; margin: 1px 0; font-size: 13px; display: none; font-weight: bold; -} - -.inactif #affres { - display: block; -} - #contentcount { - float: right; height: 13px; font-size: 13px; padding: 6px 0; + float: left; width: 100%; text-align: right; font-size: 13px; margin: 2px 0; } #filters a.remfil { @@ -142,11 +192,11 @@ } #map { - float: left; width: 100%; height: 200px; + height: 200px; } #tagcloud { - float: left; width: 100%; text-align: center; + text-align: center; } #tclist { @@ -169,20 +219,29 @@ color: #800000; } + +#tagsearchwrap { + width: 50%; +} + #tagsearch { - float: left; clear: both; width: 50%; margin: 10px 0; font-size: 13px; border-style: none; border-bottom: 1px solid #000; + width: 100%; font-size: 16px; font-weight: bold; border-style: none; border-bottom: 1px solid #000; } #tagsearch.grise { - + color: #666; font-style: italic; font-weight: normal; } #rightcol { float: left; width: 475px; margin-left: 5px; } -#contents { - float: left; width: 100%; +#disciplines { + height: 120px; +} + +#disciplines g { + cursor: pointer; cursor: hand; } #contentlist { @@ -242,30 +301,14 @@ color: #ffff00; font-weight: bold; } -#taginfo { - float:left; width: 100%; -} - -#addtofilter { - float: right; text-align: right; -} - -#addtofilter a { - color: #000000; font-size: 12px; font-weight: bold; background: #ffc080; padding: 3px; border-radius: 5px; -} - -#addtofilter a:hover { - background: #ffffff; +#tagcount { + float: right; text-align: right; font-size: 14px; font-weight: bold; } #taginfo p, h2, h3 { margin: 5px 0; } -#taginfo h2 { - font-size: 16px; -} - #taginfo h3 { font-size: 14px; } @@ -276,4 +319,36 @@ #img_wikipedia { float: left; max-width: 160px; max-height: 120px; margin: 2px 2px 2px 0; -} \ No newline at end of file +} + +#gestvue { + display: none; +} + +#div_titrevue { + margin: 5px 0; +} + +#div_titrevue label { + font-size: 14px; +} + +#titrevue { + font-size: 15px; margin: 0 0 0 5px; width: 220px; padding: 2px; border-style: none; border-bottom: 1px solid #000; +} + +#gestvue h4 { + margin: 2px 0; font-size: 14px; +} + +#widgetlist { + list-style: none; padding: 0; margin: 0; width: 100%; +} + +#widgetlist li { + float: left; width: 48%; +} + +#widgetlist label { + font-size: 13px; +} diff -r e7086d345a7c -r 46c0f7a935d1 hdalab/filter.php --- a/hdalab/filter.php Tue Jan 17 00:19:27 2012 +0100 +++ b/hdalab/filter.php Mon Jan 30 18:20:21 2012 +0100 @@ -11,7 +11,7 @@ $tag_count = (isset($_REQUEST['tagcount']) ? pg_escape_string($_REQUEST['tagcount']) : 30); $cont_count = 0; -if ($label || $periode || $contentlist) { +if ($label or $periode or gettype($contentlist) != "NULL") { $globalsql = "SELECT id, title, description, url FROM hdabo_datasheet E"; $globalids = array(); $globalfilters = array(); @@ -44,11 +44,15 @@ $globalfilters[] = "EXISTS (SELECT * FROM hdabo_taggedsheet G WHERE G.tag_id IN (" . join(",", $ids) . ") AND G.order <= $max_tag_order AND G.datasheet_id = E.id)"; } } - if ($contentlist) { - $globalfilters[] = "id IN ($contentlist)"; + if (gettype($contentlist) != "NULL") { + if ($contentlist) { + $globalfilters[] = "id IN ($contentlist)"; + } else { + $globalfilters[] = "id IS NULL"; + } } $globalsql = $globalsql.(count($globalfilters) ? " WHERE ".join($globalfilters," AND ") : "" ); - if (!$label && !$periode && !$contentlist) { + if (!$label && !$periode && gettype($contentlist)=="NULL") { $globalsql = $globalsql." ORDER BY RANDOM()"; } $rq = pg_query($globalsql); @@ -66,26 +70,37 @@ $countries[$ligne[0]] = array("isocode" => $ligne[1], "score" => 0); } pg_free_result($rq); + $rq = pg_query("SELECT DISTINCT label FROM hdabo_tag WHERE category_id=5"); + $disciplines = array(); + while($ligne = pg_fetch_row($rq)) { + $disciplines[$ligne[0]] = array("label" => $ligne[0], "score" => 0); + } + pg_free_result($rq); $tags = array(); $contentids = join(",",array_keys($contenus)); - $rq = pg_query("SELECT L.datasheet_id, L.tag_id, M.label, L.order FROM hdabo_taggedsheet L, hdabo_tag M WHERE L.datasheet_id IN ($contentids) AND L.tag_id = M.id AND L.order <= $max_tag_order ORDER BY L.order ASC"); - while($ligne = pg_fetch_row($rq)) { - $match_tag = in_array($ligne[1], $globalids); - $contenus[$ligne[0]]["tags"][] = array("id" => $ligne[1], "label" => $ligne[2], "order" => $ligne[3], "match" => $match_tag); - $tagscore = 2*$max_tag_order-$ligne[3]; - if (!isset($tags[$ligne[1]])) { - $tags[$ligne[1]] = array("id" => $ligne[1], "label" => $ligne[2], "score" => 0); + if ($contentids) { + $rq = pg_query("SELECT L.datasheet_id, L.tag_id, M.label, L.order FROM hdabo_taggedsheet L, hdabo_tag M WHERE L.datasheet_id IN ($contentids) AND L.tag_id = M.id AND L.order <= $max_tag_order ORDER BY L.order ASC"); + while($ligne = pg_fetch_row($rq)) { + $match_tag = in_array($ligne[1], $globalids); + $contenus[$ligne[0]]["tags"][] = array("id" => $ligne[1], "label" => $ligne[2], "order" => $ligne[3], "match" => $match_tag); + $tagscore = 2*$max_tag_order-$ligne[3]; + if (!isset($tags[$ligne[1]])) { + $tags[$ligne[1]] = array("id" => $ligne[1], "label" => $ligne[2], "score" => 0); + } + $tags[$ligne[1]]["score"] += $tagscore; + if ($match_tag) { + $contenus[$ligne[0]]["score"] += $tagscore; + $tags[$ligne[1]]["match"] = True; + } + if (isset($countries[$ligne[2]])) { + $countries[$ligne[2]]["score"] += $tagscore; + } + if (isset($disciplines[$ligne[2]])) { + $disciplines[$ligne[2]]["score"] += $tagscore; + } } - $tags[$ligne[1]]["score"] += $tagscore; - if ($match_tag) { - $contenus[$ligne[0]]["score"] += $tagscore; - $tags[$ligne[1]]["match"] = True; - } - if (isset($countries[$ligne[2]])) { - $countries[$ligne[2]]["score"] += $tagscore; - } + pg_free_result($rq); } - pg_free_result($rq); function triscore($a, $b) { return $b["score"] - $a["score"]; } @@ -96,16 +111,20 @@ $contenus = array_values($contenus); } usort($tags,"triscore"); + usort($disciplines,"triscore"); $countries = array_values($countries); $tags = array_slice($tags, 0, $tag_count); - $rq = pg_query("SELECT U.start_year, U.end_year, SUM(".(2*$max_tag_order)." - V.order)/(U.end_year + 1 - U.start_year) score FROM hdaviz_years U, hdabo_taggedsheet V WHERE U.tag_id = V.tag_id AND V.order <= $max_tag_order AND V.datasheet_id IN ($contentids) GROUP BY U.start_year, U.end_year"); + $disciplines = array_slice($disciplines, 0, 10); $years = array(); - while($ligne = pg_fetch_row($rq)) { - foreach(range($ligne[0], $ligne[1]) as $year) { - $years[$year] = $ligne[2] + ( isset($years[$year]) ? $years[$year] : 0 ); + if ($contentids) { + $rq = pg_query("SELECT U.start_year, U.end_year, SUM(".(2*$max_tag_order)." - V.order)/(U.end_year + 1 - U.start_year) score FROM hdaviz_years U, hdabo_taggedsheet V WHERE U.tag_id = V.tag_id AND V.order <= $max_tag_order AND V.datasheet_id IN ($contentids) GROUP BY U.start_year, U.end_year"); + while($ligne = pg_fetch_row($rq)) { + foreach(range($ligne[0], $ligne[1]) as $year) { + $years[$year] = $ligne[2] + ( isset($years[$year]) ? $years[$year] : 0 ); + } } + pg_free_result($rq); } - pg_free_result($rq); } else { $rq = pg_query("SELECT id, title, description, url FROM hdabo_datasheet ORDER BY RANDOM() LIMIT $content_count"); while($ligne = pg_fetch_assoc($rq)) { @@ -128,6 +147,9 @@ $rq = pg_query("SELECT C.isocode, SUM(".(2*$max_tag_order)." - B.order) score FROM hdabo_tag A, hdabo_taggedsheet B, hdaviz_cc C WHERE A.id = B.tag_id AND B.order <= $max_tag_order AND A.label = C.label GROUP BY C.isocode"); $countries = pg_fetch_all($rq); pg_free_result($rq); + $rq = pg_query("SELECT A.label, SUM(".(2*$max_tag_order)." - B.order) score FROM hdabo_tag A, hdabo_taggedsheet B WHERE A.id = B.tag_id AND B.order <= $max_tag_order AND A.category_id=5 GROUP BY A.label ORDER BY score DESC LIMIT 10"); + $disciplines = pg_fetch_all($rq); + pg_free_result($rq); $rq = pg_query("SELECT U.start_year, U.end_year, SUM(".(2*$max_tag_order)." - hdabo_taggedsheet.order)/(U.end_year + 1 - U.start_year) score FROM hdaviz_years U, hdabo_taggedsheet WHERE U.tag_id = hdabo_taggedsheet.tag_id AND hdabo_taggedsheet.order <= $max_tag_order GROUP BY U.start_year, U.end_year"); $years = array(); while($ligne = pg_fetch_row($rq)) { @@ -149,6 +171,6 @@ } } } -$output = array("count" => $cont_count, "contents" => $contenus, "tags" => $tags, "sparkline" => $yearchange, "countries" => $countries); +$output = array("count" => $cont_count, "contents" => $contenus, "tags" => $tags, "sparkline" => $yearchange, "countries" => $countries, "disciplines" => $disciplines); echo json_encode($output); ?> \ No newline at end of file diff -r e7086d345a7c -r 46c0f7a935d1 hdalab/index.html --- a/hdalab/index.html Tue Jan 17 00:19:27 2012 +0100 +++ b/hdalab/index.html Mon Jan 30 18:20:21 2012 +0100 @@ -8,92 +8,98 @@ + +
") : 'Annoter ce contenu...') - + '
e){if(c&&!l.start){m=cf(g,h,i[1],i[2],i[3],i[4],i[5],i[6],e-n),k+=["C"+m.start.x,m.start.y,m.m.x,m.m.y,m.x,m.y];if(f)return k;l.start=k,k=["M"+m.x,m.y+"C"+m.n.x,m.n.y,m.end.x,m.end.y,i[5],i[6]].join(),n+=j,g=+i[5],h=+i[6];continue}if(!b&&!c){m=cf(g,h,i[1],i[2],i[3],i[4],i[5],i[6],e-n);return{x:m.x,y:m.y,alpha:m.alpha}}}n+=j,g=+i[5],h=+i[6]}k+=i.shift()+i}l.end=k,m=b?n:c?l:a.findDotsAtSegment(g,h,i[0],i[1],i[2],i[3],i[4],i[5],1),m.alpha&&(m={x:m.x,y:m.y,alpha:m.alpha});return m}},ch=cg(1),ci=cg(),cj=cg(0,1);a.getTotalLength=ch,a.getPointAtLength=ci,a.getSubpath=function(a,b,c){if(this.getTotalLength(a)-c<1e-6)return cj(a,b).end;var d=cj(a,c,1);return b?cj(d,b).end:d},b$.getTotalLength=function(){if(this.type=="path"){if(this.node.getTotalLength)return this.node.getTotalLength();return ch(this.attrs.path)}},b$.getPointAtLength=function(a){if(this.type=="path")return ci(this.attrs.path,a)},b$.getSubpath=function(b,c){if(this.type=="path")return a.getSubpath(this.attrs.path,b,c)};var ck=a.easing_formulas={linear:function(a){return a},"<":function(a){return A(a,1.7)},">":function(a){return A(a,.48)},"<>":function(a){var b=.48-a/1.04,c=w.sqrt(.1734+b*b),d=c-b,e=A(z(d),1/3)*(d<0?-1:1),f=-c-b,g=A(z(f),1/3)*(f<0?-1:1),h=e+g+.5;return(1-h)*3*h*h+h*h*h},backIn:function(a){var b=1.70158;return a*a*((b+1)*a-b)},backOut:function(a){a=a-1;var b=1.70158;return a*a*((b+1)*a+b)+1},elastic:function(a){if(a==!!a)return a;return A(2,-10*a)*w.sin((a-.075)*2*B/.3)+1},bounce:function(a){var b=7.5625,c=2.75,d;a<1/c?d=b*a*a:a<2/c?(a-=1.5/c,d=b*a*a+.75):a<2.5/c?(a-=2.25/c,d=b*a*a+.9375):(a-=2.625/c,d=b*a*a+.984375);return d}};ck.easeIn=ck["ease-in"]=ck["<"],ck.easeOut=ck["ease-out"]=ck[">"],ck.easeInOut=ck["ease-in-out"]=ck["<>"],ck["back-in"]=ck.backIn,ck["back-out"]=ck.backOut;var cl=[],cm=window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(a){setTimeout(a,16)},cn=function(){var b=+(new Date),c=0;for(;c
d){if(b&&!m.start){e=ob(e,g,h[1],h[2],h[3],h[4],h[5],h[6],d-n);j+=["C",e.start.x,e.start.y,e.m.x,e.m.y,e.x,e.y];if(f)return j;m.start=j;j=["M",e.x,e.y+"C",e.n.x,e.n.y,e.end.x,e.end.y,h[5],h[6]][R]();n+=i;e=+h[5];g=+h[6];continue}if(!a&&!b){e=ob(e,g,h[1],h[2],h[3],h[4],h[5],h[6],d-n);return{x:e.x,y:e.y,alpha:e.alpha}}}n+=i;e=+h[5];g=+h[6]}j+=h}m.end=j;e=a?n:b?m:l.findDotsAtSegment(e, +g,h[1],h[2],h[3],h[4],h[5],h[6],1);e.alpha&&(e={x:e.x,y:e.y,alpha:e.alpha});return e}}var Nb=Z(function(a,b,c,d,f,e,g,h){for(var i={x:0,y:0},j=0,m=0;m<1.01;m+=0.01){var n=la(a,b,c,d,f,e,g,h,m);m&&(j+=E(E(i.x-n.x,2)+E(i.y-n.y,2),0.5));i=n}return j}),pb=Ma(1),Ba=Ma(),Na=Ma(0,1);s[p].getTotalLength=function(){if(this.type=="path"){if(this.node.getTotalLength)return this.node.getTotalLength();return pb(this.attrs.path)}};s[p].getPointAtLength=function(a){if(this.type=="path"){if(this.node.getPointAtLength)return this.node.getPointAtLength(a); +return Ba(this.attrs.path,a)}};s[p].getSubpath=function(a,b){if(this.type=="path"){if(v.abs(this.getTotalLength()-b)<1.0E-6)return Na(this.attrs.path,a).end;b=Na(this.attrs.path,b,1);return a?Na(b,a).end:b}};l.easing_formulas={linear:function(a){return a},"<":function(a){return E(a,3)},">":function(a){return E(a-1,3)+1},"<>":function(a){a*=2;if(a<1)return E(a,3)/2;a-=2;return(E(a,3)+2)/2},backIn:function(a){var b=1.70158;return a*a*((b+1)*a-b)},backOut:function(a){a-=1;var b=1.70158;return a*a*((b+ +1)*a+b)+1},elastic:function(a){if(a==0||a==1)return a;var b=0.3,c=b/4;return E(2,-10*a)*v.sin((a-c)*2*v.PI/b)+1},bounce:function(a){var b=7.5625,c=2.75;if(a<1/c)a=b*a*a;else if(a<2/c){a-=1.5/c;a=b*a*a+0.75}else if(a<2.5/c){a-=2.25/c;a=b*a*a+0.9375}else{a-=2.625/c;a=b*a*a+0.984375}return a}};var T={length:0};function qb(){var a=+new Date;for(var b in T)if(b!="length"&&T[z](b)){var c=T[b];if(c.stop||c.el.removed){delete T[b];T[o]--}else{var d=a-c.start,f=c.ms,e=c.easing,g=c.from,h=c.diff,i=c.to,j=c.t, +m=c.prev||0,n=c.el,r=c.callback,q={},k;if(d