Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

We’re showing branches in this repository, but you can also compare across forks.

base fork: yui/yui3-gallery
base: master
...
head fork: rmsguhan/yui3-gallery
compare: master
  • 12 commits
  • 5 files changed
  • 0 commit comments
  • 1 contributor
38 build/gallery-clipboard/gallery-clipboard-debug.js
View
@@ -89,10 +89,10 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
* @static
* @type String
*/
- SWF_MOVIE_NAME = "ClipBoardCopy.swf",
+ SWF_MOVIE_NAME = "ClipBoardCopy.swf?r=1",
COMPONENT_NAME = "clipboard",
COMPONENT_NS = "cp",
- DEFAULT_GLOBAL = window,
+ CALLBACK_GLOBAL = { obj : window, name : ""},
GLOBAL_HANDLER = "ClipboardInterfaceFn",
PROTOCOL = window.location.href.match(/^https/i) ? 'https://' : 'http://',
FLASHVARS_TEMPLATE = "id={__MOVIEID__}&ns={__NS__}&width={__WIDTH__}&height={__HEIGHT__}"+
@@ -127,7 +127,24 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
ClipBoard.NAME = COMPONENT_NAME;
ClipBoard.NS = COMPONENT_NAME;
-
+ ClipBoard.setCallBackGlobal = function( v ) {
+ var tmp = [],
+ n = 0, i = 0,
+ obj = window, name = '';
+
+ if ( isString(v) && v !== "window" ) {
+ tmp = ( v.indexOf(".") >= 0 )?v.split(".") : [v];
+ n = tmp.length;
+ for (;i<n;i++) {
+ if ( obj[tmp[i]] ) {
+ obj = obj[tmp[i]];
+ name = name + (( i == 0 )?tmp[i]:"."+tmp[i]);
+ }
+ }
+ }
+ CALLBACK_GLOBAL = { "obj" : obj, "name" : name };
+ return CALLBACK_GLOBAL;
+ };
ClipBoard.ATTRS = {
/**
* The page attribute represents the topmost node where the flash movie will be embeded only
@@ -164,7 +181,10 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
* @type Object
*/
global : {
- value : DEFAULT_GLOBAL
+ readOnly : true,
+ getter : function() {
+ return { obj : CALLBACK_GLOBAL.obj, name : CALLBACK_GLOBAL.name };
+ }
},
/**
* The domain value that should be allowed in the flash movie
@@ -195,7 +215,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
initializer: function(config) {
var _this = this,
global = _this.get("global"),
- fn = GLOBAL_HANDLER,
+ fn = !isEmpty(global["name"])?global["name"]+"."+GLOBAL_HANDLER:GLOBAL_HANDLER,
dimen;
if(isEmpty(_this.get("id")))
this.set("id",Y.guid(COMPONENT_NAME+"_"));
@@ -210,8 +230,9 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
dimen = _this.getHostDimensions();
- if(isUndefined(global[fn]))
- global[fn] = _this._flashInterface;
+ if ( isUndefined(global["obj"][GLOBAL_HANDLER]) ) {
+ global["obj"][GLOBAL_HANDLER] = _this._flashInterface;
+ }
_this._host.publish(COMPONENT_NAME+":"+"load", {
emitFacade : true,
@@ -524,6 +545,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
});
Y.ClipBoard = ClipBoard;
+
-}, 'gallery-2011.08.24-23-44' ,{requires:['node', 'plugin', 'substitute'], skinnable:false});
+}, '@VERSION@' ,{skinnable:false, requires:['node', 'plugin', 'substitute']});
2  build/gallery-clipboard/gallery-clipboard-min.js
View
@@ -1 +1 @@
-YUI.add("gallery-clipboard",function(c){function p(w){p.superclass.constructor.apply(this,arguments);}var r='<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"'+' codebase="{__PROTOCOL__}download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0" '+'width="{__WIDTH__}" height="{__HEIGHT__}" id="{__MOVIEID__}" '+'align="middle"><param name="allowScriptAccess" value="always" embed-type="menu"/>'+'<param name="allowFullScreen" value="false" />'+'<param name="movie" value="{__MOVIEPATH__}" />'+'<param name="loop" value="false" /><param name="menu" value="false" />'+'<param name="quality" value="best" /><param name="bgcolor" value="#ffffff" />'+'<param name="flashvars" value="{__FLASHVARS__}"/><param name="wmode" '+'value="transparent"/></object>',v='<embed id="{__MOVIEID__}" src="{__MOVIEPATH__}" loop="false" '+'menu="false" quality="best" bgcolor="#ffffff" width="{__WIDTH__}" '+'height="{__HEIGHT__}" name="{__MOVIEID__}" align="middle" '+'allowScriptAccess="always" allowFullScreen="false" '+'type="application/x-shockwave-flash" '+'pluginspage="http://www.macromedia.com/go/getflashplayer" '+'flashvars="{__FLASHVARS__}" wmode="transparent" embed-type="menu" />',n="ClipBoardCopy.swf",a="clipboard",s="cp",q=window,e="ClipboardInterfaceFn",f=window.location.href.match(/^https/i)?"https://":"http://",d="id={__MOVIEID__}&ns={__NS__}&width={__WIDTH__}&height={__HEIGHT__}"+"&fn={__FN__}&domain={__DOMAIN__}",i="-2000px",t=false,u={},o={},l=function(w){if(c.Lang.isString(w)||c.Lang.isArray(w)){return(w.length==0)?true:false;}return false;},b=c.Lang.isUndefined,m=c.Lang.isNull,k=c.Lang.isNumber,j=c.Lang.isString,h=function(y){var w=u;for(var z in w){for(var x in w[z]){if(x===y){return false;}}}return true;},g=function(x,w){delete u[x][w];};p.NAME=a;p.NS=a;p.ATTRS={page:{value:c.one("body")},id:{value:""},moviepath:{value:""},global:{value:q},domain:{value:"*.yahoo.com"},movieloaded:{value:false}};c.extend(p,c.Plugin.Base,{initializer:function(w){var A=this,z=A.get("global"),x=e,y;if(l(A.get("id"))){this.set("id",c.guid(a+"_"));}A._host=A.get("host");A._movie=null;if(l(A._host.get("id"))){A._host.set("id",A.get("id"));}else{A.set("id",A._host.get("id"));}y=A.getHostDimensions();if(b(z[x])){z[x]=A._flashInterface;}A._host.publish(a+":"+"load",{emitFacade:true,preventable:true,context:A._host,bubbles:true,fireOnce:true});c.on(a+":"+"load",function(B){t=true;o.params=B;A._host.fire(a+":"+"load",B);A.set("movieloaded",true);});A._movie=A._getFlashMovieObj(y,x);A._alignMovie(y,A._host);A.hide();A.beforeHostMethod("setAttribute",function(B,C){if(B==="copy"){A.copy(C);A.show();A.focus();}});A.afterHostMethod("on",function(B){if(B===a+":load"&&t){A._host.fire(a+":"+"load",o.params);A.set("movieloaded",true);}});},_destructor:function(){var w=this;w.get("boundingBox").destroy(true);t=false;o={};u={};},getHostDimensions:function(){var y=this,x=y._host,w=y._getNodeSize(x);return{w:parseInt(w[0],10),h:parseInt(w[1],10),xy:x.getXY()};},show:function(){var w=this;w._alignMovie(w.getHostDimensions());},focus:function(){var w=this._movie;if(w.focus){w.focus();}},hide:function(){var x=this,w=x.get("boundingBox");w.setStyles({"left":i});},copy:function(x){var y=this;try{y._movie._node.copy(x,y.get("id"));}catch(w){c.fire(a+":error",{"error":w.message});}},setEvent:function(A,w,x){try{var z=this;movie=z._movie._node,cache=u,obj={},id=this.get("id");if(b(cache[id])){cache[id]={};}cache[id][A]=w;obj[A]={"docopy":x?true:false};if(movie.setupEvents){movie.setupEvents(obj);}}catch(y){c.fire(a+":error",{"error":y.message});}},removeEvent:function(y){try{var w=u,C=this,B=0,z=0,x=C.get("id"),E=[],A=C._movie._node;if(j(y)){y=[y];}for(z=y.length;B<z;B++){g(x,y[B]);if(h(y[B])){E.push(y[B]);}}if(E.length>0&&A.removeEvents){A.removeEvents(E);}}catch(D){c.fire(a+":error",{"error":D.message});}return true;},_alignMovie:function(B,x){var C=this,y=b(x)?C._host:x,A=C.get("boundingBox"),z=1,w=parseInt(y.getStyle("zIndex"),10);if(k(w)){z=w+1;}A.setXY(B.xy);A.setStyles({zIndex:z});return A;},_getFlashMovieObj:function(B,A){var z=this,x=a,D={"__PROTOCOL__":f,"__MOVIEID__":x,"__WIDTH__":B.w,"__HEIGHT__":B.h,"__MOVIEPATH__":z.get("moviepath")+n,"__NS__":p.NS,"__FN__":A,"__DOMAIN__":z.get("domain")},E=c.UA.ie?r:v,C=z.get("page"),y=z.get("page").one("#"+x),w;D["__FLASHVARS__"]=c.substitute(d,D);if(m(y)){w=c.Node.create("<div></div>");w.set("innerHTML",c.substitute(E,D));w.setStyles({"width":B.w,height:B.h,position:"absolute"});w.set("className",a+"-wrapper");C.appendChild(w);y=z.get("page").one("#"+x);o.host=z._host;}this.set("boundingBox",y.get("parentNode"));y.setStyle("outline","none");return y;},_flashInterface:function(z,w){try{var A,y,x=u;if(z==a+":event"){A=w.transaction,y=c.one("#"+A);if(x[A][w.event]){x[A][w.event].call(y,w);}}else{c.fire(z,w);}}catch(B){c.fire(a+":error",c.mix({"error":B.message},w));}},_getNodeSize:function(w){var y=[],x=function(z,A){return parseInt(A.getComputedStyle(z),10);};y[0]=x("marginLeft",w)+x("paddingLeft",w)+x("borderLeftWidth",w)+x("width",w)+x("borderRightWidth",w)+x("paddingRight",w)+x("marginRight",w);y[1]=x("marginTop",w)+x("paddingTop",w)+x("borderTopWidth",w)+x("height",w)+x("borderBottomWidth",w)+x("paddingBottom",w)+x("marginBottom",w);return y;}});c.ClipBoard=p;},"gallery-2011.08.24-23-44",{requires:["node","plugin","substitute"],skinnable:false});
+YUI.add("gallery-clipboard",function(c){function q(w){q.superclass.constructor.apply(this,arguments);}var r='<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"'+' codebase="{__PROTOCOL__}download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0" '+'width="{__WIDTH__}" height="{__HEIGHT__}" id="{__MOVIEID__}" '+'align="middle"><param name="allowScriptAccess" value="always" embed-type="menu"/>'+'<param name="allowFullScreen" value="false" />'+'<param name="movie" value="{__MOVIEPATH__}" />'+'<param name="loop" value="false" /><param name="menu" value="false" />'+'<param name="quality" value="best" /><param name="bgcolor" value="#ffffff" />'+'<param name="flashvars" value="{__FLASHVARS__}"/><param name="wmode" '+'value="transparent"/></object>',v='<embed id="{__MOVIEID__}" src="{__MOVIEPATH__}" loop="false" '+'menu="false" quality="best" bgcolor="#ffffff" width="{__WIDTH__}" '+'height="{__HEIGHT__}" name="{__MOVIEID__}" align="middle" '+'allowScriptAccess="always" allowFullScreen="false" '+'type="application/x-shockwave-flash" '+'pluginspage="http://www.macromedia.com/go/getflashplayer" '+'flashvars="{__FLASHVARS__}" wmode="transparent" embed-type="menu" />',n="ClipBoardCopy.swf?r=1",a="clipboard",s="cp",o={obj:window,name:""},e="ClipboardInterfaceFn",f=window.location.href.match(/^https/i)?"https://":"http://",d="id={__MOVIEID__}&ns={__NS__}&width={__WIDTH__}&height={__HEIGHT__}"+"&fn={__FN__}&domain={__DOMAIN__}",i="-2000px",t=false,u={},p={},l=function(w){if(c.Lang.isString(w)||c.Lang.isArray(w)){return(w.length==0)?true:false;}return false;},b=c.Lang.isUndefined,m=c.Lang.isNull,k=c.Lang.isNumber,j=c.Lang.isString,h=function(y){var w=u;for(var z in w){for(var x in w[z]){if(x===y){return false;}}}return true;},g=function(x,w){delete u[x][w];};q.NAME=a;q.NS=a;q.setCallBackGlobal=function(w){var z=[],B=0,y=0,A=window,x="";if(j(w)&&w!=="window"){z=(w.indexOf(".")>=0)?w.split("."):[w];B=z.length;for(;y<B;y++){if(A[z[y]]){A=A[z[y]];x=x+((y==0)?z[y]:"."+z[y]);}}}o={"obj":A,"name":x};return o;};q.ATTRS={page:{value:c.one("body")},id:{value:""},moviepath:{value:""},global:{readOnly:true,getter:function(){return{obj:o.obj,name:o.name};}},domain:{value:"*.yahoo.com"},movieloaded:{value:false}};c.extend(q,c.Plugin.Base,{initializer:function(w){var A=this,z=A.get("global"),x=!l(z["name"])?z["name"]+"."+e:e,y;if(l(A.get("id"))){this.set("id",c.guid(a+"_"));}A._host=A.get("host");A._movie=null;if(l(A._host.get("id"))){A._host.set("id",A.get("id"));}else{A.set("id",A._host.get("id"));}y=A.getHostDimensions();if(b(z["obj"][e])){z["obj"][e]=A._flashInterface;}A._host.publish(a+":"+"load",{emitFacade:true,preventable:true,context:A._host,bubbles:true,fireOnce:true});c.on(a+":"+"load",function(B){t=true;p.params=B;A._host.fire(a+":"+"load",B);A.set("movieloaded",true);});A._movie=A._getFlashMovieObj(y,x);A._alignMovie(y,A._host);A.hide();A.beforeHostMethod("setAttribute",function(B,C){if(B==="copy"){A.copy(C);A.show();A.focus();}});A.afterHostMethod("on",function(B){if(B===a+":load"&&t){A._host.fire(a+":"+"load",p.params);A.set("movieloaded",true);}});},_destructor:function(){var w=this;w.get("boundingBox").destroy(true);t=false;p={};u={};},getHostDimensions:function(){var y=this,x=y._host,w=y._getNodeSize(x);return{w:parseInt(w[0],10),h:parseInt(w[1],10),xy:x.getXY()};},show:function(){var w=this;w._alignMovie(w.getHostDimensions());},focus:function(){var w=this._movie;if(w.focus){w.focus();}},hide:function(){var x=this,w=x.get("boundingBox");w.setStyles({"left":i});},copy:function(x){var y=this;try{y._movie._node.copy(x,y.get("id"));}catch(w){c.fire(a+":error",{"error":w.message});}},setEvent:function(A,w,x){try{var z=this;movie=z._movie._node,cache=u,obj={},id=this.get("id");if(b(cache[id])){cache[id]={};}cache[id][A]=w;obj[A]={"docopy":x?true:false};if(movie.setupEvents){movie.setupEvents(obj);}}catch(y){c.fire(a+":error",{"error":y.message});}},removeEvent:function(y){try{var w=u,C=this,B=0,z=0,x=C.get("id"),E=[],A=C._movie._node;if(j(y)){y=[y];}for(z=y.length;B<z;B++){g(x,y[B]);if(h(y[B])){E.push(y[B]);}}if(E.length>0&&A.removeEvents){A.removeEvents(E);}}catch(D){c.fire(a+":error",{"error":D.message});}return true;},_alignMovie:function(B,x){var C=this,y=b(x)?C._host:x,A=C.get("boundingBox"),z=1,w=parseInt(y.getStyle("zIndex"),10);if(k(w)){z=w+1;}A.setXY(B.xy);A.setStyles({zIndex:z});return A;},_getFlashMovieObj:function(B,A){var z=this,x=a,D={"__PROTOCOL__":f,"__MOVIEID__":x,"__WIDTH__":B.w,"__HEIGHT__":B.h,"__MOVIEPATH__":z.get("moviepath")+n,"__NS__":q.NS,"__FN__":A,"__DOMAIN__":z.get("domain")},E=c.UA.ie?r:v,C=z.get("page"),y=z.get("page").one("#"+x),w;D["__FLASHVARS__"]=c.substitute(d,D);if(m(y)){w=c.Node.create("<div></div>");w.set("innerHTML",c.substitute(E,D));w.setStyles({"width":B.w,height:B.h,position:"absolute"});w.set("className",a+"-wrapper");C.appendChild(w);y=z.get("page").one("#"+x);p.host=z._host;}this.set("boundingBox",y.get("parentNode"));y.setStyle("outline","none");return y;},_flashInterface:function(z,w){try{var A,y,x=u;if(z==a+":event"){A=w.transaction,y=c.one("#"+A);if(x[A][w.event]){x[A][w.event].call(y,w);}}else{c.fire(z,w);}}catch(B){c.fire(a+":error",c.mix({"error":B.message},w));}},_getNodeSize:function(w){var y=[],x=function(z,A){return parseInt(A.getComputedStyle(z),10);};y[0]=x("marginLeft",w)+x("paddingLeft",w)+x("borderLeftWidth",w)+x("width",w)+x("borderRightWidth",w)+x("paddingRight",w)+x("marginRight",w);y[1]=x("marginTop",w)+x("paddingTop",w)+x("borderTopWidth",w)+x("height",w)+x("borderBottomWidth",w)+x("paddingBottom",w)+x("marginBottom",w);return y;}});c.ClipBoard=q;},"@VERSION@",{skinnable:false,requires:["node","plugin","substitute"]});
38 build/gallery-clipboard/gallery-clipboard.js
View
@@ -89,10 +89,10 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
* @static
* @type String
*/
- SWF_MOVIE_NAME = "ClipBoardCopy.swf",
+ SWF_MOVIE_NAME = "ClipBoardCopy.swf?r=1",
COMPONENT_NAME = "clipboard",
COMPONENT_NS = "cp",
- DEFAULT_GLOBAL = window,
+ CALLBACK_GLOBAL = { obj : window, name : ""},
GLOBAL_HANDLER = "ClipboardInterfaceFn",
PROTOCOL = window.location.href.match(/^https/i) ? 'https://' : 'http://',
FLASHVARS_TEMPLATE = "id={__MOVIEID__}&ns={__NS__}&width={__WIDTH__}&height={__HEIGHT__}"+
@@ -127,7 +127,24 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
ClipBoard.NAME = COMPONENT_NAME;
ClipBoard.NS = COMPONENT_NAME;
-
+ ClipBoard.setCallBackGlobal = function( v ) {
+ var tmp = [],
+ n = 0, i = 0,
+ obj = window, name = '';
+
+ if ( isString(v) && v !== "window" ) {
+ tmp = ( v.indexOf(".") >= 0 )?v.split(".") : [v];
+ n = tmp.length;
+ for (;i<n;i++) {
+ if ( obj[tmp[i]] ) {
+ obj = obj[tmp[i]];
+ name = name + (( i == 0 )?tmp[i]:"."+tmp[i]);
+ }
+ }
+ }
+ CALLBACK_GLOBAL = { "obj" : obj, "name" : name };
+ return CALLBACK_GLOBAL;
+ };
ClipBoard.ATTRS = {
/**
* The page attribute represents the topmost node where the flash movie will be embeded only
@@ -164,7 +181,10 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
* @type Object
*/
global : {
- value : DEFAULT_GLOBAL
+ readOnly : true,
+ getter : function() {
+ return { obj : CALLBACK_GLOBAL.obj, name : CALLBACK_GLOBAL.name };
+ }
},
/**
* The domain value that should be allowed in the flash movie
@@ -195,7 +215,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
initializer: function(config) {
var _this = this,
global = _this.get("global"),
- fn = GLOBAL_HANDLER,
+ fn = !isEmpty(global["name"])?global["name"]+"."+GLOBAL_HANDLER:GLOBAL_HANDLER,
dimen;
if(isEmpty(_this.get("id")))
this.set("id",Y.guid(COMPONENT_NAME+"_"));
@@ -210,8 +230,9 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
dimen = _this.getHostDimensions();
- if(isUndefined(global[fn]))
- global[fn] = _this._flashInterface;
+ if ( isUndefined(global["obj"][GLOBAL_HANDLER]) ) {
+ global["obj"][GLOBAL_HANDLER] = _this._flashInterface;
+ }
_this._host.publish(COMPONENT_NAME+":"+"load", {
emitFacade : true,
@@ -517,6 +538,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
});
Y.ClipBoard = ClipBoard;
+
-}, 'gallery-2011.08.24-23-44' ,{requires:['node', 'plugin', 'substitute'], skinnable:false});
+}, '@VERSION@' ,{skinnable:false, requires:['node', 'plugin', 'substitute']});
12 src/gallery-clipboard/demo/demo_1.html
View
@@ -1,4 +1,4 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
+<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
@@ -91,7 +91,15 @@ <h1 id='title'>Flash clipboard copy demo</h1>
var node1 = Y.one(".b1"),
node2 = Y.one(".b2");
-
+
+ /* Make sure that the flash interface callback is within a known global name space */
+ window.My = {
+ Global : {
+ foo : "bar"
+ }
+ };
+ Y.ClipBoard.setCallBackGlobal( "My.Global" );
+
/* Set up Copy on Node 1 */
node1.plug(Y.ClipBoard, {
page : Y.one(".container"),
36 src/gallery-clipboard/js/clipboard-plugin.js
View
@@ -87,10 +87,10 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
* @static
* @type String
*/
- SWF_MOVIE_NAME = "ClipBoardCopy.swf",
+ SWF_MOVIE_NAME = "ClipBoardCopy.swf?r=1",
COMPONENT_NAME = "clipboard",
COMPONENT_NS = "cp",
- DEFAULT_GLOBAL = window,
+ CALLBACK_GLOBAL = { obj : window, name : ""},
GLOBAL_HANDLER = "ClipboardInterfaceFn",
PROTOCOL = window.location.href.match(/^https/i) ? 'https://' : 'http://',
FLASHVARS_TEMPLATE = "id={__MOVIEID__}&ns={__NS__}&width={__WIDTH__}&height={__HEIGHT__}"+
@@ -125,7 +125,24 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
ClipBoard.NAME = COMPONENT_NAME;
ClipBoard.NS = COMPONENT_NAME;
-
+ ClipBoard.setCallBackGlobal = function( v ) {
+ var tmp = [],
+ n = 0, i = 0,
+ obj = window, name = '';
+
+ if ( isString(v) && v !== "window" ) {
+ tmp = ( v.indexOf(".") >= 0 )?v.split(".") : [v];
+ n = tmp.length;
+ for (;i<n;i++) {
+ if ( obj[tmp[i]] ) {
+ obj = obj[tmp[i]];
+ name = name + (( i == 0 )?tmp[i]:"."+tmp[i]);
+ }
+ }
+ }
+ CALLBACK_GLOBAL = { "obj" : obj, "name" : name };
+ return CALLBACK_GLOBAL;
+ };
ClipBoard.ATTRS = {
/**
* The page attribute represents the topmost node where the flash movie will be embeded only
@@ -162,7 +179,10 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
* @type Object
*/
global : {
- value : DEFAULT_GLOBAL
+ readOnly : true,
+ getter : function() {
+ return { obj : CALLBACK_GLOBAL.obj, name : CALLBACK_GLOBAL.name };
+ }
},
/**
* The domain value that should be allowed in the flash movie
@@ -193,7 +213,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
initializer: function(config) {
var _this = this,
global = _this.get("global"),
- fn = GLOBAL_HANDLER,
+ fn = !isEmpty(global["name"])?global["name"]+"."+GLOBAL_HANDLER:GLOBAL_HANDLER,
dimen;
if(isEmpty(_this.get("id")))
this.set("id",Y.guid(COMPONENT_NAME+"_"));
@@ -208,8 +228,9 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
dimen = _this.getHostDimensions();
- if(isUndefined(global[fn]))
- global[fn] = _this._flashInterface;
+ if ( isUndefined(global["obj"][GLOBAL_HANDLER]) ) {
+ global["obj"][GLOBAL_HANDLER] = _this._flashInterface;
+ }
_this._host.publish(COMPONENT_NAME+":"+"load", {
emitFacade : true,
@@ -522,3 +543,4 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
});
Y.ClipBoard = ClipBoard;
+

No commit comments for this range

Something went wrong with that request. Please try again.