Commit a443efbf858842f6b33cc629f5a2de04a701945e

Authored by Benjamin Renard
1 parent aa8bb402
Exists in minimize

Remove not used libs

Showing 81 changed files with 0 additions and 12514 deletions   Show diff stats
js/app/app.js deleted
... ... @@ -1,12 +0,0 @@
1   -/**
2   - * This file sets application-wide settings and launches the application when everything has
3   - * been loaded onto the page. By default we just render the applications Viewport inside the
4   - * launch method (see app/views/Viewport.js).
5   - */
6   -AMDA-NG4 = new Ext.Application({
7   - defaultTarget: "viewport",
8   - name: "AMDA-NG4",
9   - launch: function() {
10   - this.viewport = new AMDA-NG4.Viewport();
11   - }
12   -});
js/lib/JSBuilder/bin/Dispatch.js deleted
... ... @@ -1,37 +0,0 @@
1   -var JSBuilderPath = system.cwd + '/lib/JSBuilder/';
2   -
3   -load(JSBuilderPath + 'src/Loader.js');
4   -Loader.setBasePath(JSBuilderPath + 'src');
5   -
6   -Loader.require([
7   - 'Ext', 'Cmd', 'Filesystem', 'Platform', 'Cli', 'Logger', 'Project', 'Target', 'Package', 'Build'
8   -]);
9   -
10   -/**
11   - * @class Ext.CommandDispatcher
12   - * @extends Object
13   - * Dispaches to the relevant Cli subclass from the command line 'sencha' command. e.g.
14   - * sencha generate xyz is dispatched to whichever Ext.Cli subclass registered itself to
15   - * handler the 'generate' command (Ext.generator.Factory in this case).
16   - */
17   -Ext.CommandDispatcher = {
18   - types: {},
19   -
20   - dispatch: function(module, args) {
21   - new this.types[module]({args: args});
22   - }
23   -};
24   -
25   -Ext.regDispatchable = function(name, constructor) {
26   - Ext.CommandDispatcher.types[name] = constructor;
27   -};
28   -
29   -load('src/Generator.js');
30   -load('src/generators/app/Application.js');
31   -load('src/generators/controller/Controller.js');
32   -load('src/generators/model/Model.js');
33   -
34   -var args = system.arguments,
35   - module = args[0];
36   -
37   -Ext.CommandDispatcher.dispatch(module, args.slice(1));
38 0 \ No newline at end of file
js/lib/JSBuilder/bin/Generator.js deleted
... ... @@ -1,6 +0,0 @@
1   -load('src/Generator.js');
2   -load('src/generators/app/Application.js');
3   -load('src/generators/controller/Controller.js');
4   -load('src/generators/model/Model.js');
5   -
6   -new Ext.generator.Factory();
js/lib/JSBuilder/bin/JSBuilder.js deleted
... ... @@ -1,2 +0,0 @@
1   -load('src/JSBuilder.js');
2   -new JSBuilder();
js/lib/JSBuilder/jsdb deleted
No preview for this file type
js/lib/JSBuilder/src/Build.js deleted
... ... @@ -1,62 +0,0 @@
1   -Loader.require('Parser');
2   -
3   -Build = Ext.extend(Target, {
4   - getDefaultTarget : function() {
5   - return (this.get('id') || this.get('name').replace(/ /g, '').toLowerCase()) + '.js';
6   - },
7   -
8   - onCreate: function(file) {
9   - Build.superclass.onCreate.apply(this, arguments);
10   -
11   - var project = this.project,
12   - verbose = project.builder.get('verbose'),
13   - packages = this.get('packages') || [];
14   -
15   - if (verbose && packages.length) {
16   - Logger.log(' - ' + packages.length + ' package(s) included in this target.');
17   - }
18   -
19   - // Loop over all file includes, read the contents, and write
20   - // it to our target file
21   - packages.forEach(function(id) {
22   - var pkg = this.project.getPackageById(id),
23   - content;
24   -
25   - if (!pkg) {
26   - return true;
27   - }
28   -
29   - if (verbose) {
30   - Logger.log(' + ' + pkg.get('target'));
31   - }
32   -
33   - pkg = new Stream(pkg.get('targetPath'));
34   - content = pkg.readFile();
35   - pkg.close();
36   -
37   - file.writeln(content);
38   - return true;
39   - }, this);
40   - },
41   -
42   - afterCreate : function() {
43   - var params = Ext.apply({debug: this.get('debug'), debugLevel: 1}, this.get('options') || {});
44   -
45   - Logger.log(' * Parse ' + this.get('target') + ' with options:');
46   -
47   - Ext.iterate(params, function(n, v) {
48   - Logger.log(' - ' + n + ": " + v);
49   - });
50   -
51   - Parser.setParams(params);
52   -
53   - var filePath = this.get('targetPath');
54   - var parsedContent = Parser.parse(filePath);
55   -
56   - var file = new Stream(filePath, 'w');
57   - file.writeln(parsedContent);
58   - file.close();
59   -
60   - Build.superclass.afterCreate.apply(this);
61   - }
62   -});
js/lib/JSBuilder/src/Cli.js deleted
... ... @@ -1,140 +0,0 @@
1   -Cli = Ext.extend(Object, {
2   - map: {
3   - h: {
4   - name: 'help',
5   - desc: 'Prints this help display'
6   - }
7   - },
8   -
9   - // Override this on a subclass of Cli.
10   - // An array with a description on how to use this Cli.
11   - // Each entry in the array is printed on a new line.
12   - usage: [],
13   -
14   - constructor : function() {
15   - if (this.map !== this.superproto.map) {
16   - this.map = Ext.apply({}, this.map, this.superproto.map);
17   - }
18   -
19   - this.initArguments();
20   -
21   - try {
22   - this.run();
23   - }
24   - catch (e) {
25   - Logger.log(e);
26   - if (e.stack) {
27   - Logger.log('\n' + 'Stack trace:\n' + e.stack);
28   - }
29   - }
30   - },
31   -
32   - initArguments : function() {
33   - var args = system.arguments,
34   - ln = args.length,
35   - parsedArgs = this.args = {},
36   - curArg = null,
37   - i, arg;
38   -
39   - for (i = 0; i < ln; i++) {
40   - arg = args[i];
41   - if (arg[0] == '-') {
42   - if (arg[1] == '-') {
43   - curArg = arg.substr(2);
44   - }
45   - else if (arg.length == 2) {
46   - curArg = this.map[arg[1]] ? this.map[arg[1]].name : arg[1];
47   - }
48   - else {
49   - continue;
50   - }
51   -
52   - if (args[i + 1] && args[i + 1][0] != '-') {
53   - parsedArgs[curArg] = args[i + 1] || true;
54   - i++;
55   - }
56   - else {
57   - parsedArgs[curArg] = true;
58   - }
59   - }
60   - }
61   - },
62   -
63   - printUsage : function(message) {
64   - var map = this.map,
65   - usage = [''],
66   - i, mapping;
67   -
68   - if (!message) {
69   - usage.push(this.name + ' version ' + this.version);
70   - usage.push('Powered by Sencha Inc');
71   - usage.push('');
72   - usage.push('Available arguments:');
73   - for (i in map) {
74   - mapping = map[i];
75   - usage.push(
76   - ' --' + mapping.name + ' -' + i
77   - );
78   - usage.push(' ' + (mapping.required ? '(required)' : '(optional)') + ' ' + (mapping.desc || ''));
79   - usage.push('');
80   - }
81   - }
82   - else {
83   - usage.push(message);
84   - }
85   -
86   - usage.push('');
87   - usage = usage.concat(this.usage);
88   - usage.push('');
89   -
90   - for (i = 0; i < usage.length; i++) {
91   - Logger.log(usage[i]);
92   - }
93   - },
94   -
95   - checkRequired : function() {
96   - var args = this.args,
97   - i, req;
98   -
99   - for (i in this.map) {
100   - if (this.map[i].required && args[this.map[i].name] === undefined) {
101   - return i;
102   - }
103   - }
104   -
105   - return true;
106   - },
107   -
108   - run : function() {
109   - if (this.get('help')) {
110   - this.printUsage();
111   - return false;
112   - }
113   -
114   - var required = this.checkRequired();
115   - if (required !== true) {
116   - this.error('The --' + this.map[required].name + ' or -' + required + ' argument is required');
117   - this.printUsage();
118   - return false;
119   - }
120   - },
121   -
122   - get : function(key) {
123   - return this.args[key] || false;
124   - },
125   -
126   - set : function(key, value, ifNotExists) {
127   - if (ifNotExists && this.get(key) !== false) {
128   - return;
129   - }
130   - this.args[key] = value;
131   - },
132   -
133   - log : function(variable) {
134   - Logger.log(variable);
135   - },
136   -
137   - error : function(error) {
138   - throw error;
139   - }
140   -});
141 0 \ No newline at end of file
js/lib/JSBuilder/src/Cmd.js deleted
... ... @@ -1,11 +0,0 @@
1   -Cmd = {
2   - execute: function(cmd) {
3   - if (Platform.isWindows) {
4   - var stream = new Stream('exec://' + cmd);
5   - stream.close();
6   - }
7   - else {
8   - system.execute(cmd);
9   - }
10   - }
11   -};
12 0 \ No newline at end of file
js/lib/JSBuilder/src/Ext.js deleted
... ... @@ -1,267 +0,0 @@
1   -Ext = {
2   - /**
3   - * Copies all the properties of config to obj.
4   - * @param {Object} object The receiver of the properties
5   - * @param {Object} config The source of the properties
6   - * @param {Object} defaults A different object that will also be applied for default values
7   - * @return {Object} returns obj
8   - * @member Ext apply
9   - */
10   - apply : function(object, config, defaults) {
11   - // no "this" reference for friendly out of scope calls
12   - if (defaults) {
13   - Ext.apply(object, defaults);
14   - }
15   - if (object && config && typeof config == 'object') {
16   - for (var key in config) {
17   - object[key] = config[key];
18   - }
19   - }
20   - return object;
21   - },
22   -
23   - /**
24   - * Copies all the properties of config to obj if they don't already exist.
25   - * @param {Object} obj The receiver of the properties
26   - * @param {Object} config The source of the properties
27   - * @return {Object} returns obj
28   - */
29   - applyIf : function(object, config) {
30   - var property, undefined;
31   - if (object) {
32   - for (property in config) {
33   - if (object[property] === undefined) {
34   - object[property] = config[property];
35   - }
36   - }
37   - }
38   - return object;
39   - },
40   -
41   - /**
42   - * <p>Extends one class to create a subclass and optionally overrides members with the passed literal. This method
43   - * also adds the function "override()" to the subclass that can be used to override members of the class.</p>
44   - * @param {Function} superclass The constructor of class being extended.
45   - * @param {Object} overrides <p>A literal with members which are copied into the subclass's
46   - * prototype, and are therefore shared between all instances of the new class.</p>
47   - * <p>This may contain a special member named <tt><b>constructor</b></tt>. This is used
48   - * to define the constructor of the new class, and is returned. If this property is
49   - * <i>not</i> specified, a constructor is generated and returned which just calls the
50   - * superclass's constructor passing on its parameters.</p>
51   - * <p><b>It is essential that you call the superclass constructor in any provided constructor. See example code.</b></p>
52   - * @return {Function} The subclass constructor from the <code>overrides</code> parameter, or a generated one if not provided.
53   - */
54   - extend : function() {
55   - // inline overrides
56   - var inlineOverrides = function(o){
57   - for(var m in o){
58   - this[m] = o[m];
59   - }
60   - };
61   -
62   - var objectConstructor = Object.prototype.constructor;
63   -
64   - return function(subclass, superclass, overrides){
65   - // First we check if the user passed in just the superClass with overrides
66   - if(Ext.isObject(superclass)){
67   - overrides = superclass;
68   - superclass = subclass;
69   - subclass = overrides.constructor != objectConstructor
70   - ? overrides.constructor
71   - : function(){
72   - superclass.apply(this, arguments);
73   - };
74   - }
75   -
76   - // We create a new temporary class
77   - var F = function(){},
78   - subclassProto,
79   - superclassProto = superclass.prototype;
80   -
81   - F.prototype = superclassProto;
82   - subclassProto = subclass.prototype = new F();
83   - subclassProto.constructor = subclass;
84   - subclass.superclass = superclassProto;
85   -
86   - if(superclassProto.constructor == objectConstructor){
87   - superclassProto.constructor = superclass;
88   - }
89   -
90   - subclass.override = function(overrides){
91   - Ext.override(subclass, overrides);
92   - };
93   -
94   - subclassProto.superclass = subclassProto.supr = (function(){
95   - return superclassProto;
96   - });
97   -
98   - subclassProto.override = inlineOverrides;
99   - subclassProto.proto = subclassProto;
100   - subclassProto.superproto = superclassProto;
101   -
102   - subclass.override(overrides);
103   - subclass.extend = function(o){
104   - return Ext.extend(subclass, o);
105   - };
106   -
107   - return subclass;
108   - };
109   - }(),
110   -
111   - /**
112   - * Adds a list of functions to the prototype of an existing class, overwriting any existing methods with the same name.
113   - * @param {Object} origclass The class to override
114   - * @param {Object} overrides The list of functions to add to origClass. This should be specified as an object literal
115   - * containing one or more methods.
116   - * @method override
117   - */
118   - override : function(origclass, overrides) {
119   - if (overrides) {
120   - Ext.apply(origclass.prototype, overrides);
121   - }
122   - },
123   -
124   - /**
125   - * <p>Returns true if the passed value is empty.</p>
126   - * <p>The value is deemed to be empty if it is<div class="mdetail-params"><ul>
127   - * <li>null</li>
128   - * <li>undefined</li>
129   - * <li>an empty array</li>
130   - * <li>a zero length string (Unless the <tt>allowBlank</tt> parameter is <tt>true</tt>)</li>
131   - * </ul></div>
132   - * @param {Mixed} value The value to test
133   - * @param {Boolean} allowBlank (optional) true to allow empty strings (defaults to false)
134   - * @return {Boolean}
135   - */
136   - isEmpty : function(v, allowBlank) {
137   - return v == null || ((Ext.isArray(v) && !v.length)) || (!allowBlank ? v === '' : false);
138   - },
139   -
140   - /**
141   - * Returns true if the passed value is a JavaScript array, otherwise false.
142   - * @param {Mixed} value The value to test
143   - * @return {Boolean}
144   - */
145   - isArray : function(v) {
146   - return Object.prototype.toString.apply(v) === '[object Array]';
147   - },
148   -
149   - /**
150   - * Returns true if the passed object is a JavaScript date object, otherwise false.
151   - * @param {Object} object The object to test
152   - * @return {Boolean}
153   - */
154   - isDate : function(v) {
155   - return Object.prototype.toString.apply(v) === '[object Date]';
156   - },
157   -
158   - /**
159   - * Returns true if the passed value is a JavaScript Object, otherwise false.
160   - * @param {Mixed} value The value to test
161   - * @return {Boolean}
162   - */
163   - isObject : function(v) {
164   - return !!v && Object.prototype.toString.call(v) === '[object Object]';
165   - },
166   -
167   - /**
168   - * Returns true if the passed value is a JavaScript 'primitive', a string, number or boolean.
169   - * @param {Mixed} value The value to test
170   - * @return {Boolean}
171   - */
172   - isPrimitive : function(v) {
173   - return Ext.isString(v) || Ext.isNumber(v) || Ext.isBoolean(v);
174   - },
175   -
176   - /**
177   - * Returns true if the passed value is a JavaScript Function, otherwise false.
178   - * @param {Mixed} value The value to test
179   - * @return {Boolean}
180   - */
181   - isFunction : function(v) {
182   - return Object.prototype.toString.apply(v) === '[object Function]';
183   - },
184   -
185   - /**
186   - * Returns true if the passed value is a number. Returns false for non-finite numbers.
187   - * @param {Mixed} value The value to test
188   - * @return {Boolean}
189   - */
190   - isNumber : function(v) {
191   - return Object.prototype.toString.apply(v) === '[object Number]' && isFinite(v);
192   - },
193   -
194   - /**
195   - * Returns true if the passed value is a string.
196   - * @param {Mixed} value The value to test
197   - * @return {Boolean}
198   - */
199   - isString : function(v) {
200   - return Object.prototype.toString.apply(v) === '[object String]';
201   - },
202   -
203   - /**util
204   - * Returns true if the passed value is a boolean.
205   - * @param {Mixed} value The value to test
206   - * @return {Boolean}
207   - */
208   - isBoolean : function(v) {
209   - return Object.prototype.toString.apply(v) === '[object Boolean]';
210   - },
211   -
212   - /**
213   - * Returns true if the passed value is not undefined.
214   - * @param {Mixed} value The value to test
215   - * @return {Boolean}
216   - */
217   - isDefined : function(v){
218   - return typeof v !== 'undefined';
219   - },
220   -
221   - each : function(array, fn, scope) {
222   - if (Ext.isEmpty(array, true)) {
223   - return 0;
224   - }
225   - if (!Ext.isIterable(array) || Ext.isPrimitive(array)) {
226   - array = [array];
227   - }
228   - for (var i = 0, len = array.length; i < len; i++) {
229   - if (fn.call(scope || array[i], array[i], i, array) === false) {
230   - return i;
231   - }
232   - }
233   - return true;
234   - },
235   -
236   - iterate : function(obj, fn, scope) {
237   - if (Ext.isEmpty(obj)) {
238   - return;
239   - }
240   - if (Ext.isIterable(obj)) {
241   - Ext.each(obj, fn, scope);
242   - return;
243   - }
244   - else if (Ext.isObject(obj)) {
245   - for (var prop in obj) {
246   - if (obj.hasOwnProperty(prop)) {
247   - if (fn.call(scope || obj, prop, obj[prop], obj) === false) {
248   - return;
249   - }
250   - }
251   - }
252   - }
253   - },
254   -
255   - isIterable : function(v) {
256   - //check for array or arguments
257   - if (Ext.isArray(v) || v.callee) {
258   - return true;
259   - }
260   - },
261   -
262   - $included: {},
263   -
264   - require: function(className) {
265   -
266   - }
267   -}
268 0 \ No newline at end of file
js/lib/JSBuilder/src/Filesystem.js deleted
... ... @@ -1,111 +0,0 @@
1   -Filesystem = {
2   - exists : function(path) {
3   - return system.exists(path);
4   - },
5   -
6   - getFullPath: function(path) {
7   - var currentPath = system.setcwd(path);
8   - return system.setcwd(currentPath);
9   - },
10   -
11   - getPath: function(path){
12   - return path.replace(/\//g, Fs.sep);
13   - },
14   -
15   - mkdir: function(path) {
16   - if (Platform.isWindows) {
17   - system.mkdir(path);
18   - }
19   - else {
20   - Cmd.execute('mkdir -p ' + path);
21   - }
22   - return this.getFullPath(path);
23   - },
24   -
25   - readFile : function(file) {
26   - if (!Fs.exists(file)) {
27   - return '';
28   - }
29   -
30   - file = new Stream(file);
31   - var contents = file.readFile();
32   - file.close();
33   -
34   - return contents;
35   - },
36   -
37   - writeFile: function(file, contents) {
38   - file = new Stream(file, 'w');
39   - file.writeln(contents);
40   - file.close();
41   -
42   - return contents;
43   - },
44   -
45   - copy: function(src, dest) {
46   - src = Fs.getPath(src);
47   - dest = Fs.getPath(dest);
48   -
49   - if (Platform.isWindows) {
50   - if (Fs.endsWith(src, Fs.sep)) {
51   - src = src.slice(0, -1); // cut off any trailing \
52   - }
53   -
54   - /**
55   - * Check if we're copying a single file. This isn't bulletproof, however xcopy
56   - * will prompt regarding if the item is a directory or file, with no way to
57   - * suppress the prompt. As such, this will catch a majority of scenarios
58   - * and actually make the build work!
59   - */
60   - var isFile = /\.[0-9a-z]{2,4}$/i;
61   - if (isFile.test(src)) {
62   - system.copy(src, dest);
63   - } else {
64   - Cmd.execute('xcopy ' + src + ' ' + dest + ' /E /Y /I');
65   - }
66   - }
67   - else {
68   - try {
69   - // q: quiet
70   - // r: recursive
71   - // u: only update if newer
72   - // p: keep permissions
73   - // L: copy the contents of symlinks
74   - Cmd.execute('rsync -qrupL ' + src + ' ' + dest);
75   - }
76   - catch(e) {
77   - Cmd.execute('cp -Rpf ' + src + ' ' + dest);
78   - }
79   - }
80   - },
81   -
82   - endsWith: function(str, last){
83   - return str.lastIndexOf(last) == str.length - 1;
84   - },
85   -
86   - split: function(file) {
87   - var split = [];
88   - if (!Fs.exists(file)) {
89   - return split;
90   - }
91   - file = new Stream(file);
92   - while (!file.eof) {
93   - split.push(file.readln().trim());
94   - }
95   - return split;
96   - },
97   -
98   - remove: function(file) {
99   - if (Platform.isWindows) {
100   - Cmd.execute('del /f /q "' + file + '"');
101   - } else {
102   - Cmd.execute('rm -Rf "' + file + '"');
103   - }
104   - }
105   -};
106   -
107   -// Create short alias
108   -Fs = Filesystem;
109   -
110   -Fs.sep = (Fs.getFullPath('.')[0] == '/') ? '/': '\\';
111   -Fs.fileWorkingDir = Fs.getFullPath('.');
js/lib/JSBuilder/src/Generator.js deleted
... ... @@ -1,203 +0,0 @@
1   -load(JSBuilderPath + 'src/Template.js');
2   -load(JSBuilderPath + 'src/XTemplate.js');
3   -
4   -Ext.generator = {};
5   -
6   -/**
7   - * @class Ext.generator.Base
8   - * @extends Object
9   - * Base class for all Generators
10   - */
11   -Ext.generator.Base = Ext.extend(Object, {
12   - /**
13   - * @cfg {Boolean} pretend True to only output what the generator would do (e.g. which files would be created),
14   - * without actually modifying anything on the filesystem.
15   - */
16   - pretend: false,
17   -
18   - basePath: '.',
19   -
20   - constructor: function(config) {
21   - Ext.apply(this, config);
22   -
23   - if (this.args) {
24   - this.decodeArgs(this.args);
25   - }
26   - },
27   -
28   - /**
29   - * Creates an empty directory at the given location
30   - * @param {String} path The directory path
31   - */
32   - mkdir: function() {
33   - var length = arguments.length,
34   - dirName, i;
35   -
36   - for (i = 0; i < length; i++) {
37   - dirName = this.basePath + "/" + arguments[i];
38   - Logger.log(" Creating dir: " + dirName);
39   -
40   - if (!this.pretend) {
41   - Filesystem.mkdir(dirName);
42   - }
43   - }
44   - },
45   -
46   - /**
47   - * Applies data to an XTemplate, saving its output to the given file name
48   - * @param {String} name The name of the template
49   - */
50   - template: function(name, data, filename) {
51   - Logger.log(" Creating file: " + filename);
52   -
53   - // dirty hack to let <tpl> get through without being picked up
54   - Ext.apply(data, {
55   - tpl: 'tpl'
56   - });
57   -
58   - var name = 'src/generators/' + this.dirName + '/templates/' + name + '.js',
59   - stream = new Stream(name, 'rw'),
60   - template = new Ext.XTemplate(stream.readText()),
61   - contents = template.apply(data),
62   - destination = this.basePath + '/' + filename,
63   - newFile = new Stream(destination, "w");
64   -
65   - newFile.writeLine(contents);
66   - system.move(destination, filename, true);
67   - newFile.close();
68   - },
69   -
70   - /**
71   - * Copies a file from the generator's files directory into the app
72   - * @param {String} fileName The name of the file to copy
73   - * @param {String} destination The destination path (defaults to the fileName)
74   - * @param {Boolean} silent True to not log any messages (defaults to false)
75   - */
76   - file: function(fileName, destination, silent) {
77   - Logger.log(" Copying " + fileName);
78   -
79   - destination = this.basePath + '/' + (destination || fileName);
80   - fileName = 'src/generators/' + this.dirName + '/files/' + fileName;
81   -
82   - if (!this.pretend && this.silent !== true) {
83   - Filesystem.copy(fileName, destination);
84   - }
85   - },
86   -
87   - /**
88   - * Copies all contents of the given source directory to a destination
89   - * @param {String} dirName The name of the directory to copy
90   - * @param {String} destination The destination for the source files
91   - */
92   - copyDir: function(dirName, destination) {
93   - destination = this.basePath + '/' + (destination || dirName);
94   -
95   - if (!this.pretend) {
96   - Filesystem.copy(dirName, destination);
97   - }
98   - },
99   -
100   - /**
101   - * Inserts a script tag to load the given src file inside the given div id
102   - * @param {String} path The path to the script to be included
103   - * @param {String} id The id of the div to include after
104   - * @param {String} htmlFile Optional html file to update (defaults to index.html)
105   - */
106   - insertInclude: function(path, id, htmlFile) {
107   - htmlFile = htmlFile || 'index.html';
108   -
109   - var stream = new Stream(htmlFile, 'rw'),
110   - regex = new RegExp('<div id="' + id + '">'),
111   - lines = [],
112   - line;
113   -
114   - while (line = stream.readLine()) {
115   - lines.push(line);
116   -
117   - if (regex.test(line)) {
118   - lines.push(' <script type="text/javascript" src="' + path + '"></script>');
119   - }
120   - }
121   -
122   - var destination = htmlFile + "-modified",
123   - newFile = new Stream(destination, "w");
124   -
125   - newFile.writeLine(lines.join("\n"));
126   - system.move(destination, htmlFile, true);
127   - newFile.close();
128   - },
129   -
130   - /**
131   - * Convenience function for displaying a clear message to the user
132   - * @param {String} message The message to display
133   - */
134   - headline: function(message) {
135   - Logger.log("");
136   - Logger.log("*********************************************");
137   - Logger.log(message);
138   - Logger.log("*********************************************");
139   - Logger.log("");
140   - },
141   -
142   - generate: function() {
143   -
144   - }
145   -});
146   -
147   -/**
148   - * @class GeneratorHelper
149   - * @extends Cli
150   - * Generates files and folders based on a template
151   - */
152   -Ext.generator.Factory = Ext.extend(Object, {
153   - name: "Generator",
154   - version: "0.0.1",
155   -
156   - constructor: function(config) {
157   - Ext.apply(this, config);
158   -
159   - Cli.call(this);
160   - },
161   -
162   - initArguments: function() {},
163   -
164   - usage: [
165   - 'Example usage:',
166   - 'Arguments in square brackets are optional',
167   - '',
168   - 'Generating an application:',
169   - ' ./generate app AppName [../path/to/app]',
170   - '',
171   - 'Generating a model:',
172   - ' ./generate model User id:int name:string active:boolean',
173   - '',
174   - 'Generating a controller:',
175   - ' ./generate controller users create update destroy',
176   - ''
177   - ],
178   -
179   - run: function() {
180   - var args = this.args || system.arguments,
181   - Gen = Ext.generator.Factory.types[args[0]];
182   -
183   - if (Gen) {
184   - new Gen({args: args.slice(1)}).generate();
185   - } else {
186   - this.printUsage();
187   - }
188   - }
189   -});
190   -
191   -Ext.generator.Factory.types = {};
192   -Ext.regGenerator = function(name, constructor) {
193   - Ext.generator.Factory.types[name] = constructor;
194   -
195   - constructor.prototype.dirName = name;
196   - constructor.templates = {};
197   -};
198   -
199   -Ext.regDispatchable('generate', Ext.generator.Factory);
200   -
201   -// generate app FB examples/facebook
202   -// generate model User id:int name:string email:string
203   -// generate controller users index build show new
204 0 \ No newline at end of file
js/lib/JSBuilder/src/JSBuilder.js deleted
... ... @@ -1,77 +0,0 @@
1   -var JSBuilderPath = system.script.replace(/bin(\/|\\)JSBuilder\.js/, '');
2   -
3   -load(JSBuilderPath + 'src/Loader.js');
4   -Loader.setBasePath(JSBuilderPath + 'src');
5   -
6   -Loader.require([
7   - 'Ext', 'Cmd', 'Filesystem', 'Platform', 'Cli', 'Logger', 'Project', 'Target', 'Package', 'Build'
8   -]);
9   -
10   -/**
11   - * @class JSBuilder
12   - */
13   -JSBuilder = Ext.extend(Cli, {
14   - name: 'JSBuilder',
15   - version: '3.0.0',
16   -
17   - map: {
18   - p: {
19   - name: 'projectFile',
20   - required: true,
21   - desc: 'Location of a jsb2 project file'
22   - },
23   - d: {
24   - name: 'deployDir',
25   - required: true,
26   - desc: 'The directory to build the project to'
27   - },
28   - v: {
29   - name: 'verbose',
30   - desc: 'Output detailed information about what is being built'
31   - },
32   - s: {
33   - name: 'debugSuffix',
34   - desc: 'Suffix to append to JS debug targets, defaults to \'debug\''
35   - },
36   - c: {
37   - name: 'nocompress',
38   - desc: 'Dont compress the targets'
39   - }
40   - },
41   -
42   - usage: [
43   - 'Example Usage:',
44   - '',
45   - 'Windows:',
46   - 'JSBuilder.bat -p C:\\Apps\\www\\ext3svn\\ext.jsb2 -d C:\\Apps\\www\\deploy\\',
47   - '',
48   - 'Linux and OS X:',
49   - 'JSBuilder.sh -p /home/tommy/www/trunk/ext.jsb2 -d /home/tommy/www/deploy/',
50   - '',
51   - 'JSBuilder3 is a Sencha Project build tool.',
52   - 'For additional information, see http://www.sencha.com/products/jsbuilder/'
53   - ],
54   -
55   - run : function() {
56   - if (JSBuilder.superclass.run.call(this) === false) {
57   - return;
58   - }
59   -
60   - // true to only set if it is not defined
61   - this.set('debugSuffix', '-debug', true);
62   -
63   - this.project = new Project(this.get('projectFile'), this);
64   -
65   - if (this.get('sourceFiles')) {
66   - this.project.getSourceFiles();
67   - } else if (this.get('specFiles')) {
68   - this.project.getSpecFiles();
69   - } else {
70   - this.log('\nLoading the ' + this.project.get('name') + ' Project');
71   - this.log('Loaded ' + this.project.get('packages').length + ' Packages');
72   - this.log('Loaded ' + this.project.get('builds').length + ' Builds');
73   -
74   - this.project.build();
75   - }
76   - }
77   -});
78 0 \ No newline at end of file
js/lib/JSBuilder/src/Loader.js deleted
... ... @@ -1,74 +0,0 @@
1   -(function(ROOT) {
2   -
3   -var Loader = ROOT.Loader = {
4   - paths: {
5   - _base: "."
6   - },
7   -
8   - existing: {},
9   -
10   - exists: function(name) {
11   - var root = ROOT;
12   - var chunks = name.split('.');
13   -
14   - for (var i = 0; i < chunks.length; i++) {
15   - if (!root.hasOwnProperty(chunks[i]))
16   - return false;
17   -
18   - root = root[chunks[i]];
19   - }
20   -
21   - return true;
22   - },
23   -
24   - setBasePath: function(name, path) {
25   - if (!path) {
26   - path = name;
27   - name = "_base";
28   - }
29   -
30   - Loader.paths[name] = path;
31   - },
32   -
33   - getBasePath: function(name) {
34   - // Start with the base path
35   - var path = Loader.paths._base;
36   -
37   - // Iterate through each specified name path ("Ext.layout.Layout" => "js/Ext/layout/Layout.js")
38   - for (var stub in Loader.paths) {
39   - if (stub === name.substring(0, stub.length)) {
40   - path += "/" + Loader.paths[stub];
41   - // Remove stub from name, as we've already pathed it
42   - name = name.substring(stub.length + 1);
43   - break;
44   - }
45   - }
46   -
47   - return path + "/" + name.replace(/\./g, "/");
48   - },
49   -
50   - require: function(names, compulsory) {
51   - if (compulsory == undefined)
52   - compulsory = true;
53   -
54   - if (typeof names == 'string')
55   - names = [names];
56   -
57   - names.forEach(function(name) {
58   - if (!this.existing.hasOwnProperty(name)) {
59   -// writeln(this.getBasePath(name) + '.js');
60   - load(this.getBasePath(name) + '.js');
61   -
62   - var loaded = this.exists(name);
63   - this.existing[name] = loaded;
64   - }
65   -
66   - if (this.existing[name] == false && compulsory) {
67   - throw new Error("[Loader] Failed loading '" + name + "'");
68   - }
69   - }, Loader);
70   - }
71   -};
72   -
73   -})(this);
74   -
js/lib/JSBuilder/src/Logger.js deleted
... ... @@ -1,8 +0,0 @@
1   -Logger = {
2   - /**
3   - * Logs the variable to the command line
4   - */
5   - log: function(variable) {
6   - writeln(variable);
7   - }
8   -};
9 0 \ No newline at end of file
js/lib/JSBuilder/src/Package.js deleted
... ... @@ -1,5 +0,0 @@
1   -Package = Ext.extend(Target, {
2   - getDefaultTarget : function() {
3   - return 'pkgs' + Fs.sep + (this.get('id') || this.get('name').replace(/ /g, '').toLowerCase()) + '.js';
4   - }
5   -});
6 0 \ No newline at end of file
js/lib/JSBuilder/src/Parser.js deleted
... ... @@ -1,156 +0,0 @@
1   -// Singleton
2   -Parser = new(Ext.extend(Object, {
3   - params: {},
4   -
5   - parse: function(filename) {
6   - var stream = new Stream(filename),
7   - ret;
8   -
9   - Loader.require('Parser.Statement');
10   - ret = (new Parser.Statement()).parse(stream);
11   - stream.close();
12   -
13   - return ret;
14   - },
15   -
16   - evaluate: function(name, value) {
17   - var modifier = null,
18   - param = (this.params.hasOwnProperty(name)) ? this.params[name] : false,
19   - match;
20   -
21   - if (value === undefined) {
22   - value = true;
23   - }
24   -
25   - if (Ext.isString(value)) {
26   - match = value.match(/^(\!|<=|>=|<|>)/);
27   -
28   - if (match) {
29   - modifier = match[0];
30   - value = value.slice(modifier.length);
31   - }
32   -
33   - // Boolean
34   - if (value === 'true') {
35   - value = true;
36   - }
37   - else if (value === 'false') {
38   - value = false;
39   - }
40   - // Numeric
41   - else if (!isNaN(value)) {
42   - value = parseFloat(value);
43   - }
44   - }
45   -
46   - switch (modifier) {
47   - case '!':
48   - return (param !== value);
49   - case '>':
50   - return (param > value);
51   - case '<':
52   - return (param < value);
53   - case '<=':
54   - return (param <= value);
55   - case '>=':
56   - return (param >= value);
57   - default:
58   - return (param === value);
59   - }
60   - },
61   -
62   - setParams: function(params) {
63   - this.params = params || {};
64   - },
65   -
66   - isCloseOf: function(str, statement) {
67   - if (!statement.type) {
68   - return false;
69   - }
70   -
71   - return str.trim().match(new RegExp("^\\/\\/(?:\\t|\\s)*<\\/" + ((statement.isInverted) ? "!" : "") + statement.type + ">$")) !== null;
72   - },
73   -
74   - isStatement: function(str) {
75   - return this.parseStatementParts(str) !== null;
76   - },
77   -
78   - parseStatementParts: function(str) {
79   - return str.trim().match(/^\/\/(?:\t|\s)*<([^\/]+)>$/);
80   - },
81   -
82   - parseStatementProperties: function(str) {
83   - var properties = {},
84   - expect = function(regexp) {
85   - var result = str.match(regexp);
86   -
87   - if (result !== null) {
88   - str = str.slice(result[0].length);
89   - return result[0];
90   - }
91   -
92   - return null;
93   - },
94   - name, equalSign, valueWrapper, valueCheck, value;
95   -
96   - while (str.length > 0) {
97   - expect(/^[^\w]+/i);
98   - name = expect(/^[\w]+/i);
99   -
100   - if (name === null) {
101   - break;
102   - }
103   -
104   - equalSign = expect(/^=/);
105   -
106   - if (equalSign === null) {
107   - properties[name] = true;
108   - continue;
109   - }
110   -
111   - valueWrapper = expect(/^('|")/i);
112   - valueCheck = valueWrapper || "\\s";
113   -
114   - value = expect(new RegExp('^[^' + valueCheck + ']+'));
115   -
116   - if (valueWrapper !== null) {
117   - expect(new RegExp(valueWrapper));
118   - }
119   -
120   - properties[name] = value;
121   - }
122   -
123   - return properties;
124   - },
125   -
126   - parseStatement: function(string) {
127   - var str = string.trim(),
128   - parts = this.parseStatementParts(str),
129   - typeMatch, statement;
130   -
131   - // Check if it's actually a valid statement
132   - if (parts === null) {
133   - return false;
134   - }
135   -
136   - str = parts[1];
137   -
138   - typeMatch = str.match(/^(\!)?([\w]+)/i);
139   -
140   - if (typeMatch === null) {
141   - return false;
142   - }
143   -
144   - statement = {
145   - properties: {}
146   - };
147   -
148   - statement.type = typeMatch[2];
149   - statement.isInverted = (typeMatch[1] !== undefined);
150   -
151   - str = str.substr(typeMatch[0].length, str.length).trim();
152   - statement.properties = this.parseStatementProperties(str);
153   -
154   - return statement;
155   - }
156   -}));
js/lib/JSBuilder/src/Parser.old.js deleted
... ... @@ -1,116 +0,0 @@
1   -Parser = {
2   - isBuild: function(builds) {
3   - return builds.split('|').indexOf(this.build) != -1;
4   - },
5   -
6   - parse: function(file, build) {
7   - var line,
8   - trimmed,
9   - o = this.output = [];
10   -
11   - this.build = build;
12   -
13   - file = new Stream(file);
14   - while (!file.eof) {
15   - line = file.readLine();
16   - trimmed = line.trim();
17   - if (this.isStatement(trimmed)) {
18   - this.handleStatement(this.parseStatement(trimmed), file);
19   - }
20   - else {
21   - this.output.push(line);
22   - this.checkExtraComma();
23   - }
24   - }
25   - file.close();
26   - return this.output.join('\n');
27   - },
28   -
29   - checkExtraComma: function() {
30   - var output = this.output,
31   - ln = output.length - 1,
32   - line = output[ln],
33   - trimmed = line.trim(),
34   - prevLine;
35   -
36   - if (trimmed[0] == '}') {
37   - while (output[--ln].trim() == '') {
38   - output.splice(ln, 1);
39   - }
40   - prevLine = output[ln];
41   - if (prevLine.trim().slice( - 1) == ',') {
42   - output[ln] = prevLine.slice(0, prevLine.lastIndexOf(','));
43   - }
44   - }
45   - },
46   -
47   - isStatement: function(line) {
48   - return line.substr(0, 3) == '//[' && line.substr( - 1) == ']';
49   - },
50   -
51   - handleStatement: function(statement, file) {
52   - switch (statement.type) {
53   - case 'if':
54   - case 'elseif':
55   - this.handleIf(file, statement.condition);
56   - break;
57   -
58   - case 'else':
59   - this.handleElse(file);
60   - break;
61   - }
62   - },
63   -
64   - parseStatement: function(statement) {
65   - var parts = statement.substring(3, statement.length - 1).split(' ');
66   - return {
67   - type: parts[0],
68   - condition: parts[1]
69   - };
70   - },
71   -
72   - handleIf: function(file, condition) {
73   - if (this.isBuild(condition)) {
74   - var next = this.getNextStatement(file);
75   - this.output.push(next.buffer);
76   - this.toEndIf(file, next);
77   - }
78   - else {
79   - this.handleStatement(this.getNextStatement(file), file);
80   - }
81   - },
82   -
83   - handleElse: function(file) {
84   - var next = this.toEndIf(file);
85   - this.output.push(next.buffer);
86   - },
87   -
88   - toEndIf: function(file, next) {
89   - next = next || this.getNextStatement(file);
90   - while (next && next.type != 'endif') {
91   - next = this.getNextStatement(file);
92   - }
93   - return next;
94   - },
95   -
96   - getNextStatement: function(file) {
97   - var buffer = [],
98   - line,
99   - trimmed,
100   - ret;
101   -
102   - while (!file.eof) {
103   - line = file.readLine();
104   - trimmed = line.trim();
105   - if (!this.isStatement(trimmed)) {
106   - buffer.push(line);
107   - }
108   - else {
109   - ret = this.parseStatement(trimmed);
110   - ret.buffer = buffer.join('\n');
111   - return ret;
112   - }
113   - }
114   - return null;
115   - }
116   -};
117 0 \ No newline at end of file
js/lib/JSBuilder/src/Parser/Statement.js deleted
... ... @@ -1,103 +0,0 @@
1   -Loader.require('Logger');
2   -
3   -Parser.Statement = Ext.extend(Object, {
4   - isInverted: false,
5   - properties: {},
6   - buffer: '',
7   - parent: null,
8   -
9   - constructor: function(properties, isInverted) {
10   - if (properties === undefined) {
11   - properties = {};
12   - }
13   -
14   - if (isInverted === undefined) {
15   - isInverted = false;
16   - }
17   -
18   - this.properties = properties;
19   - this.isInverted = isInverted;
20   - },
21   -
22   - setProperty: function(name, value) {
23   - this.properties[name] = value;
24   - },
25   -
26   - getProperty: function(name) {
27   - return this.properties.hasOwnProperty(name) ? this.properties[name] : null;
28   - },
29   -
30   - removeProperty: function(name) {
31   - delete this.properties[name];
32   - },
33   -
34   - isEnd: function(line, stream) {
35   - return Parser.isCloseOf(line, this);
36   - },
37   -
38   - pushBuffer: function(content, withNewLine) {
39   - if (withNewLine === undefined) {
40   - withNewLine = false;
41   - }
42   -
43   - this.buffer += content + ((withNewLine) ? "\n" : "");
44   - },
45   -
46   - resetBuffer: function() {
47   - this.buffer = '';
48   - },
49   -
50   - parse: function(stream) {
51   - var line, subStatementData, subStatement;
52   -
53   - while (!stream.eof) {
54   - line = stream.readLine();
55   -
56   - if (this.isEnd(line, stream)) {
57   - break;
58   - }
59   -
60   - if ((subStatementData = Parser.parseStatement(line)) && (subStatement = Parser.Statement.factory(subStatementData))) {
61   - subStatement.parent = this;
62   - this.onSubStatement(subStatement, stream);
63   - } else {
64   - this.pushBuffer(line, !stream.eof);
65   - }
66   - }
67   -
68   - return this.buffer;
69   - },
70   -
71   - onSubStatement: function(statement, stream) {
72   - this.pushBuffer(statement.parse(stream));
73   - }
74   -});
75   -
76   -Ext.apply(Parser.Statement, {
77   - factory: function(type, properties, isInverted) {
78   - var capitalizedType, statementClass, statement;
79   -
80   - if (Ext.isObject(type)) {
81   - properties = type.properties;
82   - isInverted = type.isInverted;
83   - type = type.type;
84   - }
85   -
86   - type = type.toLowerCase();
87   - capitalizedType = type.charAt(0).toUpperCase() + type.slice(1);
88   -
89   - Loader.require('Parser.Statement.' + capitalizedType, false);
90   - statementClass = Parser.Statement[capitalizedType];
91   -
92   - if (!statementClass) {
93   - // Not supported
94   - Logger.log("[NOTICE][Parser.Statement.factory] Statement type '" + type + "' is currently not supported, ignored");
95   - return false;
96   - }
97   -
98   - statement = new statementClass(properties, isInverted);
99   - statement.type = type;
100   -
101   - return statement;
102   - }
103   -});
js/lib/JSBuilder/src/Parser/Statement/Debug.js deleted
... ... @@ -1,38 +0,0 @@
1   -Loader.require('Parser.Statement.If');
2   -
3   -(function() {
4   -
5   -var priorities = {
6   - error: 3,
7   - warn: 2,
8   - info: 1
9   -};
10   -
11   -var Debug = Parser.Statement.Debug = Ext.extend(Parser.Statement.If, {
12   - constructor: function() {
13   - var priority, name;
14   -
15   - Debug.superclass.constructor.apply(this, arguments);
16   -
17   - this.setProperty('debug', true);
18   -
19   - for (name in priorities) {
20   - if (priorities.hasOwnProperty(name)) {
21   - if (this.getProperty(name)) {
22   - priority = priorities[name];
23   - this.removeProperty(name);
24   - break;
25   - }
26   - }
27   - }
28   -
29   - if (!priority) {
30   - priority = 1;
31   - }
32   -
33   - this.setProperty('debugLevel', '<=' + priority);
34   - }
35   -});
36   -
37   -
38   -})();
js/lib/JSBuilder/src/Parser/Statement/Deprecated.js deleted
... ... @@ -1,14 +0,0 @@
1   -Loader.require('Parser.Statement.If');
2   -
3   -Parser.Statement.Deprecated = Ext.extend(Parser.Statement.If, {
4   - constructor: function() {
5   - Parser.Statement.Deprecated.superclass.constructor.apply(this, arguments);
6   -
7   - if (this.getProperty('since') === null) {
8   - throw new Error("[Parser.Statement.Deprecated] 'since' property is required for deprecated statement");
9   - }
10   -
11   - this.setProperty('minVersion', '<=' + this.getProperty('since'));
12   - this.removeProperty('since');
13   - }
14   -});
js/lib/JSBuilder/src/Parser/Statement/Else.js deleted
... ... @@ -1,10 +0,0 @@
1   -Parser.Statement.Else = Ext.extend(Parser.Statement, {
2   - isEnd: function(line, stream) {
3   - if (this.parent.isEnd.apply(this.parent, arguments)) {
4   - stream.goBack(line.length + 1);
5   - return true;
6   - }
7   -
8   - return false;
9   - }
10   -});
11 0 \ No newline at end of file
js/lib/JSBuilder/src/Parser/Statement/Elseif.js deleted
... ... @@ -1,22 +0,0 @@
1   -Parser.Statement.Elseif = Ext.extend(Parser.Statement.If, {
2   - isEnd: function(line, stream) {
3   - var statement,
4   - isEnd = false;
5   -
6   - statement = Parser.parseStatement(line);
7   -
8   - if (statement) {
9   - if (statement.type === 'elseif' || statement.type === 'else') {
10   - isEnd = true;
11   - }
12   - } else if (this.parent.isEnd.apply(this.parent, arguments)) {
13   - isEnd = true;
14   - }
15   -
16   - if (isEnd) {
17   - stream.goBack(line.length + 1);
18   - }
19   -
20   - return isEnd;
21   - }
22   -});
js/lib/JSBuilder/src/Parser/Statement/If.js deleted
... ... @@ -1,57 +0,0 @@
1   -Parser.Statement.If = Ext.extend(Parser.Statement, {
2   - satisfied: false,
3   -
4   - evaluate: function() {
5   - var ret = true, n;
6   -
7   - for (n in this.properties) {
8   - if (!Parser.evaluate(n, this.properties[n])) {
9   - ret = false;
10   - break;
11   - }
12   - }
13   -
14   - return (this.isInverted ? !ret : ret);
15   - },
16   -
17   - parse: function(stream) {
18   - if (this.evaluate()) {
19   - this.satisfied = true;
20   - }
21   -
22   - Parser.Statement.If.superclass.parse.apply(this, arguments);
23   -
24   - if (!this.satisfied) {
25   - return '';
26   - }
27   -
28   - return this.buffer;
29   - },
30   -
31   - onSubStatement: function(statement, stream) {
32   - var parsed = statement.parse(stream),
33   - satisfied = false;
34   -
35   - if (statement.type === 'elseif') {
36   - if (!this.satisfied) {
37   - if (statement.evaluate()) {
38   - this.satisfied = true;
39   - satisfied = true;
40   - }
41   - }
42   - } else if (statement.type === 'else') {
43   - if (!this.satisfied) {
44   - this.satisfied = true;
45   - satisfied = true;
46   - }
47   - } else {
48   - this.pushBuffer(parsed);
49   - return;
50   - }
51   -
52   - if (satisfied) {
53   - this.resetBuffer();
54   - this.pushBuffer(parsed);
55   - }
56   - }
57   -});
js/lib/JSBuilder/src/Parser/Statement/Uncomment.js deleted
... ... @@ -1,17 +0,0 @@
1   -Parser.Statement.Uncomment = Ext.extend(Parser.Statement, {
2   - parse: function(stream) {
3   - var line;
4   -
5   - while (!stream.eof) {
6   - line = stream.readLine();
7   -
8   - if (this.isEnd(line, stream)) {
9   - break;
10   - }
11   -
12   - this.pushBuffer(line.replace(/^([\s\t]*)\/\//, "$1"), !stream.eof);
13   - }
14   -
15   - return this.buffer;
16   - }
17   -});
js/lib/JSBuilder/src/Platform.js deleted
... ... @@ -1,4 +0,0 @@
1   -Platform = {
2   - isUnix: Fs.sep == '/',
3   - isWindows: Fs.sep != '/'
4   -};
5 0 \ No newline at end of file
js/lib/JSBuilder/src/Project.js deleted
... ... @@ -1,217 +0,0 @@
1   -Project = Ext.extend(Object, {
2   - constructor : function(projectFile, builder) {
3   - var fileName = projectFile.split(/\\|\//i).pop(),
4   - dir = projectFile.replace(fileName, ''),
5   - contents, config;
6   -
7   - if (!Fs.exists(projectFile)) {
8   - throw 'Project file doesn\'t exist';
9   - }
10   -
11   - contents = Fs.readFile(projectFile);
12   - try {
13   - config = JSON.parse(contents);
14   - }
15   - catch (e) {
16   - throw 'The JSB file is not valid JSON.\n' + e.toString();
17   - }
18   -
19   - Ext.apply(config, {
20   - targets: config.targets || config.pkgs || [],
21   - name: config.projectName,
22   - license: config.licenseText,
23   - jsbDir: Fs.getFullPath(dir),
24   - jsbFile: fileName,
25   - packages: config.packages || [],
26   - builds: config.builds || [],
27   - // If the JSB file contains a deployDir property, append that to the -d deployDir
28   - deployDir: builder.get('deployDir') + Fs.sep + (config.deployDir || ''),
29   - resources: config.resources || []
30   - });
31   -
32   - this.builder = builder;
33   - this.config = config;
34   -
35   - this.parseTargets();
36   - },
37   -
38   - parseTargets : function() {
39   - // Split targets up into packages and builds for backwards compatibility
40   - this.get('targets').forEach(function(item) {
41   - if (item.packages) {
42   - this.get('builds').push(item);
43   - }
44   - else {
45   - this.get('packages').push(item);
46   - }
47   - }, this);
48   -
49   - // Convert each package config object into an actual Package instance
50   - this.set('packages', this.get('packages').map(function(item) {
51   - return new Package(item, this);
52   - }, this));
53   -
54   - // Convert each build config object into an actual Build instance
55   - this.set('builds', this.get('builds').map(function(item) {
56   - return new Build(item, this);
57   - }, this));
58   - },
59   -
60   - getPackageById : function(id) {
61   - var ret = false;
62   - this.get('packages').forEach(function(pkg) {
63   - if (pkg.get('id') == id) {
64   - ret = pkg;
65   - }
66   - });
67   - return ret;
68   - },
69   -
70   - /**
71   - * Creates the directory we are going to deploy to.
72   - */
73   - makeDeployDir: function() {
74   - var project = this.project,
75   - deployDir = Fs.mkdir(this.get('deployDir'));
76   -
77   - this.set('deployDir', deployDir);
78   -
79   - if (this.get('verbose')) {
80   - this.log('Created the deploy directory ' + deployDir);
81   - }
82   - },
83   -
84   - build : function() {
85   - this.makeDeployDir();
86   - this.createPackages();
87   - this.createBuilds();
88   - this.copyResources();
89   -
90   - if (this.builder.get('verbose')) {
91   - Logger.log('');
92   - }
93   - Logger.log('Done building!\n');
94   - },
95   -
96   - createPackages : function() {
97   - this.get('packages').forEach(function(pkg) {
98   - pkg.create();
99   - });
100   - },
101   -
102   - createBuilds : function() {
103   - this.get('builds').forEach(function(build) {
104   - build.create();
105   - });
106   - },
107   -
108   - copyResources : function() {
109   - if (this.builder.get('verbose')) {
110   - Logger.log('');
111   - }
112   -
113   - Logger.log('Copy resources...');
114   -
115   - this.get('resources').forEach(function(resource) {
116   - var filters = resource.filters,
117   - srcDir = this.get('jsbDir') + Fs.sep + resource.src,
118   - dest = resource.dest || resource.src;
119   -
120   - dest = dest || '';
121   - dest = this.get('deployDir') + Fs.sep + dest;
122   -
123   - // TODO: Implement filters
124   - if (this.builder.get('verbose')) {
125   - Logger.log(' + ' + resource.src + ' -> ' + dest);
126   - }
127   -
128   - Fs.copy(srcDir, dest);
129   - }, this);
130   - },
131   -
132   - get : function(key) {
133   - return this.config[key] || false;
134   - },
135   -
136   - set : function(key, value, ifNotExists) {
137   - if (ifNotExists && this.get(key) !== false) {
138   - return;
139   - }
140   - this.config[key] = value;
141   - },
142   -
143   - compressTarget : function(target) {
144   - if (this.builder.get('nocompress') || !target.get('compress')) {
145   - return;
146   - }
147   -
148   - Logger.log(' * Compress and obfuscate ' + target.get('target') + '...');
149   -
150   - var destination = target.get('targetPath'),
151   - source = destination + '-temp-' + Date.now() * Math.random();
152   - system.move(destination, source),
153   - command = this.getCompressor() + '-o ' + destination + ' ' + source;
154   -
155   - Cmd.execute(command);
156   -
157   - Fs.remove(source);
158   - },
159   -
160   - getCompressor : function() {
161   - return 'java -jar ' + system.script.replace(Fs.getPath('bin/JSBuilder.js'), '') + Fs.getPath('ycompressor/ycompressor.jar') + ' --type js ';
162   - },
163   -
164   - getSourceFiles: function() {
165   - Logger.log('<!--');
166   - Logger.log(' Source files');
167   - Logger.log('-->');
168   - Logger.log('');
169   -
170   - this.get('builds').forEach(function(build) {
171   - if (build.get('packages')) {
172   - Logger.log('<!-- build: ' + build.get('name') + ' -->');
173   -
174   - build.get('packages').forEach(function(pkg) {
175   - pkg = build.project.getPackageById(pkg);
176   -
177   - Logger.log('<!-- package: ' + pkg.get('name') + ' -->');
178   -
179   - pkg.get('files').forEach(function(file) {
180   - Logger.log('<script type="text/javascript" src="../../' + file.path + file.name + '"></script>');
181   - });
182   -
183   - Logger.log('');
184   - });
185   -
186   - Logger.log('');
187   - };
188   - });
189   - },
190   -
191   - getSpecFiles: function() {
192   - Logger.log('<!--');
193   - Logger.log(' Spec files');
194   - Logger.log('-->');
195   - Logger.log('');
196   -
197   - this.get('builds').forEach(function(build) {
198   - if (build.get('packages')) {
199   - Logger.log('<!-- build: ' + build.get('name') + ' -->');
200   -
201   - build.get('packages').forEach(function(pkg) {
202   - pkg = build.project.getPackageById(pkg);
203   -
204   - Logger.log('<!-- package: ' + pkg.get('name') + ' -->');
205   -
206   - pkg.get('files').forEach(function(file) {
207   - Logger.log('<script type="text/javascript" src="spec/' + file.path.replace('src/', '') + file.name + '"></script>');
208   - });
209   -
210   - Logger.log('');
211   - });
212   -
213   - Logger.log('');
214   - };
215   - });
216   - }
217   -});
js/lib/JSBuilder/src/Target.js deleted
... ... @@ -1,216 +0,0 @@
1   -Target = Ext.extend(Object, {
2   - constructor: function(config, project) {
3   - this.config = config || {};
4   - this.project = project;
5   - },
6   -
7   - create: function() {
8   - this.parseTarget();
9   -
10   - var project = this.project,
11   - builder = project.builder,
12   - verbose = builder.get('verbose'),
13   - file;
14   -
15   - if (verbose) {
16   - Logger.log('\nCreating the "' + this.get('name') + '" target as "' + this.get('target') + '"');
17   - }
18   -
19   - // Open the file stream
20   - file = new Stream(this.get('targetPath'), 'w');
21   -
22   - this.onCreate(file);
23   - this.writeIncludes(file);
24   - this.onAfterWriteIncludes(file);
25   -
26   - // Close the target file
27   - file.close();
28   -
29   - this.afterCreate();
30   - },
31   -
32   - afterCreate: function() {
33   - this.project.compressTarget(this);
34   -
35   - var filePath = this.get('targetPath');
36   - var license = (this.project.get('license')) ? "/*\n" + this.project.get('license') + "\n*/\n" : '';
37   -
38   - if (license) {
39   - var content = Fs.readFile(filePath);
40   -
41   - if (content.substring(0, license.length) !== license) {
42   - Fs.writeFile(filePath, license + content);
43   - }
44   - }
45   - },
46   -
47   - onAfterWriteIncludes: function(file) {
48   - var namespaceRewrites = this.get('namespaceRewrites'),
49   - settings = this.get('settings'),
50   - suffix = '})(',
51   - names = [];
52   -
53   - if (namespaceRewrites) {
54   - namespaceRewrites.forEach(function(rewrite) {
55   - names.push('this.' + rewrite.to + ' || (this.' + rewrite.to + ' = {})');
56   - });
57   -
58   - suffix += names.join(', ');
59   - suffix += ');';
60   -
61   - file.writeln(suffix);
62   - }
63   - },
64   -
65   - onCreate: function(file) {
66   - var namespaceRewrites = this.get('namespaceRewrites'),
67   - prefix = '(function(',
68   - settings = this.get('settings'),
69   - names = [];
70   -
71   - if (namespaceRewrites) {
72   - namespaceRewrites.forEach(function(rewrite) {
73   - names.push(rewrite.from);
74   - });
75   -
76   - prefix += names.join(', ');
77   - prefix += '){';
78   -
79   - if (settings) {
80   - prefix += "\n";
81   - prefix += ["if (typeof Ext === 'undefined') {",
82   - "this.Ext = {};",
83   - "}",
84   - "",
85   - "Ext.buildSettings = " + JSON.stringify(settings) + ";"
86   - ].join("\n");
87   - }
88   -
89   -
90   - file.writeln(prefix);
91   - }
92   - },
93   -
94   - parseTarget: function() {
95   - if (this.parsed) {
96   - return;
97   - }
98   -
99   - // Backwards compatibility with JSB2
100   - var target = this.get('target') || this.get('file') || this.getDefaultTarget(),
101   - basePath = this.project.get('deployDir') + Fs.sep,
102   - dir;
103   -
104   - target = target.replace(/\//g, Fs.sep);
105   -
106   - if (target.indexOf('.js') !== -1) {
107   - target = target.replace('.js', '');
108   -// if (this.get('debug')) {
109   -// target += this.project.builder.get('debugSuffix');
110   -// }
111   - target += '.js';
112   - }
113   -
114   - this.set('target', target);
115   -
116   - // If the target is a path, then create the needed folders
117   - if (target.indexOf(Fs.sep) !== -1) {
118   - dir = target.substr(0, target.lastIndexOf(Fs.sep));
119   - target = target.replace(dir, '').substr(1);
120   - target = Fs.mkdir(basePath + dir) + Fs.sep + target;
121   - }
122   - else {
123   - target = basePath + target;
124   - }
125   -
126   - this.set('targetPath', target);
127   - this.parsed = true;
128   - },
129   -
130   - writeIncludes: function(file) {
131   - var project = this.project,
132   - verbose = project.builder.get('verbose'),
133   - includes = this.get('files') || this.get('fileIncludes') || [],
134   - jsbDir = project.get('jsbDir') + Fs.sep;
135   -
136   - if (verbose && includes.length) {
137   - Logger.log(' - ' + includes.length + ' file(s) included in this target.');
138   - }
139   -
140   - // Loop over all file includes, read the contents, and write
141   - // it to our target file
142   - includes.forEach(function(include) {
143   - var path = this.getIncludePath(include),
144   - content = '',
145   - filesStream, files;
146   -
147   - if (verbose) {
148   - Logger.log(' + ' + path);
149   - }
150   -
151   -
152   - if (!Fs.exists(jsbDir + path)) {
153   - if (Platform.isUnix) {
154   - filesStream = new Stream('exec://ls -a ' + jsbDir + path);
155   - files = filesStream.readFile().split('\n');
156   - filesStream.close();
157   - files.forEach(function(filePath) {
158   - if (!Ext.isEmpty(filePath)) {
159   - include = new Stream(filePath);
160   - content += include.readFile() + '\n';
161   - include.close();
162   - }
163   - });
164   - }
165   - }
166   - else {
167   - content = this.getContent(jsbDir + path);
168   - }
169   -
170   -
171   -
172   - file.writeln(content);
173   - }, this);
174   - },
175   -
176   -
177   - getContent: function(file, callNum) {
178   - /**
179   - * This function should pretty much never fail since we already know the file exists.
180   - * However in Windows it seems to randomly omit files when building because it can't
181   - * open the stream, which causes the build to break. Since we know the file is there,
182   - * we'll just re-request it until we get it. While stupid, this makes it reliable.
183   - */
184   -
185   - var content = '',
186   - stream;
187   -
188   - callNum = callNum || 0;
189   - try {
190   - stream = new Stream(file);
191   - content = stream.readFile();
192   - stream.close();
193   - } catch (e) {
194   - if (Platform.isWindows && callNum < 5) {
195   - return this.getContent(file, callNum + 1);
196   - }
197   - }
198   - return content;
199   - },
200   -
201   - getIncludePath : function(include) {
202   - return include.path.replace(/\//g, Fs.sep) + (include.name || include.text || '');
203   - },
204   -
205   -
206   - get: function(key) {
207   - return this.config[key] || false;
208   - },
209   -
210   - set: function(key, value, ifNotExists) {
211   - if (ifNotExists && this.get(key) !== false) {
212   - return;
213   - }
214   - this.config[key] = value;
215   - }
216   -});
js/lib/JSBuilder/src/Template.js deleted
... ... @@ -1,275 +0,0 @@
1   -/**
2   - * @class Ext.Template
3   - * <p>Represents an HTML fragment template. Templates may be {@link #compile precompiled}
4   - * for greater performance.</p>
5   - * <p>For example usage {@link #Template see the constructor}.</p>
6   - *
7   - * @constructor
8   - * An instance of this class may be created by passing to the constructor either
9   - * a single argument, or multiple arguments:
10   - * <div class="mdetail-params"><ul>
11   - * <li><b>single argument</b> : String/Array
12   - * <div class="sub-desc">
13   - * The single argument may be either a String or an Array:<ul>
14   - * <li><tt>String</tt> : </li><pre><code>
15   -var t = new Ext.Template("&lt;div>Hello {0}.&lt;/div>");
16   -t.{@link #append}('some-element', ['foo']);
17   - </code></pre>
18   - * <li><tt>Array</tt> : </li>
19   - * An Array will be combined with <code>join('')</code>.
20   -<pre><code>
21   -var t = new Ext.Template([
22   - '&lt;div name="{id}"&gt;',
23   - '&lt;span class="{cls}"&gt;{name:trim} {value:ellipsis(10)}&lt;/span&gt;',
24   - '&lt;/div&gt;',
25   -]);
26   -t.{@link #compile}();
27   -t.{@link #append}('some-element', {id: 'myid', cls: 'myclass', name: 'foo', value: 'bar'});
28   - </code></pre>
29   - * </ul></div></li>
30   - * <li><b>multiple arguments</b> : String, Object, Array, ...
31   - * <div class="sub-desc">
32   - * Multiple arguments will be combined with <code>join('')</code>.
33   - * <pre><code>
34   -var t = new Ext.Template(
35   - '&lt;div name="{id}"&gt;',
36   - '&lt;span class="{cls}"&gt;{name} {value}&lt;/span&gt;',
37   - '&lt;/div&gt;',
38   - // a configuration object:
39   - {
40   - compiled: true, // {@link #compile} immediately
41   - }
42   -);
43   - </code></pre>
44   - * <p><b>Notes</b>:</p>
45   - * <div class="mdetail-params"><ul>
46   - * <li>Formatting and <code>disableFormats</code> are not applicable for Sencha Touch.</li>
47   - * </ul></div>
48   - * </div></li>
49   - * </ul></div>
50   - * @param {Mixed} config
51   - */
52   -Ext.Template = function(html) {
53   - var me = this,
54   - a = arguments,
55   - buf = [];
56   -
57   - if (Ext.isArray(html)) {
58   - html = html.join("");
59   - }
60   - else if (a.length > 1) {
61   - Ext.each(a, function(v) {
62   - if (Ext.isObject(v)) {
63   - Ext.apply(me, v);
64   - } else {
65   - buf.push(v);
66   - }
67   - });
68   - html = buf.join('');
69   - }
70   -
71   - // @private
72   - me.html = html;
73   -
74   - if (me.compiled) {
75   - me.compile();
76   - }
77   -};
78   -
79   -Ext.Template.prototype = {
80   - isTemplate: true,
81   -
82   - re: /\{([\w-]+)(?:\:([\w\.]*)(?:\((.*?)?\))?)?\}/g,
83   - argsRe: /^\s*['"](.*)["']\s*$/,
84   - compileARe: /\\/g,
85   - compileBRe: /(\r\n|\n)/g,
86   - compileCRe: /'/g,
87   -
88   - /**
89   - * @cfg {Boolean} disableFormats true to disable format functions in the template. If the template doesn't contain format functions, setting
90   - * disableFormats to true will reduce apply time (defaults to false)
91   - */
92   - disableFormats: false,
93   -
94   - /**
95   - * Returns an HTML fragment of this template with the specified values applied.
96   - * @param {Object/Array} values The template values. Can be an array if your params are numeric (i.e. {0}) or an object (i.e. {foo: 'bar'})
97   - * @return {String} The HTML fragment
98   - * @hide repeat doc
99   - */
100   - applyTemplate: function(values) {
101   - var me = this,
102   - useF = me.disableFormats !== true,
103   - fm = Ext.util.Format,
104   - tpl = me,
105   - re,
106   - i,
107   - len;
108   -
109   - if (me.compiled) {
110   - return me.compiled(values);
111   - }
112   - function fn(m, name, format, args) {
113   - if (format && useF) {
114   - if (format.substr(0, 5) == "this.") {
115   - return tpl.call(format.substr(5), values[name], values);
116   - }
117   - else {
118   - if (args) {
119   - // quoted values are required for strings in compiled templates,
120   - // but for non compiled we need to strip them
121   - // quoted reversed for jsmin
122   - re = me.argsRe;
123   - args = args.split(',');
124   - for (i = 0, len = args.length; i < len; i++) {
125   - args[i] = args[i].replace(re, "$1");
126   - }
127   - args = [values[name]].concat(args);
128   - }
129   - else {
130   - args = [values[name]];
131   - }
132   - return fm[format].apply(fm, args);
133   - }
134   - }
135   - else {
136   - return values[name] !== undefined ? values[name] : "";
137   - }
138   - }
139   - return me.html.replace(me.re, fn);
140   - },
141   -
142   - /**
143   - * Sets the HTML used as the template and optionally compiles it.
144   - * @param {String} html
145   - * @param {Boolean} compile (optional) True to compile the template (defaults to undefined)
146   - * @return {Ext.Template} this
147   - */
148   - set: function(html, compile) {
149   - var me = this;
150   - me.html = html;
151   - me.compiled = null;
152   - return compile ? me.compile() : me;
153   - },
154   -
155   - /**
156   - * Compiles the template into an internal function, eliminating the RegEx overhead.
157   - * @return {Ext.Template} this
158   - * @hide repeat doc
159   - */
160   - compile: function() {
161   - var me = this,
162   - fm = Ext.util.Format,
163   - useF = me.disableFormats !== true,
164   - body;
165   -
166   - function fn(m, name, format, args) {
167   - if (format && useF) {
168   - args = args ? ',' + args: "";
169   - if (format.substr(0, 5) != "this.") {
170   - format = "fm." + format + '(';
171   - }
172   - else {
173   - format = 'this.call("' + format.substr(5) + '", ';
174   - args = ", values";
175   - }
176   - }
177   - else {
178   - args = '';
179   - format = "(values['" + name + "'] == undefined ? '' : ";
180   - }
181   - return "'," + format + "values['" + name + "']" + args + ") ,'";
182   - }
183   -
184   -
185   - body = ["this.compiled = function(values){ return ['"];
186   - body.push(me.html.replace(me.compileARe, '\\\\').replace(me.compileBRe, '\\n').replace(me.compileCRe, "\\'").replace(me.re, fn));
187   - body.push("'].join('');};");
188   - body = body.join('');
189   - eval(body);
190   - return me;
191   - },
192   -
193   - /**
194   - * Applies the supplied values to the template and inserts the new node(s) as the first child of el.
195   - * @param {Mixed} el The context element
196   - * @param {Object/Array} values The template values. Can be an array if your params are numeric (i.e. {0}) or an object (i.e. {foo: 'bar'})
197   - * @param {Boolean} returnElement (optional) true to return a Ext.Element (defaults to undefined)
198   - * @return {HTMLElement/Ext.Element} The new node or Element
199   - */
200   - insertFirst: function(el, values, returnElement) {
201   - return this.doInsert('afterBegin', el, values, returnElement);
202   - },
203   -
204   - /**
205   - * Applies the supplied values to the template and inserts the new node(s) before el.
206   - * @param {Mixed} el The context element
207   - * @param {Object/Array} values The template values. Can be an array if your params are numeric (i.e. {0}) or an object (i.e. {foo: 'bar'})
208   - * @param {Boolean} returnElement (optional) true to return a Ext.Element (defaults to undefined)
209   - * @return {HTMLElement/Ext.Element} The new node or Element
210   - */
211   - insertBefore: function(el, values, returnElement) {
212   - return this.doInsert('beforeBegin', el, values, returnElement);
213   - },
214   -
215   - /**
216   - * Applies the supplied values to the template and inserts the new node(s) after el.
217   - * @param {Mixed} el The context element
218   - * @param {Object/Array} values The template values. Can be an array if your params are numeric (i.e. {0}) or an object (i.e. {foo: 'bar'})
219   - * @param {Boolean} returnElement (optional) true to return a Ext.Element (defaults to undefined)
220   - * @return {HTMLElement/Ext.Element} The new node or Element
221   - */
222   - insertAfter: function(el, values, returnElement) {
223   - return this.doInsert('afterEnd', el, values, returnElement);
224   - },
225   -
226   - /**
227   - * Applies the supplied <code>values</code> to the template and appends
228   - * the new node(s) to the specified <code>el</code>.
229   - * <p>For example usage {@link #Template see the constructor}.</p>
230   - * @param {Mixed} el The context element
231   - * @param {Object/Array} values
232   - * The template values. Can be an array if the params are numeric (i.e. <code>{0}</code>)
233   - * or an object (i.e. <code>{foo: 'bar'}</code>).
234   - * @param {Boolean} returnElement (optional) true to return an Ext.Element (defaults to undefined)
235   - * @return {HTMLElement/Ext.Element} The new node or Element
236   - */
237   - append: function(el, values, returnElement) {
238   - return this.doInsert('beforeEnd', el, values, returnElement);
239   - },
240   -
241   - doInsert: function(where, el, values, returnEl) {
242   - el = Ext.getDom(el);
243   - var newNode = Ext.DomHelper.insertHtml(where, el, this.applyTemplate(values));
244   - return returnEl ? Ext.get(newNode, true) : newNode;
245   - },
246   -
247   - /**
248   - * Applies the supplied values to the template and overwrites the content of el with the new node(s).
249   - * @param {Mixed} el The context element
250   - * @param {Object/Array} values The template values. Can be an array if your params are numeric (i.e. {0}) or an object (i.e. {foo: 'bar'})
251   - * @param {Boolean} returnElement (optional) true to return a Ext.Element (defaults to undefined)
252   - * @return {HTMLElement/Ext.Element} The new node or Element
253   - */
254   - overwrite: function(el, values, returnElement) {
255   - el = Ext.getDom(el);
256   - el.innerHTML = this.applyTemplate(values);
257   - return returnElement ? Ext.get(el.firstChild, true) : el.firstChild;
258   - },
259   -
260   - // private function used to call members
261   - call: function(fnName, value, allValues) {
262   - return this[fnName](value, allValues);
263   - }
264   -};
265   -/**
266   - * Alias for {@link #applyTemplate}
267   - * Returns an HTML fragment of this template with the specified <code>values</code> applied.
268   - * @param {Object/Array} values
269   - * The template values. Can be an array if the params are numeric (i.e. <code>{0}</code>)
270   - * or an object (i.e. <code>{foo: 'bar'}</code>).
271   - * @return {String} The HTML fragment
272   - * @member Ext.Template
273   - * @method apply
274   - */
275   -Ext.Template.prototype.apply = Ext.Template.prototype.applyTemplate;
276 0 \ No newline at end of file
js/lib/JSBuilder/src/XTemplate.js deleted
... ... @@ -1,469 +0,0 @@
1   -/**
2   - * @class Ext.XTemplate
3   - * @extends Ext.Template
4   - * <p>A template class that supports advanced functionality like:<div class="mdetail-params"><ul>
5   - * <li>Autofilling arrays using templates and sub-templates</li>
6   - * <li>Conditional processing with basic comparison operators</li>
7   - * <li>Basic math function support</li>
8   - * <li>Execute arbitrary inline code with special built-in template variables</li>
9   - * <li>Custom member functions</li>
10   - * <li>Many special tags and built-in operators that aren't defined as part of
11   - * the API, but are supported in the templates that can be created</li>
12   - * </ul></div></p>
13   - * <p>XTemplate provides the templating mechanism built into:<div class="mdetail-params"><ul>
14   - * <li>{@link Ext.view.View}</li>
15   - * </ul></div></p>
16   - *
17   - * <p>For example usage {@link #XTemplate see the constructor}.</p>
18   - *
19   - * @constructor
20   - * The {@link Ext.Template#Template Ext.Template constructor} describes
21   - * the acceptable parameters to pass to the constructor. The following
22   - * examples demonstrate all of the supported features.</p>
23   - *
24   - * <div class="mdetail-params"><ul>
25   - *
26   - * <li><b><u>Sample Data</u></b>
27   - * <div class="sub-desc">
28   - * <p>This is the data object used for reference in each code example:</p>
29   - * <pre><code>
30   -var data = {
31   - name: 'Tommy Maintz',
32   - title: 'Lead Developer',
33   - company: 'Sencha Inc.',
34   - email: 'tommy@sencha.com',
35   - address: '5 Cups Drive',
36   - city: 'Palo Alto',
37   - state: 'CA',
38   - zip: '44102',
39   - drinks: ['Coffee', 'Soda', 'Water'],
40   - kids: [{
41   - name: 'Joshua',
42   - age:3
43   - },{
44   - name: 'Matthew',
45   - age:2
46   - },{
47   - name: 'Solomon',
48   - age:0
49   - }]
50   -};
51   - </code></pre>
52   - * </div>
53   - * </li>
54   - *
55   - *
56   - * <li><b><u>Auto filling of arrays</u></b>
57   - * <div class="sub-desc">
58   - * <p>The <b><tt>tpl</tt></b> tag and the <b><tt>for</tt></b> operator are used
59   - * to process the provided data object:
60   - * <ul>
61   - * <li>If the value specified in <tt>for</tt> is an array, it will auto-fill,
62   - * repeating the template block inside the <tt>tpl</tt> tag for each item in the
63   - * array.</li>
64   - * <li>If <tt>for="."</tt> is specified, the data object provided is examined.</li>
65   - * <li>While processing an array, the special variable <tt>{#}</tt>
66   - * will provide the current array index + 1 (starts at 1, not 0).</li>
67   - * </ul>
68   - * </p>
69   - * <pre><code>
70   -&lt;tpl <b>for</b>=".">...&lt;/tpl> // loop through array at root node
71   -&lt;tpl <b>for</b>="foo">...&lt;/tpl> // loop through array at foo node
72   -&lt;tpl <b>for</b>="foo.bar">...&lt;/tpl> // loop through array at foo.bar node
73   - </code></pre>
74   - * Using the sample data above:
75   - * <pre><code>
76   -var tpl = new Ext.XTemplate(
77   - '&lt;p>Kids: ',
78   - '&lt;tpl <b>for</b>=".">', // process the data.kids node
79   - '&lt;p>{#}. {name}&lt;/p>', // use current array index to autonumber
80   - '&lt;/tpl>&lt;/p>'
81   -);
82   -tpl.overwrite(panel.body, data.kids); // pass the kids property of the data object
83   - </code></pre>
84   - * <p>An example illustrating how the <b><tt>for</tt></b> property can be leveraged
85   - * to access specified members of the provided data object to populate the template:</p>
86   - * <pre><code>
87   -var tpl = new Ext.XTemplate(
88   - '&lt;p>Name: {name}&lt;/p>',
89   - '&lt;p>Title: {title}&lt;/p>',
90   - '&lt;p>Company: {company}&lt;/p>',
91   - '&lt;p>Kids: ',
92   - '&lt;tpl <b>for="kids"</b>>', // interrogate the kids property within the data
93   - '&lt;p>{name}&lt;/p>',
94   - '&lt;/tpl>&lt;/p>'
95   -);
96   -tpl.overwrite(panel.body, data); // pass the root node of the data object
97   - </code></pre>
98   - * <p>Flat arrays that contain values (and not objects) can be auto-rendered
99   - * using the special <b><tt>{.}</tt></b> variable inside a loop. This variable
100   - * will represent the value of the array at the current index:</p>
101   - * <pre><code>
102   -var tpl = new Ext.XTemplate(
103   - '&lt;p>{name}\&#39;s favorite beverages:&lt;/p>',
104   - '&lt;tpl for="drinks">',
105   - '&lt;div> - {.}&lt;/div>',
106   - '&lt;/tpl>'
107   -);
108   -tpl.overwrite(panel.body, data);
109   - </code></pre>
110   - * <p>When processing a sub-template, for example while looping through a child array,
111   - * you can access the parent object's members via the <b><tt>parent</tt></b> object:</p>
112   - * <pre><code>
113   -var tpl = new Ext.XTemplate(
114   - '&lt;p>Name: {name}&lt;/p>',
115   - '&lt;p>Kids: ',
116   - '&lt;tpl for="kids">',
117   - '&lt;tpl if="age &amp;gt; 1">',
118   - '&lt;p>{name}&lt;/p>',
119   - '&lt;p>Dad: {<b>parent</b>.name}&lt;/p>',
120   - '&lt;/tpl>',
121   - '&lt;/tpl>&lt;/p>'
122   -);
123   -tpl.overwrite(panel.body, data);
124   - </code></pre>
125   - * </div>
126   - * </li>
127   - *
128   - *
129   - * <li><b><u>Conditional processing with basic comparison operators</u></b>
130   - * <div class="sub-desc">
131   - * <p>The <b><tt>tpl</tt></b> tag and the <b><tt>if</tt></b> operator are used
132   - * to provide conditional checks for deciding whether or not to render specific
133   - * parts of the template. Notes:<div class="sub-desc"><ul>
134   - * <li>Double quotes must be encoded if used within the conditional</li>
135   - * <li>There is no <tt>else</tt> operator &mdash; if needed, two opposite
136   - * <tt>if</tt> statements should be used.</li>
137   - * </ul></div>
138   - * <pre><code>
139   -&lt;tpl if="age &gt; 1 &amp;&amp; age &lt; 10">Child&lt;/tpl>
140   -&lt;tpl if="age >= 10 && age < 18">Teenager&lt;/tpl>
141   -&lt;tpl <b>if</b>="this.isGirl(name)">...&lt;/tpl>
142   -&lt;tpl <b>if</b>="id==\'download\'">...&lt;/tpl>
143   -&lt;tpl <b>if</b>="needsIcon">&lt;img src="{icon}" class="{iconCls}"/>&lt;/tpl>
144   -// no good:
145   -&lt;tpl if="name == "Tommy"">Hello&lt;/tpl>
146   -// encode &#34; if it is part of the condition, e.g.
147   -&lt;tpl if="name == &#38;quot;Tommy&#38;quot;">Hello&lt;/tpl>
148   - * </code></pre>
149   - * Using the sample data above:
150   - * <pre><code>
151   -var tpl = new Ext.XTemplate(
152   - '&lt;p>Name: {name}&lt;/p>',
153   - '&lt;p>Kids: ',
154   - '&lt;tpl for="kids">',
155   - '&lt;tpl if="age &amp;gt; 1">',
156   - '&lt;p>{name}&lt;/p>',
157   - '&lt;/tpl>',
158   - '&lt;/tpl>&lt;/p>'
159   -);
160   -tpl.overwrite(panel.body, data);
161   - </code></pre>
162   - * </div>
163   - * </li>
164   - *
165   - *
166   - * <li><b><u>Basic math support</u></b>
167   - * <div class="sub-desc">
168   - * <p>The following basic math operators may be applied directly on numeric
169   - * data values:</p><pre>
170   - * + - * /
171   - * </pre>
172   - * For example:
173   - * <pre><code>
174   -var tpl = new Ext.XTemplate(
175   - '&lt;p>Name: {name}&lt;/p>',
176   - '&lt;p>Kids: ',
177   - '&lt;tpl for="kids">',
178   - '&lt;tpl if="age &amp;gt; 1">', // <-- Note that the &gt; is encoded
179   - '&lt;p>{#}: {name}&lt;/p>', // <-- Auto-number each item
180   - '&lt;p>In 5 Years: {age+5}&lt;/p>', // <-- Basic math
181   - '&lt;p>Dad: {[parent.name]}&lt;/p>',
182   - '&lt;/tpl>',
183   - '&lt;/tpl>&lt;/p>'
184   -);
185   -tpl.overwrite(panel.body, data);
186   - </code></pre>
187   - * </div>
188   - * </li>
189   - *
190   - *
191   - * <li><b><u>Execute arbitrary inline code with special built-in template variables</u></b>
192   - * <div class="sub-desc">
193   - * <p>Anything between <code>{[ ... ]}</code> is considered code to be executed
194   - * in the scope of the template. There are some special variables available in that code:
195   - * <ul>
196   - * <li><b><tt>values</tt></b>: The values in the current scope. If you are using
197   - * scope changing sub-templates, you can change what <tt>values</tt> is.</li>
198   - * <li><b><tt>parent</tt></b>: The scope (values) of the ancestor template.</li>
199   - * <li><b><tt>xindex</tt></b>: If you are in a looping template, the index of the
200   - * loop you are in (1-based).</li>
201   - * <li><b><tt>xcount</tt></b>: If you are in a looping template, the total length
202   - * of the array you are looping.</li>
203   - * </ul>
204   - * This example demonstrates basic row striping using an inline code block and the
205   - * <tt>xindex</tt> variable:</p>
206   - * <pre><code>
207   -var tpl = new Ext.XTemplate(
208   - '&lt;p>Name: {name}&lt;/p>',
209   - '&lt;p>Company: {[values.company.toUpperCase() + ", " + values.title]}&lt;/p>',
210   - '&lt;p>Kids: ',
211   - '&lt;tpl for="kids">',
212   - '&lt;div class="{[xindex % 2 === 0 ? "even" : "odd"]}">',
213   - '{name}',
214   - '&lt;/div>',
215   - '&lt;/tpl>&lt;/p>'
216   -);
217   -tpl.overwrite(panel.body, data);
218   - </code></pre>
219   - * </div>
220   - * </li>
221   - *
222   - * <li><b><u>Template member functions</u></b>
223   - * <div class="sub-desc">
224   - * <p>One or more member functions can be specified in a configuration
225   - * object passed into the XTemplate constructor for more complex processing:</p>
226   - * <pre><code>
227   -var tpl = new Ext.XTemplate(
228   - '&lt;p>Name: {name}&lt;/p>',
229   - '&lt;p>Kids: ',
230   - '&lt;tpl for="kids">',
231   - '&lt;tpl if="this.isGirl(name)">',
232   - '&lt;p>Girl: {name} - {age}&lt;/p>',
233   - '&lt;/tpl>',
234   - // use opposite if statement to simulate 'else' processing:
235   - '&lt;tpl if="this.isGirl(name) == false">',
236   - '&lt;p>Boy: {name} - {age}&lt;/p>',
237   - '&lt;/tpl>',
238   - '&lt;tpl if="this.isBaby(age)">',
239   - '&lt;p>{name} is a baby!&lt;/p>',
240   - '&lt;/tpl>',
241   - '&lt;/tpl>&lt;/p>',
242   - {
243   - // XTemplate configuration:
244   - compiled: true,
245   - // member functions:
246   - isGirl: function(name){
247   - return name == 'Sara Grace';
248   - },
249   - isBaby: function(age){
250   - return age < 1;
251   - }
252   - }
253   -);
254   -tpl.overwrite(panel.body, data);
255   - </code></pre>
256   - * </div>
257   - * </li>
258   - *
259   - * </ul></div>
260   - *
261   - * @param {Mixed} config
262   - */
263   -Ext.XTemplate = function() {
264   - Ext.XTemplate.superclass.constructor.apply(this, arguments);
265   -
266   - var me = this,
267   - s = me.html,
268   - re = /<tpl\b[^>]*>((?:(?=([^<]+))\2|<(?!tpl\b[^>]*>))*?)<\/tpl>/,
269   - nameRe = /^<tpl\b[^>]*?for="(.*?)"/,
270   - ifRe = /^<tpl\b[^>]*?if="(.*?)"/,
271   - execRe = /^<tpl\b[^>]*?exec="(.*?)"/,
272   - id = 0,
273   - tpls = [],
274   - VALUES = 'values',
275   - PARENT = 'parent',
276   - XINDEX = 'xindex',
277   - XCOUNT = 'xcount',
278   - RETURN = 'return ',
279   - WITHVALUES = 'with(values){ ',
280   - m,
281   - m2,
282   - m3,
283   - m4,
284   - exp,
285   - fn,
286   - exec,
287   - name,
288   - i;
289   -
290   - s = ['<tpl>', s, '</tpl>'].join('');
291   -
292   - while ((m = s.match(re))) {
293   - m2 = m[0].match(nameRe);
294   - m3 = m[0].match(ifRe);
295   - m4 = m[0].match(execRe);
296   - exp = null;
297   - fn = null;
298   - exec = null;
299   - name = m2 && m2[1] ? m2[1] : '';
300   -
301   - if (m3) {
302   - exp = m3 && m3[1] ? m3[1] : null;
303   - if (exp) {
304   - fn = new Function(VALUES, PARENT, XINDEX, XCOUNT, WITHVALUES + 'try{' + RETURN + (Ext.util.Format.htmlDecode(exp)) + ';}catch(e){return;}}');
305   - }
306   - }
307   - if (m4) {
308   - exp = m4 && m4[1] ? m4[1] : null;
309   - if (exp) {
310   - exec = new Function(VALUES, PARENT, XINDEX, XCOUNT, WITHVALUES + (Ext.util.Format.htmlDecode(exp)) + '; }');
311   - }
312   - }
313   - if (name) {
314   - switch (name) {
315   - case '.':
316   - name = new Function(VALUES, PARENT, WITHVALUES + RETURN + VALUES + '; }');
317   - break;
318   - case '..':
319   - name = new Function(VALUES, PARENT, WITHVALUES + RETURN + PARENT + '; }');
320   - break;
321   - default:
322   - name = new Function(VALUES, PARENT, WITHVALUES + RETURN + name + '; }');
323   - }
324   - }
325   - tpls.push({
326   - id: id,
327   - target: name,
328   - exec: exec,
329   - test: fn,
330   - body: m[1] || ''
331   - });
332   - s = s.replace(m[0], '{xtpl' + id + '}');
333   - ++id;
334   - }
335   - for (i = tpls.length - 1; i >= 0; --i) {
336   - me.compileTpl(tpls[i]);
337   - }
338   - me.master = tpls[tpls.length - 1];
339   - me.tpls = tpls;
340   -};
341   -Ext.extend(Ext.XTemplate, Ext.Template, {
342   - re: /\{([\w-\.\#]+)(?:\:([\w\.]*)(?:\((.*?)?\))?)?(\s?[\+\-\*\/]\s?[\d\.\+\-\*\/\(\)]+)?\}/g,
343   -
344   - /**
345   - * @cfg {RegExp} codeRe The regular expression used to match code variables (default: matches <tt>{[expression]}</tt>).
346   - */
347   - codeRe: /\{\[((?:\\\]|.|\n)*?)\]\}/g,
348   -
349   - // @private
350   - applySubTemplate: function(id, values, parent, xindex, xcount) {
351   - var me = this,
352   - len,
353   - t = me.tpls[id],
354   - vs,
355   - buf = [],
356   - i;
357   - if ((t.test && !t.test.call(me, values, parent, xindex, xcount)) ||
358   - (t.exec && t.exec.call(me, values, parent, xindex, xcount))) {
359   - return '';
360   - }
361   - vs = t.target ? t.target.call(me, values, parent) : values;
362   - len = vs.length;
363   - parent = t.target ? values: parent;
364   - if (t.target && Ext.isArray(vs)) {
365   - for (i = 0, len = vs.length; i < len; i++) {
366   - buf[buf.length] = t.compiled.call(me, vs[i], parent, i + 1, len);
367   - }
368   - return buf.join('');
369   - }
370   - return t.compiled.call(me, vs, parent, xindex, xcount);
371   - },
372   -
373   - // @private
374   - compileTpl: function(tpl) {
375   - var fm = Ext.util.Format,
376   - useF = this.disableFormats !== true,
377   - body;
378   -
379   - function fn(m, name, format, args, math) {
380   - var v;
381   - // name is what is inside the {}
382   -
383   - // Name begins with xtpl, use a Sub Template
384   - if (name.substr(0, 4) == 'xtpl') {
385   - return "',this.applySubTemplate(" + name.substr(4) + ", values, parent, xindex, xcount),'";
386   - }
387   - // name = "." - Just use the values object.
388   - if (name == '.') {
389   - v = 'typeof values == "string" ? values : ""';
390   - }
391   -
392   - // name = "#" - Use the xindex
393   - else if (name == '#') {
394   - v = 'xindex';
395   - }
396   -
397   - // name has a . in it - Use object literal notation, starting from values
398   - else if (name.indexOf('.') != -1) {
399   - v = "values."+name;
400   - }
401   -
402   - // name is a property of values
403   - else {
404   - v = "values['" + name + "']";
405   - }
406   - if (math) {
407   - v = '(' + v + math + ')';
408   - }
409   - if (format && useF) {
410   - args = args ? ',' + args: "";
411   - if (format.substr(0, 5) != "this.") {
412   - format = "fm." + format + '(';
413   - }
414   - else {
415   - format = 'this.call("' + format.substr(5) + '", ';
416   - args = ", values";
417   - }
418   - }
419   - else {
420   - args = '';
421   - format = "(" + v + " === undefined ? '' : ";
422   - }
423   - return "'," + format + v + args + "),'";
424   - }
425   -
426   - function codeFn(m, code) {
427   - // Single quotes get escaped when the template is compiled, however we want to undo this when running code.
428   - return "',(" + code.replace(/\\'/g, "'") + "),'";
429   - }
430   - body = ["tpl.compiled = function(values, parent, xindex, xcount){return ['"];
431   - body.push(tpl.body.replace(/(\r\n|\n)/g, '\\n').replace(/'/g, "\\'").replace(this.re, fn).replace(this.codeRe, codeFn));
432   - body.push("'].join('');};");
433   - body = body.join('');
434   - eval(body);
435   - return this;
436   - },
437   -
438   - /**
439   - * Returns an HTML fragment of this template with the specified values applied.
440   - * @param {Object} values The template values. Can be an array if your params are numeric (i.e. {0}) or an object (i.e. {foo: 'bar'})
441   - * @return {String} The HTML fragment
442   - */
443   - applyTemplate: function(values) {
444   - return this.master.compiled.call(this, values, {}, 1, 1);
445   - },
446   -
447   - /**
448   - * Compile the template to a function for optimized performance. Recommended if the template will be used frequently.
449   - * @return {Function} The compiled function
450   - */
451   - compile: function() {
452   - return this;
453   - }
454   -});
455   -/**
456   - * Alias for {@link #applyTemplate}
457   - * Returns an HTML fragment of this template with the specified values applied.
458   - * @param {Object/Array} values The template values. Can be an array if your params are numeric (i.e. {0}) or an object (i.e. {foo: 'bar'})
459   - * @return {String} The HTML fragment
460   - * @member Ext.XTemplate
461   - * @method apply
462   - */
463   -Ext.XTemplate.prototype.apply = Ext.XTemplate.prototype.applyTemplate;
464   -
465   -if (Ext.util == undefined) {
466   - Ext.util = {
467   - Format: {}
468   - };
469   -}
js/lib/JSBuilder/src/generators/app/Application.js deleted
... ... @@ -1,91 +0,0 @@
1   -/**
2   - * @class Ext.generator.Application
3   - * @extends Ext.generator.Base
4   - * Generates a full application
5   - */
6   -Ext.generator.Application = Ext.extend(Ext.generator.Base, {
7   - generate: function() {
8   - this.headline('Generating the ' + this.name + ' application');
9   -
10   - this.createDirectoryStructure();
11   - this.copyApplicationFiles();
12   - this.copyJasmine();
13   - this.copyJSBuilder();
14   - },
15   -
16   - /**
17   - * Copies all files required for jasmine to the lib directory
18   - */
19   - copyJasmine: function() {
20   - Logger.log("Copying dependencies...");
21   -
22   - this.mkdir('lib/jasmine', 'lib/sencha-jasmine', 'lib/sencha-jasmine/matchers');
23   -
24   - this.file('lib/jasmine/jasmine.css');
25   - this.file('lib/jasmine/jasmine-html.js');
26   - this.file('lib/jasmine/jasmine.js');
27   - this.file('lib/jasmine/MIT.LICENSE');
28   -
29   - this.file('lib/sencha-jasmine/sencha-jasmine.css');
30   - this.file('lib/sencha-jasmine/sencha-jasmine.js');
31   - this.file('lib/sencha-jasmine/matchers/Model.js');
32   - this.file('lib/sencha-jasmine/matchers/Controller.js');
33   - },
34   -
35   - /**
36   - * Copies all static application files to their destination directories
37   - */
38   - copyApplicationFiles: function() {
39   - Logger.log("Copying files...");
40   -
41   - this.file('index.html');
42   - this.file('app/routes.js');
43   - this.file('public/resources/css/application.css');
44   - this.file('test/unit/index.html');
45   - this.file('test/unit/SpecOptions.js');
46   - this.file('test/unit/.htaccess');
47   -
48   - this.template('Application', this, "app/app.js");
49   - this.template('Viewport', this, "app/views/Viewport.js");
50   - },
51   -
52   - /**
53   - * Creates all of the necessary directories for a new app
54   - */
55   - createDirectoryStructure: function() {
56   - Logger.log("Creating directories...");
57   - this.mkdir(
58   - 'app', 'app/models', 'app/controllers', 'app/views', 'lib',
59   - 'public', 'public/resources/images', 'public/resources/css',
60   - 'test', 'test/acceptance', 'test/fixtures', 'test/unit',
61   - 'test/unit/models', 'test/unit/controllers', 'test/unit/views'
62   - );
63   - },
64   -
65   - /**
66   - * Copies all files/folders required for JSBuilder into the lib directory
67   - */
68   - copyJSBuilder: function() {
69   - Logger.log("Copying JSBuilder");
70   - this.mkdir("lib/JSBuilder", "lib/JSBuilder/bin");
71   - this.file("lib/JSBuilder/bin/Dispatch.js");
72   -
73   - var builderDirs = ['bin', 'jsdb', 'src', 'tests', 'ycompressor'],
74   - length = builderDirs.length,
75   - i;
76   -
77   - for (i = 0; i < length; i++) {
78   - this.copyDir(builderDirs[i], "lib/JSBuilder");
79   - }
80   -
81   - Logger.log(" Copying JSBuilder files");
82   - this.file("sencha.sh");
83   - },
84   -
85   - decodeArgs: function(args) {
86   - this.name = args[0];
87   - this.basePath = args[1] || this.name;
88   - }
89   -});
90   -
91   -Ext.regGenerator('app', Ext.generator.Application);
92 0 \ No newline at end of file
js/lib/JSBuilder/src/generators/app/files/app/routes.js deleted
... ... @@ -1,18 +0,0 @@
1   -/**
2   - * The Router maps local urls to controller and action pairs. This is used primarily
3   - * for providing history support without reloading the page. Example usage:
4   - *
5   - * Connects http://myapp.com/#home to the index controller's overview action
6   - * map.connect("home", {controller: 'index', action: 'overview'});
7   - *
8   - * Connects urls like "images/myImage.jpg" to the images controller's show action, passing
9   - * "myImage.jpg" as the "url" property of the options object each controller action receives
10   - * map.connect("images/:url", {controller: 'images', action: 'show'});
11   - */
12   -Ext.Router.draw(function(map) {
13   -
14   -
15   - //These are default fallback routes and can be removed if not needed
16   - map.connect(':controller/:action');
17   - map.connect(':controller/:action/:id');
18   -});
19 0 \ No newline at end of file
js/lib/JSBuilder/src/generators/app/files/index.html deleted
... ... @@ -1,38 +0,0 @@
1   -<!doctype html>
2   -<html>
3   -<head>
4   - <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
5   - <title>Sencha Application</title>
6   -
7   - <meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0; maximum-scale=1.0; user-scalable=0;" />
8   - <meta name="apple-mobile-web-app-capable" content="yes" />
9   - <link rel="apple-touch-icon" href="apple-touch-icon.png" />
10   -
11   - <link rel="stylesheet" href="lib/touch/resources/css/ext-touch.css" type="text/css">
12   - <link rel="stylesheet" href="public/resources/css/application.css" type="text/css">
13   -</head>
14   -<body>
15   - <script type="text/javascript" src="lib/touch/ext-touch-debug.js"></script>
16   - <script type="text/javascript" src="lib/touch/pkgs/platform/mvc.js"></script>
17   -
18   - <div id="sencha-app">
19   - <script type="text/javascript" src="app/routes.js"></script>
20   - <script type="text/javascript" src="app/app.js"></script>
21   -
22   - <!-- Place your view files here -->
23   - <div id="sencha-views">
24   - <script type="text/javascript" src="app/views/Viewport.js"></script>
25   - </div>
26   -
27   - <!-- Place your model files here -->
28   - <div id="sencha-models">
29   -
30   - </div>
31   -
32   - <!-- Place your controller files here -->
33   - <div id="sencha-controllers">
34   -
35   - </div>
36   - </div>
37   -</body>
38   -</html>
39 0 \ No newline at end of file
js/lib/JSBuilder/src/generators/app/files/lib/JSBuilder/bin/Dispatch.js deleted
... ... @@ -1,37 +0,0 @@
1   -var JSBuilderPath = system.cwd + '/lib/JSBuilder/';
2   -
3   -load(JSBuilderPath + 'src/Loader.js');
4   -Loader.setBasePath(JSBuilderPath + 'src');
5   -
6   -Loader.require([
7   - 'Ext', 'Cmd', 'Filesystem', 'Platform', 'Cli', 'Logger', 'Project', 'Target', 'Package', 'Build'
8   -]);
9   -
10   -/**
11   - * @class Ext.CommandDispatcher
12   - * @extends Object
13   - * Dispaches to the relevant Cli subclass from the command line 'sencha' command. e.g.
14   - * sencha generate xyz is dispatched to whichever Ext.Cli subclass registered itself to
15   - * handler the 'generate' command (Ext.generator.Factory in this case).
16   - */
17   -Ext.CommandDispatcher = {
18   - types: {},
19   -
20   - dispatch: function(module, args) {
21   - new this.types[module]({args: args});
22   - }
23   -};
24   -
25   -Ext.regDispatchable = function(name, constructor) {
26   - Ext.CommandDispatcher.types[name] = constructor;
27   -};
28   -
29   -load('src/Generator.js');
30   -load('src/generators/app/Application.js');
31   -load('src/generators/controller/Controller.js');
32   -load('src/generators/model/Model.js');
33   -
34   -var args = system.arguments,
35   - module = args[0];
36   -
37   -Ext.CommandDispatcher.dispatch(module, args.slice(1));
38 0 \ No newline at end of file
js/lib/JSBuilder/src/generators/app/files/lib/jasmine/MIT.LICENSE deleted
... ... @@ -1,20 +0,0 @@
1   -Copyright (c) 2008-2010 Pivotal Labs
2   -
3   -Permission is hereby granted, free of charge, to any person obtaining
4   -a copy of this software and associated documentation files (the
5   -"Software"), to deal in the Software without restriction, including
6   -without limitation the rights to use, copy, modify, merge, publish,
7   -distribute, sublicense, and/or sell copies of the Software, and to
8   -permit persons to whom the Software is furnished to do so, subject to
9   -the following conditions:
10   -
11   -The above copyright notice and this permission notice shall be
12   -included in all copies or substantial portions of the Software.
13   -
14   -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15   -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16   -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17   -NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18   -LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19   -OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20   -WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
js/lib/JSBuilder/src/generators/app/files/lib/jasmine/jasmine-html.js deleted
... ... @@ -1,182 +0,0 @@
1   -jasmine.TrivialReporter = function(doc) {
2   - this.document = doc || document;
3   - this.suiteDivs = {};
4   - this.logRunningSpecs = false;
5   -};
6   -
7   -jasmine.TrivialReporter.prototype.createDom = function(type, attrs, childrenVarArgs) {
8   - var el = document.createElement(type);
9   -
10   - for (var i = 2; i < arguments.length; i++) {
11   - var child = arguments[i];
12   -
13   - if (typeof child === 'string') {
14   - el.appendChild(document.createTextNode(child));
15   - } else {
16   - if (child) { el.appendChild(child); }
17   - }
18   - }
19   -
20   - for (var attr in attrs) {
21   - if (attr == "className") {
22   - el[attr] = attrs[attr];
23   - } else {
24   - el.setAttribute(attr, attrs[attr]);
25   - }
26   - }
27   -
28   - return el;
29   -};
30   -
31   -jasmine.TrivialReporter.prototype.reportRunnerStarting = function(runner) {
32   - var showPassed, showSkipped;
33   -
34   - this.outerDiv = this.createDom('div', { className: 'jasmine_reporter' },
35   - this.createDom('div', { className: 'banner' },
36   - this.createDom('div', { className: 'logo' },
37   - this.createDom('a', { href: 'http://pivotal.github.com/jasmine/', target: "_blank" }, "Jasmine"),
38   - this.createDom('span', { className: 'version' }, runner.env.versionString())),
39   - this.createDom('div', { className: 'options' },
40   - "Show ",
41   - showPassed = this.createDom('input', { id: "__jasmine_TrivialReporter_showPassed__", type: 'checkbox' }),
42   - this.createDom('label', { "for": "__jasmine_TrivialReporter_showPassed__" }, " passed "),
43   - showSkipped = this.createDom('input', { id: "__jasmine_TrivialReporter_showSkipped__", type: 'checkbox' }),
44   - this.createDom('label', { "for": "__jasmine_TrivialReporter_showSkipped__" }, " skipped")
45   - )
46   - ),
47   -
48   - this.runnerDiv = this.createDom('div', { className: 'runner running' },
49   - this.createDom('a', { className: 'run_spec', href: '?' }, "run all"),
50   - this.runnerMessageSpan = this.createDom('span', {}, "Running..."),
51   - this.finishedAtSpan = this.createDom('span', { className: 'finished-at' }, ""))
52   - );
53   -
54   - this.document.body.appendChild(this.outerDiv);
55   -
56   - var suites = runner.suites();
57   - for (var i = 0; i < suites.length; i++) {
58   - var suite = suites[i];
59   - var suiteDiv = this.createDom('div', { className: 'suite' },
60   - this.createDom('a', { className: 'run_spec', href: '?spec=' + encodeURIComponent(suite.getFullName()) }, "run"),
61   - this.createDom('a', { className: 'description', href: '?spec=' + encodeURIComponent(suite.getFullName()) }, suite.description));
62   - this.suiteDivs[suite.id] = suiteDiv;
63   - var parentDiv = this.outerDiv;
64   - if (suite.parentSuite) {
65   - parentDiv = this.suiteDivs[suite.parentSuite.id];
66   - }
67   - parentDiv.appendChild(suiteDiv);
68   - }
69   -
70   - this.startedAt = new Date();
71   -
72   - var self = this;
73   - showPassed.onchange = function(evt) {
74   - if (evt.target.checked) {
75   - self.outerDiv.className += ' show-passed';
76   - } else {
77   - self.outerDiv.className = self.outerDiv.className.replace(/ show-passed/, '');
78   - }
79   - };
80   -
81   - showSkipped.onchange = function(evt) {
82   - if (evt.target.checked) {
83   - self.outerDiv.className += ' show-skipped';
84   - } else {
85   - self.outerDiv.className = self.outerDiv.className.replace(/ show-skipped/, '');
86   - }
87   - };
88   -};
89   -
90   -jasmine.TrivialReporter.prototype.reportRunnerResults = function(runner) {
91   - var results = runner.results();
92   - var className = (results.failedCount > 0) ? "runner failed" : "runner passed";
93   - this.runnerDiv.setAttribute("class", className);
94   - //do it twice for IE
95   - this.runnerDiv.setAttribute("className", className);
96   - var specs = runner.specs();
97   - var specCount = 0;
98   - for (var i = 0; i < specs.length; i++) {
99   - if (this.specFilter(specs[i])) {
100   - specCount++;
101   - }
102   - }
103   - var message = "" + specCount + " spec" + (specCount == 1 ? "" : "s" ) + ", " + results.failedCount + " failure" + ((results.failedCount == 1) ? "" : "s");
104   - message += " in " + ((new Date().getTime() - this.startedAt.getTime()) / 1000) + "s";
105   - this.runnerMessageSpan.replaceChild(this.createDom('a', { className: 'description', href: '?'}, message), this.runnerMessageSpan.firstChild);
106   -
107   - this.finishedAtSpan.appendChild(document.createTextNode("Finished at " + new Date().toString()));
108   -};
109   -
110   -jasmine.TrivialReporter.prototype.reportSuiteResults = function(suite) {
111   - var results = suite.results();
112   - var status = results.passed() ? 'passed' : 'failed';
113   - if (results.totalCount == 0) { // todo: change this to check results.skipped
114   - status = 'skipped';
115   - }
116   - this.suiteDivs[suite.id].className += " " + status;
117   -};
118   -
119   -jasmine.TrivialReporter.prototype.reportSpecStarting = function(spec) {
120   - if (this.logRunningSpecs) {
121   - this.log('>> Jasmine Running ' + spec.suite.description + ' ' + spec.description + '...');
122   - }
123   -};
124   -
125   -jasmine.TrivialReporter.prototype.reportSpecResults = function(spec) {
126   - var results = spec.results();
127   - var status = results.passed() ? 'passed' : 'failed';
128   - if (results.skipped) {
129   - status = 'skipped';
130   - }
131   - var specDiv = this.createDom('div', { className: 'spec ' + status },
132   - this.createDom('a', { className: 'run_spec', href: '?spec=' + encodeURIComponent(spec.getFullName()) }, "run"),
133   - this.createDom('a', {
134   - className: 'description',
135   - href: '?spec=' + encodeURIComponent(spec.getFullName()),
136   - title: spec.getFullName()
137   - }, spec.description));
138   -
139   -
140   - var resultItems = results.getItems();
141   - var messagesDiv = this.createDom('div', { className: 'messages' });
142   - for (var i = 0; i < resultItems.length; i++) {
143   - var result = resultItems[i];
144   -
145   - if (result.type == 'log') {
146   - messagesDiv.appendChild(this.createDom('div', {className: 'resultMessage log'}, result.toString()));
147   - } else if (result.type == 'expect' && result.passed && !result.passed()) {
148   - messagesDiv.appendChild(this.createDom('div', {className: 'resultMessage fail'}, result.message));
149   -
150   - if (result.trace.stack) {
151   - messagesDiv.appendChild(this.createDom('div', {className: 'stackTrace'}, result.trace.stack));
152   - }
153   - }
154   - }
155   -
156   - if (messagesDiv.childNodes.length > 0) {
157   - specDiv.appendChild(messagesDiv);
158   - }
159   -
160   - this.suiteDivs[spec.suite.id].appendChild(specDiv);
161   -};
162   -
163   -jasmine.TrivialReporter.prototype.log = function() {
164   - var console = jasmine.getGlobal().console;
165   - if (console && console.log) console.log.apply(console, arguments);
166   -};
167   -
168   -jasmine.TrivialReporter.prototype.getLocation = function() {
169   - return this.document.location;
170   -};
171   -
172   -jasmine.TrivialReporter.prototype.specFilter = function(spec) {
173   - var paramMap = {};
174   - var params = this.getLocation().search.substring(1).split('&');
175   - for (var i = 0; i < params.length; i++) {
176   - var p = params[i].split('=');
177   - paramMap[decodeURIComponent(p[0])] = decodeURIComponent(p[1]);
178   - }
179   -
180   - if (!paramMap["spec"]) return true;
181   - return spec.getFullName().indexOf(paramMap["spec"]) == 0;
182   -};
js/lib/JSBuilder/src/generators/app/files/lib/jasmine/jasmine.css deleted
... ... @@ -1,166 +0,0 @@
1   -body {
2   - font-family: "Helvetica Neue Light", "Lucida Grande", "Calibri", "Arial", sans-serif;
3   -}
4   -
5   -
6   -.jasmine_reporter a:visited, .jasmine_reporter a {
7   - color: #303;
8   -}
9   -
10   -.jasmine_reporter a:hover, .jasmine_reporter a:active {
11   - color: blue;
12   -}
13   -
14   -.run_spec {
15   - float:right;
16   - padding-right: 5px;
17   - font-size: .8em;
18   - text-decoration: none;
19   -}
20   -
21   -.jasmine_reporter {
22   - margin: 0 5px;
23   -}
24   -
25   -.banner {
26   - color: #303;
27   - background-color: #fef;
28   - padding: 5px;
29   -}
30   -
31   -.logo {
32   - float: left;
33   - font-size: 1.1em;
34   - padding-left: 5px;
35   -}
36   -
37   -.logo .version {
38   - font-size: .6em;
39   - padding-left: 1em;
40   -}
41   -
42   -.runner.running {
43   - background-color: yellow;
44   -}
45   -
46   -
47   -.options {
48   - text-align: right;
49   - font-size: .8em;
50   -}
51   -
52   -
53   -
54   -
55   -.suite {
56   - border: 1px outset gray;
57   - margin: 5px 0;
58   - padding-left: 1em;
59   -}
60   -
61   -.suite .suite {
62   - margin: 5px;
63   -}
64   -
65   -.suite.passed {
66   - background-color: #dfd;
67   -}
68   -
69   -.suite.failed {
70   - background-color: #fdd;
71   -}
72   -
73   -.spec {
74   - margin: 5px;
75   - padding-left: 1em;
76   - clear: both;
77   -}
78   -
79   -.spec.failed, .spec.passed, .spec.skipped {
80   - padding-bottom: 5px;
81   - border: 1px solid gray;
82   -}
83   -
84   -.spec.failed {
85   - background-color: #fbb;
86   - border-color: red;
87   -}
88   -
89   -.spec.passed {
90   - background-color: #bfb;
91   - border-color: green;
92   -}
93   -
94   -.spec.skipped {
95   - background-color: #bbb;
96   -}
97   -
98   -.messages {
99   - border-left: 1px dashed gray;
100   - padding-left: 1em;
101   - padding-right: 1em;
102   -}
103   -
104   -.passed {
105   - background-color: #cfc;
106   - display: none;
107   -}
108   -
109   -.failed {
110   - background-color: #fbb;
111   -}
112   -
113   -.skipped {
114   - color: #777;
115   - background-color: #eee;
116   - display: none;
117   -}
118   -
119   -
120   -/*.resultMessage {*/
121   - /*white-space: pre;*/
122   -/*}*/
123   -
124   -.resultMessage span.result {
125   - display: block;
126   - line-height: 2em;
127   - color: black;
128   -}
129   -
130   -.resultMessage .mismatch {
131   - color: black;
132   -}
133   -
134   -.stackTrace {
135   - white-space: pre;
136   - font-size: .8em;
137   - margin-left: 10px;
138   - max-height: 5em;
139   - overflow: auto;
140   - border: 1px inset red;
141   - padding: 1em;
142   - background: #eef;
143   -}
144   -
145   -.finished-at {
146   - padding-left: 1em;
147   - font-size: .6em;
148   -}
149   -
150   -.show-passed .passed,
151   -.show-skipped .skipped {
152   - display: block;
153   -}
154   -
155   -
156   -#jasmine_content {
157   - position:fixed;
158   - right: 100%;
159   -}
160   -
161   -.runner {
162   - border: 1px solid gray;
163   - display: block;
164   - margin: 5px 0;
165   - padding: 2px 0 2px 10px;
166   -}
js/lib/JSBuilder/src/generators/app/files/lib/jasmine/jasmine.js deleted
... ... @@ -1,2421 +0,0 @@
1   -/**
2   - * Top level namespace for Jasmine, a lightweight JavaScript BDD/spec/testing framework.
3   - *
4   - * @namespace
5   - */
6   -var jasmine = {};
7   -
8   -/**
9   - * @private
10   - */
11   -jasmine.unimplementedMethod_ = function() {
12   - throw new Error("unimplemented method");
13   -};
14   -
15   -/**
16   - * Use <code>jasmine.undefined</code> instead of <code>undefined</code>, since <code>undefined</code> is just
17   - * a plain old variable and may be redefined by somebody else.
18   - *
19   - * @private
20   - */
21   -jasmine.undefined = jasmine.___undefined___;
22   -
23   -/**
24   - * Default interval in milliseconds for event loop yields (e.g. to allow network activity or to refresh the screen with the HTML-based runner). Small values here may result in slow test running. Zero means no updates until all tests have completed.
25   - *
26   - */
27   -jasmine.DEFAULT_UPDATE_INTERVAL = 250;
28   -
29   -/**
30   - * Default timeout interval in milliseconds for waitsFor() blocks.
31   - */
32   -jasmine.DEFAULT_TIMEOUT_INTERVAL = 5000;
33   -
34   -jasmine.getGlobal = function() {
35   - function getGlobal() {
36   - return this;
37   - }
38   -
39   - return getGlobal();
40   -};
41   -
42   -/**
43   - * Allows for bound functions to be compared. Internal use only.
44   - *
45   - * @ignore
46   - * @private
47   - * @param base {Object} bound 'this' for the function
48   - * @param name {Function} function to find
49   - */
50   -jasmine.bindOriginal_ = function(base, name) {
51   - var original = base[name];
52   - if (original.apply) {
53   - return function() {
54   - return original.apply(base, arguments);
55   - };
56   - } else {
57   - // IE support
58   - return jasmine.getGlobal()[name];
59   - }
60   -};
61   -
62   -jasmine.setTimeout = jasmine.bindOriginal_(jasmine.getGlobal(), 'setTimeout');
63   -jasmine.clearTimeout = jasmine.bindOriginal_(jasmine.getGlobal(), 'clearTimeout');
64   -jasmine.setInterval = jasmine.bindOriginal_(jasmine.getGlobal(), 'setInterval');
65   -jasmine.clearInterval = jasmine.bindOriginal_(jasmine.getGlobal(), 'clearInterval');
66   -
67   -jasmine.MessageResult = function(values) {
68   - this.type = 'log';
69   - this.values = values;
70   - this.trace = new Error(); // todo: test better
71   -};
72   -
73   -jasmine.MessageResult.prototype.toString = function() {
74   - var text = "";
75   - for(var i = 0; i < this.values.length; i++) {
76   - if (i > 0) text += " ";
77   - if (jasmine.isString_(this.values[i])) {
78   - text += this.values[i];
79   - } else {
80   - text += jasmine.pp(this.values[i]);
81   - }
82   - }
83   - return text;
84   -};
85   -
86   -jasmine.ExpectationResult = function(params) {
87   - this.type = 'expect';
88   - this.matcherName = params.matcherName;
89   - this.passed_ = params.passed;
90   - this.expected = params.expected;
91   - this.actual = params.actual;
92   -
93   - this.message = this.passed_ ? 'Passed.' : params.message;
94   - this.trace = this.passed_ ? '' : new Error(this.message);
95   -};
96   -
97   -jasmine.ExpectationResult.prototype.toString = function () {
98   - return this.message;
99   -};
100   -
101   -jasmine.ExpectationResult.prototype.passed = function () {
102   - return this.passed_;
103   -};
104   -
105   -/**
106   - * Getter for the Jasmine environment. Ensures one gets created
107   - */
108   -jasmine.getEnv = function() {
109   - return jasmine.currentEnv_ = jasmine.currentEnv_ || new jasmine.Env();
110   -};
111   -
112   -/**
113   - * @ignore
114   - * @private
115   - * @param value
116   - * @returns {Boolean}
117   - */
118   -jasmine.isArray_ = function(value) {
119   - return jasmine.isA_("Array", value);
120   -};
121   -
122   -/**
123   - * @ignore
124   - * @private
125   - * @param value
126   - * @returns {Boolean}
127   - */
128   -jasmine.isString_ = function(value) {
129   - return jasmine.isA_("String", value);
130   -};
131   -
132   -/**
133   - * @ignore
134   - * @private
135   - * @param value
136   - * @returns {Boolean}
137   - */
138   -jasmine.isNumber_ = function(value) {
139   - return jasmine.isA_("Number", value);
140   -};
141   -
142   -/**
143   - * @ignore
144   - * @private
145   - * @param {String} typeName
146   - * @param value
147   - * @returns {Boolean}
148   - */
149   -jasmine.isA_ = function(typeName, value) {
150   - return Object.prototype.toString.apply(value) === '[object ' + typeName + ']';
151   -};
152   -
153   -/**
154   - * Pretty printer for expecations. Takes any object and turns it into a human-readable string.
155   - *
156   - * @param value {Object} an object to be outputted
157   - * @returns {String}
158   - */
159   -jasmine.pp = function(value) {
160   - var stringPrettyPrinter = new jasmine.StringPrettyPrinter();
161   - stringPrettyPrinter.format(value);
162   - return stringPrettyPrinter.string;
163   -};
164   -
165   -/**
166   - * Returns true if the object is a DOM Node.
167   - *
168   - * @param {Object} obj object to check
169   - * @returns {Boolean}
170   - */
171   -jasmine.isDomNode = function(obj) {
172   - return obj['nodeType'] > 0;
173   -};
174   -
175   -/**
176   - * Returns a matchable 'generic' object of the class type. For use in expecations of type when values don't matter.
177   - *
178   - * @example
179   - * // don't care about which function is passed in, as long as it's a function
180   - * expect(mySpy).toHaveBeenCalledWith(jasmine.any(Function));
181   - *
182   - * @param {Class} clazz
183   - * @returns matchable object of the type clazz
184   - */
185   -jasmine.any = function(clazz) {
186   - return new jasmine.Matchers.Any(clazz);
187   -};
188   -
189   -/**
190   - * Jasmine Spies are test doubles that can act as stubs, spies, fakes or when used in an expecation, mocks.
191   - *
192   - * Spies should be created in test setup, before expectations. They can then be checked, using the standard Jasmine
193   - * expectation syntax. Spies can be checked if they were called or not and what the calling params were.
194   - *
195   - * A Spy has the following fields: wasCalled, callCount, mostRecentCall, and argsForCall (see docs).
196   - *
197   - * Spies are torn down at the end of every spec.
198   - *
199   - * Note: Do <b>not</b> call new jasmine.Spy() directly - a spy must be created using spyOn, jasmine.createSpy or jasmine.createSpyObj.
200   - *
201   - * @example
202   - * // a stub
203   - * var myStub = jasmine.createSpy('myStub'); // can be used anywhere
204   - *
205   - * // spy example
206   - * var foo = {
207   - * not: function(bool) { return !bool; }
208   - * }
209   - *
210   - * // actual foo.not will not be called, execution stops
211   - * spyOn(foo, 'not');
212   -
213   - // foo.not spied upon, execution will continue to implementation
214   - * spyOn(foo, 'not').andCallThrough();
215   - *
216   - * // fake example
217   - * var foo = {
218   - * not: function(bool) { return !bool; }
219   - * }
220   - *
221   - * // foo.not(val) will return val
222   - * spyOn(foo, 'not').andCallFake(function(value) {return value;});
223   - *
224   - * // mock example
225   - * foo.not(7 == 7);
226   - * expect(foo.not).toHaveBeenCalled();
227   - * expect(foo.not).toHaveBeenCalledWith(true);
228   - *
229   - * @constructor
230   - * @see spyOn, jasmine.createSpy, jasmine.createSpyObj
231   - * @param {String} name
232   - */
233   -jasmine.Spy = function(name) {
234   - /**
235   - * The name of the spy, if provided.
236   - */
237   - this.identity = name || 'unknown';
238   - /**
239   - * Is this Object a spy?
240   - */
241   - this.isSpy = true;
242   - /**
243   - * The actual function this spy stubs.
244   - */
245   - this.plan = function() {
246   - };
247   - /**
248   - * Tracking of the most recent call to the spy.
249   - * @example
250   - * var mySpy = jasmine.createSpy('foo');
251   - * mySpy(1, 2);
252   - * mySpy.mostRecentCall.args = [1, 2];
253   - */
254   - this.mostRecentCall = {};
255   -
256   - /**
257   - * Holds arguments for each call to the spy, indexed by call count
258   - * @example
259   - * var mySpy = jasmine.createSpy('foo');
260   - * mySpy(1, 2);
261   - * mySpy(7, 8);
262   - * mySpy.mostRecentCall.args = [7, 8];
263   - * mySpy.argsForCall[0] = [1, 2];
264   - * mySpy.argsForCall[1] = [7, 8];
265   - */
266   - this.argsForCall = [];
267   - this.calls = [];
268   -};
269   -
270   -/**
271   - * Tells a spy to call through to the actual implemenatation.
272   - *
273   - * @example
274   - * var foo = {
275   - * bar: function() { // do some stuff }
276   - * }
277   - *
278   - * // defining a spy on an existing property: foo.bar
279   - * spyOn(foo, 'bar').andCallThrough();
280   - */
281   -jasmine.Spy.prototype.andCallThrough = function() {
282   - this.plan = this.originalValue;
283   - return this;
284   -};
285   -
286   -/**
287   - * For setting the return value of a spy.
288   - *
289   - * @example
290   - * // defining a spy from scratch: foo() returns 'baz'
291   - * var foo = jasmine.createSpy('spy on foo').andReturn('baz');
292   - *
293   - * // defining a spy on an existing property: foo.bar() returns 'baz'
294   - * spyOn(foo, 'bar').andReturn('baz');
295   - *
296   - * @param {Object} value
297   - */
298   -jasmine.Spy.prototype.andReturn = function(value) {
299   - this.plan = function() {
300   - return value;
301   - };
302   - return this;
303   -};
304   -
305   -/**
306   - * For throwing an exception when a spy is called.
307   - *
308   - * @example
309   - * // defining a spy from scratch: foo() throws an exception w/ message 'ouch'
310   - * var foo = jasmine.createSpy('spy on foo').andThrow('baz');
311   - *
312   - * // defining a spy on an existing property: foo.bar() throws an exception w/ message 'ouch'
313   - * spyOn(foo, 'bar').andThrow('baz');
314   - *
315   - * @param {String} exceptionMsg
316   - */
317   -jasmine.Spy.prototype.andThrow = function(exceptionMsg) {
318   - this.plan = function() {
319   - throw exceptionMsg;
320   - };
321   - return this;
322   -};
323   -
324   -/**
325   - * Calls an alternate implementation when a spy is called.
326   - *
327   - * @example
328   - * var baz = function() {
329   - * // do some stuff, return something
330   - * }
331   - * // defining a spy from scratch: foo() calls the function baz
332   - * var foo = jasmine.createSpy('spy on foo').andCall(baz);
333   - *
334   - * // defining a spy on an existing property: foo.bar() calls an anonymnous function
335   - * spyOn(foo, 'bar').andCall(function() { return 'baz';} );
336   - *
337   - * @param {Function} fakeFunc
338   - */
339   -jasmine.Spy.prototype.andCallFake = function(fakeFunc) {
340   - this.plan = fakeFunc;
341   - return this;
342   -};
343   -
344   -/**
345   - * Resets all of a spy's the tracking variables so that it can be used again.
346   - *
347   - * @example
348   - * spyOn(foo, 'bar');
349   - *
350   - * foo.bar();
351   - *
352   - * expect(foo.bar.callCount).toEqual(1);
353   - *
354   - * foo.bar.reset();
355   - *
356   - * expect(foo.bar.callCount).toEqual(0);
357   - */
358   -jasmine.Spy.prototype.reset = function() {
359   - this.wasCalled = false;
360   - this.callCount = 0;
361   - this.argsForCall = [];
362   - this.calls = [];
363   - this.mostRecentCall = {};
364   -};
365   -
366   -jasmine.createSpy = function(name) {
367   -
368   - var spyObj = function() {
369   - spyObj.wasCalled = true;
370   - spyObj.callCount++;
371   - var args = jasmine.util.argsToArray(arguments);
372   - spyObj.mostRecentCall.object = this;
373   - spyObj.mostRecentCall.args = args;
374   - spyObj.argsForCall.push(args);
375   - spyObj.calls.push({object: this, args: args});
376   - return spyObj.plan.apply(this, arguments);
377   - };
378   -
379   - var spy = new jasmine.Spy(name);
380   -
381   - for (var prop in spy) {
382   - spyObj[prop] = spy[prop];
383   - }
384   -
385   - spyObj.reset();
386   -
387   - return spyObj;
388   -};
389   -
390   -/**
391   - * Determines whether an object is a spy.
392   - *
393   - * @param {jasmine.Spy|Object} putativeSpy
394   - * @returns {Boolean}
395   - */
396   -jasmine.isSpy = function(putativeSpy) {
397   - return putativeSpy && putativeSpy.isSpy;
398   -};
399   -
400   -/**
401   - * Creates a more complicated spy: an Object that has every property a function that is a spy. Used for stubbing something
402   - * large in one call.
403   - *
404   - * @param {String} baseName name of spy class
405   - * @param {Array} methodNames array of names of methods to make spies
406   - */
407   -jasmine.createSpyObj = function(baseName, methodNames) {
408   - if (!jasmine.isArray_(methodNames) || methodNames.length == 0) {
409   - throw new Error('createSpyObj requires a non-empty array of method names to create spies for');
410   - }
411   - var obj = {};
412   - for (var i = 0; i < methodNames.length; i++) {
413   - obj[methodNames[i]] = jasmine.createSpy(baseName + '.' + methodNames[i]);
414   - }
415   - return obj;
416   -};
417   -
418   -/**
419   - * All parameters are pretty-printed and concatenated together, then written to the current spec's output.
420   - *
421   - * Be careful not to leave calls to <code>jasmine.log</code> in production code.
422   - */
423   -jasmine.log = function() {
424   - var spec = jasmine.getEnv().currentSpec;
425   - spec.log.apply(spec, arguments);
426   -};
427   -
428   -/**
429   - * Function that installs a spy on an existing object's method name. Used within a Spec to create a spy.
430   - *
431   - * @example
432   - * // spy example
433   - * var foo = {
434   - * not: function(bool) { return !bool; }
435   - * }
436   - * spyOn(foo, 'not'); // actual foo.not will not be called, execution stops
437   - *
438   - * @see jasmine.createSpy
439   - * @param obj
440   - * @param methodName
441   - * @returns a Jasmine spy that can be chained with all spy methods
442   - */
443   -var spyOn = function(obj, methodName) {
444   - return jasmine.getEnv().currentSpec.spyOn(obj, methodName);
445   -};
446   -
447   -/**
448   - * Creates a Jasmine spec that will be added to the current suite.
449   - *
450   - * // TODO: pending tests
451   - *
452   - * @example
453   - * it('should be true', function() {
454   - * expect(true).toEqual(true);
455   - * });
456   - *
457   - * @param {String} desc description of this specification
458   - * @param {Function} func defines the preconditions and expectations of the spec
459   - */
460   -var it = function(desc, func) {
461   - return jasmine.getEnv().it(desc, func);
462   -};
463   -
464   -/**
465   - * Creates a <em>disabled</em> Jasmine spec.
466   - *
467   - * A convenience method that allows existing specs to be disabled temporarily during development.
468   - *
469   - * @param {String} desc description of this specification
470   - * @param {Function} func defines the preconditions and expectations of the spec
471   - */
472   -var xit = function(desc, func) {
473   - return jasmine.getEnv().xit(desc, func);
474   -};
475   -
476   -/**
477   - * Starts a chain for a Jasmine expectation.
478   - *
479   - * It is passed an Object that is the actual value and should chain to one of the many
480   - * jasmine.Matchers functions.
481   - *
482   - * @param {Object} actual Actual value to test against and expected value
483   - */
484   -var expect = function(actual) {
485   - return jasmine.getEnv().currentSpec.expect(actual);
486   -};
487   -
488   -/**
489   - * Defines part of a jasmine spec. Used in cominbination with waits or waitsFor in asynchrnous specs.
490   - *
491   - * @param {Function} func Function that defines part of a jasmine spec.
492   - */
493   -var runs = function(func) {
494   - jasmine.getEnv().currentSpec.runs(func);
495   -};
496   -
497   -/**
498   - * Waits a fixed time period before moving to the next block.
499   - *
500   - * @deprecated Use waitsFor() instead
501   - * @param {Number} timeout milliseconds to wait
502   - */
503   -var waits = function(timeout) {
504   - jasmine.getEnv().currentSpec.waits(timeout);
505   -};
506   -
507   -/**
508   - * Waits for the latchFunction to return true before proceeding to the next block.
509   - *
510   - * @param {Function} latchFunction
511   - * @param {String} optional_timeoutMessage
512   - * @param {Number} optional_timeout
513   - */
514   -var waitsFor = function(latchFunction, optional_timeoutMessage, optional_timeout) {
515   - jasmine.getEnv().currentSpec.waitsFor.apply(jasmine.getEnv().currentSpec, arguments);
516   -};
517   -
518   -/**
519   - * A function that is called before each spec in a suite.
520   - *
521   - * Used for spec setup, including validating assumptions.
522   - *
523   - * @param {Function} beforeEachFunction
524   - */
525   -var beforeEach = function(beforeEachFunction) {
526   - jasmine.getEnv().beforeEach(beforeEachFunction);
527   -};
528   -
529   -/**
530   - * A function that is called after each spec in a suite.
531   - *
532   - * Used for restoring any state that is hijacked during spec execution.
533   - *
534   - * @param {Function} afterEachFunction
535   - */
536   -var afterEach = function(afterEachFunction) {
537   - jasmine.getEnv().afterEach(afterEachFunction);
538   -};
539   -
540   -/**
541   - * Defines a suite of specifications.
542   - *
543   - * Stores the description and all defined specs in the Jasmine environment as one suite of specs. Variables declared
544   - * are accessible by calls to beforeEach, it, and afterEach. Describe blocks can be nested, allowing for specialization
545   - * of setup in some tests.
546   - *
547   - * @example
548   - * // TODO: a simple suite
549   - *
550   - * // TODO: a simple suite with a nested describe block
551   - *
552   - * @param {String} description A string, usually the class under test.
553   - * @param {Function} specDefinitions function that defines several specs.
554   - */
555   -var describe = function(description, specDefinitions) {
556   - return jasmine.getEnv().describe(description, specDefinitions);
557   -};
558   -
559   -/**
560   - * Disables a suite of specifications. Used to disable some suites in a file, or files, temporarily during development.
561   - *
562   - * @param {String} description A string, usually the class under test.
563   - * @param {Function} specDefinitions function that defines several specs.
564   - */
565   -var xdescribe = function(description, specDefinitions) {
566   - return jasmine.getEnv().xdescribe(description, specDefinitions);
567   -};
568   -
569   -
570   -// Provide the XMLHttpRequest class for IE 5.x-6.x:
571   -jasmine.XmlHttpRequest = (typeof XMLHttpRequest == "undefined") ? function() {
572   - try {
573   - return new ActiveXObject("Msxml2.XMLHTTP.6.0");
574   - } catch(e) {
575   - }
576   - try {
577   - return new ActiveXObject("Msxml2.XMLHTTP.3.0");
578   - } catch(e) {
579   - }
580   - try {
581   - return new ActiveXObject("Msxml2.XMLHTTP");
582   - } catch(e) {
583   - }
584   - try {
585   - return new ActiveXObject("Microsoft.XMLHTTP");
586   - } catch(e) {
587   - }
588   - throw new Error("This browser does not support XMLHttpRequest.");
589   -} : XMLHttpRequest;
590   -/**
591   - * @namespace
592   - */
593   -jasmine.util = {};
594   -
595   -/**
596   - * Declare that a child class inherit it's prototype from the parent class.
597   - *
598   - * @private
599   - * @param {Function} childClass
600   - * @param {Function} parentClass
601   - */
602   -jasmine.util.inherit = function(childClass, parentClass) {
603   - /**
604   - * @private
605   - */
606   - var subclass = function() {
607   - };
608   - subclass.prototype = parentClass.prototype;
609   - childClass.prototype = new subclass;
610   -};
611   -
612   -jasmine.util.formatException = function(e) {
613   - var lineNumber;
614   - if (e.line) {
615   - lineNumber = e.line;
616   - }
617   - else if (e.lineNumber) {
618   - lineNumber = e.lineNumber;
619   - }
620   -
621   - var file;
622   -
623   - if (e.sourceURL) {
624   - file = e.sourceURL;
625   - }
626   - else if (e.fileName) {
627   - file = e.fileName;
628   - }
629   -
630   - var message = (e.name && e.message) ? (e.name + ': ' + e.message) : e.toString();
631   -
632   - if (file && lineNumber) {
633   - message += ' in ' + file + ' (line ' + lineNumber + ')';
634   - }
635   -
636   - return message;
637   -};
638   -
639   -jasmine.util.htmlEscape = function(str) {
640   - if (!str) return str;
641   - return str.replace(/&/g, '&amp;')
642   - .replace(/</g, '&lt;')
643   - .replace(/>/g, '&gt;');
644   -};
645   -
646   -jasmine.util.argsToArray = function(args) {
647   - var arrayOfArgs = [];
648   - for (var i = 0; i < args.length; i++) arrayOfArgs.push(args[i]);
649   - return arrayOfArgs;
650   -};
651   -
652   -jasmine.util.extend = function(destination, source) {
653   - for (var property in source) destination[property] = source[property];
654   - return destination;
655   -};
656   -
657   -/**
658   - * Environment for Jasmine
659   - *
660   - * @constructor
661   - */
662   -jasmine.Env = function() {
663   - this.currentSpec = null;
664   - this.currentSuite = null;
665   - this.currentRunner_ = new jasmine.Runner(this);
666   -
667   - this.reporter = new jasmine.MultiReporter();
668   -
669   - this.updateInterval = jasmine.DEFAULT_UPDATE_INTERVAL;
670   - this.defaultTimeoutInterval = jasmine.DEFAULT_TIMEOUT_INTERVAL;
671   - this.lastUpdate = 0;
672   - this.specFilter = function() {
673   - return true;
674   - };
675   -
676   - this.nextSpecId_ = 0;
677   - this.nextSuiteId_ = 0;
678   - this.equalityTesters_ = [];
679   -
680   - // wrap matchers
681   - this.matchersClass = function() {
682   - jasmine.Matchers.apply(this, arguments);
683   - };
684   - jasmine.util.inherit(this.matchersClass, jasmine.Matchers);
685   -
686   - jasmine.Matchers.wrapInto_(jasmine.Matchers.prototype, this.matchersClass);
687   -};
688   -
689   -
690   -jasmine.Env.prototype.setTimeout = jasmine.setTimeout;
691   -jasmine.Env.prototype.clearTimeout = jasmine.clearTimeout;
692   -jasmine.Env.prototype.setInterval = jasmine.setInterval;
693   -jasmine.Env.prototype.clearInterval = jasmine.clearInterval;
694   -
695   -/**
696   - * @returns an object containing jasmine version build info, if set.
697   - */
698   -jasmine.Env.prototype.version = function () {
699   - if (jasmine.version_) {
700   - return jasmine.version_;
701   - } else {
702   - throw new Error('Version not set');
703   - }
704   -};
705   -
706   -/**
707   - * @returns string containing jasmine version build info, if set.
708   - */
709   -jasmine.Env.prototype.versionString = function() {
710   - if (jasmine.version_) {
711   - var version = this.version();
712   - return version.major + "." + version.minor + "." + version.build + " revision " + version.revision;
713   - } else {
714   - return "version unknown";
715   - }
716   -};
717   -
718   -/**
719   - * @returns a sequential integer starting at 0
720   - */
721   -jasmine.Env.prototype.nextSpecId = function () {
722   - return this.nextSpecId_++;
723   -};
724   -
725   -/**
726   - * @returns a sequential integer starting at 0
727   - */
728   -jasmine.Env.prototype.nextSuiteId = function () {
729   - return this.nextSuiteId_++;
730   -};
731   -
732   -/**
733   - * Register a reporter to receive status updates from Jasmine.
734   - * @param {jasmine.Reporter} reporter An object which will receive status updates.
735   - */
736   -jasmine.Env.prototype.addReporter = function(reporter) {
737   - this.reporter.addReporter(reporter);
738   -};
739   -
740   -jasmine.Env.prototype.execute = function() {
741   - this.currentRunner_.execute();
742   -};
743   -
744   -jasmine.Env.prototype.describe = function(description, specDefinitions) {
745   - var suite = new jasmine.Suite(this, description, specDefinitions, this.currentSuite);
746   -
747   - var parentSuite = this.currentSuite;
748   - if (parentSuite) {
749   - parentSuite.add(suite);
750   - } else {
751   - this.currentRunner_.add(suite);
752   - }
753   -
754   - this.currentSuite = suite;
755   -
756   - var declarationError = null;
757   - try {
758   - specDefinitions.call(suite);
759   - } catch(e) {
760   - declarationError = e;
761   - }
762   -
763   - this.currentSuite = parentSuite;
764   -
765   - if (declarationError) {
766   - this.it("encountered a declaration exception", function() {
767   - throw declarationError;
768   - });
769   - }
770   -
771   - return suite;
772   -};
773   -
774   -jasmine.Env.prototype.beforeEach = function(beforeEachFunction) {
775   - if (this.currentSuite) {
776   - this.currentSuite.beforeEach(beforeEachFunction);
777   - } else {
778   - this.currentRunner_.beforeEach(beforeEachFunction);
779   - }
780   -};
781   -
782   -jasmine.Env.prototype.currentRunner = function () {
783   - return this.currentRunner_;
784   -};
785   -
786   -jasmine.Env.prototype.afterEach = function(afterEachFunction) {
787   - if (this.currentSuite) {
788   - this.currentSuite.afterEach(afterEachFunction);
789   - } else {
790   - this.currentRunner_.afterEach(afterEachFunction);
791   - }
792   -
793   -};
794   -
795   -jasmine.Env.prototype.xdescribe = function(desc, specDefinitions) {
796   - return {
797   - execute: function() {
798   - }
799   - };
800   -};
801   -
802   -jasmine.Env.prototype.it = function(description, func) {
803   - var spec = new jasmine.Spec(this, this.currentSuite, description);
804   - this.currentSuite.add(spec);
805   - this.currentSpec = spec;
806   -
807   - if (func) {
808   - spec.runs(func);
809   - }
810   -
811   - return spec;
812   -};
813   -
814   -jasmine.Env.prototype.xit = function(desc, func) {
815   - return {
816   - id: this.nextSpecId(),
817   - runs: function() {
818   - }
819   - };
820   -};
821   -
822   -jasmine.Env.prototype.compareObjects_ = function(a, b, mismatchKeys, mismatchValues) {
823   - if (a.__Jasmine_been_here_before__ === b && b.__Jasmine_been_here_before__ === a) {
824   - return true;
825   - }
826   -
827   - a.__Jasmine_been_here_before__ = b;
828   - b.__Jasmine_been_here_before__ = a;
829   -
830   - var hasKey = function(obj, keyName) {
831   - return obj != null && obj[keyName] !== jasmine.undefined;
832   - };
833   -
834   - for (var property in b) {
835   - if (!hasKey(a, property) && hasKey(b, property)) {
836   - mismatchKeys.push("expected has key '" + property + "', but missing from actual.");
837   - }
838   - }
839   - for (property in a) {
840   - if (!hasKey(b, property) && hasKey(a, property)) {
841   - mismatchKeys.push("expected missing key '" + property + "', but present in actual.");
842   - }
843   - }
844   - for (property in b) {
845   - if (property == '__Jasmine_been_here_before__') continue;
846   - if (!this.equals_(a[property], b[property], mismatchKeys, mismatchValues)) {
847   - mismatchValues.push("'" + property + "' was '" + (b[property] ? jasmine.util.htmlEscape(b[property].toString()) : b[property]) + "' in expected, but was '" + (a[property] ? jasmine.util.htmlEscape(a[property].toString()) : a[property]) + "' in actual.");
848   - }
849   - }
850   -
851   - if (jasmine.isArray_(a) && jasmine.isArray_(b) && a.length != b.length) {
852   - mismatchValues.push("arrays were not the same length");
853   - }
854   -
855   - delete a.__Jasmine_been_here_before__;
856   - delete b.__Jasmine_been_here_before__;
857   - return (mismatchKeys.length == 0 && mismatchValues.length == 0);
858   -};
859   -
860   -jasmine.Env.prototype.equals_ = function(a, b, mismatchKeys, mismatchValues) {
861   - mismatchKeys = mismatchKeys || [];
862   - mismatchValues = mismatchValues || [];
863   -
864   - for (var i = 0; i < this.equalityTesters_.length; i++) {
865   - var equalityTester = this.equalityTesters_[i];
866   - var result = equalityTester(a, b, this, mismatchKeys, mismatchValues);
867   - if (result !== jasmine.undefined) return result;
868   - }
869   -
870   - if (a === b) return true;
871   -
872   - if (a === jasmine.undefined || a === null || b === jasmine.undefined || b === null) {
873   - return (a == jasmine.undefined && b == jasmine.undefined);
874   - }
875   -
876   - if (jasmine.isDomNode(a) && jasmine.isDomNode(b)) {
877   - return a === b;
878   - }
879   -
880   - if (a instanceof Date && b instanceof Date) {
881   - return a.getTime() == b.getTime();
882   - }
883   -
884   - if (a instanceof jasmine.Matchers.Any) {
885   - return a.matches(b);
886   - }
887   -
888   - if (b instanceof jasmine.Matchers.Any) {
889   - return b.matches(a);
890   - }
891   -
892   - if (jasmine.isString_(a) && jasmine.isString_(b)) {
893   - return (a == b);
894   - }
895   -
896   - if (jasmine.isNumber_(a) && jasmine.isNumber_(b)) {
897   - return (a == b);
898   - }
899   -
900   - if (typeof a === "object" && typeof b === "object") {
901   - return this.compareObjects_(a, b, mismatchKeys, mismatchValues);
902   - }
903   -
904   - //Straight check
905   - return (a === b);
906   -};
907   -
908   -jasmine.Env.prototype.contains_ = function(haystack, needle) {
909   - if (jasmine.isArray_(haystack)) {
910   - for (var i = 0; i < haystack.length; i++) {
911   - if (this.equals_(haystack[i], needle)) return true;
912   - }
913   - return false;
914   - }
915   - return haystack.indexOf(needle) >= 0;
916   -};
917   -
918   -jasmine.Env.prototype.addEqualityTester = function(equalityTester) {
919   - this.equalityTesters_.push(equalityTester);
920   -};
921   -/** No-op base class for Jasmine reporters.
922   - *
923   - * @constructor
924   - */
925   -jasmine.Reporter = function() {
926   -};
927   -
928   -//noinspection JSUnusedLocalSymbols
929   -jasmine.Reporter.prototype.reportRunnerStarting = function(runner) {
930   -};
931   -
932   -//noinspection JSUnusedLocalSymbols
933   -jasmine.Reporter.prototype.reportRunnerResults = function(runner) {
934   -};
935   -
936   -//noinspection JSUnusedLocalSymbols
937   -jasmine.Reporter.prototype.reportSuiteResults = function(suite) {
938   -};
939   -
940   -//noinspection JSUnusedLocalSymbols
941   -jasmine.Reporter.prototype.reportSpecStarting = function(spec) {
942   -};
943   -
944   -//noinspection JSUnusedLocalSymbols
945   -jasmine.Reporter.prototype.reportSpecResults = function(spec) {
946   -};
947   -
948   -//noinspection JSUnusedLocalSymbols
949   -jasmine.Reporter.prototype.log = function(str) {
950   -};
951   -
952   -/**
953   - * Blocks are functions with executable code that make up a spec.
954   - *
955   - * @constructor
956   - * @param {jasmine.Env} env
957   - * @param {Function} func
958   - * @param {jasmine.Spec} spec
959   - */
960   -jasmine.Block = function(env, func, spec) {
961   - this.env = env;
962   - this.func = func;
963   - this.spec = spec;
964   -};
965   -
966   -jasmine.Block.prototype.execute = function(onComplete) {
967   - try {
968   - this.func.apply(this.spec);
969   - } catch (e) {
970   - this.spec.fail(e);
971   - }
972   - onComplete();
973   -};
974   -/** JavaScript API reporter.
975   - *
976   - * @constructor
977   - */
978   -jasmine.JsApiReporter = function() {
979   - this.started = false;
980   - this.finished = false;
981   - this.suites_ = [];
982   - this.results_ = {};
983   -};
984   -
985   -jasmine.JsApiReporter.prototype.reportRunnerStarting = function(runner) {
986   - this.started = true;
987   - var suites = runner.topLevelSuites();
988   - for (var i = 0; i < suites.length; i++) {
989   - var suite = suites[i];
990   - this.suites_.push(this.summarize_(suite));
991   - }
992   -};
993   -
994   -jasmine.JsApiReporter.prototype.suites = function() {
995   - return this.suites_;
996   -};
997   -
998   -jasmine.JsApiReporter.prototype.summarize_ = function(suiteOrSpec) {
999   - var isSuite = suiteOrSpec instanceof jasmine.Suite;
1000   - var summary = {
1001   - id: suiteOrSpec.id,
1002   - name: suiteOrSpec.description,
1003   - type: isSuite ? 'suite' : 'spec',
1004   - children: []
1005   - };
1006   -
1007   - if (isSuite) {
1008   - var children = suiteOrSpec.children();
1009   - for (var i = 0; i < children.length; i++) {
1010   - summary.children.push(this.summarize_(children[i]));
1011   - }
1012   - }
1013   - return summary;
1014   -};
1015   -
1016   -jasmine.JsApiReporter.prototype.results = function() {
1017   - return this.results_;
1018   -};
1019   -
1020   -jasmine.JsApiReporter.prototype.resultsForSpec = function(specId) {
1021   - return this.results_[specId];
1022   -};
1023   -
1024   -//noinspection JSUnusedLocalSymbols
1025   -jasmine.JsApiReporter.prototype.reportRunnerResults = function(runner) {
1026   - this.finished = true;
1027   -};
1028   -
1029   -//noinspection JSUnusedLocalSymbols
1030   -jasmine.JsApiReporter.prototype.reportSuiteResults = function(suite) {
1031   -};
1032   -
1033   -//noinspection JSUnusedLocalSymbols
1034   -jasmine.JsApiReporter.prototype.reportSpecResults = function(spec) {
1035   - this.results_[spec.id] = {
1036   - messages: spec.results().getItems(),
1037   - result: spec.results().failedCount > 0 ? "failed" : "passed"
1038   - };
1039   -};
1040   -
1041   -//noinspection JSUnusedLocalSymbols
1042   -jasmine.JsApiReporter.prototype.log = function(str) {
1043   -};
1044   -
1045   -jasmine.JsApiReporter.prototype.resultsForSpecs = function(specIds){
1046   - var results = {};
1047   - for (var i = 0; i < specIds.length; i++) {
1048   - var specId = specIds[i];
1049   - results[specId] = this.summarizeResult_(this.results_[specId]);
1050   - }
1051   - return results;
1052   -};
1053   -
1054   -jasmine.JsApiReporter.prototype.summarizeResult_ = function(result){
1055   - var summaryMessages = [];
1056   - var messagesLength = result.messages.length;
1057   - for (var messageIndex = 0; messageIndex < messagesLength; messageIndex++) {
1058   - var resultMessage = result.messages[messageIndex];
1059   - summaryMessages.push({
1060   - text: resultMessage.type == 'log' ? resultMessage.toString() : jasmine.undefined,
1061   - passed: resultMessage.passed ? resultMessage.passed() : true,
1062   - type: resultMessage.type,
1063   - message: resultMessage.message,
1064   - trace: {
1065   - stack: resultMessage.passed && !resultMessage.passed() ? resultMessage.trace.stack : jasmine.undefined
1066   - }
1067   - });
1068   - }
1069   -
1070   - return {
1071   - result : result.result,
1072   - messages : summaryMessages
1073   - };
1074   -};
1075   -
1076   -/**
1077   - * @constructor
1078   - * @param {jasmine.Env} env
1079   - * @param actual
1080   - * @param {jasmine.Spec} spec
1081   - */
1082   -jasmine.Matchers = function(env, actual, spec, opt_isNot) {
1083   - this.env = env;
1084   - this.actual = actual;
1085   - this.spec = spec;
1086   - this.isNot = opt_isNot || false;
1087   - this.reportWasCalled_ = false;
1088   -};
1089   -
1090   -// todo: @deprecated as of Jasmine 0.11, remove soon [xw]
1091   -jasmine.Matchers.pp = function(str) {
1092   - throw new Error("jasmine.Matchers.pp() is no longer supported, please use jasmine.pp() instead!");
1093   -};
1094   -
1095   -// todo: @deprecated Deprecated as of Jasmine 0.10. Rewrite your custom matchers to return true or false. [xw]
1096   -jasmine.Matchers.prototype.report = function(result, failing_message, details) {
1097   - throw new Error("As of jasmine 0.11, custom matchers must be implemented differently -- please see jasmine docs");
1098   -};
1099   -
1100   -jasmine.Matchers.wrapInto_ = function(prototype, matchersClass) {
1101   - for (var methodName in prototype) {
1102   - if (methodName == 'report') continue;
1103   - var orig = prototype[methodName];
1104   - matchersClass.prototype[methodName] = jasmine.Matchers.matcherFn_(methodName, orig);
1105   - }
1106   -};
1107   -
1108   -jasmine.Matchers.matcherFn_ = function(matcherName, matcherFunction) {
1109   - return function() {
1110   - var matcherArgs = jasmine.util.argsToArray(arguments);
1111   - var result = matcherFunction.apply(this, arguments);
1112   -
1113   - if (this.isNot) {
1114   - result = !result;
1115   - }
1116   -
1117   - if (this.reportWasCalled_) return result;
1118   -
1119   - var message;
1120   - if (!result) {
1121   - if (this.message) {
1122   - message = this.message.apply(this, arguments);
1123   - if (jasmine.isArray_(message)) {
1124   - message = message[this.isNot ? 1 : 0];
1125   - }
1126   - } else {
1127   - var englishyPredicate = matcherName.replace(/[A-Z]/g, function(s) { return ' ' + s.toLowerCase(); });
1128   - message = "Expected " + jasmine.pp(this.actual) + (this.isNot ? " not " : " ") + englishyPredicate;
1129   - if (matcherArgs.length > 0) {
1130   - for (var i = 0; i < matcherArgs.length; i++) {
1131   - if (i > 0) message += ",";
1132   - message += " " + jasmine.pp(matcherArgs[i]);
1133   - }
1134   - }
1135   - message += ".";
1136   - }
1137   - }
1138   - var expectationResult = new jasmine.ExpectationResult({
1139   - matcherName: matcherName,
1140   - passed: result,
1141   - expected: matcherArgs.length > 1 ? matcherArgs : matcherArgs[0],
1142   - actual: this.actual,
1143   - message: message
1144   - });
1145   - this.spec.addMatcherResult(expectationResult);
1146   - return jasmine.undefined;
1147   - };
1148   -};
1149   -
1150   -
1151   -
1152   -
1153   -/**
1154   - * toBe: compares the actual to the expected using ===
1155   - * @param expected
1156   - */
1157   -jasmine.Matchers.prototype.toBe = function(expected) {
1158   - return this.actual === expected;
1159   -};
1160   -
1161   -/**
1162   - * toNotBe: compares the actual to the expected using !==
1163   - * @param expected
1164   - * @deprecated as of 1.0. Use not.toBe() instead.
1165   - */
1166   -jasmine.Matchers.prototype.toNotBe = function(expected) {
1167   - return this.actual !== expected;
1168   -};
1169   -
1170   -/**
1171   - * toEqual: compares the actual to the expected using common sense equality. Handles Objects, Arrays, etc.
1172   - *
1173   - * @param expected
1174   - */
1175   -jasmine.Matchers.prototype.toEqual = function(expected) {
1176   - return this.env.equals_(this.actual, expected);
1177   -};
1178   -
1179   -/**
1180   - * toNotEqual: compares the actual to the expected using the ! of jasmine.Matchers.toEqual
1181   - * @param expected
1182   - * @deprecated as of 1.0. Use not.toNotEqual() instead.
1183   - */
1184   -jasmine.Matchers.prototype.toNotEqual = function(expected) {
1185   - return !this.env.equals_(this.actual, expected);
1186   -};
1187   -
1188   -/**
1189   - * Matcher that compares the actual to the expected using a regular expression. Constructs a RegExp, so takes
1190   - * a pattern or a String.
1191   - *
1192   - * @param expected
1193   - */
1194   -jasmine.Matchers.prototype.toMatch = function(expected) {
1195   - return new RegExp(expected).test(this.actual);
1196   -};
1197   -
1198   -/**
1199   - * Matcher that compares the actual to the expected using the boolean inverse of jasmine.Matchers.toMatch
1200   - * @param expected
1201   - * @deprecated as of 1.0. Use not.toMatch() instead.
1202   - */
1203   -jasmine.Matchers.prototype.toNotMatch = function(expected) {
1204   - return !(new RegExp(expected).test(this.actual));
1205   -};
1206   -
1207   -/**
1208   - * Matcher that compares the actual to jasmine.undefined.
1209   - */
1210   -jasmine.Matchers.prototype.toBeDefined = function() {
1211   - return (this.actual !== jasmine.undefined);
1212   -};
1213   -
1214   -/**
1215   - * Matcher that compares the actual to jasmine.undefined.
1216   - */
1217   -jasmine.Matchers.prototype.toBeUndefined = function() {
1218   - return (this.actual === jasmine.undefined);
1219   -};
1220   -
1221   -/**
1222   - * Matcher that compares the actual to null.
1223   - */
1224   -jasmine.Matchers.prototype.toBeNull = function() {
1225   - return (this.actual === null);
1226   -};
1227   -
1228   -/**
1229   - * Matcher that boolean not-nots the actual.
1230   - */
1231   -jasmine.Matchers.prototype.toBeTruthy = function() {
1232   - return !!this.actual;
1233   -};
1234   -
1235   -
1236   -/**
1237   - * Matcher that boolean nots the actual.
1238   - */
1239   -jasmine.Matchers.prototype.toBeFalsy = function() {
1240   - return !this.actual;
1241   -};
1242   -
1243   -
1244   -/**
1245   - * Matcher that checks to see if the actual, a Jasmine spy, was called.
1246   - */
1247   -jasmine.Matchers.prototype.toHaveBeenCalled = function() {
1248   - if (arguments.length > 0) {
1249   - throw new Error('toHaveBeenCalled does not take arguments, use toHaveBeenCalledWith');
1250   - }
1251   -
1252   - if (!jasmine.isSpy(this.actual)) {
1253   - throw new Error('Expected a spy, but got ' + jasmine.pp(this.actual) + '.');
1254   - }
1255   -
1256   - this.message = function() {
1257   - return [
1258   - "Expected spy " + this.actual.identity + " to have been called.",
1259   - "Expected spy " + this.actual.identity + " not to have been called."
1260   - ];
1261   - };
1262   -
1263   - return this.actual.wasCalled;
1264   -};
1265   -
1266   -/** @deprecated Use expect(xxx).toHaveBeenCalled() instead */
1267   -jasmine.Matchers.prototype.wasCalled = jasmine.Matchers.prototype.toHaveBeenCalled;
1268   -
1269   -/**
1270   - * Matcher that checks to see if the actual, a Jasmine spy, was not called.
1271   - *
1272   - * @deprecated Use expect(xxx).not.toHaveBeenCalled() instead
1273   - */
1274   -jasmine.Matchers.prototype.wasNotCalled = function() {
1275   - if (arguments.length > 0) {
1276   - throw new Error('wasNotCalled does not take arguments');
1277   - }
1278   -
1279   - if (!jasmine.isSpy(this.actual)) {
1280   - throw new Error('Expected a spy, but got ' + jasmine.pp(this.actual) + '.');
1281   - }
1282   -
1283   - this.message = function() {
1284   - return [
1285   - "Expected spy " + this.actual.identity + " to not have been called.",
1286   - "Expected spy " + this.actual.identity + " to have been called."
1287   - ];
1288   - };
1289   -
1290   - return !this.actual.wasCalled;
1291   -};
1292   -
1293   -/**
1294   - * Matcher that checks to see if the actual, a Jasmine spy, was called with a set of parameters.
1295   - *
1296   - * @example
1297   - *
1298   - */
1299   -jasmine.Matchers.prototype.toHaveBeenCalledWith = function() {
1300   - var expectedArgs = jasmine.util.argsToArray(arguments);
1301   - if (!jasmine.isSpy(this.actual)) {
1302   - throw new Error('Expected a spy, but got ' + jasmine.pp(this.actual) + '.');
1303   - }
1304   - this.message = function() {
1305   - if (this.actual.callCount == 0) {
1306   - // todo: what should the failure message for .not.toHaveBeenCalledWith() be? is this right? test better. [xw]
1307   - return [
1308   - "Expected spy to have been called with " + jasmine.pp(expectedArgs) + " but it was never called.",
1309   - "Expected spy not to have been called with " + jasmine.pp(expectedArgs) + " but it was."
1310   - ];
1311   - } else {
1312   - return [
1313   - "Expected spy to have been called with " + jasmine.pp(expectedArgs) + " but was called with " + jasmine.pp(this.actual.argsForCall),
1314   - "Expected spy not to have been called with " + jasmine.pp(expectedArgs) + " but was called with " + jasmine.pp(this.actual.argsForCall)
1315   - ];
1316   - }
1317   - };
1318   -
1319   - return this.env.contains_(this.actual.argsForCall, expectedArgs);
1320   -};
1321   -
1322   -/** @deprecated Use expect(xxx).toHaveBeenCalledWith() instead */
1323   -jasmine.Matchers.prototype.wasCalledWith = jasmine.Matchers.prototype.toHaveBeenCalledWith;
1324   -
1325   -/** @deprecated Use expect(xxx).not.toHaveBeenCalledWith() instead */
1326   -jasmine.Matchers.prototype.wasNotCalledWith = function() {
1327   - var expectedArgs = jasmine.util.argsToArray(arguments);
1328   - if (!jasmine.isSpy(this.actual)) {
1329   - throw new Error('Expected a spy, but got ' + jasmine.pp(this.actual) + '.');
1330   - }
1331   -
1332   - this.message = function() {
1333   - return [
1334   - "Expected spy not to have been called with " + jasmine.pp(expectedArgs) + " but it was",
1335   - "Expected spy to have been called with " + jasmine.pp(expectedArgs) + " but it was"
1336   - ]
1337   - };
1338   -
1339   - return !this.env.contains_(this.actual.argsForCall, expectedArgs);
1340   -};
1341   -
1342   -/**
1343   - * Matcher that checks that the expected item is an element in the actual Array.
1344   - *
1345   - * @param {Object} expected
1346   - */
1347   -jasmine.Matchers.prototype.toContain = function(expected) {
1348   - return this.env.contains_(this.actual, expected);
1349   -};
1350   -
1351   -/**
1352   - * Matcher that checks that the expected item is NOT an element in the actual Array.
1353   - *
1354   - * @param {Object} expected
1355   - * @deprecated as of 1.0. Use not.toNotContain() instead.
1356   - */
1357   -jasmine.Matchers.prototype.toNotContain = function(expected) {
1358   - return !this.env.contains_(this.actual, expected);
1359   -};
1360   -
1361   -jasmine.Matchers.prototype.toBeLessThan = function(expected) {
1362   - return this.actual < expected;
1363   -};
1364   -
1365   -jasmine.Matchers.prototype.toBeGreaterThan = function(expected) {
1366   - return this.actual > expected;
1367   -};
1368   -
1369   -/**
1370   - * Matcher that checks that the expected exception was thrown by the actual.
1371   - *
1372   - * @param {String} expected
1373   - */
1374   -jasmine.Matchers.prototype.toThrow = function(expected) {
1375   - var result = false;
1376   - var exception;
1377   - if (typeof this.actual != 'function') {
1378   - throw new Error('Actual is not a function');
1379   - }
1380   - try {
1381   - this.actual();
1382   - } catch (e) {
1383   - exception = e;
1384   - }
1385   - if (exception) {
1386   - result = (expected === jasmine.undefined || this.env.equals_(exception.message || exception, expected.message || expected));
1387   - }
1388   -
1389   - var not = this.isNot ? "not " : "";
1390   -
1391   - this.message = function() {
1392   - if (exception && (expected === jasmine.undefined || !this.env.equals_(exception.message || exception, expected.message || expected))) {
1393   - return ["Expected function " + not + "to throw", expected ? expected.message || expected : " an exception", ", but it threw", exception.message || exception].join(' ');
1394   - } else {
1395   - return "Expected function to throw an exception.";
1396   - }
1397   - };
1398   -
1399   - return result;
1400   -};
1401   -
1402   -jasmine.Matchers.Any = function(expectedClass) {
1403   - this.expectedClass = expectedClass;
1404   -};
1405   -
1406   -jasmine.Matchers.Any.prototype.matches = function(other) {
1407   - if (this.expectedClass == String) {
1408   - return typeof other == 'string' || other instanceof String;
1409   - }
1410   -
1411   - if (this.expectedClass == Number) {
1412   - return typeof other == 'number' || other instanceof Number;
1413   - }
1414   -
1415   - if (this.expectedClass == Function) {
1416   - return typeof other == 'function' || other instanceof Function;
1417   - }
1418   -
1419   - if (this.expectedClass == Object) {
1420   - return typeof other == 'object';
1421   - }
1422   -
1423   - return other instanceof this.expectedClass;
1424   -};
1425   -
1426   -jasmine.Matchers.Any.prototype.toString = function() {
1427   - return '<jasmine.any(' + this.expectedClass + ')>';
1428   -};
1429   -
1430   -/**
1431   - * @constructor
1432   - */
1433   -jasmine.MultiReporter = function() {
1434   - this.subReporters_ = [];
1435   -};
1436   -jasmine.util.inherit(jasmine.MultiReporter, jasmine.Reporter);
1437   -
1438   -jasmine.MultiReporter.prototype.addReporter = function(reporter) {
1439   - this.subReporters_.push(reporter);
1440   -};
1441   -
1442   -(function() {
1443   - var functionNames = [
1444   - "reportRunnerStarting",
1445   - "reportRunnerResults",
1446   - "reportSuiteResults",
1447   - "reportSpecStarting",
1448   - "reportSpecResults",
1449   - "log"
1450   - ];
1451   - for (var i = 0; i < functionNames.length; i++) {
1452   - var functionName = functionNames[i];
1453   - jasmine.MultiReporter.prototype[functionName] = (function(functionName) {
1454   - return function() {
1455   - for (var j = 0; j < this.subReporters_.length; j++) {
1456   - var subReporter = this.subReporters_[j];
1457   - if (subReporter[functionName]) {
1458   - subReporter[functionName].apply(subReporter, arguments);
1459   - }
1460   - }
1461   - };
1462   - })(functionName);
1463   - }
1464   -})();
1465   -/**
1466   - * Holds results for a set of Jasmine spec. Allows for the results array to hold another jasmine.NestedResults
1467   - *
1468   - * @constructor
1469   - */
1470   -jasmine.NestedResults = function() {
1471   - /**
1472   - * The total count of results
1473   - */
1474   - this.totalCount = 0;
1475   - /**
1476   - * Number of passed results
1477   - */
1478   - this.passedCount = 0;
1479   - /**
1480   - * Number of failed results
1481   - */
1482   - this.failedCount = 0;
1483   - /**
1484   - * Was this suite/spec skipped?
1485   - */
1486   - this.skipped = false;
1487   - /**
1488   - * @ignore
1489   - */
1490   - this.items_ = [];
1491   -};
1492   -
1493   -/**
1494   - * Roll up the result counts.
1495   - *
1496   - * @param result
1497   - */
1498   -jasmine.NestedResults.prototype.rollupCounts = function(result) {
1499   - this.totalCount += result.totalCount;
1500   - this.passedCount += result.passedCount;
1501   - this.failedCount += result.failedCount;
1502   -};
1503   -
1504   -/**
1505   - * Adds a log message.
1506   - * @param values Array of message parts which will be concatenated later.
1507   - */
1508   -jasmine.NestedResults.prototype.log = function(values) {
1509   - this.items_.push(new jasmine.MessageResult(values));
1510   -};
1511   -
1512   -/**
1513   - * Getter for the results: message & results.
1514   - */
1515   -jasmine.NestedResults.prototype.getItems = function() {
1516   - return this.items_;
1517   -};
1518   -
1519   -/**
1520   - * Adds a result, tracking counts (total, passed, & failed)
1521   - * @param {jasmine.ExpectationResult|jasmine.NestedResults} result
1522   - */
1523   -jasmine.NestedResults.prototype.addResult = function(result) {
1524   - if (result.type != 'log') {
1525   - if (result.items_) {
1526   - this.rollupCounts(result);
1527   - } else {
1528   - this.totalCount++;
1529   - if (result.passed()) {
1530   - this.passedCount++;
1531   - } else {
1532   - this.failedCount++;
1533   - }
1534   - }
1535   - }
1536   - this.items_.push(result);
1537   -};
1538   -
1539   -/**
1540   - * @returns {Boolean} True if <b>everything</b> below passed
1541   - */
1542   -jasmine.NestedResults.prototype.passed = function() {
1543   - return this.passedCount === this.totalCount;
1544   -};
1545   -/**
1546   - * Base class for pretty printing for expectation results.
1547   - */
1548   -jasmine.PrettyPrinter = function() {
1549   - this.ppNestLevel_ = 0;
1550   -};
1551   -
1552   -/**
1553   - * Formats a value in a nice, human-readable string.
1554   - *
1555   - * @param value
1556   - */
1557   -jasmine.PrettyPrinter.prototype.format = function(value) {
1558   - if (this.ppNestLevel_ > 40) {
1559   - throw new Error('jasmine.PrettyPrinter: format() nested too deeply!');
1560   - }
1561   -
1562   - this.ppNestLevel_++;
1563   - try {
1564   - if (value === jasmine.undefined) {
1565   - this.emitScalar('undefined');
1566   - } else if (value === null) {
1567   - this.emitScalar('null');
1568   - } else if (value === jasmine.getGlobal()) {
1569   - this.emitScalar('<global>');
1570   - } else if (value instanceof jasmine.Matchers.Any) {
1571   - this.emitScalar(value.toString());
1572   - } else if (typeof value === 'string') {
1573   - this.emitString(value);
1574   - } else if (jasmine.isSpy(value)) {
1575   - this.emitScalar("spy on " + value.identity);
1576   - } else if (value instanceof RegExp) {
1577   - this.emitScalar(value.toString());
1578   - } else if (typeof value === 'function') {
1579   - this.emitScalar('Function');
1580   - } else if (typeof value.nodeType === 'number') {
1581   - this.emitScalar('HTMLNode');
1582   - } else if (value instanceof Date) {
1583   - this.emitScalar('Date(' + value + ')');
1584   - } else if (value.__Jasmine_been_here_before__) {
1585   - this.emitScalar('<circular reference: ' + (jasmine.isArray_(value) ? 'Array' : 'Object') + '>');
1586   - } else if (jasmine.isArray_(value) || typeof value == 'object') {
1587   - value.__Jasmine_been_here_before__ = true;
1588   - if (jasmine.isArray_(value)) {
1589   - this.emitArray(value);
1590   - } else {
1591   - this.emitObject(value);
1592   - }
1593   - delete value.__Jasmine_been_here_before__;
1594   - } else {
1595   - this.emitScalar(value.toString());
1596   - }
1597   - } finally {
1598   - this.ppNestLevel_--;
1599   - }
1600   -};
1601   -
1602   -jasmine.PrettyPrinter.prototype.iterateObject = function(obj, fn) {
1603   - for (var property in obj) {
1604   - if (property == '__Jasmine_been_here_before__') continue;
1605   - fn(property, obj.__lookupGetter__ ? (obj.__lookupGetter__(property) != null) : false);
1606   - }
1607   -};
1608   -
1609   -jasmine.PrettyPrinter.prototype.emitArray = jasmine.unimplementedMethod_;
1610   -jasmine.PrettyPrinter.prototype.emitObject = jasmine.unimplementedMethod_;
1611   -jasmine.PrettyPrinter.prototype.emitScalar = jasmine.unimplementedMethod_;
1612   -jasmine.PrettyPrinter.prototype.emitString = jasmine.unimplementedMethod_;
1613   -
1614   -jasmine.StringPrettyPrinter = function() {
1615   - jasmine.PrettyPrinter.call(this);
1616   -
1617   - this.string = '';
1618   -};
1619   -jasmine.util.inherit(jasmine.StringPrettyPrinter, jasmine.PrettyPrinter);
1620   -
1621   -jasmine.StringPrettyPrinter.prototype.emitScalar = function(value) {
1622   - this.append(value);
1623   -};
1624   -
1625   -jasmine.StringPrettyPrinter.prototype.emitString = function(value) {
1626   - this.append("'" + value + "'");
1627   -};
1628   -
1629   -jasmine.StringPrettyPrinter.prototype.emitArray = function(array) {
1630   - this.append('[ ');
1631   - for (var i = 0; i < array.length; i++) {
1632   - if (i > 0) {
1633   - this.append(', ');
1634   - }
1635   - this.format(array[i]);
1636   - }
1637   - this.append(' ]');
1638   -};
1639   -
1640   -jasmine.StringPrettyPrinter.prototype.emitObject = function(obj) {
1641   - var self = this;
1642   - this.append('{ ');
1643   - var first = true;
1644   -
1645   - this.iterateObject(obj, function(property, isGetter) {
1646   - if (first) {
1647   - first = false;
1648   - } else {
1649   - self.append(', ');
1650   - }
1651   -
1652   - self.append(property);
1653   - self.append(' : ');
1654   - if (isGetter) {
1655   - self.append('<getter>');
1656   - } else {
1657   - self.format(obj[property]);
1658   - }
1659   - });
1660   -
1661   - this.append(' }');
1662   -};
1663   -
1664   -jasmine.StringPrettyPrinter.prototype.append = function(value) {
1665   - this.string += value;
1666   -};
1667   -jasmine.Queue = function(env) {
1668   - this.env = env;
1669   - this.blocks = [];
1670   - this.running = false;
1671   - this.index = 0;
1672   - this.offset = 0;
1673   - this.abort = false;
1674   -};
1675   -
1676   -jasmine.Queue.prototype.addBefore = function(block) {
1677   - this.blocks.unshift(block);
1678   -};
1679   -
1680   -jasmine.Queue.prototype.add = function(block) {
1681   - this.blocks.push(block);
1682   -};
1683   -
1684   -jasmine.Queue.prototype.insertNext = function(block) {
1685   - this.blocks.splice((this.index + this.offset + 1), 0, block);
1686   - this.offset++;
1687   -};
1688   -
1689   -jasmine.Queue.prototype.start = function(onComplete) {
1690   - this.running = true;
1691   - this.onComplete = onComplete;
1692   - this.next_();
1693   -};
1694   -
1695   -jasmine.Queue.prototype.isRunning = function() {
1696   - return this.running;
1697   -};
1698   -
1699   -jasmine.Queue.LOOP_DONT_RECURSE = true;
1700   -
1701   -jasmine.Queue.prototype.next_ = function() {
1702   - var self = this;
1703   - var goAgain = true;
1704   -
1705   - while (goAgain) {
1706   - goAgain = false;
1707   -
1708   - if (self.index < self.blocks.length && !this.abort) {
1709   - var calledSynchronously = true;
1710   - var completedSynchronously = false;
1711   -
1712   - var onComplete = function () {
1713   - if (jasmine.Queue.LOOP_DONT_RECURSE && calledSynchronously) {
1714   - completedSynchronously = true;
1715   - return;
1716   - }
1717   -
1718   - if (self.blocks[self.index].abort) {
1719   - self.abort = true;
1720   - }
1721   -
1722   - self.offset = 0;
1723   - self.index++;
1724   -
1725   - var now = new Date().getTime();
1726   - if (self.env.updateInterval && now - self.env.lastUpdate > self.env.updateInterval) {
1727   - self.env.lastUpdate = now;
1728   - self.env.setTimeout(function() {
1729   - self.next_();
1730   - }, 0);
1731   - } else {
1732   - if (jasmine.Queue.LOOP_DONT_RECURSE && completedSynchronously) {
1733   - goAgain = true;
1734   - } else {
1735   - self.next_();
1736   - }
1737   - }
1738   - };
1739   - self.blocks[self.index].execute(onComplete);
1740   -
1741   - calledSynchronously = false;
1742   - if (completedSynchronously) {
1743   - onComplete();
1744   - }
1745   -
1746   - } else {
1747   - self.running = false;
1748   - if (self.onComplete) {
1749   - self.onComplete();
1750   - }
1751   - }
1752   - }
1753   -};
1754   -
1755   -jasmine.Queue.prototype.results = function() {
1756   - var results = new jasmine.NestedResults();
1757   - for (var i = 0; i < this.blocks.length; i++) {
1758   - if (this.blocks[i].results) {
1759   - results.addResult(this.blocks[i].results());
1760   - }
1761   - }
1762   - return results;
1763   -};
1764   -
1765   -
1766   -/**
1767   - * Runner
1768   - *
1769   - * @constructor
1770   - * @param {jasmine.Env} env
1771   - */
1772   -jasmine.Runner = function(env) {
1773   - var self = this;
1774   - self.env = env;
1775   - self.queue = new jasmine.Queue(env);
1776   - self.before_ = [];
1777   - self.after_ = [];
1778   - self.suites_ = [];
1779   -};
1780   -
1781   -jasmine.Runner.prototype.execute = function() {
1782   - var self = this;
1783   - if (self.env.reporter.reportRunnerStarting) {
1784   - self.env.reporter.reportRunnerStarting(this);
1785   - }
1786   - self.queue.start(function () {
1787   - self.finishCallback();
1788   - });
1789   -};
1790   -
1791   -jasmine.Runner.prototype.beforeEach = function(beforeEachFunction) {
1792   - beforeEachFunction.typeName = 'beforeEach';
1793   - this.before_.splice(0,0,beforeEachFunction);
1794   -};
1795   -
1796   -jasmine.Runner.prototype.afterEach = function(afterEachFunction) {
1797   - afterEachFunction.typeName = 'afterEach';
1798   - this.after_.splice(0,0,afterEachFunction);
1799   -};
1800   -
1801   -
1802   -jasmine.Runner.prototype.finishCallback = function() {
1803   - this.env.reporter.reportRunnerResults(this);
1804   -};
1805   -
1806   -jasmine.Runner.prototype.addSuite = function(suite) {
1807   - this.suites_.push(suite);
1808   -};
1809   -
1810   -jasmine.Runner.prototype.add = function(block) {
1811   - if (block instanceof jasmine.Suite) {
1812   - this.addSuite(block);
1813   - }
1814   - this.queue.add(block);
1815   -};
1816   -
1817   -jasmine.Runner.prototype.specs = function () {
1818   - var suites = this.suites();
1819   - var specs = [];
1820   - for (var i = 0; i < suites.length; i++) {
1821   - specs = specs.concat(suites[i].specs());
1822   - }
1823   - return specs;
1824   -};
1825   -
1826   -jasmine.Runner.prototype.suites = function() {
1827   - return this.suites_;
1828   -};
1829   -
1830   -jasmine.Runner.prototype.topLevelSuites = function() {
1831   - var topLevelSuites = [];
1832   - for (var i = 0; i < this.suites_.length; i++) {
1833   - if (!this.suites_[i].parentSuite) {
1834   - topLevelSuites.push(this.suites_[i]);
1835   - }
1836   - }
1837   - return topLevelSuites;
1838   -};
1839   -
1840   -jasmine.Runner.prototype.results = function() {
1841   - return this.queue.results();
1842   -};
1843   -/**
1844   - * Internal representation of a Jasmine specification, or test.
1845   - *
1846   - * @constructor
1847   - * @param {jasmine.Env} env
1848   - * @param {jasmine.Suite} suite
1849   - * @param {String} description
1850   - */
1851   -jasmine.Spec = function(env, suite, description) {
1852   - if (!env) {
1853   - throw new Error('jasmine.Env() required');
1854   - }
1855   - if (!suite) {
1856   - throw new Error('jasmine.Suite() required');
1857   - }
1858   - var spec = this;
1859   - spec.id = env.nextSpecId ? env.nextSpecId() : null;
1860   - spec.env = env;
1861   - spec.suite = suite;
1862   - spec.description = description;
1863   - spec.queue = new jasmine.Queue(env);
1864   -
1865   - spec.afterCallbacks = [];
1866   - spec.spies_ = [];
1867   -
1868   - spec.results_ = new jasmine.NestedResults();
1869   - spec.results_.description = description;
1870   - spec.matchersClass = null;
1871   -};
1872   -
1873   -jasmine.Spec.prototype.getFullName = function() {
1874   - return this.suite.getFullName() + ' ' + this.description + '.';
1875   -};
1876   -
1877   -
1878   -jasmine.Spec.prototype.results = function() {
1879   - return this.results_;
1880   -};
1881   -
1882   -/**
1883   - * All parameters are pretty-printed and concatenated together, then written to the spec's output.
1884   - *
1885   - * Be careful not to leave calls to <code>jasmine.log</code> in production code.
1886   - */
1887   -jasmine.Spec.prototype.log = function() {
1888   - return this.results_.log(arguments);
1889   -};
1890   -
1891   -jasmine.Spec.prototype.runs = function (func) {
1892   - var block = new jasmine.Block(this.env, func, this);
1893   - this.addToQueue(block);
1894   - return this;
1895   -};
1896   -
1897   -jasmine.Spec.prototype.addToQueue = function (block) {
1898   - if (this.queue.isRunning()) {
1899   - this.queue.insertNext(block);
1900   - } else {
1901   - this.queue.add(block);
1902   - }
1903   -};
1904   -
1905   -/**
1906   - * @param {jasmine.ExpectationResult} result
1907   - */
1908   -jasmine.Spec.prototype.addMatcherResult = function(result) {
1909   - this.results_.addResult(result);
1910   -};
1911   -
1912   -jasmine.Spec.prototype.expect = function(actual) {
1913   - var positive = new (this.getMatchersClass_())(this.env, actual, this);
1914   - positive.not = new (this.getMatchersClass_())(this.env, actual, this, true);
1915   - return positive;
1916   -};
1917   -
1918   -/**
1919   - * Waits a fixed time period before moving to the next block.
1920   - *
1921   - * @deprecated Use waitsFor() instead
1922   - * @param {Number} timeout milliseconds to wait
1923   - */
1924   -jasmine.Spec.prototype.waits = function(timeout) {
1925   - var waitsFunc = new jasmine.WaitsBlock(this.env, timeout, this);
1926   - this.addToQueue(waitsFunc);
1927   - return this;
1928   -};
1929   -
1930   -/**
1931   - * Waits for the latchFunction to return true before proceeding to the next block.
1932   - *
1933   - * @param {Function} latchFunction
1934   - * @param {String} optional_timeoutMessage
1935   - * @param {Number} optional_timeout
1936   - */
1937   -jasmine.Spec.prototype.waitsFor = function(latchFunction, optional_timeoutMessage, optional_timeout) {
1938   - var latchFunction_ = null;
1939   - var optional_timeoutMessage_ = null;
1940   - var optional_timeout_ = null;
1941   -
1942   - for (var i = 0; i < arguments.length; i++) {
1943   - var arg = arguments[i];
1944   - switch (typeof arg) {
1945   - case 'function':
1946   - latchFunction_ = arg;
1947   - break;
1948   - case 'string':
1949   - optional_timeoutMessage_ = arg;
1950   - break;
1951   - case 'number':
1952   - optional_timeout_ = arg;
1953   - break;
1954   - }
1955   - }
1956   -
1957   - var waitsForFunc = new jasmine.WaitsForBlock(this.env, optional_timeout_, latchFunction_, optional_timeoutMessage_, this);
1958   - this.addToQueue(waitsForFunc);
1959   - return this;
1960   -};
1961   -
1962   -jasmine.Spec.prototype.fail = function (e) {
1963   - var expectationResult = new jasmine.ExpectationResult({
1964   - passed: false,
1965   - message: e ? jasmine.util.formatException(e) : 'Exception'
1966   - });
1967   - this.results_.addResult(expectationResult);
1968   -};
1969   -
1970   -jasmine.Spec.prototype.getMatchersClass_ = function() {
1971   - return this.matchersClass || this.env.matchersClass;
1972   -};
1973   -
1974   -jasmine.Spec.prototype.addMatchers = function(matchersPrototype) {
1975   - var parent = this.getMatchersClass_();
1976   - var newMatchersClass = function() {
1977   - parent.apply(this, arguments);
1978   - };
1979   - jasmine.util.inherit(newMatchersClass, parent);
1980   - jasmine.Matchers.wrapInto_(matchersPrototype, newMatchersClass);
1981   - this.matchersClass = newMatchersClass;
1982   -};
1983   -
1984   -jasmine.Spec.prototype.finishCallback = function() {
1985   - this.env.reporter.reportSpecResults(this);
1986   -};
1987   -
1988   -jasmine.Spec.prototype.finish = function(onComplete) {
1989   - this.removeAllSpies();
1990   - this.finishCallback();
1991   - if (onComplete) {
1992   - onComplete();
1993   - }
1994   -};
1995   -
1996   -jasmine.Spec.prototype.after = function(doAfter) {
1997   - if (this.queue.isRunning()) {
1998   - this.queue.add(new jasmine.Block(this.env, doAfter, this));
1999   - } else {
2000   - this.afterCallbacks.unshift(doAfter);
2001   - }
2002   -};
2003   -
2004   -jasmine.Spec.prototype.execute = function(onComplete) {
2005   - var spec = this;
2006   - if (!spec.env.specFilter(spec)) {
2007   - spec.results_.skipped = true;
2008   - spec.finish(onComplete);
2009   - return;
2010   - }
2011   -
2012   - this.env.reporter.reportSpecStarting(this);
2013   -
2014   - spec.env.currentSpec = spec;
2015   -
2016   - spec.addBeforesAndAftersToQueue();
2017   -
2018   - spec.queue.start(function () {
2019   - spec.finish(onComplete);
2020   - });
2021   -};
2022   -
2023   -jasmine.Spec.prototype.addBeforesAndAftersToQueue = function() {
2024   - var runner = this.env.currentRunner();
2025   - var i;
2026   -
2027   - for (var suite = this.suite; suite; suite = suite.parentSuite) {
2028   - for (i = 0; i < suite.before_.length; i++) {
2029   - this.queue.addBefore(new jasmine.Block(this.env, suite.before_[i], this));
2030   - }
2031   - }
2032   - for (i = 0; i < runner.before_.length; i++) {
2033   - this.queue.addBefore(new jasmine.Block(this.env, runner.before_[i], this));
2034   - }
2035   - for (i = 0; i < this.afterCallbacks.length; i++) {
2036   - this.queue.add(new jasmine.Block(this.env, this.afterCallbacks[i], this));
2037   - }
2038   - for (suite = this.suite; suite; suite = suite.parentSuite) {
2039   - for (i = 0; i < suite.after_.length; i++) {
2040   - this.queue.add(new jasmine.Block(this.env, suite.after_[i], this));
2041   - }
2042   - }
2043   - for (i = 0; i < runner.after_.length; i++) {
2044   - this.queue.add(new jasmine.Block(this.env, runner.after_[i], this));
2045   - }
2046   -};
2047   -
2048   -jasmine.Spec.prototype.explodes = function() {
2049   - throw 'explodes function should not have been called';
2050   -};
2051   -
2052   -jasmine.Spec.prototype.spyOn = function(obj, methodName, ignoreMethodDoesntExist) {
2053   - if (obj == jasmine.undefined) {
2054   - throw "spyOn could not find an object to spy upon for " + methodName + "()";
2055   - }
2056   -
2057   - if (!ignoreMethodDoesntExist && obj[methodName] === jasmine.undefined) {
2058   - throw methodName + '() method does not exist';
2059   - }
2060   -
2061   - if (!ignoreMethodDoesntExist && obj[methodName] && obj[methodName].isSpy) {
2062   - throw new Error(methodName + ' has already been spied upon');
2063   - }
2064   -
2065   - var spyObj = jasmine.createSpy(methodName);
2066   -
2067   - this.spies_.push(spyObj);
2068   - spyObj.baseObj = obj;
2069   - spyObj.methodName = methodName;
2070   - spyObj.originalValue = obj[methodName];
2071   -
2072   - obj[methodName] = spyObj;
2073   -
2074   - return spyObj;
2075   -};
2076   -
2077   -jasmine.Spec.prototype.removeAllSpies = function() {
2078   - for (var i = 0; i < this.spies_.length; i++) {
2079   - var spy = this.spies_[i];
2080   - spy.baseObj[spy.methodName] = spy.originalValue;
2081   - }
2082   - this.spies_ = [];
2083   -};
2084   -
2085   -/**
2086   - * Internal representation of a Jasmine suite.
2087   - *
2088   - * @constructor
2089   - * @param {jasmine.Env} env
2090   - * @param {String} description
2091   - * @param {Function} specDefinitions
2092   - * @param {jasmine.Suite} parentSuite
2093   - */
2094   -jasmine.Suite = function(env, description, specDefinitions, parentSuite) {
2095   - var self = this;
2096   - self.id = env.nextSuiteId ? env.nextSuiteId() : null;
2097   - self.description = description;
2098   - self.queue = new jasmine.Queue(env);
2099   - self.parentSuite = parentSuite;
2100   - self.env = env;
2101   - self.before_ = [];
2102   - self.after_ = [];
2103   - self.children_ = [];
2104   - self.suites_ = [];
2105   - self.specs_ = [];
2106   -};
2107   -
2108   -jasmine.Suite.prototype.getFullName = function() {
2109   - var fullName = this.description;
2110   - for (var parentSuite = this.parentSuite; parentSuite; parentSuite = parentSuite.parentSuite) {
2111   - fullName = parentSuite.description + ' ' + fullName;
2112   - }
2113   - return fullName;
2114   -};
2115   -
2116   -jasmine.Suite.prototype.finish = function(onComplete) {
2117   - this.env.reporter.reportSuiteResults(this);
2118   - this.finished = true;
2119   - if (typeof(onComplete) == 'function') {
2120   - onComplete();
2121   - }
2122   -};
2123   -
2124   -jasmine.Suite.prototype.beforeEach = function(beforeEachFunction) {
2125   - beforeEachFunction.typeName = 'beforeEach';
2126   - this.before_.unshift(beforeEachFunction);
2127   -};
2128   -
2129   -jasmine.Suite.prototype.afterEach = function(afterEachFunction) {
2130   - afterEachFunction.typeName = 'afterEach';
2131   - this.after_.unshift(afterEachFunction);
2132   -};
2133   -
2134   -jasmine.Suite.prototype.results = function() {
2135   - return this.queue.results();
2136   -};
2137   -
2138   -jasmine.Suite.prototype.add = function(suiteOrSpec) {
2139   - this.children_.push(suiteOrSpec);
2140   - if (suiteOrSpec instanceof jasmine.Suite) {
2141   - this.suites_.push(suiteOrSpec);
2142   - this.env.currentRunner().addSuite(suiteOrSpec);
2143   - } else {
2144   - this.specs_.push(suiteOrSpec);
2145   - }
2146   - this.queue.add(suiteOrSpec);
2147   -};
2148   -
2149   -jasmine.Suite.prototype.specs = function() {
2150   - return this.specs_;
2151   -};
2152   -
2153   -jasmine.Suite.prototype.suites = function() {
2154   - return this.suites_;
2155   -};
2156   -
2157   -jasmine.Suite.prototype.children = function() {
2158   - return this.children_;
2159   -};
2160   -
2161   -jasmine.Suite.prototype.execute = function(onComplete) {
2162   - var self = this;
2163   - this.queue.start(function () {
2164   - self.finish(onComplete);
2165   - });
2166   -};
2167   -jasmine.WaitsBlock = function(env, timeout, spec) {
2168   - this.timeout = timeout;
2169   - jasmine.Block.call(this, env, null, spec);
2170   -};
2171   -
2172   -jasmine.util.inherit(jasmine.WaitsBlock, jasmine.Block);
2173   -
2174   -jasmine.WaitsBlock.prototype.execute = function (onComplete) {
2175   - this.env.reporter.log('>> Jasmine waiting for ' + this.timeout + ' ms...');
2176   - this.env.setTimeout(function () {
2177   - onComplete();
2178   - }, this.timeout);
2179   -};
2180   -/**
2181   - * A block which waits for some condition to become true, with timeout.
2182   - *
2183   - * @constructor
2184   - * @extends jasmine.Block
2185   - * @param {jasmine.Env} env The Jasmine environment.
2186   - * @param {Number} timeout The maximum time in milliseconds to wait for the condition to become true.
2187   - * @param {Function} latchFunction A function which returns true when the desired condition has been met.
2188   - * @param {String} message The message to display if the desired condition hasn't been met within the given time period.
2189   - * @param {jasmine.Spec} spec The Jasmine spec.
2190   - */
2191   -jasmine.WaitsForBlock = function(env, timeout, latchFunction, message, spec) {
2192   - this.timeout = timeout || env.defaultTimeoutInterval;
2193   - this.latchFunction = latchFunction;
2194   - this.message = message;
2195   - this.totalTimeSpentWaitingForLatch = 0;
2196   - jasmine.Block.call(this, env, null, spec);
2197   -};
2198   -jasmine.util.inherit(jasmine.WaitsForBlock, jasmine.Block);
2199   -
2200   -jasmine.WaitsForBlock.TIMEOUT_INCREMENT = 10;
2201   -
2202   -jasmine.WaitsForBlock.prototype.execute = function(onComplete) {
2203   - this.env.reporter.log('>> Jasmine waiting for ' + (this.message || 'something to happen'));
2204   - var latchFunctionResult;
2205   - try {
2206   - latchFunctionResult = this.latchFunction.apply(this.spec);
2207   - } catch (e) {
2208   - this.spec.fail(e);
2209   - onComplete();
2210   - return;
2211   - }
2212   -
2213   - if (latchFunctionResult) {
2214   - onComplete();
2215   - } else if (this.totalTimeSpentWaitingForLatch >= this.timeout) {
2216   - var message = 'timed out after ' + this.timeout + ' msec waiting for ' + (this.message || 'something to happen');
2217   - this.spec.fail({
2218   - name: 'timeout',
2219   - message: message
2220   - });
2221   -
2222   - this.abort = true;
2223   - onComplete();
2224   - } else {
2225   - this.totalTimeSpentWaitingForLatch += jasmine.WaitsForBlock.TIMEOUT_INCREMENT;
2226   - var self = this;
2227   - this.env.setTimeout(function() {
2228   - self.execute(onComplete);
2229   - }, jasmine.WaitsForBlock.TIMEOUT_INCREMENT);
2230   - }
2231   -};
2232   -// Mock setTimeout, clearTimeout
2233   -// Contributed by Pivotal Computer Systems, www.pivotalsf.com
2234   -
2235   -jasmine.FakeTimer = function() {
2236   - this.reset();
2237   -
2238   - var self = this;
2239   - self.setTimeout = function(funcToCall, millis) {
2240   - self.timeoutsMade++;
2241   - self.scheduleFunction(self.timeoutsMade, funcToCall, millis, false);
2242   - return self.timeoutsMade;
2243   - };
2244   -
2245   - self.setInterval = function(funcToCall, millis) {
2246   - self.timeoutsMade++;
2247   - self.scheduleFunction(self.timeoutsMade, funcToCall, millis, true);
2248   - return self.timeoutsMade;
2249   - };
2250   -
2251   - self.clearTimeout = function(timeoutKey) {
2252   - self.scheduledFunctions[timeoutKey] = jasmine.undefined;
2253   - };
2254   -
2255   - self.clearInterval = function(timeoutKey) {
2256   - self.scheduledFunctions[timeoutKey] = jasmine.undefined;
2257   - };
2258   -
2259   -};
2260   -
2261   -jasmine.FakeTimer.prototype.reset = function() {
2262   - this.timeoutsMade = 0;
2263   - this.scheduledFunctions = {};
2264   - this.nowMillis = 0;
2265   -};
2266   -
2267   -jasmine.FakeTimer.prototype.tick = function(millis) {
2268   - var oldMillis = this.nowMillis;
2269   - var newMillis = oldMillis + millis;
2270   - this.runFunctionsWithinRange(oldMillis, newMillis);
2271   - this.nowMillis = newMillis;
2272   -};
2273   -
2274   -jasmine.FakeTimer.prototype.runFunctionsWithinRange = function(oldMillis, nowMillis) {
2275   - var scheduledFunc;
2276   - var funcsToRun = [];
2277   - for (var timeoutKey in this.scheduledFunctions) {
2278   - scheduledFunc = this.scheduledFunctions[timeoutKey];
2279   - if (scheduledFunc != jasmine.undefined &&
2280   - scheduledFunc.runAtMillis >= oldMillis &&
2281   - scheduledFunc.runAtMillis <= nowMillis) {
2282   - funcsToRun.push(scheduledFunc);
2283   - this.scheduledFunctions[timeoutKey] = jasmine.undefined;
2284   - }
2285   - }
2286   -
2287   - if (funcsToRun.length > 0) {
2288   - funcsToRun.sort(function(a, b) {
2289   - return a.runAtMillis - b.runAtMillis;
2290   - });
2291   - for (var i = 0; i < funcsToRun.length; ++i) {
2292   - try {
2293   - var funcToRun = funcsToRun[i];
2294   - this.nowMillis = funcToRun.runAtMillis;
2295   - funcToRun.funcToCall();
2296   - if (funcToRun.recurring) {
2297   - this.scheduleFunction(funcToRun.timeoutKey,
2298   - funcToRun.funcToCall,
2299   - funcToRun.millis,
2300   - true);
2301   - }
2302   - } catch(e) {
2303   - }
2304   - }
2305   - this.runFunctionsWithinRange(oldMillis, nowMillis);
2306   - }
2307   -};
2308   -
2309   -jasmine.FakeTimer.prototype.scheduleFunction = function(timeoutKey, funcToCall, millis, recurring) {
2310   - this.scheduledFunctions[timeoutKey] = {
2311   - runAtMillis: this.nowMillis + millis,
2312   - funcToCall: funcToCall,
2313   - recurring: recurring,
2314   - timeoutKey: timeoutKey,
2315   - millis: millis
2316   - };
2317   -};
2318   -
2319   -/**
2320   - * @namespace
2321   - */
2322   -jasmine.Clock = {
2323   - defaultFakeTimer: new jasmine.FakeTimer(),
2324   -
2325   - reset: function() {
2326   - jasmine.Clock.assertInstalled();
2327   - jasmine.Clock.defaultFakeTimer.reset();
2328   - },
2329   -
2330   - tick: function(millis) {
2331   - jasmine.Clock.assertInstalled();
2332   - jasmine.Clock.defaultFakeTimer.tick(millis);
2333   - },
2334   -
2335   - runFunctionsWithinRange: function(oldMillis, nowMillis) {
2336   - jasmine.Clock.defaultFakeTimer.runFunctionsWithinRange(oldMillis, nowMillis);
2337   - },
2338   -
2339   - scheduleFunction: function(timeoutKey, funcToCall, millis, recurring) {
2340   - jasmine.Clock.defaultFakeTimer.scheduleFunction(timeoutKey, funcToCall, millis, recurring);
2341   - },
2342   -
2343   - useMock: function() {
2344   - if (!jasmine.Clock.isInstalled()) {
2345   - var spec = jasmine.getEnv().currentSpec;
2346   - spec.after(jasmine.Clock.uninstallMock);
2347   -
2348   - jasmine.Clock.installMock();
2349   - }
2350   - },
2351   -
2352   - installMock: function() {
2353   - jasmine.Clock.installed = jasmine.Clock.defaultFakeTimer;
2354   - },
2355   -
2356   - uninstallMock: function() {
2357   - jasmine.Clock.assertInstalled();
2358   - jasmine.Clock.installed = jasmine.Clock.real;
2359   - },
2360   -
2361   - real: {
2362   - setTimeout: jasmine.getGlobal().setTimeout,
2363   - clearTimeout: jasmine.getGlobal().clearTimeout,
2364   - setInterval: jasmine.getGlobal().setInterval,
2365   - clearInterval: jasmine.getGlobal().clearInterval
2366   - },
2367   -
2368   - assertInstalled: function() {
2369   - if (!jasmine.Clock.isInstalled()) {
2370   - throw new Error("Mock clock is not installed, use jasmine.Clock.useMock()");
2371   - }
2372   - },
2373   -
2374   - isInstalled: function() {
2375   - return jasmine.Clock.installed == jasmine.Clock.defaultFakeTimer;
2376   - },
2377   -
2378   - installed: null
2379   -};
2380   -jasmine.Clock.installed = jasmine.Clock.real;
2381   -
2382   -//else for IE support
2383   -jasmine.getGlobal().setTimeout = function(funcToCall, millis) {
2384   - if (jasmine.Clock.installed.setTimeout.apply) {
2385   - return jasmine.Clock.installed.setTimeout.apply(this, arguments);
2386   - } else {
2387   - return jasmine.Clock.installed.setTimeout(funcToCall, millis);
2388   - }
2389   -};
2390   -
2391   -jasmine.getGlobal().setInterval = function(funcToCall, millis) {
2392   - if (jasmine.Clock.installed.setInterval.apply) {
2393   - return jasmine.Clock.installed.setInterval.apply(this, arguments);
2394   - } else {
2395   - return jasmine.Clock.installed.setInterval(funcToCall, millis);
2396   - }
2397   -};
2398   -
2399   -jasmine.getGlobal().clearTimeout = function(timeoutKey) {
2400   - if (jasmine.Clock.installed.clearTimeout.apply) {
2401   - return jasmine.Clock.installed.clearTimeout.apply(this, arguments);
2402   - } else {
2403   - return jasmine.Clock.installed.clearTimeout(timeoutKey);
2404   - }
2405   -};
2406   -
2407   -jasmine.getGlobal().clearInterval = function(timeoutKey) {
2408   - if (jasmine.Clock.installed.clearTimeout.apply) {
2409   - return jasmine.Clock.installed.clearInterval.apply(this, arguments);
2410   - } else {
2411   - return jasmine.Clock.installed.clearInterval(timeoutKey);
2412   - }
2413   -};
2414   -
2415   -
2416   -jasmine.version_= {
2417   - "major": 1,
2418   - "minor": 0,
2419   - "build": 0,
2420   - "revision": 1284494074
2421   -};
js/lib/JSBuilder/src/generators/app/files/lib/sencha-jasmine/matchers/Controller.js deleted
... ... @@ -1,10 +0,0 @@
1   -/**
2   - * Sencha-specific matchers for convenient testing of Controller expectations
3   - */
4   -beforeEach(function() {
5   - this.addMatchers({
6   - toHaveRendered: function(expected) {
7   -
8   - }
9   - });
10   -});
11 0 \ No newline at end of file
js/lib/JSBuilder/src/generators/app/files/lib/sencha-jasmine/matchers/Model.js deleted
... ... @@ -1,54 +0,0 @@
1   -/**
2   - * Sencha-specific matchers for convenient testing of Model expectations
3   - */
4   -beforeEach(function() {
5   - this.addMatchers({
6   - /**
7   - * Sample usage:
8   - * expect('User').toHaveMany('Product');
9   - */
10   - toHaveMany: function(expected) {
11   - if (typeof this.actual == 'string') {
12   - this.actual = Ext.ModelManager.types[this.actual].prototype;
13   - }
14   -
15   - var associations = this.actual.associations.items,
16   - length = associations.length,
17   - association, i;
18   -
19   - for (i = 0; i < length; i++) {
20   - association = associations[i];
21   -
22   - if (association.associatedName == expected && association.type == 'hasMany') {
23   - return true;
24   - }
25   - }
26   -
27   - return false;
28   - },
29   -
30   - /**
31   - * Sample usage:
32   - * expect('Product').toBelongTo('User')
33   - */
34   - toBelongTo: function(expected) {
35   - if (typeof this.actual == 'string') {
36   - this.actual = Ext.ModelManager.types[this.actual].prototype;
37   - }
38   -
39   - var associations = this.actual.associations.items,
40   - length = associations.length,
41   - association, i;
42   -
43   - for (i = 0; i < length; i++) {
44   - association = associations[i];
45   -
46   - if (association.associatedName == expected && association.type == 'belongsTo') {
47   - return true;
48   - }
49   - }
50   -
51   - return false;
52   - }
53   - });
54   -});
55 0 \ No newline at end of file
js/lib/JSBuilder/src/generators/app/files/lib/sencha-jasmine/sencha-jasmine.css deleted
... ... @@ -1,226 +0,0 @@
1   -body {
2   - font-family:"Helvetica Neue Light", "Lucida Grande", "Calibri", "Arial", sans-serif;
3   - margin:0;
4   -}
5   -
6   -.jasmine_reporter > * {
7   - margin:10px;
8   -}
9   -
10   -.run_spec {
11   - float:right;
12   - font-size:10px;
13   -}
14   -
15   -/*banner*/
16   -.banner {
17   - position:relative;
18   - background:#fff;
19   - -webkit-box-shadow:0 0 10px #ccc;
20   - padding:4px 0 6px 6px;
21   - margin:0 0 10px 0;
22   -}
23   -.banner .logo {
24   - width:120px;
25   - height:50px;
26   -
27   - background:url(http://www.sencha.com/assets/images/logo-sencha-sm.png) no-repeat;
28   -}
29   -.banner .options {
30   - position:absolute;
31   - top:3px;
32   - right:3px;
33   - color:#666;
34   - font-size:10px;
35   -}
36   -.banner .options .show {
37   - text-align:right;
38   -}
39   -.banner .options .show > * {
40   - display:inline-block;
41   -}
42   -.banner .options .show label {
43   - margin-right:3px;
44   -}
45   -
46   -/*runner*/
47   -.runner,
48   -.suite {
49   - display:block;
50   -
51   - text-shadow:0 1px 0 #fff;
52   -
53   - border:1px solid #bbb;
54   - border-radius:5px;
55   - -moz-border-radius:5px;
56   - -webkit-border-radius:5px;
57   -
58   - background:-webkit-gradient(linear, left top, left bottom, from(#eee), to(#d1d1d1));
59   -
60   - -webkit-box-shadow:0 0 10px #ccc;
61   -
62   - padding:6px;
63   -}
64   -.runner a,
65   -.suite a {
66   - display:inline-block;
67   -
68   - color:#eee;
69   - font-size:11px;
70   - text-decoration:none;
71   - text-shadow:0 -1px 0 #000;
72   -
73   - border:1px solid #111;
74   - border-radius:5px;
75   - -moz-border-radius:5px;
76   - -webkit-border-radius:5px;
77   -
78   - background:-webkit-gradient(linear, left top, left bottom, from(#555), to(#212121));
79   -
80   - -webkit-background-clip: padding-box;
81   -
82   - padding:1px 4px 2px 4px;
83   -}
84   -.runner .finished-at {
85   - font-size:10px;
86   -
87   - padding-top:1px;
88   - padding-left:6px;
89   -}
90   -
91   -.runner.running {
92   - text-shadow:0 1px 0 #EDECCA;
93   -
94   - border-color:#D1CF84;
95   -
96   - background:-webkit-gradient(linear, left top, left bottom, from(#EDE613), to(#DBD61F));
97   -}
98   -.runner.running a {
99   - display:none;
100   -}
101   -
102   -.runner.failed a,
103   -.suite.failed a {
104   - border-color:#660000;
105   -
106   - background:-webkit-gradient(linear, left top, left bottom, from(#dd0000), to(#880000));
107   -}
108   -
109   -.runner.passed a,
110   -.suite.passed a {
111   - border-color:#006600;
112   -
113   - background:-webkit-gradient(linear, left top, left bottom, from(#00aa00), to(#006600));
114   -}
115   -
116   -/*suite*/
117   -.suite a.run_spec {
118   - display:none;
119   -}
120   -.suite > a.description {
121   - color:#000;
122   - font-size:18px;
123   - text-shadow:0 1px 0 #fff;
124   -
125   - border:0;
126   - background:transparent;
127   -}
128   -.suite .suite > a.description {
129   - font-size:14px;
130   -}
131   -.suite.failed {
132   - border-color:#E0C1C5;
133   -
134   - background:-webkit-gradient(linear, left top, left bottom, from(#FFF7F8), to(#F0DADD));
135   -}
136   -.suite.failed a.description {
137   - color:#440000;
138   -}
139   -.suite .suite {
140   - margin:5px;
141   -}
142   -
143   -/*spec*/
144   -.spec {
145   - margin: 5px;
146   - padding-left: 1em;
147   - clear: both;
148   -
149   - border:1px solid #ccc;
150   - border-radius:5px;
151   - -moz-border-radius:5px;
152   - -webkit-border-radius:5px;
153   -
154   - background:#fff;
155   -
156   - -webkit-box-shadow:inset 0 0 10px #ddd;
157   -
158   - -webkit-background-clip:padding-box;
159   -
160   - padding:10px;
161   -}
162   -.spec a.description {
163   - display:block;
164   -
165   - border:0;
166   -
167   - background:transparent;
168   -
169   - padding:0;
170   -
171   - color:#000 !important;
172   - font-size:16px;
173   - text-shadow:none;
174   -}
175   -.spec .messages {
176   - border:1px dashed #ccc;
177   - border-radius:5px;
178   - -moz-border-radius:5px;
179   - -webkit-border-radius:5px;
180   -
181   - background:#f1f1f1;
182   -
183   - margin:10px 0 0 0;
184   - padding:5px;
185   -
186   - font-size:11px;
187   - line-height:15px;
188   -}
189   -
190   -.passed,
191   -.skipped {
192   - display:none;
193   -}
194   -
195   -.runner.passed,
196   -.runner.skipped {
197   - display:block;
198   -}
199   -
200   -.suite.passed {
201   - border-color:#AEBFA6;
202   -
203   - background:-webkit-gradient(linear, left top, left bottom, from(#ECF2E9), to(#C8DBBF));
204   -}
205   -
206   -.show-passed .passed,
207   -.show-skipped .skipped {
208   - display:block;
209   -}
210   -
211   -.stackTrace {
212   - white-space: pre;
213   - font-size: .8em;
214   - margin-left: 10px;
215   - max-height: 5em;
216   - overflow: auto;
217   - border: 1px inset red;
218   - padding: 1em;
219   - background: #eef;
220   -}
221   -
222   -
223   -#jasmine_content {
224   - position:fixed;
225   - right: 100%;
226   -}
227 0 \ No newline at end of file
js/lib/JSBuilder/src/generators/app/files/lib/sencha-jasmine/sencha-jasmine.js deleted
... ... @@ -1,88 +0,0 @@
1   -jasmine.TrivialReporter.prototype.reportRunnerStarting = function(runner) {
2   - var showPassed, showSkipped;
3   -
4   - this.outerDiv = this.createDom('div', { className: 'jasmine_reporter' },
5   - this.createDom('div', { className: 'banner' },
6   - this.createDom('div', { className: 'logo' }),
7   - this.createDom('div', { className: 'options' },
8   - this.createDom('div', { className: 'show' },
9   - this.createDom('label', { "for": "__jasmine_TrivialReporter_showPassed__" }, " passed "),
10   - showPassed = this.createDom('input', { id: "__jasmine_TrivialReporter_showPassed__", type: 'checkbox' })
11   - ),
12   - this.createDom('div', { className: 'show' },
13   - this.createDom('label', { "for": "__jasmine_TrivialReporter_showSkipped__" }, " skipped"),
14   - showSkipped = this.createDom('input', { id: "__jasmine_TrivialReporter_showSkipped__", type: 'checkbox' })
15   - ),
16   - this.createDom('div', { className: 'show' },
17   - this.createDom('label', { "for": "__jasmine_TrivialReporter_automaticReload__" }," automatic reload"),
18   - automaticReload = this.createDom('input',
19   - (window.location.hash == "#reload") ? {id: "__jasmine_TrivialReporter_automaticReload__", type: 'checkbox', checked: true } : {id: "__jasmine_TrivialReporter_automaticReload__", type: 'checkbox'}
20   - )
21   - )
22   - )
23   - ),
24   -
25   - this.runnerDiv = this.createDom('div', { className: 'runner running' },
26   - this.createDom('a', { className: 'run_spec', href: '?' }, "run all"),
27   - this.runnerMessageSpan = this.createDom('span', {}, "Running..."),
28   - this.finishedAtSpan = this.createDom('span', { className: 'finished-at' }, ""))
29   - );
30   -
31   - this.document.body.appendChild(this.outerDiv);
32   -
33   - var suites = runner.suites();
34   - for (var i = 0; i < suites.length; i++) {
35   - var suite = suites[i];
36   - var suiteDiv = this.createDom('div', { className: 'suite' },
37   - this.createDom('a', { className: 'run_spec', href: '?spec=' + encodeURIComponent(suite.getFullName()) }, "run"),
38   - this.createDom('a', { className: 'description', href: '?spec=' + encodeURIComponent(suite.getFullName()) }, suite.description));
39   - this.suiteDivs[suite.id] = suiteDiv;
40   - var parentDiv = this.outerDiv;
41   - if (suite.parentSuite) {
42   - parentDiv = this.suiteDivs[suite.parentSuite.id];
43   - }
44   - parentDiv.appendChild(suiteDiv);
45   - }
46   -
47   - this.startedAt = new Date();
48   -
49   - var self = this;
50   - showPassed.onchange = function(evt) {
51   - if (evt.target.checked) {
52   - self.outerDiv.className += ' show-passed';
53   - } else {
54   - self.outerDiv.className = self.outerDiv.className.replace(/ show-passed/, '');
55   - }
56   - };
57   -
58   - showSkipped.onchange = function(evt) {
59   - if (evt.target.checked) {
60   - self.outerDiv.className += ' show-skipped';
61   - } else {
62   - self.outerDiv.className = self.outerDiv.className.replace(/ show-skipped/, '');
63   - }
64   - };
65   -
66   - automaticReload.onchange = function(evt) {
67   - if (evt.target.checked) {
68   - window.location.hash = "#reload";
69   - window.location.reload();
70   - } else {
71   - window.location.hash = "";
72   - window.location.reload();
73   - }
74   - };
75   -};
76   -
77   -if (window.location.hash == "#reload") {
78   - var interval = setInterval(function() {
79   - var isRunning = jasmine.getEnv().currentRunner_.queue.isRunning();
80   - if (!isRunning) {
81   - clearInterval(interval);
82   -
83   - setTimeout(function() {
84   - window.location.reload();
85   - }, 5000);
86   - };
87   - }, 1500);
88   -};
89 0 \ No newline at end of file
js/lib/JSBuilder/src/generators/app/files/public/resources/css/application.css deleted
... ... @@ -1,3 +0,0 @@
1   -.x-tablet .x-list, .x-desktop .x-list {
2   - border-right: 1px solid #000;
3   -}
4 0 \ No newline at end of file
js/lib/JSBuilder/src/generators/app/files/sencha.sh deleted
... ... @@ -1,11 +0,0 @@
1   -#!/bin/sh
2   -UNAME="$(uname)"
3   -ARGUMENTS=$*
4   -DIRNAME="$(dirname $0)/lib/JSBuilder"
5   -if [ $UNAME = "Darwin" ] ; then
6   - OS="mac"
7   -else
8   - OS="linux"
9   -fi
10   -CMD="$DIRNAME/jsdb/$OS/jsdb -path $DIRNAME $DIRNAME/bin/Dispatch.js $ARGUMENTS"
11   -$CMD
js/lib/JSBuilder/src/generators/app/files/test/unit/.htaccess deleted
... ... @@ -1,2 +0,0 @@
1   -ExpiresActive On
2   -ExpiresDefault "access"
3 0 \ No newline at end of file
js/lib/JSBuilder/src/generators/app/files/test/unit/SpecOptions.js deleted
... ... @@ -1,9 +0,0 @@
1   -/**
2   - * This file is included by your test/unit/index.html file and is used to apply settings before
3   - * the tests are run.
4   - */
5   -
6   -Ext.ns('fixtures');
7   -
8   -//Stops the Application from being booted up automatically
9   -Ext.Application.prototype.bindReady = Ext.emptyFn;
js/lib/JSBuilder/src/generators/app/files/test/unit/index.html deleted
... ... @@ -1,69 +0,0 @@
1   -<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
2   - "http://www.w3.org/TR/html4/loose.dtd">
3   -<html>
4   -<head>
5   - <title>Sencha - Jasmine Test Runner</title>
6   - <link rel="stylesheet" type="text/css" href="../../lib/sencha-jasmine/sencha-jasmine.css" />
7   -
8   - <script type="text/javascript" src="../../lib/touch/ext-touch-debug.js"></script>
9   -
10   - <script type="text/javascript" src="../../lib/jasmine/jasmine.js"></script>
11   - <script type="text/javascript" src="../../lib/jasmine/jasmine-html.js"></script>
12   - <script type="text/javascript" src="../../lib/sencha-jasmine/sencha-jasmine.js"></script>
13   - <script type="text/javascript" src="../../lib/sencha-jasmine/matchers/Model.js"></script>
14   - <script type="text/javascript" src="../../lib/sencha-jasmine/matchers/Controller.js"></script>
15   -
16   - <script type="text/javascript" src="SpecOptions.js"></script>
17   -</head>
18   -<body>
19   -
20   - <!-- include source files here... -->
21   - <div id="sourceFiles">
22   - <script type="text/javascript" src="../../app/app.js"></script>
23   -
24   - <div id="app-models">
25   -
26   - </div>
27   -
28   - <div id="app-controllers">
29   -
30   - </div>
31   -
32   - <div id="app-views">
33   -
34   - </div>
35   -
36   - <div id="app-stores">
37   -
38   - </div>
39   - </div>
40   -
41   - <!-- include fixture files here -->
42   - <div id="fixtures">
43   -
44   - </div>
45   -
46   - <!-- include spec files here... -->
47   - <div id="specFiles">
48   - <script type="text/javascript" src="app.js"></script>
49   -
50   - <div id="spec-models">
51   -
52   - </div>
53   -
54   - <div id="spec-controllers">
55   -
56   - </div>
57   -
58   - <div id="spec-views">
59   -
60   - </div>
61   - </div>
62   -
63   - <script type="text/javascript">
64   - jasmine.getEnv().addReporter(new jasmine.TrivialReporter());
65   - jasmine.getEnv().execute();
66   - </script>
67   -
68   -</body>
69   -</html>
70 0 \ No newline at end of file
js/lib/JSBuilder/src/generators/app/templates/Application.js deleted
... ... @@ -1,12 +0,0 @@
1   -/**
2   - * This file sets application-wide settings and launches the application when everything has
3   - * been loaded onto the page. By default we just render the application\s Viewport inside the
4   - * launch method (see app/views/Viewport.js).
5   - */
6   -{name} = new Ext.Application({
7   - defaultTarget: "viewport",
8   - name: "{name}",
9   - launch: function() {
10   - this.viewport = new {name}.Viewport();
11   - }
12   -});
13 0 \ No newline at end of file
js/lib/JSBuilder/src/generators/app/templates/Viewport.js deleted
... ... @@ -1,93 +0,0 @@
1   -/**
2   - * @class {name}.Viewport
3   - * @extends Ext.Panel
4   - * This is a default generated class which would usually be used to initialize your application's
5   - * main viewport. By default this is simply a welcome screen that tells you that the app was
6   - * generated correctly.
7   - */
8   -{name}.Viewport = Ext.extend(Ext.Panel, {
9   - id : 'viewport',
10   - layout : 'card',
11   - fullscreen: true,
12   -
13   - initComponent: function() {
14   - var store = new Ext.data.Store({
15   - fields: ['text', 'href'],
16   - data : [
17   - {
18   - text: 'Touch API',
19   - href: 'http://dev.sencha.com/deploy/touch/docs/'
20   - },
21   - {
22   - text: 'Touch Examples',
23   - href: 'http://dev.sencha.com/deploy/touch/examples/'
24   - }
25   - ]
26   - });
27   -
28   - Ext.apply(this, {
29   - dockedItems: [
30   - {
31   - dock : 'left',
32   - xtype: 'list',
33   - store: store,
34   - width: 250,
35   -
36   - tpl : '<{tpl} for="."><div class="link"><strong>\{text\}</strong></div></{tpl}>',
37   - itemSelector: 'div.link',
38   -
39   - listeners: {
40   - itemtap: this.onListItemTap
41   - },
42   -
43   - dockedItems: [
44   - {
45   - xtype: 'toolbar',
46   - dock : 'top',
47   - ui : 'light'
48   - }
49   - ]
50   - }
51   - ],
52   -
53   - items: [
54   - {
55   - xtype : 'panel',
56   - layout: 'fit',
57   -
58   - dockedItems: [
59   - {
60   - dock : 'top',
61   - xtype: 'toolbar',
62   - title: 'Welcome to Sencha Touch'
63   - }
64   - ],
65   -
66   - items: [
67   - {
68   - xtype: 'panel',
69   - style: 'background:#fff',
70   -
71   - styleHtmlContent: true,
72   -
73   - html : [
74   - '<h3>Getting Started</h3>',
75   - '<p>You have successfully generated the {name} application. Currently this app is a blank slate, ',
76   - 'with just the minimum set of files and directories. The file creating this interface can be found ',
77   - 'in app/views/Viewport.js</p>'
78   - ]
79   - }
80   - ]
81   - }
82   - ]
83   - });
84   -
85   - {name}.Viewport.superclass.initComponent.apply(this, arguments);
86   - },
87   -
88   - onListItemTap: function(list, index, node, e) {
89   - var record = list.getRecord(node);
90   -
91   - window.open(record.get('href'));
92   - }
93   -});
js/lib/JSBuilder/src/generators/controller/Controller.js deleted
... ... @@ -1,30 +0,0 @@
1   -/**
2   - * @class Ext.generator.Controller
3   - * @extends Ext.generator.Base
4   - * Generates a Controller file based on a template
5   - */
6   -Ext.generator.Controller = Ext.extend(Ext.generator.Base, {
7   -
8   - generate: function() {
9   - var controllerFile = 'app/controllers/' + this.name + '.js';
10   -
11   - this.headline("Generating the " + this.name + " controller");
12   -
13   - this.template('Controller', this, controllerFile);
14   - this.template('ControllerSpec', this, 'test/unit/controllers/' + this.name + '.js');
15   -
16   - this.insertInclude(controllerFile, 'sencha-controllers');
17   - this.insertInclude('../../' + controllerFile, 'app-controllers', 'test/unit/index.html');
18   - this.insertInclude('controllers/' + this.name + '.js', 'spec-controllers', 'test/unit/index.html');
19   - },
20   -
21   - decodeArgs: function(args) {
22   - this.name = args[0];
23   - this.actions = args.slice(1);
24   - }
25   -});
26   -
27   -Ext.regGenerator('controller', Ext.generator.Controller);
28   -
29   -load('src/generators/controller/templates/ControllerSpec.js');
30   -load('src/generators/controller/templates/Controller.js');
31 0 \ No newline at end of file
js/lib/JSBuilder/src/generators/controller/templates/Controller.js deleted
... ... @@ -1,9 +0,0 @@
1   -Ext.generator.Controller.templates.Controller = new Ext.XTemplate(
2   - 'Ext.regController("{name}", {\n',
3   - '<tpl for="actions">',
4   - ' {.}: function() {\n',
5   - ' \n',
6   - ' }{[xindex != xcount ? ",\n\n" : ""]}',
7   - '</tpl>',
8   - '\n});\n'
9   -);
10 0 \ No newline at end of file
js/lib/JSBuilder/src/generators/controller/templates/ControllerSpec.js deleted
... ... @@ -1,12 +0,0 @@
1   -Ext.generator.Controller.templates.ControllerSpec = new Ext.XTemplate(
2   - 'describe("The {name} controller", function() {\n',
3   - ' var controller = Ext.ControllerManager.get("{name}");\n\n',
4   - '<tpl for="actions">',
5   - ' describe("the {.} action", function() {\n',
6   - ' beforeEach(function() {\n',
7   - ' \n',
8   - ' });\n\n\n',
9   - ' });\n\n',
10   - '</tpl>',
11   - '});\n'
12   -);
13 0 \ No newline at end of file
js/lib/JSBuilder/src/generators/model/Model.js deleted
... ... @@ -1,47 +0,0 @@
1   -/**
2   - * @class Ext.generator.Model
3   - * @extends Ext.generator.Base
4   - * Generates a model file based on config
5   - */
6   -Ext.generator.Model = Ext.extend(Ext.generator.Base, {
7   -
8   - generate: function() {
9   - var modelFile = 'app/models/' + this.name + '.js',
10   - specFile = 'test/unit/models/' + this.name + '.js',
11   - fixtureFile = 'test/fixtures/' + this.name + '.js';
12   -
13   - this.headline("Generating the " + this.name + " model");
14   - this.template("Model", this, modelFile);
15   - this.template("ModelSpec", this, specFile);
16   - this.template("Fixture", this, fixtureFile);
17   -
18   - this.insertInclude(modelFile, 'sencha-models');
19   -
20   - this.insertInclude('../../' + modelFile, 'app-models', 'test/unit/index.html');
21   - this.insertInclude('models/' + this.name + '.js', 'spec-models', 'test/unit/index.html');
22   - this.insertInclude('../fixtures/' + this.name + '.js', 'fixtures', 'test/unit/index.html');
23   - },
24   -
25   - decodeArgs: function(args) {
26   - this.name = args[0];
27   - this.fields = args.slice(1);
28   -
29   - var length = this.fields.length,
30   - field, i;
31   -
32   - for (i = 0; i < length; i++) {
33   - field = this.fields[i].split(':');
34   -
35   - this.fields[i] = {
36   - name: field[0],
37   - type: field[1]
38   - };
39   - }
40   - }
41   -});
42   -
43   -Ext.regGenerator('model', Ext.generator.Model);
44   -
45   -load('src/generators/model/templates/ModelSpec.js');
46   -load('src/generators/model/templates/Model.js');
47   -load('src/generators/model/templates/Fixture.js');
48 0 \ No newline at end of file
js/lib/JSBuilder/src/generators/model/templates/Fixture.js deleted
... ... @@ -1,9 +0,0 @@
1   -Ext.generator.Model.templates.Fixture = new Ext.XTemplate(
2   - '(function() \{\n',
3   - ' var {name} = Ext.ModelManager.getModel("{name}");\n',
4   - ' \n',
5   - ' fixtures.{name} = \{\n',
6   - ' \n',
7   - ' \};\n',
8   - '\})();\n'
9   -);
10 0 \ No newline at end of file
js/lib/JSBuilder/src/generators/model/templates/Model.js deleted
... ... @@ -1,9 +0,0 @@
1   -Ext.generator.Model.templates.Model = new Ext.XTemplate(
2   - 'Ext.regModel("{name}", {\n',
3   - ' fields: [\n',
4   - '<tpl for="fields">',
5   - ' \{name: "{name}", type: "{type}"\}{[xindex != xcount ? "," : ""]}\n',
6   - '</tpl>',
7   - ' ]\n',
8   - '});'
9   -);
10 0 \ No newline at end of file
js/lib/JSBuilder/src/generators/model/templates/ModelSpec.js deleted
... ... @@ -1,9 +0,0 @@
1   -Ext.generator.Model.templates.ModelSpec = new Ext.XTemplate(
2   - 'describe("A {name}", function() {\n',
3   - ' var {name} = Ext.ModelManager.getModel("{name}"),\n',
4   - ' instance;\n\n',
5   - ' beforeEach(function() {\n',
6   - ' instance = new {name}({});\n',
7   - ' });\n\n',
8   - '});'
9   -);
10 0 \ No newline at end of file
js/lib/JSBuilder/tests/builder.js deleted
... ... @@ -1,6 +0,0 @@
1   -/*
2   - * To change this template, choose Tools | Templates
3   - * and open the template in the editor.
4   - */
5   -
6   -
js/lib/JSBuilder/tests/parser.js deleted
... ... @@ -1,51 +0,0 @@
1   -Loader.require('Parser');
2   -Loader.require('Filesystem');
3   -
4   -Parser.setParams({
5   - browser: 'ie',
6   - browserVersion: 6,
7   - version: 3.1,
8   - minVersion: 2.0,
9   - debug: true
10   -});
11   -
12   -assertTrue("Browser is IE", Parser.evaluate('browser', 'ie'));
13   -assertTrue("Browser is not firefox", Parser.evaluate('browser', '!firefox'));
14   -assertTrue("Browser version is greater than 5", Parser.evaluate('browserVersion', '>5'));
15   -assertTrue("Browser version is less than 7", Parser.evaluate('browserVersion', '<7'));
16   -assertTrue("Browser version is greater or equal to 6", Parser.evaluate('browserVersion', '>=6'));
17   -assertFalse("Nonexistent", Parser.evaluate('nonexistent'));
18   -
19   -assertTrue("//<if browser=ie> is a valid statement", Parser.isStatement('//<if browser=ie>'));
20   -assertTrue(" //<if browser=ie> (tab in front) is a valid statement", Parser.isStatement(' //<if browser=ie>'));
21   -assertTrue("//<if browser=ie> (spaces at the end) is a valid statement", Parser.isStatement('//<if browser=ie> '));
22   -
23   -assertFalse("//</if> is not a valid opening statement", Parser.isStatement('//</if>'));
24   -assertTrue("//</if> is valid close of if", Parser.isCloseOf('//</if>', { type: 'if', isInverted: false }));
25   -assertTrue("//</!if> is valid close of inverted if", Parser.isCloseOf('//</!if>', { type: 'if', isInverted: true }));
26   -
27   -assertEqual("Parser.parseStatementProperties('browser=ie debug')",
28   - Parser.parseStatementProperties('browser=ie debug'), { browser: 'ie', debug: true });
29   -
30   -assertEqual("Parser.parseStatementProperties('browser=\"ie\" browserVersion='!7' debug=false')",
31   - Parser.parseStatementProperties('browser="ie" browserVersion=\'!7\' debug=false'), { browser: 'ie', browserVersion: '!7', debug: "false" });
32   -
33   -assertEqual("Parser.parseStatement('//<deprecated since=\"3.0\">')",
34   - Parser.parseStatement('//<deprecated since="3.0">'), { properties: { since: '3.0' }, type: 'deprecated', isInverted: false });
35   -
36   -assertEqual("Parser.parse before1.js and after1.js",
37   - Parser.parse(PATH + 'tests/parser/before1.js'), Filesystem.readFile(PATH + 'tests/parser/after1.js'));
38   -
39   -assertEqual("Parser.parse before2.js and after2.js",
40   - Parser.parse(PATH + 'tests/parser/before2.js'), Filesystem.readFile(PATH + 'tests/parser/after2.js'));
41   -
42   -Parser.setParams({
43   - debug: true,
44   - debugLevel: 2
45   -});
46   -
47   -assertEqual("Parser.parse before3.js and after3.js",
48   - Parser.parse(PATH + 'tests/parser/before3.js'), Filesystem.readFile(PATH + 'tests/parser/after3.js'));
49   -
50   -assertEqual("Parser.parse before4.js and after4.js",
51   - Parser.parse(PATH + 'tests/parser/before4.js'), Filesystem.readFile(PATH + 'tests/parser/after4.js'));
js/lib/JSBuilder/tests/parser/after1.js deleted
... ... @@ -1,9 +0,0 @@
1   -// Normal comment here
2   -var lorem = {
3   - ipsum: true,
4   - // Nested if here
5   - else_here: 'ok',
6   - other: 'thing'
7   -};
8   -//<unknownTag>
9   -var testing = 123;
10 0 \ No newline at end of file
js/lib/JSBuilder/tests/parser/after2.js deleted
... ... @@ -1,2 +0,0 @@
1   -alert('Debug here');
2   -
js/lib/JSBuilder/tests/parser/after3.js deleted
... ... @@ -1,9 +0,0 @@
1   - if (someCondition) {
2   - throw new Error("Some error");
3   - }
4   -
5   - if (someCondition) {
6   - console.warn("Some warning");
7   - }
8   -
9   -
js/lib/JSBuilder/tests/parser/after4.js deleted
... ... @@ -1 +0,0 @@
1   -var test = 1+1;
js/lib/JSBuilder/tests/parser/before1.js deleted
... ... @@ -1,17 +0,0 @@
1   -// Normal comment here
2   -//<if debug>
3   -var lorem = {
4   - ipsum: true,
5   - // Nested if here
6   - //<if browser=ie browserVersion=7>
7   - if_here: 'blah',
8   - //<elseif browser="!ie">
9   - elseif_here: 'tada',
10   - //<else>
11   - else_here: 'ok',
12   - //</if>
13   - other: 'thing'
14   -};
15   -//</if>
16   -//<unknownTag>
17   -var testing = 123;
18 0 \ No newline at end of file
js/lib/JSBuilder/tests/parser/before2.js deleted
... ... @@ -1,9 +0,0 @@
1   -//<debug>
2   -alert('Debug here');
3   -//<else>
4   -alert('Not debug here');
5   -//</debug>
6   -
7   -//<deprecated since="1.0">
8   -alert("Deprecated since 1.0")
9   -//</deprecated>
10 0 \ No newline at end of file
js/lib/JSBuilder/tests/parser/before3.js deleted
... ... @@ -1,23 +0,0 @@
1   -//<debug error>
2   - if (someCondition) {
3   - throw new Error("Some error");
4   - }
5   -//</debug>
6   -
7   -//<debug warn>
8   - if (someCondition) {
9   - console.warn("Some warning");
10   - }
11   -//</debug>
12   -
13   -//<debug info>
14   - if (someCondition) {
15   - console.log("Some info");
16   - }
17   -//</debug>
18   -
19   -//<debug>
20   - if (someCondition) {
21   - console.log("Some other info");
22   - }
23   -//</debug>
js/lib/JSBuilder/tests/parser/before4.js deleted
... ... @@ -1,5 +0,0 @@
1   -//<debug error>
2   -//<uncomment>
3   -//var test = 1+1;
4   -//</uncomment>
5   -//</debug>
js/lib/JSBuilder/tests/run.js deleted
... ... @@ -1,50 +0,0 @@
1   -var PATH = system.script.replace(/tests(\/|\\)run.js/, '');
2   -load(PATH + 'src/Loader.js');
3   -
4   -Loader.setBasePath(PATH + 'src');
5   -
6   -Loader.require([
7   - 'Ext',
8   - 'Cli',
9   - 'Logger'
10   -]);
11   -
12   -var assertTrue = function(message, a) {
13   - assertEqual(message, a, true);
14   -};
15   -var assertFalse = function(message, a) {
16   - assertEqual(message, a, false);
17   -};
18   -var assertEqual = function(message, a, b) {
19   - if ((Ext.isArray(a) || Ext.isObject(a)) && (Ext.isArray(b) || Ext.isObject(b))) {
20   - a = JSON.stringify(a);
21   - b = JSON.stringify(b);
22   - }
23   - Logger.log("[" + ((a === b) ? "PASSED" : "FAILED") + "] " + message);
24   -};
25   -var assertNotEqual = function(message, a, b) {
26   - assertEqual(message, a, !b);
27   -};
28   -
29   -var Tester = Ext.extend(Cli, {
30   - name: "Super simple Unit Tester",
31   - version: "1.0",
32   -
33   - map: {
34   - n: {
35   - name: 'name',
36   - required: true,
37   - desc: 'Name of the test you want to run, e.g Parser'
38   - }
39   - },
40   -
41   - run: function() {
42   - if (Tester.superclass.run.call(this) === false)
43   - return;
44   -
45   - load(PATH + 'tests/'+this.get('name')+'.js');
46   - }
47   -});
48   -
49   -var tester = new Tester();
50   -tester.run();
js/lib/JSBuilder/ycompressor/ycompressor.jar deleted
No preview for this file type
js/lib/compat/ext3-compat.css deleted
... ... @@ -1,138 +0,0 @@
1   -/*===============================================================================================
2   - Creates rounded, raised boxes like on the Ext website - the markup isn't pretty:
3   - <div class="x-box-blue">
4   - <div class="x-box-tl"><div class="x-box-tr"><div class="x-box-tc"></div></div></div>
5   - <div class="x-box-ml"><div class="x-box-mr"><div class="x-box-mc">
6   - <h3>YOUR TITLE HERE (optional)</h3>
7   - <div>YOUR CONTENT HERE</div>
8   - </div></div></div>
9   - <div class="x-box-bl"><div class="x-box-br"><div class="x-box-bc"></div></div></div>
10   - </div>
11   - These rules used to be part of ext-all.css but this markup is no longer
12   - officially supported as part of the framework.
13   - */
14   -.x-box-tl {
15   - background: transparent no-repeat 0 0;
16   - zoom:1;
17   -}
18   -.x-box-tc {
19   - height: 8px;
20   - background: transparent repeat-x 0 0;
21   - overflow: hidden;
22   -}
23   -.x-box-tr {
24   - background: transparent no-repeat right -8px;
25   -}
26   -.x-box-ml {
27   - background: transparent repeat-y 0;
28   - padding-left: 4px;
29   - overflow: hidden;
30   - zoom:1;
31   -}
32   -.x-box-mc {
33   - background: repeat-x 0 -16px;
34   - padding: 4px 10px;
35   -}
36   -.x-box-mc h3 {
37   - margin: 0 0 4px 0;
38   - zoom:1;
39   -}
40   -.x-box-mr {
41   - background: transparent repeat-y right;
42   - padding-right: 4px;
43   - overflow: hidden;
44   -}
45   -.x-box-bl {
46   - background: transparent no-repeat 0 -16px;
47   - zoom:1;
48   -}
49   -.x-box-bc {
50   - background: transparent repeat-x 0 -8px;
51   - height: 8px;
52   - overflow: hidden;
53   -}
54   -.x-box-br {
55   - background: transparent no-repeat right -24px;
56   -}
57   -.x-box-tl, .x-box-bl {
58   - padding-left: 8px;
59   - overflow: hidden;
60   -}
61   -.x-box-tr, .x-box-br {
62   - padding-right: 8px;
63   - overflow: hidden;
64   -}
65   -.x-box-tl {
66   - background-image: url(images/box/corners.gif);
67   -}
68   -.x-box-tc {
69   - background-image: url(images/box/tb.gif);
70   -}
71   -.x-box-tr {
72   - background-image: url(images/box/corners.gif);
73   -}
74   -.x-box-ml {
75   - background-image: url(images/box/l.gif);
76   -}
77   -.x-box-mc {
78   - background-color: #eee;
79   - background-image: url(images/box/tb.gif);
80   - font-family: "Myriad Pro","Myriad Web","Tahoma","Helvetica","Arial",sans-serif;
81   - color: #393939;
82   - font-size: 12px;
83   -}
84   -.x-box-mc h3 {
85   - font-size: 14px;
86   - font-weight: bold;
87   -}
88   -.x-box-mr {
89   - background-image: url(images/box/r.gif);
90   -}
91   -.x-box-bl {
92   - background-image: url(images/box/corners.gif);
93   -}
94   -.x-box-bc {
95   - background-image: url(images/box/tb.gif);
96   -}
97   -.x-box-br {
98   - background-image: url(images/box/corners.gif);
99   -}
100   -.x-box-blue .x-box-bl, .x-box-blue .x-box-br, .x-box-blue .x-box-tl, .x-box-blue .x-box-tr {
101   - background-image: url(images/box/corners-blue.gif);
102   -}
103   -.x-box-blue .x-box-bc, .x-box-blue .x-box-mc, .x-box-blue .x-box-tc {
104   - background-image: url(images/box/tb-blue.gif);
105   -}
106   -.x-box-blue .x-box-mc {
107   - background-color: #c3daf9;
108   -}
109   -.x-box-blue .x-box-mc h3 {
110   - color: #17385b;
111   -}
112   -.x-box-blue .x-box-ml {
113   - background-image: url(images/box/l-blue.gif);
114   -}
115   -.x-box-blue .x-box-mr {
116   - background-image: url(images/box/r-blue.gif);
117   -}
118   -
119   -/*===============================================================================================
120   - * Spotlight utility
121   - */
122   -.x-spotlight {
123   - z-index: 8999;
124   - position: absolute;
125   - top:0;
126   - left:0;
127   - -moz-opacity: 0.5;
128   - opacity: .50;
129   - filter: alpha(opacity=50);
130   - width:0;
131   - height:0;
132   - zoom: 1;
133   - background-color: #ccc;
134   -}
135   -
136   -/*===============================================================================================
137   - *
138   - */
js/lib/compat/ext3-compat.js deleted
... ... @@ -1,1808 +0,0 @@
1   -//
2   -// TODO: Add GridPanel.getView() to the lib
3   -// TODO: Rename Ext.ux.PreviewPlugin -> Ext.grid.RowPreviewPlugin
4   -// TODO: Move CSS styles from paging.html into grid.css
5   -// TODO: Move JsonStore fix into the lib
6   -//
7   -/*========================================================================
8   - *
9   - * This section contains stuff that should be in Ext4, or stuff that
10   - * is up for discussion. It should be removed prior to Ext 4 final.
11   - *
12   - *========================================================================*/
13   -
14   -// This should be working as the alternateClassName but doesn't for some reason
15   -Ext.toolbar.Toolbar.SplitButton = Ext.button.Split;
16   -
17   -// DomHelper does not currently go through the ClassManager so there is no alternateClassName
18   -Ext.DomHelper = Ext.core.DomHelper;
19   -
20   -Ext.apply(Ext.panel.Panel.prototype, {
21   - getToolbars : function(){
22   - return this.getDockedItems('toolbar');
23   - }
24   -});
25   -
26   -// Not sure if these are intended to be deprecated or they just haven't been moved over
27   -Ext.apply(Ext.menu.Menu.prototype, {
28   - addSeparator : function() {
29   - return this.add(Ext.create('Ext.menu.Separator'));
30   - },
31   - addElement : function(el) {
32   - return this.add(Ext.create('Ext.menu.Item', {
33   - el: el
34   - }));
35   - },
36   - addItem : function(item) {
37   - return this.add(item);
38   - },
39   - addMenuItem : function(config) {
40   - return this.add(this.lookupComponent(config));
41   - },
42   - addText : function(text){
43   - return this.add(Ext.create('Ext.menu.Item', {
44   - plain: true,
45   - text: text
46   - }));
47   - }
48   -});
49   -
50   -
51   -/*========================================================================
52   - *
53   - * This section contains true compatibility overrides and should ship
54   - * with Ext 4 as an optional compatibility layer for Ext 3 code.
55   - * Ext.Compat is defined in ext3-core-compat.js.
56   - *
57   - *========================================================================*/
58   -
59   -(function(){
60   - var compat = Ext.Compat,
61   - deprecate = Ext.bind(compat.deprecate, compat),
62   - notify = Ext.bind(compat.notify, compat),
63   - breaking = Ext.bind(compat.breaking, compat);
64   -
65   - /*-------------------------------------------------------------
66   - * Date (from the Ext.util folder in 3.x)
67   - *-------------------------------------------------------------*/
68   - (function(){
69   - var nativeDate = window.Date,
70   - utilDate = Ext.Date,
71   - staticMappings = ['useStrict', 'formatCodeToRegex', 'parseFunctions', 'parseRegexes', 'formatFunctions', 'y2kYear',
72   - 'MILLI', 'SECOND', 'MINUTE', 'HOUR', 'DAY', 'MONTH', 'YEAR', 'defaults', 'dayNames', 'monthNames',
73   - 'monthNumbers', 'formatCodes', 'getFormatCode', 'createFormat', 'createParser', 'parseCodes'],
74   - staticOverrides = ['getShortMonthName', 'getShortDayName', 'getMonthNumber', 'isValid', 'parseDate'],
75   - proto = ['dateFormat', 'format', 'getTimezone', 'getGMTOffset', 'getDayOfYear', 'getWeekOfYear', 'isLeapYear',
76   - 'getFirstDayOfMonth', 'getLastDayOfMonth', 'getFirstDateOfMonth', 'getLastDateOfMonth', 'getDaysInMonth',
77   - 'getSuffix', 'clone', 'isDST', 'clearTime', 'add', 'between'];
78   -
79   - // Static direct mappings. These are either private methods or any members
80   - // that cannot be aliased as methods to include a warning. These are documented
81   - // in the migration guide as breaking changes to be fixed.
82   - Ext.Array.forEach(staticMappings, function(member) {
83   - nativeDate[member] = utilDate[member];
84   - });
85   -
86   - // Static overrides. These are public static methods that can be overridden
87   - // as methods to include console warnings.
88   - Ext.Array.forEach(staticOverrides, function(member) {
89   - nativeDate[member] = function(){
90   - deprecate({pkg:'Date', member:member, alt:'Ext.Date.'+member});
91   - return utilDate[member].apply(utilDate, arguments);
92   - };
93   - });
94   -
95   - // Prototype (instance) overrides
96   - Ext.Array.forEach(proto, function(member) {
97   - nativeDate.prototype[member] = function() {
98   - if(member !== 'dateFormat'){
99   - // dateFormat is actually private, and it is aliased publicly as "format". It needs
100   - // to be included, but we can skip the warning as it would be a duplicate of the format
101   - // warning and would actually be misleading since it won't have been called directly.
102   - // All other methods in this array are public and should give a warning.
103   - deprecate({pkg:'Date', member:'<date>.'+member, alt:'Ext.Date.'+member,
104   - msg:'Note that this is now a static method, so the date instance will be the first argument to the new version.'});
105   - }
106   - return utilDate[member].apply(utilDate, [this].concat(Array.prototype.slice.call(arguments)));
107   - };
108   - });
109   - })();
110   -
111   - /*-------------------------------------------------------------
112   - * XTypes
113   - *-------------------------------------------------------------*/
114   - if (Ext.ClassManager) {
115   - Ext.apply(Ext.ClassManager, {
116   - instantiateByAlias: Ext.Function.createInterceptor(Ext.ClassManager.instantiateByAlias, function() {
117   - var args = Ext.Array.toArray(arguments),
118   - alias = args.shift();
119   - //
120   - // These are xtypes that are not currently aliased in the framework code.
121   - // Not sure if these should really be deprecated or not...
122   - //
123   - if(alias == 'widget.tbsplit'){
124   - deprecate({pkg:'Core', member:'tbsplit', alt:'splitbutton', type:'xtype'});
125   - Ext.ClassManager.setAlias('Ext.button.Split', 'widget.tbsplit');
126   - }
127   - if(alias == 'widget.progress'){
128   - deprecate({pkg:'Core', member:'progress', alt:'progressbar', type:'xtype'});
129   - Ext.ClassManager.setAlias('Ext.ProgressBar', 'widget.progress');
130   - }
131   - })
132   - });
133   - }
134   -
135   - /*-------------------------------------------------------------
136   - * MicedCollection
137   - *-------------------------------------------------------------*/
138   - if (Ext.util.AbstractMixedCollection) {
139   - Ext.apply(Ext.util.AbstractMixedCollection.prototype, {
140   - removeKey : function() {
141   - deprecate({pkg:'Ext.util.MixedCollection', member:'removeKey', alt:'removeAtKey'});
142   - return this.removeAtKey.apply(this, arguments);
143   - },
144   - item : function() {
145   - deprecate({pkg:'Ext.util.MixedCollection', member:'item', alt:'get'});
146   - return this.get.apply(this, arguments);
147   - },
148   - itemAt : function() {
149   - deprecate({pkg:'Ext.util.MixedCollection', member:'itemAt', alt:'getAt'});
150   - return this.getAt.apply(this, arguments);
151   - },
152   - key : function() {
153   - deprecate({pkg:'Ext.util.MixedCollection', member:'key', alt:'getByKey'});
154   - return this.getByKey.apply(this, arguments);
155   - }
156   - });
157   - }
158   - if (Ext.util.MixedCollection) {
159   - Ext.apply(Ext.util.MixedCollection.prototype, {
160   - constructor: Ext.Function.createInterceptor(Ext.util.MixedCollection.prototype.constructor, function() {
161   - this._origSort = this.sort;
162   - this.sort = function(dir, fn) {
163   - if (Ext.isFunction(fn)) {
164   - deprecate({pkg:'Ext.util.MixedCollection', member:'sort (with a comparator fn)', alt:'sortBy',
165   - msg:'Calling MixedCollection.sort and passing a comparator function as the second parameter '+
166   - 'is no longer supported. See the docs for MixedCollection.sort to see the current '+
167   - 'valid parameter list. When passing a comparator function, use sortBy instead.'});
168   -
169   - return this.sortBy(fn);
170   - }
171   - return this._origSort(arguments);
172   - }
173   - }),
174   - keySort : function() {
175   - deprecate({pkg:'Ext.util.MixedCollection', member:'keySort', alt:'sortByKey'});
176   - return this.sortByKey.apply(this, arguments);
177   - }
178   - });
179   - }
180   -
181   - /*-------------------------------------------------------------
182   - * AbstractComponent
183   - *-------------------------------------------------------------*/
184   - if (Ext.AbstractComponent) {
185   - Ext.apply(Ext.AbstractComponent.prototype, {
186   - addClass : function() {
187   - deprecate({pkg:'Ext.Component', member:'addClass', alt:'addCls'});
188   - return this.addCls.apply(this, arguments);
189   - },
190   - removeClass : function() {
191   - deprecate({pkg:'Ext.Component', member:'removeClass', alt:'removeCls'});
192   - return this.removeCls.apply(this, arguments);
193   - }
194   - });
195   - }
196   -
197   - /*-------------------------------------------------------------
198   - * Component
199   - *-------------------------------------------------------------*/
200   - if (Ext.Component) {
201   - Ext.apply(Ext.Component.prototype, {
202   - initComponent: Ext.Function.createInterceptor(Ext.Component.prototype.initComponent, function() {
203   - if(Ext.isDefined(this.applyTo)){
204   - deprecate({pkg:'Ext.Component', member:'applyTo', type:'config', alt:'renderTo',
205   - msg:'Applying components to existing markup via "applyTo" is no longer supported.'});
206   -
207   - var replaced = false;
208   - try{
209   - var target = Ext.get(this.applyTo);
210   - if (target) {
211   - var parent = target.parent();
212   - if (parent) {
213   - this.renderTo = parent;
214   - target.remove();
215   - replaced = true;
216   - notify({pkg:'Ext.Component', member:'applyTo', msg:'This component will attempt to render to '+
217   - 'the applyTo target\'s parent node ("' + parent.id + '"). If this did not work as expected then '+
218   - 'you will have to replace the applyTo config manually before this component will render properly.'})
219   - }
220   - }
221   - } catch(ex) {}
222   -
223   - if (!replaced) {
224   - breaking({pkg:'Ext.Component', member:'applyTo', msg:'Attempted to render the component to the applyTo target\'s '+
225   - 'parent node, but this failed. You must resolve this manually before the component can render.'})
226   - }
227   - }
228   - })
229   - });
230   -
231   - Ext.define('Ext.BoxComponent', {
232   - extend: 'Ext.Component',
233   - constructor: function() {
234   - deprecate({member:'Ext.BoxComponent', alt:'Ext.Component',
235   - msg:'All functionality from BoxComponent is now directly in Component. '+
236   - 'Replace "BoxComponent" with "Component" and/or xtype "box" with "component".'});
237   -
238   - this.callParent(arguments);
239   - }
240   - });
241   - }
242   -
243   - /*-------------------------------------------------------------
244   - * ComponentManager
245   - *-------------------------------------------------------------*/
246   - if (Ext.ComponentManager) {
247   - var regMsg = 'Calling a separate function to register custom types is no longer necessary. '+
248   - 'Switch your class definition to use Ext.define with "{0}" as the alias config.';
249   -
250   - var checkClassRef = function(pkg, cls, member) {
251   - if (!Ext.isString(cls)) {
252   - breaking({pkg:pkg, member:member, msg:'You must either convert the passed class reference to a string -- e.g. ' +
253   - pkg + '.' + member + '("myclass", "Ext.ux.MyClass") -- or change your class definition to use Ext.define. '+
254   - 'See the section in the Migration Guide on registering xtypes for more info.'});
255   - }
256   - };
257   -
258   - Ext.ComponentManager.registerType = function(xtype, cls){
259   - deprecate({pkg:'ComponentManager', member:'registerType', msg:Ext.String.format(regMsg, 'widget.'+xtype)});
260   - checkClassRef('ComponentManager', cls, 'registerType');
261   - Ext.ClassManager.setAlias(cls, 'widget.'+xtype);
262   - };
263   - Ext.reg = function(xtype, cls){
264   - deprecate({pkg:'Ext', member:'reg', msg:Ext.String.format(regMsg, 'widget.'+xtype)});
265   - checkClassRef('Ext', cls, 'reg');
266   - Ext.ClassManager.setAlias(cls, 'widget.'+xtype);
267   - };
268   - Ext.ComponentManager.registerPlugin = function(ptype, cls){
269   - deprecate({pkg:'ComponentManager', member:'registerPlugin', msg:Ext.String.format(regMsg, 'plugin.'+ptype)});
270   - checkClassRef('ComponentManager', cls, 'registerPlugin');
271   - Ext.ClassManager.setAlias(cls, 'plugin.'+ptype);
272   - };
273   - Ext.preg = function(ptype, cls){
274   - deprecate({pkg:'Ext', member:'preg', msg:Ext.String.format(regMsg, 'plugin.'+ptype)});
275   - checkClassRef('Ext', cls, 'preg');
276   - Ext.ClassManager.setAlias(cls, 'plugin.'+ptype);
277   - };
278   - }
279   -
280   - /*-------------------------------------------------------------
281   - * Container
282   - *-------------------------------------------------------------*/
283   - if (Ext.container.AbstractContainer) {
284   - Ext.apply(Ext.container.AbstractContainer.prototype, {
285   - get: function(comp) {
286   - deprecate({pkg:'Ext.Container', member:'get', alt:'getComponent'});
287   - return this.getComponent(comp);
288   - },
289   - findById: function(id) {
290   - deprecate({pkg:'Ext.Container', member:'findById', alt:'query', msg:'Use the query method with the # id syntax, e.g. comp.query("#"+id).'});
291   - return this.query('#'+id);
292   - }
293   - });
294   - }
295   - if (Ext.container.Container) {
296   - Ext.apply(Ext.container.Container.prototype, {
297   - initComponent: Ext.Function.createInterceptor(Ext.container.Container.prototype.initComponent, function() {
298   - if (this.layout === 'form') {
299   - deprecate({pkg:'FormPanel', member:'form', type:'layout',
300   - msg:'Form layout no longer exists, use a different container layout and allow each field\'s '+
301   - 'Field layout to apply labels. Falling back to anchor layout.'});
302   -
303   - this.layout = 'anchor';
304   - }
305   - })
306   - });
307   - }
308   -
309   - /*-------------------------------------------------------------
310   - * Toolbar
311   - *-------------------------------------------------------------*/
312   - if (Ext.toolbar.Toolbar) {
313   - Ext.apply(Ext.toolbar.Toolbar.prototype, {
314   - addField : function(field){
315   - deprecate({pkg:'Toolbar', member:'addField', alt:'add'});
316   - return this.add(field);
317   - }
318   - });
319   - }
320   -
321   - /*-------------------------------------------------------------
322   - * PagingToolbar
323   - *-------------------------------------------------------------*/
324   - if (Ext.toolbar.Paging) {
325   - Ext.apply(Ext.toolbar.Paging.prototype, {
326   - constructor: Ext.Function.createInterceptor(Ext.toolbar.Paging.prototype.constructor, function(config) {
327   - if (config.paramNames) {
328   - var msg = 'Instead of params specific to this toolbar you should set any needed options on the associated store/proxy. '+
329   - 'See the header docs for Ext.data.Store for details. The defaults for PagingToolbar {start: \'start\', limit: \'limit\'} '+
330   - 'would map to the store\'s proxy as {startParam: \'start\', limitParam: \'limit\'}.';
331   -
332   - if (config.store && config.store.proxy) {
333   - config.store.proxy.startParam = config.paramNames[start];
334   - config.store.proxy.limitParam = config.paramNames[limit];
335   - deprecate({pkg:'PagingToolbar', member:'paramNames', msg:msg});
336   - }
337   - else {
338   - breaking({pkg:'PagingToolbar', member:'paramNames', msg:msg + ' No proxy is available in the current PagingToolbar '+
339   - 'configuration so this cannot be aliased automatically.'});
340   - }
341   - delete config.paramNames;
342   - }
343   - if (config.pageSize) {
344   - config.store.pageSize = config.pageSize;
345   - deprecate({pkg:'PagingToolbar', member:'pageSize', alt:'store.pageSize'});
346   - }
347   - }),
348   - changePage : function(page){
349   - deprecate({pkg:'PagingToolbar', member:'changePage', alt:'store.loadPage'});
350   - this.store.loadPage(page);
351   - }
352   - });
353   - }
354   -
355   - /*-------------------------------------------------------------
356   - * Views
357   - *-------------------------------------------------------------*/
358   - if (Ext.view.AbstractView) {
359   - Ext.apply(Ext.view.AbstractView.prototype, {
360   - initComponent : function(){
361   - var isDef = Ext.isDefined;
362   - if (!isDef(this.tpl) || !isDef(this.store) || !isDef(this.itemSelector)) {
363   - throw "DataView requires tpl, store and itemSelector configurations to be defined.";
364   - }
365   - Ext.view.AbstractView.superclass.initComponent.call(this);
366   - if(Ext.isString(this.tpl) || Ext.isArray(this.tpl)){
367   - this.tpl = new Ext.XTemplate(this.tpl);
368   - }
369   -
370   - if (isDef(this.overClass)){
371   - deprecate({pkg:'DataView', member:'overClass', alt:'overItemCls', type:'config'});
372   - this.overItemCls = this.overClass;
373   - delete this.overClass;
374   - }
375   - if (isDef(this.overCls)){
376   - deprecate({pkg:'DataView', member:'overCls', alt:'overItemCls', type:'config'});
377   - this.overItemCls = this.overCls;
378   - delete this.overCls;
379   - }
380   - if (isDef(this.selectedClass)){
381   - deprecate({pkg:'DataView', member:'selectedClass', alt:'selectedItemCls', type:'config'});
382   - this.selectedItemCls = this.selectedClass;
383   - delete this.selectedClass;
384   - }
385   - if (isDef(this.selectedCls)){
386   - deprecate({pkg:'DataView', member:'selectedCls', alt:'selectedItemCls', type:'config'});
387   - this.selectedItemCls = this.selectedCls;
388   - delete this.selectedCls;
389   - }
390   -
391   - this.addEvents(
392   - 'beforerefresh',
393   - 'refresh'
394   - );
395   - this.addCmpEvents();
396   - this.store = Ext.data.StoreManager.lookup(this.store);
397   - this.all = new Ext.CompositeElementLite();
398   - this.getSelectionModel().bindComponent(this);
399   - }
400   - });
401   - }
402   -
403   - /*-------------------------------------------------------------
404   - * Panel
405   - *-------------------------------------------------------------*/
406   - if (Ext.panel.Panel) {
407   - Ext.apply(Ext.panel.AbstractPanel.prototype, {
408   - initComponent: Ext.Function.createInterceptor(Ext.panel.AbstractPanel.prototype.initComponent, function() {
409   - if (this.bodyCssClass) {
410   - var me = this,
411   - msg = '',
412   - bodyCssClass = me.bodyCssClass;
413   -
414   - if (Ext.isFunction(bodyCssClass)) {
415   - me.bodyCls = bodyCssClass();
416   - msg = 'Note that passing a function reference as the config value is no longer supported.'
417   - }
418   - else {
419   - me.bodyCls = bodyCssClass;
420   - }
421   - delete me.bodyCssClass;
422   - deprecate({pkg:'Ext.panel.Panel', member:'bodyCssClass', type:'config', alt:'bodyCls', msg:msg});
423   - }
424   - })
425   - });
426   -
427   - Ext.apply(Ext.panel.Panel.prototype, {
428   - getTopToolbar: function(){
429   - notify('Panel now supports an arbitrary number of toolbars, so getTopToolbar() will return the top toolbar at index 0 if multiple are found');
430   - var items = this.getToolbars();
431   - return items.length > 0 ? items[0] : null;
432   - },
433   - getBottomToolbar: function(){
434   - notify('Panel now supports an arbitrary number of toolbars, so getBottomToolbar() will return the bottom toolbar at index 0 if multiple are found');
435   - var items = this.getToolbars();
436   - return items.length > 0 ? items[0] : null;
437   - }
438   - });
439   - }
440   -
441   - /*-------------------------------------------------------------
442   - * Layouts
443   - *-------------------------------------------------------------*/
444   - if (Ext.layout.container.Accordion) {
445   - Ext.apply(Ext.layout.container.Accordion.prototype, {
446   - constructor: Ext.Function.createSequence(Ext.layout.container.Accordion.prototype.constructor, function() {
447   - notify('AccordionLayout now defaults to animating expand/collapse. To revert to the 3.x default behavior set animate:false on the layout.')
448   - })
449   - });
450   - }
451   -
452   - /*-------------------------------------------------------------
453   - * TablePanel
454   - *-------------------------------------------------------------*/
455   - if (Ext.panel.Table) {
456   - Ext.apply(Ext.panel.Table.prototype, {
457   - initComponent: Ext.Function.createInterceptor(Ext.panel.Table.prototype.initComponent, function() {
458   - if (Ext.isDefined(this.preventHeaders)) {
459   - deprecate({pkg:'Ext.grid.Panel', member:'preventHeaders', type:'config', alt:'hideHeaders'});
460   - this.hideHeaders = this.preventHeaders;
461   - delete this.preventHeaders;
462   - }
463   - })
464   - });
465   - }
466   -
467   - /*-------------------------------------------------------------
468   - * Grid components
469   - *-------------------------------------------------------------*/
470   - if (Ext.grid.Panel) {
471   - Ext.apply(Ext.grid.Panel.prototype, {
472   - constructor: Ext.Function.createInterceptor(Ext.grid.Panel.prototype.constructor, function(config) {
473   - if (config.trackMouseOver !== undefined) {
474   - deprecate({pkg:'Ext.GridPanel', member:'trackMouseOver', alt:'trackOver', type:'config',
475   - msg:'Specify this as an attribute of the "viewConfig" config (e.g. viewConfig: {trackOver: false}).'});
476   -
477   - config.viewConfig = config.viewConfig || {};
478   - config.viewConfig.trackOver = config.viewConfig.trackOver || config.trackMouseOver;
479   - delete config.trackMouseOver;
480   - }
481   - if (config.stripeRows !== undefined) {
482   - deprecate({pkg:'Ext.GridPanel', member:'stripeRows', type:'config',
483   - msg:'The stripeRows option should now be passed as an attribute of the "viewConfig" config (e.g. viewConfig: {stripeRows: true}).'});
484   -
485   - config.viewConfig = config.viewConfig || {};
486   - config.viewConfig.stripeRows = config.viewConfig.stripeRows || config.stripeRows;
487   - delete config.stripeRows;
488   - }
489   - if (config.cm || config.colModel) {
490   - deprecate({pkg:'Ext.GridPanel', member:'colModel/cm', type:'config',
491   - msg:'Grids no longer use a ColumnModel class. Just specify the columns array config instead.'});
492   -
493   - // the ColumnModel mock constructor below just returns the columns array
494   - config.columns = config.cm || config.colModel;
495   - delete config.cm;
496   - delete config.colModel;
497   - }
498   - var cols = config.columns || this.columns;
499   - if (cols && Ext.isArray(cols)) {
500   - Ext.each(cols, function(col) {
501   - if (col.id && !col.dataIndex) {
502   - notify('Grid column "' + col.id + '" is defined with an id, but no dataIndex. In Ext 4 the id is used to reference the '+
503   - 'columns as components, and dataIndex is used to map back to the data id. Please add dataIndex to all columns.');
504   - col.dataIndex = col.id;
505   - }
506   - });
507   - }
508   - if (config.store && config.store instanceof Ext.data.GroupingStore) {
509   - notify({pkg:'Ext.GridPanel', msg:'Attempting to convert a GroupingStore store config into a Grouping feature. See the '+
510   - 'GroupingStore constructor warning for additional details.'});
511   -
512   - config.features = config.features || [];
513   - config.features.push(Ext.create('Ext.grid.feature.Grouping'));
514   - }
515   - }),
516   -
517   - initComponent: Ext.Function.createInterceptor(Ext.grid.Panel.prototype.initComponent, function() {
518   - if (this.autoExpandColumn !== undefined) {
519   - deprecate({pkg:'Ext.grid.Panel', member:'autoExpandColumn', alt:'flex (header config)', type:'config',
520   - msg:'You can set "flex: 1" in a specific header config for behavior equivalent to autoExpandColumn.'});
521   -
522   - var id;
523   - Ext.Array.each(this.headers, function(header){
524   - id = header.id || header.dataIndex;
525   - if(id === this.autoExpandColumn){
526   - header.flex = 1;
527   - return false;
528   - }
529   - }, this);
530   - }
531   - })
532   - });
533   -
534   - Ext.apply(Ext.grid.GridPanel.prototype, {
535   - getColumnModel: function(){
536   - if (!this.colModel && !this.cm) {
537   - this.cm = this.colModel = new Ext.grid.ColumnModel({
538   - columns: this.columns
539   - });
540   - }
541   - return this.cm;
542   - }
543   - });
544   -
545   - Ext.grid.EditorGridPanel = function(config) {
546   - deprecate({pkg:'Ext.grid.EditorGridPanel', msg:'EditorGridPanel no longer exists as a separate class. Instead just '+
547   - 'create a standard GridPanel and include the CellEditing plugin, e.g. "plugins: Ext.create("Ext.grid.plugin.CellEditing", {...})'});
548   -
549   - return Ext.createWidget('grid', Ext.apply(config || {}, {
550   - plugins: Ext.create('Ext.grid.plugin.CellEditing', {
551   - clicksToEdit: 1
552   - })
553   - }));
554   - }
555   - }
556   -
557   - if (Ext.grid.View) {
558   - Ext.apply(Ext.grid.View.prototype, {
559   - constructor: Ext.Function.createInterceptor(Ext.grid.View.prototype.constructor, function(config) {
560   - if(Ext.isFunction(config.getRowClass)){
561   - var getRowClass = config.getRowClass;
562   - this.__getRowClass = Ext.bind(getRowClass, this);
563   - delete config.getRowClass;
564   -
565   - this.getRowClass = function(rec, rowIndex, rowParams, store){
566   - var result = this.__getRowClass(rec, rowIndex, rowParams, store);
567   - if (rowParams.body) {
568   - delete rowParams.body;
569   - breaking({pkg:'Ext.grid.View', member:'getRowClass.rowParams.body', single:true,
570   - msg:'To implement a custom row body you must add the RowBody feature (ftype:"rowbody") '+
571   - 'to the grid\'s viewConfig and override the "getAdditionalData" template method '+
572   - '(or use the Ext.grid.RowBodyPlugin helper class). Unfortunately this cannot be '+
573   - 'inferred at design time so it must be fixed manually.'});
574   - }
575   - if (rowParams.bodyStyle) {
576   - delete rowParams.bodyStyle;
577   - deprecate({pkg:'Ext.grid.View', member:'getRowClass.rowParams.bodyStyle', single:true,
578   - msg:'To implement a custom row styles you must add the RowBody feature (ftype:"rowbody") '+
579   - 'to the grid\'s viewConfig and override the "getAdditionalData" template method '+
580   - '(or use the Ext.grid.RowBodyPlugin helper class). Note that in 3.x this property '+
581   - 'was a CSS style spec, whereas now you specify "rowBodyCls" as a CSS classname instead. Ignoring for now.'});
582   - }
583   - if (rowParams.tstyle) {
584   - delete rowParams.tstyle;
585   - deprecate({pkg:'Ext.grid.View', member:'getRowClass.rowParams.tstyle', single:true,
586   - msg:'Grid row bodies no longer use a wrapping TABLE element, so the "tstyle" property '+
587   - 'no longer directly applies. If you have CSS styles that still need to be applied, you '+
588   - 'should add the RowBody feature (ftype:"rowbody") to the grid\'s viewConfig and override '+
589   - 'the "getAdditionalData" template method (or use the Ext.grid.RowBodyPlugin helper class). '+
590   - 'Note that in 3.x this property was a CSS style spec, whereas now you would use the "rowBodyCls" '+
591   - 'CSS classname instead (and adjust for the fact that there is no TABLE if needed). Ignoring for now.'});
592   - }
593   - return result;
594   - };
595   - }
596   - })
597   - });
598   -
599   - Ext.grid.GroupingView = function(config) {
600   - breaking({pkg:'Ext.grid.GroupingView', msg:'GroupingView no longer exists as a separate class, and grid views should '+
601   - 'not need to be instantiated directly. Instead just create a standard GridPanel and include the Grouping feature, '+
602   - 'e.g. "features: Ext.create("Ext.grid.feature.Grouping", {...}). Unfortunately there is no way to alias a call to this '+
603   - 'constructor properly, so you\'ll need to adjust your GridPanel constructor as noted to resolve this.'});
604   - }
605   - }
606   -
607   - if (Ext.grid.header.Container) {
608   - Ext.apply(Ext.grid.header.Container.prototype, {
609   - constructor: Ext.Function.createSequence(Ext.grid.header.Container.prototype.constructor, function() {
610   - this.__prepareData = this.prepareData;
611   - this.prepareData = function() {
612   - var obj = this.__prepareData.apply(this, arguments);
613   - if (obj.cssWarning) {
614   - delete obj.cssWarning;
615   - deprecate({pkg:'Ext.grid.Panel', single:true, msg:'Your grid column renderer is including the legacy "css" attribute '+
616   - 'in the returned metaData object. This has been renamed to "tdCls" so you should change the attribute name in your renderer.'});
617   - }
618   - return obj;
619   - }
620   - })
621   - });
622   - }
623   -
624   - if (Ext.grid.Header) {
625   - Ext.apply(Ext.grid.Header.prototype, {
626   - initComponent: Ext.Function.createInterceptor(Ext.grid.Header.prototype.initComponent, function() {
627   - if (Ext.isDefined(this.header)) {
628   - deprecate({pkg:'Ext.grid.Panel', member:'header', alt:'text', type:'config', single: true,
629   - msg:'In 3.x the grid had a "columns" array containing "header" configs for the title of each column. '+
630   - 'In 4.0 the grid has a "headers" array and you should specify the "text" config for each header.'});
631   -
632   - this.text = this.header;
633   - delete this.header;
634   - }
635   - })
636   - });
637   - }
638   -
639   - Ext.grid.ColumnModel = function(config) {
640   - return Ext.applyIf(config.columns ? config.columns : config, {
641   - on: Ext.emptyFn,
642   - addListener: Ext.emptyFn,
643   - getColumnId: Ext.emptyFn,
644   - getColumnAt: Ext.emptyFn,
645   - setConfig: Ext.emptyFn,
646   - getColumnById: Ext.emptyFn,
647   - getIndexById: Ext.emptyFn,
648   - moveColumn: Ext.emptyFn,
649   - getColumnCount: Ext.emptyFn,
650   - getColumnsBy: Ext.emptyFn,
651   - isSortable: Ext.emptyFn,
652   - isMenuDisabled: Ext.emptyFn,
653   - getRenderer: Ext.emptyFn,
654   - getRendererScope: Ext.emptyFn,
655   - setRenderer: Ext.emptyFn,
656   - getColumnWidth: Ext.emptyFn,
657   - setColumnWidth: Ext.emptyFn,
658   - getTotalWidth: Ext.emptyFn,
659   - getColumnHeader: Ext.emptyFn,
660   - setColumnHeader: Ext.emptyFn,
661   - getColumnTooltip: Ext.emptyFn,
662   - setColumnTooltip: Ext.emptyFn,
663   - getDataIndex: Ext.emptyFn,
664   - setDataIndex: Ext.emptyFn,
665   - findColumnIndex: Ext.emptyFn,
666   - isCellEditable: Ext.emptyFn,
667   - getCellEditor: Ext.emptyFn,
668   - setEditable: Ext.emptyFn,
669   - isHidden: Ext.emptyFn,
670   - isFixed: Ext.emptyFn,
671   - isResizable: Ext.emptyFn,
672   - setHidden: Ext.emptyFn,
673   - setEditor: Ext.emptyFn,
674   - destroy: Ext.emptyFn,
675   - setState: Ext.emptyFn
676   - });
677   - };
678   -
679   - if (Ext.grid.Column) {
680   - Ext.Compat.bindProperty({owner:Ext.grid.Column, name:'types', defaultValue:{},
681   - getterMsg: function(){
682   - deprecate({pkg:'Ext.grid.Column', member:'types', type:'property', alt:'alias (config)',
683   - msg:'The new approach to creating a custom column type is to specify the alias config '+
684   - 'within your column\'s class definition (e.g., alias: ["widget.mycolumn"]). You could also '+
685   - 'call the setAlias method after the class is defined.'});
686   - }
687   - });
688   - }
689   -
690   - // temp aliases -- these will be added into Ext 4
691   - Ext.apply(Ext.grid.Panel.prototype, {
692   - getStore: function() {
693   - return this.store;
694   - }
695   - });
696   -
697   - if (Ext.selection.Model) {
698   - Ext.apply(Ext.selection.Model.prototype, {
699   - selectRow: function(index){
700   - deprecate({pkg:'Ext.grid.RowSelectionModel', member:'selectRow', alt:'Ext.selection.RowModel.selectRange',
701   - msg:'Note that selectRange requires both start and end rows as its first two arguments (defaulting both to '+index+').'});
702   -
703   - return this.selectRange(index, index);
704   - },
705   - getSelections: function(){
706   - deprecate({pkg:'Ext.grid.RowSelectionModel', member:'getSelections', alt:'Ext.selection.RowModel.getSelection'});
707   - return this.getSelection();
708   - }
709   - });
710   - }
711   -
712   - /*-------------------------------------------------------------
713   - * Tree (removed classes)
714   - *-------------------------------------------------------------*/
715   - Ext.tree.TreeNode = function(config){
716   - deprecate({pkg:'Ext.tree.TreeNode', msg:'This class is no longer needed. The Tree now uses standard Records that get decorated '+
717   - 'by the NodeInterface class in Ext 4.'});
718   - Ext.apply(this, config);
719   - };
720   - Ext.tree.AsyncTreeNode = function(config){
721   - deprecate({pkg:'Ext.tree.AsyncTreeNode', msg:'This class is no longer needed. Specify a TreeStore with an AjaxProxy instead.'});
722   - Ext.apply(this, config);
723   - };
724   - Ext.tree.AsyncTreeNode.prototype = {
725   - expand: function(){
726   - if (this.store) {
727   - this.store.load({
728   - url: this.url || this.dataUrl
729   - });
730   - }
731   - }
732   - };
733   -
734   - Ext.tree.TreeSorter = function(tree, config){
735   - deprecate({pkg:'Ext.tree.TreeSorter', msg:'This class is no longer needed. Specify a TreeStore with standard "sorter" config options instead.'});
736   - Ext.apply(this, config);
737   - };
738   -
739   - Ext.tree.TreeLoader = function(config){
740   - deprecate({pkg:'Ext.tree.TreeLoader', msg:'This class is no longer needed. Specify a TreeStore with standard store options to load the tree.'});
741   - Ext.apply(this, config);
742   - };
743   -
744   - /*-------------------------------------------------------------
745   - * TreePanel
746   - *-------------------------------------------------------------*/
747   - if (Ext.tree.Panel) {
748   - Ext.apply(Ext.tree.Panel.prototype, {
749   - constructor: Ext.Function.createInterceptor(Ext.tree.Panel.prototype.constructor, function(config) {
750   - if (config.hlDrop) {
751   - delete config.hlDrop;
752   - deprecate({pkg:'Ext.tree.TreePanel', member:'hlDrop', type:'config',
753   - msg:'Highlighting tree nodes on drop is no longer supported. You can simply remove this config.'});
754   - }
755   - if (config.hlColor) {
756   - delete config.hlDrop;
757   - deprecate({pkg:'Ext.tree.TreePanel', member:'hlColor', type:'config',
758   - msg:'Highlighting tree nodes on drop is no longer supported. You can simply remove this config.'});
759   - }
760   -
761   - var ddConfig = config.ddConfig || {};
762   - if (Ext.isDefined(config.enableDrag)) {
763   - deprecate({pkg:'Ext.tree.TreePanel', member:'enableDrag', type:'config', alt:'ddConfig.enableDrag'});
764   - ddConfig.enableDrag = config.enableDrag;
765   - delete config.enableDrag;
766   - }
767   - if (Ext.isDefined(config.enableDrop)) {
768   - deprecate({pkg:'Ext.tree.TreePanel', member:'enableDrop', type:'config', alt:'ddConfig.enableDrop'});
769   - ddConfig.enableDrop = config.enableDrop;
770   - delete config.enableDrop;
771   - }
772   - if (Ext.isDefined(config.enableDD)) {
773   - var msg = config.enableDD ? 'Note that ddConfig defaults to enabling both drag and drop by default in Ext 4. Since you are '+
774   - 'currently passing "enableDD: true", in this case the config can simply be ommitted entirely.' : '';
775   -
776   - ddConfig = {
777   - enableDrag: config.enableDD,
778   - enableDrop: config.enableDD
779   - };
780   - delete config.enableDD;
781   - deprecate({pkg:'Ext.tree.TreePanel', member:'enableDD', type:'config', alt:'ddConfig', msg:msg});
782   - }
783   - config.ddConfig = ddConfig;
784   -
785   - var url = config.dataUrl || this.dataUrl;
786   - if (url) {
787   - deprecate({pkg:'Ext.tree.TreePanel', member:'dataUrl', type:'config', alt:'TreeStore',
788   - msg:'The TreePanel no longer supports loading data directly. Creating an implicit TreeStore using the url: '+url});
789   -
790   - this.loader = { dataUrl: url };
791   - delete config.dataUrl;
792   - delete this.dataUrl;
793   - }
794   - else if (config.loader) {
795   - this.loader = config.loader;
796   - delete config.loader;
797   - deprecate({pkg:'Ext.tree.TreePanel', member:'loader', type:'config', alt:'TreeStore',
798   - msg:'The TreeLoader class and TreePanel.loader config have been removed. Trees now use the TreeStore '+
799   - 'which provides all standard Ext.data.Store loading capabilities.'});
800   - }
801   -
802   - if (config.root && (config.root instanceof Ext.tree.AsyncTreeNode || config.root.nodeType == 'async')) {
803   - config.loader = this.loader;
804   - }
805   - this.applyCompatOptions();
806   - }),
807   -
808   - initComponent: Ext.Function.createSequence(Ext.tree.Panel.prototype.initComponent, function() {
809   - this.on('itemclick', function(view, model, el, idx, e){
810   - if (this.events['click']) {
811   - model.attributes = model.attributes || model.data;
812   - this.fireEvent('click', model, e);
813   - deprecate({pkg:'Ext.tree.TreePanel', member:'click', type:'event', alt:'itemclick',
814   - msg:'Note that the argument order has changed, and that the data argument was a node in 3.x and is now '+
815   - 'the selected model. Instead of node.attributes you can access the data via model.data.'})
816   - }
817   - });
818   - }),
819   -
820   - applyCompatOptions: function(){
821   - var loader = this.loader;
822   - if (loader && (loader.url || loader.dataUrl || loader.proxy)) {
823   - var urlProp = loader.url ? 'url' : 'dataUrl',
824   - proxy = loader.proxy || {
825   - type: 'ajax',
826   - url: loader[urlProp]
827   - },
828   - storeConfig = {
829   - proxy: proxy
830   - }
831   -
832   - if (this.root) {
833   - storeConfig.root = this.root;
834   - delete this.root;
835   - }
836   - this.store = new Ext.data.TreeStore(storeConfig);
837   - this.loader.store = this.store;
838   -
839   - notify({pkg:'Ext.tree.Panel', msg:'Using the TreeLoader.' + urlProp +
840   - ' config to generate a default TreeStore + Proxy with the url: '+loader[urlProp]});
841   - }
842   - },
843   -
844   - // Aliased in TreePanel
845   -// setRootNode: function(root){
846   -// deprecate({pkg:'Ext.tree.Panel', member:'setRootNode', alt:'TreeStore.setRootNode',
847   -// msg:'Alternately you could add a "root" option to your TreeStore config.'});
848   -//
849   -// if (this.store) {
850   -// this.store.setRootNode(root);
851   -// }
852   -// else {
853   -// this.root = root;
854   -// this.applyCompatOptions();
855   -// }
856   -// },
857   -
858   - // Aliased in TreePanel
859   -// getRootNode : function(){
860   -// deprecate({pkg:'Ext.tree.Panel', member:'getRootNode', alt:'TreeStore.getRootNode'});
861   -// return this.store.getRootNode.apply(this.store, arguments);
862   -// },
863   -
864   - getNodeById : function(){
865   - deprecate({pkg:'Ext.tree.Panel', member:'getNodeById', alt:'TreeStore.getNodeById',
866   - msg:'If you have a TreePanel reference you can call treePanel.getStore().getNodeById("id").'});
867   -
868   - return this.store.getNodeById.apply(this.store, arguments);
869   - },
870   -
871   - getChecked : function(){
872   - deprecate({pkg:'Ext.tree.Panel', member:'getChecked', alt:'Ext.tree.View.getChecked',
873   - msg:'Note that in 3.x this method returned objects of type TreeNode. In 4.0 it returns standard Records, '+
874   - 'so the code that processes the checked items will have to be adjusted accordingly. For compatibility '+
875   - 'the record\'s data objects are being returned, as each record\'s data is now decorated with the node '+
876   - 'interface so they should match the 3.x API. However your 4.0 code should expect full Record objects '+
877   - 'instead and will access the node attributes via Record.get(\'attrName\') or Record.data.attrName.'});
878   -
879   - var recs = this.getView().getChecked(),
880   - nodes = [];
881   -
882   - Ext.each(recs, function(rec){
883   - nodes.push(rec.data);
884   - });
885   -
886   - return nodes;
887   - }
888   - });
889   - }
890   -
891   - if (Ext.data.TreeStore) {
892   - Ext.override(Ext.data.TreeStore, {
893   - fillNode: function(node, records) {
894   - var me = this,
895   - ln = records ? records.length : 0,
896   - i = 0, sortCollection;
897   -
898   -// if (ln && me.sortOnLoad && !me.remoteSort && me.sorters && me.sorters.items) {
899   -// sortCollection = Ext.create('Ext.util.MixedCollection');
900   -// sortCollection.addAll(records);
901   -// sortCollection.sort(me.sorters.items);
902   -// records = sortCollection.items;
903   -// }
904   -
905   - node.set('loaded', true);
906   - for (; i < ln; i++) {
907   - node.appendChild(records[i], undefined, true);
908   - }
909   -
910   - return records;
911   - }
912   - });
913   - }
914   -
915   - /*-------------------------------------------------------------
916   - * SelectionModel
917   - *-------------------------------------------------------------*/
918   - if (Ext.selection.RowModel) {
919   - Ext.apply(Ext.selection.RowModel.prototype, {
920   - constructor: Ext.Function.createSequence(Ext.selection.RowModel.prototype.constructor, function() {
921   - this.on('select', function(sm, rec, idx){
922   - if (this.events['rowselect']) {
923   - this.fireEvent('rowselect', sm, idx, rec);
924   - deprecate({pkg:'Ext.grid.RowSelectionModel', member:'rowselect', type:'event', alt:'select',
925   - msg:'Note that the argument order has changed (the index and record/model args have been switched).'})
926   - }
927   - });
928   - this.on('deselect', function(sm, rec, idx){
929   - if (this.events['rowdeselect']) {
930   - this.fireEvent('rowdeselect', sm, idx, rec);
931   - deprecate({pkg:'Ext.grid.RowSelectionModel', member:'rowdeselect', type:'event', alt:'deselect',
932   - msg:'Note that the argument order has changed (the index and record/model args have been switched).'})
933   - }
934   - });
935   - })
936   - });
937   - }
938   -
939   - /*-------------------------------------------------------------
940   - * Window
941   - *-------------------------------------------------------------*/
942   - if (Ext.window.Window) {
943   - Ext.apply(Ext.window.Window.prototype, {
944   - constructor: Ext.Function.createInterceptor(Ext.window.Window.prototype.constructor, function(config) {
945   - if (config.closeAction === 'close') {
946   - deprecate({pkg:'Ext.Window', member:'closeAction', type:'config',
947   - msg:'The default value of "close" is no longer valid. Use "destroy" instead.'});
948   -
949   - delete config.closeAction;
950   - this.closeAction = 'destroy';
951   - }
952   - })
953   - });
954   - }
955   -
956   - /*-------------------------------------------------------------
957   - * Forms
958   - *-------------------------------------------------------------*/
959   - if (Ext.form.Basic) {
960   - Ext.apply(Ext.form.Basic.prototype, {
961   - add: function() {
962   - deprecate({pkg:'Ext.form.Basic', member:'add'});
963   - return this;
964   - },
965   -
966   - remove: function(field) {
967   - deprecate({pkg:'Ext.form.Basic', member:'remove'});
968   - return this;
969   - },
970   -
971   - cleanDestroyed: function() {
972   - deprecate({pkg:'Ext.form.Basic', member:'cleanDestroyed'});
973   - },
974   -
975   - render: function() {
976   - deprecate({pkg:'Ext.form.Basic', member:'render'});
977   - return this;
978   - },
979   -
980   - getFieldValues: function(dirtyOnly) {
981   - deprecate({pkg:'Ext.form.Basic', member:'getFieldValues', alt:'getValues'});
982   - return this.getValues(false, dirtyOnly);
983   - },
984   -
985   - callFieldMethod: function(fnName, args) {
986   - deprecate({pkg:'Ext.form.Basic', member:'callFieldMethod'});
987   -
988   - args = args || [];
989   - this.getFields().each(function(f) {
990   - if (Ext.isFunction(f[fnName])) {
991   - f[fnName].apply(f, args);
992   - }
993   - });
994   - return this;
995   - }
996   - });
997   - }
998   -
999   - if (Ext.form.Panel) {
1000   - Ext.apply(Ext.form.Panel.prototype, {
1001   - monitorValid: false,
1002   - monitorPoll: 200,
1003   -
1004   - initComponent: Ext.Function.createInterceptor(Ext.form.Panel.prototype.initComponent, function() {
1005   - var me = this,
1006   - fieldDefaultsProps = {
1007   - hideLabels: 'hideLabel',
1008   - labelAlign: 'labelAlign',
1009   - labelPad: 'labelPad',
1010   - labelSeparator: 'labelSeparator',
1011   - labelWidth: 'labelWidth'
1012   - },
1013   - fieldDefaults = me.fieldDefaults || (me.fieldDefaults = {});
1014   -
1015   - Ext.iterate(fieldDefaultsProps, function(from, to) {
1016   - if (from in me) {
1017   - deprecate({pkg:'Ext.form.Panel', member:from, type:'config',
1018   - msg:'Use the fieldDefaults config object with a "' + to + '" property instead.'});
1019   -
1020   - fieldDefaults[to] = me[from];
1021   - }
1022   - });
1023   -
1024   - if (me.hasOwnProperty('monitorValid')) {
1025   - deprecate({pkg:'Ext.form.Panel', member:'monitorValid', alt:'pollForChanges'});
1026   - }
1027   - if (me.hasOwnProperty('monitorPoll')) {
1028   - deprecate({pkg:'Ext.form.Panel', member:'monitorPoll', alt:'pollInterval'});
1029   - }
1030   - }),
1031   -
1032   - startMonitoring: function() {
1033   - deprecate({pkg:'Ext.form.Panel', member:'startMonitoring', alt:'startPolling'});
1034   - this.startPolling(this.monitorPoll);
1035   - },
1036   -
1037   - stopMonitoring: function() {
1038   - deprecate({pkg:'Ext.form.Panel', member:'stopMonitoring', alt:'stopPolling'});
1039   - this.stopPolling();
1040   - }
1041   - });
1042   - }
1043   -
1044   - if (Ext.form.field.Base) {
1045   - Ext.apply(Ext.form.field.Base.prototype, {
1046   - initComponent: Ext.Function.createInterceptor(Ext.form.field.Base.prototype.initComponent, function() {
1047   - // Many legacy examples modify the default msgTarget on the Ext.form.Field class's prototype; this doesn't
1048   - // work anymore since Field is a mixin. Copy to Ext.form.field.Base and inform about change and the new
1049   - // recommended FormPanel.fieldDefaults. Only do this once rather than for every field.
1050   - var msgTarget = Ext.form.Field.prototype.msgTarget;
1051   - if (msgTarget && msgTarget !== 'qtip') {
1052   - deprecate({pkg:'Ext.form.Field', member:'msgTarget', type:'config', single: true,
1053   - msg:'Found an overridden value for Ext.form.Field.prototype.msgTarget -- Ext.form.Field is ' +
1054   - 'now Ext.form.field.Base; either override msgTarget on Ext.form.field.Base\'s prototype ' +
1055   - 'or use the new recommended Ext.form.Panel#fieldDefaults object instead.'});
1056   -
1057   - Ext.form.field.Base.prototype.msgTarget = Ext.form.Field.prototype.msgTarget;
1058   - }
1059   - })
1060   - });
1061   - }
1062   -
1063   - if (Ext.form.field.Checkbox) {
1064   - Ext.apply(Ext.form.field.Checkbox.prototype, {
1065   - initComponent: Ext.Function.createInterceptor(Ext.form.field.Checkbox.prototype.initComponent, function() {
1066   - this.addEvents(
1067   - /**
1068   - * @event check
1069   - * Fires when the checkbox is checked or unchecked.
1070   - * @deprecated Use the 'change' event instead.
1071   - * @param {Ext.form.field.Checkbox} this This checkbox
1072   - * @param {Boolean} checked The new checked value
1073   - */
1074   - 'check'
1075   - );
1076   - // TODO is there a clean way to throw a deprecation warning when the user listens for the check event?
1077   - }),
1078   -
1079   - onChange: Ext.Function.createInterceptor(Ext.form.field.Checkbox.prototype.onChange, function(newVal, oldVal) {
1080   - this.fireEvent('check', this, this.checked);
1081   - })
1082   - });
1083   - }
1084   -
1085   - if (Ext.form.CheckboxGroup) {
1086   - var cbgSetValue = Ext.form.CheckboxGroup.prototype.setValue;
1087   -
1088   - Ext.apply(Ext.form.CheckboxGroup.prototype, {
1089   -
1090   - initComponent: Ext.Function.createInterceptor(Ext.form.CheckboxGroup.prototype.initComponent, function() {
1091   - var me = this,
1092   - items = me.items;
1093   -
1094   - // Handle the old structure where the 'items' could be a set of column configs
1095   - if (items && items[0] && 'columnWidth' in items[0] && me.layout !== 'column') {
1096   - deprecate({pkg:'Ext.form.CheckboxGroup', type:'config',
1097   - msg:'CheckboxGroup and RadioGroup no longer accept implicit column containers in the "items" ' +
1098   - 'config. If you wish to use a custom column arrangement, set layout:"column" and create ' +
1099   - 'a standard items structure with container xtypes.'});
1100   - me.layout = 'column';
1101   - Ext.Array.forEach(items, function(column) {
1102   - column.xtype = 'container';
1103   - column.defaultType = me.defaultType;
1104   - });
1105   - }
1106   - }),
1107   -
1108   - setValue: function(id, value) {
1109   - var me = this,
1110   - f;
1111   - if (arguments.length === 1) {
1112   - value = id;
1113   - if (Ext.isObject(value)) {
1114   - cbgSetValue.call(me, value);
1115   - }
1116   - if (Ext.isString(value)) {
1117   - deprecate({pkg:'Ext.form.CheckboxGroup', member:'setValue',
1118   - msg:'The setValue method no longer accepts a String argument. Use the new Object form instead.'});
1119   -
1120   - me.setValueForItem(value);
1121   - }
1122   - else if (Ext.isArray(value)) {
1123   - deprecate({pkg:'Ext.form.CheckboxGroup', member:'setValue',
1124   - msg:'The setValue method no longer accepts an Array argument. Use the new Object form instead.'});
1125   -
1126   - me.batchChanges(function() {
1127   - Ext.each(value, function(val, idx){
1128   - if (Ext.isObject(val) && val.setValue) { // array of checkbox components to be checked
1129   - val.setValue(true);
1130   - }
1131   - else if (Ext.isString(val)) {
1132   - f = me.getBox(val);
1133   - if (f) {
1134   - f.setValue(true);
1135   - }
1136   - }
1137   - else { // an array of boolean values
1138   - var item = me.getBoxes()[idx];
1139   - if (item) {
1140   - item.setValue(val);
1141   - }
1142   - }
1143   - });
1144   - });
1145   - }
1146   - }
1147   - else {
1148   - deprecate({pkg:'Ext.form.CheckboxGroup', member:'setValue',
1149   - msg:'The setValue method no longer accepts a two-argument form. Use the new single Object form instead.'});
1150   -
1151   - f = me.getBox(id);
1152   - if (f) {
1153   - f.setValue(value);
1154   - }
1155   - }
1156   -
1157   - return me;
1158   - },
1159   -
1160   - // private
1161   - setValueForItem : function(val){
1162   - deprecate({pkg:'Ext.form.CheckboxGroup', member:'setValueForItem'});
1163   - var me = this;
1164   - val = String(val).split(',');
1165   - me.batchChanges(function() {
1166   - me.eachBox(function(item) {
1167   - if (val.indexOf(item.inputValue) > -1) {
1168   - item.setValue(true);
1169   - }
1170   - });
1171   - });
1172   - },
1173   -
1174   - // private
1175   - getBox : function(id){
1176   - deprecate({pkg:'Ext.form.CheckboxGroup', member:'getBox'});
1177   - var box = null;
1178   - this.eachBox(function(f) {
1179   - if (id == f || f.dataIndex == id || f.id == id || f.getName() == id) {
1180   - box = f;
1181   - return false;
1182   - }
1183   - });
1184   - return box;
1185   - }
1186   - });
1187   - }
1188   -
1189   -
1190   - /*-------------------------------------------------------------
1191   - * CompositeField
1192   - *-------------------------------------------------------------*/
1193   - if (Ext.form.FieldContainer) {
1194   - Ext.define('Ext.form.CompositeField', {
1195   - extend: 'Ext.form.FieldContainer',
1196   - alias: 'widget.compositefield',
1197   - uses: ['Ext.layout.container.HBox'],
1198   -
1199   - isComposite: true,
1200   - combineErrors: true,
1201   -
1202   - layout: {
1203   - type: 'hbox',
1204   - defaultMargins: {top: 0, right: 5, bottom: 0, left: 0}
1205   - },
1206   - baseDefaults: {
1207   - hideLabel: true
1208   - },
1209   -
1210   - initComponent: function() {
1211   - deprecate({member:'Ext.form.CompositeField', alt:'Ext.form.FieldContainer',
1212   - msg:'What used to be CompositeField has been replaced by the more flexible FieldContainer. '+
1213   - 'We will reintroduce a true Composite field in a future release.'});
1214   -
1215   - this.defaults = Ext.apply({}, this.defaults, this.baseDefaults);
1216   -
1217   - this.callParent(arguments);
1218   - }
1219   - });
1220   - }
1221   -
1222   -
1223   - /*-------------------------------------------------------------
1224   - * ComboBox
1225   - *-------------------------------------------------------------*/
1226   - if (Ext.form.field.ComboBox) {
1227   - Ext.apply(Ext.form.field.ComboBox.prototype, {
1228   - initComponent: Ext.Function.createInterceptor(Ext.form.field.ComboBox.prototype.initComponent, function() {
1229   - var me = this,
1230   - isDef = Ext.isDefined;
1231   -
1232   - // shortcut for configs that just changed names:
1233   - var remap = function(cfg, alt){
1234   - if(isDef(me[cfg])){
1235   - deprecate({pkg:'Ext.form.field.ComboBox', member:cfg, type:'config', alt:alt});
1236   - me[alt] = me[cfg];
1237   - delete me[cfg];
1238   - }
1239   - };
1240   - remap('listAlign', 'pickerAlign');
1241   - remap('mode', 'queryMode');
1242   - remap('triggerClass', 'triggerCls');
1243   -
1244   - // shortcut for configs that were moved into the listConfig object:
1245   - var listConfig = me.listConfig || (me.listConfig = {}),
1246   - remapToListConfig = function(cfg, alt) {
1247   - if(isDef(me[cfg])){
1248   - // the defaultListConfig has been applied at this point, so check that this
1249   - // option was not simply the default value applied by the superclass
1250   - if(!isDef(me.defaultListConfig[cfg]) || me.defaultListConfig[cfg] !== me[cfg]) {
1251   - deprecate({pkg:'Ext.form.field.ComboBox', member:cfg, type:'config', alt:'listConfig.' + alt});
1252   - listConfig[alt] = me[cfg];
1253   - delete me[cfg];
1254   - }
1255   - }
1256   - };
1257   - remapToListConfig('itemSelector', 'itemSelector');
1258   - remapToListConfig('listClass', 'cls');
1259   - remapToListConfig('listWidth', 'width');
1260   - remapToListConfig('loadingText', 'loadingText');
1261   - remapToListConfig('minHeight', 'minHeight');
1262   - remapToListConfig('minListWidth', 'minWidth');
1263   - remapToListConfig('maxHeight', 'maxHeight');
1264   - remapToListConfig('resizable', 'resizable');
1265   - remapToListConfig('selectedClass', 'selectedItemCls');
1266   - remapToListConfig('shadow', 'shadow');
1267   -
1268   - // shortcut for configs that were completely removed with no replacement:
1269   - var remove = function(cfg){
1270   - if(isDef(me[cfg])){
1271   - notify({pkg:'Ext.form.field.ComboBox', member:cfg,
1272   - msg:'This config is no longer needed and has no replacement -- just remove it from your code.'});
1273   - delete me[cfg];
1274   - }
1275   - };
1276   - remove('autoCreate');
1277   - remove('clearFilterOnReset');
1278   - remove('handleHeight');
1279   - remove('hiddenId');
1280   - remove('hiddenName');
1281   - remove('lazyInit');
1282   - remove('lazyRender');
1283   - remove('title');
1284   -
1285   - // non-standard mappings:
1286   - if(isDef(me.tpl)){
1287   - deprecate({pkg:'Ext.form.field.ComboBox', member:'tpl', type:'config', alt:'getInnerTpl (method)',
1288   - msg:'There is no config for providing the combo\'s item template now. Instead, you should override '+
1289   - 'the "getInnerTpl" method to provide whatever logic is required and return the template string.'});
1290   -
1291   - // make sure we are returning a template string and not an XTemplate instance:
1292   - var tpl = me.tpl.html ? me.tpl.html : me.tpl;
1293   -
1294   - me.getInnerTpl = function(){
1295   - return tpl;
1296   - };
1297   - delete me.tpl;
1298   - }
1299   - })
1300   - });
1301   - }
1302   -
1303   - /*-------------------------------------------------------------
1304   - * Slider
1305   - *-------------------------------------------------------------*/
1306   - if (Ext.slider.Multi) {
1307   - Ext.apply(Ext.slider.Multi.prototype, {
1308   - initComponent: Ext.Function.createInterceptor(Ext.slider.Multi.prototype.initComponent, function() {
1309   - if (this.plugins) {
1310   - Ext.each(this.plugins, function(p){
1311   - if (p.getText) {
1312   - deprecate({pkg:'Ext.Slider', msg:'In 3.x the Ext.slider.Tip plugin was required to provide custom slider tip text. '+
1313   - 'In 4.0 you should instead supply the tipText config directly.'});
1314   -
1315   - this.tipText = p.getText;
1316   - Ext.Array.remove(this.plugins, p);
1317   - return;
1318   - }
1319   - }, this);
1320   - }
1321   - })
1322   - });
1323   - }
1324   -
1325   - /*-------------------------------------------------------------
1326   - * Store
1327   - *-------------------------------------------------------------*/
1328   - if (Ext.data.Store) {
1329   - Ext.apply(Ext.data.AbstractStore.prototype, {
1330   - constructor: Ext.Function.createInterceptor(Ext.data.AbstractStore.prototype.constructor, function(config) {
1331   - if (this.$className == 'Ext.data.NodeStore') {
1332   - return;
1333   - }
1334   - if (config.url) {
1335   - deprecate({pkg:'Ext.data.Store', member:'url', type:'config', alt:'proxy.url',
1336   - msg:'The store\'s "url" config should now be passed as a config to a valid remote-style proxy.'});
1337   -
1338   - if (!config.proxy) {
1339   - deprecate({pkg:'Ext.data.Store', msg:'A store url was specified with no proxy config. Implcitily creating an AjaxProxy with that url. '+
1340   - 'Please see the header docs for Ext.data.Store for details on properly setting up your data components.'});
1341   -
1342   - config.proxy = {
1343   - type: 'ajax',
1344   - url: config.url
1345   - };
1346   - delete config.url;
1347   -
1348   - if (config.reader) {
1349   - config.proxy.reader = config.reader;
1350   - delete config.reader;
1351   - deprecate({pkg:'Ext.data.Store', member:'reader', type:'config', msg:'As part of creating an implicit AjaxProxy for compatibility, '+
1352   - 'the store\'s existing reader config has also been moved to the proxy. Note that the reader config should no longer be passed '+
1353   - 'directly as a store config, but should be specified on the proxy instead.'});
1354   - }
1355   - }
1356   - }
1357   - else if (!this.model && !config.model){
1358   - // there is no model set, so we need to try the various possible configurations supported by 3.x
1359   - // and hopefully find something we can convert into an implicit model
1360   - var fields;
1361   - if (config.fields) {
1362   - // shorthand store classes like ArrayStore and XmlStore support fields directly on the store config
1363   - fields = config.fields;
1364   - delete config.fields;
1365   - // this is required to be done, but skip the warning. In some cases TreeStore internally adds this. The bigger picture
1366   - // issue of configuring the store correctly will already be covered by other warnings.
1367   -// deprecate({pkg:'Ext.data.Store', msg:'Passing a "fields" config directly on the store\'s config is no longer supported. '+
1368   -// 'Instead you should configure a model and pass it as the store\'s "model" config. ' +
1369   -// 'Please see the header docs for Ext.data.Store for details on properly setting up your data components.'});
1370   - }
1371   - else if (config.reader) {
1372   - if (config.reader.model) {
1373   - // the compat warning for this case is displayed below in the Ext.data.Reader override where
1374   - // reader.model is set. This code is just here to make it work properly.
1375   - config.model = config.reader.model;
1376   - delete this.fields;
1377   - this.implicitModel = true;
1378   - return true;
1379   - }
1380   - else if (config.reader.fields) {
1381   - // standard stores typically get fields from the reader config
1382   - fields = config.reader.fields;
1383   - delete config.reader.fields;
1384   - deprecate({pkg:'Ext.data.Store', msg:'Passing a "fields" config via the store\'s reader config is no longer supported. '+
1385   - 'Instead you should configure a model and pass it as the store\'s "model" config. ' +
1386   - 'Please see the header docs for Ext.data.Store for details on properly setting up your data components.'});
1387   - }
1388   - else {
1389   - breaking({pkg:'Ext.data.Store', msg:'No valid model or field configuration could be found '+
1390   - 'so this store could not be constructed. Please see the header docs for Ext.data.Store for '+
1391   - 'details on properly setting up your data components.'});
1392   -
1393   - return false;
1394   - }
1395   - if (config.proxy) {
1396   - config.proxy.reader = config.reader;
1397   - delete config.reader;
1398   - deprecate({pkg:'Ext.data.Store', member:'reader', type:'config', msg:'The reader config should now be specified on the '+
1399   - 'configured proxy rather than directly on the store.'});
1400   - }
1401   - }
1402   - else {
1403   - // we should never get here, but just in case
1404   - breaking({pkg:'Ext.data.Store', msg: 'A store was specified with no model, url, or fields configured. '+
1405   - 'Please see the header docs for Ext.data.Store for details on properly setting up your data components.'});
1406   -
1407   - return false;
1408   - }
1409   -
1410   - var pn = config.paramNames;
1411   - if (config.proxy && pn) {
1412   - Ext.apply(config.proxy, {
1413   - startParam: pn.start || 'start',
1414   - limitParam: pn.limit || 'limit',
1415   - sortParam : pn.sort || 'sort',
1416   - directionParam : pn.dir || 'dir'
1417   - });
1418   - deprecate({pkg:'Ext.data.Store', member:'paramNames', msg:'This is now split out into individual configs at the proxy '+
1419   - 'level (e.g., paramNames.start == proxy.startParam). Set each config directly on the proxy as needed.'})
1420   - }
1421   -
1422   - var id = 'Ext.data.Store.ImplicitModel-' + (config.storeId || config.id || Ext.id());
1423   - notify({pkg:'Ext.data.Store', msg:'Registering implicit model ' + id + '. Please update your code to create a model explicitly.'});
1424   -
1425   - config.model = Ext.define(id, {
1426   - extend: 'Ext.data.Model',
1427   - fields: fields,
1428   - proxy: config.proxy
1429   - });
1430   - this.implicitModel = true;
1431   - }
1432   - })
1433   - });
1434   -
1435   - Ext.apply(Ext.data.Store.prototype, {
1436   - constructor: Ext.Function.createInterceptor(Ext.data.Store.prototype.constructor, function(config) {
1437   - if (config.data && Ext.isObject(config.data)) {
1438   - // Seems to be still supported officially for now
1439   -// deprecate({pkg:'Ext.data.Store', member:'data<Object>', type:'config', alt:'data<Array>',
1440   -// msg:'Passing inline data to store\'s constructor as an object is no longer supported. Pass a '+
1441   -// 'plain array of record data or use one of the standard proxy configurations for loading data.'});
1442   -
1443   - if(config.root){
1444   - this.inlineData = config.data[config.root];
1445   - delete config.data;
1446   - }
1447   -// else {
1448   -// breaking({pkg:'Ext.data.Store',
1449   -// msg:'Passing inline data as an object to the Store constructor without specifying a root property is not supported.'});
1450   -// }
1451   - }
1452   - if (config.sortInfo) {
1453   - deprecate({pkg:'Ext.data.Store', member:'sortInfo', type:'config', alt:'sorters'});
1454   - config.sorters = [{
1455   - property: config.sortInfo.field,
1456   - direction: config.sortInfo.direction
1457   - }];
1458   - }
1459   - if (config.autoSave) {
1460   - deprecate({pkg:'Ext.data.Store', member:'autoSave', type:'config', alt:'autoSync'});
1461   - this.autoSync = config.autoSave;
1462   - delete config.autoSave;
1463   - }
1464   - }),
1465   -
1466   - setDefaultSort : function(field, dir) {
1467   - deprecate({pkg:'Ext.data.Store', member:'setDefaultSort', alt:'sorters (config)',
1468   - msg:'Either add the default sort via the "sorters" config or by adding it to the "sorters" property after the store is created. '+
1469   - 'See the Ext.data.Store header docs for details on configuring sorters.'});
1470   -
1471   - this.sorters = new Ext.util.MixedCollection();
1472   - this.sorters.add(new Ext.util.Sorter({
1473   - property: field,
1474   - direction: dir ? dir.toUpperCase() : 'ASC'
1475   - }));
1476   - },
1477   -
1478   - save: function() {
1479   - deprecate({pkg:'Ext.data.Store', member:'save', alt:'sync'});
1480   - return this.sync.apply(this, arguments);
1481   - }
1482   - });
1483   -
1484   - Ext.Compat.bindProperty({owner:Ext.data.Store, name:'recordType',
1485   - getter: function(){
1486   - return this.model;
1487   - },
1488   - getterMsg: function(){
1489   - deprecate({pkg:'Ext.data.Store', member:'recordType', type:'property', alt:'model'});
1490   - }
1491   - });
1492   - }
1493   -
1494   - if (Ext.data.JsonStore) {
1495   - // TODO: Move this override into the lib?
1496   - Ext.apply(Ext.data.JsonStore.prototype, {
1497   - constructor: function(config) {
1498   - config = config || {};
1499   - config.proxy = config.proxy || {};
1500   -
1501   - Ext.applyIf(config.proxy, {
1502   - url : config.url,
1503   - type : 'ajax',
1504   - writer: 'json',
1505   - reader: new Ext.data.JsonReader(config)
1506   - });
1507   - Ext.data.JsonStore.superclass.constructor.call(this, config);
1508   - }
1509   - });
1510   - }
1511   -
1512   - Ext.data.GroupingStore = function(config) {
1513   - deprecate({pkg:'Ext.data.GroupingStore', msg:'GroupingStore no longer exists as a separate class. Instead just '+
1514   - 'create a standard GridPanel and include the Grouping feature, e.g. "features: Ext.create("Ext.grid.feature.Grouping", {...})'});
1515   -
1516   - return Ext.create('Ext.data.Store', config);
1517   - }
1518   -
1519   - /*-------------------------------------------------------------
1520   - * Record
1521   - *-------------------------------------------------------------*/
1522   - if (Ext.data.Record) {
1523   - Ext.data.Record.create = function(o){
1524   - deprecate({pkg:'Ext.data.Record', member:'create', msg:'There is no longer any need to statically define records. '+
1525   - 'You can simply define a new Model configured with the necessary fields via Ext.define, extending Ext.data.Model.'});
1526   -
1527   - var f = Ext.extend(Ext.data.Record, {});
1528   - var p = f.prototype;
1529   - p.fields = new Ext.util.MixedCollection(false, function(field){
1530   - return field.name;
1531   - });
1532   - for(var i = 0, len = o.length; i < len; i++){
1533   - p.fields.add(new Ext.data.Field(o[i]));
1534   - }
1535   - f.getField = function(name){
1536   - return p.fields.get(name);
1537   - };
1538   - return f;
1539   - };
1540   - }
1541   -
1542   - /*-------------------------------------------------------------
1543   - * Readers
1544   - *-------------------------------------------------------------*/
1545   - if (Ext.data.JsonReader) {
1546   - Ext.data.JsonReader.override({
1547   - //TODO: seems to be a bug in the class system that this is required for the Reader override
1548   - constructor: function(){
1549   - this.callParent(arguments);
1550   - }
1551   - });
1552   - }
1553   -
1554   - if (Ext.data.Reader) {
1555   - Ext.apply(Ext.data.Reader.prototype, {
1556   - constructor: function(config, recordType) {
1557   - Ext.apply(this, config || {});
1558   -
1559   - if (config.fields) {
1560   - // this will get converted to an implicit model in the store constructor
1561   - deprecate({pkg:'Ext.data.Reader', member:'fields', type:'config',
1562   - msg:'The fields config is no longer supported. Please refer to the '+
1563   - 'Ext.data.Store header docs for the proper way to set up your data components.'});
1564   - }
1565   - if (recordType) {
1566   - // this will get converted to an implicit model in the store constructor
1567   - config.fields = recordType;
1568   - deprecate({pkg:'Ext.data.Reader', member:'recordType', type:'arg',
1569   - msg:'The recordType argument to the Reader constructor is no longer supported. Please refer to the '+
1570   - 'Ext.data.Store header docs for the proper way to set up your data components.'});
1571   - }
1572   -
1573   - if (config.model) {
1574   - this.model = Ext.ModelManager.getModel(config.model);
1575   - }
1576   - else if (config.fields) {
1577   - this.model = Ext.define('Ext.data.Store.ImplicitModel-' + Ext.id(), {
1578   - extend: 'Ext.data.Model',
1579   - fields: config.fields
1580   - });
1581   - }
1582   - // This is not always true, e.g. with inline array data:
1583   -// else {
1584   -// breaking({pkg:'Ext.data.Reader',
1585   -// msg:'No valid model or field configuration could be found so this reader could not be constructed.'});
1586   -// }
1587   -
1588   - if (this.model) {
1589   - this.buildExtractors();
1590   - }
1591   - }
1592   - });
1593   - }
1594   -
1595   - if (Ext.data.XmlReader) {
1596   - Ext.apply(Ext.data.XmlReader.prototype, {
1597   - // FYI, this entire constructor is now deprecated because all behavior is now in the superclass constructor
1598   - constructor: function(config, recordType) {
1599   - config = config || {};
1600   - if (config.idPath) {
1601   - config.idProperty = config.idPath;
1602   - deprecate({pkg:'Ext.data.XmlReader', member:'idPath', type:'config', alt:'idProperty'});
1603   - }
1604   - if (config.id) {
1605   - config.idProperty = config.id;
1606   - deprecate({pkg:'Ext.data.XmlReader', member:'id', type:'config', alt:'idProperty'});
1607   - }
1608   - if (config.success) {
1609   - config.successProperty = config.success;
1610   - deprecate({pkg:'Ext.data.XmlReader', member:'success', type:'config', alt:'successProperty'});
1611   - }
1612   - // make sure we pass arguments in case the deprecated recordType arg is included
1613   - Ext.data.XmlReader.superclass.constructor.apply(this, arguments);
1614   - }
1615   - });
1616   - }
1617   -
1618   - /*-------------------------------------------------------------
1619   - * Proxies
1620   - *-------------------------------------------------------------*/
1621   - if (Ext.data.ServerProxy) {
1622   - Ext.apply(Ext.data.ServerProxy.prototype, {
1623   - getParams: Ext.Function.createInterceptor(Ext.data.ServerProxy.prototype.getParams, function(params, operation) {
1624   - if (this.sortParam && operation.sorters && operation.sorters.length > 0) {
1625   - if (!this.simpleSortMode) {
1626   - this.simpleSortMode = true;
1627   - Ext.Compat.warn('ServerProxy now supports multiple sort, so if any sort options are specified '+
1628   - 'the sort params get JSON-encoded by default. Unless you have specifically coded for this on '+
1629   - 'the server it will not work and you should set "simpleSortMode = true" on the proxy. Since '+
1630   - 'this was not supported in Ext 3 and you are passing a sort param, simple sorting is assumed '+
1631   - 'and has been set automatically, but you should reexamine this code as you migrate to Ext 4. '+
1632   - 'For now just set "simpleSortMode: true" on your proxy to dismiss this warning.');
1633   - }
1634   - }
1635   - })
1636   - });
1637   - }
1638   -
1639   - if (Ext.data.MemoryProxy) {
1640   - Ext.apply(Ext.data.MemoryProxy.prototype, {
1641   - read: Ext.Function.createInterceptor(Ext.data.MemoryProxy.prototype.read, function(op, cb, scope) {
1642   - if (this.doRequest) {
1643   - deprecate({pkg:'Ext.data.MemoryProxy', member:'doRequest', alt: 'read',
1644   - msg:'ClientProxy subclasses no longer implement doRequest.'});
1645   -
1646   - var params = {
1647   - start: op.start,
1648   - limit: op.limit
1649   - };
1650   - if (op.sorters && op.sorters.length > 0) {
1651   - var idx = op.sorters.length-1; // take the last sort if multiple
1652   - params[this.sortParam || 'sort'] = op.sorters[idx].property;
1653   - params[this.directionParam || 'dir'] = op.sorters[idx].direction;
1654   - }
1655   - if (op.filters && op.filters.length > 0) {
1656   - // not sure if we can compat this
1657   - //params[this.filterParam || 'filter'] = ??;
1658   - }
1659   - this.doRequest(op.action, op.getRecords(), params, this.getReader(), function(result, options){
1660   - Ext.apply(op, {
1661   - resultSet: result
1662   - });
1663   - op.setCompleted();
1664   - op.setSuccessful();
1665   - Ext.callback(cb, scope || this, [op]);
1666   - }, scope);
1667   -
1668   - return false; // skip original read logic
1669   - }
1670   - })
1671   - });
1672   - }
1673   -
1674   - /*-------------------------------------------------------------
1675   - * Model
1676   - *-------------------------------------------------------------*/
1677   - if (Ext.data.Model) {
1678   - Ext.apply(Ext.data.Model.prototype, {
1679   - constructor: Ext.Function.createInterceptor(Ext.data.Model.prototype.constructor, function(data, id) {
1680   - var newData = {};
1681   - if (Ext.isArray(data)){
1682   - // Support for loading an array, needed for calling loadData on an ArrayStore
1683   - var fields = this.fields.items,
1684   - length = fields.length,
1685   - field, name,
1686   - i = 0,
1687   - newData = {};
1688   -
1689   - for (; i < length; i++) {
1690   - field = fields[i];
1691   - name = field.name;
1692   - newData[name] = data[i];
1693   - }
1694   - data = newData;
1695   - }
1696   - }),
1697   -
1698   - initComponent: Ext.Function.createInterceptor(Ext.data.Model.prototype.initComponent, function() {
1699   - // Needed to bootstrap 3.x stores that use id. Once converted to a model this will
1700   - // not be needed, so there's no need for a separate warning, just a temp shim.
1701   - this.id = this.internalId;
1702   - })
1703   - });
1704   - }
1705   -
1706   - /*-------------------------------------------------------------
1707   - * Other Ext.data.* stuff
1708   - *-------------------------------------------------------------*/
1709   - if (Ext.data.Operation) {
1710   - Ext.apply(Ext.data.Operation.prototype, {
1711   - markStarted: function() {
1712   - deprecate({pkg:'Ext.data.Operation', member:'markStarted', alt:'setStarted'});
1713   - return this.setStarted();
1714   - },
1715   - markCompleted: function() {
1716   - deprecate({pkg:'Ext.data.Operation', member:'markCompleted', alt:'setCompleted'});
1717   - return this.setCompleted();
1718   - },
1719   - markSuccessful: function() {
1720   - deprecate({pkg:'Ext.data.Operation', member:'markSuccessful', alt:'setSuccessful'});
1721   - return this.setSuccessful();
1722   - },
1723   - markException: function() {
1724   - deprecate({pkg:'Ext.data.Operation', member:'markException', alt:'setException'});
1725   - return this.setException();
1726   - }
1727   - });
1728   - }
1729   -
1730   - /*-------------------------------------------------------------
1731   - * Tooltip
1732   - *-------------------------------------------------------------*/
1733   - if (Ext.tip.ToolTip) {
1734   - Ext.apply(Ext.tip.ToolTip.prototype, {
1735   - initTarget: function(target) {
1736   - deprecate({pkg:'Ext.ToolTip', member:'initTarget', alt:'setTarget'});
1737   - return this.setTarget(target);
1738   - }
1739   - });
1740   - }
1741   -
1742   - if (Ext.TaskManager) {
1743   - Ext.TaskMgr = function() {
1744   - deprecate({pkg:'Ext.TaskMgr', alt:'Ext.TaskManager'});
1745   - return Ext.TaskManager;
1746   - }
1747   - Ext.TaskMgr.start = Ext.TaskManager.start;
1748   - Ext.TaskMgr.stop = Ext.TaskManager.stop;
1749   - Ext.TaskMgr.stopAll = Ext.TaskManager.stopAll;
1750   - }
1751   -
1752   -})();
1753   -
1754   -//
1755   -// TODO: Remove this once the plugin is integrated into the lib
1756   -//
1757   -Ext.define('Ext.ux.PreviewPlugin', {
1758   - extend: 'Ext.AbstractPlugin',
1759   - alias: 'plugin.preview',
1760   - requires: ['Ext.grid.feature.RowBody', 'Ext.grid.feature.RowWrap'],
1761   -
1762   - // private, css class to use to hide the body
1763   - hideBodyCls: 'x-grid-row-body-hidden',
1764   -
1765   - /**
1766   - * @cfg {String} bodyField
1767   - * Field to display in the preview. Must me a field within the Model definition
1768   - * that the store is using.
1769   - */
1770   - bodyField: '',
1771   -
1772   - /**
1773   - * @cfg {Boolean} previewExpanded
1774   - */
1775   - previewExpanded: true,
1776   -
1777   - constructor: function(config) {
1778   - this.callParent(arguments);
1779   - var bodyField = this.bodyField,
1780   - hideBodyCls = this.hideBodyCls,
1781   - section = this.getCmp();
1782   -
1783   - section.previewExpanded = this.previewExpanded;
1784   - section.features = [{
1785   - ftype: 'rowbody',
1786   - getAdditionalData: function(data, idx, record, orig, view) {
1787   - var o = Ext.grid.feature.RowBody.prototype.getAdditionalData.apply(this, arguments);
1788   - Ext.apply(o, {
1789   - rowBody: data[bodyField],
1790   - rowBodyCls: section.previewExpanded ? '' : hideBodyCls
1791   - });
1792   - return o;
1793   - }
1794   - },{
1795   - ftype: 'rowwrap'
1796   - }];
1797   - },
1798   -
1799   - /**
1800   - * Toggle between the preview being expanded/hidden
1801   - * @param {Boolean} expanded Pass true to expand the record and false to not show the preview.
1802   - */
1803   - toggleExpanded: function(expanded) {
1804   - var view = this.getCmp();
1805   - this.previewExpanded = view.previewExpanded = expanded;
1806   - view.refresh();
1807   - }
1808   -});
js/lib/compat/ext3-core-compat.js deleted
... ... @@ -1,735 +0,0 @@
1   -
2   -/*========================================================================
3   - *
4   - * This section contains stuff that should be in Ext4, or stuff that
5   - * is up for discussion. It should be removed prior to Ext 4 final.
6   - *
7   - *========================================================================*/
8   -
9   -// Beefed up getDockedItems to make it easier to find specific items like top toolbars only
10   -//Ext.apply(Ext.panel.AbstractPanel.prototype, {
11   -// /**
12   -// * Retrieve an array of all currently docked components, optionally matching a
13   -// * specific docked side and/or component type.
14   -// * @param {Array} options
15   -// * @return {Array} An array of matching components
16   -// */
17   -// // ex: {dock: 'top', alias: 'widget.toolbar'}
18   -// getDockedItems : function(options) {
19   -// var me = this,
20   -// items = [];
21   -//
22   -// if (me.dockedItems && me.dockedItems.items.length) {
23   -// items = me.dockedItems.items.slice();
24   -// }
25   -//
26   -// if (options && items.length > 0) {
27   -// var i = 0,
28   -// ln = items.length,
29   -// matches = [],
30   -// item;
31   -//
32   -// for (; i < ln; i++) {
33   -// item = items[i];
34   -// if (options.dock && options.dock !== item.dock){
35   -// continue;
36   -// }
37   -// if (options.alias && options.alias !== item.alias){
38   -// continue;
39   -// }
40   -// matches.push(item);
41   -// }
42   -// return matches;
43   -// }
44   -// return items;
45   -// }
46   -//});
47   -
48   -
49   -/*========================================================================
50   - *
51   - * This section contains the Ext.Compat object definition.
52   - * Also shared by ext3-compat.js.
53   - *
54   - *========================================================================*/
55   -
56   -Ext.Compat = function(){
57   - // private
58   - var notificationCache = [],
59   -
60   - // private
61   - getMsg = function(o, tag){
62   - var version = o.version ? o.version : '4.0',
63   - pkg = o.pkg ? '[' + o.pkg + ']': '',
64   - member = o.member ? ' ' + o.member : '',
65   - type = o.type ? ' (' + o.type + ')' : '',
66   - use = o.type === 'event' ? ' Handle ' : ' Use ',
67   - alt = o.alt ? use + o.alt + ' instead.' : '',
68   - msg = o.msg ? ' ' + o.msg : '';
69   -
70   - return '[' + tag + '][' + version + ']' + pkg + member + type + ':' + alt + msg;
71   - },
72   -
73   - // private
74   - showMsg = function(msg, method, single){
75   - var isNew = Ext.Array.indexOf(notificationCache, msg) == -1;
76   - if (isNew || !single) {
77   - Ext.Compat[method](msg);
78   - if (single) {
79   - notificationCache.push(msg);
80   - }
81   - }
82   - },
83   -
84   - // private
85   - consoleOut = function(type, msg){
86   - if (Ext.Compat.silent === true) {
87   - return;
88   - }
89   - if (!Ext.isDefined(Ext.global.console)){
90   - if (type === 'error' && Ext.Array.indexOf(notificationCache, '__consoleMsg') == -1) {
91   - notificationCache.push('__consoleMsg');
92   - alert('You have Ext compatibility errors that must be resolved. Please enable your browser\'s console '+
93   - '(or switch to a console-capable browser) to see complete error details.');
94   - }
95   - return;
96   - }
97   - var con = Ext.global.console;
98   -
99   - if(Ext.Array.indexOf(notificationCache, '__initMsg') == -1){
100   - notificationCache.push('__initMsg');
101   - con.info('#### Ext 3 compatibility mode active. See the Migration Guide included with the Ext 4 download for details.');
102   - if(!Ext.Compat.showErrors){
103   - var errMsg = '#### Set "Ext.Compat.showErrors = true;" in your code to include a stack trace with each warning.';
104   - con.info(con.firebug ? errMsg : errMsg + ' (Firebug required)');
105   - }
106   - con.log(' ');
107   - }
108   - con[Ext.Compat.showErrors ? 'error' : type](msg);
109   - };
110   -
111   - return {
112   - /**
113   - * False to display console messages (default), true to skip displaying console messages. Useful
114   - * when running an app in compatibility mode for end users prior to completing full migration to Ext 4.
115   - */
116   - silent: false,
117   - /**
118   - * True to ignore informational messages and show only warnings, false to show all messages (default)
119   - */
120   - ignoreInfo: false,
121   - /**
122   - * True to display messages via console.error instead of console.warn/info (defaults to false). When
123   - * viewing the console in Firebug in particular this can be a useful option to enable as Firebug will
124   - * capture the stack trace and include it in the displayed error object, which can make finding the
125   - * source of warnings much easier in most cases. In other browsers enabling this option will simply
126   - * display the message as an error cosmetically but won't provide any additional benefit.
127   - */
128   - showErrors: false,
129   -
130   - /**
131   - * Wrapper for the browser console.warn() method that checks for the existence of console
132   - * and also honors the Ext.Compat.silent flag. Should be used for any breaking change
133   - * or deprecation warnings.
134   - * @param {String} msg The console message to log
135   - */
136   - warn: function(msg) {
137   - consoleOut('warn', msg);
138   - },
139   -
140   - /**
141   - * Wrapper for the browser console.info() method that checks for the existence of console
142   - * and also honors the Ext.Compat.silent flag. Should be used for informational
143   - * messages or non-breaking changes that modify existing behavior.
144   - * @param {String} msg The console message to log
145   - */
146   - info: function(msg){
147   - if(this.ignoreInfo !== true){
148   - consoleOut('info', msg);
149   - }
150   - },
151   -
152   - /**
153   - * This method should generally be eschewed in favor of Ext.compat.deprecate. However it might be necessary
154   - * to log a console error in certain cases, e.g. when backwards-compatibility is only conditionally possible.
155   - * @param {String} msg The console message to log
156   - */
157   - error: function(msg){
158   - consoleOut('error', msg);
159   - },
160   -
161   - /**
162   - * Display a standard deprecation message. The method takes a single object argument that contains
163   - * properties as described below. All properties are optional, although typically the pkg and member would be
164   - * specified along with a descriptive message.
165   - * @param {String} pkg (optional) The package ("Core") or component ("Ext.grid.Grid") being referenced (defaults to '')
166   - * @param {String} member (optional) The member being deprecated (defaults to '')
167   - * @param {String} alt (optional) An alternate member that is replacing the deprecated member (defaults to '')
168   - * @param {String} type (optional) The member type (method, config, property, xtype, etc.) Defaults to 'method',
169   - * which does not get displayed -- any other specified type will be displayed in the output.
170   - * @param {String} msg (optional) An additional message to provide more explanation about the change (defaults to '')
171   - * @param {String} tag (optional) The first bracketed item in the output that describes the message type (defaults to 'DEPRECATED')
172   - * @param {Boolean} single (optional) True to limit each unique message to being displayed only one time (defaults to false,
173   - * meaning the same message can be displayed multiple times). Usually it's good to set single:true for logging issues
174   - * that can happen repetitively with the same root cause (e.g., the same issue within each row of a grid).
175   - */
176   - deprecate: function(o) {
177   - var msg = getMsg(o, o.tag || 'DEPRECATED');
178   - showMsg(msg, 'warn', o.single);
179   - },
180   -
181   - /**
182   - * Display a console error with the special tag "BREAKING" to signify a breaking change that cannot be
183   - * resolved in the compatibility layer. These issues generally must be resolved immediately before the
184   - * compatibility layer be successfully applied. The method takes a single object argument that contains
185   - * properties as described below. All properties are optional, although typically the pkg and member would be
186   - * specified along with a descriptive message.
187   - * @param {String} msg (optional) A message to provide more explanation about the breaking change (defaults to '')
188   - * @param {String} pkg (optional) The package ("Core") or component ("Ext.grid.Grid") being referenced (defaults to '')
189   - * @param {String} member (optional) The member being referenced in relation to the change (defaults to '')
190   - * @param {String} type (optional) The member type (method, config, property, xtype, etc.) Defaults to 'method',
191   - * which does not get displayed -- any other specified type will be displayed in the output.
192   - * @param {String} tag (optional) The first bracketed item in the output that describes the message type (defaults to 'BREAKING')
193   - * @param {Boolean} single (optional) True to limit each unique message to being displayed only one time (defaults to false,
194   - * meaning the same message can be displayed multiple times). Usually it's good to set single:true for logging issues
195   - * that can happen repetitively with the same root cause (e.g., the same issue within each row of a grid).
196   - */
197   - breaking: function(o){
198   - o.msg = (o.msg || '') + ' This is a breaking change that cannot be resolved in the compatibility layer!';
199   - var msg = getMsg(o, o.tag || 'BREAKING');
200   - showMsg(msg, 'error', o.single);
201   - },
202   -
203   - /**
204   - * Display a freeform notification that a compatibility change exists. This would be used, for example,
205   - * if an existing method has changed its default behavior, or has a different argument signature.
206   - * The method takes either a string message or an object argument that contains properties as described below.
207   - * If a member is being deprecated you might consider using <tt>deprecate</tt> instead.
208   - * @param {String} msg A message explaining the change
209   - * @param {String} pkg (optional) The package ("Core") or component ("Ext.grid.Grid") being referenced (defaults to '')
210   - * @param {String} member (optional) The member being referenced in relation to the change (defaults to '')
211   - * @param {String} type (optional) The member type (method, config, property, xtype, etc.) Defaults to 'method',
212   - * which does not get displayed -- any other specified type will be displayed in the output.
213   - * @param {String} tag (optional) The first bracketed item in the output that describes the message type (defaults to 'INFO')
214   - * @param {Boolean} single (optional) True to limit each unique message to being displayed only one time (defaults to false,
215   - * meaning the same message can be displayed multiple times). Usually it's good to set single:true for logging issues
216   - * that can happen repetitively with the same root cause (e.g., the same issue within each row of a grid).
217   - */
218   - notify: function(o) {
219   - if(Ext.isString(o)){
220   - o = {msg:o};
221   - }
222   - if(o.msg){
223   - var msg = getMsg(o, o.tag || 'INFO'),
224   - single = Ext.isDefined(o.single) ? o.single : !this.showErrors;
225   -
226   - showMsg(msg, 'info', single);
227   - }
228   - },
229   -
230   - /*
231   - * Currently experimental
232   - */
233   - bindProperty: function(options) {
234   - var localValue,
235   - o = options;
236   -
237   - if (o.owner.__defineGetter__) {
238   - o.owner.__defineGetter__(o.name, function(){
239   - if (o.getterMsg) {
240   - o.getterMsg();
241   - }
242   - return localValue ? localValue : (o.getter ? o.getter() : o.defaultValue);
243   - });
244   - o.owner.__defineSetter__(o.name, function(val){
245   - if (o.setterMsg) {
246   - o.setterMsg();
247   - }
248   - if (o.setter) {
249   - o.setter(val);
250   - }
251   - else {
252   - o.owner[o.name] = val;
253   - }
254   - localValue = val;
255   - });
256   - }
257   - else {
258   - o.owner[o.name] = o.defaultValue;
259   - }
260   - }
261   - };
262   -}();
263   -
264   -
265   -/*========================================================================
266   - *
267   - * This section contains compatibility overrides for Ext Core
268   - *
269   - *========================================================================*/
270   -
271   -(function(){
272   - var compat = Ext.Compat,
273   - deprecate = Ext.bind(compat.deprecate, compat),
274   - notify = Ext.bind(compat.notify, compat),
275   - breaking = Ext.bind(compat.breaking, compat),
276   - bindProperty = Ext.bind(compat.bindProperty, compat);
277   -
278   - /*-------------------------------------------------------------
279   - * Ext
280   - *-------------------------------------------------------------*/
281   - Ext.apply(Ext, {
282   - createDelegate: function() {
283   - deprecate({pkg:'Ext', member:'createDelegate', alt:'Ext.bind'});
284   - return Ext.Function.bind.apply(Ext.Function, arguments);
285   - },
286   - createCallback: function() {
287   - deprecate({pkg:'Ext', member:'createCallback', alt:'Ext.pass'});
288   - return Ext.Function.pass.apply(Ext.Function, arguments);
289   - },
290   - createInterceptor: function() {
291   - deprecate({pkg:'Ext', member:'createInterceptor', alt:'Ext.Function.createInterceptor'});
292   - return Ext.Function.createInterceptor.apply(Ext.Function, arguments);
293   - },
294   - createSequence: function() {
295   - deprecate({pkg:'Ext', member:'createSequence', alt:'Ext.Function.createSequence'});
296   - return Ext.Function.createSequence.apply(Ext.Function, arguments);
297   - },
298   - // This is still aliased in Ext.Array
299   -// toArray: function() {
300   -// deprecate({pkg:'Ext', member:'toArray', alt:'Ext.Array.toArray'});
301   -// return Ext.Array.toArray.apply(Ext.Array, arguments);
302   -// },
303   - pluck: function(arr, prop) {
304   - deprecate({pkg:'Ext', member:'pluck', alt:'Ext.Array.pluck'});
305   - return Ext.Array.pluck.apply(Ext.Array, arguments);
306   - }
307   -
308   - // TODO: Verify if this is really deprecated or not:
309   -// iterate: function() {
310   -// Ext.each.apply(this, arguments);
311   -// deprecate({pkg:'Ext', member:'iterate', alt:'each',
312   -// msg:'Ext.each is now a wrapper for both Ext.Array.forEach and Ext.Object.each.'});
313   -// }
314   - });
315   -
316   - /*-------------------------------------------------------------
317   - * Ext properties
318   - *-------------------------------------------------------------*/
319   - var versionObj = Ext.getVersion('extjs');
320   -
321   - bindProperty({owner:Ext, name:'version', defaultValue:versionObj.version,
322   - getterMsg: function(){
323   - deprecate({pkg:'Ext', member:'version', type:'property', alt:'getVersion (method)',
324   - msg:'Ext.getVersion() takes one argument which is the package name to look up. This will be defaulted '+
325   - 'to "extjs" but could also be "core" or "touch". Note also that getVersion returns an object. For the '+
326   - 'simple string representation use the Ext.getVersion("extjs").version property.'});
327   - }
328   - });
329   -
330   - // For no logical reason this one causes Firebug to go into an infinite loop. It makes no sense...
331   -// bindProperty({owner:Ext, name:'versionDetail', defaultValue: {
332   -// major: versionObj.major,
333   -// minor: versionObj.minor,
334   -// patch: versionObj.patch
335   -// },
336   -// getterMsg: function(){
337   -// deprecate({pkg:'Ext', member:'versionDetail', type:'property', alt:'getVersion (method)',
338   -// msg:'Ext.getVersion() takes one argument which is the package name to look up. This will be defaulted '+
339   -// 'to "extjs" but could also be "core" or "touch". Note also that getVersion returns an object. For the '+
340   -// 'version detail representation use Ext.getVersion("extjs") and inspect the properties major, minor and patch.'});
341   -// }
342   -// });
343   -
344   - /*-------------------------------------------------------------
345   - * Ext.lib.Dom
346   - *-------------------------------------------------------------*/
347   - // Helper function for aliasing Ext.lib.Dom
348   - var aliasDom = function(name, args){
349   - deprecate({pkg:'Ext.lib.Dom', member:name, alt:'Ext.core.Element.'+name});
350   - return Ext.core.Element[name].apply(Ext.core.Element, args);
351   - };
352   - Ext.lib = {};
353   - Ext.lib.Dom = {
354   - isAncestor : function(p, c) {
355   - return aliasDom('isAncestor', arguments);
356   - },
357   - getViewWidth : function(full) {
358   - return aliasDom('getViewWidth', arguments);
359   - },
360   - getViewHeight : function(full) {
361   - return aliasDom('getViewHeight', arguments);
362   - },
363   - getDocumentHeight: function() {
364   - return aliasDom('getDocumentHeight', arguments);
365   - },
366   - getDocumentWidth: function() {
367   - return aliasDom('getDocumentWidth', arguments);
368   - },
369   - getViewportHeight: function(){
370   - return aliasDom('getViewportHeight', arguments);
371   - },
372   - getViewportWidth : function() {
373   - return aliasDom('getViewportWidth', arguments);
374   - },
375   - getY : function(el) {
376   - return aliasDom('getY', arguments);
377   - },
378   - getX : function(el) {
379   - return aliasDom('getX', arguments);
380   - },
381   - getXY : function(el) {
382   - return aliasDom('getXY', arguments);
383   - },
384   - setXY : function(el, xy) {
385   - aliasDom('setXY', arguments);
386   - },
387   - setX : function(el, x) {
388   - aliasDom('setX', arguments);
389   - },
390   - setY : function(el, y) {
391   - aliasDom('setY', arguments);
392   - }
393   - };
394   -
395   - /*-------------------------------------------------------------
396   - * Ext.lib.Event
397   - *-------------------------------------------------------------*/
398   - // Helper function for aliasing Ext.lib.Event
399   - var aliasEvent = function(e, name, args){
400   - deprecate({pkg:'Ext.lib.Event', member:name, alt:'<event>.'+name});
401   - return e[name].apply(e, args);
402   - };
403   - Ext.lib.Event = {
404   - getTarget : function(e) {
405   - return aliasEvent(e, 'getTarget', arguments);
406   - },
407   - getRelatedTarget : function(ev) {
408   - return aliasEvent(e, 'getRelatedTarget', arguments);
409   - },
410   - getPageX : function(e) {
411   - return aliasEvent(e, 'getPageX', arguments);
412   - },
413   - getPageY : function(e) {
414   - return aliasEvent(e, 'getPageY', arguments);
415   - },
416   - getXY : function(e) {
417   - return aliasEvent(e, 'getXY', arguments);
418   - },
419   - stopEvent : function(e) {
420   - return aliasEvent(e, 'stopEvent', arguments);
421   - },
422   - stopPropagation : function(e) {
423   - return aliasEvent(e, 'stopPropagation', arguments);
424   - },
425   - preventDefault : function(e) {
426   - return aliasEvent(e, 'preventDefault', arguments);
427   - },
428   - getCharCode : function(e) {
429   - return aliasEvent(e, 'getCharCode', arguments);
430   - },
431   - getEvent : function(e) {
432   - deprecate({pkg:'Ext.lib.Event', member:'getEvent', alt:'<event>', msg:'Just use the event instance directly.'});
433   - return e;
434   - }
435   - };
436   -
437   - /*-------------------------------------------------------------
438   - * Ext.lib.Point
439   - *-------------------------------------------------------------*/
440   - Ext.lib.Point = function(x, y) {
441   - deprecate({pkg:'Ext.lib.Point', alt:'Ext.util.Point'});
442   - return new Ext.util.Point(x, y);
443   - };
444   -
445   - /*-------------------------------------------------------------
446   - * Ext.lib.Ajax
447   - *-------------------------------------------------------------*/
448   - Ext.lib.Ajax = {
449   - request : function() {
450   - deprecate({pkg:'Ext.lib.Ajax', member:'request', alt:'Ext.Ajax.request',
451   - msg:'This method is not backwards-compatible and must be updated manually.'});
452   - },
453   - serializeForm : function(form) {
454   - deprecate({pkg:'Ext.lib.Ajax', member:'serializeForm', alt:'Ext.core.Element.serializeForm'});
455   - return Ext.core.Element.serializeForm(form);
456   - },
457   - abort : function() {
458   - deprecate({pkg:'Ext.lib.Ajax', member:'abort', alt:'Ext.Ajax.abort',
459   - msg:'This method is not backwards-compatible and must be updated manually.'});
460   - },
461   - isCallInProgress : function() {
462   - deprecate({pkg:'Ext.lib.Ajax', member:'isCallInProgress', alt:'Ext.Ajax.isLoading',
463   - msg:'This method is not backwards-compatible and must be updated manually.'});
464   - }
465   - };
466   -
467   - /*-------------------------------------------------------------
468   - * Function prototype overrides
469   - *-------------------------------------------------------------*/
470   - Ext.apply(Function.prototype, {
471   - createInterceptor : function(){
472   - deprecate({pkg:'Function', member:'<fn>.createInterceptor', alt:'Ext.Function.createInterceptor',
473   - msg:'Note that this is now a static method, so the function will be the first argument to the new version.'});
474   - return Ext.Function.createInterceptor.apply(Ext.Function, [this].concat(Array.prototype.slice.call(arguments)));
475   - },
476   -
477   - createSequence : function(){
478   - deprecate({pkg:'Function', member:'<fn>.createSequence', alt:'Ext.Function.createSequence',
479   - msg:'Note that this is now a static method, so the function will be the first argument to the new version.'});
480   - return Ext.Function.createInterceptor.apply(Ext.Function, [this].concat(Array.prototype.slice.call(arguments)));
481   - },
482   -
483   - createCallback : function(){
484   - deprecate({pkg:'Function', member:'<fn>.createCallback', alt:'Ext.pass',
485   - msg:'Note that this is now a static method, so the function will be the first argument to the new version.'});
486   - return Ext.pass.apply(Ext.Function, [this].concat(Array.prototype.slice.call(arguments)));
487   - },
488   -
489   - createDelegate : function(obj, args, appendArgs){
490   - deprecate({pkg:'Function', member:'<fn>.createDelegate', alt:'Ext.bind',
491   - msg:'Note that this is now a static method, so the function will be the first argument to the new version.'});
492   - return Ext.bind.apply(Ext.Function, [this].concat(Array.prototype.slice.call(arguments)));
493   - },
494   -
495   - defer : function(){
496   - deprecate({pkg:'Function', member:'<fn>.defer', alt:'Ext.defer',
497   - msg:'Note that this is now a static method, so the function will be the first argument to the new version.'});
498   - return Ext.defer.apply(Ext.Function, [this].concat(Array.prototype.slice.call(arguments)));
499   - }
500   - });
501   -
502   - /*-------------------------------------------------------------
503   - * String overrides
504   - *-------------------------------------------------------------*/
505   - // String static methods:
506   - Ext.applyIf(String, {
507   - format : function(){
508   - deprecate({pkg:'String', member:'format', alt:'Ext.String.format'});
509   - return Ext.String.format.apply(Ext.String, arguments);
510   - },
511   - escape : function(string) {
512   - deprecate({pkg:'String', member:'escape', alt:'Ext.String.escape'});
513   - return Ext.String.escape.apply(Ext.String, arguments);
514   - },
515   - leftPad : function (val, size, ch) {
516   - deprecate({pkg:'String', member:'leftPad', alt:'Ext.String.leftPad'});
517   - return Ext.String.leftPad.apply(Ext.String, arguments);
518   - }
519   - });
520   - // String instance methods:
521   - Ext.applyIf(String.prototype, {
522   - toggle : function(value, other){
523   - deprecate({pkg:'String', member:'<string>.toggle', alt:'Ext.String.toggle',
524   - msg:'Note that this is now a static method, so the string instance will be the first argument to the new version.'});
525   - return Ext.String.toggle.call(Ext.String, this, value, other);
526   - },
527   - trim : function(){
528   - deprecate({pkg:'String', member:'<string>.trim', alt:'Ext.String.trim',
529   - msg:'Note that this is now a static method, so the string instance will be the first argument to the new version.'});
530   - return Ext.String.trim.call(Ext.String, this);
531   - }
532   - });
533   -
534   - /*-------------------------------------------------------------
535   - * Array overrides
536   - *-------------------------------------------------------------*/
537   - Ext.applyIf(Array.prototype, {
538   - indexOf : function(o){
539   - deprecate({pkg:'Array', member:'<array>.indexOf', alt:'Ext.Array.indexOf',
540   - msg:'Note that this is now a static method, so the array instance will be the first argument to the new version. '+
541   - 'Also the new version adds an optional "from index" as the last argument.'});
542   - return Ext.Array.indexOf.call(Ext.Array, this, o);
543   - },
544   - remove : function(o){
545   - deprecate({pkg:'Array', member:'<array>.remove', alt:'Ext.Array.remove',
546   - msg:'Note that this is now a static method, so the array instance will be the first argument to the new version.'});
547   - return Ext.Array.remove.call(Ext.Array, this, o);
548   - }
549   - });
550   -
551   - /*-------------------------------------------------------------
552   - * Number overrides
553   - *-------------------------------------------------------------*/
554   - Ext.applyIf(Number.prototype, {
555   - constrain : function(min, max){
556   - deprecate({pkg:'Number', member:'<number>.constrain', alt:'Ext.Number.constrain',
557   - msg:'Note that this is now a static method, so the number instance will be the first argument to the new version.'});
558   - return Ext.Number.constrain.call(Ext.Number, this, min, max);
559   - }
560   - });
561   -
562   - /*-------------------------------------------------------------
563   - * Date overrides.
564   - * NOTE: The methods from the Date class under Ext.util
565   - * in 3.x are aliased separately in ext3-compat.js.
566   - *-------------------------------------------------------------*/
567   - Ext.applyIf(Date.prototype, {
568   - /**
569   - Returns the number of milliseconds between this date and date
570   - @param {Date} date (optional) Defaults to now
571   - @return {Number} The diff in milliseconds
572   - @member Date getElapsed
573   - @deprecated
574   - */
575   - getElapsed : function(date) {
576   - deprecate({pkg:'Core', member:'<date>.getElapsed', alt:'Ext.Date.getElapsed'});
577   - return Ext.Date.getElapsed.call(Ext.Date, this, date);
578   - }
579   - });
580   -
581   - /*-------------------------------------------------------------
582   - * Element
583   - *-------------------------------------------------------------*/
584   - Ext.apply(Ext.core.Element.prototype, {
585   - getMargins : function(){
586   - deprecate({pkg:'Ext.Element', member:'getMargins', alt:'getMargin'});
587   - return this.getMargin.apply(this, arguments);
588   - },
589   - addClass : function(){
590   - deprecate({pkg:'Ext.Element', member:'addClass', alt:'addCls'});
591   - return this.addCls.apply(this, arguments);
592   - },
593   - addClassOnClick : function(){
594   - deprecate({pkg:'Ext.Element', member:'addClassOnClick', alt:'addClsOnClick'});
595   - return this.addClsOnClick.apply(this, arguments);
596   - },
597   - addClassOnFocus : function(){
598   - deprecate({pkg:'Ext.Element', member:'addClassOnFocus', alt:'addClsOnFocus'});
599   - return this.addClsOnFocus.apply(this, arguments);
600   - },
601   - addClassOnOver : function(){
602   - deprecate({pkg:'Ext.Element', member:'addClassOnOver', alt:'addClsOnOver'});
603   - return this.addClsOnOver.apply(this, arguments);
604   - },
605   - hasClass : function(){
606   - deprecate({pkg:'Ext.Element', member:'hasClass', alt:'hasCls'});
607   - return this.hasCls.apply(this, arguments);
608   - },
609   - radioClass : function(){
610   - deprecate({pkg:'Ext.Element', member:'radioClass', alt:'radioCls'});
611   - return this.radioCls.apply(this, arguments);
612   - },
613   - removeClass : function(){
614   - deprecate({pkg:'Ext.Element', member:'removeClass', alt:'removeCls'});
615   - return this.removeCls.apply(this, arguments);
616   - },
617   - replaceClass : function(){
618   - deprecate({pkg:'Ext.Element', member:'replaceClass', alt:'replaceCls'});
619   - return this.replaceCls.apply(this, arguments);
620   - },
621   - toggleClass : function(){
622   - deprecate({pkg:'Ext.Element', member:'toggleClass', alt:'toggleCls'});
623   - return this.toggleCls.apply(this, arguments);
624   - },
625   -
626   -// Can't do this since Ext internally uses these calls. Reverting them will break Ext 4 code, so have to doc as breaking changes.
627   -// child : function(selector, returnDom){
628   -// notify('Ext.Element.child now returns a single direct child in 4.0 (switched with Ext.Element.down). '+
629   -// 'Reverting to the 3.x behavior that matches at any depth -- please verify this call when migrating to Ext 4.');
630   -//
631   -// var n = Ext.DomQuery.selectNode(selector, this.dom);
632   -// return returnDom ? n : Ext.get(n);
633   -// },
634   -// down : function(selector, returnDom){
635   -// notify('Ext.Element.down now returns a single child at any depth in 4.0 (switched with Ext.Element.child). '+
636   -// 'Reverting to the 3.x behavior that matches a direct child only -- please verify this call when migrating to Ext 4.');
637   -//
638   -// var n = Ext.DomQuery.selectNode(" > " + selector, this.dom);
639   -// return returnDom ? n : Ext.get(n);
640   -// },
641   - animate: function(args, duration, onComplete, easing) {
642   - if (arguments.length > 1 || Ext.isEmpty(args)) {
643   - deprecate({pkg:'Ext.Element', member:'animate', msg:'Ext.Element.animate should be called with a single configuration object. '+
644   - 'See the header API docs for Ext.util.Animate for details on the supported config attribute syntax.'});
645   - }
646   - var me = this;
647   - if (!me.id) {
648   - me = Ext.get(me.dom);
649   - }
650   - if (Ext.fx.Manager.hasFxBlock(me.id)) {
651   - return me;
652   - }
653   - args = args || {};
654   - if (duration) {
655   - args.duration = duration;
656   - }
657   - if (onComplete) {
658   - args.callback = onComplete;
659   - }
660   - if (easing) {
661   - args.easing = easing;
662   - }
663   - Ext.fx.Manager.queueFx(Ext.create('Ext.fx.Anim', me.anim(args)));
664   - return this;
665   - },
666   - anim: Ext.Function.createInterceptor(Ext.core.Element.prototype.anim, function(config) {
667   - if (Ext.isObject(config)) {
668   - if (config.delay && config.delay < 10) {
669   - config.delay *= 1000;
670   - notify({pkg:'Ext.Element', member:'animate', msg:'Detected an extremely small animation delay, assuming the '+
671   - 'deprecated unit seconds were used. Please change to milliseconds.'});
672   - }
673   - if (config.duration && config.duration < 10) {
674   - config.duration *= 1000;
675   - notify({pkg:'Ext.Element', member:'animate', msg:'Detected an extremely small animation duration, assuming the '+
676   - 'deprecated unit seconds were used. Please change to milliseconds.'});
677   - }
678   - if (config.endOpacity) {
679   - config.opacity = config.endOpacity;
680   - delete config.endOpacity;
681   - deprecate({pkg:'Ext.Element', member:'animate', msg:'The endOpacity attribute of the animate config object is '+
682   - 'no longer supported. Please use opacity instead.'});
683   - }
684   - }
685   - })
686   - });
687   -
688   - /*-------------------------------------------------------------
689   - * Ajax
690   - *-------------------------------------------------------------*/
691   - Ext.Ajax.serializeForm = function(form) {
692   - deprecate({pkg:'Ext.Ajax', member:'serializeForm', alt:'Ext.core.Element.serializeForm'});
693   - return Ext.core.Element.serializeForm(form);
694   - };
695   -
696   -// Ext.extend = function(subclass, superclass, members) {
697   -// deprecate({pkg:'Ext', member:'extend', alt:'Ext.define',
698   -// msg:'Declare your class with Ext.define() and use the "extend" config to specify the superclass.'});
699   -//
700   -// if (arguments.length === 2 && Ext.isObject(superclass)) {
701   -// members = superclass;
702   -// superclass = subclass;
703   -// subclass = null;
704   -// }
705   -//
706   -// var cls;
707   -//
708   -// if (!superclass) {
709   -// compat.error("Attempting to extend from a class which has not been loaded on the page.");
710   -// }
711   -// members = members || {};
712   -// members.extend = superclass;
713   -// members.preprocessors = ['extend', 'mixins', 'config', 'statics'];
714   -//
715   -// if (subclass) {
716   -// if (!subclass.hasOwnProperty('constructor')) {
717   -// subclass.constructor = Ext.apply({}, subclass);
718   -// }
719   -// cls = new Ext.Class(subclass, members);
720   -// }
721   -// else {
722   -// cls = new Ext.Class(members);
723   -// }
724   -//
725   -// cls.prototype.override = function(o) {
726   -// for (var m in o) {
727   -// if (o.hasOwnProperty(m)) {
728   -// this[m] = o[m];
729   -// }
730   -// }
731   -// };
732   -//
733   -// return cls;
734   -// };
735   -})();
js/lib/jasmine/MIT.LICENSE deleted
... ... @@ -1,20 +0,0 @@
1   -Copyright (c) 2008-2010 Pivotal Labs
2   -
3   -Permission is hereby granted, free of charge, to any person obtaining
4   -a copy of this software and associated documentation files (the
5   -"Software"), to deal in the Software without restriction, including
6   -without limitation the rights to use, copy, modify, merge, publish,
7   -distribute, sublicense, and/or sell copies of the Software, and to
8   -permit persons to whom the Software is furnished to do so, subject to
9   -the following conditions:
10   -
11   -The above copyright notice and this permission notice shall be
12   -included in all copies or substantial portions of the Software.
13   -
14   -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15   -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16   -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17   -NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18   -LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19   -OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20   -WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
js/lib/jasmine/jasmine-html.js deleted
... ... @@ -1,182 +0,0 @@
1   -jasmine.TrivialReporter = function(doc) {
2   - this.document = doc || document;
3   - this.suiteDivs = {};
4   - this.logRunningSpecs = false;
5   -};
6   -
7   -jasmine.TrivialReporter.prototype.createDom = function(type, attrs, childrenVarArgs) {
8   - var el = document.createElement(type);
9   -
10   - for (var i = 2; i < arguments.length; i++) {
11   - var child = arguments[i];
12   -
13   - if (typeof child === 'string') {
14   - el.appendChild(document.createTextNode(child));
15   - } else {
16   - if (child) { el.appendChild(child); }
17   - }
18   - }
19   -
20   - for (var attr in attrs) {
21   - if (attr == "className") {
22   - el[attr] = attrs[attr];
23   - } else {
24   - el.setAttribute(attr, attrs[attr]);
25   - }
26   - }
27   -
28   - return el;
29   -};
30   -
31   -jasmine.TrivialReporter.prototype.reportRunnerStarting = function(runner) {
32   - var showPassed, showSkipped;
33   -
34   - this.outerDiv = this.createDom('div', { className: 'jasmine_reporter' },
35   - this.createDom('div', { className: 'banner' },
36   - this.createDom('div', { className: 'logo' },
37   - this.createDom('a', { href: 'http://pivotal.github.com/jasmine/', target: "_blank" }, "Jasmine"),
38   - this.createDom('span', { className: 'version' }, runner.env.versionString())),
39   - this.createDom('div', { className: 'options' },
40   - "Show ",
41   - showPassed = this.createDom('input', { id: "__jasmine_TrivialReporter_showPassed__", type: 'checkbox' }),
42   - this.createDom('label', { "for": "__jasmine_TrivialReporter_showPassed__" }, " passed "),
43   - showSkipped = this.createDom('input', { id: "__jasmine_TrivialReporter_showSkipped__", type: 'checkbox' }),
44   - this.createDom('label', { "for": "__jasmine_TrivialReporter_showSkipped__" }, " skipped")
45   - )
46   - ),
47   -
48   - this.runnerDiv = this.createDom('div', { className: 'runner running' },
49   - this.createDom('a', { className: 'run_spec', href: '?' }, "run all"),
50   - this.runnerMessageSpan = this.createDom('span', {}, "Running..."),
51   - this.finishedAtSpan = this.createDom('span', { className: 'finished-at' }, ""))
52   - );
53   -
54   - this.document.body.appendChild(this.outerDiv);
55   -
56   - var suites = runner.suites();
57   - for (var i = 0; i < suites.length; i++) {
58   - var suite = suites[i];
59   - var suiteDiv = this.createDom('div', { className: 'suite' },
60   - this.createDom('a', { className: 'run_spec', href: '?spec=' + encodeURIComponent(suite.getFullName()) }, "run"),
61   - this.createDom('a', { className: 'description', href: '?spec=' + encodeURIComponent(suite.getFullName()) }, suite.description));
62   - this.suiteDivs[suite.id] = suiteDiv;
63   - var parentDiv = this.outerDiv;
64   - if (suite.parentSuite) {
65   - parentDiv = this.suiteDivs[suite.parentSuite.id];
66   - }
67   - parentDiv.appendChild(suiteDiv);
68   - }
69   -
70   - this.startedAt = new Date();
71   -
72   - var self = this;
73   - showPassed.onchange = function(evt) {
74   - if (evt.target.checked) {
75   - self.outerDiv.className += ' show-passed';
76   - } else {
77   - self.outerDiv.className = self.outerDiv.className.replace(/ show-passed/, '');
78   - }
79   - };
80   -
81   - showSkipped.onchange = function(evt) {
82   - if (evt.target.checked) {
83   - self.outerDiv.className += ' show-skipped';
84   - } else {
85   - self.outerDiv.className = self.outerDiv.className.replace(/ show-skipped/, '');
86   - }
87   - };
88   -};
89   -
90   -jasmine.TrivialReporter.prototype.reportRunnerResults = function(runner) {
91   - var results = runner.results();
92   - var className = (results.failedCount > 0) ? "runner failed" : "runner passed";
93   - this.runnerDiv.setAttribute("class", className);
94   - //do it twice for IE
95   - this.runnerDiv.setAttribute("className", className);
96   - var specs = runner.specs();
97   - var specCount = 0;
98   - for (var i = 0; i < specs.length; i++) {
99   - if (this.specFilter(specs[i])) {
100   - specCount++;
101   - }
102   - }
103   - var message = "" + specCount + " spec" + (specCount == 1 ? "" : "s" ) + ", " + results.failedCount + " failure" + ((results.failedCount == 1) ? "" : "s");
104   - message += " in " + ((new Date().getTime() - this.startedAt.getTime()) / 1000) + "s";
105   - this.runnerMessageSpan.replaceChild(this.createDom('a', { className: 'description', href: '?'}, message), this.runnerMessageSpan.firstChild);
106   -
107   - this.finishedAtSpan.appendChild(document.createTextNode("Finished at " + new Date().toString()));
108   -};
109   -
110   -jasmine.TrivialReporter.prototype.reportSuiteResults = function(suite) {
111   - var results = suite.results();
112   - var status = results.passed() ? 'passed' : 'failed';
113   - if (results.totalCount == 0) { // todo: change this to check results.skipped
114   - status = 'skipped';
115   - }
116   - this.suiteDivs[suite.id].className += " " + status;
117   -};
118   -
119   -jasmine.TrivialReporter.prototype.reportSpecStarting = function(spec) {
120   - if (this.logRunningSpecs) {
121   - this.log('>> Jasmine Running ' + spec.suite.description + ' ' + spec.description + '...');
122   - }
123   -};
124   -
125   -jasmine.TrivialReporter.prototype.reportSpecResults = function(spec) {
126   - var results = spec.results();
127   - var status = results.passed() ? 'passed' : 'failed';
128   - if (results.skipped) {
129   - status = 'skipped';
130   - }
131   - var specDiv = this.createDom('div', { className: 'spec ' + status },
132   - this.createDom('a', { className: 'run_spec', href: '?spec=' + encodeURIComponent(spec.getFullName()) }, "run"),
133   - this.createDom('a', {
134   - className: 'description',
135   - href: '?spec=' + encodeURIComponent(spec.getFullName()),
136   - title: spec.getFullName()
137   - }, spec.description));
138   -
139   -
140   - var resultItems = results.getItems();
141   - var messagesDiv = this.createDom('div', { className: 'messages' });
142   - for (var i = 0; i < resultItems.length; i++) {
143   - var result = resultItems[i];
144   -
145   - if (result.type == 'log') {
146   - messagesDiv.appendChild(this.createDom('div', {className: 'resultMessage log'}, result.toString()));
147   - } else if (result.type == 'expect' && result.passed && !result.passed()) {
148   - messagesDiv.appendChild(this.createDom('div', {className: 'resultMessage fail'}, result.message));
149   -
150   - if (result.trace.stack) {
151   - messagesDiv.appendChild(this.createDom('div', {className: 'stackTrace'}, result.trace.stack));
152   - }
153   - }
154   - }
155   -
156   - if (messagesDiv.childNodes.length > 0) {
157   - specDiv.appendChild(messagesDiv);
158   - }
159   -
160   - this.suiteDivs[spec.suite.id].appendChild(specDiv);
161   -};
162   -
163   -jasmine.TrivialReporter.prototype.log = function() {
164   - var console = jasmine.getGlobal().console;
165   - if (console && console.log) console.log.apply(console, arguments);
166   -};
167   -
168   -jasmine.TrivialReporter.prototype.getLocation = function() {
169   - return this.document.location;
170   -};
171   -
172   -jasmine.TrivialReporter.prototype.specFilter = function(spec) {
173   - var paramMap = {};
174   - var params = this.getLocation().search.substring(1).split('&');
175   - for (var i = 0; i < params.length; i++) {
176   - var p = params[i].split('=');
177   - paramMap[decodeURIComponent(p[0])] = decodeURIComponent(p[1]);
178   - }
179   -
180   - if (!paramMap["spec"]) return true;
181   - return spec.getFullName().indexOf(paramMap["spec"]) == 0;
182   -};
js/lib/jasmine/jasmine.css deleted
... ... @@ -1,166 +0,0 @@
1   -body {
2   - font-family: "Helvetica Neue Light", "Lucida Grande", "Calibri", "Arial", sans-serif;
3   -}
4   -
5   -
6   -.jasmine_reporter a:visited, .jasmine_reporter a {
7   - color: #303;
8   -}
9   -
10   -.jasmine_reporter a:hover, .jasmine_reporter a:active {
11   - color: blue;
12   -}
13   -
14   -.run_spec {
15   - float:right;
16   - padding-right: 5px;
17   - font-size: .8em;
18   - text-decoration: none;
19   -}
20   -
21   -.jasmine_reporter {
22   - margin: 0 5px;
23   -}
24   -
25   -.banner {
26   - color: #303;
27   - background-color: #fef;
28   - padding: 5px;
29   -}
30   -
31   -.logo {
32   - float: left;
33   - font-size: 1.1em;
34   - padding-left: 5px;
35   -}
36   -
37   -.logo .version {
38   - font-size: .6em;
39   - padding-left: 1em;
40   -}
41   -
42   -.runner.running {
43   - background-color: yellow;
44   -}
45   -
46   -
47   -.options {
48   - text-align: right;
49   - font-size: .8em;
50   -}
51   -
52   -
53   -
54   -
55   -.suite {
56   - border: 1px outset gray;
57   - margin: 5px 0;
58   - padding-left: 1em;
59   -}
60   -
61   -.suite .suite {
62   - margin: 5px;
63   -}
64   -
65   -.suite.passed {
66   - background-color: #dfd;
67   -}
68   -
69   -.suite.failed {
70   - background-color: #fdd;
71   -}
72   -
73   -.spec {
74   - margin: 5px;
75   - padding-left: 1em;
76   - clear: both;
77   -}
78   -
79   -.spec.failed, .spec.passed, .spec.skipped {
80   - padding-bottom: 5px;
81   - border: 1px solid gray;
82   -}
83   -
84   -.spec.failed {
85   - background-color: #fbb;
86   - border-color: red;
87   -}
88   -
89   -.spec.passed {
90   - background-color: #bfb;
91   - border-color: green;
92   -}
93   -
94   -.spec.skipped {
95   - background-color: #bbb;
96   -}
97   -
98   -.messages {
99   - border-left: 1px dashed gray;
100   - padding-left: 1em;
101   - padding-right: 1em;
102   -}
103   -
104   -.passed {
105   - background-color: #cfc;
106   - display: none;
107   -}
108   -
109   -.failed {
110   - background-color: #fbb;
111   -}
112   -
113   -.skipped {
114   - color: #777;
115   - background-color: #eee;
116   - display: none;
117   -}
118   -
119   -
120   -/*.resultMessage {*/
121   - /*white-space: pre;*/
122   -/*}*/
123   -
124   -.resultMessage span.result {
125   - display: block;
126   - line-height: 2em;
127   - color: black;
128   -}
129   -
130   -.resultMessage .mismatch {
131   - color: black;
132   -}
133   -
134   -.stackTrace {
135   - white-space: pre;
136   - font-size: .8em;
137   - margin-left: 10px;
138   - max-height: 5em;
139   - overflow: auto;
140   - border: 1px inset red;
141   - padding: 1em;
142   - background: #eef;
143   -}
144   -
145   -.finished-at {
146   - padding-left: 1em;
147   - font-size: .6em;
148   -}
149   -
150   -.show-passed .passed,
151   -.show-skipped .skipped {
152   - display: block;
153   -}
154   -
155   -
156   -#jasmine_content {
157   - position:fixed;
158   - right: 100%;
159   -}
160   -
161   -.runner {
162   - border: 1px solid gray;
163   - display: block;
164   - margin: 5px 0;
165   - padding: 2px 0 2px 10px;
166   -}
js/lib/jasmine/jasmine.js deleted
... ... @@ -1,2421 +0,0 @@
1   -/**
2   - * Top level namespace for Jasmine, a lightweight JavaScript BDD/spec/testing framework.
3   - *
4   - * @namespace
5   - */
6   -var jasmine = {};
7   -
8   -/**
9   - * @private
10   - */
11   -jasmine.unimplementedMethod_ = function() {
12   - throw new Error("unimplemented method");
13   -};
14   -
15   -/**
16   - * Use <code>jasmine.undefined</code> instead of <code>undefined</code>, since <code>undefined</code> is just
17   - * a plain old variable and may be redefined by somebody else.
18   - *
19   - * @private
20   - */
21   -jasmine.undefined = jasmine.___undefined___;
22   -
23   -/**
24   - * Default interval in milliseconds for event loop yields (e.g. to allow network activity or to refresh the screen with the HTML-based runner). Small values here may result in slow test running. Zero means no updates until all tests have completed.
25   - *
26   - */
27   -jasmine.DEFAULT_UPDATE_INTERVAL = 250;
28   -
29   -/**
30   - * Default timeout interval in milliseconds for waitsFor() blocks.
31   - */
32   -jasmine.DEFAULT_TIMEOUT_INTERVAL = 5000;
33   -
34   -jasmine.getGlobal = function() {
35   - function getGlobal() {
36   - return this;
37   - }
38   -
39   - return getGlobal();
40   -};
41   -
42   -/**
43   - * Allows for bound functions to be compared. Internal use only.
44   - *
45   - * @ignore
46   - * @private
47   - * @param base {Object} bound 'this' for the function
48   - * @param name {Function} function to find
49   - */
50   -jasmine.bindOriginal_ = function(base, name) {
51   - var original = base[name];
52   - if (original.apply) {
53   - return function() {
54   - return original.apply(base, arguments);
55   - };
56   - } else {
57   - // IE support
58   - return jasmine.getGlobal()[name];
59   - }
60   -};
61   -
62   -jasmine.setTimeout = jasmine.bindOriginal_(jasmine.getGlobal(), 'setTimeout');
63   -jasmine.clearTimeout = jasmine.bindOriginal_(jasmine.getGlobal(), 'clearTimeout');
64   -jasmine.setInterval = jasmine.bindOriginal_(jasmine.getGlobal(), 'setInterval');
65   -jasmine.clearInterval = jasmine.bindOriginal_(jasmine.getGlobal(), 'clearInterval');
66   -
67   -jasmine.MessageResult = function(values) {
68   - this.type = 'log';
69   - this.values = values;
70   - this.trace = new Error(); // todo: test better
71   -};
72   -
73   -jasmine.MessageResult.prototype.toString = function() {
74   - var text = "";
75   - for(var i = 0; i < this.values.length; i++) {
76   - if (i > 0) text += " ";
77   - if (jasmine.isString_(this.values[i])) {
78   - text += this.values[i];
79   - } else {
80   - text += jasmine.pp(this.values[i]);
81   - }
82   - }
83   - return text;
84   -};
85   -
86   -jasmine.ExpectationResult = function(params) {
87   - this.type = 'expect';
88   - this.matcherName = params.matcherName;
89   - this.passed_ = params.passed;
90   - this.expected = params.expected;
91   - this.actual = params.actual;
92   -
93   - this.message = this.passed_ ? 'Passed.' : params.message;
94   - this.trace = this.passed_ ? '' : new Error(this.message);
95   -};
96   -
97   -jasmine.ExpectationResult.prototype.toString = function () {
98   - return this.message;
99   -};
100   -
101   -jasmine.ExpectationResult.prototype.passed = function () {
102   - return this.passed_;
103   -};
104   -
105   -/**
106   - * Getter for the Jasmine environment. Ensures one gets created
107   - */
108   -jasmine.getEnv = function() {
109   - return jasmine.currentEnv_ = jasmine.currentEnv_ || new jasmine.Env();
110   -};
111   -
112   -/**
113   - * @ignore
114   - * @private
115   - * @param value
116   - * @returns {Boolean}
117   - */
118   -jasmine.isArray_ = function(value) {
119   - return jasmine.isA_("Array", value);
120   -};
121   -
122   -/**
123   - * @ignore
124   - * @private
125   - * @param value
126   - * @returns {Boolean}
127   - */
128   -jasmine.isString_ = function(value) {
129   - return jasmine.isA_("String", value);
130   -};
131   -
132   -/**
133   - * @ignore
134   - * @private
135   - * @param value
136   - * @returns {Boolean}
137   - */
138   -jasmine.isNumber_ = function(value) {
139   - return jasmine.isA_("Number", value);
140   -};
141   -
142   -/**
143   - * @ignore
144   - * @private
145   - * @param {String} typeName
146   - * @param value
147   - * @returns {Boolean}
148   - */
149   -jasmine.isA_ = function(typeName, value) {
150   - return Object.prototype.toString.apply(value) === '[object ' + typeName + ']';
151   -};
152   -
153   -/**
154   - * Pretty printer for expecations. Takes any object and turns it into a human-readable string.
155   - *
156   - * @param value {Object} an object to be outputted
157   - * @returns {String}
158   - */
159   -jasmine.pp = function(value) {
160   - var stringPrettyPrinter = new jasmine.StringPrettyPrinter();
161   - stringPrettyPrinter.format(value);
162   - return stringPrettyPrinter.string;
163   -};
164   -
165   -/**
166   - * Returns true if the object is a DOM Node.
167   - *
168   - * @param {Object} obj object to check
169   - * @returns {Boolean}
170   - */
171   -jasmine.isDomNode = function(obj) {
172   - return obj['nodeType'] > 0;
173   -};
174   -
175   -/**
176   - * Returns a matchable 'generic' object of the class type. For use in expecations of type when values don't matter.
177   - *
178   - * @example
179   - * // don't care about which function is passed in, as long as it's a function
180   - * expect(mySpy).toHaveBeenCalledWith(jasmine.any(Function));
181   - *
182   - * @param {Class} clazz
183   - * @returns matchable object of the type clazz
184   - */
185   -jasmine.any = function(clazz) {
186   - return new jasmine.Matchers.Any(clazz);
187   -};
188   -
189   -/**
190   - * Jasmine Spies are test doubles that can act as stubs, spies, fakes or when used in an expecation, mocks.
191   - *
192   - * Spies should be created in test setup, before expectations. They can then be checked, using the standard Jasmine
193   - * expectation syntax. Spies can be checked if they were called or not and what the calling params were.
194   - *
195   - * A Spy has the following fields: wasCalled, callCount, mostRecentCall, and argsForCall (see docs).
196   - *
197   - * Spies are torn down at the end of every spec.
198   - *
199   - * Note: Do <b>not</b> call new jasmine.Spy() directly - a spy must be created using spyOn, jasmine.createSpy or jasmine.createSpyObj.
200   - *
201   - * @example
202   - * // a stub
203   - * var myStub = jasmine.createSpy('myStub'); // can be used anywhere
204   - *
205   - * // spy example
206   - * var foo = {
207   - * not: function(bool) { return !bool; }
208   - * }
209   - *
210   - * // actual foo.not will not be called, execution stops
211   - * spyOn(foo, 'not');
212   -
213   - // foo.not spied upon, execution will continue to implementation
214   - * spyOn(foo, 'not').andCallThrough();
215   - *
216   - * // fake example
217   - * var foo = {
218   - * not: function(bool) { return !bool; }
219   - * }
220   - *
221   - * // foo.not(val) will return val
222   - * spyOn(foo, 'not').andCallFake(function(value) {return value;});
223   - *
224   - * // mock example
225   - * foo.not(7 == 7);
226   - * expect(foo.not).toHaveBeenCalled();
227   - * expect(foo.not).toHaveBeenCalledWith(true);
228   - *
229   - * @constructor
230   - * @see spyOn, jasmine.createSpy, jasmine.createSpyObj
231   - * @param {String} name
232   - */
233   -jasmine.Spy = function(name) {
234   - /**
235   - * The name of the spy, if provided.
236   - */
237   - this.identity = name || 'unknown';
238   - /**
239   - * Is this Object a spy?
240   - */
241   - this.isSpy = true;
242   - /**
243   - * The actual function this spy stubs.
244   - */
245   - this.plan = function() {
246   - };
247   - /**
248   - * Tracking of the most recent call to the spy.
249   - * @example
250   - * var mySpy = jasmine.createSpy('foo');
251   - * mySpy(1, 2);
252   - * mySpy.mostRecentCall.args = [1, 2];
253   - */
254   - this.mostRecentCall = {};
255   -
256   - /**
257   - * Holds arguments for each call to the spy, indexed by call count
258   - * @example
259   - * var mySpy = jasmine.createSpy('foo');
260   - * mySpy(1, 2);
261   - * mySpy(7, 8);
262   - * mySpy.mostRecentCall.args = [7, 8];
263   - * mySpy.argsForCall[0] = [1, 2];
264   - * mySpy.argsForCall[1] = [7, 8];
265   - */
266   - this.argsForCall = [];
267   - this.calls = [];
268   -};
269   -
270   -/**
271   - * Tells a spy to call through to the actual implemenatation.
272   - *
273   - * @example
274   - * var foo = {
275   - * bar: function() { // do some stuff }
276   - * }
277   - *
278   - * // defining a spy on an existing property: foo.bar
279   - * spyOn(foo, 'bar').andCallThrough();
280   - */
281   -jasmine.Spy.prototype.andCallThrough = function() {
282   - this.plan = this.originalValue;
283   - return this;
284   -};
285   -
286   -/**
287   - * For setting the return value of a spy.
288   - *
289   - * @example
290   - * // defining a spy from scratch: foo() returns 'baz'
291   - * var foo = jasmine.createSpy('spy on foo').andReturn('baz');
292   - *
293   - * // defining a spy on an existing property: foo.bar() returns 'baz'
294   - * spyOn(foo, 'bar').andReturn('baz');
295   - *
296   - * @param {Object} value
297   - */
298   -jasmine.Spy.prototype.andReturn = function(value) {
299   - this.plan = function() {
300   - return value;
301   - };
302   - return this;
303   -};
304   -
305   -/**
306   - * For throwing an exception when a spy is called.
307   - *
308   - * @example
309   - * // defining a spy from scratch: foo() throws an exception w/ message 'ouch'
310   - * var foo = jasmine.createSpy('spy on foo').andThrow('baz');
311   - *
312   - * // defining a spy on an existing property: foo.bar() throws an exception w/ message 'ouch'
313   - * spyOn(foo, 'bar').andThrow('baz');
314   - *
315   - * @param {String} exceptionMsg
316   - */
317   -jasmine.Spy.prototype.andThrow = function(exceptionMsg) {
318   - this.plan = function() {
319   - throw exceptionMsg;
320   - };
321   - return this;
322   -};
323   -
324   -/**
325   - * Calls an alternate implementation when a spy is called.
326   - *
327   - * @example
328   - * var baz = function() {
329   - * // do some stuff, return something
330   - * }
331   - * // defining a spy from scratch: foo() calls the function baz
332   - * var foo = jasmine.createSpy('spy on foo').andCall(baz);
333   - *
334   - * // defining a spy on an existing property: foo.bar() calls an anonymnous function
335   - * spyOn(foo, 'bar').andCall(function() { return 'baz';} );
336   - *
337   - * @param {Function} fakeFunc
338   - */
339   -jasmine.Spy.prototype.andCallFake = function(fakeFunc) {
340   - this.plan = fakeFunc;
341   - return this;
342   -};
343   -
344   -/**
345   - * Resets all of a spy's the tracking variables so that it can be used again.
346   - *
347   - * @example
348   - * spyOn(foo, 'bar');
349   - *
350   - * foo.bar();
351   - *
352   - * expect(foo.bar.callCount).toEqual(1);
353   - *
354   - * foo.bar.reset();
355   - *
356   - * expect(foo.bar.callCount).toEqual(0);
357   - */
358   -jasmine.Spy.prototype.reset = function() {
359   - this.wasCalled = false;
360   - this.callCount = 0;
361   - this.argsForCall = [];
362   - this.calls = [];
363   - this.mostRecentCall = {};
364   -};
365   -
366   -jasmine.createSpy = function(name) {
367   -
368   - var spyObj = function() {
369   - spyObj.wasCalled = true;
370   - spyObj.callCount++;
371   - var args = jasmine.util.argsToArray(arguments);
372   - spyObj.mostRecentCall.object = this;
373   - spyObj.mostRecentCall.args = args;
374   - spyObj.argsForCall.push(args);
375   - spyObj.calls.push({object: this, args: args});
376   - return spyObj.plan.apply(this, arguments);
377   - };
378   -
379   - var spy = new jasmine.Spy(name);
380   -
381   - for (var prop in spy) {
382   - spyObj[prop] = spy[prop];
383   - }
384   -
385   - spyObj.reset();
386   -
387   - return spyObj;
388   -};
389   -
390   -/**
391   - * Determines whether an object is a spy.
392   - *
393   - * @param {jasmine.Spy|Object} putativeSpy
394   - * @returns {Boolean}
395   - */
396   -jasmine.isSpy = function(putativeSpy) {
397   - return putativeSpy && putativeSpy.isSpy;
398   -};
399   -
400   -/**
401   - * Creates a more complicated spy: an Object that has every property a function that is a spy. Used for stubbing something
402   - * large in one call.
403   - *
404   - * @param {String} baseName name of spy class
405   - * @param {Array} methodNames array of names of methods to make spies
406   - */
407   -jasmine.createSpyObj = function(baseName, methodNames) {
408   - if (!jasmine.isArray_(methodNames) || methodNames.length == 0) {
409   - throw new Error('createSpyObj requires a non-empty array of method names to create spies for');
410   - }
411   - var obj = {};
412   - for (var i = 0; i < methodNames.length; i++) {
413   - obj[methodNames[i]] = jasmine.createSpy(baseName + '.' + methodNames[i]);
414   - }
415   - return obj;
416   -};
417   -
418   -/**
419   - * All parameters are pretty-printed and concatenated together, then written to the current spec's output.
420   - *
421   - * Be careful not to leave calls to <code>jasmine.log</code> in production code.
422   - */
423   -jasmine.log = function() {
424   - var spec = jasmine.getEnv().currentSpec;
425   - spec.log.apply(spec, arguments);
426   -};
427   -
428   -/**
429   - * Function that installs a spy on an existing object's method name. Used within a Spec to create a spy.
430   - *
431   - * @example
432   - * // spy example
433   - * var foo = {
434   - * not: function(bool) { return !bool; }
435   - * }
436   - * spyOn(foo, 'not'); // actual foo.not will not be called, execution stops
437   - *
438   - * @see jasmine.createSpy
439   - * @param obj
440   - * @param methodName
441   - * @returns a Jasmine spy that can be chained with all spy methods
442   - */
443   -var spyOn = function(obj, methodName) {
444   - return jasmine.getEnv().currentSpec.spyOn(obj, methodName);
445   -};
446   -
447   -/**
448   - * Creates a Jasmine spec that will be added to the current suite.
449   - *
450   - * // TODO: pending tests
451   - *
452   - * @example
453   - * it('should be true', function() {
454   - * expect(true).toEqual(true);
455   - * });
456   - *
457   - * @param {String} desc description of this specification
458   - * @param {Function} func defines the preconditions and expectations of the spec
459   - */
460   -var it = function(desc, func) {
461   - return jasmine.getEnv().it(desc, func);
462   -};
463   -
464   -/**
465   - * Creates a <em>disabled</em> Jasmine spec.
466   - *
467   - * A convenience method that allows existing specs to be disabled temporarily during development.
468   - *
469   - * @param {String} desc description of this specification
470   - * @param {Function} func defines the preconditions and expectations of the spec
471   - */
472   -var xit = function(desc, func) {
473   - return jasmine.getEnv().xit(desc, func);
474   -};
475   -
476   -/**
477   - * Starts a chain for a Jasmine expectation.
478   - *
479   - * It is passed an Object that is the actual value and should chain to one of the many
480   - * jasmine.Matchers functions.
481   - *
482   - * @param {Object} actual Actual value to test against and expected value
483   - */
484   -var expect = function(actual) {
485   - return jasmine.getEnv().currentSpec.expect(actual);
486   -};
487   -
488   -/**
489   - * Defines part of a jasmine spec. Used in cominbination with waits or waitsFor in asynchrnous specs.
490   - *
491   - * @param {Function} func Function that defines part of a jasmine spec.
492   - */
493   -var runs = function(func) {
494   - jasmine.getEnv().currentSpec.runs(func);
495   -};
496   -
497   -/**
498   - * Waits a fixed time period before moving to the next block.
499   - *
500   - * @deprecated Use waitsFor() instead
501   - * @param {Number} timeout milliseconds to wait
502   - */
503   -var waits = function(timeout) {
504   - jasmine.getEnv().currentSpec.waits(timeout);
505   -};
506   -
507   -/**
508   - * Waits for the latchFunction to return true before proceeding to the next block.
509   - *
510   - * @param {Function} latchFunction
511   - * @param {String} optional_timeoutMessage
512   - * @param {Number} optional_timeout
513   - */
514   -var waitsFor = function(latchFunction, optional_timeoutMessage, optional_timeout) {
515   - jasmine.getEnv().currentSpec.waitsFor.apply(jasmine.getEnv().currentSpec, arguments);
516   -};
517   -
518   -/**
519   - * A function that is called before each spec in a suite.
520   - *
521   - * Used for spec setup, including validating assumptions.
522   - *
523   - * @param {Function} beforeEachFunction
524   - */
525   -var beforeEach = function(beforeEachFunction) {
526   - jasmine.getEnv().beforeEach(beforeEachFunction);
527   -};
528   -
529   -/**
530   - * A function that is called after each spec in a suite.
531   - *
532   - * Used for restoring any state that is hijacked during spec execution.
533   - *
534   - * @param {Function} afterEachFunction
535   - */
536   -var afterEach = function(afterEachFunction) {
537   - jasmine.getEnv().afterEach(afterEachFunction);
538   -};
539   -
540   -/**
541   - * Defines a suite of specifications.
542   - *
543   - * Stores the description and all defined specs in the Jasmine environment as one suite of specs. Variables declared
544   - * are accessible by calls to beforeEach, it, and afterEach. Describe blocks can be nested, allowing for specialization
545   - * of setup in some tests.
546   - *
547   - * @example
548   - * // TODO: a simple suite
549   - *
550   - * // TODO: a simple suite with a nested describe block
551   - *
552   - * @param {String} description A string, usually the class under test.
553   - * @param {Function} specDefinitions function that defines several specs.
554   - */
555   -var describe = function(description, specDefinitions) {
556   - return jasmine.getEnv().describe(description, specDefinitions);
557   -};
558   -
559   -/**
560   - * Disables a suite of specifications. Used to disable some suites in a file, or files, temporarily during development.
561   - *
562   - * @param {String} description A string, usually the class under test.
563   - * @param {Function} specDefinitions function that defines several specs.
564   - */
565   -var xdescribe = function(description, specDefinitions) {
566   - return jasmine.getEnv().xdescribe(description, specDefinitions);
567   -};
568   -
569   -
570   -// Provide the XMLHttpRequest class for IE 5.x-6.x:
571   -jasmine.XmlHttpRequest = (typeof XMLHttpRequest == "undefined") ? function() {
572   - try {
573   - return new ActiveXObject("Msxml2.XMLHTTP.6.0");
574   - } catch(e) {
575   - }
576   - try {
577   - return new ActiveXObject("Msxml2.XMLHTTP.3.0");
578   - } catch(e) {
579   - }
580   - try {
581   - return new ActiveXObject("Msxml2.XMLHTTP");
582   - } catch(e) {
583   - }
584   - try {
585   - return new ActiveXObject("Microsoft.XMLHTTP");
586   - } catch(e) {
587   - }
588   - throw new Error("This browser does not support XMLHttpRequest.");
589   -} : XMLHttpRequest;
590   -/**
591   - * @namespace
592   - */
593   -jasmine.util = {};
594   -
595   -/**
596   - * Declare that a child class inherit it's prototype from the parent class.
597   - *
598   - * @private
599   - * @param {Function} childClass
600   - * @param {Function} parentClass
601   - */
602   -jasmine.util.inherit = function(childClass, parentClass) {
603   - /**
604   - * @private
605   - */
606   - var subclass = function() {
607   - };
608   - subclass.prototype = parentClass.prototype;
609   - childClass.prototype = new subclass;
610   -};
611   -
612   -jasmine.util.formatException = function(e) {
613   - var lineNumber;
614   - if (e.line) {
615   - lineNumber = e.line;
616   - }
617   - else if (e.lineNumber) {
618   - lineNumber = e.lineNumber;
619   - }
620   -
621   - var file;
622   -
623   - if (e.sourceURL) {
624   - file = e.sourceURL;
625   - }
626   - else if (e.fileName) {
627   - file = e.fileName;
628   - }
629   -
630   - var message = (e.name && e.message) ? (e.name + ': ' + e.message) : e.toString();
631   -
632   - if (file && lineNumber) {
633   - message += ' in ' + file + ' (line ' + lineNumber + ')';
634   - }
635   -
636   - return message;
637   -};
638   -
639   -jasmine.util.htmlEscape = function(str) {
640   - if (!str) return str;
641   - return str.replace(/&/g, '&amp;')
642   - .replace(/</g, '&lt;')
643   - .replace(/>/g, '&gt;');
644   -};
645   -
646   -jasmine.util.argsToArray = function(args) {
647   - var arrayOfArgs = [];
648   - for (var i = 0; i < args.length; i++) arrayOfArgs.push(args[i]);
649   - return arrayOfArgs;
650   -};
651   -
652   -jasmine.util.extend = function(destination, source) {
653   - for (var property in source) destination[property] = source[property];
654   - return destination;
655   -};
656   -
657   -/**
658   - * Environment for Jasmine
659   - *
660   - * @constructor
661   - */
662   -jasmine.Env = function() {
663   - this.currentSpec = null;
664   - this.currentSuite = null;
665   - this.currentRunner_ = new jasmine.Runner(this);
666   -
667   - this.reporter = new jasmine.MultiReporter();
668   -
669   - this.updateInterval = jasmine.DEFAULT_UPDATE_INTERVAL;
670   - this.defaultTimeoutInterval = jasmine.DEFAULT_TIMEOUT_INTERVAL;
671   - this.lastUpdate = 0;
672   - this.specFilter = function() {
673   - return true;
674   - };
675   -
676   - this.nextSpecId_ = 0;
677   - this.nextSuiteId_ = 0;
678   - this.equalityTesters_ = [];
679   -
680   - // wrap matchers
681   - this.matchersClass = function() {
682   - jasmine.Matchers.apply(this, arguments);
683   - };
684   - jasmine.util.inherit(this.matchersClass, jasmine.Matchers);
685   -
686   - jasmine.Matchers.wrapInto_(jasmine.Matchers.prototype, this.matchersClass);
687   -};
688   -
689   -
690   -jasmine.Env.prototype.setTimeout = jasmine.setTimeout;
691   -jasmine.Env.prototype.clearTimeout = jasmine.clearTimeout;
692   -jasmine.Env.prototype.setInterval = jasmine.setInterval;
693   -jasmine.Env.prototype.clearInterval = jasmine.clearInterval;
694   -
695   -/**
696   - * @returns an object containing jasmine version build info, if set.
697   - */
698   -jasmine.Env.prototype.version = function () {
699   - if (jasmine.version_) {
700   - return jasmine.version_;
701   - } else {
702   - throw new Error('Version not set');
703   - }
704   -};
705   -
706   -/**
707   - * @returns string containing jasmine version build info, if set.
708   - */
709   -jasmine.Env.prototype.versionString = function() {
710   - if (jasmine.version_) {
711   - var version = this.version();
712   - return version.major + "." + version.minor + "." + version.build + " revision " + version.revision;
713   - } else {
714   - return "version unknown";
715   - }
716   -};
717   -
718   -/**
719   - * @returns a sequential integer starting at 0
720   - */
721   -jasmine.Env.prototype.nextSpecId = function () {
722   - return this.nextSpecId_++;
723   -};
724   -
725   -/**
726   - * @returns a sequential integer starting at 0
727   - */
728   -jasmine.Env.prototype.nextSuiteId = function () {
729   - return this.nextSuiteId_++;
730   -};
731   -
732   -/**
733   - * Register a reporter to receive status updates from Jasmine.
734   - * @param {jasmine.Reporter} reporter An object which will receive status updates.
735   - */
736   -jasmine.Env.prototype.addReporter = function(reporter) {
737   - this.reporter.addReporter(reporter);
738   -};
739   -
740   -jasmine.Env.prototype.execute = function() {
741   - this.currentRunner_.execute();
742   -};
743   -
744   -jasmine.Env.prototype.describe = function(description, specDefinitions) {
745   - var suite = new jasmine.Suite(this, description, specDefinitions, this.currentSuite);
746   -
747   - var parentSuite = this.currentSuite;
748   - if (parentSuite) {
749   - parentSuite.add(suite);
750   - } else {
751   - this.currentRunner_.add(suite);
752   - }
753   -
754   - this.currentSuite = suite;
755   -
756   - var declarationError = null;
757   - try {
758   - specDefinitions.call(suite);
759   - } catch(e) {
760   - declarationError = e;
761   - }
762   -
763   - this.currentSuite = parentSuite;
764   -
765   - if (declarationError) {
766   - this.it("encountered a declaration exception", function() {
767   - throw declarationError;
768   - });
769   - }
770   -
771   - return suite;
772   -};
773   -
774   -jasmine.Env.prototype.beforeEach = function(beforeEachFunction) {
775   - if (this.currentSuite) {
776   - this.currentSuite.beforeEach(beforeEachFunction);
777   - } else {
778   - this.currentRunner_.beforeEach(beforeEachFunction);
779   - }
780   -};
781   -
782   -jasmine.Env.prototype.currentRunner = function () {
783   - return this.currentRunner_;
784   -};
785   -
786   -jasmine.Env.prototype.afterEach = function(afterEachFunction) {
787   - if (this.currentSuite) {
788   - this.currentSuite.afterEach(afterEachFunction);
789   - } else {
790   - this.currentRunner_.afterEach(afterEachFunction);
791   - }
792   -
793   -};
794   -
795   -jasmine.Env.prototype.xdescribe = function(desc, specDefinitions) {
796   - return {
797   - execute: function() {
798   - }
799   - };
800   -};
801   -
802   -jasmine.Env.prototype.it = function(description, func) {
803   - var spec = new jasmine.Spec(this, this.currentSuite, description);
804   - this.currentSuite.add(spec);
805   - this.currentSpec = spec;
806   -
807   - if (func) {
808   - spec.runs(func);
809   - }
810   -
811   - return spec;
812   -};
813   -
814   -jasmine.Env.prototype.xit = function(desc, func) {
815   - return {
816   - id: this.nextSpecId(),
817   - runs: function() {
818   - }
819   - };
820   -};
821   -
822   -jasmine.Env.prototype.compareObjects_ = function(a, b, mismatchKeys, mismatchValues) {
823   - if (a.__Jasmine_been_here_before__ === b && b.__Jasmine_been_here_before__ === a) {
824   - return true;
825   - }
826   -
827   - a.__Jasmine_been_here_before__ = b;
828   - b.__Jasmine_been_here_before__ = a;
829   -
830   - var hasKey = function(obj, keyName) {
831   - return obj != null && obj[keyName] !== jasmine.undefined;
832   - };
833   -
834   - for (var property in b) {
835   - if (!hasKey(a, property) && hasKey(b, property)) {
836   - mismatchKeys.push("expected has key '" + property + "', but missing from actual.");
837   - }
838   - }
839   - for (property in a) {
840   - if (!hasKey(b, property) && hasKey(a, property)) {
841   - mismatchKeys.push("expected missing key '" + property + "', but present in actual.");
842   - }
843   - }
844   - for (property in b) {
845   - if (property == '__Jasmine_been_here_before__') continue;
846   - if (!this.equals_(a[property], b[property], mismatchKeys, mismatchValues)) {
847   - mismatchValues.push("'" + property + "' was '" + (b[property] ? jasmine.util.htmlEscape(b[property].toString()) : b[property]) + "' in expected, but was '" + (a[property] ? jasmine.util.htmlEscape(a[property].toString()) : a[property]) + "' in actual.");
848   - }
849   - }
850   -
851   - if (jasmine.isArray_(a) && jasmine.isArray_(b) && a.length != b.length) {
852   - mismatchValues.push("arrays were not the same length");
853   - }
854   -
855   - delete a.__Jasmine_been_here_before__;
856   - delete b.__Jasmine_been_here_before__;
857   - return (mismatchKeys.length == 0 && mismatchValues.length == 0);
858   -};
859   -
860   -jasmine.Env.prototype.equals_ = function(a, b, mismatchKeys, mismatchValues) {
861   - mismatchKeys = mismatchKeys || [];
862   - mismatchValues = mismatchValues || [];
863   -
864   - for (var i = 0; i < this.equalityTesters_.length; i++) {
865   - var equalityTester = this.equalityTesters_[i];
866   - var result = equalityTester(a, b, this, mismatchKeys, mismatchValues);
867   - if (result !== jasmine.undefined) return result;
868   - }
869   -
870   - if (a === b) return true;
871   -
872   - if (a === jasmine.undefined || a === null || b === jasmine.undefined || b === null) {
873   - return (a == jasmine.undefined && b == jasmine.undefined);
874   - }
875   -
876   - if (jasmine.isDomNode(a) && jasmine.isDomNode(b)) {
877   - return a === b;
878   - }
879   -
880   - if (a instanceof Date && b instanceof Date) {
881   - return a.getTime() == b.getTime();
882   - }
883   -
884   - if (a instanceof jasmine.Matchers.Any) {
885   - return a.matches(b);
886   - }
887   -
888   - if (b instanceof jasmine.Matchers.Any) {
889   - return b.matches(a);
890   - }
891   -
892   - if (jasmine.isString_(a) && jasmine.isString_(b)) {
893   - return (a == b);
894   - }
895   -
896   - if (jasmine.isNumber_(a) && jasmine.isNumber_(b)) {
897   - return (a == b);
898   - }
899   -
900   - if (typeof a === "object" && typeof b === "object") {
901   - return this.compareObjects_(a, b, mismatchKeys, mismatchValues);
902   - }
903   -
904   - //Straight check
905   - return (a === b);
906   -};
907   -
908   -jasmine.Env.prototype.contains_ = function(haystack, needle) {
909   - if (jasmine.isArray_(haystack)) {
910   - for (var i = 0; i < haystack.length; i++) {
911   - if (this.equals_(haystack[i], needle)) return true;
912   - }
913   - return false;
914   - }
915   - return haystack.indexOf(needle) >= 0;
916   -};
917   -
918   -jasmine.Env.prototype.addEqualityTester = function(equalityTester) {
919   - this.equalityTesters_.push(equalityTester);
920   -};
921   -/** No-op base class for Jasmine reporters.
922   - *
923   - * @constructor
924   - */
925   -jasmine.Reporter = function() {
926   -};
927   -
928   -//noinspection JSUnusedLocalSymbols
929   -jasmine.Reporter.prototype.reportRunnerStarting = function(runner) {
930   -};
931   -
932   -//noinspection JSUnusedLocalSymbols
933   -jasmine.Reporter.prototype.reportRunnerResults = function(runner) {
934   -};
935   -
936   -//noinspection JSUnusedLocalSymbols
937   -jasmine.Reporter.prototype.reportSuiteResults = function(suite) {
938   -};
939   -
940   -//noinspection JSUnusedLocalSymbols
941   -jasmine.Reporter.prototype.reportSpecStarting = function(spec) {
942   -};
943   -
944   -//noinspection JSUnusedLocalSymbols
945   -jasmine.Reporter.prototype.reportSpecResults = function(spec) {
946   -};
947   -
948   -//noinspection JSUnusedLocalSymbols
949   -jasmine.Reporter.prototype.log = function(str) {
950   -};
951   -
952   -/**
953   - * Blocks are functions with executable code that make up a spec.
954   - *
955   - * @constructor
956   - * @param {jasmine.Env} env
957   - * @param {Function} func
958   - * @param {jasmine.Spec} spec
959   - */
960   -jasmine.Block = function(env, func, spec) {
961   - this.env = env;
962   - this.func = func;
963   - this.spec = spec;
964   -};
965   -
966   -jasmine.Block.prototype.execute = function(onComplete) {
967   - try {
968   - this.func.apply(this.spec);
969   - } catch (e) {
970   - this.spec.fail(e);
971   - }
972   - onComplete();
973   -};
974   -/** JavaScript API reporter.
975   - *
976   - * @constructor
977   - */
978   -jasmine.JsApiReporter = function() {
979   - this.started = false;
980   - this.finished = false;
981   - this.suites_ = [];
982   - this.results_ = {};
983   -};
984   -
985   -jasmine.JsApiReporter.prototype.reportRunnerStarting = function(runner) {
986   - this.started = true;
987   - var suites = runner.topLevelSuites();
988   - for (var i = 0; i < suites.length; i++) {
989   - var suite = suites[i];
990   - this.suites_.push(this.summarize_(suite));
991   - }
992   -};
993   -
994   -jasmine.JsApiReporter.prototype.suites = function() {
995   - return this.suites_;
996   -};
997   -
998   -jasmine.JsApiReporter.prototype.summarize_ = function(suiteOrSpec) {
999   - var isSuite = suiteOrSpec instanceof jasmine.Suite;
1000   - var summary = {
1001   - id: suiteOrSpec.id,
1002   - name: suiteOrSpec.description,
1003   - type: isSuite ? 'suite' : 'spec',
1004   - children: []
1005   - };
1006   -
1007   - if (isSuite) {
1008   - var children = suiteOrSpec.children();
1009   - for (var i = 0; i < children.length; i++) {
1010   - summary.children.push(this.summarize_(children[i]));
1011   - }
1012   - }
1013   - return summary;
1014   -};
1015   -
1016   -jasmine.JsApiReporter.prototype.results = function() {
1017   - return this.results_;
1018   -};
1019   -
1020   -jasmine.JsApiReporter.prototype.resultsForSpec = function(specId) {
1021   - return this.results_[specId];
1022   -};
1023   -
1024   -//noinspection JSUnusedLocalSymbols
1025   -jasmine.JsApiReporter.prototype.reportRunnerResults = function(runner) {
1026   - this.finished = true;
1027   -};
1028   -
1029   -//noinspection JSUnusedLocalSymbols
1030   -jasmine.JsApiReporter.prototype.reportSuiteResults = function(suite) {
1031   -};
1032   -
1033   -//noinspection JSUnusedLocalSymbols
1034   -jasmine.JsApiReporter.prototype.reportSpecResults = function(spec) {
1035   - this.results_[spec.id] = {
1036   - messages: spec.results().getItems(),
1037   - result: spec.results().failedCount > 0 ? "failed" : "passed"
1038   - };
1039   -};
1040   -
1041   -//noinspection JSUnusedLocalSymbols
1042   -jasmine.JsApiReporter.prototype.log = function(str) {
1043   -};
1044   -
1045   -jasmine.JsApiReporter.prototype.resultsForSpecs = function(specIds){
1046   - var results = {};
1047   - for (var i = 0; i < specIds.length; i++) {
1048   - var specId = specIds[i];
1049   - results[specId] = this.summarizeResult_(this.results_[specId]);
1050   - }
1051   - return results;
1052   -};
1053   -
1054   -jasmine.JsApiReporter.prototype.summarizeResult_ = function(result){
1055   - var summaryMessages = [];
1056   - var messagesLength = result.messages.length;
1057   - for (var messageIndex = 0; messageIndex < messagesLength; messageIndex++) {
1058   - var resultMessage = result.messages[messageIndex];
1059   - summaryMessages.push({
1060   - text: resultMessage.type == 'log' ? resultMessage.toString() : jasmine.undefined,
1061   - passed: resultMessage.passed ? resultMessage.passed() : true,
1062   - type: resultMessage.type,
1063   - message: resultMessage.message,
1064   - trace: {
1065   - stack: resultMessage.passed && !resultMessage.passed() ? resultMessage.trace.stack : jasmine.undefined
1066   - }
1067   - });
1068   - }
1069   -
1070   - return {
1071   - result : result.result,
1072   - messages : summaryMessages
1073   - };
1074   -};
1075   -
1076   -/**
1077   - * @constructor
1078   - * @param {jasmine.Env} env
1079   - * @param actual
1080   - * @param {jasmine.Spec} spec
1081   - */
1082   -jasmine.Matchers = function(env, actual, spec, opt_isNot) {
1083   - this.env = env;
1084   - this.actual = actual;
1085   - this.spec = spec;
1086   - this.isNot = opt_isNot || false;
1087   - this.reportWasCalled_ = false;
1088   -};
1089   -
1090   -// todo: @deprecated as of Jasmine 0.11, remove soon [xw]
1091   -jasmine.Matchers.pp = function(str) {
1092   - throw new Error("jasmine.Matchers.pp() is no longer supported, please use jasmine.pp() instead!");
1093   -};
1094   -
1095   -// todo: @deprecated Deprecated as of Jasmine 0.10. Rewrite your custom matchers to return true or false. [xw]
1096   -jasmine.Matchers.prototype.report = function(result, failing_message, details) {
1097   - throw new Error("As of jasmine 0.11, custom matchers must be implemented differently -- please see jasmine docs");
1098   -};
1099   -
1100   -jasmine.Matchers.wrapInto_ = function(prototype, matchersClass) {
1101   - for (var methodName in prototype) {
1102   - if (methodName == 'report') continue;
1103   - var orig = prototype[methodName];
1104   - matchersClass.prototype[methodName] = jasmine.Matchers.matcherFn_(methodName, orig);
1105   - }
1106   -};
1107   -
1108   -jasmine.Matchers.matcherFn_ = function(matcherName, matcherFunction) {
1109   - return function() {
1110   - var matcherArgs = jasmine.util.argsToArray(arguments);
1111   - var result = matcherFunction.apply(this, arguments);
1112   -
1113   - if (this.isNot) {
1114   - result = !result;
1115   - }
1116   -
1117   - if (this.reportWasCalled_) return result;
1118   -
1119   - var message;
1120   - if (!result) {
1121   - if (this.message) {
1122   - message = this.message.apply(this, arguments);
1123   - if (jasmine.isArray_(message)) {
1124   - message = message[this.isNot ? 1 : 0];
1125   - }
1126   - } else {
1127   - var englishyPredicate = matcherName.replace(/[A-Z]/g, function(s) { return ' ' + s.toLowerCase(); });
1128   - message = "Expected " + jasmine.pp(this.actual) + (this.isNot ? " not " : " ") + englishyPredicate;
1129   - if (matcherArgs.length > 0) {
1130   - for (var i = 0; i < matcherArgs.length; i++) {
1131   - if (i > 0) message += ",";
1132   - message += " " + jasmine.pp(matcherArgs[i]);
1133   - }
1134   - }
1135   - message += ".";
1136   - }
1137   - }
1138   - var expectationResult = new jasmine.ExpectationResult({
1139   - matcherName: matcherName,
1140   - passed: result,
1141   - expected: matcherArgs.length > 1 ? matcherArgs : matcherArgs[0],
1142   - actual: this.actual,
1143   - message: message
1144   - });
1145   - this.spec.addMatcherResult(expectationResult);
1146   - return jasmine.undefined;
1147   - };
1148   -};
1149   -
1150   -
1151   -
1152   -
1153   -/**
1154   - * toBe: compares the actual to the expected using ===
1155   - * @param expected
1156   - */
1157   -jasmine.Matchers.prototype.toBe = function(expected) {
1158   - return this.actual === expected;
1159   -};
1160   -
1161   -/**
1162   - * toNotBe: compares the actual to the expected using !==
1163   - * @param expected
1164   - * @deprecated as of 1.0. Use not.toBe() instead.
1165   - */
1166   -jasmine.Matchers.prototype.toNotBe = function(expected) {
1167   - return this.actual !== expected;
1168   -};
1169   -
1170   -/**
1171   - * toEqual: compares the actual to the expected using common sense equality. Handles Objects, Arrays, etc.
1172   - *
1173   - * @param expected
1174   - */
1175   -jasmine.Matchers.prototype.toEqual = function(expected) {
1176   - return this.env.equals_(this.actual, expected);
1177   -};
1178   -
1179   -/**
1180   - * toNotEqual: compares the actual to the expected using the ! of jasmine.Matchers.toEqual
1181   - * @param expected
1182   - * @deprecated as of 1.0. Use not.toNotEqual() instead.
1183   - */
1184   -jasmine.Matchers.prototype.toNotEqual = function(expected) {
1185   - return !this.env.equals_(this.actual, expected);
1186   -};
1187   -
1188   -/**
1189   - * Matcher that compares the actual to the expected using a regular expression. Constructs a RegExp, so takes
1190   - * a pattern or a String.
1191   - *
1192   - * @param expected
1193   - */
1194   -jasmine.Matchers.prototype.toMatch = function(expected) {
1195   - return new RegExp(expected).test(this.actual);
1196   -};
1197   -
1198   -/**
1199   - * Matcher that compares the actual to the expected using the boolean inverse of jasmine.Matchers.toMatch
1200   - * @param expected
1201   - * @deprecated as of 1.0. Use not.toMatch() instead.
1202   - */
1203   -jasmine.Matchers.prototype.toNotMatch = function(expected) {
1204   - return !(new RegExp(expected).test(this.actual));
1205   -};
1206   -
1207   -/**
1208   - * Matcher that compares the actual to jasmine.undefined.
1209   - */
1210   -jasmine.Matchers.prototype.toBeDefined = function() {
1211   - return (this.actual !== jasmine.undefined);
1212   -};
1213   -
1214   -/**
1215   - * Matcher that compares the actual to jasmine.undefined.
1216   - */
1217   -jasmine.Matchers.prototype.toBeUndefined = function() {
1218   - return (this.actual === jasmine.undefined);
1219   -};
1220   -
1221   -/**
1222   - * Matcher that compares the actual to null.
1223   - */
1224   -jasmine.Matchers.prototype.toBeNull = function() {
1225   - return (this.actual === null);
1226   -};
1227   -
1228   -/**
1229   - * Matcher that boolean not-nots the actual.
1230   - */
1231   -jasmine.Matchers.prototype.toBeTruthy = function() {
1232   - return !!this.actual;
1233   -};
1234   -
1235   -
1236   -/**
1237   - * Matcher that boolean nots the actual.
1238   - */
1239   -jasmine.Matchers.prototype.toBeFalsy = function() {
1240   - return !this.actual;
1241   -};
1242   -
1243   -
1244   -/**
1245   - * Matcher that checks to see if the actual, a Jasmine spy, was called.
1246   - */
1247   -jasmine.Matchers.prototype.toHaveBeenCalled = function() {
1248   - if (arguments.length > 0) {
1249   - throw new Error('toHaveBeenCalled does not take arguments, use toHaveBeenCalledWith');
1250   - }
1251   -
1252   - if (!jasmine.isSpy(this.actual)) {
1253   - throw new Error('Expected a spy, but got ' + jasmine.pp(this.actual) + '.');
1254   - }
1255   -
1256   - this.message = function() {
1257   - return [
1258   - "Expected spy " + this.actual.identity + " to have been called.",
1259   - "Expected spy " + this.actual.identity + " not to have been called."
1260   - ];
1261   - };
1262   -
1263   - return this.actual.wasCalled;
1264   -};
1265   -
1266   -/** @deprecated Use expect(xxx).toHaveBeenCalled() instead */
1267   -jasmine.Matchers.prototype.wasCalled = jasmine.Matchers.prototype.toHaveBeenCalled;
1268   -
1269   -/**
1270   - * Matcher that checks to see if the actual, a Jasmine spy, was not called.
1271   - *
1272   - * @deprecated Use expect(xxx).not.toHaveBeenCalled() instead
1273   - */
1274   -jasmine.Matchers.prototype.wasNotCalled = function() {
1275   - if (arguments.length > 0) {
1276   - throw new Error('wasNotCalled does not take arguments');
1277   - }
1278   -
1279   - if (!jasmine.isSpy(this.actual)) {
1280   - throw new Error('Expected a spy, but got ' + jasmine.pp(this.actual) + '.');
1281   - }
1282   -
1283   - this.message = function() {
1284   - return [
1285   - "Expected spy " + this.actual.identity + " to not have been called.",
1286   - "Expected spy " + this.actual.identity + " to have been called."
1287   - ];
1288   - };
1289   -
1290   - return !this.actual.wasCalled;
1291   -};
1292   -
1293   -/**
1294   - * Matcher that checks to see if the actual, a Jasmine spy, was called with a set of parameters.
1295   - *
1296   - * @example
1297   - *
1298   - */
1299   -jasmine.Matchers.prototype.toHaveBeenCalledWith = function() {
1300   - var expectedArgs = jasmine.util.argsToArray(arguments);
1301   - if (!jasmine.isSpy(this.actual)) {
1302   - throw new Error('Expected a spy, but got ' + jasmine.pp(this.actual) + '.');
1303   - }
1304   - this.message = function() {
1305   - if (this.actual.callCount == 0) {
1306   - // todo: what should the failure message for .not.toHaveBeenCalledWith() be? is this right? test better. [xw]
1307   - return [
1308   - "Expected spy to have been called with " + jasmine.pp(expectedArgs) + " but it was never called.",
1309   - "Expected spy not to have been called with " + jasmine.pp(expectedArgs) + " but it was."
1310   - ];
1311   - } else {
1312   - return [
1313   - "Expected spy to have been called with " + jasmine.pp(expectedArgs) + " but was called with " + jasmine.pp(this.actual.argsForCall),
1314   - "Expected spy not to have been called with " + jasmine.pp(expectedArgs) + " but was called with " + jasmine.pp(this.actual.argsForCall)
1315   - ];
1316   - }
1317   - };
1318   -
1319   - return this.env.contains_(this.actual.argsForCall, expectedArgs);
1320   -};
1321   -
1322   -/** @deprecated Use expect(xxx).toHaveBeenCalledWith() instead */
1323   -jasmine.Matchers.prototype.wasCalledWith = jasmine.Matchers.prototype.toHaveBeenCalledWith;
1324   -
1325   -/** @deprecated Use expect(xxx).not.toHaveBeenCalledWith() instead */
1326   -jasmine.Matchers.prototype.wasNotCalledWith = function() {
1327   - var expectedArgs = jasmine.util.argsToArray(arguments);
1328   - if (!jasmine.isSpy(this.actual)) {
1329   - throw new Error('Expected a spy, but got ' + jasmine.pp(this.actual) + '.');
1330   - }
1331   -
1332   - this.message = function() {
1333   - return [
1334   - "Expected spy not to have been called with " + jasmine.pp(expectedArgs) + " but it was",
1335   - "Expected spy to have been called with " + jasmine.pp(expectedArgs) + " but it was"
1336   - ]
1337   - };
1338   -
1339   - return !this.env.contains_(this.actual.argsForCall, expectedArgs);
1340   -};
1341   -
1342   -/**
1343   - * Matcher that checks that the expected item is an element in the actual Array.
1344   - *
1345   - * @param {Object} expected
1346   - */
1347   -jasmine.Matchers.prototype.toContain = function(expected) {
1348   - return this.env.contains_(this.actual, expected);
1349   -};
1350   -
1351   -/**
1352   - * Matcher that checks that the expected item is NOT an element in the actual Array.
1353   - *
1354   - * @param {Object} expected
1355   - * @deprecated as of 1.0. Use not.toNotContain() instead.
1356   - */
1357   -jasmine.Matchers.prototype.toNotContain = function(expected) {
1358   - return !this.env.contains_(this.actual, expected);
1359   -};
1360   -
1361   -jasmine.Matchers.prototype.toBeLessThan = function(expected) {
1362   - return this.actual < expected;
1363   -};
1364   -
1365   -jasmine.Matchers.prototype.toBeGreaterThan = function(expected) {
1366   - return this.actual > expected;
1367   -};
1368   -
1369   -/**
1370   - * Matcher that checks that the expected exception was thrown by the actual.
1371   - *
1372   - * @param {String} expected
1373   - */
1374   -jasmine.Matchers.prototype.toThrow = function(expected) {
1375   - var result = false;
1376   - var exception;
1377   - if (typeof this.actual != 'function') {
1378   - throw new Error('Actual is not a function');
1379   - }
1380   - try {
1381   - this.actual();
1382   - } catch (e) {
1383   - exception = e;
1384   - }
1385   - if (exception) {
1386   - result = (expected === jasmine.undefined || this.env.equals_(exception.message || exception, expected.message || expected));
1387   - }
1388   -
1389   - var not = this.isNot ? "not " : "";
1390   -
1391   - this.message = function() {
1392   - if (exception && (expected === jasmine.undefined || !this.env.equals_(exception.message || exception, expected.message || expected))) {
1393   - return ["Expected function " + not + "to throw", expected ? expected.message || expected : " an exception", ", but it threw", exception.message || exception].join(' ');
1394   - } else {
1395   - return "Expected function to throw an exception.";
1396   - }
1397   - };
1398   -
1399   - return result;
1400   -};
1401   -
1402   -jasmine.Matchers.Any = function(expectedClass) {
1403   - this.expectedClass = expectedClass;
1404   -};
1405   -
1406   -jasmine.Matchers.Any.prototype.matches = function(other) {
1407   - if (this.expectedClass == String) {
1408   - return typeof other == 'string' || other instanceof String;
1409   - }
1410   -
1411   - if (this.expectedClass == Number) {
1412   - return typeof other == 'number' || other instanceof Number;
1413   - }
1414   -
1415   - if (this.expectedClass == Function) {
1416   - return typeof other == 'function' || other instanceof Function;
1417   - }
1418   -
1419   - if (this.expectedClass == Object) {
1420   - return typeof other == 'object';
1421   - }
1422   -
1423   - return other instanceof this.expectedClass;
1424   -};
1425   -
1426   -jasmine.Matchers.Any.prototype.toString = function() {
1427   - return '<jasmine.any(' + this.expectedClass + ')>';
1428   -};
1429   -
1430   -/**
1431   - * @constructor
1432   - */
1433   -jasmine.MultiReporter = function() {
1434   - this.subReporters_ = [];
1435   -};
1436   -jasmine.util.inherit(jasmine.MultiReporter, jasmine.Reporter);
1437   -
1438   -jasmine.MultiReporter.prototype.addReporter = function(reporter) {
1439   - this.subReporters_.push(reporter);
1440   -};
1441   -
1442   -(function() {
1443   - var functionNames = [
1444   - "reportRunnerStarting",
1445   - "reportRunnerResults",
1446   - "reportSuiteResults",
1447   - "reportSpecStarting",
1448   - "reportSpecResults",
1449   - "log"
1450   - ];
1451   - for (var i = 0; i < functionNames.length; i++) {
1452   - var functionName = functionNames[i];
1453   - jasmine.MultiReporter.prototype[functionName] = (function(functionName) {
1454   - return function() {
1455   - for (var j = 0; j < this.subReporters_.length; j++) {
1456   - var subReporter = this.subReporters_[j];
1457   - if (subReporter[functionName]) {
1458   - subReporter[functionName].apply(subReporter, arguments);
1459   - }
1460   - }
1461   - };
1462   - })(functionName);
1463   - }
1464   -})();
1465   -/**
1466   - * Holds results for a set of Jasmine spec. Allows for the results array to hold another jasmine.NestedResults
1467   - *
1468   - * @constructor
1469   - */
1470   -jasmine.NestedResults = function() {
1471   - /**
1472   - * The total count of results
1473   - */
1474   - this.totalCount = 0;
1475   - /**
1476   - * Number of passed results
1477   - */
1478   - this.passedCount = 0;
1479   - /**
1480   - * Number of failed results
1481   - */
1482   - this.failedCount = 0;
1483   - /**
1484   - * Was this suite/spec skipped?
1485   - */
1486   - this.skipped = false;
1487   - /**
1488   - * @ignore
1489   - */
1490   - this.items_ = [];
1491   -};
1492   -
1493   -/**
1494   - * Roll up the result counts.
1495   - *
1496   - * @param result
1497   - */
1498   -jasmine.NestedResults.prototype.rollupCounts = function(result) {
1499   - this.totalCount += result.totalCount;
1500   - this.passedCount += result.passedCount;
1501   - this.failedCount += result.failedCount;
1502   -};
1503   -
1504   -/**
1505   - * Adds a log message.
1506   - * @param values Array of message parts which will be concatenated later.
1507   - */
1508   -jasmine.NestedResults.prototype.log = function(values) {
1509   - this.items_.push(new jasmine.MessageResult(values));
1510   -};
1511   -
1512   -/**
1513   - * Getter for the results: message & results.
1514   - */
1515   -jasmine.NestedResults.prototype.getItems = function() {
1516   - return this.items_;
1517   -};
1518   -
1519   -/**
1520   - * Adds a result, tracking counts (total, passed, & failed)
1521   - * @param {jasmine.ExpectationResult|jasmine.NestedResults} result
1522   - */
1523   -jasmine.NestedResults.prototype.addResult = function(result) {
1524   - if (result.type != 'log') {
1525   - if (result.items_) {
1526   - this.rollupCounts(result);
1527   - } else {
1528   - this.totalCount++;
1529   - if (result.passed()) {
1530   - this.passedCount++;
1531   - } else {
1532   - this.failedCount++;
1533   - }
1534   - }
1535   - }
1536   - this.items_.push(result);
1537   -};
1538   -
1539   -/**
1540   - * @returns {Boolean} True if <b>everything</b> below passed
1541   - */
1542   -jasmine.NestedResults.prototype.passed = function() {
1543   - return this.passedCount === this.totalCount;
1544   -};
1545   -/**
1546   - * Base class for pretty printing for expectation results.
1547   - */
1548   -jasmine.PrettyPrinter = function() {
1549   - this.ppNestLevel_ = 0;
1550   -};
1551   -
1552   -/**
1553   - * Formats a value in a nice, human-readable string.
1554   - *
1555   - * @param value
1556   - */
1557   -jasmine.PrettyPrinter.prototype.format = function(value) {
1558   - if (this.ppNestLevel_ > 40) {
1559   - throw new Error('jasmine.PrettyPrinter: format() nested too deeply!');
1560   - }
1561   -
1562   - this.ppNestLevel_++;
1563   - try {
1564   - if (value === jasmine.undefined) {
1565   - this.emitScalar('undefined');
1566   - } else if (value === null) {
1567   - this.emitScalar('null');
1568   - } else if (value === jasmine.getGlobal()) {
1569   - this.emitScalar('<global>');
1570   - } else if (value instanceof jasmine.Matchers.Any) {
1571   - this.emitScalar(value.toString());
1572   - } else if (typeof value === 'string') {
1573   - this.emitString(value);
1574   - } else if (jasmine.isSpy(value)) {
1575   - this.emitScalar("spy on " + value.identity);
1576   - } else if (value instanceof RegExp) {
1577   - this.emitScalar(value.toString());
1578   - } else if (typeof value === 'function') {
1579   - this.emitScalar('Function');
1580   - } else if (typeof value.nodeType === 'number') {
1581   - this.emitScalar('HTMLNode');
1582   - } else if (value instanceof Date) {
1583   - this.emitScalar('Date(' + value + ')');
1584   - } else if (value.__Jasmine_been_here_before__) {
1585   - this.emitScalar('<circular reference: ' + (jasmine.isArray_(value) ? 'Array' : 'Object') + '>');
1586   - } else if (jasmine.isArray_(value) || typeof value == 'object') {
1587   - value.__Jasmine_been_here_before__ = true;
1588   - if (jasmine.isArray_(value)) {
1589   - this.emitArray(value);
1590   - } else {
1591   - this.emitObject(value);
1592   - }
1593   - delete value.__Jasmine_been_here_before__;
1594   - } else {
1595   - this.emitScalar(value.toString());
1596   - }
1597   - } finally {
1598   - this.ppNestLevel_--;
1599   - }
1600   -};
1601   -
1602   -jasmine.PrettyPrinter.prototype.iterateObject = function(obj, fn) {
1603   - for (var property in obj) {
1604   - if (property == '__Jasmine_been_here_before__') continue;
1605   - fn(property, obj.__lookupGetter__ ? (obj.__lookupGetter__(property) != null) : false);
1606   - }
1607   -};
1608   -
1609   -jasmine.PrettyPrinter.prototype.emitArray = jasmine.unimplementedMethod_;
1610   -jasmine.PrettyPrinter.prototype.emitObject = jasmine.unimplementedMethod_;
1611   -jasmine.PrettyPrinter.prototype.emitScalar = jasmine.unimplementedMethod_;
1612   -jasmine.PrettyPrinter.prototype.emitString = jasmine.unimplementedMethod_;
1613   -
1614   -jasmine.StringPrettyPrinter = function() {
1615   - jasmine.PrettyPrinter.call(this);
1616   -
1617   - this.string = '';
1618   -};
1619   -jasmine.util.inherit(jasmine.StringPrettyPrinter, jasmine.PrettyPrinter);
1620   -
1621   -jasmine.StringPrettyPrinter.prototype.emitScalar = function(value) {
1622   - this.append(value);
1623   -};
1624   -
1625   -jasmine.StringPrettyPrinter.prototype.emitString = function(value) {
1626   - this.append("'" + value + "'");
1627   -};
1628   -
1629   -jasmine.StringPrettyPrinter.prototype.emitArray = function(array) {
1630   - this.append('[ ');
1631   - for (var i = 0; i < array.length; i++) {
1632   - if (i > 0) {
1633   - this.append(', ');
1634   - }
1635   - this.format(array[i]);
1636   - }
1637   - this.append(' ]');
1638   -};
1639   -
1640   -jasmine.StringPrettyPrinter.prototype.emitObject = function(obj) {
1641   - var self = this;
1642   - this.append('{ ');
1643   - var first = true;
1644   -
1645   - this.iterateObject(obj, function(property, isGetter) {
1646   - if (first) {
1647   - first = false;
1648   - } else {
1649   - self.append(', ');
1650   - }
1651   -
1652   - self.append(property);
1653   - self.append(' : ');
1654   - if (isGetter) {
1655   - self.append('<getter>');
1656   - } else {
1657   - self.format(obj[property]);
1658   - }
1659   - });
1660   -
1661   - this.append(' }');
1662   -};
1663   -
1664   -jasmine.StringPrettyPrinter.prototype.append = function(value) {
1665   - this.string += value;
1666   -};
1667   -jasmine.Queue = function(env) {
1668   - this.env = env;
1669   - this.blocks = [];
1670   - this.running = false;
1671   - this.index = 0;
1672   - this.offset = 0;
1673   - this.abort = false;
1674   -};
1675   -
1676   -jasmine.Queue.prototype.addBefore = function(block) {
1677   - this.blocks.unshift(block);
1678   -};
1679   -
1680   -jasmine.Queue.prototype.add = function(block) {
1681   - this.blocks.push(block);
1682   -};
1683   -
1684   -jasmine.Queue.prototype.insertNext = function(block) {
1685   - this.blocks.splice((this.index + this.offset + 1), 0, block);
1686   - this.offset++;
1687   -};
1688   -
1689   -jasmine.Queue.prototype.start = function(onComplete) {
1690   - this.running = true;
1691   - this.onComplete = onComplete;
1692   - this.next_();
1693   -};
1694   -
1695   -jasmine.Queue.prototype.isRunning = function() {
1696   - return this.running;
1697   -};
1698   -
1699   -jasmine.Queue.LOOP_DONT_RECURSE = true;
1700   -
1701   -jasmine.Queue.prototype.next_ = function() {
1702   - var self = this;
1703   - var goAgain = true;
1704   -
1705   - while (goAgain) {
1706   - goAgain = false;
1707   -
1708   - if (self.index < self.blocks.length && !this.abort) {
1709   - var calledSynchronously = true;
1710   - var completedSynchronously = false;
1711   -
1712   - var onComplete = function () {
1713   - if (jasmine.Queue.LOOP_DONT_RECURSE && calledSynchronously) {
1714   - completedSynchronously = true;
1715   - return;
1716   - }
1717   -
1718   - if (self.blocks[self.index].abort) {
1719   - self.abort = true;
1720   - }
1721   -
1722   - self.offset = 0;
1723   - self.index++;
1724   -
1725   - var now = new Date().getTime();
1726   - if (self.env.updateInterval && now - self.env.lastUpdate > self.env.updateInterval) {
1727   - self.env.lastUpdate = now;
1728   - self.env.setTimeout(function() {
1729   - self.next_();
1730   - }, 0);
1731   - } else {
1732   - if (jasmine.Queue.LOOP_DONT_RECURSE && completedSynchronously) {
1733   - goAgain = true;
1734   - } else {
1735   - self.next_();
1736   - }
1737   - }
1738   - };
1739   - self.blocks[self.index].execute(onComplete);
1740   -
1741   - calledSynchronously = false;
1742   - if (completedSynchronously) {
1743   - onComplete();
1744   - }
1745   -
1746   - } else {
1747   - self.running = false;
1748   - if (self.onComplete) {
1749   - self.onComplete();
1750   - }
1751   - }
1752   - }
1753   -};
1754   -
1755   -jasmine.Queue.prototype.results = function() {
1756   - var results = new jasmine.NestedResults();
1757   - for (var i = 0; i < this.blocks.length; i++) {
1758   - if (this.blocks[i].results) {
1759   - results.addResult(this.blocks[i].results());
1760   - }
1761   - }
1762   - return results;
1763   -};
1764   -
1765   -
1766   -/**
1767   - * Runner
1768   - *
1769   - * @constructor
1770   - * @param {jasmine.Env} env
1771   - */
1772   -jasmine.Runner = function(env) {
1773   - var self = this;
1774   - self.env = env;
1775   - self.queue = new jasmine.Queue(env);
1776   - self.before_ = [];
1777   - self.after_ = [];
1778   - self.suites_ = [];
1779   -};
1780   -
1781   -jasmine.Runner.prototype.execute = function() {
1782   - var self = this;
1783   - if (self.env.reporter.reportRunnerStarting) {
1784   - self.env.reporter.reportRunnerStarting(this);
1785   - }
1786   - self.queue.start(function () {
1787   - self.finishCallback();
1788   - });
1789   -};
1790   -
1791   -jasmine.Runner.prototype.beforeEach = function(beforeEachFunction) {
1792   - beforeEachFunction.typeName = 'beforeEach';
1793   - this.before_.splice(0,0,beforeEachFunction);
1794   -};
1795   -
1796   -jasmine.Runner.prototype.afterEach = function(afterEachFunction) {
1797   - afterEachFunction.typeName = 'afterEach';
1798   - this.after_.splice(0,0,afterEachFunction);
1799   -};
1800   -
1801   -
1802   -jasmine.Runner.prototype.finishCallback = function() {
1803   - this.env.reporter.reportRunnerResults(this);
1804   -};
1805   -
1806   -jasmine.Runner.prototype.addSuite = function(suite) {
1807   - this.suites_.push(suite);
1808   -};
1809   -
1810   -jasmine.Runner.prototype.add = function(block) {
1811   - if (block instanceof jasmine.Suite) {
1812   - this.addSuite(block);
1813   - }
1814   - this.queue.add(block);
1815   -};
1816   -
1817   -jasmine.Runner.prototype.specs = function () {
1818   - var suites = this.suites();
1819   - var specs = [];
1820   - for (var i = 0; i < suites.length; i++) {
1821   - specs = specs.concat(suites[i].specs());
1822   - }
1823   - return specs;
1824   -};
1825   -
1826   -jasmine.Runner.prototype.suites = function() {
1827   - return this.suites_;
1828   -};
1829   -
1830   -jasmine.Runner.prototype.topLevelSuites = function() {
1831   - var topLevelSuites = [];
1832   - for (var i = 0; i < this.suites_.length; i++) {
1833   - if (!this.suites_[i].parentSuite) {
1834   - topLevelSuites.push(this.suites_[i]);
1835   - }
1836   - }
1837   - return topLevelSuites;
1838   -};
1839   -
1840   -jasmine.Runner.prototype.results = function() {
1841   - return this.queue.results();
1842   -};
1843   -/**
1844   - * Internal representation of a Jasmine specification, or test.
1845   - *
1846   - * @constructor
1847   - * @param {jasmine.Env} env
1848   - * @param {jasmine.Suite} suite
1849   - * @param {String} description
1850   - */
1851   -jasmine.Spec = function(env, suite, description) {
1852   - if (!env) {
1853   - throw new Error('jasmine.Env() required');
1854   - }
1855   - if (!suite) {
1856   - throw new Error('jasmine.Suite() required');
1857   - }
1858   - var spec = this;
1859   - spec.id = env.nextSpecId ? env.nextSpecId() : null;
1860   - spec.env = env;
1861   - spec.suite = suite;
1862   - spec.description = description;
1863   - spec.queue = new jasmine.Queue(env);
1864   -
1865   - spec.afterCallbacks = [];
1866   - spec.spies_ = [];
1867   -
1868   - spec.results_ = new jasmine.NestedResults();
1869   - spec.results_.description = description;
1870   - spec.matchersClass = null;
1871   -};
1872   -
1873   -jasmine.Spec.prototype.getFullName = function() {
1874   - return this.suite.getFullName() + ' ' + this.description + '.';
1875   -};
1876   -
1877   -
1878   -jasmine.Spec.prototype.results = function() {
1879   - return this.results_;
1880   -};
1881   -
1882   -/**
1883   - * All parameters are pretty-printed and concatenated together, then written to the spec's output.
1884   - *
1885   - * Be careful not to leave calls to <code>jasmine.log</code> in production code.
1886   - */
1887   -jasmine.Spec.prototype.log = function() {
1888   - return this.results_.log(arguments);
1889   -};
1890   -
1891   -jasmine.Spec.prototype.runs = function (func) {
1892   - var block = new jasmine.Block(this.env, func, this);
1893   - this.addToQueue(block);
1894   - return this;
1895   -};
1896   -
1897   -jasmine.Spec.prototype.addToQueue = function (block) {
1898   - if (this.queue.isRunning()) {
1899   - this.queue.insertNext(block);
1900   - } else {
1901   - this.queue.add(block);
1902   - }
1903   -};
1904   -
1905   -/**
1906   - * @param {jasmine.ExpectationResult} result
1907   - */
1908   -jasmine.Spec.prototype.addMatcherResult = function(result) {
1909   - this.results_.addResult(result);
1910   -};
1911   -
1912   -jasmine.Spec.prototype.expect = function(actual) {
1913   - var positive = new (this.getMatchersClass_())(this.env, actual, this);
1914   - positive.not = new (this.getMatchersClass_())(this.env, actual, this, true);
1915   - return positive;
1916   -};
1917   -
1918   -/**
1919   - * Waits a fixed time period before moving to the next block.
1920   - *
1921   - * @deprecated Use waitsFor() instead
1922   - * @param {Number} timeout milliseconds to wait
1923   - */
1924   -jasmine.Spec.prototype.waits = function(timeout) {
1925   - var waitsFunc = new jasmine.WaitsBlock(this.env, timeout, this);
1926   - this.addToQueue(waitsFunc);
1927   - return this;
1928   -};
1929   -
1930   -/**
1931   - * Waits for the latchFunction to return true before proceeding to the next block.
1932   - *
1933   - * @param {Function} latchFunction
1934   - * @param {String} optional_timeoutMessage
1935   - * @param {Number} optional_timeout
1936   - */
1937   -jasmine.Spec.prototype.waitsFor = function(latchFunction, optional_timeoutMessage, optional_timeout) {
1938   - var latchFunction_ = null;
1939   - var optional_timeoutMessage_ = null;
1940   - var optional_timeout_ = null;
1941   -
1942   - for (var i = 0; i < arguments.length; i++) {
1943   - var arg = arguments[i];
1944   - switch (typeof arg) {
1945   - case 'function':
1946   - latchFunction_ = arg;
1947   - break;
1948   - case 'string':
1949   - optional_timeoutMessage_ = arg;
1950   - break;
1951   - case 'number':
1952   - optional_timeout_ = arg;
1953   - break;
1954   - }
1955   - }
1956   -
1957   - var waitsForFunc = new jasmine.WaitsForBlock(this.env, optional_timeout_, latchFunction_, optional_timeoutMessage_, this);
1958   - this.addToQueue(waitsForFunc);
1959   - return this;
1960   -};
1961   -
1962   -jasmine.Spec.prototype.fail = function (e) {
1963   - var expectationResult = new jasmine.ExpectationResult({
1964   - passed: false,
1965   - message: e ? jasmine.util.formatException(e) : 'Exception'
1966   - });
1967   - this.results_.addResult(expectationResult);
1968   -};
1969   -
1970   -jasmine.Spec.prototype.getMatchersClass_ = function() {
1971   - return this.matchersClass || this.env.matchersClass;
1972   -};
1973   -
1974   -jasmine.Spec.prototype.addMatchers = function(matchersPrototype) {
1975   - var parent = this.getMatchersClass_();
1976   - var newMatchersClass = function() {
1977   - parent.apply(this, arguments);
1978   - };
1979   - jasmine.util.inherit(newMatchersClass, parent);
1980   - jasmine.Matchers.wrapInto_(matchersPrototype, newMatchersClass);
1981   - this.matchersClass = newMatchersClass;
1982   -};
1983   -
1984   -jasmine.Spec.prototype.finishCallback = function() {
1985   - this.env.reporter.reportSpecResults(this);
1986   -};
1987   -
1988   -jasmine.Spec.prototype.finish = function(onComplete) {
1989   - this.removeAllSpies();
1990   - this.finishCallback();
1991   - if (onComplete) {
1992   - onComplete();
1993   - }
1994   -};
1995   -
1996   -jasmine.Spec.prototype.after = function(doAfter) {
1997   - if (this.queue.isRunning()) {
1998   - this.queue.add(new jasmine.Block(this.env, doAfter, this));
1999   - } else {
2000   - this.afterCallbacks.unshift(doAfter);
2001   - }
2002   -};
2003   -
2004   -jasmine.Spec.prototype.execute = function(onComplete) {
2005   - var spec = this;
2006   - if (!spec.env.specFilter(spec)) {
2007   - spec.results_.skipped = true;
2008   - spec.finish(onComplete);
2009   - return;
2010   - }
2011   -
2012   - this.env.reporter.reportSpecStarting(this);
2013   -
2014   - spec.env.currentSpec = spec;
2015   -
2016   - spec.addBeforesAndAftersToQueue();
2017   -
2018   - spec.queue.start(function () {
2019   - spec.finish(onComplete);
2020   - });
2021   -};
2022   -
2023   -jasmine.Spec.prototype.addBeforesAndAftersToQueue = function() {
2024   - var runner = this.env.currentRunner();
2025   - var i;
2026   -
2027   - for (var suite = this.suite; suite; suite = suite.parentSuite) {
2028   - for (i = 0; i < suite.before_.length; i++) {
2029   - this.queue.addBefore(new jasmine.Block(this.env, suite.before_[i], this));
2030   - }
2031   - }
2032   - for (i = 0; i < runner.before_.length; i++) {
2033   - this.queue.addBefore(new jasmine.Block(this.env, runner.before_[i], this));
2034   - }
2035   - for (i = 0; i < this.afterCallbacks.length; i++) {
2036   - this.queue.add(new jasmine.Block(this.env, this.afterCallbacks[i], this));
2037   - }
2038   - for (suite = this.suite; suite; suite = suite.parentSuite) {
2039   - for (i = 0; i < suite.after_.length; i++) {
2040   - this.queue.add(new jasmine.Block(this.env, suite.after_[i], this));
2041   - }
2042   - }
2043   - for (i = 0; i < runner.after_.length; i++) {
2044   - this.queue.add(new jasmine.Block(this.env, runner.after_[i], this));
2045   - }
2046   -};
2047   -
2048   -jasmine.Spec.prototype.explodes = function() {
2049   - throw 'explodes function should not have been called';
2050   -};
2051   -
2052   -jasmine.Spec.prototype.spyOn = function(obj, methodName, ignoreMethodDoesntExist) {
2053   - if (obj == jasmine.undefined) {
2054   - throw "spyOn could not find an object to spy upon for " + methodName + "()";
2055   - }
2056   -
2057   - if (!ignoreMethodDoesntExist && obj[methodName] === jasmine.undefined) {
2058   - throw methodName + '() method does not exist';
2059   - }
2060   -
2061   - if (!ignoreMethodDoesntExist && obj[methodName] && obj[methodName].isSpy) {
2062   - throw new Error(methodName + ' has already been spied upon');
2063   - }
2064   -
2065   - var spyObj = jasmine.createSpy(methodName);
2066   -
2067   - this.spies_.push(spyObj);
2068   - spyObj.baseObj = obj;
2069   - spyObj.methodName = methodName;
2070   - spyObj.originalValue = obj[methodName];
2071   -
2072   - obj[methodName] = spyObj;
2073   -
2074   - return spyObj;
2075   -};
2076   -
2077   -jasmine.Spec.prototype.removeAllSpies = function() {
2078   - for (var i = 0; i < this.spies_.length; i++) {
2079   - var spy = this.spies_[i];
2080   - spy.baseObj[spy.methodName] = spy.originalValue;
2081   - }
2082   - this.spies_ = [];
2083   -};
2084   -
2085   -/**
2086   - * Internal representation of a Jasmine suite.
2087   - *
2088   - * @constructor
2089   - * @param {jasmine.Env} env
2090   - * @param {String} description
2091   - * @param {Function} specDefinitions
2092   - * @param {jasmine.Suite} parentSuite
2093   - */
2094   -jasmine.Suite = function(env, description, specDefinitions, parentSuite) {
2095   - var self = this;
2096   - self.id = env.nextSuiteId ? env.nextSuiteId() : null;
2097   - self.description = description;
2098   - self.queue = new jasmine.Queue(env);
2099   - self.parentSuite = parentSuite;
2100   - self.env = env;
2101   - self.before_ = [];
2102   - self.after_ = [];
2103   - self.children_ = [];
2104   - self.suites_ = [];
2105   - self.specs_ = [];
2106   -};
2107   -
2108   -jasmine.Suite.prototype.getFullName = function() {
2109   - var fullName = this.description;
2110   - for (var parentSuite = this.parentSuite; parentSuite; parentSuite = parentSuite.parentSuite) {
2111   - fullName = parentSuite.description + ' ' + fullName;
2112   - }
2113   - return fullName;
2114   -};
2115   -
2116   -jasmine.Suite.prototype.finish = function(onComplete) {
2117   - this.env.reporter.reportSuiteResults(this);
2118   - this.finished = true;
2119   - if (typeof(onComplete) == 'function') {
2120   - onComplete();
2121   - }
2122   -};
2123   -
2124   -jasmine.Suite.prototype.beforeEach = function(beforeEachFunction) {
2125   - beforeEachFunction.typeName = 'beforeEach';
2126   - this.before_.unshift(beforeEachFunction);
2127   -};
2128   -
2129   -jasmine.Suite.prototype.afterEach = function(afterEachFunction) {
2130   - afterEachFunction.typeName = 'afterEach';
2131   - this.after_.unshift(afterEachFunction);
2132   -};
2133   -
2134   -jasmine.Suite.prototype.results = function() {
2135   - return this.queue.results();
2136   -};
2137   -
2138   -jasmine.Suite.prototype.add = function(suiteOrSpec) {
2139   - this.children_.push(suiteOrSpec);
2140   - if (suiteOrSpec instanceof jasmine.Suite) {
2141   - this.suites_.push(suiteOrSpec);
2142   - this.env.currentRunner().addSuite(suiteOrSpec);
2143   - } else {
2144   - this.specs_.push(suiteOrSpec);
2145   - }
2146   - this.queue.add(suiteOrSpec);
2147   -};
2148   -
2149   -jasmine.Suite.prototype.specs = function() {
2150   - return this.specs_;
2151   -};
2152   -
2153   -jasmine.Suite.prototype.suites = function() {
2154   - return this.suites_;
2155   -};
2156   -
2157   -jasmine.Suite.prototype.children = function() {
2158   - return this.children_;
2159   -};
2160   -
2161   -jasmine.Suite.prototype.execute = function(onComplete) {
2162   - var self = this;
2163   - this.queue.start(function () {
2164   - self.finish(onComplete);
2165   - });
2166   -};
2167   -jasmine.WaitsBlock = function(env, timeout, spec) {
2168   - this.timeout = timeout;
2169   - jasmine.Block.call(this, env, null, spec);
2170   -};
2171   -
2172   -jasmine.util.inherit(jasmine.WaitsBlock, jasmine.Block);
2173   -
2174   -jasmine.WaitsBlock.prototype.execute = function (onComplete) {
2175   - this.env.reporter.log('>> Jasmine waiting for ' + this.timeout + ' ms...');
2176   - this.env.setTimeout(function () {
2177   - onComplete();
2178   - }, this.timeout);
2179   -};
2180   -/**
2181   - * A block which waits for some condition to become true, with timeout.
2182   - *
2183   - * @constructor
2184   - * @extends jasmine.Block
2185   - * @param {jasmine.Env} env The Jasmine environment.
2186   - * @param {Number} timeout The maximum time in milliseconds to wait for the condition to become true.
2187   - * @param {Function} latchFunction A function which returns true when the desired condition has been met.
2188   - * @param {String} message The message to display if the desired condition hasn't been met within the given time period.
2189   - * @param {jasmine.Spec} spec The Jasmine spec.
2190   - */
2191   -jasmine.WaitsForBlock = function(env, timeout, latchFunction, message, spec) {
2192   - this.timeout = timeout || env.defaultTimeoutInterval;
2193   - this.latchFunction = latchFunction;
2194   - this.message = message;
2195   - this.totalTimeSpentWaitingForLatch = 0;
2196   - jasmine.Block.call(this, env, null, spec);
2197   -};
2198   -jasmine.util.inherit(jasmine.WaitsForBlock, jasmine.Block);
2199   -
2200   -jasmine.WaitsForBlock.TIMEOUT_INCREMENT = 10;
2201   -
2202   -jasmine.WaitsForBlock.prototype.execute = function(onComplete) {
2203   - this.env.reporter.log('>> Jasmine waiting for ' + (this.message || 'something to happen'));
2204   - var latchFunctionResult;
2205   - try {
2206   - latchFunctionResult = this.latchFunction.apply(this.spec);
2207   - } catch (e) {
2208   - this.spec.fail(e);
2209   - onComplete();
2210   - return;
2211   - }
2212   -
2213   - if (latchFunctionResult) {
2214   - onComplete();
2215   - } else if (this.totalTimeSpentWaitingForLatch >= this.timeout) {
2216   - var message = 'timed out after ' + this.timeout + ' msec waiting for ' + (this.message || 'something to happen');
2217   - this.spec.fail({
2218   - name: 'timeout',
2219   - message: message
2220   - });
2221   -
2222   - this.abort = true;
2223   - onComplete();
2224   - } else {
2225   - this.totalTimeSpentWaitingForLatch += jasmine.WaitsForBlock.TIMEOUT_INCREMENT;
2226   - var self = this;
2227   - this.env.setTimeout(function() {
2228   - self.execute(onComplete);
2229   - }, jasmine.WaitsForBlock.TIMEOUT_INCREMENT);
2230   - }
2231   -};
2232   -// Mock setTimeout, clearTimeout
2233   -// Contributed by Pivotal Computer Systems, www.pivotalsf.com
2234   -
2235   -jasmine.FakeTimer = function() {
2236   - this.reset();
2237   -
2238   - var self = this;
2239   - self.setTimeout = function(funcToCall, millis) {
2240   - self.timeoutsMade++;
2241   - self.scheduleFunction(self.timeoutsMade, funcToCall, millis, false);
2242   - return self.timeoutsMade;
2243   - };
2244   -
2245   - self.setInterval = function(funcToCall, millis) {
2246   - self.timeoutsMade++;
2247   - self.scheduleFunction(self.timeoutsMade, funcToCall, millis, true);
2248   - return self.timeoutsMade;
2249   - };
2250   -
2251   - self.clearTimeout = function(timeoutKey) {
2252   - self.scheduledFunctions[timeoutKey] = jasmine.undefined;
2253   - };
2254   -
2255   - self.clearInterval = function(timeoutKey) {
2256   - self.scheduledFunctions[timeoutKey] = jasmine.undefined;
2257   - };
2258   -
2259   -};
2260   -
2261   -jasmine.FakeTimer.prototype.reset = function() {
2262   - this.timeoutsMade = 0;
2263   - this.scheduledFunctions = {};
2264   - this.nowMillis = 0;
2265   -};
2266   -
2267   -jasmine.FakeTimer.prototype.tick = function(millis) {
2268   - var oldMillis = this.nowMillis;
2269   - var newMillis = oldMillis + millis;
2270   - this.runFunctionsWithinRange(oldMillis, newMillis);
2271   - this.nowMillis = newMillis;
2272   -};
2273   -
2274   -jasmine.FakeTimer.prototype.runFunctionsWithinRange = function(oldMillis, nowMillis) {
2275   - var scheduledFunc;
2276   - var funcsToRun = [];
2277   - for (var timeoutKey in this.scheduledFunctions) {
2278   - scheduledFunc = this.scheduledFunctions[timeoutKey];
2279   - if (scheduledFunc != jasmine.undefined &&
2280   - scheduledFunc.runAtMillis >= oldMillis &&
2281   - scheduledFunc.runAtMillis <= nowMillis) {
2282   - funcsToRun.push(scheduledFunc);
2283   - this.scheduledFunctions[timeoutKey] = jasmine.undefined;
2284   - }
2285   - }
2286   -
2287   - if (funcsToRun.length > 0) {
2288   - funcsToRun.sort(function(a, b) {
2289   - return a.runAtMillis - b.runAtMillis;
2290   - });
2291   - for (var i = 0; i < funcsToRun.length; ++i) {
2292   - try {
2293   - var funcToRun = funcsToRun[i];
2294   - this.nowMillis = funcToRun.runAtMillis;
2295   - funcToRun.funcToCall();
2296   - if (funcToRun.recurring) {
2297   - this.scheduleFunction(funcToRun.timeoutKey,
2298   - funcToRun.funcToCall,
2299   - funcToRun.millis,
2300   - true);
2301   - }
2302   - } catch(e) {
2303   - }
2304   - }
2305   - this.runFunctionsWithinRange(oldMillis, nowMillis);
2306   - }
2307   -};
2308   -
2309   -jasmine.FakeTimer.prototype.scheduleFunction = function(timeoutKey, funcToCall, millis, recurring) {
2310   - this.scheduledFunctions[timeoutKey] = {
2311   - runAtMillis: this.nowMillis + millis,
2312   - funcToCall: funcToCall,
2313   - recurring: recurring,
2314   - timeoutKey: timeoutKey,
2315   - millis: millis
2316   - };
2317   -};
2318   -
2319   -/**
2320   - * @namespace
2321   - */
2322   -jasmine.Clock = {
2323   - defaultFakeTimer: new jasmine.FakeTimer(),
2324   -
2325   - reset: function() {
2326   - jasmine.Clock.assertInstalled();
2327   - jasmine.Clock.defaultFakeTimer.reset();
2328   - },
2329   -
2330   - tick: function(millis) {
2331   - jasmine.Clock.assertInstalled();
2332   - jasmine.Clock.defaultFakeTimer.tick(millis);
2333   - },
2334   -
2335   - runFunctionsWithinRange: function(oldMillis, nowMillis) {
2336   - jasmine.Clock.defaultFakeTimer.runFunctionsWithinRange(oldMillis, nowMillis);
2337   - },
2338   -
2339   - scheduleFunction: function(timeoutKey, funcToCall, millis, recurring) {
2340   - jasmine.Clock.defaultFakeTimer.scheduleFunction(timeoutKey, funcToCall, millis, recurring);
2341   - },
2342   -
2343   - useMock: function() {
2344   - if (!jasmine.Clock.isInstalled()) {
2345   - var spec = jasmine.getEnv().currentSpec;
2346   - spec.after(jasmine.Clock.uninstallMock);
2347   -
2348   - jasmine.Clock.installMock();
2349   - }
2350   - },
2351   -
2352   - installMock: function() {
2353   - jasmine.Clock.installed = jasmine.Clock.defaultFakeTimer;
2354   - },
2355   -
2356   - uninstallMock: function() {
2357   - jasmine.Clock.assertInstalled();
2358   - jasmine.Clock.installed = jasmine.Clock.real;
2359   - },
2360   -
2361   - real: {
2362   - setTimeout: jasmine.getGlobal().setTimeout,
2363   - clearTimeout: jasmine.getGlobal().clearTimeout,
2364   - setInterval: jasmine.getGlobal().setInterval,
2365   - clearInterval: jasmine.getGlobal().clearInterval
2366   - },
2367   -
2368   - assertInstalled: function() {
2369   - if (!jasmine.Clock.isInstalled()) {
2370   - throw new Error("Mock clock is not installed, use jasmine.Clock.useMock()");
2371   - }
2372   - },
2373   -
2374   - isInstalled: function() {
2375   - return jasmine.Clock.installed == jasmine.Clock.defaultFakeTimer;
2376   - },
2377   -
2378   - installed: null
2379   -};
2380   -jasmine.Clock.installed = jasmine.Clock.real;
2381   -
2382   -//else for IE support
2383   -jasmine.getGlobal().setTimeout = function(funcToCall, millis) {
2384   - if (jasmine.Clock.installed.setTimeout.apply) {
2385   - return jasmine.Clock.installed.setTimeout.apply(this, arguments);
2386   - } else {
2387   - return jasmine.Clock.installed.setTimeout(funcToCall, millis);
2388   - }
2389   -};
2390   -
2391   -jasmine.getGlobal().setInterval = function(funcToCall, millis) {
2392   - if (jasmine.Clock.installed.setInterval.apply) {
2393   - return jasmine.Clock.installed.setInterval.apply(this, arguments);
2394   - } else {
2395   - return jasmine.Clock.installed.setInterval(funcToCall, millis);
2396   - }
2397   -};
2398   -
2399   -jasmine.getGlobal().clearTimeout = function(timeoutKey) {
2400   - if (jasmine.Clock.installed.clearTimeout.apply) {
2401   - return jasmine.Clock.installed.clearTimeout.apply(this, arguments);
2402   - } else {
2403   - return jasmine.Clock.installed.clearTimeout(timeoutKey);
2404   - }
2405   -};
2406   -
2407   -jasmine.getGlobal().clearInterval = function(timeoutKey) {
2408   - if (jasmine.Clock.installed.clearTimeout.apply) {
2409   - return jasmine.Clock.installed.clearInterval.apply(this, arguments);
2410   - } else {
2411   - return jasmine.Clock.installed.clearInterval(timeoutKey);
2412   - }
2413   -};
2414   -
2415   -
2416   -jasmine.version_= {
2417   - "major": 1,
2418   - "minor": 0,
2419   - "build": 0,
2420   - "revision": 1284494074
2421   -};
js/lib/sencha-jasmine/matchers/Controller.js deleted
... ... @@ -1,10 +0,0 @@
1   -/**
2   - * Sencha-specific matchers for convenient testing of Controller expectations
3   - */
4   -beforeEach(function() {
5   - this.addMatchers({
6   - toHaveRendered: function(expected) {
7   -
8   - }
9   - });
10   -});
11 0 \ No newline at end of file
js/lib/sencha-jasmine/matchers/Model.js deleted
... ... @@ -1,54 +0,0 @@
1   -/**
2   - * Sencha-specific matchers for convenient testing of Model expectations
3   - */
4   -beforeEach(function() {
5   - this.addMatchers({
6   - /**
7   - * Sample usage:
8   - * expect('User').toHaveMany('Product');
9   - */
10   - toHaveMany: function(expected) {
11   - if (typeof this.actual == 'string') {
12   - this.actual = Ext.ModelManager.types[this.actual].prototype;
13   - }
14   -
15   - var associations = this.actual.associations.items,
16   - length = associations.length,
17   - association, i;
18   -
19   - for (i = 0; i < length; i++) {
20   - association = associations[i];
21   -
22   - if (association.associatedName == expected && association.type == 'hasMany') {
23   - return true;
24   - }
25   - }
26   -
27   - return false;
28   - },
29   -
30   - /**
31   - * Sample usage:
32   - * expect('Product').toBelongTo('User')
33   - */
34   - toBelongTo: function(expected) {
35   - if (typeof this.actual == 'string') {
36   - this.actual = Ext.ModelManager.types[this.actual].prototype;
37   - }
38   -
39   - var associations = this.actual.associations.items,
40   - length = associations.length,
41   - association, i;
42   -
43   - for (i = 0; i < length; i++) {
44   - association = associations[i];
45   -
46   - if (association.associatedName == expected && association.type == 'belongsTo') {
47   - return true;
48   - }
49   - }
50   -
51   - return false;
52   - }
53   - });
54   -});
55 0 \ No newline at end of file
js/lib/sencha-jasmine/sencha-jasmine.css deleted
... ... @@ -1,226 +0,0 @@
1   -body {
2   - font-family:"Helvetica Neue Light", "Lucida Grande", "Calibri", "Arial", sans-serif;
3   - margin:0;
4   -}
5   -
6   -.jasmine_reporter > * {
7   - margin:10px;
8   -}
9   -
10   -.run_spec {
11   - float:right;
12   - font-size:10px;
13   -}
14   -
15   -/*banner*/
16   -.banner {
17   - position:relative;
18   - background:#fff;
19   - -webkit-box-shadow:0 0 10px #ccc;
20   - padding:4px 0 6px 6px;
21   - margin:0 0 10px 0;
22   -}
23   -.banner .logo {
24   - width:120px;
25   - height:50px;
26   -
27   - background:url(http://www.sencha.com/assets/images/logo-sencha-sm.png) no-repeat;
28   -}
29   -.banner .options {
30   - position:absolute;
31   - top:3px;
32   - right:3px;
33   - color:#666;
34   - font-size:10px;
35   -}
36   -.banner .options .show {
37   - text-align:right;
38   -}
39   -.banner .options .show > * {
40   - display:inline-block;
41   -}
42   -.banner .options .show label {
43   - margin-right:3px;
44   -}
45   -
46   -/*runner*/
47   -.runner,
48   -.suite {
49   - display:block;
50   -
51   - text-shadow:0 1px 0 #fff;
52   -
53   - border:1px solid #bbb;
54   - border-radius:5px;
55   - -moz-border-radius:5px;
56   - -webkit-border-radius:5px;
57   -
58   - background:-webkit-gradient(linear, left top, left bottom, from(#eee), to(#d1d1d1));
59   -
60   - -webkit-box-shadow:0 0 10px #ccc;
61   -
62   - padding:6px;
63   -}
64   -.runner a,
65   -.suite a {
66   - display:inline-block;
67   -
68   - color:#eee;
69   - font-size:11px;
70   - text-decoration:none;
71   - text-shadow:0 -1px 0 #000;
72   -
73   - border:1px solid #111;
74   - border-radius:5px;
75   - -moz-border-radius:5px;
76   - -webkit-border-radius:5px;
77   -
78   - background:-webkit-gradient(linear, left top, left bottom, from(#555), to(#212121));
79   -
80   - -webkit-background-clip: padding-box;
81   -
82   - padding:1px 4px 2px 4px;
83   -}
84   -.runner .finished-at {
85   - font-size:10px;
86   -
87   - padding-top:1px;
88   - padding-left:6px;
89   -}
90   -
91   -.runner.running {
92   - text-shadow:0 1px 0 #EDECCA;
93   -
94   - border-color:#D1CF84;
95   -
96   - background:-webkit-gradient(linear, left top, left bottom, from(#EDE613), to(#DBD61F));
97   -}
98   -.runner.running a {
99   - display:none;
100   -}
101   -
102   -.runner.failed a,
103   -.suite.failed a {
104   - border-color:#660000;
105   -
106   - background:-webkit-gradient(linear, left top, left bottom, from(#dd0000), to(#880000));
107   -}
108   -
109   -.runner.passed a,
110   -.suite.passed a {
111   - border-color:#006600;
112   -
113   - background:-webkit-gradient(linear, left top, left bottom, from(#00aa00), to(#006600));
114   -}
115   -
116   -/*suite*/
117   -.suite a.run_spec {
118   - display:none;
119   -}
120   -.suite > a.description {
121   - color:#000;
122   - font-size:18px;
123   - text-shadow:0 1px 0 #fff;
124   -
125   - border:0;
126   - background:transparent;
127   -}
128   -.suite .suite > a.description {
129   - font-size:14px;
130   -}
131   -.suite.failed {
132   - border-color:#E0C1C5;
133   -
134   - background:-webkit-gradient(linear, left top, left bottom, from(#FFF7F8), to(#F0DADD));
135   -}
136   -.suite.failed a.description {
137   - color:#440000;
138   -}
139   -.suite .suite {
140   - margin:5px;
141   -}
142   -
143   -/*spec*/
144   -.spec {
145   - margin: 5px;
146   - padding-left: 1em;
147   - clear: both;
148   -
149   - border:1px solid #ccc;
150   - border-radius:5px;
151   - -moz-border-radius:5px;
152   - -webkit-border-radius:5px;
153   -
154   - background:#fff;
155   -
156   - -webkit-box-shadow:inset 0 0 10px #ddd;
157   -
158   - -webkit-background-clip:padding-box;
159   -
160   - padding:10px;
161   -}
162   -.spec a.description {
163   - display:block;
164   -
165   - border:0;
166   -
167   - background:transparent;
168   -
169   - padding:0;
170   -
171   - color:#000 !important;
172   - font-size:16px;
173   - text-shadow:none;
174   -}
175   -.spec .messages {
176   - border:1px dashed #ccc;
177   - border-radius:5px;
178   - -moz-border-radius:5px;
179   - -webkit-border-radius:5px;
180   -
181   - background:#f1f1f1;
182   -
183   - margin:10px 0 0 0;
184   - padding:5px;
185   -
186   - font-size:11px;
187   - line-height:15px;
188   -}
189   -
190   -.passed,
191   -.skipped {
192   - display:none;
193   -}
194   -
195   -.runner.passed,
196   -.runner.skipped {
197   - display:block;
198   -}
199   -
200   -.suite.passed {
201   - border-color:#AEBFA6;
202   -
203   - background:-webkit-gradient(linear, left top, left bottom, from(#ECF2E9), to(#C8DBBF));
204   -}
205   -
206   -.show-passed .passed,
207   -.show-skipped .skipped {
208   - display:block;
209   -}
210   -
211   -.stackTrace {
212   - white-space: pre;
213   - font-size: .8em;
214   - margin-left: 10px;
215   - max-height: 5em;
216   - overflow: auto;
217   - border: 1px inset red;
218   - padding: 1em;
219   - background: #eef;
220   -}
221   -
222   -
223   -#jasmine_content {
224   - position:fixed;
225   - right: 100%;
226   -}
227 0 \ No newline at end of file
js/lib/sencha-jasmine/sencha-jasmine.js deleted
... ... @@ -1,88 +0,0 @@
1   -jasmine.TrivialReporter.prototype.reportRunnerStarting = function(runner) {
2   - var showPassed, showSkipped;
3   -
4   - this.outerDiv = this.createDom('div', { className: 'jasmine_reporter' },
5   - this.createDom('div', { className: 'banner' },
6   - this.createDom('div', { className: 'logo' }),
7   - this.createDom('div', { className: 'options' },
8   - this.createDom('div', { className: 'show' },
9   - this.createDom('label', { "for": "__jasmine_TrivialReporter_showPassed__" }, " passed "),
10   - showPassed = this.createDom('input', { id: "__jasmine_TrivialReporter_showPassed__", type: 'checkbox' })
11   - ),
12   - this.createDom('div', { className: 'show' },
13   - this.createDom('label', { "for": "__jasmine_TrivialReporter_showSkipped__" }, " skipped"),
14   - showSkipped = this.createDom('input', { id: "__jasmine_TrivialReporter_showSkipped__", type: 'checkbox' })
15   - ),
16   - this.createDom('div', { className: 'show' },
17   - this.createDom('label', { "for": "__jasmine_TrivialReporter_automaticReload__" }," automatic reload"),
18   - automaticReload = this.createDom('input',
19   - (window.location.hash == "#reload") ? {id: "__jasmine_TrivialReporter_automaticReload__", type: 'checkbox', checked: true } : {id: "__jasmine_TrivialReporter_automaticReload__", type: 'checkbox'}
20   - )
21   - )
22   - )
23   - ),
24   -
25   - this.runnerDiv = this.createDom('div', { className: 'runner running' },
26   - this.createDom('a', { className: 'run_spec', href: '?' }, "run all"),
27   - this.runnerMessageSpan = this.createDom('span', {}, "Running..."),
28   - this.finishedAtSpan = this.createDom('span', { className: 'finished-at' }, ""))
29   - );
30   -
31   - this.document.body.appendChild(this.outerDiv);
32   -
33   - var suites = runner.suites();
34   - for (var i = 0; i < suites.length; i++) {
35   - var suite = suites[i];
36   - var suiteDiv = this.createDom('div', { className: 'suite' },
37   - this.createDom('a', { className: 'run_spec', href: '?spec=' + encodeURIComponent(suite.getFullName()) }, "run"),
38   - this.createDom('a', { className: 'description', href: '?spec=' + encodeURIComponent(suite.getFullName()) }, suite.description));
39   - this.suiteDivs[suite.id] = suiteDiv;
40   - var parentDiv = this.outerDiv;
41   - if (suite.parentSuite) {
42   - parentDiv = this.suiteDivs[suite.parentSuite.id];
43   - }
44   - parentDiv.appendChild(suiteDiv);
45   - }
46   -
47   - this.startedAt = new Date();
48   -
49   - var self = this;
50   - showPassed.onchange = function(evt) {
51   - if (evt.target.checked) {
52   - self.outerDiv.className += ' show-passed';
53   - } else {
54   - self.outerDiv.className = self.outerDiv.className.replace(/ show-passed/, '');
55   - }
56   - };
57   -
58   - showSkipped.onchange = function(evt) {
59   - if (evt.target.checked) {
60   - self.outerDiv.className += ' show-skipped';
61   - } else {
62   - self.outerDiv.className = self.outerDiv.className.replace(/ show-skipped/, '');
63   - }
64   - };
65   -
66   - automaticReload.onchange = function(evt) {
67   - if (evt.target.checked) {
68   - window.location.hash = "#reload";
69   - window.location.reload();
70   - } else {
71   - window.location.hash = "";
72   - window.location.reload();
73   - }
74   - };
75   -};
76   -
77   -if (window.location.hash == "#reload") {
78   - var interval = setInterval(function() {
79   - var isRunning = jasmine.getEnv().currentRunner_.queue.isRunning();
80   - if (!isRunning) {
81   - clearInterval(interval);
82   -
83   - setTimeout(function() {
84   - window.location.reload();
85   - }, 5000);
86   - };
87   - }, 1500);
88   -};
89 0 \ No newline at end of file
js/test/unit/.htaccess deleted
... ... @@ -1,2 +0,0 @@
1   -ExpiresActive On
2   -ExpiresDefault "access"
3 0 \ No newline at end of file
js/test/unit/SpecOptions.js deleted
... ... @@ -1,9 +0,0 @@
1   -/**
2   - * This file is included by your test/unit/index.html file and is used to apply settings before
3   - * the tests are run.
4   - */
5   -
6   -Ext.ns('fixtures');
7   -
8   -//Stops the Application from being booted up automatically
9   -Ext.Application.prototype.bindReady = Ext.emptyFn;
js/test/unit/index.html deleted
... ... @@ -1,69 +0,0 @@
1   -<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
2   - "http://www.w3.org/TR/html4/loose.dtd">
3   -<html>
4   -<head>
5   - <title>Sencha - Jasmine Test Runner</title>
6   - <link rel="stylesheet" type="text/css" href="../../lib/sencha-jasmine/sencha-jasmine.css" />
7   -
8   - <script type="text/javascript" src="../../lib/touch/ext-touch-debug.js"></script>
9   -
10   - <script type="text/javascript" src="../../lib/jasmine/jasmine.js"></script>
11   - <script type="text/javascript" src="../../lib/jasmine/jasmine-html.js"></script>
12   - <script type="text/javascript" src="../../lib/sencha-jasmine/sencha-jasmine.js"></script>
13   - <script type="text/javascript" src="../../lib/sencha-jasmine/matchers/Model.js"></script>
14   - <script type="text/javascript" src="../../lib/sencha-jasmine/matchers/Controller.js"></script>
15   -
16   - <script type="text/javascript" src="SpecOptions.js"></script>
17   -</head>
18   -<body>
19   -
20   - <!-- include source files here... -->
21   - <div id="sourceFiles">
22   - <script type="text/javascript" src="../../app/app.js"></script>
23   -
24   - <div id="app-models">
25   -
26   - </div>
27   -
28   - <div id="app-controllers">
29   -
30   - </div>
31   -
32   - <div id="app-views">
33   -
34   - </div>
35   -
36   - <div id="app-stores">
37   -
38   - </div>
39   - </div>
40   -
41   - <!-- include fixture files here -->
42   - <div id="fixtures">
43   -
44   - </div>
45   -
46   - <!-- include spec files here... -->
47   - <div id="specFiles">
48   - <script type="text/javascript" src="app.js"></script>
49   -
50   - <div id="spec-models">
51   -
52   - </div>
53   -
54   - <div id="spec-controllers">
55   -
56   - </div>
57   -
58   - <div id="spec-views">
59   -
60   - </div>
61   - </div>
62   -
63   - <script type="text/javascript">
64   - jasmine.getEnv().addReporter(new jasmine.TrivialReporter());
65   - jasmine.getEnv().execute();
66   - </script>
67   -
68   -</body>
69   -</html>
70 0 \ No newline at end of file