diff options
Diffstat (limited to 'js/document')
-rwxr-xr-x | js/document/html-document.js | 59 | ||||
-rwxr-xr-x | js/document/templates/montage-html/default_html.css | 75 | ||||
-rwxr-xr-x | js/document/templates/montage-html/index.html | 50 | ||||
-rw-r--r-- | js/document/templates/montage-html/main.reel/main.js | 54 | ||||
-rwxr-xr-x | js/document/templates/montage-html/package.json | 8 | ||||
-rwxr-xr-x | js/document/templates/montage-html/styles.css | 5 | ||||
-rwxr-xr-x | js/document/text-document.js | 5 |
7 files changed, 252 insertions, 4 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, | |||
14 | exports.HTMLDocument = Montage.create(TextDocument, { | 14 | exports.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: { |
diff --git a/js/document/templates/montage-html/default_html.css b/js/document/templates/montage-html/default_html.css new file mode 100755 index 00000000..68300edf --- /dev/null +++ b/js/document/templates/montage-html/default_html.css | |||
@@ -0,0 +1,75 @@ | |||
1 | /* <copyright> | ||
2 | This file contains proprietary software owned by Motorola Mobility, Inc.<br/> | ||
3 | No rights, expressed or implied, whatsoever to this software are provided by Motorola Mobility, Inc. hereunder.<br/> | ||
4 | (c) Copyright 2011 Motorola Mobility, Inc. All Rights Reserved. | ||
5 | </copyright> */ | ||
6 | |||
7 | * { | ||
8 | -webkit-transition-duration: 0s !important; | ||
9 | -webkit-animation-duration: 0s !important; | ||
10 | -webkit-animation-name: none !important; | ||
11 | } | ||
12 | |||
13 | html{ | ||
14 | overflow:hidden; | ||
15 | } | ||
16 | |||
17 | body | ||
18 | { | ||
19 | background: #808080; | ||
20 | } | ||
21 | |||
22 | #Viewport | ||
23 | { | ||
24 | margin: 0px; | ||
25 | padding: 0px; | ||
26 | top: 200px; | ||
27 | left: 700px; | ||
28 | /*position: absolute;*/ | ||
29 | /*height: 600px;*/ | ||
30 | /*width: 800px;*/ | ||
31 | opacity: 0.99; | ||
32 | z-index:2; | ||
33 | } | ||
34 | |||
35 | #stageBG | ||
36 | { | ||
37 | background: #ffffff; | ||
38 | top: 200px; | ||
39 | left: 700px; | ||
40 | z-index:1; | ||
41 | } | ||
42 | |||
43 | .stageDimension | ||
44 | { | ||
45 | position: absolute; | ||
46 | height: 600px; | ||
47 | width: 800px; | ||
48 | } | ||
49 | |||
50 | .stageView | ||
51 | { | ||
52 | border: 1px solid black; | ||
53 | -webkit-transform-style: preserve-3d; | ||
54 | -webkit-transform: perspective(1400) matrix3d(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); | ||
55 | } | ||
56 | |||
57 | .stageContentShadow { | ||
58 | -webkit-box-shadow: 3px 5px 4px rgba(0,0,0,.5); | ||
59 | -moz-box-shadow: 3px 5px 4px rgba(0,0,0,.5); | ||
60 | box-shadow: 3px 5px 4px rgba(0,0,0,.5); | ||
61 | } | ||
62 | |||
63 | #userHead | ||
64 | { | ||
65 | display: none; | ||
66 | } | ||
67 | |||
68 | .global3DSettings { | ||
69 | -webkit-transform-style: preserve-3d; | ||
70 | -webkit-transform: perspective(1400) matrix3d(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); | ||
71 | } | ||
72 | |||
73 | .elem-red-outline { | ||
74 | outline: red solid thin; | ||
75 | } \ No newline at end of file | ||
diff --git a/js/document/templates/montage-html/index.html b/js/document/templates/montage-html/index.html new file mode 100755 index 00000000..8b3d73bb --- /dev/null +++ b/js/document/templates/montage-html/index.html | |||
@@ -0,0 +1,50 @@ | |||
1 | <!DOCTYPE html> | ||
2 | <!-- <copyright> | ||
3 | This file contains proprietary software owned by Motorola Mobility, Inc.<br/> | ||
4 | No rights, expressed or implied, whatsoever to this software are provided by Motorola Mobility, Inc. hereunder.<br/> | ||
5 | (c) Copyright 2011 Motorola Mobility, Inc. All Rights Reserved. | ||
6 | </copyright> --> | ||
7 | |||
8 | <html> | ||
9 | |||
10 | <head> | ||
11 | |||
12 | <title>Ninja Prototype</title> | ||
13 | |||
14 | <link href="default_html.css" id="nj-stage-stylesheet" rel="stylesheet" type="text/css" media="screen"/> | ||
15 | <link href="styles.css" id="nj-default-stylesheet" rel="stylesheet" type="text/css" media="screen"/> | ||
16 | |||
17 | <script type="text/javascript" data-package="." src="../../../../node_modules/montage/montage.js"></script> | ||
18 | |||
19 | <script type="text/javascript"> | ||
20 | function getElement(x,y) { | ||
21 | return document.elementFromPoint(x,y); | ||