diff --git a/build/Gruntfile.js b/build/Gruntfile.js index 2cdf0f9fb..e4370c9d9 100644 --- a/build/Gruntfile.js +++ b/build/Gruntfile.js @@ -99,7 +99,6 @@ module.exports = function(grunt) { doRegisterTask('sockjs'); doRegisterTask('xregexp'); doRegisterTask('megapixel'); - doRegisterTask('touch'); doRegisterTask('jquery'); doRegisterTask('underscore'); doRegisterTask('zeroclipboard'); @@ -398,7 +397,6 @@ module.exports = function(grunt) { grunt.registerTask('deploy-sockjs', ['sockjs-init', 'clean', 'copy']); grunt.registerTask('deploy-xregexp', ['xregexp-init', 'clean', 'copy']); grunt.registerTask('deploy-megapixel', ['megapixel-init', 'clean', 'copy']); - grunt.registerTask('deploy-touch', ['touch-init', 'clean', 'copy']); grunt.registerTask('deploy-jquery', ['jquery-init', 'clean', 'copy']); grunt.registerTask('deploy-underscore', ['underscore-init', 'clean', 'copy']); grunt.registerTask('deploy-zeroclipboard', ['zeroclipboard-init', 'clean', 'copy']); diff --git a/build/deploy/documenteditor.json b/build/deploy/documenteditor.json index 8a5b9d733..ad284c96f 100644 --- a/build/deploy/documenteditor.json +++ b/build/deploy/documenteditor.json @@ -328,16 +328,6 @@ } } }, - "touch": { - "clean": [ - "../../deploy/3rdparty/touch" - ], - "copy": { - "script": { - "../../deploy/3rdparty/touch/": "../../3rdparty/touch/sencha-touch-all.js" - } - } - }, "bootstrap": { "clean": [ "../../deploy/3rdparty/bootstrap" @@ -448,6 +438,6 @@ ] }, "tasks": { - "deploy": "increment-build deploy-api deploy-sdk deploy-3rdparty-bootstrap deploy-3rdparty-extjs deploy-3rdparty-touch deploy-3rdparty-megapixel deploy-3rdparty-jquery deploy-3rdparty-sockjs deploy-3rdparty-xregexp deploy-3rdparty-underscore deploy-3rdparty-zeroclipboard deploy-app-main deploy-app-mobile deploy-app-embed" + "deploy": "increment-build deploy-api deploy-sdk deploy-3rdparty-bootstrap deploy-3rdparty-extjs deploy-3rdparty-megapixel deploy-3rdparty-jquery deploy-3rdparty-sockjs deploy-3rdparty-xregexp deploy-3rdparty-underscore deploy-3rdparty-zeroclipboard deploy-app-main deploy-app-mobile deploy-app-embed" } } \ No newline at end of file diff --git a/build/deploy/grunt.js b/build/deploy/grunt.js index aedb0ba18..eaaf1b38c 100644 --- a/build/deploy/grunt.js +++ b/build/deploy/grunt.js @@ -77,18 +77,6 @@ module.exports = function(grunt) { }); }); - grunt.registerTask('touch-init', function() { - grunt.initConfig({ - clean: packageFile['touch']['clean'], - - copy: { - script: { - files: packageFile['touch']["copy"]["script"] - } - } - }); - }); - grunt.registerTask('jquery-init', function() { grunt.initConfig({ clean: packageFile['jquery']['clean'], @@ -307,7 +295,6 @@ module.exports = function(grunt) { grunt.registerTask('deploy-3rdparty-bootstrap', 'bootstrap-init clean copy'); grunt.registerTask('deploy-3rdparty-extjs', 'extjs-init clean copy'); grunt.registerTask('deploy-3rdparty-megapixel', 'megapixel-init clean copy'); - grunt.registerTask('deploy-3rdparty-touch', 'touch-init clean copy'); grunt.registerTask('deploy-3rdparty-jquery', 'jquery-init clean copy'); grunt.registerTask('deploy-3rdparty-sockjs', 'sockjs-init clean copy'); grunt.registerTask('deploy-3rdparty-xregexp', 'xregexp-init clean copy'); @@ -380,7 +367,7 @@ module.exports = function(grunt) { } }); }); - + grunt.registerTask('init-obfuscate-api', 'Obfuscate api.', function(){ grunt.initConfig({ exec: { @@ -401,10 +388,10 @@ module.exports = function(grunt) { } }); }); - + grunt.registerTask('obfuscate-api', 'init-obfuscate-api exec'); grunt.registerTask('obfuscate-app', 'init-obfuscate-app exec'); - + grunt.registerTask('deploy-documenteditor', 'init-build-documenteditor deploy-app'); grunt.registerTask('deploy-spreadsheeteditor', 'init-build-spreadsheeteditor deploy-app'); grunt.registerTask('deploy-presentationeditor', 'init-build-presentationeditor deploy-app'); @@ -412,59 +399,59 @@ module.exports = function(grunt) { grunt.registerTask('obfuscate-documenteditor', 'deploy-documenteditor obfuscate-api obfuscate-app'); grunt.registerTask('obfuscate-spreadsheeteditor', 'deploy-spreadsheeteditor obfuscate-app'); grunt.registerTask('obfuscate-presentationeditor', 'deploy-presentationeditor obfuscate-api obfuscate-app'); - + grunt.registerTask('obfuscate-all', 'obfuscate-documenteditor obfuscate-spreadsheeteditor obfuscate-presentationeditor'); - + grunt.registerTask('init-deploy-isa209', 'Initialize deploy to isa209.', function(){ deployConfig = 'isa209.json'; - + deployFile = require('./' + deployConfig); - - if (deployFile) + + if (deployFile) grunt.log.ok('isa209 config loaded successfully'.green); else grunt.log.error().writeln('Could not load config file'.red); }); - + grunt.registerTask('init-deploy-testserver', 'Initialize deploy to testserver.', function(){ deployConfig = 'testserver.json'; - + deployFile = require('./' + deployConfig); - - if (deployFile) + + if (deployFile) grunt.log.ok('testserver config loaded successfully'.green); else grunt.log.error().writeln('Could not load config file'.red); }); - + grunt.registerTask('init-deploy-com', 'Initialize deploy to com.', function(){ deployConfig = 'com.json'; - + deployFile = require('./' + deployConfig); - - if (deployFile) + + if (deployFile) grunt.log.ok('com config loaded successfully'.green); else grunt.log.error().writeln('Could not load config file'.red); }); - + grunt.registerTask('init-deploy-com.eu', 'Initialize deploy to com.', function(){ deployConfig = 'com.eu.json'; - + deployFile = require('./' + deployConfig); - - if (deployFile) + + if (deployFile) grunt.log.ok('com config loaded successfully'.green); else grunt.log.error().writeln('Could not load config file'.red); }); - + grunt.registerTask('init-deploy-nct', 'Initialize deploy to nct.', function(){ deployConfig = 'nct.json'; - + deployFile = require('./' + deployConfig); - - if (deployFile) + + if (deployFile) grunt.log.ok('nct config loaded successfully'.green); else grunt.log.error().writeln('Could not load config file'.red); @@ -472,15 +459,15 @@ module.exports = function(grunt) { grunt.registerTask('init-deploy-doc-test', 'Initialize deploy to doc-test.', function(){ deployConfig = 'doc-test.json'; - + deployFile = require('./' + deployConfig); - - if (deployFile) + + if (deployFile) grunt.log.ok('doc-test config loaded successfully'.green); else grunt.log.error().writeln('Could not load config file'.red); }); - + grunt.registerTask('run-deploy-task', 'Run deploy task.', function(){ if (deployFile) { if (deployFile['tasks']['deploy']) @@ -491,52 +478,52 @@ module.exports = function(grunt) { grunt.log.error().writeln('Is not load configure file.'.red); } }); - + grunt.registerTask('insert-version-to-url', function() { var dst_folder = 'v' + deployFile['version']['major'] + '.' + deployFile['version']['minor']; - + if(undefined !== process.env['BUILD_NUMBER']) { - grunt.log.ok('Use Jenkins build number as minor version!'.yellow); + grunt.log.ok('Use Jenkins build number as minor version!'.yellow); dst_folder = 'v' + deployFile['version']['major'] + '.' + process.env['BUILD_NUMBER']; } - + //change current config: //set version's named folder as rootDir for archived sources if(undefined !== deployFile['compress']) deployFile['compress']['dist']['options']['rootDir'] = dst_folder; - + if(undefined !== deployFile['dst']) deployFile['dst'] = deployFile['dst'] + '/' + dst_folder; //add version's named folder to full path url var full_url = deployFile['replace']['url']['options']['variables']; - for(var i in full_url){ + for(var i in full_url){ full_url[i] = full_url[i] + dst_folder + '/'; } }); - + grunt.registerTask('increment-deploy-version', function() { var pkg = grunt.file.readJSON(deployConfig); pkg.version.minor = parseInt(pkg.version.minor) + 1; - + //write changes grunt.file.write(deployConfig, JSON.stringify(pkg, null, 4)); }); - + grunt.registerTask('init-deploy-compress', function(){ grunt.initConfig({ pkg: '', compress: deployFile['compress'] }); }); - - grunt.registerTask('deploy-compress-all', 'init-deploy-compress'); - + + grunt.registerTask('deploy-compress-all', 'init-deploy-compress'); + grunt.registerTask('init-deploy-configure', 'Init configure task.', function(){ var replace_path_array = {}; - + if(deployFile['path']){ //Generate structure for the replace tasks //for each pattern @@ -544,10 +531,10 @@ module.exports = function(grunt) { //and for each file for(var j in deployFile['path']['src_path']){ var replace_task_name = 'path_subtask_' + i + j; - replace_path_array[replace_task_name] = {}; + replace_path_array[replace_task_name] = {}; replace_path_array[replace_task_name]['options'] = {}; var find = deployFile['path']['pattern'][i]; - + var replace = ''; //find the count of slash var start_index = 0; @@ -565,14 +552,14 @@ module.exports = function(grunt) { if(last_slash != -1) replace = replace + deployFile['path']['src_path'][j].substring(0, last_slash + 1); replace = replace + find; - + replace_path_array[replace_task_name]['options']['variables'] = {}; replace_path_array[replace_task_name]['options']['variables'][find] = replace; replace_path_array[replace_task_name]['options']['prefix'] = ""; var file = deployFile['path']['base_path'] + '/' + deployFile['path']['src_path'][j]; replace_path_array[replace_task_name]['files'] = {}; replace_path_array[replace_task_name]['files'][file] = file; - grunt.log.ok(JSON.stringify(replace_path_array[replace_task_name], null, 4).green); + grunt.log.ok(JSON.stringify(replace_path_array[replace_task_name], null, 4).green); } } } @@ -580,7 +567,7 @@ module.exports = function(grunt) { for(var i in deployFile['replace']){ replace_path_array[i] = deployFile['replace'][i]; } - + grunt.initConfig({ pkg: deployFile, pkg_origin: '', @@ -592,12 +579,12 @@ module.exports = function(grunt) { } } }, - replace: replace_path_array + replace: replace_path_array }); }); - - grunt.registerTask('deploy-configure-all', 'init-deploy-configure clean copy replace'); - + + grunt.registerTask('deploy-configure-all', 'init-deploy-configure clean copy replace'); + grunt.registerTask('deploy-to-isa209', 'init-deploy-isa209 run-deploy-task'); grunt.registerTask('deploy-to-testserver', 'init-deploy-testserver run-deploy-task'); grunt.registerTask('deploy-to-com', 'init-deploy-com run-deploy-task'); @@ -605,6 +592,6 @@ module.exports = function(grunt) { grunt.registerTask('deploy-to-nct', 'init-deploy-nct run-deploy-task'); grunt.registerTask('deploy-to-doc-test', 'init-deploy-doc-test run-deploy-task'); grunt.registerTask('deploy-to-all', 'deploy-to-isa209 deploy-to-testserver deploy-to-com deploy-to-com.eu deploy-to-nct deploy-to-doc-test'); - + grunt.registerTask('default', 'deploy-documenteditor deploy-spreadsheeteditor deploy-presentationeditor'); }; \ No newline at end of file diff --git a/build/deploy/presentationeditor.json b/build/deploy/presentationeditor.json index 9e1379edf..026c9f06f 100644 --- a/build/deploy/presentationeditor.json +++ b/build/deploy/presentationeditor.json @@ -300,16 +300,6 @@ } } }, - "touch": { - "clean": [ - "../../deploy/3rdparty/touch" - ], - "copy": { - "script": { - "../../deploy/3rdparty/touch/": "../../3rdparty/touch/sencha-touch-all.js" - } - } - }, "bootstrap": { "clean": [ "../../deploy/3rdparty/bootstrap" @@ -409,6 +399,6 @@ ] }, "tasks": { - "deploy": "increment-build deploy-api deploy-sdk deploy-3rdparty-bootstrap deploy-3rdparty-extjs deploy-3rdparty-touch deploy-3rdparty-jquery deploy-3rdparty-sockjs deploy-3rdparty-xregexp deploy-3rdparty-underscore deploy-3rdparty-zeroclipboard deploy-app-main deploy-app-mobile deploy-app-embed" + "deploy": "increment-build deploy-api deploy-sdk deploy-3rdparty-bootstrap deploy-3rdparty-extjs deploy-3rdparty-jquery deploy-3rdparty-sockjs deploy-3rdparty-xregexp deploy-3rdparty-underscore deploy-3rdparty-zeroclipboard deploy-app-main deploy-app-mobile deploy-app-embed" } } \ No newline at end of file diff --git a/build/deploy/spreadsheeteditor.json b/build/deploy/spreadsheeteditor.json index b0ac46e80..1aed1844e 100644 --- a/build/deploy/spreadsheeteditor.json +++ b/build/deploy/spreadsheeteditor.json @@ -315,16 +315,6 @@ } } }, - "touch": { - "clean": [ - "../../deploy/3rdparty/touch" - ], - "copy": { - "script": { - "../../deploy/3rdparty/touch/": "../../3rdparty/touch/sencha-touch-all.js" - } - } - }, "bootstrap": { "clean": [ "../../deploy/3rdparty/bootstrap" @@ -412,6 +402,6 @@ ] }, "tasks": { - "deploy": "increment-build deploy-api deploy-sdk deploy-3rdparty-bootstrap deploy-3rdparty-extjs deploy-3rdparty-touch deploy-3rdparty-jquery deploy-3rdparty-sockjs deploy-3rdparty-xregexp deploy-3rdparty-underscore deploy-3rdparty-zeroclipboard deploy-app-main deploy-app-mobile deploy-app-embed" + "deploy": "increment-build deploy-api deploy-sdk deploy-3rdparty-bootstrap deploy-3rdparty-extjs deploy-3rdparty-jquery deploy-3rdparty-sockjs deploy-3rdparty-xregexp deploy-3rdparty-underscore deploy-3rdparty-zeroclipboard deploy-app-main deploy-app-mobile deploy-app-embed" } } \ No newline at end of file diff --git a/build/documenteditor.json b/build/documenteditor.json index 2a439939d..2827e5f22 100644 --- a/build/documenteditor.json +++ b/build/documenteditor.json @@ -425,17 +425,6 @@ ] } }, - "touch": { - "clean": [ - "../deploy/web-apps/vendor/touch" - ], - "copy": { - "script": { - "src": "../vendor/touch/sencha-touch-all.js", - "dest": "../deploy/web-apps/vendor/touch/sencha-touch-all.js" - } - } - }, "bootstrap": { "clean": [ "../deploy/web-apps/vendor/bootstrap" @@ -611,7 +600,6 @@ "deploy-xregexp", "deploy-requirejs", "deploy-megapixel", - "deploy-touch", "deploy-jquery", "deploy-underscore", "deploy-zeroclipboard", diff --git a/build/opensource/documenteditor.json b/build/opensource/documenteditor.json index 859bece8e..da1c556fa 100644 --- a/build/opensource/documenteditor.json +++ b/build/opensource/documenteditor.json @@ -302,16 +302,6 @@ } } }, - "touch": { - "clean": [ - "../../deploy/3rdparty/touch" - ], - "copy": { - "script": { - "../../deploy/3rdparty/touch/": "../../3rdparty/touch/sencha-touch-all.js" - } - } - }, "bootstrap": { "clean": [ "../../deploy/3rdparty/bootstrap" @@ -397,6 +387,6 @@ } }, "tasks": { - "deploy": "increment-build deploy-api deploy-sdk deploy-3rdparty-bootstrap deploy-3rdparty-extjs deploy-3rdparty-touch deploy-3rdparty-megapixel deploy-3rdparty-jquery deploy-3rdparty-sockjs deploy-3rdparty-xregexp deploy-3rdparty-underscore deploy-3rdparty-zeroclipboard deploy-app-main deploy-app-mobile deploy-app-embed" + "deploy": "increment-build deploy-api deploy-sdk deploy-3rdparty-bootstrap deploy-3rdparty-extjs deploy-3rdparty-megapixel deploy-3rdparty-jquery deploy-3rdparty-sockjs deploy-3rdparty-xregexp deploy-3rdparty-underscore deploy-3rdparty-zeroclipboard deploy-app-main deploy-app-mobile deploy-app-embed" } } \ No newline at end of file diff --git a/build/opensource/grunt.js b/build/opensource/grunt.js index c5b83a9c1..132872b3a 100644 --- a/build/opensource/grunt.js +++ b/build/opensource/grunt.js @@ -75,18 +75,6 @@ module.exports = function(grunt) { }); }); - grunt.registerTask('touch-init', function() { - grunt.initConfig({ - clean: packageFile['touch']['clean'], - - copy: { - script: { - files: packageFile['touch']["copy"]["script"] - } - } - }); - }); - grunt.registerTask('jquery-init', function() { grunt.initConfig({ clean: packageFile['jquery']['clean'], @@ -329,7 +317,6 @@ module.exports = function(grunt) { grunt.registerTask('deploy-3rdparty-bootstrap', 'bootstrap-init clean copy'); grunt.registerTask('deploy-3rdparty-extjs', 'extjs-init clean copy'); grunt.registerTask('deploy-3rdparty-megapixel', 'megapixel-init clean copy'); - grunt.registerTask('deploy-3rdparty-touch', 'touch-init clean copy'); grunt.registerTask('deploy-3rdparty-jquery', 'jquery-init clean copy'); grunt.registerTask('deploy-3rdparty-sockjs', 'sockjs-init clean copy'); grunt.registerTask('deploy-3rdparty-xregexp', 'xregexp-init clean copy'); diff --git a/build/opensource/presentationeditor.json b/build/opensource/presentationeditor.json index 736d57d32..14f76c1ed 100644 --- a/build/opensource/presentationeditor.json +++ b/build/opensource/presentationeditor.json @@ -273,16 +273,6 @@ } } }, - "touch": { - "clean": [ - "../../deploy/3rdparty/touch" - ], - "copy": { - "script": { - "../../deploy/3rdparty/touch/": "../../3rdparty/touch/sencha-touch-all.js" - } - } - }, "bootstrap": { "clean": [ "../../deploy/3rdparty/bootstrap" @@ -358,6 +348,6 @@ } }, "tasks": { - "deploy": "increment-build deploy-api deploy-sdk deploy-3rdparty-bootstrap deploy-3rdparty-extjs deploy-3rdparty-touch deploy-3rdparty-jquery deploy-3rdparty-sockjs deploy-3rdparty-xregexp deploy-3rdparty-underscore deploy-3rdparty-zeroclipboard deploy-app-main deploy-app-mobile deploy-app-embed" + "deploy": "increment-build deploy-api deploy-sdk deploy-3rdparty-bootstrap deploy-3rdparty-extjs deploy-3rdparty-jquery deploy-3rdparty-sockjs deploy-3rdparty-xregexp deploy-3rdparty-underscore deploy-3rdparty-zeroclipboard deploy-app-main deploy-app-mobile deploy-app-embed" } } \ No newline at end of file diff --git a/build/opensource/spreadsheeteditor.json b/build/opensource/spreadsheeteditor.json index 364b3b010..20c032d51 100644 --- a/build/opensource/spreadsheeteditor.json +++ b/build/opensource/spreadsheeteditor.json @@ -291,16 +291,6 @@ } } }, - "touch": { - "clean": [ - "../../deploy/3rdparty/touch" - ], - "copy": { - "script": { - "../../deploy/3rdparty/touch/": "../../3rdparty/touch/sencha-touch-all.js" - } - } - }, "bootstrap": { "clean": [ "../../deploy/3rdparty/bootstrap" @@ -376,6 +366,6 @@ } }, "tasks": { - "deploy": "increment-build deploy-api deploy-sdk deploy-3rdparty-bootstrap deploy-3rdparty-extjs deploy-3rdparty-touch deploy-3rdparty-jquery deploy-3rdparty-sockjs deploy-3rdparty-xregexp deploy-3rdparty-underscore deploy-3rdparty-zeroclipboard deploy-app-main deploy-app-mobile deploy-app-embed" + "deploy": "increment-build deploy-api deploy-sdk deploy-3rdparty-bootstrap deploy-3rdparty-extjs deploy-3rdparty-jquery deploy-3rdparty-sockjs deploy-3rdparty-xregexp deploy-3rdparty-underscore deploy-3rdparty-zeroclipboard deploy-app-main deploy-app-mobile deploy-app-embed" } } \ No newline at end of file diff --git a/build/presentationeditor.json b/build/presentationeditor.json index 94d5c4661..155008f7b 100644 --- a/build/presentationeditor.json +++ b/build/presentationeditor.json @@ -322,17 +322,6 @@ ] } }, - "touch": { - "clean": [ - "../deploy/web-apps/vendor/touch" - ], - "copy": { - "script": { - "src": "../vendor/touch/sencha-touch-all.js", - "dest": "../deploy/web-apps/vendor/touch/sencha-touch-all.js" - } - } - }, "bootstrap": { "clean": [ "../deploy/web-apps/vendor/bootstrap" @@ -507,7 +496,6 @@ "deploy-xregexp", "deploy-requirejs", "deploy-megapixel", - "deploy-touch", "deploy-jquery", "deploy-underscore", "deploy-zeroclipboard", diff --git a/build/spreadsheeteditor.json b/build/spreadsheeteditor.json index 971496fe4..0eba087c0 100644 --- a/build/spreadsheeteditor.json +++ b/build/spreadsheeteditor.json @@ -352,17 +352,6 @@ ] } }, - "touch": { - "clean": [ - "../deploy/web-apps/vendor/touch" - ], - "copy": { - "script": { - "src": "../vendor/touch/sencha-touch-all.js", - "dest": "../deploy/web-apps/vendor/touch/sencha-touch-all.js" - } - } - }, "bootstrap": { "clean": [ "../deploy/web-apps/vendor/bootstrap" @@ -525,7 +514,6 @@ "deploy-xregexp", "deploy-requirejs", "deploy-megapixel", - "deploy-touch", "deploy-jquery", "deploy-underscore", "deploy-zeroclipboard", diff --git a/vendor/touch/SETUP.html b/vendor/touch/SETUP.html deleted file mode 100644 index 218e71cdc..000000000 --- a/vendor/touch/SETUP.html +++ /dev/null @@ -1,78 +0,0 @@ - - - - - - - -

Sencha Touch Setup Guide

-

Topics:

- - -

Introduction

-

Sencha Touch, a high-performance HTML5 mobile application framework, is the cornerstone - of the Sencha HTML5 platform. Built for enabling world-class user experiences, - Sencha Touch is the only framework that enables developers to build powerful apps - that work on iOS, Android, BlackBerry, Windows Phone, and Internet Explorer 10. -
Learn more at What's New. -
Learn about new APIs in the "New in this version" - section near the end of the API page.

- - -

Installing Sencha Touch

-

To install Sencha Touch:

-
    -
  1. Download Sencha Cmd. - Sencha Cmd enables you to publish, package, and simulate an application, as well as to upgrade Sencha software. - Sencha Cmd also installs Apache Ant, Compass, and Sass.
  2. -
  3. Download Ruby -
      -
    • Mac OS: Ruby is pre-installed. You can verify - it with the ruby -v command.
    • -
    • Windows Download the open source 7-Zip archiver. - Download Ruby (any version) from rubyinstaller.org. - Set the Path environment variable to point to the directory in which you unzip the installer file.
    • -
    • Ubuntu: Use sudo apt-get install ruby2.0.0 to download and install Ruby.
    • -
    -
  4. -
  5. Start your web server. - If using the Sencha Cmd web server, change directory to where you want to serve - your application, open a new command line window and start the server with the - sencha web start command. You can stop the server by typing - CTRL+c or opening another command line and typing the sencha web stop command. - You can access the Sencha Cmd web server using - the http://localhost:1841/<app_name> URL.
  6. -
  7. If you are using Windows and running the IIS web server, add "application/x-json" - as a MIME type; otherwise, IIS returns the JSON file with an error when you preview - your project. In Windows, enable IIS from the add/remove programs or programs and features dialog - (add/remove windows features), you can also add extra functionality by downloading the web platform - toolkit to make config of IIS features extra simple. - For information on adding this MIME type, see this - Stackoverflow article.
  8. -
  9. Use a modern web browser such as - Chrome - or Safari.
  10. -
- - -

Sencha Touch Information

- - - diff --git a/vendor/touch/SenchaLogo.png b/vendor/touch/SenchaLogo.png deleted file mode 100644 index ec04f17c4..000000000 Binary files a/vendor/touch/SenchaLogo.png and /dev/null differ diff --git a/vendor/touch/index.html b/vendor/touch/index.html deleted file mode 100644 index fe3c1fb2d..000000000 --- a/vendor/touch/index.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - Welcome to Sencha Touch 2 - - - - - diff --git a/vendor/touch/license.txt b/vendor/touch/license.txt deleted file mode 100644 index 2eed6cd4b..000000000 --- a/vendor/touch/license.txt +++ /dev/null @@ -1,68 +0,0 @@ -Sencha Touch & Sencha Touch Charts - JavaScript Libraries -Copyright (c) 2010-2015, Sencha, Inc. -All rights reserved. -licensing@sencha.com - -http://www.sencha.com/products/touch/license.php - - -Open Source License ------------------------------------------------------------------------------------------- -This version of Sencha Touch and Sencha Touch Charts is licensed under the terms of the Open -Source GPL 3.0 license. - -http://www.gnu.org/licenses/gpl.html - -There are several FLOSS exceptions available for use with this release for -open source applications that are distributed under a license other than the GPL. - -* Open Source License Exception for Applications - - http://www.sencha.com/products/floss-exception.php - -* Open Source License Exception for Development - - http://www.sencha.com/products/ux-exception.php - - -Alternate Licensing for Sencha Touch ------------------------------------------------------------------------------------------- -Commercial and OEM Licenses are available for an alternate download of Sencha Touch. -This is the appropriate option if you are creating proprietary applications and you are -not prepared to distribute and share the source code of your application under the -GPL v3 license. Please visit http://www.sencha.com/store/touch/license.php for more details. - - -Alternate Licensing for Sencha Touch Charts ------------------------------------------------------------------------------------------- -Commercial and OEM Licenses are available for an alternate download of Sencha Touch Charts. -This is the appropriate option if you are creating proprietary applications and you are -not prepared to distribute and share the source code of your application under the -GPL v3 license. - -Sencha Touch Charts is available commercially only as a part of Sencha Complete or Sencha -Complete Team. Please visit http://www.sencha.com/products/complete/license or -http://www.sencha.com/products/complete-team/license for more details. - - -Third Party Content ------------------------------------------------------------------------------------------- -The following third party software is distributed with Sencha Touch and is -provided under other licenses and/or has source available from other locations. - -Library: JSON parser -License: Public Domain -Location: http://www.JSON.org/js.html - -Library: flexible-js-formatting - date parsing and formatting -License: MIT -Location: http://code.google.com/p/flexible-js-formatting/ - -Library: Jasmine Š unit testing -License: MIT -Location: https://github.com/pivotal/jasmine - - --- - -THIS SOFTWARE IS DISTRIBUTED "AS-IS" WITHOUT ANY WARRANTIES, CONDITIONS AND REPRESENTATIONS WHETHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION THE IMPLIED WARRANTIES AND CONDITIONS OF MERCHANTABILITY, MERCHANTABLE QUALITY, FITNESS FOR A PARTICULAR PURPOSE, DURABILITY, NON-INFRINGEMENT, PERFORMANCE AND THOSE ARISING BY STATUTE OR FROM CUSTOM OR USAGE OF TRADE OR COURSE OF DEALING. \ No newline at end of file diff --git a/vendor/touch/microloader/development.js b/vendor/touch/microloader/development.js deleted file mode 100644 index 4906c58c4..000000000 --- a/vendor/touch/microloader/development.js +++ /dev/null @@ -1,185 +0,0 @@ -/** - * Sencha Blink - Development - * @author Jacky Nguyen - */ -(function() { - var head = document.head; - - function write(content) { - document.write(content); - } - - function addMeta(name, content) { - var meta = document.createElement('meta'); - - meta.setAttribute('name', name); - meta.setAttribute('content', content); - head.appendChild(meta); - } - - var xhr = new XMLHttpRequest(); - xhr.open('GET', 'app.json', false); - xhr.send(null); - - var options = eval("(" + xhr.responseText + ")"), - scripts = options.js || [], - styleSheets = options.css || [], - i, ln, path, platform, theme, exclude; - - if(options.platform && options.platforms && options.platforms[options.platform] && options.platforms[options.platform].js) { - scripts = options.platforms[options.platform].js.concat(scripts); - } - - if (navigator.userAgent.match(/IEMobile\/10\.0/)) { - var msViewportStyle = document.createElement("style"); - msViewportStyle.appendChild( - document.createTextNode( - "@media screen and (orientation: portrait) {" + - "@-ms-viewport {width: 320px !important;}" + - "}" + - "@media screen and (orientation: landscape) {" + - "@-ms-viewport {width: 560px !important;}" + - "}" - ) - ); - document.getElementsByTagName("head")[0].appendChild(msViewportStyle); - } - - addMeta('viewport', 'width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=no'); - addMeta('apple-mobile-web-app-capable', 'yes'); - addMeta('apple-touch-fullscreen', 'yes'); - - if (!window.Ext) { - window.Ext = {}; - } - Ext.microloaded = true; - - var filterPlatform = window.Ext.filterPlatform = function(platform) { - var profileMatch = false, - ua = navigator.userAgent, - j, jln; - - platform = [].concat(platform); - - function isPhone(ua) { - var isMobile = /Mobile(\/|\s)/.test(ua); - - // Either: - // - iOS but not iPad - // - Android 2 - // - Android with "Mobile" in the UA - - return /(iPhone|iPod)/.test(ua) || - (!/(Silk)/.test(ua) && (/(Android)/.test(ua) && (/(Android 2)/.test(ua) || isMobile))) || - (/(BlackBerry|BB)/.test(ua) && isMobile) || - /(Windows Phone)/.test(ua); - } - - function isTablet(ua) { - return !isPhone(ua) && (/iPad/.test(ua) || /Android|Silk/.test(ua) || /(RIM Tablet OS)/.test(ua) || - (/MSIE 10/.test(ua) && /; Touch/.test(ua))); - } - - // Check if the ?platform parameter is set in the URL - var paramsString = window.location.search.substr(1), - paramsArray = paramsString.split("&"), - params = {}, - testPlatform, i; - - for (i = 0; i < paramsArray.length; i++) { - var tmpArray = paramsArray[i].split("="); - params[tmpArray[0]] = tmpArray[1]; - } - - testPlatform = params.platform; - if (testPlatform) { - return platform.indexOf(testPlatform) != -1; - } - - for (j = 0, jln = platform.length; j < jln; j++) { - switch (platform[j]) { - case 'phone': - profileMatch = isPhone(ua); - break; - case 'tablet': - profileMatch = isTablet(ua); - break; - case 'desktop': - profileMatch = !isPhone(ua) && !isTablet(ua); - break; - case 'ios': - profileMatch = /(iPad|iPhone|iPod)/.test(ua); - break; - case 'android': - profileMatch = /(Android|Silk)/.test(ua); - break; - case 'blackberry': - profileMatch = /(BlackBerry|BB)/.test(ua); - break; - case 'safari': - profileMatch = /Safari/.test(ua) && !(/(BlackBerry|BB)/.test(ua)); - break; - case 'chrome': - profileMatch = /Chrome/.test(ua); - break; - case 'ie10': - profileMatch = /MSIE 10/.test(ua); - break; - case 'windows': - profileMatch = /MSIE 10/.test(ua) || /Trident/.test(ua); - break; - case 'tizen': - profileMatch = /Tizen/.test(ua); - break; - case 'firefox': - profileMatch = /Firefox/.test(ua); - } - if (profileMatch) { - return true; - } - } - return false; - }; - - - for (i = 0,ln = styleSheets.length; i < ln; i++) { - path = styleSheets[i]; - - if (typeof path != 'string') { - platform = path.platform; - exclude = path.exclude; - theme = path.theme; - path = path.path; - } - - if (platform) { - if (!filterPlatform(platform) || filterPlatform(exclude)) { - continue; - } - Ext.theme = { - name: theme || 'Default' - }; - } - - write(''); - } - - for (i = 0,ln = scripts.length; i < ln; i++) { - path = scripts[i]; - - if (typeof path != 'string') { - platform = path.platform; - exclude = path.exclude; - path = path.path; - } - - if (platform) { - if (!filterPlatform(platform) || filterPlatform(exclude)) { - continue; - } - } - - write(' - * - * - * Refer to config options of {@link Ext.Loader} for the list of possible properties. - * - * @param {Object/String} name The config object to override the default values - * or name of a single config setting when also passing the second parameter. - * @param {Mixed} [value] The value for the config setting. - * @return {Ext.Loader} this - */ - setConfig: function(name, value) { - if (Ext.isObject(name) && arguments.length === 1) { - Ext.merge(this.config, name); - } - else { - this.config[name] = (Ext.isObject(value)) ? Ext.merge(this.config[name], value) : value; - } - setPathCount += 1; - return this; - }, - - /** - * Get the config value corresponding to the specified name. If no name is given, will return the config object. - * @param {String} name The config property name. - * @return {Object/Mixed} - */ - getConfig: function(name) { - if (name) { - return this.config[name]; - } - - return this.config; - }, - - /** - * Sets the path of a namespace. - * For example: - * - * Ext.Loader.setPath('Ext', '.'); - * - * @param {String/Object} name See {@link Ext.Function#flexSetter flexSetter} - * @param {String} [path] See {@link Ext.Function#flexSetter flexSetter} - * @return {Ext.Loader} this - * @method - */ - setPath: flexSetter(function(name, path) { - this.config.paths[name] = path; - setPathCount += 1; - return this; - }), - - /** - * Sets a batch of path entries - * - * @param {Object } paths a set of className: path mappings - * @return {Ext.Loader} this - */ - addClassPathMappings: function(paths) { - var name; - - if(setPathCount == 0){ - Loader.config.paths = paths; - } else { - for(name in paths){ - Loader.config.paths[name] = paths[name]; - } - } - setPathCount++; - return Loader; - }, - - /** - * Translates a className to a file path by adding the - * the proper prefix and converting the .'s to /'s. For example: - * - * Ext.Loader.setPath('My', '/path/to/My'); - * - * alert(Ext.Loader.getPath('My.awesome.Class')); // alerts '/path/to/My/awesome/Class.js' - * - * Note that the deeper namespace levels, if explicitly set, are always resolved first. For example: - * - * Ext.Loader.setPath({ - * 'My': '/path/to/lib', - * 'My.awesome': '/other/path/for/awesome/stuff', - * 'My.awesome.more': '/more/awesome/path' - * }); - * - * alert(Ext.Loader.getPath('My.awesome.Class')); // alerts '/other/path/for/awesome/stuff/Class.js' - * - * alert(Ext.Loader.getPath('My.awesome.more.Class')); // alerts '/more/awesome/path/Class.js' - * - * alert(Ext.Loader.getPath('My.cool.Class')); // alerts '/path/to/lib/cool/Class.js' - * - * alert(Ext.Loader.getPath('Unknown.strange.Stuff')); // alerts 'Unknown/strange/Stuff.js' - * - * @param {String} className - * @return {String} path - */ - getPath: function(className) { - var path = '', - paths = this.config.paths, - prefix = this.getPrefix(className); - - if (prefix.length > 0) { - if (prefix === className) { - return paths[prefix]; - } - - path = paths[prefix]; - className = className.substring(prefix.length + 1); - } - - if (path.length > 0) { - path += '/'; - } - - return path.replace(/\/\.\//g, '/') + className.replace(/\./g, "/") + '.js'; - }, - - /** - * @private - * @param {String} className - */ - getPrefix: function(className) { - var paths = this.config.paths, - prefix, deepestPrefix = ''; - - if (paths.hasOwnProperty(className)) { - return className; - } - - for (prefix in paths) { - if (paths.hasOwnProperty(prefix) && prefix + '.' === className.substring(0, prefix.length + 1)) { - if (prefix.length > deepestPrefix.length) { - deepestPrefix = prefix; - } - } - } - - return deepestPrefix; - }, - - /** - * Loads all classes by the given names and all their direct dependencies; optionally executes the given callback function when - * finishes, within the optional scope. This method is aliased by {@link Ext#require Ext.require} for convenience. - * @param {String/Array} expressions Can either be a string or an array of string. - * @param {Function} fn (optional) The callback function. - * @param {Object} scope (optional) The execution scope (`this`) of the callback function. - * @param {String/Array} excludes (optional) Classes to be excluded, useful when being used with expressions. - */ - require: function(expressions, fn, scope, excludes) { - if (fn) { - fn.call(scope); - } - }, - - /** - * Synchronously loads all classes by the given names and all their direct dependencies; optionally executes the given callback function when finishes, within the optional scope. This method is aliased by {@link Ext#syncRequire} for convenience - * @param {String/Array} expressions Can either be a string or an array of string - * @param {Function} fn (optional) The callback function - * @param {Object} scope (optional) The execution scope (`this`) of the callback function - * @param {String/Array} excludes (optional) Classes to be excluded, useful when being used with expressions - */ - syncRequire: function() {}, - - /** - * Explicitly exclude files from being loaded. Useful when used in conjunction with a broad include expression. - * Can be chained with more `require` and `exclude` methods, eg: - * - * Ext.exclude('Ext.data.*').require('*'); - * - * Ext.exclude('widget.button*').require('widget.*'); - * - * @param {Array} excludes - * @return {Object} object contains `require` method for chaining. - */ - exclude: function(excludes) { - var me = this; - - return { - require: function(expressions, fn, scope) { - return me.require(expressions, fn, scope, excludes); - }, - - syncRequire: function(expressions, fn, scope) { - return me.syncRequire(expressions, fn, scope, excludes); - } - }; - }, - - /** - * Add a new listener to be executed when all required scripts are fully loaded. - * - * @param {Function} fn The function callback to be executed. - * @param {Object} scope The execution scope (`this`) of the callback function. - * @param {Boolean} withDomReady Whether or not to wait for document DOM ready as well. - */ - onReady: function(fn, scope, withDomReady, options) { - var oldFn; - - if (withDomReady !== false && Ext.onDocumentReady) { - oldFn = fn; - - fn = function() { - Ext.onDocumentReady(oldFn, scope, options); - }; - } - - fn.call(scope); - } - }; - - // - Ext.apply(Loader, { - /** - * @private - */ - documentHead: typeof document != 'undefined' && (document.head || document.getElementsByTagName('head')[0]), - - /** - * Flag indicating whether there are still files being loaded - * @private - */ - isLoading: false, - - /** - * Maintain the queue for all dependencies. Each item in the array is an object of the format: - * - * { - * requires: [...], // The required classes for this queue item - * callback: function() { ... } // The function to execute when all classes specified in requires exist - * } - * @private - */ - queue: [], - - /** - * Maintain the list of files that have already been handled so that they never get double-loaded - * @private - */ - isClassFileLoaded: {}, - - /** - * @private - */ - isFileLoaded: {}, - - /** - * Maintain the list of listeners to execute when all required scripts are fully loaded - * @private - */ - readyListeners: [], - - /** - * Contains optional dependencies to be loaded last - * @private - */ - optionalRequires: [], - - /** - * Map of fully qualified class names to an array of dependent classes. - * @private - */ - requiresMap: {}, - - /** - * @private - */ - numPendingFiles: 0, - - /** - * @private - */ - numLoadedFiles: 0, - - /** @private */ - hasFileLoadError: false, - - /** - * @private - */ - classNameToFilePathMap: {}, - - /** - * @private - */ - syncModeEnabled: false, - - scriptElements: {}, - - /** - * Refresh all items in the queue. If all dependencies for an item exist during looping, - * it will execute the callback and call refreshQueue again. Triggers onReady when the queue is - * empty - * @private - */ - refreshQueue: function() { - var queue = this.queue, - ln = queue.length, - i, item, j, requires, references; - - if (ln === 0) { - this.triggerReady(); - return; - } - - for (i = 0; i < ln; i++) { - item = queue[i]; - - if (item) { - requires = item.requires; - references = item.references; - - // Don't bother checking when the number of files loaded - // is still less than the array length - if (requires.length > this.numLoadedFiles) { - continue; - } - - j = 0; - - do { - if (Manager.isCreated(requires[j])) { - // Take out from the queue - arrayErase(requires, j, 1); - } - else { - j++; - } - } while (j < requires.length); - - if (item.requires.length === 0) { - arrayErase(queue, i, 1); - item.callback.call(item.scope); - this.refreshQueue(); - break; - } - } - } - - return this; - }, - - /** - * Inject a script element to document's head, call onLoad and onError accordingly - * @private - */ - injectScriptElement: function(url, onLoad, onError, scope, charset) { - var script = document.createElement('script'), - me = this, - onLoadFn = function() { - me.cleanupScriptElement(script); - onLoad.call(scope); - }, - onErrorFn = function() { - me.cleanupScriptElement(script); - onError.call(scope); - }; - - script.type = 'text/javascript'; - script.src = url; - script.onload = onLoadFn; - script.onerror = onErrorFn; - script.onreadystatechange = function() { - if (this.readyState === 'loaded' || this.readyState === 'complete') { - onLoadFn(); - } - }; - - if (charset) { - script.charset = charset; - } - - this.documentHead.appendChild(script); - - return script; - }, - - removeScriptElement: function(url) { - var scriptElements = this.scriptElements; - - if (scriptElements[url]) { - this.cleanupScriptElement(scriptElements[url], true); - delete scriptElements[url]; - } - - return this; - }, - - /** - * @private - */ - cleanupScriptElement: function(script, remove) { - script.onload = null; - script.onreadystatechange = null; - script.onerror = null; - - if (remove) { - this.documentHead.removeChild(script); - } - - return this; - }, - - /** - * Load a script file, supports both asynchronous and synchronous approaches - * @private - */ - loadScriptFile: function(url, onLoad, onError, scope, synchronous) { - var me = this, - isFileLoaded = this.isFileLoaded, - scriptElements = this.scriptElements, - noCacheUrl = url + (this.getConfig('disableCaching') ? ('?' + this.getConfig('disableCachingParam') + '=' + Ext.Date.now()) : ''), - xhr, status, content, onScriptError; - - if (isFileLoaded[url]) { - return this; - } - - scope = scope || this; - - this.isLoading = true; - - if (!synchronous) { - onScriptError = function() { - // - onError.call(scope, "Failed loading '" + url + "', please verify that the file exists", synchronous); - // - }; - - if (!Ext.isReady && Ext.onDocumentReady) { - Ext.onDocumentReady(function() { - if (!isFileLoaded[url]) { - scriptElements[url] = me.injectScriptElement(noCacheUrl, onLoad, onScriptError, scope); - } - }); - } - else { - scriptElements[url] = this.injectScriptElement(noCacheUrl, onLoad, onScriptError, scope); - } - } - else { - if (typeof XMLHttpRequest != 'undefined') { - xhr = new XMLHttpRequest(); - } else { - xhr = new ActiveXObject('Microsoft.XMLHTTP'); - } - - try { - xhr.open('GET', noCacheUrl, false); - xhr.send(null); - } - catch (e) { - // - onError.call(this, "Failed loading synchronously via XHR: '" + url + "'; It's likely that the file is either " + - "being loaded from a different domain or from the local file system whereby cross origin " + - "requests are not allowed due to security reasons. Use asynchronous loading with " + - "Ext.require instead.", synchronous); - // - } - - status = (xhr.status == 1223) ? 204 : xhr.status; - content = xhr.responseText; - - if ((status >= 200 && status < 300) || status == 304 || (status == 0 && content.length > 0)) { - // Debugger friendly, file names are still shown even though they're eval'ed code - // Breakpoints work on both Firebug and Chrome's Web Inspector - Ext.globalEval(content + "\n//@ sourceURL=" + url); - onLoad.call(scope); - } - else { - // - onError.call(this, "Failed loading synchronously via XHR: '" + url + "'; please " + - "verify that the file exists. " + - "XHR status code: " + status, synchronous); - // - } - - // Prevent potential IE memory leak - xhr = null; - } - }, - - // documented above - syncRequire: function() { - var syncModeEnabled = this.syncModeEnabled; - - if (!syncModeEnabled) { - this.syncModeEnabled = true; - } - - this.require.apply(this, arguments); - - if (!syncModeEnabled) { - this.syncModeEnabled = false; - } - - this.refreshQueue(); - }, - - // documented above - require: function(expressions, fn, scope, excludes) { - var excluded = {}, - included = {}, - queue = this.queue, - classNameToFilePathMap = this.classNameToFilePathMap, - isClassFileLoaded = this.isClassFileLoaded, - excludedClassNames = [], - possibleClassNames = [], - classNames = [], - references = [], - callback, - syncModeEnabled, - filePath, expression, exclude, className, - possibleClassName, i, j, ln, subLn; - - if (excludes) { - excludes = arrayFrom(excludes); - - for (i = 0,ln = excludes.length; i < ln; i++) { - exclude = excludes[i]; - - if (typeof exclude == 'string' && exclude.length > 0) { - excludedClassNames = Manager.getNamesByExpression(exclude); - - for (j = 0,subLn = excludedClassNames.length; j < subLn; j++) { - excluded[excludedClassNames[j]] = true; - } - } - } - } - - expressions = arrayFrom(expressions); - - if (fn) { - if (fn.length > 0) { - callback = function() { - var classes = [], - i, ln, name; - - for (i = 0,ln = references.length; i < ln; i++) { - name = references[i]; - classes.push(Manager.get(name)); - } - - return fn.apply(this, classes); - }; - } - else { - callback = fn; - } - } - else { - callback = Ext.emptyFn; - } - - scope = scope || Ext.global; - - for (i = 0,ln = expressions.length; i < ln; i++) { - expression = expressions[i]; - - if (typeof expression == 'string' && expression.length > 0) { - possibleClassNames = Manager.getNamesByExpression(expression); - subLn = possibleClassNames.length; - - for (j = 0; j < subLn; j++) { - possibleClassName = possibleClassNames[j]; - - if (excluded[possibleClassName] !== true) { - references.push(possibleClassName); - - if (!Manager.isCreated(possibleClassName) && !included[possibleClassName]/* && !this.requiresMap.hasOwnProperty(possibleClassName)*/) { - included[possibleClassName] = true; - classNames.push(possibleClassName); - } - } - } - } - } - - // If the dynamic dependency feature is not being used, throw an error - // if the dependencies are not defined - if (classNames.length > 0) { - if (!this.config.enabled) { - throw new Error("Ext.Loader is not enabled, so dependencies cannot be resolved dynamically. " + - "Missing required class" + ((classNames.length > 1) ? "es" : "") + ": " + classNames.join(', ')); - } - } - else { - callback.call(scope); - return this; - } - - syncModeEnabled = this.syncModeEnabled; - - if (!syncModeEnabled) { - queue.push({ - requires: classNames.slice(), // this array will be modified as the queue is processed, - // so we need a copy of it - callback: callback, - scope: scope - }); - } - - ln = classNames.length; - - for (i = 0; i < ln; i++) { - className = classNames[i]; - - filePath = this.getPath(className); - - // If we are synchronously loading a file that has already been asynchronously loaded before - // we need to destroy the script tag and revert the count - // This file will then be forced loaded in synchronous - if (syncModeEnabled && isClassFileLoaded.hasOwnProperty(className)) { - this.numPendingFiles--; - this.removeScriptElement(filePath); - delete isClassFileLoaded[className]; - } - - if (!isClassFileLoaded.hasOwnProperty(className)) { - isClassFileLoaded[className] = false; - - classNameToFilePathMap[className] = filePath; - - this.numPendingFiles++; - - this.loadScriptFile( - filePath, - pass(this.onFileLoaded, [className, filePath], this), - pass(this.onFileLoadError, [className, filePath]), - this, - syncModeEnabled - ); - } - } - - if (syncModeEnabled) { - callback.call(scope); - - if (ln === 1) { - return Manager.get(className); - } - } - - return this; - }, - - /** - * @private - * @param {String} className - * @param {String} filePath - */ - onFileLoaded: function(className, filePath) { - this.numLoadedFiles++; - - this.isClassFileLoaded[className] = true; - this.isFileLoaded[filePath] = true; - - this.numPendingFiles--; - - if (this.numPendingFiles === 0) { - this.refreshQueue(); - } - - // - if (!this.syncModeEnabled && this.numPendingFiles === 0 && this.isLoading && !this.hasFileLoadError) { - var queue = this.queue, - missingClasses = [], - missingPaths = [], - requires, - i, ln, j, subLn; - - for (i = 0,ln = queue.length; i < ln; i++) { - requires = queue[i].requires; - - for (j = 0,subLn = requires.length; j < subLn; j++) { - if (this.isClassFileLoaded[requires[j]]) { - missingClasses.push(requires[j]); - } - } - } - - if (missingClasses.length < 1) { - return; - } - - missingClasses = Ext.Array.filter(Ext.Array.unique(missingClasses), function(item) { - return !this.requiresMap.hasOwnProperty(item); - }, this); - - for (i = 0,ln = missingClasses.length; i < ln; i++) { - missingPaths.push(this.classNameToFilePathMap[missingClasses[i]]); - } - - throw new Error("The following classes are not declared even if their files have been " + - "loaded: '" + missingClasses.join("', '") + "'. Please check the source code of their " + - "corresponding files for possible typos: '" + missingPaths.join("', '")); - } - // - }, - - /** - * @private - */ - onFileLoadError: function(className, filePath, errorMessage, isSynchronous) { - this.numPendingFiles--; - this.hasFileLoadError = true; - - // - throw new Error("[Ext.Loader] " + errorMessage); - // - }, - - /** - * @private - */ - addOptionalRequires: function(requires) { - var optionalRequires = this.optionalRequires, - i, ln, require; - - requires = arrayFrom(requires); - - for (i = 0, ln = requires.length; i < ln; i++) { - require = requires[i]; - - arrayInclude(optionalRequires, require); - } - - return this; - }, - - /** - * @private - */ - triggerReady: function(force) { - var readyListeners = this.readyListeners, - optionalRequires = this.optionalRequires, - listener; - - if (this.isLoading || force) { - this.isLoading = false; - - if (optionalRequires.length !== 0) { - // Clone then empty the array to eliminate potential recursive loop issue - optionalRequires = optionalRequires.slice(); - - // Empty the original array - this.optionalRequires.length = 0; - - this.require(optionalRequires, pass(this.triggerReady, [true], this), this); - return this; - } - - while (readyListeners.length) { - listener = readyListeners.shift(); - listener.fn.call(listener.scope); - - if (this.isLoading) { - return this; - } - } - } - - return this; - }, - - // duplicate definition (documented above) - onReady: function(fn, scope, withDomReady, options) { - var oldFn; - - if (withDomReady !== false && Ext.onDocumentReady) { - oldFn = fn; - - fn = function() { - Ext.onDocumentReady(oldFn, scope, options); - }; - } - - if (!this.isLoading) { - fn.call(scope); - } - else { - this.readyListeners.push({ - fn: fn, - scope: scope - }); - } - }, - - /** - * @private - * @param {String} className - */ - historyPush: function(className) { - var isInHistory = this.isInHistory; - - if (className && this.isClassFileLoaded.hasOwnProperty(className) && !isInHistory[className]) { - isInHistory[className] = true; - this.history.push(className); - } - - return this; - } - }); - - // - - /** - * Convenient alias of {@link Ext.Loader#require}. Please see the introduction documentation of - * {@link Ext.Loader} for examples. - * @member Ext - * @method require - * @inheritdoc Ext.Loader#require - */ - Ext.require = alias(Loader, 'require'); - - /** - * Synchronous version of {@link Ext#require}, convenient alias of {@link Ext.Loader#syncRequire}. - * @member Ext - * @method syncRequire - * @inheritdoc Ext.Loader#syncRequire - */ - Ext.syncRequire = alias(Loader, 'syncRequire'); - - /** - * Convenient shortcut to {@link Ext.Loader#exclude}. - * @member Ext - * @method exclude - * @inheritdoc Ext.Loader#exclude - */ - Ext.exclude = alias(Loader, 'exclude'); - - /** - * Adds a listener to be notified when the document is ready and all dependencies are loaded. - * - * @param {Function} fn The method the event invokes. - * @param {Object} [scope] The scope in which the handler function executes. Defaults to the browser window. - * @param {Boolean} [options] Options object as passed to {@link Ext.Element#addListener}. It is recommended - * that the options `{single: true}` be used so that the handler is removed on first invocation. - * @member Ext - * @method onReady - */ - Ext.onReady = function(fn, scope, options) { - Loader.onReady(fn, scope, true, options); - }; - - Class.registerPreprocessor('loader', function(cls, data, hooks, continueFn) { - var me = this, - dependencies = [], - className = Manager.getName(cls), - i, j, ln, subLn, value, propertyName, propertyValue; - - /* - Loop through the dependencyProperties, look for string class names and push - them into a stack, regardless of whether the property's value is a string, array or object. For example: - { - extend: 'Ext.MyClass', - requires: ['Ext.some.OtherClass'], - mixins: { - observable: 'Ext.mixin.Observable'; - } - } - which will later be transformed into: - { - extend: Ext.MyClass, - requires: [Ext.some.OtherClass], - mixins: { - observable: Ext.mixin.Observable; - } - } - */ - - for (i = 0,ln = dependencyProperties.length; i < ln; i++) { - propertyName = dependencyProperties[i]; - - if (data.hasOwnProperty(propertyName)) { - propertyValue = data[propertyName]; - - if (typeof propertyValue == 'string') { - dependencies.push(propertyValue); - } - else if (propertyValue instanceof Array) { - for (j = 0, subLn = propertyValue.length; j < subLn; j++) { - value = propertyValue[j]; - - if (typeof value == 'string') { - dependencies.push(value); - } - } - } - else if (typeof propertyValue != 'function') { - for (j in propertyValue) { - if (propertyValue.hasOwnProperty(j)) { - value = propertyValue[j]; - - if (typeof value == 'string') { - dependencies.push(value); - } - } - } - } - } - } - - if (dependencies.length === 0) { - return; - } - - // - // - var deadlockPath = [], - requiresMap = Loader.requiresMap, - detectDeadlock; - - /* - Automatically detect deadlocks before-hand, - will throw an error with detailed path for ease of debugging. Examples of deadlock cases: - - - A extends B, then B extends A - - A requires B, B requires C, then C requires A - - The detectDeadlock function will recursively transverse till the leaf, hence it can detect deadlocks - no matter how deep the path is. - */ - - if (className) { - requiresMap[className] = dependencies; - // - if (!Loader.requiredByMap) Loader.requiredByMap = {}; - Ext.Array.each(dependencies, function(dependency){ - if (!Loader.requiredByMap[dependency]) Loader.requiredByMap[dependency] = []; - Loader.requiredByMap[dependency].push(className); - }); - // - detectDeadlock = function(cls) { - deadlockPath.push(cls); - - if (requiresMap[cls]) { - if (Ext.Array.contains(requiresMap[cls], className)) { - throw new Error("Deadlock detected while loading dependencies! '" + className + "' and '" + - deadlockPath[1] + "' " + "mutually require each other. Path: " + - deadlockPath.join(' -> ') + " -> " + deadlockPath[0]); - } - - for (i = 0,ln = requiresMap[cls].length; i < ln; i++) { - detectDeadlock(requiresMap[cls][i]); - } - } - }; - - detectDeadlock(className); - } - - // - // - - Loader.require(dependencies, function() { - for (i = 0,ln = dependencyProperties.length; i < ln; i++) { - propertyName = dependencyProperties[i]; - - if (data.hasOwnProperty(propertyName)) { - propertyValue = data[propertyName]; - - if (typeof propertyValue == 'string') { - data[propertyName] = Manager.get(propertyValue); - } - else if (propertyValue instanceof Array) { - for (j = 0, subLn = propertyValue.length; j < subLn; j++) { - value = propertyValue[j]; - - if (typeof value == 'string') { - data[propertyName][j] = Manager.get(value); - } - } - } - else if (typeof propertyValue != 'function') { - for (var k in propertyValue) { - if (propertyValue.hasOwnProperty(k)) { - value = propertyValue[k]; - - if (typeof value == 'string') { - data[propertyName][k] = Manager.get(value); - } - } - } - } - } - } - - continueFn.call(me, cls, data, hooks); - }); - - return false; - }, true, 'after', 'className'); - - // - /** - * @cfg {String[]} uses - * @member Ext.Class - * List of optional classes to load together with this class. These aren't necessarily loaded before - * this class is created, but are guaranteed to be available before Ext.onReady listeners are - * invoked - */ - Manager.registerPostprocessor('uses', function(name, cls, data) { - var uses = arrayFrom(data.uses), - items = [], - i, ln, item; - - for (i = 0,ln = uses.length; i < ln; i++) { - item = uses[i]; - - if (typeof item == 'string') { - items.push(item); - } - } - - Loader.addOptionalRequires(items); - }); - - Manager.onCreated(function(className) { - this.historyPush(className); - }, Loader); - // - -})(Ext.ClassManager, Ext.Class, Ext.Function.flexSetter, Ext.Function.alias, - Ext.Function.pass, Ext.Array.from, Ext.Array.erase, Ext.Array.include); - -// initalize the default path of the framework -// trimmed down version of sench-touch-debug-suffix.js -// with alias / alternates removed, as those are handled separately by -// compiler-generated metadata -(function() { - var scripts = document.getElementsByTagName('script'), - currentScript = scripts[scripts.length - 1], - src = currentScript.src, - path = src.substring(0, src.lastIndexOf('/') + 1), - Loader = Ext.Loader; - - // - // if we're running in dev mode out of the repo src tree, then this - // file will potentially be loaded from the touch/src/core/class folder - // so we'll need to adjust for that - if(src.indexOf("src/core/class/") != -1) { - path = path + "../../../"; - } - // - - - Loader.setConfig({ - enabled: true, - disableCaching: !/[?&](cache|breakpoint)/i.test(location.search), - paths: { - 'Ext' : path + 'src' - } - }); - -})(); - -//@tag dom,core -//@define Ext.EventManager -//@define Ext.core.EventManager -//@require Ext.Loader - -/** - * @class Ext.EventManager - * - * This object has been deprecated in Sencha Touch 2.0.0. Please refer to the method documentation for specific alternatives. - * - * @deprecated 2.0.0 - * @singleton - * @private - */ - - -//@tag dom,core -//@define Ext-more -//@require Ext.EventManager - -/** - * @class Ext - * - * Ext is the global namespace for the whole Sencha Touch framework. Every class, function and configuration for the - * whole framework exists under this single global variable. The Ext singleton itself contains a set of useful helper - * functions (like {@link #apply}, {@link #min} and others), but most of the framework that you use day to day exists - * in specialized classes (for example {@link Ext.Panel}, {@link Ext.Carousel} and others). - * - * If you are new to Sencha Touch we recommend starting with the [Getting Started Guide][../../../getting_started/getting_started.html] to - * get a feel for how the framework operates. After that, use the more focused guides on subjects like panels, forms and data - * to broaden your understanding. - * - * The functions listed below are mostly utility functions used internally by many of the classes shipped in the - * framework, but also often useful in your own apps. - * - * A method that is crucial to beginning your application is {@link #setup Ext.setup}. Please refer to it's documentation, or the - * [Getting Started Guide][../../../getting_started/getting_started.html] as a reference on beginning your application. - * - * Ext.setup({ - * onReady: function() { - * Ext.Viewport.add({ - * xtype: 'component', - * html: 'Hello world!' - * }); - * } - * }); - * - * ###Further Reading - * [Getting Started Guide](../../../getting_started/getting_started.html) - */ -Ext.setVersion('touch', '2.4.2.571'); - -Ext.apply(Ext, { - /** - * The version of the framework - * @type String - */ - version: Ext.getVersion('touch'), - - /** - * @private - */ - idSeed: 0, - - /** - * Repaints the whole page. This fixes frequently encountered painting issues in mobile Safari. - */ - repaint: function() { - var mask = Ext.getBody().createChild({ - cls: Ext.baseCSSPrefix + 'mask ' + Ext.baseCSSPrefix + 'mask-transparent' - }); - setTimeout(function() { - mask.destroy(); - }, 0); - }, - - /** - * Generates unique ids. If the element is passes and it already has an `id`, it is unchanged. - * @param {Mixed} el (optional) The element to generate an id for. - * @param {String} [prefix=ext-gen] (optional) The `id` prefix. - * @return {String} The generated `id`. - */ - id: function(el, prefix) { - if (el && el.id) { - return el.id; - } - - el = Ext.getDom(el) || {}; - - if (el === document || el === document.documentElement) { - el.id = 'ext-app'; - } - else if (el === document.body) { - el.id = 'ext-body'; - } - else if (el === window) { - el.id = 'ext-window'; - } - - el.id = el.id || ((prefix || 'ext-') + (++Ext.idSeed)); - - return el.id; - }, - - /** - * Returns the current document body as an {@link Ext.Element}. - * @return {Ext.Element} The document body. - */ - getBody: function() { - if (!Ext.documentBodyElement) { - if (!document.body) { - throw new Error("[Ext.getBody] document.body does not exist at this point"); - } - - Ext.documentBodyElement = Ext.get(document.body); - } - - return Ext.documentBodyElement; - }, - - /** - * Returns the current document head as an {@link Ext.Element}. - * @return {Ext.Element} The document head. - */ - getHead: function() { - if (!Ext.documentHeadElement) { - Ext.documentHeadElement = Ext.get(document.head || document.getElementsByTagName('head')[0]); - } - - return Ext.documentHeadElement; - }, - - /** - * Returns the current HTML document object as an {@link Ext.Element}. - * @return {Ext.Element} The document. - */ - getDoc: function() { - if (!Ext.documentElement) { - Ext.documentElement = Ext.get(document); - } - - return Ext.documentElement; - }, - - /** - * This is shorthand reference to {@link Ext.ComponentMgr#get}. - * Looks up an existing {@link Ext.Component Component} by {@link Ext.Component#getId id} - * @param {String} id The component {@link Ext.Component#getId id} - * @return {Ext.Component} The Component, `undefined` if not found, or `null` if a - * Class was found. - */ - getCmp: function(id) { - return Ext.ComponentMgr.get(id); - }, - - /** - * Copies a set of named properties from the source object to the destination object. - * - * Example: - * - * ImageComponent = Ext.extend(Ext.Component, { - * initComponent: function() { - * this.autoEl = { tag: 'img' }; - * MyComponent.superclass.initComponent.apply(this, arguments); - * this.initialBox = Ext.copyTo({}, this.initialConfig, 'x,y,width,height'); - * } - * }); - * - * Important note: To borrow class prototype methods, use {@link Ext.Base#borrow} instead. - * - * @param {Object} dest The destination object. - * @param {Object} source The source object. - * @param {String/String[]} names Either an Array of property names, or a comma-delimited list - * of property names to copy. - * @param {Boolean} [usePrototypeKeys=false] (optional) Pass `true` to copy keys off of the prototype as well as the instance. - * @return {Object} The modified object. - */ - copyTo : function(dest, source, names, usePrototypeKeys) { - if (typeof names == 'string') { - names = names.split(/[,;\s]/); - } - Ext.each (names, function(name) { - if (usePrototypeKeys || source.hasOwnProperty(name)) { - dest[name] = source[name]; - } - }, this); - return dest; - }, - - /** - * Attempts to destroy any objects passed to it by removing all event listeners, removing them from the - * DOM (if applicable) and calling their destroy functions (if available). This method is primarily - * intended for arguments of type {@link Ext.Element} and {@link Ext.Component}. - * Any number of elements and/or components can be passed into this function in a single - * call as separate arguments. - * @param {Mixed...} args An {@link Ext.Element}, {@link Ext.Component}, or an Array of either of these to destroy. - */ - destroy: function() { - var args = arguments, - ln = args.length, - i, item; - - for (i = 0; i < ln; i++) { - item = args[i]; - - if (item) { - if (Ext.isArray(item)) { - this.destroy.apply(this, item); - } - else if (Ext.isFunction(item.destroy)) { - item.destroy(); - } - } - } - }, - - /** - * Return the dom node for the passed String (id), dom node, or Ext.Element. - * Here are some examples: - * - * // gets dom node based on id - * var elDom = Ext.getDom('elId'); - * - * // gets dom node based on the dom node - * var elDom1 = Ext.getDom(elDom); - * - * // If we don't know if we are working with an - * // Ext.Element or a dom node use Ext.getDom - * function(el){ - * var dom = Ext.getDom(el); - * // do something with the dom node - * } - * - * __Note:__ the dom node to be found actually needs to exist (be rendered, etc) - * when this method is called to be successful. - * @param {Mixed} el - * @return {HTMLElement} - */ - getDom: function(el) { - if (!el || !document) { - return null; - } - - return el.dom ? el.dom : (typeof el == 'string' ? document.getElementById(el) : el); - }, - - /** - * Removes this element from the document, removes all DOM event listeners, and deletes the cache reference. - * All DOM event listeners are removed from this element. - * @param {HTMLElement} node The node to remove. - */ - removeNode: function(node) { - if (node && node.parentNode && node.tagName != 'BODY') { - Ext.get(node).clearListeners(); - node.parentNode.removeChild(node); - delete Ext.cache[node.id]; - } - }, - - /** - * @private - */ - defaultSetupConfig: { - eventPublishers: { - dom: { - xclass: 'Ext.event.publisher.Dom' - }, - touchGesture: { - xclass: 'Ext.event.publisher.TouchGesture', - recognizers: { - drag: { - xclass: 'Ext.event.recognizer.Drag' - }, - tap: { - xclass: 'Ext.event.recognizer.Tap' - }, - doubleTap: { - xclass: 'Ext.event.recognizer.DoubleTap' - }, - longPress: { - xclass: 'Ext.event.recognizer.LongPress' - }, - swipe: { - xclass: 'Ext.event.recognizer.Swipe' - }, - pinch: { - xclass: 'Ext.event.recognizer.Pinch' - }, - rotate: { - xclass: 'Ext.event.recognizer.Rotate' - }, - edgeSwipe: { - xclass: 'Ext.event.recognizer.EdgeSwipe' - } - } - }, - componentDelegation: { - xclass: 'Ext.event.publisher.ComponentDelegation' - }, - componentPaint: { - xclass: 'Ext.event.publisher.ComponentPaint' - }, -// componentSize: { -// xclass: 'Ext.event.publisher.ComponentSize' -// }, - elementPaint: { - xclass: 'Ext.event.publisher.ElementPaint' - }, - elementSize: { - xclass: 'Ext.event.publisher.ElementSize' - } - // - ,seriesItemEvents: { - xclass: 'Ext.chart.series.ItemPublisher' - } - // - }, - - // - logger: { - enabled: true, - xclass: 'Ext.log.Logger', - minPriority: 'deprecate', - writers: { - console: { - xclass: 'Ext.log.writer.Console', - throwOnErrors: true, - formatter: { - xclass: 'Ext.log.formatter.Default' - } - } - } - }, - // - - animator: { - xclass: 'Ext.fx.Runner' - }, - - viewport: { - xclass: 'Ext.viewport.Viewport' - } - }, - - /** - * @private - */ - isSetup: false, - - /** - * This indicate the start timestamp of current cycle. - * It is only reliable during dom-event-initiated cycles and - * {@link Ext.draw.Animator} initiated cycles. - */ - frameStartTime: +new Date(), - - /** - * @private - */ - setupListeners: [], - - /** - * @private - */ - onSetup: function(fn, scope) { - if (Ext.isSetup) { - fn.call(scope); - } - else { - Ext.setupListeners.push({ - fn: fn, - scope: scope - }); - } - }, - - /** - * Ext.setup() is the entry-point to initialize a Sencha Touch application. Note that if your application makes - * use of MVC architecture, use {@link Ext#application} instead. - * - * This method accepts one single argument in object format. The most basic use of Ext.setup() is as follows: - * - * Ext.setup({ - * onReady: function() { - * // ... - * } - * }); - * - * This sets up the viewport, initializes the event system, instantiates a default animation runner, and a default - * logger (during development). When all of that is ready, it invokes the callback function given to the `onReady` key. - * - * The default scope (`this`) of `onReady` is the main viewport. By default the viewport instance is stored in - * {@link Ext.Viewport}. For example, this snippet adds a 'Hello World' button that is centered on the screen: - * - * Ext.setup({ - * onReady: function() { - * this.add({ - * xtype: 'button', - * centered: true, - * text: 'Hello world!' - * }); // Equivalent to Ext.Viewport.add(...) - * } - * }); - * - * @param {Object} config An object with the following config options: - * - * @param {Function} config.onReady - * A function to be called when the application is ready. Your application logic should be here. - * - * @param {Object} config.viewport - * A custom config object to be used when creating the global {@link Ext.Viewport} instance. Please refer to the - * {@link Ext.Viewport} documentation for more information. - * - * Ext.setup({ - * viewport: { - * width: 500, - * height: 500 - * }, - * onReady: function() { - * // ... - * } - * }); - * - * @param {String/Object} config.icon - * Specifies a set of URLs to the application icon for different device form factors. This icon is displayed - * when the application is added to the device's Home Screen. - * - * Ext.setup({ - * icon: { - * 57: 'resources/icons/Icon.png', - * 72: 'resources/icons/Icon~ipad.png', - * 114: 'resources/icons/Icon@2x.png', - * 144: 'resources/icons/Icon~ipad@2x.png' - * }, - * onReady: function() { - * // ... - * } - * }); - * - * Each key represents the dimension of the icon as a square shape. For example: '57' is the key for a 57 x 57 - * icon image. Here is the breakdown of each dimension and its device target: - * - * - 57: Non-retina iPhone, iPod touch, and all Android devices - * - 72: Retina iPhone and iPod touch - * - 114: Non-retina iPad (first and second generation) - * - 144: Retina iPad (third generation) - * - * Note that the dimensions of the icon images must be exactly 57x57, 72x72, 114x114 and 144x144 respectively. - * - * It is highly recommended that you provide all these different sizes to accommodate a full range of - * devices currently available. However if you only have one icon in one size, make it 57x57 in size and - * specify it as a string value. This same icon will be used on all supported devices. - * - * Ext.setup({ - * icon: 'resources/icons/Icon.png', - * onReady: function() { - * // ... - * } - * }); - * - * @param {Object} config.startupImage - * Specifies a set of URLs to the application startup images for different device form factors. This image is - * displayed when the application is being launched from the Home Screen icon. Note that this currently only applies - * to iOS devices. - * - * Ext.setup({ - * startupImage: { - * '320x460': 'resources/startup/320x460.jpg', - * '640x920': 'resources/startup/640x920.png', - * '640x1096': 'resources/startup/640x1096.png', - * '768x1004': 'resources/startup/768x1004.png', - * '748x1024': 'resources/startup/748x1024.png', - * '1536x2008': 'resources/startup/1536x2008.png', - * '1496x2048': 'resources/startup/1496x2048.png' - * }, - * onReady: function() { - * // ... - * } - * }); - * - * Each key represents the dimension of the image. For example: '320x460' is the key for a 320px x 460px image. - * Here is the breakdown of each dimension and its device target: - * - * - 320x460: Non-retina iPhone, iPod touch, and all Android devices - * - 640x920: Retina iPhone and iPod touch - * - 640x1096: iPhone 5 and iPod touch (fifth generation) - * - 768x1004: Non-retina iPad (first and second generation) in portrait orientation - * - 748x1024: Non-retina iPad (first and second generation) in landscape orientation - * - 1536x2008: Retina iPad (third generation) in portrait orientation - * - 1496x2048: Retina iPad (third generation) in landscape orientation - * - * Please note that there's no automatic fallback mechanism for the startup images. In other words, if you don't specify - * a valid image for a certain device, nothing will be displayed while the application is being launched on that device. - * - * @param {Boolean} config.isIconPrecomposed - * True to not having a glossy effect added to the icon by the OS, which will preserve its exact look. This currently - * only applies to iOS devices. - * - * @param {String} config.statusBarStyle - * The style of status bar to be shown on applications added to the iOS home screen. Valid options are: - * - * * `default` - * * `black` - * * `black-translucent` - * - * @param {String[]} config.requires - * An array of required classes for your application which will be automatically loaded before `onReady` is invoked. - * Please refer to {@link Ext.Loader} and {@link Ext.Loader#require} for more information. - * - * Ext.setup({ - * requires: ['Ext.Button', 'Ext.tab.Panel'], - * onReady: function() { - * // ... - * } - * }); - * - * @param {Object} config.eventPublishers - * Sencha Touch, by default, includes various {@link Ext.event.recognizer.Recognizer} subclasses to recognize events fired - * in your application. The list of default recognizers can be found in the documentation for - * {@link Ext.event.recognizer.Recognizer}. - * - * To change the default recognizers, you can use the following syntax: - * - * Ext.setup({ - * eventPublishers: { - * touchGesture: { - * recognizers: { - * swipe: { - * // this will include both vertical and horizontal swipe recognizers - * xclass: 'Ext.event.recognizer.Swipe' - * } - * } - * } - * }, - * onReady: function() { - * // ... - * } - * }); - * - * You can also disable recognizers using this syntax: - * - * Ext.setup({ - * eventPublishers: { - * touchGesture: { - * recognizers: { - * swipe: null, - * pinch: null, - * rotate: null - * } - * } - * }, - * onReady: function() { - * // ... - * } - * }); - */ - setup: function(config) { - var defaultSetupConfig = Ext.defaultSetupConfig, - emptyFn = Ext.emptyFn, - onReady = config.onReady || emptyFn, - onUpdated = config.onUpdated || emptyFn, - scope = config.scope, - requires = Ext.Array.from(config.requires), - extOnReady = Ext.onReady, - head = Ext.getHead(), - callback, viewport, precomposed; - - Ext.setup = function() { - throw new Error("Ext.setup has already been called before"); - }; - - delete config.requires; - delete config.onReady; - delete config.onUpdated; - delete config.scope; - - Ext.require(['Ext.event.Dispatcher']); - - callback = function() { - var listeners = Ext.setupListeners, - ln = listeners.length, - i, listener; - - delete Ext.setupListeners; - Ext.isSetup = true; - - for (i = 0; i < ln; i++) { - listener = listeners[i]; - listener.fn.call(listener.scope); - } - - Ext.onReady = extOnReady; - Ext.onReady(onReady, scope); - }; - - Ext.onUpdated = onUpdated; - Ext.onReady = function(fn, scope) { - var origin = onReady; - - onReady = function() { - origin(); - Ext.onReady(fn, scope); - }; - }; - - config = Ext.merge({}, defaultSetupConfig, config); - - Ext.onDocumentReady(function() { - Ext.factoryConfig(config, function(data) { - Ext.event.Dispatcher.getInstance().setPublishers(data.eventPublishers); - - if (data.logger) { - Ext.Logger = data.logger; - } - - if (data.animator) { - Ext.Animator = data.animator; - } - - if (data.viewport) { - Ext.Viewport = viewport = data.viewport; - - if (!scope) { - scope = viewport; - } - - Ext.require(requires, function() { - Ext.Viewport.on('ready', callback, null, {single: true}); - }); - } - else { - Ext.require(requires, callback); - } - }); - - if (!Ext.microloaded && navigator.userAgent.match(/IEMobile\/10\.0/)) { - var msViewportStyle = document.createElement("style"); - msViewportStyle.appendChild( - document.createTextNode( - "@media screen and (orientation: portrait) {" + - "@-ms-viewport {width: 320px !important;}" + - "}" + - "@media screen and (orientation: landscape) {" + - "@-ms-viewport {width: 560px !important;}" + - "}" - ) - ); - head.appendChild(msViewportStyle); - } - }); - - function addMeta(name, content) { - var meta = document.createElement('meta'); - - meta.setAttribute('name', name); - meta.setAttribute('content', content); - head.append(meta); - } - - function addIcon(href, sizes, precomposed) { - var link = document.createElement('link'); - link.setAttribute('rel', 'apple-touch-icon' + (precomposed ? '-precomposed' : '')); - link.setAttribute('href', href); - if (sizes) { - link.setAttribute('sizes', sizes); - } - head.append(link); - } - - function addStartupImage(href, media) { - var link = document.createElement('link'); - link.setAttribute('rel', 'apple-touch-startup-image'); - link.setAttribute('href', href); - if (media) { - link.setAttribute('media', media); - } - head.append(link); - } - - var icon = config.icon, - isIconPrecomposed = Boolean(config.isIconPrecomposed), - startupImage = config.startupImage || {}, - statusBarStyle = config.statusBarStyle || 'black', - devicePixelRatio = window.devicePixelRatio || 1; - - - if (navigator.standalone) { - addMeta('viewport', 'width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0'); - } - else { - addMeta('viewport', 'initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, minimum-ui'); - } - addMeta('apple-mobile-web-app-capable', 'yes'); - addMeta('apple-touch-fullscreen', 'yes'); - if (Ext.browser.is.ie) { - addMeta('msapplication-tap-highlight', 'no'); - } - - // status bar style - if (statusBarStyle) { - addMeta('apple-mobile-web-app-status-bar-style', statusBarStyle); - } - - if (Ext.isString(icon)) { - icon = { - 57: icon, - 72: icon, - 114: icon, - 144: icon - }; - } - else if (!icon) { - icon = {}; - } - - - if (Ext.os.is.iPad) { - if (devicePixelRatio >= 2) { - // Retina iPad - Landscape - if ('1496x2048' in startupImage) { - addStartupImage(startupImage['1496x2048'], '(orientation: landscape)'); - } - // Retina iPad - Portrait - if ('1536x2008' in startupImage) { - addStartupImage(startupImage['1536x2008'], '(orientation: portrait)'); - } - - // Retina iPad - if ('144' in icon) { - addIcon(icon['144'], '144x144', isIconPrecomposed); - } - } - else { - // Non-Retina iPad - Landscape - if ('748x1024' in startupImage) { - addStartupImage(startupImage['748x1024'], '(orientation: landscape)'); - } - // Non-Retina iPad - Portrait - if ('768x1004' in startupImage) { - addStartupImage(startupImage['768x1004'], '(orientation: portrait)'); - } - - // Non-Retina iPad - if ('72' in icon) { - addIcon(icon['72'], '72x72', isIconPrecomposed); - } - } - } - else { - // Retina iPhone, iPod touch with iOS version >= 4.3 - if (devicePixelRatio >= 2 && Ext.os.version.gtEq('4.3')) { - if (Ext.os.is.iPhone5) { - addStartupImage(startupImage['640x1096']); - } else { - addStartupImage(startupImage['640x920']); - } - - // Retina iPhone and iPod touch - if ('114' in icon) { - addIcon(icon['114'], '114x114', isIconPrecomposed); - } - } - else { - addStartupImage(startupImage['320x460']); - - // Non-Retina iPhone, iPod touch, and Android devices - if ('57' in icon) { - addIcon(icon['57'], null, isIconPrecomposed); - } - } - } - }, - - /** - * @member Ext - * @method application - * - * Loads Ext.app.Application class and starts it up with given configuration after the page is ready. - * - * Ext.application({ - * launch: function() { - * alert('Application launched!'); - * } - * }); - * - * See {@link Ext.app.Application} for details. - * - * @param {Object} config An object with the following config options: - * - * @param {Function} config.launch - * A function to be called when the application is ready. Your application logic should be here. Please see {@link Ext.app.Application} - * for details. - * - * @param {Object} config.viewport - * An object to be used when creating the global {@link Ext.Viewport} instance. Please refer to the {@link Ext.Viewport} - * documentation for more information. - * - * Ext.application({ - * viewport: { - * layout: 'vbox' - * }, - * launch: function() { - * Ext.Viewport.add({ - * flex: 1, - * html: 'top (flex: 1)' - * }); - * - * Ext.Viewport.add({ - * flex: 4, - * html: 'bottom (flex: 4)' - * }); - * } - * }); - * - * @param {String/Object} config.icon - * Specifies a set of URLs to the application icon for different device form factors. This icon is displayed - * when the application is added to the device's Home Screen. - * - * Ext.application({ - * icon: { - * 57: 'resources/icons/Icon.png', - * 72: 'resources/icons/Icon~ipad.png', - * 114: 'resources/icons/Icon@2x.png', - * 144: 'resources/icons/Icon~ipad@2x.png' - * }, - * launch: function() { - * // ... - * } - * }); - * - * Each key represents the dimension of the icon as a square shape. For example: '57' is the key for a 57 x 57 - * icon image. Here is the breakdown of each dimension and its device target: - * - * - 57: Non-retina iPhone, iPod touch, and all Android devices - * - 72: Retina iPhone and iPod touch - * - 114: Non-retina iPad (first and second generation) - * - 144: Retina iPad (third generation) - * - * Note that the dimensions of the icon images must be exactly 57x57, 72x72, 114x114 and 144x144 respectively. - * - * It is highly recommended that you provide all these different sizes to accommodate a full range of - * devices currently available. However if you only have one icon in one size, make it 57x57 in size and - * specify it as a string value. This same icon will be used on all supported devices. - * - * Ext.setup({ - * icon: 'resources/icons/Icon.png', - * onReady: function() { - * // ... - * } - * }); - * - * @param {Object} config.startupImage - * Specifies a set of URLs to the application startup images for different device form factors. This image is - * displayed when the application is being launched from the Home Screen icon. Note that this currently only applies - * to iOS devices. - * - * Ext.application({ - * startupImage: { - * '320x460': 'resources/startup/320x460.jpg', - * '640x920': 'resources/startup/640x920.png', - * '640x1096': 'resources/startup/640x1096.png', - * '768x1004': 'resources/startup/768x1004.png', - * '748x1024': 'resources/startup/748x1024.png', - * '1536x2008': 'resources/startup/1536x2008.png', - * '1496x2048': 'resources/startup/1496x2048.png' - * }, - * launch: function() { - * // ... - * } - * }); - * - * Each key represents the dimension of the image. For example: '320x460' is the key for a 320px x 460px image. - * Here is the breakdown of each dimension and its device target: - * - * - 320x460: Non-retina iPhone, iPod touch, and all Android devices - * - 640x920: Retina iPhone and iPod touch - * - 640x1096: iPhone 5 and iPod touch (fifth generation) - * - 768x1004: Non-retina iPad (first and second generation) in portrait orientation - * - 748x1024: Non-retina iPad (first and second generation) in landscape orientation - * - 1536x2008: Retina iPad (third generation) in portrait orientation - * - 1496x2048: Retina iPad (third generation) in landscape orientation - * - * Please note that there's no automatic fallback mechanism for the startup images. In other words, if you don't specify - * a valid image for a certain device, nothing will be displayed while the application is being launched on that device. - * - * @param {Boolean} config.isIconPrecomposed - * True to not having a glossy effect added to the icon by the OS, which will preserve its exact look. This currently - * only applies to iOS devices. - * - * @param {String} config.statusBarStyle - * The style of status bar to be shown on applications added to the iOS home screen. Valid options are: - * - * * `default` - * * `black` - * * `black-translucent` - * - * @param {String[]} config.requires - * An array of required classes for your application which will be automatically loaded if {@link Ext.Loader#enabled} is set - * to `true`. Please refer to {@link Ext.Loader} and {@link Ext.Loader#require} for more information. - * - * Ext.application({ - * requires: ['Ext.Button', 'Ext.tab.Panel'], - * launch: function() { - * // ... - * } - * }); - * - * @param {Object} config.eventPublishers - * Sencha Touch, by default, includes various {@link Ext.event.recognizer.Recognizer} subclasses to recognize events fired - * in your application. The list of default recognizers can be found in the documentation for {@link Ext.event.recognizer.Recognizer}. - * - * To change the default recognizers, you can use the following syntax: - * - * Ext.application({ - * eventPublishers: { - * touchGesture: { - * recognizers: { - * swipe: { - * // this will include both vertical and horizontal swipe recognizers - * xclass: 'Ext.event.recognizer.Swipe' - * } - * } - * } - * }, - * launch: function() { - * // ... - * } - * }); - * - * You can also disable recognizers using this syntax: - * - * Ext.application({ - * eventPublishers: { - * touchGesture: { - * recognizers: { - * swipe: null, - * pinch: null, - * rotate: null - * } - * } - * }, - * launch: function() { - * // ... - * } - * }); - * - * @param {Function} config.onUpdated - * This function will execute once the production microloader determines there are updates to the application and has - * merged the updates into the application. You can then alert the user there was an update and can then reload - * the application to execute the updated application. - * - * Ext.application({ - * onUpdated : function() { - * Ext.Msg.confirm( - * 'Application Update', - * 'This application has just successfully been updated to the latest version. Reload now?', - * function(buttonId) { - * if (buttonId === 'yes') { - * window.location.reload(); - * } - * } - * ); - * } - * }); - */ - application: function(config) { - var appName = config.name, - onReady, scope, requires; - - if (!config) { - config = {}; - } - - if (!Ext.Loader.config.paths[appName]) { - Ext.Loader.setPath(appName, config.appFolder || 'app'); - } - - requires = Ext.Array.from(config.requires); - config.requires = ['Ext.app.Application']; - - onReady = config.onReady; - scope = config.scope; - - config.onReady = function() { - config.requires = requires; - new Ext.app.Application(config); - - if (onReady) { - onReady.call(scope); - } - }; - - Ext.setup(config); - }, - - /** - * @private - * @param {Object} config - * @param {Function} callback - * @member Ext - */ - factoryConfig: function(config, callback) { - var isSimpleObject = Ext.isSimpleObject(config); - - if (isSimpleObject && config.xclass) { - var className = config.xclass; - - delete config.xclass; - - Ext.require(className, function() { - Ext.factoryConfig(config, function(cfg) { - callback(Ext.create(className, cfg)); - }); - }); - - return; - } - - var isArray = Ext.isArray(config), - keys = [], - key, value, i, ln; - - if (isSimpleObject || isArray) { - if (isSimpleObject) { - for (key in config) { - if (config.hasOwnProperty(key)) { - value = config[key]; - if (Ext.isSimpleObject(value) || Ext.isArray(value)) { - keys.push(key); - } - } - } - } - else { - for (i = 0,ln = config.length; i < ln; i++) { - value = config[i]; - - if (Ext.isSimpleObject(value) || Ext.isArray(value)) { - keys.push(i); - } - } - } - - i = 0; - ln = keys.length; - - if (ln === 0) { - callback(config); - return; - } - - function fn(value) { - config[key] = value; - i++; - factory(); - } - - function factory() { - if (i >= ln) { - callback(config); - return; - } - - key = keys[i]; - value = config[key]; - - Ext.factoryConfig(value, fn); - } - - factory(); - return; - } - - callback(config); - }, - - /** - * A global factory method to instantiate a class from a config object. For example, these two calls are equivalent: - * - * Ext.factory({ text: 'My Button' }, 'Ext.Button'); - * Ext.create('Ext.Button', { text: 'My Button' }); - * - * If an existing instance is also specified, it will be updated with the supplied config object. This is useful - * if you need to either create or update an object, depending on if an instance already exists. For example: - * - * var button; - * button = Ext.factory({ text: 'New Button' }, 'Ext.Button', button); // Button created - * button = Ext.factory({ text: 'Updated Button' }, 'Ext.Button', button); // Button updated - * - * @param {Object} config The config object to instantiate or update an instance with. - * @param {String} classReference The class to instantiate from. - * @param {Object} [instance] The instance to update. - * @param {String} [aliasNamespace] - * @member Ext - */ - factory: function(config, classReference, instance, aliasNamespace) { - var manager = Ext.ClassManager, - newInstance; - - // If config is falsy or a valid instance, destroy the current instance - // (if it exists) and replace with the new one - if (!config || config.isInstance) { - if (instance && instance !== config) { - instance.destroy(); - } - - return config; - } - - if (aliasNamespace) { - // If config is a string value, treat it as an alias - if (typeof config == 'string') { - return manager.instantiateByAlias(aliasNamespace + '.' + config); - } - // Same if 'type' is given in config - else if (Ext.isObject(config) && 'type' in config) { - return manager.instantiateByAlias(aliasNamespace + '.' + config.type, config); - } - } - - if (config === true) { - return instance || manager.instantiate(classReference); - } - - // - if (!Ext.isObject(config)) { - Ext.Logger.error("Invalid config, must be a valid config object"); - } - // - - if ('xtype' in config) { - newInstance = manager.instantiateByAlias('widget.' + config.xtype, config); - } - else if ('xclass' in config) { - newInstance = manager.instantiate(config.xclass, config); - } - - if (newInstance) { - if (instance) { - instance.destroy(); - } - - return newInstance; - } - - if (instance) { - return instance.setConfig(config); - } - - return manager.instantiate(classReference, config); - }, - - /** - * @private - * @member Ext - */ - deprecateClassMember: function(cls, oldName, newName, message) { - return this.deprecateProperty(cls.prototype, oldName, newName, message); - }, - - /** - * @private - * @member Ext - */ - deprecateClassMembers: function(cls, members) { - var prototype = cls.prototype, - oldName, newName; - - for (oldName in members) { - if (members.hasOwnProperty(oldName)) { - newName = members[oldName]; - - this.deprecateProperty(prototype, oldName, newName); - } - } - }, - - /** - * @private - * @member Ext - */ - deprecateProperty: function(object, oldName, newName, message) { - if (!message) { - message = "'" + oldName + "' is deprecated"; - } - if (newName) { - message += ", please use '" + newName + "' instead"; - } - - if (newName) { - Ext.Object.defineProperty(object, oldName, { - get: function() { - // - Ext.Logger.deprecate(message, 1); - // - return this[newName]; - }, - set: function(value) { - // - Ext.Logger.deprecate(message, 1); - // - - this[newName] = value; - }, - configurable: true - }); - } - }, - - /** - * @private - * @member Ext - */ - deprecatePropertyValue: function(object, name, value, message) { - Ext.Object.defineProperty(object, name, { - get: function() { - // - Ext.Logger.deprecate(message, 1); - // - return value; - }, - configurable: true - }); - }, - - /** - * @private - * @member Ext - */ - deprecateMethod: function(object, name, method, message) { - object[name] = function() { - // - Ext.Logger.deprecate(message, 2); - // - if (method) { - return method.apply(this, arguments); - } - }; - }, - - /** - * @private - * @member Ext - */ - deprecateClassMethod: function(cls, name, method, message) { - if (typeof name != 'string') { - var from, to; - - for (from in name) { - if (name.hasOwnProperty(from)) { - to = name[from]; - Ext.deprecateClassMethod(cls, from, to); - } - } - return; - } - - var isLateBinding = typeof method == 'string', - member; - - if (!message) { - message = "'" + name + "()' is deprecated, please use '" + (isLateBinding ? method : method.name) + - "()' instead"; - } - - if (isLateBinding) { - member = function() { - // - Ext.Logger.deprecate(message, this); - // - - return this[method].apply(this, arguments); - }; - } - else { - member = function() { - // - Ext.Logger.deprecate(message, this); - // - - return method.apply(this, arguments); - }; - } - - if (name in cls.prototype) { - Ext.Object.defineProperty(cls.prototype, name, { - value: null, - writable: true, - configurable: true - }); - } - - cls.addMember(name, member); - }, - - // - /** - * Useful snippet to show an exact, narrowed-down list of top-level Components that are not yet destroyed. - * @private - */ - showLeaks: function() { - var map = Ext.ComponentManager.all.map, - leaks = [], - parent; - - Ext.Object.each(map, function(id, component) { - while ((parent = component.getParent()) && map.hasOwnProperty(parent.getId())) { - component = parent; - } - - if (leaks.indexOf(component) === -1) { - leaks.push(component); - } - }); - - console.log(leaks); - }, - // - - /** - * True when the document is fully initialized and ready for action - * @type Boolean - * @member Ext - * @private - */ - isReady : false, - - /** - * @private - * @member Ext - */ - readyListeners: [], - - /** - * @private - * @member Ext - */ - triggerReady: function() { - var listeners = Ext.readyListeners, - i, ln, listener; - - if (!Ext.isReady) { - Ext.isReady = true; - - for (i = 0,ln = listeners.length; i < ln; i++) { - listener = listeners[i]; - listener.fn.call(listener.scope); - } - delete Ext.readyListeners; - } - }, - - /** - * @private - * @member Ext - */ - onDocumentReady: function(fn, scope) { - if (Ext.isReady) { - fn.call(scope); - } - else { - var triggerFn = Ext.triggerReady; - - Ext.readyListeners.push({ - fn: fn, - scope: scope - }); - - if ((Ext.browser.is.WebWorks || Ext.browser.is.PhoneGap) && !Ext.os.is.Desktop) { - if (!Ext.readyListenerAttached) { - Ext.readyListenerAttached = true; - document.addEventListener(Ext.browser.is.PhoneGap ? 'deviceready' : 'webworksready', triggerFn, false); - } - } - else { - var readyStateRe = (/MSIE 10/.test(navigator.userAgent)) ? /complete|loaded/ : /interactive|complete|loaded/; - if (document.readyState.match(readyStateRe) !== null) { - triggerFn(); - } - else if (!Ext.readyListenerAttached) { - Ext.readyListenerAttached = true; - window.addEventListener('DOMContentLoaded', function() { - if (navigator.standalone) { - // When running from Home Screen, the splash screen will not disappear until all - // external resource requests finish. - // The first timeout clears the splash screen - // The second timeout allows inital HTML content to be displayed - setTimeout(function() { - setTimeout(function() { - triggerFn(); - }, 1); - }, 1); - } - else { - setTimeout(function() { - triggerFn(); - }, 1); - } - }, false); - } - } - } - }, - - /** - * Calls function after specified delay, or right away when delay == 0. - * @param {Function} callback The callback to execute. - * @param {Object} scope (optional) The scope to execute in. - * @param {Array} args (optional) The arguments to pass to the function. - * @param {Number} delay (optional) Pass a number to delay the call by a number of milliseconds. - * @member Ext - */ - callback: function(callback, scope, args, delay) { - if (Ext.isFunction(callback)) { - args = args || []; - scope = scope || window; - if (delay) { - Ext.defer(callback, delay, scope, args); - } else { - callback.apply(scope, args); - } - } - } -}); - -// -Ext.Object.defineProperty(Ext, 'Msg', { - get: function() { - Ext.Logger.error("Using Ext.Msg without requiring Ext.MessageBox"); - return null; - }, - set: function(value) { - Ext.Object.defineProperty(Ext, 'Msg', { - value: value - }); - return value; - }, - configurable: true -}); -// - - -//@tag dom,core -//@require Ext-more - -/** - * Provides information about browser. - * - * Should not be manually instantiated unless for unit-testing. - * Access the global instance stored in {@link Ext.browser} instead. - * @private - */ -Ext.define('Ext.env.Browser', { - - - - - statics: { - browserNames: { - ie: 'IE', - firefox: 'Firefox', - safari: 'Safari', - chrome: 'Chrome', - opera: 'Opera', - dolfin: 'Dolfin', - webosbrowser: 'webOSBrowser', - chromeMobile: 'ChromeMobile', - chromeiOS: 'ChromeiOS', - silk: 'Silk', - other: 'Other' - }, - engineNames: { - webkit: 'WebKit', - gecko: 'Gecko', - presto: 'Presto', - trident: 'Trident', - other: 'Other' - }, - enginePrefixes: { - webkit: 'AppleWebKit/', - gecko: 'Gecko/', - presto: 'Presto/', - trident: 'Trident/' - }, - browserPrefixes: { - ie: 'MSIE ', - firefox: 'Firefox/', - chrome: 'Chrome/', - safari: 'Version/', - opera: 'OPR/', - dolfin: 'Dolfin/', - webosbrowser: 'wOSBrowser/', - chromeMobile: 'CrMo/', - chromeiOS: 'CriOS/', - silk: 'Silk/' - } - }, - - styleDashPrefixes: { - WebKit: '-webkit-', - Gecko: '-moz-', - Trident: '-ms-', - Presto: '-o-', - Other: '' - }, - - stylePrefixes: { - WebKit: 'Webkit', - Gecko: 'Moz', - Trident: 'ms', - Presto: 'O', - Other: '' - }, - - propertyPrefixes: { - WebKit: 'webkit', - Gecko: 'moz', - Trident: 'ms', - Presto: 'o', - Other: '' - }, - - // scope: Ext.env.Browser.prototype - - /** - * A "hybrid" property, can be either accessed as a method call, for example: - * - * if (Ext.browser.is('IE')) { - * // ... - * } - * - * Or as an object with Boolean properties, for example: - * - * if (Ext.browser.is.IE) { - * // ... - * } - * - * Versions can be conveniently checked as well. For example: - * - * if (Ext.browser.is.IE6) { - * // Equivalent to (Ext.browser.is.IE && Ext.browser.version.equals(6)) - * } - * - * __Note:__ Only {@link Ext.Version#getMajor major component} and {@link Ext.Version#getShortVersion simplified} - * value of the version are available via direct property checking. - * - * Supported values are: - * - * - IE - * - Firefox - * - Safari - * - Chrome - * - Opera - * - WebKit - * - Gecko - * - Presto - * - Trident - * - WebView - * - Other - * - * @param {String} value The OS name to check. - * @return {Boolean} - */ - is: Ext.emptyFn, - - /** - * The full name of the current browser. - * Possible values are: - * - * - IE - * - Firefox - * - Safari - * - Chrome - * - Opera - * - Other - * @type String - * @readonly - */ - name: null, - - /** - * Refer to {@link Ext.Version}. - * @type Ext.Version - * @readonly - */ - version: null, - - /** - * The full name of the current browser's engine. - * Possible values are: - * - * - WebKit - * - Gecko - * - Presto - * - Trident - * - Other - * @type String - * @readonly - */ - engineName: null, - - /** - * Refer to {@link Ext.Version}. - * @type Ext.Version - * @readonly - */ - engineVersion: null, - - setFlag: function(name, value) { - if (typeof value == 'undefined') { - value = true; - } - - this.is[name] = value; - this.is[name.toLowerCase()] = value; - - return this; - }, - - constructor: function(userAgent) { - /** - * @property {String} - * Browser User Agent string. - */ - this.userAgent = userAgent; - - var statics = this.statics(), - browserMatch = userAgent.match(new RegExp('((?:' + Ext.Object.getValues(statics.browserPrefixes).join(')|(?:') + '))([\\w\\._]+)')), - engineMatch = userAgent.match(new RegExp('((?:' + Ext.Object.getValues(statics.enginePrefixes).join(')|(?:') + '))([\\w\\._]+)')), - browserNames = statics.browserNames, - browserName = browserNames.other, - engineNames = statics.engineNames, - engineName = engineNames.other, - browserVersion = '', - engineVersion = '', - isWebView = false, - is, i, name; - - is = this.is = function(name) { - return is[name] === true; - }; - - if (browserMatch) { - browserName = browserNames[Ext.Object.getKey(statics.browserPrefixes, browserMatch[1])]; - browserVersion = new Ext.Version(browserMatch[2]); - } - - if (engineMatch) { - engineName = engineNames[Ext.Object.getKey(statics.enginePrefixes, engineMatch[1])]; - engineVersion = new Ext.Version(engineMatch[2]); - } - - if (engineName == 'Trident' && browserName != 'IE') { - browserName = 'IE'; - var version = userAgent.match(/.*rv:(\d+.\d+)/); - if (version && version.length) { - version = version[1]; - browserVersion = new Ext.Version(version); - } - } - - // Facebook changes the userAgent when you view a website within their iOS app. For some reason, the strip out information - // about the browser, so we have to detect that and fake it... - if (userAgent.match(/FB/) && browserName == "Other") { - browserName = browserNames.safari; - engineName = engineNames.webkit; - } - - if (userAgent.match(/Android.*Chrome/g)) { - browserName = 'ChromeMobile'; - } - - if (userAgent.match(/OPR/)) { - browserName = 'Opera'; - browserMatch = userAgent.match(/OPR\/(\d+.\d+)/); - browserVersion = new Ext.Version(browserMatch[1]); - } - - if(browserName === 'Safari' && userAgent.match(/BB10/)) { - browserName = 'BlackBerry'; - } - - Ext.apply(this, { - engineName: engineName, - engineVersion: engineVersion, - name: browserName, - version: browserVersion - }); - - this.setFlag(browserName); - - if (browserVersion) { - this.setFlag(browserName + (browserVersion.getMajor() || '')); - this.setFlag(browserName + browserVersion.getShortVersion()); - } - - for (i in browserNames) { - if (browserNames.hasOwnProperty(i)) { - name = browserNames[i]; - - this.setFlag(name, browserName === name); - } - } - - this.setFlag(name); - - if (engineVersion) { - this.setFlag(engineName + (engineVersion.getMajor() || '')); - this.setFlag(engineName + engineVersion.getShortVersion()); - } - - for (i in engineNames) { - if (engineNames.hasOwnProperty(i)) { - name = engineNames[i]; - - this.setFlag(name, engineName === name); - } - } - - this.setFlag('Standalone', !!navigator.standalone); - - this.setFlag('Ripple', !!document.getElementById("tinyhippos-injected") && !Ext.isEmpty(window.top.ripple)); - this.setFlag('WebWorks', !!window.blackberry); - - if (typeof window.PhoneGap != 'undefined' || typeof window.Cordova != 'undefined' || typeof window.cordova != 'undefined') { - isWebView = true; - this.setFlag('PhoneGap'); - this.setFlag('Cordova'); - } - else if (!!window.isNK) { - isWebView = true; - this.setFlag('Sencha'); - } - - if (/(Glass)/i.test(userAgent)) { - this.setFlag('GoogleGlass'); - } - - // Check if running in UIWebView - if (/(iPhone|iPod|iPad).*AppleWebKit(?!.*Safari)(?!.*FBAN)/i.test(userAgent)) { - isWebView = true; - } - - // Flag to check if it we are in the WebView - this.setFlag('WebView', isWebView); - - /** - * @property {Boolean} - * `true` if browser is using strict mode. - */ - this.isStrict = document.compatMode == "CSS1Compat"; - - /** - * @property {Boolean} - * `true` if page is running over SSL. - */ - this.isSecure = /^https/i.test(window.location.protocol); - - return this; - }, - - getStyleDashPrefix: function() { - return this.styleDashPrefixes[this.engineName]; - }, - - getStylePrefix: function() { - return this.stylePrefixes[this.engineName]; - }, - - getVendorProperyName: function(name) { - var prefix = this.propertyPrefixes[this.engineName]; - - if (prefix.length > 0) { - return prefix + Ext.String.capitalize(name); - } - - return name; - }, - - getPreferredTranslationMethod: function(config) { - if (typeof config == 'object' && 'translationMethod' in config && config.translationMethod !== 'auto') { - return config.translationMethod; - } else { - if (this.is.AndroidStock2 || this.is.IE) { - return 'scrollposition'; - } - else { - return 'csstransform'; - } - } - } - -}, function() { - /** - * @class Ext.browser - * @extends Ext.env.Browser - * @singleton - * Provides useful information about the current browser. - * - * Example: - * - * if (Ext.browser.is.IE) { - * // IE specific code here - * } - * - * if (Ext.browser.is.WebKit) { - * // WebKit specific code here - * } - * - * console.log("Version " + Ext.browser.version); - * - * For a full list of supported values, refer to {@link #is} property/method. - * - * For more information, see the [Environment Detect Guide](../../../core_concepts/environment_detection.html) - */ - var browserEnv = Ext.browser = new this(Ext.global.navigator.userAgent); - -}); - -//@tag dom,core -//@require Ext.env.Browser - -/** - * Provides information about operating system environment. - * - * Should not be manually instantiated unless for unit-testing. - * Access the global instance stored in {@link Ext.os} instead. - * @private - */ -Ext.define('Ext.env.OS', { - - - - statics: { - names: { - ios: 'iOS', - android: 'Android', - windowsPhone: 'WindowsPhone', - webos: 'webOS', - blackberry: 'BlackBerry', - rimTablet: 'RIMTablet', - mac: 'MacOS', - win: 'Windows', - tizen: 'Tizen', - linux: 'Linux', - bada: 'Bada', - chrome: 'ChromeOS', - other: 'Other' - }, - prefixes: { - tizen: '(Tizen )', - ios: 'i(?:Pad|Phone|Pod)(?:.*)CPU(?: iPhone)? OS ', - android: '(Android |HTC_|Silk/)', // Some HTC devices ship with an OSX userAgent by default, - // so we need to add a direct check for HTC_ - windowsPhone: 'Windows Phone ', - blackberry: '(?:BlackBerry|BB)(?:.*)Version\/', - rimTablet: 'RIM Tablet OS ', - webos: '(?:webOS|hpwOS)\/', - bada: 'Bada\/', - chrome: 'CrOS ' - } - }, - - /** - * A "hybrid" property, can be either accessed as a method call, i.e: - * - * if (Ext.os.is('Android')) { - * // ... - * } - * - * or as an object with boolean properties, i.e: - * - * if (Ext.os.is.Android) { - * // ... - * } - * - * Versions can be conveniently checked as well. For example: - * - * if (Ext.os.is.Android2) { - * // Equivalent to (Ext.os.is.Android && Ext.os.version.equals(2)) - * } - * - * if (Ext.os.is.iOS32) { - * // Equivalent to (Ext.os.is.iOS && Ext.os.version.equals(3.2)) - * } - * - * Note that only {@link Ext.Version#getMajor major component} and {@link Ext.Version#getShortVersion simplified} - * value of the version are available via direct property checking. Supported values are: - * - * - iOS - * - iPad - * - iPhone - * - iPhone5 (also true for 4in iPods). - * - iPod - * - Android - * - WebOS - * - BlackBerry - * - Bada - * - MacOS - * - Windows - * - Linux - * - Other - * @param {String} value The OS name to check. - * @return {Boolean} - */ - is: Ext.emptyFn, - - /** - * @property {String} [name=null] - * @readonly - * The full name of the current operating system. Possible values are: - * - * - iOS - * - Android - * - WebOS - * - BlackBerry, - * - MacOS - * - Windows - * - Linux - * - Other - */ - name: null, - - /** - * @property {Ext.Version} [version=null] - * Refer to {@link Ext.Version} - * @readonly - */ - version: null, - - setFlag: function(name, value) { - if (typeof value == 'undefined') { - value = true; - } - - this.is[name] = value; - this.is[name.toLowerCase()] = value; - - return this; - }, - - constructor: function(userAgent, platform, browserScope) { - var statics = this.statics(), - names = statics.names, - prefixes = statics.prefixes, - name, - version = '', - i, prefix, match, item, is, match1; - - browserScope = browserScope || Ext.browser; - - is = this.is = function(name) { - return this.is[name] === true; - }; - - for (i in prefixes) { - if (prefixes.hasOwnProperty(i)) { - prefix = prefixes[i]; - - match = userAgent.match(new RegExp('(?:'+prefix+')([^\\s;]+)')); - - if (match) { - name = names[i]; - match1 = match[1]; - - // This is here because some HTC android devices show an OSX Snow Leopard userAgent by default. - // And the Kindle Fire doesn't have any indicator of Android as the OS in its User Agent - if (match1 && match1 == "HTC_") { - version = new Ext.Version("2.3"); - } - else if (match1 && match1 == "Silk/") { - version = new Ext.Version("2.3"); - } - else { - version = new Ext.Version(match[match.length - 1]); - } - - break; - } - } - } - - if (!name) { - name = names[(userAgent.toLowerCase().match(/mac|win|linux/) || ['other'])[0]]; - version = new Ext.Version(''); - } - - this.name = name; - this.version = version; - - if (platform) { - this.setFlag(platform.replace(/ simulator$/i, '')); - } - - this.setFlag(name); - - if (version) { - this.setFlag(name + (version.getMajor() || '')); - this.setFlag(name + version.getShortVersion()); - } - - for (i in names) { - if (names.hasOwnProperty(i)) { - item = names[i]; - - if (!is.hasOwnProperty(name)) { - this.setFlag(item, (name === item)); - } - } - } - - // Detect if the device is the iPhone 5. - if (this.name == "iOS" && window.screen.height == 568) { - this.setFlag('iPhone5'); - } - - - if (browserScope.is.Safari || browserScope.is.Silk) { - // Ext.browser.version.shortVersion == 501 is for debugging off device - if (this.is.Android2 || this.is.Android3 || browserScope.version.shortVersion == 501) { - browserScope.setFlag("AndroidStock"); - browserScope.setFlag("AndroidStock2"); - } - if (this.is.Android4) { - browserScope.setFlag("AndroidStock"); - browserScope.setFlag("AndroidStock4"); - } - } - - return this; - } - -}, function() { - - var navigation = Ext.global.navigator, - userAgent = navigation.userAgent, - osEnv, osName, deviceType; - - - /** - * @class Ext.os - * @extends Ext.env.OS - * @singleton - * Provides useful information about the current operating system environment. - * - * Example: - * - * if (Ext.os.is.Windows) { - * // Windows specific code here - * } - * - * if (Ext.os.is.iOS) { - * // iPad, iPod, iPhone, etc. - * } - * - * console.log("Version " + Ext.os.version); - * - * For a full list of supported values, refer to the {@link #is} property/method. - * - * For more information, see the [Environment Detect Guide](../../../core_concepts/environment_detection.html) - */ - Ext.os = osEnv = new this(userAgent, navigation.platform); - - osName = osEnv.name; - - var search = window.location.search.match(/deviceType=(Tablet|Phone)/), - nativeDeviceType = window.deviceType; - - // Override deviceType by adding a get variable of deviceType. NEEDED FOR DOCS APP. - // E.g: example/kitchen-sink.html?deviceType=Phone - if (search && search[1]) { - deviceType = search[1]; - } - else if (nativeDeviceType === 'iPhone') { - deviceType = 'Phone'; - } - else if (nativeDeviceType === 'iPad') { - deviceType = 'Tablet'; - } - else { - if (!osEnv.is.Android && !osEnv.is.iOS && !osEnv.is.WindowsPhone && /Windows|Linux|MacOS/.test(osName)) { - deviceType = 'Desktop'; - - // always set it to false when you are on a desktop not using Ripple Emulation - Ext.browser.is.WebView = Ext.browser.is.Ripple ? true : false; - } - else if (osEnv.is.iPad || osEnv.is.RIMTablet || osEnv.is.Android3 || Ext.browser.is.Silk || (osEnv.is.Android && userAgent.search(/mobile/i) == -1)) { - deviceType = 'Tablet'; - } - else { - deviceType = 'Phone'; - } - } - - /** - * @property {String} deviceType - * The generic type of the current device. - * - * Possible values: - * - * - Phone - * - Tablet - * - Desktop - * - * For testing purposes the deviceType can be overridden by adding - * a deviceType parameter to the URL of the page, like so: - * - * http://localhost/mypage.html?deviceType=Tablet - * - */ - osEnv.setFlag(deviceType, true); - osEnv.deviceType = deviceType; - - - /** - * @class Ext.is - * Used to detect if the current browser supports a certain feature, and the type of the current browser. - * @deprecated 2.0.0 - * Please refer to the {@link Ext.browser}, {@link Ext.os} and {@link Ext.feature} classes instead. - */ -}); - -//@tag dom,core - -/** - * Provides information about browser. - * - * Should not be manually instantiated unless for unit-testing. - * Access the global instance stored in {@link Ext.browser} instead. - * @private - */ -Ext.define('Ext.env.Feature', { - - - - constructor: function() { - this.testElements = {}; - - this.has = function(name) { - return !!this.has[name]; - }; - - if (!Ext.theme) { - Ext.theme = { - name: 'Default' - }; - } - - Ext.theme.is = {}; - Ext.theme.is[Ext.theme.name] = true; - - Ext.onDocumentReady(function() { - this.registerTest({ - ProperHBoxStretching: function() { - // IE10 currently has a bug in their flexbox row layout. We feature detect the issue here. - var bodyElement = document.createElement('div'), - innerElement = bodyElement.appendChild(document.createElement('div')), - contentElement = innerElement.appendChild(document.createElement('div')), - innerWidth; - - bodyElement.setAttribute('style', 'width: 100px; height: 100px; position: relative;'); - innerElement.setAttribute('style', 'position: absolute; display: -ms-flexbox; display: -webkit-flex; display: -moz-flexbox; display: flex; -ms-flex-direction: row; -webkit-flex-direction: row; -moz-flex-direction: row; flex-direction: row; min-width: 100%;'); - contentElement.setAttribute('style', 'width: 200px; height: 50px;'); - document.body.appendChild(bodyElement); - innerWidth = innerElement.offsetWidth; - document.body.removeChild(bodyElement); - - return (innerWidth > 100); - } - }); - }, this); - }, - - getTestElement: function(tag, createNew) { - if (tag === undefined) { - tag = 'div'; - } - else if (typeof tag !== 'string') { - return tag; - } - - if (createNew) { - return document.createElement(tag); - } - - if (!this.testElements[tag]) { - this.testElements[tag] = document.createElement(tag); - } - - return this.testElements[tag]; - }, - - isStyleSupported: function(name, tag) { - var elementStyle = this.getTestElement(tag).style, - cName = Ext.String.capitalize(name); - - if (typeof elementStyle[name] !== 'undefined' - || typeof elementStyle[Ext.browser.getStylePrefix(name) + cName] !== 'undefined') { - return true; - } - - return false; - }, - - isStyleSupportedWithoutPrefix: function(name, tag) { - var elementStyle = this.getTestElement(tag).style; - - if (typeof elementStyle[name] !== 'undefined') { - return true; - } - - return false; - }, - - isEventSupported: function(name, tag) { - if (tag === undefined) { - tag = window; - } - - var element = this.getTestElement(tag), - eventName = 'on' + name.toLowerCase(), - isSupported = (eventName in element); - - if (!isSupported) { - if (element.setAttribute && element.removeAttribute) { - element.setAttribute(eventName, ''); - isSupported = typeof element[eventName] === 'function'; - - if (typeof element[eventName] !== 'undefined') { - element[eventName] = undefined; - } - - element.removeAttribute(eventName); - } - } - - return isSupported; - }, - - getSupportedPropertyName: function(object, name) { - var vendorName = Ext.browser.getVendorProperyName(name); - - if (vendorName in object) { - return vendorName; - } - else if (name in object) { - return name; - } - - return null; - }, - - registerTest: Ext.Function.flexSetter(function(name, fn) { - this.has[name] = fn.call(this); - - return this; - }) - -}, function() { - - /** - * @class Ext.feature - * @extend Ext.env.Feature - * @singleton - * - * A simple class to verify if a browser feature exists or not on the current device. - * - * if (Ext.feature.has.Canvas) { - * // do some cool things with canvas here - * } - * - * See the {@link #has} property/method for details of the features that can be detected. - * - * For more information, see the [Environment Detect Guide](../../../core_concepts/environment_detection.html) - */ - Ext.feature = new this; - - var has = Ext.feature.has; - - /** - * @method has - * @member Ext.feature - * Verifies if a browser feature exists or not on the current device. - * - * A "hybrid" property, can be either accessed as a method call, i.e: - * - * if (Ext.feature.has('Canvas')) { - * // ... - * } - * - * or as an object with boolean properties, i.e: - * - * if (Ext.feature.has.Canvas) { - * // ... - * } - * - * Possible properties/parameter values: - * - * - Canvas - * - Svg - * - Vml - * - Touch - supports touch events (`touchstart`). - * - Orientation - supports different orientations. - * - OrientationChange - supports the `orientationchange` event. - * - DeviceMotion - supports the `devicemotion` event. - * - Geolocation - * - SqlDatabase - * - WebSockets - * - Range - supports [DOM document fragments.][1] - * - CreateContextualFragment - supports HTML fragment parsing using [range.createContextualFragment()][2]. - * - History - supports history management with [history.pushState()][3]. - * - CssTransforms - * - Css3dTransforms - * - CssAnimations - * - CssTransitions - * - Audio - supports the `