diff options
Diffstat (limited to 'js/document/views/design.js')
-rwxr-xr-x | js/document/views/design.js | 61 |
1 files changed, 53 insertions, 8 deletions
diff --git a/js/document/views/design.js b/js/document/views/design.js index b7c50a7c..ed98b660 100755 --- a/js/document/views/design.js +++ b/js/document/views/design.js | |||
@@ -1,7 +1,31 @@ | |||
1 | /* <copyright> | 1 | /* <copyright> |
2 | This file contains proprietary software owned by Motorola Mobility, Inc.<br/> | 2 | Copyright (c) 2012, Motorola Mobility, Inc |
3 | No rights, expressed or implied, whatsoever to this software are provided by Motorola Mobility, Inc. hereunder.<br/> | 3 | All Rights Reserved. |
4 | (c) Copyright 2011 Motorola Mobility, Inc. All Rights Reserved. | 4 | BSD License. |
5 | |||
6 | Redistribution and use in source and binary forms, with or without | ||
7 | modification, are permitted provided that the following conditions are met: | ||
8 | |||
9 | - Redistributions of source code must retain the above copyright notice, | ||
10 | this list of conditions and the following disclaimer. | ||
11 | - Redistributions in binary form must reproduce the above copyright | ||
12 | notice, this list of conditions and the following disclaimer in the | ||
13 | documentation and/or other materials provided with the distribution. | ||
14 | - Neither the name of Motorola Mobility nor the names of its contributors | ||
15 | may be used to endorse or promote products derived from this software | ||
16 | without specific prior written permission. | ||
17 | |||
18 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" | ||
19 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | ||
20 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | ||
21 | ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE | ||
22 | LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR | ||
23 | CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF | ||
24 | SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS | ||
25 | INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN | ||
26 | CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | ||
27 | ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | ||
28 | POSSIBILITY OF SUCH DAMAGE. | ||
5 | </copyright> */ | 29 | </copyright> */ |
6 | 30 | ||
7 | //////////////////////////////////////////////////////////////////////// | 31 | //////////////////////////////////////////////////////////////////////// |
@@ -513,9 +537,11 @@ exports.DesignDocumentView = Montage.create(BaseDocumentView, { | |||
513 | // | 537 | // |
514 | pauseVideos:{ | 538 | pauseVideos:{ |
515 | value:function(){ | 539 | value:function(){ |
516 | var i, videos = this.document.getElementsByTagName("video"); | 540 | if(this.document) { |
517 | for(i = 0; i < videos.length; i++){ | 541 | var i, videos = this.document.getElementsByTagName("video"); |
518 | if(!videos[i].paused) videos[i].pause(); | 542 | for(i = 0; i < videos.length; i++){ |
543 | if(!videos[i].paused) videos[i].pause(); | ||
544 | } | ||
519 | } | 545 | } |
520 | } | 546 | } |
521 | }, | 547 | }, |
@@ -539,9 +565,28 @@ exports.DesignDocumentView = Montage.create(BaseDocumentView, { | |||
539 | videos[i].src = ""; | 565 | videos[i].src = ""; |
540 | } | 566 | } |
541 | } | 567 | } |
542 | } | 568 | }, |
543 | //////////////////////////////////////////////////////////////////// | 569 | //////////////////////////////////////////////////////////////////// |
544 | //////////////////////////////////////////////////////////////////// | 570 | //////////////////////////////////////////////////////////////////// |
571 | toggleWebGlAnimation: { | ||
572 | value: function(show) { | ||
573 | if(this.document) { | ||
574 | var glCanvases = this.document.querySelectorAll('[data-RDGE-id]'), | ||
575 | glShapeModel; | ||
576 | if(glCanvases) { | ||
577 | for(var i = 0, len = glCanvases.length; i<len; i++) { | ||
578 | glShapeModel = glCanvases[i].elementModel.shapeModel; | ||
579 | if(show) { | ||
580 | glShapeModel.GLWorld.restartRenderLoop(); | ||
581 | } else { | ||
582 | glShapeModel.GLWorld.stop(); | ||
583 | } | ||
584 | } | ||
585 | |||
586 | } | ||
587 | } | ||
588 | } | ||
589 | } | ||
545 | }); | 590 | }); |
546 | //////////////////////////////////////////////////////////////////////// | 591 | //////////////////////////////////////////////////////////////////////// |
547 | //////////////////////////////////////////////////////////////////////// \ No newline at end of file | 592 | //////////////////////////////////////////////////////////////////////// |