| author | hamidouk |
| Thu, 02 Feb 2012 10:34:50 +0100 | |
| branch | popcorn-port |
| changeset 759 | 4dc3240f2c56 |
| parent 722 | ed12570ebd64 |
| child 762 | 5497895a3ddb |
| permissions | -rw-r--r-- |
| 543 | 1 |
IriSP.createAnnotationWidget = function(Popcorn, config, Serializer) { |
2 |
IriSP.Widget.call(this, Popcorn, config, Serializer); |
|
3 |
this._hidden = true; |
|
| 547 | 4 |
this.keywords = IriSP.widgetsDefaults["createAnnotationWidget"].keywords; |
| 718 | 5 |
|
6 |
this.polemic_mode = IriSP.widgetsDefaults["createAnnotationWidget"].polemic_mode; |
|
7 |
this.polemics = IriSP.widgetsDefaults["createAnnotationWidget"].polemics; |
|
8 |
|
|
|
553
10d08f43c534
widget works now more or less like in samuel's crea.
hamidouk
parents:
549
diff
changeset
|
9 |
this.cinecast_version = IriSP.widgetsDefaults["createAnnotationWidget"].cinecast_version; |
| 549 | 10 |
this.ids = {}; /* a dictionnary linking buttons ids to keywords */ |
|
623
d8f107938feb
WIP - create custom-sized segments in "normal" (non-cinecast) mode.
hamidouk
parents:
620
diff
changeset
|
11 |
|
|
d8f107938feb
WIP - create custom-sized segments in "normal" (non-cinecast) mode.
hamidouk
parents:
620
diff
changeset
|
12 |
/* variables to save the current position of the slicer */ |
|
d8f107938feb
WIP - create custom-sized segments in "normal" (non-cinecast) mode.
hamidouk
parents:
620
diff
changeset
|
13 |
if (this.cinecast_version) { |
|
d8f107938feb
WIP - create custom-sized segments in "normal" (non-cinecast) mode.
hamidouk
parents:
620
diff
changeset
|
14 |
this.sliceLeft = 0; |
|
d8f107938feb
WIP - create custom-sized segments in "normal" (non-cinecast) mode.
hamidouk
parents:
620
diff
changeset
|
15 |
this.sliceWidth = 0; |
|
d8f107938feb
WIP - create custom-sized segments in "normal" (non-cinecast) mode.
hamidouk
parents:
620
diff
changeset
|
16 |
} |
| 543 | 17 |
}; |
18 |
||
19 |
||
20 |
IriSP.createAnnotationWidget.prototype = new IriSP.Widget(); |
|
21 |
||
22 |
IriSP.createAnnotationWidget.prototype.clear = function() { |
|
23 |
this.selector.find(".Ldt-SaTitle").text(""); |
|
24 |
this.selector.find(".Ldt-SaDescription").text(""); |
|
25 |
this.selector.find(".Ldt-SaKeywordText").text(""); |
|
26 |
}; |
|
27 |
||
28 |
IriSP.createAnnotationWidget.prototype.draw = function() { |
|
29 |
var _this = this; |
|
30 |
||
| 718 | 31 |
var annotationMarkup = IriSP.templToHTML(IriSP.createAnnotationWidget_template, |
32 |
{cinecast_version: this.cinecast_version, |
|
33 |
polemic_mode: this.polemic_mode}); |
|
|
553
10d08f43c534
widget works now more or less like in samuel's crea.
hamidouk
parents:
549
diff
changeset
|
34 |
|
| 543 | 35 |
this.selector.append(annotationMarkup); |
| 548 | 36 |
|
|
614
116de1c38a7d
lots of refactoring for this widget, as well as changes to support the cinecast
hamidouk
parents:
611
diff
changeset
|
37 |
if (!this.cinecast_version) |
|
116de1c38a7d
lots of refactoring for this widget, as well as changes to support the cinecast
hamidouk
parents:
611
diff
changeset
|
38 |
this.selector.hide(); |
|
116de1c38a7d
lots of refactoring for this widget, as well as changes to support the cinecast
hamidouk
parents:
611
diff
changeset
|
39 |
|
| 548 | 40 |
for (var i = 0; i < this.keywords.length; i++) { |
| 549 | 41 |
var keyword = this.keywords[i]; |
42 |
var id = IriSP.guid("button_"); |
|
43 |
var templ = IriSP.templToHTML("<button id={{id}} class='Ldt-createAnnotation-absent-keyword'>{{keyword}}</button>", |
|
44 |
{keyword: keyword, id: id}); |
|
| 548 | 45 |
|
| 549 | 46 |
this.ids[keyword] = id; // save it for the function that handle textarea changes. |
47 |
|
|
| 548 | 48 |
this.selector.find(".Ldt-createAnnotation-keywords").append(templ); |
| 549 | 49 |
this.selector.find("#" + id).click(function(keyword) { return function() { |
50 |
var contents = _this.selector.find(".Ldt-createAnnotation-Description").val(); |
|
51 |
if (contents.indexOf(keyword) != -1) { |
|
|
614
116de1c38a7d
lots of refactoring for this widget, as well as changes to support the cinecast
hamidouk
parents:
611
diff
changeset
|
52 |
var newVal = contents.replace(" " + keyword, ""); |
|
116de1c38a7d
lots of refactoring for this widget, as well as changes to support the cinecast
hamidouk
parents:
611
diff
changeset
|
53 |
if (newVal == contents) |
|
116de1c38a7d
lots of refactoring for this widget, as well as changes to support the cinecast
hamidouk
parents:
611
diff
changeset
|
54 |
newVal = contents.replace(keyword, ""); |
| 549 | 55 |
} else { |
| 611 | 56 |
if (contents === "") |
57 |
var newVal = keyword; |
|
58 |
else |
|
59 |
var newVal = contents + " " + keyword; |
|
| 549 | 60 |
} |
61 |
|
|
62 |
_this.selector.find(".Ldt-createAnnotation-Description").val(newVal); |
|
| 570 | 63 |
// we use a custom event because there's no simple way to test for a js |
64 |
// change in a textfield. |
|
65 |
_this.selector.find(".Ldt-createAnnotation-Description").trigger("js_mod"); |
|
| 549 | 66 |
// also call our update function. |
| 718 | 67 |
//_this.handleTextChanges(); |
| 549 | 68 |
} |
69 |
}(keyword)); |
|
| 548 | 70 |
} |
| 718 | 71 |
|
72 |
// add the polemic buttons. |
|
73 |
if(this.polemic_mode) |
|
74 |
for (var polemic in this.polemics) { |
|
75 |
||
76 |
var classname = IriSP.templToHTML("Ldt-createAnnotation-polemic-{{classname}}", {classname : this.polemics[polemic]}); |
|
77 |
||
| 722 | 78 |
var templ = IriSP.templToHTML("<button class='{{classname}} Ldt-createAnnotation-polemic-button'>{{polemic}}</button>", |
| 718 | 79 |
{classname: classname, polemic: polemic}); |
80 |
|
|
81 |
this.selector.find(".Ldt-createAnnotation-polemics").append(templ); |
|
82 |
this.selector.find("." + classname).click(function(polemic) { return function() { |
|
83 |
var contents = _this.selector.find(".Ldt-createAnnotation-Description").val(); |
|
84 |
if (contents.indexOf(polemic) != -1) { |
|
85 |
var newVal = contents.replace(" " + polemic, ""); |
|
86 |
if (newVal == contents) |
|
87 |
newVal = contents.replace(polemic, ""); |
|
88 |
} else { |
|
89 |
if (contents === "") |
|
90 |
var newVal = polemic; |
|
91 |
else |
|
92 |
var newVal = contents + " " + polemic; |
|
93 |
} |
|
94 |
|
|
95 |
_this.selector.find(".Ldt-createAnnotation-Description").val(newVal); |
|
96 |
// we use a custom event because there's no simple way to test for a js |
|
97 |
// change in a textfield. |
|
98 |
_this.selector.find(".Ldt-createAnnotation-Description").trigger("js_mod"); |
|
99 |
// also call our update function. |
|
100 |
_this.handleTextChanges(); |
|
101 |
} |
|
102 |
}(polemic)); |
|
103 |
} |
|
| 548 | 104 |
|
| 549 | 105 |
this.selector.find(".Ldt-createAnnotation-Description") |
106 |
.bind("propertychange keyup input paste", IriSP.wrap(this, this.handleTextChanges)); |
|
|
614
116de1c38a7d
lots of refactoring for this widget, as well as changes to support the cinecast
hamidouk
parents:
611
diff
changeset
|
107 |
|
|
116de1c38a7d
lots of refactoring for this widget, as well as changes to support the cinecast
hamidouk
parents:
611
diff
changeset
|
108 |
/* the cinecast version of the player is supposed to pause when the user clicks on the button */ |
|
620
fe981f0aab71
automatically position and show the sliceWidget under the current chapter.
hamidouk
parents:
616
diff
changeset
|
109 |
if (this.cinecast_version) { |
|
614
116de1c38a7d
lots of refactoring for this widget, as well as changes to support the cinecast
hamidouk
parents:
611
diff
changeset
|
110 |
this.selector.find(".Ldt-createAnnotation-Description") |
|
116de1c38a7d
lots of refactoring for this widget, as well as changes to support the cinecast
hamidouk
parents:
611
diff
changeset
|
111 |
.one("propertychange keyup input paste js_mod", |
|
116de1c38a7d
lots of refactoring for this widget, as well as changes to support the cinecast
hamidouk
parents:
611
diff
changeset
|
112 |
function() { if (!_this._Popcorn.media.paused) _this._Popcorn.pause() }); |
|
620
fe981f0aab71
automatically position and show the sliceWidget under the current chapter.
hamidouk
parents:
616
diff
changeset
|
113 |
} |
|
614
116de1c38a7d
lots of refactoring for this widget, as well as changes to support the cinecast
hamidouk
parents:
611
diff
changeset
|
114 |
/* the cinecast version expects the user to comment on a defined segment. |
|
116de1c38a7d
lots of refactoring for this widget, as well as changes to support the cinecast
hamidouk
parents:
611
diff
changeset
|
115 |
As the widget is always shown, we need a way to update it's content as |
|
116de1c38a7d
lots of refactoring for this widget, as well as changes to support the cinecast
hamidouk
parents:
611
diff
changeset
|
116 |
time passes. We do this like we did with the annotationsWidget : we schedule |
|
116de1c38a7d
lots of refactoring for this widget, as well as changes to support the cinecast
hamidouk
parents:
611
diff
changeset
|
117 |
a .code start function which will be called at the right time. |
|
116de1c38a7d
lots of refactoring for this widget, as well as changes to support the cinecast
hamidouk
parents:
611
diff
changeset
|
118 |
*/ |
|
116de1c38a7d
lots of refactoring for this widget, as well as changes to support the cinecast
hamidouk
parents:
611
diff
changeset
|
119 |
if (this.cinecast_version) { |
|
116de1c38a7d
lots of refactoring for this widget, as well as changes to support the cinecast
hamidouk
parents:
611
diff
changeset
|
120 |
var legal_ids; |
|
116de1c38a7d
lots of refactoring for this widget, as well as changes to support the cinecast
hamidouk
parents:
611
diff
changeset
|
121 |
if (typeof(this._serializer.getChapitrage()) !== "undefined") |
|
116de1c38a7d
lots of refactoring for this widget, as well as changes to support the cinecast
hamidouk
parents:
611
diff
changeset
|
122 |
legal_id = this._serializer.getChapitrage(); |
|
116de1c38a7d
lots of refactoring for this widget, as well as changes to support the cinecast
hamidouk
parents:
611
diff
changeset
|
123 |
else |
|
116de1c38a7d
lots of refactoring for this widget, as well as changes to support the cinecast
hamidouk
parents:
611
diff
changeset
|
124 |
legal_id = this._serializer.getNonTweetIds()[0]; |
|
116de1c38a7d
lots of refactoring for this widget, as well as changes to support the cinecast
hamidouk
parents:
611
diff
changeset
|
125 |
|
|
116de1c38a7d
lots of refactoring for this widget, as well as changes to support the cinecast
hamidouk
parents:
611
diff
changeset
|
126 |
var annotations = this._serializer._data.annotations; |
|
116de1c38a7d
lots of refactoring for this widget, as well as changes to support the cinecast
hamidouk
parents:
611
diff
changeset
|
127 |
var i; |
|
116de1c38a7d
lots of refactoring for this widget, as well as changes to support the cinecast
hamidouk
parents:
611
diff
changeset
|
128 |
|
|
116de1c38a7d
lots of refactoring for this widget, as well as changes to support the cinecast
hamidouk
parents:
611
diff
changeset
|
129 |
for (i in annotations) { |
|
116de1c38a7d
lots of refactoring for this widget, as well as changes to support the cinecast
hamidouk
parents:
611
diff
changeset
|
130 |
var annotation = annotations[i]; |
|
116de1c38a7d
lots of refactoring for this widget, as well as changes to support the cinecast
hamidouk
parents:
611
diff
changeset
|
131 |
if (typeof(annotation.meta) !== "undefined" && typeof(annotation.meta["id-ref"]) !== "undefined" |
|
116de1c38a7d
lots of refactoring for this widget, as well as changes to support the cinecast
hamidouk
parents:
611
diff
changeset
|
132 |
&& legal_id !== annotation.meta["id-ref"]) { |
|
116de1c38a7d
lots of refactoring for this widget, as well as changes to support the cinecast
hamidouk
parents:
611
diff
changeset
|
133 |
continue; |
|
116de1c38a7d
lots of refactoring for this widget, as well as changes to support the cinecast
hamidouk
parents:
611
diff
changeset
|
134 |
} |
|
116de1c38a7d
lots of refactoring for this widget, as well as changes to support the cinecast
hamidouk
parents:
611
diff
changeset
|
135 |
|
|
116de1c38a7d
lots of refactoring for this widget, as well as changes to support the cinecast
hamidouk
parents:
611
diff
changeset
|
136 |
code = {start: annotation.begin / 1000, end: annotation.end / 1000, |
|
116de1c38a7d
lots of refactoring for this widget, as well as changes to support the cinecast
hamidouk
parents:
611
diff
changeset
|
137 |
onStart: function(annotation) { return function() { |
|
116de1c38a7d
lots of refactoring for this widget, as well as changes to support the cinecast
hamidouk
parents:
611
diff
changeset
|
138 |
if (typeof(annotation.content) !== "undefined") |
|
116de1c38a7d
lots of refactoring for this widget, as well as changes to support the cinecast
hamidouk
parents:
611
diff
changeset
|
139 |
_this.selector.find(".Ldt-createAnnotation-Title").html(annotation.content.title); |
|
116de1c38a7d
lots of refactoring for this widget, as well as changes to support the cinecast
hamidouk
parents:
611
diff
changeset
|
140 |
|
|
116de1c38a7d
lots of refactoring for this widget, as well as changes to support the cinecast
hamidouk
parents:
611
diff
changeset
|
141 |
_this._currentAnnotation = annotation; |
|
116de1c38a7d
lots of refactoring for this widget, as well as changes to support the cinecast
hamidouk
parents:
611
diff
changeset
|
142 |
var beginTime = IriSP.msToTime(annotation.begin); |
|
116de1c38a7d
lots of refactoring for this widget, as well as changes to support the cinecast
hamidouk
parents:
611
diff
changeset
|
143 |
var endTime = IriSP.msToTime(annotation.end); |
|
116de1c38a7d
lots of refactoring for this widget, as well as changes to support the cinecast
hamidouk
parents:
611
diff
changeset
|
144 |
var timeTemplate = IriSP.templToHTML("- ({{begin}} - {{ end }})", {begin: beginTime, end: endTime }); |
|
116de1c38a7d
lots of refactoring for this widget, as well as changes to support the cinecast
hamidouk
parents:
611
diff
changeset
|
145 |
_this.selector.find(".Ldt-createAnnotation-TimeFrame").html(timeTemplate); |
|
116de1c38a7d
lots of refactoring for this widget, as well as changes to support the cinecast
hamidouk
parents:
611
diff
changeset
|
146 |
} }(annotation) |
|
116de1c38a7d
lots of refactoring for this widget, as well as changes to support the cinecast
hamidouk
parents:
611
diff
changeset
|
147 |
}; |
|
116de1c38a7d
lots of refactoring for this widget, as well as changes to support the cinecast
hamidouk
parents:
611
diff
changeset
|
148 |
|
|
116de1c38a7d
lots of refactoring for this widget, as well as changes to support the cinecast
hamidouk
parents:
611
diff
changeset
|
149 |
this._Popcorn.code(code); |
|
116de1c38a7d
lots of refactoring for this widget, as well as changes to support the cinecast
hamidouk
parents:
611
diff
changeset
|
150 |
} |
|
116de1c38a7d
lots of refactoring for this widget, as well as changes to support the cinecast
hamidouk
parents:
611
diff
changeset
|
151 |
} |
| 543 | 152 |
|
|
553
10d08f43c534
widget works now more or less like in samuel's crea.
hamidouk
parents:
549
diff
changeset
|
153 |
this.selector.find(".Ldt-createAnnotation-submitButton").click(IriSP.wrap(this, this.handleButtonClick)); |
|
614
116de1c38a7d
lots of refactoring for this widget, as well as changes to support the cinecast
hamidouk
parents:
611
diff
changeset
|
154 |
|
| 721 | 155 |
if (!this.cinecast_version) { |
|
614
116de1c38a7d
lots of refactoring for this widget, as well as changes to support the cinecast
hamidouk
parents:
611
diff
changeset
|
156 |
this._Popcorn.listen("IriSP.PlayerWidget.AnnotateButton.clicked", |
| 721 | 157 |
IriSP.wrap(this, this.handleAnnotateSignal)); |
158 |
|
|
159 |
// handle clicks on the cancel button too. |
|
160 |
this.selector.find(".Ldt-createAnnotation-Minimize").click(IriSP.wrap(this, |
|
161 |
function() { |
|
162 |
// we've got to simulate the pressing of the button because there's no |
|
163 |
// other way to minimize the widget and show the widgets that were hidden |
|
164 |
// same time |
|
165 |
this._Popcorn.trigger("IriSP.PlayerWidget.AnnotateButton.clicked"); |
|
166 |
} |
|
167 |
)); |
|
168 |
} |
|
| 543 | 169 |
}; |
170 |
||
|
620
fe981f0aab71
automatically position and show the sliceWidget under the current chapter.
hamidouk
parents:
616
diff
changeset
|
171 |
/** handles clicks on the annotate button. Works only for the non-cinecast version */ |
| 543 | 172 |
IriSP.createAnnotationWidget.prototype.handleAnnotateSignal = function() { |
|
620
fe981f0aab71
automatically position and show the sliceWidget under the current chapter.
hamidouk
parents:
616
diff
changeset
|
173 |
|
| 543 | 174 |
if (this._hidden == false) { |
175 |
this.selector.hide(); |
|
176 |
this._hidden = true; |
|
| 570 | 177 |
|
178 |
// free the arrow. |
|
179 |
this._Popcorn.trigger("IriSP.ArrowWidget.releaseArrow"); |
|
|
620
fe981f0aab71
automatically position and show the sliceWidget under the current chapter.
hamidouk
parents:
616
diff
changeset
|
180 |
this._Popcorn.trigger("IriSP.SliceWidget.hide"); |
|
fe981f0aab71
automatically position and show the sliceWidget under the current chapter.
hamidouk
parents:
616
diff
changeset
|
181 |
|
| 543 | 182 |
} else { |
|
614
116de1c38a7d
lots of refactoring for this widget, as well as changes to support the cinecast
hamidouk
parents:
611
diff
changeset
|
183 |
this.showStartScreen(); |
| 543 | 184 |
this.selector.show(); |
185 |
this._hidden = false; |
|
|
620
fe981f0aab71
automatically position and show the sliceWidget under the current chapter.
hamidouk
parents:
616
diff
changeset
|
186 |
var currentTime = this._Popcorn.currentTime(); |
| 563 | 187 |
|
188 |
// block the arrow. |
|
189 |
this._Popcorn.trigger("IriSP.ArrowWidget.blockArrow"); |
|
|
623
d8f107938feb
WIP - create custom-sized segments in "normal" (non-cinecast) mode.
hamidouk
parents:
620
diff
changeset
|
190 |
|
|
620
fe981f0aab71
automatically position and show the sliceWidget under the current chapter.
hamidouk
parents:
616
diff
changeset
|
191 |
var duration = +this._serializer.currentMedia().meta["dc:duration"]; |
|
623
d8f107938feb
WIP - create custom-sized segments in "normal" (non-cinecast) mode.
hamidouk
parents:
620
diff
changeset
|
192 |
|
|
620
fe981f0aab71
automatically position and show the sliceWidget under the current chapter.
hamidouk
parents:
616
diff
changeset
|
193 |
var currentChapter = this._serializer.currentChapitre(currentTime); |
|
623
d8f107938feb
WIP - create custom-sized segments in "normal" (non-cinecast) mode.
hamidouk
parents:
620
diff
changeset
|
194 |
if (typeof(currentChapter) === "undefined") { |
|
d8f107938feb
WIP - create custom-sized segments in "normal" (non-cinecast) mode.
hamidouk
parents:
620
diff
changeset
|
195 |
var left = this.selector.width() / 2; |
|
d8f107938feb
WIP - create custom-sized segments in "normal" (non-cinecast) mode.
hamidouk
parents:
620
diff
changeset
|
196 |
var width = this.selector.width() / 10; |
|
d8f107938feb
WIP - create custom-sized segments in "normal" (non-cinecast) mode.
hamidouk
parents:
620
diff
changeset
|
197 |
} else { |
|
d8f107938feb
WIP - create custom-sized segments in "normal" (non-cinecast) mode.
hamidouk
parents:
620
diff
changeset
|
198 |
var left = (currentChapter.begin / duration) * this.selector.width(); |
|
d8f107938feb
WIP - create custom-sized segments in "normal" (non-cinecast) mode.
hamidouk
parents:
620
diff
changeset
|
199 |
var width = (currentChapter.end / duration) * this.selector.width() - left; |
|
d8f107938feb
WIP - create custom-sized segments in "normal" (non-cinecast) mode.
hamidouk
parents:
620
diff
changeset
|
200 |
} |
|
d8f107938feb
WIP - create custom-sized segments in "normal" (non-cinecast) mode.
hamidouk
parents:
620
diff
changeset
|
201 |
|
|
d8f107938feb
WIP - create custom-sized segments in "normal" (non-cinecast) mode.
hamidouk
parents:
620
diff
changeset
|
202 |
this.sliceLeft = left; |
|
d8f107938feb
WIP - create custom-sized segments in "normal" (non-cinecast) mode.
hamidouk
parents:
620
diff
changeset
|
203 |
this.sliceWidth = width; |
|
620
fe981f0aab71
automatically position and show the sliceWidget under the current chapter.
hamidouk
parents:
616
diff
changeset
|
204 |
this._Popcorn.trigger("IriSP.SliceWidget.position", [left, width]); |
|
623
d8f107938feb
WIP - create custom-sized segments in "normal" (non-cinecast) mode.
hamidouk
parents:
620
diff
changeset
|
205 |
this._Popcorn.listen("IriSP.SliceWidget.zoneChange", IriSP.wrap(this, this.handleSliderChanges)); |
|
620
fe981f0aab71
automatically position and show the sliceWidget under the current chapter.
hamidouk
parents:
616
diff
changeset
|
206 |
this._Popcorn.trigger("IriSP.SliceWidget.show"); |
| 722 | 207 |
|
208 |
this.selector.find(".Ldt-createAnnotation-Title").html(currentChapter.content.title); |
|
209 |
||
210 |
this._currentcurrentChapter = currentChapter; |
|
211 |
var beginTime = IriSP.msToTime(currentChapter.begin); |
|
212 |
var endTime = IriSP.msToTime(currentChapter.end); |
|
213 |
var timeTemplate = IriSP.templToHTML("- ({{begin}} - {{ end }})", {begin: beginTime, end: endTime }); |
|
214 |
this.selector.find(".Ldt-createAnnotation-TimeFrame").html(timeTemplate); |
|
| 543 | 215 |
} |
| 549 | 216 |
}; |
217 |
||
|
614
116de1c38a7d
lots of refactoring for this widget, as well as changes to support the cinecast
hamidouk
parents:
611
diff
changeset
|
218 |
|
| 549 | 219 |
/** watch for changes in the textfield and change the buttons accordingly */ |
220 |
IriSP.createAnnotationWidget.prototype.handleTextChanges = function(event) { |
|
221 |
var contents = this.selector.find(".Ldt-createAnnotation-Description").val(); |
|
222 |
||
223 |
for(var keyword in this.ids) { |
|
224 |
|
|
225 |
var id = this.ids[keyword]; |
|
226 |
||
227 |
if (contents.indexOf(keyword) != -1) { |
|
228 |
/* the word is present in the textarea but the button is not toggled */ |
|
229 |
if (this.selector.find("#" + id).hasClass("Ldt-createAnnotation-absent-keyword")) |
|
230 |
this.selector.find("#" + id).removeClass("Ldt-createAnnotation-absent-keyword") |
|
231 |
.addClass("Ldt-createAnnotation-present-keyword"); |
|
232 |
} else { |
|
233 |
/* the word is absent from the textarea but the button is toggled */ |
|
234 |
if (this.selector.find("#" + id).hasClass("Ldt-createAnnotation-present-keyword")) { |
|
235 |
this.selector.find("#" + id).removeClass("Ldt-createAnnotation-present-keyword") |
|
236 |
.addClass("Ldt-createAnnotation-absent-keyword"); |
|
237 |
} |
|
238 |
} |
|
239 |
} |
|
| 722 | 240 |
|
241 |
if (this.polemic_mode) { |
|
242 |
/* Also go through the polemics to highlight the buttons */ |
|
243 |
for (var polemic in this.polemics) { |
|
244 |
/* Add the active class to the button */ |
|
245 |
var classname = "Ldt-createAnnotation-polemic-" + this.polemics[polemic]; |
|
246 |
if (contents.indexOf(polemic) != -1) { |
|
247 |
this.selector.find("." + classname).addClass("Ldt-createAnnotation-polemic-active"); |
|
248 |
} else { |
|
249 |
if (this.selector.find("." + classname).addClass("Ldt-createAnnotation-polemic-active")) |
|
250 |
this.selector.find("." + classname).removeClass("Ldt-createAnnotation-polemic-active") |
|
251 |
} |
|
252 |
} |
|
253 |
} |
|
|
553
10d08f43c534
widget works now more or less like in samuel's crea.
hamidouk
parents:
549
diff
changeset
|
254 |
}; |
|
10d08f43c534
widget works now more or less like in samuel's crea.
hamidouk
parents:
549
diff
changeset
|
255 |
|
|
614
116de1c38a7d
lots of refactoring for this widget, as well as changes to support the cinecast
hamidouk
parents:
611
diff
changeset
|
256 |
IriSP.createAnnotationWidget.prototype.showStartScreen = function() { |
|
627
13b9f14bf49a
added a spinner displayed while submitting an annotation.
hamidouk
parents:
626
diff
changeset
|
257 |
this.selector.find(".Ldt-createAnnotation-DoubleBorder").children().hide(); |
|
13b9f14bf49a
added a spinner displayed while submitting an annotation.
hamidouk
parents:
626
diff
changeset
|
258 |
this.selector.find(".Ldt-createAnnotation-startScreen").show(); |
|
13b9f14bf49a
added a spinner displayed while submitting an annotation.
hamidouk
parents:
626
diff
changeset
|
259 |
this.selector.find("Ldt-createAnnotation-Description").val("Type your annotation here."); |
|
13b9f14bf49a
added a spinner displayed while submitting an annotation.
hamidouk
parents:
626
diff
changeset
|
260 |
}; |
|
13b9f14bf49a
added a spinner displayed while submitting an annotation.
hamidouk
parents:
626
diff
changeset
|
261 |
|
|
13b9f14bf49a
added a spinner displayed while submitting an annotation.
hamidouk
parents:
626
diff
changeset
|
262 |
IriSP.createAnnotationWidget.prototype.showWaitScreen = function() { |
|
13b9f14bf49a
added a spinner displayed while submitting an annotation.
hamidouk
parents:
626
diff
changeset
|
263 |
this.selector.find(".Ldt-createAnnotation-DoubleBorder").children().hide(); |
|
13b9f14bf49a
added a spinner displayed while submitting an annotation.
hamidouk
parents:
626
diff
changeset
|
264 |
this.selector.find(".Ldt-createAnnotation-waitScreen").show(); |
|
614
116de1c38a7d
lots of refactoring for this widget, as well as changes to support the cinecast
hamidouk
parents:
611
diff
changeset
|
265 |
}; |
|
116de1c38a7d
lots of refactoring for this widget, as well as changes to support the cinecast
hamidouk
parents:
611
diff
changeset
|
266 |
|
| 651 | 267 |
IriSP.createAnnotationWidget.prototype.showEndScreen = function(annotation) { |
|
614
116de1c38a7d
lots of refactoring for this widget, as well as changes to support the cinecast
hamidouk
parents:
611
diff
changeset
|
268 |
this.selector.find(".Ldt-createAnnotation-DoubleBorder").children().hide(); |
|
116de1c38a7d
lots of refactoring for this widget, as well as changes to support the cinecast
hamidouk
parents:
611
diff
changeset
|
269 |
|
|
116de1c38a7d
lots of refactoring for this widget, as well as changes to support the cinecast
hamidouk
parents:
611
diff
changeset
|
270 |
if (this.cinecast_version) { |
|
116de1c38a7d
lots of refactoring for this widget, as well as changes to support the cinecast
hamidouk
parents:
611
diff
changeset
|
271 |
this.selector.find(".Ldt-createAnnotation-Title").parent().show(); |
|
116de1c38a7d
lots of refactoring for this widget, as well as changes to support the cinecast
hamidouk
parents:
611
diff
changeset
|
272 |
} |
|
116de1c38a7d
lots of refactoring for this widget, as well as changes to support the cinecast
hamidouk
parents:
611
diff
changeset
|
273 |
|
| 719 | 274 |
var url = document.location.href + "#id=" + annotation.id; |
| 651 | 275 |
var twStatus = IriSP.mkTweetUrl(url); |
276 |
var gpStatus = IriSP.mkGplusUrl(url); |
|
277 |
var fbStatus = IriSP.mkFbUrl(url); |
|
|
614
116de1c38a7d
lots of refactoring for this widget, as well as changes to support the cinecast
hamidouk
parents:
611
diff
changeset
|
278 |
|
|
116de1c38a7d
lots of refactoring for this widget, as well as changes to support the cinecast
hamidouk
parents:
611
diff
changeset
|
279 |
this.selector.find(".Ldt-createAnnotation-endScreen-TweetLink").attr("href", twStatus); |
|
116de1c38a7d
lots of refactoring for this widget, as well as changes to support the cinecast
hamidouk
parents:
611
diff
changeset
|
280 |
this.selector.find(".Ldt-createAnnotation-endScreen-FbLink").attr("href", fbStatus); |
|
116de1c38a7d
lots of refactoring for this widget, as well as changes to support the cinecast
hamidouk
parents:
611
diff
changeset
|
281 |
this.selector.find(".Ldt-createAnnotation-endScreen-GplusLink").attr("href", gpStatus); |
|
116de1c38a7d
lots of refactoring for this widget, as well as changes to support the cinecast
hamidouk
parents:
611
diff
changeset
|
282 |
|
|
116de1c38a7d
lots of refactoring for this widget, as well as changes to support the cinecast
hamidouk
parents:
611
diff
changeset
|
283 |
this.selector.find(".Ldt-createAnnotation-endScreen").show(); |
|
116de1c38a7d
lots of refactoring for this widget, as well as changes to support the cinecast
hamidouk
parents:
611
diff
changeset
|
284 |
}; |
|
116de1c38a7d
lots of refactoring for this widget, as well as changes to support the cinecast
hamidouk
parents:
611
diff
changeset
|
285 |
|
|
553
10d08f43c534
widget works now more or less like in samuel's crea.
hamidouk
parents:
549
diff
changeset
|
286 |
/** handle clicks on "send annotation" button */ |
|
10d08f43c534
widget works now more or less like in samuel's crea.
hamidouk
parents:
549
diff
changeset
|
287 |
IriSP.createAnnotationWidget.prototype.handleButtonClick = function(event) { |
| 597 | 288 |
var _this = this; |
|
561
a10e7b6fdb08
display an error message when the user forget to enter text.
hamidouk
parents:
553
diff
changeset
|
289 |
var textfield = this.selector.find(".Ldt-createAnnotation-Description"); |
|
a10e7b6fdb08
display an error message when the user forget to enter text.
hamidouk
parents:
553
diff
changeset
|
290 |
var contents = textfield.val(); |
|
a10e7b6fdb08
display an error message when the user forget to enter text.
hamidouk
parents:
553
diff
changeset
|
291 |
|
|
614
116de1c38a7d
lots of refactoring for this widget, as well as changes to support the cinecast
hamidouk
parents:
611
diff
changeset
|
292 |
if (contents === "") { |
| 570 | 293 |
if (this.selector.find(".Ldt-createAnnotation-errorMessage").length === 0) { |
294 |
this.selector.find(".Ldt-createAnnotation-Container") |
|
295 |
.after(IriSP.templToHTML(IriSP.createAnnotation_errorMessage_template)); |
|
| 571 | 296 |
textfield.css("background-color", "#d93c71"); |
297 |
} else { |
|
298 |
this.selector.find(".Ldt-createAnnotation-errorMessage").show(); |
|
299 |
} |
|
|
614
116de1c38a7d
lots of refactoring for this widget, as well as changes to support the cinecast
hamidouk
parents:
611
diff
changeset
|
300 |
|
|
116de1c38a7d
lots of refactoring for this widget, as well as changes to support the cinecast
hamidouk
parents:
611
diff
changeset
|
301 |
textfield.one("js_mod propertychange keyup input paste", IriSP.wrap(this, function() { |
| 570 | 302 |
var contents = textfield.val(); |
| 611 | 303 |
|
| 570 | 304 |
if (contents !== "") { |
305 |
this.selector.find(".Ldt-createAnnotation-errorMessage").hide(); |
|
306 |
textfield.css("background-color", ""); |
|
307 |
} |
|
308 |
})); |
|
|
561
a10e7b6fdb08
display an error message when the user forget to enter text.
hamidouk
parents:
553
diff
changeset
|
309 |
} else { |
|
627
13b9f14bf49a
added a spinner displayed while submitting an annotation.
hamidouk
parents:
626
diff
changeset
|
310 |
this.showWaitScreen(); |
|
594
96af41097260
WIP - adapting the widget to the new segments conventions.
hamidouk
parents:
575
diff
changeset
|
311 |
|
| 678 | 312 |
this.sendLdtData(contents, function(annotation) { |
| 683 | 313 |
if (_this.cinecast_version) { |
314 |
if (_this._Popcorn.media.paused) |
|
315 |
_this._Popcorn.play(); |
|
316 |
} |
|
|
630
7c53857650b1
create a new contribution line in the json if it's not defined already.
hamidouk
parents:
627
diff
changeset
|
317 |
|
| 683 | 318 |
_this.showEndScreen(annotation); |
319 |
if (_this.cinecast_version) { |
|
320 |
window.setTimeout(IriSP.wrap(_this, function() { this.showStartScreen(); }), 5000); |
|
321 |
} |
|
322 |
|
|
323 |
// hide the slicer widget |
|
324 |
if (!_this.cinecast_version) { |
|
325 |
_this._Popcorn.trigger("IriSP.SliceWidget.hide"); |
|
326 |
} |
|
|
614
116de1c38a7d
lots of refactoring for this widget, as well as changes to support the cinecast
hamidouk
parents:
611
diff
changeset
|
327 |
}); |
|
116de1c38a7d
lots of refactoring for this widget, as well as changes to support the cinecast
hamidouk
parents:
611
diff
changeset
|
328 |
} |
|
116de1c38a7d
lots of refactoring for this widget, as well as changes to support the cinecast
hamidouk
parents:
611
diff
changeset
|
329 |
}; |
|
116de1c38a7d
lots of refactoring for this widget, as well as changes to support the cinecast
hamidouk
parents:
611
diff
changeset
|
330 |
|
|
623
d8f107938feb
WIP - create custom-sized segments in "normal" (non-cinecast) mode.
hamidouk
parents:
620
diff
changeset
|
331 |
IriSP.createAnnotationWidget.prototype.handleSliderChanges = function(params) { |
|
d8f107938feb
WIP - create custom-sized segments in "normal" (non-cinecast) mode.
hamidouk
parents:
620
diff
changeset
|
332 |
this.sliceLeft = params[0]; |
|
d8f107938feb
WIP - create custom-sized segments in "normal" (non-cinecast) mode.
hamidouk
parents:
620
diff
changeset
|
333 |
this.sliceWidth = params[1]; |
|
d8f107938feb
WIP - create custom-sized segments in "normal" (non-cinecast) mode.
hamidouk
parents:
620
diff
changeset
|
334 |
}; |
|
d8f107938feb
WIP - create custom-sized segments in "normal" (non-cinecast) mode.
hamidouk
parents:
620
diff
changeset
|
335 |
|
|
614
116de1c38a7d
lots of refactoring for this widget, as well as changes to support the cinecast
hamidouk
parents:
611
diff
changeset
|
336 |
IriSP.createAnnotationWidget.prototype.sendLdtData = function(contents, callback) { |
|
116de1c38a7d
lots of refactoring for this widget, as well as changes to support the cinecast
hamidouk
parents:
611
diff
changeset
|
337 |
var _this = this; |
|
116de1c38a7d
lots of refactoring for this widget, as well as changes to support the cinecast
hamidouk
parents:
611
diff
changeset
|
338 |
var apiJson = {annotations : [{}], meta: {}}; |
|
116de1c38a7d
lots of refactoring for this widget, as well as changes to support the cinecast
hamidouk
parents:
611
diff
changeset
|
339 |
var annotation = apiJson["annotations"][0]; |
|
116de1c38a7d
lots of refactoring for this widget, as well as changes to support the cinecast
hamidouk
parents:
611
diff
changeset
|
340 |
|
|
116de1c38a7d
lots of refactoring for this widget, as well as changes to support the cinecast
hamidouk
parents:
611
diff
changeset
|
341 |
annotation["media"] = this._serializer.currentMedia()["id"]; |
|
682
10a52271579d
set the duration of the cinecast annotation as a function of the total length of
hamidouk
parents:
678
diff
changeset
|
342 |
var duration_part = Math.round(this._serializer.currentMedia().meta["dc:duration"] / 20); |
|
623
d8f107938feb
WIP - create custom-sized segments in "normal" (non-cinecast) mode.
hamidouk
parents:
620
diff
changeset
|
343 |
|
| 678 | 344 |
if (this.cinecast_version) { |
|
682
10a52271579d
set the duration of the cinecast annotation as a function of the total length of
hamidouk
parents:
678
diff
changeset
|
345 |
annotation["begin"] = Math.round(this._Popcorn.currentTime() * 1000 - duration_part); |
|
10a52271579d
set the duration of the cinecast annotation as a function of the total length of
hamidouk
parents:
678
diff
changeset
|
346 |
annotation["end"] = Math.round(this._Popcorn.currentTime() * 1000 + duration_part); |
| 678 | 347 |
if (annotation["begin"] < 0) |
348 |
annotation["begin"] = 0; |
|
349 |
|
|
350 |
if (annotation["end"] > this._serializer.currentMedia().meta["dc:duration"]) |
|
351 |
annotation["end"] = this._serializer.currentMedia().meta["dc:duration"]; |
|
352 |
|
|
|
623
d8f107938feb
WIP - create custom-sized segments in "normal" (non-cinecast) mode.
hamidouk
parents:
620
diff
changeset
|
353 |
} else { |
| 643 | 354 |
var duration = +this._serializer.currentMedia().meta["dc:duration"]; |
| 645 | 355 |
annotation["begin"] = +((duration * (this.sliceLeft / 100)).toFixed(0)); |
356 |
annotation["end"] = +((duration * ((this.sliceWidth + this.sliceLeft) / 100)).toFixed(0)); |
|
|
623
d8f107938feb
WIP - create custom-sized segments in "normal" (non-cinecast) mode.
hamidouk
parents:
620
diff
changeset
|
357 |
} |
| 645 | 358 |
|
|
614
116de1c38a7d
lots of refactoring for this widget, as well as changes to support the cinecast
hamidouk
parents:
611
diff
changeset
|
359 |
annotation["type"] = this._serializer.getContributions(); |
|
116de1c38a7d
lots of refactoring for this widget, as well as changes to support the cinecast
hamidouk
parents:
611
diff
changeset
|
360 |
if (typeof(annotation["type"]) === "undefined") |
|
116de1c38a7d
lots of refactoring for this widget, as well as changes to support the cinecast
hamidouk
parents:
611
diff
changeset
|
361 |
annotation["type"] = ""; |
|
116de1c38a7d
lots of refactoring for this widget, as well as changes to support the cinecast
hamidouk
parents:
611
diff
changeset
|
362 |
|
|
116de1c38a7d
lots of refactoring for this widget, as well as changes to support the cinecast
hamidouk
parents:
611
diff
changeset
|
363 |
annotation["type_title"] = "Contributions"; |
|
116de1c38a7d
lots of refactoring for this widget, as well as changes to support the cinecast
hamidouk
parents:
611
diff
changeset
|
364 |
annotation.content = {}; |
|
116de1c38a7d
lots of refactoring for this widget, as well as changes to support the cinecast
hamidouk
parents:
611
diff
changeset
|
365 |
annotation.content["data"] = contents; |
|
116de1c38a7d
lots of refactoring for this widget, as well as changes to support the cinecast
hamidouk
parents:
611
diff
changeset
|
366 |
|
|
116de1c38a7d
lots of refactoring for this widget, as well as changes to support the cinecast
hamidouk
parents:
611
diff
changeset
|
367 |
var meta = apiJson["meta"]; |
|
759
4dc3240f2c56
send the correct username if the user is loggedin on the platform.
hamidouk
parents:
722
diff
changeset
|
368 |
if (!IriSP.null_or_undefined(IriSP.user) && !IriSP.null_or_undefined(IriSP.user.name)) |
|
4dc3240f2c56
send the correct username if the user is loggedin on the platform.
hamidouk
parents:
722
diff
changeset
|
369 |
meta.creator = IriSP.user.name; |
|
4dc3240f2c56
send the correct username if the user is loggedin on the platform.
hamidouk
parents:
722
diff
changeset
|
370 |
else |
|
4dc3240f2c56
send the correct username if the user is loggedin on the platform.
hamidouk
parents:
722
diff
changeset
|
371 |
meta.creator = "An User"; |
|
4dc3240f2c56
send the correct username if the user is loggedin on the platform.
hamidouk
parents:
722
diff
changeset
|
372 |
|
|
614
116de1c38a7d
lots of refactoring for this widget, as well as changes to support the cinecast
hamidouk
parents:
611
diff
changeset
|
373 |
meta.created = Date().toString(); |
|
116de1c38a7d
lots of refactoring for this widget, as well as changes to support the cinecast
hamidouk
parents:
611
diff
changeset
|
374 |
|
|
116de1c38a7d
lots of refactoring for this widget, as well as changes to support the cinecast
hamidouk
parents:
611
diff
changeset
|
375 |
annotation["tags"] = []; |
|
116de1c38a7d
lots of refactoring for this widget, as well as changes to support the cinecast
hamidouk
parents:
611
diff
changeset
|
376 |
|
|
116de1c38a7d
lots of refactoring for this widget, as well as changes to support the cinecast
hamidouk
parents:
611
diff
changeset
|
377 |
for (var i = 0; i < this.keywords.length; i++) { |
|
116de1c38a7d
lots of refactoring for this widget, as well as changes to support the cinecast
hamidouk
parents:
611
diff
changeset
|
378 |
var keyword = this.keywords[i]; |
|
116de1c38a7d
lots of refactoring for this widget, as well as changes to support the cinecast
hamidouk
parents:
611
diff
changeset
|
379 |
if (contents.indexOf(keyword) != -1) |
|
116de1c38a7d
lots of refactoring for this widget, as well as changes to support the cinecast
hamidouk
parents:
611
diff
changeset
|
380 |
annotation["tags"].push(keyword); |
|
116de1c38a7d
lots of refactoring for this widget, as well as changes to support the cinecast
hamidouk
parents:
611
diff
changeset
|
381 |
} |
|
116de1c38a7d
lots of refactoring for this widget, as well as changes to support the cinecast
hamidouk
parents:
611
diff
changeset
|
382 |
|
|
116de1c38a7d
lots of refactoring for this widget, as well as changes to support the cinecast
hamidouk
parents:
611
diff
changeset
|
383 |
var jsonString = JSON.stringify(apiJson); |
|
116de1c38a7d
lots of refactoring for this widget, as well as changes to support the cinecast
hamidouk
parents:
611
diff
changeset
|
384 |
var project_id = this._serializer._data.meta.id; |
|
116de1c38a7d
lots of refactoring for this widget, as well as changes to support the cinecast
hamidouk
parents:
611
diff
changeset
|
385 |
|
|
116de1c38a7d
lots of refactoring for this widget, as well as changes to support the cinecast
hamidouk
parents:
611
diff
changeset
|
386 |
var url = Mustache.to_html("{{platf_url}}/ldtplatform/api/ldt/projects/{{id}}.json", |
|
116de1c38a7d
lots of refactoring for this widget, as well as changes to support the cinecast
hamidouk
parents:
611
diff
changeset
|
387 |
{platf_url: IriSP.platform_url, id: project_id}); |
|
627
13b9f14bf49a
added a spinner displayed while submitting an annotation.
hamidouk
parents:
626
diff
changeset
|
388 |
|
|
614
116de1c38a7d
lots of refactoring for this widget, as well as changes to support the cinecast
hamidouk
parents:
611
diff
changeset
|
389 |
IriSP.jQuery.ajax({ |
|
116de1c38a7d
lots of refactoring for this widget, as well as changes to support the cinecast
hamidouk
parents:
611
diff
changeset
|
390 |
url: url, |
|
116de1c38a7d
lots of refactoring for this widget, as well as changes to support the cinecast
hamidouk
parents:
611
diff
changeset
|
391 |
type: 'PUT', |
|
116de1c38a7d
lots of refactoring for this widget, as well as changes to support the cinecast
hamidouk
parents:
611
diff
changeset
|
392 |
contentType: 'application/json', |
|
116de1c38a7d
lots of refactoring for this widget, as well as changes to support the cinecast
hamidouk
parents:
611
diff
changeset
|
393 |
data: jsonString, |
| 626 | 394 |
//dataType: 'json', |
|
630
7c53857650b1
create a new contribution line in the json if it's not defined already.
hamidouk
parents:
627
diff
changeset
|
395 |
success: IriSP.wrap(this, function(json, textStatus, XMLHttpRequest) { |
|
7c53857650b1
create a new contribution line in the json if it's not defined already.
hamidouk
parents:
627
diff
changeset
|
396 |
/* add the annotation to the annotation and tell the world */ |
|
7c53857650b1
create a new contribution line in the json if it's not defined already.
hamidouk
parents:
627
diff
changeset
|
397 |
|
|
7c53857650b1
create a new contribution line in the json if it's not defined already.
hamidouk
parents:
627
diff
changeset
|
398 |
/* if the media doesn't have a contributions line, we need to add one */ |
|
7c53857650b1
create a new contribution line in the json if it's not defined already.
hamidouk
parents:
627
diff
changeset
|
399 |
if (typeof(this._serializer.getContributions()) === "undefined") { |
|
7c53857650b1
create a new contribution line in the json if it's not defined already.
hamidouk
parents:
627
diff
changeset
|
400 |
/* set up a basic view */ |
|
7c53857650b1
create a new contribution line in the json if it's not defined already.
hamidouk
parents:
627
diff
changeset
|
401 |
var tmp_view = {"dc:contributor": "perso", "dc:creator": "perso", "dc:title": "Contributions", |
|
7c53857650b1
create a new contribution line in the json if it's not defined already.
hamidouk
parents:
627
diff
changeset
|
402 |
"id": json.annotations[0].type} |
| 651 | 403 |
|
|
630
7c53857650b1
create a new contribution line in the json if it's not defined already.
hamidouk
parents:
627
diff
changeset
|
404 |
this._serializer._data["annotation-types"].push(tmp_view); |
|
7c53857650b1
create a new contribution line in the json if it's not defined already.
hamidouk
parents:
627
diff
changeset
|
405 |
} |
|
7c53857650b1
create a new contribution line in the json if it's not defined already.
hamidouk
parents:
627
diff
changeset
|
406 |
|
| 597 | 407 |
delete annotation.tags; |
408 |
annotation.content.description = annotation.content.data; |
|
|
630
7c53857650b1
create a new contribution line in the json if it's not defined already.
hamidouk
parents:
627
diff
changeset
|
409 |
annotation.content.title = ""; |
| 597 | 410 |
delete annotation.content.data; |
411 |
annotation.id = json.annotations[0].id; |
|
|
630
7c53857650b1
create a new contribution line in the json if it's not defined already.
hamidouk
parents:
627
diff
changeset
|
412 |
|
| 606 | 413 |
annotation.meta = meta; |
| 643 | 414 |
annotation.meta["id-ref"] = json.annotations[0]["type"]; |
415 |
|
|
| 597 | 416 |
// everything is shared so there's no need to propagate the change |
417 |
_this._serializer._data.annotations.push(annotation); |
|
| 651 | 418 |
|
| 643 | 419 |
_this._Popcorn.trigger("IriSP.createAnnotationWidget.addedAnnotation", annotation); |
| 651 | 420 |
callback(annotation); |
|
630
7c53857650b1
create a new contribution line in the json if it's not defined already.
hamidouk
parents:
627
diff
changeset
|
421 |
}), |
|
614
116de1c38a7d
lots of refactoring for this widget, as well as changes to support the cinecast
hamidouk
parents:
611
diff
changeset
|
422 |
error: |
| 626 | 423 |
function(jqXHR, textStatus, errorThrown) { |
|
614
116de1c38a7d
lots of refactoring for this widget, as well as changes to support the cinecast
hamidouk
parents:
611
diff
changeset
|
424 |
console.log("an error occured while contacting " |
| 626 | 425 |
+ url + " and sending " + jsonString + textStatus ); } }); |
| 543 | 426 |
}; |