Skip to content
This repository
Browse code

file shuffling for better org

  • Loading branch information...
commit d6929d08acddebc515f0b9da623249ff2feaa1d0 1 parent f78a402
Nick Carter authored March 04, 2010

Showing 30 changed files with 3 additions and 7,740 deletions. Show diff stats Hide diff stats

  1. 0  {javascripts/dependencies → JSSpec}/gears/gears_init.js
  2. 2  JSSpec/{ → gears}/index.html
  3. 0  {javascripts → }/examples/example_fixtures.js
  4. 0  {javascripts → }/examples/example_migrations.js
  5. 0  {javascripts → }/examples/example_models.js
  6. 208  javascripts/dependencies/air/AIRAliases.js
  7. 1,949  javascripts/dependencies/air/AIRIntrospector.js
  8. 1,325  javascripts/dependencies/air/AIRLocalizer.js
  9. 1,322  javascripts/dependencies/air/AIRMenuBuilder.js
  10. 2,933  javascripts/dependencies/air/AIRSourceViewer.js
  11. 4  rakefile.rb
  12. 0  {javascripts → source}/adapters.js
  13. 0  {javascripts → source}/association_loader.js
  14. 0  {javascripts → source}/jazz_record.js
  15. 0  {javascripts → source}/migrations/migrate.js
  16. 0  {javascripts → source}/migrations/schema_operations.js
  17. 0  {javascripts → source}/model/destroy.js
  18. 0  {javascripts → source}/model/find.js
  19. 0  {javascripts → source}/model/model.js
  20. 0  {javascripts → source}/model/new_query.js
  21. 0  {javascripts → source}/model/query.js
  22. 0  {javascripts → source}/model/save.js
  23. 0  {javascripts → source}/model/util.js
  24. 0  {javascripts → source}/record/is_changed.js
  25. 0  {javascripts → source}/record/record.js
  26. 0  {javascripts → source}/record/save.js
  27. 0  {javascripts → source}/record/validate.js
  28. 0  {javascripts → source}/save.js
  29. 0  {javascripts → source}/util.js
  30. 0  {build → }/yuicompressor-2.3.6.jar
0  javascripts/dependencies/gears/gears_init.js → JSSpec/gears/gears_init.js
File renamed without changes
2  JSSpec/index.html → JSSpec/gears/index.html
@@ -8,7 +8,7 @@
8 8
 <script type="text/javascript" src="JSSpec.js"></script>
9 9
 <script type="text/javascript" src="jsmock.js"></script>
10 10
 
11  
-<script type="text/javascript" src="../javascripts/dependencies/gears/gears_init.js"></script>
  11
+<script type="text/javascript" src="gears_init.js"></script>
12 12
 <script src="../build/jazz_record.js" type="text/javascript" charset="utf-8"></script>
13 13
 
14 14
 <script type="text/javascript" src="../javascripts/examples/example_models.js"></script>
0  javascripts/examples/example_fixtures.js → examples/example_fixtures.js
File renamed without changes
0  javascripts/examples/example_migrations.js → examples/example_migrations.js
File renamed without changes
0  javascripts/examples/example_models.js → examples/example_models.js
File renamed without changes
208  javascripts/dependencies/air/AIRAliases.js
... ...
@@ -1,208 +0,0 @@
1  
-/* AIRAliases.js - Revision: 1.5 */
2  
-
3  
-/*
4  
-ADOBE SYSTEMS INCORPORATED
5  
-Copyright 2007-2008 Adobe Systems Incorporated. All Rights Reserved.
6  
- 
7  
-NOTICE:   Adobe permits you to modify and distribute this file only in accordance with
8  
-the terms of Adobe AIR SDK license agreement.  You may have received this file from a
9  
-source other than Adobe.  Nonetheless, you may modify or
10  
-distribute this file only in accordance with such agreement. 
11  
-*/
12  
-
13  
-
14  
-var air;
15  
-if (window.runtime) 
16  
-{
17  
-    if (!air) air = {};
18  
-    // functions
19  
-    air.trace = window.runtime.trace;
20  
-    air.navigateToURL = window.runtime.flash.net.navigateToURL;
21  
-    air.sendToURL = window.runtime.flash.net.sendToURL;
22  
-
23  
-
24  
-    // file
25  
-    air.File = window.runtime.flash.filesystem.File;
26  
-    air.FileStream = window.runtime.flash.filesystem.FileStream;
27  
-    air.FileMode = window.runtime.flash.filesystem.FileMode;
28  
-
29  
-    // events
30  
-    air.ActivityEvent = window.runtime.flash.events.ActivityEvent;
31  
-    air.AsyncErrorEvent = window.runtime.flash.events.AsyncErrorEvent;
32  
-    air.BrowserInvokeEvent = window.runtime.flash.events.BrowserInvokeEvent;
33  
-    air.DataEvent = window.runtime.flash.events.DataEvent;
34  
-    air.DRMAuthenticateEvent = window.runtime.flash.events.DRMAuthenticateEvent;
35  
-    air.DRMStatusEvent = window.runtime.flash.events.DRMStatusEvent;
36  
-    air.ErrorEvent = window.runtime.flash.events.ErrorEvent;
37  
-    air.Event = window.runtime.flash.events.Event;
38  
-    air.EventDispatcher = window.runtime.flash.events.EventDispatcher;
39  
-    air.FileListEvent = window.runtime.flash.events.FileListEvent;
40  
-    air.HTTPStatusEvent = window.runtime.flash.events.HTTPStatusEvent;
41  
-    air.IOErrorEvent = window.runtime.flash.events.IOErrorEvent;
42  
-    air.InvokeEvent = window.runtime.flash.events.InvokeEvent;
43  
-    air.NetStatusEvent = window.runtime.flash.events.NetStatusEvent;
44  
-    air.OutputProgressEvent = window.runtime.flash.events.OutputProgressEvent;
45  
-    air.ProgressEvent = window.runtime.flash.events.ProgressEvent;
46  
-    air.SecurityErrorEvent = window.runtime.flash.events.SecurityErrorEvent;
47  
-    air.StatusEvent = window.runtime.flash.events.StatusEvent;
48  
-    air.TimerEvent = window.runtime.flash.events.TimerEvent;
49  
-    air.SampleDataEvent = window.runtime.flash.events.SampleDataEvent;
50  
-    
51  
-    // native window
52  
-    air.NativeWindow = window.runtime.flash.display.NativeWindow;
53  
-    air.NativeWindowDisplayState = window.runtime.flash.display.NativeWindowDisplayState;
54  
-    air.NativeWindowInitOptions = window.runtime.flash.display.NativeWindowInitOptions;
55  
-    air.NativeWindowSystemChrome = window.runtime.flash.display.NativeWindowSystemChrome;
56  
-    air.NativeWindowResize = window.runtime.flash.display.NativeWindowResize;
57  
-    air.NativeWindowType = window.runtime.flash.display.NativeWindowType;
58  
-
59  
-    air.NativeWindowBoundsEvent = window.runtime.flash.events.NativeWindowBoundsEvent;
60  
-    air.NativeWindowDisplayStateEvent = window.runtime.flash.events.NativeWindowDisplayStateEvent;
61  
-
62  
-    // geom
63  
-    air.Point = window.runtime.flash.geom.Point;
64  
-    air.Rectangle = window.runtime.flash.geom.Rectangle;
65  
-    air.Matrix = window.runtime.flash.geom.Matrix;
66  
-
67  
-    // 3D
68  
-    air.Matrix3D  = window.runtime.flash.geom.Matrix3D;
69  
-    air.Vector3D  = window.runtime.flash.geom.Vector3D;
70  
-    air.Orientation3D  = window.runtime.flash.geom.Orientation3D;
71  
-    air.Utils3D  = window.runtime.flash.geom.Utils3D;
72  
-    
73  
-    // Shader    
74  
-    air.Shader = window.runtime.flash.display.Shader;
75  
-    air.ShaderFilter = window.runtime.flash.filters.ShaderFilter;
76  
-    air.ShaderPrecision = window.runtime.flash.display.ShaderPrecision;
77  
-    
78  
-    // net
79  
-    air.FileFilter = window.runtime.flash.net.FileFilter;
80  
-    
81  
-    air.LocalConnection = window.runtime.flash.net.LocalConnection;
82  
-    air.NetConnection = window.runtime.flash.net.NetConnection;
83  
-
84  
-    air.URLLoader = window.runtime.flash.net.URLLoader;
85  
-    air.URLLoaderDataFormat = window.runtime.flash.net.URLLoaderDataFormat;
86  
-    air.URLRequest = window.runtime.flash.net.URLRequest;
87  
-    air.URLRequestDefaults = window.runtime.flash.net.URLRequestDefaults;
88  
-    air.URLRequestHeader = window.runtime.flash.net.URLRequestHeader;
89  
-    air.URLRequestMethod = window.runtime.flash.net.URLRequestMethod;
90  
-    air.URLStream = window.runtime.flash.net.URLStream;
91  
-    air.URLVariables = window.runtime.flash.net.URLVariables;
92  
-    air.Socket = window.runtime.flash.net.Socket;
93  
-    air.XMLSocket = window.runtime.flash.net.XMLSocket;
94  
-
95  
-    air.Responder = window.runtime.flash.net.Responder;
96  
-    air.ObjectEncoding = window.runtime.flash.net.ObjectEncoding;
97  
-
98  
-    air.NetStream = window.runtime.flash.net.NetStream;
99  
-    air.NetStreamInfo = window.runtime.flash.net.NetStreamInfo;
100  
-    air.NetStreamPlayOptions = window.runtime.flash.net.NetStreamPlayOptions;
101  
-    air.NetStreamPlayTransitions = window.runtime.flash.net.NetStreamPlayTransitions;
102  
-    air.SharedObject = window.runtime.flash.net.SharedObject;
103  
-    air.SharedObjectFlushStatus = window.runtime.flash.net.SharedObjectFlushStatus;
104  
-
105  
-    // system
106  
-    air.Capabilities = window.runtime.flash.system.Capabilities;
107  
-    air.System = window.runtime.flash.system.System;
108  
-    air.Security = window.runtime.flash.system.Security;
109  
-    air.Updater = window.runtime.flash.desktop.Updater;
110  
-
111  
-    // desktop
112  
-    air.Clipboard = window.runtime.flash.desktop.Clipboard;
113  
-    air.ClipboardFormats = window.runtime.flash.desktop.ClipboardFormats;
114  
-    air.ClipboardTransferMode = window.runtime.flash.desktop.ClipboardTransferMode;
115  
-
116  
-    air.NativeDragManager = window.runtime.flash.desktop.NativeDragManager;
117  
-    air.NativeDragOptions = window.runtime.flash.desktop.NativeDragOptions;
118  
-    air.NativeDragActions = window.runtime.flash.desktop.NativeDragActions;
119  
-
120  
-    air.Icon = window.runtime.flash.desktop.Icon;
121  
-    air.DockIcon = window.runtime.flash.desktop.DockIcon;
122  
-    air.InteractiveIcon = window.runtime.flash.desktop.InteractiveIcon;
123  
-    air.NotificationType = window.runtime.flash.desktop.NotificationType;
124  
-    air.SystemTrayIcon = window.runtime.flash.desktop.SystemTrayIcon;
125  
-
126  
-    air.NativeApplication = window.runtime.flash.desktop.NativeApplication;
127  
-
128  
-    // display
129  
-    air.NativeMenu = window.runtime.flash.display.NativeMenu;
130  
-    air.NativeMenuItem = window.runtime.flash.display.NativeMenuItem;
131  
-    air.Screen = window.runtime.flash.display.Screen;
132  
-    
133  
-    air.Loader  = window.runtime.flash.display.Loader;
134  
-    air.Bitmap = window.runtime.flash.display.Bitmap;
135  
-    air.BitmapData = window.runtime.flash.display.BitmapData;
136  
-
137  
-    // ui
138  
-    air.Keyboard = window.runtime.flash.ui.Keyboard;
139  
-    air.KeyLocation = window.runtime.flash.ui.KeyLocation;
140  
-    air.Mouse = window.runtime.flash.ui.Mouse;
141  
-
142  
-
143  
-    //security
144  
-    air.ReferencesValidationSetting = window.runtime.flash.security.ReferencesValidationSetting;
145  
-    air.RevocationCheckSettings = window.runtime.flash.security.RevocationCheckSettings;
146  
-    air.SignatureStatus = window.runtime.flash.security.SignatureStatus;
147  
-    air.SignerTrustSettings = window.runtime.flash.security.SignerTrustSettings;
148  
-    air.XMLSignatureValidator = window.runtime.flash.security.XMLSignatureValidator;
149  
-        
150  
-
151  
-    // utils
152  
-    air.ByteArray = window.runtime.flash.utils.ByteArray;
153  
-    air.CompressionAlgorithm = window.runtime.flash.utils.CompressionAlgorithm;
154  
-    air.Endian = window.runtime.flash.utils.Endian;
155  
-    air.Timer = window.runtime.flash.utils.Timer;
156  
-
157  
-    air.HTMLLoader = window.runtime.flash.html.HTMLLoader;
158  
-    air.HTMLPDFCapability = window.runtime.flash.html.HTMLPDFCapability;    
159  
-
160  
-    // media
161  
-    air.ID3Info = window.runtime.flash.media.ID3Info;
162  
-    air.Sound = window.runtime.flash.media.Sound;
163  
-    air.SoundChannel = window.runtime.flash.media.SoundChannel;
164  
-    air.SoundLoaderContext = window.runtime.flash.media.SoundLoaderContext;
165  
-    air.SoundMixer = window.runtime.flash.media.SoundMixer;
166  
-    air.SoundTransform = window.runtime.flash.media.SoundTransform;
167  
-    air.Microphone = window.runtime.flash.media.Microphone;
168  
-    air.Video = window.runtime.flash.media.Video;
169  
-    air.Camera = window.runtime.flash.media.Camera;
170  
-    air.SoundCodec = window.runtime.flash.media.SoundCodec;
171  
-
172  
-    // data
173  
-    air.EncryptedLocalStore = window.runtime.flash.data.EncryptedLocalStore;
174  
-    air.SQLCollationType = window.runtime.flash.data.SQLCollationType;
175  
-    air.SQLColumnNameStyle = window.runtime.flash.data.SQLColumnNameStyle;
176  
-    air.SQLColumnSchema = window.runtime.flash.data.SQLColumnSchema;
177  
-    air.SQLConnection = window.runtime.flash.data.SQLConnection;
178  
-    air.SQLError = window.runtime.flash.errors.SQLError;
179  
-    air.SQLErrorEvent = window.runtime.flash.events.SQLErrorEvent;
180  
-    air.SQLErrorOperation = window.runtime.flash.errors.SQLErrorOperation;
181  
-    air.SQLEvent = window.runtime.flash.events.SQLEvent;
182  
-    air.SQLIndexSchema = window.runtime.flash.data.SQLIndexSchema;
183  
-    air.SQLMode = window.runtime.flash.data.SQLMode;
184  
-    air.SQLResult = window.runtime.flash.data.SQLResult;
185  
-    air.SQLSchema = window.runtime.flash.data.SQLSchema;
186  
-    air.SQLSchemaResult = window.runtime.flash.data.SQLSchemaResult;
187  
-    air.SQLStatement = window.runtime.flash.data.SQLStatement;
188  
-    air.SQLTableSchema = window.runtime.flash.data.SQLTableSchema;
189  
-    air.SQLTransactionLockType = window.runtime.flash.data.SQLTransactionLockType;
190  
-    air.SQLTriggerSchema = window.runtime.flash.data.SQLTriggerSchema;
191  
-    air.SQLUpdateEvent = window.runtime.flash.events.SQLUpdateEvent;
192  
-    air.SQLViewSchema = window.runtime.flash.data.SQLViewSchema;
193  
-
194  
-    // service monitoring framework
195  
-    air.__defineGetter__("ServiceMonitor", function() { return window.runtime.air.net.ServiceMonitor; })
196  
-    air.__defineGetter__("SocketMonitor", function() { return window.runtime.air.net.SocketMonitor; })
197  
-    air.__defineGetter__("URLMonitor", function() { return window.runtime.air.net.URLMonitor; })
198  
-    
199  
-    // update framework
200  
-    air.__defineGetter__("ApplicationUpdater", function() { return window.runtime.air.update.ApplicationUpdater; });
201  
-    air.__defineGetter__("ApplicationUpdaterUI", function() { return window.runtime.air.update.ApplicationUpdaterUI; });
202  
-    air.__defineGetter__("UpdateEvent", function() { return window.runtime.air.update.events.UpdateEvent; });
203  
-    air.__defineGetter__("StatusUpdateEvent", function() { return window.runtime.air.update.events.StatusUpdateEvent; });
204  
-    air.__defineGetter__("StatusUpdateErrorEvent", function() { return window.runtime.air.update.events.StatusUpdateErrorEvent; });
205  
-    air.__defineGetter__("DownloadErrorEvent", function() { return window.runtime.air.update.events.DownloadErrorEvent; });
206  
-    air.__defineGetter__("StatusFileUpdateEvent", function() { return window.runtime.air.update.events.StatusFileUpdateEvent; });
207  
-    air.__defineGetter__("StatusFileUpdateErrorEvent", function() { return window.runtime.air.update.events.StatusFileUpdateErrorEvent; });
208  
-}
1,949  javascripts/dependencies/air/AIRIntrospector.js
0 additions, 1949 deletions not shown
1,325  javascripts/dependencies/air/AIRLocalizer.js
... ...
@@ -1,1325 +0,0 @@
1  
-/* AIRLocalizer.js - Revision: 1.5 */
2  
-
3  
-/*
4  
-ADOBE SYSTEMS INCORPORATED
5  
-Copyright 2007-2008 Adobe Systems Incorporated. All Rights Reserved.
6  
- 
7  
-NOTICE:   Adobe permits you to modify and distribute this file only in accordance with
8  
-the terms of Adobe AIR SDK license agreement.  You may have received this file from a
9  
-source other than Adobe.  Nonetheless, you may modify or
10  
-distribute this file only in accordance with such agreement. 
11  
-*/
12  
-
13  
-
14  
-// Using the function method to obfuscate inner globals to the main script, so that the 
15  
-// "window" remains untouched.
16  
-(function(){
17  
-	/**
18  
-	 * This is automatically replaced while building
19  
-	 * @version "1.5"
20  
-	 * @private	
21  
-	 */
22  
-	var version = "1.5";
23  
-	
24  
-	
25  
-	/**
26  
-	 * Just to make sure we have the right shortcuts included
27  
-	 * @namespace window.air
28  
-	 * @private	
29  
-	 */
30  
-	var air = {
31  
-		File : window.runtime.flash.filesystem.File,
32  
-	    FileStream : window.runtime.flash.filesystem.FileStream,
33  
-	    FileMode : window.runtime.flash.filesystem.FileMode,
34  
-	    Capabilities : window.runtime.flash.system.Capabilities
35  
-	};
36  
-	
37  
-	/**
38  
-	 * Utility functions
39  
-	 * @namespace util
40  
-	 * @private	
41  
-	 */
42  
-	var util = {
43  
-		/**
44  
-		 * Returns the content of a file
45  
-		 * @param file air.File File that should be read
46  
-		 * @return string
47  
-		 */
48  
-		stringFromFile : function stringFromFile(file){
49  
-			var fileStream = new air.FileStream();
50  
-			fileStream.open(file, air.FileMode.READ);
51  
-			var result = fileStream.readUTFBytes(file.size);
52  
-			fileStream.close();
53  
-			return result;
54  
-		}
55  
-	};
56  
-	
57  
-	/**
58  
-	 * Used for sorting the locales array
59  
-	 * @private
60  
-	 */
61  
-	
62  
-	function LocaleId(){
63  
-		this.lang = '';
64  
-		this.script = '';
65  
-		this.region = '';
66  
-		this.extended_langs = [];
67  
-		this.variants = [];
68  
-		this.extensions = {};
69  
-		this.privates = [];
70  
-		this.privateLangs = false;
71  
-	};
72  
-	
73  
-	
74  
- 	LocaleId.prototype = {
75  
-		transformToParent: function(){
76  
-			if(this.privates.length>0){
77  
-				this.privates.splice(this.privates.length-1, 1);
78  
-				return true;
79  
-			}
80  
-			
81  
-			var lastExtensionName = null;
82  
-			for(var i in this.extensions){
83  
-				if(this.extensions.hasOwnProperty(i)){
84  
-					lastExtensionName = i;
85  
-				}
86  
-			}
87  
-			if(lastExtensionName){
88  
-				var lastExtension = this.extensions[lastExtensionName];
89  
-				if(lastExtension.length==1){
90  
-					delete this.extensions[ lastExtensionName ];
91  
-					return true;
92  
-				}
93  
-				lastExtension.splice(lastExtension.length-1, 1);
94  
-				return true;
95  
-			}
96  
-			
97  
-			if(this.variants.length>0){
98  
-				this.variants.splice(this.variants.length-1, 1);
99  
-				return true;
100  
-			}
101  
-
102  
-			if(this.script!=''){
103  
-				//check if we can surpress the script
104  
-			    if(LocaleId.getScriptByLang(this.lang)!=''){
105  
-					this.script='';
106  
-					return true;
107  
-			    }else if(this.region==''){
108  
-					//maybe the default region can surpress the script
109  
-					var region = LocaleId.getDefaultRegionForLangAndScript(this.lang, this.script);
110  
-					if(region!=''){
111  
-						this.region = region;
112  
-						this.script = '';
113  
-						return true;
114  
-					}
115  
-				}
116  
-			}
117  
-			
118  
-			if(this.region!=''){
119  
-				if(!(this.script=='' && LocaleId.getScriptByLang(this.lang) == '')){
120  
-					this.region='';
121  
-					return true;
122  
-				}
123  
-			}
124  
-			
125  
-			
126  
-			if(this.extended_langs.length>0){
127  
-				this.extended_langs.splice(this.extended_langs.length-1, 1);
128  
-				return true;
129  
-			}
130  
-			
131  
-			return false;
132  
-		},
133  
-		
134  
-		isSiblingOf: function(other){
135  
-			if(this.lang==other.lang&&this.script==other.script){
136  
-				return true;
137  
-			}
138  
-			return false;
139  
-		},
140  
-		
141  
-		equals: function(locale){
142  
-			return this.toString() == locale.toString();
143  
-		},
144  
-		toString: function(){
145  
-			var stack = [ this.lang ];
146  
-			Array.prototype.push.apply(stack, this.extended_langs);
147  
-			if(this.script!='') stack.push(this.script);
148  
-			if(this.region!='') stack.push(this.region);
149  
-			Array.prototype.push.apply(stack, this.variants);
150  
-			for(var i in this.extensions){
151  
-				if(this.extensions.hasOwnProperty(i)){
152  
-					stack.push(i);
153  
-					Array.prototype.push.apply(stack, this.extensions[i]);
154  
-				}
155  
-			}
156  
-			if(this.privates.length>0){
157  
-				stack.push('x');
158  
-				Array.prototype.push.apply(stack, this.privates);
159  
-			}
160  
-			return stack.join('_');
161  
-		},
162  
-		canonicalize: function(){
163  
-			for(var i in this.extensions){
164  
-				if(this.extensions.hasOwnProperty(i)){
165  
-					//also clear zero length extensions
166  
-					if(this.extensions[i].length==0) delete this.extensions[i];
167  
-					else this.extensions[i] = this.extensions[i].sort();
168  
-				}
169  
-			}
170  
-			this.extended_langs = this.extended_langs.sort();
171  
-			this.variants = this.variants.sort();
172  
-			this.privates = this.privates.sort();
173  
-			if(this.script == ''){
174  
-				this.script = LocaleId.getScriptByLang(this.lang);
175  
-			}
176  
-			//still no script, check the region
177  
-			if(this.script == '' && this.region!=''){
178  
-				this.script = LocaleId.getScriptByLangAndRegion(this.lang, this.region);
179  
-			}
180  
-			
181  
-			if(this.region=='' && this.script!=''){
182  
-				this.region = LocaleId.getDefaultRegionForLangAndScript(this.lang, this.script);
183  
-			}
184  
-		}
185  
-	}
186  
-	
187  
-	LocaleId.registry = {
188  
-		"scripts": ["cyrl", "latn", "ethi", "arab", "beng", "cyrl", "thaa", "tibt", "grek", "gujr", "hebr", "deva", "armn", "jpan", "geor", "khmr", "knda", "kore", "laoo", "mlym", "mymr", "orya", "guru", "sinh", "taml", "telu", "thai", "nkoo", "blis", "hans", "hant", "mong", "syrc"],
189  
-	 	"scriptById": {"cyrl": 5, "latn": 1, "ethi": 2, "arab": 3, "beng": 4, "thaa": 6, "tibt": 7, "grek": 8, "gujr": 9, "hebr": 10, "deva": 11, "armn": 12, "jpan": 13, "geor": 14, "khmr": 15, "knda": 16, "kore": 17, "laoo": 18, "mlym": 19, "mymr": 20, "orya": 21, "guru": 22, "sinh": 23, "taml": 24, "telu": 25, "thai": 26, "nkoo": 27, "blis": 28, "hans": 29, "hant": 30, "mong": 31, "syrc": 32} , 
190  
-		"defaultRegionByLangAndScript": {"bg": {5: "bg"}, "ca": {1: "es"}, "zh": {30: "tw", 29: "cn"}, "cs": {1: "cz"}, "da": {1: "dk"}, "de": {1: "de"}, "el": {8: "gr"}, "en": {1: "us"}, "es": {1: "es"}, "fi": {1: "fi"}, "fr": {1: "fr"}, "he": {10: "il"}, "hu": {1: "hu"}, "is": {1: "is"}, "it": {1: "it"}, "ja": {13: "jp"}, "ko": {17: "kr"}, "nl": {1: "nl"}, "nb": {1: "no"}, "pl": {1: "pl"}, "pt": {1: "br"}, "ro": {1: "ro"}, "ru": {5: "ru"}, "hr": {1: "hr"}, "sk": {1: "sk"}, "sq": {1: "al"}, "sv": {1: "se"}, "th": {26: "th"}, "tr": {1: "tr"}, "ur": {3: "pk"}, "id": {1: "id"}, "uk": {5: "ua"}, "be": {5: "by"}, "sl": {1: "si"}, "et": {1: "ee"}, "lv": {1: "lv"}, "lt": {1: "lt"}, "fa": {3: "ir"}, "vi": {1: "vn"}, "hy": {12: "am"}, "az": {1: "az", 5: "az"}, "eu": {1: "es"}, "mk": {5: "mk"}, "af": {1: "za"}, "ka": {14: "ge"}, "fo": {1: "fo"}, "hi": {11: "in"}, "ms": {1: "my"}, "kk": {5: "kz"}, "ky": {5: "kg"}, "sw": {1: "ke"}, "uz": {1: "uz", 5: "uz"}, "tt": {5: "ru"}, "pa": {22: "in"}, "gu": {9: "in"}, "ta": {24: "in"}, "te": {25: "in"}, "kn": {16: "in"}, "mr": {11: "in"}, "sa": {11: "in"}, "mn": {5: "mn"}, "gl": {1: "es"}, "kok": {11: "in"}, "syr": {32: "sy"}, "dv": {6: "mv"}, "nn": {1: "no"}, "sr": {1: "cs", 5: "cs"}, "cy": {1: "gb"}, "mi": {1: "nz"}, "mt": {1: "mt"}, "quz": {1: "bo"}, "tn": {1: "za"}, "xh": {1: "za"}, "zu": {1: "za"}, "nso": {1: "za"}, "se": {1: "no"}, "smj": {1: "no"}, "sma": {1: "no"}, "sms": {1: "fi"}, "smn": {1: "fi"}, "bs": {1: "ba"}},
191  
-		"scriptIdByLang": {"ab": 0, "af": 1, "am": 2, "ar": 3, "as": 4, "ay": 1, "be": 5, "bg": 5, "bn": 4, "bs": 1, "ca": 1, "ch": 1, "cs": 1, "cy": 1, "da": 1, "de": 1, "dv": 6, "dz": 7, "el": 8, "en": 1, "eo": 1, "es": 1, "et": 1, "eu": 1, "fa": 3, "fi": 1, "fj": 1, "fo": 1, "fr": 1, "frr": 1, "fy": 1, "ga": 1, "gl": 1, "gn": 1, "gu": 9, "gv": 1, "he": 10, "hi": 11, "hr": 1, "ht": 1, "hu": 1, "hy": 12, "id": 1, "in": 1, "is": 1, "it": 1, "iw": 10, "ja": 13, "ka": 14, "kk": 5, "kl": 1, "km": 15, "kn": 16, "ko": 17, "la": 1, "lb": 1, "ln": 1, "lo": 18, "lt": 1, "lv": 1, "mg": 1, "mh": 1, "mk": 5, "ml": 19, "mo": 1, "mr": 11, "ms": 1, "mt": 1, "my": 20, "na": 1, "nb": 1, "nd": 1, "ne": 11, "nl": 1, "nn": 1, "no": 1, "nr": 1, "ny": 1, "om": 1, "or": 21, "pa": 22, "pl": 1, "ps": 3, "pt": 1, "qu": 1, "rn": 1, "ro": 1, "ru": 5, "rw": 1, "sg": 1, "si": 23, "sk": 1, "sl": 1, "sm": 1, "so": 1, "sq": 1, "ss": 1, "st": 1, "sv": 1, "sw": 1, "ta": 24, "te": 25, "th": 26, "ti": 2, "tl": 1, "tn": 1, "to": 1, "tr": 1, "ts": 1, "uk": 5, "ur": 3, "ve": 1, "vi": 1, "wo": 1, "xh": 1, "yi": 10, "zu": 1, "cpe": 1, "dsb": 1, "frs": 1, "gsw": 1, "hsb": 1, "kok": 11, "mai": 11, "men": 1, "nds": 1, "niu": 1, "nqo": 27, "nso": 1, "son": 1, "tem": 1, "tkl": 1, "tmh": 1, "tpi": 1, "tvl": 1, "zbl": 28}, 
192  
-		"scriptIdByLangAndRegion": {"zh": {"cn": 29, "sg": 29, "tw": 30, "hk": 30, "mo": 30}, "mn": {"cn": 31, "sg": 5}, "pa": {"pk": 3, "in": 22}, "ha": {"gh": 1, "ne": 1}}};                                             
193  
-	
194  
-	
195  
-	LocaleId.getScriptByLangAndRegion = function(lang, region){
196  
-		var langRegions = LocaleId.registry.scriptIdByLangAndRegion[ lang ];
197  
-		if(typeof langRegions=='undefined') return '';
198  
-		var scriptId = langRegions[region];
199  
-		if(typeof scriptId!='undefined'){
200  
-			return LocaleId.registry.scripts[scriptId].toLowerCase();
201  
-		}
202  
-		return '';
203  
-	}
204  
-	
205  
-	LocaleId.getScriptByLang = function(lang){
206  
-		var scriptId = LocaleId.registry.scriptIdByLang[ lang ];
207  
-		if(typeof scriptId!='undefined'){
208  
-			return LocaleId.registry.scripts[scriptId].toLowerCase();
209  
-		}
210  
-		return '';
211  
-	}
212  
-
213  
-	LocaleId.getDefaultRegionForLangAndScript = function(lang, script){
214  
-		var lang = LocaleId.registry.defaultRegionByLangAndScript[ lang ];
215  
-		var scriptId = LocaleId.registry.scriptById[ script ];
216  
-		if(typeof lang!='undefined' && typeof scriptId !='undefined' ){
217  
-			return lang[scriptId] || "";
218  
-		}
219  
-		return '';
220  
-	}
221  
-
222  
-	
223  
-	LocaleId.fromString = function(str){
224  
-		//states
225  
-		{ 
226  
-			var PrimaryLanguage = 0,
227  
-				ExtendedLanguages = 1,
228  
-				Script = 2,
229  
-				Region = 3,
230  
-				Variants = 5,  
231  
-				Extensions = 6,
232  
-				Privates = 7;
233  
-		}
234  
-		var localeId = new LocaleId();
235  
-
236  
-		var state = PrimaryLanguage;
237  
-		var subtags = str.replace(/-/g, '_').split('_');
238  
-        
239  
-		var last_extension;
240  
-
241  
-		for(var i=0, l=subtags.length; i<l ;i++){
242  
-			var subtag = subtags[i].toLowerCase();
243  
-			
244  
-			if(state==PrimaryLanguage){
245  
-				if(subtag=='x'){
246  
-					localeId.privateLangs = true; //not used in our implementation, but makes the tag private
247  
-				}else if(subtag=='i'){
248  
-					localeId.lang += 'i-';	//and wait the next subtag to complete the language name
249  
-				}else{
250  
-					localeId.lang += subtag;
251  
-					state ++;
252  
-				}
253  
-			}else{
254  
-				//looging for an extended language 	- 3 chars
255  
-				//			   a script 			- 4 chars
256  
-				//			   a region				- 2-3 chars
257  
-				//			   a variant			- alpha with at least 5 chars or numeric with at least 4 chars
258  
-				//			  an extension/private singleton - 1 char
259  
-				
260  
-				var subtag_length = subtag.length; //store it for faster use later
261  
-				if(subtag_length==0) continue; //skip zero-lengthed subtags
262  
-				var firstChar = subtag[0].toLowerCase();
263  
-				
264  
-				if(state<=ExtendedLanguages && subtag_length==3){
265  
-				    localeId.extended_langs.push(subtag);
266  
-					if(localeId.extended_langs.length==3){ //allow a maximum of 3 extended langs
267  
-						state = Script;
268  
-					}
269  
-				}else if ( state <= Script && subtag_length==4 ){
270  
-					localeId.script = subtag;
271  
-					state = Region;
272  
-				}else if( state <= Region && (subtag_length==2 || subtag_length==3) ){
273  
-					localeId.region = subtag;
274  
-					state = Variants;
275  
-				}else if ( state <= Variants && 
276  
-						( 
277  
-							( firstChar>='a' && firstChar<='z' && subtag_length>=5 ) 
278  
-													|| 
279  
-							( firstChar>='0' && firstChar<='9' && subtag_length>=4 ) 
280  
-						)
281  
-				  ){
282  
-					//variant
283  
-					localeId.variants.push(subtag);
284  
-					state = Variants;
285  
-				}else if ( state < Privates && subtag_length==1 ){ //singleton
286  
-					if(subtag == 'x'){
287  
-						state = Privates;
288  
-						last_extension = localeId.privates;
289  
-					} else { 
290  
-						state = Extensions;
291  
-						last_extension = localeId.extensions[subtag] || [];
292  
-						localeId.extensions[subtag] = last_extension;
293  
-					}
294  
-				}else if(state >= Extensions){
295  
-					last_extension.push(subtag);
296  
-				}
297  
-			}
298  
-		}
299  
-		localeId.canonicalize();
300  
-		return localeId;
301  
-	}
302  
-	
303  
-    var LocaleSorter = {
304  
-		/**
305  
-		 * Promote only that locales from preferenceLocales that have parents in locales
306  
-		 * @private
307  
-		 * @param locales String[] List of locales to be sorted. 
308  
-		 * @param preferenceLocales String[] List of locales in the preference order
309  
-		 * @param addAll Adds all the locales at the end, even though no locale is in the preferences list. Default is true
310  
-		 * @return String[]
311  
-		 */
312  
-		sortLocalesUsingPreferences: function(_locales, _preferenceLocales, ultimateFallbackLocale, addAll){
313  
-			var result = [];
314  
-			var haveLocale = {};
315  
-			
316  
-			function prepare(list){
317  
-				var resultList = []; 
318  
-				for(var i=0,l=list.length;i<l;i++) {
319  
-					resultList.push (list[i].toLowerCase().replace(/-/g,'_'));
320  
-				}
321  
-				return resultList;
322  
-			}
323  
-			
324  
-			var locales = prepare(_locales);
325  
-			var preferenceLocales = prepare(_preferenceLocales);
326  
-
327  
-			if(ultimateFallbackLocale&&ultimateFallbackLocale!=''){
328  
-				var ultimateFallbackLocale = ultimateFallbackLocale.toLowerCase().replace(/-/g,'_');
329  
-				var found = false;
330  
-				for(var i=0, l=preferenceLocales.length; i<l; i++){
331  
-					if(preferenceLocales[i]==ultimateFallbackLocale){
332  
-						found = true;
333  
-					}
334  
-				}
335  
-				if(!found){
336  
-					preferenceLocales.push(ultimateFallbackLocale);
337  
-				}
338  
-			}
339  
-			
340  
-			for(var j=0, k=locales.length; j<k; j++){
341  
-				haveLocale[ locales[j] ] = j;
342  
-			}
343  
-			
344  
-			function promote(locale){
345  
-				if(typeof haveLocale[locale]!='undefined'){
346  
-					result.push( _locales[ haveLocale[locale] ] );
347  
-					delete haveLocale[locale];
348  
-				}
349  
-			}
350  
-			
351  
-
352  
-			
353  
-			for(var i=0, l=preferenceLocales.length; i<l; i++){
354  
-				var plocale = LocaleId.fromString( preferenceLocales[i] );
355  
-				
356  
-				// step 1: promote the perfect match
357  
-				promote(preferenceLocales[i]);
358  
-
359  
-				promote(plocale.toString());
360  
-               
361  
- 				// step 2: promote the parent chain
362  
-				while(plocale.transformToParent()){
363  
-					promote(plocale.toString());
364  
-				}
365  
-				
366  
-				//parse it again
367  
-			    plocale = LocaleId.fromString( preferenceLocales[i] );
368  
-			    // step 3: promote the order of siblings from preferenceLocales
369  
-				for(var j=0; j<l; j++){
370  
-					var locale = preferenceLocales[j];
371  
-					if( plocale.isSiblingOf ( LocaleId.fromString( locale ) ) ){
372  
-						promote(locale);
373  
-					}
374  
-				}				
375  
-				// step 4: promote all remaining siblings (aka not in preferenceLocales)
376  
-				for(var j=0, k=locales.length; j<k; j++){
377  
-					var locale = locales[j];
378  
-					if( plocale.isSiblingOf( LocaleId.fromString( locale ) ) ){
379  
-						promote( locale );
380  
-					}
381  
-				}
382  
-				
383  
-			}
384  
-			if(addAll){
385  
-				// check what locales are not already loaded and push them. 
386  
-				// using the "for" because we want to preserve order
387  
-				for(var j=0, k=locales.length; j<k; j++){
388  
-					promote(locales[j]);
389  
-				}
390  
-			}
391  
-			return result;
392  
-		},
393  
-	};
394  
-	
395  
-	/**
396  
-	 * LocalizerEvent
397  
-	 * @constructor
398  
-	 * @private
399  
-	 */
400  
-	function LocalizerEvent(name, config){
401  
-		for(var prop in config){
402  
-			this[prop] = config[prop];
403  
-		}
404  
-		this.name = name;
405  
-	};
406  
-	
407  
-	LocalizerEvent.prototype = {
408  
-		toString: function(){
409  
-			return "[LocalizerEvent: "+this.name+"]";
410  
-		}
411  
-	}
412  
-	
413  
-	/**
414  
-	 * Parses the property files and generates a collection of keys and values
415  
-	 * @constructor
416  
-	 * @private	
417  
-	 */
418  
-	function ResourceBundle(bundleFile){  
419  
-		this.keys = {};
420  
-		try{
421  
-			this.parse(util.stringFromFile(bundleFile));
422  
-			this.found = true;
423  
-		}catch(e){
424  
-			// file not found
425  
-			// die silently
426  
-			this.found = false;
427  
-		}
428  
-	};
429  
-	
430  
-	ResourceBundle.prototype = {
431  
-		/**
432  
-		 * Parses the property file
433  
-		 * @param source Content of the property file
434  
-		 */
435  
-		parse: function(source){
436  
-			var source = source.replace(/\r\n/g, "\n").replace(/\r/g, "\n").replace(/^(?:\s*?)(?:!|#)([^\n\r]*)$/gm, ''); 
437  
-			var rg = /^(?:[ \t\f]*)((?:\\=|\\:|\\\\|[^=:\s])+)(?:[ \t\f]*)(?:$|(?:[=: \t\f](?:[ \t\f]*)((?:[^\n\r]*(?:\\(?:\r\n|\n|\r))+)*[^\n\r]*)$))/gm;
438  
-			var reformat = /\\(?:\r\n|\n|\r)(?:\s*)/g;
439  
-			var decoder = /\\(.)/g;
440  
-			var decoderCodes = { ':' : ':', '=':'=', 'n': "\n", 'r':"\r", 't':"\t", "\\":"\\" };
441  
-			var decoderFn = function(r, a){ return decoderCodes.hasOwnProperty(a) ? decoderCodes[a] : r }
442  
-			var line;
443  
-			while( line = rg.exec(source) ){
444  
-				var nodeName = line[1].replace(/\uFEFF/g, '').replace(decoder, decoderFn);
445  
-				var value = line[2] || "";
446  
-				this.keys[nodeName] = value.replace(reformat, "").replace(decoder, decoderFn);
447  
-			}
448  
-		},
449  
-		/**
450  
-		 * Returns the value of a resource     
451  
-		 * @param key string The key name of the resource. This is case sensitvie
452  
-		 * @return string
453  
-		 */
454  
-		get: function(key){
455  
-			return this.keys[key] || null;
456  
-		}
457  
-	};
458  
-	
459  
-	/**
460  
-	 * Holds the content of a localized file
461  
-	 * @constructor
462  
-	 * @private	
463  
-	 */
464  
-	function ResourceFile(bundleFile){
465  
-		try{
466  
-			this.content = util.stringFromFile(bundleFile);
467  
-			this.found = true;
468  
-		}catch(e){
469  
-			// file not found
470  
-			// die silently
471  
-			this.content = null;
472  
-			this.found = false;
473  
-		}
474  
-	};
475  
-	
476  
-	ResourceFile.prototype = {
477  
-		/**
478  
-		 * Returns the content of the file
479  
-		 * @return string
480  
-		 */
481  
-		getContent: function(){
482  
-			return this.content;
483  
-		}
484  
-	};
485  
-	
486  
-	/**
487  
-	 * Takes every node on the DOM and replaces attributes based on a prefix
488  
-	 * @param parent LocalizerPrivate The localizer object used to get the resource strings
489  
-	 * @constructor
490  
-	 * @private
491  
-	 */
492  
-	function DOMWalker(parent){
493  
-		this.parent = parent;
494  
-	}
495  
-	
496  
-	DOMWalker.prototype = {
497  
-		/**
498  
-		 * Chechs if an attribute is a local attribute
499  
-		 * @param attr DOMAttribute The attribute that should be checked 
500  
-		 * @return bool 
501  
-		 */
502  
-		isLocalAttribute: function(attr){
503  
-			return attr.nodeName.toLowerCase().substr(0, this.attributePrefixLength)==this.attributePrefix;
504  
-		},
505  
-		
506  
-		/**
507  
-		 * Returns the attribute name that should be replace on a local attribute
508  
-		 * @param attr DOMAttribute The attribute that should be checked 
509  
-		 * @return string
510  
-		 */
511  
-		getLocalAttribute: function(attr){
512  
-			return attr.nodeName.toLowerCase().substr(this.attributePrefixLength);
513  
-		},
514  
-
515  
-		/**
516  
-		 * Replaces attributes on a single node
517  
-		 * @private
518  
-		 */
519  
-		walkNode: function(node){
520  
-			var attributePrefix = this.attributePrefix;
521  
-			var attributeInnerPrefix = attributePrefix+'innerhtml';
522  
-			if(!node.attributes) return;
523  
-			var params = [];
524  
-			var setInner = false;
525  
-			var innerValue = null;
526  
-			for(var i=node.attributes.length-1;i>=0;i--){
527  
-				var attr = node.attributes[i];
528  
-				if(attr.name.toLowerCase()==attributeInnerPrefix){
529  
-					setInner = true;
530  
-					innerValue = attr.value;
531  
-				}else if(this.isLocalAttribute(attr)){
532  
-					params.push([this.getLocalAttribute(attr), attr.value]);
533  
-				}
534  
-			}
535  
-			if(setInner){
536  
-				var value = this.getHtmlString(innerValue);
537  
-				try{
538  
-					node.innerHTML = value||innerValue;
539  
-				}catch(e){
540  
-					node.textContent = value||innerValue;
541  
-				}
542  
-			}
543  
-			for(var i=params.length-1;i>=0;i--){
544  
-				var param = params[i];
545  
-				var value = this.getHtmlString(param[1]);
546  
-				node.setAttribute(param[0], value||param[1]);
547  
-			}
548  
-		},
549  
-		
550  
-		/**
551  
-		 * Replaces each node under 'node'
552  
-		 * @param node DOMElement
553  
-		 * @public
554  
-		 */
555  
-		run: function (node){
556  
-			this.attributePrefix = this.parent.attributePrefix.toLowerCase();
557  
-			this.attributePrefixLength = this.attributePrefix.length;
558  
-			var treeWalker = document.createTreeWalker(
559  
-			    node||document,
560  
-			    NodeFilter.SHOW_ELEMENT,
561  
-			    { acceptNode: function(node) { return NodeFilter.FILTER_ACCEPT; } },
562  
-			    false
563  
-			);
564  
-			while(treeWalker.nextNode()) this.walkNode(treeWalker.currentNode);
565  
-		},
566  
-		
567  
-		/**
568  
-		 * Separates the bundleName and resourceName and returns the string from locale chain
569  
-		 * @param resourceName String Default bundle is "default"
570  
-		 * @return String
571  
-		 */
572  
-		getHtmlString: function(resourceName){
573  
-			var bundleName;
574  
-			var i = resourceName.indexOf('.');
575  
-			if(i!=-1){ bundleName = resourceName.substr(0, i); resourceName=resourceName.substr(i+1); }
576  
-			else bundleName = "default"
577  
-			return this.parent.getStringFromChain(bundleName, resourceName);
578  
-		}
579  
-	};
580  
- 
581  
-	
582  
-	
583  
-	/**
584  
-	 * Creates a new object used in Localizer to store loaded bundles, locale chain and bundles path 
585  
-	 * @private
586  
-	 * @constructor
587  
-	 * @v
588  
-	 */
589  
-	function LocalizerPrivate(parent){
590  
-		this.parent = parent;
591  
-
592  
-		// dom walker needed to update nodes
593  
-		this.domWalker = new DOMWalker(this);
594  
-		
595  
-		
596  
-		// Locale chain is the internal order that the framework uses to search for locales
597  
-		this.localeChain = [];
598  
-		
599  
-		// When the developer sets the locale chain we should disable the automatic detection
600  
-		this.autoLocaleChain = true;
601  
-		
602  
-		// Loaded locales should be sorted for later use
603  
-		this.localeCache = {};
604  
-		
605  
-		// Default bundle path used to solve the locales directories
606  
-		this.bundlePath = new air.File('app:/locale/');
607  
-		
608  
-		// Store the system capabilities for later use
609  
-		this.userPreference = air.Capabilities.languages || [air.Capabilities.language];
610  
-		
611  
-		// Event listeners
612  
-		this.eventListeners = {};
613  
-		
614  
-		this.attributePrefix = 'local_';
615  
-
616  
-	}                           
617  
-	LocalizerPrivate.prototype = {
618  
-		
619  
-		/**
620  
-		 * Creates a new locale object that caches bundles and files
621  
-		 * registers the locale for later use
622  
-		 * @private
623  
-		 * @param locale The localeName to be created
624  
-		 * @return LocaleHash
625  
-		 */    
626  
-		createLocaleCache: function(locale){
627  
-			var obj = {
628  
-				name : locale, 
629  
-				bundles: {},
630  
-				files: {}
631  
-			};
632  
-			this.localeCache[locale] = obj;
633  
-			return obj;
634  
-		},
635  
-		
636  
-		/**
637  
-		 * Returns the locale cache object. In case it is not already loaded it is created.
638  
-		 * @private
639  
-		 * @param locale String The localeName to be returned
640  
-		 * @return LocaleHash
641  
-		 */
642  
-		getLocaleCache: function(locale){
643  
-			return this.localeCache[locale] || this.createLocaleCache(locale);
644  
-		},
645  
-		
646  
-		
647  
-		/**
648  
-		 * Removes all the cached locales that are not in the locale chain
649  
-		 * @private
650  
-		 */
651  
-		cleanupCache: function (){
652  
-			var isInChain = {};
653  
-			for(var i in this.localeChain) isInChain[ this.localeChain[i] ] = true;
654  
-			
655  
-			for(var locale in this.localeCache ) {
656  
-				if( ! isInChain[locale] ){
657  
-					this.localeCache [ locale ] = null;
658  
-					delete this.localeCache [locale];
659  
-				}
660  
-			}
661  
-		},  
662  
-		    
663  
-		/**
664  
-		 * Removes all the cached locales 
665  
-		 * @private
666  
-		 */
667  
-		clearCache: function (){
668  
-			for(var locale in this.localeCache ) {
669  
-				this.localeCache [ locale ] = null;
670  
-				delete this.localeCache [locale];
671  
-			}
672  
-		},		
673  
-		/**
674  
-		 * Creates the bundle object. Also caches it for later use
675  
-		 * @private
676  
-		 * @param locale String The locale name where it should search the bundle
677  
-		 * @param bundlename String The bundle name for the returned bundle
678  
-		 * @return ResourceBundle
679  
-		 */
680  
-		createBundle: function(locale, bundleName){
681  
-			var localeCache = this.getLocaleCache(locale);
682  
-			var file = this.bundlePath.resolvePath(locale).resolvePath(bundleName+".properties");
683  
-			var resourceBundle = new ResourceBundle(file);
684  
-			localeCache.bundles[bundleName] = resourceBundle;
685  
-			if(!resourceBundle.found){
686  
-				setTimeout(function(obj){
687  
-					obj.dispatchEvent(new LocalizerEvent(Localizer.BUNDLE_NOT_FOUND, {
688  
-						bundleName: bundleName, 
689  
-						locale: locale
690  
-					}));
691  
-				}, 0, this);
692  
-			}
693  
-			return resourceBundle;
694  
-		},
695  
-		
696  
-		/**
697  
-		 * Loads a bundle and returns it. 
698  
-		 * @private              		
699  
-		 * @param locale String The locale name where it should search the bundle
700  
-		 * @param bundleName String The bundle name to be loaded
701  
-		 * @param useCache Bool Setting this to false will force the function to reread the bundle. Default is true
702  
-		 * @return ResourceBundle
703  
-		 */
704  
-		loadBundle: function(locale, bundleName, useCache){
705  
-			var localeCache = this.getLocaleCache(locale);
706  
-			useCache=(typeof useCache=='undefined')?true:useCache;
707  
-			return (useCache&&localeCache.bundles[bundleName]) || this.createBundle(locale, bundleName);
708  
-		},
709  
-		
710  
-		/**
711  
-		 * Loads a bundle and returns its keys and values as an object.
712  
-		 * @private
713  
-		 * @param locale String The locale name where it should search the bundle
714  
-		 * @param bundleName String The bundle name to be loaded
715  
-		 * @return Object Returns null if the bundle is not found.
716  
-		 */
717  
-		getResourceBundle: function(locale, bundleName){
718  
-			var bundle = this.loadBundle(locale, bundleName);
719  
-			if(bundle==null) 
720  
-				return null;
721  
-			//make a copy of the bundle
722  
-			var result = {};
723  
-			for (var key in bundle.keys){
724  
-				result [ key ] = bundle.keys [key];
725  
-			}
726  
-			return result;
727  
-		},
728  
-		
729  
-		/**
730  
-		 * Creates a new ResourceFile based on the fileName
731  
-		 * @private
732  
-		 * @param locale String The locale name where it should search the file
733  
-		 * @param fileName String Filename that should be loaded
734  
-		 * @return ResourceFile
735  
-		 */
736  
-		createFile: function(locale, fileName){
737  
-			var localeCache = this.getLocaleCache(locale);
738  
-			var file = this.bundlePath.resolvePath(locale).resolvePath(fileName);
739  
-			var resourceFile = new ResourceFile(file);
740  
-			localeCache.files[fileName] = resourceFile;
741  
-			if(!resourceFile.found){
742  
-				setTimeout(function(obj){
743  
-					obj.dispatchEvent(new LocalizerEvent(Localizer.FILE_NOT_FOUND, {
744  
-						fileName: fileName, 
745  
-						locale: locale
746  
-					}));
747  
-				}, 0, this);
748  
-			}
749  
-			return resourceFile;
750  
-		},
751  
-		
752  
-		/**
753  
-		 * Loads a file and returns it. 
754  
-		 * @private
755  
-		 * @param locale String The locale name where it should search the file
756  
-		 * @param bundleName String The file name to be loaded
757  
-		 * @param useCache Bool Setting this to false will force the function to reread the file. Default is true
758  
-		 * @return ResourceFile
759  
-		 */
760  
-		loadFile: function(locale, fileName, useCache){
761  
-			var localeCache = this.getLocaleCache(locale);
762  
-			useCache=(typeof useCache=='undefined')?true:useCache;
763  
-			return (useCache&&localeCache.files[fileName]) || this.createFile(locale, fileName);
764  
-		},
765  
-		
766  
-		/**
767  
-		 * Automatically discovers the available locales using the listing directory of the bundle path, 
768  
-		 * returns an array of locales
769  
-		 * @private
770  
-		 * @return StringArray
771  
-		 */
772  
-		discoverAndReturnAvailableLocales: function (){
773  
-			var folder = this.bundlePath;
774  
-			// check if the file exists and is a directory
775  
-			if(!(folder.exists&&folder.isDirectory)){
776  
-				// just die sillently, because a higher level should take care of that
777  
-				return [];
778  
-			}
779  
-			   
780  
-			var localeChain = []
781  
-			var localeFolders = folder.getDirectoryListing();
782  
-			for(var i=0, l=localeFolders.length; i<l; i++){
783  
-				var folder = localeFolders[i];
784  
-				// checking if we got a real folder
785  
-				if(folder.isDirectory){
786  
-					localeChain.push(folder.name);
787  
-				}
788  
-			}
789  
-			return localeChain;
790  
-		},
791  
-		
792  
-		
793  
-		
794  
-		/**
795  
-		 * Same as sortLocalesUsingPreferences, but this time uses the systems pref
796  
-		 * @param locales String[] List of locales to be sorted. 
797  
-		 * @param addAll Adds all the locales at the end, even though no locale is in the preferences list. Default is true
798  
-		 * @return String[]                                                                                                
799  
-		 */
800  
-		sortLocalesUsingSystemPreferences: function(locales, addAll){
801  
-			return LocaleSorter.sortLocalesUsingPreferences( locales, this.userPreference, Localizer.ultimateFallbackLocale, addAll)
802  
-		},
803  
-		
804  
-		/**
805  
-		 * Discovers locale chain the bundle path and sets the current locale chain.
806  
-		 * The function will fail silently if the locale chain has been set by the user
807  
-		 * @param fireEvent bool If true it will fire change events. Default is true
808  
-		 */
809  
-		autoDiscoverLocaleChain: function(fireEvent){
810  
-			if(this.autoLocaleChain){
811  
-				// set the new locale chain
812  
-				var oldLocaleChain = this.localeChain;
813  
-				this.localeChain = this.sortLocalesUsingSystemPreferences( this.discoverAndReturnAvailableLocales(), true);
814  
-				// remove from cache not neeed locales
815  
-				this.cleanupCache();
816  
-				if(typeof fireEvent=='undefined') fireEvent = true;
817  
-				if(fireEvent){
818  
-					this.diffChainsAndFireEvent(this.localeChain, oldLocaleChain);
819  
-				}
820  
-			}
821  
-		}, 
822  
-		
823  
-		/**
824  
-		 * Diffs two chains and returns true if they are not equal
825  
-		 * @param newChain String[]
826  
-		 * @param oldChain String[]
827  
-		 * @return String[]
828  
-		 */
829  
-		diffChains: function(newChain, oldChain){
830  
-			if(newChain.length!=oldChain.length) return true;
831  
-			for(var i=0, l=newChain.length; i<l; i++){
832  
-				if(newChain[i]!=oldChain[i]) 
833  
-					return true;
834  
-			}
835  
-			return false;
836  
-		},
837  
-		
838  
-		/**
839  
-		 * Clones a chain list
840  
-		 * @param chain String[]
841  
-		 * @return String[]
842  
-		 */   
843  
-		cloneChain: function(chain){
844  
-			var result = [];
845  
-			for(var i=0, l=chain.length; i<l; i++){
846  
-				result.push( chain[i] );
847  
-			}
848  
-			return result;
849  
-		},