Skip to content

Commit

Permalink
ajile 1.9.8
Browse files Browse the repository at this point in the history
: cloakObject(): Displays "cloaked" when cloaked object's toString() is called.
: destroyModules(): Compatibility: MSIE: Fixed bug caused by IE's disallowing deletion of global members.
: "in": Compatibility: MSIE 5.01: Replaced all non-for-in code using "in" operator.
: RemoveImportListener(): Fixed bug that caused listeners to not be removed.
: RemoveImportListener(): Fixed bug that caused listeners to be notified despite being removed.
: Added new ajile 1.9.8 versioned source and compressed scripts.
: Updated default source and compressed scripts with ajile 1.9.8 source.

Docs
: Ajile-Overview.htm: Updated version to 1.9.8.
: API Examples: Fixed bug in "Using a Wildcard Import" example.

Tests
: Ajile.GetVersion(): Expects 1.9.8.
: Ajile.Unload(): Compatibility: MSIE: Correctly handles single-level namespaces.
: Ajile.Unload(): Compatibility: MSIE: Correctly handles Ajile namespace.
: Ajile.RemoveImportListener(): Compatibility: MSIE: Correctly handles single-level namespaces.
: Import(): Compatibility: MSIE: Correctly handles single-level namespaces.
: Namespace(): Compatibility: MSIE: Correctly handles single-level namespaces.
  • Loading branch information
iskitz committed Feb 19, 2013
1 parent 8e9e0c5 commit 26a065e
Show file tree
Hide file tree
Showing 14 changed files with 2,192 additions and 93 deletions.
4 changes: 2 additions & 2 deletions build/stage/README.txt
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
/*-----------------------------------------------------------------------------+
| ajile 1.9.3 {ajile.net: Smart scripts that play nice!}
| ajile 1.9.8 {ajile.net: Smart scripts that play nice!}
|
| Advanced JavaScript Importing & Loading Extension is a JavaScript module that
| provides an API for namespace creation, module dependency management and
| on-demand insertion of inline, local and remote scripts.
|
| Copyright (c) 2003-2013 Michael A. I. Lee [iskitz.com]
|
| Created: 2003.11.04 Updated: 2013.02.12.04.51-08.00
| Created: 2003.11.04 Updated: 2013.02.19.01.14-08.00
+-----------------------------------------------------------------------------*/

What's in these folders?
Expand Down
4 changes: 2 additions & 2 deletions build/stage/header.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
/**----------------------------------------------------------------------------+
| Product: ajile [com.iskitz.ajile]
| @version 1.9.3
| @version 1.9.8
|+-----------------------------------------------------------------------------+
| @author Michael A. I. Lee [iskitz.com]
|
| Created: Tuesday, November 4, 2003 [2003.11.04]
| Updated: Tuesday, February 12, 2013 [2013.02.12.04.51-08.00]
| Updated: Tuesday, February 19, 2013 [2013.02.19.01.14-08.00]
|+-----------------------------------------------------------------------------+
|
| [ajile] - Advanced JavaScript Importing & Loading Extension is a JavaScript
Expand Down
25 changes: 13 additions & 12 deletions code/com.iskitz.ajile.src.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
/**----------------------------------------------------------------------------+
| Product: ajile [com.iskitz.ajile]
| @version 1.9.3
| @version 1.9.8
|+-----------------------------------------------------------------------------+
| @author Michael A. I. Lee [iskitz.com]
|
| Created: Tuesday, November 4, 2003 [2003.11.04]
| Updated: Tuesday, February 12, 2013 [2013.02.12.04.51-08.00]
| Updated: Tuesday, February 19, 2013 [2013.02.19.01.14-08.00]
|+-----------------------------------------------------------------------------+
|
| [ajile] - Advanced JavaScript Importing & Loading Extension is a JavaScript
Expand Down Expand Up @@ -318,7 +318,7 @@
}

cloakObjectToggler = function() {
//return CLOAK ? undefined : this.toString.trueValue(); //WebKit:yes, Firefox:no
return "cloaked";//CLOAK ? undefined : this.toString.trueValue(); //WebKit:yes, Firefox:no
};


Expand Down Expand Up @@ -456,7 +456,7 @@
if(module[shortName] == global[shortName])
global[shortName] = undefined;

delete module[shortName];
((module != global) || !isIE) && delete (module[shortName]); //MSIE disallows deleting global members.
}
else
{
Expand Down Expand Up @@ -1091,7 +1091,7 @@ paths:for(var path in paths)

for (var name, nsParts=fullName.split('\x2e'), i=0, j=nsParts.length; i < j; i++) {
name = nsParts[i];
if (!(name in module)) break;
if (typeof module[name] == "undefined") break;
module = module [name];
_parentNsID += name + '\x2e';
}
Expand Down Expand Up @@ -1201,12 +1201,12 @@ paths:for(var path in paths)
&& !!HEAD.removeChild;

isDOM1 = isDOM05
&& "firstChild" in document
&& "lastChild" in document
&& "parentNode" in document;
&& !!document.firstChild
&& !!document.lastChild
&& !!document.parentNode;

isDOM2 = isDOM1
&& "ownerDocument" in document;
&& !!document.ownerDocument;


//**/ alert("LOADER: "+getMainLoader(document)+"\n\nisSimple: "+isSimple+"\nisDOM: "+isDOM+"\nisDOM05: "+isDOM05+"\nisDOM1: "+isDOM1+"\nisDOM2: "+isDOM2);
Expand Down Expand Up @@ -1730,7 +1730,7 @@ paths:for(var path in paths)
break;

case !!moduleName && !isString (moduleName):
if ("object" == typeof moduleName && "name" in moduleName) { // API: ajile 1.7.3-
if ("object" == typeof moduleName && moduleName.name != undefined) {// API: ajile 1.7.3-
listener = moduleName.notify;
moduleName = moduleName.name;
break;
Expand Down Expand Up @@ -1759,7 +1759,7 @@ paths:for(var path in paths)
for (var id in listeners)
if ("undefined" == typeof Object.prototype[id]) {
listener = listeners[id];
if (!listener || (listener.notify != callback && listener.notifyOriginal != callback))
if (!listener || ((callback != listener.notify) && callback != listener.notifyOriginal))
continue; // API: ajile 1.6.1...1.7.3: notifyOriginal

delete listener.notify;
Expand All @@ -1771,6 +1771,7 @@ paths:for(var path in paths)
delete notified[n];
}

notified.length = 0;
delete listener.notified;
listenerList[i].remove(id);
wasRemoved = true;
Expand Down Expand Up @@ -2030,4 +2031,4 @@ paths:for(var path in paths)
, usage = new SimpleSet();

$create();
})("1.9.3", this);
})("1.9.8", this);
2 changes: 1 addition & 1 deletion learn/Ajile-Overview.htm
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
</head>
<body>
<p>
<a href="https://github.com/iskitz/ajile/wiki/Release-History#wiki-wrapper" target="ajile.github"><strong>ajile</strong> 1.9.3</a>
<a href="https://github.com/iskitz/ajile/wiki/Release-History#wiki-wrapper" target="ajile.github"><strong>ajile</strong> 1.9.8</a>
<br>
<br>
Copyright (c) 2003-2013 Michael Lee [<a href="http://ajile.net/">ajile.net</a> + <a href="http://twitter.com/ajilenet/" title="Follow ajile on Twitter" target="ajile.news">@ajilenet</a>]
Expand Down
18 changes: 8 additions & 10 deletions play/api/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
| Author: Michael Lee [ http://ajile.net/ ]
|
| Created: Friday, November 2, 2006 [2006.06.02.19:44-04.00]
| Modified: Friday, February 1, 2013 [2013.02.01.15:13-08.00]
| Modified: Tuesday, February 19, 2013 [2013.02.19.00:35-08.00]
|+-----------------------------------------------------------------------------+
|
| [ ajile :: http://ajile.net/ :: "Smart scripts that play nice!" ]
Expand Down Expand Up @@ -187,8 +187,8 @@ com.iskitz.ajile.Examples = new function()
{
if("undefined" != typeof Complex)
{
var complex = new Complex();
complex.sayHello();
var complex = new Complex();
complex.sayHello();
}
else alert( "Dependency test was unsuccessful :-(\n\n"
+ "Failed to Import [ com.iskitz.ajile.examples.Complex ]");
Expand Down Expand Up @@ -229,14 +229,12 @@ com.iskitz.ajile.Examples = new function()
// Tests ajile's module member import feature; see scripts/com.iskitz.examples.0.9.js
function testImportModule()
{
// Test if showContents method has been imported.
var imported = "undefined" != typeof showContents;
// Test if showContents method has been imported and that it's ImportModule.showContents.
var imported = ("undefined" != typeof showContents)
&& ("undefined" != typeof com.iskitz.ajile.examples.ImportModule)
&& (showContents == com.iskitz.ajile.examples.ImportModule.showContents)
;

if(imported)// Test if imported showContents is ImportModule.showContents.
if("undefined" != typeof com.iskitz.ajile.examples.ImportModule)
if(showContents == com.iskitz.ajile.examples.ImportModule.showContents)
imported = true;

if(imported) showContents();

else alert( "ImportModule test was unsuccessful :-(\n\n Failed to "
Expand Down
16 changes: 8 additions & 8 deletions play/api/scripts/com.iskitz.ajile.examples.ImportModule.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Author: Michael Lee [ http:/ajile.net/ ]
//
// Created: 2006.07.30
// Modified: 2012.11.17
// Modified: 2013.02.19 @ 00.27-08.00
//
// Description: Example of how to define all of a namespace's members within a
// single container object for later import like:
Expand All @@ -17,13 +17,13 @@ com.iskitz.ajile.examples.ImportModule = new function ImportModule ()

function $ImportModule()
{
this.aNumber = 1;
this.aString = "member 5";
this.aFunction = function(){ alert("member 1"); };
this.anArray = ["member3"];
this.anObject = { member:"member 2" };
this.aRegularExpression = (/member 6/);
this.showContents = showContents;
THIS.aNumber = 1;
THIS.aString = "member 5";
THIS.aFunction = function(){ alert("member 1"); };
THIS.anArray = ["member3"];
THIS.anObject = { member:"member 2" };
THIS.aRegularExpression = (/member 6/);
THIS.showContents = showContents;
}

function showContents()
Expand Down
4 changes: 2 additions & 2 deletions test/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
About : Launch script for ajile's Jasmine Tests.
Author : Michael Lee [iskitz.com]
Created : 2011.12.17 @ 22:15-08.00
Updated : 2013.02.12 @ 11:18-08.00
Updated : 2013.02.19 @ 00:35-08.00
*/
(function (global, use, on, off, undefined) {

Expand Down Expand Up @@ -78,4 +78,4 @@

$start();

})(this, Load, Ajile.AddImportListener, Ajile.RemoveImportListener);
})(this, Load, Ajile.AddImportListener, Ajile.RemoveImportListener);
26 changes: 13 additions & 13 deletions test/net.ajile.test.Ajile.RemoveImportListener.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
About : ajile's Ajile.RemoveImportListener Test Suite module.
Author : Michael Lee [iskitz.com]
Created : 2011.12.17 @ 22:30-08.00
Updated : 2013.02.10 @ 21:51-08.00
Updated : 2013.02.18 @ 23:13-08.00
*/

Namespace ("net.ajile.test.Ajile");
Expand All @@ -16,13 +16,13 @@ Namespace ("net.ajile.test.Ajile");
function describeTestSuite () {
beforeEach ($prepareTest);

it ("is a method" , isAMethod);
it ('removes a generic listener' , removesGenericListener);
it ('removes a global property listener' , removesGlobalListener);
it ("removes an Import module's listener" , removesImportListener);
it ("removes an ImportAs module's listener", removesImportAsListener);
it ("removes an Included module's listener", removesIncludedListener);
it ('removes a multi-item listener' , removesMultiListener);
it ("is a method" , isAMethod);
it ('removes a generic listener' , removesGenericListener);
it ('removes a global property listener', removesGlobalListener);
it ("removes an Import listener" , removesImportListener);
it ("removes an ImportAs listener" , removesImportAsListener);
it ("removes an Included listener" , removesIncludedListener);
it ('removes a multi-item listener' , removesMultiListener);
}

//.............................................................. Shared test variables and functions
Expand Down Expand Up @@ -98,7 +98,7 @@ Namespace ("net.ajile.test.Ajile");
listener.notify = notifyListener;
spyOn (listener, "notify").andCallThrough();
runs (addAndNotifyListener);
waitsFor ($wasListenerNotified, "removes an Import module's listener", 500);
waitsFor ($wasListenerNotified, "removes an Import listener", 500);
runs (wasListenerRemoved);
}
function addAndNotifyListener () {
Expand All @@ -116,7 +116,7 @@ Namespace ("net.ajile.test.Ajile");
}
function wasListenerRemoved() {
$wasListenerRemoved();
delete global["Imported"];
try { delete global.Imported; }catch (e) { global.Imported = undefined; } // BUG: MSIE disallows deleting global members.
delete net.ajile.test.Ajile.RemoveImportListener.Imported;
}
$start();
Expand All @@ -130,7 +130,7 @@ Namespace ("net.ajile.test.Ajile");
listener.notify = notifyListener;
spyOn (listener, "notify").andCallThrough();
runs (addAndNotifyListener);
waitsFor ($wasListenerNotified, "removes an ImportAs module's listener", 500);
waitsFor ($wasListenerNotified, "removes an ImportAs listener", 500);
runs (wasListenerRemoved);
}
function addAndNotifyListener () {
Expand All @@ -148,7 +148,7 @@ Namespace ("net.ajile.test.Ajile");
}
function wasListenerRemoved() {
$wasListenerRemoved();
delete global["ImportedAs"];
try { delete global.ImportedAs; }catch (e) { global.ImportedAs = undefined; } // BUG: MSIE disallows deleting global members.
delete net.ajile.test.Ajile.RemoveImportListener.Imported;
}
$start();
Expand All @@ -162,7 +162,7 @@ Namespace ("net.ajile.test.Ajile");
listener.notify = notifyListener;
spyOn (listener, "notify").andCallThrough();
runs (addAndNotifyListener);
waitsFor ($wasListenerNotified, "removes an Included module's listener", 500);
waitsFor ($wasListenerNotified, "removes an Included listener", 500);
runs (wasListenerRemoved);
}
function addAndNotifyListener () {
Expand Down
10 changes: 5 additions & 5 deletions test/net.ajile.test.Ajile.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
About : ajile's core Tests Package.
Author : Michael Lee [iskitz.com]
Created : 2011.12.17 @ 22:30-08.00
Updated : 2013.02.10 @ 21:52-08.00
Updated : 2013.02.19 @ 00:02-08.00
*/

Namespace ("net.ajile.test");
Expand Down Expand Up @@ -69,8 +69,8 @@ Include ("net.ajile.test.Ajile.RemoveImportListener");
expect (Ajile.GetVersion).toBeDefined();
expect (Ajile.GetVersion).toEqual (jasmine.any (Function));
});
it ("returns ajile's version: 1.9.3", function testAjileGetVersionWorks () {
expect (Ajile.GetVersion()).toEqual ("1.9.3");
it ("returns ajile's version: 1.9.8", function testAjileGetVersionWorks () {
expect (Ajile.GetVersion()).toEqual ("1.9.8");
});
});

Expand All @@ -97,7 +97,7 @@ Include ("net.ajile.test.Ajile.RemoveImportListener");
it ("unloads single-level namespaced modules", function testAjileUnloadSingleNS () {
global.SingleLevelModule = {single: true};
Ajile.Unload ("SingleLevelModule");
expect (global.SingleLevelModule).not.toBeDefined();
expect (global.SingleLevelModule).toBeUndefined();
});

it ("unloads multi-level namespaced modules", function testAjileUnloadNS () {
Expand Down Expand Up @@ -130,7 +130,7 @@ Include ("net.ajile.test.Ajile.RemoveImportListener");
};

Ajile.Unload ();
expect (global.Ajile).not.toBeDefined();
expect (global.Ajile).toBeUndefined();
expect (com.iskitz.ajile).not.toBeDefined();

for (var property in safe) { // Restore ajile's public API.
Expand Down
4 changes: 2 additions & 2 deletions test/net.ajile.test.Import.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
About : ajile's Import Tests Suite module.
Author : Michael Lee (iskitz.com)
Created : 2011.12.17 @ 11:34-08.00
Updated : 2013.02.10 @ 21:25-08.00
Updated : 2013.02.18 @ 23:58-08.00
*/

Namespace ("net.ajile.test");
Expand All @@ -24,7 +24,7 @@ Namespace ("net.ajile.test");
expect (InMemory).not.toBeNull();
expect (InMemory).not.toBeUndefined();
expect (InMemory.works).toBe (true);
delete global.InMemory;
try { delete global.InMemory; } catch (e) { global.InMemory = undefined; } //BUG: MSIE disallows deleting global members.
Ajile.Unload ("net.ajile.test.Import.InMemory");
});
});
Expand Down
Loading

0 comments on commit 26a065e

Please sign in to comment.