adding support for keywords. popcorn-port
authorhamidouk
Thu, 29 Dec 2011 17:04:56 +0100
branchpopcorn-port
changeset 547 5b58a108086a
parent 546 be6b15bd7234
child 548 96a188138c20
adding support for keywords.
src/js/site.js.templ
src/js/widgets/createAnnotationWidget.js
src/templates/createAnnotationWidget.html
--- a/src/js/site.js.templ	Thu Dec 29 16:46:10 2011 +0100
+++ b/src/js/site.js.templ	Thu Dec 29 17:04:56 2011 +0100
@@ -37,6 +37,9 @@
   "SliderWidget" : {
       minimize_period: 850 // how long does the slider stays maximized after the user leaves the zone ?
   },
+  "createAnnotationWidget" : {
+      keywords: ["#faux-raccord", "#mot-clef"]
+  },
   "Main" : {
       autoplay: true
   }
--- a/src/js/widgets/createAnnotationWidget.js	Thu Dec 29 16:46:10 2011 +0100
+++ b/src/js/widgets/createAnnotationWidget.js	Thu Dec 29 17:04:56 2011 +0100
@@ -1,6 +1,7 @@
 IriSP.createAnnotationWidget = function(Popcorn, config, Serializer) {
   IriSP.Widget.call(this, Popcorn, config, Serializer);
   this._hidden = true;
+  this.keywords = IriSP.widgetsDefaults["createAnnotationWidget"].keywords;
 };
 
 
@@ -29,12 +30,13 @@
 IriSP.createAnnotationWidget.prototype.draw = function() {
   var _this = this;
 
-  var annotationMarkup = IriSP.templToHTML(IriSP.createAnnotationWidget_template);
+  var annotationMarkup = IriSP.templToHTML(IriSP.createAnnotationWidget_template,
+                                           {keywords: this.keywords});
 	this.selector.append(annotationMarkup);
   this.selector.hide();
   
   this._Popcorn.listen("IriSP.PlayerWidget.AnnotateButton.clicked", 
-                        IriSP.wrap(this, this.handleAnnotateSignal));
+                        IriSP.wrap(this, this.handleAnnotateSignal));  
 };
 
 IriSP.createAnnotationWidget.prototype.handleAnnotateSignal = function() {
--- a/src/templates/createAnnotationWidget.html	Thu Dec 29 16:46:10 2011 +0100
+++ b/src/templates/createAnnotationWidget.html	Thu Dec 29 17:04:56 2011 +0100
@@ -18,8 +18,8 @@
     </div>
     
     <div class='Ldt-createAnnotation-keywords'>
-      Add keywords : <span class='Ldt-createAnnotation-present-keyword'>#faux-raccord</span>
-                     <span class='Ldt-createAnnotation-absent-keyword'>#mot-clef</span>
+      Add keywords :       
+      {{#keywords}}<span class='Ldt-createAnnotation-absent-keyword'>{{.}}</span>{{/keywords}}
     </div>          
     <div class='Ldt-createAnnotation-submitButton'>
       <div style='position: absolute; bottom: 10pt; right: 11pt;'>Submit</div>