# HG changeset patch # User veltr # Date 1328180587 -3600 # Node ID dc6c3ac62efaed210873fe38ffcef9c1db9a5e92 # Parent 0f9cc90c49fa787f8d847737ef798587b2df9601 minor changes diff -r 0f9cc90c49fa -r dc6c3ac62efa hdalab/css/style.css --- a/hdalab/css/style.css Mon Jan 30 18:20:59 2012 +0100 +++ b/hdalab/css/style.css Thu Feb 02 12:03:07 2012 +0100 @@ -19,7 +19,7 @@ font-size: 10px; } -input { +input, textarea { font-family: "Open Sans", Arial, Helvetica, sans-serif; } @@ -96,8 +96,12 @@ color: #990000; } -#partageurls { - float: right; text-align: center; clear: both; list-style: none; padding: 0; margin: 2px 0; +#nouvellevue a { + font-weight: bold; color: #ff3000; font-size: 16px; +} + +#partageurls, #plusdevues { + float: right; text-align: right; clear: both; list-style: none; padding: 0; margin: 2px 0; font-size: 13px; display: none; } @@ -269,7 +273,7 @@ } .content-annotation ul { - list-style : disc; margin: 2px 0; padding: 0 0 0 16px; font-size: 12px; + list-style : disc; margin: 2px 0; padding-left: 1.5em; font-size: 12px; cursor: pointer; cursor: hand; } @@ -278,7 +282,7 @@ } .content-annotation textarea { - width: 99%; font-family: Arial, Helvetica, sans-serif; margin: 0; padding: 0; font-size: 12px; + width: 99%; margin: 0; padding: 0; font-size: 12px; } ul.content-tags { @@ -352,3 +356,11 @@ #widgetlist label { font-size: 13px; } + +#notes ul { + font-size: 13px; margin: 0; padding-left: 1.5em; +} + +#notes textarea { + padding: 0; margin: 0; width: 99%; font-size: 13px; +} diff -r 0f9cc90c49fa -r dc6c3ac62efa hdalab/index.html --- a/hdalab/index.html Mon Jan 30 18:20:59 2012 +0100 +++ b/hdalab/index.html Thu Feb 02 12:03:07 2012 +0100 @@ -28,7 +28,12 @@

Mes vues :

+ + +

Filtres : @@ -84,6 +89,12 @@

+
+
+

Notes

+
+
+

Disciplines artistiques

diff -r 0f9cc90c49fa -r dc6c3ac62efa hdalab/js/gomina.js --- a/hdalab/js/gomina.js Mon Jan 30 18:20:59 2012 +0100 +++ b/hdalab/js/gomina.js Thu Feb 02 12:03:07 2012 +0100 @@ -201,9 +201,13 @@ }).join('') + '

Annotations

  • ' - + (gomNs.sessiondata.annotations[_d.id] && gomNs.sessiondata.annotations[_d.id].texte ? gomNs.sessiondata.annotations[_d.id].texte.replace(/\n/gm,"

    ") : 'Annoter ce contenu...') - + '

'; + + '">' + + ( gomNs.sessiondata.annotations[_d.id] && gomNs.sessiondata.annotations[_d.id].texte + ? '
  • ' + + _.escape(gomNs.sessiondata.annotations[_d.id].texte).replace(/\n/gm,"
  • ") + + '
  • ' + : ( gomNs.write_allowed ? '
    • Annoter ce contenu...
    ' : '' ) ) + + '
'; if (gomNs.write_allowed) { _(gomNs.sessiondata.views).each(function(_view, _k) { if (_view.type == 'list') { @@ -253,8 +257,8 @@ if (!gomNs.sessiondata.annotations[_id]) { gomNs.sessiondata.annotations[_id] = {}; } - gomNs.sessiondata.annotations[_id].texte = _.escape(this.value); - this.parentNode.innerHTML = ''; + gomNs.sessiondata.annotations[_id].texte = this.value; + this.parentNode.innerHTML = ''; debouncedSaveChanges(); }); $(this).html(_el); @@ -417,7 +421,10 @@ _(_curView.hiddenWidgets).each(function(_w) { $("#chbx_" + _w).prop("checked",false); $("#" + _w).hide(); - }) + }); + $("#notes").html( _curView.notes + ? '' + : ( gomNs.write_allowed ? '' : '' ) ); switch(_curView.type) { case 'list': $("#bandefiltre, .handle").hide(); @@ -432,6 +439,18 @@ } } +function displayViewList() { + $("#ongletsvues").html(gomNs.sessiondata.views.map(function(_v, _k) { + return '
  • ' + + _.escape(_v.name) + + '
  • '; + }).join("")) +} + function getInitialView() { var _urlParam = {}; if (document.location.hash) { @@ -461,39 +480,16 @@ if (!gomNs.sessiondata.title) { gomNs.sessiondata.title = 'Nouvelle session'; } - if (!gomNs.sessiondata.view) { - gomNs.sessiondata.view = 0; - } if (!gomNs.sessiondata.views) { gomNs.sessiondata.views = []; } if (!gomNs.sessiondata.views.length) { - gomNs.sessiondata.views[0] = { - type: 'filter', - name: 'Mes résultats de recherche', - period: [ gomNs.minYear, gomNs.maxYear ], - tag: [], - hiddenWidgets: [], - }; - gomNs.sessiondata.views[1] = { - type: 'list', - name: 'Ma liste', - list: [], - hiddenWidgets: [], - }; + addView( 'filter', 'Mes résultats de recherche' ); + addView( 'list', 'Ma liste' ); } if (!gomNs.sessiondata.annotations) { gomNs.sessiondata.annotations = {}; } - $("#ongletsvues").html(gomNs.sessiondata.views.map(function(_v, _k) { - return '
  • ' - + _.escape(_v.name) - + '
  • '; - }).join("")) if (data.write_allowed) { $("#bloc_gestvue").show(); } else { @@ -503,11 +499,11 @@ + ( data.write_allowed ? '' : ' (lecture seule)' ) ); gomNs.hrefinterval = setInterval(function() { if (document.location.hash != gomNs.hash) { - console.log("Changement de hash"); clearInterval(gomNs.hrefinterval); getInitialView(); } }, 500); + displayViewList(); showView(); }); } @@ -518,6 +514,25 @@ debouncedSaveChanges(); } +function addView(viewtype, viewname) { + var _content = { + type: viewtype, + name: viewname, + hiddenWidgets: [], + }; + switch(viewtype) { + case 'filter': + _content.period = [ gomNs.minYear, gomNs.maxYear ]; + _content.tag = []; + gomNs.sessiondata.view = gomNs.sessiondata.views.length; + break; + case 'list': + _content.list = []; + break; + } + gomNs.sessiondata.views.push(_content); + debouncedSaveChanges(); +} $(document).ready(function() { gomNs.map = new google.maps.Map(document.getElementById("map"), @@ -600,6 +615,23 @@ $("#view_" + gomNs.sessiondata.view + " a").html(_.escape(_curView.name)) debouncedSaveChanges(); }); + $("#notes").click(function() { + if (gomNs.write_allowed) { + if (this.children[0].tagName == 'UL') { + var _el = document.createElement('textarea'), + _curView = gomNs.sessiondata.views[gomNs.sessiondata.view]; + _el.innerHTML = _curView.notes ? _curView.notes : ''; + $(_el).focusout(function() { + _curView.notes = this.value; + this.parentNode.innerHTML = ''; + debouncedSaveChanges(); + }); + $(this).html(_el); + _el.focus(); + _el.select(); + } + } + }); gomNs.disChart = d3.select("#disciplines") .append("svg:svg") .attr("width", 475) @@ -618,6 +650,10 @@ }); _html + ''; $("#gestvue").append(_html); + $("#nouvellevue").click(function() { + $("#plusdevues").slideToggle(); + return false; + }) $("#widgetlist input").change(function() { var _newWL = []; $("#widgetlist input").each(function(_k, _e) { @@ -631,5 +667,21 @@ }); gomNs.sessiondata.views[gomNs.sessiondata.view].hiddenWidgets = _newWL; debouncedSaveChanges(); - }) + }); + $("#nouv_resrech").click(function() { + var _txt = prompt("Comment souhaitez-vous nommer votre nouvelle vue ?","Nouveaux résultats de recherche"); + if (_txt !== null) { + addView('filter', _txt); + displayViewList(); + } + return false; + }); + $("#nouv_liste").click(function() { + var _txt = prompt("Comment souhaitez-vous nommer votre nouvelle vue ?","Nouvelle liste"); + if (_txt !== null) { + addView('list', _txt); + displayViewList(); + } + return false; + }); });