From d7441481d8a1032a555cbdc26996a4202e424b22 Mon Sep 17 00:00:00 2001 From: Ananya Sen Date: Fri, 29 Jun 2012 16:17:13 -0700 Subject: Fixed IKNINJA-1763, IKNINJA-1807 - refresh stage after loading is done for image and svg Signed-off-by: Ananya Sen --- js/clipboard/internal-ops/elements-clipboard-agent.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'js/clipboard/internal-ops') diff --git a/js/clipboard/internal-ops/elements-clipboard-agent.js b/js/clipboard/internal-ops/elements-clipboard-agent.js index 1a4bfdba..a8bd3b2d 100644 --- a/js/clipboard/internal-ops/elements-clipboard-agent.js +++ b/js/clipboard/internal-ops/elements-clipboard-agent.js @@ -325,7 +325,7 @@ var ElementsClipboardAgent = exports.ElementsClipboardAgent = Montage.create(Com pastePositioned:{ value: function(element, styles, fromCopy){// for now can wok for both in-place and centered paste - var modObject = [], x,y, newX, newY, counter; + var modObject = [], x,y, newX, newY, counter, self = this, addElementsFlag = true; if((typeof fromCopy === "undefined") || (fromCopy && fromCopy === true)){ counter = this.pasteCounter; @@ -341,6 +341,14 @@ var ElementsClipboardAgent = exports.ElementsClipboardAgent = Montage.create(Com if(!styles || (styles && !styles.position)){ this.application.ninja.elementMediator.addElements(element, null, false); }else if(styles && (styles.position === "absolute")){ + if((element.tagName === "IMG") || (element.getAttribute("type") === "image/svg+xml")){ + element.onload = function(){ + element.onload = null; + //refresh selection + self.application.ninja.stage.needsDraw = true; + } + } + this.application.ninja.elementMediator.addElements(element, {"top" : newY, "left" : newX}, false);//displace } } -- cgit v1.2.3 From d00207263caf6b8196b991a681e826b658d0712c Mon Sep 17 00:00:00 2001 From: Ananya Sen Date: Fri, 29 Jun 2012 16:19:48 -0700 Subject: removing unnecessary variable Signed-off-by: Ananya Sen --- js/clipboard/internal-ops/elements-clipboard-agent.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'js/clipboard/internal-ops') diff --git a/js/clipboard/internal-ops/elements-clipboard-agent.js b/js/clipboard/internal-ops/elements-clipboard-agent.js index a8bd3b2d..1f3db331 100644 --- a/js/clipboard/internal-ops/elements-clipboard-agent.js +++ b/js/clipboard/internal-ops/elements-clipboard-agent.js @@ -325,7 +325,7 @@ var ElementsClipboardAgent = exports.ElementsClipboardAgent = Montage.create(Com pastePositioned:{ value: function(element, styles, fromCopy){// for now can wok for both in-place and centered paste - var modObject = [], x,y, newX, newY, counter, self = this, addElementsFlag = true; + var modObject = [], x,y, newX, newY, counter, self = this; if((typeof fromCopy === "undefined") || (fromCopy && fromCopy === true)){ counter = this.pasteCounter; -- cgit v1.2.3 From fdf2411fbf8d2d5ec710dded859bb5fa29e867d6 Mon Sep 17 00:00:00 2001 From: Nivesh Rajbhandari Date: Mon, 2 Jul 2012 13:29:02 -0700 Subject: IKNinja-1736 and IKNinja-1802 - Copy paste WebGL bugs. Signed-off-by: Nivesh Rajbhandari --- js/clipboard/internal-ops/elements-clipboard-agent.js | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'js/clipboard/internal-ops') diff --git a/js/clipboard/internal-ops/elements-clipboard-agent.js b/js/clipboard/internal-ops/elements-clipboard-agent.js index 1a4bfdba..ef89ab35 100644 --- a/js/clipboard/internal-ops/elements-clipboard-agent.js +++ b/js/clipboard/internal-ops/elements-clipboard-agent.js @@ -243,7 +243,10 @@ var ElementsClipboardAgent = exports.ElementsClipboardAgent = Montage.create(Com styles = null; } + var addDelegate = this.application.ninja.elementMediator.addDelegate; + this.application.ninja.elementMediator.addDelegate = null; this.application.ninja.elementMediator.addElements(canvas, styles, false); + this.application.ninja.elementMediator.addDelegate = addDelegate; worldData = sourceCanvas.elementModel.shapeModel ? sourceCanvas.elementModel.shapeModel.GLWorld.exportJSON(): null; if(worldData) @@ -338,11 +341,14 @@ var ElementsClipboardAgent = exports.ElementsClipboardAgent = Montage.create(Com newX = styles ? ("" + (styles.left + (25 * counter)) + "px") : "100px"; newY = styles ? ("" + (styles.top + (25 * counter)) + "px") : "100px"; + var addDelegate = this.application.ninja.elementMediator.addDelegate; + this.application.ninja.elementMediator.addDelegate = null; if(!styles || (styles && !styles.position)){ this.application.ninja.elementMediator.addElements(element, null, false); }else if(styles && (styles.position === "absolute")){ this.application.ninja.elementMediator.addElements(element, {"top" : newY, "left" : newX}, false);//displace } + this.application.ninja.elementMediator.addDelegate = addDelegate; } }, -- cgit v1.2.3 From 648ee61ae84216d0236e0dbc211addc13b2cfa3a Mon Sep 17 00:00:00 2001 From: Kris Kowal Date: Fri, 6 Jul 2012 11:52:06 -0700 Subject: Expand tabs --- js/clipboard/internal-ops/component-clipboard-agent.js | 4 ++-- js/clipboard/internal-ops/css-clipboard-agent.js | 4 ++-- js/clipboard/internal-ops/elements-clipboard-agent.js | 4 ++-- js/clipboard/internal-ops/timeline-clipboard-agent.js | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) (limited to 'js/clipboard/internal-ops') diff --git a/js/clipboard/internal-ops/component-clipboard-agent.js b/js/clipboard/internal-ops/component-clipboard-agent.js index 3dc41532..31b53474 100644 --- a/js/clipboard/internal-ops/component-clipboard-agent.js +++ b/js/clipboard/internal-ops/component-clipboard-agent.js @@ -31,8 +31,8 @@ POSSIBILITY OF SUCH DAMAGE. //////////////////////////////////////////////////////////////////////// // -var Montage = require("montage/core/core").Montage, - Component = require("montage/ui/component").Component; +var Montage = require("montage/core/core").Montage, + Component = require("montage/ui/component").Component; var ComponentsClipboardAgent = exports.ComponentsClipboardAgent = Montage.create(Component, { diff --git a/js/clipboard/internal-ops/css-clipboard-agent.js b/js/clipboard/internal-ops/css-clipboard-agent.js index 42dd09c9..e93077a8 100644 --- a/js/clipboard/internal-ops/css-clipboard-agent.js +++ b/js/clipboard/internal-ops/css-clipboard-agent.js @@ -31,8 +31,8 @@ POSSIBILITY OF SUCH DAMAGE. //////////////////////////////////////////////////////////////////////// // -var Montage = require("montage/core/core").Montage, - Component = require("montage/ui/component").Component; +var Montage = require("montage/core/core").Montage, + Component = require("montage/ui/component").Component; var CssClipboardAgent = exports.CssClipboardAgent = Montage.create(Component, { diff --git a/js/clipboard/internal-ops/elements-clipboard-agent.js b/js/clipboard/internal-ops/elements-clipboard-agent.js index 14984593..5c4b7d6f 100644 --- a/js/clipboard/internal-ops/elements-clipboard-agent.js +++ b/js/clipboard/internal-ops/elements-clipboard-agent.js @@ -31,8 +31,8 @@ POSSIBILITY OF SUCH DAMAGE. //////////////////////////////////////////////////////////////////////// // -var Montage = require("montage/core/core").Montage, - Component = require("montage/ui/component").Component, +var Montage = require("montage/core/core").Montage, + Component = require("montage/ui/component").Component, ClipboardUtil = require("js/clipboard/util").ClipboardUtil, World = require("js/lib/drawing/world").World; diff --git a/js/clipboard/internal-ops/timeline-clipboard-agent.js b/js/clipboard/internal-ops/timeline-clipboard-agent.js index d8ef7ae9..4e5cfe30 100644 --- a/js/clipboard/internal-ops/timeline-clipboard-agent.js +++ b/js/clipboard/internal-ops/timeline-clipboard-agent.js @@ -31,8 +31,8 @@ POSSIBILITY OF SUCH DAMAGE. //////////////////////////////////////////////////////////////////////// // -var Montage = require("montage/core/core").Montage, - Component = require("montage/ui/component").Component; +var Montage = require("montage/core/core").Montage, + Component = require("montage/ui/component").Component; var TimelineClipboardAgent = exports.TimelineClipboardAgent = Montage.create(Component, { -- cgit v1.2.3 From fdbec324dad4ab33d97282ab021d2c1661bc097c Mon Sep 17 00:00:00 2001 From: Kris Kowal Date: Mon, 9 Jul 2012 16:27:52 -0700 Subject: BSD License --- .../internal-ops/component-clipboard-agent.js | 23 +++++++++++----------- js/clipboard/internal-ops/css-clipboard-agent.js | 23 +++++++++++----------- .../internal-ops/elements-clipboard-agent.js | 23 +++++++++++----------- .../internal-ops/timeline-clipboard-agent.js | 23 +++++++++++----------- 4 files changed, 48 insertions(+), 44 deletions(-) (limited to 'js/clipboard/internal-ops') diff --git a/js/clipboard/internal-ops/component-clipboard-agent.js b/js/clipboard/internal-ops/component-clipboard-agent.js index 31b53474..702e2a37 100644 --- a/js/clipboard/internal-ops/component-clipboard-agent.js +++ b/js/clipboard/internal-ops/component-clipboard-agent.js @@ -1,24 +1,25 @@ /* -Copyright (c) 2012, Motorola Mobility, Inc +Copyright (c) 2012, Motorola Mobility LLC. All Rights Reserved. -BSD License. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: - - Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimer. - - Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - - Neither the name of Motorola Mobility nor the names of its contributors - may be used to endorse or promote products derived from this software - without specific prior written permission. +* Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + +* Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +* Neither the name of Motorola Mobility LLC nor the names of its + contributors may be used to endorse or promote products derived from this + software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS diff --git a/js/clipboard/internal-ops/css-clipboard-agent.js b/js/clipboard/internal-ops/css-clipboard-agent.js index e93077a8..54ac44b6 100644 --- a/js/clipboard/internal-ops/css-clipboard-agent.js +++ b/js/clipboard/internal-ops/css-clipboard-agent.js @@ -1,24 +1,25 @@ /* -Copyright (c) 2012, Motorola Mobility, Inc +Copyright (c) 2012, Motorola Mobility LLC. All Rights Reserved. -BSD License. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: - - Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimer. - - Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - - Neither the name of Motorola Mobility nor the names of its contributors - may be used to endorse or promote products derived from this software - without specific prior written permission. +* Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + +* Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +* Neither the name of Motorola Mobility LLC nor the names of its + contributors may be used to endorse or promote products derived from this + software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS diff --git a/js/clipboard/internal-ops/elements-clipboard-agent.js b/js/clipboard/internal-ops/elements-clipboard-agent.js index 4f6e8195..3129b644 100644 --- a/js/clipboard/internal-ops/elements-clipboard-agent.js +++ b/js/clipboard/internal-ops/elements-clipboard-agent.js @@ -1,24 +1,25 @@ /* -Copyright (c) 2012, Motorola Mobility, Inc +Copyright (c) 2012, Motorola Mobility LLC. All Rights Reserved. -BSD License. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: - - Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimer. - - Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - - Neither the name of Motorola Mobility nor the names of its contributors - may be used to endorse or promote products derived from this software - without specific prior written permission. +* Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + +* Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +* Neither the name of Motorola Mobility LLC nor the names of its + contributors may be used to endorse or promote products derived from this + software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS diff --git a/js/clipboard/internal-ops/timeline-clipboard-agent.js b/js/clipboard/internal-ops/timeline-clipboard-agent.js index 4e5cfe30..752c91ba 100644 --- a/js/clipboard/internal-ops/timeline-clipboard-agent.js +++ b/js/clipboard/internal-ops/timeline-clipboard-agent.js @@ -1,24 +1,25 @@ /* -Copyright (c) 2012, Motorola Mobility, Inc +Copyright (c) 2012, Motorola Mobility LLC. All Rights Reserved. -BSD License. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: - - Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimer. - - Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - - Neither the name of Motorola Mobility nor the names of its contributors - may be used to endorse or promote products derived from this software - without specific prior written permission. +* Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + +* Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +* Neither the name of Motorola Mobility LLC nor the names of its + contributors may be used to endorse or promote products derived from this + software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -- cgit v1.2.3