diff options
author | Armen Kesablyan | 2012-07-02 13:19:20 -0700 |
---|---|---|
committer | Armen Kesablyan | 2012-07-02 13:19:20 -0700 |
commit | 526b9d76686323f488f1b26175440172b715d808 (patch) | |
tree | 47fc6bd90715b403a08d08a48a86f4d24da1ba29 /js/document/views | |
parent | b194664df7e01aaeb8d1e7220a6de0e7f879f1db (diff) | |
parent | 12de4e49a309e210c13eb40b2ffa158ef2eb54a7 (diff) | |
download | ninja-526b9d76686323f488f1b26175440172b715d808.tar.gz |
Merge branch 'master' of github.com:Motorola-Mobility/ninja-internal
Diffstat (limited to 'js/document/views')
-rwxr-xr-x | js/document/views/design.js | 22 |
1 files changed, 19 insertions, 3 deletions
diff --git a/js/document/views/design.js b/js/document/views/design.js index 6a60e1f9..b7c50a7c 100755 --- a/js/document/views/design.js +++ b/js/document/views/design.js | |||
@@ -285,7 +285,8 @@ exports.DesignDocumentView = Montage.create(BaseDocumentView, { | |||
285 | userStyles, | 285 | userStyles, |
286 | stags = this.document.getElementsByTagName('style'), | 286 | stags = this.document.getElementsByTagName('style'), |
287 | ltags = this.document.getElementsByTagName('link'), i, orgNodes, | 287 | ltags = this.document.getElementsByTagName('link'), i, orgNodes, |
288 | scripttags = this.document.getElementsByTagName('script'); | 288 | scripttags = this.document.getElementsByTagName('script'), |
289 | videotags = this.document.getElementsByTagName('video'); | ||
289 | //Temporarily checking for disabled special case (we must enabled for Ninja to access styles) | 290 | //Temporarily checking for disabled special case (we must enabled for Ninja to access styles) |
290 | this.ninjaDisableAttribute(stags); | 291 | this.ninjaDisableAttribute(stags); |
291 | this.ninjaDisableAttribute(ltags); | 292 | this.ninjaDisableAttribute(ltags); |
@@ -308,10 +309,25 @@ exports.DesignDocumentView = Montage.create(BaseDocumentView, { | |||
308 | } | 309 | } |
309 | } | 310 | } |
310 | } | 311 | } |
311 | 312 | //Checking for video tags | |
313 | if (videotags.length > 0) { | ||
314 | //Looping through all video tags | ||
315 | for (i = 0; i < videotags.length; i++) { | ||
316 | //Stopping all videos from playing on open | ||
317 | videotags[i].addEventListener('canplay', function(e) { | ||
318 | //TODO: Figure out why the video must be seeked to the end before pausing | ||
319 | var time = Math.ceil(this.duration); | ||
320 | //Trying to display the last frame (doing minus 2 seconds if long video) | ||
321 | if (time > 2) this.currentTime = time - 2; | ||
322 | else if (time > 1) this.currentTime = time - 1; | ||
323 | else this.currentTime = time || 0; | ||
324 | //Pauing video | ||
325 | this.pause(); | ||
326 | }, false); | ||
327 | } | ||
328 | } | ||
312 | // Assign the modelGenerator reference from the template to our own modelGenerator | 329 | // Assign the modelGenerator reference from the template to our own modelGenerator |
313 | this.document.modelGenerator = ElementModel.modelGenerator; | 330 | this.document.modelGenerator = ElementModel.modelGenerator; |
314 | |||
315 | //Checking for script tags then parsing check for montage and webgl | 331 | //Checking for script tags then parsing check for montage and webgl |
316 | if (scripttags.length > 0) { | 332 | if (scripttags.length > 0) { |
317 | //Checking and initializing webGL | 333 | //Checking and initializing webGL |