aboutsummaryrefslogtreecommitdiff
path: root/js/document
diff options
context:
space:
mode:
authorNivesh Rajbhandari2012-07-02 09:23:13 -0700
committerNivesh Rajbhandari2012-07-02 09:23:13 -0700
commit2bae1b3148233288ec0bc50876935bdfea1f288c (patch)
tree686fa3b5b9615941bb7013f35c91e8f326b049db /js/document
parent2da05a4c71bfe9b136384d9e94fbfbef19f24550 (diff)
parent12de4e49a309e210c13eb40b2ffa158ef2eb54a7 (diff)
downloadninja-2bae1b3148233288ec0bc50876935bdfea1f288c.tar.gz
Merge branch 'refs/heads/ninja-internal' into MaterialsUI
Diffstat (limited to 'js/document')
-rwxr-xr-xjs/document/mediators/template.js10
-rwxr-xr-xjs/document/templates/banner/index.html2
-rwxr-xr-xjs/document/templates/html/index.html2
-rwxr-xr-xjs/document/views/design.js22
4 files changed, 23 insertions, 13 deletions
diff --git a/js/document/mediators/template.js b/js/document/mediators/template.js
index f43b1a2c..015a50ff 100755
--- a/js/document/mediators/template.js
+++ b/js/document/mediators/template.js
@@ -220,14 +220,6 @@ exports.TemplateDocumentMediator = Montage.create(Component, {
220 linktags = template.file.content.document.getElementsByTagName('link'), 220 linktags = template.file.content.document.getElementsByTagName('link'),
221 njtemplatetags = template.file.content.document.querySelectorAll('[data-ninja-template]'); 221 njtemplatetags = template.file.content.document.querySelectorAll('[data-ninja-template]');
222 222
223 //////////////////////////////////////////////////
224 //TODO: Remove, temp hack, this is to be fixed by Montage
225 var basetags = template.file.content.document.getElementsByTagName('base');
226 for (var g in basetags) {
227 if (basetags[g].getAttribute && basetags[g].href && basetags[g].href.indexOf('chrome-extension://') !== -1) toremovetags.push(basetags[g]);
228 }
229 //////////////////////////////////////////////////
230
231 //Adding to tags to be removed form template 223 //Adding to tags to be removed form template
232 for (var f in njtemplatetags) { 224 for (var f in njtemplatetags) {
233 if (njtemplatetags[f].getAttribute) toremovetags.push(njtemplatetags[f]); 225 if (njtemplatetags[f].getAttribute) toremovetags.push(njtemplatetags[f]);
@@ -284,8 +276,6 @@ exports.TemplateDocumentMediator = Montage.create(Component, {
284 276
285 277
286 278
287
288
289 //TODO: Make proper CSS method 279 //TODO: Make proper CSS method
290 280
291 281
diff --git a/js/document/templates/banner/index.html b/js/document/templates/banner/index.html
index 626dc0bc..037c1197 100755
--- a/js/document/templates/banner/index.html
+++ b/js/document/templates/banner/index.html
@@ -18,9 +18,11 @@
18 18
19 <style type="text/css" id="nj-stage-stylesheet" data-ninja-template="true"> 19 <style type="text/css" id="nj-stage-stylesheet" data-ninja-template="true">
20 * { 20 * {
21 -webkit-animation: none !important;
21 -webkit-transition-duration: 0s !important; 22 -webkit-transition-duration: 0s !important;
22 -webkit-animation-duration: 0s !important; 23 -webkit-animation-duration: 0s !important;
23 -webkit-animation-name: none !important; 24 -webkit-animation-name: none !important;
25 -webkit-animation-fill-mode: none !important;
24 } 26 }
25 27
26 body { 28 body {
diff --git a/js/document/templates/html/index.html b/js/document/templates/html/index.html
index 8fc0d82f..ef68a3c0 100755
--- a/js/document/templates/html/index.html
+++ b/js/document/templates/html/index.html
@@ -21,9 +21,11 @@
21 21
22 <style type="text/css" id="nj-stage-stylesheet" data-ninja-template="true"> 22 <style type="text/css" id="nj-stage-stylesheet" data-ninja-template="true">
23 * { 23 * {
24 -webkit-animation: none !important;
24 -webkit-transition-duration: 0s !important; 25 -webkit-transition-duration: 0s !important;
25 -webkit-animation-duration: 0s !important; 26 -webkit-animation-duration: 0s !important;
26 -webkit-animation-name: none !important; 27 -webkit-animation-name: none !important;
28 -webkit-animation-fill-mode: none !important;
27 } 29 }
28 30
29 body { 31 body {
diff --git a/js/document/views/design.js b/js/document/views/design.js
index 5c7ba4fc..f8020f2b 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