aboutsummaryrefslogtreecommitdiff
path: root/js/document/html-document.js
diff options
context:
space:
mode:
authorValerio Virgillito2012-02-20 15:40:04 -0800
committerValerio Virgillito2012-02-20 15:40:04 -0800
commitf6811b8b7e86bcae16f9278b5a7cfc1ea94e3909 (patch)
tree7d12d3aca26e15fac2072498d42e2f7478f72719 /js/document/html-document.js
parent7ec06098dcfa969017b73b91a1eec810d05775f8 (diff)
parentbd7bc833895391e4974b8746f31f63ba70689df3 (diff)
downloadninja-f6811b8b7e86bcae16f9278b5a7cfc1ea94e3909.tar.gz
Merge branch 'refs/heads/master' into nested-selection
Diffstat (limited to 'js/document/html-document.js')
-rwxr-xr-xjs/document/html-document.js59
1 files changed, 57 insertions, 2 deletions
diff --git a/js/document/html-document.js b/js/document/html-document.js
index 0c8695fb..77cc711d 100755
--- a/js/document/html-document.js
+++ b/js/document/html-document.js
@@ -14,7 +14,7 @@ var Montage = require("montage/core/core").Montage,
14exports.HTMLDocument = Montage.create(TextDocument, { 14exports.HTMLDocument = Montage.create(TextDocument, {
15 15
16 _selectionExclude: { value: null, enumerable: false }, 16 _selectionExclude: { value: null, enumerable: false },
17 _htmlTemplateUrl: { value: "user-document-templates/montage-application-cloud/index.html", enumerable: false}, 17 _htmlTemplateUrl: { value: "js/document/templates/montage-html/index.html", enumerable: false},
18 _iframe: { value: null, enumerable: false }, 18 _iframe: { value: null, enumerable: false },
19 _server: { value: null, enumerable: false }, 19 _server: { value: null, enumerable: false },
20 _templateDocument: { value: null, enumerable: false }, 20 _templateDocument: { value: null, enumerable: false },
@@ -235,6 +235,7 @@ exports.HTMLDocument = Montage.create(TextDocument, {
235 // 235 //
236 initialize: { 236 initialize: {
237 value: function(file, uuid, iframe, callback) { 237 value: function(file, uuid, iframe, callback) {
238 this.application.ninja.documentController._hackRootFlag = false;
238 // 239 //
239 this._userDocument = file; 240 this._userDocument = file;
240 // 241 //
@@ -354,11 +355,19 @@ exports.HTMLDocument = Montage.create(TextDocument, {
354 }, 355 },
355 356
356 357
358
359
360
357 361
358 //////////////////////////////////////////////////////////////////// 362 ////////////////////////////////////////////////////////////////////
359 // 363 //
360 handleEvent: { 364 handleEvent: {
361 value: function(event){ 365 value: function(event){
366 //TODO: Remove
367 window.hackPreview = this.livePreview.bind(this);
368
369 this.application.ninja.documentController._hackRootFlag = true;
370 //console.log(this._userDocument.root, this);
362 //TODO: Clean up, using for prototyping save 371 //TODO: Clean up, using for prototyping save
363 this._templateDocument = {}; 372 this._templateDocument = {};
364 this._templateDocument.head = this.iframe.contentWindow.document.getElementById("userHead");; 373 this._templateDocument.head = this.iframe.contentWindow.document.getElementById("userHead");;
@@ -389,6 +398,8 @@ exports.HTMLDocument = Montage.create(TextDocument, {
389 this._stylesheets = this._document.styleSheets; // Entire stlyesheets array 398 this._stylesheets = this._document.styleSheets; // Entire stlyesheets array
390 399
391 this.callback(this); 400 this.callback(this);
401
402 //console.log('file content end');
392 } 403 }
393 }.bind(this), 50); 404 }.bind(this), 50);
394 405
@@ -440,7 +451,9 @@ exports.HTMLDocument = Montage.create(TextDocument, {
440 } 451 }
441 452
442 // Remving this callback and using the callback from the css load 453 // Remving this callback and using the callback from the css load
443 // this.callback(this); 454 //this.callback(this);
455
456
444 457
445 } 458 }
446 }, 459 },
@@ -461,6 +474,48 @@ exports.HTMLDocument = Montage.create(TextDocument, {
461 } 474 }
462 }, 475 },
463 476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499 ////////////////////////////////////////////////////////////////////
500 //
501 livePreview: {
502 enumerable: false,
503 value: function () {
504 //this.application.ninja.documentController
505 //console.log(this.application.ninja.coreIoApi.rootUrl+this.application.ninja.documentController._activeDocument.uri.split(this.application.ninja.coreIoApi.cloudData.root)[1]);
506 chrome.tabs.create({url: this.application.ninja.coreIoApi.rootUrl+this.application.ninja.documentController._activeDocument.uri.split(this.application.ninja.coreIoApi.cloudData.root)[1]});
507 }
508 },
509 ////////////////////////////////////////////////////////////////////
510
511
512
513
514
515
516
517
518
464 //////////////////////////////////////////////////////////////////// 519 ////////////////////////////////////////////////////////////////////
465 // 520 //
466 save: { 521 save: {