Permalink
Browse files

added noConflict support

  • Loading branch information...
1 parent 0ff0909 commit 6c52311738630dd6995a913cd46943d44fb63e70 @Jakobo committed Mar 30, 2011
Showing with 9 additions and 2 deletions.
  1. +9 −2 src/sslac.js
View
@@ -15,7 +15,8 @@
var globalWindow = this,
NAMESPACE = "Sslac",
SslacRegistry = {},
- externalInterface = null;
+ externalInterface = null,
+ oldSslac = globalWindow[NAMESPACE];
globalWindow[NAMESPACE] = globalWindow[NAMESPACE] || {};
externalInterface = globalWindow[NAMESPACE];
@@ -325,6 +326,12 @@
function getDefinition(ns) {
return SslacRegistry[ns];
}
+
+ function noConflict() {
+ var thisSslac = externalInterface;
+ globalWindow[NAMESPACE] = oldSslac;
+ return thisSslac;
+ }
// assign outward
externalInterface.Class = createObject;
@@ -336,7 +343,7 @@
externalInterface.nameOf = nameOf;
externalInterface.valueOf = resolveNamespace;
externalInterface.definitionOf = getDefinition;
-
+ externalInterface.noConflict = noConflict;
}());
// licensing block

0 comments on commit 6c52311

Please sign in to comment.