diff --git a/.idea/.name b/.idea/.name new file mode 100644 index 0000000..5b10ebb --- /dev/null +++ b/.idea/.name @@ -0,0 +1 @@ +TDA-Enrichment \ No newline at end of file diff --git a/.idea/TDA-Enrichment.iml b/.idea/TDA-Enrichment.iml new file mode 100644 index 0000000..967832e --- /dev/null +++ b/.idea/TDA-Enrichment.iml @@ -0,0 +1,12 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/encodings.xml b/.idea/encodings.xml new file mode 100644 index 0000000..d821048 --- /dev/null +++ b/.idea/encodings.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/.idea/inspectionProfiles/Project_Default.xml b/.idea/inspectionProfiles/Project_Default.xml new file mode 100644 index 0000000..c66df00 --- /dev/null +++ b/.idea/inspectionProfiles/Project_Default.xml @@ -0,0 +1,11 @@ + + + + \ No newline at end of file diff --git a/.idea/inspectionProfiles/profiles_settings.xml b/.idea/inspectionProfiles/profiles_settings.xml new file mode 100644 index 0000000..3b31283 --- /dev/null +++ b/.idea/inspectionProfiles/profiles_settings.xml @@ -0,0 +1,7 @@ + + + + \ No newline at end of file diff --git a/.idea/jsLibraryMappings.xml b/.idea/jsLibraryMappings.xml new file mode 100644 index 0000000..b6029b6 --- /dev/null +++ b/.idea/jsLibraryMappings.xml @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff --git a/.idea/jsLinters/jslint.xml b/.idea/jsLinters/jslint.xml new file mode 100644 index 0000000..2ea776a --- /dev/null +++ b/.idea/jsLinters/jslint.xml @@ -0,0 +1,8 @@ + + + + + \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml new file mode 100644 index 0000000..8662aa9 --- /dev/null +++ b/.idea/misc.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml new file mode 100644 index 0000000..a66d183 --- /dev/null +++ b/.idea/modules.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/scopes/scope_settings.xml b/.idea/scopes/scope_settings.xml new file mode 100644 index 0000000..922003b --- /dev/null +++ b/.idea/scopes/scope_settings.xml @@ -0,0 +1,5 @@ + + + + \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml new file mode 100644 index 0000000..6564d52 --- /dev/null +++ b/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/.idea/workspace.xml b/.idea/workspace.xml new file mode 100644 index 0000000..99e63db --- /dev/null +++ b/.idea/workspace.xml @@ -0,0 +1,743 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + true + + + + + + + + + + + + GeneralJavaScript + + + JavaScript + + + Potentially confusing code constructsJavaScript + + + Probable bugsJavaScript + + + Spelling + + + XPath + + + + + SpellCheckingInspection + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + true + + + + + + + + + + + + + 1419803886434 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/config.xml b/config.xml new file mode 100644 index 0000000..3051b49 --- /dev/null +++ b/config.xml @@ -0,0 +1,12 @@ + + + TDA-Enrichment + + Always have access to Thomas Deacon Academy's Sports Enrichment with the official TDA Enrichment app. + + + George Garside + + + + diff --git a/hooks/README.md b/hooks/README.md new file mode 100644 index 0000000..66f2873 --- /dev/null +++ b/hooks/README.md @@ -0,0 +1,196 @@ + +# Cordova Hooks + +Cordova Hooks represent special scripts which could be added by application and plugin developers or even by your own build system to customize cordova commands. Hook scripts could be defined by adding them to the special predefined folder (`/hooks`) or via configuration files (`config.xml` and `plugin.xml`) and run serially in the following order: +* Application hooks from `/hooks`; +* Application hooks from `config.xml`; +* Plugin hooks from `plugins/.../plugin.xml`. + +__Remember__: Make your scripts executable. + +__Note__: `.cordova/hooks` directory is also supported for backward compatibility, but we don't recommend using it as it is deprecated. + +## Supported hook types +The following hook types are supported: + + after_build/ + after_compile/ + after_docs/ + after_emulate/ + after_platform_add/ + after_platform_rm/ + after_platform_ls/ + after_plugin_add/ + after_plugin_ls/ + after_plugin_rm/ + after_plugin_search/ + after_plugin_install/ <-- Plugin hooks defined in plugin.xml are executed exclusively for a plugin being installed + after_prepare/ + after_run/ + after_serve/ + before_build/ + before_compile/ + before_docs/ + before_emulate/ + before_platform_add/ + before_platform_rm/ + before_platform_ls/ + before_plugin_add/ + before_plugin_ls/ + before_plugin_rm/ + before_plugin_search/ + before_plugin_install/ <-- Plugin hooks defined in plugin.xml are executed exclusively for a plugin being installed + before_plugin_uninstall/ <-- Plugin hooks defined in plugin.xml are executed exclusively for a plugin being uninstalled + before_prepare/ + before_run/ + before_serve/ + pre_package/ <-- Windows 8 and Windows Phone only. + +## Ways to define hooks +### Via '/hooks' directory +To execute custom action when corresponding hook type is fired, use hook type as a name for a subfolder inside 'hooks' directory and place you script file here, for example: + + # script file will be automatically executed after each build + hooks/after_build/after_build_custom_action.js + + +### Config.xml + +Hooks can be defined in project's `config.xml` using `` elements, for example: + + + + + + + + + + ... + + + + + + + ... + + +### Plugin hooks (plugin.xml) + +As a plugin developer you can define hook scripts using `` elements in a `plugin.xml` like that: + + + + + + + + ... + + +`before_plugin_install`, `after_plugin_install`, `before_plugin_uninstall` plugin hooks will be fired exclusively for the plugin being installed/uninstalled. + +## Script Interface + +### Javascript + +If you are writing hooks in Javascript you should use the following module definition: +```javascript +module.exports = function(context) { + ... +} +``` + +You can make your scipts async using Q: +```javascript +module.exports = function(context) { + var Q = context.requireCordovaModule('q'); + var deferral = new Q.defer(); + + setTimeout(function(){ + console.log('hook.js>> end'); + deferral.resolve(); + }, 1000); + + return deferral.promise; +} +``` + +`context` object contains hook type, executed script full path, hook options, command-line arguments passed to Cordova and top-level "cordova" object: +```json +{ + "hook": "before_plugin_install", + "scriptLocation": "c:\\script\\full\\path\\appBeforePluginInstall.js", + "cmdLine": "The\\exact\\command\\cordova\\run\\with arguments", + "opts": { + "projectRoot":"C:\\path\\to\\the\\project", + "cordova": { + "platforms": ["wp8"], + "plugins": ["com.plugin.withhooks"], + "version": "0.21.7-dev" + }, + "plugin": { + "id": "com.plugin.withhooks", + "pluginInfo": { + ... + }, + "platform": "wp8", + "dir": "C:\\path\\to\\the\\project\\plugins\\com.plugin.withhooks" + } + }, + "cordova": {...} +} + +``` +`context.opts.plugin` object will only be passed to plugin hooks scripts. + +You can also require additional Cordova modules in your script using `context.requireCordovaModule` in the following way: +```javascript +var Q = context.requireCordovaModule('q'); +``` + +__Note__: new module loader script interface is used for the `.js` files defined via `config.xml` or `plugin.xml` only. +For compatibility reasons hook files specified via `/hooks` folders are run via Node child_process spawn, see 'Non-javascript' section below. + +### Non-javascript + +Non-javascript scripts are run via Node child_process spawn from the project's root directory and have the root directory passes as the first argument. All other options are passed to the script using environment variables: + +* CORDOVA_VERSION - The version of the Cordova-CLI. +* CORDOVA_PLATFORMS - Comma separated list of platforms that the command applies to (e.g.: android, ios). +* CORDOVA_PLUGINS - Comma separated list of plugin IDs that the command applies to (e.g.: org.apache.cordova.file, org.apache.cordova.file-transfer) +* CORDOVA_HOOK - Path to the hook that is being executed. +* CORDOVA_CMDLINE - The exact command-line arguments passed to cordova (e.g.: cordova run ios --emulate) + +If a script returns a non-zero exit code, then the parent cordova command will be aborted. + +## Writing hooks + +We highly recommend writting your hooks using Node.js so that they are +cross-platform. Some good examples are shown here: + +[http://devgirl.org/2013/11/12/three-hooks-your-cordovaphonegap-project-needs/](http://devgirl.org/2013/11/12/three-hooks-your-cordovaphonegap-project-needs/) + +Also, note that even if you are working on Windows, and in case your hook scripts aren't bat files (which is recommended, if you want your scripts to work in non-Windows operating systems) Cordova CLI will expect a shebang line as the first line for it to know the interpreter it needs to use to launch the script. The shebang line should match the following example: + + #!/usr/bin/env [name_of_interpreter_executable] diff --git a/platforms/ios/.gitignore b/platforms/ios/.gitignore index d30c0b0..cc76483 100644 --- a/platforms/ios/.gitignore +++ b/platforms/ios/.gitignore @@ -2,5 +2,4 @@ *.perspectivev3 *.pbxuser .DS_Store -build -www/phonegap.js +build/ diff --git a/platforms/ios/CordovaLib/.gitignore b/platforms/ios/CordovaLib/.gitignore deleted file mode 100644 index c946984..0000000 --- a/platforms/ios/CordovaLib/.gitignore +++ /dev/null @@ -1,6 +0,0 @@ -build/* -*.pbxuser -*.perspectivev3 -*.mode1v3 -javascripts/cordova-*.js - diff --git a/platforms/ios/CordovaLib/Classes/CDVAvailability.h b/platforms/ios/CordovaLib/Classes/CDVAvailability.h index 859088a..1d37be0 100644 --- a/platforms/ios/CordovaLib/Classes/CDVAvailability.h +++ b/platforms/ios/CordovaLib/Classes/CDVAvailability.h @@ -17,6 +17,8 @@ under the License. */ +#import "CDVAvailabilityDeprecated.h" + #define __CORDOVA_IOS__ #define __CORDOVA_0_9_6 906 @@ -47,6 +49,11 @@ #define __CORDOVA_3_1_0 30100 #define __CORDOVA_3_2_0 30200 #define __CORDOVA_3_3_0 30300 +#define __CORDOVA_3_4_0 30400 +#define __CORDOVA_3_4_1 30401 +#define __CORDOVA_3_5_0 30500 +#define __CORDOVA_3_6_0 30600 +#define __CORDOVA_3_7_0 30700 #define __CORDOVA_NA 99999 /* not available */ /* @@ -57,7 +64,7 @@ #endif */ #ifndef CORDOVA_VERSION_MIN_REQUIRED - #define CORDOVA_VERSION_MIN_REQUIRED __CORDOVA_3_3_0 + #define CORDOVA_VERSION_MIN_REQUIRED __CORDOVA_3_7_0 #endif /* @@ -69,22 +76,12 @@ */ #define IsAtLeastiOSVersion(X) ([[[UIDevice currentDevice] systemVersion] compare:X options:NSNumericSearch] != NSOrderedAscending) -#define CDV_IsIPad() ([[UIDevice currentDevice] respondsToSelector:@selector(userInterfaceIdiom)] && ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPad)) - -#define CDV_IsIPhone5() ([[UIScreen mainScreen] bounds].size.height == 568 && [[UIScreen mainScreen] bounds].size.width == 320) - /* Return the string version of the decimal version */ #define CDV_VERSION [NSString stringWithFormat:@"%d.%d.%d", \ (CORDOVA_VERSION_MIN_REQUIRED / 10000), \ (CORDOVA_VERSION_MIN_REQUIRED % 10000) / 100, \ (CORDOVA_VERSION_MIN_REQUIRED % 10000) % 100] -#ifdef __clang__ - #define CDV_DEPRECATED(version, msg) __attribute__((deprecated("Deprecated in Cordova " #version ". " msg))) -#else - #define CDV_DEPRECATED(version, msg) __attribute__((deprecated())) -#endif - // Enable this to log all exec() calls. #define CDV_ENABLE_EXEC_LOGGING 0 #if CDV_ENABLE_EXEC_LOGGING diff --git a/platforms/ios/CordovaLib/Classes/CDVAvailabilityDeprecated.h b/platforms/ios/CordovaLib/Classes/CDVAvailabilityDeprecated.h new file mode 100644 index 0000000..216b4c1 --- /dev/null +++ b/platforms/ios/CordovaLib/Classes/CDVAvailabilityDeprecated.h @@ -0,0 +1,38 @@ +/* + Licensed to the Apache Software Foundation (ASF) under one + or more contributor license agreements. See the NOTICE file + distributed with this work for additional information + regarding copyright ownership. The ASF licenses this file + to you under the Apache License, Version 2.0 (the + "License"); you may not use this file except in compliance + with the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, + software distributed under the License is distributed on an + "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + KIND, either express or implied. See the License for the + specific language governing permissions and limitations + under the License. + */ + + +#import + +#ifdef __clang__ +#define CDV_DEPRECATED(version, msg) __attribute__((deprecated("Deprecated in Cordova " #version ". " msg))) +#else +#define CDV_DEPRECATED(version, msg) __attribute__((deprecated())) +#endif + +static inline BOOL CDV_IsIPad(void) CDV_DEPRECATED(3.7.0, "This will be removed in 4.0.0"); +static inline BOOL CDV_IsIPhone5(void) CDV_DEPRECATED(3.7.0, "This will be removed in 4.0.0"); + +static inline BOOL CDV_IsIPad(void) { + return [[UIDevice currentDevice] respondsToSelector:@selector(userInterfaceIdiom)] && [[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPad; +} + +static inline BOOL CDV_IsIPhone5(void) { + return ([[UIScreen mainScreen] bounds].size.width == 568 && [[UIScreen mainScreen] bounds].size.height == 320) || ([[UIScreen mainScreen] bounds].size.height == 568 && [[UIScreen mainScreen] bounds].size.width == 320); +} \ No newline at end of file diff --git a/platforms/ios/CordovaLib/Classes/CDVCommandDelegate.h b/platforms/ios/CordovaLib/Classes/CDVCommandDelegate.h index 0401136..04df6bc 100644 --- a/platforms/ios/CordovaLib/Classes/CDVCommandDelegate.h +++ b/platforms/ios/CordovaLib/Classes/CDVCommandDelegate.h @@ -31,10 +31,6 @@ - (NSString*)pathForResource:(NSString*)resourcepath; - (id)getCommandInstance:(NSString*)pluginName; -// Plugins should not be using this interface to call other plugins since it -// will result in bogus callbacks being made. -- (BOOL)execute:(CDVInvokedUrlCommand*)command CDV_DEPRECATED(2.2, "Use direct method calls instead."); - // Sends a plugin result to the JS. This is thread-safe. - (void)sendPluginResult:(CDVPluginResult*)result callbackId:(NSString*)callbackId; // Evaluates the given JS. This is thread-safe. diff --git a/platforms/ios/CordovaLib/Classes/CDVCommandDelegateImpl.h b/platforms/ios/CordovaLib/Classes/CDVCommandDelegateImpl.h index 6735136..0531134 100644 --- a/platforms/ios/CordovaLib/Classes/CDVCommandDelegateImpl.h +++ b/platforms/ios/CordovaLib/Classes/CDVCommandDelegateImpl.h @@ -26,8 +26,11 @@ @interface CDVCommandDelegateImpl : NSObject { @private __weak CDVViewController* _viewController; + NSRegularExpression* _callbackIdPattern; @protected __weak CDVCommandQueue* _commandQueue; + BOOL _delayResponses; } - (id)initWithViewController:(CDVViewController*)viewController; +- (void)flushCommandQueueWithDelayedJs; @end diff --git a/platforms/ios/CordovaLib/Classes/CDVCommandDelegateImpl.m b/platforms/ios/CordovaLib/Classes/CDVCommandDelegateImpl.m index 3e68bd4..fc3346d 100644 --- a/platforms/ios/CordovaLib/Classes/CDVCommandDelegateImpl.m +++ b/platforms/ios/CordovaLib/Classes/CDVCommandDelegateImpl.m @@ -31,6 +31,14 @@ - (id)initWithViewController:(CDVViewController*)viewController if (self != nil) { _viewController = viewController; _commandQueue = _viewController.commandQueue; + + NSError* err = nil; + _callbackIdPattern = [NSRegularExpression regularExpressionWithPattern:@"[^A-Za-z0-9._-]" options:0 error:&err]; + if (err != nil) { + // Couldn't initialize Regex + NSLog(@"Error: Couldn't initialize regex"); + _callbackIdPattern = nil; + } } return self; } @@ -53,6 +61,13 @@ - (NSString*)pathForResource:(NSString*)resourcepath return [mainBundle pathForResource:filename ofType:@"" inDirectory:directoryStr]; } +- (void)flushCommandQueueWithDelayedJs +{ + _delayResponses = YES; + [_commandQueue executePending]; + _delayResponses = NO; +} + - (void)evalJsHelper2:(NSString*)js { CDV_EXEC_LOG(@"Exec: evalling: %@", [js substringToIndex:MIN([js length], 160)]); @@ -61,25 +76,46 @@ - (void)evalJsHelper2:(NSString*)js CDV_EXEC_LOG(@"Exec: Retrieved new exec messages by chaining."); } - [_commandQueue enqueCommandBatch:commandsJSON]; + [_commandQueue enqueueCommandBatch:commandsJSON]; + [_commandQueue executePending]; } - (void)evalJsHelper:(NSString*)js { // Cycle the run-loop before executing the JS. - // This works around a bug where sometimes alerts() within callbacks can cause - // dead-lock. - // If the commandQueue is currently executing, then we know that it is safe to - // execute the callback immediately. - // Using (dispatch_get_main_queue()) does *not* fix deadlocks for some reaon, + // For _delayResponses - + // This ensures that we don't eval JS during the middle of an existing JS + // function (possible since UIWebViewDelegate callbacks can be synchronous). + // For !isMainThread - + // It's a hard error to eval on the non-UI thread. + // For !_commandQueue.currentlyExecuting - + // This works around a bug where sometimes alerts() within callbacks can cause + // dead-lock. + // If the commandQueue is currently executing, then we know that it is safe to + // execute the callback immediately. + // Using (dispatch_get_main_queue()) does *not* fix deadlocks for some reason, // but performSelectorOnMainThread: does. - if (![NSThread isMainThread] || !_commandQueue.currentlyExecuting) { + if (_delayResponses || ![NSThread isMainThread] || !_commandQueue.currentlyExecuting) { [self performSelectorOnMainThread:@selector(evalJsHelper2:) withObject:js waitUntilDone:NO]; } else { [self evalJsHelper2:js]; } } +- (BOOL)isValidCallbackId:(NSString*)callbackId +{ + + if (callbackId == nil || _callbackIdPattern == nil) { + return NO; + } + + // Disallow if too long or if any invalid characters were found. + if (([callbackId length] > 100) || [_callbackIdPattern firstMatchInString:callbackId options:0 range:NSMakeRange(0, [callbackId length])]) { + return NO; + } + return YES; +} + - (void)sendPluginResult:(CDVPluginResult*)result callbackId:(NSString*)callbackId { CDV_EXEC_LOG(@"Exec(%@): Sending result. Status=%@", callbackId, result.status); @@ -87,6 +123,11 @@ - (void)sendPluginResult:(CDVPluginResult*)result callbackId:(NSString*)callback if ([@"INVALID" isEqualToString : callbackId]) { return; } + // This occurs when the callback id is malformed. + if (![self isValidCallbackId:callbackId]) { + NSLog(@"Invalid callback id received by sendPluginResult"); + return; + } int status = [result.status intValue]; BOOL keepCallback = [result.keepCallback boolValue]; NSString* argumentsAsJSON = [result argumentsAsJSON]; @@ -111,11 +152,6 @@ - (void)evalJs:(NSString*)js scheduledOnRunLoop:(BOOL)scheduledOnRunLoop } } -- (BOOL)execute:(CDVInvokedUrlCommand*)command -{ - return [_commandQueue execute:command]; -} - - (id)getCommandInstance:(NSString*)pluginName { return [_viewController getCommandInstance:pluginName]; diff --git a/platforms/ios/CordovaLib/Classes/CDVCommandQueue.h b/platforms/ios/CordovaLib/Classes/CDVCommandQueue.h index 27c47b5..3329078 100644 --- a/platforms/ios/CordovaLib/Classes/CDVCommandQueue.h +++ b/platforms/ios/CordovaLib/Classes/CDVCommandQueue.h @@ -30,9 +30,9 @@ - (void)dispose; - (void)resetRequestId; -- (void)enqueCommandBatch:(NSString*)batchJSON; +- (void)enqueueCommandBatch:(NSString*)batchJSON; -- (void)maybeFetchCommandsFromJs:(NSNumber*)requestId; +- (void)processXhrExecBridgePoke:(NSNumber*)requestId; - (void)fetchCommandsFromJs; - (void)executePending; - (BOOL)execute:(CDVInvokedUrlCommand*)command; diff --git a/platforms/ios/CordovaLib/Classes/CDVCommandQueue.m b/platforms/ios/CordovaLib/Classes/CDVCommandQueue.m index 851d28c..1eddfe3 100644 --- a/platforms/ios/CordovaLib/Classes/CDVCommandQueue.m +++ b/platforms/ios/CordovaLib/Classes/CDVCommandQueue.m @@ -23,17 +23,25 @@ Licensed to the Apache Software Foundation (ASF) under one #import "CDVViewController.h" #import "CDVCommandDelegateImpl.h" +// Parse JS on the main thread if it's shorter than this. +static const NSInteger JSON_SIZE_FOR_MAIN_THREAD = 4 * 1024; // Chosen arbitrarily. +// Execute multiple commands in one go until this many seconds have passed. +static const double MAX_EXECUTION_TIME = .008; // Half of a 60fps frame. + @interface CDVCommandQueue () { NSInteger _lastCommandQueueFlushRequestId; __weak CDVViewController* _viewController; NSMutableArray* _queue; - BOOL _currentlyExecuting; + NSTimeInterval _startExecutionTime; } @end @implementation CDVCommandQueue -@synthesize currentlyExecuting = _currentlyExecuting; +- (BOOL)currentlyExecuting +{ + return _startExecutionTime > 0; +} - (id)initWithViewController:(CDVViewController*)viewController { @@ -56,15 +64,26 @@ - (void)resetRequestId _lastCommandQueueFlushRequestId = 0; } -- (void)enqueCommandBatch:(NSString*)batchJSON +- (void)enqueueCommandBatch:(NSString*)batchJSON { if ([batchJSON length] > 0) { - [_queue addObject:batchJSON]; - [self executePending]; + NSMutableArray* commandBatchHolder = [[NSMutableArray alloc] init]; + [_queue addObject:commandBatchHolder]; + if ([batchJSON length] < JSON_SIZE_FOR_MAIN_THREAD) { + [commandBatchHolder addObject:[batchJSON JSONObject]]; + } else { + dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^() { + NSMutableArray* result = [batchJSON JSONObject]; + @synchronized(commandBatchHolder) { + [commandBatchHolder addObject:result]; + } + [self performSelectorOnMainThread:@selector(executePending) withObject:nil waitUntilDone:NO]; + }); + } } } -- (void)maybeFetchCommandsFromJs:(NSNumber*)requestId +- (void)processXhrExecBridgePoke:(NSNumber*)requestId { NSInteger rid = [requestId integerValue]; @@ -84,6 +103,7 @@ - (void)maybeFetchCommandsFromJs:(NSNumber*)requestId if (rid > _lastCommandQueueFlushRequestId) { _lastCommandQueueFlushRequestId = [requestId integerValue]; [self fetchCommandsFromJs]; + [self executePending]; } } @@ -94,25 +114,36 @@ - (void)fetchCommandsFromJs @"cordova.require('cordova/exec').nativeFetchMessages()"]; CDV_EXEC_LOG(@"Exec: Flushed JS->native queue (hadCommands=%d).", [queuedCommandsJSON length] > 0); - [self enqueCommandBatch:queuedCommandsJSON]; + [self enqueueCommandBatch:queuedCommandsJSON]; } - (void)executePending { // Make us re-entrant-safe. - if (_currentlyExecuting) { + if (_startExecutionTime > 0) { return; } @try { - _currentlyExecuting = YES; - - for (NSUInteger i = 0; i < [_queue count]; ++i) { - // Parse the returned JSON array. - NSArray* commandBatch = [[_queue objectAtIndex:i] JSONObject]; + _startExecutionTime = [NSDate timeIntervalSinceReferenceDate]; + + while ([_queue count] > 0) { + NSMutableArray* commandBatchHolder = _queue[0]; + NSMutableArray* commandBatch = nil; + @synchronized(commandBatchHolder) { + // If the next-up command is still being decoded, wait for it. + if ([commandBatchHolder count] == 0) { + break; + } + commandBatch = commandBatchHolder[0]; + } - // Iterate over and execute all of the commands. - for (NSArray* jsonEntry in commandBatch) { + while ([commandBatch count] > 0) { @autoreleasepool { + // Execute the commands one-at-a-time. + NSArray* jsonEntry = [commandBatch dequeue]; + if ([commandBatch count] == 0) { + [_queue removeObjectAtIndex:0]; + } CDVInvokedUrlCommand* command = [CDVInvokedUrlCommand commandFromJson:jsonEntry]; CDV_EXEC_LOG(@"Exec(%@): Calling %@.%@", command.callbackId, command.className, command.methodName); @@ -128,13 +159,17 @@ - (void)executePending #endif } } + + // Yield if we're taking too long. + if (([_queue count] > 0) && ([NSDate timeIntervalSinceReferenceDate] - _startExecutionTime > MAX_EXECUTION_TIME)) { + [self performSelector:@selector(executePending) withObject:nil afterDelay:0]; + return; + } } } - - [_queue removeAllObjects]; } @finally { - _currentlyExecuting = NO; + _startExecutionTime = 0; } } @@ -159,7 +194,7 @@ - (BOOL)execute:(CDVInvokedUrlCommand*)command SEL normalSelector = NSSelectorFromString(methodName); if ([obj respondsToSelector:normalSelector]) { // [obj performSelector:normalSelector withObject:command]; - objc_msgSend(obj, normalSelector, command); + ((void (*)(id, SEL, id))objc_msgSend)(obj, normalSelector, command); } else { // There's no method to call, so throw an error. NSLog(@"ERROR: Method '%@' not defined in Plugin '%@'", methodName, command.className); diff --git a/platforms/ios/CordovaLib/Classes/CDVConfigParser.m b/platforms/ios/CordovaLib/Classes/CDVConfigParser.m index 7a5685d..4b73b60 100644 --- a/platforms/ios/CordovaLib/Classes/CDVConfigParser.m +++ b/platforms/ios/CordovaLib/Classes/CDVConfigParser.m @@ -62,7 +62,7 @@ - (void)parser:(NSXMLParser*)parser didStartElement:(NSString*)elementName names pluginsDict[featureName] = value; } BOOL paramIsOnload = ([paramName isEqualToString:@"onload"] && [@"true" isEqualToString : value]); - BOOL attribIsOnload = [@"true" isEqualToString : [attributeDict[@"onload"] lowercaseString]]; + BOOL attribIsOnload = [@"true" isEqualToString :[attributeDict[@"onload"] lowercaseString]]; if (paramIsOnload || attribIsOnload) { [self.startupPluginNames addObject:featureName]; } @@ -82,7 +82,7 @@ - (void)parser:(NSXMLParser*)parser didEndElement:(NSString*)elementName namespa - (void)parser:(NSXMLParser*)parser parseErrorOccurred:(NSError*)parseError { - NSAssert(NO, @"config.xml parse error line %d col %d", [parser lineNumber], [parser columnNumber]); + NSAssert(NO, @"config.xml parse error line %ld col %ld", (long)[parser lineNumber], (long)[parser columnNumber]); } @end diff --git a/platforms/ios/CordovaLib/Classes/CDVJSON.h b/platforms/ios/CordovaLib/Classes/CDVJSON.h index eaa895e..8ad85da 100644 --- a/platforms/ios/CordovaLib/Classes/CDVJSON.h +++ b/platforms/ios/CordovaLib/Classes/CDVJSON.h @@ -27,4 +27,5 @@ @interface NSString (CDVJSONSerializing) - (id)JSONObject; +- (id)JSONFragment; @end diff --git a/platforms/ios/CordovaLib/Classes/CDVJSON.m b/platforms/ios/CordovaLib/Classes/CDVJSON.m index 78267e5..4698bfe 100644 --- a/platforms/ios/CordovaLib/Classes/CDVJSON.m +++ b/platforms/ios/CordovaLib/Classes/CDVJSON.m @@ -64,7 +64,21 @@ - (id)JSONObject { NSError* error = nil; id object = [NSJSONSerialization JSONObjectWithData:[self dataUsingEncoding:NSUTF8StringEncoding] - options:kNilOptions + options:NSJSONReadingMutableContainers + error:&error]; + + if (error != nil) { + NSLog(@"NSString JSONObject error: %@", [error localizedDescription]); + } + + return object; +} + +- (id)JSONFragment +{ + NSError* error = nil; + id object = [NSJSONSerialization JSONObjectWithData:[self dataUsingEncoding:NSUTF8StringEncoding] + options:NSJSONReadingAllowFragments error:&error]; if (error != nil) { diff --git a/platforms/ios/CordovaLib/Classes/CDVLocalStorage.m b/platforms/ios/CordovaLib/Classes/CDVLocalStorage.m index 9dcf5c1..8aec403 100644 --- a/platforms/ios/CordovaLib/Classes/CDVLocalStorage.m +++ b/platforms/ios/CordovaLib/Classes/CDVLocalStorage.m @@ -340,6 +340,13 @@ + (void)__restoreLegacyDatabaseLocationsWithBackupType:(NSString*)backupType NSMutableArray* backupInfo = [NSMutableArray arrayWithCapacity:0]; if ([backupType isEqualToString:@"cloud"]) { +#ifdef DEBUG + NSLog(@"\n\nStarted backup to iCloud! Please be careful." + "\nYour application might be rejected by Apple if you store too much data." + "\nFor more information please read \"iOS Data Storage Guidelines\" at:" + "\nhttps://developer.apple.com/icloud/documentation/data-storage/" + "\nTo disable web storage backup to iCloud, set the BackupWebStorage preference to \"local\" in the Cordova config.xml file\n\n"); +#endif // We would like to restore old backups/caches databases to the new destination (nested in lib folder) [backupInfo addObjectsFromArray:[self createBackupInfoWithTargetDir:appLibraryFolder backupDir:[appDocumentsFolder stringByAppendingPathComponent:@"Backups"] targetDirNests:YES backupDirNests:NO rename:YES]]; [backupInfo addObjectsFromArray:[self createBackupInfoWithTargetDir:appLibraryFolder backupDir:[appLibraryFolder stringByAppendingPathComponent:@"Caches"] targetDirNests:YES backupDirNests:NO rename:NO]]; diff --git a/platforms/ios/CordovaLib/Classes/CDVPlugin.h b/platforms/ios/CordovaLib/Classes/CDVPlugin.h index 33ba1c4..5e8b283 100644 --- a/platforms/ios/CordovaLib/Classes/CDVPlugin.h +++ b/platforms/ios/CordovaLib/Classes/CDVPlugin.h @@ -27,6 +27,8 @@ extern NSString* const CDVPageDidLoadNotification; extern NSString* const CDVPluginHandleOpenURLNotification; extern NSString* const CDVPluginResetNotification; extern NSString* const CDVLocalNotification; +extern NSString* const CDVRemoteNotification; +extern NSString* const CDVRemoteNotificationError; @interface CDVPlugin : NSObject {} @@ -56,9 +58,10 @@ extern NSString* const CDVLocalNotification; - (id)appDelegate; -// TODO(agrieve): Deprecate these in favour of using CDVCommandDelegate directly. -- (NSString*)writeJavascript:(NSString*)javascript; -- (NSString*)success:(CDVPluginResult*)pluginResult callbackId:(NSString*)callbackId; -- (NSString*)error:(CDVPluginResult*)pluginResult callbackId:(NSString*)callbackId; +- (NSString*)writeJavascript:(NSString*)javascript CDV_DEPRECATED(3.6, "Use the CDVCommandDelegate equivalent of evalJs:. This will be removed in 4.0.0"); + +- (NSString*)success:(CDVPluginResult*)pluginResult callbackId:(NSString*)callbackId CDV_DEPRECATED(3.6, "Use the CDVCommandDelegate equivalent of sendPluginResult:callbackId. This will be removed in 4.0.0"); + +- (NSString*)error:(CDVPluginResult*)pluginResult callbackId:(NSString*)callbackId CDV_DEPRECATED(3.6, "Use the CDVCommandDelegate equivalent of sendPluginResult:callbackId. This will be removed in 4.0.0"); @end diff --git a/platforms/ios/CordovaLib/Classes/CDVPlugin.m b/platforms/ios/CordovaLib/Classes/CDVPlugin.m index 8c932a0..ea81ddd 100644 --- a/platforms/ios/CordovaLib/Classes/CDVPlugin.m +++ b/platforms/ios/CordovaLib/Classes/CDVPlugin.m @@ -23,6 +23,8 @@ Licensed to the Apache Software Foundation (ASF) under one NSString* const CDVPluginHandleOpenURLNotification = @"CDVPluginHandleOpenURLNotification"; NSString* const CDVPluginResetNotification = @"CDVPluginResetNotification"; NSString* const CDVLocalNotification = @"CDVLocalNotification"; +NSString* const CDVRemoteNotification = @"CDVRemoteNotification"; +NSString* const CDVRemoteNotificationError = @"CDVRemoteNotificationError"; @interface CDVPlugin () diff --git a/platforms/ios/CordovaLib/Classes/CDVPluginResult.h b/platforms/ios/CordovaLib/Classes/CDVPluginResult.h index 11b5377..e624d4d 100644 --- a/platforms/ios/CordovaLib/Classes/CDVPluginResult.h +++ b/platforms/ios/CordovaLib/Classes/CDVPluginResult.h @@ -18,6 +18,7 @@ */ #import +#import "CDVAvailability.h" typedef enum { CDVCommandStatus_NO_RESULT = 0, @@ -61,8 +62,10 @@ typedef enum { - (NSString*)argumentsAsJSON; // These methods are used by the legacy plugin return result method -- (NSString*)toJSONString; -- (NSString*)toSuccessCallbackString:(NSString*)callbackId; -- (NSString*)toErrorCallbackString:(NSString*)callbackId; +- (NSString*)toJSONString CDV_DEPRECATED(3.6, "Only used by toSuccessCallbackString and toErrorCallbackString which are deprecated. This will be removed in 4.0.0"); + +- (NSString*)toSuccessCallbackString:(NSString*)callbackId CDV_DEPRECATED(3.6, "Use the CDVCommandDelegate method sendPluginResult:callbackId instead. This will be removed in 4.0.0"); + +- (NSString*)toErrorCallbackString:(NSString*)callbackId CDV_DEPRECATED(3.6, "Use the CDVCommandDelegate method sendPluginResult:callbackId instead. This will be removed in 4.0.0"); @end diff --git a/platforms/ios/CordovaLib/Classes/CDVPluginResult.m b/platforms/ios/CordovaLib/Classes/CDVPluginResult.m index af7c528..2eb46cd 100644 --- a/platforms/ios/CordovaLib/Classes/CDVPluginResult.m +++ b/platforms/ios/CordovaLib/Classes/CDVPluginResult.m @@ -96,7 +96,7 @@ - (CDVPluginResult*)initWithStatus:(CDVCommandStatus)statusOrdinal message:(id)t + (CDVPluginResult*)resultWithStatus:(CDVCommandStatus)statusOrdinal { - return [[self alloc] initWithStatus:statusOrdinal message:[org_apache_cordova_CommandStatusMsgs objectAtIndex:statusOrdinal]]; + return [[self alloc] initWithStatus:statusOrdinal message:nil]; } + (CDVPluginResult*)resultWithStatus:(CDVCommandStatus)statusOrdinal messageAsString:(NSString*)theMessage diff --git a/platforms/ios/CordovaLib/Classes/CDVShared.h b/platforms/ios/CordovaLib/Classes/CDVShared.h index c54567a..68acc5c 100644 --- a/platforms/ios/CordovaLib/Classes/CDVShared.h +++ b/platforms/ios/CordovaLib/Classes/CDVShared.h @@ -17,17 +17,6 @@ under the License. */ -#import +// This file was emptied out in 3.6.0 release (July 2014). +// It will be deleted in a future release. #import - -@interface NSError (JSONMethods) - -- (NSString*)JSONRepresentation; - -@end - -@interface CLLocation (JSONMethods) - -- (NSString*)JSONRepresentation; - -@end diff --git a/platforms/ios/CordovaLib/Classes/CDVShared.m b/platforms/ios/CordovaLib/Classes/CDVShared.m deleted file mode 100644 index 0617ece..0000000 --- a/platforms/ios/CordovaLib/Classes/CDVShared.m +++ /dev/null @@ -1,59 +0,0 @@ -/* - Licensed to the Apache Software Foundation (ASF) under one - or more contributor license agreements. See the NOTICE file - distributed with this work for additional information - regarding copyright ownership. The ASF licenses this file - to you under the Apache License, Version 2.0 (the - "License"); you may not use this file except in compliance - with the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, - software distributed under the License is distributed on an - "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - KIND, either express or implied. See the License for the - specific language governing permissions and limitations - under the License. - */ - -#import "CDVShared.h" - -#pragma mark - -#pragma mark CLLocation(JSONMethods) - -@implementation CLLocation (JSONMethods) - -- (NSString*)JSONRepresentation -{ - return [NSString stringWithFormat: - @"{ timestamp: %.00f, \ - coords: { latitude: %f, longitude: %f, altitude: %.02f, heading: %.02f, speed: %.02f, accuracy: %.02f, altitudeAccuracy: %.02f } \ - }", - [self.timestamp timeIntervalSince1970] * 1000.0, - self.coordinate.latitude, - self.coordinate.longitude, - self.altitude, - self.course, - self.speed, - self.horizontalAccuracy, - self.verticalAccuracy - ]; -} - -@end - -#pragma mark NSError(JSONMethods) - -@implementation NSError (JSONMethods) - -- (NSString*)JSONRepresentation -{ - return [NSString stringWithFormat: - @"{ code: %d, message: '%@'}", - self.code, - [self localizedDescription] - ]; -} - -@end diff --git a/platforms/ios/CordovaLib/Classes/CDVURLProtocol.m b/platforms/ios/CordovaLib/Classes/CDVURLProtocol.m index 9bd4050..fce5783 100644 --- a/platforms/ios/CordovaLib/Classes/CDVURLProtocol.m +++ b/platforms/ios/CordovaLib/Classes/CDVURLProtocol.m @@ -26,16 +26,12 @@ Licensed to the Apache Software Foundation (ASF) under one #import "CDVWhitelist.h" #import "CDVViewController.h" -@interface CDVHTTPURLResponse : NSHTTPURLResponse -@property (nonatomic) NSInteger statusCode; -@end - static CDVWhitelist* gWhitelist = nil; // Contains a set of NSNumbers of addresses of controllers. It doesn't store // the actual pointer to avoid retaining. static NSMutableSet* gRegisteredControllers = nil; -NSString* const kCDVAssetsLibraryPrefixs = @"assets-library://"; +NSString* const kCDVAssetsLibraryPrefixes = @"assets-library://"; // Returns the registered view controller that sent the given request. // If the user-agent is not from a UIWebView, or if it's from an unregistered one, @@ -110,7 +106,7 @@ + (BOOL)canInitWithRequest:(NSURLRequest*)theRequest NSURL* theUrl = [theRequest URL]; CDVViewController* viewController = viewControllerForRequest(theRequest); - if ([[theUrl absoluteString] hasPrefix:kCDVAssetsLibraryPrefixs]) { + if ([[theUrl absoluteString] hasPrefix:kCDVAssetsLibraryPrefixes]) { return YES; } else if (viewController != nil) { if ([[theUrl path] isEqualToString:@"/!gap_exec"]) { @@ -122,10 +118,11 @@ + (BOOL)canInitWithRequest:(NSURLRequest*)theRequest } BOOL hasCmds = [queuedCommandsJSON length] > 0; if (hasCmds) { - SEL sel = @selector(enqueCommandBatch:); + SEL sel = @selector(enqueueCommandBatch:); [viewController.commandQueue performSelectorOnMainThread:sel withObject:queuedCommandsJSON waitUntilDone:NO]; + [viewController.commandQueue performSelectorOnMainThread:@selector(executePending) withObject:nil waitUntilDone:NO]; } else { - SEL sel = @selector(maybeFetchCommandsFromJs:); + SEL sel = @selector(processXhrExecBridgePoke:); [viewController.commandQueue performSelectorOnMainThread:sel withObject:[NSNumber numberWithInteger:[requestId integerValue]] waitUntilDone:NO]; } // Returning NO here would be 20% faster, but it spams WebInspector's console with failure messages. @@ -159,14 +156,14 @@ - (void)startLoading if ([[url path] isEqualToString:@"/!gap_exec"]) { [self sendResponseWithResponseCode:200 data:nil mimeType:nil]; return; - } else if ([[url absoluteString] hasPrefix:kCDVAssetsLibraryPrefixs]) { + } else if ([[url absoluteString] hasPrefix:kCDVAssetsLibraryPrefixes]) { ALAssetsLibraryAssetForURLResultBlock resultBlock = ^(ALAsset* asset) { if (asset) { // We have the asset! Get the data and send it along. ALAssetRepresentation* assetRepresentation = [asset defaultRepresentation]; NSString* MIMEType = (__bridge_transfer NSString*)UTTypeCopyPreferredTagWithClass((__bridge CFStringRef)[assetRepresentation UTI], kUTTagClassMIMEType); - Byte* buffer = (Byte*)malloc([assetRepresentation size]); - NSUInteger bufferSize = [assetRepresentation getBytes:buffer fromOffset:0.0 length:[assetRepresentation size] error:nil]; + Byte* buffer = (Byte*)malloc((unsigned long)[assetRepresentation size]); + NSUInteger bufferSize = [assetRepresentation getBytes:buffer fromOffset:0.0 length:(NSUInteger)[assetRepresentation size] error:nil]; NSData* data = [NSData dataWithBytesNoCopy:buffer length:bufferSize freeWhenDone:YES]; [self sendResponseWithResponseCode:200 data:data mimeType:MIMEType]; } else { @@ -203,13 +200,8 @@ - (void)sendResponseWithResponseCode:(NSInteger)statusCode data:(NSData*)data mi if (mimeType == nil) { mimeType = @"text/plain"; } - NSString* encodingName = [@"text/plain" isEqualToString : mimeType] ? @"UTF-8" : nil; - CDVHTTPURLResponse* response = - [[CDVHTTPURLResponse alloc] initWithURL:[[self request] URL] - MIMEType:mimeType - expectedContentLength:[data length] - textEncodingName:encodingName]; - response.statusCode = statusCode; + + NSHTTPURLResponse* response = [[NSHTTPURLResponse alloc] initWithURL:[[self request] URL] statusCode:statusCode HTTPVersion:@"HTTP/1.1" headerFields:@{@"Content-Type" : mimeType}]; [[self client] URLProtocol:self didReceiveResponse:response cacheStoragePolicy:NSURLCacheStorageNotAllowed]; if (data != nil) { @@ -219,13 +211,3 @@ - (void)sendResponseWithResponseCode:(NSInteger)statusCode data:(NSData*)data mi } @end - -@implementation CDVHTTPURLResponse -@synthesize statusCode; - -- (NSDictionary*)allHeaderFields -{ - return nil; -} - -@end diff --git a/platforms/ios/CordovaLib/Classes/CDVUserAgentUtil.m b/platforms/ios/CordovaLib/Classes/CDVUserAgentUtil.m index 9923d47..c3402d0 100644 --- a/platforms/ios/CordovaLib/Classes/CDVUserAgentUtil.m +++ b/platforms/ios/CordovaLib/Classes/CDVUserAgentUtil.m @@ -43,7 +43,9 @@ + (NSString*)originalUserAgent NSUserDefaults* userDefaults = [NSUserDefaults standardUserDefaults]; NSString* systemVersion = [[UIDevice currentDevice] systemVersion]; NSString* localeStr = [[NSLocale currentLocale] localeIdentifier]; - NSString* systemAndLocale = [NSString stringWithFormat:@"%@ %@", systemVersion, localeStr]; + // Record the model since simulator can change it without re-install (CB-5420). + NSString* model = [UIDevice currentDevice].model; + NSString* systemAndLocale = [NSString stringWithFormat:@"%@ %@ %@", model, systemVersion, localeStr]; NSString* cordovaUserAgentVersion = [userDefaults stringForKey:kCdvUserAgentVersionKey]; gOriginalUserAgent = [userDefaults stringForKey:kCdvUserAgentKey]; @@ -89,14 +91,14 @@ + (void)releaseLock:(NSInteger*)lockToken if (*lockToken == 0) { return; } - NSAssert(gCurrentLockToken == *lockToken, @"Got token %d, expected %d", *lockToken, gCurrentLockToken); + NSAssert(gCurrentLockToken == *lockToken, @"Got token %ld, expected %ld", (long)*lockToken, (long)gCurrentLockToken); VerboseLog(@"Released lock %d", *lockToken); if ([gPendingSetUserAgentBlocks count] > 0) { void (^block)() = [gPendingSetUserAgentBlocks objectAtIndex:0]; [gPendingSetUserAgentBlocks removeObjectAtIndex:0]; gCurrentLockToken = ++gNextLockToken; - NSLog(@"Gave lock %d", gCurrentLockToken); + NSLog(@"Gave lock %ld", (long)gCurrentLockToken); block(gCurrentLockToken); } else { gCurrentLockToken = 0; @@ -106,7 +108,7 @@ + (void)releaseLock:(NSInteger*)lockToken + (void)setUserAgent:(NSString*)value lockToken:(NSInteger)lockToken { - NSAssert(gCurrentLockToken == lockToken, @"Got token %d, expected %d", lockToken, gCurrentLockToken); + NSAssert(gCurrentLockToken == lockToken, @"Got token %ld, expected %ld", (long)lockToken, (long)gCurrentLockToken); VerboseLog(@"User-Agent set to: %@", value); // Setting the UserAgent must occur before a UIWebView is instantiated. diff --git a/platforms/ios/CordovaLib/Classes/CDVViewController.h b/platforms/ios/CordovaLib/Classes/CDVViewController.h index 1015c50..51863a5 100644 --- a/platforms/ios/CordovaLib/Classes/CDVViewController.h +++ b/platforms/ios/CordovaLib/Classes/CDVViewController.h @@ -48,8 +48,19 @@ @property (nonatomic, readwrite, copy) NSString* startPage; @property (nonatomic, readonly, strong) CDVCommandQueue* commandQueue; @property (nonatomic, readonly, strong) id commandDelegate; + +/** + The complete user agent that Cordova will use when sending web requests. + */ @property (nonatomic, readonly) NSString* userAgent; +/** + The base user agent data that Cordova will use to build its user agent. If this + property isn't set, Cordova will use the standard web view user agent as its + base. + */ +@property (nonatomic, readwrite, copy) NSString* baseUserAgent; + + (NSDictionary*)getBundlePlist:(NSString*)plistName; + (NSString*)applicationDocumentsDirectory; @@ -68,5 +79,6 @@ - (void)registerPlugin:(CDVPlugin*)plugin withPluginName:(NSString*)pluginName; - (BOOL)URLisAllowed:(NSURL*)url; +- (void)processOpenUrl:(NSURL*)url; @end diff --git a/platforms/ios/CordovaLib/Classes/CDVViewController.m b/platforms/ios/CordovaLib/Classes/CDVViewController.m index ee11c4b..eb056ce 100644 --- a/platforms/ios/CordovaLib/Classes/CDVViewController.m +++ b/platforms/ios/CordovaLib/Classes/CDVViewController.m @@ -52,7 +52,7 @@ @implementation CDVViewController @synthesize webView, supportedOrientations; @synthesize pluginObjects, pluginsMap, whitelist, startupPluginNames; @synthesize configParser, settings, loadFromString; -@synthesize wwwFolderName, startPage, initialized, openURL; +@synthesize wwwFolderName, startPage, initialized, openURL, baseUserAgent; @synthesize commandDelegate = _commandDelegate; @synthesize commandQueue = _commandQueue; @@ -72,14 +72,16 @@ - (void)__init name:UIApplicationWillEnterForegroundNotification object:nil]; [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(onAppDidEnterBackground:) name:UIApplicationDidEnterBackgroundNotification object:nil]; - [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(handleOpenURL:) name:CDVPluginHandleOpenURLNotification object:nil]; + [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(onPageDidLoad:) + name:CDVPageDidLoadNotification object:nil]; // read from UISupportedInterfaceOrientations (or UISupportedInterfaceOrientations~iPad, if its iPad) from -Info.plist self.supportedOrientations = [self parseInterfaceOrientations: [[[NSBundle mainBundle] infoDictionary] objectForKey:@"UISupportedInterfaceOrientations"]]; + [self printVersion]; [self printMultitaskingInfo]; - [self printDeprecationNotice]; + [self printPlatformVersionWarning]; self.initialized = YES; // load config.xml settings @@ -118,10 +120,15 @@ - (void)viewWillDisappear:(BOOL)animated [super viewWillDisappear:animated]; } -- (void)printDeprecationNotice +- (void)printVersion { - if (!IsAtLeastiOSVersion(@"5.0")) { - NSLog(@"CRITICAL: For Cordova 2.0, you will need to upgrade to at least iOS 5.0 or greater. Your current version of iOS is %@.", + NSLog(@"Apache Cordova native platform version %@ is starting.", CDV_VERSION); +} + +- (void)printPlatformVersionWarning +{ + if (!IsAtLeastiOSVersion(@"6.0")) { + NSLog(@"CRITICAL: For Cordova 3.5.0 and above, you will need to upgrade to at least iOS 6.0 or greater. Your current version of iOS is %@.", [[UIDevice currentDevice] systemVersion] ); } @@ -192,13 +199,9 @@ - (void)loadSettings self.pluginObjects = [[NSMutableDictionary alloc] initWithCapacity:20]; } -// Implement viewDidLoad to do additional setup after loading the view, typically from a nib. -- (void)viewDidLoad +- (NSURL*)appUrl { - [super viewDidLoad]; - NSURL* appURL = nil; - NSString* loadErr = nil; if ([self.startPage rangeOfString:@"://"].location != NSNotFound) { appURL = [NSURL URLWithString:self.startPage]; @@ -210,18 +213,50 @@ - (void)viewDidLoad NSString* startFilePath = [self.commandDelegate pathForResource:[startURL path]]; if (startFilePath == nil) { - loadErr = [NSString stringWithFormat:@"ERROR: Start Page at '%@/%@' was not found.", self.wwwFolderName, self.startPage]; - NSLog(@"%@", loadErr); self.loadFromString = YES; appURL = nil; } else { - // CB-3005 we know that the page exists : reconstruct full path from bundle - NSURL* relativeURL = [NSURL fileURLWithPath:[[NSBundle mainBundle] bundlePath]]; - NSString* localURL = [NSString stringWithFormat:@"%@/%@", self.wwwFolderName, self.startPage]; - appURL = [NSURL URLWithString:localURL relativeToURL:relativeURL]; + appURL = [NSURL fileURLWithPath:startFilePath]; + // CB-3005 Add on the query params or fragment. + NSString* startPageNoParentDirs = self.startPage; + NSRange r = [startPageNoParentDirs rangeOfCharacterFromSet:[NSCharacterSet characterSetWithCharactersInString:@"?#"] options:0]; + if (r.location != NSNotFound) { + NSString* queryAndOrFragment = [self.startPage substringFromIndex:r.location]; + appURL = [NSURL URLWithString:queryAndOrFragment relativeToURL:appURL]; + } + } + } + + return appURL; +} + +- (NSURL*)errorUrl +{ + NSURL* errorURL = nil; + + id setting = [self settingForKey:@"ErrorUrl"]; + + if (setting) { + NSString* errorUrlString = (NSString*)setting; + if ([errorUrlString rangeOfString:@"://"].location != NSNotFound) { + errorURL = [NSURL URLWithString:errorUrlString]; + } else { + NSURL* url = [NSURL URLWithString:(NSString*)setting]; + NSString* errorFilePath = [self.commandDelegate pathForResource:[url path]]; + if (errorFilePath) { + errorURL = [NSURL fileURLWithPath:errorFilePath]; + } } } + return errorURL; +} + +// Implement viewDidLoad to do additional setup after loading the view, typically from a nib. +- (void)viewDidLoad +{ + [super viewDidLoad]; + // // Fix the iOS 5.1 SECURITY_ERR bug (CB-347), this must be before the webView is instantiated //// NSString* backupWebStorageType = @"cloud"; // default value @@ -238,7 +273,16 @@ - (void)viewDidLoad // // Instantiate the WebView /////////////// - [self createGapView]; + if (!self.webView) { + [self createGapView]; + } + + // Configure WebView + _webViewDelegate = [[CDVWebViewDelegate alloc] initWithDelegate:self]; + self.webView.delegate = _webViewDelegate; + + // register this viewcontroller with the NSURLProtocol, only after the User-Agent is set + [CDVURLProtocol registerViewController:self]; // ///////////////// @@ -294,6 +338,11 @@ - (void)viewDidLoad } } + NSString* decelerationSetting = [self settingForKey:@"UIWebViewDecelerationSpeed"]; + if (![@"fast" isEqualToString:decelerationSetting]) { + [self.webView.scrollView setDecelerationRate:UIScrollViewDecelerationRateNormal]; + } + /* * iOS 6.0 UIWebView properties */ @@ -412,15 +461,27 @@ - (void)viewDidLoad } // ///////////////// + NSURL* appURL = [self appUrl]; + [CDVUserAgentUtil acquireLock:^(NSInteger lockToken) { _userAgentLockToken = lockToken; [CDVUserAgentUtil setUserAgent:self.userAgent lockToken:lockToken]; - if (!loadErr) { + if (appURL) { NSURLRequest* appReq = [NSURLRequest requestWithURL:appURL cachePolicy:NSURLRequestUseProtocolCachePolicy timeoutInterval:20.0]; [self.webView loadRequest:appReq]; } else { - NSString* html = [NSString stringWithFormat:@" %@ ", loadErr]; - [self.webView loadHTMLString:html baseURL:nil]; + NSString* loadErr = [NSString stringWithFormat:@"ERROR: Start Page at '%@/%@' was not found.", self.wwwFolderName, self.startPage]; + NSLog(@"%@", loadErr); + + NSURL* errorUrl = [self errorUrl]; + if (errorUrl) { + errorUrl = [NSURL URLWithString:[NSString stringWithFormat:@"?error=%@", [loadErr stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]] relativeToURL:errorUrl]; + NSLog(@"%@", [errorUrl absoluteString]); + [self.webView loadRequest:[NSURLRequest requestWithURL:errorUrl]]; + } else { + NSString* html = [NSString stringWithFormat:@" %@ ", loadErr]; + [self.webView loadHTMLString:html baseURL:nil]; + } } }]; } @@ -488,8 +549,8 @@ - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interface { // First, ask the webview via JS if it supports the new orientation NSString* jsCall = [NSString stringWithFormat: - @"window.shouldRotateToOrientation && window.shouldRotateToOrientation(%d);" - , [self mapIosOrientationToJsOrientation:interfaceOrientation]]; + @"window.shouldRotateToOrientation && window.shouldRotateToOrientation(%ld);" + , (long)[self mapIosOrientationToJsOrientation:interfaceOrientation]]; NSString* res = [webView stringByEvaluatingJavaScriptFromString:jsCall]; if ([res length] > 0) { @@ -538,9 +599,14 @@ - (UIWebView*)newCordovaViewWithFrame:(CGRect)bounds - (NSString*)userAgent { if (_userAgent == nil) { - NSString* originalUserAgent = [CDVUserAgentUtil originalUserAgent]; + NSString* localBaseUserAgent; + if (self.baseUserAgent != nil) { + localBaseUserAgent = self.baseUserAgent; + } else { + localBaseUserAgent = [CDVUserAgentUtil originalUserAgent]; + } // Use our address as a unique number to append to the User-Agent. - _userAgent = [NSString stringWithFormat:@"%@ (%lld)", originalUserAgent, (long long)self]; + _userAgent = [NSString stringWithFormat:@"%@ (%lld)", localBaseUserAgent, (long long)self]; } return _userAgent; } @@ -551,19 +617,11 @@ - (void)createGapView webViewBounds.origin = self.view.bounds.origin; - if (!self.webView) { - self.webView = [self newCordovaViewWithFrame:webViewBounds]; - self.webView.autoresizingMask = (UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight); - - [self.view addSubview:self.webView]; - [self.view sendSubviewToBack:self.webView]; - - _webViewDelegate = [[CDVWebViewDelegate alloc] initWithDelegate:self]; - self.webView.delegate = _webViewDelegate; + self.webView = [self newCordovaViewWithFrame:webViewBounds]; + self.webView.autoresizingMask = (UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight); - // register this viewcontroller with the NSURLProtocol, only after the User-Agent is set - [CDVURLProtocol registerViewController:self]; - } + [self.view addSubview:self.webView]; + [self.view sendSubviewToBack:self.webView]; } - (void)didReceiveMemoryWarning @@ -599,6 +657,8 @@ - (void)viewDidUnload self.webView.delegate = nil; self.webView = nil; [CDVUserAgentUtil releaseLock:&_userAgentLockToken]; + + [super viewDidUnload]; } #pragma mark UIWebViewDelegate @@ -628,8 +688,6 @@ - (void)webViewDidFinishLoad:(UIWebView*)theWebView */ [[UIApplication sharedApplication] setNetworkActivityIndicatorVisible:NO]; - [self processOpenUrl]; - [[NSNotificationCenter defaultCenter] postNotification:[NSNotification notificationWithName:CDVPageDidLoadNotification object:self.webView]]; } @@ -637,7 +695,15 @@ - (void)webView:(UIWebView*)theWebView didFailLoadWithError:(NSError*)error { [CDVUserAgentUtil releaseLock:&_userAgentLockToken]; - NSLog(@"Failed to load webpage with error: %@", [error localizedDescription]); + NSString* message = [NSString stringWithFormat:@"Failed to load webpage with error: %@", [error localizedDescription]]; + NSLog(@"%@", message); + + NSURL* errorUrl = [self errorUrl]; + if (errorUrl) { + errorUrl = [NSURL URLWithString:[NSString stringWithFormat:@"?error=%@", [message stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]] relativeToURL:errorUrl]; + NSLog(@"%@", [errorUrl absoluteString]); + [theWebView loadRequest:[NSURLRequest requestWithURL:errorUrl]]; + } } - (BOOL)webView:(UIWebView*)theWebView shouldStartLoadWithRequest:(NSURLRequest*)request navigationType:(UIWebViewNavigationType)navigationType @@ -650,6 +716,33 @@ - (BOOL)webView:(UIWebView*)theWebView shouldStartLoadWithRequest:(NSURLRequest* */ if ([[url scheme] isEqualToString:@"gap"]) { [_commandQueue fetchCommandsFromJs]; + // The delegate is called asynchronously in this case, so we don't have to use + // flushCommandQueueWithDelayedJs (setTimeout(0)) as we do with hash changes. + [_commandQueue executePending]; + return NO; + } + + if ([[url fragment] hasPrefix:@"%01"] || [[url fragment] hasPrefix:@"%02"]) { + // Delegate is called *immediately* for hash changes. This means that any + // calls to stringByEvaluatingJavascriptFromString will occur in the middle + // of an existing (paused) call stack. This doesn't cause errors, but may + // be unexpected to callers (exec callbacks will be called before exec() even + // returns). To avoid this, we do not do any synchronous JS evals by using + // flushCommandQueueWithDelayedJs. + NSString* inlineCommands = [[url fragment] substringFromIndex:3]; + if ([inlineCommands length] == 0) { + // Reach in right away since the WebCore / Main thread are already synchronized. + [_commandQueue fetchCommandsFromJs]; + } else { + inlineCommands = [inlineCommands stringByReplacingPercentEscapesUsingEncoding:NSUTF8StringEncoding]; + [_commandQueue enqueueCommandBatch:inlineCommands]; + } + // Switch these for minor performance improvements, and to really live on the wild side. + // Callbacks will occur in the middle of the location.hash = ... statement! + [(CDVCommandDelegateImpl*)_commandDelegate flushCommandQueueWithDelayedJs]; + // [_commandQueue executePending]; + + // Although we return NO, the hash change does end up taking effect. return NO; } @@ -660,7 +753,7 @@ - (BOOL)webView:(UIWebView*)theWebView shouldStartLoadWithRequest:(NSURLRequest* CDVPlugin* plugin = [pluginObjects objectForKey:pluginName]; SEL selector = NSSelectorFromString(@"shouldOverrideLoadWithRequest:navigationType:"); if ([plugin respondsToSelector:selector]) { - if ((BOOL)objc_msgSend(plugin, selector, request, navigationType) == YES) { + if (((BOOL (*)(id, SEL, id, int))objc_msgSend)(plugin, selector, request, navigationType) == YES) { return NO; } } @@ -731,27 +824,10 @@ - (void)javascriptAlert:(NSString*)text [self.commandDelegate evalJs:jsString]; } -+ (NSString*)resolveImageResource:(NSString*)resource -{ - NSString* systemVersion = [[UIDevice currentDevice] systemVersion]; - BOOL isLessThaniOS4 = ([systemVersion compare:@"4.0" options:NSNumericSearch] == NSOrderedAscending); - - // the iPad image (nor retina) differentiation code was not in 3.x, and we have to explicitly set the path - if (isLessThaniOS4) { - if (CDV_IsIPad()) { - return [NSString stringWithFormat:@"%@~ipad.png", resource]; - } else { - return [NSString stringWithFormat:@"%@.png", resource]; - } - } - - return resource; -} - + (NSString*)applicationDocumentsDirectory { NSArray* paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES); - NSString* basePath = ([paths count] > 0) ? [paths objectAtIndex:0] : nil; + NSString* basePath = (([paths count] > 0) ? ([paths objectAtIndex : 0]) : nil); return basePath; } @@ -922,21 +998,37 @@ - (void)onAppDidEnterBackground:(NSNotification*)notification // /////////////////////// -- (void)handleOpenURL:(NSNotification*)notification +- (void)onPageDidLoad:(NSNotification*)notification { - self.openURL = notification.object; + if (self.openURL) { + [self processOpenUrl:self.openURL pageLoaded:YES]; + self.openURL = nil; + } } -- (void)processOpenUrl +- (void)processOpenUrl:(NSURL*)url pageLoaded:(BOOL)pageLoaded { - if (self.openURL) { + if (!pageLoaded) { + // query the webview for readystate + NSString* readyState = [webView stringByEvaluatingJavaScriptFromString:@"document.readyState"]; + pageLoaded = [readyState isEqualToString:@"loaded"] || [readyState isEqualToString:@"complete"]; + } + + if (pageLoaded) { // calls into javascript global function 'handleOpenURL' - NSString* jsString = [NSString stringWithFormat:@"handleOpenURL(\"%@\");", [self.openURL description]]; + NSString* jsString = [NSString stringWithFormat:@"if (typeof handleOpenURL === 'function') { handleOpenURL(\"%@\");}", url]; [self.webView stringByEvaluatingJavaScriptFromString:jsString]; - self.openURL = nil; + } else { + // save for when page has loaded + self.openURL = url; } } +- (void)processOpenUrl:(NSURL*)url +{ + [self processOpenUrl:url pageLoaded:NO]; +} + // /////////////////////// - (void)dealloc diff --git a/platforms/ios/CordovaLib/Classes/CDVWebViewDelegate.h b/platforms/ios/CordovaLib/Classes/CDVWebViewDelegate.h index dd71807..4b60bab 100644 --- a/platforms/ios/CordovaLib/Classes/CDVWebViewDelegate.h +++ b/platforms/ios/CordovaLib/Classes/CDVWebViewDelegate.h @@ -18,6 +18,7 @@ */ #import +#import "CDVAvailability.h" /** * Distinguishes top-level navigations from sub-frame navigations. @@ -34,6 +35,8 @@ } - (id)initWithDelegate:(NSObject *)delegate; -- (BOOL)request:(NSURLRequest*)newRequest isFragmentIdentifierToRequest:(NSURLRequest*)originalRequest; +- (BOOL)request:(NSURLRequest*)newRequest isFragmentIdentifierToRequest:(NSURLRequest*)originalRequest CDV_DEPRECATED(3.5, "Use request:isEqualToRequestAfterStrippingFragments: instead."); + +- (BOOL)request:(NSURLRequest*)newRequest isEqualToRequestAfterStrippingFragments:(NSURLRequest*)originalRequest; @end diff --git a/platforms/ios/CordovaLib/Classes/CDVWebViewDelegate.m b/platforms/ios/CordovaLib/Classes/CDVWebViewDelegate.m index 2c0b6d8..5a187f4 100644 --- a/platforms/ios/CordovaLib/Classes/CDVWebViewDelegate.m +++ b/platforms/ios/CordovaLib/Classes/CDVWebViewDelegate.m @@ -91,6 +91,16 @@ Licensed to the Apache Software Foundation (ASF) under one STATE_CANCELLED = 5 } State; +static NSString *stripFragment(NSString* url) +{ + NSRange r = [url rangeOfString:@"#"]; + + if (r.location == NSNotFound) { + return url; + } + return [url substringToIndex:r.location]; +} + @implementation CDVWebViewDelegate - (id)initWithDelegate:(NSObject *)delegate @@ -105,38 +115,18 @@ - (id)initWithDelegate:(NSObject *)delegate } - (BOOL)request:(NSURLRequest*)newRequest isFragmentIdentifierToRequest:(NSURLRequest*)originalRequest +{ + return [self request:newRequest isEqualToRequestAfterStrippingFragments:originalRequest]; +} + +- (BOOL)request:(NSURLRequest*)newRequest isEqualToRequestAfterStrippingFragments:(NSURLRequest*)originalRequest { if (originalRequest.URL && newRequest.URL) { NSString* originalRequestUrl = [originalRequest.URL absoluteString]; NSString* newRequestUrl = [newRequest.URL absoluteString]; - // no fragment, easy - if (newRequest.URL.fragment == nil) { - return NO; - } - - // if the urls have fragments and they are equal - if ((originalRequest.URL.fragment && newRequest.URL.fragment) && [originalRequestUrl isEqualToString:newRequestUrl]) { - return YES; - } - - NSString* urlFormat = @"%@://%@:%d/%@#%@"; - // reconstruct the URLs (ignoring basic auth credentials, query string) - NSString* baseOriginalRequestUrl = [NSString stringWithFormat:urlFormat, - [originalRequest.URL scheme], - [originalRequest.URL host], - [[originalRequest.URL port] intValue], - [originalRequest.URL path], - [newRequest.URL fragment] // add the new request's fragment - ]; - NSString* baseNewRequestUrl = [NSString stringWithFormat:urlFormat, - [newRequest.URL scheme], - [newRequest.URL host], - [[newRequest.URL port] intValue], - [newRequest.URL path], - [newRequest.URL fragment] - ]; - + NSString* baseOriginalRequestUrl = stripFragment(originalRequestUrl); + NSString* baseNewRequestUrl = stripFragment(newRequestUrl); return [baseOriginalRequestUrl isEqualToString:baseNewRequestUrl]; } @@ -154,13 +144,18 @@ - (BOOL)isJsLoadTokenSet:(UIWebView*)webView { NSString* loadToken = [webView stringByEvaluatingJavaScriptFromString:@"window.__cordovaLoadToken"]; - return [[NSString stringWithFormat:@"%d", _curLoadToken] isEqualToString:loadToken]; + return [[NSString stringWithFormat:@"%ld", (long)_curLoadToken] isEqualToString:loadToken]; } - (void)setLoadToken:(UIWebView*)webView { _curLoadToken += 1; - [webView stringByEvaluatingJavaScriptFromString:[NSString stringWithFormat:@"window.__cordovaLoadToken=%d", _curLoadToken]]; + [webView stringByEvaluatingJavaScriptFromString:[NSString stringWithFormat:@"window.__cordovaLoadToken=%ld", (long)_curLoadToken]]; +} + +- (NSString*)evalForCurrentURL:(UIWebView*)webView +{ + return [webView stringByEvaluatingJavaScriptFromString:@"location.href"]; } - (void)pollForPageLoadStart:(UIWebView*)webView @@ -203,6 +198,17 @@ - (void)pollForPageLoadFinish:(UIWebView*)webView } } +- (BOOL)shouldLoadRequest:(NSURLRequest*)request +{ + NSString* scheme = [[request URL] scheme]; + + if ([scheme isEqualToString:@"mailto"] || [scheme isEqualToString:@"tel"]) { + return YES; + } + + return [NSURLConnection canHandleRequest:request]; +} + - (BOOL)webView:(UIWebView*)webView shouldStartLoadWithRequest:(NSURLRequest*)request navigationType:(UIWebViewNavigationType)navigationType { BOOL shouldLoad = YES; @@ -214,14 +220,29 @@ - (BOOL)webView:(UIWebView*)webView shouldStartLoadWithRequest:(NSURLRequest*)re VerboseLog(@"webView shouldLoad=%d (before) state=%d loadCount=%d URL=%@", shouldLoad, _state, _loadCount, request.URL); if (shouldLoad) { - BOOL isTopLevelNavigation = [request.URL isEqual:[request mainDocumentURL]]; + // When devtools refresh occurs, it blindly uses the same request object. If a history.replaceState() has occured, then + // mainDocumentURL != URL even though it's a top-level navigation. + BOOL isDevToolsRefresh = (request == webView.request); + BOOL isTopLevelNavigation = isDevToolsRefresh || [request.URL isEqual:[request mainDocumentURL]]; if (isTopLevelNavigation) { + // Ignore hash changes that don't navigate to a different page. + // webView.request does actually update when history.replaceState() gets called. + if ([self request:request isEqualToRequestAfterStrippingFragments:webView.request]) { + NSString* prevURL = [self evalForCurrentURL:webView]; + if ([prevURL isEqualToString:[request.URL absoluteString]]) { + VerboseLog(@"Page reload detected."); + } else { + VerboseLog(@"Detected hash change shouldLoad"); + return shouldLoad; + } + } + switch (_state) { case STATE_WAITING_FOR_LOAD_FINISH: // Redirect case. // We expect loadCount == 1. if (_loadCount != 1) { - NSLog(@"CDVWebViewDelegate: Detected redirect when loadCount=%d", _loadCount); + NSLog(@"CDVWebViewDelegate: Detected redirect when loadCount=%ld", (long)_loadCount); } break; @@ -237,21 +258,19 @@ - (BOOL)webView:(UIWebView*)webView shouldStartLoadWithRequest:(NSURLRequest*)re { _loadCount = 0; _state = STATE_WAITING_FOR_LOAD_START; - if (![self request:request isFragmentIdentifierToRequest:webView.request]) { - NSString* description = [NSString stringWithFormat:@"CDVWebViewDelegate: Navigation started when state=%d", _state]; - NSLog(@"%@", description); - if ([_delegate respondsToSelector:@selector(webView:didFailLoadWithError:)]) { - NSDictionary* errorDictionary = @{NSLocalizedDescriptionKey : description}; - NSError* error = [[NSError alloc] initWithDomain:@"CDVWebViewDelegate" code:1 userInfo:errorDictionary]; - [_delegate webView:webView didFailLoadWithError:error]; - } + NSString* description = [NSString stringWithFormat:@"CDVWebViewDelegate: Navigation started when state=%ld", (long)_state]; + NSLog(@"%@", description); + if ([_delegate respondsToSelector:@selector(webView:didFailLoadWithError:)]) { + NSDictionary* errorDictionary = @{NSLocalizedDescriptionKey : description}; + NSError* error = [[NSError alloc] initWithDomain:@"CDVWebViewDelegate" code:1 userInfo:errorDictionary]; + [_delegate webView:webView didFailLoadWithError:error]; } } } } else { // Deny invalid URLs so that we don't get the case where we go straight from // webViewShouldLoad -> webViewDidFailLoad (messes up _loadCount). - shouldLoad = shouldLoad && [NSURLConnection canHandleRequest:request]; + shouldLoad = shouldLoad && [self shouldLoadRequest:request]; } VerboseLog(@"webView shouldLoad=%d (after) isTopLevelNavigation=%d state=%d loadCount=%d", shouldLoad, isTopLevelNavigation, _state, _loadCount); } @@ -272,7 +291,7 @@ - (void)webViewDidStartLoad:(UIWebView*)webView // We could try to distinguish using [UIWebView canGoForward], but that's too much complexity, // and would work only on the first time it was used. - // Our work-around is to set a JS variable and poll until it disappears (from a naviagtion). + // Our work-around is to set a JS variable and poll until it disappears (from a navigation). _state = STATE_IOS5_POLLING_FOR_LOAD_START; _loadStartPollCount = 0; [self setLoadToken:webView]; @@ -287,7 +306,7 @@ - (void)webViewDidStartLoad:(UIWebView*)webView case STATE_WAITING_FOR_LOAD_START: if (_loadCount != 0) { - NSLog(@"CDVWebViewDelegate: Unexpected loadCount in didStart. count=%d", _loadCount); + NSLog(@"CDVWebViewDelegate: Unexpected loadCount in didStart. count=%ld", (long)_loadCount); } fireCallback = YES; _state = STATE_WAITING_FOR_LOAD_FINISH; @@ -307,7 +326,7 @@ - (void)webViewDidStartLoad:(UIWebView*)webView break; default: - NSLog(@"CDVWebViewDelegate: Unexpected didStart with state=%d loadCount=%d", _state, _loadCount); + NSLog(@"CDVWebViewDelegate: Unexpected didStart with state=%ld loadCount=%ld", (long)_state, (long)_loadCount); } VerboseLog(@"webView didStartLoad (after). state=%d loadCount=%d fireCallback=%d", _state, _loadCount, fireCallback); if (fireCallback && [_delegate respondsToSelector:@selector(webViewDidStartLoad:)]) { @@ -359,7 +378,11 @@ - (void)webView:(UIWebView*)webView didFailLoadWithError:(NSError*)error break; case STATE_WAITING_FOR_LOAD_START: - _state = STATE_IDLE; + if ([error code] == NSURLErrorCancelled) { + _state = STATE_CANCELLED; + } else { + _state = STATE_IDLE; + } fireCallback = YES; break; diff --git a/platforms/ios/CordovaLib/Classes/CDVWhitelist.m b/platforms/ios/CordovaLib/Classes/CDVWhitelist.m index 5a9fb7e..8e3be75 100644 --- a/platforms/ios/CordovaLib/Classes/CDVWhitelist.m +++ b/platforms/ios/CordovaLib/Classes/CDVWhitelist.m @@ -44,6 +44,13 @@ + (NSString*)regexFromPattern:(NSString*)pattern allowWildcards:(bool)allowWildc if (allowWildcards) { regex = [regex stringByReplacingOccurrencesOfString:@"\\*" withString:@".*"]; + + /* [NSURL path] has the peculiarity that a trailing slash at the end of a path + * will be omitted. This regex tweak compensates for that. + */ + if ([regex hasSuffix:@"\\/.*"]) { + regex = [NSString stringWithFormat:@"%@(\\/.*)?", [regex substringToIndex:([regex length] - 4)]]; + } } return [NSString stringWithFormat:@"%@$", regex]; } @@ -55,14 +62,14 @@ - (id)initWithScheme:(NSString*)scheme host:(NSString*)host port:(NSString*)port if ((scheme == nil) || [scheme isEqualToString:@"*"]) { _scheme = nil; } else { - _scheme = [NSRegularExpression regularExpressionWithPattern:[CDVWhitelistPattern regexFromPattern:scheme allowWildcards:NO] options:0 error:nil]; + _scheme = [NSRegularExpression regularExpressionWithPattern:[CDVWhitelistPattern regexFromPattern:scheme allowWildcards:NO] options:NSRegularExpressionCaseInsensitive error:nil]; } if ([host isEqualToString:@"*"]) { _host = nil; } else if ([host hasPrefix:@"*."]) { - _host = [NSRegularExpression regularExpressionWithPattern:[NSString stringWithFormat:@"([a-z0-9.-]*\\.)?%@", [CDVWhitelistPattern regexFromPattern:[host substringFromIndex:2] allowWildcards:false]] options:0 error:nil]; + _host = [NSRegularExpression regularExpressionWithPattern:[NSString stringWithFormat:@"([a-z0-9.-]*\\.)?%@", [CDVWhitelistPattern regexFromPattern:[host substringFromIndex:2] allowWildcards:false]] options:NSRegularExpressionCaseInsensitive error:nil]; } else { - _host = [NSRegularExpression regularExpressionWithPattern:[CDVWhitelistPattern regexFromPattern:host allowWildcards:NO] options:0 error:nil]; + _host = [NSRegularExpression regularExpressionWithPattern:[CDVWhitelistPattern regexFromPattern:host allowWildcards:NO] options:NSRegularExpressionCaseInsensitive error:nil]; } if ((port == nil) || [port isEqualToString:@"*"]) { _port = nil; @@ -162,7 +169,7 @@ - (void)addWhiteListEntry:(NSString*)origin self.whitelist = nil; self.permittedSchemes = nil; } else { // specific access - NSRegularExpression* parts = [NSRegularExpression regularExpressionWithPattern:@"^((\\*|[a-z-]+)://)?(((\\*\\.)?[^*/:]+)|\\*)?(:(\\d+))?(/.*)?" options:0 error:nil]; + NSRegularExpression* parts = [NSRegularExpression regularExpressionWithPattern:@"^((\\*|[A-Za-z-]+)://)?(((\\*\\.)?[^*/:]+)|\\*)?(:(\\d+))?(/.*)?" options:0 error:nil]; NSTextCheckingResult* m = [parts firstMatchInString:origin options:NSMatchingAnchored range:NSMakeRange(0, [origin length])]; if (m != nil) { NSRange r; @@ -239,7 +246,7 @@ - (BOOL)URLIsAllowed:(NSURL*)url logFailure:(BOOL)logFailure } // Shortcut rejection: Check that the scheme is supported - NSString* scheme = [url scheme]; + NSString* scheme = [[url scheme] lowercaseString]; if (![self schemeIsAllowed:scheme]) { if (logFailure) { NSLog(@"%@", [self errorStringForURL:url]); @@ -249,7 +256,7 @@ - (BOOL)URLIsAllowed:(NSURL*)url logFailure:(BOOL)logFailure // http[s] and ftp[s] should also validate against the common set in the kCDVDefaultSchemeName list if ([scheme isEqualToString:@"http"] || [scheme isEqualToString:@"https"] || [scheme isEqualToString:@"ftp"] || [scheme isEqualToString:@"ftps"]) { - NSURL* newUrl = [NSURL URLWithString:[NSString stringWithFormat:@"%@://%@%@", kCDVDefaultSchemeName, [url host], [url path]]]; + NSURL* newUrl = [NSURL URLWithString:[NSString stringWithFormat:@"%@://%@%@", kCDVDefaultSchemeName, [url host], [[url path] stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]]]; // If it is allowed, we are done. If not, continue to check for the actual scheme-specific list if ([self URLIsAllowed:newUrl logFailure:NO]) { return YES; diff --git a/platforms/ios/CordovaLib/Classes/NSArray+Comparisons.m b/platforms/ios/CordovaLib/Classes/NSArray+Comparisons.m index 485e3c8..e29c03d 100644 --- a/platforms/ios/CordovaLib/Classes/NSArray+Comparisons.m +++ b/platforms/ios/CordovaLib/Classes/NSArray+Comparisons.m @@ -24,9 +24,11 @@ @implementation NSArray (Comparisons) - (id)objectAtIndex:(NSUInteger)index withDefault:(id)aDefault { id obj = nil; - + @try { - obj = [self objectAtIndex:index]; + if (index < [self count]) { + obj = [self objectAtIndex:index]; + } if ((obj == [NSNull null]) || (obj == nil)) { return aDefault; } @@ -34,7 +36,7 @@ - (id)objectAtIndex:(NSUInteger)index withDefault:(id)aDefault @catch(NSException* exception) { NSLog(@"Exception - Name: %@ Reason: %@", [exception name], [exception reason]); } - + return obj; } diff --git a/platforms/ios/CordovaLib/Classes/NSData+Base64.h b/platforms/ios/CordovaLib/Classes/NSData+Base64.h index ffe9c83..d5a9a6f 100644 --- a/platforms/ios/CordovaLib/Classes/NSData+Base64.h +++ b/platforms/ios/CordovaLib/Classes/NSData+Base64.h @@ -5,11 +5,20 @@ // Created by Matt Gallagher on 2009/06/03. // Copyright 2009 Matt Gallagher. All rights reserved. // -// Permission is given to use this source code file, free of charge, in any -// project, commercial or otherwise, entirely at your risk, with the condition -// that any redistribution (in part or whole) of source code must retain -// this copyright and permission notice. Attribution in compiled projects is -// appreciated but not required. +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. Permission is granted to anyone to +// use this software for any purpose, including commercial applications, and to +// alter it and redistribute it freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source +// distribution. // #import diff --git a/platforms/ios/CordovaLib/Classes/NSData+Base64.m b/platforms/ios/CordovaLib/Classes/NSData+Base64.m index d0f2189..c9d67f9 100644 --- a/platforms/ios/CordovaLib/Classes/NSData+Base64.m +++ b/platforms/ios/CordovaLib/Classes/NSData+Base64.m @@ -5,11 +5,20 @@ // Created by Matt Gallagher on 2009/06/03. // Copyright 2009 Matt Gallagher. All rights reserved. // -// Permission is given to use this source code file, free of charge, in any -// project, commercial or otherwise, entirely at your risk, with the condition -// that any redistribution (in part or whole) of source code must retain -// this copyright and permission notice. Attribution in compiled projects is -// appreciated but not required. +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. Permission is granted to anyone to +// use this software for any purpose, including commercial applications, and to +// alter it and redistribute it freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source +// distribution. // #import "NSData+Base64.h" @@ -17,7 +26,7 @@ // // Mapping from 6 bit pattern to ASCII character. // -static unsigned char cdvbase64EncodeLookup[65] = +static unsigned char base64EncodeLookup[65] = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; // @@ -28,7 +37,7 @@ // // Mapping from ASCII character to 6 bit pattern. // -static unsigned char cdvbase64DecodeLookup[256] = +static unsigned char base64DecodeLookup[256] = { xx, xx, xx, xx, xx, xx, xx, xx, xx, xx, xx, xx, xx, xx, xx, xx, xx, xx, xx, xx, xx, xx, xx, xx, xx, xx, xx, xx, xx, xx, xx, xx, @@ -51,8 +60,8 @@ // // Fundamental sizes of the binary and base64 encode/decode units in bytes // -#define CDV_BINARY_UNIT_SIZE 3 -#define CDV_BASE64_UNIT_SIZE 4 +#define BINARY_UNIT_SIZE 3 +#define BASE64_UNIT_SIZE 4 // // NewBase64Decode @@ -64,7 +73,7 @@ // length - the length of the string or -1 (to specify strlen should be used) // outputLength - if not-NULL, on output will contain the decoded length // -// returns the decoded buffer. Must be freed by caller. Length is given by +// returns the decoded buffer. Must be free'd by caller. Length is given by // outputLength. // void *CDVNewBase64Decode( @@ -76,7 +85,8 @@ length = strlen(inputBuffer); } - size_t outputBufferSize = (length / CDV_BASE64_UNIT_SIZE) * CDV_BINARY_UNIT_SIZE; + size_t outputBufferSize = + ((length + BASE64_UNIT_SIZE - 1) / BASE64_UNIT_SIZE) * BINARY_UNIT_SIZE; unsigned char* outputBuffer = (unsigned char*)malloc(outputBufferSize); size_t i = 0; @@ -86,17 +96,16 @@ // // Accumulate 4 valid characters (ignore everything else) // - unsigned char accumulated[CDV_BASE64_UNIT_SIZE]; - bzero(accumulated, sizeof(unsigned char) * CDV_BASE64_UNIT_SIZE); + unsigned char accumulated[BASE64_UNIT_SIZE]; size_t accumulateIndex = 0; while (i < length) { - unsigned char decode = cdvbase64DecodeLookup[inputBuffer[i++]]; + unsigned char decode = base64DecodeLookup[inputBuffer[i++]]; if (decode != xx) { accumulated[accumulateIndex] = decode; accumulateIndex++; - if (accumulateIndex == CDV_BASE64_UNIT_SIZE) { + if (accumulateIndex == BASE64_UNIT_SIZE) { break; } } @@ -105,9 +114,17 @@ // // Store the 6 bits from each of the 4 characters as 3 bytes // - outputBuffer[j] = (accumulated[0] << 2) | (accumulated[1] >> 4); - outputBuffer[j + 1] = (accumulated[1] << 4) | (accumulated[2] >> 2); - outputBuffer[j + 2] = (accumulated[2] << 6) | accumulated[3]; + // (Uses improved bounds checking suggested by Alexandre Colucci) + // + if (accumulateIndex >= 2) { + outputBuffer[j] = (accumulated[0] << 2) | (accumulated[1] >> 4); + } + if (accumulateIndex >= 3) { + outputBuffer[j + 1] = (accumulated[1] << 4) | (accumulated[2] >> 2); + } + if (accumulateIndex >= 4) { + outputBuffer[j + 2] = (accumulated[2] << 6) | accumulated[3]; + } j += accumulateIndex - 1; } @@ -118,7 +135,7 @@ } // -// NewBase64Decode +// NewBase64Encode // // Encodes the arbitrary data in the inputBuffer as base64 into a newly malloced // output buffer. @@ -130,7 +147,7 @@ // outputLength - if not-NULL, on output will contain the encoded length // (not including terminating 0 char) // -// returns the encoded buffer. Must be freed by caller. Length is given by +// returns the encoded buffer. Must be free'd by caller. Length is given by // outputLength. // char *CDVNewBase64Encode( @@ -143,16 +160,16 @@ #define MAX_NUM_PADDING_CHARS 2 #define OUTPUT_LINE_LENGTH 64 -#define INPUT_LINE_LENGTH ((OUTPUT_LINE_LENGTH / CDV_BASE64_UNIT_SIZE) * CDV_BINARY_UNIT_SIZE) -#define CR_LF_SIZE 0 +#define INPUT_LINE_LENGTH ((OUTPUT_LINE_LENGTH / BASE64_UNIT_SIZE) * BINARY_UNIT_SIZE) +#define CR_LF_SIZE 2 // // Byte accurate calculation of final buffer size // size_t outputBufferSize = - ((length / CDV_BINARY_UNIT_SIZE) - + ((length % CDV_BINARY_UNIT_SIZE) ? 1 : 0)) - * CDV_BASE64_UNIT_SIZE; + ((length / BINARY_UNIT_SIZE) + + ((length % BINARY_UNIT_SIZE) ? 1 : 0)) + * BASE64_UNIT_SIZE; if (separateLines) { outputBufferSize += (outputBufferSize / OUTPUT_LINE_LENGTH) * CR_LF_SIZE; @@ -181,16 +198,16 @@ lineEnd = length; } - for (; i + CDV_BINARY_UNIT_SIZE - 1 < lineEnd; i += CDV_BINARY_UNIT_SIZE) { + for (; i + BINARY_UNIT_SIZE - 1 < lineEnd; i += BINARY_UNIT_SIZE) { // // Inner loop: turn 48 bytes into 64 base64 characters // - outputBuffer[j++] = cdvbase64EncodeLookup[(inputBuffer[i] & 0xFC) >> 2]; - outputBuffer[j++] = cdvbase64EncodeLookup[((inputBuffer[i] & 0x03) << 4) + outputBuffer[j++] = base64EncodeLookup[(inputBuffer[i] & 0xFC) >> 2]; + outputBuffer[j++] = base64EncodeLookup[((inputBuffer[i] & 0x03) << 4) | ((inputBuffer[i + 1] & 0xF0) >> 4)]; - outputBuffer[j++] = cdvbase64EncodeLookup[((inputBuffer[i + 1] & 0x0F) << 2) + outputBuffer[j++] = base64EncodeLookup[((inputBuffer[i + 1] & 0x0F) << 2) | ((inputBuffer[i + 2] & 0xC0) >> 6)]; - outputBuffer[j++] = cdvbase64EncodeLookup[inputBuffer[i + 2] & 0x3F]; + outputBuffer[j++] = base64EncodeLookup[inputBuffer[i + 2] & 0x3F]; } if (lineEnd == length) { @@ -209,17 +226,17 @@ // // Handle the single '=' case // - outputBuffer[j++] = cdvbase64EncodeLookup[(inputBuffer[i] & 0xFC) >> 2]; - outputBuffer[j++] = cdvbase64EncodeLookup[((inputBuffer[i] & 0x03) << 4) + outputBuffer[j++] = base64EncodeLookup[(inputBuffer[i] & 0xFC) >> 2]; + outputBuffer[j++] = base64EncodeLookup[((inputBuffer[i] & 0x03) << 4) | ((inputBuffer[i + 1] & 0xF0) >> 4)]; - outputBuffer[j++] = cdvbase64EncodeLookup[(inputBuffer[i + 1] & 0x0F) << 2]; + outputBuffer[j++] = base64EncodeLookup[(inputBuffer[i + 1] & 0x0F) << 2]; outputBuffer[j++] = '='; } else if (i < length) { // // Handle the double '=' case // - outputBuffer[j++] = cdvbase64EncodeLookup[(inputBuffer[i] & 0xFC) >> 2]; - outputBuffer[j++] = cdvbase64EncodeLookup[(inputBuffer[i] & 0x03) << 4]; + outputBuffer[j++] = base64EncodeLookup[(inputBuffer[i] & 0xFC) >> 2]; + outputBuffer[j++] = base64EncodeLookup[(inputBuffer[i] & 0x03) << 4]; outputBuffer[j++] = '='; outputBuffer[j++] = '='; } diff --git a/platforms/ios/CordovaLib/CordovaLib.xcodeproj/project.pbxproj b/platforms/ios/CordovaLib/CordovaLib.xcodeproj/project.pbxproj index 730be24..63c294c 100644 --- a/platforms/ios/CordovaLib/CordovaLib.xcodeproj/project.pbxproj +++ b/platforms/ios/CordovaLib/CordovaLib.xcodeproj/project.pbxproj @@ -8,7 +8,6 @@ /* Begin PBXBuildFile section */ 1B701028177A61CF00AE11F4 /* CDVShared.h in Headers */ = {isa = PBXBuildFile; fileRef = 1B701026177A61CF00AE11F4 /* CDVShared.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 1B701029177A61CF00AE11F4 /* CDVShared.m in Sources */ = {isa = PBXBuildFile; fileRef = 1B701027177A61CF00AE11F4 /* CDVShared.m */; }; 1F92F4A01314023E0046367C /* CDVPluginResult.h in Headers */ = {isa = PBXBuildFile; fileRef = 1F92F49E1314023E0046367C /* CDVPluginResult.h */; settings = {ATTRIBUTES = (Public, ); }; }; 1F92F4A11314023E0046367C /* CDVPluginResult.m in Sources */ = {isa = PBXBuildFile; fileRef = 1F92F49F1314023E0046367C /* CDVPluginResult.m */; }; 301F2F2A14F3C9CA003FE9FC /* CDV.h in Headers */ = {isa = PBXBuildFile; fileRef = 301F2F2914F3C9CA003FE9FC /* CDV.h */; settings = {ATTRIBUTES = (Public, ); }; }; @@ -32,6 +31,7 @@ 30F5EBAB14CA26E700987760 /* CDVCommandDelegate.h in Headers */ = {isa = PBXBuildFile; fileRef = 30F5EBA914CA26E700987760 /* CDVCommandDelegate.h */; settings = {ATTRIBUTES = (Public, ); }; }; 7E14B5A81705050A0032169E /* CDVTimer.h in Headers */ = {isa = PBXBuildFile; fileRef = 7E14B5A61705050A0032169E /* CDVTimer.h */; settings = {ATTRIBUTES = (Public, ); }; }; 7E14B5A91705050A0032169E /* CDVTimer.m in Sources */ = {isa = PBXBuildFile; fileRef = 7E14B5A71705050A0032169E /* CDVTimer.m */; }; + 7E22B88519E4C0210026F95E /* CDVAvailabilityDeprecated.h in Headers */ = {isa = PBXBuildFile; fileRef = 7E22B88419E4C0210026F95E /* CDVAvailabilityDeprecated.h */; settings = {ATTRIBUTES = (Public, ); }; }; 8852C43A14B65FD800F0E735 /* CDVViewController.h in Headers */ = {isa = PBXBuildFile; fileRef = 8852C43614B65FD800F0E735 /* CDVViewController.h */; settings = {ATTRIBUTES = (Public, ); }; }; 8852C43C14B65FD800F0E735 /* CDVViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 8852C43714B65FD800F0E735 /* CDVViewController.m */; }; 8887FD681090FBE7009987E8 /* NSDictionary+Extensions.h in Headers */ = {isa = PBXBuildFile; fileRef = 8887FD281090FBE7009987E8 /* NSDictionary+Extensions.h */; settings = {ATTRIBUTES = (Public, ); }; }; @@ -56,7 +56,6 @@ /* Begin PBXFileReference section */ 1B701026177A61CF00AE11F4 /* CDVShared.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CDVShared.h; path = Classes/CDVShared.h; sourceTree = ""; }; - 1B701027177A61CF00AE11F4 /* CDVShared.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = CDVShared.m; path = Classes/CDVShared.m; sourceTree = ""; }; 1F92F49E1314023E0046367C /* CDVPluginResult.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CDVPluginResult.h; path = Classes/CDVPluginResult.h; sourceTree = ""; }; 1F92F49F1314023E0046367C /* CDVPluginResult.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = CDVPluginResult.m; path = Classes/CDVPluginResult.m; sourceTree = ""; }; 301F2F2914F3C9CA003FE9FC /* CDV.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CDV.h; path = Classes/CDV.h; sourceTree = ""; }; @@ -93,6 +92,7 @@ 68A32D7414103017006B237C /* AddressBook.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AddressBook.framework; path = System/Library/Frameworks/AddressBook.framework; sourceTree = SDKROOT; }; 7E14B5A61705050A0032169E /* CDVTimer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CDVTimer.h; path = Classes/CDVTimer.h; sourceTree = ""; }; 7E14B5A71705050A0032169E /* CDVTimer.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = CDVTimer.m; path = Classes/CDVTimer.m; sourceTree = ""; }; + 7E22B88419E4C0210026F95E /* CDVAvailabilityDeprecated.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CDVAvailabilityDeprecated.h; path = Classes/CDVAvailabilityDeprecated.h; sourceTree = ""; }; 8220B5C316D5427E00EC3921 /* AssetsLibrary.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AssetsLibrary.framework; path = System/Library/Frameworks/AssetsLibrary.framework; sourceTree = SDKROOT; }; 8852C43614B65FD800F0E735 /* CDVViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CDVViewController.h; path = Classes/CDVViewController.h; sourceTree = ""; }; 8852C43714B65FD800F0E735 /* CDVViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = CDVViewController.m; path = Classes/CDVViewController.m; sourceTree = ""; }; @@ -191,6 +191,7 @@ 888700D710922F56009987E8 /* Commands */ = { isa = PBXGroup; children = ( + 7E22B88419E4C0210026F95E /* CDVAvailabilityDeprecated.h */, EBFF4DBA16D3FE2E008F452B /* CDVWebViewDelegate.m */, EBFF4DBB16D3FE2E008F452B /* CDVWebViewDelegate.h */, 301F2F2914F3C9CA003FE9FC /* CDV.h */, @@ -204,7 +205,6 @@ 30C684931407044A004C1A8E /* CDVURLProtocol.m */, 30C6847E1406CB38004C1A8E /* CDVWhitelist.h */, 1B701026177A61CF00AE11F4 /* CDVShared.h */, - 1B701027177A61CF00AE11F4 /* CDVShared.m */, 30C6847F1406CB38004C1A8E /* CDVWhitelist.m */, 30E33AF013A7E24B00594D64 /* CDVPlugin.h */, 30E33AF113A7E24B00594D64 /* CDVPlugin.m */, @@ -271,6 +271,7 @@ 30F5EBAB14CA26E700987760 /* CDVCommandDelegate.h in Headers */, 301F2F2A14F3C9CA003FE9FC /* CDV.h in Headers */, 30392E4E14F4FCAB00B9E0B8 /* CDVAvailability.h in Headers */, + 7E22B88519E4C0210026F95E /* CDVAvailabilityDeprecated.h in Headers */, 3034979C1513D56A0090E688 /* CDVLocalStorage.h in Headers */, 3062D120151D0EDB000D9128 /* UIDevice+Extensions.h in Headers */, EBA3557315ABD38C00F4DE24 /* NSArray+Comparisons.h in Headers */, @@ -312,7 +313,7 @@ 0867D690FE84028FC02AAC07 /* Project object */ = { isa = PBXProject; attributes = { - LastUpgradeCheck = 0500; + LastUpgradeCheck = 0510; }; buildConfigurationList = 1DEB922208733DC00010E9CD /* Build configuration list for PBXProject "CordovaLib" */; compatibilityVersion = "Xcode 3.2"; @@ -359,7 +360,6 @@ EB96673C16A8970A00D86CDF /* CDVUserAgentUtil.m in Sources */, EBFF4DBC16D3FE2E008F452B /* CDVWebViewDelegate.m in Sources */, 7E14B5A91705050A0032169E /* CDVTimer.m in Sources */, - 1B701029177A61CF00AE11F4 /* CDVShared.m in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -370,16 +370,6 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; - "ARCHS[sdk=iphoneos*]" = armv7; - "ARCHS[sdk=iphoneos6.*]" = ( - armv7, - armv7s, - ); - "ARCHS[sdk=iphoneos7.*]" = ( - armv7, - armv7s, - ); - "ARCHS[sdk=iphonesimulator*]" = i386; CLANG_ENABLE_OBJC_ARC = YES; COPY_PHASE_STRIP = NO; DSTROOT = "/tmp/$(PROJECT_NAME).dst"; @@ -392,7 +382,7 @@ GCC_THUMB_SUPPORT = NO; GCC_VERSION = ""; INSTALL_PATH = /usr/local/lib; - IPHONEOS_DEPLOYMENT_TARGET = 5.0; + IPHONEOS_DEPLOYMENT_TARGET = 6.0; PRODUCT_NAME = Cordova; PUBLIC_HEADERS_FOLDER_PATH = include/Cordova; SKIP_INSTALL = YES; @@ -403,16 +393,6 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; - "ARCHS[sdk=iphoneos*]" = armv7; - "ARCHS[sdk=iphoneos6.*]" = ( - armv7, - armv7s, - ); - "ARCHS[sdk=iphoneos7.*]" = ( - armv7, - armv7s, - ); - "ARCHS[sdk=iphonesimulator*]" = i386; CLANG_ENABLE_OBJC_ARC = YES; DSTROOT = "/tmp/$(PROJECT_NAME).dst"; GCC_MODEL_TUNING = G5; @@ -422,7 +402,7 @@ GCC_THUMB_SUPPORT = NO; GCC_VERSION = ""; INSTALL_PATH = /usr/local/lib; - IPHONEOS_DEPLOYMENT_TARGET = 5.0; + IPHONEOS_DEPLOYMENT_TARGET = 6.0; PRODUCT_NAME = Cordova; PUBLIC_HEADERS_FOLDER_PATH = include/Cordova; SKIP_INSTALL = YES; @@ -432,16 +412,6 @@ 1DEB922308733DC00010E9CD /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { - "ARCHS[sdk=iphoneos*]" = armv7; - "ARCHS[sdk=iphoneos6.*]" = ( - armv7, - armv7s, - ); - "ARCHS[sdk=iphoneos7.*]" = ( - armv7, - armv7s, - ); - "ARCHS[sdk=iphonesimulator*]" = i386; CLANG_WARN_BOOL_CONVERSION = YES; CLANG_WARN_CONSTANT_CONVERSION = YES; CLANG_WARN_EMPTY_BODY = YES; @@ -458,31 +428,20 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 5.0; - ONLY_ACTIVE_ARCH = NO; + IPHONEOS_DEPLOYMENT_TARGET = 6.0; + ONLY_ACTIVE_ARCH = YES; OTHER_CFLAGS = "-DDEBUG"; PUBLIC_HEADERS_FOLDER_PATH = include/Cordova; SDKROOT = iphoneos; SKIP_INSTALL = YES; TARGETED_DEVICE_FAMILY = "1,2"; USER_HEADER_SEARCH_PATHS = ""; - VALID_ARCHS = "i386 armv7 armv7s"; }; name = Debug; }; 1DEB922408733DC00010E9CD /* Release */ = { isa = XCBuildConfiguration; buildSettings = { - "ARCHS[sdk=iphoneos*]" = armv7; - "ARCHS[sdk=iphoneos6.*]" = ( - armv7, - armv7s, - ); - "ARCHS[sdk=iphoneos7.*]" = ( - armv7, - armv7s, - ); - "ARCHS[sdk=iphonesimulator*]" = i386; CLANG_WARN_BOOL_CONVERSION = YES; CLANG_WARN_CONSTANT_CONVERSION = YES; CLANG_WARN_EMPTY_BODY = YES; @@ -498,13 +457,12 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 5.0; + IPHONEOS_DEPLOYMENT_TARGET = 6.0; ONLY_ACTIVE_ARCH = NO; PUBLIC_HEADERS_FOLDER_PATH = include/Cordova; SDKROOT = iphoneos; SKIP_INSTALL = YES; TARGETED_DEVICE_FAMILY = "1,2"; - VALID_ARCHS = "i386 armv7 armv7s"; }; name = Release; }; diff --git a/platforms/ios/CordovaLib/VERSION b/platforms/ios/CordovaLib/VERSION index 15a2799..7c69a55 100644 --- a/platforms/ios/CordovaLib/VERSION +++ b/platforms/ios/CordovaLib/VERSION @@ -1 +1 @@ -3.3.0 +3.7.0 diff --git a/platforms/ios/CordovaLib/cordova.js b/platforms/ios/CordovaLib/cordova.js index a26e7b1..84b7642 100644 --- a/platforms/ios/CordovaLib/cordova.js +++ b/platforms/ios/CordovaLib/cordova.js @@ -1,5 +1,5 @@ // Platform: ios -// 3.3.0 +// 91157c2e1bf3eb098c7e2ab31404e895ccb0df2a /* Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file @@ -19,8 +19,8 @@ under the License. */ ;(function() { -var CORDOVA_JS_BUILD_LABEL = '3.3.0'; -// file: lib/scripts/require.js +var PLATFORM_VERSION_BUILD_LABEL = '3.7.0'; +// file: src/scripts/require.js /*jshint -W079 */ /*jshint -W020 */ @@ -98,7 +98,7 @@ if (typeof module === "object" && typeof require === "function") { module.exports.define = define; } -// file: lib/cordova.js +// file: src/cordova.js define("cordova", function(require, exports, module) { @@ -175,7 +175,8 @@ function createEvent(type, data) { var cordova = { define:define, require:require, - version:CORDOVA_JS_BUILD_LABEL, + version:PLATFORM_VERSION_BUILD_LABEL, + platformVersion:PLATFORM_VERSION_BUILD_LABEL, platformId:platform.id, /** * Methods to add/remove your own addEventListener hijacking on document + window. @@ -262,11 +263,7 @@ var cordova = { * Called by native code when returning successful result from an action. */ callbackSuccess: function(callbackId, args) { - try { - cordova.callbackFromNative(callbackId, true, args.status, [args.message], args.keepCallback); - } catch (e) { - console.log("Error in error callback: " + callbackId + " = "+e); - } + cordova.callbackFromNative(callbackId, true, args.status, [args.message], args.keepCallback); }, /** @@ -275,30 +272,34 @@ var cordova = { callbackError: function(callbackId, args) { // TODO: Deprecate callbackSuccess and callbackError in favour of callbackFromNative. // Derive success from status. - try { - cordova.callbackFromNative(callbackId, false, args.status, [args.message], args.keepCallback); - } catch (e) { - console.log("Error in error callback: " + callbackId + " = "+e); - } + cordova.callbackFromNative(callbackId, false, args.status, [args.message], args.keepCallback); }, /** * Called by native code when returning the result from an action. */ - callbackFromNative: function(callbackId, success, status, args, keepCallback) { - var callback = cordova.callbacks[callbackId]; - if (callback) { - if (success && status == cordova.callbackStatus.OK) { - callback.success && callback.success.apply(null, args); - } else if (!success) { - callback.fail && callback.fail.apply(null, args); - } + callbackFromNative: function(callbackId, isSuccess, status, args, keepCallback) { + try { + var callback = cordova.callbacks[callbackId]; + if (callback) { + if (isSuccess && status == cordova.callbackStatus.OK) { + callback.success && callback.success.apply(null, args); + } else { + callback.fail && callback.fail.apply(null, args); + } - // Clear callback if not expecting any more results - if (!keepCallback) { - delete cordova.callbacks[callbackId]; + // Clear callback if not expecting any more results + if (!keepCallback) { + delete cordova.callbacks[callbackId]; + } } } + catch (err) { + var msg = "Error in " + (isSuccess ? "Success" : "Error") + " callbackId: " + callbackId + " : " + err; + console && console.log && console.log(msg); + cordova.fireWindowEvent("cordovacallbackerror", { 'message': msg }); + throw err; + } }, addConstructor: function(func) { channel.onCordovaReady.subscribe(function() { @@ -316,7 +317,7 @@ module.exports = cordova; }); -// file: lib/common/argscheck.js +// file: src/common/argscheck.js define("cordova/argscheck", function(require, exports, module) { var exec = require('cordova/exec'); @@ -382,7 +383,7 @@ moduleExports.enableChecks = true; }); -// file: lib/common/base64.js +// file: src/common/base64.js define("cordova/base64", function(require, exports, module) { var base64 = exports; @@ -392,6 +393,16 @@ base64.fromArrayBuffer = function(arrayBuffer) { return uint8ToBase64(array); }; +base64.toArrayBuffer = function(str) { + var decodedStr = typeof atob != 'undefined' ? atob(str) : new Buffer(str,'base64').toString('binary'); + var arrayBuffer = new ArrayBuffer(decodedStr.length); + var array = new Uint8Array(arrayBuffer); + for (var i=0, len=decodedStr.length; i < len; i++) { + array[i] = decodedStr.charCodeAt(i); + } + return arrayBuffer; +}; + //------------------------------------------------------------------------------ /* This code is based on the performance tests at http://jsperf.com/b64tests @@ -438,7 +449,7 @@ function uint8ToBase64(rawData) { }); -// file: lib/common/builder.js +// file: src/common/builder.js define("cordova/builder", function(require, exports, module) { var utils = require('cordova/utils'); @@ -551,7 +562,7 @@ exports.replaceHookForTesting = function() {}; }); -// file: lib/common/channel.js +// file: src/common/channel.js define("cordova/channel", function(require, exports, module) { var utils = require('cordova/utils'), @@ -770,6 +781,7 @@ channel.createSticky('onNativeReady'); channel.createSticky('onCordovaReady'); // Event to indicate that all automatically loaded JS plugins are loaded and ready. +// FIXME remove this channel.createSticky('onPluginsReady'); // Event to indicate that Cordova is ready @@ -792,45 +804,66 @@ module.exports = channel; }); -// file: lib/ios/exec.js +// file: src/ios/exec.js define("cordova/exec", function(require, exports, module) { /** * Creates a gap bridge iframe used to notify the native code about queued * commands. - * - * @private */ var cordova = require('cordova'), channel = require('cordova/channel'), utils = require('cordova/utils'), base64 = require('cordova/base64'), + // XHR mode does not work on iOS 4.2. + // XHR mode's main advantage is working around a bug in -webkit-scroll, which + // doesn't exist only on iOS 5.x devices. + // IFRAME_NAV is the fastest. + // IFRAME_HASH could be made to enable synchronous bridge calls if we wanted this feature. jsToNativeModes = { IFRAME_NAV: 0, XHR_NO_PAYLOAD: 1, XHR_WITH_PAYLOAD: 2, - XHR_OPTIONAL_PAYLOAD: 3 + XHR_OPTIONAL_PAYLOAD: 3, + IFRAME_HASH_NO_PAYLOAD: 4, + // Bundling the payload turns out to be slower. Probably since it has to be URI encoded / decoded. + IFRAME_HASH_WITH_PAYLOAD: 5, + WK_WEBVIEW_BINDING: 6 }, bridgeMode, execIframe, + execHashIframe, + hashToggle = 1, execXhr, requestCount = 0, vcHeaderValue = null, commandQueue = [], // Contains pending JS->Native messages. isInContextOfEvalJs = 0; -function createExecIframe() { +function createExecIframe(src, unloadListener) { var iframe = document.createElement("iframe"); iframe.style.display = 'none'; + // Both the unload listener and the src must be set before adding the iframe + // to the document in order to avoid race conditions. Callbacks from native + // can happen within the appendChild() call! + iframe.onunload = unloadListener; + iframe.src = src; document.body.appendChild(iframe); return iframe; } +function createHashIframe() { + var ret = createExecIframe('about:blank'); + // Hash changes don't work on about:blank, so switch it to file:///. + ret.contentWindow.history.replaceState(null, null, 'file:///#'); + return ret; +} + function shouldBundleCommandJson() { - if (bridgeMode == jsToNativeModes.XHR_WITH_PAYLOAD) { + if (bridgeMode === jsToNativeModes.XHR_WITH_PAYLOAD) { return true; } - if (bridgeMode == jsToNativeModes.XHR_OPTIONAL_PAYLOAD) { + if (bridgeMode === jsToNativeModes.XHR_OPTIONAL_PAYLOAD) { var payloadLength = 0; for (var i = 0; i < commandQueue.length; ++i) { payloadLength += commandQueue[i].length; @@ -891,11 +924,12 @@ function convertMessageToArgsNativeToJs(message) { } function iOSExec() { - // XHR mode does not work on iOS 4.2, so default to IFRAME_NAV for such devices. - // XHR mode's main advantage is working around a bug in -webkit-scroll, which - // doesn't exist in 4.X devices anyways. if (bridgeMode === undefined) { - bridgeMode = navigator.userAgent.indexOf(' 4_') == -1 ? jsToNativeModes.XHR_NO_PAYLOAD : jsToNativeModes.IFRAME_NAV; + bridgeMode = jsToNativeModes.IFRAME_NAV; + } + + if (window.webkit && window.webkit.messageHandlers && window.webkit.messageHandlers.cordova && window.webkit.messageHandlers.cordova.postMessage) { + bridgeMode = jsToNativeModes.WK_WEBVIEW_BINDING; } var successCallback, failCallback, service, action, actionArgs, splitCommand; @@ -928,6 +962,9 @@ function iOSExec() { } catch (e) {} } + // If actionArgs is not provided, default to an empty array + actionArgs = actionArgs || []; + // Register the callbacks and add the callbackId to the positional // arguments if given. if (successCallback || failCallback) { @@ -944,36 +981,85 @@ function iOSExec() { // effectively clone the command arguments in case they are mutated before // the command is executed. commandQueue.push(JSON.stringify(command)); - - // If we're in the context of a stringByEvaluatingJavaScriptFromString call, - // then the queue will be flushed when it returns; no need for a poke. - // Also, if there is already a command in the queue, then we've already - // poked the native side, so there is no reason to do so again. - if (!isInContextOfEvalJs && commandQueue.length == 1) { - if (bridgeMode != jsToNativeModes.IFRAME_NAV) { - // This prevents sending an XHR when there is already one being sent. - // This should happen only in rare circumstances (refer to unit tests). - if (execXhr && execXhr.readyState != 4) { - execXhr = null; - } - // Re-using the XHR improves exec() performance by about 10%. - execXhr = execXhr || new XMLHttpRequest(); - // Changing this to a GET will make the XHR reach the URIProtocol on 4.2. - // For some reason it still doesn't work though... - // Add a timestamp to the query param to prevent caching. - execXhr.open('HEAD', "/!gap_exec?" + (+new Date()), true); - if (!vcHeaderValue) { - vcHeaderValue = /.*\((.*)\)/.exec(navigator.userAgent)[1]; - } - execXhr.setRequestHeader('vc', vcHeaderValue); - execXhr.setRequestHeader('rc', ++requestCount); - if (shouldBundleCommandJson()) { - execXhr.setRequestHeader('cmds', iOSExec.nativeFetchMessages()); + + if (bridgeMode === jsToNativeModes.WK_WEBVIEW_BINDING) { + window.webkit.messageHandlers.cordova.postMessage(command); + } else { + // If we're in the context of a stringByEvaluatingJavaScriptFromString call, + // then the queue will be flushed when it returns; no need for a poke. + // Also, if there is already a command in the queue, then we've already + // poked the native side, so there is no reason to do so again. + if (!isInContextOfEvalJs && commandQueue.length == 1) { + switch (bridgeMode) { + case jsToNativeModes.XHR_NO_PAYLOAD: + case jsToNativeModes.XHR_WITH_PAYLOAD: + case jsToNativeModes.XHR_OPTIONAL_PAYLOAD: + pokeNativeViaXhr(); + break; + default: // iframe-based. + pokeNativeViaIframe(); } - execXhr.send(null); + } + } +} + +function pokeNativeViaXhr() { + // This prevents sending an XHR when there is already one being sent. + // This should happen only in rare circumstances (refer to unit tests). + if (execXhr && execXhr.readyState != 4) { + execXhr = null; + } + // Re-using the XHR improves exec() performance by about 10%. + execXhr = execXhr || new XMLHttpRequest(); + // Changing this to a GET will make the XHR reach the URIProtocol on 4.2. + // For some reason it still doesn't work though... + // Add a timestamp to the query param to prevent caching. + execXhr.open('HEAD', "/!gap_exec?" + (+new Date()), true); + if (!vcHeaderValue) { + vcHeaderValue = /.*\((.*)\)$/.exec(navigator.userAgent)[1]; + } + execXhr.setRequestHeader('vc', vcHeaderValue); + execXhr.setRequestHeader('rc', ++requestCount); + if (shouldBundleCommandJson()) { + execXhr.setRequestHeader('cmds', iOSExec.nativeFetchMessages()); + } + execXhr.send(null); +} + +function onIframeUnload() { + execIframe = null; + setTimeout(pokeNativeViaIframe, 0); +} + +function pokeNativeViaIframe() { + // CB-5488 - Don't attempt to create iframe before document.body is available. + if (!document.body) { + setTimeout(pokeNativeViaIframe); + return; + } + if (bridgeMode === jsToNativeModes.IFRAME_HASH_NO_PAYLOAD || bridgeMode === jsToNativeModes.IFRAME_HASH_WITH_PAYLOAD) { + // TODO: This bridge mode doesn't properly support being removed from the DOM (CB-7735) + execHashIframe = execHashIframe || createHashIframe(); + // Check if they've removed it from the DOM, and put it back if so. + if (!execHashIframe.contentWindow) { + execHashIframe = createHashIframe(); + } + // The delegate method is called only when the hash changes, so toggle it back and forth. + hashToggle = hashToggle ^ 3; + var hashValue = '%0' + hashToggle; + if (bridgeMode === jsToNativeModes.IFRAME_HASH_WITH_PAYLOAD) { + hashValue += iOSExec.nativeFetchMessages(); + } + execHashIframe.contentWindow.location.hash = hashValue; + } else { + // Check if they've removed it from the DOM, and put it back if so. + if (execIframe && execIframe.contentWindow) { + // Listen for unload, since it can happen (CB-7735) that the iframe gets + // removed from the DOM before it gets a chance to poke the native side. + execIframe.contentWindow.onunload = onIframeUnload; + execIframe.src = 'gap://ready'; } else { - execIframe = execIframe || createExecIframe(); - execIframe.src = "gap://ready"; + execIframe = createExecIframe('gap://ready', onIframeUnload); } } } @@ -992,6 +1078,10 @@ iOSExec.setJsToNativeBridgeMode = function(mode) { }; iOSExec.nativeFetchMessages = function() { + // Stop listing for window detatch once native side confirms poke. + if (execIframe && execIframe.contentWindow) { + execIframe.contentWindow.onunload = null; + } // Each entry in commandQueue is a JSON string already. if (!commandQueue.length) { return ''; @@ -1024,7 +1114,7 @@ module.exports = iOSExec; }); -// file: lib/common/exec/proxy.js +// file: src/common/exec/proxy.js define("cordova/exec/proxy", function(require, exports, module) { @@ -1054,7 +1144,7 @@ module.exports = { }; }); -// file: lib/common/init.js +// file: src/common/init.js define("cordova/init", function(require, exports, module) { var channel = require('cordova/channel'); @@ -1062,6 +1152,7 @@ var cordova = require('cordova'); var modulemapper = require('cordova/modulemapper'); var platform = require('cordova/platform'); var pluginloader = require('cordova/pluginloader'); +var utils = require('cordova/utils'); var platformInitChannelsArray = [channel.onNativeReady, channel.onPluginsReady]; @@ -1093,11 +1184,19 @@ function replaceNavigator(origNavigator) { for (var key in origNavigator) { if (typeof origNavigator[key] == 'function') { newNavigator[key] = origNavigator[key].bind(origNavigator); + } + else { + (function(k) { + utils.defineGetterSetter(newNavigator,key,function() { + return origNavigator[k]; + }); + })(key); } } } return newNavigator; } + if (window.navigator) { window.navigator = replaceNavigator(window.navigator); } @@ -1141,9 +1240,13 @@ modulemapper.clobbers('cordova/exec', 'Cordova.exec'); // Call the platform-specific initialization. platform.bootstrap && platform.bootstrap(); -pluginloader.load(function() { - channel.onPluginsReady.fire(); -}); +// Wrap in a setTimeout to support the use-case of having plugin JS appended to cordova.js. +// The delay allows the attached modules to be defined before the plugin loader looks for them. +setTimeout(function() { + pluginloader.load(function() { + channel.onPluginsReady.fire(); + }); +}, 0); /** * Create all cordova objects once native side is ready. @@ -1168,7 +1271,120 @@ channel.join(function() { }); -// file: lib/common/modulemapper.js +// file: src/common/init_b.js +define("cordova/init_b", function(require, exports, module) { + +var channel = require('cordova/channel'); +var cordova = require('cordova'); +var platform = require('cordova/platform'); +var utils = require('cordova/utils'); + +var platformInitChannelsArray = [channel.onDOMContentLoaded, channel.onNativeReady]; + +// setting exec +cordova.exec = require('cordova/exec'); + +function logUnfiredChannels(arr) { + for (var i = 0; i < arr.length; ++i) { + if (arr[i].state != 2) { + console.log('Channel not fired: ' + arr[i].type); + } + } +} + +window.setTimeout(function() { + if (channel.onDeviceReady.state != 2) { + console.log('deviceready has not fired after 5 seconds.'); + logUnfiredChannels(platformInitChannelsArray); + logUnfiredChannels(channel.deviceReadyChannelsArray); + } +}, 5000); + +// Replace navigator before any modules are required(), to ensure it happens as soon as possible. +// We replace it so that properties that can't be clobbered can instead be overridden. +function replaceNavigator(origNavigator) { + var CordovaNavigator = function() {}; + CordovaNavigator.prototype = origNavigator; + var newNavigator = new CordovaNavigator(); + // This work-around really only applies to new APIs that are newer than Function.bind. + // Without it, APIs such as getGamepads() break. + if (CordovaNavigator.bind) { + for (var key in origNavigator) { + if (typeof origNavigator[key] == 'function') { + newNavigator[key] = origNavigator[key].bind(origNavigator); + } + else { + (function(k) { + utils.defineGetterSetter(newNavigator,key,function() { + return origNavigator[k]; + }); + })(key); + } + } + } + return newNavigator; +} +if (window.navigator) { + window.navigator = replaceNavigator(window.navigator); +} + +if (!window.console) { + window.console = { + log: function(){} + }; +} +if (!window.console.warn) { + window.console.warn = function(msg) { + this.log("warn: " + msg); + }; +} + +// Register pause, resume and deviceready channels as events on document. +channel.onPause = cordova.addDocumentEventHandler('pause'); +channel.onResume = cordova.addDocumentEventHandler('resume'); +channel.onDeviceReady = cordova.addStickyDocumentEventHandler('deviceready'); + +// Listen for DOMContentLoaded and notify our channel subscribers. +if (document.readyState == 'complete' || document.readyState == 'interactive') { + channel.onDOMContentLoaded.fire(); +} else { + document.addEventListener('DOMContentLoaded', function() { + channel.onDOMContentLoaded.fire(); + }, false); +} + +// _nativeReady is global variable that the native side can set +// to signify that the native code is ready. It is a global since +// it may be called before any cordova JS is ready. +if (window._nativeReady) { + channel.onNativeReady.fire(); +} + +// Call the platform-specific initialization. +platform.bootstrap && platform.bootstrap(); + +/** + * Create all cordova objects once native side is ready. + */ +channel.join(function() { + + platform.initialize && platform.initialize(); + + // Fire event to notify that all objects are created + channel.onCordovaReady.fire(); + + // Fire onDeviceReady event once page has fully loaded, all + // constructors have run and cordova info has been received from native + // side. + channel.join(function() { + require('cordova').fireDocumentEvent('deviceready'); + }, channel.deviceReadyChannelsArray); + +}, platformInitChannelsArray); + +}); + +// file: src/common/modulemapper.js define("cordova/modulemapper", function(require, exports, module) { var builder = require('cordova/builder'), @@ -1269,7 +1485,7 @@ exports.reset(); }); -// file: lib/ios/platform.js +// file: src/ios/platform.js define("cordova/platform", function(require, exports, module) { module.exports = { @@ -1282,49 +1498,58 @@ module.exports = { }); -// file: lib/common/pluginloader.js +// file: src/common/pluginloader.js define("cordova/pluginloader", function(require, exports, module) { var modulemapper = require('cordova/modulemapper'); +var urlutil = require('cordova/urlutil'); // Helper function to inject a - - - -

Loading device properties...

- - - diff --git a/plugins/org.apache.cordova.core.device/docs/device.md b/plugins/org.apache.cordova.core.device/docs/device.md deleted file mode 100644 index 3748d36..0000000 --- a/plugins/org.apache.cordova.core.device/docs/device.md +++ /dev/null @@ -1,104 +0,0 @@ ---- - license: Licensed to the Apache Software Foundation (ASF) under one - or more contributor license agreements. See the NOTICE file - distributed with this work for additional information - regarding copyright ownership. The ASF licenses this file - to you under the Apache License, Version 2.0 (the - "License"); you may not use this file except in compliance - with the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, - software distributed under the License is distributed on an - "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - KIND, either express or implied. See the License for the - specific language governing permissions and limitations - under the License. ---- - -Device -====== - -> The `device` object describes the device's hardware and software. - -Properties ----------- - -- device.name -- device.cordova -- device.platform -- device.uuid -- device.version -- device.model - -Variable Scope --------------- - -Since `device` is assigned to the `window` object, it is implicitly in the global scope. - - // These reference the same `device` - var phoneName = window.device.name; - var phoneName = device.name; - -Permissions ------------ - -### Android - -#### app/res/xml/config.xml - - - -#### app/AndroidManifest.xml - - - -### Bada - -#### manifest.xml - - - SYSTEM_SERVICE - - -### BlackBerry WebWorks - -#### www/plugins.xml - - - -#### www/config.xml - - - - read_device_identifying_information - - -### iOS - - No permissions are required. - -### webOS - - No permissions are required. - -### Windows Phone - -#### Properties/WPAppManifest.xml - - - - - - - -Reference: [Application Manifest for Windows Phone](http://msdn.microsoft.com/en-us/library/ff769509%28v=vs.92%29.aspx) - -### Tizen - -#### config.xml - - - -Reference: [Application Manifest for Tizen Web Application](https://developer.tizen.org/help/topic/org.tizen.help.gs/Creating%20a%20Project.html?path=0_1_1_3#8814682_CreatingaProject-EditingconfigxmlFeatures) diff --git a/plugins/org.apache.cordova.core.device/docs/device.model.md b/plugins/org.apache.cordova.core.device/docs/device.model.md deleted file mode 100644 index e5238e4..0000000 --- a/plugins/org.apache.cordova.core.device/docs/device.model.md +++ /dev/null @@ -1,106 +0,0 @@ ---- - license: Licensed to the Apache Software Foundation (ASF) under one - or more contributor license agreements. See the NOTICE file - distributed with this work for additional information - regarding copyright ownership. The ASF licenses this file - to you under the Apache License, Version 2.0 (the - "License"); you may not use this file except in compliance - with the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, - software distributed under the License is distributed on an - "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - KIND, either express or implied. See the License for the - specific language governing permissions and limitations - under the License. ---- - -device.model -=========== - -Get the device's model name. - - var string = device.model; - -Description ------------ - -The `device.model` returns the name of the device's model or -product. The value is set by the device manufacturer and may be -different across versions of the same product. - -Supported Platforms -------------------- - -- Android -- BlackBerry WebWorks (OS 5.0 and higher) -- iOS -- Windows Phone 7 and 8 -- Bada 1.2 & 2.x -- webOS -- Tizen -- Windows 8 - -Quick Example -------------- - - // Android: Nexus One returns "Passion" (Nexus One code name) - // Motorola Droid returns "voles" - // BlackBerry: Torch 9800 returns "9800" - // iOS: for the iPad Mini, returns iPad2,5; iPhone 5 is iPhone 5,1. See http://theiphonewiki.com/wiki/index.php?title=Models - // - var model = device.model; - -Full Example ------------- - - - - - Device Properties Example - - - - - -

Loading device properties...

- - - -Android Quirks --------------- - -- Gets the [product name](http://developer.android.com/reference/android/os/Build.html#PRODUCT) instead of the [model name](http://developer.android.com/reference/android/os/Build.html#MODEL), which is often the production code name. For example, the Nexus One returns `Passion`, and Motorola Droid returns `voles`. - -Windows Phone 7 and 8 Quirks -------------- - -- Returns the device model specified by the manufacturer. For example, the Samsung Focus returns `SGH-i917`. - -Bada Quirks ------------ -- Returns the manufacturer model name, for example, `Samsung Wave S8500` - -Tizen Quirks ------------ -- Returns the device model assigned by the vendor, for example, `TIZEN` diff --git a/plugins/org.apache.cordova.core.device/docs/device.name.md b/plugins/org.apache.cordova.core.device/docs/device.name.md deleted file mode 100644 index a70648f..0000000 --- a/plugins/org.apache.cordova.core.device/docs/device.name.md +++ /dev/null @@ -1,108 +0,0 @@ ---- - license: Licensed to the Apache Software Foundation (ASF) under one - or more contributor license agreements. See the NOTICE file - distributed with this work for additional information - regarding copyright ownership. The ASF licenses this file - to you under the Apache License, Version 2.0 (the - "License"); you may not use this file except in compliance - with the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, - software distributed under the License is distributed on an - "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - KIND, either express or implied. See the License for the - specific language governing permissions and limitations - under the License. ---- - -device.name -=========== - -__WARNING:__ `device.name` is deprecated as of version 2.3.0. Use `device.model` instead. - -Get the device's model name. - - var string = device.name; - -Description ------------ - -`device.name` returns the name of the device's model or product. This -value is set by the device manufacturer and may be different across -versions of the same product. - -Supported Platforms -------------------- - -- Android -- BlackBerry WebWorks (OS 5.0 and higher) -- iOS -- Windows Phone 7 and 8 -- Bada 1.2 & 2.x -- webOS -- Tizen -- Windows 8 - -Quick Example -------------- - - // Android: Nexus One returns "Passion" (Nexus One code name) - // Motorola Droid returns "voles" - // BlackBerry: Torch 9800 returns "9800" - // iOS: All devices returns either "iPhone", "iPod Touch", "iPhone Simulator", "iPad", "iPad Simulator" - // - var name = device.name; - -Full Example ------------- - - - - - Device Properties Example - - - - - -

Loading device properties...

- - - -Android Quirks --------------- - -- Gets the [product name](http://developer.android.com/reference/android/os/Build.html#PRODUCT) instead of the [model name](http://developer.android.com/reference/android/os/Build.html#MODEL), which is often the production code name. For example, the Nexus One returns `Passion`, and Motorola Droid returns `voles`. - -Windows Phone 7 and 8 Quirks -------------- - -- Returns the device model specified by the manufacturer. For example, the Samsung Focus returns `SGH-i917`. - -Bada Quirks ------------ -- Returns the manufacturer model name, for example, `Samsung Wave S8500` - -Tizen Quirks ------------ -- Returns the device model assigned by the vendor, for example, `TIZEN` diff --git a/plugins/org.apache.cordova.core.device/docs/device.platform.md b/plugins/org.apache.cordova.core.device/docs/device.platform.md deleted file mode 100644 index 0d2cacb..0000000 --- a/plugins/org.apache.cordova.core.device/docs/device.platform.md +++ /dev/null @@ -1,99 +0,0 @@ ---- - license: Licensed to the Apache Software Foundation (ASF) under one - or more contributor license agreements. See the NOTICE file - distributed with this work for additional information - regarding copyright ownership. The ASF licenses this file - to you under the Apache License, Version 2.0 (the - "License"); you may not use this file except in compliance - with the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, - software distributed under the License is distributed on an - "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - KIND, either express or implied. See the License for the - specific language governing permissions and limitations - under the License. ---- - -device.platform -=============== - -Get the device's operating system name. - - var string = device.platform; - -Supported Platforms -------------------- - -- Android -- BlackBerry WebWorks (OS 5.0 and higher) -- iOS -- Windows Phone 7 and 8 -- Bada 1.2 & 2.x -- webOS -- Tizen -- Windows 8 - -Quick Example -------------- - - // Depending on the device, a few examples are: - // - "Android" - // - "BlackBerry" - // - "iOS" - // - "webOS" - // - "WinCE" - // - "Tizen" - var devicePlatform = device.platform; - -Full Example ------------- - - - - - Device Properties Example - - - - - -

Loading device properties...

- - - -BlackBerry Quirks ------------------ - -Devices may return the device platform version number instead of the -platform name. For example, the Storm2 9550 returns a value such as -`2.13.0.95`. - -Windows Phone 7 Quirks ------------------ - -Windows Phone 7 devices report the platform as `WinCE`. - -Windows Phone 8 Quirks ------------------ - -Windows Phone 8 devices report the platform as `Win32NT`. diff --git a/plugins/org.apache.cordova.core.device/docs/device.uuid.md b/plugins/org.apache.cordova.core.device/docs/device.uuid.md deleted file mode 100644 index 76abf73..0000000 --- a/plugins/org.apache.cordova.core.device/docs/device.uuid.md +++ /dev/null @@ -1,115 +0,0 @@ ---- - license: Licensed to the Apache Software Foundation (ASF) under one - or more contributor license agreements. See the NOTICE file - distributed with this work for additional information - regarding copyright ownership. The ASF licenses this file - to you under the Apache License, Version 2.0 (the - "License"); you may not use this file except in compliance - with the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, - software distributed under the License is distributed on an - "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - KIND, either express or implied. See the License for the - specific language governing permissions and limitations - under the License. ---- - -device.uuid -=========== - -Get the device's Universally Unique Identifier ([UUID](http://en.wikipedia.org/wiki/Universally_Unique_Identifier)). - - var string = device.uuid; - -Description ------------ - -The details of how a UUID is generated are determined by the device manufacturer and are specific to the device's platform or model. - -Supported Platforms -------------------- - -- Android -- BlackBerry WebWorks (OS 5.0 and higher) -- iOS -- Windows Phone 7 and 8 -- Bada 1.2 & 2.x -- webOS -- Tizen -- Windows 8 - -Quick Example -------------- - - // Android: Returns a random 64-bit integer (as a string, again!) - // The integer is generated on the device's first boot - // - // BlackBerry: Returns the PIN number of the device - // This is a nine-digit unique integer (as a string, though!) - // - // iPhone: (Paraphrased from the UIDevice Class documentation) - // Returns a string of hash values created from multiple hardware identifies. - // It is guaranteed to be unique for every device and cannot be tied - // to the user account. - // Windows Phone 7 : Returns a hash of device+current user, - // if the user is not defined, a guid is generated and will persist until the app is uninstalled - // - // webOS: returns the device NDUID - // - // Tizen: returns the device IMEI (International Mobile Equipment Identity or IMEI is a number - // unique to every GSM and UMTS mobile phone. - var deviceID = device.uuid; - -Full Example ------------- - - - - - Device Properties Example - - - - - -

Loading device properties...

- - - -iOS Quirk -------------- - -The `uuid` on iOS is not unique to a device, but varies for each -application, for each installation. It changes if you delete and -re-install the app, and possibly also when you upgrade iOS, or even -upgrade your app per version (apparent in iOS 5.1). The `uuid` is not -a reliable value. - -Windows Phone 7 and 8 Quirks -------------- - -The `uuid` for Windows Phone 7 requires the permission -`ID_CAP_IDENTITY_DEVICE`. Microsoft will likely deprecate this -property soon. If the capability is not available, the application -generates a persistent guid that is maintained for the duration of the -application's installation on the device. diff --git a/plugins/org.apache.cordova.core.device/docs/device.version.md b/plugins/org.apache.cordova.core.device/docs/device.version.md deleted file mode 100644 index ecd4733..0000000 --- a/plugins/org.apache.cordova.core.device/docs/device.version.md +++ /dev/null @@ -1,86 +0,0 @@ ---- - license: Licensed to the Apache Software Foundation (ASF) under one - or more contributor license agreements. See the NOTICE file - distributed with this work for additional information - regarding copyright ownership. The ASF licenses this file - to you under the Apache License, Version 2.0 (the - "License"); you may not use this file except in compliance - with the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, - software distributed under the License is distributed on an - "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - KIND, either express or implied. See the License for the - specific language governing permissions and limitations - under the License. ---- - -device.version -============== - -Get the operating system version. - - var string = device.version; - -Supported Platforms -------------------- - -- Android 2.1+ -- BlackBerry WebWorks (OS 5.0 and higher) -- iOS -- Windows Phone 7 and 8 -- Bada 1.2 & 2.x -- webOS -- Tizen -- Windows 8 - -Quick Example -------------- - - // Android: Froyo OS would return "2.2" - // Eclair OS would return "2.1", "2.0.1", or "2.0" - // Version can also return update level "2.1-update1" - // - // BlackBerry: Torch 9800 using OS 6.0 would return "6.0.0.600" - // - // iPhone: iOS 3.2 returns "3.2" - // - // Windows Phone 7: returns current OS version number, ex. on Mango returns 7.10.7720 - // webOS: webOS 2.2.4 return 2.2.4 - // Tizen: returns "TIZEN_20120425_2" - var deviceVersion = device.version; - -Full Example ------------- - - - - - Device Properties Example - - - - - -

Loading device properties...

- - diff --git a/plugins/org.apache.cordova.core.device/plugin.xml b/plugins/org.apache.cordova.core.device/plugin.xml deleted file mode 100644 index b299be3..0000000 --- a/plugins/org.apache.cordova.core.device/plugin.xml +++ /dev/null @@ -1,90 +0,0 @@ - - - - Device - Cordova Device Plugin - Apache - cordova,device - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - read_device_identifying_information - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/plugins/org.apache.cordova.core.device/src/android/Device.java b/plugins/org.apache.cordova.core.device/src/android/Device.java deleted file mode 100644 index 4ebaffa..0000000 --- a/plugins/org.apache.cordova.core.device/src/android/Device.java +++ /dev/null @@ -1,200 +0,0 @@ -/* - Licensed to the Apache Software Foundation (ASF) under one - or more contributor license agreements. See the NOTICE file - distributed with this work for additional information - regarding copyright ownership. The ASF licenses this file - to you under the Apache License, Version 2.0 (the - "License"); you may not use this file except in compliance - with the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, - software distributed under the License is distributed on an - "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - KIND, either express or implied. See the License for the - specific language governing permissions and limitations - under the License. -*/ -package org.apache.cordova.core; - -import java.util.TimeZone; - -import org.apache.cordova.CordovaWebView; -import org.apache.cordova.CallbackContext; -import org.apache.cordova.CordovaPlugin; -import org.apache.cordova.LOG; -import org.apache.cordova.CordovaInterface; -import org.json.JSONArray; -import org.json.JSONException; -import org.json.JSONObject; - -import android.content.BroadcastReceiver; -import android.content.Context; -import android.content.Intent; -import android.content.IntentFilter; -import android.provider.Settings; -import android.telephony.TelephonyManager; - -public class Device extends CordovaPlugin { - public static final String TAG = "Device"; - - public static String cordovaVersion = "dev"; // Cordova version - public static String platform = "Android"; // Device OS - public static String uuid; // Device UUID - - BroadcastReceiver telephonyReceiver = null; - - /** - * Constructor. - */ - public Device() { - } - - /** - * Sets the context of the Command. This can then be used to do things like - * get file paths associated with the Activity. - * - * @param cordova The context of the main Activity. - * @param webView The CordovaWebView Cordova is running in. - */ - public void initialize(CordovaInterface cordova, CordovaWebView webView) { - super.initialize(cordova, webView); - Device.uuid = getUuid(); - this.initTelephonyReceiver(); - } - - /** - * Executes the request and returns PluginResult. - * - * @param action The action to execute. - * @param args JSONArry of arguments for the plugin. - * @param callbackContext The callback id used when calling back into JavaScript. - * @return True if the action was valid, false if not. - */ - public boolean execute(String action, JSONArray args, CallbackContext callbackContext) throws JSONException { - if (action.equals("getDeviceInfo")) { - JSONObject r = new JSONObject(); - r.put("uuid", Device.uuid); - r.put("version", this.getOSVersion()); - r.put("platform", Device.platform); - r.put("cordova", Device.cordovaVersion); - r.put("model", this.getModel()); - callbackContext.success(r); - } - else { - return false; - } - return true; - } - - /** - * Unregister receiver. - */ - public void onDestroy() { - this.cordova.getActivity().unregisterReceiver(this.telephonyReceiver); - } - - //-------------------------------------------------------------------------- - // LOCAL METHODS - //-------------------------------------------------------------------------- - - /** - * Listen for telephony events: RINGING, OFFHOOK and IDLE - * Send these events to all plugins using - * CordovaActivity.onMessage("telephone", "ringing" | "offhook" | "idle") - */ - private void initTelephonyReceiver() { - IntentFilter intentFilter = new IntentFilter(); - intentFilter.addAction(TelephonyManager.ACTION_PHONE_STATE_CHANGED); - //final CordovaInterface mycordova = this.cordova; - this.telephonyReceiver = new BroadcastReceiver() { - - @Override - public void onReceive(Context context, Intent intent) { - - // If state has changed - if ((intent != null) && intent.getAction().equals(TelephonyManager.ACTION_PHONE_STATE_CHANGED)) { - if (intent.hasExtra(TelephonyManager.EXTRA_STATE)) { - String extraData = intent.getStringExtra(TelephonyManager.EXTRA_STATE); - if (extraData.equals(TelephonyManager.EXTRA_STATE_RINGING)) { - LOG.i(TAG, "Telephone RINGING"); - webView.postMessage("telephone", "ringing"); - } - else if (extraData.equals(TelephonyManager.EXTRA_STATE_OFFHOOK)) { - LOG.i(TAG, "Telephone OFFHOOK"); - webView.postMessage("telephone", "offhook"); - } - else if (extraData.equals(TelephonyManager.EXTRA_STATE_IDLE)) { - LOG.i(TAG, "Telephone IDLE"); - webView.postMessage("telephone", "idle"); - } - } - } - } - }; - - // Register the receiver - this.cordova.getActivity().registerReceiver(this.telephonyReceiver, intentFilter); - } - - /** - * Get the OS name. - * - * @return - */ - public String getPlatform() { - return Device.platform; - } - - /** - * Get the device's Universally Unique Identifier (UUID). - * - * @return - */ - public String getUuid() { - String uuid = Settings.Secure.getString(this.cordova.getActivity().getContentResolver(), android.provider.Settings.Secure.ANDROID_ID); - return uuid; - } - - /** - * Get the Cordova version. - * - * @return - */ - public String getCordovaVersion() { - return Device.cordovaVersion; - } - - public String getModel() { - String model = android.os.Build.MODEL; - return model; - } - - public String getProductName() { - String productname = android.os.Build.PRODUCT; - return productname; - } - - /** - * Get the OS version. - * - * @return - */ - public String getOSVersion() { - String osversion = android.os.Build.VERSION.RELEASE; - return osversion; - } - - public String getSDKVersion() { - @SuppressWarnings("deprecation") - String sdkversion = android.os.Build.VERSION.SDK; - return sdkversion; - } - - public String getTimeZoneID() { - TimeZone tz = TimeZone.getDefault(); - return (tz.getID()); - } - -} diff --git a/plugins/org.apache.cordova.core.device/src/blackberry10/index.js b/plugins/org.apache.cordova.core.device/src/blackberry10/index.js deleted file mode 100644 index db85ce1..0000000 --- a/plugins/org.apache.cordova.core.device/src/blackberry10/index.js +++ /dev/null @@ -1,63 +0,0 @@ -/* - * Copyright 2010-2011 Research In Motion Limited. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -function getModelName () { - var modelName = window.qnx.webplatform.device.modelName; - //Pre 10.2 (meaning Z10 or Q10) - if (typeof modelName === "undefined") { - if (window.screen.height === 720 && window.screen.width === 720) { - if ( window.matchMedia("(-blackberry-display-technology: -blackberry-display-oled)").matches) { - modelName = "Q10"; - } else { - modelName = "Q5"; - } - } else if ((window.screen.height === 1280 && window.screen.width === 768) || - (window.screen.height === 768 && window.screen.width === 1280)) { - modelName = "Z10"; - } else { - modelName = window.qnx.webplatform.deviceName; - } - } - - return modelName; -} - -function getUUID () { - var uuid = ""; - try { - //Must surround by try catch because this will throw if the app is missing permissions - uuid = window.qnx.webplatform.device.devicePin; - } catch (e) { - //DO Nothing - } - return uuid; -} - -module.exports = { - getDeviceInfo: function (success, fail, args, env) { - var result = new PluginResult(args, env), - modelName = getModelName(), - uuid = getUUID(), - info = { - platform: "blackberry10", - version: window.qnx.webplatform.device.scmBundle, - model: modelName, - uuid: uuid, - cordova: "dev" - }; - result.ok(info); - } -}; diff --git a/plugins/org.apache.cordova.core.device/src/ios/CDVDevice.h b/plugins/org.apache.cordova.core.device/src/ios/CDVDevice.h deleted file mode 100644 index a146d88..0000000 --- a/plugins/org.apache.cordova.core.device/src/ios/CDVDevice.h +++ /dev/null @@ -1,30 +0,0 @@ -/* - Licensed to the Apache Software Foundation (ASF) under one - or more contributor license agreements. See the NOTICE file - distributed with this work for additional information - regarding copyright ownership. The ASF licenses this file - to you under the Apache License, Version 2.0 (the - "License"); you may not use this file except in compliance - with the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, - software distributed under the License is distributed on an - "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - KIND, either express or implied. See the License for the - specific language governing permissions and limitations - under the License. - */ - -#import -#import - -@interface CDVDevice : CDVPlugin -{} - -+ (NSString*)cordovaVersion; - -- (void)getDeviceInfo:(CDVInvokedUrlCommand*)command; - -@end diff --git a/plugins/org.apache.cordova.core.device/src/ios/CDVDevice.m b/plugins/org.apache.cordova.core.device/src/ios/CDVDevice.m deleted file mode 100644 index 7e18d92..0000000 --- a/plugins/org.apache.cordova.core.device/src/ios/CDVDevice.m +++ /dev/null @@ -1,90 +0,0 @@ -/* - Licensed to the Apache Software Foundation (ASF) under one - or more contributor license agreements. See the NOTICE file - distributed with this work for additional information - regarding copyright ownership. The ASF licenses this file - to you under the Apache License, Version 2.0 (the - "License"); you may not use this file except in compliance - with the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, - software distributed under the License is distributed on an - "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - KIND, either express or implied. See the License for the - specific language governing permissions and limitations - under the License. - */ - -#include -#include - -#import -#import "CDVDevice.h" - -@implementation UIDevice (ModelVersion) - -- (NSString*)modelVersion -{ - size_t size; - - sysctlbyname("hw.machine", NULL, &size, NULL, 0); - char* machine = malloc(size); - sysctlbyname("hw.machine", machine, &size, NULL, 0); - NSString* platform = [NSString stringWithUTF8String:machine]; - free(machine); - - return platform; -} - -@end - -@interface CDVDevice () {} -@end - -@implementation CDVDevice - -- (void)getDeviceInfo:(CDVInvokedUrlCommand*)command -{ - NSDictionary* deviceProperties = [self deviceProperties]; - CDVPluginResult* pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsDictionary:deviceProperties]; - - /* Settings.plist - * Read the optional Settings.plist file and push these user-defined settings down into the web application. - * This can be useful for supplying build-time configuration variables down to the app to change its behavior, - * such as specifying Full / Lite version, or localization (English vs German, for instance). - */ - // TODO: turn this into an iOS only plugin - NSDictionary* temp = [CDVViewController getBundlePlist:@"Settings"]; - - if ([temp respondsToSelector:@selector(JSONString)]) { - NSLog(@"Deprecation warning: window.Setting will be removed Aug 2013. Refer to https://issues.apache.org/jira/browse/CB-2433"); - NSString* js = [NSString stringWithFormat:@"window.Settings = %@;", [temp JSONString]]; - [self.commandDelegate evalJs:js]; - } - - [self.commandDelegate sendPluginResult:pluginResult callbackId:command.callbackId]; -} - -- (NSDictionary*)deviceProperties -{ - UIDevice* device = [UIDevice currentDevice]; - NSMutableDictionary* devProps = [NSMutableDictionary dictionaryWithCapacity:4]; - - [devProps setObject:[device modelVersion] forKey:@"model"]; - [devProps setObject:@"iOS" forKey:@"platform"]; - [devProps setObject:[device systemVersion] forKey:@"version"]; - [devProps setObject:[device uniqueAppInstanceIdentifier] forKey:@"uuid"]; - [devProps setObject:[[self class] cordovaVersion] forKey:@"cordova"]; - - NSDictionary* devReturn = [NSDictionary dictionaryWithDictionary:devProps]; - return devReturn; -} - -+ (NSString*)cordovaVersion -{ - return CDV_VERSION; -} - -@end diff --git a/plugins/org.apache.cordova.core.device/src/windows8/DeviceProxy.js b/plugins/org.apache.cordova.core.device/src/windows8/DeviceProxy.js deleted file mode 100644 index bd57323..0000000 --- a/plugins/org.apache.cordova.core.device/src/windows8/DeviceProxy.js +++ /dev/null @@ -1,50 +0,0 @@ -/* - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - * -*/ - - -var cordova = require('cordova'); -var utils = require('cordova/utils'); - -module.exports = { - - getDeviceInfo:function(win,fail,args) { - - // deviceId aka uuid, stored in Windows.Storage.ApplicationData.current.localSettings.values.deviceId - var deviceId; - - var localSettings = Windows.Storage.ApplicationData.current.localSettings; - - if (localSettings.values.deviceId) { - deviceId = localSettings.values.deviceId; - } - else { - deviceId = localSettings.values.deviceId = utils.createUUID(); - } - - setTimeout(function () { - win({ platform: "windows8", version: "8", uuid: deviceId, cordova: '0.0.0', model: window.clientInformation.platform }); - }, 0); - } - -}; - -require("cordova/commandProxy").add("Device", module.exports); - diff --git a/plugins/org.apache.cordova.core.device/src/wp/Device.cs b/plugins/org.apache.cordova.core.device/src/wp/Device.cs deleted file mode 100644 index 0d2576d..0000000 --- a/plugins/org.apache.cordova.core.device/src/wp/Device.cs +++ /dev/null @@ -1,135 +0,0 @@ -/* - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -using System; -using System.Net; -using System.Windows; -using System.Windows.Controls; -using System.Windows.Documents; -using System.Windows.Ink; -using System.Windows.Input; -using System.Windows.Media; -using System.Windows.Media.Animation; -using System.Windows.Shapes; -using Microsoft.Phone.Info; -using System.IO.IsolatedStorage; -using System.Windows.Resources; -using System.IO; -using System.Diagnostics; - -namespace WPCordovaClassLib.Cordova.Commands -{ - public class Device : BaseCommand - { - public void getDeviceInfo(string notused) - { - - string res = String.Format("\"name\":\"{0}\",\"cordova\":\"{1}\",\"platform\":\"{2}\",\"uuid\":\"{3}\",\"version\":\"{4}\",\"model\":\"{5}\"", - this.name, - this.cordova, - this.platform, - this.uuid, - this.version, - this.model); - - - - res = "{" + res + "}"; - //Debug.WriteLine("Result::" + res); - DispatchCommandResult(new PluginResult(PluginResult.Status.OK, res)); - } - - public string model - { - get - { - return DeviceStatus.DeviceName; - //return String.Format("{0},{1},{2}", DeviceStatus.DeviceManufacturer, DeviceStatus.DeviceHardwareVersion, DeviceStatus.DeviceFirmwareVersion); - } - } - - public string name - { - get - { - return DeviceStatus.DeviceName; - - } - } - - public string cordova - { - get - { - // TODO: should be able to dynamically read the Cordova version from somewhere... - return "3.0.0"; - } - } - - public string platform - { - get - { - return Environment.OSVersion.Platform.ToString(); - } - } - - public string uuid - { - get - { - string returnVal = ""; - object id; - UserExtendedProperties.TryGetValue("ANID", out id); - - if (id != null) - { - returnVal = id.ToString().Substring(2, 32); - } - else - { - returnVal = "???unknown???"; - - using (IsolatedStorageFile appStorage = IsolatedStorageFile.GetUserStoreForApplication()) - { - try - { - IsolatedStorageFileStream fileStream = new IsolatedStorageFileStream("DeviceID.txt", FileMode.Open, FileAccess.Read, appStorage); - - using (StreamReader reader = new StreamReader(fileStream)) - { - returnVal = reader.ReadLine(); - } - } - catch (Exception /*ex*/) - { - - } - } - } - - return returnVal; - } - } - - public string version - { - get - { - return Environment.OSVersion.Version.ToString(); - } - } - - } -} diff --git a/plugins/org.apache.cordova.core.device/test/autotest/html/HtmlReporter.js b/plugins/org.apache.cordova.core.device/test/autotest/html/HtmlReporter.js deleted file mode 100644 index 7d9d924..0000000 --- a/plugins/org.apache.cordova.core.device/test/autotest/html/HtmlReporter.js +++ /dev/null @@ -1,101 +0,0 @@ -jasmine.HtmlReporter = function(_doc) { - var self = this; - var doc = _doc || window.document; - - var reporterView; - - var dom = {}; - - // Jasmine Reporter Public Interface - self.logRunningSpecs = false; - - self.reportRunnerStarting = function(runner) { - var specs = runner.specs() || []; - - if (specs.length == 0) { - return; - } - - createReporterDom(runner.env.versionString()); - doc.body.appendChild(dom.reporter); - - reporterView = new jasmine.HtmlReporter.ReporterView(dom); - reporterView.addSpecs(specs, self.specFilter); - }; - - self.reportRunnerResults = function(runner) { - reporterView && reporterView.complete(); - }; - - self.reportSuiteResults = function(suite) { - reporterView.suiteComplete(suite); - }; - - self.reportSpecStarting = function(spec) { - if (self.logRunningSpecs) { - self.log('>> Jasmine Running ' + spec.suite.description + ' ' + spec.description + '...'); - } - }; - - self.reportSpecResults = function(spec) { - reporterView.specComplete(spec); - }; - - self.log = function() { - var console = jasmine.getGlobal().console; - if (console && console.log) { - if (console.log.apply) { - console.log.apply(console, arguments); - } else { - console.log(arguments); // ie fix: console.log.apply doesn't exist on ie - } - } - }; - - self.specFilter = function(spec) { - if (!focusedSpecName()) { - return true; - } - - return spec.getFullName().indexOf(focusedSpecName()) === 0; - }; - - return self; - - function focusedSpecName() { - var specName; - - (function memoizeFocusedSpec() { - if (specName) { - return; - } - - var paramMap = []; - var params = doc.location.search.substring(1).split('&'); - - for (var i = 0; i < params.length; i++) { - var p = params[i].split('='); - paramMap[decodeURIComponent(p[0])] = decodeURIComponent(p[1]); - } - - specName = paramMap.spec; - })(); - - return specName; - } - - function createReporterDom(version) { - dom.reporter = self.createDom('div', { id: 'HTMLReporter', className: 'jasmine_reporter' }, - dom.banner = self.createDom('div', { className: 'banner' }, - self.createDom('span', { className: 'title' }, "Jasmine "), - self.createDom('span', { className: 'version' }, version)), - - dom.symbolSummary = self.createDom('ul', {className: 'symbolSummary'}), - dom.alert = self.createDom('div', {className: 'alert'}), - dom.results = self.createDom('div', {className: 'results'}, - dom.summary = self.createDom('div', { className: 'summary' }), - dom.details = self.createDom('div', { id: 'details' })) - ); - } -}; -jasmine.HtmlReporterHelpers.addHelpers(jasmine.HtmlReporter); diff --git a/plugins/org.apache.cordova.core.device/test/autotest/html/HtmlReporterHelpers.js b/plugins/org.apache.cordova.core.device/test/autotest/html/HtmlReporterHelpers.js deleted file mode 100644 index 745e1e0..0000000 --- a/plugins/org.apache.cordova.core.device/test/autotest/html/HtmlReporterHelpers.js +++ /dev/null @@ -1,60 +0,0 @@ -jasmine.HtmlReporterHelpers = {}; - -jasmine.HtmlReporterHelpers.createDom = function(type, attrs, childrenVarArgs) { - var el = document.createElement(type); - - for (var i = 2; i < arguments.length; i++) { - var child = arguments[i]; - - if (typeof child === 'string') { - el.appendChild(document.createTextNode(child)); - } else { - if (child) { - el.appendChild(child); - } - } - } - - for (var attr in attrs) { - if (attr == "className") { - el[attr] = attrs[attr]; - } else { - el.setAttribute(attr, attrs[attr]); - } - } - - return el; -}; - -jasmine.HtmlReporterHelpers.getSpecStatus = function(child) { - var results = child.results(); - var status = results.passed() ? 'passed' : 'failed'; - if (results.skipped) { - status = 'skipped'; - } - - return status; -}; - -jasmine.HtmlReporterHelpers.appendToSummary = function(child, childElement) { - var parentDiv = this.dom.summary; - var parentSuite = (typeof child.parentSuite == 'undefined') ? 'suite' : 'parentSuite'; - var parent = child[parentSuite]; - - if (parent) { - if (typeof this.views.suites[parent.id] == 'undefined') { - this.views.suites[parent.id] = new jasmine.HtmlReporter.SuiteView(parent, this.dom, this.views); - } - parentDiv = this.views.suites[parent.id].element; - } - - parentDiv.appendChild(childElement); -}; - - -jasmine.HtmlReporterHelpers.addHelpers = function(ctor) { - for(var fn in jasmine.HtmlReporterHelpers) { - ctor.prototype[fn] = jasmine.HtmlReporterHelpers[fn]; - } -}; - diff --git a/plugins/org.apache.cordova.core.device/test/autotest/html/ReporterView.js b/plugins/org.apache.cordova.core.device/test/autotest/html/ReporterView.js deleted file mode 100644 index 6a6d005..0000000 --- a/plugins/org.apache.cordova.core.device/test/autotest/html/ReporterView.js +++ /dev/null @@ -1,164 +0,0 @@ -jasmine.HtmlReporter.ReporterView = function(dom) { - this.startedAt = new Date(); - this.runningSpecCount = 0; - this.completeSpecCount = 0; - this.passedCount = 0; - this.failedCount = 0; - this.skippedCount = 0; - - this.createResultsMenu = function() { - this.resultsMenu = this.createDom('span', {className: 'resultsMenu bar'}, - this.summaryMenuItem = this.createDom('a', {className: 'summaryMenuItem', href: "#"}, '0 specs'), - ' | ', - this.detailsMenuItem = this.createDom('a', {className: 'detailsMenuItem', href: "#"}, '0 failing')); - - this.summaryMenuItem.onclick = function() { - dom.reporter.className = dom.reporter.className.replace(/ showDetails/g, ''); - }; - - this.detailsMenuItem.onclick = function() { - showDetails(); - }; - }; - - this.addSpecs = function(specs, specFilter) { - this.totalSpecCount = specs.length; - - this.views = { - specs: {}, - suites: {} - }; - - for (var i = 0; i < specs.length; i++) { - var spec = specs[i]; - this.views.specs[spec.id] = new jasmine.HtmlReporter.SpecView(spec, dom, this.views); - if (specFilter(spec)) { - this.runningSpecCount++; - } - } - }; - - this.specComplete = function(spec) { - this.completeSpecCount++; - - if (isUndefined(this.views.specs[spec.id])) { - this.views.specs[spec.id] = new jasmine.HtmlReporter.SpecView(spec, dom); - } - - var specView = this.views.specs[spec.id]; - - switch (specView.status()) { - case 'passed': - this.passedCount++; - break; - - case 'failed': - this.failedCount++; - break; - - case 'skipped': - this.skippedCount++; - break; - } - - specView.refresh(); - this.refresh(); - }; - - this.suiteComplete = function(suite) { - var suiteView = this.views.suites[suite.id]; - if (isUndefined(suiteView)) { - return; - } - suiteView.refresh(); - }; - - this.refresh = function() { - - if (isUndefined(this.resultsMenu)) { - this.createResultsMenu(); - } - - // currently running UI - if (isUndefined(this.runningAlert)) { - this.runningAlert = this.createDom('a', {href: "?", className: "runningAlert bar"}); - dom.alert.appendChild(this.runningAlert); - } - this.runningAlert.innerHTML = "Running " + this.completeSpecCount + " of " + specPluralizedFor(this.totalSpecCount); - - // skipped specs UI - if (isUndefined(this.skippedAlert)) { - this.skippedAlert = this.createDom('a', {href: "?", className: "skippedAlert bar"}); - } - - this.skippedAlert.innerHTML = "Skipping " + this.skippedCount + " of " + specPluralizedFor(this.totalSpecCount) + " - run all"; - - if (this.skippedCount === 1 && isDefined(dom.alert)) { - dom.alert.appendChild(this.skippedAlert); - } - - // passing specs UI - if (isUndefined(this.passedAlert)) { - this.passedAlert = this.createDom('span', {href: "?", className: "passingAlert bar"}); - } - this.passedAlert.innerHTML = "Passing " + specPluralizedFor(this.passedCount); - - // failing specs UI - if (isUndefined(this.failedAlert)) { - this.failedAlert = this.createDom('span', {href: "?", className: "failingAlert bar"}); - } - this.failedAlert.innerHTML = "Failing " + specPluralizedFor(this.failedCount); - - if (this.failedCount === 1 && isDefined(dom.alert)) { - dom.alert.appendChild(this.failedAlert); - dom.alert.appendChild(this.resultsMenu); - } - - // summary info - this.summaryMenuItem.innerHTML = "" + specPluralizedFor(this.runningSpecCount); - this.detailsMenuItem.innerHTML = "" + this.failedCount + " failing"; - }; - - this.complete = function() { - dom.alert.removeChild(this.runningAlert); - - this.skippedAlert.innerHTML = "Ran " + this.runningSpecCount + " of " + specPluralizedFor(this.totalSpecCount) + " - run all"; - - if (this.failedCount === 0) { - dom.alert.appendChild(this.createDom('span', {className: 'passingAlert bar'}, "Passing " + specPluralizedFor(this.passedCount))); - } else { - showDetails(); - } - - dom.banner.appendChild(this.createDom('span', {className: 'duration'}, "finished in " + ((new Date().getTime() - this.startedAt.getTime()) / 1000) + "s")); - }; - - return this; - - function showDetails() { - if (dom.reporter.className.search(/showDetails/) === -1) { - dom.reporter.className += " showDetails"; - } - } - - function isUndefined(obj) { - return typeof obj === 'undefined'; - } - - function isDefined(obj) { - return !isUndefined(obj); - } - - function specPluralizedFor(count) { - var str = count + " spec"; - if (count > 1) { - str += "s" - } - return str; - } - -}; - -jasmine.HtmlReporterHelpers.addHelpers(jasmine.HtmlReporter.ReporterView); - - diff --git a/plugins/org.apache.cordova.core.device/test/autotest/html/SpecView.js b/plugins/org.apache.cordova.core.device/test/autotest/html/SpecView.js deleted file mode 100644 index e8a3c23..0000000 --- a/plugins/org.apache.cordova.core.device/test/autotest/html/SpecView.js +++ /dev/null @@ -1,79 +0,0 @@ -jasmine.HtmlReporter.SpecView = function(spec, dom, views) { - this.spec = spec; - this.dom = dom; - this.views = views; - - this.symbol = this.createDom('li', { className: 'pending' }); - this.dom.symbolSummary.appendChild(this.symbol); - - this.summary = this.createDom('div', { className: 'specSummary' }, - this.createDom('a', { - className: 'description', - href: '?spec=' + encodeURIComponent(this.spec.getFullName()), - title: this.spec.getFullName() - }, this.spec.description) - ); - - this.detail = this.createDom('div', { className: 'specDetail' }, - this.createDom('a', { - className: 'description', - href: '?spec=' + encodeURIComponent(this.spec.getFullName()), - title: this.spec.getFullName() - }, this.spec.getFullName()) - ); -}; - -jasmine.HtmlReporter.SpecView.prototype.status = function() { - return this.getSpecStatus(this.spec); -}; - -jasmine.HtmlReporter.SpecView.prototype.refresh = function() { - this.symbol.className = this.status(); - - switch (this.status()) { - case 'skipped': - break; - - case 'passed': - this.appendSummaryToSuiteDiv(); - break; - - case 'failed': - this.appendSummaryToSuiteDiv(); - this.appendFailureDetail(); - break; - } -}; - -jasmine.HtmlReporter.SpecView.prototype.appendSummaryToSuiteDiv = function() { - this.summary.className += ' ' + this.status(); - this.appendToSummary(this.spec, this.summary); -}; - -jasmine.HtmlReporter.SpecView.prototype.appendFailureDetail = function() { - this.detail.className += ' ' + this.status(); - - var resultItems = this.spec.results().getItems(); - var messagesDiv = this.createDom('div', { className: 'messages' }); - - for (var i = 0; i < resultItems.length; i++) { - var result = resultItems[i]; - - if (result.type == 'log') { - messagesDiv.appendChild(this.createDom('div', {className: 'resultMessage log'}, result.toString())); - } else if (result.type == 'expect' && result.passed && !result.passed()) { - messagesDiv.appendChild(this.createDom('div', {className: 'resultMessage fail'}, result.message)); - - if (result.trace.stack) { - messagesDiv.appendChild(this.createDom('div', {className: 'stackTrace'}, result.trace.stack)); - } - } - } - - if (messagesDiv.childNodes.length > 0) { - this.detail.appendChild(messagesDiv); - this.dom.details.appendChild(this.detail); - } -}; - -jasmine.HtmlReporterHelpers.addHelpers(jasmine.HtmlReporter.SpecView); diff --git a/plugins/org.apache.cordova.core.device/test/autotest/html/SuiteView.js b/plugins/org.apache.cordova.core.device/test/autotest/html/SuiteView.js deleted file mode 100644 index 19a1efa..0000000 --- a/plugins/org.apache.cordova.core.device/test/autotest/html/SuiteView.js +++ /dev/null @@ -1,22 +0,0 @@ -jasmine.HtmlReporter.SuiteView = function(suite, dom, views) { - this.suite = suite; - this.dom = dom; - this.views = views; - - this.element = this.createDom('div', { className: 'suite' }, - this.createDom('a', { className: 'description', href: '?spec=' + encodeURIComponent(this.suite.getFullName()) }, this.suite.description) - ); - - this.appendToSummary(this.suite, this.element); -}; - -jasmine.HtmlReporter.SuiteView.prototype.status = function() { - return this.getSpecStatus(this.suite); -}; - -jasmine.HtmlReporter.SuiteView.prototype.refresh = function() { - this.element.className += " " + this.status(); -}; - -jasmine.HtmlReporterHelpers.addHelpers(jasmine.HtmlReporter.SuiteView); - diff --git a/plugins/org.apache.cordova.core.device/test/autotest/html/TrivialReporter.js b/plugins/org.apache.cordova.core.device/test/autotest/html/TrivialReporter.js deleted file mode 100644 index 167ac50..0000000 --- a/plugins/org.apache.cordova.core.device/test/autotest/html/TrivialReporter.js +++ /dev/null @@ -1,192 +0,0 @@ -/* @deprecated Use jasmine.HtmlReporter instead - */ -jasmine.TrivialReporter = function(doc) { - this.document = doc || document; - this.suiteDivs = {}; - this.logRunningSpecs = false; -}; - -jasmine.TrivialReporter.prototype.createDom = function(type, attrs, childrenVarArgs) { - var el = document.createElement(type); - - for (var i = 2; i < arguments.length; i++) { - var child = arguments[i]; - - if (typeof child === 'string') { - el.appendChild(document.createTextNode(child)); - } else { - if (child) { el.appendChild(child); } - } - } - - for (var attr in attrs) { - if (attr == "className") { - el[attr] = attrs[attr]; - } else { - el.setAttribute(attr, attrs[attr]); - } - } - - return el; -}; - -jasmine.TrivialReporter.prototype.reportRunnerStarting = function(runner) { - var showPassed, showSkipped; - - this.outerDiv = this.createDom('div', { id: 'TrivialReporter', className: 'jasmine_reporter' }, - this.createDom('div', { className: 'banner' }, - this.createDom('div', { className: 'logo' }, - this.createDom('span', { className: 'title' }, "Jasmine"), - this.createDom('span', { className: 'version' }, runner.env.versionString())), - this.createDom('div', { className: 'options' }, - "Show ", - showPassed = this.createDom('input', { id: "__jasmine_TrivialReporter_showPassed__", type: 'checkbox' }), - this.createDom('label', { "for": "__jasmine_TrivialReporter_showPassed__" }, " passed "), - showSkipped = this.createDom('input', { id: "__jasmine_TrivialReporter_showSkipped__", type: 'checkbox' }), - this.createDom('label', { "for": "__jasmine_TrivialReporter_showSkipped__" }, " skipped") - ) - ), - - this.runnerDiv = this.createDom('div', { className: 'runner running' }, - this.createDom('a', { className: 'run_spec', href: '?' }, "run all"), - this.runnerMessageSpan = this.createDom('span', {}, "Running..."), - this.finishedAtSpan = this.createDom('span', { className: 'finished-at' }, "")) - ); - - this.document.body.appendChild(this.outerDiv); - - var suites = runner.suites(); - for (var i = 0; i < suites.length; i++) { - var suite = suites[i]; - var suiteDiv = this.createDom('div', { className: 'suite' }, - this.createDom('a', { className: 'run_spec', href: '?spec=' + encodeURIComponent(suite.getFullName()) }, "run"), - this.createDom('a', { className: 'description', href: '?spec=' + encodeURIComponent(suite.getFullName()) }, suite.description)); - this.suiteDivs[suite.id] = suiteDiv; - var parentDiv = this.outerDiv; - if (suite.parentSuite) { - parentDiv = this.suiteDivs[suite.parentSuite.id]; - } - parentDiv.appendChild(suiteDiv); - } - - this.startedAt = new Date(); - - var self = this; - showPassed.onclick = function(evt) { - if (showPassed.checked) { - self.outerDiv.className += ' show-passed'; - } else { - self.outerDiv.className = self.outerDiv.className.replace(/ show-passed/, ''); - } - }; - - showSkipped.onclick = function(evt) { - if (showSkipped.checked) { - self.outerDiv.className += ' show-skipped'; - } else { - self.outerDiv.className = self.outerDiv.className.replace(/ show-skipped/, ''); - } - }; -}; - -jasmine.TrivialReporter.prototype.reportRunnerResults = function(runner) { - var results = runner.results(); - var className = (results.failedCount > 0) ? "runner failed" : "runner passed"; - this.runnerDiv.setAttribute("class", className); - //do it twice for IE - this.runnerDiv.setAttribute("className", className); - var specs = runner.specs(); - var specCount = 0; - for (var i = 0; i < specs.length; i++) { - if (this.specFilter(specs[i])) { - specCount++; - } - } - var message = "" + specCount + " spec" + (specCount == 1 ? "" : "s" ) + ", " + results.failedCount + " failure" + ((results.failedCount == 1) ? "" : "s"); - message += " in " + ((new Date().getTime() - this.startedAt.getTime()) / 1000) + "s"; - this.runnerMessageSpan.replaceChild(this.createDom('a', { className: 'description', href: '?'}, message), this.runnerMessageSpan.firstChild); - - this.finishedAtSpan.appendChild(document.createTextNode("Finished at " + new Date().toString())); -}; - -jasmine.TrivialReporter.prototype.reportSuiteResults = function(suite) { - var results = suite.results(); - var status = results.passed() ? 'passed' : 'failed'; - if (results.totalCount === 0) { // todo: change this to check results.skipped - status = 'skipped'; - } - this.suiteDivs[suite.id].className += " " + status; -}; - -jasmine.TrivialReporter.prototype.reportSpecStarting = function(spec) { - if (this.logRunningSpecs) { - this.log('>> Jasmine Running ' + spec.suite.description + ' ' + spec.description + '...'); - } -}; - -jasmine.TrivialReporter.prototype.reportSpecResults = function(spec) { - var results = spec.results(); - var status = results.passed() ? 'passed' : 'failed'; - if (results.skipped) { - status = 'skipped'; - } - var specDiv = this.createDom('div', { className: 'spec ' + status }, - this.createDom('a', { className: 'run_spec', href: '?spec=' + encodeURIComponent(spec.getFullName()) }, "run"), - this.createDom('a', { - className: 'description', - href: '?spec=' + encodeURIComponent(spec.getFullName()), - title: spec.getFullName() - }, spec.description)); - - - var resultItems = results.getItems(); - var messagesDiv = this.createDom('div', { className: 'messages' }); - for (var i = 0; i < resultItems.length; i++) { - var result = resultItems[i]; - - if (result.type == 'log') { - messagesDiv.appendChild(this.createDom('div', {className: 'resultMessage log'}, result.toString())); - } else if (result.type == 'expect' && result.passed && !result.passed()) { - messagesDiv.appendChild(this.createDom('div', {className: 'resultMessage fail'}, result.message)); - - if (result.trace.stack) { - messagesDiv.appendChild(this.createDom('div', {className: 'stackTrace'}, result.trace.stack)); - } - } - } - - if (messagesDiv.childNodes.length > 0) { - specDiv.appendChild(messagesDiv); - } - - this.suiteDivs[spec.suite.id].appendChild(specDiv); -}; - -jasmine.TrivialReporter.prototype.log = function() { - var console = jasmine.getGlobal().console; - if (console && console.log) { - if (console.log.apply) { - console.log.apply(console, arguments); - } else { - console.log(arguments); // ie fix: console.log.apply doesn't exist on ie - } - } -}; - -jasmine.TrivialReporter.prototype.getLocation = function() { - return this.document.location; -}; - -jasmine.TrivialReporter.prototype.specFilter = function(spec) { - var paramMap = {}; - var params = this.getLocation().search.substring(1).split('&'); - for (var i = 0; i < params.length; i++) { - var p = params[i].split('='); - paramMap[decodeURIComponent(p[0])] = decodeURIComponent(p[1]); - } - - if (!paramMap.spec) { - return true; - } - return spec.getFullName().indexOf(paramMap.spec) === 0; -}; diff --git a/plugins/org.apache.cordova.core.device/test/autotest/index.html b/plugins/org.apache.cordova.core.device/test/autotest/index.html deleted file mode 100644 index 6ebccbd..0000000 --- a/plugins/org.apache.cordova.core.device/test/autotest/index.html +++ /dev/null @@ -1,59 +0,0 @@ - - - - - - - - - - Cordova API Specs - - - - - -

Cordova API Specs

- - Run All Tests - Run Accelerometer Tests - Run Battery Tests - Run Camera Tests - Run Capture Tests - Run Compass Tests - Run Contacts Tests - Run Data URI Tests - Run Device Tests - Run File Tests - Run FileTransfer Tests - Run Geolocation Tests - Run Globalization Tests - Run Media Tests - Run Network Tests - Run Notification Tests - Run Platform Tests - Run Storage Tests - Run Bridge Tests - -

Back
- - diff --git a/plugins/org.apache.cordova.core.device/test/autotest/jasmine.css b/plugins/org.apache.cordova.core.device/test/autotest/jasmine.css deleted file mode 100644 index 826e575..0000000 --- a/plugins/org.apache.cordova.core.device/test/autotest/jasmine.css +++ /dev/null @@ -1,81 +0,0 @@ -body { background-color: #eeeeee; padding: 0; margin: 5px; overflow-y: scroll; } - -#HTMLReporter { font-size: 11px; font-family: Monaco, "Lucida Console", monospace; line-height: 14px; color: #333333; } -#HTMLReporter a { text-decoration: none; } -#HTMLReporter a:hover { text-decoration: underline; } -#HTMLReporter p, #HTMLReporter h1, #HTMLReporter h2, #HTMLReporter h3, #HTMLReporter h4, #HTMLReporter h5, #HTMLReporter h6 { margin: 0; line-height: 14px; } -#HTMLReporter .banner, #HTMLReporter .symbolSummary, #HTMLReporter .summary, #HTMLReporter .resultMessage, #HTMLReporter .specDetail .description, #HTMLReporter .alert .bar, #HTMLReporter .stackTrace { padding-left: 9px; padding-right: 9px; } -#HTMLReporter #jasmine_content { position: fixed; right: 100%; } -#HTMLReporter .version { color: #aaaaaa; } -#HTMLReporter .banner { margin-top: 14px; } -#HTMLReporter .duration { color: #aaaaaa; float: right; } -#HTMLReporter .symbolSummary { overflow: hidden; *zoom: 1; margin: 14px 0; } -#HTMLReporter .symbolSummary li { display: block; float: left; height: 7px; width: 14px; margin-bottom: 7px; font-size: 16px; } -#HTMLReporter .symbolSummary li.passed { font-size: 14px; } -#HTMLReporter .symbolSummary li.passed:before { color: #5e7d00; content: "\02022"; } -#HTMLReporter .symbolSummary li.failed { line-height: 9px; } -#HTMLReporter .symbolSummary li.failed:before { color: #b03911; content: "x"; font-weight: bold; margin-left: -1px; } -#HTMLReporter .symbolSummary li.skipped { font-size: 14px; } -#HTMLReporter .symbolSummary li.skipped:before { color: #bababa; content: "\02022"; } -#HTMLReporter .symbolSummary li.pending { line-height: 11px; } -#HTMLReporter .symbolSummary li.pending:before { color: #aaaaaa; content: "-"; } -#HTMLReporter .bar { line-height: 28px; font-size: 14px; display: block; color: #eee; } -#HTMLReporter .runningAlert { background-color: #666666; } -#HTMLReporter .skippedAlert { background-color: #aaaaaa; } -#HTMLReporter .skippedAlert:first-child { background-color: #333333; } -#HTMLReporter .skippedAlert:hover { text-decoration: none; color: white; text-decoration: underline; } -#HTMLReporter .passingAlert { background-color: #a6b779; } -#HTMLReporter .passingAlert:first-child { background-color: #5e7d00; } -#HTMLReporter .failingAlert { background-color: #cf867e; } -#HTMLReporter .failingAlert:first-child { background-color: #b03911; } -#HTMLReporter .results { margin-top: 14px; } -#HTMLReporter #details { display: none; } -#HTMLReporter .resultsMenu, #HTMLReporter .resultsMenu a { background-color: #fff; color: #333333; } -#HTMLReporter.showDetails .summaryMenuItem { font-weight: normal; text-decoration: inherit; } -#HTMLReporter.showDetails .summaryMenuItem:hover { text-decoration: underline; } -#HTMLReporter.showDetails .detailsMenuItem { font-weight: bold; text-decoration: underline; } -#HTMLReporter.showDetails .summary { display: none; } -#HTMLReporter.showDetails #details { display: block; } -#HTMLReporter .summaryMenuItem { font-weight: bold; text-decoration: underline; } -#HTMLReporter .summary { margin-top: 14px; } -#HTMLReporter .summary .suite .suite, #HTMLReporter .summary .specSummary { margin-left: 14px; } -#HTMLReporter .summary .specSummary.passed a { color: #5e7d00; } -#HTMLReporter .summary .specSummary.failed a { color: #b03911; } -#HTMLReporter .description + .suite { margin-top: 0; } -#HTMLReporter .suite { margin-top: 14px; } -#HTMLReporter .suite a { color: #333333; } -#HTMLReporter #details .specDetail { margin-bottom: 28px; } -#HTMLReporter #details .specDetail .description { display: block; color: white; background-color: #b03911; } -#HTMLReporter .resultMessage { padding-top: 14px; color: #333333; } -#HTMLReporter .resultMessage span.result { display: block; } -#HTMLReporter .stackTrace { margin: 5px 0 0 0; max-height: 224px; overflow: auto; line-height: 18px; color: #666666; border: 1px solid #ddd; background: white; white-space: pre; } - -#TrivialReporter { padding: 8px 13px; position: absolute; top: 0; bottom: 0; left: 0; right: 0; overflow-y: scroll; background-color: white; font-family: "Helvetica Neue Light", "Lucida Grande", "Calibri", "Arial", sans-serif; /*.resultMessage {*/ /*white-space: pre;*/ /*}*/ } -#TrivialReporter a:visited, #TrivialReporter a { color: #303; } -#TrivialReporter a:hover, #TrivialReporter a:active { color: blue; } -#TrivialReporter .run_spec { float: right; padding-right: 5px; font-size: .8em; text-decoration: none; } -#TrivialReporter .banner { color: #303; background-color: #fef; padding: 5px; } -#TrivialReporter .logo { float: left; font-size: 1.1em; padding-left: 5px; } -#TrivialReporter .logo .version { font-size: .6em; padding-left: 1em; } -#TrivialReporter .runner.running { background-color: yellow; } -#TrivialReporter .options { text-align: right; font-size: .8em; } -#TrivialReporter .suite { border: 1px outset gray; margin: 5px 0; padding-left: 1em; } -#TrivialReporter .suite .suite { margin: 5px; } -#TrivialReporter .suite.passed { background-color: #dfd; } -#TrivialReporter .suite.failed { background-color: #fdd; } -#TrivialReporter .spec { margin: 5px; padding-left: 1em; clear: both; } -#TrivialReporter .spec.failed, #TrivialReporter .spec.passed, #TrivialReporter .spec.skipped { padding-bottom: 5px; border: 1px solid gray; } -#TrivialReporter .spec.failed { background-color: #fbb; border-color: red; } -#TrivialReporter .spec.passed { background-color: #bfb; border-color: green; } -#TrivialReporter .spec.skipped { background-color: #bbb; } -#TrivialReporter .messages { border-left: 1px dashed gray; padding-left: 1em; padding-right: 1em; } -#TrivialReporter .passed { background-color: #cfc; display: none; } -#TrivialReporter .failed { background-color: #fbb; } -#TrivialReporter .skipped { color: #777; background-color: #eee; display: none; } -#TrivialReporter .resultMessage span.result { display: block; line-height: 2em; color: black; } -#TrivialReporter .resultMessage .mismatch { color: black; } -#TrivialReporter .stackTrace { white-space: pre; font-size: .8em; margin-left: 10px; max-height: 5em; overflow: auto; border: 1px inset red; padding: 1em; background: #eef; } -#TrivialReporter .finished-at { padding-left: 1em; font-size: .6em; } -#TrivialReporter.show-passed .passed, #TrivialReporter.show-skipped .skipped { display: block; } -#TrivialReporter #jasmine_content { position: fixed; right: 100%; } -#TrivialReporter .runner { border: 1px solid gray; display: block; margin: 5px 0; padding: 2px 0 2px 10px; } diff --git a/plugins/org.apache.cordova.core.device/test/autotest/jasmine.js b/plugins/org.apache.cordova.core.device/test/autotest/jasmine.js deleted file mode 100644 index bccb66c..0000000 --- a/plugins/org.apache.cordova.core.device/test/autotest/jasmine.js +++ /dev/null @@ -1,2530 +0,0 @@ -var isCommonJS = typeof window == "undefined"; - -/** - * Top level namespace for Jasmine, a lightweight JavaScript BDD/spec/testing framework. - * - * @namespace - */ -var jasmine = {}; -if (isCommonJS) exports.jasmine = jasmine; -/** - * @private - */ -jasmine.unimplementedMethod_ = function() { - throw new Error("unimplemented method"); -}; - -/** - * Use jasmine.undefined instead of undefined, since undefined is just - * a plain old variable and may be redefined by somebody else. - * - * @private - */ -jasmine.undefined = jasmine.___undefined___; - -/** - * Show diagnostic messages in the console if set to true - * - */ -jasmine.VERBOSE = false; - -/** - * Default interval in milliseconds for event loop yields (e.g. to allow network activity or to refresh the screen with the HTML-based runner). Small values here may result in slow test running. Zero means no updates until all tests have completed. - * - */ -jasmine.DEFAULT_UPDATE_INTERVAL = 250; - -/** - * Default timeout interval in milliseconds for waitsFor() blocks. - */ -jasmine.DEFAULT_TIMEOUT_INTERVAL = 5000; - -jasmine.getGlobal = function() { - function getGlobal() { - return this; - } - - return getGlobal(); -}; - -/** - * Allows for bound functions to be compared. Internal use only. - * - * @ignore - * @private - * @param base {Object} bound 'this' for the function - * @param name {Function} function to find - */ -jasmine.bindOriginal_ = function(base, name) { - var original = base[name]; - if (original.apply) { - return function() { - return original.apply(base, arguments); - }; - } else { - // IE support - return jasmine.getGlobal()[name]; - } -}; - -jasmine.setTimeout = jasmine.bindOriginal_(jasmine.getGlobal(), 'setTimeout'); -jasmine.clearTimeout = jasmine.bindOriginal_(jasmine.getGlobal(), 'clearTimeout'); -jasmine.setInterval = jasmine.bindOriginal_(jasmine.getGlobal(), 'setInterval'); -jasmine.clearInterval = jasmine.bindOriginal_(jasmine.getGlobal(), 'clearInterval'); - -jasmine.MessageResult = function(values) { - this.type = 'log'; - this.values = values; - this.trace = new Error(); // todo: test better -}; - -jasmine.MessageResult.prototype.toString = function() { - var text = ""; - for (var i = 0; i < this.values.length; i++) { - if (i > 0) text += " "; - if (jasmine.isString_(this.values[i])) { - text += this.values[i]; - } else { - text += jasmine.pp(this.values[i]); - } - } - return text; -}; - -jasmine.ExpectationResult = function(params) { - this.type = 'expect'; - this.matcherName = params.matcherName; - this.passed_ = params.passed; - this.expected = params.expected; - this.actual = params.actual; - this.message = this.passed_ ? 'Passed.' : params.message; - - var trace = (params.trace || new Error(this.message)); - this.trace = this.passed_ ? '' : trace; -}; - -jasmine.ExpectationResult.prototype.toString = function () { - return this.message; -}; - -jasmine.ExpectationResult.prototype.passed = function () { - return this.passed_; -}; - -/** - * Getter for the Jasmine environment. Ensures one gets created - */ -jasmine.getEnv = function() { - var env = jasmine.currentEnv_ = jasmine.currentEnv_ || new jasmine.Env(); - return env; -}; - -/** - * @ignore - * @private - * @param value - * @returns {Boolean} - */ -jasmine.isArray_ = function(value) { - return jasmine.isA_("Array", value); -}; - -/** - * @ignore - * @private - * @param value - * @returns {Boolean} - */ -jasmine.isString_ = function(value) { - return jasmine.isA_("String", value); -}; - -/** - * @ignore - * @private - * @param value - * @returns {Boolean} - */ -jasmine.isNumber_ = function(value) { - return jasmine.isA_("Number", value); -}; - -/** - * @ignore - * @private - * @param {String} typeName - * @param value - * @returns {Boolean} - */ -jasmine.isA_ = function(typeName, value) { - return Object.prototype.toString.apply(value) === '[object ' + typeName + ']'; -}; - -/** - * Pretty printer for expecations. Takes any object and turns it into a human-readable string. - * - * @param value {Object} an object to be outputted - * @returns {String} - */ -jasmine.pp = function(value) { - var stringPrettyPrinter = new jasmine.StringPrettyPrinter(); - stringPrettyPrinter.format(value); - return stringPrettyPrinter.string; -}; - -/** - * Returns true if the object is a DOM Node. - * - * @param {Object} obj object to check - * @returns {Boolean} - */ -jasmine.isDomNode = function(obj) { - return obj.nodeType > 0; -}; - -/** - * Returns a matchable 'generic' object of the class type. For use in expecations of type when values don't matter. - * - * @example - * // don't care about which function is passed in, as long as it's a function - * expect(mySpy).toHaveBeenCalledWith(jasmine.any(Function)); - * - * @param {Class} clazz - * @returns matchable object of the type clazz - */ -jasmine.any = function(clazz) { - return new jasmine.Matchers.Any(clazz); -}; - -/** - * Returns a matchable subset of a JSON object. For use in expectations when you don't care about all of the - * attributes on the object. - * - * @example - * // don't care about any other attributes than foo. - * expect(mySpy).toHaveBeenCalledWith(jasmine.objectContaining({foo: "bar"}); - * - * @param sample {Object} sample - * @returns matchable object for the sample - */ -jasmine.objectContaining = function (sample) { - return new jasmine.Matchers.ObjectContaining(sample); -}; - -/** - * Jasmine Spies are test doubles that can act as stubs, spies, fakes or when used in an expecation, mocks. - * - * Spies should be created in test setup, before expectations. They can then be checked, using the standard Jasmine - * expectation syntax. Spies can be checked if they were called or not and what the calling params were. - * - * A Spy has the following fields: wasCalled, callCount, mostRecentCall, and argsForCall (see docs). - * - * Spies are torn down at the end of every spec. - * - * Note: Do not call new jasmine.Spy() directly - a spy must be created using spyOn, jasmine.createSpy or jasmine.createSpyObj. - * - * @example - * // a stub - * var myStub = jasmine.createSpy('myStub'); // can be used anywhere - * - * // spy example - * var foo = { - * not: function(bool) { return !bool; } - * } - * - * // actual foo.not will not be called, execution stops - * spyOn(foo, 'not'); - - // foo.not spied upon, execution will continue to implementation - * spyOn(foo, 'not').andCallThrough(); - * - * // fake example - * var foo = { - * not: function(bool) { return !bool; } - * } - * - * // foo.not(val) will return val - * spyOn(foo, 'not').andCallFake(function(value) {return value;}); - * - * // mock example - * foo.not(7 == 7); - * expect(foo.not).toHaveBeenCalled(); - * expect(foo.not).toHaveBeenCalledWith(true); - * - * @constructor - * @see spyOn, jasmine.createSpy, jasmine.createSpyObj - * @param {String} name - */ -jasmine.Spy = function(name) { - /** - * The name of the spy, if provided. - */ - this.identity = name || 'unknown'; - /** - * Is this Object a spy? - */ - this.isSpy = true; - /** - * The actual function this spy stubs. - */ - this.plan = function() { - }; - /** - * Tracking of the most recent call to the spy. - * @example - * var mySpy = jasmine.createSpy('foo'); - * mySpy(1, 2); - * mySpy.mostRecentCall.args = [1, 2]; - */ - this.mostRecentCall = {}; - - /** - * Holds arguments for each call to the spy, indexed by call count - * @example - * var mySpy = jasmine.createSpy('foo'); - * mySpy(1, 2); - * mySpy(7, 8); - * mySpy.mostRecentCall.args = [7, 8]; - * mySpy.argsForCall[0] = [1, 2]; - * mySpy.argsForCall[1] = [7, 8]; - */ - this.argsForCall = []; - this.calls = []; -}; - -/** - * Tells a spy to call through to the actual implemenatation. - * - * @example - * var foo = { - * bar: function() { // do some stuff } - * } - * - * // defining a spy on an existing property: foo.bar - * spyOn(foo, 'bar').andCallThrough(); - */ -jasmine.Spy.prototype.andCallThrough = function() { - this.plan = this.originalValue; - return this; -}; - -/** - * For setting the return value of a spy. - * - * @example - * // defining a spy from scratch: foo() returns 'baz' - * var foo = jasmine.createSpy('spy on foo').andReturn('baz'); - * - * // defining a spy on an existing property: foo.bar() returns 'baz' - * spyOn(foo, 'bar').andReturn('baz'); - * - * @param {Object} value - */ -jasmine.Spy.prototype.andReturn = function(value) { - this.plan = function() { - return value; - }; - return this; -}; - -/** - * For throwing an exception when a spy is called. - * - * @example - * // defining a spy from scratch: foo() throws an exception w/ message 'ouch' - * var foo = jasmine.createSpy('spy on foo').andThrow('baz'); - * - * // defining a spy on an existing property: foo.bar() throws an exception w/ message 'ouch' - * spyOn(foo, 'bar').andThrow('baz'); - * - * @param {String} exceptionMsg - */ -jasmine.Spy.prototype.andThrow = function(exceptionMsg) { - this.plan = function() { - throw exceptionMsg; - }; - return this; -}; - -/** - * Calls an alternate implementation when a spy is called. - * - * @example - * var baz = function() { - * // do some stuff, return something - * } - * // defining a spy from scratch: foo() calls the function baz - * var foo = jasmine.createSpy('spy on foo').andCall(baz); - * - * // defining a spy on an existing property: foo.bar() calls an anonymnous function - * spyOn(foo, 'bar').andCall(function() { return 'baz';} ); - * - * @param {Function} fakeFunc - */ -jasmine.Spy.prototype.andCallFake = function(fakeFunc) { - this.plan = fakeFunc; - return this; -}; - -/** - * Resets all of a spy's the tracking variables so that it can be used again. - * - * @example - * spyOn(foo, 'bar'); - * - * foo.bar(); - * - * expect(foo.bar.callCount).toEqual(1); - * - * foo.bar.reset(); - * - * expect(foo.bar.callCount).toEqual(0); - */ -jasmine.Spy.prototype.reset = function() { - this.wasCalled = false; - this.callCount = 0; - this.argsForCall = []; - this.calls = []; - this.mostRecentCall = {}; -}; - -jasmine.createSpy = function(name) { - - var spyObj = function() { - spyObj.wasCalled = true; - spyObj.callCount++; - var args = jasmine.util.argsToArray(arguments); - spyObj.mostRecentCall.object = this; - spyObj.mostRecentCall.args = args; - spyObj.argsForCall.push(args); - spyObj.calls.push({object: this, args: args}); - return spyObj.plan.apply(this, arguments); - }; - - var spy = new jasmine.Spy(name); - - for (var prop in spy) { - spyObj[prop] = spy[prop]; - } - - spyObj.reset(); - - return spyObj; -}; - -/** - * Determines whether an object is a spy. - * - * @param {jasmine.Spy|Object} putativeSpy - * @returns {Boolean} - */ -jasmine.isSpy = function(putativeSpy) { - return putativeSpy && putativeSpy.isSpy; -}; - -/** - * Creates a more complicated spy: an Object that has every property a function that is a spy. Used for stubbing something - * large in one call. - * - * @param {String} baseName name of spy class - * @param {Array} methodNames array of names of methods to make spies - */ -jasmine.createSpyObj = function(baseName, methodNames) { - if (!jasmine.isArray_(methodNames) || methodNames.length === 0) { - throw new Error('createSpyObj requires a non-empty array of method names to create spies for'); - } - var obj = {}; - for (var i = 0; i < methodNames.length; i++) { - obj[methodNames[i]] = jasmine.createSpy(baseName + '.' + methodNames[i]); - } - return obj; -}; - -/** - * All parameters are pretty-printed and concatenated together, then written to the current spec's output. - * - * Be careful not to leave calls to jasmine.log in production code. - */ -jasmine.log = function() { - var spec = jasmine.getEnv().currentSpec; - spec.log.apply(spec, arguments); -}; - -/** - * Function that installs a spy on an existing object's method name. Used within a Spec to create a spy. - * - * @example - * // spy example - * var foo = { - * not: function(bool) { return !bool; } - * } - * spyOn(foo, 'not'); // actual foo.not will not be called, execution stops - * - * @see jasmine.createSpy - * @param obj - * @param methodName - * @returns a Jasmine spy that can be chained with all spy methods - */ -var spyOn = function(obj, methodName) { - return jasmine.getEnv().currentSpec.spyOn(obj, methodName); -}; -if (isCommonJS) exports.spyOn = spyOn; - -/** - * Creates a Jasmine spec that will be added to the current suite. - * - * // TODO: pending tests - * - * @example - * it('should be true', function() { - * expect(true).toEqual(true); - * }); - * - * @param {String} desc description of this specification - * @param {Function} func defines the preconditions and expectations of the spec - */ -var it = function(desc, func) { - return jasmine.getEnv().it(desc, func); -}; -if (isCommonJS) exports.it = it; - -/** - * Creates a disabled Jasmine spec. - * - * A convenience method that allows existing specs to be disabled temporarily during development. - * - * @param {String} desc description of this specification - * @param {Function} func defines the preconditions and expectations of the spec - */ -var xit = function(desc, func) { - return jasmine.getEnv().xit(desc, func); -}; -if (isCommonJS) exports.xit = xit; - -/** - * Starts a chain for a Jasmine expectation. - * - * It is passed an Object that is the actual value and should chain to one of the many - * jasmine.Matchers functions. - * - * @param {Object} actual Actual value to test against and expected value - */ -var expect = function(actual) { - return jasmine.getEnv().currentSpec.expect(actual); -}; -if (isCommonJS) exports.expect = expect; - -/** - * Defines part of a jasmine spec. Used in cominbination with waits or waitsFor in asynchrnous specs. - * - * @param {Function} func Function that defines part of a jasmine spec. - */ -var runs = function(func) { - jasmine.getEnv().currentSpec.runs(func); -}; -if (isCommonJS) exports.runs = runs; - -/** - * Waits a fixed time period before moving to the next block. - * - * @deprecated Use waitsFor() instead - * @param {Number} timeout milliseconds to wait - */ -var waits = function(timeout) { - jasmine.getEnv().currentSpec.waits(timeout); -}; -if (isCommonJS) exports.waits = waits; - -/** - * Waits for the latchFunction to return true before proceeding to the next block. - * - * @param {Function} latchFunction - * @param {String} optional_timeoutMessage - * @param {Number} optional_timeout - */ -var waitsFor = function(latchFunction, optional_timeoutMessage, optional_timeout) { - jasmine.getEnv().currentSpec.waitsFor.apply(jasmine.getEnv().currentSpec, arguments); -}; -if (isCommonJS) exports.waitsFor = waitsFor; - -/** - * A function that is called before each spec in a suite. - * - * Used for spec setup, including validating assumptions. - * - * @param {Function} beforeEachFunction - */ -var beforeEach = function(beforeEachFunction) { - jasmine.getEnv().beforeEach(beforeEachFunction); -}; -if (isCommonJS) exports.beforeEach = beforeEach; - -/** - * A function that is called after each spec in a suite. - * - * Used for restoring any state that is hijacked during spec execution. - * - * @param {Function} afterEachFunction - */ -var afterEach = function(afterEachFunction) { - jasmine.getEnv().afterEach(afterEachFunction); -}; -if (isCommonJS) exports.afterEach = afterEach; - -/** - * Defines a suite of specifications. - * - * Stores the description and all defined specs in the Jasmine environment as one suite of specs. Variables declared - * are accessible by calls to beforeEach, it, and afterEach. Describe blocks can be nested, allowing for specialization - * of setup in some tests. - * - * @example - * // TODO: a simple suite - * - * // TODO: a simple suite with a nested describe block - * - * @param {String} description A string, usually the class under test. - * @param {Function} specDefinitions function that defines several specs. - */ -var describe = function(description, specDefinitions) { - return jasmine.getEnv().describe(description, specDefinitions); -}; -if (isCommonJS) exports.describe = describe; - -/** - * Disables a suite of specifications. Used to disable some suites in a file, or files, temporarily during development. - * - * @param {String} description A string, usually the class under test. - * @param {Function} specDefinitions function that defines several specs. - */ -var xdescribe = function(description, specDefinitions) { - return jasmine.getEnv().xdescribe(description, specDefinitions); -}; -if (isCommonJS) exports.xdescribe = xdescribe; - - -// Provide the XMLHttpRequest class for IE 5.x-6.x: -jasmine.XmlHttpRequest = (typeof XMLHttpRequest == "undefined") ? function() { - function tryIt(f) { - try { - return f(); - } catch(e) { - } - return null; - } - - var xhr = tryIt(function() { - return new ActiveXObject("Msxml2.XMLHTTP.6.0"); - }) || - tryIt(function() { - return new ActiveXObject("Msxml2.XMLHTTP.3.0"); - }) || - tryIt(function() { - return new ActiveXObject("Msxml2.XMLHTTP"); - }) || - tryIt(function() { - return new ActiveXObject("Microsoft.XMLHTTP"); - }); - - if (!xhr) throw new Error("This browser does not support XMLHttpRequest."); - - return xhr; -} : XMLHttpRequest; -/** - * @namespace - */ -jasmine.util = {}; - -/** - * Declare that a child class inherit it's prototype from the parent class. - * - * @private - * @param {Function} childClass - * @param {Function} parentClass - */ -jasmine.util.inherit = function(childClass, parentClass) { - /** - * @private - */ - var subclass = function() { - }; - subclass.prototype = parentClass.prototype; - childClass.prototype = new subclass(); -}; - -jasmine.util.formatException = function(e) { - var lineNumber; - if (e.line) { - lineNumber = e.line; - } - else if (e.lineNumber) { - lineNumber = e.lineNumber; - } - - var file; - - if (e.sourceURL) { - file = e.sourceURL; - } - else if (e.fileName) { - file = e.fileName; - } - - var message = (e.name && e.message) ? (e.name + ': ' + e.message) : e.toString(); - - if (file && lineNumber) { - message += ' in ' + file + ' (line ' + lineNumber + ')'; - } - - return message; -}; - -jasmine.util.htmlEscape = function(str) { - if (!str) return str; - return str.replace(/&/g, '&') - .replace(//g, '>'); -}; - -jasmine.util.argsToArray = function(args) { - var arrayOfArgs = []; - for (var i = 0; i < args.length; i++) arrayOfArgs.push(args[i]); - return arrayOfArgs; -}; - -jasmine.util.extend = function(destination, source) { - for (var property in source) destination[property] = source[property]; - return destination; -}; - -/** - * Environment for Jasmine - * - * @constructor - */ -jasmine.Env = function() { - this.currentSpec = null; - this.currentSuite = null; - this.currentRunner_ = new jasmine.Runner(this); - - this.reporter = new jasmine.MultiReporter(); - - this.updateInterval = jasmine.DEFAULT_UPDATE_INTERVAL; - this.defaultTimeoutInterval = jasmine.DEFAULT_TIMEOUT_INTERVAL; - this.lastUpdate = 0; - this.specFilter = function() { - return true; - }; - - this.nextSpecId_ = 0; - this.nextSuiteId_ = 0; - this.equalityTesters_ = []; - - // wrap matchers - this.matchersClass = function() { - jasmine.Matchers.apply(this, arguments); - }; - jasmine.util.inherit(this.matchersClass, jasmine.Matchers); - - jasmine.Matchers.wrapInto_(jasmine.Matchers.prototype, this.matchersClass); -}; - - -jasmine.Env.prototype.setTimeout = jasmine.setTimeout; -jasmine.Env.prototype.clearTimeout = jasmine.clearTimeout; -jasmine.Env.prototype.setInterval = jasmine.setInterval; -jasmine.Env.prototype.clearInterval = jasmine.clearInterval; - -/** - * @returns an object containing jasmine version build info, if set. - */ -jasmine.Env.prototype.version = function () { - if (jasmine.version_) { - return jasmine.version_; - } else { - throw new Error('Version not set'); - } -}; - -/** - * @returns string containing jasmine version build info, if set. - */ -jasmine.Env.prototype.versionString = function() { - if (!jasmine.version_) { - return "version unknown"; - } - - var version = this.version(); - var versionString = version.major + "." + version.minor + "." + version.build; - if (version.release_candidate) { - versionString += ".rc" + version.release_candidate; - } - versionString += " revision " + version.revision; - return versionString; -}; - -/** - * @returns a sequential integer starting at 0 - */ -jasmine.Env.prototype.nextSpecId = function () { - return this.nextSpecId_++; -}; - -/** - * @returns a sequential integer starting at 0 - */ -jasmine.Env.prototype.nextSuiteId = function () { - return this.nextSuiteId_++; -}; - -/** - * Register a reporter to receive status updates from Jasmine. - * @param {jasmine.Reporter} reporter An object which will receive status updates. - */ -jasmine.Env.prototype.addReporter = function(reporter) { - this.reporter.addReporter(reporter); -}; - -jasmine.Env.prototype.execute = function() { - this.currentRunner_.execute(); -}; - -jasmine.Env.prototype.describe = function(description, specDefinitions) { - var suite = new jasmine.Suite(this, description, specDefinitions, this.currentSuite); - - var parentSuite = this.currentSuite; - if (parentSuite) { - parentSuite.add(suite); - } else { - this.currentRunner_.add(suite); - } - - this.currentSuite = suite; - - var declarationError = null; - try { - specDefinitions.call(suite); - } catch(e) { - declarationError = e; - } - - if (declarationError) { - this.it("encountered a declaration exception", function() { - throw declarationError; - }); - } - - this.currentSuite = parentSuite; - - return suite; -}; - -jasmine.Env.prototype.beforeEach = function(beforeEachFunction) { - if (this.currentSuite) { - this.currentSuite.beforeEach(beforeEachFunction); - } else { - this.currentRunner_.beforeEach(beforeEachFunction); - } -}; - -jasmine.Env.prototype.currentRunner = function () { - return this.currentRunner_; -}; - -jasmine.Env.prototype.afterEach = function(afterEachFunction) { - if (this.currentSuite) { - this.currentSuite.afterEach(afterEachFunction); - } else { - this.currentRunner_.afterEach(afterEachFunction); - } - -}; - -jasmine.Env.prototype.xdescribe = function(desc, specDefinitions) { - return { - execute: function() { - } - }; -}; - -jasmine.Env.prototype.it = function(description, func) { - var spec = new jasmine.Spec(this, this.currentSuite, description); - this.currentSuite.add(spec); - this.currentSpec = spec; - - if (func) { - spec.runs(func); - } - - return spec; -}; - -jasmine.Env.prototype.xit = function(desc, func) { - return { - id: this.nextSpecId(), - runs: function() { - } - }; -}; - -jasmine.Env.prototype.compareObjects_ = function(a, b, mismatchKeys, mismatchValues) { - if (a.__Jasmine_been_here_before__ === b && b.__Jasmine_been_here_before__ === a) { - return true; - } - - a.__Jasmine_been_here_before__ = b; - b.__Jasmine_been_here_before__ = a; - - var hasKey = function(obj, keyName) { - return obj !== null && obj[keyName] !== jasmine.undefined; - }; - - for (var property in b) { - if (!hasKey(a, property) && hasKey(b, property)) { - mismatchKeys.push("expected has key '" + property + "', but missing from actual."); - } - } - for (property in a) { - if (!hasKey(b, property) && hasKey(a, property)) { - mismatchKeys.push("expected missing key '" + property + "', but present in actual."); - } - } - for (property in b) { - if (property == '__Jasmine_been_here_before__') continue; - if (!this.equals_(a[property], b[property], mismatchKeys, mismatchValues)) { - mismatchValues.push("'" + property + "' was '" + (b[property] ? jasmine.util.htmlEscape(b[property].toString()) : b[property]) + "' in expected, but was '" + (a[property] ? jasmine.util.htmlEscape(a[property].toString()) : a[property]) + "' in actual."); - } - } - - if (jasmine.isArray_(a) && jasmine.isArray_(b) && a.length != b.length) { - mismatchValues.push("arrays were not the same length"); - } - - delete a.__Jasmine_been_here_before__; - delete b.__Jasmine_been_here_before__; - return (mismatchKeys.length === 0 && mismatchValues.length === 0); -}; - -jasmine.Env.prototype.equals_ = function(a, b, mismatchKeys, mismatchValues) { - mismatchKeys = mismatchKeys || []; - mismatchValues = mismatchValues || []; - - for (var i = 0; i < this.equalityTesters_.length; i++) { - var equalityTester = this.equalityTesters_[i]; - var result = equalityTester(a, b, this, mismatchKeys, mismatchValues); - if (result !== jasmine.undefined) return result; - } - - if (a === b) return true; - - if (a === jasmine.undefined || a === null || b === jasmine.undefined || b === null) { - return (a == jasmine.undefined && b == jasmine.undefined); - } - - if (jasmine.isDomNode(a) && jasmine.isDomNode(b)) { - return a === b; - } - - if (a instanceof Date && b instanceof Date) { - return a.getTime() == b.getTime(); - } - - if (a.jasmineMatches) { - return a.jasmineMatches(b); - } - - if (b.jasmineMatches) { - return b.jasmineMatches(a); - } - - if (a instanceof jasmine.Matchers.ObjectContaining) { - return a.matches(b); - } - - if (b instanceof jasmine.Matchers.ObjectContaining) { - return b.matches(a); - } - - if (jasmine.isString_(a) && jasmine.isString_(b)) { - return (a == b); - } - - if (jasmine.isNumber_(a) && jasmine.isNumber_(b)) { - return (a == b); - } - - if (typeof a === "object" && typeof b === "object") { - return this.compareObjects_(a, b, mismatchKeys, mismatchValues); - } - - //Straight check - return (a === b); -}; - -jasmine.Env.prototype.contains_ = function(haystack, needle) { - if (jasmine.isArray_(haystack)) { - for (var i = 0; i < haystack.length; i++) { - if (this.equals_(haystack[i], needle)) return true; - } - return false; - } - return haystack.indexOf(needle) >= 0; -}; - -jasmine.Env.prototype.addEqualityTester = function(equalityTester) { - this.equalityTesters_.push(equalityTester); -}; -/** No-op base class for Jasmine reporters. - * - * @constructor - */ -jasmine.Reporter = function() { -}; - -//noinspection JSUnusedLocalSymbols -jasmine.Reporter.prototype.reportRunnerStarting = function(runner) { -}; - -//noinspection JSUnusedLocalSymbols -jasmine.Reporter.prototype.reportRunnerResults = function(runner) { -}; - -//noinspection JSUnusedLocalSymbols -jasmine.Reporter.prototype.reportSuiteResults = function(suite) { -}; - -//noinspection JSUnusedLocalSymbols -jasmine.Reporter.prototype.reportSpecStarting = function(spec) { -}; - -//noinspection JSUnusedLocalSymbols -jasmine.Reporter.prototype.reportSpecResults = function(spec) { -}; - -//noinspection JSUnusedLocalSymbols -jasmine.Reporter.prototype.log = function(str) { -}; - -/** - * Blocks are functions with executable code that make up a spec. - * - * @constructor - * @param {jasmine.Env} env - * @param {Function} func - * @param {jasmine.Spec} spec - */ -jasmine.Block = function(env, func, spec) { - this.env = env; - this.func = func; - this.spec = spec; -}; - -jasmine.Block.prototype.execute = function(onComplete) { - try { - this.func.apply(this.spec); - } catch (e) { - this.spec.fail(e); - } - onComplete(); -}; -/** JavaScript API reporter. - * - * @constructor - */ -jasmine.JsApiReporter = function() { - this.started = false; - this.finished = false; - this.suites_ = []; - this.results_ = {}; -}; - -jasmine.JsApiReporter.prototype.reportRunnerStarting = function(runner) { - this.started = true; - var suites = runner.topLevelSuites(); - for (var i = 0; i < suites.length; i++) { - var suite = suites[i]; - this.suites_.push(this.summarize_(suite)); - } -}; - -jasmine.JsApiReporter.prototype.suites = function() { - return this.suites_; -}; - -jasmine.JsApiReporter.prototype.summarize_ = function(suiteOrSpec) { - var isSuite = suiteOrSpec instanceof jasmine.Suite; - var summary = { - id: suiteOrSpec.id, - name: suiteOrSpec.description, - type: isSuite ? 'suite' : 'spec', - children: [] - }; - - if (isSuite) { - var children = suiteOrSpec.children(); - for (var i = 0; i < children.length; i++) { - summary.children.push(this.summarize_(children[i])); - } - } - return summary; -}; - -jasmine.JsApiReporter.prototype.results = function() { - return this.results_; -}; - -jasmine.JsApiReporter.prototype.resultsForSpec = function(specId) { - return this.results_[specId]; -}; - -//noinspection JSUnusedLocalSymbols -jasmine.JsApiReporter.prototype.reportRunnerResults = function(runner) { - this.finished = true; -}; - -//noinspection JSUnusedLocalSymbols -jasmine.JsApiReporter.prototype.reportSuiteResults = function(suite) { -}; - -//noinspection JSUnusedLocalSymbols -jasmine.JsApiReporter.prototype.reportSpecResults = function(spec) { - this.results_[spec.id] = { - messages: spec.results().getItems(), - result: spec.results().failedCount > 0 ? "failed" : "passed" - }; -}; - -//noinspection JSUnusedLocalSymbols -jasmine.JsApiReporter.prototype.log = function(str) { -}; - -jasmine.JsApiReporter.prototype.resultsForSpecs = function(specIds){ - var results = {}; - for (var i = 0; i < specIds.length; i++) { - var specId = specIds[i]; - results[specId] = this.summarizeResult_(this.results_[specId]); - } - return results; -}; - -jasmine.JsApiReporter.prototype.summarizeResult_ = function(result){ - var summaryMessages = []; - var messagesLength = result.messages.length; - for (var messageIndex = 0; messageIndex < messagesLength; messageIndex++) { - var resultMessage = result.messages[messageIndex]; - summaryMessages.push({ - text: resultMessage.type == 'log' ? resultMessage.toString() : jasmine.undefined, - passed: resultMessage.passed ? resultMessage.passed() : true, - type: resultMessage.type, - message: resultMessage.message, - trace: { - stack: resultMessage.passed && !resultMessage.passed() ? resultMessage.trace.stack : jasmine.undefined - } - }); - } - - return { - result : result.result, - messages : summaryMessages - }; -}; - -/** - * @constructor - * @param {jasmine.Env} env - * @param actual - * @param {jasmine.Spec} spec - */ -jasmine.Matchers = function(env, actual, spec, opt_isNot) { - this.env = env; - this.actual = actual; - this.spec = spec; - this.isNot = opt_isNot || false; - this.reportWasCalled_ = false; -}; - -// todo: @deprecated as of Jasmine 0.11, remove soon [xw] -jasmine.Matchers.pp = function(str) { - throw new Error("jasmine.Matchers.pp() is no longer supported, please use jasmine.pp() instead!"); -}; - -// todo: @deprecated Deprecated as of Jasmine 0.10. Rewrite your custom matchers to return true or false. [xw] -jasmine.Matchers.prototype.report = function(result, failing_message, details) { - throw new Error("As of jasmine 0.11, custom matchers must be implemented differently -- please see jasmine docs"); -}; - -jasmine.Matchers.wrapInto_ = function(prototype, matchersClass) { - for (var methodName in prototype) { - if (methodName == 'report') continue; - var orig = prototype[methodName]; - matchersClass.prototype[methodName] = jasmine.Matchers.matcherFn_(methodName, orig); - } -}; - -jasmine.Matchers.matcherFn_ = function(matcherName, matcherFunction) { - return function() { - var matcherArgs = jasmine.util.argsToArray(arguments); - var result = matcherFunction.apply(this, arguments); - - if (this.isNot) { - result = !result; - } - - if (this.reportWasCalled_) return result; - - var message; - if (!result) { - if (this.message) { - message = this.message.apply(this, arguments); - if (jasmine.isArray_(message)) { - message = message[this.isNot ? 1 : 0]; - } - } else { - var englishyPredicate = matcherName.replace(/[A-Z]/g, function(s) { return ' ' + s.toLowerCase(); }); - message = "Expected " + jasmine.pp(this.actual) + (this.isNot ? " not " : " ") + englishyPredicate; - if (matcherArgs.length > 0) { - for (var i = 0; i < matcherArgs.length; i++) { - if (i > 0) message += ","; - message += " " + jasmine.pp(matcherArgs[i]); - } - } - message += "."; - } - } - var expectationResult = new jasmine.ExpectationResult({ - matcherName: matcherName, - passed: result, - expected: matcherArgs.length > 1 ? matcherArgs : matcherArgs[0], - actual: this.actual, - message: message - }); - this.spec.addMatcherResult(expectationResult); - return jasmine.undefined; - }; -}; - - - - -/** - * toBe: compares the actual to the expected using === - * @param expected - */ -jasmine.Matchers.prototype.toBe = function(expected) { - return this.actual === expected; -}; - -/** - * toNotBe: compares the actual to the expected using !== - * @param expected - * @deprecated as of 1.0. Use not.toBe() instead. - */ -jasmine.Matchers.prototype.toNotBe = function(expected) { - return this.actual !== expected; -}; - -/** - * toEqual: compares the actual to the expected using common sense equality. Handles Objects, Arrays, etc. - * - * @param expected - */ -jasmine.Matchers.prototype.toEqual = function(expected) { - return this.env.equals_(this.actual, expected); -}; - -/** - * toNotEqual: compares the actual to the expected using the ! of jasmine.Matchers.toEqual - * @param expected - * @deprecated as of 1.0. Use not.toEqual() instead. - */ -jasmine.Matchers.prototype.toNotEqual = function(expected) { - return !this.env.equals_(this.actual, expected); -}; - -/** - * Matcher that compares the actual to the expected using a regular expression. Constructs a RegExp, so takes - * a pattern or a String. - * - * @param expected - */ -jasmine.Matchers.prototype.toMatch = function(expected) { - return new RegExp(expected).test(this.actual); -}; - -/** - * Matcher that compares the actual to the expected using the boolean inverse of jasmine.Matchers.toMatch - * @param expected - * @deprecated as of 1.0. Use not.toMatch() instead. - */ -jasmine.Matchers.prototype.toNotMatch = function(expected) { - return !(new RegExp(expected).test(this.actual)); -}; - -/** - * Matcher that compares the actual to jasmine.undefined. - */ -jasmine.Matchers.prototype.toBeDefined = function() { - return (this.actual !== jasmine.undefined); -}; - -/** - * Matcher that compares the actual to jasmine.undefined. - */ -jasmine.Matchers.prototype.toBeUndefined = function() { - return (this.actual === jasmine.undefined); -}; - -/** - * Matcher that compares the actual to null. - */ -jasmine.Matchers.prototype.toBeNull = function() { - return (this.actual === null); -}; - -/** - * Matcher that boolean not-nots the actual. - */ -jasmine.Matchers.prototype.toBeTruthy = function() { - return !!this.actual; -}; - - -/** - * Matcher that boolean nots the actual. - */ -jasmine.Matchers.prototype.toBeFalsy = function() { - return !this.actual; -}; - - -/** - * Matcher that checks to see if the actual, a Jasmine spy, was called. - */ -jasmine.Matchers.prototype.toHaveBeenCalled = function() { - if (arguments.length > 0) { - throw new Error('toHaveBeenCalled does not take arguments, use toHaveBeenCalledWith'); - } - - if (!jasmine.isSpy(this.actual)) { - throw new Error('Expected a spy, but got ' + jasmine.pp(this.actual) + '.'); - } - - this.message = function() { - return [ - "Expected spy " + this.actual.identity + " to have been called.", - "Expected spy " + this.actual.identity + " not to have been called." - ]; - }; - - return this.actual.wasCalled; -}; - -/** @deprecated Use expect(xxx).toHaveBeenCalled() instead */ -jasmine.Matchers.prototype.wasCalled = jasmine.Matchers.prototype.toHaveBeenCalled; - -/** - * Matcher that checks to see if the actual, a Jasmine spy, was not called. - * - * @deprecated Use expect(xxx).not.toHaveBeenCalled() instead - */ -jasmine.Matchers.prototype.wasNotCalled = function() { - if (arguments.length > 0) { - throw new Error('wasNotCalled does not take arguments'); - } - - if (!jasmine.isSpy(this.actual)) { - throw new Error('Expected a spy, but got ' + jasmine.pp(this.actual) + '.'); - } - - this.message = function() { - return [ - "Expected spy " + this.actual.identity + " to not have been called.", - "Expected spy " + this.actual.identity + " to have been called." - ]; - }; - - return !this.actual.wasCalled; -}; - -/** - * Matcher that checks to see if the actual, a Jasmine spy, was called with a set of parameters. - * - * @example - * - */ -jasmine.Matchers.prototype.toHaveBeenCalledWith = function() { - var expectedArgs = jasmine.util.argsToArray(arguments); - if (!jasmine.isSpy(this.actual)) { - throw new Error('Expected a spy, but got ' + jasmine.pp(this.actual) + '.'); - } - this.message = function() { - if (this.actual.callCount === 0) { - // todo: what should the failure message for .not.toHaveBeenCalledWith() be? is this right? test better. [xw] - return [ - "Expected spy " + this.actual.identity + " to have been called with " + jasmine.pp(expectedArgs) + " but it was never called.", - "Expected spy " + this.actual.identity + " not to have been called with " + jasmine.pp(expectedArgs) + " but it was." - ]; - } else { - return [ - "Expected spy " + this.actual.identity + " to have been called with " + jasmine.pp(expectedArgs) + " but was called with " + jasmine.pp(this.actual.argsForCall), - "Expected spy " + this.actual.identity + " not to have been called with " + jasmine.pp(expectedArgs) + " but was called with " + jasmine.pp(this.actual.argsForCall) - ]; - } - }; - - return this.env.contains_(this.actual.argsForCall, expectedArgs); -}; - -/** @deprecated Use expect(xxx).toHaveBeenCalledWith() instead */ -jasmine.Matchers.prototype.wasCalledWith = jasmine.Matchers.prototype.toHaveBeenCalledWith; - -/** @deprecated Use expect(xxx).not.toHaveBeenCalledWith() instead */ -jasmine.Matchers.prototype.wasNotCalledWith = function() { - var expectedArgs = jasmine.util.argsToArray(arguments); - if (!jasmine.isSpy(this.actual)) { - throw new Error('Expected a spy, but got ' + jasmine.pp(this.actual) + '.'); - } - - this.message = function() { - return [ - "Expected spy not to have been called with " + jasmine.pp(expectedArgs) + " but it was", - "Expected spy to have been called with " + jasmine.pp(expectedArgs) + " but it was" - ]; - }; - - return !this.env.contains_(this.actual.argsForCall, expectedArgs); -}; - -/** - * Matcher that checks that the expected item is an element in the actual Array. - * - * @param {Object} expected - */ -jasmine.Matchers.prototype.toContain = function(expected) { - return this.env.contains_(this.actual, expected); -}; - -/** - * Matcher that checks that the expected item is NOT an element in the actual Array. - * - * @param {Object} expected - * @deprecated as of 1.0. Use not.toContain() instead. - */ -jasmine.Matchers.prototype.toNotContain = function(expected) { - return !this.env.contains_(this.actual, expected); -}; - -jasmine.Matchers.prototype.toBeLessThan = function(expected) { - return this.actual < expected; -}; - -jasmine.Matchers.prototype.toBeGreaterThan = function(expected) { - return this.actual > expected; -}; - -/** - * Matcher that checks that the expected item is equal to the actual item - * up to a given level of decimal precision (default 2). - * - * @param {Number} expected - * @param {Number} precision - */ -jasmine.Matchers.prototype.toBeCloseTo = function(expected, precision) { - if (!(precision === 0)) { - precision = precision || 2; - } - var multiplier = Math.pow(10, precision); - var actual = Math.round(this.actual * multiplier); - expected = Math.round(expected * multiplier); - return expected == actual; -}; - -/** - * Matcher that checks that the expected exception was thrown by the actual. - * - * @param {String} expected - */ -jasmine.Matchers.prototype.toThrow = function(expected) { - var result = false; - var exception; - if (typeof this.actual != 'function') { - throw new Error('Actual is not a function'); - } - try { - this.actual(); - } catch (e) { - exception = e; - } - if (exception) { - result = (expected === jasmine.undefined || this.env.equals_(exception.message || exception, expected.message || expected)); - } - - var not = this.isNot ? "not " : ""; - - this.message = function() { - if (exception && (expected === jasmine.undefined || !this.env.equals_(exception.message || exception, expected.message || expected))) { - return ["Expected function " + not + "to throw", expected ? expected.message || expected : "an exception", ", but it threw", exception.message || exception].join(' '); - } else { - return "Expected function to throw an exception."; - } - }; - - return result; -}; - -jasmine.Matchers.Any = function(expectedClass) { - this.expectedClass = expectedClass; -}; - -jasmine.Matchers.Any.prototype.jasmineMatches = function(other) { - if (this.expectedClass == String) { - return typeof other == 'string' || other instanceof String; - } - - if (this.expectedClass == Number) { - return typeof other == 'number' || other instanceof Number; - } - - if (this.expectedClass == Function) { - return typeof other == 'function' || other instanceof Function; - } - - if (this.expectedClass == Object) { - return typeof other == 'object'; - } - - return other instanceof this.expectedClass; -}; - -jasmine.Matchers.Any.prototype.jasmineToString = function() { - return ''; -}; - -jasmine.Matchers.ObjectContaining = function (sample) { - this.sample = sample; -}; - -jasmine.Matchers.ObjectContaining.prototype.jasmineMatches = function(other, mismatchKeys, mismatchValues) { - mismatchKeys = mismatchKeys || []; - mismatchValues = mismatchValues || []; - - var env = jasmine.getEnv(); - - var hasKey = function(obj, keyName) { - return obj != null && obj[keyName] !== jasmine.undefined; - }; - - for (var property in this.sample) { - if (!hasKey(other, property) && hasKey(this.sample, property)) { - mismatchKeys.push("expected has key '" + property + "', but missing from actual."); - } - else if (!env.equals_(this.sample[property], other[property], mismatchKeys, mismatchValues)) { - mismatchValues.push("'" + property + "' was '" + (other[property] ? jasmine.util.htmlEscape(other[property].toString()) : other[property]) + "' in expected, but was '" + (this.sample[property] ? jasmine.util.htmlEscape(this.sample[property].toString()) : this.sample[property]) + "' in actual."); - } - } - - return (mismatchKeys.length === 0 && mismatchValues.length === 0); -}; - -jasmine.Matchers.ObjectContaining.prototype.jasmineToString = function () { - return ""; -}; -// Mock setTimeout, clearTimeout -// Contributed by Pivotal Computer Systems, www.pivotalsf.com - -jasmine.FakeTimer = function() { - this.reset(); - - var self = this; - self.setTimeout = function(funcToCall, millis) { - self.timeoutsMade++; - self.scheduleFunction(self.timeoutsMade, funcToCall, millis, false); - return self.timeoutsMade; - }; - - self.setInterval = function(funcToCall, millis) { - self.timeoutsMade++; - self.scheduleFunction(self.timeoutsMade, funcToCall, millis, true); - return self.timeoutsMade; - }; - - self.clearTimeout = function(timeoutKey) { - self.scheduledFunctions[timeoutKey] = jasmine.undefined; - }; - - self.clearInterval = function(timeoutKey) { - self.scheduledFunctions[timeoutKey] = jasmine.undefined; - }; - -}; - -jasmine.FakeTimer.prototype.reset = function() { - this.timeoutsMade = 0; - this.scheduledFunctions = {}; - this.nowMillis = 0; -}; - -jasmine.FakeTimer.prototype.tick = function(millis) { - var oldMillis = this.nowMillis; - var newMillis = oldMillis + millis; - this.runFunctionsWithinRange(oldMillis, newMillis); - this.nowMillis = newMillis; -}; - -jasmine.FakeTimer.prototype.runFunctionsWithinRange = function(oldMillis, nowMillis) { - var scheduledFunc; - var funcsToRun = []; - for (var timeoutKey in this.scheduledFunctions) { - scheduledFunc = this.scheduledFunctions[timeoutKey]; - if (scheduledFunc != jasmine.undefined && - scheduledFunc.runAtMillis >= oldMillis && - scheduledFunc.runAtMillis <= nowMillis) { - funcsToRun.push(scheduledFunc); - this.scheduledFunctions[timeoutKey] = jasmine.undefined; - } - } - - if (funcsToRun.length > 0) { - funcsToRun.sort(function(a, b) { - return a.runAtMillis - b.runAtMillis; - }); - for (var i = 0; i < funcsToRun.length; ++i) { - try { - var funcToRun = funcsToRun[i]; - this.nowMillis = funcToRun.runAtMillis; - funcToRun.funcToCall(); - if (funcToRun.recurring) { - this.scheduleFunction(funcToRun.timeoutKey, - funcToRun.funcToCall, - funcToRun.millis, - true); - } - } catch(e) { - } - } - this.runFunctionsWithinRange(oldMillis, nowMillis); - } -}; - -jasmine.FakeTimer.prototype.scheduleFunction = function(timeoutKey, funcToCall, millis, recurring) { - this.scheduledFunctions[timeoutKey] = { - runAtMillis: this.nowMillis + millis, - funcToCall: funcToCall, - recurring: recurring, - timeoutKey: timeoutKey, - millis: millis - }; -}; - -/** - * @namespace - */ -jasmine.Clock = { - defaultFakeTimer: new jasmine.FakeTimer(), - - reset: function() { - jasmine.Clock.assertInstalled(); - jasmine.Clock.defaultFakeTimer.reset(); - }, - - tick: function(millis) { - jasmine.Clock.assertInstalled(); - jasmine.Clock.defaultFakeTimer.tick(millis); - }, - - runFunctionsWithinRange: function(oldMillis, nowMillis) { - jasmine.Clock.defaultFakeTimer.runFunctionsWithinRange(oldMillis, nowMillis); - }, - - scheduleFunction: function(timeoutKey, funcToCall, millis, recurring) { - jasmine.Clock.defaultFakeTimer.scheduleFunction(timeoutKey, funcToCall, millis, recurring); - }, - - useMock: function() { - if (!jasmine.Clock.isInstalled()) { - var spec = jasmine.getEnv().currentSpec; - spec.after(jasmine.Clock.uninstallMock); - - jasmine.Clock.installMock(); - } - }, - - installMock: function() { - jasmine.Clock.installed = jasmine.Clock.defaultFakeTimer; - }, - - uninstallMock: function() { - jasmine.Clock.assertInstalled(); - jasmine.Clock.installed = jasmine.Clock.real; - }, - - real: { - setTimeout: jasmine.getGlobal().setTimeout, - clearTimeout: jasmine.getGlobal().clearTimeout, - setInterval: jasmine.getGlobal().setInterval, - clearInterval: jasmine.getGlobal().clearInterval - }, - - assertInstalled: function() { - if (!jasmine.Clock.isInstalled()) { - throw new Error("Mock clock is not installed, use jasmine.Clock.useMock()"); - } - }, - - isInstalled: function() { - return jasmine.Clock.installed == jasmine.Clock.defaultFakeTimer; - }, - - installed: null -}; -jasmine.Clock.installed = jasmine.Clock.real; - -//else for IE support -jasmine.getGlobal().setTimeout = function(funcToCall, millis) { - if (jasmine.Clock.installed.setTimeout.apply) { - return jasmine.Clock.installed.setTimeout.apply(this, arguments); - } else { - return jasmine.Clock.installed.setTimeout(funcToCall, millis); - } -}; - -jasmine.getGlobal().setInterval = function(funcToCall, millis) { - if (jasmine.Clock.installed.setInterval.apply) { - return jasmine.Clock.installed.setInterval.apply(this, arguments); - } else { - return jasmine.Clock.installed.setInterval(funcToCall, millis); - } -}; - -jasmine.getGlobal().clearTimeout = function(timeoutKey) { - if (jasmine.Clock.installed.clearTimeout.apply) { - return jasmine.Clock.installed.clearTimeout.apply(this, arguments); - } else { - return jasmine.Clock.installed.clearTimeout(timeoutKey); - } -}; - -jasmine.getGlobal().clearInterval = function(timeoutKey) { - if (jasmine.Clock.installed.clearTimeout.apply) { - return jasmine.Clock.installed.clearInterval.apply(this, arguments); - } else { - return jasmine.Clock.installed.clearInterval(timeoutKey); - } -}; - -/** - * @constructor - */ -jasmine.MultiReporter = function() { - this.subReporters_ = []; -}; -jasmine.util.inherit(jasmine.MultiReporter, jasmine.Reporter); - -jasmine.MultiReporter.prototype.addReporter = function(reporter) { - this.subReporters_.push(reporter); -}; - -(function() { - var functionNames = [ - "reportRunnerStarting", - "reportRunnerResults", - "reportSuiteResults", - "reportSpecStarting", - "reportSpecResults", - "log" - ]; - for (var i = 0; i < functionNames.length; i++) { - var functionName = functionNames[i]; - jasmine.MultiReporter.prototype[functionName] = (function(functionName) { - return function() { - for (var j = 0; j < this.subReporters_.length; j++) { - var subReporter = this.subReporters_[j]; - if (subReporter[functionName]) { - subReporter[functionName].apply(subReporter, arguments); - } - } - }; - })(functionName); - } -})(); -/** - * Holds results for a set of Jasmine spec. Allows for the results array to hold another jasmine.NestedResults - * - * @constructor - */ -jasmine.NestedResults = function() { - /** - * The total count of results - */ - this.totalCount = 0; - /** - * Number of passed results - */ - this.passedCount = 0; - /** - * Number of failed results - */ - this.failedCount = 0; - /** - * Was this suite/spec skipped? - */ - this.skipped = false; - /** - * @ignore - */ - this.items_ = []; -}; - -/** - * Roll up the result counts. - * - * @param result - */ -jasmine.NestedResults.prototype.rollupCounts = function(result) { - this.totalCount += result.totalCount; - this.passedCount += result.passedCount; - this.failedCount += result.failedCount; -}; - -/** - * Adds a log message. - * @param values Array of message parts which will be concatenated later. - */ -jasmine.NestedResults.prototype.log = function(values) { - this.items_.push(new jasmine.MessageResult(values)); -}; - -/** - * Getter for the results: message & results. - */ -jasmine.NestedResults.prototype.getItems = function() { - return this.items_; -}; - -/** - * Adds a result, tracking counts (total, passed, & failed) - * @param {jasmine.ExpectationResult|jasmine.NestedResults} result - */ -jasmine.NestedResults.prototype.addResult = function(result) { - if (result.type != 'log') { - if (result.items_) { - this.rollupCounts(result); - } else { - this.totalCount++; - if (result.passed()) { - this.passedCount++; - } else { - this.failedCount++; - } - } - } - this.items_.push(result); -}; - -/** - * @returns {Boolean} True if everything below passed - */ -jasmine.NestedResults.prototype.passed = function() { - return this.passedCount === this.totalCount; -}; -/** - * Base class for pretty printing for expectation results. - */ -jasmine.PrettyPrinter = function() { - this.ppNestLevel_ = 0; -}; - -/** - * Formats a value in a nice, human-readable string. - * - * @param value - */ -jasmine.PrettyPrinter.prototype.format = function(value) { - if (this.ppNestLevel_ > 40) { - throw new Error('jasmine.PrettyPrinter: format() nested too deeply!'); - } - - this.ppNestLevel_++; - try { - if (value === jasmine.undefined) { - this.emitScalar('undefined'); - } else if (value === null) { - this.emitScalar('null'); - } else if (value === jasmine.getGlobal()) { - this.emitScalar(''); - } else if (value.jasmineToString) { - this.emitScalar(value.jasmineToString()); - } else if (typeof value === 'string') { - this.emitString(value); - } else if (jasmine.isSpy(value)) { - this.emitScalar("spy on " + value.identity); - } else if (value instanceof RegExp) { - this.emitScalar(value.toString()); - } else if (typeof value === 'function') { - this.emitScalar('Function'); - } else if (typeof value.nodeType === 'number') { - this.emitScalar('HTMLNode'); - } else if (value instanceof Date) { - this.emitScalar('Date(' + value + ')'); - } else if (value.__Jasmine_been_here_before__) { - this.emitScalar(''); - } else if (jasmine.isArray_(value) || typeof value == 'object') { - value.__Jasmine_been_here_before__ = true; - if (jasmine.isArray_(value)) { - this.emitArray(value); - } else { - this.emitObject(value); - } - delete value.__Jasmine_been_here_before__; - } else { - this.emitScalar(value.toString()); - } - } finally { - this.ppNestLevel_--; - } -}; - -jasmine.PrettyPrinter.prototype.iterateObject = function(obj, fn) { - for (var property in obj) { - if (property == '__Jasmine_been_here_before__') continue; - fn(property, obj.__lookupGetter__ ? (obj.__lookupGetter__(property) !== jasmine.undefined && - obj.__lookupGetter__(property) !== null) : false); - } -}; - -jasmine.PrettyPrinter.prototype.emitArray = jasmine.unimplementedMethod_; -jasmine.PrettyPrinter.prototype.emitObject = jasmine.unimplementedMethod_; -jasmine.PrettyPrinter.prototype.emitScalar = jasmine.unimplementedMethod_; -jasmine.PrettyPrinter.prototype.emitString = jasmine.unimplementedMethod_; - -jasmine.StringPrettyPrinter = function() { - jasmine.PrettyPrinter.call(this); - - this.string = ''; -}; -jasmine.util.inherit(jasmine.StringPrettyPrinter, jasmine.PrettyPrinter); - -jasmine.StringPrettyPrinter.prototype.emitScalar = function(value) { - this.append(value); -}; - -jasmine.StringPrettyPrinter.prototype.emitString = function(value) { - this.append("'" + value + "'"); -}; - -jasmine.StringPrettyPrinter.prototype.emitArray = function(array) { - this.append('[ '); - for (var i = 0; i < array.length; i++) { - if (i > 0) { - this.append(', '); - } - this.format(array[i]); - } - this.append(' ]'); -}; - -jasmine.StringPrettyPrinter.prototype.emitObject = function(obj) { - var self = this; - this.append('{ '); - var first = true; - - this.iterateObject(obj, function(property, isGetter) { - if (first) { - first = false; - } else { - self.append(', '); - } - - self.append(property); - self.append(' : '); - if (isGetter) { - self.append(''); - } else { - self.format(obj[property]); - } - }); - - this.append(' }'); -}; - -jasmine.StringPrettyPrinter.prototype.append = function(value) { - this.string += value; -}; -jasmine.Queue = function(env) { - this.env = env; - this.blocks = []; - this.running = false; - this.index = 0; - this.offset = 0; - this.abort = false; -}; - -jasmine.Queue.prototype.addBefore = function(block) { - this.blocks.unshift(block); -}; - -jasmine.Queue.prototype.add = function(block) { - this.blocks.push(block); -}; - -jasmine.Queue.prototype.insertNext = function(block) { - this.blocks.splice((this.index + this.offset + 1), 0, block); - this.offset++; -}; - -jasmine.Queue.prototype.start = function(onComplete) { - this.running = true; - this.onComplete = onComplete; - this.next_(); -}; - -jasmine.Queue.prototype.isRunning = function() { - return this.running; -}; - -jasmine.Queue.LOOP_DONT_RECURSE = true; - -jasmine.Queue.prototype.next_ = function() { - var self = this; - var goAgain = true; - - while (goAgain) { - goAgain = false; - - if (self.index < self.blocks.length && !this.abort) { - var calledSynchronously = true; - var completedSynchronously = false; - - var onComplete = function () { - if (jasmine.Queue.LOOP_DONT_RECURSE && calledSynchronously) { - completedSynchronously = true; - return; - } - - if (self.blocks[self.index].abort) { - self.abort = true; - } - - self.offset = 0; - self.index++; - - var now = new Date().getTime(); - if (self.env.updateInterval && now - self.env.lastUpdate > self.env.updateInterval) { - self.env.lastUpdate = now; - self.env.setTimeout(function() { - self.next_(); - }, 0); - } else { - if (jasmine.Queue.LOOP_DONT_RECURSE && completedSynchronously) { - goAgain = true; - } else { - self.next_(); - } - } - }; - self.blocks[self.index].execute(onComplete); - - calledSynchronously = false; - if (completedSynchronously) { - onComplete(); - } - - } else { - self.running = false; - if (self.onComplete) { - self.onComplete(); - } - } - } -}; - -jasmine.Queue.prototype.results = function() { - var results = new jasmine.NestedResults(); - for (var i = 0; i < this.blocks.length; i++) { - if (this.blocks[i].results) { - results.addResult(this.blocks[i].results()); - } - } - return results; -}; - - -/** - * Runner - * - * @constructor - * @param {jasmine.Env} env - */ -jasmine.Runner = function(env) { - var self = this; - self.env = env; - self.queue = new jasmine.Queue(env); - self.before_ = []; - self.after_ = []; - self.suites_ = []; -}; - -jasmine.Runner.prototype.execute = function() { - var self = this; - if (self.env.reporter.reportRunnerStarting) { - self.env.reporter.reportRunnerStarting(this); - } - self.queue.start(function () { - self.finishCallback(); - }); -}; - -jasmine.Runner.prototype.beforeEach = function(beforeEachFunction) { - beforeEachFunction.typeName = 'beforeEach'; - this.before_.splice(0,0,beforeEachFunction); -}; - -jasmine.Runner.prototype.afterEach = function(afterEachFunction) { - afterEachFunction.typeName = 'afterEach'; - this.after_.splice(0,0,afterEachFunction); -}; - - -jasmine.Runner.prototype.finishCallback = function() { - this.env.reporter.reportRunnerResults(this); -}; - -jasmine.Runner.prototype.addSuite = function(suite) { - this.suites_.push(suite); -}; - -jasmine.Runner.prototype.add = function(block) { - if (block instanceof jasmine.Suite) { - this.addSuite(block); - } - this.queue.add(block); -}; - -jasmine.Runner.prototype.specs = function () { - var suites = this.suites(); - var specs = []; - for (var i = 0; i < suites.length; i++) { - specs = specs.concat(suites[i].specs()); - } - return specs; -}; - -jasmine.Runner.prototype.suites = function() { - return this.suites_; -}; - -jasmine.Runner.prototype.topLevelSuites = function() { - var topLevelSuites = []; - for (var i = 0; i < this.suites_.length; i++) { - if (!this.suites_[i].parentSuite) { - topLevelSuites.push(this.suites_[i]); - } - } - return topLevelSuites; -}; - -jasmine.Runner.prototype.results = function() { - return this.queue.results(); -}; -/** - * Internal representation of a Jasmine specification, or test. - * - * @constructor - * @param {jasmine.Env} env - * @param {jasmine.Suite} suite - * @param {String} description - */ -jasmine.Spec = function(env, suite, description) { - if (!env) { - throw new Error('jasmine.Env() required'); - } - if (!suite) { - throw new Error('jasmine.Suite() required'); - } - var spec = this; - spec.id = env.nextSpecId ? env.nextSpecId() : null; - spec.env = env; - spec.suite = suite; - spec.description = description; - spec.queue = new jasmine.Queue(env); - - spec.afterCallbacks = []; - spec.spies_ = []; - - spec.results_ = new jasmine.NestedResults(); - spec.results_.description = description; - spec.matchersClass = null; -}; - -jasmine.Spec.prototype.getFullName = function() { - return this.suite.getFullName() + ' ' + this.description + '.'; -}; - - -jasmine.Spec.prototype.results = function() { - return this.results_; -}; - -/** - * All parameters are pretty-printed and concatenated together, then written to the spec's output. - * - * Be careful not to leave calls to jasmine.log in production code. - */ -jasmine.Spec.prototype.log = function() { - return this.results_.log(arguments); -}; - -jasmine.Spec.prototype.runs = function (func) { - var block = new jasmine.Block(this.env, func, this); - this.addToQueue(block); - return this; -}; - -jasmine.Spec.prototype.addToQueue = function (block) { - if (this.queue.isRunning()) { - this.queue.insertNext(block); - } else { - this.queue.add(block); - } -}; - -/** - * @param {jasmine.ExpectationResult} result - */ -jasmine.Spec.prototype.addMatcherResult = function(result) { - this.results_.addResult(result); -}; - -jasmine.Spec.prototype.expect = function(actual) { - var positive = new (this.getMatchersClass_())(this.env, actual, this); - positive.not = new (this.getMatchersClass_())(this.env, actual, this, true); - return positive; -}; - -/** - * Waits a fixed time period before moving to the next block. - * - * @deprecated Use waitsFor() instead - * @param {Number} timeout milliseconds to wait - */ -jasmine.Spec.prototype.waits = function(timeout) { - var waitsFunc = new jasmine.WaitsBlock(this.env, timeout, this); - this.addToQueue(waitsFunc); - return this; -}; - -/** - * Waits for the latchFunction to return true before proceeding to the next block. - * - * @param {Function} latchFunction - * @param {String} optional_timeoutMessage - * @param {Number} optional_timeout - */ -jasmine.Spec.prototype.waitsFor = function(latchFunction, optional_timeoutMessage, optional_timeout) { - var latchFunction_ = null; - var optional_timeoutMessage_ = null; - var optional_timeout_ = null; - - for (var i = 0; i < arguments.length; i++) { - var arg = arguments[i]; - switch (typeof arg) { - case 'function': - latchFunction_ = arg; - break; - case 'string': - optional_timeoutMessage_ = arg; - break; - case 'number': - optional_timeout_ = arg; - break; - } - } - - var waitsForFunc = new jasmine.WaitsForBlock(this.env, optional_timeout_, latchFunction_, optional_timeoutMessage_, this); - this.addToQueue(waitsForFunc); - return this; -}; - -jasmine.Spec.prototype.fail = function (e) { - var expectationResult = new jasmine.ExpectationResult({ - passed: false, - message: e ? jasmine.util.formatException(e) : 'Exception', - trace: { stack: e.stack } - }); - this.results_.addResult(expectationResult); -}; - -jasmine.Spec.prototype.getMatchersClass_ = function() { - return this.matchersClass || this.env.matchersClass; -}; - -jasmine.Spec.prototype.addMatchers = function(matchersPrototype) { - var parent = this.getMatchersClass_(); - var newMatchersClass = function() { - parent.apply(this, arguments); - }; - jasmine.util.inherit(newMatchersClass, parent); - jasmine.Matchers.wrapInto_(matchersPrototype, newMatchersClass); - this.matchersClass = newMatchersClass; -}; - -jasmine.Spec.prototype.finishCallback = function() { - this.env.reporter.reportSpecResults(this); -}; - -jasmine.Spec.prototype.finish = function(onComplete) { - this.removeAllSpies(); - this.finishCallback(); - if (onComplete) { - onComplete(); - } -}; - -jasmine.Spec.prototype.after = function(doAfter) { - if (this.queue.isRunning()) { - this.queue.add(new jasmine.Block(this.env, doAfter, this)); - } else { - this.afterCallbacks.unshift(doAfter); - } -}; - -jasmine.Spec.prototype.execute = function(onComplete) { - var spec = this; - if (!spec.env.specFilter(spec)) { - spec.results_.skipped = true; - spec.finish(onComplete); - return; - } - - this.env.reporter.reportSpecStarting(this); - - spec.env.currentSpec = spec; - - spec.addBeforesAndAftersToQueue(); - - spec.queue.start(function () { - spec.finish(onComplete); - }); -}; - -jasmine.Spec.prototype.addBeforesAndAftersToQueue = function() { - var runner = this.env.currentRunner(); - var i; - - for (var suite = this.suite; suite; suite = suite.parentSuite) { - for (i = 0; i < suite.before_.length; i++) { - this.queue.addBefore(new jasmine.Block(this.env, suite.before_[i], this)); - } - } - for (i = 0; i < runner.before_.length; i++) { - this.queue.addBefore(new jasmine.Block(this.env, runner.before_[i], this)); - } - for (i = 0; i < this.afterCallbacks.length; i++) { - this.queue.add(new jasmine.Block(this.env, this.afterCallbacks[i], this)); - } - for (suite = this.suite; suite; suite = suite.parentSuite) { - for (i = 0; i < suite.after_.length; i++) { - this.queue.add(new jasmine.Block(this.env, suite.after_[i], this)); - } - } - for (i = 0; i < runner.after_.length; i++) { - this.queue.add(new jasmine.Block(this.env, runner.after_[i], this)); - } -}; - -jasmine.Spec.prototype.explodes = function() { - throw 'explodes function should not have been called'; -}; - -jasmine.Spec.prototype.spyOn = function(obj, methodName, ignoreMethodDoesntExist) { - if (obj == jasmine.undefined) { - throw "spyOn could not find an object to spy upon for " + methodName + "()"; - } - - if (!ignoreMethodDoesntExist && obj[methodName] === jasmine.undefined) { - throw methodName + '() method does not exist'; - } - - if (!ignoreMethodDoesntExist && obj[methodName] && obj[methodName].isSpy) { - throw new Error(methodName + ' has already been spied upon'); - } - - var spyObj = jasmine.createSpy(methodName); - - this.spies_.push(spyObj); - spyObj.baseObj = obj; - spyObj.methodName = methodName; - spyObj.originalValue = obj[methodName]; - - obj[methodName] = spyObj; - - return spyObj; -}; - -jasmine.Spec.prototype.removeAllSpies = function() { - for (var i = 0; i < this.spies_.length; i++) { - var spy = this.spies_[i]; - spy.baseObj[spy.methodName] = spy.originalValue; - } - this.spies_ = []; -}; - -/** - * Internal representation of a Jasmine suite. - * - * @constructor - * @param {jasmine.Env} env - * @param {String} description - * @param {Function} specDefinitions - * @param {jasmine.Suite} parentSuite - */ -jasmine.Suite = function(env, description, specDefinitions, parentSuite) { - var self = this; - self.id = env.nextSuiteId ? env.nextSuiteId() : null; - self.description = description; - self.queue = new jasmine.Queue(env); - self.parentSuite = parentSuite; - self.env = env; - self.before_ = []; - self.after_ = []; - self.children_ = []; - self.suites_ = []; - self.specs_ = []; -}; - -jasmine.Suite.prototype.getFullName = function() { - var fullName = this.description; - for (var parentSuite = this.parentSuite; parentSuite; parentSuite = parentSuite.parentSuite) { - fullName = parentSuite.description + ' ' + fullName; - } - return fullName; -}; - -jasmine.Suite.prototype.finish = function(onComplete) { - this.env.reporter.reportSuiteResults(this); - this.finished = true; - if (typeof(onComplete) == 'function') { - onComplete(); - } -}; - -jasmine.Suite.prototype.beforeEach = function(beforeEachFunction) { - beforeEachFunction.typeName = 'beforeEach'; - this.before_.unshift(beforeEachFunction); -}; - -jasmine.Suite.prototype.afterEach = function(afterEachFunction) { - afterEachFunction.typeName = 'afterEach'; - this.after_.unshift(afterEachFunction); -}; - -jasmine.Suite.prototype.results = function() { - return this.queue.results(); -}; - -jasmine.Suite.prototype.add = function(suiteOrSpec) { - this.children_.push(suiteOrSpec); - if (suiteOrSpec instanceof jasmine.Suite) { - this.suites_.push(suiteOrSpec); - this.env.currentRunner().addSuite(suiteOrSpec); - } else { - this.specs_.push(suiteOrSpec); - } - this.queue.add(suiteOrSpec); -}; - -jasmine.Suite.prototype.specs = function() { - return this.specs_; -}; - -jasmine.Suite.prototype.suites = function() { - return this.suites_; -}; - -jasmine.Suite.prototype.children = function() { - return this.children_; -}; - -jasmine.Suite.prototype.execute = function(onComplete) { - var self = this; - this.queue.start(function () { - self.finish(onComplete); - }); -}; -jasmine.WaitsBlock = function(env, timeout, spec) { - this.timeout = timeout; - jasmine.Block.call(this, env, null, spec); -}; - -jasmine.util.inherit(jasmine.WaitsBlock, jasmine.Block); - -jasmine.WaitsBlock.prototype.execute = function (onComplete) { - if (jasmine.VERBOSE) { - this.env.reporter.log('>> Jasmine waiting for ' + this.timeout + ' ms...'); - } - this.env.setTimeout(function () { - onComplete(); - }, this.timeout); -}; -/** - * A block which waits for some condition to become true, with timeout. - * - * @constructor - * @extends jasmine.Block - * @param {jasmine.Env} env The Jasmine environment. - * @param {Number} timeout The maximum time in milliseconds to wait for the condition to become true. - * @param {Function} latchFunction A function which returns true when the desired condition has been met. - * @param {String} message The message to display if the desired condition hasn't been met within the given time period. - * @param {jasmine.Spec} spec The Jasmine spec. - */ -jasmine.WaitsForBlock = function(env, timeout, latchFunction, message, spec) { - this.timeout = timeout || env.defaultTimeoutInterval; - this.latchFunction = latchFunction; - this.message = message; - this.totalTimeSpentWaitingForLatch = 0; - jasmine.Block.call(this, env, null, spec); -}; -jasmine.util.inherit(jasmine.WaitsForBlock, jasmine.Block); - -jasmine.WaitsForBlock.TIMEOUT_INCREMENT = 10; - -jasmine.WaitsForBlock.prototype.execute = function(onComplete) { - if (jasmine.VERBOSE) { - this.env.reporter.log('>> Jasmine waiting for ' + (this.message || 'something to happen')); - } - var latchFunctionResult; - try { - latchFunctionResult = this.latchFunction.apply(this.spec); - } catch (e) { - this.spec.fail(e); - onComplete(); - return; - } - - if (latchFunctionResult) { - onComplete(); - } else if (this.totalTimeSpentWaitingForLatch >= this.timeout) { - var message = 'timed out after ' + this.timeout + ' msec waiting for ' + (this.message || 'something to happen'); - this.spec.fail({ - name: 'timeout', - message: message - }); - - this.abort = true; - onComplete(); - } else { - this.totalTimeSpentWaitingForLatch += jasmine.WaitsForBlock.TIMEOUT_INCREMENT; - var self = this; - this.env.setTimeout(function() { - self.execute(onComplete); - }, jasmine.WaitsForBlock.TIMEOUT_INCREMENT); - } -}; - -jasmine.version_= { - "major": 1, - "minor": 2, - "build": 0, - "revision": 1333310630, - "release_candidate": 1 -}; diff --git a/plugins/org.apache.cordova.core.device/test/autotest/pages/device.html b/plugins/org.apache.cordova.core.device/test/autotest/pages/device.html deleted file mode 100644 index 7252e67..0000000 --- a/plugins/org.apache.cordova.core.device/test/autotest/pages/device.html +++ /dev/null @@ -1,71 +0,0 @@ - - - - - - - - Cordova: Device API Specs - - - - - - - - - - - - - - - - - - - - - - - - - - Back - - - diff --git a/plugins/org.apache.cordova.core.device/test/autotest/test-runner.js b/plugins/org.apache.cordova.core.device/test/autotest/test-runner.js deleted file mode 100644 index f72b3cc..0000000 --- a/plugins/org.apache.cordova.core.device/test/autotest/test-runner.js +++ /dev/null @@ -1,62 +0,0 @@ -/* - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - * -*/ - -if (window.sessionStorage != null) { - window.sessionStorage.clear(); -} - -// Timeout is 2 seconds to allow physical devices enough -// time to query the response. This is important for some -// Android devices. -var Tests = function() {}; -Tests.TEST_TIMEOUT = 7500; - -// Creates a spy that will fail if called. -function createDoNotCallSpy(name, opt_extraMessage) { - return jasmine.createSpy().andCallFake(function() { - var errorMessage = name + ' should not have been called.'; - if (arguments.length) { - errorMessage += ' Got args: ' + JSON.stringify(arguments); - } - if (opt_extraMessage) { - errorMessage += '\n' + opt_extraMessage; - } - expect(false).toBe(true, errorMessage); - }); -} - -// Waits for any of the given spys to be called. -// Last param may be a custom timeout duration. -function waitsForAny() { - var spys = [].slice.call(arguments); - var timeout = Tests.TEST_TIMEOUT; - if (typeof spys[spys.length - 1] == 'number') { - timeout = spys.pop(); - } - waitsFor(function() { - for (var i = 0; i < spys.length; ++i) { - if (spys[i].wasCalled) { - return true; - } - } - return false; - }, "Expecting callbacks to be called.", timeout); -} diff --git a/plugins/org.apache.cordova.core.device/test/autotest/tests/device.tests.js b/plugins/org.apache.cordova.core.device/test/autotest/tests/device.tests.js deleted file mode 100644 index df9d2c6..0000000 --- a/plugins/org.apache.cordova.core.device/test/autotest/tests/device.tests.js +++ /dev/null @@ -1,50 +0,0 @@ -/* - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - * -*/ - -describe('Device Information (window.device)', function () { - it("should exist", function() { - expect(window.device).toBeDefined(); - }); - - it("should contain a platform specification that is a string", function() { - expect(window.device.platform).toBeDefined(); - expect((new String(window.device.platform)).length > 0).toBe(true); - }); - - it("should contain a version specification that is a string", function() { - expect(window.device.version).toBeDefined(); - expect((new String(window.device.version)).length > 0).toBe(true); - }); - - it("should contain a UUID specification that is a string or a number", function() { - expect(window.device.uuid).toBeDefined(); - if (typeof window.device.uuid == 'string' || typeof window.device.uuid == 'object') { - expect((new String(window.device.uuid)).length > 0).toBe(true); - } else { - expect(window.device.uuid > 0).toBe(true); - } - }); - - it("should contain a cordova specification that is a string", function() { - expect(window.device.cordova).toBeDefined(); - expect((new String(window.device.cordova)).length > 0).toBe(true); - }); -}); diff --git a/plugins/org.apache.cordova.core.device/test/cordova-incl.js b/plugins/org.apache.cordova.core.device/test/cordova-incl.js deleted file mode 100644 index a82c590..0000000 --- a/plugins/org.apache.cordova.core.device/test/cordova-incl.js +++ /dev/null @@ -1,85 +0,0 @@ -/* - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - * -*/ - -var PLAT; -(function getPlatform() { - var platforms = { - android: /Android/, - ios: /(iPad)|(iPhone)|(iPod)/, - blackberry10: /(BB10)/, - blackberry: /(PlayBook)|(BlackBerry)/, - windows8: /MSAppHost/, - windowsphone: /Windows Phone/ - }; - for (var key in platforms) { - if (platforms[key].exec(navigator.userAgent)) { - PLAT = key; - break; - } - } -})(); - -var scripts = document.getElementsByTagName('script'); -var currentPath = scripts[scripts.length - 1].src; -var platformCordovaPath = currentPath.replace("cordova-incl.js", "cordova." + PLAT + ".js"); -var normalCordovaPath = currentPath.replace("cordova-incl.js", "cordova.js"); -var cordovaPath = normalCordovaPath; - -if (PLAT) { - // XHR to local file is an error on some platforms, windowsphone for one - try { - var xhr = new XMLHttpRequest(); - xhr.open("GET", platformCordovaPath, false); - xhr.onreadystatechange = function() { - - if (this.readyState == this.DONE && this.responseText.length > 0) { - if(parseInt(this.status) >= 400){ - cordovaPath = normalCordovaPath; - }else{ - cordovaPath = platformCordovaPath; - } - } - }; - xhr.send(null); - } - catch(e){ - cordovaPath = normalCordovaPath; - } // access denied! -} - -if (!window._doNotWriteCordovaScript) { - if (PLAT != "windows8") { - document.write(''); - } else { - var s = document.createElement('script'); - s.src = cordovaPath; - document.head.appendChild(s); - } -} - -function backHome() { - if (window.device && device.platform && device.platform.toLowerCase() == 'android') { - navigator.app.backHistory(); - } - else { - window.history.go(-1); - } -} diff --git a/plugins/org.apache.cordova.core.device/test/index.html b/plugins/org.apache.cordova.core.device/test/index.html deleted file mode 100644 index 727c504..0000000 --- a/plugins/org.apache.cordova.core.device/test/index.html +++ /dev/null @@ -1,64 +0,0 @@ - - - - - - - - - Cordova Mobile Spec - - - - - - -

Apache Cordova Tests

-
-

Platform:

-

Version:

-

UUID:

-

Model:

-

Width: , Height: - , Color Depth:

-

User-Agent:

-
- Automatic Test - Accelerometer - Audio Play/Record - Battery - Camera - Compass - Contacts - Events - Location - Lazy Loading of cordova-incl.js - Misc Content - Network - Notification - Splashscreen - Web SQL - Local Storage - Benchmarks - In App Browser - - diff --git a/plugins/org.apache.cordova.core.device/test/main.js b/plugins/org.apache.cordova.core.device/test/main.js deleted file mode 100644 index 5f071c4..0000000 --- a/plugins/org.apache.cordova.core.device/test/main.js +++ /dev/null @@ -1,162 +0,0 @@ -/* - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - * -*/ - -var deviceInfo = function() { - document.getElementById("platform").innerHTML = device.platform; - document.getElementById("version").innerHTML = device.version; - document.getElementById("uuid").innerHTML = device.uuid; - document.getElementById("model").innerHTML = device.model; - document.getElementById("width").innerHTML = screen.width; - document.getElementById("height").innerHTML = screen.height; - document.getElementById("colorDepth").innerHTML = screen.colorDepth; -}; - -var getLocation = function() { - var suc = function(p) { - alert(p.coords.latitude + " " + p.coords.longitude); - }; - var locFail = function() { - }; - navigator.geolocation.getCurrentPosition(suc, locFail); -}; - -var beep = function() { - navigator.notification.beep(2); -}; - -var vibrate = function() { - navigator.notification.vibrate(0); -}; - -function roundNumber(num) { - var dec = 3; - var result = Math.round(num * Math.pow(10, dec)) / Math.pow(10, dec); - return result; -} - -var accelerationWatch = null; - -function updateAcceleration(a) { - document.getElementById('x').innerHTML = roundNumber(a.x); - document.getElementById('y').innerHTML = roundNumber(a.y); - document.getElementById('z').innerHTML = roundNumber(a.z); -} - -var toggleAccel = function() { - if (accelerationWatch !== null) { - navigator.accelerometer.clearWatch(accelerationWatch); - updateAcceleration({ - x : "", - y : "", - z : "" - }); - accelerationWatch = null; - } else { - var options = {}; - options.frequency = 1000; - accelerationWatch = navigator.accelerometer.watchAcceleration( - updateAcceleration, function(ex) { - alert("accel fail (" + ex.name + ": " + ex.message + ")"); - }, options); - } -}; - -var preventBehavior = function(e) { - e.preventDefault(); -}; - -function dump_pic(data) { - var viewport = document.getElementById('viewport'); - console.log(data); - viewport.style.display = ""; - viewport.style.position = "absolute"; - viewport.style.top = "10px"; - viewport.style.left = "10px"; - document.getElementById("test_img").src = "data:image/jpeg;base64," + data; -} - -function fail(msg) { - alert(msg); -} - -function show_pic() { - navigator.camera.getPicture(dump_pic, fail, { - quality : 50 - }); -} - -function close() { - var viewport = document.getElementById('viewport'); - viewport.style.position = "relative"; - viewport.style.display = "none"; -} - -// This is just to do this. -function readFile() { - navigator.file.read('/sdcard/cordova.txt', fail, fail); -} - -function writeFile() { - navigator.file.write('foo.txt', "This is a test of writing to a file", - fail, fail); -} - -function contacts_success(contacts) { - alert(contacts.length - + ' contacts returned.' - + (contacts[2] && contacts[2].name ? (' Third contact is ' + contacts[2].name.formatted) - : '')); -} - -function get_contacts() { - var obj = new ContactFindOptions(); - obj.filter = ""; - obj.multiple = true; - obj.limit = 5; - navigator.service.contacts.find( - [ "displayName", "name" ], contacts_success, - fail, obj); -} - -var networkReachableCallback = function(reachability) { - // There is no consistency on the format of reachability - var networkState = reachability.code || reachability; - - var currentState = {}; - currentState[NetworkStatus.NOT_REACHABLE] = 'No network connection'; - currentState[NetworkStatus.REACHABLE_VIA_CARRIER_DATA_NETWORK] = 'Carrier data connection'; - currentState[NetworkStatus.REACHABLE_VIA_WIFI_NETWORK] = 'WiFi connection'; - - confirm("Connection type:\n" + currentState[networkState]); -}; - -function check_network() { - navigator.network.isReachable("www.mobiledevelopersolutions.com", - networkReachableCallback, {}); -} - -function init() { - // the next line makes it impossible to see Contacts on the HTC Evo since it - // doesn't have a scroll button - // document.addEventListener("touchmove", preventBehavior, false); - document.addEventListener("deviceready", deviceInfo, true); - document.getElementById("user-agent").textContent = navigator.userAgent; -} diff --git a/plugins/org.apache.cordova.core.device/test/master.css b/plugins/org.apache.cordova.core.device/test/master.css deleted file mode 100644 index e93c937..0000000 --- a/plugins/org.apache.cordova.core.device/test/master.css +++ /dev/null @@ -1,164 +0,0 @@ -/* - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - * -*/ - - body { - background:#222 none repeat scroll 0 0; - color:#666; - font-family:Helvetica; - font-size:72%; - line-height:1.5em; - margin:0; - border-top:1px solid #393939; - } - - #info{ - background:#ffa; - border: 1px solid #ffd324; - -webkit-border-radius: 5px; - border-radius: 5px; - clear:both; - margin:15px 6px 0; - min-width:295px; - max-width:97%; - padding:4px 0px 2px 10px; - word-wrap:break-word; - margin-bottom:10px; - display:inline-block; - min-height: 160px; - max-height: 300px; - overflow: auto; - -webkit-overflow-scrolling: touch; - } - - #info > h4{ - font-size:.95em; - margin:5px 0; - } - - #stage.theme{ - padding-top:3px; - } - - /* Definition List */ - #stage.theme > dl{ - padding-top:10px; - clear:both; - margin:0; - list-style-type:none; - padding-left:10px; - overflow:auto; - } - - #stage.theme > dl > dt{ - font-weight:bold; - float:left; - margin-left:5px; - } - - #stage.theme > dl > dd{ - width:45px; - float:left; - color:#a87; - font-weight:bold; - } - - /* Content Styling */ - #stage.theme > h1, #stage.theme > h2, #stage.theme > p{ - margin:1em 0 .5em 13px; - } - - #stage.theme > h1{ - color:#eee; - font-size:1.6em; - text-align:center; - margin:0; - margin-top:15px; - padding:0; - } - - #stage.theme > h2{ - clear:both; - margin:0; - padding:3px; - font-size:1em; - text-align:center; - } - - /* Stage Buttons */ - #stage.theme .btn{ - border: 1px solid #555; - -webkit-border-radius: 5px; - border-radius: 5px; - text-align:center; - display:inline-block; - background:#444; - width:150px; - color:#9ab; - font-size:1.1em; - text-decoration:none; - padding:1.2em 0; - margin:3px 0px 3px 5px; - } - - #stage.theme .large{ - width:308px; - padding:1.2em 0; - } - - #stage.theme .wide{ - width:100%; - padding:1.2em 0; - } - - #stage.theme .backBtn{ - border: 1px solid #555; - -webkit-border-radius: 5px; - border-radius: 5px; - text-align:center; - display:block; - float:right; - background:#666; - width:75px; - color:#9ab; - font-size:1.1em; - text-decoration:none; - padding:1.2em 0; - margin:3px 5px 3px 5px; - } - - #stage.theme .input{ - border: 1px solid #555; - -webkit-border-radius: 5px; - border-radius: 5px; - text-align:center; - display:block; - float:light; - background:#888; - color:#9cd; - font-size:1.1em; - text-decoration:none; - padding:1.2em 0; - margin:3px 0px 3px 5px; - } - - #stage.theme .numeric{ - width:100%; - } diff --git a/plugins/org.apache.cordova.core.device/www/device.js b/plugins/org.apache.cordova.core.device/www/device.js deleted file mode 100644 index 0271b70..0000000 --- a/plugins/org.apache.cordova.core.device/www/device.js +++ /dev/null @@ -1,74 +0,0 @@ -/* - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - * -*/ - -var argscheck = require('cordova/argscheck'), - channel = require('cordova/channel'), - utils = require('cordova/utils'), - exec = require('cordova/exec'); - -channel.createSticky('onCordovaInfoReady'); -// Tell cordova channel to wait on the CordovaInfoReady event -channel.waitForInitialization('onCordovaInfoReady'); - -/** - * This represents the mobile device, and provides properties for inspecting the model, version, UUID of the - * phone, etc. - * @constructor - */ -function Device() { - this.available = false; - this.platform = null; - this.version = null; - this.uuid = null; - this.cordova = null; - this.model = null; - - var me = this; - - channel.onCordovaReady.subscribe(function() { - me.getInfo(function(info) { - var buildLabel = info.cordova; - me.available = true; - me.platform = info.platform; - me.version = info.version; - me.uuid = info.uuid; - me.cordova = buildLabel; - me.model = info.model; - channel.onCordovaInfoReady.fire(); - },function(e) { - me.available = false; - utils.alert("[ERROR] Error initializing Cordova: " + e); - }); - }); -} - -/** - * Get device info - * - * @param {Function} successCallback The function to call when the heading data is available - * @param {Function} errorCallback The function to call when there is an error getting the heading data. (OPTIONAL) - */ -Device.prototype.getInfo = function(successCallback, errorCallback) { - argscheck.checkArgs('fF', 'Device.getInfo', arguments); - exec(successCallback, errorCallback, "Device", "getDeviceInfo", []); -}; - -module.exports = new Device(); diff --git a/plugins/org.apache.cordova.core.file-transfer/.fetch.json b/plugins/org.apache.cordova.core.file-transfer/.fetch.json deleted file mode 100644 index fced255..0000000 --- a/plugins/org.apache.cordova.core.file-transfer/.fetch.json +++ /dev/null @@ -1 +0,0 @@ -{"source":{"type":"git","url":"https://git-wip-us.apache.org/repos/asf/cordova-plugin-file-transfer.git","subdir":"."}} \ No newline at end of file diff --git a/plugins/org.apache.cordova.core.file-transfer/README.md b/plugins/org.apache.cordova.core.file-transfer/README.md deleted file mode 100644 index 603e478..0000000 --- a/plugins/org.apache.cordova.core.file-transfer/README.md +++ /dev/null @@ -1,5 +0,0 @@ -cordova-plugin-file-transfer ----------------------------- -To install this plugin, follow the [Command-line Interface Guide](http://cordova.apache.org/docs/en/edge/guide_cli_index.md.html#The%20Command-line%20Interface). - -If you are not using the Cordova Command-line Interface, follow [Using Plugman to Manage Plugins](http://cordova.apache.org/docs/en/edge/guide_plugin_ref_plugman.md.html). diff --git a/plugins/org.apache.cordova.core.file-transfer/docs/filetransfer/filetransfer.md b/plugins/org.apache.cordova.core.file-transfer/docs/filetransfer/filetransfer.md deleted file mode 100644 index 8230216..0000000 --- a/plugins/org.apache.cordova.core.file-transfer/docs/filetransfer/filetransfer.md +++ /dev/null @@ -1,303 +0,0 @@ ---- -license: Licensed to the Apache Software Foundation (ASF) under one - or more contributor license agreements. See the NOTICE file - distributed with this work for additional information - regarding copyright ownership. The ASF licenses this file - to you under the Apache License, Version 2.0 (the - "License"); you may not use this file except in compliance - with the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, - software distributed under the License is distributed on an - "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - KIND, either express or implied. See the License for the - specific language governing permissions and limitations - under the License. ---- - -FileTransfer -========== - -The `FileTransfer` object allows you to upload or download files to -and from a server. - -Properties ----------- - -- __onprogress__: Called with a `ProgressEvent` whenever a new chunk of data is transferred. _(Function)_ - -Methods -------- - -- __upload__: sends a file to a server. -- __download__: downloads a file from server. -- __abort__: Aborts an in-progress transfer. - -Details -------- - -The `FileTransfer` object provides a way to upload files to a remote -server using an HTTP multi-part POST request. Both HTTP and HTTPS -protocols are supported. Optional parameters can be specified by -passing a `FileUploadOptions` object to the `upload()` method. On -successful upload, a `FileUploadResult` object is passed to the -success callback. If an error occurs, a `FileTransferError` object is -passed to the error callback. It is also possible (only on iOS and -Android) to download a file from a remote server and save it on the -device. - -Supported Platforms -------------------- - -- Android -- BlackBerry WebWorks (OS 5.0 and higher) -- iOS -- Windows Phone 7 and 8 -- Windows 8 - -upload --------------- - -__Parameters:__ - -- __filePath__: Full path of the file on the device. -- __server__: URL of the server to receive the file, as encoded by `encodeURI()`. -- __successCallback__: A callback that is passed a `Metadata` object. _(Function)_ -- __errorCallback__: A callback that executes if an error occurs retrieving the `Metadata`. Invoked with a `FileTransferError` object. _(Function)_ -- __options__: Optional parameters such as file name and mimetype. -- __trustAllHosts__: Optional parameter, defaults to `false`. If set to true, it accepts all security certificates. This is useful since Android rejects self-signed security certificates. Not recommended for production use. Supported on Android and iOS. _(boolean)_ - -__Quick Example__ - - // !! Assumes variable fileURI contains a valid URI to a text file on the device - - var win = function (r) { - console.log("Code = " + r.responseCode); - console.log("Response = " + r.response); - console.log("Sent = " + r.bytesSent); - } - - var fail = function (error) { - alert("An error has occurred: Code = " + error.code); - console.log("upload error source " + error.source); - console.log("upload error target " + error.target); - } - - var options = new FileUploadOptions(); - options.fileKey = "file"; - options.fileName = fileURI.substr(fileURI.lastIndexOf('/') + 1); - options.mimeType = "text/plain"; - - var params = {}; - params.value1 = "test"; - params.value2 = "param"; - - options.params = params; - - var ft = new FileTransfer(); - ft.upload(fileURI, encodeURI("http://some.server.com/upload.php"), win, fail, options); - -__Full Example__ - - - - - File Transfer Example - - - - - -

Example

-

Upload File

- - - -__Setting Upload Headers__ - -Supported on Android and iOS - - function win(r) { - console.log("Code = " + r.responseCode); - console.log("Response = " + r.response); - console.log("Sent = " + r.bytesSent); - } - - function fail(error) { - alert("An error has occurred: Code = " + error.code); - console.log("upload error source " + error.source); - console.log("upload error target " + error.target); - } - - var uri = encodeURI("http://some.server.com/upload.php"); - - var options = new FileUploadOptions(); - options.fileKey="file"; - options.fileName=fileURI.substr(fileURI.lastIndexOf('/')+1); - options.mimeType="text/plain"; - - var headers={'headerParam':'headerValue'}; - - options.headers = headers; - - var ft = new FileTransfer(); - ft.upload(fileURI, uri, win, fail, options); - -__Android Quirks__ - -Set the `chunkedMode` option to `false` to prevent problems uploading -to a Nginx server. - -download --------------- - -__Parameters:__ - -- __source__: URL of the server to download the file, as encoded by `encodeURI()`. -- __target__: Full path of the file on the device. -- __successCallback__: A callback that is passed a `FileEntry` object. _(Function)_ -- __errorCallback__: A callback that executes if an error occurs when retrieving the `Metadata`. Invoked with a `FileTransferError` object. _(Function)_ -- __trustAllHosts__: Optional parameter, defaults to `false`. If set to `true` then it will accept all security certificates. This is useful as Android rejects self signed security certificates. Not recommended for production use. Supported on Android and iOS. _(boolean)_ -- __options__: Optional parameters, currently only supports headers (such as Authorization (Basic Authentication), etc). - -__Quick Example__ - - // !! Assumes filePath is a valid path on the device - - var fileTransfer = new FileTransfer(); - var uri = encodeURI("http://some.server.com/download.php"); - - fileTransfer.download( - uri, - filePath, - function(entry) { - console.log("download complete: " + entry.fullPath); - }, - function(error) { - console.log("download error source " + error.source); - console.log("download error target " + error.target); - console.log("upload error code" + error.code); - }, - false, - { - headers: { - "Authorization": "Basic dGVzdHVzZXJuYW1lOnRlc3RwYXNzd29yZA==" - } - } - ); - -abort --------------- - -Aborts an in-progress transfer. The onerror callback is passed a FileTransferError object which has an error code of FileTransferError.ABORT_ERR. - -__Supported Platforms__ - -- Android -- iOS - -__Quick Example__ - - // !! Assumes variable fileURI contains a valid URI to a text file on the device - - var win = function(r) { - console.log("Code = " + r.responseCode); - console.log("Response = " + r.response); - console.log("Sent = " + r.bytesSent); - } - - var fail = function(error) { - alert("An error has occurred: Code = " + error.code); - console.log("upload error source " + error.source); - console.log("upload error target " + error.target); - } - - var options = new FileUploadOptions(); - options.fileKey="file"; - options.fileName=fileURI.substr(fileURI.lastIndexOf('/')+1); - options.mimeType="text/plain"; - - var params = {}; - params.value1 = "test"; - params.value2 = "param"; - - options.params = params; - - var ft = new FileTransfer(); - ft.upload(fileURI, encodeURI("http://some.server.com/upload.php"), win, fail, options); - ft.abort(win, fail); - -onprogress --------------- - -Called with a ProgressEvent whenever a new chunk of data is transferred. - -__Supported Platforms__ - -- Android -- iOS - -__Example__ - - fileTransfer.onprogress = function(progressEvent) { - if (progressEvent.lengthComputable) { - loadingStatus.setPercentage(progressEvent.loaded / progressEvent.total); - } else { - loadingStatus.increment(); - } - }; - fileTransfer.download(...); // or fileTransfer.upload(...); - -__Quirks__ -- On both Android an iOS, lengthComputable is false for downloads that use gzip encoding. diff --git a/plugins/org.apache.cordova.core.file-transfer/docs/filetransfererror/filetransfererror.md b/plugins/org.apache.cordova.core.file-transfer/docs/filetransfererror/filetransfererror.md deleted file mode 100644 index abb135f..0000000 --- a/plugins/org.apache.cordova.core.file-transfer/docs/filetransfererror/filetransfererror.md +++ /dev/null @@ -1,45 +0,0 @@ ---- -license: Licensed to the Apache Software Foundation (ASF) under one - or more contributor license agreements. See the NOTICE file - distributed with this work for additional information - regarding copyright ownership. The ASF licenses this file - to you under the Apache License, Version 2.0 (the - "License"); you may not use this file except in compliance - with the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, - software distributed under the License is distributed on an - "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - KIND, either express or implied. See the License for the - specific language governing permissions and limitations - under the License. ---- - -FileTransferError -======== - -A `FileTransferError` object is passed to an error callback when an error occurs. - -Properties ----------- - -- __code__: One of the predefined error codes listed below. (Number) -- __source__: URI to the source. (String) -- __target__: URI to the target. (String) -- __http_status__: HTTP status code. This attribute is only available when a response code is received from the HTTP connection. (Number) - -Constants ---------- - -- `FileTransferError.FILE_NOT_FOUND_ERR` -- `FileTransferError.INVALID_URL_ERR` -- `FileTransferError.CONNECTION_ERR` -- `FileTransferError.ABORT_ERR` - -Description ------------ - -The `FileTransferError` object is passed to the error callback when an -error occurs when uploading or downloading a file. diff --git a/plugins/org.apache.cordova.core.file-transfer/plugin.xml b/plugins/org.apache.cordova.core.file-transfer/plugin.xml deleted file mode 100644 index acd24d9..0000000 --- a/plugins/org.apache.cordova.core.file-transfer/plugin.xml +++ /dev/null @@ -1,100 +0,0 @@ - - - - File Transfer - Cordova File Transfer Plugin - Apache - cordova,file,transfer - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/plugins/org.apache.cordova.core.file-transfer/src/android/FileProgressResult.java b/plugins/org.apache.cordova.core.file-transfer/src/android/FileProgressResult.java deleted file mode 100644 index 045a846..0000000 --- a/plugins/org.apache.cordova.core.file-transfer/src/android/FileProgressResult.java +++ /dev/null @@ -1,63 +0,0 @@ -/* - Licensed to the Apache Software Foundation (ASF) under one - or more contributor license agreements. See the NOTICE file - distributed with this work for additional information - regarding copyright ownership. The ASF licenses this file - to you under the Apache License, Version 2.0 (the - "License"); you may not use this file except in compliance - with the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, - software distributed under the License is distributed on an - "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - KIND, either express or implied. See the License for the - specific language governing permissions and limitations - under the License. -*/ -package org.apache.cordova.core; - -import org.json.JSONException; -import org.json.JSONObject; - -/** - * Encapsulates in-progress status of uploading or downloading a file to a remote server. - */ -public class FileProgressResult { - - private boolean lengthComputable = false; // declares whether total is known - private long loaded = 0; // bytes sent so far - private long total = 0; // bytes total, if known - - public boolean getLengthComputable() { - return lengthComputable; - } - - public void setLengthComputable(boolean computable) { - this.lengthComputable = computable; - } - - public long getLoaded() { - return loaded; - } - - public void setLoaded(long bytes) { - this.loaded = bytes; - } - - public long getTotal() { - return total; - } - - public void setTotal(long bytes) { - this.total = bytes; - } - - public JSONObject toJSONObject() throws JSONException { - return new JSONObject( - "{loaded:" + loaded + - ",total:" + total + - ",lengthComputable:" + (lengthComputable ? "true" : "false") + "}"); - } -} diff --git a/plugins/org.apache.cordova.core.file-transfer/src/android/FileTransfer.java b/plugins/org.apache.cordova.core.file-transfer/src/android/FileTransfer.java deleted file mode 100644 index c4b5dd1..0000000 --- a/plugins/org.apache.cordova.core.file-transfer/src/android/FileTransfer.java +++ /dev/null @@ -1,871 +0,0 @@ -/* - Licensed to the Apache Software Foundation (ASF) under one - or more contributor license agreements. See the NOTICE file - distributed with this work for additional information - regarding copyright ownership. The ASF licenses this file - to you under the Apache License, Version 2.0 (the - "License"); you may not use this file except in compliance - with the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, - software distributed under the License is distributed on an - "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - KIND, either express or implied. See the License for the - specific language governing permissions and limitations - under the License. -*/ -package org.apache.cordova.core; - -import java.io.BufferedReader; -import java.io.ByteArrayOutputStream; -import java.io.Closeable; -import java.io.File; -import java.io.FileNotFoundException; -import java.io.FilterInputStream; -import java.io.IOException; -import java.io.InputStream; -import java.io.InputStreamReader; -import java.io.OutputStream; -import java.io.UnsupportedEncodingException; -import java.net.HttpURLConnection; -import java.net.URLConnection; -import java.net.URLDecoder; -import java.security.cert.CertificateException; -import java.security.cert.X509Certificate; -import java.util.HashMap; -import java.util.Iterator; -import java.util.zip.GZIPInputStream; -import java.util.zip.Inflater; - -import javax.net.ssl.HostnameVerifier; -import javax.net.ssl.HttpsURLConnection; -import javax.net.ssl.SSLContext; -import javax.net.ssl.SSLSession; -import javax.net.ssl.SSLSocketFactory; -import javax.net.ssl.TrustManager; -import javax.net.ssl.X509TrustManager; - -import org.apache.cordova.Config; -import org.apache.cordova.CallbackContext; -import org.apache.cordova.CordovaPlugin; -import org.apache.cordova.CordovaResourceApi; -import org.apache.cordova.CordovaResourceApi.OpenForReadResult; -import org.apache.cordova.PluginResult; -import org.json.JSONArray; -import org.json.JSONException; -import org.json.JSONObject; - -import android.net.Uri; -import android.os.Build; -import android.util.Log; -import android.webkit.CookieManager; - -public class FileTransfer extends CordovaPlugin { - - private static final String LOG_TAG = "FileTransfer"; - private static final String LINE_START = "--"; - private static final String LINE_END = "\r\n"; - private static final String BOUNDARY = "+++++"; - - public static int FILE_NOT_FOUND_ERR = 1; - public static int INVALID_URL_ERR = 2; - public static int CONNECTION_ERR = 3; - public static int ABORTED_ERR = 4; - - private static HashMap activeRequests = new HashMap(); - private static final int MAX_BUFFER_SIZE = 16 * 1024; - - private static final class RequestContext { - String source; - String target; - File targetFile; - CallbackContext callbackContext; - InputStream currentInputStream; - OutputStream currentOutputStream; - boolean aborted; - RequestContext(String source, String target, CallbackContext callbackContext) { - this.source = source; - this.target = target; - this.callbackContext = callbackContext; - } - void sendPluginResult(PluginResult pluginResult) { - synchronized (this) { - if (!aborted) { - callbackContext.sendPluginResult(pluginResult); - } - } - } - } - - /** - * Adds an interface method to an InputStream to return the number of bytes - * read from the raw stream. This is used to track total progress against - * the HTTP Content-Length header value from the server. - */ - private static abstract class TrackingInputStream extends FilterInputStream { - public TrackingInputStream(final InputStream in) { - super(in); - } - public abstract long getTotalRawBytesRead(); - } - - private static class ExposedGZIPInputStream extends GZIPInputStream { - public ExposedGZIPInputStream(final InputStream in) throws IOException { - super(in); - } - public Inflater getInflater() { - return inf; - } - } - - /** - * Provides raw bytes-read tracking for a GZIP input stream. Reports the - * total number of compressed bytes read from the input, rather than the - * number of uncompressed bytes. - */ - private static class TrackingGZIPInputStream extends TrackingInputStream { - private ExposedGZIPInputStream gzin; - public TrackingGZIPInputStream(final ExposedGZIPInputStream gzin) throws IOException { - super(gzin); - this.gzin = gzin; - } - public long getTotalRawBytesRead() { - return gzin.getInflater().getBytesRead(); - } - } - - /** - * Provides simple total-bytes-read tracking for an existing InputStream - */ - private static class SimpleTrackingInputStream extends TrackingInputStream { - private long bytesRead = 0; - public SimpleTrackingInputStream(InputStream stream) { - super(stream); - } - - private int updateBytesRead(int newBytesRead) { - if (newBytesRead != -1) { - bytesRead += newBytesRead; - } - return newBytesRead; - } - - @Override - public int read() throws IOException { - return updateBytesRead(super.read()); - } - - @Override - public int read(byte[] buffer) throws IOException { - return updateBytesRead(super.read(buffer)); - } - - @Override - public int read(byte[] bytes, int offset, int count) throws IOException { - return updateBytesRead(super.read(bytes, offset, count)); - } - - public long getTotalRawBytesRead() { - return bytesRead; - } - } - - @Override - public boolean execute(String action, JSONArray args, final CallbackContext callbackContext) throws JSONException { - if (action.equals("upload") || action.equals("download")) { - String source = args.getString(0); - String target = args.getString(1); - - if (action.equals("upload")) { - try { - source = URLDecoder.decode(source, "UTF-8"); - upload(source, target, args, callbackContext); - } catch (UnsupportedEncodingException e) { - callbackContext.sendPluginResult(new PluginResult(PluginResult.Status.MALFORMED_URL_EXCEPTION, "UTF-8 error.")); - } - } else { - download(source, target, args, callbackContext); - } - return true; - } else if (action.equals("abort")) { - String objectId = args.getString(0); - abort(objectId); - callbackContext.success(); - return true; - } - return false; - } - - private static void addHeadersToRequest(URLConnection connection, JSONObject headers) { - try { - for (Iterator iter = headers.keys(); iter.hasNext(); ) { - String headerKey = iter.next().toString(); - JSONArray headerValues = headers.optJSONArray(headerKey); - if (headerValues == null) { - headerValues = new JSONArray(); - headerValues.put(headers.getString(headerKey)); - } - connection.setRequestProperty(headerKey, headerValues.getString(0)); - for (int i = 1; i < headerValues.length(); ++i) { - connection.addRequestProperty(headerKey, headerValues.getString(i)); - } - } - } catch (JSONException e1) { - // No headers to be manipulated! - } - } - - /** - * Uploads the specified file to the server URL provided using an HTTP multipart request. - * @param source Full path of the file on the file system - * @param target URL of the server to receive the file - * @param args JSON Array of args - * @param callbackContext callback id for optional progress reports - * - * args[2] fileKey Name of file request parameter - * args[3] fileName File name to be used on server - * args[4] mimeType Describes file content type - * args[5] params key:value pairs of user-defined parameters - * @return FileUploadResult containing result of upload request - */ - private void upload(final String source, final String target, JSONArray args, CallbackContext callbackContext) throws JSONException { - Log.d(LOG_TAG, "upload " + source + " to " + target); - - // Setup the options - final String fileKey = getArgument(args, 2, "file"); - final String fileName = getArgument(args, 3, "image.jpg"); - final String mimeType = getArgument(args, 4, "image/jpeg"); - final JSONObject params = args.optJSONObject(5) == null ? new JSONObject() : args.optJSONObject(5); - final boolean trustEveryone = args.optBoolean(6); - // Always use chunked mode unless set to false as per API - final boolean chunkedMode = args.optBoolean(7) || args.isNull(7); - // Look for headers on the params map for backwards compatibility with older Cordova versions. - final JSONObject headers = args.optJSONObject(8) == null ? params.optJSONObject("headers") : args.optJSONObject(8); - final String objectId = args.getString(9); - final String httpMethod = getArgument(args, 10, "POST"); - - final CordovaResourceApi resourceApi = webView.getResourceApi(); - - Log.d(LOG_TAG, "fileKey: " + fileKey); - Log.d(LOG_TAG, "fileName: " + fileName); - Log.d(LOG_TAG, "mimeType: " + mimeType); - Log.d(LOG_TAG, "params: " + params); - Log.d(LOG_TAG, "trustEveryone: " + trustEveryone); - Log.d(LOG_TAG, "chunkedMode: " + chunkedMode); - Log.d(LOG_TAG, "headers: " + headers); - Log.d(LOG_TAG, "objectId: " + objectId); - Log.d(LOG_TAG, "httpMethod: " + httpMethod); - - final Uri targetUri = resourceApi.remapUri(Uri.parse(target)); - // Accept a path or a URI for the source. - Uri tmpSrc = Uri.parse(source); - final Uri sourceUri = resourceApi.remapUri( - tmpSrc.getScheme() != null ? tmpSrc : Uri.fromFile(new File(source))); - - int uriType = CordovaResourceApi.getUriType(targetUri); - final boolean useHttps = uriType == CordovaResourceApi.URI_TYPE_HTTPS; - if (uriType != CordovaResourceApi.URI_TYPE_HTTP && !useHttps) { - JSONObject error = createFileTransferError(INVALID_URL_ERR, source, target, null, 0); - Log.e(LOG_TAG, "Unsupported URI: " + targetUri); - callbackContext.sendPluginResult(new PluginResult(PluginResult.Status.IO_EXCEPTION, error)); - return; - } - - final RequestContext context = new RequestContext(source, target, callbackContext); - synchronized (activeRequests) { - activeRequests.put(objectId, context); - } - - cordova.getThreadPool().execute(new Runnable() { - public void run() { - if (context.aborted) { - return; - } - HttpURLConnection conn = null; - HostnameVerifier oldHostnameVerifier = null; - SSLSocketFactory oldSocketFactory = null; - int totalBytes = 0; - int fixedLength = -1; - try { - // Create return object - FileUploadResult result = new FileUploadResult(); - FileProgressResult progress = new FileProgressResult(); - - //------------------ CLIENT REQUEST - // Open a HTTP connection to the URL based on protocol - conn = resourceApi.createHttpConnection(targetUri); - if (useHttps && trustEveryone) { - // Setup the HTTPS connection class to trust everyone - HttpsURLConnection https = (HttpsURLConnection)conn; - oldSocketFactory = trustAllHosts(https); - // Save the current hostnameVerifier - oldHostnameVerifier = https.getHostnameVerifier(); - // Setup the connection not to verify hostnames - https.setHostnameVerifier(DO_NOT_VERIFY); - } - - // Allow Inputs - conn.setDoInput(true); - - // Allow Outputs - conn.setDoOutput(true); - - // Don't use a cached copy. - conn.setUseCaches(false); - - // Use a post method. - conn.setRequestMethod(httpMethod); - conn.setRequestProperty("Content-Type", "multipart/form-data;boundary=" + BOUNDARY); - - // Set the cookies on the response - String cookie = CookieManager.getInstance().getCookie(target); - if (cookie != null) { - conn.setRequestProperty("Cookie", cookie); - } - - // Handle the other headers - if (headers != null) { - addHeadersToRequest(conn, headers); - } - - /* - * Store the non-file portions of the multipart data as a string, so that we can add it - * to the contentSize, since it is part of the body of the HTTP request. - */ - StringBuilder beforeData = new StringBuilder(); - try { - for (Iterator iter = params.keys(); iter.hasNext();) { - Object key = iter.next(); - if(!String.valueOf(key).equals("headers")) - { - beforeData.append(LINE_START).append(BOUNDARY).append(LINE_END); - beforeData.append("Content-Disposition: form-data; name=\"").append(key.toString()).append('"'); - beforeData.append(LINE_END).append(LINE_END); - beforeData.append(params.getString(key.toString())); - beforeData.append(LINE_END); - } - } - } catch (JSONException e) { - Log.e(LOG_TAG, e.getMessage(), e); - } - - beforeData.append(LINE_START).append(BOUNDARY).append(LINE_END); - beforeData.append("Content-Disposition: form-data; name=\"").append(fileKey).append("\";"); - beforeData.append(" filename=\"").append(fileName).append('"').append(LINE_END); - beforeData.append("Content-Type: ").append(mimeType).append(LINE_END).append(LINE_END); - byte[] beforeDataBytes = beforeData.toString().getBytes("UTF-8"); - byte[] tailParamsBytes = (LINE_END + LINE_START + BOUNDARY + LINE_START + LINE_END).getBytes("UTF-8"); - - - // Get a input stream of the file on the phone - OpenForReadResult readResult = resourceApi.openForRead(sourceUri); - - int stringLength = beforeDataBytes.length + tailParamsBytes.length; - if (readResult.length >= 0) { - fixedLength = (int)readResult.length + stringLength; - progress.setLengthComputable(true); - progress.setTotal(fixedLength); - } - Log.d(LOG_TAG, "Content Length: " + fixedLength); - // setFixedLengthStreamingMode causes and OutOfMemoryException on pre-Froyo devices. - // http://code.google.com/p/android/issues/detail?id=3164 - // It also causes OOM if HTTPS is used, even on newer devices. - boolean useChunkedMode = chunkedMode && (Build.VERSION.SDK_INT < Build.VERSION_CODES.FROYO || useHttps); - useChunkedMode = useChunkedMode || (fixedLength == -1); - - if (useChunkedMode) { - conn.setChunkedStreamingMode(MAX_BUFFER_SIZE); - // Although setChunkedStreamingMode sets this header, setting it explicitly here works - // around an OutOfMemoryException when using https. - conn.setRequestProperty("Transfer-Encoding", "chunked"); - } else { - conn.setFixedLengthStreamingMode(fixedLength); - } - - conn.connect(); - - OutputStream sendStream = null; - try { - sendStream = conn.getOutputStream(); - synchronized (context) { - if (context.aborted) { - return; - } - context.currentOutputStream = sendStream; - } - //We don't want to change encoding, we just want this to write for all Unicode. - sendStream.write(beforeDataBytes); - totalBytes += beforeDataBytes.length; - - // create a buffer of maximum size - int bytesAvailable = readResult.inputStream.available(); - int bufferSize = Math.min(bytesAvailable, MAX_BUFFER_SIZE); - byte[] buffer = new byte[bufferSize]; - - // read file and write it into form... - int bytesRead = readResult.inputStream.read(buffer, 0, bufferSize); - - long prevBytesRead = 0; - while (bytesRead > 0) { - result.setBytesSent(totalBytes); - sendStream.write(buffer, 0, bytesRead); - totalBytes += bytesRead; - if (totalBytes > prevBytesRead + 102400) { - prevBytesRead = totalBytes; - Log.d(LOG_TAG, "Uploaded " + totalBytes + " of " + fixedLength + " bytes"); - } - bytesAvailable = readResult.inputStream.available(); - bufferSize = Math.min(bytesAvailable, MAX_BUFFER_SIZE); - bytesRead = readResult.inputStream.read(buffer, 0, bufferSize); - - // Send a progress event. - progress.setLoaded(totalBytes); - PluginResult progressResult = new PluginResult(PluginResult.Status.OK, progress.toJSONObject()); - progressResult.setKeepCallback(true); - context.sendPluginResult(progressResult); - } - - // send multipart form data necessary after file data... - sendStream.write(tailParamsBytes); - totalBytes += tailParamsBytes.length; - sendStream.flush(); - } finally { - safeClose(readResult.inputStream); - safeClose(sendStream); - } - context.currentOutputStream = null; - Log.d(LOG_TAG, "Sent " + totalBytes + " of " + fixedLength); - - //------------------ read the SERVER RESPONSE - String responseString; - int responseCode = conn.getResponseCode(); - Log.d(LOG_TAG, "response code: " + responseCode); - Log.d(LOG_TAG, "response headers: " + conn.getHeaderFields()); - TrackingInputStream inStream = null; - try { - inStream = getInputStream(conn); - synchronized (context) { - if (context.aborted) { - return; - } - context.currentInputStream = inStream; - } - - ByteArrayOutputStream out = new ByteArrayOutputStream(Math.max(1024, conn.getContentLength())); - byte[] buffer = new byte[1024]; - int bytesRead = 0; - // write bytes to file - while ((bytesRead = inStream.read(buffer)) > 0) { - out.write(buffer, 0, bytesRead); - } - responseString = out.toString("UTF-8"); - } finally { - context.currentInputStream = null; - safeClose(inStream); - } - - Log.d(LOG_TAG, "got response from server"); - Log.d(LOG_TAG, responseString.substring(0, Math.min(256, responseString.length()))); - - // send request and retrieve response - result.setResponseCode(responseCode); - result.setResponse(responseString); - - context.sendPluginResult(new PluginResult(PluginResult.Status.OK, result.toJSONObject())); - } catch (FileNotFoundException e) { - JSONObject error = createFileTransferError(FILE_NOT_FOUND_ERR, source, target, conn); - Log.e(LOG_TAG, error.toString(), e); - context.sendPluginResult(new PluginResult(PluginResult.Status.IO_EXCEPTION, error)); - } catch (IOException e) { - JSONObject error = createFileTransferError(CONNECTION_ERR, source, target, conn); - Log.e(LOG_TAG, error.toString(), e); - Log.e(LOG_TAG, "Failed after uploading " + totalBytes + " of " + fixedLength + " bytes."); - context.sendPluginResult(new PluginResult(PluginResult.Status.IO_EXCEPTION, error)); - } catch (JSONException e) { - Log.e(LOG_TAG, e.getMessage(), e); - context.sendPluginResult(new PluginResult(PluginResult.Status.JSON_EXCEPTION)); - } catch (Throwable t) { - // Shouldn't happen, but will - JSONObject error = createFileTransferError(CONNECTION_ERR, source, target, conn); - Log.e(LOG_TAG, error.toString(), t); - context.sendPluginResult(new PluginResult(PluginResult.Status.IO_EXCEPTION, error)); - } finally { - synchronized (activeRequests) { - activeRequests.remove(objectId); - } - - if (conn != null) { - // Revert back to the proper verifier and socket factories - // Revert back to the proper verifier and socket factories - if (trustEveryone && useHttps) { - HttpsURLConnection https = (HttpsURLConnection) conn; - https.setHostnameVerifier(oldHostnameVerifier); - https.setSSLSocketFactory(oldSocketFactory); - } - } - } - } - }); - } - - private static void safeClose(Closeable stream) { - if (stream != null) { - try { - stream.close(); - } catch (IOException e) { - } - } - } - - private static TrackingInputStream getInputStream(URLConnection conn) throws IOException { - String encoding = conn.getContentEncoding(); - if (encoding != null && encoding.equalsIgnoreCase("gzip")) { - return new TrackingGZIPInputStream(new ExposedGZIPInputStream(conn.getInputStream())); - } - return new SimpleTrackingInputStream(conn.getInputStream()); - } - - // always verify the host - don't check for certificate - private static final HostnameVerifier DO_NOT_VERIFY = new HostnameVerifier() { - public boolean verify(String hostname, SSLSession session) { - return true; - } - }; - // Create a trust manager that does not validate certificate chains - private static final TrustManager[] trustAllCerts = new TrustManager[] { new X509TrustManager() { - public java.security.cert.X509Certificate[] getAcceptedIssuers() { - return new java.security.cert.X509Certificate[] {}; - } - - public void checkClientTrusted(X509Certificate[] chain, - String authType) throws CertificateException { - } - - public void checkServerTrusted(X509Certificate[] chain, - String authType) throws CertificateException { - } - } }; - - /** - * This function will install a trust manager that will blindly trust all SSL - * certificates. The reason this code is being added is to enable developers - * to do development using self signed SSL certificates on their web server. - * - * The standard HttpsURLConnection class will throw an exception on self - * signed certificates if this code is not run. - */ - private static SSLSocketFactory trustAllHosts(HttpsURLConnection connection) { - // Install the all-trusting trust manager - SSLSocketFactory oldFactory = connection.getSSLSocketFactory(); - try { - // Install our all trusting manager - SSLContext sc = SSLContext.getInstance("TLS"); - sc.init(null, trustAllCerts, new java.security.SecureRandom()); - SSLSocketFactory newFactory = sc.getSocketFactory(); - connection.setSSLSocketFactory(newFactory); - } catch (Exception e) { - Log.e(LOG_TAG, e.getMessage(), e); - } - return oldFactory; - } - - private static JSONObject createFileTransferError(int errorCode, String source, String target, URLConnection connection) { - - int httpStatus = 0; - StringBuilder bodyBuilder = new StringBuilder(); - String body = null; - if (connection != null) { - try { - if (connection instanceof HttpURLConnection) { - httpStatus = ((HttpURLConnection)connection).getResponseCode(); - InputStream err = ((HttpURLConnection) connection).getErrorStream(); - if(err != null) - { - BufferedReader reader = new BufferedReader(new InputStreamReader(err, "UTF-8")); - String line = reader.readLine(); - while(line != null) - { - bodyBuilder.append(line); - line = reader.readLine(); - if(line != null) - bodyBuilder.append('\n'); - } - body = bodyBuilder.toString(); - } - } - } catch (IOException e) { - Log.w(LOG_TAG, "Error getting HTTP status code from connection.", e); - } - } - - return createFileTransferError(errorCode, source, target, body, httpStatus); - } - - /** - * Create an error object based on the passed in errorCode - * @param errorCode the error - * @return JSONObject containing the error - */ - private static JSONObject createFileTransferError(int errorCode, String source, String target, String body, Integer httpStatus) { - JSONObject error = null; - try { - error = new JSONObject(); - error.put("code", errorCode); - error.put("source", source); - error.put("target", target); - if(body != null) - { - error.put("body", body); - } - if (httpStatus != null) { - error.put("http_status", httpStatus); - } - } catch (JSONException e) { - Log.e(LOG_TAG, e.getMessage(), e); - } - return error; - } - - /** - * Convenience method to read a parameter from the list of JSON args. - * @param args the args passed to the Plugin - * @param position the position to retrieve the arg from - * @param defaultString the default to be used if the arg does not exist - * @return String with the retrieved value - */ - private static String getArgument(JSONArray args, int position, String defaultString) { - String arg = defaultString; - if (args.length() > position) { - arg = args.optString(position); - if (arg == null || "null".equals(arg)) { - arg = defaultString; - } - } - return arg; - } - - /** - * Downloads a file form a given URL and saves it to the specified directory. - * - * @param source URL of the server to receive the file - * @param target Full path of the file on the file system - */ - private void download(final String source, final String target, JSONArray args, CallbackContext callbackContext) throws JSONException { - Log.d(LOG_TAG, "download " + source + " to " + target); - - final CordovaResourceApi resourceApi = webView.getResourceApi(); - - final boolean trustEveryone = args.optBoolean(2); - final String objectId = args.getString(3); - final JSONObject headers = args.optJSONObject(4); - - final Uri sourceUri = resourceApi.remapUri(Uri.parse(source)); - // Accept a path or a URI for the source. - Uri tmpTarget = Uri.parse(target); - final Uri targetUri = resourceApi.remapUri( - tmpTarget.getScheme() != null ? tmpTarget : Uri.fromFile(new File(target))); - - int uriType = CordovaResourceApi.getUriType(sourceUri); - final boolean useHttps = uriType == CordovaResourceApi.URI_TYPE_HTTPS; - final boolean isLocalTransfer = !useHttps && uriType != CordovaResourceApi.URI_TYPE_HTTP; - if (uriType == CordovaResourceApi.URI_TYPE_UNKNOWN) { - JSONObject error = createFileTransferError(INVALID_URL_ERR, source, target, null, 0); - Log.e(LOG_TAG, "Unsupported URI: " + targetUri); - callbackContext.sendPluginResult(new PluginResult(PluginResult.Status.IO_EXCEPTION, error)); - return; - } - - // TODO: refactor to also allow resources & content: - if (!isLocalTransfer && !Config.isUrlWhiteListed(source)) { - Log.w(LOG_TAG, "Source URL is not in white list: '" + source + "'"); - JSONObject error = createFileTransferError(CONNECTION_ERR, source, target, null, 401); - callbackContext.sendPluginResult(new PluginResult(PluginResult.Status.IO_EXCEPTION, error)); - return; - } - - - final RequestContext context = new RequestContext(source, target, callbackContext); - synchronized (activeRequests) { - activeRequests.put(objectId, context); - } - - cordova.getThreadPool().execute(new Runnable() { - public void run() { - if (context.aborted) { - return; - } - HttpURLConnection connection = null; - HostnameVerifier oldHostnameVerifier = null; - SSLSocketFactory oldSocketFactory = null; - File file = null; - PluginResult result = null; - TrackingInputStream inputStream = null; - - OutputStream outputStream = null; - try { - OpenForReadResult readResult = null; - outputStream = resourceApi.openOutputStream(targetUri); - - file = resourceApi.mapUriToFile(targetUri); - context.targetFile = file; - - Log.d(LOG_TAG, "Download file:" + sourceUri); - - FileProgressResult progress = new FileProgressResult(); - - if (isLocalTransfer) { - readResult = resourceApi.openForRead(sourceUri); - if (readResult.length != -1) { - progress.setLengthComputable(true); - progress.setTotal(readResult.length); - } - inputStream = new SimpleTrackingInputStream(readResult.inputStream); - } else { - // connect to server - // Open a HTTP connection to the URL based on protocol - connection = resourceApi.createHttpConnection(sourceUri); - if (useHttps && trustEveryone) { - // Setup the HTTPS connection class to trust everyone - HttpsURLConnection https = (HttpsURLConnection)connection; - oldSocketFactory = trustAllHosts(https); - // Save the current hostnameVerifier - oldHostnameVerifier = https.getHostnameVerifier(); - // Setup the connection not to verify hostnames - https.setHostnameVerifier(DO_NOT_VERIFY); - } - - connection.setRequestMethod("GET"); - - // TODO: Make OkHttp use this CookieManager by default. - String cookie = CookieManager.getInstance().getCookie(sourceUri.toString()); - if(cookie != null) - { - connection.setRequestProperty("cookie", cookie); - } - - // This must be explicitly set for gzip progress tracking to work. - connection.setRequestProperty("Accept-Encoding", "gzip"); - - // Handle the other headers - if (headers != null) { - addHeadersToRequest(connection, headers); - } - - connection.connect(); - - if (connection.getContentEncoding() == null || connection.getContentEncoding().equalsIgnoreCase("gzip")) { - // Only trust content-length header if we understand - // the encoding -- identity or gzip - progress.setLengthComputable(true); - progress.setTotal(connection.getContentLength()); - } - inputStream = getInputStream(connection); - } - - try { - synchronized (context) { - if (context.aborted) { - return; - } - context.currentInputStream = inputStream; - } - - // write bytes to file - byte[] buffer = new byte[MAX_BUFFER_SIZE]; - int bytesRead = 0; - while ((bytesRead = inputStream.read(buffer)) > 0) { - outputStream.write(buffer, 0, bytesRead); - // Send a progress event. - progress.setLoaded(inputStream.getTotalRawBytesRead()); - PluginResult progressResult = new PluginResult(PluginResult.Status.OK, progress.toJSONObject()); - progressResult.setKeepCallback(true); - context.sendPluginResult(progressResult); - } - } finally { - context.currentInputStream = null; - safeClose(inputStream); - safeClose(outputStream); - } - - Log.d(LOG_TAG, "Saved file: " + target); - - // create FileEntry object - JSONObject fileEntry = FileUtils.getEntry(file); - - result = new PluginResult(PluginResult.Status.OK, fileEntry); - } catch (FileNotFoundException e) { - JSONObject error = createFileTransferError(FILE_NOT_FOUND_ERR, source, target, connection); - Log.e(LOG_TAG, error.toString(), e); - result = new PluginResult(PluginResult.Status.IO_EXCEPTION, error); - } catch (IOException e) { - JSONObject error = createFileTransferError(CONNECTION_ERR, source, target, connection); - Log.e(LOG_TAG, error.toString(), e); - result = new PluginResult(PluginResult.Status.IO_EXCEPTION, error); - } catch (JSONException e) { - Log.e(LOG_TAG, e.getMessage(), e); - result = new PluginResult(PluginResult.Status.JSON_EXCEPTION); - } catch (Throwable e) { - JSONObject error = createFileTransferError(CONNECTION_ERR, source, target, connection); - Log.e(LOG_TAG, error.toString(), e); - result = new PluginResult(PluginResult.Status.IO_EXCEPTION, error); - } finally { - safeClose(outputStream); - synchronized (activeRequests) { - activeRequests.remove(objectId); - } - - if (connection != null) { - // Revert back to the proper verifier and socket factories - if (trustEveryone && useHttps) { - HttpsURLConnection https = (HttpsURLConnection) connection; - https.setHostnameVerifier(oldHostnameVerifier); - https.setSSLSocketFactory(oldSocketFactory); - } - } - - if (result == null) { - result = new PluginResult(PluginResult.Status.ERROR, createFileTransferError(CONNECTION_ERR, source, target, connection)); - } - // Remove incomplete download. - if (result.getStatus() != PluginResult.Status.OK.ordinal() && file != null) { - file.delete(); - } - context.sendPluginResult(result); - } - } - }); - } - - /** - * Abort an ongoing upload or download. - */ - private void abort(String objectId) { - final RequestContext context; - synchronized (activeRequests) { - context = activeRequests.remove(objectId); - } - if (context != null) { - File file = context.targetFile; - if (file != null) { - file.delete(); - } - // Trigger the abort callback immediately to minimize latency between it and abort() being called. - JSONObject error = createFileTransferError(ABORTED_ERR, context.source, context.target, null, -1); - synchronized (context) { - context.sendPluginResult(new PluginResult(PluginResult.Status.ERROR, error)); - context.aborted = true; - } - // Closing the streams can block, so execute on a background thread. - cordova.getThreadPool().execute(new Runnable() { - public void run() { - synchronized (context) { - safeClose(context.currentInputStream); - safeClose(context.currentOutputStream); - } - } - }); - } - } -} diff --git a/plugins/org.apache.cordova.core.file-transfer/src/android/FileUploadResult.java b/plugins/org.apache.cordova.core.file-transfer/src/android/FileUploadResult.java deleted file mode 100644 index f0fbde9..0000000 --- a/plugins/org.apache.cordova.core.file-transfer/src/android/FileUploadResult.java +++ /dev/null @@ -1,73 +0,0 @@ -/* - Licensed to the Apache Software Foundation (ASF) under one - or more contributor license agreements. See the NOTICE file - distributed with this work for additional information - regarding copyright ownership. The ASF licenses this file - to you under the Apache License, Version 2.0 (the - "License"); you may not use this file except in compliance - with the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, - software distributed under the License is distributed on an - "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - KIND, either express or implied. See the License for the - specific language governing permissions and limitations - under the License. -*/ -package org.apache.cordova.core; - -import org.json.JSONException; -import org.json.JSONObject; - -/** - * Encapsulates the result and/or status of uploading a file to a remote server. - */ -public class FileUploadResult { - - private long bytesSent = 0; // bytes sent - private int responseCode = -1; // HTTP response code - private String response = null; // HTTP response - private String objectId = null; // FileTransfer object id - - public long getBytesSent() { - return bytesSent; - } - - public void setBytesSent(long bytes) { - this.bytesSent = bytes; - } - - public int getResponseCode() { - return responseCode; - } - - public void setResponseCode(int responseCode) { - this.responseCode = responseCode; - } - - public String getResponse() { - return response; - } - - public void setResponse(String response) { - this.response = response; - } - - public String getObjectId() { - return objectId; - } - - public void setObjectId(String objectId) { - this.objectId = objectId; - } - - public JSONObject toJSONObject() throws JSONException { - return new JSONObject( - "{bytesSent:" + bytesSent + - ",responseCode:" + responseCode + - ",response:" + JSONObject.quote(response) + - ",objectId:" + JSONObject.quote(objectId) + "}"); - } -} diff --git a/plugins/org.apache.cordova.core.file-transfer/src/ios/CDVFileTransfer.h b/plugins/org.apache.cordova.core.file-transfer/src/ios/CDVFileTransfer.h deleted file mode 100644 index 2231ee3..0000000 --- a/plugins/org.apache.cordova.core.file-transfer/src/ios/CDVFileTransfer.h +++ /dev/null @@ -1,82 +0,0 @@ -/* - Licensed to the Apache Software Foundation (ASF) under one - or more contributor license agreements. See the NOTICE file - distributed with this work for additional information - regarding copyright ownership. The ASF licenses this file - to you under the Apache License, Version 2.0 (the - "License"); you may not use this file except in compliance - with the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, - software distributed under the License is distributed on an - "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - KIND, either express or implied. See the License for the - specific language governing permissions and limitations - under the License. - */ - -#import -#import - -enum CDVFileTransferError { - FILE_NOT_FOUND_ERR = 1, - INVALID_URL_ERR = 2, - CONNECTION_ERR = 3, - CONNECTION_ABORTED = 4 -}; -typedef int CDVFileTransferError; - -enum CDVFileTransferDirection { - CDV_TRANSFER_UPLOAD = 1, - CDV_TRANSFER_DOWNLOAD = 2, -}; -typedef int CDVFileTransferDirection; - -// Magic value within the options dict used to set a cookie. -extern NSString* const kOptionsKeyCookie; - -@interface CDVFileTransfer : CDVPlugin {} - -- (void)upload:(CDVInvokedUrlCommand*)command; -- (void)download:(CDVInvokedUrlCommand*)command; -- (NSString*)escapePathComponentForUrlString:(NSString*)urlString; - -// Visible for testing. -- (NSURLRequest*)requestForUploadCommand:(CDVInvokedUrlCommand*)command fileData:(NSData*)fileData; -- (NSMutableDictionary*)createFileTransferError:(int)code AndSource:(NSString*)source AndTarget:(NSString*)target; - -- (NSMutableDictionary*)createFileTransferError:(int)code - AndSource:(NSString*)source - AndTarget:(NSString*)target - AndHttpStatus:(int)httpStatus - AndBody:(NSString*)body; -@property (readonly) NSMutableDictionary* activeTransfers; -@property (nonatomic, assign) UIBackgroundTaskIdentifier backgroundTaskID; -@end - -@class CDVFileTransferEntityLengthRequest; - -@interface CDVFileTransferDelegate : NSObject {} - -- (void)updateBytesExpected:(NSInteger)newBytesExpected; -- (void)cancelTransfer:(NSURLConnection*)connection; - -@property (strong) NSMutableData* responseData; // atomic -@property (nonatomic, strong) CDVFileTransfer* command; -@property (nonatomic, assign) CDVFileTransferDirection direction; -@property (nonatomic, strong) NSURLConnection* connection; -@property (nonatomic, copy) NSString* callbackId; -@property (nonatomic, copy) NSString* objectId; -@property (nonatomic, copy) NSString* source; -@property (nonatomic, copy) NSString* target; -@property (nonatomic, copy) NSString* mimeType; -@property (assign) int responseCode; // atomic -@property (nonatomic, assign) NSInteger bytesTransfered; -@property (nonatomic, assign) NSInteger bytesExpected; -@property (nonatomic, assign) BOOL trustAllHosts; -@property (strong) NSFileHandle* targetFileHandle; -@property (nonatomic, strong) CDVFileTransferEntityLengthRequest* entityLengthRequest; - -@end; diff --git a/plugins/org.apache.cordova.core.file-transfer/src/ios/CDVFileTransfer.m b/plugins/org.apache.cordova.core.file-transfer/src/ios/CDVFileTransfer.m deleted file mode 100644 index 92070d1..0000000 --- a/plugins/org.apache.cordova.core.file-transfer/src/ios/CDVFileTransfer.m +++ /dev/null @@ -1,732 +0,0 @@ -/* - Licensed to the Apache Software Foundation (ASF) under one - or more contributor license agreements. See the NOTICE file - distributed with this work for additional information - regarding copyright ownership. The ASF licenses this file - to you under the Apache License, Version 2.0 (the - "License"); you may not use this file except in compliance - with the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, - software distributed under the License is distributed on an - "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - KIND, either express or implied. See the License for the - specific language governing permissions and limitations - under the License. - */ - -#import -#import "CDVFileTransfer.h" -#import "CDVFile.h" - -#import -#import -#import -#import - -@interface CDVFileTransfer () -// Sets the requests headers for the request. -- (void)applyRequestHeaders:(NSDictionary*)headers toRequest:(NSMutableURLRequest*)req; -// Creates a delegate to handle an upload. -- (CDVFileTransferDelegate*)delegateForUploadCommand:(CDVInvokedUrlCommand*)command; -// Creates an NSData* for the file for the given upload arguments. -- (void)fileDataForUploadCommand:(CDVInvokedUrlCommand*)command; -@end - -// Buffer size to use for streaming uploads. -static const NSUInteger kStreamBufferSize = 32768; -// Magic value within the options dict used to set a cookie. -NSString* const kOptionsKeyCookie = @"__cookie"; -// Form boundary for multi-part requests. -NSString* const kFormBoundary = @"+++++org.apache.cordova.formBoundary"; - -// Writes the given data to the stream in a blocking way. -// If successful, returns bytesToWrite. -// If the stream was closed on the other end, returns 0. -// If there was an error, returns -1. -static CFIndex WriteDataToStream(NSData* data, CFWriteStreamRef stream) -{ - UInt8* bytes = (UInt8*)[data bytes]; - NSUInteger bytesToWrite = [data length]; - NSUInteger totalBytesWritten = 0; - - while (totalBytesWritten < bytesToWrite) { - CFIndex result = CFWriteStreamWrite(stream, - bytes + totalBytesWritten, - bytesToWrite - totalBytesWritten); - if (result < 0) { - CFStreamError error = CFWriteStreamGetError(stream); - NSLog(@"WriteStreamError domain: %ld error: %ld", error.domain, error.error); - return result; - } else if (result == 0) { - return result; - } - totalBytesWritten += result; - } - - return totalBytesWritten; -} - -@implementation CDVFileTransfer -@synthesize activeTransfers; - -- (NSString*)escapePathComponentForUrlString:(NSString*)urlString -{ - NSRange schemeAndHostRange = [urlString rangeOfString:@"://.*?/" options:NSRegularExpressionSearch]; - - if (schemeAndHostRange.length == 0) { - return urlString; - } - - NSInteger schemeAndHostEndIndex = NSMaxRange(schemeAndHostRange); - NSString* schemeAndHost = [urlString substringToIndex:schemeAndHostEndIndex]; - NSString* pathComponent = [urlString substringFromIndex:schemeAndHostEndIndex]; - pathComponent = [pathComponent stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]; - - return [schemeAndHost stringByAppendingString:pathComponent]; -} - -- (void)applyRequestHeaders:(NSDictionary*)headers toRequest:(NSMutableURLRequest*)req -{ - [req setValue:@"XMLHttpRequest" forHTTPHeaderField:@"X-Requested-With"]; - - NSString* userAgent = [self.commandDelegate userAgent]; - if (userAgent) { - [req setValue:userAgent forHTTPHeaderField:@"User-Agent"]; - } - - for (NSString* headerName in headers) { - id value = [headers objectForKey:headerName]; - if (!value || (value == [NSNull null])) { - value = @"null"; - } - - // First, remove an existing header if one exists. - [req setValue:nil forHTTPHeaderField:headerName]; - - if (![value isKindOfClass:[NSArray class]]) { - value = [NSArray arrayWithObject:value]; - } - - // Then, append all header values. - for (id __strong subValue in value) { - // Convert from an NSNumber -> NSString. - if ([subValue respondsToSelector:@selector(stringValue)]) { - subValue = [subValue stringValue]; - } - if ([subValue isKindOfClass:[NSString class]]) { - [req addValue:subValue forHTTPHeaderField:headerName]; - } - } - } -} - -- (NSURLRequest*)requestForUploadCommand:(CDVInvokedUrlCommand*)command fileData:(NSData*)fileData -{ - // arguments order from js: [filePath, server, fileKey, fileName, mimeType, params, debug, chunkedMode] - // however, params is a JavaScript object and during marshalling is put into the options dict, - // thus debug and chunkedMode are the 6th and 7th arguments - NSString* target = [command argumentAtIndex:0]; - NSString* server = [command argumentAtIndex:1]; - NSString* fileKey = [command argumentAtIndex:2 withDefault:@"file"]; - NSString* fileName = [command argumentAtIndex:3 withDefault:@"no-filename"]; - NSString* mimeType = [command argumentAtIndex:4 withDefault:nil]; - NSDictionary* options = [command argumentAtIndex:5 withDefault:nil]; - // BOOL trustAllHosts = [[arguments objectAtIndex:6 withDefault:[NSNumber numberWithBool:YES]] boolValue]; // allow self-signed certs - BOOL chunkedMode = [[command argumentAtIndex:7 withDefault:[NSNumber numberWithBool:YES]] boolValue]; - NSDictionary* headers = [command argumentAtIndex:8 withDefault:nil]; - // Allow alternative http method, default to POST. JS side checks - // for allowed methods, currently PUT or POST (forces POST for - // unrecognised values) - NSString* httpMethod = [command argumentAtIndex:10 withDefault:@"POST"]; - CDVPluginResult* result = nil; - CDVFileTransferError errorCode = 0; - - // NSURL does not accepts URLs with spaces in the path. We escape the path in order - // to be more lenient. - NSURL* url = [NSURL URLWithString:server]; - - if (!url) { - errorCode = INVALID_URL_ERR; - NSLog(@"File Transfer Error: Invalid server URL %@", server); - } else if (!fileData) { - errorCode = FILE_NOT_FOUND_ERR; - } - - if (errorCode > 0) { - result = [CDVPluginResult resultWithStatus:CDVCommandStatus_ERROR messageAsDictionary:[self createFileTransferError:errorCode AndSource:target AndTarget:server]]; - [self.commandDelegate sendPluginResult:result callbackId:command.callbackId]; - return nil; - } - - NSMutableURLRequest* req = [NSMutableURLRequest requestWithURL:url]; - - [req setHTTPMethod:httpMethod]; - - // Magic value to set a cookie - if ([options objectForKey:kOptionsKeyCookie]) { - [req setValue:[options objectForKey:kOptionsKeyCookie] forHTTPHeaderField:@"Cookie"]; - [req setHTTPShouldHandleCookies:NO]; - } - - NSString* contentType = [NSString stringWithFormat:@"multipart/form-data; boundary=%@", kFormBoundary]; - [req setValue:contentType forHTTPHeaderField:@"Content-Type"]; - [self applyRequestHeaders:headers toRequest:req]; - - NSData* formBoundaryData = [[NSString stringWithFormat:@"--%@\r\n", kFormBoundary] dataUsingEncoding:NSUTF8StringEncoding]; - NSMutableData* postBodyBeforeFile = [NSMutableData data]; - - for (NSString* key in options) { - id val = [options objectForKey:key]; - if (!val || (val == [NSNull null]) || [key isEqualToString:kOptionsKeyCookie]) { - continue; - } - // if it responds to stringValue selector (eg NSNumber) get the NSString - if ([val respondsToSelector:@selector(stringValue)]) { - val = [val stringValue]; - } - // finally, check whether it is a NSString (for dataUsingEncoding selector below) - if (![val isKindOfClass:[NSString class]]) { - continue; - } - - [postBodyBeforeFile appendData:formBoundaryData]; - [postBodyBeforeFile appendData:[[NSString stringWithFormat:@"Content-Disposition: form-data; name=\"%@\"\r\n\r\n", key] dataUsingEncoding:NSUTF8StringEncoding]]; - [postBodyBeforeFile appendData:[val dataUsingEncoding:NSUTF8StringEncoding]]; - [postBodyBeforeFile appendData:[@"\r\n" dataUsingEncoding : NSUTF8StringEncoding]]; - } - - [postBodyBeforeFile appendData:formBoundaryData]; - [postBodyBeforeFile appendData:[[NSString stringWithFormat:@"Content-Disposition: form-data; name=\"%@\"; filename=\"%@\"\r\n", fileKey, fileName] dataUsingEncoding:NSUTF8StringEncoding]]; - if (mimeType != nil) { - [postBodyBeforeFile appendData:[[NSString stringWithFormat:@"Content-Type: %@\r\n", mimeType] dataUsingEncoding:NSUTF8StringEncoding]]; - } - [postBodyBeforeFile appendData:[[NSString stringWithFormat:@"Content-Length: %d\r\n\r\n", [fileData length]] dataUsingEncoding:NSUTF8StringEncoding]]; - - DLog(@"fileData length: %d", [fileData length]); - NSData* postBodyAfterFile = [[NSString stringWithFormat:@"\r\n--%@--\r\n", kFormBoundary] dataUsingEncoding:NSUTF8StringEncoding]; - - NSUInteger totalPayloadLength = [postBodyBeforeFile length] + [fileData length] + [postBodyAfterFile length]; - [req setValue:[[NSNumber numberWithInteger:totalPayloadLength] stringValue] forHTTPHeaderField:@"Content-Length"]; - - if (chunkedMode) { - CFReadStreamRef readStream = NULL; - CFWriteStreamRef writeStream = NULL; - CFStreamCreateBoundPair(NULL, &readStream, &writeStream, kStreamBufferSize); - [req setHTTPBodyStream:CFBridgingRelease(readStream)]; - - self.backgroundTaskID = [[UIApplication sharedApplication] beginBackgroundTaskWithExpirationHandler:^{ - [[UIApplication sharedApplication] endBackgroundTask:self.backgroundTaskID]; - self.backgroundTaskID = UIBackgroundTaskInvalid; - NSLog(@"Background task to upload media finished."); - }]; - - [self.commandDelegate runInBackground:^{ - if (CFWriteStreamOpen(writeStream)) { - NSData* chunks[] = {postBodyBeforeFile, fileData, postBodyAfterFile}; - int numChunks = sizeof(chunks) / sizeof(chunks[0]); - - for (int i = 0; i < numChunks; ++i) { - CFIndex result = WriteDataToStream(chunks[i], writeStream); - if (result <= 0) { - break; - } - } - } else { - NSLog(@"FileTransfer: Failed to open writeStream"); - } - CFWriteStreamClose(writeStream); - CFRelease(writeStream); - }]; - } else { - [postBodyBeforeFile appendData:fileData]; - [postBodyBeforeFile appendData:postBodyAfterFile]; - [req setHTTPBody:postBodyBeforeFile]; - } - return req; -} - -- (CDVFileTransferDelegate*)delegateForUploadCommand:(CDVInvokedUrlCommand*)command -{ - NSString* source = [command.arguments objectAtIndex:0]; - NSString* server = [command.arguments objectAtIndex:1]; - BOOL trustAllHosts = [[command.arguments objectAtIndex:6 withDefault:[NSNumber numberWithBool:YES]] boolValue]; // allow self-signed certs - NSString* objectId = [command.arguments objectAtIndex:9]; - - CDVFileTransferDelegate* delegate = [[CDVFileTransferDelegate alloc] init]; - - delegate.command = self; - delegate.callbackId = command.callbackId; - delegate.direction = CDV_TRANSFER_UPLOAD; - delegate.objectId = objectId; - delegate.source = source; - delegate.target = server; - delegate.trustAllHosts = trustAllHosts; - - return delegate; -} - -- (void)fileDataForUploadCommand:(CDVInvokedUrlCommand*)command -{ - NSString* target = (NSString*)[command.arguments objectAtIndex:0]; - NSError* __autoreleasing err = nil; - - // return unsupported result for assets-library URLs - if ([target hasPrefix:kCDVAssetsLibraryPrefix]) { - // Instead, we return after calling the asynchronous method and send `result` in each of the blocks. - ALAssetsLibraryAssetForURLResultBlock resultBlock = ^(ALAsset* asset) { - if (asset) { - // We have the asset! Get the data and send it off. - ALAssetRepresentation* assetRepresentation = [asset defaultRepresentation]; - Byte* buffer = (Byte*)malloc([assetRepresentation size]); - NSUInteger bufferSize = [assetRepresentation getBytes:buffer fromOffset:0.0 length:[assetRepresentation size] error:nil]; - NSData* fileData = [NSData dataWithBytesNoCopy:buffer length:bufferSize freeWhenDone:YES]; - [self uploadData:fileData command:command]; - } else { - // We couldn't find the asset. Send the appropriate error. - CDVPluginResult* result = [CDVPluginResult resultWithStatus:CDVCommandStatus_IO_EXCEPTION messageAsInt:NOT_FOUND_ERR]; - [self.commandDelegate sendPluginResult:result callbackId:command.callbackId]; - } - }; - ALAssetsLibraryAccessFailureBlock failureBlock = ^(NSError* error) { - // Retrieving the asset failed for some reason. Send the appropriate error. - CDVPluginResult* result = [CDVPluginResult resultWithStatus:CDVCommandStatus_IO_EXCEPTION messageAsString:[error localizedDescription]]; - [self.commandDelegate sendPluginResult:result callbackId:command.callbackId]; - }; - - ALAssetsLibrary* assetsLibrary = [[ALAssetsLibrary alloc] init]; - [assetsLibrary assetForURL:[NSURL URLWithString:target] resultBlock:resultBlock failureBlock:failureBlock]; - return; - } else { - // Extract the path part out of a file: URL. - NSString* filePath = [target hasPrefix:@"/"] ? [target copy] : [[NSURL URLWithString:target] path]; - if (filePath == nil) { - // We couldn't find the asset. Send the appropriate error. - CDVPluginResult* result = [CDVPluginResult resultWithStatus:CDVCommandStatus_IO_EXCEPTION messageAsInt:NOT_FOUND_ERR]; - [self.commandDelegate sendPluginResult:result callbackId:command.callbackId]; - return; - } - - // Memory map the file so that it can be read efficiently even if it is large. - NSData* fileData = [NSData dataWithContentsOfFile:filePath options:NSDataReadingMappedIfSafe error:&err]; - - if (err != nil) { - NSLog(@"Error opening file %@: %@", target, err); - } - [self uploadData:fileData command:command]; - } -} - -- (void)upload:(CDVInvokedUrlCommand*)command -{ - // fileData and req are split into helper functions to ease the unit testing of delegateForUpload. - // First, get the file data. This method will call `uploadData:command`. - [self fileDataForUploadCommand:command]; -} - -- (void)uploadData:(NSData*)fileData command:(CDVInvokedUrlCommand*)command -{ - NSURLRequest* req = [self requestForUploadCommand:command fileData:fileData]; - - if (req == nil) { - return; - } - CDVFileTransferDelegate* delegate = [self delegateForUploadCommand:command]; - [NSURLConnection connectionWithRequest:req delegate:delegate]; - - if (activeTransfers == nil) { - activeTransfers = [[NSMutableDictionary alloc] init]; - } - - [activeTransfers setObject:delegate forKey:delegate.objectId]; -} - -- (void)abort:(CDVInvokedUrlCommand*)command -{ - NSString* objectId = [command.arguments objectAtIndex:0]; - - CDVFileTransferDelegate* delegate = [activeTransfers objectForKey:objectId]; - - if (delegate != nil) { - [delegate cancelTransfer:delegate.connection]; - CDVPluginResult* result = [CDVPluginResult resultWithStatus:CDVCommandStatus_ERROR messageAsDictionary:[self createFileTransferError:CONNECTION_ABORTED AndSource:delegate.source AndTarget:delegate.target]]; - [self.commandDelegate sendPluginResult:result callbackId:delegate.callbackId]; - } -} - -- (void)download:(CDVInvokedUrlCommand*)command -{ - DLog(@"File Transfer downloading file..."); - NSString* sourceUrl = [command.arguments objectAtIndex:0]; - NSString* filePath = [command.arguments objectAtIndex:1]; - BOOL trustAllHosts = [[command.arguments objectAtIndex:2 withDefault:[NSNumber numberWithBool:YES]] boolValue]; // allow self-signed certs - NSString* objectId = [command.arguments objectAtIndex:3]; - NSDictionary* headers = [command.arguments objectAtIndex:4 withDefault:nil]; - - // return unsupported result for assets-library URLs - if ([filePath hasPrefix:kCDVAssetsLibraryPrefix]) { - CDVPluginResult* result = [CDVPluginResult resultWithStatus:CDVCommandStatus_MALFORMED_URL_EXCEPTION messageAsString:@"download not supported for assets-library URLs."]; - [self.commandDelegate sendPluginResult:result callbackId:command.callbackId]; - return; - } - - CDVPluginResult* result = nil; - CDVFileTransferError errorCode = 0; - - NSURL* file; - - if ([filePath hasPrefix:@"/"]) { - file = [NSURL fileURLWithPath:filePath]; - } else { - file = [NSURL URLWithString:filePath]; - } - - NSURL* url = [NSURL URLWithString:sourceUrl]; - - if (!url) { - errorCode = INVALID_URL_ERR; - NSLog(@"File Transfer Error: Invalid server URL %@", sourceUrl); - } else if (![file isFileURL]) { - errorCode = FILE_NOT_FOUND_ERR; - NSLog(@"File Transfer Error: Invalid file path or URL %@", filePath); - } - - if (errorCode > 0) { - result = [CDVPluginResult resultWithStatus:CDVCommandStatus_ERROR messageAsDictionary:[self createFileTransferError:errorCode AndSource:sourceUrl AndTarget:filePath]]; - [self.commandDelegate sendPluginResult:result callbackId:command.callbackId]; - return; - } - - NSMutableURLRequest* req = [NSMutableURLRequest requestWithURL:url]; - [self applyRequestHeaders:headers toRequest:req]; - - CDVFileTransferDelegate* delegate = [[CDVFileTransferDelegate alloc] init]; - delegate.command = self; - delegate.direction = CDV_TRANSFER_DOWNLOAD; - delegate.callbackId = command.callbackId; - delegate.objectId = objectId; - delegate.source = sourceUrl; - delegate.target = filePath; - delegate.trustAllHosts = trustAllHosts; - - delegate.connection = [NSURLConnection connectionWithRequest:req delegate:delegate]; - - if (activeTransfers == nil) { - activeTransfers = [[NSMutableDictionary alloc] init]; - } - - [activeTransfers setObject:delegate forKey:delegate.objectId]; -} - -- (NSMutableDictionary*)createFileTransferError:(int)code AndSource:(NSString*)source AndTarget:(NSString*)target -{ - NSMutableDictionary* result = [NSMutableDictionary dictionaryWithCapacity:3]; - - [result setObject:[NSNumber numberWithInt:code] forKey:@"code"]; - if (source != nil) { - [result setObject:source forKey:@"source"]; - } - if (target != nil) { - [result setObject:target forKey:@"target"]; - } - NSLog(@"FileTransferError %@", result); - - return result; -} - -- (NSMutableDictionary*)createFileTransferError:(int)code - AndSource:(NSString*)source - AndTarget:(NSString*)target - AndHttpStatus:(int)httpStatus - AndBody:(NSString*)body -{ - NSMutableDictionary* result = [NSMutableDictionary dictionaryWithCapacity:5]; - - [result setObject:[NSNumber numberWithInt:code] forKey:@"code"]; - if (source != nil) { - [result setObject:source forKey:@"source"]; - } - if (target != nil) { - [result setObject:target forKey:@"target"]; - } - [result setObject:[NSNumber numberWithInt:httpStatus] forKey:@"http_status"]; - if (body != nil) { - [result setObject:body forKey:@"body"]; - } - NSLog(@"FileTransferError %@", result); - - return result; -} - -- (void)onReset -{ - for (CDVFileTransferDelegate* delegate in [activeTransfers allValues]) { - [delegate.connection cancel]; - } - - [activeTransfers removeAllObjects]; -} - -@end - -@interface CDVFileTransferEntityLengthRequest : NSObject { - NSURLConnection* _connection; - CDVFileTransferDelegate* __weak _originalDelegate; -} - -- (CDVFileTransferEntityLengthRequest*)initWithOriginalRequest:(NSURLRequest*)originalRequest andDelegate:(CDVFileTransferDelegate*)originalDelegate; - -@end; - -@implementation CDVFileTransferEntityLengthRequest; - -- (CDVFileTransferEntityLengthRequest*)initWithOriginalRequest:(NSURLRequest*)originalRequest andDelegate:(CDVFileTransferDelegate*)originalDelegate -{ - if (self) { - DLog(@"Requesting entity length for GZIPped content..."); - - NSMutableURLRequest* req = [originalRequest mutableCopy]; - [req setHTTPMethod:@"HEAD"]; - [req setValue:@"identity" forHTTPHeaderField:@"Accept-Encoding"]; - - _originalDelegate = originalDelegate; - _connection = [NSURLConnection connectionWithRequest:req delegate:self]; - } - return self; -} - -- (void)connection:(NSURLConnection*)connection didReceiveResponse:(NSURLResponse*)response -{ - DLog(@"HEAD request returned; content-length is %lld", [response expectedContentLength]); - [_originalDelegate updateBytesExpected:[response expectedContentLength]]; -} - -- (void)connection:(NSURLConnection*)connection didReceiveData:(NSData*)data -{} - -- (void)connectionDidFinishLoading:(NSURLConnection*)connection -{} - -@end - -@implementation CDVFileTransferDelegate - -@synthesize callbackId, connection = _connection, source, target, responseData, command, bytesTransfered, bytesExpected, direction, responseCode, objectId, targetFileHandle; - -- (void)connectionDidFinishLoading:(NSURLConnection*)connection -{ - NSString* uploadResponse = nil; - NSString* downloadResponse = nil; - NSMutableDictionary* uploadResult; - CDVPluginResult* result = nil; - BOOL bDirRequest = NO; - CDVFile* file; - - NSLog(@"File Transfer Finished with response code %d", self.responseCode); - - if (self.direction == CDV_TRANSFER_UPLOAD) { - uploadResponse = [[NSString alloc] initWithData:self.responseData encoding:NSUTF8StringEncoding]; - - if ((self.responseCode >= 200) && (self.responseCode < 300)) { - // create dictionary to return FileUploadResult object - uploadResult = [NSMutableDictionary dictionaryWithCapacity:3]; - if (uploadResponse != nil) { - [uploadResult setObject:uploadResponse forKey:@"response"]; - } - [uploadResult setObject:[NSNumber numberWithInt:self.bytesTransfered] forKey:@"bytesSent"]; - [uploadResult setObject:[NSNumber numberWithInt:self.responseCode] forKey:@"responseCode"]; - result = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsDictionary:uploadResult]; - } else { - result = [CDVPluginResult resultWithStatus:CDVCommandStatus_ERROR messageAsDictionary:[command createFileTransferError:CONNECTION_ERR AndSource:source AndTarget:target AndHttpStatus:self.responseCode AndBody:uploadResponse]]; - } - } - if (self.direction == CDV_TRANSFER_DOWNLOAD) { - if (self.targetFileHandle) { - [self.targetFileHandle closeFile]; - self.targetFileHandle = nil; - DLog(@"File Transfer Download success"); - - file = [[CDVFile alloc] init]; - result = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsDictionary:[file getDirectoryEntry:target isDirectory:bDirRequest]]; - } else { - downloadResponse = [[NSString alloc] initWithData:self.responseData encoding:NSUTF8StringEncoding]; - result = [CDVPluginResult resultWithStatus:CDVCommandStatus_ERROR messageAsDictionary:[command createFileTransferError:CONNECTION_ERR AndSource:source AndTarget:target AndHttpStatus:self.responseCode AndBody:downloadResponse]]; - } - } - - [self.command.commandDelegate sendPluginResult:result callbackId:callbackId]; - - // remove connection for activeTransfers - [command.activeTransfers removeObjectForKey:objectId]; - - // remove background id task in case our upload was done in the background - [[UIApplication sharedApplication] endBackgroundTask:self.command.backgroundTaskID]; - self.command.backgroundTaskID = UIBackgroundTaskInvalid; -} - -- (void)removeTargetFile -{ - NSFileManager* fileMgr = [NSFileManager defaultManager]; - - [fileMgr removeItemAtPath:self.target error:nil]; -} - -- (void)cancelTransfer:(NSURLConnection*)connection -{ - [connection cancel]; - [self.command.activeTransfers removeObjectForKey:self.objectId]; - [self removeTargetFile]; -} - -- (void)cancelTransferWithError:(NSURLConnection*)connection errorMessage:(NSString*)errorMessage -{ - CDVPluginResult* result = [CDVPluginResult resultWithStatus:CDVCommandStatus_IO_EXCEPTION messageAsDictionary:[self.command createFileTransferError:FILE_NOT_FOUND_ERR AndSource:self.source AndTarget:self.target AndHttpStatus:self.responseCode AndBody:errorMessage]]; - - NSLog(@"File Transfer Error: %@", errorMessage); - [self cancelTransfer:connection]; - [self.command.commandDelegate sendPluginResult:result callbackId:callbackId]; -} - -- (void)connection:(NSURLConnection*)connection didReceiveResponse:(NSURLResponse*)response -{ - NSError* __autoreleasing error = nil; - - self.mimeType = [response MIMEType]; - self.targetFileHandle = nil; - - // required for iOS 4.3, for some reason; response is - // a plain NSURLResponse, not the HTTP subclass - if ([response isKindOfClass:[NSHTTPURLResponse class]]) { - NSHTTPURLResponse* httpResponse = (NSHTTPURLResponse*)response; - - self.responseCode = [httpResponse statusCode]; - self.bytesExpected = [response expectedContentLength]; - if ((self.direction == CDV_TRANSFER_DOWNLOAD) && (self.responseCode == 200) && (self.bytesExpected == NSURLResponseUnknownLength)) { - // Kick off HEAD request to server to get real length - // bytesExpected will be updated when that response is returned - self.entityLengthRequest = [[CDVFileTransferEntityLengthRequest alloc] initWithOriginalRequest:connection.currentRequest andDelegate:self]; - } - } else if ([response.URL isFileURL]) { - NSDictionary* attr = [[NSFileManager defaultManager] attributesOfItemAtPath:[response.URL path] error:nil]; - self.responseCode = 200; - self.bytesExpected = [attr[NSFileSize] longLongValue]; - } else { - self.responseCode = 200; - self.bytesExpected = NSURLResponseUnknownLength; - } - if ((self.direction == CDV_TRANSFER_DOWNLOAD) && (self.responseCode >= 200) && (self.responseCode < 300)) { - // Download response is okay; begin streaming output to file - NSString* parentPath = [self.target stringByDeletingLastPathComponent]; - - // create parent directories if needed - if ([[NSFileManager defaultManager] createDirectoryAtPath:parentPath withIntermediateDirectories:YES attributes:nil error:&error] == NO) { - if (error) { - [self cancelTransferWithError:connection errorMessage:[NSString stringWithFormat:@"Could not create path to save downloaded file: %@", [error localizedDescription]]]; - } else { - [self cancelTransferWithError:connection errorMessage:@"Could not create path to save downloaded file"]; - } - return; - } - // create target file - if ([[NSFileManager defaultManager] createFileAtPath:self.target contents:nil attributes:nil] == NO) { - [self cancelTransferWithError:connection errorMessage:@"Could not create target file"]; - return; - } - // open target file for writing - self.targetFileHandle = [NSFileHandle fileHandleForWritingAtPath:self.target]; - if (self.targetFileHandle == nil) { - [self cancelTransferWithError:connection errorMessage:@"Could not open target file for writing"]; - } - DLog(@"Streaming to file %@", target); - } -} - -- (void)connection:(NSURLConnection*)connection didFailWithError:(NSError*)error -{ - NSString* body = [[NSString alloc] initWithData:self.responseData encoding:NSUTF8StringEncoding]; - CDVPluginResult* result = [CDVPluginResult resultWithStatus:CDVCommandStatus_ERROR messageAsDictionary:[command createFileTransferError:CONNECTION_ERR AndSource:source AndTarget:target AndHttpStatus:self.responseCode AndBody:body]]; - - NSLog(@"File Transfer Error: %@", [error localizedDescription]); - - [self cancelTransfer:connection]; - [self.command.commandDelegate sendPluginResult:result callbackId:callbackId]; -} - -- (void)connection:(NSURLConnection*)connection didReceiveData:(NSData*)data -{ - self.bytesTransfered += data.length; - if (self.targetFileHandle) { - [self.targetFileHandle writeData:data]; - } else { - [self.responseData appendData:data]; - } - [self updateProgress]; -} - -- (void)updateBytesExpected:(NSInteger)newBytesExpected -{ - DLog(@"Updating bytesExpected to %d", newBytesExpected); - self.bytesExpected = newBytesExpected; - [self updateProgress]; -} - -- (void)updateProgress -{ - if (self.direction == CDV_TRANSFER_DOWNLOAD) { - BOOL lengthComputable = (self.bytesExpected != NSURLResponseUnknownLength); - // If the response is GZipped, and we have an outstanding HEAD request to get - // the length, then hold off on sending progress events. - if (!lengthComputable && (self.entityLengthRequest != nil)) { - return; - } - NSMutableDictionary* downloadProgress = [NSMutableDictionary dictionaryWithCapacity:3]; - [downloadProgress setObject:[NSNumber numberWithBool:lengthComputable] forKey:@"lengthComputable"]; - [downloadProgress setObject:[NSNumber numberWithInt:self.bytesTransfered] forKey:@"loaded"]; - [downloadProgress setObject:[NSNumber numberWithInt:self.bytesExpected] forKey:@"total"]; - CDVPluginResult* result = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsDictionary:downloadProgress]; - [result setKeepCallbackAsBool:true]; - [self.command.commandDelegate sendPluginResult:result callbackId:callbackId]; - } -} - -- (void)connection:(NSURLConnection*)connection didSendBodyData:(NSInteger)bytesWritten totalBytesWritten:(NSInteger)totalBytesWritten totalBytesExpectedToWrite:(NSInteger)totalBytesExpectedToWrite -{ - if (self.direction == CDV_TRANSFER_UPLOAD) { - NSMutableDictionary* uploadProgress = [NSMutableDictionary dictionaryWithCapacity:3]; - - [uploadProgress setObject:[NSNumber numberWithBool:true] forKey:@"lengthComputable"]; - [uploadProgress setObject:[NSNumber numberWithInt:totalBytesWritten] forKey:@"loaded"]; - [uploadProgress setObject:[NSNumber numberWithInt:totalBytesExpectedToWrite] forKey:@"total"]; - CDVPluginResult* result = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsDictionary:uploadProgress]; - [result setKeepCallbackAsBool:true]; - [self.command.commandDelegate sendPluginResult:result callbackId:callbackId]; - } - self.bytesTransfered = totalBytesWritten; -} - -// for self signed certificates -- (void)connection:(NSURLConnection*)connection willSendRequestForAuthenticationChallenge:(NSURLAuthenticationChallenge*)challenge -{ - if ([challenge.protectionSpace.authenticationMethod isEqualToString:NSURLAuthenticationMethodServerTrust]) { - if (self.trustAllHosts) { - NSURLCredential* credential = [NSURLCredential credentialForTrust:challenge.protectionSpace.serverTrust]; - [challenge.sender useCredential:credential forAuthenticationChallenge:challenge]; - } - [challenge.sender continueWithoutCredentialForAuthenticationChallenge:challenge]; - } else { - [challenge.sender performDefaultHandlingForAuthenticationChallenge:challenge]; - } -} - -- (id)init -{ - if ((self = [super init])) { - self.responseData = [NSMutableData data]; - self.targetFileHandle = nil; - } - return self; -} - -@end; diff --git a/plugins/org.apache.cordova.core.file-transfer/src/wp/FileTransfer.cs b/plugins/org.apache.cordova.core.file-transfer/src/wp/FileTransfer.cs deleted file mode 100644 index a04e949..0000000 --- a/plugins/org.apache.cordova.core.file-transfer/src/wp/FileTransfer.cs +++ /dev/null @@ -1,650 +0,0 @@ -/* - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -using System; -using System.Collections.Generic; -using System.IO; -using System.IO.IsolatedStorage; -using System.Net; -using System.Runtime.Serialization; -using System.Windows; -using System.Security; -using System.Diagnostics; - -namespace WPCordovaClassLib.Cordova.Commands -{ - public class FileTransfer : BaseCommand - { - public class DownloadRequestState - { - // This class stores the State of the request. - public HttpWebRequest request; - public TransferOptions options; - - public DownloadRequestState() - { - request = null; - options = null; - } - } - - - public class TransferOptions - { - /// File path to upload OR File path to download to - public string FilePath { get; set; } - - public string Url { get; set; } - /// Flag to recognize if we should trust every host (only in debug environments) - public bool TrustAllHosts { get; set; } - public string Id { get; set; } - public string Headers { get; set; } - public string CallbackId { get; set; } - public bool ChunkedMode { get; set; } - /// Server address - public string Server { get; set; } - /// File key - public string FileKey { get; set; } - /// File name on the server - public string FileName { get; set; } - /// File Mime type - public string MimeType { get; set; } - /// Additional options - public string Params { get; set; } - public string Method { get; set; } - - public TransferOptions() - { - FileKey = "file"; - FileName = "image.jpg"; - MimeType = "image/jpeg"; - } - } - - /// - /// Boundary symbol - /// - private string Boundary = "----------------------------" + DateTime.Now.Ticks.ToString("x"); - - // Error codes - public const int FileNotFoundError = 1; - public const int InvalidUrlError = 2; - public const int ConnectionError = 3; - public const int AbortError = 4; // not really an error, but whatevs - - private static Dictionary InProcDownloads = new Dictionary(); - - - /// - /// Uploading response info - /// - [DataContract] - public class FileUploadResult - { - /// - /// Amount of sent bytes - /// - [DataMember(Name = "bytesSent")] - public long BytesSent { get; set; } - - /// - /// Server response code - /// - [DataMember(Name = "responseCode")] - public long ResponseCode { get; set; } - - /// - /// Server response - /// - [DataMember(Name = "response", EmitDefaultValue = false)] - public string Response { get; set; } - - /// - /// Creates FileUploadResult object with response values - /// - /// Amount of sent bytes - /// Server response code - /// Server response - public FileUploadResult(long bytesSent, long responseCode, string response) - { - this.BytesSent = bytesSent; - this.ResponseCode = responseCode; - this.Response = response; - } - } - /// - /// Represents transfer error codes for callback - /// - [DataContract] - public class FileTransferError - { - /// - /// Error code - /// - [DataMember(Name = "code", IsRequired = true)] - public int Code { get; set; } - - /// - /// The source URI - /// - [DataMember(Name = "source", IsRequired = true)] - public string Source { get; set; } - - /// - /// The target URI - /// - /// - [DataMember(Name = "target", IsRequired = true)] - public string Target { get; set; } - - [DataMember(Name = "body", IsRequired = true)] - public string Body { get; set; } - - /// - /// The http status code response from the remote URI - /// - [DataMember(Name = "http_status", IsRequired = true)] - public int HttpStatus { get; set; } - - /// - /// Creates FileTransferError object - /// - /// Error code - public FileTransferError(int errorCode) - { - this.Code = errorCode; - this.Source = null; - this.Target = null; - this.HttpStatus = 0; - this.Body = ""; - } - public FileTransferError(int errorCode, string source, string target, int status, string body = "") - { - this.Code = errorCode; - this.Source = source; - this.Target = target; - this.HttpStatus = status; - this.Body = body; - } - } - - /// - /// Upload options - /// - //private TransferOptions uploadOptions; - - /// - /// Bytes sent - /// - private long bytesSent; - - /// - /// sends a file to a server - /// - /// Upload options - /// exec(win, fail, 'FileTransfer', 'upload', [filePath, server, fileKey, fileName, mimeType, params, trustAllHosts, chunkedMode, headers, this._id, httpMethod]); - public void upload(string options) - { - options = options.Replace("{}", ""); // empty objects screw up the Deserializer - string callbackId = ""; - - TransferOptions uploadOptions = null; - HttpWebRequest webRequest = null; - - try - { - try - { - string[] args = JSON.JsonHelper.Deserialize(options); - uploadOptions = new TransferOptions(); - uploadOptions.FilePath = args[0]; - uploadOptions.Server = args[1]; - uploadOptions.FileKey = args[2]; - uploadOptions.FileName = args[3]; - uploadOptions.MimeType = args[4]; - uploadOptions.Params = args[5]; - - - bool trustAll = false; - bool.TryParse(args[6],out trustAll); - uploadOptions.TrustAllHosts = trustAll; - - bool doChunked = false; - bool.TryParse(args[7], out doChunked); - uploadOptions.ChunkedMode = doChunked; - - //8 : Headers - //9 : id - //10: method - - uploadOptions.Headers = args[8]; - uploadOptions.Id = args[9]; - uploadOptions.Method = args[10]; - - uploadOptions.CallbackId = callbackId = args[11]; - } - catch (Exception) - { - DispatchCommandResult(new PluginResult(PluginResult.Status.JSON_EXCEPTION)); - return; - } - - Uri serverUri; - try - { - serverUri = new Uri(uploadOptions.Server); - } - catch (Exception) - { - DispatchCommandResult(new PluginResult(PluginResult.Status.ERROR, new FileTransferError(InvalidUrlError, uploadOptions.Server, null, 0))); - return; - } - webRequest = (HttpWebRequest)WebRequest.Create(serverUri); - webRequest.ContentType = "multipart/form-data;boundary=" + Boundary; - webRequest.Method = uploadOptions.Method; - - if (!string.IsNullOrEmpty(uploadOptions.Headers)) - { - Dictionary headers = parseHeaders(uploadOptions.Headers); - foreach (string key in headers.Keys) - { - webRequest.Headers[key] = headers[key]; - } - } - - DownloadRequestState reqState = new DownloadRequestState(); - reqState.options = uploadOptions; - reqState.request = webRequest; - - InProcDownloads[uploadOptions.Id] = reqState; - - - webRequest.BeginGetRequestStream(WriteCallback, reqState); - } - catch (Exception ex) - { - - DispatchCommandResult(new PluginResult(PluginResult.Status.ERROR, new FileTransferError(ConnectionError)),callbackId); - - - } - } - - // example : "{\"Authorization\":\"Basic Y29yZG92YV91c2VyOmNvcmRvdmFfcGFzc3dvcmQ=\"}" - protected Dictionary parseHeaders(string jsonHeaders) - { - Dictionary result = new Dictionary(); - - string temp = jsonHeaders.StartsWith("{") ? jsonHeaders.Substring(1) : jsonHeaders; - temp = temp.EndsWith("}") ? temp.Substring(0,temp.Length - 1) : temp; - // "\"Authorization\":\"Basic Y29yZG92YV91c2VyOmNvcmRvdmFfcGFzc3dvcmQ=\"" - - string[] strHeaders = temp.Split(','); - for (int n = 0; n < strHeaders.Length; n++) - { - string[] split = strHeaders[n].Split(':'); - if (split.Length == 2) - { - split[0] = JSON.JsonHelper.Deserialize(split[0]); - split[1] = JSON.JsonHelper.Deserialize(split[1]); - result[split[0]] = split[1]; - } - } - return result; - } - - public void download(string options) - { - TransferOptions downloadOptions = null; - HttpWebRequest webRequest = null; - string callbackId; - - try - { - string[] optionStrings = JSON.JsonHelper.Deserialize(options); - - downloadOptions = new TransferOptions(); - downloadOptions.Url = optionStrings[0]; - downloadOptions.FilePath = optionStrings[1]; - - bool trustAll = false; - bool.TryParse(optionStrings[2],out trustAll); - downloadOptions.TrustAllHosts = trustAll; - - downloadOptions.Id = optionStrings[3]; - downloadOptions.Headers = optionStrings[4]; - downloadOptions.CallbackId = callbackId = optionStrings[5]; - - } - catch (Exception) - { - DispatchCommandResult(new PluginResult(PluginResult.Status.JSON_EXCEPTION)); - return; - } - - try - { - Debug.WriteLine("Creating WebRequest for url : " + downloadOptions.Url); - webRequest = (HttpWebRequest)WebRequest.Create(downloadOptions.Url); - } - //catch (WebException webEx) - //{ - - //} - catch (Exception) - { - DispatchCommandResult(new PluginResult(PluginResult.Status.ERROR, new FileTransferError(InvalidUrlError, downloadOptions.Url, null, 0))); - return; - } - - if (downloadOptions != null && webRequest != null) - { - DownloadRequestState state = new DownloadRequestState(); - state.options = downloadOptions; - state.request = webRequest; - InProcDownloads[downloadOptions.Id] = state; - - if (!string.IsNullOrEmpty(downloadOptions.Headers)) - { - Dictionary headers = parseHeaders(downloadOptions.Headers); - foreach (string key in headers.Keys) - { - webRequest.Headers[key] = headers[key]; - } - } - - webRequest.BeginGetResponse(new AsyncCallback(downloadCallback), state); - } - - - - } - - public void abort(string options) - { - string[] optionStrings = JSON.JsonHelper.Deserialize(options); - string id = optionStrings[0]; - string callbackId = optionStrings[1]; - - if (InProcDownloads.ContainsKey(id)) - { - DownloadRequestState state = InProcDownloads[id]; - state.request.Abort(); - state.request = null; - - callbackId = state.options.CallbackId; - InProcDownloads.Remove(id); - state = null; - DispatchCommandResult(new PluginResult(PluginResult.Status.ERROR, new FileTransferError(FileTransfer.AbortError)), - callbackId); - - } - else - { - DispatchCommandResult(new PluginResult(PluginResult.Status.IO_EXCEPTION), callbackId); // TODO: is it an IO exception? - } - } - - /// - /// - /// - /// - private void downloadCallback(IAsyncResult asynchronousResult) - { - DownloadRequestState reqState = (DownloadRequestState)asynchronousResult.AsyncState; - HttpWebRequest request = reqState.request; - - string callbackId = reqState.options.CallbackId; - - if (InProcDownloads.ContainsKey(reqState.options.Id)) - { - InProcDownloads.Remove(reqState.options.Id); - } - - try - { - HttpWebResponse response = (HttpWebResponse)request.EndGetResponse(asynchronousResult); - - using (IsolatedStorageFile isoFile = IsolatedStorageFile.GetUserStoreForApplication()) - { - // create the file if not exists - if (!isoFile.FileExists(reqState.options.FilePath)) - { - var file = isoFile.CreateFile(reqState.options.FilePath); - file.Close(); - } - - using (FileStream fileStream = new IsolatedStorageFileStream(reqState.options.FilePath, FileMode.Open, FileAccess.Write, isoFile)) - { - long totalBytes = response.ContentLength; - int bytesRead = 0; - using (BinaryReader reader = new BinaryReader(response.GetResponseStream())) - { - using (BinaryWriter writer = new BinaryWriter(fileStream)) - { - int BUFFER_SIZE = 1024; - byte[] buffer; - - while (true) - { - buffer = reader.ReadBytes(BUFFER_SIZE); - // fire a progress event ? - bytesRead += buffer.Length; - if (buffer.Length > 0) - { - writer.Write(buffer); - } - else - { - writer.Close(); - reader.Close(); - fileStream.Close(); - break; - } - } - } - - } - - - } - } - File.FileEntry entry = new File.FileEntry(reqState.options.FilePath); - DispatchCommandResult(new PluginResult(PluginResult.Status.OK, entry), callbackId); - } - catch (IsolatedStorageException) - { - // Trying to write the file somewhere within the IsoStorage. - DispatchCommandResult(new PluginResult(PluginResult.Status.ERROR, new FileTransferError(FileNotFoundError)), - callbackId); - } - catch (SecurityException) - { - // Trying to write the file somewhere not allowed. - DispatchCommandResult(new PluginResult(PluginResult.Status.ERROR, new FileTransferError(FileNotFoundError)), - callbackId); - } - catch (WebException webex) - { - // TODO: probably need better work here to properly respond with all http status codes back to JS - // Right now am jumping through hoops just to detect 404. - HttpWebResponse response = (HttpWebResponse)webex.Response; - if ((webex.Status == WebExceptionStatus.ProtocolError && response.StatusCode == HttpStatusCode.NotFound) - || webex.Status == WebExceptionStatus.UnknownError) - { - - // Weird MSFT detection of 404... seriously... just give us the f(*&#$@ status code as a number ffs!!! - // "Numbers for HTTP status codes? Nah.... let's create our own set of enums/structs to abstract that stuff away." - // FACEPALM - // Or just cast it to an int, whiner ... -jm - int statusCode = (int)response.StatusCode; - string body = ""; - - using (Stream streamResponse = response.GetResponseStream()) - { - using (StreamReader streamReader = new StreamReader(streamResponse)) - { - body = streamReader.ReadToEnd(); - } - } - FileTransferError ftError = new FileTransferError(ConnectionError, null, null, statusCode, body); - DispatchCommandResult(new PluginResult(PluginResult.Status.ERROR, ftError), - callbackId); - } - else - { - DispatchCommandResult(new PluginResult(PluginResult.Status.ERROR, - new FileTransferError(ConnectionError)), - callbackId); - } - } - catch (Exception) - { - DispatchCommandResult(new PluginResult(PluginResult.Status.ERROR, - new FileTransferError(FileNotFoundError)), - callbackId); - } - } - - - - /// - /// Read file from Isolated Storage and sends it to server - /// - /// - private void WriteCallback(IAsyncResult asynchronousResult) - { - DownloadRequestState reqState = (DownloadRequestState)asynchronousResult.AsyncState; - HttpWebRequest webRequest = reqState.request; - string callbackId = reqState.options.CallbackId; - - try - { - using (Stream requestStream = (webRequest.EndGetRequestStream(asynchronousResult))) - { - string lineStart = "--"; - string lineEnd = Environment.NewLine; - byte[] boundaryBytes = System.Text.Encoding.UTF8.GetBytes(lineStart + Boundary + lineEnd); - string formdataTemplate = "Content-Disposition: form-data; name=\"{0}\"" + lineEnd + lineEnd + "{1}" + lineEnd; - - if (!string.IsNullOrEmpty(reqState.options.Params)) - { - Dictionary paramMap = parseHeaders(reqState.options.Params); - foreach (string key in paramMap.Keys) - { - requestStream.Write(boundaryBytes, 0, boundaryBytes.Length); - string formItem = string.Format(formdataTemplate, key, paramMap[key]); - byte[] formItemBytes = System.Text.Encoding.UTF8.GetBytes(formItem); - requestStream.Write(formItemBytes, 0, formItemBytes.Length); - } - requestStream.Write(boundaryBytes, 0, boundaryBytes.Length); - } - using (IsolatedStorageFile isoFile = IsolatedStorageFile.GetUserStoreForApplication()) - { - if (!isoFile.FileExists(reqState.options.FilePath)) - { - DispatchCommandResult(new PluginResult(PluginResult.Status.ERROR, new FileTransferError(FileNotFoundError, reqState.options.Server, reqState.options.FilePath, 0))); - return; - } - - using (FileStream fileStream = new IsolatedStorageFileStream(reqState.options.FilePath, FileMode.Open, isoFile)) - { - string headerTemplate = "Content-Disposition: form-data; name=\"{0}\"; filename=\"{1}\"" + lineEnd + "Content-Type: {2}" + lineEnd + lineEnd; - string header = string.Format(headerTemplate, reqState.options.FileKey, reqState.options.FileName, reqState.options.MimeType); - byte[] headerBytes = System.Text.Encoding.UTF8.GetBytes(header); - requestStream.Write(boundaryBytes, 0, boundaryBytes.Length); - requestStream.Write(headerBytes, 0, headerBytes.Length); - byte[] buffer = new byte[4096]; - int bytesRead = 0; - - while ((bytesRead = fileStream.Read(buffer, 0, buffer.Length)) != 0) - { - // TODO: Progress event - requestStream.Write(buffer, 0, bytesRead); - bytesSent += bytesRead; - } - } - byte[] endRequest = System.Text.Encoding.UTF8.GetBytes(lineEnd + lineStart + Boundary + lineStart + lineEnd); - requestStream.Write(endRequest, 0, endRequest.Length); - } - } - // webRequest - - webRequest.BeginGetResponse(ReadCallback, reqState); - } - catch (Exception ex) - { - DispatchCommandResult(new PluginResult(PluginResult.Status.ERROR, new FileTransferError(ConnectionError)),callbackId); - } - } - - /// - /// Reads response into FileUploadResult - /// - /// - private void ReadCallback(IAsyncResult asynchronousResult) - { - DownloadRequestState reqState = (DownloadRequestState)asynchronousResult.AsyncState; - try - { - HttpWebRequest webRequest = reqState.request; - string callbackId = reqState.options.CallbackId; - - if (InProcDownloads.ContainsKey(reqState.options.Id)) - { - InProcDownloads.Remove(reqState.options.Id); - } - - using (HttpWebResponse response = (HttpWebResponse)webRequest.EndGetResponse(asynchronousResult)) - { - using (Stream streamResponse = response.GetResponseStream()) - { - using (StreamReader streamReader = new StreamReader(streamResponse)) - { - string responseString = streamReader.ReadToEnd(); - Deployment.Current.Dispatcher.BeginInvoke(() => - { - DispatchCommandResult(new PluginResult(PluginResult.Status.OK, new FileUploadResult(bytesSent, (long)response.StatusCode, responseString))); - }); - } - } - } - } - catch (WebException webex) - { - // TODO: probably need better work here to properly respond with all http status codes back to JS - // Right now am jumping through hoops just to detect 404. - if ((webex.Status == WebExceptionStatus.ProtocolError && ((HttpWebResponse)webex.Response).StatusCode == HttpStatusCode.NotFound) - || webex.Status == WebExceptionStatus.UnknownError) - { - int statusCode = (int)((HttpWebResponse)webex.Response).StatusCode; - FileTransferError ftError = new FileTransferError(ConnectionError, null, null, statusCode); - DispatchCommandResult(new PluginResult(PluginResult.Status.ERROR, ftError), reqState.options.CallbackId); - } - else - { - DispatchCommandResult(new PluginResult(PluginResult.Status.ERROR, - new FileTransferError(ConnectionError)), - reqState.options.CallbackId); - } - } - catch (Exception ex) - { - FileTransferError transferError = new FileTransferError(ConnectionError, reqState.options.Server, reqState.options.FilePath, 403); - DispatchCommandResult(new PluginResult(PluginResult.Status.ERROR, transferError), reqState.options.CallbackId); - - } - } - } -} diff --git a/plugins/org.apache.cordova.core.file-transfer/test/autotest/html/HtmlReporter.js b/plugins/org.apache.cordova.core.file-transfer/test/autotest/html/HtmlReporter.js deleted file mode 100644 index 7d9d924..0000000 --- a/plugins/org.apache.cordova.core.file-transfer/test/autotest/html/HtmlReporter.js +++ /dev/null @@ -1,101 +0,0 @@ -jasmine.HtmlReporter = function(_doc) { - var self = this; - var doc = _doc || window.document; - - var reporterView; - - var dom = {}; - - // Jasmine Reporter Public Interface - self.logRunningSpecs = false; - - self.reportRunnerStarting = function(runner) { - var specs = runner.specs() || []; - - if (specs.length == 0) { - return; - } - - createReporterDom(runner.env.versionString()); - doc.body.appendChild(dom.reporter); - - reporterView = new jasmine.HtmlReporter.ReporterView(dom); - reporterView.addSpecs(specs, self.specFilter); - }; - - self.reportRunnerResults = function(runner) { - reporterView && reporterView.complete(); - }; - - self.reportSuiteResults = function(suite) { - reporterView.suiteComplete(suite); - }; - - self.reportSpecStarting = function(spec) { - if (self.logRunningSpecs) { - self.log('>> Jasmine Running ' + spec.suite.description + ' ' + spec.description + '...'); - } - }; - - self.reportSpecResults = function(spec) { - reporterView.specComplete(spec); - }; - - self.log = function() { - var console = jasmine.getGlobal().console; - if (console && console.log) { - if (console.log.apply) { - console.log.apply(console, arguments); - } else { - console.log(arguments); // ie fix: console.log.apply doesn't exist on ie - } - } - }; - - self.specFilter = function(spec) { - if (!focusedSpecName()) { - return true; - } - - return spec.getFullName().indexOf(focusedSpecName()) === 0; - }; - - return self; - - function focusedSpecName() { - var specName; - - (function memoizeFocusedSpec() { - if (specName) { - return; - } - - var paramMap = []; - var params = doc.location.search.substring(1).split('&'); - - for (var i = 0; i < params.length; i++) { - var p = params[i].split('='); - paramMap[decodeURIComponent(p[0])] = decodeURIComponent(p[1]); - } - - specName = paramMap.spec; - })(); - - return specName; - } - - function createReporterDom(version) { - dom.reporter = self.createDom('div', { id: 'HTMLReporter', className: 'jasmine_reporter' }, - dom.banner = self.createDom('div', { className: 'banner' }, - self.createDom('span', { className: 'title' }, "Jasmine "), - self.createDom('span', { className: 'version' }, version)), - - dom.symbolSummary = self.createDom('ul', {className: 'symbolSummary'}), - dom.alert = self.createDom('div', {className: 'alert'}), - dom.results = self.createDom('div', {className: 'results'}, - dom.summary = self.createDom('div', { className: 'summary' }), - dom.details = self.createDom('div', { id: 'details' })) - ); - } -}; -jasmine.HtmlReporterHelpers.addHelpers(jasmine.HtmlReporter); diff --git a/plugins/org.apache.cordova.core.file-transfer/test/autotest/html/HtmlReporterHelpers.js b/plugins/org.apache.cordova.core.file-transfer/test/autotest/html/HtmlReporterHelpers.js deleted file mode 100644 index 745e1e0..0000000 --- a/plugins/org.apache.cordova.core.file-transfer/test/autotest/html/HtmlReporterHelpers.js +++ /dev/null @@ -1,60 +0,0 @@ -jasmine.HtmlReporterHelpers = {}; - -jasmine.HtmlReporterHelpers.createDom = function(type, attrs, childrenVarArgs) { - var el = document.createElement(type); - - for (var i = 2; i < arguments.length; i++) { - var child = arguments[i]; - - if (typeof child === 'string') { - el.appendChild(document.createTextNode(child)); - } else { - if (child) { - el.appendChild(child); - } - } - } - - for (var attr in attrs) { - if (attr == "className") { - el[attr] = attrs[attr]; - } else { - el.setAttribute(attr, attrs[attr]); - } - } - - return el; -}; - -jasmine.HtmlReporterHelpers.getSpecStatus = function(child) { - var results = child.results(); - var status = results.passed() ? 'passed' : 'failed'; - if (results.skipped) { - status = 'skipped'; - } - - return status; -}; - -jasmine.HtmlReporterHelpers.appendToSummary = function(child, childElement) { - var parentDiv = this.dom.summary; - var parentSuite = (typeof child.parentSuite == 'undefined') ? 'suite' : 'parentSuite'; - var parent = child[parentSuite]; - - if (parent) { - if (typeof this.views.suites[parent.id] == 'undefined') { - this.views.suites[parent.id] = new jasmine.HtmlReporter.SuiteView(parent, this.dom, this.views); - } - parentDiv = this.views.suites[parent.id].element; - } - - parentDiv.appendChild(childElement); -}; - - -jasmine.HtmlReporterHelpers.addHelpers = function(ctor) { - for(var fn in jasmine.HtmlReporterHelpers) { - ctor.prototype[fn] = jasmine.HtmlReporterHelpers[fn]; - } -}; - diff --git a/plugins/org.apache.cordova.core.file-transfer/test/autotest/html/ReporterView.js b/plugins/org.apache.cordova.core.file-transfer/test/autotest/html/ReporterView.js deleted file mode 100644 index 6a6d005..0000000 --- a/plugins/org.apache.cordova.core.file-transfer/test/autotest/html/ReporterView.js +++ /dev/null @@ -1,164 +0,0 @@ -jasmine.HtmlReporter.ReporterView = function(dom) { - this.startedAt = new Date(); - this.runningSpecCount = 0; - this.completeSpecCount = 0; - this.passedCount = 0; - this.failedCount = 0; - this.skippedCount = 0; - - this.createResultsMenu = function() { - this.resultsMenu = this.createDom('span', {className: 'resultsMenu bar'}, - this.summaryMenuItem = this.createDom('a', {className: 'summaryMenuItem', href: "#"}, '0 specs'), - ' | ', - this.detailsMenuItem = this.createDom('a', {className: 'detailsMenuItem', href: "#"}, '0 failing')); - - this.summaryMenuItem.onclick = function() { - dom.reporter.className = dom.reporter.className.replace(/ showDetails/g, ''); - }; - - this.detailsMenuItem.onclick = function() { - showDetails(); - }; - }; - - this.addSpecs = function(specs, specFilter) { - this.totalSpecCount = specs.length; - - this.views = { - specs: {}, - suites: {} - }; - - for (var i = 0; i < specs.length; i++) { - var spec = specs[i]; - this.views.specs[spec.id] = new jasmine.HtmlReporter.SpecView(spec, dom, this.views); - if (specFilter(spec)) { - this.runningSpecCount++; - } - } - }; - - this.specComplete = function(spec) { - this.completeSpecCount++; - - if (isUndefined(this.views.specs[spec.id])) { - this.views.specs[spec.id] = new jasmine.HtmlReporter.SpecView(spec, dom); - } - - var specView = this.views.specs[spec.id]; - - switch (specView.status()) { - case 'passed': - this.passedCount++; - break; - - case 'failed': - this.failedCount++; - break; - - case 'skipped': - this.skippedCount++; - break; - } - - specView.refresh(); - this.refresh(); - }; - - this.suiteComplete = function(suite) { - var suiteView = this.views.suites[suite.id]; - if (isUndefined(suiteView)) { - return; - } - suiteView.refresh(); - }; - - this.refresh = function() { - - if (isUndefined(this.resultsMenu)) { - this.createResultsMenu(); - } - - // currently running UI - if (isUndefined(this.runningAlert)) { - this.runningAlert = this.createDom('a', {href: "?", className: "runningAlert bar"}); - dom.alert.appendChild(this.runningAlert); - } - this.runningAlert.innerHTML = "Running " + this.completeSpecCount + " of " + specPluralizedFor(this.totalSpecCount); - - // skipped specs UI - if (isUndefined(this.skippedAlert)) { - this.skippedAlert = this.createDom('a', {href: "?", className: "skippedAlert bar"}); - } - - this.skippedAlert.innerHTML = "Skipping " + this.skippedCount + " of " + specPluralizedFor(this.totalSpecCount) + " - run all"; - - if (this.skippedCount === 1 && isDefined(dom.alert)) { - dom.alert.appendChild(this.skippedAlert); - } - - // passing specs UI - if (isUndefined(this.passedAlert)) { - this.passedAlert = this.createDom('span', {href: "?", className: "passingAlert bar"}); - } - this.passedAlert.innerHTML = "Passing " + specPluralizedFor(this.passedCount); - - // failing specs UI - if (isUndefined(this.failedAlert)) { - this.failedAlert = this.createDom('span', {href: "?", className: "failingAlert bar"}); - } - this.failedAlert.innerHTML = "Failing " + specPluralizedFor(this.failedCount); - - if (this.failedCount === 1 && isDefined(dom.alert)) { - dom.alert.appendChild(this.failedAlert); - dom.alert.appendChild(this.resultsMenu); - } - - // summary info - this.summaryMenuItem.innerHTML = "" + specPluralizedFor(this.runningSpecCount); - this.detailsMenuItem.innerHTML = "" + this.failedCount + " failing"; - }; - - this.complete = function() { - dom.alert.removeChild(this.runningAlert); - - this.skippedAlert.innerHTML = "Ran " + this.runningSpecCount + " of " + specPluralizedFor(this.totalSpecCount) + " - run all"; - - if (this.failedCount === 0) { - dom.alert.appendChild(this.createDom('span', {className: 'passingAlert bar'}, "Passing " + specPluralizedFor(this.passedCount))); - } else { - showDetails(); - } - - dom.banner.appendChild(this.createDom('span', {className: 'duration'}, "finished in " + ((new Date().getTime() - this.startedAt.getTime()) / 1000) + "s")); - }; - - return this; - - function showDetails() { - if (dom.reporter.className.search(/showDetails/) === -1) { - dom.reporter.className += " showDetails"; - } - } - - function isUndefined(obj) { - return typeof obj === 'undefined'; - } - - function isDefined(obj) { - return !isUndefined(obj); - } - - function specPluralizedFor(count) { - var str = count + " spec"; - if (count > 1) { - str += "s" - } - return str; - } - -}; - -jasmine.HtmlReporterHelpers.addHelpers(jasmine.HtmlReporter.ReporterView); - - diff --git a/plugins/org.apache.cordova.core.file-transfer/test/autotest/html/SpecView.js b/plugins/org.apache.cordova.core.file-transfer/test/autotest/html/SpecView.js deleted file mode 100644 index e8a3c23..0000000 --- a/plugins/org.apache.cordova.core.file-transfer/test/autotest/html/SpecView.js +++ /dev/null @@ -1,79 +0,0 @@ -jasmine.HtmlReporter.SpecView = function(spec, dom, views) { - this.spec = spec; - this.dom = dom; - this.views = views; - - this.symbol = this.createDom('li', { className: 'pending' }); - this.dom.symbolSummary.appendChild(this.symbol); - - this.summary = this.createDom('div', { className: 'specSummary' }, - this.createDom('a', { - className: 'description', - href: '?spec=' + encodeURIComponent(this.spec.getFullName()), - title: this.spec.getFullName() - }, this.spec.description) - ); - - this.detail = this.createDom('div', { className: 'specDetail' }, - this.createDom('a', { - className: 'description', - href: '?spec=' + encodeURIComponent(this.spec.getFullName()), - title: this.spec.getFullName() - }, this.spec.getFullName()) - ); -}; - -jasmine.HtmlReporter.SpecView.prototype.status = function() { - return this.getSpecStatus(this.spec); -}; - -jasmine.HtmlReporter.SpecView.prototype.refresh = function() { - this.symbol.className = this.status(); - - switch (this.status()) { - case 'skipped': - break; - - case 'passed': - this.appendSummaryToSuiteDiv(); - break; - - case 'failed': - this.appendSummaryToSuiteDiv(); - this.appendFailureDetail(); - break; - } -}; - -jasmine.HtmlReporter.SpecView.prototype.appendSummaryToSuiteDiv = function() { - this.summary.className += ' ' + this.status(); - this.appendToSummary(this.spec, this.summary); -}; - -jasmine.HtmlReporter.SpecView.prototype.appendFailureDetail = function() { - this.detail.className += ' ' + this.status(); - - var resultItems = this.spec.results().getItems(); - var messagesDiv = this.createDom('div', { className: 'messages' }); - - for (var i = 0; i < resultItems.length; i++) { - var result = resultItems[i]; - - if (result.type == 'log') { - messagesDiv.appendChild(this.createDom('div', {className: 'resultMessage log'}, result.toString())); - } else if (result.type == 'expect' && result.passed && !result.passed()) { - messagesDiv.appendChild(this.createDom('div', {className: 'resultMessage fail'}, result.message)); - - if (result.trace.stack) { - messagesDiv.appendChild(this.createDom('div', {className: 'stackTrace'}, result.trace.stack)); - } - } - } - - if (messagesDiv.childNodes.length > 0) { - this.detail.appendChild(messagesDiv); - this.dom.details.appendChild(this.detail); - } -}; - -jasmine.HtmlReporterHelpers.addHelpers(jasmine.HtmlReporter.SpecView); diff --git a/plugins/org.apache.cordova.core.file-transfer/test/autotest/html/SuiteView.js b/plugins/org.apache.cordova.core.file-transfer/test/autotest/html/SuiteView.js deleted file mode 100644 index 19a1efa..0000000 --- a/plugins/org.apache.cordova.core.file-transfer/test/autotest/html/SuiteView.js +++ /dev/null @@ -1,22 +0,0 @@ -jasmine.HtmlReporter.SuiteView = function(suite, dom, views) { - this.suite = suite; - this.dom = dom; - this.views = views; - - this.element = this.createDom('div', { className: 'suite' }, - this.createDom('a', { className: 'description', href: '?spec=' + encodeURIComponent(this.suite.getFullName()) }, this.suite.description) - ); - - this.appendToSummary(this.suite, this.element); -}; - -jasmine.HtmlReporter.SuiteView.prototype.status = function() { - return this.getSpecStatus(this.suite); -}; - -jasmine.HtmlReporter.SuiteView.prototype.refresh = function() { - this.element.className += " " + this.status(); -}; - -jasmine.HtmlReporterHelpers.addHelpers(jasmine.HtmlReporter.SuiteView); - diff --git a/plugins/org.apache.cordova.core.file-transfer/test/autotest/html/TrivialReporter.js b/plugins/org.apache.cordova.core.file-transfer/test/autotest/html/TrivialReporter.js deleted file mode 100644 index 167ac50..0000000 --- a/plugins/org.apache.cordova.core.file-transfer/test/autotest/html/TrivialReporter.js +++ /dev/null @@ -1,192 +0,0 @@ -/* @deprecated Use jasmine.HtmlReporter instead - */ -jasmine.TrivialReporter = function(doc) { - this.document = doc || document; - this.suiteDivs = {}; - this.logRunningSpecs = false; -}; - -jasmine.TrivialReporter.prototype.createDom = function(type, attrs, childrenVarArgs) { - var el = document.createElement(type); - - for (var i = 2; i < arguments.length; i++) { - var child = arguments[i]; - - if (typeof child === 'string') { - el.appendChild(document.createTextNode(child)); - } else { - if (child) { el.appendChild(child); } - } - } - - for (var attr in attrs) { - if (attr == "className") { - el[attr] = attrs[attr]; - } else { - el.setAttribute(attr, attrs[attr]); - } - } - - return el; -}; - -jasmine.TrivialReporter.prototype.reportRunnerStarting = function(runner) { - var showPassed, showSkipped; - - this.outerDiv = this.createDom('div', { id: 'TrivialReporter', className: 'jasmine_reporter' }, - this.createDom('div', { className: 'banner' }, - this.createDom('div', { className: 'logo' }, - this.createDom('span', { className: 'title' }, "Jasmine"), - this.createDom('span', { className: 'version' }, runner.env.versionString())), - this.createDom('div', { className: 'options' }, - "Show ", - showPassed = this.createDom('input', { id: "__jasmine_TrivialReporter_showPassed__", type: 'checkbox' }), - this.createDom('label', { "for": "__jasmine_TrivialReporter_showPassed__" }, " passed "), - showSkipped = this.createDom('input', { id: "__jasmine_TrivialReporter_showSkipped__", type: 'checkbox' }), - this.createDom('label', { "for": "__jasmine_TrivialReporter_showSkipped__" }, " skipped") - ) - ), - - this.runnerDiv = this.createDom('div', { className: 'runner running' }, - this.createDom('a', { className: 'run_spec', href: '?' }, "run all"), - this.runnerMessageSpan = this.createDom('span', {}, "Running..."), - this.finishedAtSpan = this.createDom('span', { className: 'finished-at' }, "")) - ); - - this.document.body.appendChild(this.outerDiv); - - var suites = runner.suites(); - for (var i = 0; i < suites.length; i++) { - var suite = suites[i]; - var suiteDiv = this.createDom('div', { className: 'suite' }, - this.createDom('a', { className: 'run_spec', href: '?spec=' + encodeURIComponent(suite.getFullName()) }, "run"), - this.createDom('a', { className: 'description', href: '?spec=' + encodeURIComponent(suite.getFullName()) }, suite.description)); - this.suiteDivs[suite.id] = suiteDiv; - var parentDiv = this.outerDiv; - if (suite.parentSuite) { - parentDiv = this.suiteDivs[suite.parentSuite.id]; - } - parentDiv.appendChild(suiteDiv); - } - - this.startedAt = new Date(); - - var self = this; - showPassed.onclick = function(evt) { - if (showPassed.checked) { - self.outerDiv.className += ' show-passed'; - } else { - self.outerDiv.className = self.outerDiv.className.replace(/ show-passed/, ''); - } - }; - - showSkipped.onclick = function(evt) { - if (showSkipped.checked) { - self.outerDiv.className += ' show-skipped'; - } else { - self.outerDiv.className = self.outerDiv.className.replace(/ show-skipped/, ''); - } - }; -}; - -jasmine.TrivialReporter.prototype.reportRunnerResults = function(runner) { - var results = runner.results(); - var className = (results.failedCount > 0) ? "runner failed" : "runner passed"; - this.runnerDiv.setAttribute("class", className); - //do it twice for IE - this.runnerDiv.setAttribute("className", className); - var specs = runner.specs(); - var specCount = 0; - for (var i = 0; i < specs.length; i++) { - if (this.specFilter(specs[i])) { - specCount++; - } - } - var message = "" + specCount + " spec" + (specCount == 1 ? "" : "s" ) + ", " + results.failedCount + " failure" + ((results.failedCount == 1) ? "" : "s"); - message += " in " + ((new Date().getTime() - this.startedAt.getTime()) / 1000) + "s"; - this.runnerMessageSpan.replaceChild(this.createDom('a', { className: 'description', href: '?'}, message), this.runnerMessageSpan.firstChild); - - this.finishedAtSpan.appendChild(document.createTextNode("Finished at " + new Date().toString())); -}; - -jasmine.TrivialReporter.prototype.reportSuiteResults = function(suite) { - var results = suite.results(); - var status = results.passed() ? 'passed' : 'failed'; - if (results.totalCount === 0) { // todo: change this to check results.skipped - status = 'skipped'; - } - this.suiteDivs[suite.id].className += " " + status; -}; - -jasmine.TrivialReporter.prototype.reportSpecStarting = function(spec) { - if (this.logRunningSpecs) { - this.log('>> Jasmine Running ' + spec.suite.description + ' ' + spec.description + '...'); - } -}; - -jasmine.TrivialReporter.prototype.reportSpecResults = function(spec) { - var results = spec.results(); - var status = results.passed() ? 'passed' : 'failed'; - if (results.skipped) { - status = 'skipped'; - } - var specDiv = this.createDom('div', { className: 'spec ' + status }, - this.createDom('a', { className: 'run_spec', href: '?spec=' + encodeURIComponent(spec.getFullName()) }, "run"), - this.createDom('a', { - className: 'description', - href: '?spec=' + encodeURIComponent(spec.getFullName()), - title: spec.getFullName() - }, spec.description)); - - - var resultItems = results.getItems(); - var messagesDiv = this.createDom('div', { className: 'messages' }); - for (var i = 0; i < resultItems.length; i++) { - var result = resultItems[i]; - - if (result.type == 'log') { - messagesDiv.appendChild(this.createDom('div', {className: 'resultMessage log'}, result.toString())); - } else if (result.type == 'expect' && result.passed && !result.passed()) { - messagesDiv.appendChild(this.createDom('div', {className: 'resultMessage fail'}, result.message)); - - if (result.trace.stack) { - messagesDiv.appendChild(this.createDom('div', {className: 'stackTrace'}, result.trace.stack)); - } - } - } - - if (messagesDiv.childNodes.length > 0) { - specDiv.appendChild(messagesDiv); - } - - this.suiteDivs[spec.suite.id].appendChild(specDiv); -}; - -jasmine.TrivialReporter.prototype.log = function() { - var console = jasmine.getGlobal().console; - if (console && console.log) { - if (console.log.apply) { - console.log.apply(console, arguments); - } else { - console.log(arguments); // ie fix: console.log.apply doesn't exist on ie - } - } -}; - -jasmine.TrivialReporter.prototype.getLocation = function() { - return this.document.location; -}; - -jasmine.TrivialReporter.prototype.specFilter = function(spec) { - var paramMap = {}; - var params = this.getLocation().search.substring(1).split('&'); - for (var i = 0; i < params.length; i++) { - var p = params[i].split('='); - paramMap[decodeURIComponent(p[0])] = decodeURIComponent(p[1]); - } - - if (!paramMap.spec) { - return true; - } - return spec.getFullName().indexOf(paramMap.spec) === 0; -}; diff --git a/plugins/org.apache.cordova.core.file-transfer/test/autotest/index.html b/plugins/org.apache.cordova.core.file-transfer/test/autotest/index.html deleted file mode 100644 index 6ebccbd..0000000 --- a/plugins/org.apache.cordova.core.file-transfer/test/autotest/index.html +++ /dev/null @@ -1,59 +0,0 @@ - - - - - - - - - - Cordova API Specs - - - - - -

Cordova API Specs

- - Run All Tests - Run Accelerometer Tests - Run Battery Tests - Run Camera Tests - Run Capture Tests - Run Compass Tests - Run Contacts Tests - Run Data URI Tests - Run Device Tests - Run File Tests - Run FileTransfer Tests - Run Geolocation Tests - Run Globalization Tests - Run Media Tests - Run Network Tests - Run Notification Tests - Run Platform Tests - Run Storage Tests - Run Bridge Tests - -

Back
- - diff --git a/plugins/org.apache.cordova.core.file-transfer/test/autotest/jasmine.css b/plugins/org.apache.cordova.core.file-transfer/test/autotest/jasmine.css deleted file mode 100644 index 826e575..0000000 --- a/plugins/org.apache.cordova.core.file-transfer/test/autotest/jasmine.css +++ /dev/null @@ -1,81 +0,0 @@ -body { background-color: #eeeeee; padding: 0; margin: 5px; overflow-y: scroll; } - -#HTMLReporter { font-size: 11px; font-family: Monaco, "Lucida Console", monospace; line-height: 14px; color: #333333; } -#HTMLReporter a { text-decoration: none; } -#HTMLReporter a:hover { text-decoration: underline; } -#HTMLReporter p, #HTMLReporter h1, #HTMLReporter h2, #HTMLReporter h3, #HTMLReporter h4, #HTMLReporter h5, #HTMLReporter h6 { margin: 0; line-height: 14px; } -#HTMLReporter .banner, #HTMLReporter .symbolSummary, #HTMLReporter .summary, #HTMLReporter .resultMessage, #HTMLReporter .specDetail .description, #HTMLReporter .alert .bar, #HTMLReporter .stackTrace { padding-left: 9px; padding-right: 9px; } -#HTMLReporter #jasmine_content { position: fixed; right: 100%; } -#HTMLReporter .version { color: #aaaaaa; } -#HTMLReporter .banner { margin-top: 14px; } -#HTMLReporter .duration { color: #aaaaaa; float: right; } -#HTMLReporter .symbolSummary { overflow: hidden; *zoom: 1; margin: 14px 0; } -#HTMLReporter .symbolSummary li { display: block; float: left; height: 7px; width: 14px; margin-bottom: 7px; font-size: 16px; } -#HTMLReporter .symbolSummary li.passed { font-size: 14px; } -#HTMLReporter .symbolSummary li.passed:before { color: #5e7d00; content: "\02022"; } -#HTMLReporter .symbolSummary li.failed { line-height: 9px; } -#HTMLReporter .symbolSummary li.failed:before { color: #b03911; content: "x"; font-weight: bold; margin-left: -1px; } -#HTMLReporter .symbolSummary li.skipped { font-size: 14px; } -#HTMLReporter .symbolSummary li.skipped:before { color: #bababa; content: "\02022"; } -#HTMLReporter .symbolSummary li.pending { line-height: 11px; } -#HTMLReporter .symbolSummary li.pending:before { color: #aaaaaa; content: "-"; } -#HTMLReporter .bar { line-height: 28px; font-size: 14px; display: block; color: #eee; } -#HTMLReporter .runningAlert { background-color: #666666; } -#HTMLReporter .skippedAlert { background-color: #aaaaaa; } -#HTMLReporter .skippedAlert:first-child { background-color: #333333; } -#HTMLReporter .skippedAlert:hover { text-decoration: none; color: white; text-decoration: underline; } -#HTMLReporter .passingAlert { background-color: #a6b779; } -#HTMLReporter .passingAlert:first-child { background-color: #5e7d00; } -#HTMLReporter .failingAlert { background-color: #cf867e; } -#HTMLReporter .failingAlert:first-child { background-color: #b03911; } -#HTMLReporter .results { margin-top: 14px; } -#HTMLReporter #details { display: none; } -#HTMLReporter .resultsMenu, #HTMLReporter .resultsMenu a { background-color: #fff; color: #333333; } -#HTMLReporter.showDetails .summaryMenuItem { font-weight: normal; text-decoration: inherit; } -#HTMLReporter.showDetails .summaryMenuItem:hover { text-decoration: underline; } -#HTMLReporter.showDetails .detailsMenuItem { font-weight: bold; text-decoration: underline; } -#HTMLReporter.showDetails .summary { display: none; } -#HTMLReporter.showDetails #details { display: block; } -#HTMLReporter .summaryMenuItem { font-weight: bold; text-decoration: underline; } -#HTMLReporter .summary { margin-top: 14px; } -#HTMLReporter .summary .suite .suite, #HTMLReporter .summary .specSummary { margin-left: 14px; } -#HTMLReporter .summary .specSummary.passed a { color: #5e7d00; } -#HTMLReporter .summary .specSummary.failed a { color: #b03911; } -#HTMLReporter .description + .suite { margin-top: 0; } -#HTMLReporter .suite { margin-top: 14px; } -#HTMLReporter .suite a { color: #333333; } -#HTMLReporter #details .specDetail { margin-bottom: 28px; } -#HTMLReporter #details .specDetail .description { display: block; color: white; background-color: #b03911; } -#HTMLReporter .resultMessage { padding-top: 14px; color: #333333; } -#HTMLReporter .resultMessage span.result { display: block; } -#HTMLReporter .stackTrace { margin: 5px 0 0 0; max-height: 224px; overflow: auto; line-height: 18px; color: #666666; border: 1px solid #ddd; background: white; white-space: pre; } - -#TrivialReporter { padding: 8px 13px; position: absolute; top: 0; bottom: 0; left: 0; right: 0; overflow-y: scroll; background-color: white; font-family: "Helvetica Neue Light", "Lucida Grande", "Calibri", "Arial", sans-serif; /*.resultMessage {*/ /*white-space: pre;*/ /*}*/ } -#TrivialReporter a:visited, #TrivialReporter a { color: #303; } -#TrivialReporter a:hover, #TrivialReporter a:active { color: blue; } -#TrivialReporter .run_spec { float: right; padding-right: 5px; font-size: .8em; text-decoration: none; } -#TrivialReporter .banner { color: #303; background-color: #fef; padding: 5px; } -#TrivialReporter .logo { float: left; font-size: 1.1em; padding-left: 5px; } -#TrivialReporter .logo .version { font-size: .6em; padding-left: 1em; } -#TrivialReporter .runner.running { background-color: yellow; } -#TrivialReporter .options { text-align: right; font-size: .8em; } -#TrivialReporter .suite { border: 1px outset gray; margin: 5px 0; padding-left: 1em; } -#TrivialReporter .suite .suite { margin: 5px; } -#TrivialReporter .suite.passed { background-color: #dfd; } -#TrivialReporter .suite.failed { background-color: #fdd; } -#TrivialReporter .spec { margin: 5px; padding-left: 1em; clear: both; } -#TrivialReporter .spec.failed, #TrivialReporter .spec.passed, #TrivialReporter .spec.skipped { padding-bottom: 5px; border: 1px solid gray; } -#TrivialReporter .spec.failed { background-color: #fbb; border-color: red; } -#TrivialReporter .spec.passed { background-color: #bfb; border-color: green; } -#TrivialReporter .spec.skipped { background-color: #bbb; } -#TrivialReporter .messages { border-left: 1px dashed gray; padding-left: 1em; padding-right: 1em; } -#TrivialReporter .passed { background-color: #cfc; display: none; } -#TrivialReporter .failed { background-color: #fbb; } -#TrivialReporter .skipped { color: #777; background-color: #eee; display: none; } -#TrivialReporter .resultMessage span.result { display: block; line-height: 2em; color: black; } -#TrivialReporter .resultMessage .mismatch { color: black; } -#TrivialReporter .stackTrace { white-space: pre; font-size: .8em; margin-left: 10px; max-height: 5em; overflow: auto; border: 1px inset red; padding: 1em; background: #eef; } -#TrivialReporter .finished-at { padding-left: 1em; font-size: .6em; } -#TrivialReporter.show-passed .passed, #TrivialReporter.show-skipped .skipped { display: block; } -#TrivialReporter #jasmine_content { position: fixed; right: 100%; } -#TrivialReporter .runner { border: 1px solid gray; display: block; margin: 5px 0; padding: 2px 0 2px 10px; } diff --git a/plugins/org.apache.cordova.core.file-transfer/test/autotest/jasmine.js b/plugins/org.apache.cordova.core.file-transfer/test/autotest/jasmine.js deleted file mode 100644 index bccb66c..0000000 --- a/plugins/org.apache.cordova.core.file-transfer/test/autotest/jasmine.js +++ /dev/null @@ -1,2530 +0,0 @@ -var isCommonJS = typeof window == "undefined"; - -/** - * Top level namespace for Jasmine, a lightweight JavaScript BDD/spec/testing framework. - * - * @namespace - */ -var jasmine = {}; -if (isCommonJS) exports.jasmine = jasmine; -/** - * @private - */ -jasmine.unimplementedMethod_ = function() { - throw new Error("unimplemented method"); -}; - -/** - * Use jasmine.undefined instead of undefined, since undefined is just - * a plain old variable and may be redefined by somebody else. - * - * @private - */ -jasmine.undefined = jasmine.___undefined___; - -/** - * Show diagnostic messages in the console if set to true - * - */ -jasmine.VERBOSE = false; - -/** - * Default interval in milliseconds for event loop yields (e.g. to allow network activity or to refresh the screen with the HTML-based runner). Small values here may result in slow test running. Zero means no updates until all tests have completed. - * - */ -jasmine.DEFAULT_UPDATE_INTERVAL = 250; - -/** - * Default timeout interval in milliseconds for waitsFor() blocks. - */ -jasmine.DEFAULT_TIMEOUT_INTERVAL = 5000; - -jasmine.getGlobal = function() { - function getGlobal() { - return this; - } - - return getGlobal(); -}; - -/** - * Allows for bound functions to be compared. Internal use only. - * - * @ignore - * @private - * @param base {Object} bound 'this' for the function - * @param name {Function} function to find - */ -jasmine.bindOriginal_ = function(base, name) { - var original = base[name]; - if (original.apply) { - return function() { - return original.apply(base, arguments); - }; - } else { - // IE support - return jasmine.getGlobal()[name]; - } -}; - -jasmine.setTimeout = jasmine.bindOriginal_(jasmine.getGlobal(), 'setTimeout'); -jasmine.clearTimeout = jasmine.bindOriginal_(jasmine.getGlobal(), 'clearTimeout'); -jasmine.setInterval = jasmine.bindOriginal_(jasmine.getGlobal(), 'setInterval'); -jasmine.clearInterval = jasmine.bindOriginal_(jasmine.getGlobal(), 'clearInterval'); - -jasmine.MessageResult = function(values) { - this.type = 'log'; - this.values = values; - this.trace = new Error(); // todo: test better -}; - -jasmine.MessageResult.prototype.toString = function() { - var text = ""; - for (var i = 0; i < this.values.length; i++) { - if (i > 0) text += " "; - if (jasmine.isString_(this.values[i])) { - text += this.values[i]; - } else { - text += jasmine.pp(this.values[i]); - } - } - return text; -}; - -jasmine.ExpectationResult = function(params) { - this.type = 'expect'; - this.matcherName = params.matcherName; - this.passed_ = params.passed; - this.expected = params.expected; - this.actual = params.actual; - this.message = this.passed_ ? 'Passed.' : params.message; - - var trace = (params.trace || new Error(this.message)); - this.trace = this.passed_ ? '' : trace; -}; - -jasmine.ExpectationResult.prototype.toString = function () { - return this.message; -}; - -jasmine.ExpectationResult.prototype.passed = function () { - return this.passed_; -}; - -/** - * Getter for the Jasmine environment. Ensures one gets created - */ -jasmine.getEnv = function() { - var env = jasmine.currentEnv_ = jasmine.currentEnv_ || new jasmine.Env(); - return env; -}; - -/** - * @ignore - * @private - * @param value - * @returns {Boolean} - */ -jasmine.isArray_ = function(value) { - return jasmine.isA_("Array", value); -}; - -/** - * @ignore - * @private - * @param value - * @returns {Boolean} - */ -jasmine.isString_ = function(value) { - return jasmine.isA_("String", value); -}; - -/** - * @ignore - * @private - * @param value - * @returns {Boolean} - */ -jasmine.isNumber_ = function(value) { - return jasmine.isA_("Number", value); -}; - -/** - * @ignore - * @private - * @param {String} typeName - * @param value - * @returns {Boolean} - */ -jasmine.isA_ = function(typeName, value) { - return Object.prototype.toString.apply(value) === '[object ' + typeName + ']'; -}; - -/** - * Pretty printer for expecations. Takes any object and turns it into a human-readable string. - * - * @param value {Object} an object to be outputted - * @returns {String} - */ -jasmine.pp = function(value) { - var stringPrettyPrinter = new jasmine.StringPrettyPrinter(); - stringPrettyPrinter.format(value); - return stringPrettyPrinter.string; -}; - -/** - * Returns true if the object is a DOM Node. - * - * @param {Object} obj object to check - * @returns {Boolean} - */ -jasmine.isDomNode = function(obj) { - return obj.nodeType > 0; -}; - -/** - * Returns a matchable 'generic' object of the class type. For use in expecations of type when values don't matter. - * - * @example - * // don't care about which function is passed in, as long as it's a function - * expect(mySpy).toHaveBeenCalledWith(jasmine.any(Function)); - * - * @param {Class} clazz - * @returns matchable object of the type clazz - */ -jasmine.any = function(clazz) { - return new jasmine.Matchers.Any(clazz); -}; - -/** - * Returns a matchable subset of a JSON object. For use in expectations when you don't care about all of the - * attributes on the object. - * - * @example - * // don't care about any other attributes than foo. - * expect(mySpy).toHaveBeenCalledWith(jasmine.objectContaining({foo: "bar"}); - * - * @param sample {Object} sample - * @returns matchable object for the sample - */ -jasmine.objectContaining = function (sample) { - return new jasmine.Matchers.ObjectContaining(sample); -}; - -/** - * Jasmine Spies are test doubles that can act as stubs, spies, fakes or when used in an expecation, mocks. - * - * Spies should be created in test setup, before expectations. They can then be checked, using the standard Jasmine - * expectation syntax. Spies can be checked if they were called or not and what the calling params were. - * - * A Spy has the following fields: wasCalled, callCount, mostRecentCall, and argsForCall (see docs). - * - * Spies are torn down at the end of every spec. - * - * Note: Do not call new jasmine.Spy() directly - a spy must be created using spyOn, jasmine.createSpy or jasmine.createSpyObj. - * - * @example - * // a stub - * var myStub = jasmine.createSpy('myStub'); // can be used anywhere - * - * // spy example - * var foo = { - * not: function(bool) { return !bool; } - * } - * - * // actual foo.not will not be called, execution stops - * spyOn(foo, 'not'); - - // foo.not spied upon, execution will continue to implementation - * spyOn(foo, 'not').andCallThrough(); - * - * // fake example - * var foo = { - * not: function(bool) { return !bool; } - * } - * - * // foo.not(val) will return val - * spyOn(foo, 'not').andCallFake(function(value) {return value;}); - * - * // mock example - * foo.not(7 == 7); - * expect(foo.not).toHaveBeenCalled(); - * expect(foo.not).toHaveBeenCalledWith(true); - * - * @constructor - * @see spyOn, jasmine.createSpy, jasmine.createSpyObj - * @param {String} name - */ -jasmine.Spy = function(name) { - /** - * The name of the spy, if provided. - */ - this.identity = name || 'unknown'; - /** - * Is this Object a spy? - */ - this.isSpy = true; - /** - * The actual function this spy stubs. - */ - this.plan = function() { - }; - /** - * Tracking of the most recent call to the spy. - * @example - * var mySpy = jasmine.createSpy('foo'); - * mySpy(1, 2); - * mySpy.mostRecentCall.args = [1, 2]; - */ - this.mostRecentCall = {}; - - /** - * Holds arguments for each call to the spy, indexed by call count - * @example - * var mySpy = jasmine.createSpy('foo'); - * mySpy(1, 2); - * mySpy(7, 8); - * mySpy.mostRecentCall.args = [7, 8]; - * mySpy.argsForCall[0] = [1, 2]; - * mySpy.argsForCall[1] = [7, 8]; - */ - this.argsForCall = []; - this.calls = []; -}; - -/** - * Tells a spy to call through to the actual implemenatation. - * - * @example - * var foo = { - * bar: function() { // do some stuff } - * } - * - * // defining a spy on an existing property: foo.bar - * spyOn(foo, 'bar').andCallThrough(); - */ -jasmine.Spy.prototype.andCallThrough = function() { - this.plan = this.originalValue; - return this; -}; - -/** - * For setting the return value of a spy. - * - * @example - * // defining a spy from scratch: foo() returns 'baz' - * var foo = jasmine.createSpy('spy on foo').andReturn('baz'); - * - * // defining a spy on an existing property: foo.bar() returns 'baz' - * spyOn(foo, 'bar').andReturn('baz'); - * - * @param {Object} value - */ -jasmine.Spy.prototype.andReturn = function(value) { - this.plan = function() { - return value; - }; - return this; -}; - -/** - * For throwing an exception when a spy is called. - * - * @example - * // defining a spy from scratch: foo() throws an exception w/ message 'ouch' - * var foo = jasmine.createSpy('spy on foo').andThrow('baz'); - * - * // defining a spy on an existing property: foo.bar() throws an exception w/ message 'ouch' - * spyOn(foo, 'bar').andThrow('baz'); - * - * @param {String} exceptionMsg - */ -jasmine.Spy.prototype.andThrow = function(exceptionMsg) { - this.plan = function() { - throw exceptionMsg; - }; - return this; -}; - -/** - * Calls an alternate implementation when a spy is called. - * - * @example - * var baz = function() { - * // do some stuff, return something - * } - * // defining a spy from scratch: foo() calls the function baz - * var foo = jasmine.createSpy('spy on foo').andCall(baz); - * - * // defining a spy on an existing property: foo.bar() calls an anonymnous function - * spyOn(foo, 'bar').andCall(function() { return 'baz';} ); - * - * @param {Function} fakeFunc - */ -jasmine.Spy.prototype.andCallFake = function(fakeFunc) { - this.plan = fakeFunc; - return this; -}; - -/** - * Resets all of a spy's the tracking variables so that it can be used again. - * - * @example - * spyOn(foo, 'bar'); - * - * foo.bar(); - * - * expect(foo.bar.callCount).toEqual(1); - * - * foo.bar.reset(); - * - * expect(foo.bar.callCount).toEqual(0); - */ -jasmine.Spy.prototype.reset = function() { - this.wasCalled = false; - this.callCount = 0; - this.argsForCall = []; - this.calls = []; - this.mostRecentCall = {}; -}; - -jasmine.createSpy = function(name) { - - var spyObj = function() { - spyObj.wasCalled = true; - spyObj.callCount++; - var args = jasmine.util.argsToArray(arguments); - spyObj.mostRecentCall.object = this; - spyObj.mostRecentCall.args = args; - spyObj.argsForCall.push(args); - spyObj.calls.push({object: this, args: args}); - return spyObj.plan.apply(this, arguments); - }; - - var spy = new jasmine.Spy(name); - - for (var prop in spy) { - spyObj[prop] = spy[prop]; - } - - spyObj.reset(); - - return spyObj; -}; - -/** - * Determines whether an object is a spy. - * - * @param {jasmine.Spy|Object} putativeSpy - * @returns {Boolean} - */ -jasmine.isSpy = function(putativeSpy) { - return putativeSpy && putativeSpy.isSpy; -}; - -/** - * Creates a more complicated spy: an Object that has every property a function that is a spy. Used for stubbing something - * large in one call. - * - * @param {String} baseName name of spy class - * @param {Array} methodNames array of names of methods to make spies - */ -jasmine.createSpyObj = function(baseName, methodNames) { - if (!jasmine.isArray_(methodNames) || methodNames.length === 0) { - throw new Error('createSpyObj requires a non-empty array of method names to create spies for'); - } - var obj = {}; - for (var i = 0; i < methodNames.length; i++) { - obj[methodNames[i]] = jasmine.createSpy(baseName + '.' + methodNames[i]); - } - return obj; -}; - -/** - * All parameters are pretty-printed and concatenated together, then written to the current spec's output. - * - * Be careful not to leave calls to jasmine.log in production code. - */ -jasmine.log = function() { - var spec = jasmine.getEnv().currentSpec; - spec.log.apply(spec, arguments); -}; - -/** - * Function that installs a spy on an existing object's method name. Used within a Spec to create a spy. - * - * @example - * // spy example - * var foo = { - * not: function(bool) { return !bool; } - * } - * spyOn(foo, 'not'); // actual foo.not will not be called, execution stops - * - * @see jasmine.createSpy - * @param obj - * @param methodName - * @returns a Jasmine spy that can be chained with all spy methods - */ -var spyOn = function(obj, methodName) { - return jasmine.getEnv().currentSpec.spyOn(obj, methodName); -}; -if (isCommonJS) exports.spyOn = spyOn; - -/** - * Creates a Jasmine spec that will be added to the current suite. - * - * // TODO: pending tests - * - * @example - * it('should be true', function() { - * expect(true).toEqual(true); - * }); - * - * @param {String} desc description of this specification - * @param {Function} func defines the preconditions and expectations of the spec - */ -var it = function(desc, func) { - return jasmine.getEnv().it(desc, func); -}; -if (isCommonJS) exports.it = it; - -/** - * Creates a disabled Jasmine spec. - * - * A convenience method that allows existing specs to be disabled temporarily during development. - * - * @param {String} desc description of this specification - * @param {Function} func defines the preconditions and expectations of the spec - */ -var xit = function(desc, func) { - return jasmine.getEnv().xit(desc, func); -}; -if (isCommonJS) exports.xit = xit; - -/** - * Starts a chain for a Jasmine expectation. - * - * It is passed an Object that is the actual value and should chain to one of the many - * jasmine.Matchers functions. - * - * @param {Object} actual Actual value to test against and expected value - */ -var expect = function(actual) { - return jasmine.getEnv().currentSpec.expect(actual); -}; -if (isCommonJS) exports.expect = expect; - -/** - * Defines part of a jasmine spec. Used in cominbination with waits or waitsFor in asynchrnous specs. - * - * @param {Function} func Function that defines part of a jasmine spec. - */ -var runs = function(func) { - jasmine.getEnv().currentSpec.runs(func); -}; -if (isCommonJS) exports.runs = runs; - -/** - * Waits a fixed time period before moving to the next block. - * - * @deprecated Use waitsFor() instead - * @param {Number} timeout milliseconds to wait - */ -var waits = function(timeout) { - jasmine.getEnv().currentSpec.waits(timeout); -}; -if (isCommonJS) exports.waits = waits; - -/** - * Waits for the latchFunction to return true before proceeding to the next block. - * - * @param {Function} latchFunction - * @param {String} optional_timeoutMessage - * @param {Number} optional_timeout - */ -var waitsFor = function(latchFunction, optional_timeoutMessage, optional_timeout) { - jasmine.getEnv().currentSpec.waitsFor.apply(jasmine.getEnv().currentSpec, arguments); -}; -if (isCommonJS) exports.waitsFor = waitsFor; - -/** - * A function that is called before each spec in a suite. - * - * Used for spec setup, including validating assumptions. - * - * @param {Function} beforeEachFunction - */ -var beforeEach = function(beforeEachFunction) { - jasmine.getEnv().beforeEach(beforeEachFunction); -}; -if (isCommonJS) exports.beforeEach = beforeEach; - -/** - * A function that is called after each spec in a suite. - * - * Used for restoring any state that is hijacked during spec execution. - * - * @param {Function} afterEachFunction - */ -var afterEach = function(afterEachFunction) { - jasmine.getEnv().afterEach(afterEachFunction); -}; -if (isCommonJS) exports.afterEach = afterEach; - -/** - * Defines a suite of specifications. - * - * Stores the description and all defined specs in the Jasmine environment as one suite of specs. Variables declared - * are accessible by calls to beforeEach, it, and afterEach. Describe blocks can be nested, allowing for specialization - * of setup in some tests. - * - * @example - * // TODO: a simple suite - * - * // TODO: a simple suite with a nested describe block - * - * @param {String} description A string, usually the class under test. - * @param {Function} specDefinitions function that defines several specs. - */ -var describe = function(description, specDefinitions) { - return jasmine.getEnv().describe(description, specDefinitions); -}; -if (isCommonJS) exports.describe = describe; - -/** - * Disables a suite of specifications. Used to disable some suites in a file, or files, temporarily during development. - * - * @param {String} description A string, usually the class under test. - * @param {Function} specDefinitions function that defines several specs. - */ -var xdescribe = function(description, specDefinitions) { - return jasmine.getEnv().xdescribe(description, specDefinitions); -}; -if (isCommonJS) exports.xdescribe = xdescribe; - - -// Provide the XMLHttpRequest class for IE 5.x-6.x: -jasmine.XmlHttpRequest = (typeof XMLHttpRequest == "undefined") ? function() { - function tryIt(f) { - try { - return f(); - } catch(e) { - } - return null; - } - - var xhr = tryIt(function() { - return new ActiveXObject("Msxml2.XMLHTTP.6.0"); - }) || - tryIt(function() { - return new ActiveXObject("Msxml2.XMLHTTP.3.0"); - }) || - tryIt(function() { - return new ActiveXObject("Msxml2.XMLHTTP"); - }) || - tryIt(function() { - return new ActiveXObject("Microsoft.XMLHTTP"); - }); - - if (!xhr) throw new Error("This browser does not support XMLHttpRequest."); - - return xhr; -} : XMLHttpRequest; -/** - * @namespace - */ -jasmine.util = {}; - -/** - * Declare that a child class inherit it's prototype from the parent class. - * - * @private - * @param {Function} childClass - * @param {Function} parentClass - */ -jasmine.util.inherit = function(childClass, parentClass) { - /** - * @private - */ - var subclass = function() { - }; - subclass.prototype = parentClass.prototype; - childClass.prototype = new subclass(); -}; - -jasmine.util.formatException = function(e) { - var lineNumber; - if (e.line) { - lineNumber = e.line; - } - else if (e.lineNumber) { - lineNumber = e.lineNumber; - } - - var file; - - if (e.sourceURL) { - file = e.sourceURL; - } - else if (e.fileName) { - file = e.fileName; - } - - var message = (e.name && e.message) ? (e.name + ': ' + e.message) : e.toString(); - - if (file && lineNumber) { - message += ' in ' + file + ' (line ' + lineNumber + ')'; - } - - return message; -}; - -jasmine.util.htmlEscape = function(str) { - if (!str) return str; - return str.replace(/&/g, '&') - .replace(//g, '>'); -}; - -jasmine.util.argsToArray = function(args) { - var arrayOfArgs = []; - for (var i = 0; i < args.length; i++) arrayOfArgs.push(args[i]); - return arrayOfArgs; -}; - -jasmine.util.extend = function(destination, source) { - for (var property in source) destination[property] = source[property]; - return destination; -}; - -/** - * Environment for Jasmine - * - * @constructor - */ -jasmine.Env = function() { - this.currentSpec = null; - this.currentSuite = null; - this.currentRunner_ = new jasmine.Runner(this); - - this.reporter = new jasmine.MultiReporter(); - - this.updateInterval = jasmine.DEFAULT_UPDATE_INTERVAL; - this.defaultTimeoutInterval = jasmine.DEFAULT_TIMEOUT_INTERVAL; - this.lastUpdate = 0; - this.specFilter = function() { - return true; - }; - - this.nextSpecId_ = 0; - this.nextSuiteId_ = 0; - this.equalityTesters_ = []; - - // wrap matchers - this.matchersClass = function() { - jasmine.Matchers.apply(this, arguments); - }; - jasmine.util.inherit(this.matchersClass, jasmine.Matchers); - - jasmine.Matchers.wrapInto_(jasmine.Matchers.prototype, this.matchersClass); -}; - - -jasmine.Env.prototype.setTimeout = jasmine.setTimeout; -jasmine.Env.prototype.clearTimeout = jasmine.clearTimeout; -jasmine.Env.prototype.setInterval = jasmine.setInterval; -jasmine.Env.prototype.clearInterval = jasmine.clearInterval; - -/** - * @returns an object containing jasmine version build info, if set. - */ -jasmine.Env.prototype.version = function () { - if (jasmine.version_) { - return jasmine.version_; - } else { - throw new Error('Version not set'); - } -}; - -/** - * @returns string containing jasmine version build info, if set. - */ -jasmine.Env.prototype.versionString = function() { - if (!jasmine.version_) { - return "version unknown"; - } - - var version = this.version(); - var versionString = version.major + "." + version.minor + "." + version.build; - if (version.release_candidate) { - versionString += ".rc" + version.release_candidate; - } - versionString += " revision " + version.revision; - return versionString; -}; - -/** - * @returns a sequential integer starting at 0 - */ -jasmine.Env.prototype.nextSpecId = function () { - return this.nextSpecId_++; -}; - -/** - * @returns a sequential integer starting at 0 - */ -jasmine.Env.prototype.nextSuiteId = function () { - return this.nextSuiteId_++; -}; - -/** - * Register a reporter to receive status updates from Jasmine. - * @param {jasmine.Reporter} reporter An object which will receive status updates. - */ -jasmine.Env.prototype.addReporter = function(reporter) { - this.reporter.addReporter(reporter); -}; - -jasmine.Env.prototype.execute = function() { - this.currentRunner_.execute(); -}; - -jasmine.Env.prototype.describe = function(description, specDefinitions) { - var suite = new jasmine.Suite(this, description, specDefinitions, this.currentSuite); - - var parentSuite = this.currentSuite; - if (parentSuite) { - parentSuite.add(suite); - } else { - this.currentRunner_.add(suite); - } - - this.currentSuite = suite; - - var declarationError = null; - try { - specDefinitions.call(suite); - } catch(e) { - declarationError = e; - } - - if (declarationError) { - this.it("encountered a declaration exception", function() { - throw declarationError; - }); - } - - this.currentSuite = parentSuite; - - return suite; -}; - -jasmine.Env.prototype.beforeEach = function(beforeEachFunction) { - if (this.currentSuite) { - this.currentSuite.beforeEach(beforeEachFunction); - } else { - this.currentRunner_.beforeEach(beforeEachFunction); - } -}; - -jasmine.Env.prototype.currentRunner = function () { - return this.currentRunner_; -}; - -jasmine.Env.prototype.afterEach = function(afterEachFunction) { - if (this.currentSuite) { - this.currentSuite.afterEach(afterEachFunction); - } else { - this.currentRunner_.afterEach(afterEachFunction); - } - -}; - -jasmine.Env.prototype.xdescribe = function(desc, specDefinitions) { - return { - execute: function() { - } - }; -}; - -jasmine.Env.prototype.it = function(description, func) { - var spec = new jasmine.Spec(this, this.currentSuite, description); - this.currentSuite.add(spec); - this.currentSpec = spec; - - if (func) { - spec.runs(func); - } - - return spec; -}; - -jasmine.Env.prototype.xit = function(desc, func) { - return { - id: this.nextSpecId(), - runs: function() { - } - }; -}; - -jasmine.Env.prototype.compareObjects_ = function(a, b, mismatchKeys, mismatchValues) { - if (a.__Jasmine_been_here_before__ === b && b.__Jasmine_been_here_before__ === a) { - return true; - } - - a.__Jasmine_been_here_before__ = b; - b.__Jasmine_been_here_before__ = a; - - var hasKey = function(obj, keyName) { - return obj !== null && obj[keyName] !== jasmine.undefined; - }; - - for (var property in b) { - if (!hasKey(a, property) && hasKey(b, property)) { - mismatchKeys.push("expected has key '" + property + "', but missing from actual."); - } - } - for (property in a) { - if (!hasKey(b, property) && hasKey(a, property)) { - mismatchKeys.push("expected missing key '" + property + "', but present in actual."); - } - } - for (property in b) { - if (property == '__Jasmine_been_here_before__') continue; - if (!this.equals_(a[property], b[property], mismatchKeys, mismatchValues)) { - mismatchValues.push("'" + property + "' was '" + (b[property] ? jasmine.util.htmlEscape(b[property].toString()) : b[property]) + "' in expected, but was '" + (a[property] ? jasmine.util.htmlEscape(a[property].toString()) : a[property]) + "' in actual."); - } - } - - if (jasmine.isArray_(a) && jasmine.isArray_(b) && a.length != b.length) { - mismatchValues.push("arrays were not the same length"); - } - - delete a.__Jasmine_been_here_before__; - delete b.__Jasmine_been_here_before__; - return (mismatchKeys.length === 0 && mismatchValues.length === 0); -}; - -jasmine.Env.prototype.equals_ = function(a, b, mismatchKeys, mismatchValues) { - mismatchKeys = mismatchKeys || []; - mismatchValues = mismatchValues || []; - - for (var i = 0; i < this.equalityTesters_.length; i++) { - var equalityTester = this.equalityTesters_[i]; - var result = equalityTester(a, b, this, mismatchKeys, mismatchValues); - if (result !== jasmine.undefined) return result; - } - - if (a === b) return true; - - if (a === jasmine.undefined || a === null || b === jasmine.undefined || b === null) { - return (a == jasmine.undefined && b == jasmine.undefined); - } - - if (jasmine.isDomNode(a) && jasmine.isDomNode(b)) { - return a === b; - } - - if (a instanceof Date && b instanceof Date) { - return a.getTime() == b.getTime(); - } - - if (a.jasmineMatches) { - return a.jasmineMatches(b); - } - - if (b.jasmineMatches) { - return b.jasmineMatches(a); - } - - if (a instanceof jasmine.Matchers.ObjectContaining) { - return a.matches(b); - } - - if (b instanceof jasmine.Matchers.ObjectContaining) { - return b.matches(a); - } - - if (jasmine.isString_(a) && jasmine.isString_(b)) { - return (a == b); - } - - if (jasmine.isNumber_(a) && jasmine.isNumber_(b)) { - return (a == b); - } - - if (typeof a === "object" && typeof b === "object") { - return this.compareObjects_(a, b, mismatchKeys, mismatchValues); - } - - //Straight check - return (a === b); -}; - -jasmine.Env.prototype.contains_ = function(haystack, needle) { - if (jasmine.isArray_(haystack)) { - for (var i = 0; i < haystack.length; i++) { - if (this.equals_(haystack[i], needle)) return true; - } - return false; - } - return haystack.indexOf(needle) >= 0; -}; - -jasmine.Env.prototype.addEqualityTester = function(equalityTester) { - this.equalityTesters_.push(equalityTester); -}; -/** No-op base class for Jasmine reporters. - * - * @constructor - */ -jasmine.Reporter = function() { -}; - -//noinspection JSUnusedLocalSymbols -jasmine.Reporter.prototype.reportRunnerStarting = function(runner) { -}; - -//noinspection JSUnusedLocalSymbols -jasmine.Reporter.prototype.reportRunnerResults = function(runner) { -}; - -//noinspection JSUnusedLocalSymbols -jasmine.Reporter.prototype.reportSuiteResults = function(suite) { -}; - -//noinspection JSUnusedLocalSymbols -jasmine.Reporter.prototype.reportSpecStarting = function(spec) { -}; - -//noinspection JSUnusedLocalSymbols -jasmine.Reporter.prototype.reportSpecResults = function(spec) { -}; - -//noinspection JSUnusedLocalSymbols -jasmine.Reporter.prototype.log = function(str) { -}; - -/** - * Blocks are functions with executable code that make up a spec. - * - * @constructor - * @param {jasmine.Env} env - * @param {Function} func - * @param {jasmine.Spec} spec - */ -jasmine.Block = function(env, func, spec) { - this.env = env; - this.func = func; - this.spec = spec; -}; - -jasmine.Block.prototype.execute = function(onComplete) { - try { - this.func.apply(this.spec); - } catch (e) { - this.spec.fail(e); - } - onComplete(); -}; -/** JavaScript API reporter. - * - * @constructor - */ -jasmine.JsApiReporter = function() { - this.started = false; - this.finished = false; - this.suites_ = []; - this.results_ = {}; -}; - -jasmine.JsApiReporter.prototype.reportRunnerStarting = function(runner) { - this.started = true; - var suites = runner.topLevelSuites(); - for (var i = 0; i < suites.length; i++) { - var suite = suites[i]; - this.suites_.push(this.summarize_(suite)); - } -}; - -jasmine.JsApiReporter.prototype.suites = function() { - return this.suites_; -}; - -jasmine.JsApiReporter.prototype.summarize_ = function(suiteOrSpec) { - var isSuite = suiteOrSpec instanceof jasmine.Suite; - var summary = { - id: suiteOrSpec.id, - name: suiteOrSpec.description, - type: isSuite ? 'suite' : 'spec', - children: [] - }; - - if (isSuite) { - var children = suiteOrSpec.children(); - for (var i = 0; i < children.length; i++) { - summary.children.push(this.summarize_(children[i])); - } - } - return summary; -}; - -jasmine.JsApiReporter.prototype.results = function() { - return this.results_; -}; - -jasmine.JsApiReporter.prototype.resultsForSpec = function(specId) { - return this.results_[specId]; -}; - -//noinspection JSUnusedLocalSymbols -jasmine.JsApiReporter.prototype.reportRunnerResults = function(runner) { - this.finished = true; -}; - -//noinspection JSUnusedLocalSymbols -jasmine.JsApiReporter.prototype.reportSuiteResults = function(suite) { -}; - -//noinspection JSUnusedLocalSymbols -jasmine.JsApiReporter.prototype.reportSpecResults = function(spec) { - this.results_[spec.id] = { - messages: spec.results().getItems(), - result: spec.results().failedCount > 0 ? "failed" : "passed" - }; -}; - -//noinspection JSUnusedLocalSymbols -jasmine.JsApiReporter.prototype.log = function(str) { -}; - -jasmine.JsApiReporter.prototype.resultsForSpecs = function(specIds){ - var results = {}; - for (var i = 0; i < specIds.length; i++) { - var specId = specIds[i]; - results[specId] = this.summarizeResult_(this.results_[specId]); - } - return results; -}; - -jasmine.JsApiReporter.prototype.summarizeResult_ = function(result){ - var summaryMessages = []; - var messagesLength = result.messages.length; - for (var messageIndex = 0; messageIndex < messagesLength; messageIndex++) { - var resultMessage = result.messages[messageIndex]; - summaryMessages.push({ - text: resultMessage.type == 'log' ? resultMessage.toString() : jasmine.undefined, - passed: resultMessage.passed ? resultMessage.passed() : true, - type: resultMessage.type, - message: resultMessage.message, - trace: { - stack: resultMessage.passed && !resultMessage.passed() ? resultMessage.trace.stack : jasmine.undefined - } - }); - } - - return { - result : result.result, - messages : summaryMessages - }; -}; - -/** - * @constructor - * @param {jasmine.Env} env - * @param actual - * @param {jasmine.Spec} spec - */ -jasmine.Matchers = function(env, actual, spec, opt_isNot) { - this.env = env; - this.actual = actual; - this.spec = spec; - this.isNot = opt_isNot || false; - this.reportWasCalled_ = false; -}; - -// todo: @deprecated as of Jasmine 0.11, remove soon [xw] -jasmine.Matchers.pp = function(str) { - throw new Error("jasmine.Matchers.pp() is no longer supported, please use jasmine.pp() instead!"); -}; - -// todo: @deprecated Deprecated as of Jasmine 0.10. Rewrite your custom matchers to return true or false. [xw] -jasmine.Matchers.prototype.report = function(result, failing_message, details) { - throw new Error("As of jasmine 0.11, custom matchers must be implemented differently -- please see jasmine docs"); -}; - -jasmine.Matchers.wrapInto_ = function(prototype, matchersClass) { - for (var methodName in prototype) { - if (methodName == 'report') continue; - var orig = prototype[methodName]; - matchersClass.prototype[methodName] = jasmine.Matchers.matcherFn_(methodName, orig); - } -}; - -jasmine.Matchers.matcherFn_ = function(matcherName, matcherFunction) { - return function() { - var matcherArgs = jasmine.util.argsToArray(arguments); - var result = matcherFunction.apply(this, arguments); - - if (this.isNot) { - result = !result; - } - - if (this.reportWasCalled_) return result; - - var message; - if (!result) { - if (this.message) { - message = this.message.apply(this, arguments); - if (jasmine.isArray_(message)) { - message = message[this.isNot ? 1 : 0]; - } - } else { - var englishyPredicate = matcherName.replace(/[A-Z]/g, function(s) { return ' ' + s.toLowerCase(); }); - message = "Expected " + jasmine.pp(this.actual) + (this.isNot ? " not " : " ") + englishyPredicate; - if (matcherArgs.length > 0) { - for (var i = 0; i < matcherArgs.length; i++) { - if (i > 0) message += ","; - message += " " + jasmine.pp(matcherArgs[i]); - } - } - message += "."; - } - } - var expectationResult = new jasmine.ExpectationResult({ - matcherName: matcherName, - passed: result, - expected: matcherArgs.length > 1 ? matcherArgs : matcherArgs[0], - actual: this.actual, - message: message - }); - this.spec.addMatcherResult(expectationResult); - return jasmine.undefined; - }; -}; - - - - -/** - * toBe: compares the actual to the expected using === - * @param expected - */ -jasmine.Matchers.prototype.toBe = function(expected) { - return this.actual === expected; -}; - -/** - * toNotBe: compares the actual to the expected using !== - * @param expected - * @deprecated as of 1.0. Use not.toBe() instead. - */ -jasmine.Matchers.prototype.toNotBe = function(expected) { - return this.actual !== expected; -}; - -/** - * toEqual: compares the actual to the expected using common sense equality. Handles Objects, Arrays, etc. - * - * @param expected - */ -jasmine.Matchers.prototype.toEqual = function(expected) { - return this.env.equals_(this.actual, expected); -}; - -/** - * toNotEqual: compares the actual to the expected using the ! of jasmine.Matchers.toEqual - * @param expected - * @deprecated as of 1.0. Use not.toEqual() instead. - */ -jasmine.Matchers.prototype.toNotEqual = function(expected) { - return !this.env.equals_(this.actual, expected); -}; - -/** - * Matcher that compares the actual to the expected using a regular expression. Constructs a RegExp, so takes - * a pattern or a String. - * - * @param expected - */ -jasmine.Matchers.prototype.toMatch = function(expected) { - return new RegExp(expected).test(this.actual); -}; - -/** - * Matcher that compares the actual to the expected using the boolean inverse of jasmine.Matchers.toMatch - * @param expected - * @deprecated as of 1.0. Use not.toMatch() instead. - */ -jasmine.Matchers.prototype.toNotMatch = function(expected) { - return !(new RegExp(expected).test(this.actual)); -}; - -/** - * Matcher that compares the actual to jasmine.undefined. - */ -jasmine.Matchers.prototype.toBeDefined = function() { - return (this.actual !== jasmine.undefined); -}; - -/** - * Matcher that compares the actual to jasmine.undefined. - */ -jasmine.Matchers.prototype.toBeUndefined = function() { - return (this.actual === jasmine.undefined); -}; - -/** - * Matcher that compares the actual to null. - */ -jasmine.Matchers.prototype.toBeNull = function() { - return (this.actual === null); -}; - -/** - * Matcher that boolean not-nots the actual. - */ -jasmine.Matchers.prototype.toBeTruthy = function() { - return !!this.actual; -}; - - -/** - * Matcher that boolean nots the actual. - */ -jasmine.Matchers.prototype.toBeFalsy = function() { - return !this.actual; -}; - - -/** - * Matcher that checks to see if the actual, a Jasmine spy, was called. - */ -jasmine.Matchers.prototype.toHaveBeenCalled = function() { - if (arguments.length > 0) { - throw new Error('toHaveBeenCalled does not take arguments, use toHaveBeenCalledWith'); - } - - if (!jasmine.isSpy(this.actual)) { - throw new Error('Expected a spy, but got ' + jasmine.pp(this.actual) + '.'); - } - - this.message = function() { - return [ - "Expected spy " + this.actual.identity + " to have been called.", - "Expected spy " + this.actual.identity + " not to have been called." - ]; - }; - - return this.actual.wasCalled; -}; - -/** @deprecated Use expect(xxx).toHaveBeenCalled() instead */ -jasmine.Matchers.prototype.wasCalled = jasmine.Matchers.prototype.toHaveBeenCalled; - -/** - * Matcher that checks to see if the actual, a Jasmine spy, was not called. - * - * @deprecated Use expect(xxx).not.toHaveBeenCalled() instead - */ -jasmine.Matchers.prototype.wasNotCalled = function() { - if (arguments.length > 0) { - throw new Error('wasNotCalled does not take arguments'); - } - - if (!jasmine.isSpy(this.actual)) { - throw new Error('Expected a spy, but got ' + jasmine.pp(this.actual) + '.'); - } - - this.message = function() { - return [ - "Expected spy " + this.actual.identity + " to not have been called.", - "Expected spy " + this.actual.identity + " to have been called." - ]; - }; - - return !this.actual.wasCalled; -}; - -/** - * Matcher that checks to see if the actual, a Jasmine spy, was called with a set of parameters. - * - * @example - * - */ -jasmine.Matchers.prototype.toHaveBeenCalledWith = function() { - var expectedArgs = jasmine.util.argsToArray(arguments); - if (!jasmine.isSpy(this.actual)) { - throw new Error('Expected a spy, but got ' + jasmine.pp(this.actual) + '.'); - } - this.message = function() { - if (this.actual.callCount === 0) { - // todo: what should the failure message for .not.toHaveBeenCalledWith() be? is this right? test better. [xw] - return [ - "Expected spy " + this.actual.identity + " to have been called with " + jasmine.pp(expectedArgs) + " but it was never called.", - "Expected spy " + this.actual.identity + " not to have been called with " + jasmine.pp(expectedArgs) + " but it was." - ]; - } else { - return [ - "Expected spy " + this.actual.identity + " to have been called with " + jasmine.pp(expectedArgs) + " but was called with " + jasmine.pp(this.actual.argsForCall), - "Expected spy " + this.actual.identity + " not to have been called with " + jasmine.pp(expectedArgs) + " but was called with " + jasmine.pp(this.actual.argsForCall) - ]; - } - }; - - return this.env.contains_(this.actual.argsForCall, expectedArgs); -}; - -/** @deprecated Use expect(xxx).toHaveBeenCalledWith() instead */ -jasmine.Matchers.prototype.wasCalledWith = jasmine.Matchers.prototype.toHaveBeenCalledWith; - -/** @deprecated Use expect(xxx).not.toHaveBeenCalledWith() instead */ -jasmine.Matchers.prototype.wasNotCalledWith = function() { - var expectedArgs = jasmine.util.argsToArray(arguments); - if (!jasmine.isSpy(this.actual)) { - throw new Error('Expected a spy, but got ' + jasmine.pp(this.actual) + '.'); - } - - this.message = function() { - return [ - "Expected spy not to have been called with " + jasmine.pp(expectedArgs) + " but it was", - "Expected spy to have been called with " + jasmine.pp(expectedArgs) + " but it was" - ]; - }; - - return !this.env.contains_(this.actual.argsForCall, expectedArgs); -}; - -/** - * Matcher that checks that the expected item is an element in the actual Array. - * - * @param {Object} expected - */ -jasmine.Matchers.prototype.toContain = function(expected) { - return this.env.contains_(this.actual, expected); -}; - -/** - * Matcher that checks that the expected item is NOT an element in the actual Array. - * - * @param {Object} expected - * @deprecated as of 1.0. Use not.toContain() instead. - */ -jasmine.Matchers.prototype.toNotContain = function(expected) { - return !this.env.contains_(this.actual, expected); -}; - -jasmine.Matchers.prototype.toBeLessThan = function(expected) { - return this.actual < expected; -}; - -jasmine.Matchers.prototype.toBeGreaterThan = function(expected) { - return this.actual > expected; -}; - -/** - * Matcher that checks that the expected item is equal to the actual item - * up to a given level of decimal precision (default 2). - * - * @param {Number} expected - * @param {Number} precision - */ -jasmine.Matchers.prototype.toBeCloseTo = function(expected, precision) { - if (!(precision === 0)) { - precision = precision || 2; - } - var multiplier = Math.pow(10, precision); - var actual = Math.round(this.actual * multiplier); - expected = Math.round(expected * multiplier); - return expected == actual; -}; - -/** - * Matcher that checks that the expected exception was thrown by the actual. - * - * @param {String} expected - */ -jasmine.Matchers.prototype.toThrow = function(expected) { - var result = false; - var exception; - if (typeof this.actual != 'function') { - throw new Error('Actual is not a function'); - } - try { - this.actual(); - } catch (e) { - exception = e; - } - if (exception) { - result = (expected === jasmine.undefined || this.env.equals_(exception.message || exception, expected.message || expected)); - } - - var not = this.isNot ? "not " : ""; - - this.message = function() { - if (exception && (expected === jasmine.undefined || !this.env.equals_(exception.message || exception, expected.message || expected))) { - return ["Expected function " + not + "to throw", expected ? expected.message || expected : "an exception", ", but it threw", exception.message || exception].join(' '); - } else { - return "Expected function to throw an exception."; - } - }; - - return result; -}; - -jasmine.Matchers.Any = function(expectedClass) { - this.expectedClass = expectedClass; -}; - -jasmine.Matchers.Any.prototype.jasmineMatches = function(other) { - if (this.expectedClass == String) { - return typeof other == 'string' || other instanceof String; - } - - if (this.expectedClass == Number) { - return typeof other == 'number' || other instanceof Number; - } - - if (this.expectedClass == Function) { - return typeof other == 'function' || other instanceof Function; - } - - if (this.expectedClass == Object) { - return typeof other == 'object'; - } - - return other instanceof this.expectedClass; -}; - -jasmine.Matchers.Any.prototype.jasmineToString = function() { - return ''; -}; - -jasmine.Matchers.ObjectContaining = function (sample) { - this.sample = sample; -}; - -jasmine.Matchers.ObjectContaining.prototype.jasmineMatches = function(other, mismatchKeys, mismatchValues) { - mismatchKeys = mismatchKeys || []; - mismatchValues = mismatchValues || []; - - var env = jasmine.getEnv(); - - var hasKey = function(obj, keyName) { - return obj != null && obj[keyName] !== jasmine.undefined; - }; - - for (var property in this.sample) { - if (!hasKey(other, property) && hasKey(this.sample, property)) { - mismatchKeys.push("expected has key '" + property + "', but missing from actual."); - } - else if (!env.equals_(this.sample[property], other[property], mismatchKeys, mismatchValues)) { - mismatchValues.push("'" + property + "' was '" + (other[property] ? jasmine.util.htmlEscape(other[property].toString()) : other[property]) + "' in expected, but was '" + (this.sample[property] ? jasmine.util.htmlEscape(this.sample[property].toString()) : this.sample[property]) + "' in actual."); - } - } - - return (mismatchKeys.length === 0 && mismatchValues.length === 0); -}; - -jasmine.Matchers.ObjectContaining.prototype.jasmineToString = function () { - return ""; -}; -// Mock setTimeout, clearTimeout -// Contributed by Pivotal Computer Systems, www.pivotalsf.com - -jasmine.FakeTimer = function() { - this.reset(); - - var self = this; - self.setTimeout = function(funcToCall, millis) { - self.timeoutsMade++; - self.scheduleFunction(self.timeoutsMade, funcToCall, millis, false); - return self.timeoutsMade; - }; - - self.setInterval = function(funcToCall, millis) { - self.timeoutsMade++; - self.scheduleFunction(self.timeoutsMade, funcToCall, millis, true); - return self.timeoutsMade; - }; - - self.clearTimeout = function(timeoutKey) { - self.scheduledFunctions[timeoutKey] = jasmine.undefined; - }; - - self.clearInterval = function(timeoutKey) { - self.scheduledFunctions[timeoutKey] = jasmine.undefined; - }; - -}; - -jasmine.FakeTimer.prototype.reset = function() { - this.timeoutsMade = 0; - this.scheduledFunctions = {}; - this.nowMillis = 0; -}; - -jasmine.FakeTimer.prototype.tick = function(millis) { - var oldMillis = this.nowMillis; - var newMillis = oldMillis + millis; - this.runFunctionsWithinRange(oldMillis, newMillis); - this.nowMillis = newMillis; -}; - -jasmine.FakeTimer.prototype.runFunctionsWithinRange = function(oldMillis, nowMillis) { - var scheduledFunc; - var funcsToRun = []; - for (var timeoutKey in this.scheduledFunctions) { - scheduledFunc = this.scheduledFunctions[timeoutKey]; - if (scheduledFunc != jasmine.undefined && - scheduledFunc.runAtMillis >= oldMillis && - scheduledFunc.runAtMillis <= nowMillis) { - funcsToRun.push(scheduledFunc); - this.scheduledFunctions[timeoutKey] = jasmine.undefined; - } - } - - if (funcsToRun.length > 0) { - funcsToRun.sort(function(a, b) { - return a.runAtMillis - b.runAtMillis; - }); - for (var i = 0; i < funcsToRun.length; ++i) { - try { - var funcToRun = funcsToRun[i]; - this.nowMillis = funcToRun.runAtMillis; - funcToRun.funcToCall(); - if (funcToRun.recurring) { - this.scheduleFunction(funcToRun.timeoutKey, - funcToRun.funcToCall, - funcToRun.millis, - true); - } - } catch(e) { - } - } - this.runFunctionsWithinRange(oldMillis, nowMillis); - } -}; - -jasmine.FakeTimer.prototype.scheduleFunction = function(timeoutKey, funcToCall, millis, recurring) { - this.scheduledFunctions[timeoutKey] = { - runAtMillis: this.nowMillis + millis, - funcToCall: funcToCall, - recurring: recurring, - timeoutKey: timeoutKey, - millis: millis - }; -}; - -/** - * @namespace - */ -jasmine.Clock = { - defaultFakeTimer: new jasmine.FakeTimer(), - - reset: function() { - jasmine.Clock.assertInstalled(); - jasmine.Clock.defaultFakeTimer.reset(); - }, - - tick: function(millis) { - jasmine.Clock.assertInstalled(); - jasmine.Clock.defaultFakeTimer.tick(millis); - }, - - runFunctionsWithinRange: function(oldMillis, nowMillis) { - jasmine.Clock.defaultFakeTimer.runFunctionsWithinRange(oldMillis, nowMillis); - }, - - scheduleFunction: function(timeoutKey, funcToCall, millis, recurring) { - jasmine.Clock.defaultFakeTimer.scheduleFunction(timeoutKey, funcToCall, millis, recurring); - }, - - useMock: function() { - if (!jasmine.Clock.isInstalled()) { - var spec = jasmine.getEnv().currentSpec; - spec.after(jasmine.Clock.uninstallMock); - - jasmine.Clock.installMock(); - } - }, - - installMock: function() { - jasmine.Clock.installed = jasmine.Clock.defaultFakeTimer; - }, - - uninstallMock: function() { - jasmine.Clock.assertInstalled(); - jasmine.Clock.installed = jasmine.Clock.real; - }, - - real: { - setTimeout: jasmine.getGlobal().setTimeout, - clearTimeout: jasmine.getGlobal().clearTimeout, - setInterval: jasmine.getGlobal().setInterval, - clearInterval: jasmine.getGlobal().clearInterval - }, - - assertInstalled: function() { - if (!jasmine.Clock.isInstalled()) { - throw new Error("Mock clock is not installed, use jasmine.Clock.useMock()"); - } - }, - - isInstalled: function() { - return jasmine.Clock.installed == jasmine.Clock.defaultFakeTimer; - }, - - installed: null -}; -jasmine.Clock.installed = jasmine.Clock.real; - -//else for IE support -jasmine.getGlobal().setTimeout = function(funcToCall, millis) { - if (jasmine.Clock.installed.setTimeout.apply) { - return jasmine.Clock.installed.setTimeout.apply(this, arguments); - } else { - return jasmine.Clock.installed.setTimeout(funcToCall, millis); - } -}; - -jasmine.getGlobal().setInterval = function(funcToCall, millis) { - if (jasmine.Clock.installed.setInterval.apply) { - return jasmine.Clock.installed.setInterval.apply(this, arguments); - } else { - return jasmine.Clock.installed.setInterval(funcToCall, millis); - } -}; - -jasmine.getGlobal().clearTimeout = function(timeoutKey) { - if (jasmine.Clock.installed.clearTimeout.apply) { - return jasmine.Clock.installed.clearTimeout.apply(this, arguments); - } else { - return jasmine.Clock.installed.clearTimeout(timeoutKey); - } -}; - -jasmine.getGlobal().clearInterval = function(timeoutKey) { - if (jasmine.Clock.installed.clearTimeout.apply) { - return jasmine.Clock.installed.clearInterval.apply(this, arguments); - } else { - return jasmine.Clock.installed.clearInterval(timeoutKey); - } -}; - -/** - * @constructor - */ -jasmine.MultiReporter = function() { - this.subReporters_ = []; -}; -jasmine.util.inherit(jasmine.MultiReporter, jasmine.Reporter); - -jasmine.MultiReporter.prototype.addReporter = function(reporter) { - this.subReporters_.push(reporter); -}; - -(function() { - var functionNames = [ - "reportRunnerStarting", - "reportRunnerResults", - "reportSuiteResults", - "reportSpecStarting", - "reportSpecResults", - "log" - ]; - for (var i = 0; i < functionNames.length; i++) { - var functionName = functionNames[i]; - jasmine.MultiReporter.prototype[functionName] = (function(functionName) { - return function() { - for (var j = 0; j < this.subReporters_.length; j++) { - var subReporter = this.subReporters_[j]; - if (subReporter[functionName]) { - subReporter[functionName].apply(subReporter, arguments); - } - } - }; - })(functionName); - } -})(); -/** - * Holds results for a set of Jasmine spec. Allows for the results array to hold another jasmine.NestedResults - * - * @constructor - */ -jasmine.NestedResults = function() { - /** - * The total count of results - */ - this.totalCount = 0; - /** - * Number of passed results - */ - this.passedCount = 0; - /** - * Number of failed results - */ - this.failedCount = 0; - /** - * Was this suite/spec skipped? - */ - this.skipped = false; - /** - * @ignore - */ - this.items_ = []; -}; - -/** - * Roll up the result counts. - * - * @param result - */ -jasmine.NestedResults.prototype.rollupCounts = function(result) { - this.totalCount += result.totalCount; - this.passedCount += result.passedCount; - this.failedCount += result.failedCount; -}; - -/** - * Adds a log message. - * @param values Array of message parts which will be concatenated later. - */ -jasmine.NestedResults.prototype.log = function(values) { - this.items_.push(new jasmine.MessageResult(values)); -}; - -/** - * Getter for the results: message & results. - */ -jasmine.NestedResults.prototype.getItems = function() { - return this.items_; -}; - -/** - * Adds a result, tracking counts (total, passed, & failed) - * @param {jasmine.ExpectationResult|jasmine.NestedResults} result - */ -jasmine.NestedResults.prototype.addResult = function(result) { - if (result.type != 'log') { - if (result.items_) { - this.rollupCounts(result); - } else { - this.totalCount++; - if (result.passed()) { - this.passedCount++; - } else { - this.failedCount++; - } - } - } - this.items_.push(result); -}; - -/** - * @returns {Boolean} True if everything below passed - */ -jasmine.NestedResults.prototype.passed = function() { - return this.passedCount === this.totalCount; -}; -/** - * Base class for pretty printing for expectation results. - */ -jasmine.PrettyPrinter = function() { - this.ppNestLevel_ = 0; -}; - -/** - * Formats a value in a nice, human-readable string. - * - * @param value - */ -jasmine.PrettyPrinter.prototype.format = function(value) { - if (this.ppNestLevel_ > 40) { - throw new Error('jasmine.PrettyPrinter: format() nested too deeply!'); - } - - this.ppNestLevel_++; - try { - if (value === jasmine.undefined) { - this.emitScalar('undefined'); - } else if (value === null) { - this.emitScalar('null'); - } else if (value === jasmine.getGlobal()) { - this.emitScalar(''); - } else if (value.jasmineToString) { - this.emitScalar(value.jasmineToString()); - } else if (typeof value === 'string') { - this.emitString(value); - } else if (jasmine.isSpy(value)) { - this.emitScalar("spy on " + value.identity); - } else if (value instanceof RegExp) { - this.emitScalar(value.toString()); - } else if (typeof value === 'function') { - this.emitScalar('Function'); - } else if (typeof value.nodeType === 'number') { - this.emitScalar('HTMLNode'); - } else if (value instanceof Date) { - this.emitScalar('Date(' + value + ')'); - } else if (value.__Jasmine_been_here_before__) { - this.emitScalar(''); - } else if (jasmine.isArray_(value) || typeof value == 'object') { - value.__Jasmine_been_here_before__ = true; - if (jasmine.isArray_(value)) { - this.emitArray(value); - } else { - this.emitObject(value); - } - delete value.__Jasmine_been_here_before__; - } else { - this.emitScalar(value.toString()); - } - } finally { - this.ppNestLevel_--; - } -}; - -jasmine.PrettyPrinter.prototype.iterateObject = function(obj, fn) { - for (var property in obj) { - if (property == '__Jasmine_been_here_before__') continue; - fn(property, obj.__lookupGetter__ ? (obj.__lookupGetter__(property) !== jasmine.undefined && - obj.__lookupGetter__(property) !== null) : false); - } -}; - -jasmine.PrettyPrinter.prototype.emitArray = jasmine.unimplementedMethod_; -jasmine.PrettyPrinter.prototype.emitObject = jasmine.unimplementedMethod_; -jasmine.PrettyPrinter.prototype.emitScalar = jasmine.unimplementedMethod_; -jasmine.PrettyPrinter.prototype.emitString = jasmine.unimplementedMethod_; - -jasmine.StringPrettyPrinter = function() { - jasmine.PrettyPrinter.call(this); - - this.string = ''; -}; -jasmine.util.inherit(jasmine.StringPrettyPrinter, jasmine.PrettyPrinter); - -jasmine.StringPrettyPrinter.prototype.emitScalar = function(value) { - this.append(value); -}; - -jasmine.StringPrettyPrinter.prototype.emitString = function(value) { - this.append("'" + value + "'"); -}; - -jasmine.StringPrettyPrinter.prototype.emitArray = function(array) { - this.append('[ '); - for (var i = 0; i < array.length; i++) { - if (i > 0) { - this.append(', '); - } - this.format(array[i]); - } - this.append(' ]'); -}; - -jasmine.StringPrettyPrinter.prototype.emitObject = function(obj) { - var self = this; - this.append('{ '); - var first = true; - - this.iterateObject(obj, function(property, isGetter) { - if (first) { - first = false; - } else { - self.append(', '); - } - - self.append(property); - self.append(' : '); - if (isGetter) { - self.append(''); - } else { - self.format(obj[property]); - } - }); - - this.append(' }'); -}; - -jasmine.StringPrettyPrinter.prototype.append = function(value) { - this.string += value; -}; -jasmine.Queue = function(env) { - this.env = env; - this.blocks = []; - this.running = false; - this.index = 0; - this.offset = 0; - this.abort = false; -}; - -jasmine.Queue.prototype.addBefore = function(block) { - this.blocks.unshift(block); -}; - -jasmine.Queue.prototype.add = function(block) { - this.blocks.push(block); -}; - -jasmine.Queue.prototype.insertNext = function(block) { - this.blocks.splice((this.index + this.offset + 1), 0, block); - this.offset++; -}; - -jasmine.Queue.prototype.start = function(onComplete) { - this.running = true; - this.onComplete = onComplete; - this.next_(); -}; - -jasmine.Queue.prototype.isRunning = function() { - return this.running; -}; - -jasmine.Queue.LOOP_DONT_RECURSE = true; - -jasmine.Queue.prototype.next_ = function() { - var self = this; - var goAgain = true; - - while (goAgain) { - goAgain = false; - - if (self.index < self.blocks.length && !this.abort) { - var calledSynchronously = true; - var completedSynchronously = false; - - var onComplete = function () { - if (jasmine.Queue.LOOP_DONT_RECURSE && calledSynchronously) { - completedSynchronously = true; - return; - } - - if (self.blocks[self.index].abort) { - self.abort = true; - } - - self.offset = 0; - self.index++; - - var now = new Date().getTime(); - if (self.env.updateInterval && now - self.env.lastUpdate > self.env.updateInterval) { - self.env.lastUpdate = now; - self.env.setTimeout(function() { - self.next_(); - }, 0); - } else { - if (jasmine.Queue.LOOP_DONT_RECURSE && completedSynchronously) { - goAgain = true; - } else { - self.next_(); - } - } - }; - self.blocks[self.index].execute(onComplete); - - calledSynchronously = false; - if (completedSynchronously) { - onComplete(); - } - - } else { - self.running = false; - if (self.onComplete) { - self.onComplete(); - } - } - } -}; - -jasmine.Queue.prototype.results = function() { - var results = new jasmine.NestedResults(); - for (var i = 0; i < this.blocks.length; i++) { - if (this.blocks[i].results) { - results.addResult(this.blocks[i].results()); - } - } - return results; -}; - - -/** - * Runner - * - * @constructor - * @param {jasmine.Env} env - */ -jasmine.Runner = function(env) { - var self = this; - self.env = env; - self.queue = new jasmine.Queue(env); - self.before_ = []; - self.after_ = []; - self.suites_ = []; -}; - -jasmine.Runner.prototype.execute = function() { - var self = this; - if (self.env.reporter.reportRunnerStarting) { - self.env.reporter.reportRunnerStarting(this); - } - self.queue.start(function () { - self.finishCallback(); - }); -}; - -jasmine.Runner.prototype.beforeEach = function(beforeEachFunction) { - beforeEachFunction.typeName = 'beforeEach'; - this.before_.splice(0,0,beforeEachFunction); -}; - -jasmine.Runner.prototype.afterEach = function(afterEachFunction) { - afterEachFunction.typeName = 'afterEach'; - this.after_.splice(0,0,afterEachFunction); -}; - - -jasmine.Runner.prototype.finishCallback = function() { - this.env.reporter.reportRunnerResults(this); -}; - -jasmine.Runner.prototype.addSuite = function(suite) { - this.suites_.push(suite); -}; - -jasmine.Runner.prototype.add = function(block) { - if (block instanceof jasmine.Suite) { - this.addSuite(block); - } - this.queue.add(block); -}; - -jasmine.Runner.prototype.specs = function () { - var suites = this.suites(); - var specs = []; - for (var i = 0; i < suites.length; i++) { - specs = specs.concat(suites[i].specs()); - } - return specs; -}; - -jasmine.Runner.prototype.suites = function() { - return this.suites_; -}; - -jasmine.Runner.prototype.topLevelSuites = function() { - var topLevelSuites = []; - for (var i = 0; i < this.suites_.length; i++) { - if (!this.suites_[i].parentSuite) { - topLevelSuites.push(this.suites_[i]); - } - } - return topLevelSuites; -}; - -jasmine.Runner.prototype.results = function() { - return this.queue.results(); -}; -/** - * Internal representation of a Jasmine specification, or test. - * - * @constructor - * @param {jasmine.Env} env - * @param {jasmine.Suite} suite - * @param {String} description - */ -jasmine.Spec = function(env, suite, description) { - if (!env) { - throw new Error('jasmine.Env() required'); - } - if (!suite) { - throw new Error('jasmine.Suite() required'); - } - var spec = this; - spec.id = env.nextSpecId ? env.nextSpecId() : null; - spec.env = env; - spec.suite = suite; - spec.description = description; - spec.queue = new jasmine.Queue(env); - - spec.afterCallbacks = []; - spec.spies_ = []; - - spec.results_ = new jasmine.NestedResults(); - spec.results_.description = description; - spec.matchersClass = null; -}; - -jasmine.Spec.prototype.getFullName = function() { - return this.suite.getFullName() + ' ' + this.description + '.'; -}; - - -jasmine.Spec.prototype.results = function() { - return this.results_; -}; - -/** - * All parameters are pretty-printed and concatenated together, then written to the spec's output. - * - * Be careful not to leave calls to jasmine.log in production code. - */ -jasmine.Spec.prototype.log = function() { - return this.results_.log(arguments); -}; - -jasmine.Spec.prototype.runs = function (func) { - var block = new jasmine.Block(this.env, func, this); - this.addToQueue(block); - return this; -}; - -jasmine.Spec.prototype.addToQueue = function (block) { - if (this.queue.isRunning()) { - this.queue.insertNext(block); - } else { - this.queue.add(block); - } -}; - -/** - * @param {jasmine.ExpectationResult} result - */ -jasmine.Spec.prototype.addMatcherResult = function(result) { - this.results_.addResult(result); -}; - -jasmine.Spec.prototype.expect = function(actual) { - var positive = new (this.getMatchersClass_())(this.env, actual, this); - positive.not = new (this.getMatchersClass_())(this.env, actual, this, true); - return positive; -}; - -/** - * Waits a fixed time period before moving to the next block. - * - * @deprecated Use waitsFor() instead - * @param {Number} timeout milliseconds to wait - */ -jasmine.Spec.prototype.waits = function(timeout) { - var waitsFunc = new jasmine.WaitsBlock(this.env, timeout, this); - this.addToQueue(waitsFunc); - return this; -}; - -/** - * Waits for the latchFunction to return true before proceeding to the next block. - * - * @param {Function} latchFunction - * @param {String} optional_timeoutMessage - * @param {Number} optional_timeout - */ -jasmine.Spec.prototype.waitsFor = function(latchFunction, optional_timeoutMessage, optional_timeout) { - var latchFunction_ = null; - var optional_timeoutMessage_ = null; - var optional_timeout_ = null; - - for (var i = 0; i < arguments.length; i++) { - var arg = arguments[i]; - switch (typeof arg) { - case 'function': - latchFunction_ = arg; - break; - case 'string': - optional_timeoutMessage_ = arg; - break; - case 'number': - optional_timeout_ = arg; - break; - } - } - - var waitsForFunc = new jasmine.WaitsForBlock(this.env, optional_timeout_, latchFunction_, optional_timeoutMessage_, this); - this.addToQueue(waitsForFunc); - return this; -}; - -jasmine.Spec.prototype.fail = function (e) { - var expectationResult = new jasmine.ExpectationResult({ - passed: false, - message: e ? jasmine.util.formatException(e) : 'Exception', - trace: { stack: e.stack } - }); - this.results_.addResult(expectationResult); -}; - -jasmine.Spec.prototype.getMatchersClass_ = function() { - return this.matchersClass || this.env.matchersClass; -}; - -jasmine.Spec.prototype.addMatchers = function(matchersPrototype) { - var parent = this.getMatchersClass_(); - var newMatchersClass = function() { - parent.apply(this, arguments); - }; - jasmine.util.inherit(newMatchersClass, parent); - jasmine.Matchers.wrapInto_(matchersPrototype, newMatchersClass); - this.matchersClass = newMatchersClass; -}; - -jasmine.Spec.prototype.finishCallback = function() { - this.env.reporter.reportSpecResults(this); -}; - -jasmine.Spec.prototype.finish = function(onComplete) { - this.removeAllSpies(); - this.finishCallback(); - if (onComplete) { - onComplete(); - } -}; - -jasmine.Spec.prototype.after = function(doAfter) { - if (this.queue.isRunning()) { - this.queue.add(new jasmine.Block(this.env, doAfter, this)); - } else { - this.afterCallbacks.unshift(doAfter); - } -}; - -jasmine.Spec.prototype.execute = function(onComplete) { - var spec = this; - if (!spec.env.specFilter(spec)) { - spec.results_.skipped = true; - spec.finish(onComplete); - return; - } - - this.env.reporter.reportSpecStarting(this); - - spec.env.currentSpec = spec; - - spec.addBeforesAndAftersToQueue(); - - spec.queue.start(function () { - spec.finish(onComplete); - }); -}; - -jasmine.Spec.prototype.addBeforesAndAftersToQueue = function() { - var runner = this.env.currentRunner(); - var i; - - for (var suite = this.suite; suite; suite = suite.parentSuite) { - for (i = 0; i < suite.before_.length; i++) { - this.queue.addBefore(new jasmine.Block(this.env, suite.before_[i], this)); - } - } - for (i = 0; i < runner.before_.length; i++) { - this.queue.addBefore(new jasmine.Block(this.env, runner.before_[i], this)); - } - for (i = 0; i < this.afterCallbacks.length; i++) { - this.queue.add(new jasmine.Block(this.env, this.afterCallbacks[i], this)); - } - for (suite = this.suite; suite; suite = suite.parentSuite) { - for (i = 0; i < suite.after_.length; i++) { - this.queue.add(new jasmine.Block(this.env, suite.after_[i], this)); - } - } - for (i = 0; i < runner.after_.length; i++) { - this.queue.add(new jasmine.Block(this.env, runner.after_[i], this)); - } -}; - -jasmine.Spec.prototype.explodes = function() { - throw 'explodes function should not have been called'; -}; - -jasmine.Spec.prototype.spyOn = function(obj, methodName, ignoreMethodDoesntExist) { - if (obj == jasmine.undefined) { - throw "spyOn could not find an object to spy upon for " + methodName + "()"; - } - - if (!ignoreMethodDoesntExist && obj[methodName] === jasmine.undefined) { - throw methodName + '() method does not exist'; - } - - if (!ignoreMethodDoesntExist && obj[methodName] && obj[methodName].isSpy) { - throw new Error(methodName + ' has already been spied upon'); - } - - var spyObj = jasmine.createSpy(methodName); - - this.spies_.push(spyObj); - spyObj.baseObj = obj; - spyObj.methodName = methodName; - spyObj.originalValue = obj[methodName]; - - obj[methodName] = spyObj; - - return spyObj; -}; - -jasmine.Spec.prototype.removeAllSpies = function() { - for (var i = 0; i < this.spies_.length; i++) { - var spy = this.spies_[i]; - spy.baseObj[spy.methodName] = spy.originalValue; - } - this.spies_ = []; -}; - -/** - * Internal representation of a Jasmine suite. - * - * @constructor - * @param {jasmine.Env} env - * @param {String} description - * @param {Function} specDefinitions - * @param {jasmine.Suite} parentSuite - */ -jasmine.Suite = function(env, description, specDefinitions, parentSuite) { - var self = this; - self.id = env.nextSuiteId ? env.nextSuiteId() : null; - self.description = description; - self.queue = new jasmine.Queue(env); - self.parentSuite = parentSuite; - self.env = env; - self.before_ = []; - self.after_ = []; - self.children_ = []; - self.suites_ = []; - self.specs_ = []; -}; - -jasmine.Suite.prototype.getFullName = function() { - var fullName = this.description; - for (var parentSuite = this.parentSuite; parentSuite; parentSuite = parentSuite.parentSuite) { - fullName = parentSuite.description + ' ' + fullName; - } - return fullName; -}; - -jasmine.Suite.prototype.finish = function(onComplete) { - this.env.reporter.reportSuiteResults(this); - this.finished = true; - if (typeof(onComplete) == 'function') { - onComplete(); - } -}; - -jasmine.Suite.prototype.beforeEach = function(beforeEachFunction) { - beforeEachFunction.typeName = 'beforeEach'; - this.before_.unshift(beforeEachFunction); -}; - -jasmine.Suite.prototype.afterEach = function(afterEachFunction) { - afterEachFunction.typeName = 'afterEach'; - this.after_.unshift(afterEachFunction); -}; - -jasmine.Suite.prototype.results = function() { - return this.queue.results(); -}; - -jasmine.Suite.prototype.add = function(suiteOrSpec) { - this.children_.push(suiteOrSpec); - if (suiteOrSpec instanceof jasmine.Suite) { - this.suites_.push(suiteOrSpec); - this.env.currentRunner().addSuite(suiteOrSpec); - } else { - this.specs_.push(suiteOrSpec); - } - this.queue.add(suiteOrSpec); -}; - -jasmine.Suite.prototype.specs = function() { - return this.specs_; -}; - -jasmine.Suite.prototype.suites = function() { - return this.suites_; -}; - -jasmine.Suite.prototype.children = function() { - return this.children_; -}; - -jasmine.Suite.prototype.execute = function(onComplete) { - var self = this; - this.queue.start(function () { - self.finish(onComplete); - }); -}; -jasmine.WaitsBlock = function(env, timeout, spec) { - this.timeout = timeout; - jasmine.Block.call(this, env, null, spec); -}; - -jasmine.util.inherit(jasmine.WaitsBlock, jasmine.Block); - -jasmine.WaitsBlock.prototype.execute = function (onComplete) { - if (jasmine.VERBOSE) { - this.env.reporter.log('>> Jasmine waiting for ' + this.timeout + ' ms...'); - } - this.env.setTimeout(function () { - onComplete(); - }, this.timeout); -}; -/** - * A block which waits for some condition to become true, with timeout. - * - * @constructor - * @extends jasmine.Block - * @param {jasmine.Env} env The Jasmine environment. - * @param {Number} timeout The maximum time in milliseconds to wait for the condition to become true. - * @param {Function} latchFunction A function which returns true when the desired condition has been met. - * @param {String} message The message to display if the desired condition hasn't been met within the given time period. - * @param {jasmine.Spec} spec The Jasmine spec. - */ -jasmine.WaitsForBlock = function(env, timeout, latchFunction, message, spec) { - this.timeout = timeout || env.defaultTimeoutInterval; - this.latchFunction = latchFunction; - this.message = message; - this.totalTimeSpentWaitingForLatch = 0; - jasmine.Block.call(this, env, null, spec); -}; -jasmine.util.inherit(jasmine.WaitsForBlock, jasmine.Block); - -jasmine.WaitsForBlock.TIMEOUT_INCREMENT = 10; - -jasmine.WaitsForBlock.prototype.execute = function(onComplete) { - if (jasmine.VERBOSE) { - this.env.reporter.log('>> Jasmine waiting for ' + (this.message || 'something to happen')); - } - var latchFunctionResult; - try { - latchFunctionResult = this.latchFunction.apply(this.spec); - } catch (e) { - this.spec.fail(e); - onComplete(); - return; - } - - if (latchFunctionResult) { - onComplete(); - } else if (this.totalTimeSpentWaitingForLatch >= this.timeout) { - var message = 'timed out after ' + this.timeout + ' msec waiting for ' + (this.message || 'something to happen'); - this.spec.fail({ - name: 'timeout', - message: message - }); - - this.abort = true; - onComplete(); - } else { - this.totalTimeSpentWaitingForLatch += jasmine.WaitsForBlock.TIMEOUT_INCREMENT; - var self = this; - this.env.setTimeout(function() { - self.execute(onComplete); - }, jasmine.WaitsForBlock.TIMEOUT_INCREMENT); - } -}; - -jasmine.version_= { - "major": 1, - "minor": 2, - "build": 0, - "revision": 1333310630, - "release_candidate": 1 -}; diff --git a/plugins/org.apache.cordova.core.file-transfer/test/autotest/pages/filetransfer.html b/plugins/org.apache.cordova.core.file-transfer/test/autotest/pages/filetransfer.html deleted file mode 100644 index 60cfcff..0000000 --- a/plugins/org.apache.cordova.core.file-transfer/test/autotest/pages/filetransfer.html +++ /dev/null @@ -1,91 +0,0 @@ - - - - - - - Cordova: File API Specs - - - - - - - - - - - - - - - - - - - - - - - - - - Back - - - diff --git a/plugins/org.apache.cordova.core.file-transfer/test/autotest/test-runner.js b/plugins/org.apache.cordova.core.file-transfer/test/autotest/test-runner.js deleted file mode 100644 index f72b3cc..0000000 --- a/plugins/org.apache.cordova.core.file-transfer/test/autotest/test-runner.js +++ /dev/null @@ -1,62 +0,0 @@ -/* - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - * -*/ - -if (window.sessionStorage != null) { - window.sessionStorage.clear(); -} - -// Timeout is 2 seconds to allow physical devices enough -// time to query the response. This is important for some -// Android devices. -var Tests = function() {}; -Tests.TEST_TIMEOUT = 7500; - -// Creates a spy that will fail if called. -function createDoNotCallSpy(name, opt_extraMessage) { - return jasmine.createSpy().andCallFake(function() { - var errorMessage = name + ' should not have been called.'; - if (arguments.length) { - errorMessage += ' Got args: ' + JSON.stringify(arguments); - } - if (opt_extraMessage) { - errorMessage += '\n' + opt_extraMessage; - } - expect(false).toBe(true, errorMessage); - }); -} - -// Waits for any of the given spys to be called. -// Last param may be a custom timeout duration. -function waitsForAny() { - var spys = [].slice.call(arguments); - var timeout = Tests.TEST_TIMEOUT; - if (typeof spys[spys.length - 1] == 'number') { - timeout = spys.pop(); - } - waitsFor(function() { - for (var i = 0; i < spys.length; ++i) { - if (spys[i].wasCalled) { - return true; - } - } - return false; - }, "Expecting callbacks to be called.", timeout); -} diff --git a/plugins/org.apache.cordova.core.file-transfer/test/autotest/tests/filetransfer.tests.js b/plugins/org.apache.cordova.core.file-transfer/test/autotest/tests/filetransfer.tests.js deleted file mode 100644 index 69eaaa9..0000000 --- a/plugins/org.apache.cordova.core.file-transfer/test/autotest/tests/filetransfer.tests.js +++ /dev/null @@ -1,753 +0,0 @@ -/* - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - * -*/ - -describe('FileTransfer', function() { - // https://github.com/apache/cordova-labs/tree/cordova-filetransfer - var server = "http://cordova-filetransfer.jitsu.com"; - var server_with_credentials = "http://cordova_user:cordova_password@cordova-filetransfer.jitsu.com"; - - // deletes and re-creates the specified content - var writeFile = function(fileName, fileContent, success, error) { - deleteFile(fileName, function() { - root.getFile(fileName, {create: true}, function(fileEntry) { - fileEntry.createWriter(function (writer) { - - writer.onwrite = function(evt) { - success(fileEntry); - }; - - writer.onabort = function(evt) { - error(evt); - }; - - writer.error = function(evt) { - error(evt); - }; - - writer.write(fileContent + "\n"); - }, error); - }, error); - }); - }; - - var readFileEntry = function(entry, success, error) { - entry.file(function(file) { - var reader = new FileReader(); - reader.onerror = error; - reader.onload = function(e) { - success(reader.result); - }; - reader.readAsText(file); - }, error); - }; - - var getMalformedUrl = function() { - if (device.platform.match(/Android/i)) { - // bad protocol causes a MalformedUrlException on Android - return "httpssss://example.com"; - } else { - // iOS doesn't care about protocol, space in hostname causes error - return "httpssss://exa mple.com"; - } - }; - - // deletes file, if it exists, then invokes callback - var deleteFile = function(fileName, callback) { - callback = callback || function() {}; - var spy = jasmine.createSpy().andCallFake(callback); - root.getFile(fileName, null, - // remove file system entry - function(entry) { - entry.remove(spy, spy); - }, - // doesn't exist - spy); - waitsFor(function() { return spy.wasCalled; }, Tests.TEST_TIMEOUT); - }; - - it("filetransfer.spec.1 should exist and be constructable", function() { - var ft = new FileTransfer(); - expect(ft).toBeDefined(); - }); - it("filetransfer.spec.2 should contain proper functions", function() { - var ft = new FileTransfer(); - expect(typeof ft.upload).toBe('function'); - expect(typeof ft.download).toBe('function'); - }); - describe('FileTransferError', function() { - it("filetransfer.spec.3 FileTransferError constants should be defined", function() { - expect(FileTransferError.FILE_NOT_FOUND_ERR).toBe(1); - expect(FileTransferError.INVALID_URL_ERR).toBe(2); - expect(FileTransferError.CONNECTION_ERR).toBe(3); - }); - }); - - describe('download method', function() { - - // NOTE: if download tests are failing, check the white list - // - // - // - // - - it("filetransfer.spec.4 should be able to download a file using http", function() { - var fail = createDoNotCallSpy('downloadFail'); - var remoteFile = server + "/robots.txt" - var localFileName = remoteFile.substring(remoteFile.lastIndexOf('/')+1); - var lastProgressEvent = null; - - var downloadWin = jasmine.createSpy().andCallFake(function(entry) { - expect(entry.name).toBe(localFileName); - expect(lastProgressEvent.loaded).toBeGreaterThan(1); - }); - - this.after(function() { - deleteFile(localFileName); - }); - runs(function() { - var ft = new FileTransfer(); - ft.onprogress = function(e) { - lastProgressEvent = e; - }; - ft.download(remoteFile, root.fullPath + "/" + localFileName, downloadWin, fail); - }); - - waitsForAny(downloadWin, fail); - }); - it("filetransfer.spec.5 should be able to download a file using http basic auth", function() { - var fail = createDoNotCallSpy('downloadFail'); - var remoteFile = server_with_credentials + "/download_basic_auth" - var localFileName = remoteFile.substring(remoteFile.lastIndexOf('/')+1); - var lastProgressEvent = null; - - var downloadWin = jasmine.createSpy().andCallFake(function(entry) { - expect(entry.name).toBe(localFileName); - expect(lastProgressEvent.loaded).toBeGreaterThan(1); - }); - - this.after(function() { - deleteFile(localFileName); - }); - runs(function() { - var ft = new FileTransfer(); - ft.onprogress = function(e) { - lastProgressEvent = e; - }; - ft.download(remoteFile, root.fullPath + "/" + localFileName, downloadWin, fail); - }); - - waitsForAny(downloadWin, fail); - }); - it("filetransfer.spec.6 should get http status on basic auth failure", function() { - var downloadWin = createDoNotCallSpy('downloadWin'); - - var remoteFile = server + "/download_basic_auth"; - var localFileName = remoteFile.substring(remoteFile.lastIndexOf('/')+1); - var downloadFail = jasmine.createSpy().andCallFake(function(error) { - expect(error.http_status).toBe(401); - expect(error.http_status).not.toBe(404, "Ensure " + remoteFile + " is in the white list"); - }); - - this.after(function() { - deleteFile(localFileName); - }); - runs(function() { - var ft = new FileTransfer(); - ft.download(remoteFile, root.fullPath + "/" + localFileName, downloadWin, downloadFail); - }); - - waitsForAny(downloadWin, downloadFail); - }); - it("filetransfer.spec.7 should be able to download a file using file:// (when hosted from file://)", function() { - var fail = createDoNotCallSpy('downloadFail'); - var remoteFile = window.location.href.replace(/\?.*/, '').replace(/ /g, '%20'); - var localFileName = remoteFile.substring(remoteFile.lastIndexOf('/')+1); - var lastProgressEvent = null; - - if (!/^file/.exec(remoteFile)) { - expect(remoteFile).toMatch(/^file:/); - return; - } - - var downloadWin = jasmine.createSpy().andCallFake(function(entry) { - expect(entry.name).toBe(localFileName); - expect(lastProgressEvent.loaded).toBeGreaterThan(1); - }); - - this.after(function() { - deleteFile(localFileName); - }); - - var ft = new FileTransfer(); - ft.onprogress = function(e) { - lastProgressEvent = e; - }; - ft.download(remoteFile, root.fullPath + "/" + localFileName, downloadWin, fail); - - waitsForAny(downloadWin, fail); - }); - it("filetransfer.spec.8 should be able to download a file using https", function() { - var remoteFile = "https://www.apache.org/licenses/"; - var localFileName = 'httpstest.html'; - var downloadFail = createDoNotCallSpy('downloadFail', 'Ensure ' + remoteFile + ' is in the white-list'); - var fileFail = createDoNotCallSpy('fileFail'); - var downloadWin = function(entry) { - readFileEntry(entry, fileWin, fileFail); - }; - var fileWin = jasmine.createSpy().andCallFake(function(content) { - expect(content).toMatch(/The Apache Software Foundation/); - }); - - this.after(function() { - deleteFile(localFileName); - }); - runs(function() { - var ft = new FileTransfer(); - ft.download(remoteFile, root.fullPath + "/" + localFileName, downloadWin, downloadFail); - }); - - waitsForAny(fileWin, downloadFail, fileFail); - }); - it("filetransfer.spec.9 should not leave partial file due to abort", function() { - var downloadWin = createDoNotCallSpy('downloadWin'); - var remoteFile = 'http://cordova.apache.org/downloads/logos_2.zip'; - var localFileName = remoteFile.substring(remoteFile.lastIndexOf('/')+1); - var startTime = +new Date(); - - var downloadFail = jasmine.createSpy().andCallFake(function(e) { - expect(e.code).toBe(FileTransferError.ABORT_ERR); - var didNotExistSpy = jasmine.createSpy(); - var existedSpy = createDoNotCallSpy('file existed after abort'); - root.getFile(localFileName, null, existedSpy, didNotExistSpy); - waitsForAny(didNotExistSpy, existedSpy); - }); - - runs(function() { - var ft = new FileTransfer(); - ft.onprogress = function(e) { - if (e.loaded > 0) { - ft.abort(); - } - }; - ft.download(remoteFile, root.fullPath + "/" + localFileName, downloadWin, downloadFail); - }); - - waitsForAny(downloadWin, downloadFail); - }); - it("filetransfer.spec.10 should be stopped by abort() right away", function() { - var downloadWin = createDoNotCallSpy('downloadWin'); - var remoteFile = 'http://cordova.apache.org/downloads/BlueZedEx.mp3'; - var localFileName = remoteFile.substring(remoteFile.lastIndexOf('/')+1); - var startTime = +new Date(); - - var downloadFail = jasmine.createSpy().andCallFake(function(e) { - expect(e.code).toBe(FileTransferError.ABORT_ERR); - expect(new Date() - startTime).toBeLessThan(300); - }); - - this.after(function() { - deleteFile(localFileName); - }); - runs(function() { - var ft = new FileTransfer(); - ft.abort(); // should be a no-op. - ft.download(remoteFile, root.fullPath + "/" + localFileName, downloadWin, downloadFail); - ft.abort(); - ft.abort(); // should be a no-op. - }); - - waitsForAny(downloadWin, downloadFail); - }); - it("filetransfer.spec.11 should call the error callback on abort()", function() { - var downloadWin = createDoNotCallSpy('downloadWin'); - var downloadFail = jasmine.createSpy().andCallFake(function(e) { console.log("Abort called") }); - var remoteFile = 'http://cordova.apache.org/downloads/BlueZedEx.mp3'; - var localFileName = remoteFile.substring(remoteFile.lastIndexOf('/')+1); - var startTime = +new Date(); - - this.after(function() { - deleteFile(localFileName); - }); - runs(function() { - var ft = new FileTransfer(); - ft.abort(); // should be a no-op. - ft.download(remoteFile, root.fullPath + "/" + localFileName, downloadWin, downloadFail); - ft.abort(); - ft.abort(); // should be a no-op. - }); - - waitsForAny(downloadFail); - }); - it("filetransfer.spec.12 should get http status on failure", function() { - var downloadWin = createDoNotCallSpy('downloadWin'); - - var remoteFile = server + "/404"; - var localFileName = remoteFile.substring(remoteFile.lastIndexOf('/')+1); - var downloadFail = jasmine.createSpy().andCallFake(function(error) { - expect(error.http_status).toBe(404); - expect(error.http_status).not.toBe(401, "Ensure " + remoteFile + " is in the white list"); - }); - - this.after(function() { - deleteFile(localFileName); - }); - runs(function() { - var ft = new FileTransfer(); - ft.download(remoteFile, root.fullPath + "/" + localFileName, downloadWin, downloadFail); - }); - - waitsForAny(downloadWin, downloadFail); - }); - it("filetransfer.spec.13 should get response body on failure", function() { - var downloadWin = createDoNotCallSpy('downloadWin'); - - var remoteFile = server + "/404"; - var localFileName = remoteFile.substring(remoteFile.lastIndexOf('/')+1); - var downloadFail = jasmine.createSpy().andCallFake(function(error) { - expect(error.body).toBeDefined(); - expect(error.body).toEqual('You requested a 404\n'); - }); - - this.after(function() { - deleteFile(localFileName); - }); - runs(function() { - var ft = new FileTransfer(); - ft.download(remoteFile, root.fullPath + "/" + localFileName, downloadWin, downloadFail); - }); - - waitsForAny(downloadWin, downloadFail); - }); - it("filetransfer.spec.14 should handle malformed urls", function() { - var downloadWin = createDoNotCallSpy('downloadWin'); - - var remoteFile = getMalformedUrl(); - var localFileName = "download_malformed_url.txt"; - var downloadFail = jasmine.createSpy().andCallFake(function(error) { - // Note: Android needs the bad protocol to be added to the access list - // won't match because ^https?:// is prepended to the regex - // The bad protocol must begin with http to avoid automatic prefix - expect(error.http_status).not.toBe(401, "Ensure " + remoteFile + " is in the white list"); - expect(error.code).toBe(FileTransferError.INVALID_URL_ERR); - }); - - this.after(function() { - deleteFile(localFileName); - }); - runs(function() { - var ft = new FileTransfer(); - ft.download(remoteFile, root.fullPath + "/" + localFileName, downloadWin, downloadFail); - }); - - waitsForAny(downloadWin, downloadFail); - }); - it("filetransfer.spec.15 should handle unknown host", function() { - var downloadWin = createDoNotCallSpy('downloadWin'); - - var remoteFile = "http://foobar.apache.org/index.html"; - var localFileName = remoteFile.substring(remoteFile.lastIndexOf('/')+1); - var downloadFail = jasmine.createSpy().andCallFake(function(error) { - expect(error.code).toBe(FileTransferError.CONNECTION_ERR); - }); - - runs(function() { - var ft = new FileTransfer(); - ft.download(remoteFile, root.fullPath + "/" + localFileName, downloadWin, downloadFail); - }); - - waitsForAny(downloadWin, downloadFail); - }); - it("filetransfer.spec.16 should handle bad file path", function() { - var downloadWin = createDoNotCallSpy('downloadWin'); - - var remoteFile = server; - var badFilePath = "c:\\54321"; - var downloadFail = jasmine.createSpy().andCallFake(function(error) { - expect(error.code).toBe(FileTransferError.FILE_NOT_FOUND_ERR); - }); - - runs(function() { - var ft = new FileTransfer(); - ft.download(remoteFile, badFilePath, downloadWin, downloadFail); - }); - - waitsForAny(downloadWin, downloadFail); - }); - it("filetransfer.spec.17 progress should work with gzip encoding", function() { - var downloadFail = createDoNotCallSpy('downloadFail'); - var remoteFile = "http://www.apache.org/"; - var localFileName = "index.html"; - var lastProgressEvent = null; - - var downloadWin = jasmine.createSpy().andCallFake(function(entry) { - expect(entry.name).toBe(localFileName); - expect(lastProgressEvent.loaded).toBeGreaterThan(1, 'loaded'); - expect(lastProgressEvent.total).not.toBeLessThan(lastProgressEvent.loaded); - expect(lastProgressEvent.lengthComputable).toBe(true, 'lengthComputable'); - }); - - this.after(function() { - deleteFile(localFileName); - }); - runs(function() { - var ft = new FileTransfer(); - ft.onprogress = function(e) { - lastProgressEvent = e; - }; - ft.download(remoteFile, root.fullPath + "/" + localFileName, downloadWin, downloadFail); - }); - waitsForAny(downloadWin, downloadFail); - }); - }); - describe('upload method', function() { - it("filetransfer.spec.18 should be able to upload a file", function() { - var remoteFile = server + "/upload"; - var localFileName = "upload.txt"; - var fileContents = 'This file should upload'; - - var fileFail = createDoNotCallSpy('fileFail'); - var uploadFail = createDoNotCallSpy('uploadFail', "Ensure " + remoteFile + " is in the white list"); - var lastProgressEvent = null; - - var uploadWin = jasmine.createSpy().andCallFake(function(uploadResult) { - expect(uploadResult.bytesSent).toBeGreaterThan(0); - expect(uploadResult.responseCode).toBe(200); - expect(uploadResult.response).toMatch(/fields:\s*{\s*value1.*/); - }); - - var fileWin = function(fileEntry) { - ft = new FileTransfer(); - - var options = new FileUploadOptions(); - options.fileKey = "file"; - options.fileName = localFileName; - options.mimeType = "text/plain"; - - var params = new Object(); - params.value1 = "test"; - params.value2 = "param"; - options.params = params; - - ft.onprogress = function(e) { - expect(e.lengthComputable).toBe(true); - expect(e.total).toBeGreaterThan(0); - expect(e.loaded).toBeGreaterThan(0); - lastProgressEvent = e; - }; - - // removing options cause Android to timeout - ft.upload(fileEntry.fullPath, remoteFile, uploadWin, uploadFail, options); - }; - - this.after(function() { - deleteFile(localFileName); - }); - runs(function() { - writeFile(localFileName, fileContents, fileWin, fileFail); - }); - - waitsForAny(uploadWin, uploadFail, fileFail); - runs(function() { - expect(lastProgressEvent).not.toBeNull('expected progress events'); - }); - }); - it("filetransfer.spec.19 should be able to upload a file with http basic auth", function() { - var remoteFile = server_with_credentials + "/upload_basic_auth"; - var localFileName = "upload.txt"; - var fileContents = 'This file should upload'; - - var fileFail = createDoNotCallSpy('fileFail'); - var uploadFail = createDoNotCallSpy('uploadFail', "Ensure " + remoteFile + " is in the white list"); - var lastProgressEvent = null; - - var uploadWin = jasmine.createSpy().andCallFake(function(uploadResult) { - expect(uploadResult.bytesSent).toBeGreaterThan(0); - expect(uploadResult.responseCode).toBe(200); - expect(uploadResult.response).toMatch(/fields:\s*{\s*value1.*/); - }); - - var fileWin = function(fileEntry) { - ft = new FileTransfer(); - - var options = new FileUploadOptions(); - options.fileKey = "file"; - options.fileName = localFileName; - options.mimeType = "text/plain"; - - var params = new Object(); - params.value1 = "test"; - params.value2 = "param"; - options.params = params; - - ft.onprogress = function(e) { - expect(e.lengthComputable).toBe(true); - expect(e.total).toBeGreaterThan(0); - expect(e.loaded).toBeGreaterThan(0); - lastProgressEvent = e; - }; - - // removing options cause Android to timeout - ft.upload(fileEntry.fullPath, remoteFile, uploadWin, uploadFail, options); - }; - - this.after(function() { - deleteFile(localFileName); - }); - runs(function() { - writeFile(localFileName, fileContents, fileWin, fileFail); - }); - - waitsForAny(uploadWin, uploadFail, fileFail); - runs(function() { - expect(lastProgressEvent).not.toBeNull('expected progress events'); - }); - }); - it("filetransfer.spec.6 should get http status on basic auth failure", function() { - var fileFail = createDoNotCallSpy('fileFail'); - var uploadWin = createDoNotCallSpy('uploadWin'); - - var remoteFile = server + "/upload_basic_auth"; - var localFileName = "upload_expect_fail.txt"; - var uploadFail = jasmine.createSpy().andCallFake(function(error) { - expect(error.http_status).toBe(401); - expect(error.http_status).not.toBe(404, "Ensure " + remoteFile + " is in the white list"); - }); - - var fileWin = function(fileEntry) { - var ft = new FileTransfer(); - - var options = new FileUploadOptions(); - options.fileKey="file"; - options.fileName=fileEntry.name; - options.mimeType="text/plain"; - - ft.upload(fileEntry.fullPath, remoteFile, uploadWin, uploadFail, options); - }; - - this.after(function() { - deleteFile(localFileName); - }); - runs(function() { - writeFile(localFileName, "this file should fail to upload", fileWin, fileFail); - }); - - waitsForAny(uploadWin, uploadFail, fileFail); - }); - it("filetransfer.spec.21 should be stopped by abort() right away.", function() { - var remoteFile = server + "/upload"; - var localFileName = "upload.txt"; - - var fileFail = createDoNotCallSpy('fileFail'); - var uploadWin = createDoNotCallSpy('uploadWin', 'Should have been aborted'); - var startTime; - - var uploadFail = jasmine.createSpy().andCallFake(function(e) { - expect(e.code).toBe(FileTransferError.ABORT_ERR); - expect(new Date() - startTime).toBeLessThan(300); - }); - - var fileWin = function(fileEntry) { - ft = new FileTransfer(); - - var options = new FileUploadOptions(); - options.fileKey = "file"; - options.fileName = localFileName; - options.mimeType = "text/plain"; - - startTime = +new Date(); - // removing options cause Android to timeout - ft.abort(); // should be a no-op. - ft.upload(fileEntry.fullPath, remoteFile, uploadWin, uploadFail, options); - ft.abort(); - ft.abort(); // should be a no-op. - }; - - this.after(function() { - deleteFile(localFileName); - }); - runs(function() { - writeFile(localFileName, new Array(10000).join('aborttest!'), fileWin, fileFail); - }); - - waitsForAny(uploadWin, uploadFail, fileFail); - }); - it("filetransfer.spec.12 should get http status on failure", function() { - var fileFail = createDoNotCallSpy('fileFail'); - var uploadWin = createDoNotCallSpy('uploadWin'); - - var remoteFile = server + "/403"; - var localFileName = "upload_expect_fail.txt"; - var uploadFail = jasmine.createSpy().andCallFake(function(error) { - expect(error.http_status).toBe(403); - expect(error.http_status).not.toBe(401, "Ensure " + remoteFile + " is in the white list"); - }); - - var fileWin = function(fileEntry) { - var ft = new FileTransfer(); - - var options = new FileUploadOptions(); - options.fileKey="file"; - options.fileName=fileEntry.name; - options.mimeType="text/plain"; - - ft.upload(fileEntry.fullPath, remoteFile, uploadWin, uploadFail, options); - }; - - this.after(function() { - deleteFile(localFileName); - }); - runs(function() { - writeFile(localFileName, "this file should fail to upload", fileWin, fileFail); - }); - - waitsForAny(uploadWin, uploadFail, fileFail); - }); - it("filetransfer.spec.14 should handle malformed urls", function() { - var fileFail = createDoNotCallSpy('fileFail'); - var uploadWin = createDoNotCallSpy('uploadWin'); - - var remoteFile = getMalformedUrl(); - var localFileName = "malformed_url.txt"; - var uploadFail = jasmine.createSpy().andCallFake(function(error) { - expect(error.code).toBe(FileTransferError.INVALID_URL_ERR); - expect(error.http_status).not.toBe(401, "Ensure " + remoteFile + " is in the white list"); - }); - var fileWin = function(fileEntry) { - var ft = new FileTransfer(); - ft.upload(fileEntry.fullPath, remoteFile, uploadWin, uploadFail, {}); - }; - - this.after(function() { - deleteFile(localFileName); - }); - runs(function() { - writeFile(localFileName, "Some content", fileWin, fileFail); - }); - - waitsForAny(uploadWin, uploadFail, fileFail); - }); - it("filetransfer.spec.15 should handle unknown host", function() { - var fileFail = createDoNotCallSpy('fileFail'); - var uploadWin = createDoNotCallSpy('uploadWin'); - - var remoteFile = "http://foobar.apache.org/robots.txt"; - var localFileName = remoteFile.substring(remoteFile.lastIndexOf('/')+1); - var uploadFail = jasmine.createSpy().andCallFake(function(error) { - expect(error.code).toBe(FileTransferError.CONNECTION_ERR); - expect(error.http_status).not.toBe(401, "Ensure " + remoteFile + " is in the white list"); - }); - var fileWin = function(fileEntry) { - var ft = new FileTransfer(); - ft.upload(fileEntry.fullPath, remoteFile, uploadWin, uploadFail, {}); - }; - - this.after(function() { - deleteFile(localFileName); - }); - runs(function() { - writeFile(localFileName, "# allow all", fileWin, fileFail); - }); - - waitsForAny(uploadWin, uploadFail, fileFail); - }); - it("filetransfer.spec.25 should handle missing file", function() { - var uploadWin = createDoNotCallSpy('uploadWin'); - - var remoteFile = server + "/upload"; - var localFileName = "does_not_exist.txt"; - - var uploadFail = jasmine.createSpy().andCallFake(function(error) { - expect(error.code).toBe(FileTransferError.FILE_NOT_FOUND_ERR); - expect(error.http_status).not.toBe(401, "Ensure " + remoteFile + " is in the white list"); - }); - - runs(function() { - var ft = new FileTransfer(); - ft.upload(root.fullPath + "/" + localFileName, remoteFile, uploadWin, uploadFail); - }); - - waitsForAny(uploadWin, uploadFail); - }); - it("filetransfer.spec.16 should handle bad file path", function() { - var uploadWin = createDoNotCallSpy('uploadWin'); - - var remoteFile = server + "/upload"; - - var uploadFail = jasmine.createSpy().andCallFake(function(error) { - expect(error.code).toBe(FileTransferError.FILE_NOT_FOUND_ERR); - expect(error.http_status).not.toBe(401, "Ensure " + remoteFile + " is in the white list"); - }); - - runs(function() { - var ft = new FileTransfer(); - ft.upload("/usr/local/bad/file/path.txt", remoteFile, uploadWin, uploadFail); - }); - - waitsForAny(uploadWin, uploadFail); - }); - it("filetransfer.spec.27 should be able to set custom headers", function() { - var remoteFile = "http://whatheaders.com"; - var localFileName = "upload.txt"; - - var fileFail = function() {}; - var uploadFail = createDoNotCallSpy('uploadFail', "Ensure " + remoteFile + " is in the white list and that Content-Length header is being set."); - - var uploadWin = jasmine.createSpy().andCallFake(function(uploadResult) { - expect(uploadResult.bytesSent).toBeGreaterThan(0); - expect(uploadResult.responseCode).toBe(200); - expect(uploadResult.response).toBeDefined(); - var responseHtml = decodeURIComponent(uploadResult.response); - expect(responseHtml).toMatch(/CustomHeader1[\s\S]*CustomValue1/i); - expect(responseHtml).toMatch(/CustomHeader2[\s\S]*CustomValue2[\s\S]*CustomValue3/i, "Should allow array values"); - }); - - var fileWin = function(fileEntry) { - ft = new FileTransfer(); - - var options = new FileUploadOptions(); - options.fileKey = "file"; - options.fileName = localFileName; - options.mimeType = "text/plain"; - - var params = new Object(); - params.value1 = "test"; - params.value2 = "param"; - options.params = params; - options.headers = { - "CustomHeader1": "CustomValue1", - "CustomHeader2": ["CustomValue2", "CustomValue3"], - }; - - // removing options cause Android to timeout - ft.upload(fileEntry.fullPath, remoteFile, uploadWin, uploadFail, options); - }; - - this.after(function() { - deleteFile(localFileName); - }); - runs(function() { - writeFile(localFileName, "this file should upload", fileWin, fileFail); - }); - - waitsForAny(uploadWin, uploadFail); - }); - }); -}); diff --git a/plugins/org.apache.cordova.core.file-transfer/test/cordova-incl.js b/plugins/org.apache.cordova.core.file-transfer/test/cordova-incl.js deleted file mode 100644 index a82c590..0000000 --- a/plugins/org.apache.cordova.core.file-transfer/test/cordova-incl.js +++ /dev/null @@ -1,85 +0,0 @@ -/* - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - * -*/ - -var PLAT; -(function getPlatform() { - var platforms = { - android: /Android/, - ios: /(iPad)|(iPhone)|(iPod)/, - blackberry10: /(BB10)/, - blackberry: /(PlayBook)|(BlackBerry)/, - windows8: /MSAppHost/, - windowsphone: /Windows Phone/ - }; - for (var key in platforms) { - if (platforms[key].exec(navigator.userAgent)) { - PLAT = key; - break; - } - } -})(); - -var scripts = document.getElementsByTagName('script'); -var currentPath = scripts[scripts.length - 1].src; -var platformCordovaPath = currentPath.replace("cordova-incl.js", "cordova." + PLAT + ".js"); -var normalCordovaPath = currentPath.replace("cordova-incl.js", "cordova.js"); -var cordovaPath = normalCordovaPath; - -if (PLAT) { - // XHR to local file is an error on some platforms, windowsphone for one - try { - var xhr = new XMLHttpRequest(); - xhr.open("GET", platformCordovaPath, false); - xhr.onreadystatechange = function() { - - if (this.readyState == this.DONE && this.responseText.length > 0) { - if(parseInt(this.status) >= 400){ - cordovaPath = normalCordovaPath; - }else{ - cordovaPath = platformCordovaPath; - } - } - }; - xhr.send(null); - } - catch(e){ - cordovaPath = normalCordovaPath; - } // access denied! -} - -if (!window._doNotWriteCordovaScript) { - if (PLAT != "windows8") { - document.write(''); - } else { - var s = document.createElement('script'); - s.src = cordovaPath; - document.head.appendChild(s); - } -} - -function backHome() { - if (window.device && device.platform && device.platform.toLowerCase() == 'android') { - navigator.app.backHistory(); - } - else { - window.history.go(-1); - } -} diff --git a/plugins/org.apache.cordova.core.file-transfer/test/index.html b/plugins/org.apache.cordova.core.file-transfer/test/index.html deleted file mode 100644 index 727c504..0000000 --- a/plugins/org.apache.cordova.core.file-transfer/test/index.html +++ /dev/null @@ -1,64 +0,0 @@ - - - - - - - - - Cordova Mobile Spec - - - - - - -

Apache Cordova Tests

-
-

Platform:

-

Version:

-

UUID:

-

Model:

-

Width: , Height: - , Color Depth:

-

User-Agent:

-
- Automatic Test - Accelerometer - Audio Play/Record - Battery - Camera - Compass - Contacts - Events - Location - Lazy Loading of cordova-incl.js - Misc Content - Network - Notification - Splashscreen - Web SQL - Local Storage - Benchmarks - In App Browser - - diff --git a/plugins/org.apache.cordova.core.file-transfer/test/main.js b/plugins/org.apache.cordova.core.file-transfer/test/main.js deleted file mode 100644 index 5f071c4..0000000 --- a/plugins/org.apache.cordova.core.file-transfer/test/main.js +++ /dev/null @@ -1,162 +0,0 @@ -/* - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - * -*/ - -var deviceInfo = function() { - document.getElementById("platform").innerHTML = device.platform; - document.getElementById("version").innerHTML = device.version; - document.getElementById("uuid").innerHTML = device.uuid; - document.getElementById("model").innerHTML = device.model; - document.getElementById("width").innerHTML = screen.width; - document.getElementById("height").innerHTML = screen.height; - document.getElementById("colorDepth").innerHTML = screen.colorDepth; -}; - -var getLocation = function() { - var suc = function(p) { - alert(p.coords.latitude + " " + p.coords.longitude); - }; - var locFail = function() { - }; - navigator.geolocation.getCurrentPosition(suc, locFail); -}; - -var beep = function() { - navigator.notification.beep(2); -}; - -var vibrate = function() { - navigator.notification.vibrate(0); -}; - -function roundNumber(num) { - var dec = 3; - var result = Math.round(num * Math.pow(10, dec)) / Math.pow(10, dec); - return result; -} - -var accelerationWatch = null; - -function updateAcceleration(a) { - document.getElementById('x').innerHTML = roundNumber(a.x); - document.getElementById('y').innerHTML = roundNumber(a.y); - document.getElementById('z').innerHTML = roundNumber(a.z); -} - -var toggleAccel = function() { - if (accelerationWatch !== null) { - navigator.accelerometer.clearWatch(accelerationWatch); - updateAcceleration({ - x : "", - y : "", - z : "" - }); - accelerationWatch = null; - } else { - var options = {}; - options.frequency = 1000; - accelerationWatch = navigator.accelerometer.watchAcceleration( - updateAcceleration, function(ex) { - alert("accel fail (" + ex.name + ": " + ex.message + ")"); - }, options); - } -}; - -var preventBehavior = function(e) { - e.preventDefault(); -}; - -function dump_pic(data) { - var viewport = document.getElementById('viewport'); - console.log(data); - viewport.style.display = ""; - viewport.style.position = "absolute"; - viewport.style.top = "10px"; - viewport.style.left = "10px"; - document.getElementById("test_img").src = "data:image/jpeg;base64," + data; -} - -function fail(msg) { - alert(msg); -} - -function show_pic() { - navigator.camera.getPicture(dump_pic, fail, { - quality : 50 - }); -} - -function close() { - var viewport = document.getElementById('viewport'); - viewport.style.position = "relative"; - viewport.style.display = "none"; -} - -// This is just to do this. -function readFile() { - navigator.file.read('/sdcard/cordova.txt', fail, fail); -} - -function writeFile() { - navigator.file.write('foo.txt', "This is a test of writing to a file", - fail, fail); -} - -function contacts_success(contacts) { - alert(contacts.length - + ' contacts returned.' - + (contacts[2] && contacts[2].name ? (' Third contact is ' + contacts[2].name.formatted) - : '')); -} - -function get_contacts() { - var obj = new ContactFindOptions(); - obj.filter = ""; - obj.multiple = true; - obj.limit = 5; - navigator.service.contacts.find( - [ "displayName", "name" ], contacts_success, - fail, obj); -} - -var networkReachableCallback = function(reachability) { - // There is no consistency on the format of reachability - var networkState = reachability.code || reachability; - - var currentState = {}; - currentState[NetworkStatus.NOT_REACHABLE] = 'No network connection'; - currentState[NetworkStatus.REACHABLE_VIA_CARRIER_DATA_NETWORK] = 'Carrier data connection'; - currentState[NetworkStatus.REACHABLE_VIA_WIFI_NETWORK] = 'WiFi connection'; - - confirm("Connection type:\n" + currentState[networkState]); -}; - -function check_network() { - navigator.network.isReachable("www.mobiledevelopersolutions.com", - networkReachableCallback, {}); -} - -function init() { - // the next line makes it impossible to see Contacts on the HTC Evo since it - // doesn't have a scroll button - // document.addEventListener("touchmove", preventBehavior, false); - document.addEventListener("deviceready", deviceInfo, true); - document.getElementById("user-agent").textContent = navigator.userAgent; -} diff --git a/plugins/org.apache.cordova.core.file-transfer/test/master.css b/plugins/org.apache.cordova.core.file-transfer/test/master.css deleted file mode 100644 index e93c937..0000000 --- a/plugins/org.apache.cordova.core.file-transfer/test/master.css +++ /dev/null @@ -1,164 +0,0 @@ -/* - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - * -*/ - - body { - background:#222 none repeat scroll 0 0; - color:#666; - font-family:Helvetica; - font-size:72%; - line-height:1.5em; - margin:0; - border-top:1px solid #393939; - } - - #info{ - background:#ffa; - border: 1px solid #ffd324; - -webkit-border-radius: 5px; - border-radius: 5px; - clear:both; - margin:15px 6px 0; - min-width:295px; - max-width:97%; - padding:4px 0px 2px 10px; - word-wrap:break-word; - margin-bottom:10px; - display:inline-block; - min-height: 160px; - max-height: 300px; - overflow: auto; - -webkit-overflow-scrolling: touch; - } - - #info > h4{ - font-size:.95em; - margin:5px 0; - } - - #stage.theme{ - padding-top:3px; - } - - /* Definition List */ - #stage.theme > dl{ - padding-top:10px; - clear:both; - margin:0; - list-style-type:none; - padding-left:10px; - overflow:auto; - } - - #stage.theme > dl > dt{ - font-weight:bold; - float:left; - margin-left:5px; - } - - #stage.theme > dl > dd{ - width:45px; - float:left; - color:#a87; - font-weight:bold; - } - - /* Content Styling */ - #stage.theme > h1, #stage.theme > h2, #stage.theme > p{ - margin:1em 0 .5em 13px; - } - - #stage.theme > h1{ - color:#eee; - font-size:1.6em; - text-align:center; - margin:0; - margin-top:15px; - padding:0; - } - - #stage.theme > h2{ - clear:both; - margin:0; - padding:3px; - font-size:1em; - text-align:center; - } - - /* Stage Buttons */ - #stage.theme .btn{ - border: 1px solid #555; - -webkit-border-radius: 5px; - border-radius: 5px; - text-align:center; - display:inline-block; - background:#444; - width:150px; - color:#9ab; - font-size:1.1em; - text-decoration:none; - padding:1.2em 0; - margin:3px 0px 3px 5px; - } - - #stage.theme .large{ - width:308px; - padding:1.2em 0; - } - - #stage.theme .wide{ - width:100%; - padding:1.2em 0; - } - - #stage.theme .backBtn{ - border: 1px solid #555; - -webkit-border-radius: 5px; - border-radius: 5px; - text-align:center; - display:block; - float:right; - background:#666; - width:75px; - color:#9ab; - font-size:1.1em; - text-decoration:none; - padding:1.2em 0; - margin:3px 5px 3px 5px; - } - - #stage.theme .input{ - border: 1px solid #555; - -webkit-border-radius: 5px; - border-radius: 5px; - text-align:center; - display:block; - float:light; - background:#888; - color:#9cd; - font-size:1.1em; - text-decoration:none; - padding:1.2em 0; - margin:3px 0px 3px 5px; - } - - #stage.theme .numeric{ - width:100%; - } diff --git a/plugins/org.apache.cordova.core.file-transfer/www/FileTransfer.js b/plugins/org.apache.cordova.core.file-transfer/www/FileTransfer.js deleted file mode 100644 index 6eb9d74..0000000 --- a/plugins/org.apache.cordova.core.file-transfer/www/FileTransfer.js +++ /dev/null @@ -1,207 +0,0 @@ -/* - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - * -*/ - -var argscheck = require('cordova/argscheck'), - exec = require('cordova/exec'), - FileTransferError = require('./FileTransferError'), - ProgressEvent = require('org.apache.cordova.core.file.ProgressEvent'); - -function newProgressEvent(result) { - var pe = new ProgressEvent(); - pe.lengthComputable = result.lengthComputable; - pe.loaded = result.loaded; - pe.total = result.total; - return pe; -} - -function getBasicAuthHeader(urlString) { - var header = null; - - if (window.btoa) { - // parse the url using the Location object - var url = document.createElement('a'); - url.href = urlString; - - var credentials = null; - var protocol = url.protocol + "//"; - var origin = protocol + url.host; - - // check whether there are the username:password credentials in the url - if (url.href.indexOf(origin) !== 0) { // credentials found - var atIndex = url.href.indexOf("@"); - credentials = url.href.substring(protocol.length, atIndex); - } - - if (credentials) { - var authHeader = "Authorization"; - var authHeaderValue = "Basic " + window.btoa(credentials); - - header = { - name : authHeader, - value : authHeaderValue - }; - } - } - - return header; -} - -var idCounter = 0; - -/** - * FileTransfer uploads a file to a remote server. - * @constructor - */ -var FileTransfer = function() { - this._id = ++idCounter; - this.onprogress = null; // optional callback -}; - -/** -* Given an absolute file path, uploads a file on the device to a remote server -* using a multipart HTTP request. -* @param filePath {String} Full path of the file on the device -* @param server {String} URL of the server to receive the file -* @param successCallback (Function} Callback to be invoked when upload has completed -* @param errorCallback {Function} Callback to be invoked upon error -* @param options {FileUploadOptions} Optional parameters such as file name and mimetype -* @param trustAllHosts {Boolean} Optional trust all hosts (e.g. for self-signed certs), defaults to false -*/ -FileTransfer.prototype.upload = function(filePath, server, successCallback, errorCallback, options, trustAllHosts) { - argscheck.checkArgs('ssFFO*', 'FileTransfer.upload', arguments); - // check for options - var fileKey = null; - var fileName = null; - var mimeType = null; - var params = null; - var chunkedMode = true; - var headers = null; - var httpMethod = null; - var basicAuthHeader = getBasicAuthHeader(server); - if (basicAuthHeader) { - options = options || {}; - options.headers = options.headers || {}; - options.headers[basicAuthHeader.name] = basicAuthHeader.value; - } - - if (options) { - fileKey = options.fileKey; - fileName = options.fileName; - mimeType = options.mimeType; - headers = options.headers; - httpMethod = options.httpMethod || "POST"; - if (httpMethod.toUpperCase() == "PUT"){ - httpMethod = "PUT"; - } else { - httpMethod = "POST"; - } - if (options.chunkedMode !== null || typeof options.chunkedMode != "undefined") { - chunkedMode = options.chunkedMode; - } - if (options.params) { - params = options.params; - } - else { - params = {}; - } - } - - var fail = errorCallback && function(e) { - var error = new FileTransferError(e.code, e.source, e.target, e.http_status, e.body); - errorCallback(error); - }; - - var self = this; - var win = function(result) { - if (typeof result.lengthComputable != "undefined") { - if (self.onprogress) { - self.onprogress(newProgressEvent(result)); - } - } else { - successCallback && successCallback(result); - } - }; - exec(win, fail, 'FileTransfer', 'upload', [filePath, server, fileKey, fileName, mimeType, params, trustAllHosts, chunkedMode, headers, this._id, httpMethod]); -}; - -/** - * Downloads a file form a given URL and saves it to the specified directory. - * @param source {String} URL of the server to receive the file - * @param target {String} Full path of the file on the device - * @param successCallback (Function} Callback to be invoked when upload has completed - * @param errorCallback {Function} Callback to be invoked upon error - * @param trustAllHosts {Boolean} Optional trust all hosts (e.g. for self-signed certs), defaults to false - * @param options {FileDownloadOptions} Optional parameters such as headers - */ -FileTransfer.prototype.download = function(source, target, successCallback, errorCallback, trustAllHosts, options) { - argscheck.checkArgs('ssFF*', 'FileTransfer.download', arguments); - var self = this; - - var basicAuthHeader = getBasicAuthHeader(source); - if (basicAuthHeader) { - options = options || {}; - options.headers = options.headers || {}; - options.headers[basicAuthHeader.name] = basicAuthHeader.value; - } - - var headers = null; - if (options) { - headers = options.headers || null; - } - - var win = function(result) { - if (typeof result.lengthComputable != "undefined") { - if (self.onprogress) { - return self.onprogress(newProgressEvent(result)); - } - } else if (successCallback) { - var entry = null; - if (result.isDirectory) { - entry = new (require('org.apache.cordova.core.file.DirectoryEntry'))(); - } - else if (result.isFile) { - entry = new (require('org.apache.cordova.core.file.FileEntry'))(); - } - entry.isDirectory = result.isDirectory; - entry.isFile = result.isFile; - entry.name = result.name; - entry.fullPath = result.fullPath; - successCallback(entry); - } - }; - - var fail = errorCallback && function(e) { - var error = new FileTransferError(e.code, e.source, e.target, e.http_status, e.body); - errorCallback(error); - }; - - exec(win, fail, 'FileTransfer', 'download', [source, target, trustAllHosts, this._id, headers]); -}; - -/** - * Aborts the ongoing file transfer on this object. The original error - * callback for the file transfer will be called if necessary. - */ -FileTransfer.prototype.abort = function() { - exec(null, null, 'FileTransfer', 'abort', [this._id]); -}; - -module.exports = FileTransfer; diff --git a/plugins/org.apache.cordova.core.file-transfer/www/FileTransferError.js b/plugins/org.apache.cordova.core.file-transfer/www/FileTransferError.js deleted file mode 100644 index 1394f59..0000000 --- a/plugins/org.apache.cordova.core.file-transfer/www/FileTransferError.js +++ /dev/null @@ -1,39 +0,0 @@ -/* - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - * -*/ - -/** - * FileTransferError - * @constructor - */ -var FileTransferError = function(code, source, target, status, body) { - this.code = code || null; - this.source = source || null; - this.target = target || null; - this.http_status = status || null; - this.body = body || null; -}; - -FileTransferError.FILE_NOT_FOUND_ERR = 1; -FileTransferError.INVALID_URL_ERR = 2; -FileTransferError.CONNECTION_ERR = 3; -FileTransferError.ABORT_ERR = 4; - -module.exports = FileTransferError; diff --git a/plugins/org.apache.cordova.core.file-transfer/www/blackberry10/FileTransfer.js b/plugins/org.apache.cordova.core.file-transfer/www/blackberry10/FileTransfer.js deleted file mode 100644 index f74914a..0000000 --- a/plugins/org.apache.cordova.core.file-transfer/www/blackberry10/FileTransfer.js +++ /dev/null @@ -1,188 +0,0 @@ -/* - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - * -*/ - -var argscheck = require('cordova/argscheck'), - FileTransferError = require('./FileTransferError'); - xhrImpl = require('./BB10XHRImplementation'); - - -function getBasicAuthHeader(urlString) { - var header = null; - - if (window.btoa) { - // parse the url using the Location object - var url = document.createElement('a'); - url.href = urlString; - - var credentials = null; - var protocol = url.protocol + "//"; - var origin = protocol + url.host; - - // check whether there are the username:password credentials in the url - if (url.href.indexOf(origin) !== 0) { // credentials found - var atIndex = url.href.indexOf("@"); - credentials = url.href.substring(protocol.length, atIndex); - } - - if (credentials) { - var authHeader = "Authorization"; - var authHeaderValue = "Basic " + window.btoa(credentials); - - header = { - name : authHeader, - value : authHeaderValue - }; - } - } - - return header; -} - -var idCounter = 0; - -/** - * FileTransfer uploads a file to a remote server. - * @constructor - */ -var FileTransfer = function() { - this._id = ++idCounter; - this.onprogress = null; // optional callback -}; - -/** -* Given an absolute file path, uploads a file on the device to a remote server -* using a multipart HTTP request. -* @param filePath {String} Full path of the file on the device -* @param server {String} URL of the server to receive the file -* @param successCallback (Function} Callback to be invoked when upload has completed -* @param errorCallback {Function} Callback to be invoked upon error -* @param options {FileUploadOptions} Optional parameters such as file name and mimetype -* @param trustAllHosts {Boolean} Optional trust all hosts (e.g. for self-signed certs), defaults to false -*/ -FileTransfer.prototype.upload = function(filePath, server, successCallback, errorCallback, options, trustAllHosts) { - argscheck.checkArgs('ssFFO*', 'FileTransfer.upload', arguments); - // check for options - var fileKey = null; - var fileName = null; - var mimeType = null; - var params = null; - var chunkedMode = true; - var headers = null; - var httpMethod = null; - var basicAuthHeader = getBasicAuthHeader(server); - if (basicAuthHeader) { - options = options || {}; - options.headers = options.headers || {}; - options.headers[basicAuthHeader.name] = basicAuthHeader.value; - } - - if (options) { - fileKey = options.fileKey; - fileName = options.fileName; - mimeType = options.mimeType; - headers = options.headers; - httpMethod = options.httpMethod || "POST"; - if (httpMethod.toUpperCase() == "PUT"){ - httpMethod = "PUT"; - } else { - httpMethod = "POST"; - } - if (options.chunkedMode !== null || typeof options.chunkedMode != "undefined") { - chunkedMode = options.chunkedMode; - } - if (options.params) { - params = options.params; - } - else { - params = {}; - } - } - - var fail = errorCallback && function(e) { - var error = new FileTransferError(e.code, e.source, e.target, e.http_status, e.body); - errorCallback(error); - }; - - var self = this; - var win = function(result) { - if (typeof result.lengthComputable != "undefined") { - if (self.onprogress) { - self.onprogress(result); - } - } else { - successCallback && successCallback(result); - } - }; - xhrImpl.upload(win, fail, [filePath, server, fileKey, fileName, mimeType, params, trustAllHosts, chunkedMode, headers, this._id, httpMethod]); -}; - -/** - * Downloads a file form a given URL and saves it to the specified directory. - * @param source {String} URL of the server to receive the file - * @param target {String} Full path of the file on the device - * @param successCallback (Function} Callback to be invoked when upload has completed - * @param errorCallback {Function} Callback to be invoked upon error - * @param trustAllHosts {Boolean} Optional trust all hosts (e.g. for self-signed certs), defaults to false - * @param options {FileDownloadOptions} Optional parameters such as headers - */ -FileTransfer.prototype.download = function(source, target, successCallback, errorCallback, trustAllHosts, options) { - argscheck.checkArgs('ssFF*', 'FileTransfer.download', arguments); - var self = this; - - var basicAuthHeader = getBasicAuthHeader(source); - if (basicAuthHeader) { - options = options || {}; - options.headers = options.headers || {}; - options.headers[basicAuthHeader.name] = basicAuthHeader.value; - } - - var headers = null; - if (options) { - headers = options.headers || null; - } - - var win = function(result) { - if (typeof result.lengthComputable != "undefined") { - if (self.onprogress) { - return self.onprogress(result); - } - } else if (successCallback) { - successCallback(result); - } - }; - - var fail = errorCallback && function(e) { - var error = new FileTransferError(e.code, e.source, e.target, e.http_status, e.body); - errorCallback(error); - }; - - xhrImpl.download(win, fail, [source, target, trustAllHosts, this._id, headers]); -}; - -/** - * Aborts the ongoing file transfer on this object. The original error - * callback for the file transfer will be called if necessary. - */ -FileTransfer.prototype.abort = function() { - xhrImpl.abort(null, null, [this._id]); -}; - -module.exports = FileTransfer; diff --git a/plugins/org.apache.cordova.core.file-transfer/www/blackberry10/XHRImplementation.js b/plugins/org.apache.cordova.core.file-transfer/www/blackberry10/XHRImplementation.js deleted file mode 100644 index 3ccf8f2..0000000 --- a/plugins/org.apache.cordova.core.file-transfer/www/blackberry10/XHRImplementation.js +++ /dev/null @@ -1,201 +0,0 @@ -/* - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - * -*/ - -/*global Blob:false */ -var cordova = require('cordova'), - nativeResolveLocalFileSystemURI = function(uri, success, fail) { - if (uri.substring(0,11) !== "filesystem:") { - uri = "filesystem:" + uri; - } - resolveLocalFileSystemURI(uri, success, fail); - }, - xhr; - -function getParentPath(filePath) { - var pos = filePath.lastIndexOf('/'); - return filePath.substring(0, pos + 1); -} - -function getFileName(filePath) { - var pos = filePath.lastIndexOf('/'); - return filePath.substring(pos + 1); -} - -function checkURL(url) { - return url.indexOf(' ') === -1 ? true : false; -} - -module.exports = { - abort: function () { - return { "status" : cordova.callbackStatus.NO_RESULT, "message" : "async"}; - }, - - upload: function(win, fail, args) { - var filePath = args[0], - server = args[1], - fileKey = args[2], - fileName = args[3], - mimeType = args[4], - params = args[5], - /*trustAllHosts = args[6],*/ - chunkedMode = args[7], - headers = args[8]; - - if (!checkURL(server)) { - fail(new FileTransferError(FileTransferError.INVALID_URL_ERR, server, filePath)); - } - - nativeResolveLocalFileSystemURI(filePath, function(entry) { - entry.file(function(file) { - function uploadFile(blobFile) { - var fd = new FormData(); - - fd.append(fileKey, blobFile, fileName); - for (var prop in params) { - if(params.hasOwnProperty(prop)) { - fd.append(prop, params[prop]); - } - } - - xhr = new XMLHttpRequest(); - xhr.open("POST", server); - xhr.onload = function(evt) { - if (xhr.status === 200) { - var result = new FileUploadResult(); - result.bytesSent = file.size; - result.responseCode = xhr.status; - result.response = xhr.response; - win(result); - } else if (xhr.status === 404) { - fail(new FileTransferError(FileTransferError.INVALID_URL_ERR, server, filePath, xhr.status, xhr.response)); - } else { - fail(new FileTransferError(FileTransferError.CONNECTION_ERR, server, filePath, xhr.status, xhr.response)); - } - }; - xhr.ontimeout = function(evt) { - fail(new FileTransferError(FileTransferError.CONNECTION_ERR, server, filePath, xhr.status, xhr.response)); - }; - xhr.onerror = function () { - fail(new FileTransferError(FileTransferError.CONNECTION_ERR, server, filePath, this.status, xhr.response)); - }; - xhr.onprogress = function (evt) { - win(evt); - }; - - for (var header in headers) { - if (headers.hasOwnProperty(header)) { - xhr.setRequestHeader(header, headers[header]); - } - } - - xhr.send(fd); - } - - var bytesPerChunk; - if (chunkedMode === true) { - bytesPerChunk = 1024 * 1024; // 1MB chunk sizes. - } else { - bytesPerChunk = file.size; - } - var start = 0; - var end = bytesPerChunk; - while (start < file.size) { - var chunk = file.slice(start, end, mimeType); - uploadFile(chunk); - start = end; - end = start + bytesPerChunk; - } - }, function(error) { - fail(new FileTransferError(FileTransferError.FILE_NOT_FOUND_ERR, server, filePath)); - }); - }, function(error) { - fail(new FileTransferError(FileTransferError.FILE_NOT_FOUND_ERR, server, filePath)); - }); - - return { "status" : cordova.callbackStatus.NO_RESULT, "message" : "async"}; - }, - - download: function (win, fail, args) { - var source = args[0], - target = args[1], - headers = args[4], - fileWriter; - - if (!checkURL(source)) { - fail(new FileTransferError(FileTransferError.INVALID_URL_ERR, source, target)); - } - - xhr = new XMLHttpRequest(); - - function writeFile(entry) { - entry.createWriter(function (writer) { - fileWriter = writer; - fileWriter.onwriteend = function (evt) { - if (!evt.target.error) { - win(entry); - } else { - fail(evt.target.error); - } - }; - fileWriter.onerror = function (evt) { - fail(evt.target.error); - }; - fileWriter.write(new Blob([xhr.response])); - }, function (error) { - fail(error); - }); - } - - xhr.onerror = function (e) { - fail(new FileTransferError(FileTransferError.CONNECTION_ERR, source, target, xhr.status, xhr.response)); - }; - - xhr.onload = function () { - if (xhr.readyState === xhr.DONE) { - if (xhr.status === 200 && xhr.response) { - nativeResolveLocalFileSystemURI(getParentPath(target), function (dir) { - dir.getFile(getFileName(target), {create: true}, writeFile, function (error) { - fail(new FileTransferError(FileTransferError.FILE_NOT_FOUND_ERR, source, target, xhr.status, xhr.response)); - }); - }, function (error) { - fail(new FileTransferError(FileTransferError.FILE_NOT_FOUND_ERR, source, target, xhr.status, xhr.response)); - }); - } else if (xhr.status === 404) { - fail(new FileTransferError(FileTransferError.INVALID_URL_ERR, source, target, xhr.status, xhr.response)); - } else { - fail(new FileTransferError(FileTransferError.CONNECTION_ERR, source, target, xhr.status, xhr.response)); - } - } - }; - xhr.onprogress = function (evt) { - win(evt); - }; - - xhr.open("GET", source, true); - for (var header in headers) { - if (headers.hasOwnProperty(header)) { - xhr.setRequestHeader(header, headers[header]); - } - } - xhr.send(); - return { "status" : cordova.callbackStatus.NO_RESULT, "message" : "async"}; - } -}; diff --git a/plugins/org.apache.cordova.core.file-transfer/www/windows8/FileTransferProxy.js b/plugins/org.apache.cordova.core.file-transfer/www/windows8/FileTransferProxy.js deleted file mode 100644 index dd8ff62..0000000 --- a/plugins/org.apache.cordova.core.file-transfer/www/windows8/FileTransferProxy.js +++ /dev/null @@ -1,110 +0,0 @@ -/* - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - * -*/ - - -var FileTransferError = require('./FileTransferError'), - FileUploadResult = require('org.apache.cordova.core.file.FileUploadResult'), - FileEntry = require('org.apache.cordova.core.file.FileEntry'); - -module.exports = { - - upload:function(successCallback, error, options) { - var filePath = options[0]; - var server = options[1]; - - - var win = function (fileUploadResult) { - successCallback(fileUploadResult); - }; - - if (filePath === null || typeof filePath === 'undefined') { - error(FileTransferError.FILE_NOT_FOUND_ERR); - return; - } - - if (String(filePath).substr(0, 8) == "file:///") { - filePath = Windows.Storage.ApplicationData.current.localFolder.path + String(filePath).substr(8).split("/").join("\\"); - } - - Windows.Storage.StorageFile.getFileFromPathAsync(filePath).then(function (storageFile) { - storageFile.openAsync(Windows.Storage.FileAccessMode.read).then(function (stream) { - var blob = MSApp.createBlobFromRandomAccessStream(storageFile.contentType, stream); - var formData = new FormData(); - formData.append("source\";filename=\"" + storageFile.name + "\"", blob); - WinJS.xhr({ type: "POST", url: server, data: formData }).then(function (response) { - var code = response.status; - storageFile.getBasicPropertiesAsync().done(function (basicProperties) { - - Windows.Storage.FileIO.readBufferAsync(storageFile).done(function (buffer) { - var dataReader = Windows.Storage.Streams.DataReader.fromBuffer(buffer); - var fileContent = dataReader.readString(buffer.length); - dataReader.close(); - win(new FileUploadResult(basicProperties.size, code, fileContent)); - - }); - - }); - }, function () { - error(FileTransferError.INVALID_URL_ERR); - }); - }); - - },function(){error(FileTransferError.FILE_NOT_FOUND_ERR);}); - }, - - download:function(win, error, options) { - var source = options[0]; - var target = options[1]; - - - if (target === null || typeof target === undefined) { - error(FileTransferError.FILE_NOT_FOUND_ERR); - return; - } - if (String(target).substr(0, 8) == "file:///") { - target = Windows.Storage.ApplicationData.current.localFolder.path + String(target).substr(8).split("/").join("\\"); - } - var path = target.substr(0, String(target).lastIndexOf("\\")); - var fileName = target.substr(String(target).lastIndexOf("\\") + 1); - if (path === null || fileName === null) { - error(FileTransferError.FILE_NOT_FOUND_ERR); - return; - } - - var download = null; - - - Windows.Storage.StorageFolder.getFolderFromPathAsync(path).then(function (storageFolder) { - storageFolder.createFileAsync(fileName, Windows.Storage.CreationCollisionOption.generateUniqueName).then(function (storageFile) { - var uri = Windows.Foundation.Uri(source); - var downloader = new Windows.Networking.BackgroundTransfer.BackgroundDownloader(); - download = downloader.createDownload(uri, storageFile); - download.startAsync().then(function () { - win(new FileEntry(storageFile.name, storageFile.path)); - }, function () { - error(FileTransferError.INVALID_URL_ERR); - }); - }); - }); - } -}; - -require("cordova/commandProxy").add("FileTransfer",module.exports); \ No newline at end of file diff --git a/plugins/org.apache.cordova.core.file-transfer/www/wp/FileTransfer.js b/plugins/org.apache.cordova.core.file-transfer/www/wp/FileTransfer.js deleted file mode 100644 index b2f8686..0000000 --- a/plugins/org.apache.cordova.core.file-transfer/www/wp/FileTransfer.js +++ /dev/null @@ -1,123 +0,0 @@ -/* - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - * -*/ - -var exec = require('cordova/exec'), - FileTransferError = require('cordova/plugin/FileTransferError'); - -// Note that the only difference between this and the default implementation is the -// object literal passed to exec() in upload - jm - -/** - * FileTransfer uploads a file to a remote server. - * @constructor - */ -var FileTransfer = function() {}; - -/** -* Given an absolute file path, uploads a file on the device to a remote server -* using a multipart HTTP request. -* @param filePath {String} Full path of the file on the device -* @param server {String} URL of the server to receive the file -* @param successCallback (Function} Callback to be invoked when upload has completed -* @param errorCallback {Function} Callback to be invoked upon error -* @param options {FileUploadOptions} Optional parameters such as file name and mimetype -* @param trustAllHosts {Boolean} Optional trust all hosts (e.g. for self-signed certs), defaults to false -*/ - -FileTransfer.prototype.upload = function(filePath, server, successCallback, errorCallback, options, trustAllHosts) { - - // sanity parameter checking - if (!filePath || !server) throw new Error("FileTransfer.upload requires filePath and server URL parameters at the minimum."); - // check for options - var fileKey = null; - var fileName = null; - var mimeType = null; - var params = null; - var chunkedMode = true; - - if (options) { - fileKey = options.fileKey; - fileName = options.fileName; - mimeType = options.mimeType; - if (options.chunkedMode !== null || typeof options.chunkedMode != "undefined") { - chunkedMode = options.chunkedMode; - } - - // if options are specified, and NOT a string already, we will stringify it. - if(options.params && typeof options.params != typeof "") { - var arrParams = []; - for(var v in options.params) { - arrParams.push(v + "=" + options.params[v]); - } - params = encodeURI(arrParams.join("&")); - } - } - - var fail = function(e) { - var error = new FileTransferError(e.code, e.source, e.target, e.http_status); - errorCallback(error); - }; - exec(successCallback, fail, 'FileTransfer', 'upload', [{"filePath":filePath, - "server":server, - "fileKey":fileKey, - "fileName":fileName, - "mimeType":mimeType, - "params":params, - "trustAllHosts":trustAllHosts, - "chunkedMode":chunkedMode}]); -}; - -/** - * Downloads a file form a given URL and saves it to the specified directory. - * @param source {String} URL of the server to receive the file - * @param target {String} Full path of the file on the device - * @param successCallback (Function} Callback to be invoked when upload has completed - * @param errorCallback {Function} Callback to be invoked upon error - */ - -FileTransfer.prototype.download = function(source, target, successCallback, errorCallback) { - // sanity parameter checking - if (!source || !target) throw new Error("FileTransfer.download requires source URI and target URI parameters at the minimum."); - var win = function(result) { - var entry = null; - if (result.isDirectory) { - entry = new (require('cordova/plugin/DirectoryEntry'))(); - } - else if (result.isFile) { - entry = new (require('cordova/plugin/FileEntry'))(); - } - entry.isDirectory = result.isDirectory; - entry.isFile = result.isFile; - entry.name = result.name; - entry.fullPath = result.fullPath; - successCallback(entry); - }; - - var fail = function(e) { - var error = new FileTransferError(e.code, e.source, e.target, e.http_status); - errorCallback(error); - }; - - exec(win, errorCallback, 'FileTransfer', 'download', [source, target]); -}; - - -module.exports = FileTransfer; diff --git a/plugins/org.apache.cordova.core.file/.fetch.json b/plugins/org.apache.cordova.core.file/.fetch.json deleted file mode 100644 index 9815191..0000000 --- a/plugins/org.apache.cordova.core.file/.fetch.json +++ /dev/null @@ -1 +0,0 @@ -{"source":{"type":"git","url":"https://git-wip-us.apache.org/repos/asf/cordova-plugin-file.git","subdir":"."}} \ No newline at end of file diff --git a/plugins/org.apache.cordova.core.file/README.md b/plugins/org.apache.cordova.core.file/README.md deleted file mode 100644 index 673b6e5..0000000 --- a/plugins/org.apache.cordova.core.file/README.md +++ /dev/null @@ -1,5 +0,0 @@ -cordova-plugin-file --------------------------- -To install this plugin, follow the [Command-line Interface Guide](http://cordova.apache.org/docs/en/edge/guide_cli_index.md.html#The%20Command-line%20Interface). - -If you are not using the Cordova Command-line Interface, follow [Using Plugman to Manage Plugins](http://cordova.apache.org/docs/en/edge/guide_plugin_ref_plugman.md.html). diff --git a/plugins/org.apache.cordova.core.file/docs/directoryentry/directoryentry.md b/plugins/org.apache.cordova.core.file/docs/directoryentry/directoryentry.md deleted file mode 100644 index e21aa5f..0000000 --- a/plugins/org.apache.cordova.core.file/docs/directoryentry/directoryentry.md +++ /dev/null @@ -1,390 +0,0 @@ ---- -license: Licensed to the Apache Software Foundation (ASF) under one - or more contributor license agreements. See the NOTICE file - distributed with this work for additional information - regarding copyright ownership. The ASF licenses this file - to you under the Apache License, Version 2.0 (the - "License"); you may not use this file except in compliance - with the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, - software distributed under the License is distributed on an - "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - KIND, either express or implied. See the License for the - specific language governing permissions and limitations - under the License. ---- - -DirectoryEntry -============== - -This object represents a directory on a file system, as defined by the -[W3C Directories and Systems](http://www.w3.org/TR/file-system-api/) -specification. - -Properties ----------- - -- __isFile__: Always false. _(boolean)_ -- __isDirectory__: Always true. _(boolean)_ -- __name__: The name of the `DirectoryEntry`, excluding the path leading to it. _(DOMString)_ -- __fullPath__: The full absolute path from the root to the `DirectoryEntry`. _(DOMString)_ - -__NOTE:__ The following attribute is defined by the W3C specification, -but is _not_ supported: - -- __filesystem__: The file system on which the `DirectoryEntry` resides. _(FileSystem)_ - -Methods -------- - -The following methods can be invoked on a `DirectoryEntry` object: - -- __getMetadata__: Look up metadata about a directory. -- __setMetadata__: Set metadata on a directory. -- __moveTo__: Move a directory to a different location on the file system. -- __copyTo__: Copy a directory to a different location on the file system. -- __toURL__: Return a URL to help locate a directory. -- __remove__: Delete a directory. The directory must be empty. -- __getParent__: Look up the parent directory. -- __createReader__: Create a new `DirectoryReader` that can read entries from a directory. -- __getDirectory__: Create or look up a directory. -- __getFile__: Create or look up a file. -- __removeRecursively__: Delete a directory and all of its contents. - -Supported Platforms -------------------- - -- Android -- BlackBerry WebWorks (OS 5.0 and higher) -- iOS -- Windows Phone 7 and 8 -- Windows 8 - -getMetadata ------------ - -Look up metadata about a directory. - -__Parameters:__ - -- __successCallback__: A callback function to execute with a `Metadata` object. _(Function)_ -- __errorCallback__: A callback function to execute if an error occurs when retrieving the `Metadata`. Invoked with a `FileError` object. _(Function)_ - -__Quick Example__ - - function success(metadata) { - console.log("Last Modified: " + metadata.modificationTime); - } - - function fail(error) { - alert(error.code); - } - - // Request the metadata object for this entry - entry.getMetadata(success, fail); - -setMetadata ----------------- - -Set metadata on a directory. -__Currently works only on iOS.__ - this will set the extended attributes of a directory. - -__Parameters:__ - -- __successCallback__: A callback that executes when the metadata is successfully set. _(Function)_ -- __errorCallback__: A callback that executes when the metadata fails to be set. _(Function)_ -- __metadataObject__: An object that contains the metadata's keys and values. _(Object)_ - -__Quick Example__ - - function success() { - console.log("The metadata was successfully set."); - } - - function fail() { - alert("There was an error in setting the metadata"); - } - - // Set the metadata - entry.setMetadata(success, fail, { "com.apple.MobileBackup": 1}); - -__iOS Quirk__ - -- Only the `com.apple.MobileBackup` extended attribute is supported. Set the value to `1` to prevent the directory from being backed up to iCloud. Set the value to `0` to re-enable the directory to be backed up to iCloud. - -__Quick Example__ - - function setFolderMetadata(localFileSystem, subFolder, metadataKey, metadataValue) - { - var onSetMetadataWin = function() { - console.log("success setting metadata") - } - var onSetMetadataFail = function() { - console.log("error setting metadata") - } - - var onGetDirectoryWin = function(parent) { - var data = {}; - data[metadataKey] = metadataValue; - parent.setMetadata(onSetMetadataWin, onSetMetadataFail, data); - } - var onGetDirectoryFail = function() { - console.log("error getting dir") - } - - var onFSWin = function(fileSystem) { - fileSystem.root.getDirectory(subFolder, {create: true, exclusive: false}, onGetDirectoryWin, onGetDirectoryFail); - } - - var onFSFail = function(evt) { - console.log(evt.target.error.code); - } - - window.requestFileSystem(localFileSystem, 0, onFSWin, onFSFail); - } - - setFolderMetadata(LocalFileSystem.PERSISTENT, "Backups", "com.apple.MobileBackup", 1); - -moveTo ------- - -Move a directory to a different location on the file system. An error results if the app attempts to: - -- move a directory inside itself or to any child at any depth. -- move a directory into its parent if a name different from its current directory is not provided. -- move a directory to a path occupied by a file. -- move a directory to a path occupied by a directory that is not empty. - -Moving a directory on top of an existing empty directory attempts to -delete and replace that directory. - -__Parameters:__ - -- __parent__: The parent directory to which to move the directory. _(DirectoryEntry)_ -- __newName__: The new name of the directory. Defaults to the current name if unspecified. _(DOMString)_ -- __successCallback__: A callback that executes with the `DirectoryEntry` object for the new directory. _(Function)_ -- __errorCallback__: A callback that executes if an error occurs when attempting to move the directory. Invoked with a `FileError` object. _(Function)_ - -__Quick Example__ - - function success(entry) { - console.log("New Path: " + entry.fullPath); - } - - function fail(error) { - alert(error.code); - } - - function moveDir(entry) { - var parent = document.getElementById('parent').value, - parentName = parent.substring(parent.lastIndexOf('/')+1), - newName = document.getElementById('newName').value, - parentEntry = new DirectoryEntry(parentName, parent); - - // move the directory to a new directory and rename it - entry.moveTo(parentEntry, newName, success, fail); - } - -copyTo ------- - -Copy a directory to a different location on the file system. An error results if the app attempts to: - -- copy a directory inside itself at any depth. -- copy a directory into its parent if a name different from its current directory is not provided. - -Directory copies are always recursive, and copy all contents of the directory. - -__Parameters:__ - -- __parent__: The parent directory to which to copy the directory. _(DirectoryEntry)_ -- __newName__: The new name of the directory. Defaults to the current name if unspecified. _(DOMString)_ -- __successCallback__: A callback that executes with the `DirectoryEntry` object for the new directory. _(Function)_ -- __errorCallback__: A callback that executes if an error occurs when attempting to copy the underlying directory. Invoked with a `FileError` object. _(Function)_ - -__Quick Example__ - - function win(entry) { - console.log("New Path: " + entry.fullPath); - } - - function fail(error) { - alert(error.code); - } - - function copyDir(entry) { - var parent = document.getElementById('parent').value, - parentName = parent.substring(parent.lastIndexOf('/')+1), - newName = document.getElementById('newName').value, - parentEntry = new DirectoryEntry(parentName, parent); - - // copy the directory to a new directory and rename it - entry.copyTo(parentEntry, newName, success, fail); - } - -toURL ------ - -Returns a URL that can be used to locate the directory. - -__Quick Example__ - - // Get the URL for this directory - var dirURL = entry.toURL(); - console.log(dirURL); - -remove ------- - -Deletes a directory. An error results if the app attempts to: - -- delete a directory that is not empty. -- delete the root directory of a filesystem. - -__Parameters:__ - -- __successCallback__: A callback that executes after the directory is deleted. Invoked with no parameters. _(Function)_ -- __errorCallback__: A callback that executes if an error occurs when attempting to delete the directory. Invoked with a `FileError` object. _(Function)_ - -__Quick Example__ - - function success(entry) { - console.log("Removal succeeded"); - } - - function fail(error) { - alert('Error removing directory: ' + error.code); - } - - // remove this directory - entry.remove(success, fail); - -getParent ---------- - -Look up the parent `DirectoryEntry` containing the directory. - -__Parameters:__ - -- __successCallback__: A callback that is passed the directory's parent `DirectoryEntry`. _(Function)_ -- __errorCallback__: A callback that executes if an error occurs when attempting to retrieve the parent `DirectoryEntry`. Invoked with a `FileError` object. _(Function)_ - -__Quick Example__ - - function success(parent) { - console.log("Parent Name: " + parent.name); - } - - function fail(error) { - alert('Failed to get parent directory: ' + error.code); - } - - // Get the parent DirectoryEntry - entry.getParent(success, fail); - -createReader ------------- - -Creates a new DirectoryReader to read entries in a directory. - -__Quick Example__ - - // create a directory reader - var directoryReader = entry.createReader(); - -getDirectory ------------- - -Creates or looks up an existing directory. An error results if the app attempts to: - -- create a directory whose immediate parent does not yet exist. - -__Parameters:__ - -- __path__: The path to the directory to be looked up or created. Either an absolute path, or a relative path from this `DirectoryEntry`. _(DOMString)_ -- __options__: Options to specify whether the directory is to be created if it doesn't exist. _(Flags)_ -- __successCallback__: A callback that executes with a `DirectoryEntry` object. _(Function)_ -- __errorCallback__: A callback that executes if an error occurs when creating or looking up the directory. Invoked with a `FileError` object. _(Function)_ - -__Quick Example__ - - function success(parent) { - console.log("Parent Name: " + parent.name); - } - - function fail(error) { - alert("Unable to create new directory: " + error.code); - } - - // Retrieve an existing directory, or create it if it does not already exist - entry.getDirectory("newDir", {create: true, exclusive: false}, success, fail); - -getFile -------- - -Creates or looks up a file. An error results if the app attempts to: - -- create a file whose immediate parent does not yet exist. - -__Parameters:__ - -- __path__: The path to the file to be looked up or created. Either an absolute path, or a relative path from this `DirectoryEntry`. _(DOMString)_ -- __options__: Options to specify whether the file is created if it doesn't exist. _(Flags)_ -- __successCallback__: A callback that is passed a `FileEntry` object. _(Function)_ -- __errorCallback__: A callback that executes if an error occurs when creating or looking up the file. Invoked with a `FileError` object. _(Function)_ - -__Quick Example__ - - function success(parent) { - console.log("Parent Name: " + parent.name); - } - - function fail(error) { - alert("Failed to retrieve file: " + error.code); - } - - // Retrieve an existing file, or create it if it does not exist - entry.getFile("newFile.txt", {create: true, exclusive: false}, success, fail); - -removeRecursively ------------------ - -Deletes a directory and all of its contents. In the event of an error (such as trying to delete -a directory containing a file that cannot be removed), some of the contents of the directory may -be deleted. An error results if the app attempts to: - -- delete the root directory of a filesystem. - -__Parameters:__ - -- __successCallback__: A callback that executes after the `DirectoryEntry` has been deleted. Invoked with no parameters. _(Function)_ -- __errorCallback__: A callback that executes if an error occurs when attempting to delete the `DirectoryEntry`. Invoked with a `FileError` object. _(Function)_ - -__Quick Example__ - - function success(parent) { - console.log("Remove Recursively Succeeded"); - } - - function fail(error) { - alert("Failed to remove directory or it's contents: " + error.code); - } - - // remove the directory and all it's contents - entry.removeRecursively(success, fail); - -BlackBerry Quirks ------------------ - -May fail with a `ControlledAccessException` in the following cases: - -- An app attempts to access a directory created by a previous installation of the app. - -> Solution: ensure temporary directories are cleaned manually, or by the application prior to reinstallation. - -- If the device is connected by USB. - -> Solution: disconnect the USB cable from the device and run again. diff --git a/plugins/org.apache.cordova.core.file/docs/directoryreader/directoryreader.md b/plugins/org.apache.cordova.core.file/docs/directoryreader/directoryreader.md deleted file mode 100644 index b37edb9..0000000 --- a/plugins/org.apache.cordova.core.file/docs/directoryreader/directoryreader.md +++ /dev/null @@ -1,69 +0,0 @@ ---- -license: Licensed to the Apache Software Foundation (ASF) under one - or more contributor license agreements. See the NOTICE file - distributed with this work for additional information - regarding copyright ownership. The ASF licenses this file - to you under the Apache License, Version 2.0 (the - "License"); you may not use this file except in compliance - with the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, - software distributed under the License is distributed on an - "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - KIND, either express or implied. See the License for the - specific language governing permissions and limitations - under the License. ---- - -DirectoryReader -=============== - -An object that lists files and directories within a directory, as -defined in the -[W3C Directories and Systems](http://www.w3.org/TR/file-system-api/) -specification. - -Methods -------- - -- __readEntries__: Read the entries in a directory. - -Supported Platforms -------------------- - -- Android -- BlackBerry WebWorks (OS 5.0 and higher) -- iOS -- Windows Phone 7 and 8 -- Windows 8 - -readEntries ------------ - -Read the entries in this directory. - -__Parameters:__ - -- __successCallback__: A callback that is passed an array of `FileEntry` and `DirectoryEntry` objects. _(Function)_ -- __errorCallback__: A callback that executes if an error occurs when retrieving the directory listing. Invoked with a `FileError` object. _(Function)_ - -__Quick Example__ - - function success(entries) { - var i; - for (i=0; i An API to read, write and navigate file system hierarchies, based on the [W3C File API](http://www.w3.org/TR/FileAPI). - -Objects -------- - -- DirectoryEntry -- DirectoryReader -- File -- FileEntry -- FileError -- FileReader -- FileSystem -- FileTransfer -- FileTransferError -- FileUploadOptions -- FileUploadResult -- FileWriter -- Flags -- LocalFileSystem -- Metadata - -Permissions ------------ - -### Android - -#### app/res/xml/config.xml - - - - -#### app/AndroidManifest.xml - - - -### Bada - - No permissions are required. - -### BlackBerry WebWorks - -#### www/plugins.xml - - - - -#### www/config.xml - - - - - - access_shared - - -### iOS - -#### config.xml - - - - -### webOS - - No permissions are required. - -### Windows Phone - - No permissions are required. diff --git a/plugins/org.apache.cordova.core.file/docs/fileentry/fileentry.md b/plugins/org.apache.cordova.core.file/docs/fileentry/fileentry.md deleted file mode 100644 index f362833..0000000 --- a/plugins/org.apache.cordova.core.file/docs/fileentry/fileentry.md +++ /dev/null @@ -1,323 +0,0 @@ ---- -license: Licensed to the Apache Software Foundation (ASF) under one - or more contributor license agreements. See the NOTICE file - distributed with this work for additional information - regarding copyright ownership. The ASF licenses this file - to you under the Apache License, Version 2.0 (the - "License"); you may not use this file except in compliance - with the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, - software distributed under the License is distributed on an - "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - KIND, either express or implied. See the License for the - specific language governing permissions and limitations - under the License. ---- - -FileEntry -========== - -Represents a file on a file system, as defined in the -[W3C Directories and Systems](http://www.w3.org/TR/file-system-api/) -specification. - -Properties ----------- - -- __isFile__: Always true. _(boolean)_ -- __isDirectory__: Always false. _(boolean)_ -- __name__: The name of the `FileEntry`, excluding the path leading to it. _(DOMString)_ -- __fullPath__: The full absolute path from the root to the `FileEntry`. _(DOMString)_ - -__NOTE:__ The following attribute is defined by the W3C specification, -but is _not_ supported: - -- __filesystem__: The file system on which the `FileEntry` resides. _(FileSystem)_ - -Methods -------- - -- __getMetadata__: Look up metadata about a file. -- __setMetadata__: Set metadata on a file. -- __moveTo__: Move a file to a different location on the file system. -- __copyTo__: Copy a file to a different location on the file system. -- __toURL__: Return a URL that can be used to locate a file. -- __remove__: Delete a file. -- __getParent__: Look up the parent directory. -- __createWriter__: Creates a `FileWriter` object that can be used to write to a file. -- __file__: Creates a `File` object containing file properties. - -Supported Platforms -------------------- - -- Android -- BlackBerry WebWorks (OS 5.0 and higher) -- iOS -- Windows Phone 7 and 8 -- Windows 8 - -getMetadata ----------------- - -Look up metadata about a file. - -__Parameters:__ - -- __successCallback__: A callback that is passed a `Metadata` object. _(Function)_ -- __errorCallback__: A callback that executes if an error occurs when retrieving the `Metadata`. Invoked with a `FileError` object. _(Function)_ - -__Quick Example__ - - function success(metadata) { - console.log("Last Modified: " + metadata.modificationTime); - } - - function fail(error) { - alert(error.code); - } - - // Request the metadata object for this entry - entry.getMetadata(success, fail); - -setMetadata ----------------- - -Set metadata on a file. - -__Currently works only on iOS.__ -- this will set the extended attributes of a file. - -__Parameters:__ - -- __successCallback__: A callback that executes when the metadata is set. _(Function)_ -- __errorCallback__: A callback that executes when the metadata is not successfully set. _(Function)_ -- __metadataObject__: An object that contains the metadata's keys and values. _(Object)_ - -__Quick Example__ - - function success() { - console.log("The metadata was successfully set."); - } - - function fail() { - alert("There was an error in setting the metadata"); - } - - // Set the metadata - entry.setMetadata(success, fail, { "com.apple.MobileBackup": 1}); - -__iOS Quirk__ - -- Only the `com.apple.MobileBackup` extended attribute is supported. Set the value to `1` to prevent the file from being backed up to iCloud. Set the value to `0` to re-enable the file to be backed up to iCloud. - -__Quick Example__ - - function setFileMetadata(localFileSystem, filePath, metadataKey, metadataValue) - { - var onSetMetadataWin = function() { - console.log("success setting metadata") - } - var onSetMetadataFail = function() { - console.log("error setting metadata") - } - - var onGetFileWin = function(parent) { - var data = {}; - data[metadataKey] = metadataValue; - parent.setMetadata(onSetMetadataWin, onSetMetadataFail, data); - } - var onGetFileFail = function() { - console.log("error getting file") - } - - var onFSWin = function(fileSystem) { - fileSystem.root.getFile(filePath, {create: true, exclusive: false}, onGetFileWin, onGetFileFail); - } - - var onFSFail = function(evt) { - console.log(evt.target.error.code); - } - - window.requestFileSystem(localFileSystem, 0, onFSWin, onFSFail); - } - - setFileMetadata(LocalFileSystem.PERSISTENT, "Backups/sqlite.db", "com.apple.MobileBackup", 1); - -moveTo ------- - -Move a file to a different location on the file system. An error -results if the app attempts to: - -- move a file into its parent if a name different from its current one isn't provided; -- move a file to a path occupied by a directory; - -In addition, moving a file on top of an existing file attempts to -delete and replace that file. - -__Parameters:__ - -- __parent__: The parent directory to which to move the file. _(DirectoryEntry)_ -- __newName__: The new name of the file. Defaults to the current name if unspecified. _(DOMString)_ -- __successCallback__: A callback that is passed the new files `FileEntry` object. _(Function)_ -- __errorCallback__: A callback that executes if an error occurs when attempting to move the file. Invoked with a `FileError` object. _(Function)_ - -__Quick Example__ - - function success(entry) { - console.log("New Path: " + entry.fullPath); - } - - function fail(error) { - alert(error.code); - } - - function moveFile(entry) { - var parent = document.getElementById('parent').value, - parentName = parent.substring(parent.lastIndexOf('/')+1), - parentEntry = new DirectoryEntry(parentName, parent); - - // move the file to a new directory and rename it - entry.moveTo(parentEntry, "newFile.txt", success, fail); - } - -copyTo ------- - -Copy a file to a new location on the file system. An error results if -the app attempts to: - -- copy a file into its parent if a name different from its current one is not provided. - -__Parameters:__ - -- __parent__: The parent directory to which to copy the file. _(DirectoryEntry)_ -- __newName__: The new name of the file. Defaults to the current name if unspecified. _(DOMString)_ -- __successCallback__: A callback that is passed the new file's `FileEntry` object. _(Function)_ -- __errorCallback__: A callback that executes if an error occurs when attempting to copy the file. Invoked with a `FileError` object. _(Function)_ - -__Quick Example__ - - function win(entry) { - console.log("New Path: " + entry.fullPath); - } - - function fail(error) { - alert(error.code); - } - - function copyFile(entry) { - var parent = document.getElementById('parent').value, - parentName = parent.substring(parent.lastIndexOf('/')+1), - parentEntry = new DirectoryEntry(parentName, parent); - - // copy the file to a new directory and rename it - entry.copyTo(parentEntry, "file.copy", success, fail); - } - -toURL ------ - -Returns a URL that can be used to locate the file. - -__Quick Example__ - - // Request the URL for this entry - var fileURL = entry.toURL(); - console.log(fileURL); - -remove ------- - -Deletes a file. - -__Parameters:__ - -- __successCallback__: A callback that executes after the file has been deleted. Invoked with no parameters. _(Function)_ -- __errorCallback__: A callback that executes if an error occurs when attempting to delete the file. Invoked with a `FileError` object. _(Function)_ - -__Quick Example__ - - function success(entry) { - console.log("Removal succeeded"); - } - - function fail(error) { - alert('Error removing file: ' + error.code); - } - - // remove the file - entry.remove(success, fail); - -getParent ---------- - -Look up the parent `DirectoryEntry` containing the file. - -__Parameters:__ - -- __successCallback__: A callback that is passed the file's parent `DirectoryEntry`. _(Function)_ -- __errorCallback__: A callback that executes if an error occurs when attempting to retrieve the parent `DirectoryEntry`. Invoked with a `FileError` object. _(Function)_ - -__Quick Example__ - - function success(parent) { - console.log("Parent Name: " + parent.name); - } - - function fail(error) { - alert(error.code); - } - - // Get the parent DirectoryEntry - entry.getParent(success, fail); - -createWriter ------------- - -Create a `FileWriter` object associated with the file represented by the `FileEntry`. - -__Parameters:__ - -- __successCallback__: A callback that is passed a `FileWriter` object. _(Function)_ -- __errorCallback__: A callback that executes if an error occurs while attempting to create the FileWriter. Invoked with a `FileError` object. _(Function)_ - -__Quick Example__ - - function success(writer) { - writer.write("Some text to the file"); - } - - function fail(error) { - alert(error.code); - } - - // create a FileWriter to write to the file - entry.createWriter(success, fail); - -file ----- - -Return a `File` object that represents the current state of the file -that this `FileEntry` represents. - -__Parameters:__ - -- __successCallback__: A callback that is passed a `File` object. _(Function)_ -- __errorCallback__: A callback that executes if an error occurs when creating the `File` object, such as when the file no longer exists. Invoked with a `FileError` object. _(Function)_ - -__Quick Example__ - - function success(file) { - console.log("File size: " + file.size); - } - - function fail(error) { - alert("Unable to retrieve file properties: " + error.code); - } - - // obtain properties of a file - entry.file(success, fail); diff --git a/plugins/org.apache.cordova.core.file/docs/fileerror/fileerror.md b/plugins/org.apache.cordova.core.file/docs/fileerror/fileerror.md deleted file mode 100644 index 1d7f39f..0000000 --- a/plugins/org.apache.cordova.core.file/docs/fileerror/fileerror.md +++ /dev/null @@ -1,51 +0,0 @@ ---- -license: Licensed to the Apache Software Foundation (ASF) under one - or more contributor license agreements. See the NOTICE file - distributed with this work for additional information - regarding copyright ownership. The ASF licenses this file - to you under the Apache License, Version 2.0 (the - "License"); you may not use this file except in compliance - with the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, - software distributed under the License is distributed on an - "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - KIND, either express or implied. See the License for the - specific language governing permissions and limitations - under the License. ---- - -FileError -======== - -A `FileError` object is set when an error occurs in any of the File API methods. - -Properties ----------- - -- __code__: One of the predefined error codes listed below. - -Constants ---------- - -- `FileError.NOT_FOUND_ERR` -- `FileError.SECURITY_ERR` -- `FileError.ABORT_ERR` -- `FileError.NOT_READABLE_ERR` -- `FileError.ENCODING_ERR` -- `FileError.NO_MODIFICATION_ALLOWED_ERR` -- `FileError.INVALID_STATE_ERR` -- `FileError.SYNTAX_ERR` -- `FileError.INVALID_MODIFICATION_ERR` -- `FileError.QUOTA_EXCEEDED_ERR` -- `FileError.TYPE_MISMATCH_ERR` -- `FileError.PATH_EXISTS_ERR` - -Description ------------ - -The `FileError` object is the only parameter provided to any of the -File API's error callbacks. To determine the type of error, compare -its `code` property to any of the listings above. diff --git a/plugins/org.apache.cordova.core.file/docs/fileobj/fileobj.md b/plugins/org.apache.cordova.core.file/docs/fileobj/fileobj.md deleted file mode 100644 index ee5f1d4..0000000 --- a/plugins/org.apache.cordova.core.file/docs/fileobj/fileobj.md +++ /dev/null @@ -1,83 +0,0 @@ ---- -license: Licensed to the Apache Software Foundation (ASF) under one - or more contributor license agreements. See the NOTICE file - distributed with this work for additional information - regarding copyright ownership. The ASF licenses this file - to you under the Apache License, Version 2.0 (the - "License"); you may not use this file except in compliance - with the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, - software distributed under the License is distributed on an - "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - KIND, either express or implied. See the License for the - specific language governing permissions and limitations - under the License. ---- - -File -==== - -This object contains attributes of a single file. - -Properties ----------- - -- __name__: The name of the file. _(DOMString)_ -- __fullPath__: The full path of the file including the file name. _(DOMString)_ -- __type__: The mime type of the file. _(DOMString)_ -- __lastModifiedDate__: The last time the file was modified. _(Date)_ -- __size__: The size of the file in bytes. _(long)_ - -Methods -------- - -- __slice__: Select only a portion of the file to be read. - -Details -------- - -The `File` object contains attributes of a single file. You can get -an instance of a `File` object by calling a `FileEntry` object's -`file()` method. - -Supported Platforms -------------------- - -- Android -- BlackBerry WebWorks (OS 5.0 and higher) -- iOS -- Windows Phone 7 and 8 -- Windows 8 - -slice --------------- - -Return a new `File` object, for which `FileReader` returns only the -specified portion of the file. Negative values for `start` or `end` -are measured from the end of the file. Indexes are positioned -relative to the current slice. (See the full example below.) - -__Parameters:__ - -- __start__: The index of the first byte to read, inclusive. -- __end__: The index of the byte after the last one to read. - -__Quick Example__ - - var slicedFile = file.slice(10, 30); - -__Full Example__ - - var slice1 = file.slice(100, 400); - var slice2 = slice1.slice(20, 35); - - var slice3 = file.slice(120, 135); - // slice2 and slice3 are equivalent. - -__Supported Platforms:__ - -- Android -- iOS diff --git a/plugins/org.apache.cordova.core.file/docs/filereader/filereader.md b/plugins/org.apache.cordova.core.file/docs/filereader/filereader.md deleted file mode 100644 index 25f6ff0..0000000 --- a/plugins/org.apache.cordova.core.file/docs/filereader/filereader.md +++ /dev/null @@ -1,259 +0,0 @@ ---- -license: Licensed to the Apache Software Foundation (ASF) under one - or more contributor license agreements. See the NOTICE file - distributed with this work for additional information - regarding copyright ownership. The ASF licenses this file - to you under the Apache License, Version 2.0 (the - "License"); you may not use this file except in compliance - with the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, - software distributed under the License is distributed on an - "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - KIND, either express or implied. See the License for the - specific language governing permissions and limitations - under the License. ---- - -FileReader -========== - -The `FileReader` allows basic access to a file. - -Properties ----------- - -- __readyState__: One of the reader's three possible states, either `EMPTY`, `LOADING` or `DONE`. -- __result__: The contents of the file that have been read. _(DOMString)_ -- __error__: An object containing errors. _(FileError)_ -- __onloadstart__: Called when the read starts. _(Function)_ -- __onload__: Called when the read has successfully completed. _(Function)_ -- __onabort__: Called when the read has been aborted. For instance, by invoking the `abort()` method. _(Function)_ -- __onerror__: Called when the read has failed. _(Function)_ -- __onloadend__: Called when the request has completed (either in success or failure). _(Function)_ - -__NOTE:__ The following porperty is not supported: - -- __onprogress__: Called while reading the file, reporting progress in terms of `progress.loaded`/`progress.total`. _(Function)_ - -Methods -------- - -- __abort__: Aborts reading file. -- __readAsDataURL__: Read file and return data as a base64-encoded data URL. -- __readAsText__: Reads text file. -- __readAsBinaryString__: Reads file as binary and returns a binary string. -- __readAsArrayBuffer__: Reads file as an `ArrayBuffer`. - -Details -------- - -The `FileReader` object offers a way to read files from the device's -file system. Files can be read as text or as a base64 data-encoded -string. Event listeners receive the `loadstart`, `progress`, `load`, -`loadend`, `error`, and `abort` events. - -Supported Platforms -------------------- - -- Android -- BlackBerry WebWorks (OS 5.0 and higher) -- iOS -- Windows Phone 7 and 8 -- Windows 8 - -Read As Data URL ----------------- - -__Parameters:__ - -- __file__: the file object to read. - -Quick Example -------------- - - function win(file) { - var reader = new FileReader(); - reader.onloadend = function (evt) { - console.log("read success"); - console.log(evt.target.result); - }; - reader.readAsDataURL(file); - }; - - var fail = function (evt) { - console.log(error.code); - }; - - entry.file(win, fail); - -Read As Text ------------- - -__Parameters:__ - -- __file__: the file object to read. -- __encoding__: the encoding to use to encode the file's content. Default is UTF8. - -Quick Example -------------- - - function win(file) { - var reader = new FileReader(); - reader.onloadend = function (evt) { - console.log("read success"); - console.log(evt.target.result); - }; - reader.readAsText(file); - }; - - var fail = function (evt) { - console.log(error.code); - }; - - entry.file(win, fail); - -Abort Quick Example -------------------- - - function win(file) { - var reader = new FileReader(); - reader.onloadend = function(evt) { - console.log("read success"); - console.log(evt.target.result); - }; - reader.readAsText(file); - reader.abort(); - }; - - function fail(error) { - console.log(error.code); - } - - entry.file(win, fail); - -Full Example ------------- - - - - - FileReader Example - - - - - -

Example

-

Read File

- - - -iOS Quirks ----------- -- The __encoding__ parameter is not supported, and UTF8 encoding is always in effect. - -Read As Binary String ---------------------- - -Currently supported on iOS and Android only. - -__Parameters:__ - -- __file__: the file object to read. - -Quick Example -------------- - - function win(file) { - var reader = new FileReader(); - reader.onloadend = function (evt) { - console.log("read success"); - console.log(evt.target.result); - }; - reader.readAsBinaryString(file); - }; - - var fail = function (evt) { - console.log(error.code); - }; - - entry.file(win, fail); - -Read As Array Buffer --------------------- - -Currently supported on iOS and Android only. - -__Parameters:__ - -- __file__: the file object to read. - -Quick Example -------------- - - function win(file) { - var reader = new FileReader(); - reader.onloadend = function (evt) { - console.log("read success"); - console.log(new Uint8Array(evt.target.result)); - }; - reader.readAsArrayBuffer(file); - }; - - var fail = function (evt) { - console.log(error.code); - }; - - entry.file(win, fail); diff --git a/plugins/org.apache.cordova.core.file/docs/filesystem/filesystem.md b/plugins/org.apache.cordova.core.file/docs/filesystem/filesystem.md deleted file mode 100644 index c8eaa2c..0000000 --- a/plugins/org.apache.cordova.core.file/docs/filesystem/filesystem.md +++ /dev/null @@ -1,95 +0,0 @@ ---- -license: Licensed to the Apache Software Foundation (ASF) under one - or more contributor license agreements. See the NOTICE file - distributed with this work for additional information - regarding copyright ownership. The ASF licenses this file - to you under the Apache License, Version 2.0 (the - "License"); you may not use this file except in compliance - with the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, - software distributed under the License is distributed on an - "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - KIND, either express or implied. See the License for the - specific language governing permissions and limitations - under the License. ---- - -FileSystem -========== - -This object represents a file system. - -Properties ----------- - -- __name__: The name of the file system. _(DOMString)_ -- __root__: The root directory of the file system. _(DirectoryEntry)_ - -Details -------- - -The `FileSystem` object represents information about the file system. -The name of the file system is unique across the list of exposed -file systems. The root property contains a `DirectoryEntry` object -that represents the file system's root directory. - -Supported Platforms -------------------- - -- Android -- BlackBerry WebWorks (OS 5.0 and higher) -- iOS -- Windows Phone 7 and 8 -- Windows 8 - -File System Quick Example -------------------------- - - function onSuccess(fileSystem) { - console.log(fileSystem.name); - console.log(fileSystem.root.name); - } - - // request the persistent file system - window.requestFileSystem(LocalFileSystem.PERSISTENT, 0, onSuccess, null); - -Full Example ------------- - - - - - File System Example - - - - - -

Example

-

File System

- - diff --git a/plugins/org.apache.cordova.core.file/docs/fileuploadoptions/fileuploadoptions.md b/plugins/org.apache.cordova.core.file/docs/fileuploadoptions/fileuploadoptions.md deleted file mode 100644 index e0e6fe2..0000000 --- a/plugins/org.apache.cordova.core.file/docs/fileuploadoptions/fileuploadoptions.md +++ /dev/null @@ -1,47 +0,0 @@ ---- -license: Licensed to the Apache Software Foundation (ASF) under one - or more contributor license agreements. See the NOTICE file - distributed with this work for additional information - regarding copyright ownership. The ASF licenses this file - to you under the Apache License, Version 2.0 (the - "License"); you may not use this file except in compliance - with the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, - software distributed under the License is distributed on an - "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - KIND, either express or implied. See the License for the - specific language governing permissions and limitations - under the License. ---- - -FileUploadOptions -======== - -A `FileUploadOptions` object can be passed to the `FileTransfer` -object's `upload()` method to specify additional parameters to the -upload script. - -Properties ----------- - -- __fileKey__: The name of the form element. Defaults to `file`. (DOMString) -- __fileName__: The file name to use when saving the file on the server. Defaults to `image.jpg`. (DOMString) -- __mimeType__: The mime type of the data to upload. Defaults to `image/jpeg`. (DOMString) -- __params__: A set of optional key/value pairs to pass in the HTTP request. (Object) -- __chunkedMode__: Whether to upload the data in chunked streaming mode. Defaults to `true`. (Boolean) -- __headers__: A map of header name/header values. Use an array to specify more than one value. (Object) - -Description ------------ - -A `FileUploadOptions` object can be passed to the `FileTransfer` -object's `upload()` method to specify additional parameters to the -upload script. - -WP7 Quirk ---------- - -- __chunkedMode:__: Ignored on WP7. diff --git a/plugins/org.apache.cordova.core.file/docs/fileuploadresult/fileuploadresult.md b/plugins/org.apache.cordova.core.file/docs/fileuploadresult/fileuploadresult.md deleted file mode 100644 index 4d9305a..0000000 --- a/plugins/org.apache.cordova.core.file/docs/fileuploadresult/fileuploadresult.md +++ /dev/null @@ -1,42 +0,0 @@ ---- -license: Licensed to the Apache Software Foundation (ASF) under one - or more contributor license agreements. See the NOTICE file - distributed with this work for additional information - regarding copyright ownership. The ASF licenses this file - to you under the Apache License, Version 2.0 (the - "License"); you may not use this file except in compliance - with the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, - software distributed under the License is distributed on an - "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - KIND, either express or implied. See the License for the - specific language governing permissions and limitations - under the License. ---- - -FileUploadResult -======== - -A `FileUploadResult` object is passed to the success callback of the -`FileTransfer` object's `upload()` method. - -Properties ----------- - -- __bytesSent__: The number of bytes sent to the server as part of the upload. (long) -- __responseCode__: The HTTP response code returned by the server. (long) -- __response__: The HTTP response returned by the server. (DOMString) - -Description ------------ - -The `FileUploadResult` object is returned via the success callback of -the `FileTransfer` object's `upload()` method. - -iOS Quirks ----------- - -- Does not support `responseCode` or `bytesSent`. diff --git a/plugins/org.apache.cordova.core.file/docs/filewriter/filewriter.md b/plugins/org.apache.cordova.core.file/docs/filewriter/filewriter.md deleted file mode 100644 index 2269c06..0000000 --- a/plugins/org.apache.cordova.core.file/docs/filewriter/filewriter.md +++ /dev/null @@ -1,233 +0,0 @@ ---- -license: Licensed to the Apache Software Foundation (ASF) under one - or more contributor license agreements. See the NOTICE file - distributed with this work for additional information - regarding copyright ownership. The ASF licenses this file - to you under the Apache License, Version 2.0 (the - "License"); you may not use this file except in compliance - with the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, - software distributed under the License is distributed on an - "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - KIND, either express or implied. See the License for the - specific language governing permissions and limitations - under the License. ---- - -FileWriter -========== - -As object that allows you to create and write data to a file. - -Properties ----------- - -- __readyState__: One of the three possible states, either `INIT`, `WRITING`, or `DONE`. -- __fileName__: The name of the file to be written. _(DOMString)_ -- __length__: The length of the file to be written. _(long)_ -- __position__: The current position of the file pointer. _(long)_ -- __error__: An object containing errors. _(FileError)_ -- __onwritestart__: Called when the write starts. _(Function)_ -- __onwrite__: Called when the request has completed successfully. _(Function)_ -- __onabort__: Called when the write has been aborted. For instance, by invoking the abort() method. _(Function)_ -- __onerror__: Called when the write has failed. _(Function)_ -- __onwriteend__: Called when the request has completed (either in success or failure). _(Function)_ - -The following property is _not_ supported: - -- __onprogress__: Called while writing the file, reporting progress in terms of `progress.loaded`/`progress.total`. _(Function)_ -Methods -------- - -- __abort__: Aborts writing the file. -- __seek__: Moves the file pointer to the specified byte. -- __truncate__: Shortens the file to the specified length. -- __write__: Writes data to the file. - -Details -------- - -The `FileWriter` object offers a way to write UTF-8 encoded files to -the device file system. Applications respond to `writestart`, -`progress`, `write`, `writeend`, `error`, and `abort` events. - -Each `FileWriter` corresponds to a single file, to which data can be -written many times. The `FileWriter` maintains the file's `position` -and `length` attributes, which allow the app to `seek` and `write` -anywhere in the file. By default, the `FileWriter` writes to the -beginning of the file, overwriting existing data. Set the optional -`append` boolean to `true` in the `FileWriter`'s constructor to -write to the end of the file. - -Text data is supported by all platforms listed below. Text is encoded as UTF-8 before being written to the filesystem. Some platforms also support binary data, which can be passed in as either an ArrayBuffer or a Blob. - -Supported Platforms -------------------- - -### Text and Binary suport - -- Android -- iOS - -### Text only support - -- BlackBerry WebWorks (OS 5.0 and higher) -- Windows Phone 7 and 8 -- Windows 8 - -Seek Quick Example ------------------------------- - - function win(writer) { - // fast forwards file pointer to end of file - writer.seek(writer.length); - }; - - var fail = function(evt) { - console.log(error.code); - }; - - entry.createWriter(win, fail); - -Truncate Quick Example --------------------------- - - function win(writer) { - writer.truncate(10); - }; - - var fail = function(evt) { - console.log(error.code); - }; - - entry.createWriter(win, fail); - -Write Quick Example -------------------- - - function win(writer) { - writer.onwrite = function(evt) { - console.log("write success"); - }; - writer.write("some sample text"); - }; - - var fail = function(evt) { - console.log(error.code); - }; - - entry.createWriter(win, fail); - -Binary Write Quick Example --------------------------- - - function win(writer) { - var data = new ArrayBuffer(5), - dataView = new Int8Array(data); - for (i=0; i < 5; i++) { - dataView[i] = i; - } - writer.onwrite = function(evt) { - console.log("write success"); - }; - writer.write(data); - }; - - var fail = function(evt) { - console.log(error.code); - }; - - entry.createWriter(win, fail); - -Append Quick Example --------------------- - - function win(writer) { - writer.onwrite = function(evt) { - console.log("write success"); - }; - writer.seek(writer.length); - writer.write("appended text"); - }; - - var fail = function(evt) { - console.log(error.code); - }; - - entry.createWriter(win, fail); - -Abort Quick Example -------------------- - - function win(writer) { - writer.onwrite = function(evt) { - console.log("write success"); - }; - writer.write("some sample text"); - writer.abort(); - }; - - var fail = function(evt) { - console.log(error.code); - }; - - entry.createWriter(win, fail); - -Full Example ------------- - - - - FileWriter Example - - - - - -

Example

-

Write File

- - diff --git a/plugins/org.apache.cordova.core.file/docs/flags/flags.md b/plugins/org.apache.cordova.core.file/docs/flags/flags.md deleted file mode 100644 index 504f323..0000000 --- a/plugins/org.apache.cordova.core.file/docs/flags/flags.md +++ /dev/null @@ -1,49 +0,0 @@ ---- -license: Licensed to the Apache Software Foundation (ASF) under one - or more contributor license agreements. See the NOTICE file - distributed with this work for additional information - regarding copyright ownership. The ASF licenses this file - to you under the Apache License, Version 2.0 (the - "License"); you may not use this file except in compliance - with the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, - software distributed under the License is distributed on an - "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - KIND, either express or implied. See the License for the - specific language governing permissions and limitations - under the License. ---- - -Flags -===== - -Supplies arguments to the `DirectoryEntry` object's `getFile()` and -`getDirectory()` methods, which look up or create files and -directories, respectively. - -Properties ----------- - -- __create__: Indicates that the file or directory should be created if it does not already exist. _(boolean)_ -- __exclusive__: Has has no effect by itself, but when used with `create` causes the file or directory creation to fail if the target path already exists. _(boolean)_ - -Supported Platforms -------------------- - -- Android -- BlackBerry WebWorks (OS 5.0 and higher) -- iOS -- Windows Phone 7 and 8 -- Windows 8 - -Quick Example -------------- - - // Get the data directory, creating it if it doesn't exist. - dataDir = fileSystem.root.getDirectory("data", {create: true}); - - // Create the lock file, if and only if it doesn't exist. - lockFile = dataDir.getFile("lockfile.txt", {create: true, exclusive: true}); diff --git a/plugins/org.apache.cordova.core.file/docs/localfilesystem/localfilesystem.md b/plugins/org.apache.cordova.core.file/docs/localfilesystem/localfilesystem.md deleted file mode 100644 index 2b933c9..0000000 --- a/plugins/org.apache.cordova.core.file/docs/localfilesystem/localfilesystem.md +++ /dev/null @@ -1,110 +0,0 @@ ---- -license: Licensed to the Apache Software Foundation (ASF) under one - or more contributor license agreements. See the NOTICE file - distributed with this work for additional information - regarding copyright ownership. The ASF licenses this file - to you under the Apache License, Version 2.0 (the - "License"); you may not use this file except in compliance - with the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, - software distributed under the License is distributed on an - "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - KIND, either express or implied. See the License for the - specific language governing permissions and limitations - under the License. ---- - -LocalFileSystem -=============== - -This object provides a way to obtain root file systems. - -Methods ----------- - -- __requestFileSystem__: Requests a filesystem. _(Function)_ -- __resolveLocalFileSystemURI__: Retrieve a `DirectoryEntry` or `FileEntry` using local URI. _(Function)_ - -Constants ---------- - -- `LocalFileSystem.PERSISTENT`: Used for storage that should not be removed by the user agent without application or user permission. -- `LocalFileSystem.TEMPORARY`: Used for storage with no guarantee of persistence. - -Details -------- - -The `LocalFileSystem` object methods are defined on the `window` object. - -Supported Platforms -------------------- - -- Android -- BlackBerry WebWorks (OS 5.0 and higher) -- iOS -- Windows Phone 7 and 8 -- Windows 8 - -Request File System Quick Example ---------------------------------- - - function onSuccess(fileSystem) { - console.log(fileSystem.name); - } - - // request the persistent file system - window.requestFileSystem(LocalFileSystem.PERSISTENT, 0, onSuccess, onError); - -Resolve Local File System URI Quick Example -------------------------------------------- - - function onSuccess(fileEntry) { - console.log(fileEntry.name); - } - - window.resolveLocalFileSystemURI("file:///example.txt", onSuccess, onError); - -Full Example ------------- - - - - - Local File System Example - - - - - -

Example

-

Local File System

- - diff --git a/plugins/org.apache.cordova.core.file/docs/metadata/metadata.md b/plugins/org.apache.cordova.core.file/docs/metadata/metadata.md deleted file mode 100644 index bfa3a46..0000000 --- a/plugins/org.apache.cordova.core.file/docs/metadata/metadata.md +++ /dev/null @@ -1,54 +0,0 @@ ---- -license: Licensed to the Apache Software Foundation (ASF) under one - or more contributor license agreements. See the NOTICE file - distributed with this work for additional information - regarding copyright ownership. The ASF licenses this file - to you under the Apache License, Version 2.0 (the - "License"); you may not use this file except in compliance - with the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, - software distributed under the License is distributed on an - "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - KIND, either express or implied. See the License for the - specific language governing permissions and limitations - under the License. ---- - -Metadata -========== - -An interface that supplies information about the state of a file or directory. - -Properties ----------- - -- __modificationTime__: The time when the file or directory was last modified. _(Date)_ - -Details -------- - -The `Metadata` object represents information about the state of a file -or directory. Calling a `DirectoryEntry` or `FileEntry` object's -`getMetadata()` method results in a `Metadata` instance. - -Supported Platforms -------------------- - -- Android -- BlackBerry WebWorks (OS 5.0 and higher) -- iOS -- Windows Phone 7 and 8 -- Windows 8 - -Quick Example -------------- - - function win(metadata) { - console.log("Last Modified: " + metadata.modificationTime); - } - - // Request the metadata object for this entry - entry.getMetadata(win, null); diff --git a/plugins/org.apache.cordova.core.file/plugin.xml b/plugins/org.apache.cordova.core.file/plugin.xml deleted file mode 100644 index 4ab3eeb..0000000 --- a/plugins/org.apache.cordova.core.file/plugin.xml +++ /dev/null @@ -1,194 +0,0 @@ - - - - File - Cordova File Plugin - Apache - cordova,file - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/plugins/org.apache.cordova.core.file/src/android/EncodingException.java b/plugins/org.apache.cordova.core.file/src/android/EncodingException.java deleted file mode 100644 index 430e8c8..0000000 --- a/plugins/org.apache.cordova.core.file/src/android/EncodingException.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - Licensed to the Apache Software Foundation (ASF) under one - or more contributor license agreements. See the NOTICE file - distributed with this work for additional information - regarding copyright ownership. The ASF licenses this file - to you under the Apache License, Version 2.0 (the - "License"); you may not use this file except in compliance - with the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, - software distributed under the License is distributed on an - "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - KIND, either express or implied. See the License for the - specific language governing permissions and limitations - under the License. -*/ - -package org.apache.cordova.core; - -public class EncodingException extends Exception { - - public EncodingException(String message) { - super(message); - } - -} diff --git a/plugins/org.apache.cordova.core.file/src/android/FileExistsException.java b/plugins/org.apache.cordova.core.file/src/android/FileExistsException.java deleted file mode 100644 index 9549097..0000000 --- a/plugins/org.apache.cordova.core.file/src/android/FileExistsException.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - Licensed to the Apache Software Foundation (ASF) under one - or more contributor license agreements. See the NOTICE file - distributed with this work for additional information - regarding copyright ownership. The ASF licenses this file - to you under the Apache License, Version 2.0 (the - "License"); you may not use this file except in compliance - with the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, - software distributed under the License is distributed on an - "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - KIND, either express or implied. See the License for the - specific language governing permissions and limitations - under the License. -*/ - -package org.apache.cordova.core; - -public class FileExistsException extends Exception { - - public FileExistsException(String msg) { - super(msg); - } - -} diff --git a/plugins/org.apache.cordova.core.file/src/android/FileUtils.java b/plugins/org.apache.cordova.core.file/src/android/FileUtils.java deleted file mode 100644 index 8c8f513..0000000 --- a/plugins/org.apache.cordova.core.file/src/android/FileUtils.java +++ /dev/null @@ -1,1063 +0,0 @@ -/* - Licensed to the Apache Software Foundation (ASF) under one - or more contributor license agreements. See the NOTICE file - distributed with this work for additional information - regarding copyright ownership. The ASF licenses this file - to you under the Apache License, Version 2.0 (the - "License"); you may not use this file except in compliance - with the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, - software distributed under the License is distributed on an - "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - KIND, either express or implied. See the License for the - specific language governing permissions and limitations - under the License. - */ -package org.apache.cordova.core; - -import android.database.Cursor; -import android.net.Uri; -import android.os.Environment; -import android.provider.MediaStore; -import android.util.Base64; -import android.util.Log; - -import org.apache.cordova.CallbackContext; -import org.apache.cordova.CordovaPlugin; -import org.apache.cordova.PluginResult; -import org.apache.cordova.DirectoryManager; -import org.apache.cordova.FileHelper; - -import org.json.JSONArray; -import org.json.JSONException; -import org.json.JSONObject; - -import java.io.ByteArrayInputStream; -import java.io.File; -import java.io.FileInputStream; -import java.io.FileNotFoundException; -import java.io.FileOutputStream; -import java.io.IOException; -import java.io.InputStream; -import java.io.RandomAccessFile; -import java.net.MalformedURLException; -import java.net.URL; -import java.net.URLDecoder; -import java.nio.channels.FileChannel; - -/** - * This class provides SD card file and directory services to JavaScript. - * Only files on the SD card can be accessed. - */ -public class FileUtils extends CordovaPlugin { - private static final String LOG_TAG = "FileUtils"; - - public static int NOT_FOUND_ERR = 1; - public static int SECURITY_ERR = 2; - public static int ABORT_ERR = 3; - - public static int NOT_READABLE_ERR = 4; - public static int ENCODING_ERR = 5; - public static int NO_MODIFICATION_ALLOWED_ERR = 6; - public static int INVALID_STATE_ERR = 7; - public static int SYNTAX_ERR = 8; - public static int INVALID_MODIFICATION_ERR = 9; - public static int QUOTA_EXCEEDED_ERR = 10; - public static int TYPE_MISMATCH_ERR = 11; - public static int PATH_EXISTS_ERR = 12; - - public static int TEMPORARY = 0; - public static int PERSISTENT = 1; - public static int RESOURCE = 2; - public static int APPLICATION = 3; - - /** - * Constructor. - */ - public FileUtils() { - } - - /** - * Executes the request and returns whether the action was valid. - * - * @param action The action to execute. - * @param args JSONArray of arguments for the plugin. - * @param callbackContext The callback context used when calling back into JavaScript. - * @return True if the action was valid, false otherwise. - */ - public boolean execute(String action, JSONArray args, CallbackContext callbackContext) throws JSONException { - try { - if (action.equals("testSaveLocationExists")) { - boolean b = DirectoryManager.testSaveLocationExists(); - callbackContext.sendPluginResult(new PluginResult(PluginResult.Status.OK, b)); - } - else if (action.equals("getFreeDiskSpace")) { - long l = DirectoryManager.getFreeDiskSpace(false); - callbackContext.sendPluginResult(new PluginResult(PluginResult.Status.OK, l)); - } - else if (action.equals("testFileExists")) { - boolean b = DirectoryManager.testFileExists(args.getString(0)); - callbackContext.sendPluginResult(new PluginResult(PluginResult.Status.OK, b)); - } - else if (action.equals("testDirectoryExists")) { - boolean b = DirectoryManager.testFileExists(args.getString(0)); - callbackContext.sendPluginResult(new PluginResult(PluginResult.Status.OK, b)); - } - else if (action.equals("readAsText")) { - String encoding = args.getString(1); - int start = args.getInt(2); - int end = args.getInt(3); - - this.readFileAs(args.getString(0), start, end, callbackContext, encoding, PluginResult.MESSAGE_TYPE_STRING); - } - else if (action.equals("readAsDataURL")) { - int start = args.getInt(1); - int end = args.getInt(2); - - this.readFileAs(args.getString(0), start, end, callbackContext, null, -1); - } - else if (action.equals("readAsArrayBuffer")) { - int start = args.getInt(1); - int end = args.getInt(2); - - this.readFileAs(args.getString(0), start, end, callbackContext, null, PluginResult.MESSAGE_TYPE_ARRAYBUFFER); - } - else if (action.equals("readAsBinaryString")) { - int start = args.getInt(1); - int end = args.getInt(2); - - this.readFileAs(args.getString(0), start, end, callbackContext, null, PluginResult.MESSAGE_TYPE_BINARYSTRING); - } - else if (action.equals("write")) { - long fileSize = this.write(args.getString(0), args.getString(1), args.getInt(2), args.getBoolean(3)); - callbackContext.sendPluginResult(new PluginResult(PluginResult.Status.OK, fileSize)); - } - else if (action.equals("truncate")) { - long fileSize = this.truncateFile(args.getString(0), args.getLong(1)); - callbackContext.sendPluginResult(new PluginResult(PluginResult.Status.OK, fileSize)); - } - else if (action.equals("requestFileSystem")) { - long size = args.optLong(1); - if (size != 0 && size > (DirectoryManager.getFreeDiskSpace(true) * 1024)) { - callbackContext.sendPluginResult(new PluginResult(PluginResult.Status.ERROR, FileUtils.QUOTA_EXCEEDED_ERR)); - } else { - JSONObject obj = requestFileSystem(args.getInt(0)); - callbackContext.success(obj); - } - } - else if (action.equals("resolveLocalFileSystemURI")) { - JSONObject obj = resolveLocalFileSystemURI(args.getString(0)); - callbackContext.success(obj); - } - else if (action.equals("getMetadata")) { - callbackContext.sendPluginResult(new PluginResult(PluginResult.Status.OK, getMetadata(args.getString(0)))); - } - else if (action.equals("getFileMetadata")) { - JSONObject obj = getFileMetadata(args.getString(0)); - callbackContext.success(obj); - } - else if (action.equals("getParent")) { - JSONObject obj = getParent(args.getString(0)); - callbackContext.success(obj); - } - else if (action.equals("getDirectory")) { - JSONObject obj = getFile(args.getString(0), args.getString(1), args.optJSONObject(2), true); - callbackContext.success(obj); - } - else if (action.equals("getFile")) { - JSONObject obj = getFile(args.getString(0), args.getString(1), args.optJSONObject(2), false); - callbackContext.success(obj); - } - else if (action.equals("remove")) { - boolean success; - - success = remove(args.getString(0)); - - if (success) { - notifyDelete(args.getString(0)); - callbackContext.success(); - } else { - callbackContext.error(FileUtils.NO_MODIFICATION_ALLOWED_ERR); - } - } - else if (action.equals("removeRecursively")) { - boolean success = removeRecursively(args.getString(0)); - if (success) { - callbackContext.success(); - } else { - callbackContext.error(FileUtils.NO_MODIFICATION_ALLOWED_ERR); - } - } - else if (action.equals("moveTo")) { - JSONObject entry = transferTo(args.getString(0), args.getString(1), args.getString(2), true); - callbackContext.success(entry); - } - else if (action.equals("copyTo")) { - JSONObject entry = transferTo(args.getString(0), args.getString(1), args.getString(2), false); - callbackContext.success(entry); - } - else if (action.equals("readEntries")) { - JSONArray entries = readEntries(args.getString(0)); - callbackContext.success(entries); - } - else { - return false; - } - } catch (FileNotFoundException e) { - callbackContext.error(FileUtils.NOT_FOUND_ERR); - } catch (FileExistsException e) { - callbackContext.error(FileUtils.PATH_EXISTS_ERR); - } catch (NoModificationAllowedException e) { - callbackContext.error(FileUtils.NO_MODIFICATION_ALLOWED_ERR); - } catch (InvalidModificationException e) { - callbackContext.error(FileUtils.INVALID_MODIFICATION_ERR); - } catch (MalformedURLException e) { - callbackContext.error(FileUtils.ENCODING_ERR); - } catch (IOException e) { - callbackContext.error(FileUtils.INVALID_MODIFICATION_ERR); - } catch (EncodingException e) { - callbackContext.error(FileUtils.ENCODING_ERR); - } catch (TypeMismatchException e) { - callbackContext.error(FileUtils.TYPE_MISMATCH_ERR); - } - return true; - } - - /** - * Need to check to see if we need to clean up the content store - * - * @param filePath the path to check - */ - private void notifyDelete(String filePath) { - String newFilePath = FileHelper.getRealPath(filePath, cordova); - try { - this.cordova.getActivity().getContentResolver().delete(MediaStore.Images.Media.EXTERNAL_CONTENT_URI, - MediaStore.Images.Media.DATA + " = ?", - new String[] { newFilePath }); - } catch (UnsupportedOperationException t) { - // Was seeing this on the File mobile-spec tests on 4.0.3 x86 emulator. - // The ContentResolver applies only when the file was registered in the - // first case, which is generally only the case with images. - } - } - - /** - * Allows the user to look up the Entry for a file or directory referred to by a local URI. - * - * @param url of the file/directory to look up - * @return a JSONObject representing a Entry from the filesystem - * @throws MalformedURLException if the url is not valid - * @throws FileNotFoundException if the file does not exist - * @throws IOException if the user can't read the file - * @throws JSONException - */ - @SuppressWarnings("deprecation") - private JSONObject resolveLocalFileSystemURI(String url) throws IOException, JSONException { - String decoded = URLDecoder.decode(url, "UTF-8"); - - File fp = null; - - // Handle the special case where you get an Android content:// uri. - if (decoded.startsWith("content:")) { - Cursor cursor = this.cordova.getActivity().managedQuery(Uri.parse(decoded), new String[] { MediaStore.Images.Media.DATA }, null, null, null); - // Note: MediaStore.Images/Audio/Video.Media.DATA is always "_data" - int column_index = cursor.getColumnIndexOrThrow(MediaStore.Images.Media.DATA); - cursor.moveToFirst(); - fp = new File(cursor.getString(column_index)); - } else { - // Test to see if this is a valid URL first - @SuppressWarnings("unused") - URL testUrl = new URL(decoded); - - if (decoded.startsWith("file://")) { - int questionMark = decoded.indexOf("?"); - if (questionMark < 0) { - fp = new File(decoded.substring(7, decoded.length())); - } else { - fp = new File(decoded.substring(7, questionMark)); - } - } else { - fp = new File(decoded); - } - } - - if (!fp.exists()) { - throw new FileNotFoundException(); - } - if (!fp.canRead()) { - throw new IOException(); - } - return getEntry(fp); - } - - /** - * Read the list of files from this directory. - * - * @param fileName the directory to read from - * @return a JSONArray containing JSONObjects that represent Entry objects. - * @throws FileNotFoundException if the directory is not found. - * @throws JSONException - */ - private JSONArray readEntries(String fileName) throws FileNotFoundException, JSONException { - File fp = createFileObject(fileName); - - if (!fp.exists()) { - // The directory we are listing doesn't exist so we should fail. - throw new FileNotFoundException(); - } - - JSONArray entries = new JSONArray(); - - if (fp.isDirectory()) { - File[] files = fp.listFiles(); - for (int i = 0; i < files.length; i++) { - if (files[i].canRead()) { - entries.put(getEntry(files[i])); - } - } - } - - return entries; - } - - /** - * A setup method that handles the move/copy of files/directories - * - * @param fileName to be copied/moved - * @param newParent is the location where the file will be copied/moved to - * @param newName for the file directory to be called, if null use existing file name - * @param move if false do a copy, if true do a move - * @return a Entry object - * @throws NoModificationAllowedException - * @throws IOException - * @throws InvalidModificationException - * @throws EncodingException - * @throws JSONException - * @throws FileExistsException - */ - private JSONObject transferTo(String fileName, String newParent, String newName, boolean move) throws JSONException, NoModificationAllowedException, IOException, InvalidModificationException, EncodingException, FileExistsException { - String newFileName = FileHelper.getRealPath(fileName, cordova); - newParent = FileHelper.getRealPath(newParent, cordova); - - // Check for invalid file name - if (newName != null && newName.contains(":")) { - throw new EncodingException("Bad file name"); - } - - File source = new File(newFileName); - - if (!source.exists()) { - // The file/directory we are copying doesn't exist so we should fail. - throw new FileNotFoundException("The source does not exist"); - } - - File destinationDir = new File(newParent); - if (!destinationDir.exists()) { - // The destination does not exist so we should fail. - throw new FileNotFoundException("The source does not exist"); - } - - // Figure out where we should be copying to - File destination = createDestination(newName, source, destinationDir); - - //Log.d(LOG_TAG, "Source: " + source.getAbsolutePath()); - //Log.d(LOG_TAG, "Destin: " + destination.getAbsolutePath()); - - // Check to see if source and destination are the same file - if (source.getAbsolutePath().equals(destination.getAbsolutePath())) { - throw new InvalidModificationException("Can't copy a file onto itself"); - } - - if (source.isDirectory()) { - if (move) { - return moveDirectory(source, destination); - } else { - return copyDirectory(source, destination); - } - } else { - if (move) { - JSONObject newFileEntry = moveFile(source, destination); - - // If we've moved a file given its content URI, we need to clean up. - if (fileName.startsWith("content://")) { - notifyDelete(fileName); - } - - return newFileEntry; - } else { - return copyFile(source, destination); - } - } - } - - /** - * Creates the destination File object based on name passed in - * - * @param newName for the file directory to be called, if null use existing file name - * @param fp represents the source file - * @param destination represents the destination file - * @return a File object that represents the destination - */ - private File createDestination(String newName, File fp, File destination) { - File destFile = null; - - // I know this looks weird but it is to work around a JSON bug. - if ("null".equals(newName) || "".equals(newName)) { - newName = null; - } - - if (newName != null) { - destFile = new File(destination.getAbsolutePath() + File.separator + newName); - } else { - destFile = new File(destination.getAbsolutePath() + File.separator + fp.getName()); - } - return destFile; - } - - /** - * Copy a file - * - * @param srcFile file to be copied - * @param destFile destination to be copied to - * @return a FileEntry object - * @throws IOException - * @throws InvalidModificationException - * @throws JSONException - */ - private JSONObject copyFile(File srcFile, File destFile) throws IOException, InvalidModificationException, JSONException { - // Renaming a file to an existing directory should fail - if (destFile.exists() && destFile.isDirectory()) { - throw new InvalidModificationException("Can't rename a file to a directory"); - } - - copyAction(srcFile, destFile); - - return getEntry(destFile); - } - - /** - * Moved this code into it's own method so moveTo could use it when the move is across file systems - */ - private void copyAction(File srcFile, File destFile) - throws FileNotFoundException, IOException { - FileInputStream istream = new FileInputStream(srcFile); - FileOutputStream ostream = new FileOutputStream(destFile); - FileChannel input = istream.getChannel(); - FileChannel output = ostream.getChannel(); - - try { - input.transferTo(0, input.size(), output); - } finally { - istream.close(); - ostream.close(); - input.close(); - output.close(); - } - } - - /** - * Copy a directory - * - * @param srcDir directory to be copied - * @param destinationDir destination to be copied to - * @return a DirectoryEntry object - * @throws JSONException - * @throws IOException - * @throws NoModificationAllowedException - * @throws InvalidModificationException - */ - private JSONObject copyDirectory(File srcDir, File destinationDir) throws JSONException, IOException, NoModificationAllowedException, InvalidModificationException { - // Renaming a file to an existing directory should fail - if (destinationDir.exists() && destinationDir.isFile()) { - throw new InvalidModificationException("Can't rename a file to a directory"); - } - - // Check to make sure we are not copying the directory into itself - if (isCopyOnItself(srcDir.getAbsolutePath(), destinationDir.getAbsolutePath())) { - throw new InvalidModificationException("Can't copy itself into itself"); - } - - // See if the destination directory exists. If not create it. - if (!destinationDir.exists()) { - if (!destinationDir.mkdir()) { - // If we can't create the directory then fail - throw new NoModificationAllowedException("Couldn't create the destination directory"); - } - } - - for (File file : srcDir.listFiles()) { - if (file.isDirectory()) { - copyDirectory(file, destinationDir); - } else { - File destination = new File(destinationDir.getAbsoluteFile() + File.separator + file.getName()); - copyFile(file, destination); - } - } - - return getEntry(destinationDir); - } - - /** - * Check to see if the user attempted to copy an entry into its parent without changing its name, - * or attempted to copy a directory into a directory that it contains directly or indirectly. - * - * @param srcDir - * @param destinationDir - * @return - */ - private boolean isCopyOnItself(String src, String dest) { - - // This weird test is to determine if we are copying or moving a directory into itself. - // Copy /sdcard/myDir to /sdcard/myDir-backup is okay but - // Copy /sdcard/myDir to /sdcard/myDir/backup should throw an INVALID_MODIFICATION_ERR - if (dest.startsWith(src) && dest.indexOf(File.separator, src.length() - 1) != -1) { - return true; - } - - return false; - } - - /** - * Move a file - * - * @param srcFile file to be copied - * @param destFile destination to be copied to - * @return a FileEntry object - * @throws IOException - * @throws InvalidModificationException - * @throws JSONException - */ - private JSONObject moveFile(File srcFile, File destFile) throws IOException, JSONException, InvalidModificationException { - // Renaming a file to an existing directory should fail - if (destFile.exists() && destFile.isDirectory()) { - throw new InvalidModificationException("Can't rename a file to a directory"); - } - - // Try to rename the file - if (!srcFile.renameTo(destFile)) { - // Trying to rename the file failed. Possibly because we moved across file system on the device. - // Now we have to do things the hard way - // 1) Copy all the old file - // 2) delete the src file - copyAction(srcFile, destFile); - if (destFile.exists()) { - srcFile.delete(); - } else { - throw new IOException("moved failed"); - } - } - - return getEntry(destFile); - } - - /** - * Move a directory - * - * @param srcDir directory to be copied - * @param destinationDir destination to be copied to - * @return a DirectoryEntry object - * @throws JSONException - * @throws IOException - * @throws InvalidModificationException - * @throws NoModificationAllowedException - * @throws FileExistsException - */ - private JSONObject moveDirectory(File srcDir, File destinationDir) throws IOException, JSONException, InvalidModificationException, NoModificationAllowedException, FileExistsException { - // Renaming a file to an existing directory should fail - if (destinationDir.exists() && destinationDir.isFile()) { - throw new InvalidModificationException("Can't rename a file to a directory"); - } - - // Check to make sure we are not copying the directory into itself - if (isCopyOnItself(srcDir.getAbsolutePath(), destinationDir.getAbsolutePath())) { - throw new InvalidModificationException("Can't move itself into itself"); - } - - // If the destination directory already exists and is empty then delete it. This is according to spec. - if (destinationDir.exists()) { - if (destinationDir.list().length > 0) { - throw new InvalidModificationException("directory is not empty"); - } - } - - // Try to rename the directory - if (!srcDir.renameTo(destinationDir)) { - // Trying to rename the directory failed. Possibly because we moved across file system on the device. - // Now we have to do things the hard way - // 1) Copy all the old files - // 2) delete the src directory - copyDirectory(srcDir, destinationDir); - if (destinationDir.exists()) { - removeDirRecursively(srcDir); - } else { - throw new IOException("moved failed"); - } - } - - return getEntry(destinationDir); - } - - /** - * Deletes a directory and all of its contents, if any. In the event of an error - * [e.g. trying to delete a directory that contains a file that cannot be removed], - * some of the contents of the directory may be deleted. - * It is an error to attempt to delete the root directory of a filesystem. - * - * @param filePath the directory to be removed - * @return a boolean representing success of failure - * @throws FileExistsException - */ - private boolean removeRecursively(String filePath) throws FileExistsException { - File fp = createFileObject(filePath); - - // You can't delete the root directory. - if (atRootDirectory(filePath)) { - return false; - } - - return removeDirRecursively(fp); - } - - /** - * Loops through a directory deleting all the files. - * - * @param directory to be removed - * @return a boolean representing success of failure - * @throws FileExistsException - */ - private boolean removeDirRecursively(File directory) throws FileExistsException { - if (directory.isDirectory()) { - for (File file : directory.listFiles()) { - removeDirRecursively(file); - } - } - - if (!directory.delete()) { - throw new FileExistsException("could not delete: " + directory.getName()); - } else { - return true; - } - } - - /** - * Deletes a file or directory. It is an error to attempt to delete a directory that is not empty. - * It is an error to attempt to delete the root directory of a filesystem. - * - * @param filePath file or directory to be removed - * @return a boolean representing success of failure - * @throws NoModificationAllowedException - * @throws InvalidModificationException - */ - private boolean remove(String filePath) throws NoModificationAllowedException, InvalidModificationException { - File fp = createFileObject(filePath); - - // You can't delete the root directory. - if (atRootDirectory(filePath)) { - throw new NoModificationAllowedException("You can't delete the root directory"); - } - - // You can't delete a directory that is not empty - if (fp.isDirectory() && fp.list().length > 0) { - throw new InvalidModificationException("You can't delete a directory that is not empty."); - } - - return fp.delete(); - } - - /** - * Creates or looks up a file. - * - * @param dirPath base directory - * @param fileName file/directory to lookup or create - * @param options specify whether to create or not - * @param directory if true look up directory, if false look up file - * @return a Entry object - * @throws FileExistsException - * @throws IOException - * @throws TypeMismatchException - * @throws EncodingException - * @throws JSONException - */ - private JSONObject getFile(String dirPath, String fileName, JSONObject options, boolean directory) throws FileExistsException, IOException, TypeMismatchException, EncodingException, JSONException { - boolean create = false; - boolean exclusive = false; - if (options != null) { - create = options.optBoolean("create"); - if (create) { - exclusive = options.optBoolean("exclusive"); - } - } - - // Check for a ":" character in the file to line up with BB and iOS - if (fileName.contains(":")) { - throw new EncodingException("This file has a : in it's name"); - } - - File fp = createFileObject(dirPath, fileName); - - if (create) { - if (exclusive && fp.exists()) { - throw new FileExistsException("create/exclusive fails"); - } - if (directory) { - fp.mkdir(); - } else { - fp.createNewFile(); - } - if (!fp.exists()) { - throw new FileExistsException("create fails"); - } - } - else { - if (!fp.exists()) { - throw new FileNotFoundException("path does not exist"); - } - if (directory) { - if (fp.isFile()) { - throw new TypeMismatchException("path doesn't exist or is file"); - } - } else { - if (fp.isDirectory()) { - throw new TypeMismatchException("path doesn't exist or is directory"); - } - } - } - - // Return the directory - return getEntry(fp); - } - - /** - * If the path starts with a '/' just return that file object. If not construct the file - * object from the path passed in and the file name. - * - * @param dirPath root directory - * @param fileName new file name - * @return - */ - private File createFileObject(String dirPath, String fileName) { - File fp = null; - if (fileName.startsWith("/")) { - fp = new File(fileName); - } else { - dirPath = FileHelper.getRealPath(dirPath, cordova); - fp = new File(dirPath + File.separator + fileName); - } - return fp; - } - - /** - * Look up the parent DirectoryEntry containing this Entry. - * If this Entry is the root of its filesystem, its parent is itself. - * - * @param filePath - * @return - * @throws JSONException - */ - private JSONObject getParent(String filePath) throws JSONException { - filePath = FileHelper.getRealPath(filePath, cordova); - - if (atRootDirectory(filePath)) { - return getEntry(filePath); - } - return getEntry(new File(filePath).getParent()); - } - - /** - * Checks to see if we are at the root directory. Useful since we are - * not allow to delete this directory. - * - * @param filePath to directory - * @return true if we are at the root, false otherwise. - */ - private boolean atRootDirectory(String filePath) { - filePath = FileHelper.getRealPath(filePath, cordova); - - if (filePath.equals(Environment.getExternalStorageDirectory().getAbsolutePath() + "/Android/data/" + cordova.getActivity().getPackageName() + "/cache") || - filePath.equals(Environment.getExternalStorageDirectory().getAbsolutePath()) || - filePath.equals("/data/data/" + cordova.getActivity().getPackageName())) { - return true; - } - return false; - } - - /** - * Create a File object from the passed in path - * - * @param filePath - * @return - */ - private File createFileObject(String filePath) { - filePath = FileHelper.getRealPath(filePath, cordova); - - File file = new File(filePath); - return file; - } - - /** - * Look up metadata about this entry. - * - * @param filePath to entry - * @return a long - * @throws FileNotFoundException - */ - private long getMetadata(String filePath) throws FileNotFoundException { - File file = createFileObject(filePath); - - if (!file.exists()) { - throw new FileNotFoundException("Failed to find file in getMetadata"); - } - - return file.lastModified(); - } - - /** - * Returns a File that represents the current state of the file that this FileEntry represents. - * - * @param filePath to entry - * @return returns a JSONObject represent a W3C File object - * @throws FileNotFoundException - * @throws JSONException - */ - private JSONObject getFileMetadata(String filePath) throws FileNotFoundException, JSONException { - File file = createFileObject(filePath); - - if (!file.exists()) { - throw new FileNotFoundException("File: " + filePath + " does not exist."); - } - - JSONObject metadata = new JSONObject(); - metadata.put("size", file.length()); - metadata.put("type", FileHelper.getMimeType(filePath, cordova)); - metadata.put("name", file.getName()); - metadata.put("fullPath", filePath); - metadata.put("lastModifiedDate", file.lastModified()); - - return metadata; - } - - /** - * Requests a filesystem in which to store application data. - * - * @param type of file system requested - * @return a JSONObject representing the file system - * @throws IOException - * @throws JSONException - */ - private JSONObject requestFileSystem(int type) throws IOException, JSONException { - JSONObject fs = new JSONObject(); - if (type == TEMPORARY) { - File fp; - fs.put("name", "temporary"); - if (Environment.getExternalStorageState().equals(Environment.MEDIA_MOUNTED)) { - fp = new File(Environment.getExternalStorageDirectory().getAbsolutePath() + - "/Android/data/" + cordova.getActivity().getPackageName() + "/cache/"); - // Create the cache dir if it doesn't exist. - fp.mkdirs(); - fs.put("root", getEntry(Environment.getExternalStorageDirectory().getAbsolutePath() + - "/Android/data/" + cordova.getActivity().getPackageName() + "/cache/")); - } else { - fp = new File("/data/data/" + cordova.getActivity().getPackageName() + "/cache/"); - // Create the cache dir if it doesn't exist. - fp.mkdirs(); - fs.put("root", getEntry("/data/data/" + cordova.getActivity().getPackageName() + "/cache/")); - } - } - else if (type == PERSISTENT) { - fs.put("name", "persistent"); - if (Environment.getExternalStorageState().equals(Environment.MEDIA_MOUNTED)) { - fs.put("root", getEntry(Environment.getExternalStorageDirectory())); - } else { - fs.put("root", getEntry("/data/data/" + cordova.getActivity().getPackageName())); - } - } - else { - throw new IOException("No filesystem of type requested"); - } - - return fs; - } - - /** - * Returns a JSON object representing the given File. - * - * @param file the File to convert - * @return a JSON representation of the given File - * @throws JSONException - */ - public static JSONObject getEntry(File file) throws JSONException { - JSONObject entry = new JSONObject(); - - entry.put("isFile", file.isFile()); - entry.put("isDirectory", file.isDirectory()); - entry.put("name", file.getName()); - entry.put("fullPath", "file://" + file.getAbsolutePath()); - // The file system can't be specified, as it would lead to an infinite loop. - // entry.put("filesystem", null); - - return entry; - } - - /** - * Returns a JSON Object representing a directory on the device's file system - * - * @param path to the directory - * @return - * @throws JSONException - */ - private JSONObject getEntry(String path) throws JSONException { - return getEntry(new File(path)); - } - - - //-------------------------------------------------------------------------- - // LOCAL METHODS - //-------------------------------------------------------------------------- - - /** - * Read the contents of a file. - * This is done in a background thread; the result is sent to the callback. - * - * @param filename The name of the file. - * @param start Start position in the file. - * @param end End position to stop at (exclusive). - * @param callbackContext The context through which to send the result. - * @param encoding The encoding to return contents as. Typical value is UTF-8. (see http://www.iana.org/assignments/character-sets) - * @param resultType The desired type of data to send to the callback. - * @return Contents of file. - */ - public void readFileAs(final String filename, final int start, final int end, final CallbackContext callbackContext, final String encoding, final int resultType) { - this.cordova.getThreadPool().execute(new Runnable() { - public void run() { - try { - byte[] bytes = readAsBinaryHelper(filename, start, end); - - PluginResult result; - switch (resultType) { - case PluginResult.MESSAGE_TYPE_STRING: - result = new PluginResult(PluginResult.Status.OK, new String(bytes, encoding)); - break; - case PluginResult.MESSAGE_TYPE_ARRAYBUFFER: - result = new PluginResult(PluginResult.Status.OK, bytes); - break; - case PluginResult.MESSAGE_TYPE_BINARYSTRING: - result = new PluginResult(PluginResult.Status.OK, bytes, true); - break; - default: // Base64. - String contentType = FileHelper.getMimeType(filename, cordova); - byte[] base64 = Base64.encode(bytes, Base64.DEFAULT); - String s = "data:" + contentType + ";base64," + new String(base64, "US-ASCII"); - result = new PluginResult(PluginResult.Status.OK, s); - } - - callbackContext.sendPluginResult(result); - } catch (FileNotFoundException e) { - callbackContext.sendPluginResult(new PluginResult(PluginResult.Status.IO_EXCEPTION, NOT_FOUND_ERR)); - } catch (IOException e) { - Log.d(LOG_TAG, e.getLocalizedMessage()); - callbackContext.sendPluginResult(new PluginResult(PluginResult.Status.IO_EXCEPTION, NOT_READABLE_ERR)); - } - } - }); - } - - /** - * Read the contents of a file as binary. - * This is done synchronously; the result is returned. - * - * @param filename The name of the file. - * @param start Start position in the file. - * @param end End position to stop at (exclusive). - * @return Contents of the file as a byte[]. - * @throws IOException - */ - private byte[] readAsBinaryHelper(String filename, int start, int end) throws IOException { - int numBytesToRead = end - start; - byte[] bytes = new byte[numBytesToRead]; - InputStream inputStream = FileHelper.getInputStreamFromUriString(filename, cordova); - int numBytesRead = 0; - - if (start > 0) { - inputStream.skip(start); - } - - while (numBytesToRead > 0 && (numBytesRead = inputStream.read(bytes, numBytesRead, numBytesToRead)) >= 0) { - numBytesToRead -= numBytesRead; - } - - return bytes; - } - - /** - * Write contents of file. - * - * @param filename The name of the file. - * @param data The contents of the file. - * @param offset The position to begin writing the file. - * @param isBinary True if the file contents are base64-encoded binary data - * @throws FileNotFoundException, IOException - * @throws NoModificationAllowedException - */ - /**/ - public long write(String filename, String data, int offset, boolean isBinary) throws FileNotFoundException, IOException, NoModificationAllowedException { - if (filename.startsWith("content://")) { - throw new NoModificationAllowedException("Couldn't write to file given its content URI"); - } - - filename = FileHelper.getRealPath(filename, cordova); - - boolean append = false; - if (offset > 0) { - this.truncateFile(filename, offset); - append = true; - } - - byte[] rawData; - if (isBinary) { - rawData = Base64.decode(data, Base64.DEFAULT); - } else { - rawData = data.getBytes(); - } - ByteArrayInputStream in = new ByteArrayInputStream(rawData); - FileOutputStream out = new FileOutputStream(filename, append); - byte buff[] = new byte[rawData.length]; - in.read(buff, 0, buff.length); - out.write(buff, 0, rawData.length); - out.flush(); - out.close(); - - return rawData.length; - } - - /** - * Truncate the file to size - * - * @param filename - * @param size - * @throws FileNotFoundException, IOException - * @throws NoModificationAllowedException - */ - private long truncateFile(String filename, long size) throws FileNotFoundException, IOException, NoModificationAllowedException { - if (filename.startsWith("content://")) { - throw new NoModificationAllowedException("Couldn't truncate file given its content URI"); - } - - filename = FileHelper.getRealPath(filename, cordova); - - RandomAccessFile raf = new RandomAccessFile(filename, "rw"); - try { - if (raf.length() >= size) { - FileChannel channel = raf.getChannel(); - channel.truncate(size); - return size; - } - - return raf.length(); - } finally { - raf.close(); - } - } -} diff --git a/plugins/org.apache.cordova.core.file/src/android/InvalidModificationException.java b/plugins/org.apache.cordova.core.file/src/android/InvalidModificationException.java deleted file mode 100644 index 51886ed..0000000 --- a/plugins/org.apache.cordova.core.file/src/android/InvalidModificationException.java +++ /dev/null @@ -1,29 +0,0 @@ -/* - Licensed to the Apache Software Foundation (ASF) under one - or more contributor license agreements. See the NOTICE file - distributed with this work for additional information - regarding copyright ownership. The ASF licenses this file - to you under the Apache License, Version 2.0 (the - "License"); you may not use this file except in compliance - with the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, - software distributed under the License is distributed on an - "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - KIND, either express or implied. See the License for the - specific language governing permissions and limitations - under the License. -*/ - - -package org.apache.cordova.core; - -public class InvalidModificationException extends Exception { - - public InvalidModificationException(String message) { - super(message); - } - -} diff --git a/plugins/org.apache.cordova.core.file/src/android/NoModificationAllowedException.java b/plugins/org.apache.cordova.core.file/src/android/NoModificationAllowedException.java deleted file mode 100644 index 771d1d5..0000000 --- a/plugins/org.apache.cordova.core.file/src/android/NoModificationAllowedException.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - Licensed to the Apache Software Foundation (ASF) under one - or more contributor license agreements. See the NOTICE file - distributed with this work for additional information - regarding copyright ownership. The ASF licenses this file - to you under the Apache License, Version 2.0 (the - "License"); you may not use this file except in compliance - with the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, - software distributed under the License is distributed on an - "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - KIND, either express or implied. See the License for the - specific language governing permissions and limitations - under the License. -*/ - -package org.apache.cordova.core; - -public class NoModificationAllowedException extends Exception { - - public NoModificationAllowedException(String message) { - super(message); - } - -} diff --git a/plugins/org.apache.cordova.core.file/src/android/TypeMismatchException.java b/plugins/org.apache.cordova.core.file/src/android/TypeMismatchException.java deleted file mode 100644 index 19f7b5d..0000000 --- a/plugins/org.apache.cordova.core.file/src/android/TypeMismatchException.java +++ /dev/null @@ -1,29 +0,0 @@ -/* - Licensed to the Apache Software Foundation (ASF) under one - or more contributor license agreements. See the NOTICE file - distributed with this work for additional information - regarding copyright ownership. The ASF licenses this file - to you under the Apache License, Version 2.0 (the - "License"); you may not use this file except in compliance - with the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, - software distributed under the License is distributed on an - "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - KIND, either express or implied. See the License for the - specific language governing permissions and limitations - under the License. -*/ - - -package org.apache.cordova.core; - -public class TypeMismatchException extends Exception { - - public TypeMismatchException(String message) { - super(message); - } - -} diff --git a/plugins/org.apache.cordova.core.file/src/ios/CDVFile.h b/plugins/org.apache.cordova.core.file/src/ios/CDVFile.h deleted file mode 100644 index 54d25f0..0000000 --- a/plugins/org.apache.cordova.core.file/src/ios/CDVFile.h +++ /dev/null @@ -1,107 +0,0 @@ -/* - Licensed to the Apache Software Foundation (ASF) under one - or more contributor license agreements. See the NOTICE file - distributed with this work for additional information - regarding copyright ownership. The ASF licenses this file - to you under the Apache License, Version 2.0 (the - "License"); you may not use this file except in compliance - with the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, - software distributed under the License is distributed on an - "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - KIND, either express or implied. See the License for the - specific language governing permissions and limitations - under the License. - */ - -#import -#import - -enum CDVFileError { - NO_ERROR = 0, - NOT_FOUND_ERR = 1, - SECURITY_ERR = 2, - ABORT_ERR = 3, - NOT_READABLE_ERR = 4, - ENCODING_ERR = 5, - NO_MODIFICATION_ALLOWED_ERR = 6, - INVALID_STATE_ERR = 7, - SYNTAX_ERR = 8, - INVALID_MODIFICATION_ERR = 9, - QUOTA_EXCEEDED_ERR = 10, - TYPE_MISMATCH_ERR = 11, - PATH_EXISTS_ERR = 12 -}; -typedef int CDVFileError; - -enum CDVFileSystemType { - TEMPORARY = 0, - PERSISTENT = 1 -}; -typedef int CDVFileSystemType; - -extern NSString* const kCDVAssetsLibraryPrefix; - -@interface CDVFile : CDVPlugin { - NSString* appDocsPath; - NSString* appLibraryPath; - NSString* appTempPath; - NSString* persistentPath; - NSString* temporaryPath; - - BOOL userHasAllowed; -} -- (NSNumber*)checkFreeDiskSpace:(NSString*)appPath; -- (NSString*)getAppPath:(NSString*)pathFragment; -// -(NSString*) getFullPath: (NSString*)pathFragment; -- (void)requestFileSystem:(CDVInvokedUrlCommand*)command; -- (NSDictionary*)getDirectoryEntry:(NSString*)fullPath isDirectory:(BOOL)isDir; -- (void)resolveLocalFileSystemURI:(CDVInvokedUrlCommand*)command; -- (void)getDirectory:(CDVInvokedUrlCommand*)command; -- (void)getFile:(CDVInvokedUrlCommand*)command; -- (void)getParent:(CDVInvokedUrlCommand*)command; -- (void)getMetadata:(CDVInvokedUrlCommand*)command; -- (void)removeRecursively:(CDVInvokedUrlCommand*)command; -- (void)remove:(CDVInvokedUrlCommand*)command; -- (CDVPluginResult*)doRemove:(NSString*)fullPath; -- (void)copyTo:(CDVInvokedUrlCommand*)command; -- (void)moveTo:(CDVInvokedUrlCommand*)command; -- (BOOL)canCopyMoveSrc:(NSString*)src ToDestination:(NSString*)dest; -- (void)doCopyMove:(CDVInvokedUrlCommand*)command isCopy:(BOOL)bCopy; -// - (void) toURI:(CDVInvokedUrlCommand*)command; -- (void)getFileMetadata:(CDVInvokedUrlCommand*)command; -- (void)readEntries:(CDVInvokedUrlCommand*)command; - -- (void)readAsText:(CDVInvokedUrlCommand*)command; -- (void)readAsDataURL:(CDVInvokedUrlCommand*)command; -- (void)readAsArrayBuffer:(CDVInvokedUrlCommand*)command; -- (NSString*)getMimeTypeFromPath:(NSString*)fullPath; -- (void)write:(CDVInvokedUrlCommand*)command; -- (void)testFileExists:(CDVInvokedUrlCommand*)command; -- (void)testDirectoryExists:(CDVInvokedUrlCommand*)command; -// - (void) createDirectory:(CDVInvokedUrlCommand*)command; -// - (void) deleteDirectory:(CDVInvokedUrlCommand*)command; -// - (void) deleteFile:(CDVInvokedUrlCommand*)command; -- (void)getFreeDiskSpace:(CDVInvokedUrlCommand*)command; -- (void)truncate:(CDVInvokedUrlCommand*)command; - -// - (BOOL) fileExists:(NSString*)fileName; -// - (BOOL) directoryExists:(NSString*)dirName; -- (void)writeToFile:(NSString*)fileName withData:(NSData*)data append:(BOOL)shouldAppend callback:(NSString*)callbackId; -- (void)writeToFile:(NSString*)fileName withString:(NSString*)data encoding:(NSStringEncoding)encoding append:(BOOL)shouldAppend callback:(NSString*)callbackId; -- (unsigned long long)truncateFile:(NSString*)filePath atPosition:(unsigned long long)pos; - -@property (nonatomic, strong) NSString* appDocsPath; -@property (nonatomic, strong) NSString* appLibraryPath; -@property (nonatomic, strong) NSString* appTempPath; -@property (nonatomic, strong) NSString* persistentPath; -@property (nonatomic, strong) NSString* temporaryPath; -@property BOOL userHasAllowed; - -@end - -#define kW3FileTemporary @"temporary" -#define kW3FilePersistent @"persistent" diff --git a/plugins/org.apache.cordova.core.file/src/ios/CDVFile.m b/plugins/org.apache.cordova.core.file/src/ios/CDVFile.m deleted file mode 100644 index c245ee3..0000000 --- a/plugins/org.apache.cordova.core.file/src/ios/CDVFile.m +++ /dev/null @@ -1,1422 +0,0 @@ -/* - Licensed to the Apache Software Foundation (ASF) under one - or more contributor license agreements. See the NOTICE file - distributed with this work for additional information - regarding copyright ownership. The ASF licenses this file - to you under the Apache License, Version 2.0 (the - "License"); you may not use this file except in compliance - with the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, - software distributed under the License is distributed on an - "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - KIND, either express or implied. See the License for the - specific language governing permissions and limitations - under the License. - */ - -#import "CDVFile.h" -#import -#import -#import -#import -#import -#import - -extern NSString * const NSURLIsExcludedFromBackupKey __attribute__((weak_import)); - -#ifndef __IPHONE_5_1 - NSString* const NSURLIsExcludedFromBackupKey = @"NSURLIsExcludedFromBackupKey"; -#endif - -NSString* const kCDVAssetsLibraryPrefix = @"assets-library://"; - -@implementation CDVFile - -@synthesize appDocsPath, appLibraryPath, appTempPath, persistentPath, temporaryPath, userHasAllowed; - -- (id)initWithWebView:(UIWebView*)theWebView -{ - self = (CDVFile*)[super initWithWebView:theWebView]; - if (self) { - // get the documents directory path - NSArray* paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES); - self.appDocsPath = [paths objectAtIndex:0]; - - paths = NSSearchPathForDirectoriesInDomains(NSLibraryDirectory, NSUserDomainMask, YES); - self.appLibraryPath = [paths objectAtIndex:0]; - - self.appTempPath = [NSTemporaryDirectory()stringByStandardizingPath]; // remove trailing slash from NSTemporaryDirectory() - - self.persistentPath = [NSString stringWithFormat:@"/%@", [self.appDocsPath lastPathComponent]]; - self.temporaryPath = [NSString stringWithFormat:@"/%@", [self.appTempPath lastPathComponent]]; - // NSLog(@"docs: %@ - temp: %@", self.appDocsPath, self.appTempPath); - } - - return self; -} - -- (NSNumber*)checkFreeDiskSpace:(NSString*)appPath -{ - NSFileManager* fMgr = [[NSFileManager alloc] init]; - - NSError* __autoreleasing pError = nil; - - NSDictionary* pDict = [fMgr attributesOfFileSystemForPath:appPath error:&pError]; - NSNumber* pNumAvail = (NSNumber*)[pDict objectForKey:NSFileSystemFreeSize]; - - return pNumAvail; -} - -// figure out if the pathFragment represents a persistent of temporary directory and return the full application path. -// returns nil if path is not persistent or temporary -- (NSString*)getAppPath:(NSString*)pathFragment -{ - NSString* appPath = nil; - NSRange rangeP = [pathFragment rangeOfString:self.persistentPath]; - NSRange rangeT = [pathFragment rangeOfString:self.temporaryPath]; - - if ((rangeP.location != NSNotFound) && (rangeT.location != NSNotFound)) { - // we found both in the path, return whichever one is first - if (rangeP.length < rangeT.length) { - appPath = self.appDocsPath; - } else { - appPath = self.appTempPath; - } - } else if (rangeP.location != NSNotFound) { - appPath = self.appDocsPath; - } else if (rangeT.location != NSNotFound) { - appPath = self.appTempPath; - } - return appPath; -} - -/* get the full path to this resource - * IN - * NSString* pathFragment - full Path from File or Entry object (includes system path info) - * OUT - * NSString* fullPath - full iOS path to this resource, nil if not found - */ - -/* Was here in order to NOT have to return full path, but W3C synchronous DirectoryEntry.toURI() killed that idea since I can't call into iOS to - * resolve full URI. Leaving this code here in case W3C spec changes. --(NSString*) getFullPath: (NSString*)pathFragment -{ - return pathFragment; - NSString* fullPath = nil; - NSString *appPath = [ self getAppPath: pathFragment]; - if (appPath){ - - // remove last component from appPath - NSRange range = [appPath rangeOfString:@"/" options: NSBackwardsSearch]; - NSString* newPath = [appPath substringToIndex:range.location]; - // add pathFragment to get test Path - fullPath = [newPath stringByAppendingPathComponent:pathFragment]; - } - return fullPath; -} */ - -/* Request the File System info - * - * IN: - * arguments[0] - type (number as string) - * TEMPORARY = 0, PERSISTENT = 1; - * arguments[1] - size - * - * OUT: - * Dictionary representing FileSystem object - * name - the human readable directory name - * root = DirectoryEntry object - * bool isDirectory - * bool isFile - * string name - * string fullPath - * fileSystem = FileSystem object - !! ignored because creates circular reference !! - */ - -- (void)requestFileSystem:(CDVInvokedUrlCommand*)command -{ - NSArray* arguments = command.arguments; - - // arguments - NSString* strType = [arguments objectAtIndex:0]; - unsigned long long size = [[arguments objectAtIndex:1] longLongValue]; - - int type = [strType intValue]; - CDVPluginResult* result = nil; - - if (type > 1) { - result = [CDVPluginResult resultWithStatus:CDVCommandStatus_ERROR messageAsInt:NOT_FOUND_ERR]; - NSLog(@"iOS only supports TEMPORARY and PERSISTENT file systems"); - } else { - // NSString* fullPath = [NSString stringWithFormat:@"/%@", (type == 0 ? [self.appTempPath lastPathComponent] : [self.appDocsPath lastPathComponent])]; - NSString* fullPath = (type == 0 ? self.appTempPath : self.appDocsPath); - // check for avail space for size request - NSNumber* pNumAvail = [self checkFreeDiskSpace:fullPath]; - // NSLog(@"Free space: %@", [NSString stringWithFormat:@"%qu", [ pNumAvail unsignedLongLongValue ]]); - if (pNumAvail && ([pNumAvail unsignedLongLongValue] < size)) { - result = [CDVPluginResult resultWithStatus:CDVCommandStatus_IO_EXCEPTION messageAsInt:QUOTA_EXCEEDED_ERR]; - } else { - NSMutableDictionary* fileSystem = [NSMutableDictionary dictionaryWithCapacity:2]; - [fileSystem setObject:(type == TEMPORARY ? kW3FileTemporary : kW3FilePersistent) forKey:@"name"]; - NSDictionary* dirEntry = [self getDirectoryEntry:fullPath isDirectory:YES]; - [fileSystem setObject:dirEntry forKey:@"root"]; - result = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsDictionary:fileSystem]; - } - } - [self.commandDelegate sendPluginResult:result callbackId:command.callbackId]; -} - -/* Creates a dictionary representing an Entry Object - * - * IN: - * NSString* fullPath of the entry - * FileSystem type - * BOOL isDirectory - YES if this is a directory, NO if is a file - * OUT: - * NSDictionary* - Entry object - * bool as NSNumber isDirectory - * bool as NSNumber isFile - * NSString* name - last part of path - * NSString* fullPath - * fileSystem = FileSystem object - !! ignored because creates circular reference FileSystem contains DirectoryEntry which contains FileSystem.....!! - */ -- (NSDictionary*)getDirectoryEntry:(NSString*)fullPath isDirectory:(BOOL)isDir -{ - NSMutableDictionary* dirEntry = [NSMutableDictionary dictionaryWithCapacity:4]; - NSString* lastPart = [fullPath lastPathComponent]; - - [dirEntry setObject:[NSNumber numberWithBool:!isDir] forKey:@"isFile"]; - [dirEntry setObject:[NSNumber numberWithBool:isDir] forKey:@"isDirectory"]; - // NSURL* fileUrl = [NSURL fileURLWithPath:fullPath]; - // [dirEntry setObject: [fileUrl absoluteString] forKey: @"fullPath"]; - [dirEntry setObject:fullPath forKey:@"fullPath"]; - [dirEntry setObject:lastPart forKey:@"name"]; - - return dirEntry; -} - -/* - * Given a URI determine the File System information associated with it and return an appropriate W3C entry object - * IN - * NSString* fileURI - currently requires full file URI - * OUT - * Entry object - * bool isDirectory - * bool isFile - * string name - * string fullPath - * fileSystem = FileSystem object - !! ignored because creates circular reference FileSystem contains DirectoryEntry which contains FileSystem.....!! - */ -- (void)resolveLocalFileSystemURI:(CDVInvokedUrlCommand*)command -{ - // arguments - NSString* inputUri = [command.arguments objectAtIndex:0]; - - // don't know if string is encoded or not so unescape - NSString* cleanUri = [inputUri stringByReplacingPercentEscapesUsingEncoding:NSUTF8StringEncoding]; - // now escape in order to create URL - NSString* strUri = [cleanUri stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]; - NSURL* testUri = [NSURL URLWithString:strUri]; - CDVPluginResult* result = nil; - - if (!testUri) { - result = [CDVPluginResult resultWithStatus:CDVCommandStatus_ERROR messageAsInt:ENCODING_ERR]; - } else if ([testUri isFileURL]) { - NSFileManager* fileMgr = [[NSFileManager alloc] init]; - NSString* path = [testUri path]; - // NSLog(@"url path: %@", path); - BOOL isDir = NO; - // see if exists and is file or dir - BOOL bExists = [fileMgr fileExistsAtPath:path isDirectory:&isDir]; - if (bExists) { - // see if it contains docs path - NSRange range = [path rangeOfString:self.appDocsPath]; - NSString* foundFullPath = nil; - // there's probably an api or easier way to figure out the path type but I can't find it! - if ((range.location != NSNotFound) && (range.length == [self.appDocsPath length])) { - foundFullPath = self.appDocsPath; - } else { - // see if it contains the temp path - range = [path rangeOfString:self.appTempPath]; - if ((range.location != NSNotFound) && (range.length == [self.appTempPath length])) { - foundFullPath = self.appTempPath; - } - } - if (foundFullPath == nil) { - // error SECURITY_ERR - not one of the two paths types supported - result = [CDVPluginResult resultWithStatus:CDVCommandStatus_ERROR messageAsInt:SECURITY_ERR]; - } else { - NSDictionary* fileSystem = [self getDirectoryEntry:path isDirectory:isDir]; - result = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsDictionary:fileSystem]; - } - } else { - // return NOT_FOUND_ERR - result = [CDVPluginResult resultWithStatus:CDVCommandStatus_IO_EXCEPTION messageAsInt:NOT_FOUND_ERR]; - } - } else if ([strUri hasPrefix:@"assets-library://"]) { - NSDictionary* fileSystem = [self getDirectoryEntry:strUri isDirectory:NO]; - result = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsDictionary:fileSystem]; - } else { - result = [CDVPluginResult resultWithStatus:CDVCommandStatus_ERROR messageAsInt:ENCODING_ERR]; - } - - if (result != nil) { - [self.commandDelegate sendPluginResult:result callbackId:command.callbackId]; - } -} - -/* Part of DirectoryEntry interface, creates or returns the specified directory - * IN: - * NSString* fullPath - full path for this directory - * NSString* path - directory to be created/returned; may be full path or relative path - * NSDictionary* - Flags object - * boolean as NSNumber create - - * if create is true and directory does not exist, create dir and return directory entry - * if create is true and exclusive is true and directory does exist, return error - * if create is false and directory does not exist, return error - * if create is false and the path represents a file, return error - * boolean as NSNumber exclusive - used in conjunction with create - * if exclusive is true and create is true - specifies failure if directory already exists - * - * - */ -- (void)getDirectory:(CDVInvokedUrlCommand*)command -{ - NSMutableArray* arguments = [NSMutableArray arrayWithArray:command.arguments]; - NSMutableDictionary* options = nil; - - if ([arguments count] >= 3) { - options = [arguments objectAtIndex:2 withDefault:nil]; - } - // add getDir to options and call getFile() - if (options != nil) { - options = [NSMutableDictionary dictionaryWithDictionary:options]; - } else { - options = [NSMutableDictionary dictionaryWithCapacity:1]; - } - [options setObject:[NSNumber numberWithInt:1] forKey:@"getDir"]; - if ([arguments count] >= 3) { - [arguments replaceObjectAtIndex:2 withObject:options]; - } else { - [arguments addObject:options]; - } - CDVInvokedUrlCommand* subCommand = - [[CDVInvokedUrlCommand alloc] initWithArguments:arguments - callbackId:command.callbackId - className:command.className - methodName:command.methodName]; - - [self getFile:subCommand]; -} - -/* Part of DirectoryEntry interface, creates or returns the specified file - * IN: - * NSString* fullPath - full path for this file - * NSString* path - file to be created/returned; may be full path or relative path - * NSDictionary* - Flags object - * boolean as NSNumber create - - * if create is true and file does not exist, create file and return File entry - * if create is true and exclusive is true and file does exist, return error - * if create is false and file does not exist, return error - * if create is false and the path represents a directory, return error - * boolean as NSNumber exclusive - used in conjunction with create - * if exclusive is true and create is true - specifies failure if file already exists - * - * - */ -- (void)getFile:(CDVInvokedUrlCommand*)command -{ - // arguments are URL encoded - NSString* fullPath = [command.arguments objectAtIndex:0]; - NSString* requestedPath = [command.arguments objectAtIndex:1]; - NSDictionary* options = [command.arguments objectAtIndex:2 withDefault:nil]; - - // return unsupported result for assets-library URLs - if ([fullPath hasPrefix:kCDVAssetsLibraryPrefix]) { - CDVPluginResult* result = [CDVPluginResult resultWithStatus:CDVCommandStatus_MALFORMED_URL_EXCEPTION messageAsString:@"getFile not supported for assets-library URLs."]; - [self.commandDelegate sendPluginResult:result callbackId:command.callbackId]; - return; - } - - CDVPluginResult* result = nil; - BOOL bDirRequest = NO; - BOOL create = NO; - BOOL exclusive = NO; - int errorCode = 0; // !!! risky - no error code currently defined for 0 - - if ([options valueForKeyIsNumber:@"create"]) { - create = [(NSNumber*)[options valueForKey:@"create"] boolValue]; - } - if ([options valueForKeyIsNumber:@"exclusive"]) { - exclusive = [(NSNumber*)[options valueForKey:@"exclusive"] boolValue]; - } - - if ([options valueForKeyIsNumber:@"getDir"]) { - // this will not exist for calls directly to getFile but will have been set by getDirectory before calling this method - bDirRequest = [(NSNumber*)[options valueForKey:@"getDir"] boolValue]; - } - // see if the requested path has invalid characters - should we be checking for more than just ":"? - if ([requestedPath rangeOfString:@":"].location != NSNotFound) { - errorCode = ENCODING_ERR; - } else { - // was full or relative path provided? - NSRange range = [requestedPath rangeOfString:fullPath]; - BOOL bIsFullPath = range.location != NSNotFound; - - NSString* reqFullPath = nil; - - if (!bIsFullPath) { - reqFullPath = [fullPath stringByAppendingPathComponent:requestedPath]; - } else { - reqFullPath = requestedPath; - } - - // NSLog(@"reqFullPath = %@", reqFullPath); - NSFileManager* fileMgr = [[NSFileManager alloc] init]; - BOOL bIsDir; - BOOL bExists = [fileMgr fileExistsAtPath:reqFullPath isDirectory:&bIsDir]; - if (bExists && (create == NO) && (bIsDir == !bDirRequest)) { - // path exists and is of requested type - return TYPE_MISMATCH_ERR - errorCode = TYPE_MISMATCH_ERR; - } else if (!bExists && (create == NO)) { - // path does not exist and create is false - return NOT_FOUND_ERR - errorCode = NOT_FOUND_ERR; - } else if (bExists && (create == YES) && (exclusive == YES)) { - // file/dir already exists and exclusive and create are both true - return PATH_EXISTS_ERR - errorCode = PATH_EXISTS_ERR; - } else { - // if bExists and create == YES - just return data - // if bExists and create == NO - just return data - // if !bExists and create == YES - create and return data - BOOL bSuccess = YES; - NSError __autoreleasing* pError = nil; - if (!bExists && (create == YES)) { - if (bDirRequest) { - // create the dir - bSuccess = [fileMgr createDirectoryAtPath:reqFullPath withIntermediateDirectories:NO attributes:nil error:&pError]; - } else { - // create the empty file - bSuccess = [fileMgr createFileAtPath:reqFullPath contents:nil attributes:nil]; - } - } - if (!bSuccess) { - errorCode = ABORT_ERR; - if (pError) { - NSLog(@"error creating directory: %@", [pError localizedDescription]); - } - } else { - // NSLog(@"newly created file/dir (%@) exists: %d", reqFullPath, [fileMgr fileExistsAtPath:reqFullPath]); - // file existed or was created - result = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsDictionary:[self getDirectoryEntry:reqFullPath isDirectory:bDirRequest]]; - } - } // are all possible conditions met? - } - - if (errorCode > 0) { - // create error callback - result = [CDVPluginResult resultWithStatus:CDVCommandStatus_IO_EXCEPTION messageAsInt:errorCode]; - } - - [self.commandDelegate sendPluginResult:result callbackId:command.callbackId]; -} - -/* - * Look up the parent Entry containing this Entry. - * If this Entry is the root of its filesystem, its parent is itself. - * IN: - * NSArray* arguments - * 0 - NSString* fullPath - * NSMutableDictionary* options - * empty - */ -- (void)getParent:(CDVInvokedUrlCommand*)command -{ - // arguments are URL encoded - NSString* fullPath = [command.arguments objectAtIndex:0]; - - // we don't (yet?) support getting the parent of an asset - if ([fullPath hasPrefix:kCDVAssetsLibraryPrefix]) { - CDVPluginResult* result = [CDVPluginResult resultWithStatus:CDVCommandStatus_IO_EXCEPTION messageAsInt:NOT_READABLE_ERR]; - [self.commandDelegate sendPluginResult:result callbackId:command.callbackId]; - return; - } - - CDVPluginResult* result = nil; - NSString* newPath = nil; - - if ([fullPath isEqualToString:self.appDocsPath] || [fullPath isEqualToString:self.appTempPath]) { - // return self - newPath = fullPath; - } else { - // since this call is made from an existing Entry object - the parent should already exist so no additional error checking - // remove last component and return Entry - NSRange range = [fullPath rangeOfString:@"/" options:NSBackwardsSearch]; - newPath = [fullPath substringToIndex:range.location]; - } - - if (newPath) { - NSFileManager* fileMgr = [[NSFileManager alloc] init]; - BOOL bIsDir; - BOOL bExists = [fileMgr fileExistsAtPath:newPath isDirectory:&bIsDir]; - if (bExists) { - result = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsDictionary:[self getDirectoryEntry:newPath isDirectory:bIsDir]]; - } - } - if (!result) { - // invalid path or file does not exist - result = [CDVPluginResult resultWithStatus:CDVCommandStatus_IO_EXCEPTION messageAsInt:NOT_FOUND_ERR]; - } - [self.commandDelegate sendPluginResult:result callbackId:command.callbackId]; -} - -/* - * get MetaData of entry - * Currently MetaData only includes modificationTime. - */ -- (void)getMetadata:(CDVInvokedUrlCommand*)command -{ - // arguments - NSString* argPath = [command.arguments objectAtIndex:0]; - __block CDVPluginResult* result = nil; - - if ([argPath hasPrefix:kCDVAssetsLibraryPrefix]) { - // In this case, we need to use an asynchronous method to retrieve the file. - // Because of this, we can't just assign to `result` and send it at the end of the method. - // Instead, we return after calling the asynchronous method and send `result` in each of the blocks. - ALAssetsLibraryAssetForURLResultBlock resultBlock = ^(ALAsset* asset) { - if (asset) { - // We have the asset! Retrieve the metadata and send it off. - NSDate* date = [asset valueForProperty:ALAssetPropertyDate]; - result = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsDouble:[date timeIntervalSince1970] * 1000]; - [self.commandDelegate sendPluginResult:result callbackId:command.callbackId]; - } else { - // We couldn't find the asset. Send the appropriate error. - result = [CDVPluginResult resultWithStatus:CDVCommandStatus_IO_EXCEPTION messageAsInt:NOT_FOUND_ERR]; - [self.commandDelegate sendPluginResult:result callbackId:command.callbackId]; - } - }; - // TODO(maxw): Consider making this a class variable since it's the same every time. - ALAssetsLibraryAccessFailureBlock failureBlock = ^(NSError* error) { - // Retrieving the asset failed for some reason. Send the appropriate error. - result = [CDVPluginResult resultWithStatus:CDVCommandStatus_IO_EXCEPTION messageAsString:[error localizedDescription]]; - [self.commandDelegate sendPluginResult:result callbackId:command.callbackId]; - }; - - ALAssetsLibrary* assetsLibrary = [[ALAssetsLibrary alloc] init]; - [assetsLibrary assetForURL:[NSURL URLWithString:argPath] resultBlock:resultBlock failureBlock:failureBlock]; - return; - } - - NSString* testPath = argPath; // [self getFullPath: argPath]; - - NSFileManager* fileMgr = [[NSFileManager alloc] init]; - NSError* __autoreleasing error = nil; - - NSDictionary* fileAttribs = [fileMgr attributesOfItemAtPath:testPath error:&error]; - - if (fileAttribs) { - NSDate* modDate = [fileAttribs fileModificationDate]; - if (modDate) { - result = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsDouble:[modDate timeIntervalSince1970] * 1000]; - } - } else { - // didn't get fileAttribs - CDVFileError errorCode = ABORT_ERR; - NSLog(@"error getting metadata: %@", [error localizedDescription]); - if ([error code] == NSFileNoSuchFileError) { - errorCode = NOT_FOUND_ERR; - } - // log [NSNumber numberWithDouble: theMessage] objCtype to see what it returns - result = [CDVPluginResult resultWithStatus:CDVCommandStatus_ERROR messageAsInt:errorCode]; - } - if (!result) { - // invalid path or file does not exist - result = [CDVPluginResult resultWithStatus:CDVCommandStatus_IO_EXCEPTION]; - } - [self.commandDelegate sendPluginResult:result callbackId:command.callbackId]; -} - -/* - * set MetaData of entry - * Currently we only support "com.apple.MobileBackup" (boolean) - */ -- (void)setMetadata:(CDVInvokedUrlCommand*)command -{ - // arguments - NSString* filePath = [command.arguments objectAtIndex:0]; - NSDictionary* options = [command.arguments objectAtIndex:1 withDefault:nil]; - CDVPluginResult* result = nil; - BOOL ok = NO; - - // setMetadata doesn't make sense for asset library files - if (![filePath hasPrefix:kCDVAssetsLibraryPrefix]) { - // we only care about this iCloud key for now. - // set to 1/true to skip backup, set to 0/false to back it up (effectively removing the attribute) - NSString* iCloudBackupExtendedAttributeKey = @"com.apple.MobileBackup"; - id iCloudBackupExtendedAttributeValue = [options objectForKey:iCloudBackupExtendedAttributeKey]; - - if ((iCloudBackupExtendedAttributeValue != nil) && [iCloudBackupExtendedAttributeValue isKindOfClass:[NSNumber class]]) { - if (IsAtLeastiOSVersion(@"5.1")) { - NSURL* url = [NSURL fileURLWithPath:filePath]; - NSError* __autoreleasing error = nil; - - ok = [url setResourceValue:[NSNumber numberWithBool:[iCloudBackupExtendedAttributeValue boolValue]] forKey:NSURLIsExcludedFromBackupKey error:&error]; - } else { // below 5.1 (deprecated - only really supported in 5.01) - u_int8_t value = [iCloudBackupExtendedAttributeValue intValue]; - if (value == 0) { // remove the attribute (allow backup, the default) - ok = (removexattr([filePath fileSystemRepresentation], [iCloudBackupExtendedAttributeKey cStringUsingEncoding:NSUTF8StringEncoding], 0) == 0); - } else { // set the attribute (skip backup) - ok = (setxattr([filePath fileSystemRepresentation], [iCloudBackupExtendedAttributeKey cStringUsingEncoding:NSUTF8StringEncoding], &value, sizeof(value), 0, 0) == 0); - } - } - } - } - - if (ok) { - result = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK]; - } else { - result = [CDVPluginResult resultWithStatus:CDVCommandStatus_ERROR]; - } - [self.commandDelegate sendPluginResult:result callbackId:command.callbackId]; -} - -/* removes the directory or file entry - * IN: - * NSArray* arguments - * 0 - NSString* fullPath - * - * returns NO_MODIFICATION_ALLOWED_ERR if is top level directory or no permission to delete dir - * returns INVALID_MODIFICATION_ERR if is non-empty dir or asset library file - * returns NOT_FOUND_ERR if file or dir is not found -*/ -- (void)remove:(CDVInvokedUrlCommand*)command -{ - // arguments - NSString* fullPath = [command.arguments objectAtIndex:0]; - CDVPluginResult* result = nil; - CDVFileError errorCode = 0; // !! 0 not currently defined - - // return error for assets-library URLs - if ([fullPath hasPrefix:kCDVAssetsLibraryPrefix]) { - errorCode = INVALID_MODIFICATION_ERR; - } else if ([fullPath isEqualToString:self.appDocsPath] || [fullPath isEqualToString:self.appTempPath]) { - // error if try to remove top level (documents or tmp) dir - errorCode = NO_MODIFICATION_ALLOWED_ERR; - } else { - NSFileManager* fileMgr = [[NSFileManager alloc] init]; - BOOL bIsDir = NO; - BOOL bExists = [fileMgr fileExistsAtPath:fullPath isDirectory:&bIsDir]; - if (!bExists) { - errorCode = NOT_FOUND_ERR; - } - if (bIsDir && ([[fileMgr contentsOfDirectoryAtPath:fullPath error:nil] count] != 0)) { - // dir is not empty - errorCode = INVALID_MODIFICATION_ERR; - } - } - if (errorCode > 0) { - result = [CDVPluginResult resultWithStatus:CDVCommandStatus_IO_EXCEPTION messageAsInt:errorCode]; - } else { - // perform actual remove - result = [self doRemove:fullPath]; - } - [self.commandDelegate sendPluginResult:result callbackId:command.callbackId]; -} - -/* recursively removes the directory - * IN: - * NSArray* arguments - * 0 - NSString* fullPath - * - * returns NO_MODIFICATION_ALLOWED_ERR if is top level directory or no permission to delete dir - * returns NOT_FOUND_ERR if file or dir is not found - */ -- (void)removeRecursively:(CDVInvokedUrlCommand*)command -{ - // arguments - NSString* fullPath = [command.arguments objectAtIndex:0]; - - // return unsupported result for assets-library URLs - if ([fullPath hasPrefix:kCDVAssetsLibraryPrefix]) { - CDVPluginResult* result = [CDVPluginResult resultWithStatus:CDVCommandStatus_MALFORMED_URL_EXCEPTION messageAsString:@"removeRecursively not supported for assets-library URLs."]; - [self.commandDelegate sendPluginResult:result callbackId:command.callbackId]; - return; - } - - CDVPluginResult* result = nil; - - // error if try to remove top level (documents or tmp) dir - if ([fullPath isEqualToString:self.appDocsPath] || [fullPath isEqualToString:self.appTempPath]) { - result = [CDVPluginResult resultWithStatus:CDVCommandStatus_IO_EXCEPTION messageAsInt:NO_MODIFICATION_ALLOWED_ERR]; - } else { - result = [self doRemove:fullPath]; - } - [self.commandDelegate sendPluginResult:result callbackId:command.callbackId]; -} - -/* remove the file or directory (recursively) - * IN: - * NSString* fullPath - the full path to the file or directory to be removed - * NSString* callbackId - * called from remove and removeRecursively - check all pubic api specific error conditions (dir not empty, etc) before calling - */ - -- (CDVPluginResult*)doRemove:(NSString*)fullPath -{ - CDVPluginResult* result = nil; - BOOL bSuccess = NO; - NSError* __autoreleasing pError = nil; - NSFileManager* fileMgr = [[NSFileManager alloc] init]; - - @try { - bSuccess = [fileMgr removeItemAtPath:fullPath error:&pError]; - if (bSuccess) { - result = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK]; - } else { - // see if we can give a useful error - CDVFileError errorCode = ABORT_ERR; - NSLog(@"error getting metadata: %@", [pError localizedDescription]); - if ([pError code] == NSFileNoSuchFileError) { - errorCode = NOT_FOUND_ERR; - } else if ([pError code] == NSFileWriteNoPermissionError) { - errorCode = NO_MODIFICATION_ALLOWED_ERR; - } - - result = [CDVPluginResult resultWithStatus:CDVCommandStatus_IO_EXCEPTION messageAsInt:errorCode]; - } - } @catch(NSException* e) { // NSInvalidArgumentException if path is . or .. - result = [CDVPluginResult resultWithStatus:CDVCommandStatus_ERROR messageAsInt:SYNTAX_ERR]; - } - - return result; -} - -- (void)copyTo:(CDVInvokedUrlCommand*)command -{ - [self doCopyMove:command isCopy:YES]; -} - -- (void)moveTo:(CDVInvokedUrlCommand*)command -{ - [self doCopyMove:command isCopy:NO]; -} - -/** - * Helper function to check to see if the user attempted to copy an entry into its parent without changing its name, - * or attempted to copy a directory into a directory that it contains directly or indirectly. - * - * IN: - * NSString* srcDir - * NSString* destinationDir - * OUT: - * YES copy/ move is allows - * NO move is onto itself - */ -- (BOOL)canCopyMoveSrc:(NSString*)src ToDestination:(NSString*)dest -{ - // This weird test is to determine if we are copying or moving a directory into itself. - // Copy /Documents/myDir to /Documents/myDir-backup is okay but - // Copy /Documents/myDir to /Documents/myDir/backup not okay - BOOL copyOK = YES; - NSRange range = [dest rangeOfString:src]; - - if (range.location != NSNotFound) { - NSRange testRange = {range.length - 1, ([dest length] - range.length)}; - NSRange resultRange = [dest rangeOfString:@"/" options:0 range:testRange]; - if (resultRange.location != NSNotFound) { - copyOK = NO; - } - } - return copyOK; -} - -/* Copy/move a file or directory to a new location - * IN: - * NSArray* arguments - * 0 - NSString* fullPath of entry - * 1 - NSString* newName the new name of the entry, defaults to the current name - * NSMutableDictionary* options - DirectoryEntry to which to copy the entry - * BOOL - bCopy YES if copy, NO if move - * - */ -- (void)doCopyMove:(CDVInvokedUrlCommand*)command isCopy:(BOOL)bCopy -{ - NSArray* arguments = command.arguments; - - // arguments - NSString* srcFullPath = [arguments objectAtIndex:0]; - NSString* destRootPath = [arguments objectAtIndex:1]; - // optional argument - NSString* newName = ([arguments count] > 2) ? [arguments objectAtIndex:2] : [srcFullPath lastPathComponent]; // use last component from appPath if new name not provided - - __block CDVPluginResult* result = nil; - CDVFileError errCode = 0; // !! Currently 0 is not defined, use this to signal error !! - - /*NSString* destRootPath = nil; - NSString* key = @"fullPath"; - if([options valueForKeyIsString:key]){ - destRootPath = [options objectForKey:@"fullPath"]; - }*/ - - if (!destRootPath) { - // no destination provided - errCode = NOT_FOUND_ERR; - } else if ([newName rangeOfString:@":"].location != NSNotFound) { - // invalid chars in new name - errCode = ENCODING_ERR; - } else { - NSString* newFullPath = [destRootPath stringByAppendingPathComponent:newName]; - NSFileManager* fileMgr = [[NSFileManager alloc] init]; - if ([newFullPath isEqualToString:srcFullPath]) { - // source and destination can not be the same - errCode = INVALID_MODIFICATION_ERR; - } else if ([srcFullPath hasPrefix:kCDVAssetsLibraryPrefix]) { - if (bCopy) { - // Copying (as opposed to moving) an assets library file is okay. - // In this case, we need to use an asynchronous method to retrieve the file. - // Because of this, we can't just assign to `result` and send it at the end of the method. - // Instead, we return after calling the asynchronous method and send `result` in each of the blocks. - ALAssetsLibraryAssetForURLResultBlock resultBlock = ^(ALAsset* asset) { - if (asset) { - // We have the asset! Get the data and try to copy it over. - if (![fileMgr fileExistsAtPath:destRootPath]) { - // The destination directory doesn't exist. - result = [CDVPluginResult resultWithStatus:CDVCommandStatus_IO_EXCEPTION messageAsInt:NOT_FOUND_ERR]; - [self.commandDelegate sendPluginResult:result callbackId:command.callbackId]; - return; - } else if ([fileMgr fileExistsAtPath:newFullPath]) { - // A file already exists at the destination path. - result = [CDVPluginResult resultWithStatus:CDVCommandStatus_IO_EXCEPTION messageAsInt:PATH_EXISTS_ERR]; - [self.commandDelegate sendPluginResult:result callbackId:command.callbackId]; - return; - } - - // We're good to go! Write the file to the new destination. - ALAssetRepresentation* assetRepresentation = [asset defaultRepresentation]; - Byte* buffer = (Byte*)malloc([assetRepresentation size]); - NSUInteger bufferSize = [assetRepresentation getBytes:buffer fromOffset:0.0 length:[assetRepresentation size] error:nil]; - NSData* data = [NSData dataWithBytesNoCopy:buffer length:bufferSize freeWhenDone:YES]; - [data writeToFile:newFullPath atomically:YES]; - result = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsDictionary:[self getDirectoryEntry:newFullPath isDirectory:NO]]; - [self.commandDelegate sendPluginResult:result callbackId:command.callbackId]; - } else { - // We couldn't find the asset. Send the appropriate error. - result = [CDVPluginResult resultWithStatus:CDVCommandStatus_IO_EXCEPTION messageAsInt:NOT_FOUND_ERR]; - [self.commandDelegate sendPluginResult:result callbackId:command.callbackId]; - } - }; - ALAssetsLibraryAccessFailureBlock failureBlock = ^(NSError* error) { - // Retrieving the asset failed for some reason. Send the appropriate error. - result = [CDVPluginResult resultWithStatus:CDVCommandStatus_IO_EXCEPTION messageAsString:[error localizedDescription]]; - [self.commandDelegate sendPluginResult:result callbackId:command.callbackId]; - }; - - ALAssetsLibrary* assetsLibrary = [[ALAssetsLibrary alloc] init]; - [assetsLibrary assetForURL:[NSURL URLWithString:srcFullPath] resultBlock:resultBlock failureBlock:failureBlock]; - return; - } else { - // Moving an assets library file is not doable, since we can't remove it. - errCode = INVALID_MODIFICATION_ERR; - } - } else { - BOOL bSrcIsDir = NO; - BOOL bDestIsDir = NO; - BOOL bNewIsDir = NO; - BOOL bSrcExists = [fileMgr fileExistsAtPath:srcFullPath isDirectory:&bSrcIsDir]; - BOOL bDestExists = [fileMgr fileExistsAtPath:destRootPath isDirectory:&bDestIsDir]; - BOOL bNewExists = [fileMgr fileExistsAtPath:newFullPath isDirectory:&bNewIsDir]; - if (!bSrcExists || !bDestExists) { - // the source or the destination root does not exist - errCode = NOT_FOUND_ERR; - } else if (bSrcIsDir && (bNewExists && !bNewIsDir)) { - // can't copy/move dir to file - errCode = INVALID_MODIFICATION_ERR; - } else { // no errors yet - NSError* __autoreleasing error = nil; - BOOL bSuccess = NO; - if (bCopy) { - if (bSrcIsDir && ![self canCopyMoveSrc:srcFullPath ToDestination:newFullPath] /*[newFullPath hasPrefix:srcFullPath]*/) { - // can't copy dir into self - errCode = INVALID_MODIFICATION_ERR; - } else if (bNewExists) { - // the full destination should NOT already exist if a copy - errCode = PATH_EXISTS_ERR; - } else { - bSuccess = [fileMgr copyItemAtPath:srcFullPath toPath:newFullPath error:&error]; - } - } else { // move - // iOS requires that destination must not exist before calling moveTo - // is W3C INVALID_MODIFICATION_ERR error if destination dir exists and has contents - // - if (!bSrcIsDir && (bNewExists && bNewIsDir)) { - // can't move a file to directory - errCode = INVALID_MODIFICATION_ERR; - } else if (bSrcIsDir && ![self canCopyMoveSrc:srcFullPath ToDestination:newFullPath]) { // [newFullPath hasPrefix:srcFullPath]){ - // can't move a dir into itself - errCode = INVALID_MODIFICATION_ERR; - } else if (bNewExists) { - if (bNewIsDir && ([[fileMgr contentsOfDirectoryAtPath:newFullPath error:NULL] count] != 0)) { - // can't move dir to a dir that is not empty - errCode = INVALID_MODIFICATION_ERR; - newFullPath = nil; // so we won't try to move - } else { - // remove destination so can perform the moveItemAtPath - bSuccess = [fileMgr removeItemAtPath:newFullPath error:NULL]; - if (!bSuccess) { - errCode = INVALID_MODIFICATION_ERR; // is this the correct error? - newFullPath = nil; - } - } - } else if (bNewIsDir && [newFullPath hasPrefix:srcFullPath]) { - // can't move a directory inside itself or to any child at any depth; - errCode = INVALID_MODIFICATION_ERR; - newFullPath = nil; - } - - if (newFullPath != nil) { - bSuccess = [fileMgr moveItemAtPath:srcFullPath toPath:newFullPath error:&error]; - } - } - if (bSuccess) { - // should verify it is there and of the correct type??? - NSDictionary* newEntry = [self getDirectoryEntry:newFullPath isDirectory:bSrcIsDir]; // should be the same type as source - result = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsDictionary:newEntry]; - } else { - errCode = INVALID_MODIFICATION_ERR; // catch all - if (error) { - if (([error code] == NSFileReadUnknownError) || ([error code] == NSFileReadTooLargeError)) { - errCode = NOT_READABLE_ERR; - } else if ([error code] == NSFileWriteOutOfSpaceError) { - errCode = QUOTA_EXCEEDED_ERR; - } else if ([error code] == NSFileWriteNoPermissionError) { - errCode = NO_MODIFICATION_ALLOWED_ERR; - } - } - } - } - } - } - if (errCode > 0) { - result = [CDVPluginResult resultWithStatus:CDVCommandStatus_IO_EXCEPTION messageAsInt:errCode]; - } - [self.commandDelegate sendPluginResult:result callbackId:command.callbackId]; -} - -/* return the URI to the entry - * IN: - * NSArray* arguments - * 0 - NSString* fullPath of entry - * 1 - desired mime type of entry - ignored - always returns file:// - */ - -/* Not needed since W3C toURI is synchronous. Leaving code here for now in case W3C spec changes..... -- (void) toURI:(CDVInvokedUrlCommand*)command -{ - NSString* callbackId = command.callbackId; - NSString* argPath = [command.arguments objectAtIndex:0]; - PluginResult* result = nil; - NSString* jsString = nil; - - NSString* fullPath = [self getFullPath: argPath]; - if (fullPath) { - // do we need to make sure the file actually exists? - // create file uri - NSString* strUri = [fullPath stringByReplacingPercentEscapesUsingEncoding: NSUTF8StringEncoding]; - NSURL* fileUrl = [NSURL fileURLWithPath:strUri]; - if (fileUrl) { - result = [PluginResult resultWithStatus:CDVCommandStatus_OK messageAsString: [fileUrl absoluteString]]; - jsString = [result toSuccessCallbackString:callbackId]; - } // else NOT_FOUND_ERR - } - if(!jsString) { - // was error - result = [PluginResult resultWithStatus:CDVCommandStatus_OK messageAsInt: NOT_FOUND_ERR cast: @"window.localFileSystem._castError"]; - jsString = [result toErrorCallbackString:callbackId]; - } - - [self writeJavascript:jsString]; -}*/ -- (void)getFileMetadata:(CDVInvokedUrlCommand*)command -{ - // arguments - NSString* argPath = [command.arguments objectAtIndex:0]; - - __block CDVPluginResult* result = nil; - - NSString* fullPath = argPath; // [self getFullPath: argPath]; - - if (fullPath) { - if ([fullPath hasPrefix:kCDVAssetsLibraryPrefix]) { - // In this case, we need to use an asynchronous method to retrieve the file. - // Because of this, we can't just assign to `result` and send it at the end of the method. - // Instead, we return after calling the asynchronous method and send `result` in each of the blocks. - ALAssetsLibraryAssetForURLResultBlock resultBlock = ^(ALAsset* asset) { - if (asset) { - // We have the asset! Populate the dictionary and send it off. - NSMutableDictionary* fileInfo = [NSMutableDictionary dictionaryWithCapacity:5]; - ALAssetRepresentation* assetRepresentation = [asset defaultRepresentation]; - [fileInfo setObject:[NSNumber numberWithUnsignedLongLong:[assetRepresentation size]] forKey:@"size"]; - [fileInfo setObject:argPath forKey:@"fullPath"]; - NSString* filename = [assetRepresentation filename]; - [fileInfo setObject:filename forKey:@"name"]; - [fileInfo setObject:[self getMimeTypeFromPath:filename] forKey:@"type"]; - NSDate* creationDate = [asset valueForProperty:ALAssetPropertyDate]; - NSNumber* msDate = [NSNumber numberWithDouble:[creationDate timeIntervalSince1970] * 1000]; - [fileInfo setObject:msDate forKey:@"lastModifiedDate"]; - - result = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsDictionary:fileInfo]; - [self.commandDelegate sendPluginResult:result callbackId:command.callbackId]; - } else { - // We couldn't find the asset. Send the appropriate error. - result = [CDVPluginResult resultWithStatus:CDVCommandStatus_IO_EXCEPTION messageAsInt:NOT_FOUND_ERR]; - [self.commandDelegate sendPluginResult:result callbackId:command.callbackId]; - } - }; - ALAssetsLibraryAccessFailureBlock failureBlock = ^(NSError* error) { - // Retrieving the asset failed for some reason. Send the appropriate error. - result = [CDVPluginResult resultWithStatus:CDVCommandStatus_IO_EXCEPTION messageAsString:[error localizedDescription]]; - [self.commandDelegate sendPluginResult:result callbackId:command.callbackId]; - }; - - ALAssetsLibrary* assetsLibrary = [[ALAssetsLibrary alloc] init]; - [assetsLibrary assetForURL:[NSURL URLWithString:argPath] resultBlock:resultBlock failureBlock:failureBlock]; - return; - } else { - NSFileManager* fileMgr = [[NSFileManager alloc] init]; - BOOL bIsDir = NO; - // make sure it exists and is not a directory - BOOL bExists = [fileMgr fileExistsAtPath:fullPath isDirectory:&bIsDir]; - if (!bExists || bIsDir) { - result = [CDVPluginResult resultWithStatus:CDVCommandStatus_IO_EXCEPTION messageAsInt:NOT_FOUND_ERR]; - } else { - // create dictionary of file info - NSError* __autoreleasing error = nil; - NSDictionary* fileAttrs = [fileMgr attributesOfItemAtPath:fullPath error:&error]; - NSMutableDictionary* fileInfo = [NSMutableDictionary dictionaryWithCapacity:5]; - [fileInfo setObject:[NSNumber numberWithUnsignedLongLong:[fileAttrs fileSize]] forKey:@"size"]; - [fileInfo setObject:argPath forKey:@"fullPath"]; - [fileInfo setObject:@"" forKey:@"type"]; // can't easily get the mimetype unless create URL, send request and read response so skipping - [fileInfo setObject:[argPath lastPathComponent] forKey:@"name"]; - NSDate* modDate = [fileAttrs fileModificationDate]; - NSNumber* msDate = [NSNumber numberWithDouble:[modDate timeIntervalSince1970] * 1000]; - [fileInfo setObject:msDate forKey:@"lastModifiedDate"]; - result = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsDictionary:fileInfo]; - } - } - } - if (!result) { - result = [CDVPluginResult resultWithStatus:CDVCommandStatus_INSTANTIATION_EXCEPTION]; - } - [self.commandDelegate sendPluginResult:result callbackId:command.callbackId]; -} - -- (void)readEntries:(CDVInvokedUrlCommand*)command -{ - // arguments - NSString* fullPath = [command.arguments objectAtIndex:0]; - - // return unsupported result for assets-library URLs - if ([fullPath hasPrefix:kCDVAssetsLibraryPrefix]) { - CDVPluginResult* result = [CDVPluginResult resultWithStatus:CDVCommandStatus_MALFORMED_URL_EXCEPTION messageAsString:@"readEntries not supported for assets-library URLs."]; - [self.commandDelegate sendPluginResult:result callbackId:command.callbackId]; - return; - } - - CDVPluginResult* result = nil; - - NSFileManager* fileMgr = [[NSFileManager alloc] init]; - NSError* __autoreleasing error = nil; - NSArray* contents = [fileMgr contentsOfDirectoryAtPath:fullPath error:&error]; - - if (contents) { - NSMutableArray* entries = [NSMutableArray arrayWithCapacity:1]; - if ([contents count] > 0) { - // create an Entry (as JSON) for each file/dir - for (NSString* name in contents) { - // see if is dir or file - NSString* entryPath = [fullPath stringByAppendingPathComponent:name]; - BOOL bIsDir = NO; - [fileMgr fileExistsAtPath:entryPath isDirectory:&bIsDir]; - NSDictionary* entryDict = [self getDirectoryEntry:entryPath isDirectory:bIsDir]; - [entries addObject:entryDict]; - } - } - result = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsArray:entries]; - } else { - // assume not found but could check error for more specific error conditions - result = [CDVPluginResult resultWithStatus:CDVCommandStatus_IO_EXCEPTION messageAsInt:NOT_FOUND_ERR]; - } - - [self.commandDelegate sendPluginResult:result callbackId:command.callbackId]; -} - -- (void)readFileWithPath:(NSString*)path start:(NSInteger)start end:(NSInteger)end callback:(void (^)(NSData*, NSString* mimeType, CDVFileError))callback -{ - if (path == nil) { - callback(nil, nil, SYNTAX_ERR); - } else { - [self.commandDelegate runInBackground:^ { - if ([path hasPrefix:kCDVAssetsLibraryPrefix]) { - // In this case, we need to use an asynchronous method to retrieve the file. - // Because of this, we can't just assign to `result` and send it at the end of the method. - // Instead, we return after calling the asynchronous method and send `result` in each of the blocks. - ALAssetsLibraryAssetForURLResultBlock resultBlock = ^(ALAsset* asset) { - if (asset) { - // We have the asset! Get the data and send it off. - ALAssetRepresentation* assetRepresentation = [asset defaultRepresentation]; - Byte* buffer = (Byte*)malloc([assetRepresentation size]); - NSUInteger bufferSize = [assetRepresentation getBytes:buffer fromOffset:0.0 length:[assetRepresentation size] error:nil]; - NSData* data = [NSData dataWithBytesNoCopy:buffer length:bufferSize freeWhenDone:YES]; - NSString* MIMEType = (__bridge_transfer NSString*)UTTypeCopyPreferredTagWithClass((__bridge CFStringRef)[assetRepresentation UTI], kUTTagClassMIMEType); - - callback(data, MIMEType, NO_ERROR); - } else { - callback(nil, nil, NOT_FOUND_ERR); - } - }; - ALAssetsLibraryAccessFailureBlock failureBlock = ^(NSError* error) { - // Retrieving the asset failed for some reason. Send the appropriate error. - NSLog(@"Error: %@", error); - callback(nil, nil, SECURITY_ERR); - }; - - ALAssetsLibrary* assetsLibrary = [[ALAssetsLibrary alloc] init]; - [assetsLibrary assetForURL:[NSURL URLWithString:path] resultBlock:resultBlock failureBlock:failureBlock]; - } else { - NSString* mimeType = [self getMimeTypeFromPath:path]; - if (mimeType == nil) { - mimeType = @"*/*"; - } - NSFileHandle* file = [NSFileHandle fileHandleForReadingAtPath:path]; - if (start > 0) { - [file seekToFileOffset:start]; - } - - NSData* readData; - if (end < 0) { - readData = [file readDataToEndOfFile]; - } else { - readData = [file readDataOfLength:(end - start)]; - } - - [file closeFile]; - - callback(readData, mimeType, readData != nil ? NO_ERROR : NOT_FOUND_ERR); - } - }]; - } -} - -/* read and return file data - * IN: - * NSArray* arguments - * 0 - NSString* fullPath - * 1 - NSString* encoding - * 2 - NSString* start - * 3 - NSString* end - */ -- (void)readAsText:(CDVInvokedUrlCommand*)command -{ - // arguments - NSString* path = [command argumentAtIndex:0]; - NSString* encoding = [command argumentAtIndex:1]; - NSInteger start = [[command argumentAtIndex:2] integerValue]; - NSInteger end = [[command argumentAtIndex:3] integerValue]; - - // TODO: implement - if ([@"UTF-8" caseInsensitiveCompare : encoding] != NSOrderedSame) { - NSLog(@"Only UTF-8 encodings are currently supported by readAsText"); - CDVPluginResult* result = [CDVPluginResult resultWithStatus:CDVCommandStatus_IO_EXCEPTION messageAsInt:ENCODING_ERR]; - [self.commandDelegate sendPluginResult:result callbackId:command.callbackId]; - return; - } - - [self readFileWithPath:path start:start end:end callback:^(NSData* data, NSString* mimeType, CDVFileError errorCode) { - CDVPluginResult* result = nil; - if (data != nil) { - NSString* str = [[NSString alloc] initWithBytesNoCopy:(void*)[data bytes] length:[data length] encoding:NSUTF8StringEncoding freeWhenDone:NO]; - // Check that UTF8 conversion did not fail. - if (str != nil) { - result = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsString:str]; - result.associatedObject = data; - } else { - errorCode = ENCODING_ERR; - } - } - if (result == nil) { - result = [CDVPluginResult resultWithStatus:CDVCommandStatus_IO_EXCEPTION messageAsInt:errorCode]; - } - - [self.commandDelegate sendPluginResult:result callbackId:command.callbackId]; - }]; -} - -/* Read content of text file and return as base64 encoded data url. - * IN: - * NSArray* arguments - * 0 - NSString* fullPath - * 1 - NSString* start - * 2 - NSString* end - * - * Determines the mime type from the file extension, returns ENCODING_ERR if mimetype can not be determined. - */ - -- (void)readAsDataURL:(CDVInvokedUrlCommand*)command -{ - NSString* path = [command argumentAtIndex:0]; - NSInteger start = [[command argumentAtIndex:1] integerValue]; - NSInteger end = [[command argumentAtIndex:2] integerValue]; - - [self readFileWithPath:path start:start end:end callback:^(NSData* data, NSString* mimeType, CDVFileError errorCode) { - CDVPluginResult* result = nil; - if (data != nil) { - // TODO: Would be faster to base64 encode directly to the final string. - NSString* output = [NSString stringWithFormat:@"data:%@;base64,%@", mimeType, [data base64EncodedString]]; - result = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsString:output]; - } else { - result = [CDVPluginResult resultWithStatus:CDVCommandStatus_IO_EXCEPTION messageAsInt:errorCode]; - } - - [self.commandDelegate sendPluginResult:result callbackId:command.callbackId]; - }]; -} - -/* Read content of text file and return as an arraybuffer - * IN: - * NSArray* arguments - * 0 - NSString* fullPath - * 1 - NSString* start - * 2 - NSString* end - */ - -- (void)readAsArrayBuffer:(CDVInvokedUrlCommand*)command -{ - NSString* path = [command argumentAtIndex:0]; - NSInteger start = [[command argumentAtIndex:1] integerValue]; - NSInteger end = [[command argumentAtIndex:2] integerValue]; - - [self readFileWithPath:path start:start end:end callback:^(NSData* data, NSString* mimeType, CDVFileError errorCode) { - CDVPluginResult* result = nil; - if (data != nil) { - result = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsArrayBuffer:data]; - } else { - result = [CDVPluginResult resultWithStatus:CDVCommandStatus_IO_EXCEPTION messageAsInt:errorCode]; - } - - [self.commandDelegate sendPluginResult:result callbackId:command.callbackId]; - }]; -} - -- (void)readAsBinaryString:(CDVInvokedUrlCommand*)command -{ - NSString* path = [command argumentAtIndex:0]; - NSInteger start = [[command argumentAtIndex:1] integerValue]; - NSInteger end = [[command argumentAtIndex:2] integerValue]; - - [self readFileWithPath:path start:start end:end callback:^(NSData* data, NSString* mimeType, CDVFileError errorCode) { - CDVPluginResult* result = nil; - if (data != nil) { - NSString* payload = [[NSString alloc] initWithBytesNoCopy:(void*)[data bytes] length:[data length] encoding:NSASCIIStringEncoding freeWhenDone:NO]; - result = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsString:payload]; - result.associatedObject = data; - } else { - result = [CDVPluginResult resultWithStatus:CDVCommandStatus_IO_EXCEPTION messageAsInt:errorCode]; - } - - [self.commandDelegate sendPluginResult:result callbackId:command.callbackId]; - }]; -} - -/* helper function to get the mimeType from the file extension - * IN: - * NSString* fullPath - filename (may include path) - * OUT: - * NSString* the mime type as type/subtype. nil if not able to determine - */ -- (NSString*)getMimeTypeFromPath:(NSString*)fullPath -{ - NSString* mimeType = nil; - - if (fullPath) { - CFStringRef typeId = UTTypeCreatePreferredIdentifierForTag(kUTTagClassFilenameExtension, (__bridge CFStringRef)[fullPath pathExtension], NULL); - if (typeId) { - mimeType = (__bridge_transfer NSString*)UTTypeCopyPreferredTagWithClass(typeId, kUTTagClassMIMEType); - if (!mimeType) { - // special case for m4a - if ([(__bridge NSString*)typeId rangeOfString : @"m4a-audio"].location != NSNotFound) { - mimeType = @"audio/mp4"; - } else if ([[fullPath pathExtension] rangeOfString:@"wav"].location != NSNotFound) { - mimeType = @"audio/wav"; - } - } - CFRelease(typeId); - } - } - return mimeType; -} - -- (void)truncate:(CDVInvokedUrlCommand*)command -{ - // arguments - NSString* argPath = [command.arguments objectAtIndex:0]; - unsigned long long pos = (unsigned long long)[[command.arguments objectAtIndex:1] longLongValue]; - - // assets-library files can't be truncated - if ([argPath hasPrefix:kCDVAssetsLibraryPrefix]) { - CDVPluginResult* result = [CDVPluginResult resultWithStatus:CDVCommandStatus_IO_EXCEPTION messageAsInt:NO_MODIFICATION_ALLOWED_ERR]; - [self.commandDelegate sendPluginResult:result callbackId:command.callbackId]; - return; - } - - NSString* appFile = argPath; // [self getFullPath:argPath]; - - unsigned long long newPos = [self truncateFile:appFile atPosition:pos]; - CDVPluginResult* result = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsInt:newPos]; - - [self.commandDelegate sendPluginResult:result callbackId:command.callbackId]; -} - -- (unsigned long long)truncateFile:(NSString*)filePath atPosition:(unsigned long long)pos -{ - unsigned long long newPos = 0UL; - - NSFileHandle* file = [NSFileHandle fileHandleForWritingAtPath:filePath]; - - if (file) { - [file truncateFileAtOffset:(unsigned long long)pos]; - newPos = [file offsetInFile]; - [file synchronizeFile]; - [file closeFile]; - } - return newPos; -} - -/* write - * IN: - * NSArray* arguments - * 0 - NSString* file path to write to - * 1 - NSString* or NSData* data to write - * 2 - NSNumber* position to begin writing - */ -- (void)write:(CDVInvokedUrlCommand*)command -{ - NSString* callbackId = command.callbackId; - NSArray* arguments = command.arguments; - - // arguments - NSString* argPath = [arguments objectAtIndex:0]; - id argData = [arguments objectAtIndex:1]; - unsigned long long pos = (unsigned long long)[[arguments objectAtIndex:2] longLongValue]; - - // text can't be written into assets-library files - if ([argPath hasPrefix:kCDVAssetsLibraryPrefix]) { - CDVPluginResult* result = [CDVPluginResult resultWithStatus:CDVCommandStatus_IO_EXCEPTION messageAsInt:NO_MODIFICATION_ALLOWED_ERR]; - [self.commandDelegate sendPluginResult:result callbackId:command.callbackId]; - return; - } - - NSString* fullPath = argPath; // [self getFullPath:argPath]; - - [self truncateFile:fullPath atPosition:pos]; - - if ([argData isKindOfClass:[NSString class]]) { - [self writeToFile:fullPath withString:argData encoding:NSUTF8StringEncoding append:YES callback:callbackId]; - } else if ([argData isKindOfClass:[NSData class]]) { - [self writeToFile:fullPath withData:argData append:YES callback:callbackId]; - } else { - CDVPluginResult *result = [CDVPluginResult resultWithStatus:CDVCommandStatus_ERROR messageAsString:@"Invalid parameter type"]; - [self.commandDelegate sendPluginResult:result callbackId:callbackId]; - } - -} - -- (void)writeToFile:(NSString*)filePath withData:(NSData*)encData append:(BOOL)shouldAppend callback:(NSString*)callbackId -{ - CDVPluginResult* result = nil; - CDVFileError errCode = INVALID_MODIFICATION_ERR; - int bytesWritten = 0; - - if (filePath) { - NSOutputStream* fileStream = [NSOutputStream outputStreamToFileAtPath:filePath append:shouldAppend]; - if (fileStream) { - NSUInteger len = [encData length]; - [fileStream open]; - - bytesWritten = [fileStream write:[encData bytes] maxLength:len]; - - [fileStream close]; - if (bytesWritten > 0) { - result = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsInt:bytesWritten]; - // } else { - // can probably get more detailed error info via [fileStream streamError] - // errCode already set to INVALID_MODIFICATION_ERR; - // bytesWritten = 0; // may be set to -1 on error - } - } // else fileStream not created return INVALID_MODIFICATION_ERR - } else { - // invalid filePath - errCode = NOT_FOUND_ERR; - } - if (!result) { - // was an error - result = [CDVPluginResult resultWithStatus:CDVCommandStatus_ERROR messageAsInt:errCode]; - } - [self.commandDelegate sendPluginResult:result callbackId:callbackId]; -} - -- (void)writeToFile:(NSString*)filePath withString:(NSString*)stringData encoding:(NSStringEncoding)encoding append:(BOOL)shouldAppend callback:(NSString*)callbackId -{ - [self writeToFile:filePath withData:[stringData dataUsingEncoding:encoding allowLossyConversion:YES] append:shouldAppend callback:callbackId]; -} - -- (void)testFileExists:(CDVInvokedUrlCommand*)command -{ - // arguments - NSString* argPath = [command.arguments objectAtIndex:0]; - - // Get the file manager - NSFileManager* fMgr = [NSFileManager defaultManager]; - NSString* appFile = argPath; // [ self getFullPath: argPath]; - - BOOL bExists = [fMgr fileExistsAtPath:appFile]; - CDVPluginResult* result = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsInt:(bExists ? 1 : 0)]; - - [self.commandDelegate sendPluginResult:result callbackId:command.callbackId]; -} - -- (void)testDirectoryExists:(CDVInvokedUrlCommand*)command -{ - // arguments - NSString* argPath = [command.arguments objectAtIndex:0]; - - // Get the file manager - NSFileManager* fMgr = [[NSFileManager alloc] init]; - NSString* appFile = argPath; // [self getFullPath: argPath]; - BOOL bIsDir = NO; - BOOL bExists = [fMgr fileExistsAtPath:appFile isDirectory:&bIsDir]; - - CDVPluginResult* result = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsInt:((bExists && bIsDir) ? 1 : 0)]; - - [self.commandDelegate sendPluginResult:result callbackId:command.callbackId]; -} - -// Returns number of bytes available via callback -- (void)getFreeDiskSpace:(CDVInvokedUrlCommand*)command -{ - // no arguments - - NSNumber* pNumAvail = [self checkFreeDiskSpace:self.appDocsPath]; - - NSString* strFreeSpace = [NSString stringWithFormat:@"%qu", [pNumAvail unsignedLongLongValue]]; - // NSLog(@"Free space is %@", strFreeSpace ); - - CDVPluginResult* result = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsString:strFreeSpace]; - - [self.commandDelegate sendPluginResult:result callbackId:command.callbackId]; -} - -@end diff --git a/plugins/org.apache.cordova.core.file/src/windows8/FileProxy.js b/plugins/org.apache.cordova.core.file/src/windows8/FileProxy.js deleted file mode 100644 index 6da9dd0..0000000 --- a/plugins/org.apache.cordova.core.file/src/windows8/FileProxy.js +++ /dev/null @@ -1,845 +0,0 @@ -/* - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - * -*/ - -var cordova = require('cordova'); -var Entry = require('./Entry'), - File = require('./File'), - FileEntry = require('./FileEntry'), - FileError = require('./FileError'), - DirectoryEntry = require('./DirectoryEntry'), - Flags = require('./Flags'), - FileSystem = require('./FileSystem'), - LocalFileSystem = require('./LocalFileSystem'); - -module.exports = { - - getFileMetadata:function(win,fail,args) { - var fullPath = args[0]; - - Windows.Storage.StorageFile.getFileFromPathAsync(fullPath).done( - function (storageFile) { - storageFile.getBasicPropertiesAsync().then( - function (basicProperties) { - win(new File(storageFile.name, storageFile.path, storageFile.fileType, basicProperties.dateModified, basicProperties.size)); - }, function () { - fail && fail(FileError.NOT_READABLE_ERR); - } - ); - }, function () { - fail && fail(FileError.NOT_FOUND_ERR); - } - ); - }, - - getMetadata:function(success,fail,args) { - var fullPath = args[0]; - - var dealFile = function (sFile) { - Windows.Storage.StorageFile.getFileFromPathAsync(fullPath).then( - function (storageFile) { - return storageFile.getBasicPropertiesAsync(); - }, - function () { - fail && fail(FileError.NOT_READABLE_ERR); - } - // get the basic properties of the file. - ).then( - function (basicProperties) { - success(basicProperties.dateModified); - }, - function () { - fail && fail(FileError.NOT_READABLE_ERR); - } - ); - }; - - var dealFolder = function (sFolder) { - Windows.Storage.StorageFolder.getFolderFromPathAsync(fullPath).then( - function (storageFolder) { - return storageFolder.getBasicPropertiesAsync(); - }, - function () { - fail && fail(FileError.NOT_READABLE_ERR); - } - // get the basic properties of the folder. - ).then( - function (basicProperties) { - success(basicProperties.dateModified); - }, - function () { - fail && fail(FileError.NOT_FOUND_ERR); - } - ); - }; - - Windows.Storage.StorageFile.getFileFromPathAsync(fullPath).then( - // the path is file. - function (sFile) { - dealFile(sFile); - }, - // the path is folder - function () { - Windows.Storage.StorageFolder.getFolderFromPathAsync(fullPath).then( - function (sFolder) { - dealFolder(sFolder); - }, function () { - fail && fail(FileError.NOT_FOUND_ERR); - } - ); - } - ); - }, - - getParent:function(win,fail,args) { // ["fullPath"] - var fullPath = args[0]; - - var storageFolderPer = Windows.Storage.ApplicationData.current.localFolder; - var storageFolderTem = Windows.Storage.ApplicationData.current.temporaryFolder; - - if (fullPath == storageFolderPer.path) { - win(new DirectoryEntry(storageFolderPer.name, storageFolderPer.path)); - return; - } else if (fullPath == storageFolderTem.path) { - win(new DirectoryEntry(storageFolderTem.name, storageFolderTem.path)); - return; - } - var splitArr = fullPath.split(new RegExp(/\/|\\/g)); - - var popItem = splitArr.pop(); - - var result = new DirectoryEntry(popItem, fullPath.substr(0, fullPath.length - popItem.length - 1)); - Windows.Storage.StorageFolder.getFolderFromPathAsync(result.fullPath).done( - function () { win(result); }, - function () { fail && fail(FileError.INVALID_STATE_ERR); } - ); - }, - - readAsText:function(win,fail,args) { - var fileName = args[0]; - var enc = args[1]; - - Windows.Storage.StorageFile.getFileFromPathAsync(fileName).done( - function (storageFile) { - var value = Windows.Storage.Streams.UnicodeEncoding.utf8; - if (enc == 'Utf16LE' || enc == 'utf16LE') { - value = Windows.Storage.Streams.UnicodeEncoding.utf16LE; - }else if (enc == 'Utf16BE' || enc == 'utf16BE') { - value = Windows.Storage.Streams.UnicodeEncoding.utf16BE; - } - Windows.Storage.FileIO.readTextAsync(storageFile, value).done( - function (fileContent) { - win(fileContent); - }, - function () { - fail && fail(FileError.ENCODING_ERR); - } - ); - }, function () { - fail && fail(FileError.NOT_FOUND_ERR); - } - ); - }, - - readAsDataURL:function(win,fail,args) { - var fileName = args[0]; - - - Windows.Storage.StorageFile.getFileFromPathAsync(fileName).then( - function (storageFile) { - Windows.Storage.FileIO.readBufferAsync(storageFile).done( - function (buffer) { - var strBase64 = Windows.Security.Cryptography.CryptographicBuffer.encodeToBase64String(buffer); - //the method encodeToBase64String will add "77u/" as a prefix, so we should remove it - if(String(strBase64).substr(0,4) == "77u/") { - strBase64 = strBase64.substr(4); - } - var mediaType = storageFile.contentType; - var result = "data:" + mediaType + ";base64," + strBase64; - win(result); - } - ); - }, function () { - fail && fail(FileError.NOT_FOUND_ERR); - } - ); - }, - - getDirectory:function(win,fail,args) { - var fullPath = args[0]; - var path = args[1]; - var options = args[2]; - - var flag = ""; - if (options !== null) { - flag = new Flags(options.create, options.exclusive); - } else { - flag = new Flags(false, false); - } - - Windows.Storage.StorageFolder.getFolderFromPathAsync(fullPath).then( - function (storageFolder) { - if (flag.create === true && flag.exclusive === true) { - storageFolder.createFolderAsync(path, Windows.Storage.CreationCollisionOption.failIfExists).done( - function (storageFolder) { - win(new DirectoryEntry(storageFolder.name, storageFolder.path)); - }, function () { - fail && fail(FileError.PATH_EXISTS_ERR); - } - ); - } else if (flag.create === true && flag.exclusive === false) { - storageFolder.createFolderAsync(path, Windows.Storage.CreationCollisionOption.openIfExists).done( - function (storageFolder) { - win(new DirectoryEntry(storageFolder.name, storageFolder.path)); - }, function () { - fail && fail(FileError.INVALID_MODIFICATION_ERR); - } - ); - } else if (flag.create === false) { - if (/\?|\\|\*|\||\"|<|>|\:|\//g.test(path)) { - fail && fail(FileError.ENCODING_ERR); - return; - } - - storageFolder.getFolderAsync(path).done( - function (storageFolder) { - win(new DirectoryEntry(storageFolder.name, storageFolder.path)); - }, function () { - fail && fail(FileError.NOT_FOUND_ERR); - } - ); - } - }, function () { - fail && fail(FileError.NOT_FOUND_ERR); - } - ); - }, - - remove:function(win,fail,args) { - var fullPath = args[0]; - - Windows.Storage.StorageFile.getFileFromPathAsync(fullPath).then( - function (sFile) { - Windows.Storage.StorageFile.getFileFromPathAsync(fullPath).done(function (storageFile) { - storageFile.deleteAsync().done(win, function () { - fail && fail(FileError.INVALID_MODIFICATION_ERR); - - }); - }); - }, - function () { - Windows.Storage.StorageFolder.getFolderFromPathAsync(fullPath).then( - function (sFolder) { - var removeEntry = function () { - var storageFolderTop = null; - - Windows.Storage.StorageFolder.getFolderFromPathAsync(fullPath).then( - function (storageFolder) { - // FileSystem root can't be removed! - var storageFolderPer = Windows.Storage.ApplicationData.current.localFolder; - var storageFolderTem = Windows.Storage.ApplicationData.current.temporaryFolder; - if (fullPath == storageFolderPer.path || fullPath == storageFolderTem.path) { - fail && fail(FileError.NO_MODIFICATION_ALLOWED_ERR); - return; - } - storageFolderTop = storageFolder; - return storageFolder.createFileQuery().getFilesAsync(); - }, function () { - fail && fail(FileError.INVALID_MODIFICATION_ERR); - - } - // check sub-files. - ).then(function (fileList) { - if (fileList) { - if (fileList.length === 0) { - return storageFolderTop.createFolderQuery().getFoldersAsync(); - } else { - fail && fail(FileError.INVALID_MODIFICATION_ERR); - } - } - // check sub-folders. - }).then(function (folderList) { - if (folderList) { - if (folderList.length === 0) { - storageFolderTop.deleteAsync().done(win, function () { - fail && fail(FileError.INVALID_MODIFICATION_ERR); - - }); - } else { - fail && fail(FileError.INVALID_MODIFICATION_ERR); - } - } - - }); - }; - removeEntry(); - }, function () { - fail && fail(FileError.NOT_FOUND_ERR); - } - ); - } - ); - }, - - removeRecursively:function(successCallback,fail,args) { - var fullPath = args[0]; - - Windows.Storage.StorageFolder.getFolderFromPathAsync(fullPath).done(function (storageFolder) { - var storageFolderPer = Windows.Storage.ApplicationData.current.localFolder; - var storageFolderTem = Windows.Storage.ApplicationData.current.temporaryFolder; - - if (storageFolder.path == storageFolderPer.path || storageFolder.path == storageFolderTem.path) { - fail && fail(FileError.NO_MODIFICATION_ALLOWED_ERR); - return; - } - - var removeFolders = function (path) { - return new WinJS.Promise(function (complete) { - var filePromiseArr = []; - var storageFolderTop = null; - Windows.Storage.StorageFolder.getFolderFromPathAsync(path).then( - function (storageFolder) { - var fileListPromise = storageFolder.createFileQuery().getFilesAsync(); - - storageFolderTop = storageFolder; - return fileListPromise; - } - // remove all the files directly under the folder. - ).then(function (fileList) { - if (fileList !== null) { - for (var i = 0; i < fileList.length; i++) { - var filePromise = fileList[i].deleteAsync(); - filePromiseArr.push(filePromise); - } - } - WinJS.Promise.join(filePromiseArr).then(function () { - var folderListPromise = storageFolderTop.createFolderQuery().getFoldersAsync(); - return folderListPromise; - // remove empty folders. - }).then(function (folderList) { - var folderPromiseArr = []; - if (folderList.length !== 0) { - for (var j = 0; j < folderList.length; j++) { - - folderPromiseArr.push(removeFolders(folderList[j].path)); - } - WinJS.Promise.join(folderPromiseArr).then(function () { - storageFolderTop.deleteAsync().then(complete); - }); - } else { - storageFolderTop.deleteAsync().then(complete); - } - }, function () { }); - }, function () { }); - }); - }; - removeFolders(storageFolder.path).then(function () { - Windows.Storage.StorageFolder.getFolderFromPathAsync(storageFolder.path).then( - function () {}, - function () { - if (typeof successCallback !== 'undefined' && successCallback !== null) { successCallback(); } - }); - }); - }); - }, - - getFile:function(win,fail,args) { - var fullPath = args[0]; - var path = args[1]; - var options = args[2]; - - var flag = ""; - if (options !== null) { - flag = new Flags(options.create, options.exclusive); - } else { - flag = new Flags(false, false); - } - - Windows.Storage.StorageFolder.getFolderFromPathAsync(fullPath).then( - function (storageFolder) { - if (flag.create === true && flag.exclusive === true) { - storageFolder.createFileAsync(path, Windows.Storage.CreationCollisionOption.failIfExists).done( - function (storageFile) { - win(new FileEntry(storageFile.name, storageFile.path)); - }, function () { - fail && fail(FileError.PATH_EXISTS_ERR); - } - ); - } else if (flag.create === true && flag.exclusive === false) { - storageFolder.createFileAsync(path, Windows.Storage.CreationCollisionOption.openIfExists).done( - function (storageFile) { - win(new FileEntry(storageFile.name, storageFile.path)); - }, function () { - fail && fail(FileError.INVALID_MODIFICATION_ERR); - } - ); - } else if (flag.create === false) { - if (/\?|\\|\*|\||\"|<|>|\:|\//g.test(path)) { - fail && fail(FileError.ENCODING_ERR); - return; - } - storageFolder.getFileAsync(path).done( - function (storageFile) { - win(new FileEntry(storageFile.name, storageFile.path)); - }, function () { - fail && fail(FileError.NOT_FOUND_ERR); - } - ); - } - }, function () { - fail && fail(FileError.NOT_FOUND_ERR); - } - ); - }, - - readEntries:function(win,fail,args) { // ["fullPath"] - var path = args[0]; - - var result = []; - - Windows.Storage.StorageFolder.getFolderFromPathAsync(path).then(function (storageFolder) { - var promiseArr = []; - var index = 0; - promiseArr[index++] = storageFolder.createFileQuery().getFilesAsync().then(function (fileList) { - if (fileList !== null) { - for (var i = 0; i < fileList.length; i++) { - result.push(new FileEntry(fileList[i].name, fileList[i].path)); - } - } - }); - promiseArr[index++] = storageFolder.createFolderQuery().getFoldersAsync().then(function (folderList) { - if (folderList !== null) { - for (var j = 0; j < folderList.length; j++) { - result.push(new FileEntry(folderList[j].name, folderList[j].path)); - } - } - }); - WinJS.Promise.join(promiseArr).then(function () { - win(result); - }); - - }, function () { fail && fail(FileError.NOT_FOUND_ERR); }); - }, - - write:function(win,fail,args) { - var fileName = args[0]; - var text = args[1]; - var position = args[2]; - - Windows.Storage.StorageFile.getFileFromPathAsync(fileName).done( - function (storageFile) { - Windows.Storage.FileIO.writeTextAsync(storageFile,text,Windows.Storage.Streams.UnicodeEncoding.utf8).done( - function() { - win(String(text).length); - }, function () { - fail && fail(FileError.INVALID_MODIFICATION_ERR); - } - ); - }, function() { - fail && fail(FileError.NOT_FOUND_ERR); - } - ); - }, - - truncate:function(win,fail,args) { // ["fileName","size"] - var fileName = args[0]; - var size = args[1]; - - Windows.Storage.StorageFile.getFileFromPathAsync(fileName).done(function(storageFile){ - //the current length of the file. - var leng = 0; - - storageFile.getBasicPropertiesAsync().then(function (basicProperties) { - leng = basicProperties.size; - if (Number(size) >= leng) { - win(this.length); - return; - } - if (Number(size) >= 0) { - Windows.Storage.FileIO.readTextAsync(storageFile, Windows.Storage.Streams.UnicodeEncoding.utf8).then(function (fileContent) { - fileContent = fileContent.substr(0, size); - var fullPath = storageFile.path; - var name = storageFile.name; - var entry = new Entry(true, false, name, fullPath); - var parentPath = ""; - var successCallBack = function (entry) { - parentPath = entry.fullPath; - storageFile.deleteAsync().then(function () { - return Windows.Storage.StorageFolder.getFolderFromPathAsync(parentPath); - }).then(function (storageFolder) { - storageFolder.createFileAsync(name).then(function (newStorageFile) { - Windows.Storage.FileIO.writeTextAsync(newStorageFile, fileContent).done(function () { - win(String(fileContent).length); - }, function () { - fail && fail(FileError.NO_MODIFICATION_ALLOWED_ERR); - }); - }); - }); - }; - entry.getParent(successCallBack, null); - }, function () { fail && fail(FileError.NOT_FOUND_ERR); }); - } - }); - }, function () { fail && fail(FileError.NOT_FOUND_ERR); }); - }, - - copyTo:function(success,fail,args) { // ["fullPath","parent", "newName"] - var srcPath = args[0]; - var parentFullPath = args[1]; - var name = args[2]; - - //name can't be invalid - if (/\?|\\|\*|\||\"|<|>|\:|\//g.test(name)) { - fail && fail(FileError.ENCODING_ERR); - return; - } - // copy - var copyFiles = ""; - Windows.Storage.StorageFile.getFileFromPathAsync(srcPath).then( - function (sFile) { - copyFiles = function (srcPath, parentPath) { - var storageFileTop = null; - Windows.Storage.StorageFile.getFileFromPathAsync(srcPath).then(function (storageFile) { - storageFileTop = storageFile; - return Windows.Storage.StorageFolder.getFolderFromPathAsync(parentPath); - }, function () { - - fail && fail(FileError.NOT_FOUND_ERR); - }).then(function (storageFolder) { - storageFileTop.copyAsync(storageFolder, name, Windows.Storage.NameCollisionOption.failIfExists).then(function (storageFile) { - - success(new FileEntry(storageFile.name, storageFile.path)); - }, function () { - - fail && fail(FileError.INVALID_MODIFICATION_ERR); - }); - }, function () { - - fail && fail(FileError.NOT_FOUND_ERR); - }); - }; - var copyFinish = function (srcPath, parentPath) { - copyFiles(srcPath, parentPath); - }; - copyFinish(srcPath, parentFullPath); - }, - function () { - Windows.Storage.StorageFolder.getFolderFromPathAsync(srcPath).then( - function (sFolder) { - copyFiles = function (srcPath, parentPath) { - var coreCopy = function (storageFolderTop, complete) { - storageFolderTop.createFolderQuery().getFoldersAsync().then(function (folderList) { - var folderPromiseArr = []; - if (folderList.length === 0) { complete(); } - else { - Windows.Storage.StorageFolder.getFolderFromPathAsync(parentPath).then(function (storageFolderTarget) { - var tempPromiseArr = []; - var index = 0; - for (var j = 0; j < folderList.length; j++) { - tempPromiseArr[index++] = storageFolderTarget.createFolderAsync(folderList[j].name).then(function (targetFolder) { - folderPromiseArr.push(copyFiles(folderList[j].path, targetFolder.path)); - }); - } - WinJS.Promise.join(tempPromiseArr).then(function () { - WinJS.Promise.join(folderPromiseArr).then(complete); - }); - }); - } - }); - }; - - return new WinJS.Promise(function (complete) { - var storageFolderTop = null; - var filePromiseArr = []; - var fileListTop = null; - Windows.Storage.StorageFolder.getFolderFromPathAsync(srcPath).then(function (storageFolder) { - storageFolderTop = storageFolder; - return storageFolder.createFileQuery().getFilesAsync(); - }).then(function (fileList) { - fileListTop = fileList; - if (fileList) { - return Windows.Storage.StorageFolder.getFolderFromPathAsync(parentPath); - } - }).then(function (targetStorageFolder) { - for (var i = 0; i < fileListTop.length; i++) { - filePromiseArr.push(fileListTop[i].copyAsync(targetStorageFolder)); - } - WinJS.Promise.join(filePromiseArr).then(function () { - coreCopy(storageFolderTop, complete); - }); - }); - }); - }; - var copyFinish = function (srcPath, parentPath) { - Windows.Storage.StorageFolder.getFolderFromPathAsync(parentPath).then(function (storageFolder) { - storageFolder.createFolderAsync(name, Windows.Storage.CreationCollisionOption.openIfExists).then(function (newStorageFolder) { - //can't copy onto itself - if (srcPath == newStorageFolder.path) { - fail && fail(FileError.INVALID_MODIFICATION_ERR); - return; - } - //can't copy into itself - if (srcPath == parentPath) { - fail && fail(FileError.INVALID_MODIFICATION_ERR); - return; - } - copyFiles(srcPath, newStorageFolder.path).then(function () { - Windows.Storage.StorageFolder.getFolderFromPathAsync(newStorageFolder.path).done( - function (storageFolder) { - success(new DirectoryEntry(storageFolder.name, storageFolder.path)); - }, - function () { fail && fail(FileError.NOT_FOUND_ERR); } - ); - }); - }, function () { fail && fail(FileError.INVALID_MODIFICATION_ERR); }); - }, function () { fail && fail(FileError.INVALID_MODIFICATION_ERR); }); - }; - copyFinish(srcPath, parentFullPath); - }, function () { - fail && fail(FileError.NOT_FOUND_ERR); - } - ); - } - ); - }, - - moveTo:function(success,fail,args) { - var srcPath = args[0]; - var parentFullPath = args[1]; - var name = args[2]; - - - //name can't be invalid - if (/\?|\\|\*|\||\"|<|>|\:|\//g.test(name)) { - fail && fail(FileError.ENCODING_ERR); - return; - } - - var moveFiles = ""; - Windows.Storage.StorageFile.getFileFromPathAsync(srcPath).then( - function (sFile) { - moveFiles = function (srcPath, parentPath) { - var storageFileTop = null; - Windows.Storage.StorageFile.getFileFromPathAsync(srcPath).then(function (storageFile) { - storageFileTop = storageFile; - return Windows.Storage.StorageFolder.getFolderFromPathAsync(parentPath); - }, function () { - fail && fail(FileError.NOT_FOUND_ERR); - }).then(function (storageFolder) { - storageFileTop.moveAsync(storageFolder, name, Windows.Storage.NameCollisionOption.replaceExisting).then(function () { - success(new FileEntry(name, storageFileTop.path)); - }, function () { - fail && fail(FileError.INVALID_MODIFICATION_ERR); - }); - }, function () { - fail && fail(FileError.NOT_FOUND_ERR); - }); - }; - var moveFinish = function (srcPath, parentPath) { - //can't copy onto itself - if (srcPath == parentPath + "\\" + name) { - fail && fail(FileError.INVALID_MODIFICATION_ERR); - return; - } - moveFiles(srcPath, parentFullPath); - }; - moveFinish(srcPath, parentFullPath); - }, - function () { - Windows.Storage.StorageFolder.getFolderFromPathAsync(srcPath).then( - function (sFolder) { - moveFiles = function (srcPath, parentPath) { - var coreMove = function (storageFolderTop, complete) { - storageFolderTop.createFolderQuery().getFoldersAsync().then(function (folderList) { - var folderPromiseArr = []; - if (folderList.length === 0) { - // If failed, we must cancel the deletion of folders & files.So here wo can't delete the folder. - complete(); - } - else { - Windows.Storage.StorageFolder.getFolderFromPathAsync(parentPath).then(function (storageFolderTarget) { - var tempPromiseArr = []; - var index = 0; - for (var j = 0; j < folderList.length; j++) { - tempPromiseArr[index++] = storageFolderTarget.createFolderAsync(folderList[j].name).then(function (targetFolder) { - folderPromiseArr.push(moveFiles(folderList[j].path, targetFolder.path)); - }); - } - WinJS.Promise.join(tempPromiseArr).then(function () { - WinJS.Promise.join(folderPromiseArr).then(complete); - }); - }); - } - }); - }; - return new WinJS.Promise(function (complete) { - var storageFolderTop = null; - Windows.Storage.StorageFolder.getFolderFromPathAsync(srcPath).then(function (storageFolder) { - storageFolderTop = storageFolder; - return storageFolder.createFileQuery().getFilesAsync(); - }).then(function (fileList) { - var filePromiseArr = []; - Windows.Storage.StorageFolder.getFolderFromPathAsync(parentPath).then(function (dstStorageFolder) { - if (fileList) { - for (var i = 0; i < fileList.length; i++) { - filePromiseArr.push(fileList[i].moveAsync(dstStorageFolder)); - } - } - WinJS.Promise.join(filePromiseArr).then(function () { - coreMove(storageFolderTop, complete); - }, function () { }); - }); - }); - }); - }; - var moveFinish = function (srcPath, parentPath) { - var originFolderTop = null; - Windows.Storage.StorageFolder.getFolderFromPathAsync(srcPath).then(function (originFolder) { - originFolderTop = originFolder; - return Windows.Storage.StorageFolder.getFolderFromPathAsync(parentPath); - }, function () { - fail && fail(FileError.INVALID_MODIFICATION_ERR); - }).then(function (storageFolder) { - return storageFolder.createFolderAsync(name, Windows.Storage.CreationCollisionOption.openIfExists); - }, function () { - fail && fail(FileError.INVALID_MODIFICATION_ERR); - }).then(function (newStorageFolder) { - //can't move onto directory that is not empty - newStorageFolder.createFileQuery().getFilesAsync().then(function (fileList) { - newStorageFolder.createFolderQuery().getFoldersAsync().then(function (folderList) { - if (fileList.length !== 0 || folderList.length !== 0) { - fail && fail(FileError.INVALID_MODIFICATION_ERR); - return; - } - //can't copy onto itself - if (srcPath == newStorageFolder.path) { - fail && fail(FileError.INVALID_MODIFICATION_ERR); - return; - } - //can't copy into itself - if (srcPath == parentPath) { - fail && fail(FileError.INVALID_MODIFICATION_ERR); - return; - } - moveFiles(srcPath, newStorageFolder.path).then(function () { - var successCallback = function () { - success(new DirectoryEntry(name, newStorageFolder.path)); - }; - var temp = new DirectoryEntry(originFolderTop.name, originFolderTop.path).removeRecursively(successCallback, fail); - - }, function () { console.log("error!"); }); - }); - }); - }, function () { fail && fail(FileError.INVALID_MODIFICATION_ERR); }); - - }; - moveFinish(srcPath, parentFullPath); - }, function () { - fail && fail(FileError.NOT_FOUND_ERR); - } - ); - } - ); - }, - tempFileSystem:null, - - persistentFileSystem:null, - - requestFileSystem:function(win,fail,args) { - var type = args[0]; - var size = args[1]; - - var filePath = ""; - var result = null; - var fsTypeName = ""; - - switch (type) { - case LocalFileSystem.TEMPORARY: - filePath = Windows.Storage.ApplicationData.current.temporaryFolder.path; - fsTypeName = "temporary"; - break; - case LocalFileSystem.PERSISTENT: - filePath = Windows.Storage.ApplicationData.current.localFolder.path; - fsTypeName = "persistent"; - break; - } - - var MAX_SIZE = 10000000000; - if (size > MAX_SIZE) { - fail && fail(FileError.QUOTA_EXCEEDED_ERR); - return; - } - - var fileSystem = new FileSystem(fsTypeName, new DirectoryEntry(fsTypeName, filePath)); - result = fileSystem; - win(result); - }, - - resolveLocalFileSystemURI:function(success,fail,args) { - var uri = args[0]; - - var path = uri; - - // support for file name with parameters - if (/\?/g.test(path)) { - path = String(path).split("?")[0]; - } - - // support for encodeURI - if (/\%5/g.test(path)) { - path = decodeURI(path); - } - - // support for special path start with file:/// - if (path.substr(0, 8) == "file:///") { - path = Windows.Storage.ApplicationData.current.localFolder.path + "\\" + String(path).substr(8).split("/").join("\\"); - Windows.Storage.StorageFile.getFileFromPathAsync(path).then( - function (storageFile) { - success(new FileEntry(storageFile.name, storageFile.path)); - }, function () { - Windows.Storage.StorageFolder.getFolderFromPathAsync(path).then( - function (storageFolder) { - success(new DirectoryEntry(storageFolder.name, storageFolder.path)); - }, function () { - fail && fail(FileError.NOT_FOUND_ERR); - } - ); - } - ); - } else { - Windows.Storage.StorageFile.getFileFromPathAsync(path).then( - function (storageFile) { - success(new FileEntry(storageFile.name, storageFile.path)); - }, function () { - Windows.Storage.StorageFolder.getFolderFromPathAsync(path).then( - function (storageFolder) { - success(new DirectoryEntry(storageFolder.name, storageFolder.path)); - }, function () { - fail && fail(FileError.ENCODING_ERR); - } - ); - } - ); - } - } - -}; - -require("cordova/commandProxy").add("File",module.exports); diff --git a/plugins/org.apache.cordova.core.file/src/wp/File.cs b/plugins/org.apache.cordova.core.file/src/wp/File.cs deleted file mode 100644 index b0534f0..0000000 --- a/plugins/org.apache.cordova.core.file/src/wp/File.cs +++ /dev/null @@ -1,1676 +0,0 @@ -/* - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -using System; -using System.Collections.Generic; -using System.Diagnostics; -using System.IO; -using System.IO.IsolatedStorage; -using System.Runtime.Serialization; -using System.Security; -using System.Text; -using System.Windows; -using System.Windows.Resources; - -namespace WPCordovaClassLib.Cordova.Commands -{ - /// - /// Provides access to isolated storage - /// - public class File : BaseCommand - { - // Error codes - public const int NOT_FOUND_ERR = 1; - public const int SECURITY_ERR = 2; - public const int ABORT_ERR = 3; - public const int NOT_READABLE_ERR = 4; - public const int ENCODING_ERR = 5; - public const int NO_MODIFICATION_ALLOWED_ERR = 6; - public const int INVALID_STATE_ERR = 7; - public const int SYNTAX_ERR = 8; - public const int INVALID_MODIFICATION_ERR = 9; - public const int QUOTA_EXCEEDED_ERR = 10; - public const int TYPE_MISMATCH_ERR = 11; - public const int PATH_EXISTS_ERR = 12; - - // File system options - public const int TEMPORARY = 0; - public const int PERSISTENT = 1; - public const int RESOURCE = 2; - public const int APPLICATION = 3; - - /// - /// Temporary directory name - /// - private readonly string TMP_DIRECTORY_NAME = "tmp"; - - /// - /// Represents error code for callback - /// - [DataContract] - public class ErrorCode - { - /// - /// Error code - /// - [DataMember(IsRequired = true, Name = "code")] - public int Code { get; set; } - - /// - /// Creates ErrorCode object - /// - public ErrorCode(int code) - { - this.Code = code; - } - } - - /// - /// Represents File action options. - /// - [DataContract] - public class FileOptions - { - /// - /// File path - /// - /// - private string _fileName; - [DataMember(Name = "fileName")] - public string FilePath - { - get - { - return this._fileName; - } - - set - { - int index = value.IndexOfAny(new char[] { '#', '?' }); - this._fileName = index > -1 ? value.Substring(0, index) : value; - } - } - - /// - /// Full entryPath - /// - [DataMember(Name = "fullPath")] - public string FullPath { get; set; } - - /// - /// Directory name - /// - [DataMember(Name = "dirName")] - public string DirectoryName { get; set; } - - /// - /// Path to create file/directory - /// - [DataMember(Name = "path")] - public string Path { get; set; } - - /// - /// The encoding to use to encode the file's content. Default is UTF8. - /// - [DataMember(Name = "encoding")] - public string Encoding { get; set; } - - /// - /// Uri to get file - /// - /// - private string _uri; - [DataMember(Name = "uri")] - public string Uri - { - get - { - return this._uri; - } - - set - { - int index = value.IndexOfAny(new char[] { '#', '?' }); - this._uri = index > -1 ? value.Substring(0, index) : value; - } - } - - /// - /// Size to truncate file - /// - [DataMember(Name = "size")] - public long Size { get; set; } - - /// - /// Data to write in file - /// - [DataMember(Name = "data")] - public string Data { get; set; } - - /// - /// Position the writing starts with - /// - [DataMember(Name = "position")] - public int Position { get; set; } - - /// - /// Type of file system requested - /// - [DataMember(Name = "type")] - public int FileSystemType { get; set; } - - /// - /// New file/directory name - /// - [DataMember(Name = "newName")] - public string NewName { get; set; } - - /// - /// Destination directory to copy/move file/directory - /// - [DataMember(Name = "parent")] - public string Parent { get; set; } - - /// - /// Options for getFile/getDirectory methods - /// - [DataMember(Name = "options")] - public CreatingOptions CreatingOpt { get; set; } - - /// - /// Creates options object with default parameters - /// - public FileOptions() - { - this.SetDefaultValues(new StreamingContext()); - } - - /// - /// Initializes default values for class fields. - /// Implemented in separate method because default constructor is not invoked during deserialization. - /// - /// - [OnDeserializing()] - public void SetDefaultValues(StreamingContext context) - { - this.Encoding = "UTF-8"; - this.FilePath = ""; - this.FileSystemType = -1; - } - } - - /// - /// Stores image info - /// - [DataContract] - public class FileMetadata - { - [DataMember(Name = "fileName")] - public string FileName { get; set; } - - [DataMember(Name = "fullPath")] - public string FullPath { get; set; } - - [DataMember(Name = "type")] - public string Type { get; set; } - - [DataMember(Name = "lastModifiedDate")] - public string LastModifiedDate { get; set; } - - [DataMember(Name = "size")] - public long Size { get; set; } - - public FileMetadata(string filePath) - { - using (IsolatedStorageFile isoFile = IsolatedStorageFile.GetUserStoreForApplication()) - { - if (string.IsNullOrEmpty(filePath)) - { - throw new FileNotFoundException("File doesn't exist"); - } - else if (!isoFile.FileExists(filePath)) - { - // attempt to get it from the resources - if (filePath.IndexOf("www") == 0) - { - Uri fileUri = new Uri(filePath, UriKind.Relative); - StreamResourceInfo streamInfo = Application.GetResourceStream(fileUri); - if (streamInfo != null) - { - this.Size = streamInfo.Stream.Length; - this.FileName = filePath.Substring(filePath.LastIndexOf("/") + 1); - this.FullPath = filePath; - } - } - else - { - throw new FileNotFoundException("File doesn't exist"); - } - } - else - { - //TODO get file size the other way if possible - using (IsolatedStorageFileStream stream = new IsolatedStorageFileStream(filePath, FileMode.Open, FileAccess.Read, isoFile)) - { - this.Size = stream.Length; - } - this.FullPath = filePath; - this.FileName = System.IO.Path.GetFileName(filePath); - this.LastModifiedDate = isoFile.GetLastWriteTime(filePath).DateTime.ToString(); - } - this.Type = MimeTypeMapper.GetMimeType(this.FileName); - } - } - } - - /// - /// Represents file or directory modification metadata - /// - [DataContract] - public class ModificationMetadata - { - /// - /// Modification time - /// - [DataMember] - public string modificationTime { get; set; } - } - - /// - /// Represents file or directory entry - /// - [DataContract] - public class FileEntry - { - - /// - /// File type - /// - [DataMember(Name = "isFile")] - public bool IsFile { get; set; } - - /// - /// Directory type - /// - [DataMember(Name = "isDirectory")] - public bool IsDirectory { get; set; } - - /// - /// File/directory name - /// - [DataMember(Name = "name")] - public string Name { get; set; } - - /// - /// Full path to file/directory - /// - [DataMember(Name = "fullPath")] - public string FullPath { get; set; } - - public bool IsResource { get; set; } - - public static FileEntry GetEntry(string filePath, bool bIsRes=false) - { - FileEntry entry = null; - try - { - entry = new FileEntry(filePath, bIsRes); - - } - catch (Exception ex) - { - Debug.WriteLine("Exception in GetEntry for filePath :: " + filePath + " " + ex.Message); - } - return entry; - } - - /// - /// Creates object and sets necessary properties - /// - /// - public FileEntry(string filePath, bool bIsRes = false) - { - if (string.IsNullOrEmpty(filePath)) - { - throw new ArgumentException(); - } - - if(filePath.Contains(" ")) - { - Debug.WriteLine("FilePath with spaces :: " + filePath); - } - - using (IsolatedStorageFile isoFile = IsolatedStorageFile.GetUserStoreForApplication()) - { - IsResource = bIsRes; - IsFile = isoFile.FileExists(filePath); - IsDirectory = isoFile.DirectoryExists(filePath); - if (IsFile) - { - this.Name = Path.GetFileName(filePath); - } - else if (IsDirectory) - { - this.Name = this.GetDirectoryName(filePath); - if (string.IsNullOrEmpty(Name)) - { - this.Name = "/"; - } - } - else - { - if (IsResource) - { - this.Name = Path.GetFileName(filePath); - } - else - { - throw new FileNotFoundException(); - } - } - - try - { - this.FullPath = filePath.Replace('\\', '/'); // new Uri(filePath).LocalPath; - } - catch (Exception) - { - this.FullPath = filePath; - } - } - } - - /// - /// Extracts directory name from path string - /// Path should refer to a directory, for example \foo\ or /foo. - /// - /// - /// - private string GetDirectoryName(string path) - { - if (String.IsNullOrEmpty(path)) - { - return path; - } - - string[] split = path.Split(new char[] { '/', '\\' }, StringSplitOptions.RemoveEmptyEntries); - if (split.Length < 1) - { - return null; - } - else - { - return split[split.Length - 1]; - } - } - } - - - /// - /// Represents info about requested file system - /// - [DataContract] - public class FileSystemInfo - { - /// - /// file system type - /// - [DataMember(Name = "name", IsRequired = true)] - public string Name { get; set; } - - /// - /// Root directory entry - /// - [DataMember(Name = "root", EmitDefaultValue = false)] - public FileEntry Root { get; set; } - - /// - /// Creates class instance - /// - /// - /// Root directory - public FileSystemInfo(string name, FileEntry rootEntry = null) - { - Name = name; - Root = rootEntry; - } - } - - [DataContract] - public class CreatingOptions - { - /// - /// Create file/directory if is doesn't exist - /// - [DataMember(Name = "create")] - public bool Create { get; set; } - - /// - /// Generate an exception if create=true and file/directory already exists - /// - [DataMember(Name = "exclusive")] - public bool Exclusive { get; set; } - - - } - - // returns null value if it fails. - private string[] getOptionStrings(string options) - { - string[] optStings = null; - try - { - optStings = JSON.JsonHelper.Deserialize(options); - } - catch (Exception) - { - DispatchCommandResult(new PluginResult(PluginResult.Status.JSON_EXCEPTION), CurrentCommandCallbackId); - } - return optStings; - } - - /// - /// Gets amount of free space available for Isolated Storage - /// - /// No options is needed for this method - public void getFreeDiskSpace(string options) - { - string callbackId = getOptionStrings(options)[0]; - - try - { - using (IsolatedStorageFile isoFile = IsolatedStorageFile.GetUserStoreForApplication()) - { - DispatchCommandResult(new PluginResult(PluginResult.Status.OK, isoFile.AvailableFreeSpace), callbackId); - } - } - catch (IsolatedStorageException) - { - DispatchCommandResult(new PluginResult(PluginResult.Status.ERROR, NOT_READABLE_ERR), callbackId); - } - catch (Exception ex) - { - if (!this.HandleException(ex)) - { - DispatchCommandResult(new PluginResult(PluginResult.Status.ERROR, NOT_READABLE_ERR), callbackId); - } - } - } - - /// - /// Check if file exists - /// - /// File path - public void testFileExists(string options) - { - IsDirectoryOrFileExist(options, false); - } - - /// - /// Check if directory exists - /// - /// directory name - public void testDirectoryExists(string options) - { - IsDirectoryOrFileExist(options, true); - } - - /// - /// Check if file or directory exist - /// - /// File path/Directory name - /// Flag to recognize what we should check - public void IsDirectoryOrFileExist(string options, bool isDirectory) - { - string[] args = getOptionStrings(options); - string callbackId = args[1]; - FileOptions fileOptions = JSON.JsonHelper.Deserialize(args[0]); - string filePath = args[0]; - - if (fileOptions == null) - { - DispatchCommandResult(new PluginResult(PluginResult.Status.JSON_EXCEPTION), callbackId); - } - - try - { - using (IsolatedStorageFile isoFile = IsolatedStorageFile.GetUserStoreForApplication()) - { - bool isExist; - if (isDirectory) - { - isExist = isoFile.DirectoryExists(fileOptions.DirectoryName); - } - else - { - isExist = isoFile.FileExists(fileOptions.FilePath); - } - DispatchCommandResult(new PluginResult(PluginResult.Status.OK, isExist), callbackId); - } - } - catch (IsolatedStorageException) // default handler throws INVALID_MODIFICATION_ERR - { - DispatchCommandResult(new PluginResult(PluginResult.Status.ERROR, NOT_READABLE_ERR), callbackId); - } - catch (Exception ex) - { - if (!this.HandleException(ex)) - { - DispatchCommandResult(new PluginResult(PluginResult.Status.ERROR, NOT_FOUND_ERR), callbackId); - } - } - - } - - public void readAsDataURL(string options) - { - string[] optStrings = getOptionStrings(options); - string filePath = optStrings[0]; - int startPos = int.Parse(optStrings[1]); - int endPos = int.Parse(optStrings[2]); - string callbackId = optStrings[3]; - - if (filePath != null) - { - try - { - string base64URL = null; - - using (IsolatedStorageFile isoFile = IsolatedStorageFile.GetUserStoreForApplication()) - { - if (!isoFile.FileExists(filePath)) - { - DispatchCommandResult(new PluginResult(PluginResult.Status.ERROR, NOT_FOUND_ERR), callbackId); - return; - } - string mimeType = MimeTypeMapper.GetMimeType(filePath); - - using (IsolatedStorageFileStream stream = isoFile.OpenFile(filePath, FileMode.Open, FileAccess.Read)) - { - string base64String = GetFileContent(stream); - base64URL = "data:" + mimeType + ";base64," + base64String; - } - } - - DispatchCommandResult(new PluginResult(PluginResult.Status.OK, base64URL), callbackId); - } - catch (Exception ex) - { - if (!this.HandleException(ex)) - { - DispatchCommandResult(new PluginResult(PluginResult.Status.ERROR, NOT_READABLE_ERR), callbackId); - } - } - } - } - - public void readAsArrayBuffer(string options) - { - string[] optStrings = getOptionStrings(options); - string filePath = optStrings[0]; - int startPos = int.Parse(optStrings[1]); - int endPos = int.Parse(optStrings[2]); - string callbackId = optStrings[3]; - DispatchCommandResult(new PluginResult(PluginResult.Status.ERROR), callbackId); - } - - public void readAsBinaryString(string options) - { - string[] optStrings = getOptionStrings(options); - string filePath = optStrings[0]; - int startPos = int.Parse(optStrings[1]); - int endPos = int.Parse(optStrings[2]); - string callbackId = optStrings[3]; - DispatchCommandResult(new PluginResult(PluginResult.Status.ERROR), callbackId); - } - - public void readAsText(string options) - { - string[] optStrings = getOptionStrings(options); - string filePath = optStrings[0]; - string encStr = optStrings[1]; - int startPos = int.Parse(optStrings[2]); - int endPos = int.Parse(optStrings[3]); - string callbackId = optStrings[4]; - - try - { - string text = ""; - - using (IsolatedStorageFile isoFile = IsolatedStorageFile.GetUserStoreForApplication()) - { - if (!isoFile.FileExists(filePath)) - { - readResourceAsText(options); - return; - } - Encoding encoding = Encoding.GetEncoding(encStr); - - using (TextReader reader = new StreamReader(isoFile.OpenFile(filePath, FileMode.Open, FileAccess.Read), encoding)) - { - text = reader.ReadToEnd(); - if (startPos < 0) - { - startPos = Math.Max(text.Length + startPos, 0); - } - else if (startPos > 0) - { - startPos = Math.Min(text.Length, startPos); - } - - if (endPos > 0) - { - endPos = Math.Min(text.Length, endPos); - } - else if (endPos < 0) - { - endPos = Math.Max(endPos + text.Length, 0); - } - - - text = text.Substring(startPos, endPos - startPos); - - } - } - - DispatchCommandResult(new PluginResult(PluginResult.Status.OK, text), callbackId); - } - catch (Exception ex) - { - if (!this.HandleException(ex, callbackId)) - { - DispatchCommandResult(new PluginResult(PluginResult.Status.ERROR, NOT_READABLE_ERR), callbackId); - } - } - } - - /// - /// Reads application resource as a text - /// - /// Path to a resource - public void readResourceAsText(string options) - { - string[] optStrings = getOptionStrings(options); - string pathToResource = optStrings[0]; - string encStr = optStrings[1]; - int start = int.Parse(optStrings[2]); - int endMarker = int.Parse(optStrings[3]); - string callbackId = optStrings[4]; - - try - { - if (pathToResource.StartsWith("/")) - { - pathToResource = pathToResource.Remove(0, 1); - } - - var resource = Application.GetResourceStream(new Uri(pathToResource, UriKind.Relative)); - - if (resource == null) - { - DispatchCommandResult(new PluginResult(PluginResult.Status.ERROR, NOT_FOUND_ERR), callbackId); - return; - } - - string text; - StreamReader streamReader = new StreamReader(resource.Stream); - text = streamReader.ReadToEnd(); - - DispatchCommandResult(new PluginResult(PluginResult.Status.OK, text), callbackId); - } - catch (Exception ex) - { - if (!this.HandleException(ex, callbackId)) - { - DispatchCommandResult(new PluginResult(PluginResult.Status.ERROR, NOT_READABLE_ERR), callbackId); - } - } - } - - public void truncate(string options) - { - string[] optStrings = getOptionStrings(options); - - string filePath = optStrings[0]; - int size = int.Parse(optStrings[1]); - string callbackId = optStrings[2]; - - try - { - long streamLength = 0; - - using (IsolatedStorageFile isoFile = IsolatedStorageFile.GetUserStoreForApplication()) - { - if (!isoFile.FileExists(filePath)) - { - DispatchCommandResult(new PluginResult(PluginResult.Status.ERROR, NOT_FOUND_ERR), callbackId); - return; - } - - using (FileStream stream = new IsolatedStorageFileStream(filePath, FileMode.Open, FileAccess.ReadWrite, isoFile)) - { - if (0 <= size && size <= stream.Length) - { - stream.SetLength(size); - } - streamLength = stream.Length; - } - } - - DispatchCommandResult(new PluginResult(PluginResult.Status.OK, streamLength), callbackId); - } - catch (Exception ex) - { - if (!this.HandleException(ex, callbackId)) - { - DispatchCommandResult(new PluginResult(PluginResult.Status.ERROR, NOT_READABLE_ERR), callbackId); - } - } - } - - //write:[filePath,data,position,isBinary,callbackId] - public void write(string options) - { - string[] optStrings = getOptionStrings(options); - - string filePath = optStrings[0]; - string data = optStrings[1]; - int position = int.Parse(optStrings[2]); - bool isBinary = bool.Parse(optStrings[3]); - string callbackId = optStrings[4]; - - try - { - if (string.IsNullOrEmpty(data)) - { - Debug.WriteLine("Expected some data to be send in the write command to {0}", filePath); - DispatchCommandResult(new PluginResult(PluginResult.Status.JSON_EXCEPTION), callbackId); - return; - } - - using (IsolatedStorageFile isoFile = IsolatedStorageFile.GetUserStoreForApplication()) - { - // create the file if not exists - if (!isoFile.FileExists(filePath)) - { - var file = isoFile.CreateFile(filePath); - file.Close(); - } - - using (FileStream stream = new IsolatedStorageFileStream(filePath, FileMode.Open, FileAccess.ReadWrite, isoFile)) - { - if (0 <= position && position <= stream.Length) - { - stream.SetLength(position); - } - using (BinaryWriter writer = new BinaryWriter(stream)) - { - writer.Seek(0, SeekOrigin.End); - writer.Write(data.ToCharArray()); - } - } - } - - DispatchCommandResult(new PluginResult(PluginResult.Status.OK, data.Length), callbackId); - } - catch (Exception ex) - { - if (!this.HandleException(ex, callbackId)) - { - DispatchCommandResult(new PluginResult(PluginResult.Status.ERROR, NOT_READABLE_ERR), callbackId); - } - } - } - - /// - /// Look up metadata about this entry. - /// - /// filePath to entry - public void getMetadata(string options) - { - string[] optStings = getOptionStrings(options); - string filePath = optStings[0]; - string callbackId = optStings[1]; - - if (filePath != null) - { - try - { - using (IsolatedStorageFile isoFile = IsolatedStorageFile.GetUserStoreForApplication()) - { - if (isoFile.FileExists(filePath)) - { - DispatchCommandResult(new PluginResult(PluginResult.Status.OK, - new ModificationMetadata() { modificationTime = isoFile.GetLastWriteTime(filePath).DateTime.ToString() }), callbackId); - } - else if (isoFile.DirectoryExists(filePath)) - { - string modTime = isoFile.GetLastWriteTime(filePath).DateTime.ToString(); - DispatchCommandResult(new PluginResult(PluginResult.Status.OK, new ModificationMetadata() { modificationTime = modTime }), callbackId); - } - else - { - DispatchCommandResult(new PluginResult(PluginResult.Status.ERROR, NOT_FOUND_ERR), callbackId); - } - - } - } - catch (IsolatedStorageException) - { - DispatchCommandResult(new PluginResult(PluginResult.Status.ERROR, NOT_READABLE_ERR), callbackId); - } - catch (Exception ex) - { - if (!this.HandleException(ex)) - { - DispatchCommandResult(new PluginResult(PluginResult.Status.ERROR, NOT_READABLE_ERR), callbackId); - } - } - } - - } - - - /// - /// Returns a File that represents the current state of the file that this FileEntry represents. - /// - /// filePath to entry - /// - public void getFileMetadata(string options) - { - string[] optStings = getOptionStrings(options); - string filePath = optStings[0]; - string callbackId = optStings[1]; - - if (filePath != null) - { - try - { - FileMetadata metaData = new FileMetadata(filePath); - DispatchCommandResult(new PluginResult(PluginResult.Status.OK, metaData), callbackId); - } - catch (IsolatedStorageException) - { - DispatchCommandResult(new PluginResult(PluginResult.Status.ERROR, NOT_READABLE_ERR), callbackId); - } - catch (Exception ex) - { - if (!this.HandleException(ex)) - { - DispatchCommandResult(new PluginResult(PluginResult.Status.ERROR, NOT_READABLE_ERR), callbackId); - } - } - } - } - - /// - /// Look up the parent DirectoryEntry containing this Entry. - /// If this Entry is the root of IsolatedStorage, its parent is itself. - /// - /// - public void getParent(string options) - { - string[] optStings = getOptionStrings(options); - string filePath = optStings[0]; - string callbackId = optStings[1]; - - if (filePath != null) - { - try - { - if (string.IsNullOrEmpty(filePath)) - { - DispatchCommandResult(new PluginResult(PluginResult.Status.JSON_EXCEPTION),callbackId); - return; - } - - using (IsolatedStorageFile isoFile = IsolatedStorageFile.GetUserStoreForApplication()) - { - FileEntry entry; - - if (isoFile.FileExists(filePath) || isoFile.DirectoryExists(filePath)) - { - - - string path = this.GetParentDirectory(filePath); - entry = FileEntry.GetEntry(path); - DispatchCommandResult(new PluginResult(PluginResult.Status.OK, entry),callbackId); - } - else - { - DispatchCommandResult(new PluginResult(PluginResult.Status.ERROR, NOT_FOUND_ERR),callbackId); - } - - } - } - catch (Exception ex) - { - if (!this.HandleException(ex)) - { - DispatchCommandResult(new PluginResult(PluginResult.Status.ERROR, NOT_FOUND_ERR),callbackId); - } - } - } - } - - public void remove(string options) - { - string[] args = getOptionStrings(options); - string filePath = args[0]; - string callbackId = args[1]; - - if (filePath != null) - { - try - { - if (filePath == "/" || filePath == "" || filePath == @"\") - { - throw new Exception("Cannot delete root file system") ; - } - using (IsolatedStorageFile isoFile = IsolatedStorageFile.GetUserStoreForApplication()) - { - if (isoFile.FileExists(filePath)) - { - isoFile.DeleteFile(filePath); - } - else - { - if (isoFile.DirectoryExists(filePath)) - { - isoFile.DeleteDirectory(filePath); - } - else - { - DispatchCommandResult(new PluginResult(PluginResult.Status.ERROR, NOT_FOUND_ERR),callbackId); - return; - } - } - DispatchCommandResult(new PluginResult(PluginResult.Status.OK),callbackId); - } - } - catch (Exception ex) - { - if (!this.HandleException(ex)) - { - DispatchCommandResult(new PluginResult(PluginResult.Status.ERROR, NO_MODIFICATION_ALLOWED_ERR),callbackId); - } - } - } - } - - public void removeRecursively(string options) - { - string[] args = getOptionStrings(options); - string filePath = args[0]; - string callbackId = args[1]; - - if (filePath != null) - { - if (string.IsNullOrEmpty(filePath)) - { - DispatchCommandResult(new PluginResult(PluginResult.Status.JSON_EXCEPTION),callbackId); - } - else - { - if (removeDirRecursively(filePath, callbackId)) - { - DispatchCommandResult(new PluginResult(PluginResult.Status.OK), callbackId); - } - } - } - } - - public void readEntries(string options) - { - string[] args = getOptionStrings(options); - string filePath = args[0]; - string callbackId = args[1]; - - if (filePath != null) - { - try - { - if (string.IsNullOrEmpty(filePath)) - { - DispatchCommandResult(new PluginResult(PluginResult.Status.JSON_EXCEPTION),callbackId); - return; - } - - using (IsolatedStorageFile isoFile = IsolatedStorageFile.GetUserStoreForApplication()) - { - if (isoFile.DirectoryExists(filePath)) - { - string path = File.AddSlashToDirectory(filePath); - List entries = new List(); - string[] files = isoFile.GetFileNames(path + "*"); - string[] dirs = isoFile.GetDirectoryNames(path + "*"); - foreach (string file in files) - { - entries.Add(FileEntry.GetEntry(path + file)); - } - foreach (string dir in dirs) - { - entries.Add(FileEntry.GetEntry(path + dir + "/")); - } - DispatchCommandResult(new PluginResult(PluginResult.Status.OK, entries),callbackId); - } - else - { - DispatchCommandResult(new PluginResult(PluginResult.Status.ERROR, NOT_FOUND_ERR),callbackId); - } - } - } - catch (Exception ex) - { - if (!this.HandleException(ex)) - { - DispatchCommandResult(new PluginResult(PluginResult.Status.ERROR, NO_MODIFICATION_ALLOWED_ERR),callbackId); - } - } - } - } - - public void requestFileSystem(string options) - { - // TODO: try/catch - string[] optVals = getOptionStrings(options); - //FileOptions fileOptions = new FileOptions(); - int fileSystemType = int.Parse(optVals[0]); - double size = double.Parse(optVals[1]); - string callbackId = optVals[2]; - - - IsolatedStorageFile.GetUserStoreForApplication(); - - if (size > (10 * 1024 * 1024)) // 10 MB, compier will clean this up! - { - DispatchCommandResult(new PluginResult(PluginResult.Status.ERROR, QUOTA_EXCEEDED_ERR), callbackId); - return; - } - - try - { - if (size != 0) - { - using (IsolatedStorageFile isoFile = IsolatedStorageFile.GetUserStoreForApplication()) - { - long availableSize = isoFile.AvailableFreeSpace; - if (size > availableSize) - { - DispatchCommandResult(new PluginResult(PluginResult.Status.ERROR, QUOTA_EXCEEDED_ERR), callbackId); - return; - } - } - } - - if (fileSystemType == PERSISTENT) - { - // TODO: this should be in it's own folder to prevent overwriting of the app assets, which are also in ISO - DispatchCommandResult(new PluginResult(PluginResult.Status.OK, new FileSystemInfo("persistent", FileEntry.GetEntry("/"))), callbackId); - } - else if (fileSystemType == TEMPORARY) - { - using (IsolatedStorageFile isoStorage = IsolatedStorageFile.GetUserStoreForApplication()) - { - if (!isoStorage.FileExists(TMP_DIRECTORY_NAME)) - { - isoStorage.CreateDirectory(TMP_DIRECTORY_NAME); - } - } - - string tmpFolder = "/" + TMP_DIRECTORY_NAME + "/"; - - DispatchCommandResult(new PluginResult(PluginResult.Status.OK, new FileSystemInfo("temporary", FileEntry.GetEntry(tmpFolder))), callbackId); - } - else if (fileSystemType == RESOURCE) - { - DispatchCommandResult(new PluginResult(PluginResult.Status.OK, new FileSystemInfo("resource")), callbackId); - } - else if (fileSystemType == APPLICATION) - { - DispatchCommandResult(new PluginResult(PluginResult.Status.OK, new FileSystemInfo("application")), callbackId); - } - else - { - DispatchCommandResult(new PluginResult(PluginResult.Status.ERROR, NO_MODIFICATION_ALLOWED_ERR), callbackId); - } - - } - catch (Exception ex) - { - if (!this.HandleException(ex)) - { - DispatchCommandResult(new PluginResult(PluginResult.Status.ERROR, NO_MODIFICATION_ALLOWED_ERR), callbackId); - } - } - } - - public void resolveLocalFileSystemURI(string options) - { - - string[] optVals = getOptionStrings(options); - string uri = optVals[0].Split('?')[0]; - string callbackId = optVals[1]; - - if (uri != null) - { - // a single '/' is valid, however, '/someDir' is not, but '/tmp//somedir' and '///someDir' are valid - if (uri.StartsWith("/") && uri.IndexOf("//") < 0 && uri != "/") - { - DispatchCommandResult(new PluginResult(PluginResult.Status.ERROR, ENCODING_ERR), callbackId); - return; - } - try - { - // fix encoded spaces - string path = Uri.UnescapeDataString(uri); - - FileEntry uriEntry = FileEntry.GetEntry(path); - if (uriEntry != null) - { - DispatchCommandResult(new PluginResult(PluginResult.Status.OK, uriEntry), callbackId); - } - else - { - DispatchCommandResult(new PluginResult(PluginResult.Status.ERROR, NOT_FOUND_ERR), callbackId); - } - } - catch (Exception ex) - { - if (!this.HandleException(ex, callbackId)) - { - DispatchCommandResult(new PluginResult(PluginResult.Status.ERROR, NO_MODIFICATION_ALLOWED_ERR), callbackId); - } - } - } - } - - public void copyTo(string options) - { - TransferTo(options, false); - } - - public void moveTo(string options) - { - TransferTo(options, true); - } - - public void getFile(string options) - { - GetFileOrDirectory(options, false); - } - - public void getDirectory(string options) - { - GetFileOrDirectory(options, true); - } - - #region internal functionality - - /// - /// Retrieves the parent directory name of the specified path, - /// - /// Path - /// Parent directory name - private string GetParentDirectory(string path) - { - if (String.IsNullOrEmpty(path) || path == "/") - { - return "/"; - } - - if (path.EndsWith(@"/") || path.EndsWith(@"\")) - { - return this.GetParentDirectory(Path.GetDirectoryName(path)); - } - - string result = Path.GetDirectoryName(path); - if (result == null) - { - result = "/"; - } - - return result; - } - - private bool removeDirRecursively(string fullPath,string callbackId) - { - try - { - if (fullPath == "/") - { - DispatchCommandResult(new PluginResult(PluginResult.Status.ERROR, NO_MODIFICATION_ALLOWED_ERR),callbackId); - return false; - } - - using (IsolatedStorageFile isoFile = IsolatedStorageFile.GetUserStoreForApplication()) - { - if (isoFile.DirectoryExists(fullPath)) - { - string tempPath = File.AddSlashToDirectory(fullPath); - string[] files = isoFile.GetFileNames(tempPath + "*"); - if (files.Length > 0) - { - foreach (string file in files) - { - isoFile.DeleteFile(tempPath + file); - } - } - string[] dirs = isoFile.GetDirectoryNames(tempPath + "*"); - if (dirs.Length > 0) - { - foreach (string dir in dirs) - { - if (!removeDirRecursively(tempPath + dir, callbackId)) - { - return false; - } - } - } - isoFile.DeleteDirectory(fullPath); - } - else - { - DispatchCommandResult(new PluginResult(PluginResult.Status.ERROR, NOT_FOUND_ERR),callbackId); - } - } - } - catch (Exception ex) - { - if (!this.HandleException(ex)) - { - DispatchCommandResult(new PluginResult(PluginResult.Status.ERROR, NO_MODIFICATION_ALLOWED_ERR),callbackId); - return false; - } - } - return true; - } - - private bool CanonicalCompare(string pathA, string pathB) - { - string a = pathA.Replace("//", "/"); - string b = pathB.Replace("//", "/"); - - return a.Equals(b, StringComparison.OrdinalIgnoreCase); - } - - /* - * copyTo:["fullPath","parent", "newName"], - * moveTo:["fullPath","parent", "newName"], - */ - private void TransferTo(string options, bool move) - { - // TODO: try/catch - string[] optStrings = getOptionStrings(options); - string fullPath = optStrings[0]; - string parent = optStrings[1]; - string newFileName = optStrings[2]; - string callbackId = optStrings[3]; - - char[] invalids = Path.GetInvalidPathChars(); - - if (newFileName.IndexOfAny(invalids) > -1 || newFileName.IndexOf(":") > -1 ) - { - DispatchCommandResult(new PluginResult(PluginResult.Status.ERROR, ENCODING_ERR), callbackId); - return; - } - - try - { - if ((parent == null) || (string.IsNullOrEmpty(parent)) || (string.IsNullOrEmpty(fullPath))) - { - DispatchCommandResult(new PluginResult(PluginResult.Status.ERROR, NOT_FOUND_ERR), callbackId); - return; - } - - string parentPath = File.AddSlashToDirectory(parent); - string currentPath = fullPath; - - using (IsolatedStorageFile isoFile = IsolatedStorageFile.GetUserStoreForApplication()) - { - bool isFileExist = isoFile.FileExists(currentPath); - bool isDirectoryExist = isoFile.DirectoryExists(currentPath); - bool isParentExist = isoFile.DirectoryExists(parentPath); - - if ( ( !isFileExist && !isDirectoryExist ) || !isParentExist ) - { - DispatchCommandResult(new PluginResult(PluginResult.Status.ERROR, NOT_FOUND_ERR), callbackId); - return; - } - string newName; - string newPath; - if (isFileExist) - { - newName = (string.IsNullOrEmpty(newFileName)) - ? Path.GetFileName(currentPath) - : newFileName; - - newPath = Path.Combine(parentPath, newName); - - // sanity check .. - // cannot copy file onto itself - if (CanonicalCompare(newPath,currentPath)) //(parent + newFileName)) - { - DispatchCommandResult(new PluginResult(PluginResult.Status.ERROR, INVALID_MODIFICATION_ERR), callbackId); - return; - } - else if (isoFile.DirectoryExists(newPath)) - { - // there is already a folder with the same name, operation is not allowed - DispatchCommandResult(new PluginResult(PluginResult.Status.ERROR, INVALID_MODIFICATION_ERR), callbackId); - return; - } - else if (isoFile.FileExists(newPath)) - { // remove destination file if exists, in other case there will be exception - isoFile.DeleteFile(newPath); - } - - if (move) - { - isoFile.MoveFile(currentPath, newPath); - } - else - { - isoFile.CopyFile(currentPath, newPath, true); - } - } - else - { - newName = (string.IsNullOrEmpty(newFileName)) - ? currentPath - : newFileName; - - newPath = Path.Combine(parentPath, newName); - - if (move) - { - // remove destination directory if exists, in other case there will be exception - // target directory should be empty - if (!newPath.Equals(currentPath) && isoFile.DirectoryExists(newPath)) - { - isoFile.DeleteDirectory(newPath); - } - - isoFile.MoveDirectory(currentPath, newPath); - } - else - { - CopyDirectory(currentPath, newPath, isoFile); - } - } - FileEntry entry = FileEntry.GetEntry(newPath); - if (entry != null) - { - DispatchCommandResult(new PluginResult(PluginResult.Status.OK, entry), callbackId); - } - else - { - DispatchCommandResult(new PluginResult(PluginResult.Status.ERROR, NOT_FOUND_ERR), callbackId); - } - } - - } - catch (Exception ex) - { - if (!this.HandleException(ex, callbackId)) - { - DispatchCommandResult(new PluginResult(PluginResult.Status.ERROR, NO_MODIFICATION_ALLOWED_ERR), callbackId); - } - } - } - - private bool HandleException(Exception ex, string cbId="") - { - bool handled = false; - string callbackId = String.IsNullOrEmpty(cbId) ? this.CurrentCommandCallbackId : cbId; - if (ex is SecurityException) - { - DispatchCommandResult(new PluginResult(PluginResult.Status.ERROR, SECURITY_ERR), callbackId); - handled = true; - } - else if (ex is FileNotFoundException) - { - DispatchCommandResult(new PluginResult(PluginResult.Status.ERROR, NOT_FOUND_ERR), callbackId); - handled = true; - } - else if (ex is ArgumentException) - { - DispatchCommandResult(new PluginResult(PluginResult.Status.ERROR, ENCODING_ERR), callbackId); - handled = true; - } - else if (ex is IsolatedStorageException) - { - DispatchCommandResult(new PluginResult(PluginResult.Status.ERROR, INVALID_MODIFICATION_ERR), callbackId); - handled = true; - } - else if (ex is DirectoryNotFoundException) - { - DispatchCommandResult(new PluginResult(PluginResult.Status.ERROR, NOT_FOUND_ERR), callbackId); - handled = true; - } - return handled; - } - - private void CopyDirectory(string sourceDir, string destDir, IsolatedStorageFile isoFile) - { - string path = File.AddSlashToDirectory(sourceDir); - - bool bExists = isoFile.DirectoryExists(destDir); - - if (!bExists) - { - isoFile.CreateDirectory(destDir); - } - - destDir = File.AddSlashToDirectory(destDir); - - string[] files = isoFile.GetFileNames(path + "*"); - - if (files.Length > 0) - { - foreach (string file in files) - { - isoFile.CopyFile(path + file, destDir + file,true); - } - } - string[] dirs = isoFile.GetDirectoryNames(path + "*"); - if (dirs.Length > 0) - { - foreach (string dir in dirs) - { - CopyDirectory(path + dir, destDir + dir, isoFile); - } - } - } - - private void GetFileOrDirectory(string options, bool getDirectory) - { - FileOptions fOptions = new FileOptions(); - string[] args = getOptionStrings(options); - - fOptions.FullPath = args[0]; - fOptions.Path = args[1]; - - string callbackId = args[3]; - - try - { - fOptions.CreatingOpt = JSON.JsonHelper.Deserialize(args[2]); - } - catch (Exception) - { - DispatchCommandResult(new PluginResult(PluginResult.Status.JSON_EXCEPTION), callbackId); - return; - } - - try - { - if ((string.IsNullOrEmpty(fOptions.Path)) || (string.IsNullOrEmpty(fOptions.FullPath))) - { - DispatchCommandResult(new PluginResult(PluginResult.Status.ERROR, NOT_FOUND_ERR), callbackId); - return; - } - - string path; - - if (fOptions.Path.Split(':').Length > 2) - { - DispatchCommandResult(new PluginResult(PluginResult.Status.ERROR, ENCODING_ERR), callbackId); - return; - } - - try - { - path = Path.Combine(fOptions.FullPath + "/", fOptions.Path); - } - catch (Exception) - { - DispatchCommandResult(new PluginResult(PluginResult.Status.ERROR, ENCODING_ERR), callbackId); - return; - } - - using (IsolatedStorageFile isoFile = IsolatedStorageFile.GetUserStoreForApplication()) - { - bool isFile = isoFile.FileExists(path); - bool isDirectory = isoFile.DirectoryExists(path); - bool create = (fOptions.CreatingOpt == null) ? false : fOptions.CreatingOpt.Create; - bool exclusive = (fOptions.CreatingOpt == null) ? false : fOptions.CreatingOpt.Exclusive; - if (create) - { - if (exclusive && (isoFile.FileExists(path) || isoFile.DirectoryExists(path))) - { - DispatchCommandResult(new PluginResult(PluginResult.Status.ERROR, PATH_EXISTS_ERR), callbackId); - return; - } - - // need to make sure the parent exists - // it is an error to create a directory whose immediate parent does not yet exist - // see issue: https://issues.apache.org/jira/browse/CB-339 - string[] pathParts = path.Split('/'); - string builtPath = pathParts[0]; - for (int n = 1; n < pathParts.Length - 1; n++) - { - builtPath += "/" + pathParts[n]; - if (!isoFile.DirectoryExists(builtPath)) - { - Debug.WriteLine(String.Format("Error :: Parent folder \"{0}\" does not exist, when attempting to create \"{1}\"",builtPath,path)); - DispatchCommandResult(new PluginResult(PluginResult.Status.ERROR, NOT_FOUND_ERR), callbackId); - return; - } - } - - if ((getDirectory) && (!isDirectory)) - { - isoFile.CreateDirectory(path); - } - else - { - if ((!getDirectory) && (!isFile)) - { - - IsolatedStorageFileStream fileStream = isoFile.CreateFile(path); - fileStream.Close(); - } - } - } - else // (not create) - { - if ((!isFile) && (!isDirectory)) - { - if (path.IndexOf("//www") == 0) - { - Uri fileUri = new Uri(path.Remove(0,2), UriKind.Relative); - StreamResourceInfo streamInfo = Application.GetResourceStream(fileUri); - if (streamInfo != null) - { - FileEntry _entry = FileEntry.GetEntry(fileUri.OriginalString,true); - - DispatchCommandResult(new PluginResult(PluginResult.Status.OK, _entry), callbackId); - - //using (BinaryReader br = new BinaryReader(streamInfo.Stream)) - //{ - // byte[] data = br.ReadBytes((int)streamInfo.Stream.Length); - - //} - - } - else - { - DispatchCommandResult(new PluginResult(PluginResult.Status.ERROR, NOT_FOUND_ERR), callbackId); - } - - - } - else - { - DispatchCommandResult(new PluginResult(PluginResult.Status.ERROR, NOT_FOUND_ERR), callbackId); - } - return; - } - if (((getDirectory) && (!isDirectory)) || ((!getDirectory) && (!isFile))) - { - DispatchCommandResult(new PluginResult(PluginResult.Status.ERROR, TYPE_MISMATCH_ERR), callbackId); - return; - } - } - FileEntry entry = FileEntry.GetEntry(path); - if (entry != null) - { - DispatchCommandResult(new PluginResult(PluginResult.Status.OK, entry), callbackId); - } - else - { - DispatchCommandResult(new PluginResult(PluginResult.Status.ERROR, NOT_FOUND_ERR), callbackId); - } - } - } - catch (Exception ex) - { - if (!this.HandleException(ex)) - { - DispatchCommandResult(new PluginResult(PluginResult.Status.ERROR, NO_MODIFICATION_ALLOWED_ERR), callbackId); - } - } - } - - private static string AddSlashToDirectory(string dirPath) - { - if (dirPath.EndsWith("/")) - { - return dirPath; - } - else - { - return dirPath + "/"; - } - } - - /// - /// Returns file content in a form of base64 string - /// - /// File stream - /// Base64 representation of the file - private string GetFileContent(Stream stream) - { - int streamLength = (int)stream.Length; - byte[] fileData = new byte[streamLength + 1]; - stream.Read(fileData, 0, streamLength); - stream.Close(); - return Convert.ToBase64String(fileData); - } - - #endregion - - } -} diff --git a/plugins/org.apache.cordova.core.file/test/autotest/html/HtmlReporter.js b/plugins/org.apache.cordova.core.file/test/autotest/html/HtmlReporter.js deleted file mode 100644 index 7d9d924..0000000 --- a/plugins/org.apache.cordova.core.file/test/autotest/html/HtmlReporter.js +++ /dev/null @@ -1,101 +0,0 @@ -jasmine.HtmlReporter = function(_doc) { - var self = this; - var doc = _doc || window.document; - - var reporterView; - - var dom = {}; - - // Jasmine Reporter Public Interface - self.logRunningSpecs = false; - - self.reportRunnerStarting = function(runner) { - var specs = runner.specs() || []; - - if (specs.length == 0) { - return; - } - - createReporterDom(runner.env.versionString()); - doc.body.appendChild(dom.reporter); - - reporterView = new jasmine.HtmlReporter.ReporterView(dom); - reporterView.addSpecs(specs, self.specFilter); - }; - - self.reportRunnerResults = function(runner) { - reporterView && reporterView.complete(); - }; - - self.reportSuiteResults = function(suite) { - reporterView.suiteComplete(suite); - }; - - self.reportSpecStarting = function(spec) { - if (self.logRunningSpecs) { - self.log('>> Jasmine Running ' + spec.suite.description + ' ' + spec.description + '...'); - } - }; - - self.reportSpecResults = function(spec) { - reporterView.specComplete(spec); - }; - - self.log = function() { - var console = jasmine.getGlobal().console; - if (console && console.log) { - if (console.log.apply) { - console.log.apply(console, arguments); - } else { - console.log(arguments); // ie fix: console.log.apply doesn't exist on ie - } - } - }; - - self.specFilter = function(spec) { - if (!focusedSpecName()) { - return true; - } - - return spec.getFullName().indexOf(focusedSpecName()) === 0; - }; - - return self; - - function focusedSpecName() { - var specName; - - (function memoizeFocusedSpec() { - if (specName) { - return; - } - - var paramMap = []; - var params = doc.location.search.substring(1).split('&'); - - for (var i = 0; i < params.length; i++) { - var p = params[i].split('='); - paramMap[decodeURIComponent(p[0])] = decodeURIComponent(p[1]); - } - - specName = paramMap.spec; - })(); - - return specName; - } - - function createReporterDom(version) { - dom.reporter = self.createDom('div', { id: 'HTMLReporter', className: 'jasmine_reporter' }, - dom.banner = self.createDom('div', { className: 'banner' }, - self.createDom('span', { className: 'title' }, "Jasmine "), - self.createDom('span', { className: 'version' }, version)), - - dom.symbolSummary = self.createDom('ul', {className: 'symbolSummary'}), - dom.alert = self.createDom('div', {className: 'alert'}), - dom.results = self.createDom('div', {className: 'results'}, - dom.summary = self.createDom('div', { className: 'summary' }), - dom.details = self.createDom('div', { id: 'details' })) - ); - } -}; -jasmine.HtmlReporterHelpers.addHelpers(jasmine.HtmlReporter); diff --git a/plugins/org.apache.cordova.core.file/test/autotest/html/HtmlReporterHelpers.js b/plugins/org.apache.cordova.core.file/test/autotest/html/HtmlReporterHelpers.js deleted file mode 100644 index 745e1e0..0000000 --- a/plugins/org.apache.cordova.core.file/test/autotest/html/HtmlReporterHelpers.js +++ /dev/null @@ -1,60 +0,0 @@ -jasmine.HtmlReporterHelpers = {}; - -jasmine.HtmlReporterHelpers.createDom = function(type, attrs, childrenVarArgs) { - var el = document.createElement(type); - - for (var i = 2; i < arguments.length; i++) { - var child = arguments[i]; - - if (typeof child === 'string') { - el.appendChild(document.createTextNode(child)); - } else { - if (child) { - el.appendChild(child); - } - } - } - - for (var attr in attrs) { - if (attr == "className") { - el[attr] = attrs[attr]; - } else { - el.setAttribute(attr, attrs[attr]); - } - } - - return el; -}; - -jasmine.HtmlReporterHelpers.getSpecStatus = function(child) { - var results = child.results(); - var status = results.passed() ? 'passed' : 'failed'; - if (results.skipped) { - status = 'skipped'; - } - - return status; -}; - -jasmine.HtmlReporterHelpers.appendToSummary = function(child, childElement) { - var parentDiv = this.dom.summary; - var parentSuite = (typeof child.parentSuite == 'undefined') ? 'suite' : 'parentSuite'; - var parent = child[parentSuite]; - - if (parent) { - if (typeof this.views.suites[parent.id] == 'undefined') { - this.views.suites[parent.id] = new jasmine.HtmlReporter.SuiteView(parent, this.dom, this.views); - } - parentDiv = this.views.suites[parent.id].element; - } - - parentDiv.appendChild(childElement); -}; - - -jasmine.HtmlReporterHelpers.addHelpers = function(ctor) { - for(var fn in jasmine.HtmlReporterHelpers) { - ctor.prototype[fn] = jasmine.HtmlReporterHelpers[fn]; - } -}; - diff --git a/plugins/org.apache.cordova.core.file/test/autotest/html/ReporterView.js b/plugins/org.apache.cordova.core.file/test/autotest/html/ReporterView.js deleted file mode 100644 index 6a6d005..0000000 --- a/plugins/org.apache.cordova.core.file/test/autotest/html/ReporterView.js +++ /dev/null @@ -1,164 +0,0 @@ -jasmine.HtmlReporter.ReporterView = function(dom) { - this.startedAt = new Date(); - this.runningSpecCount = 0; - this.completeSpecCount = 0; - this.passedCount = 0; - this.failedCount = 0; - this.skippedCount = 0; - - this.createResultsMenu = function() { - this.resultsMenu = this.createDom('span', {className: 'resultsMenu bar'}, - this.summaryMenuItem = this.createDom('a', {className: 'summaryMenuItem', href: "#"}, '0 specs'), - ' | ', - this.detailsMenuItem = this.createDom('a', {className: 'detailsMenuItem', href: "#"}, '0 failing')); - - this.summaryMenuItem.onclick = function() { - dom.reporter.className = dom.reporter.className.replace(/ showDetails/g, ''); - }; - - this.detailsMenuItem.onclick = function() { - showDetails(); - }; - }; - - this.addSpecs = function(specs, specFilter) { - this.totalSpecCount = specs.length; - - this.views = { - specs: {}, - suites: {} - }; - - for (var i = 0; i < specs.length; i++) { - var spec = specs[i]; - this.views.specs[spec.id] = new jasmine.HtmlReporter.SpecView(spec, dom, this.views); - if (specFilter(spec)) { - this.runningSpecCount++; - } - } - }; - - this.specComplete = function(spec) { - this.completeSpecCount++; - - if (isUndefined(this.views.specs[spec.id])) { - this.views.specs[spec.id] = new jasmine.HtmlReporter.SpecView(spec, dom); - } - - var specView = this.views.specs[spec.id]; - - switch (specView.status()) { - case 'passed': - this.passedCount++; - break; - - case 'failed': - this.failedCount++; - break; - - case 'skipped': - this.skippedCount++; - break; - } - - specView.refresh(); - this.refresh(); - }; - - this.suiteComplete = function(suite) { - var suiteView = this.views.suites[suite.id]; - if (isUndefined(suiteView)) { - return; - } - suiteView.refresh(); - }; - - this.refresh = function() { - - if (isUndefined(this.resultsMenu)) { - this.createResultsMenu(); - } - - // currently running UI - if (isUndefined(this.runningAlert)) { - this.runningAlert = this.createDom('a', {href: "?", className: "runningAlert bar"}); - dom.alert.appendChild(this.runningAlert); - } - this.runningAlert.innerHTML = "Running " + this.completeSpecCount + " of " + specPluralizedFor(this.totalSpecCount); - - // skipped specs UI - if (isUndefined(this.skippedAlert)) { - this.skippedAlert = this.createDom('a', {href: "?", className: "skippedAlert bar"}); - } - - this.skippedAlert.innerHTML = "Skipping " + this.skippedCount + " of " + specPluralizedFor(this.totalSpecCount) + " - run all"; - - if (this.skippedCount === 1 && isDefined(dom.alert)) { - dom.alert.appendChild(this.skippedAlert); - } - - // passing specs UI - if (isUndefined(this.passedAlert)) { - this.passedAlert = this.createDom('span', {href: "?", className: "passingAlert bar"}); - } - this.passedAlert.innerHTML = "Passing " + specPluralizedFor(this.passedCount); - - // failing specs UI - if (isUndefined(this.failedAlert)) { - this.failedAlert = this.createDom('span', {href: "?", className: "failingAlert bar"}); - } - this.failedAlert.innerHTML = "Failing " + specPluralizedFor(this.failedCount); - - if (this.failedCount === 1 && isDefined(dom.alert)) { - dom.alert.appendChild(this.failedAlert); - dom.alert.appendChild(this.resultsMenu); - } - - // summary info - this.summaryMenuItem.innerHTML = "" + specPluralizedFor(this.runningSpecCount); - this.detailsMenuItem.innerHTML = "" + this.failedCount + " failing"; - }; - - this.complete = function() { - dom.alert.removeChild(this.runningAlert); - - this.skippedAlert.innerHTML = "Ran " + this.runningSpecCount + " of " + specPluralizedFor(this.totalSpecCount) + " - run all"; - - if (this.failedCount === 0) { - dom.alert.appendChild(this.createDom('span', {className: 'passingAlert bar'}, "Passing " + specPluralizedFor(this.passedCount))); - } else { - showDetails(); - } - - dom.banner.appendChild(this.createDom('span', {className: 'duration'}, "finished in " + ((new Date().getTime() - this.startedAt.getTime()) / 1000) + "s")); - }; - - return this; - - function showDetails() { - if (dom.reporter.className.search(/showDetails/) === -1) { - dom.reporter.className += " showDetails"; - } - } - - function isUndefined(obj) { - return typeof obj === 'undefined'; - } - - function isDefined(obj) { - return !isUndefined(obj); - } - - function specPluralizedFor(count) { - var str = count + " spec"; - if (count > 1) { - str += "s" - } - return str; - } - -}; - -jasmine.HtmlReporterHelpers.addHelpers(jasmine.HtmlReporter.ReporterView); - - diff --git a/plugins/org.apache.cordova.core.file/test/autotest/html/SpecView.js b/plugins/org.apache.cordova.core.file/test/autotest/html/SpecView.js deleted file mode 100644 index e8a3c23..0000000 --- a/plugins/org.apache.cordova.core.file/test/autotest/html/SpecView.js +++ /dev/null @@ -1,79 +0,0 @@ -jasmine.HtmlReporter.SpecView = function(spec, dom, views) { - this.spec = spec; - this.dom = dom; - this.views = views; - - this.symbol = this.createDom('li', { className: 'pending' }); - this.dom.symbolSummary.appendChild(this.symbol); - - this.summary = this.createDom('div', { className: 'specSummary' }, - this.createDom('a', { - className: 'description', - href: '?spec=' + encodeURIComponent(this.spec.getFullName()), - title: this.spec.getFullName() - }, this.spec.description) - ); - - this.detail = this.createDom('div', { className: 'specDetail' }, - this.createDom('a', { - className: 'description', - href: '?spec=' + encodeURIComponent(this.spec.getFullName()), - title: this.spec.getFullName() - }, this.spec.getFullName()) - ); -}; - -jasmine.HtmlReporter.SpecView.prototype.status = function() { - return this.getSpecStatus(this.spec); -}; - -jasmine.HtmlReporter.SpecView.prototype.refresh = function() { - this.symbol.className = this.status(); - - switch (this.status()) { - case 'skipped': - break; - - case 'passed': - this.appendSummaryToSuiteDiv(); - break; - - case 'failed': - this.appendSummaryToSuiteDiv(); - this.appendFailureDetail(); - break; - } -}; - -jasmine.HtmlReporter.SpecView.prototype.appendSummaryToSuiteDiv = function() { - this.summary.className += ' ' + this.status(); - this.appendToSummary(this.spec, this.summary); -}; - -jasmine.HtmlReporter.SpecView.prototype.appendFailureDetail = function() { - this.detail.className += ' ' + this.status(); - - var resultItems = this.spec.results().getItems(); - var messagesDiv = this.createDom('div', { className: 'messages' }); - - for (var i = 0; i < resultItems.length; i++) { - var result = resultItems[i]; - - if (result.type == 'log') { - messagesDiv.appendChild(this.createDom('div', {className: 'resultMessage log'}, result.toString())); - } else if (result.type == 'expect' && result.passed && !result.passed()) { - messagesDiv.appendChild(this.createDom('div', {className: 'resultMessage fail'}, result.message)); - - if (result.trace.stack) { - messagesDiv.appendChild(this.createDom('div', {className: 'stackTrace'}, result.trace.stack)); - } - } - } - - if (messagesDiv.childNodes.length > 0) { - this.detail.appendChild(messagesDiv); - this.dom.details.appendChild(this.detail); - } -}; - -jasmine.HtmlReporterHelpers.addHelpers(jasmine.HtmlReporter.SpecView); diff --git a/plugins/org.apache.cordova.core.file/test/autotest/html/SuiteView.js b/plugins/org.apache.cordova.core.file/test/autotest/html/SuiteView.js deleted file mode 100644 index 19a1efa..0000000 --- a/plugins/org.apache.cordova.core.file/test/autotest/html/SuiteView.js +++ /dev/null @@ -1,22 +0,0 @@ -jasmine.HtmlReporter.SuiteView = function(suite, dom, views) { - this.suite = suite; - this.dom = dom; - this.views = views; - - this.element = this.createDom('div', { className: 'suite' }, - this.createDom('a', { className: 'description', href: '?spec=' + encodeURIComponent(this.suite.getFullName()) }, this.suite.description) - ); - - this.appendToSummary(this.suite, this.element); -}; - -jasmine.HtmlReporter.SuiteView.prototype.status = function() { - return this.getSpecStatus(this.suite); -}; - -jasmine.HtmlReporter.SuiteView.prototype.refresh = function() { - this.element.className += " " + this.status(); -}; - -jasmine.HtmlReporterHelpers.addHelpers(jasmine.HtmlReporter.SuiteView); - diff --git a/plugins/org.apache.cordova.core.file/test/autotest/html/TrivialReporter.js b/plugins/org.apache.cordova.core.file/test/autotest/html/TrivialReporter.js deleted file mode 100644 index 167ac50..0000000 --- a/plugins/org.apache.cordova.core.file/test/autotest/html/TrivialReporter.js +++ /dev/null @@ -1,192 +0,0 @@ -/* @deprecated Use jasmine.HtmlReporter instead - */ -jasmine.TrivialReporter = function(doc) { - this.document = doc || document; - this.suiteDivs = {}; - this.logRunningSpecs = false; -}; - -jasmine.TrivialReporter.prototype.createDom = function(type, attrs, childrenVarArgs) { - var el = document.createElement(type); - - for (var i = 2; i < arguments.length; i++) { - var child = arguments[i]; - - if (typeof child === 'string') { - el.appendChild(document.createTextNode(child)); - } else { - if (child) { el.appendChild(child); } - } - } - - for (var attr in attrs) { - if (attr == "className") { - el[attr] = attrs[attr]; - } else { - el.setAttribute(attr, attrs[attr]); - } - } - - return el; -}; - -jasmine.TrivialReporter.prototype.reportRunnerStarting = function(runner) { - var showPassed, showSkipped; - - this.outerDiv = this.createDom('div', { id: 'TrivialReporter', className: 'jasmine_reporter' }, - this.createDom('div', { className: 'banner' }, - this.createDom('div', { className: 'logo' }, - this.createDom('span', { className: 'title' }, "Jasmine"), - this.createDom('span', { className: 'version' }, runner.env.versionString())), - this.createDom('div', { className: 'options' }, - "Show ", - showPassed = this.createDom('input', { id: "__jasmine_TrivialReporter_showPassed__", type: 'checkbox' }), - this.createDom('label', { "for": "__jasmine_TrivialReporter_showPassed__" }, " passed "), - showSkipped = this.createDom('input', { id: "__jasmine_TrivialReporter_showSkipped__", type: 'checkbox' }), - this.createDom('label', { "for": "__jasmine_TrivialReporter_showSkipped__" }, " skipped") - ) - ), - - this.runnerDiv = this.createDom('div', { className: 'runner running' }, - this.createDom('a', { className: 'run_spec', href: '?' }, "run all"), - this.runnerMessageSpan = this.createDom('span', {}, "Running..."), - this.finishedAtSpan = this.createDom('span', { className: 'finished-at' }, "")) - ); - - this.document.body.appendChild(this.outerDiv); - - var suites = runner.suites(); - for (var i = 0; i < suites.length; i++) { - var suite = suites[i]; - var suiteDiv = this.createDom('div', { className: 'suite' }, - this.createDom('a', { className: 'run_spec', href: '?spec=' + encodeURIComponent(suite.getFullName()) }, "run"), - this.createDom('a', { className: 'description', href: '?spec=' + encodeURIComponent(suite.getFullName()) }, suite.description)); - this.suiteDivs[suite.id] = suiteDiv; - var parentDiv = this.outerDiv; - if (suite.parentSuite) { - parentDiv = this.suiteDivs[suite.parentSuite.id]; - } - parentDiv.appendChild(suiteDiv); - } - - this.startedAt = new Date(); - - var self = this; - showPassed.onclick = function(evt) { - if (showPassed.checked) { - self.outerDiv.className += ' show-passed'; - } else { - self.outerDiv.className = self.outerDiv.className.replace(/ show-passed/, ''); - } - }; - - showSkipped.onclick = function(evt) { - if (showSkipped.checked) { - self.outerDiv.className += ' show-skipped'; - } else { - self.outerDiv.className = self.outerDiv.className.replace(/ show-skipped/, ''); - } - }; -}; - -jasmine.TrivialReporter.prototype.reportRunnerResults = function(runner) { - var results = runner.results(); - var className = (results.failedCount > 0) ? "runner failed" : "runner passed"; - this.runnerDiv.setAttribute("class", className); - //do it twice for IE - this.runnerDiv.setAttribute("className", className); - var specs = runner.specs(); - var specCount = 0; - for (var i = 0; i < specs.length; i++) { - if (this.specFilter(specs[i])) { - specCount++; - } - } - var message = "" + specCount + " spec" + (specCount == 1 ? "" : "s" ) + ", " + results.failedCount + " failure" + ((results.failedCount == 1) ? "" : "s"); - message += " in " + ((new Date().getTime() - this.startedAt.getTime()) / 1000) + "s"; - this.runnerMessageSpan.replaceChild(this.createDom('a', { className: 'description', href: '?'}, message), this.runnerMessageSpan.firstChild); - - this.finishedAtSpan.appendChild(document.createTextNode("Finished at " + new Date().toString())); -}; - -jasmine.TrivialReporter.prototype.reportSuiteResults = function(suite) { - var results = suite.results(); - var status = results.passed() ? 'passed' : 'failed'; - if (results.totalCount === 0) { // todo: change this to check results.skipped - status = 'skipped'; - } - this.suiteDivs[suite.id].className += " " + status; -}; - -jasmine.TrivialReporter.prototype.reportSpecStarting = function(spec) { - if (this.logRunningSpecs) { - this.log('>> Jasmine Running ' + spec.suite.description + ' ' + spec.description + '...'); - } -}; - -jasmine.TrivialReporter.prototype.reportSpecResults = function(spec) { - var results = spec.results(); - var status = results.passed() ? 'passed' : 'failed'; - if (results.skipped) { - status = 'skipped'; - } - var specDiv = this.createDom('div', { className: 'spec ' + status }, - this.createDom('a', { className: 'run_spec', href: '?spec=' + encodeURIComponent(spec.getFullName()) }, "run"), - this.createDom('a', { - className: 'description', - href: '?spec=' + encodeURIComponent(spec.getFullName()), - title: spec.getFullName() - }, spec.description)); - - - var resultItems = results.getItems(); - var messagesDiv = this.createDom('div', { className: 'messages' }); - for (var i = 0; i < resultItems.length; i++) { - var result = resultItems[i]; - - if (result.type == 'log') { - messagesDiv.appendChild(this.createDom('div', {className: 'resultMessage log'}, result.toString())); - } else if (result.type == 'expect' && result.passed && !result.passed()) { - messagesDiv.appendChild(this.createDom('div', {className: 'resultMessage fail'}, result.message)); - - if (result.trace.stack) { - messagesDiv.appendChild(this.createDom('div', {className: 'stackTrace'}, result.trace.stack)); - } - } - } - - if (messagesDiv.childNodes.length > 0) { - specDiv.appendChild(messagesDiv); - } - - this.suiteDivs[spec.suite.id].appendChild(specDiv); -}; - -jasmine.TrivialReporter.prototype.log = function() { - var console = jasmine.getGlobal().console; - if (console && console.log) { - if (console.log.apply) { - console.log.apply(console, arguments); - } else { - console.log(arguments); // ie fix: console.log.apply doesn't exist on ie - } - } -}; - -jasmine.TrivialReporter.prototype.getLocation = function() { - return this.document.location; -}; - -jasmine.TrivialReporter.prototype.specFilter = function(spec) { - var paramMap = {}; - var params = this.getLocation().search.substring(1).split('&'); - for (var i = 0; i < params.length; i++) { - var p = params[i].split('='); - paramMap[decodeURIComponent(p[0])] = decodeURIComponent(p[1]); - } - - if (!paramMap.spec) { - return true; - } - return spec.getFullName().indexOf(paramMap.spec) === 0; -}; diff --git a/plugins/org.apache.cordova.core.file/test/autotest/index.html b/plugins/org.apache.cordova.core.file/test/autotest/index.html deleted file mode 100644 index 6ebccbd..0000000 --- a/plugins/org.apache.cordova.core.file/test/autotest/index.html +++ /dev/null @@ -1,59 +0,0 @@ - - - - - - - - - - Cordova API Specs - - - - - -

Cordova API Specs

- - Run All Tests - Run Accelerometer Tests - Run Battery Tests - Run Camera Tests - Run Capture Tests - Run Compass Tests - Run Contacts Tests - Run Data URI Tests - Run Device Tests - Run File Tests - Run FileTransfer Tests - Run Geolocation Tests - Run Globalization Tests - Run Media Tests - Run Network Tests - Run Notification Tests - Run Platform Tests - Run Storage Tests - Run Bridge Tests - -

Back
- - diff --git a/plugins/org.apache.cordova.core.file/test/autotest/jasmine.css b/plugins/org.apache.cordova.core.file/test/autotest/jasmine.css deleted file mode 100644 index 826e575..0000000 --- a/plugins/org.apache.cordova.core.file/test/autotest/jasmine.css +++ /dev/null @@ -1,81 +0,0 @@ -body { background-color: #eeeeee; padding: 0; margin: 5px; overflow-y: scroll; } - -#HTMLReporter { font-size: 11px; font-family: Monaco, "Lucida Console", monospace; line-height: 14px; color: #333333; } -#HTMLReporter a { text-decoration: none; } -#HTMLReporter a:hover { text-decoration: underline; } -#HTMLReporter p, #HTMLReporter h1, #HTMLReporter h2, #HTMLReporter h3, #HTMLReporter h4, #HTMLReporter h5, #HTMLReporter h6 { margin: 0; line-height: 14px; } -#HTMLReporter .banner, #HTMLReporter .symbolSummary, #HTMLReporter .summary, #HTMLReporter .resultMessage, #HTMLReporter .specDetail .description, #HTMLReporter .alert .bar, #HTMLReporter .stackTrace { padding-left: 9px; padding-right: 9px; } -#HTMLReporter #jasmine_content { position: fixed; right: 100%; } -#HTMLReporter .version { color: #aaaaaa; } -#HTMLReporter .banner { margin-top: 14px; } -#HTMLReporter .duration { color: #aaaaaa; float: right; } -#HTMLReporter .symbolSummary { overflow: hidden; *zoom: 1; margin: 14px 0; } -#HTMLReporter .symbolSummary li { display: block; float: left; height: 7px; width: 14px; margin-bottom: 7px; font-size: 16px; } -#HTMLReporter .symbolSummary li.passed { font-size: 14px; } -#HTMLReporter .symbolSummary li.passed:before { color: #5e7d00; content: "\02022"; } -#HTMLReporter .symbolSummary li.failed { line-height: 9px; } -#HTMLReporter .symbolSummary li.failed:before { color: #b03911; content: "x"; font-weight: bold; margin-left: -1px; } -#HTMLReporter .symbolSummary li.skipped { font-size: 14px; } -#HTMLReporter .symbolSummary li.skipped:before { color: #bababa; content: "\02022"; } -#HTMLReporter .symbolSummary li.pending { line-height: 11px; } -#HTMLReporter .symbolSummary li.pending:before { color: #aaaaaa; content: "-"; } -#HTMLReporter .bar { line-height: 28px; font-size: 14px; display: block; color: #eee; } -#HTMLReporter .runningAlert { background-color: #666666; } -#HTMLReporter .skippedAlert { background-color: #aaaaaa; } -#HTMLReporter .skippedAlert:first-child { background-color: #333333; } -#HTMLReporter .skippedAlert:hover { text-decoration: none; color: white; text-decoration: underline; } -#HTMLReporter .passingAlert { background-color: #a6b779; } -#HTMLReporter .passingAlert:first-child { background-color: #5e7d00; } -#HTMLReporter .failingAlert { background-color: #cf867e; } -#HTMLReporter .failingAlert:first-child { background-color: #b03911; } -#HTMLReporter .results { margin-top: 14px; } -#HTMLReporter #details { display: none; } -#HTMLReporter .resultsMenu, #HTMLReporter .resultsMenu a { background-color: #fff; color: #333333; } -#HTMLReporter.showDetails .summaryMenuItem { font-weight: normal; text-decoration: inherit; } -#HTMLReporter.showDetails .summaryMenuItem:hover { text-decoration: underline; } -#HTMLReporter.showDetails .detailsMenuItem { font-weight: bold; text-decoration: underline; } -#HTMLReporter.showDetails .summary { display: none; } -#HTMLReporter.showDetails #details { display: block; } -#HTMLReporter .summaryMenuItem { font-weight: bold; text-decoration: underline; } -#HTMLReporter .summary { margin-top: 14px; } -#HTMLReporter .summary .suite .suite, #HTMLReporter .summary .specSummary { margin-left: 14px; } -#HTMLReporter .summary .specSummary.passed a { color: #5e7d00; } -#HTMLReporter .summary .specSummary.failed a { color: #b03911; } -#HTMLReporter .description + .suite { margin-top: 0; } -#HTMLReporter .suite { margin-top: 14px; } -#HTMLReporter .suite a { color: #333333; } -#HTMLReporter #details .specDetail { margin-bottom: 28px; } -#HTMLReporter #details .specDetail .description { display: block; color: white; background-color: #b03911; } -#HTMLReporter .resultMessage { padding-top: 14px; color: #333333; } -#HTMLReporter .resultMessage span.result { display: block; } -#HTMLReporter .stackTrace { margin: 5px 0 0 0; max-height: 224px; overflow: auto; line-height: 18px; color: #666666; border: 1px solid #ddd; background: white; white-space: pre; } - -#TrivialReporter { padding: 8px 13px; position: absolute; top: 0; bottom: 0; left: 0; right: 0; overflow-y: scroll; background-color: white; font-family: "Helvetica Neue Light", "Lucida Grande", "Calibri", "Arial", sans-serif; /*.resultMessage {*/ /*white-space: pre;*/ /*}*/ } -#TrivialReporter a:visited, #TrivialReporter a { color: #303; } -#TrivialReporter a:hover, #TrivialReporter a:active { color: blue; } -#TrivialReporter .run_spec { float: right; padding-right: 5px; font-size: .8em; text-decoration: none; } -#TrivialReporter .banner { color: #303; background-color: #fef; padding: 5px; } -#TrivialReporter .logo { float: left; font-size: 1.1em; padding-left: 5px; } -#TrivialReporter .logo .version { font-size: .6em; padding-left: 1em; } -#TrivialReporter .runner.running { background-color: yellow; } -#TrivialReporter .options { text-align: right; font-size: .8em; } -#TrivialReporter .suite { border: 1px outset gray; margin: 5px 0; padding-left: 1em; } -#TrivialReporter .suite .suite { margin: 5px; } -#TrivialReporter .suite.passed { background-color: #dfd; } -#TrivialReporter .suite.failed { background-color: #fdd; } -#TrivialReporter .spec { margin: 5px; padding-left: 1em; clear: both; } -#TrivialReporter .spec.failed, #TrivialReporter .spec.passed, #TrivialReporter .spec.skipped { padding-bottom: 5px; border: 1px solid gray; } -#TrivialReporter .spec.failed { background-color: #fbb; border-color: red; } -#TrivialReporter .spec.passed { background-color: #bfb; border-color: green; } -#TrivialReporter .spec.skipped { background-color: #bbb; } -#TrivialReporter .messages { border-left: 1px dashed gray; padding-left: 1em; padding-right: 1em; } -#TrivialReporter .passed { background-color: #cfc; display: none; } -#TrivialReporter .failed { background-color: #fbb; } -#TrivialReporter .skipped { color: #777; background-color: #eee; display: none; } -#TrivialReporter .resultMessage span.result { display: block; line-height: 2em; color: black; } -#TrivialReporter .resultMessage .mismatch { color: black; } -#TrivialReporter .stackTrace { white-space: pre; font-size: .8em; margin-left: 10px; max-height: 5em; overflow: auto; border: 1px inset red; padding: 1em; background: #eef; } -#TrivialReporter .finished-at { padding-left: 1em; font-size: .6em; } -#TrivialReporter.show-passed .passed, #TrivialReporter.show-skipped .skipped { display: block; } -#TrivialReporter #jasmine_content { position: fixed; right: 100%; } -#TrivialReporter .runner { border: 1px solid gray; display: block; margin: 5px 0; padding: 2px 0 2px 10px; } diff --git a/plugins/org.apache.cordova.core.file/test/autotest/jasmine.js b/plugins/org.apache.cordova.core.file/test/autotest/jasmine.js deleted file mode 100644 index bccb66c..0000000 --- a/plugins/org.apache.cordova.core.file/test/autotest/jasmine.js +++ /dev/null @@ -1,2530 +0,0 @@ -var isCommonJS = typeof window == "undefined"; - -/** - * Top level namespace for Jasmine, a lightweight JavaScript BDD/spec/testing framework. - * - * @namespace - */ -var jasmine = {}; -if (isCommonJS) exports.jasmine = jasmine; -/** - * @private - */ -jasmine.unimplementedMethod_ = function() { - throw new Error("unimplemented method"); -}; - -/** - * Use jasmine.undefined instead of undefined, since undefined is just - * a plain old variable and may be redefined by somebody else. - * - * @private - */ -jasmine.undefined = jasmine.___undefined___; - -/** - * Show diagnostic messages in the console if set to true - * - */ -jasmine.VERBOSE = false; - -/** - * Default interval in milliseconds for event loop yields (e.g. to allow network activity or to refresh the screen with the HTML-based runner). Small values here may result in slow test running. Zero means no updates until all tests have completed. - * - */ -jasmine.DEFAULT_UPDATE_INTERVAL = 250; - -/** - * Default timeout interval in milliseconds for waitsFor() blocks. - */ -jasmine.DEFAULT_TIMEOUT_INTERVAL = 5000; - -jasmine.getGlobal = function() { - function getGlobal() { - return this; - } - - return getGlobal(); -}; - -/** - * Allows for bound functions to be compared. Internal use only. - * - * @ignore - * @private - * @param base {Object} bound 'this' for the function - * @param name {Function} function to find - */ -jasmine.bindOriginal_ = function(base, name) { - var original = base[name]; - if (original.apply) { - return function() { - return original.apply(base, arguments); - }; - } else { - // IE support - return jasmine.getGlobal()[name]; - } -}; - -jasmine.setTimeout = jasmine.bindOriginal_(jasmine.getGlobal(), 'setTimeout'); -jasmine.clearTimeout = jasmine.bindOriginal_(jasmine.getGlobal(), 'clearTimeout'); -jasmine.setInterval = jasmine.bindOriginal_(jasmine.getGlobal(), 'setInterval'); -jasmine.clearInterval = jasmine.bindOriginal_(jasmine.getGlobal(), 'clearInterval'); - -jasmine.MessageResult = function(values) { - this.type = 'log'; - this.values = values; - this.trace = new Error(); // todo: test better -}; - -jasmine.MessageResult.prototype.toString = function() { - var text = ""; - for (var i = 0; i < this.values.length; i++) { - if (i > 0) text += " "; - if (jasmine.isString_(this.values[i])) { - text += this.values[i]; - } else { - text += jasmine.pp(this.values[i]); - } - } - return text; -}; - -jasmine.ExpectationResult = function(params) { - this.type = 'expect'; - this.matcherName = params.matcherName; - this.passed_ = params.passed; - this.expected = params.expected; - this.actual = params.actual; - this.message = this.passed_ ? 'Passed.' : params.message; - - var trace = (params.trace || new Error(this.message)); - this.trace = this.passed_ ? '' : trace; -}; - -jasmine.ExpectationResult.prototype.toString = function () { - return this.message; -}; - -jasmine.ExpectationResult.prototype.passed = function () { - return this.passed_; -}; - -/** - * Getter for the Jasmine environment. Ensures one gets created - */ -jasmine.getEnv = function() { - var env = jasmine.currentEnv_ = jasmine.currentEnv_ || new jasmine.Env(); - return env; -}; - -/** - * @ignore - * @private - * @param value - * @returns {Boolean} - */ -jasmine.isArray_ = function(value) { - return jasmine.isA_("Array", value); -}; - -/** - * @ignore - * @private - * @param value - * @returns {Boolean} - */ -jasmine.isString_ = function(value) { - return jasmine.isA_("String", value); -}; - -/** - * @ignore - * @private - * @param value - * @returns {Boolean} - */ -jasmine.isNumber_ = function(value) { - return jasmine.isA_("Number", value); -}; - -/** - * @ignore - * @private - * @param {String} typeName - * @param value - * @returns {Boolean} - */ -jasmine.isA_ = function(typeName, value) { - return Object.prototype.toString.apply(value) === '[object ' + typeName + ']'; -}; - -/** - * Pretty printer for expecations. Takes any object and turns it into a human-readable string. - * - * @param value {Object} an object to be outputted - * @returns {String} - */ -jasmine.pp = function(value) { - var stringPrettyPrinter = new jasmine.StringPrettyPrinter(); - stringPrettyPrinter.format(value); - return stringPrettyPrinter.string; -}; - -/** - * Returns true if the object is a DOM Node. - * - * @param {Object} obj object to check - * @returns {Boolean} - */ -jasmine.isDomNode = function(obj) { - return obj.nodeType > 0; -}; - -/** - * Returns a matchable 'generic' object of the class type. For use in expecations of type when values don't matter. - * - * @example - * // don't care about which function is passed in, as long as it's a function - * expect(mySpy).toHaveBeenCalledWith(jasmine.any(Function)); - * - * @param {Class} clazz - * @returns matchable object of the type clazz - */ -jasmine.any = function(clazz) { - return new jasmine.Matchers.Any(clazz); -}; - -/** - * Returns a matchable subset of a JSON object. For use in expectations when you don't care about all of the - * attributes on the object. - * - * @example - * // don't care about any other attributes than foo. - * expect(mySpy).toHaveBeenCalledWith(jasmine.objectContaining({foo: "bar"}); - * - * @param sample {Object} sample - * @returns matchable object for the sample - */ -jasmine.objectContaining = function (sample) { - return new jasmine.Matchers.ObjectContaining(sample); -}; - -/** - * Jasmine Spies are test doubles that can act as stubs, spies, fakes or when used in an expecation, mocks. - * - * Spies should be created in test setup, before expectations. They can then be checked, using the standard Jasmine - * expectation syntax. Spies can be checked if they were called or not and what the calling params were. - * - * A Spy has the following fields: wasCalled, callCount, mostRecentCall, and argsForCall (see docs). - * - * Spies are torn down at the end of every spec. - * - * Note: Do not call new jasmine.Spy() directly - a spy must be created using spyOn, jasmine.createSpy or jasmine.createSpyObj. - * - * @example - * // a stub - * var myStub = jasmine.createSpy('myStub'); // can be used anywhere - * - * // spy example - * var foo = { - * not: function(bool) { return !bool; } - * } - * - * // actual foo.not will not be called, execution stops - * spyOn(foo, 'not'); - - // foo.not spied upon, execution will continue to implementation - * spyOn(foo, 'not').andCallThrough(); - * - * // fake example - * var foo = { - * not: function(bool) { return !bool; } - * } - * - * // foo.not(val) will return val - * spyOn(foo, 'not').andCallFake(function(value) {return value;}); - * - * // mock example - * foo.not(7 == 7); - * expect(foo.not).toHaveBeenCalled(); - * expect(foo.not).toHaveBeenCalledWith(true); - * - * @constructor - * @see spyOn, jasmine.createSpy, jasmine.createSpyObj - * @param {String} name - */ -jasmine.Spy = function(name) { - /** - * The name of the spy, if provided. - */ - this.identity = name || 'unknown'; - /** - * Is this Object a spy? - */ - this.isSpy = true; - /** - * The actual function this spy stubs. - */ - this.plan = function() { - }; - /** - * Tracking of the most recent call to the spy. - * @example - * var mySpy = jasmine.createSpy('foo'); - * mySpy(1, 2); - * mySpy.mostRecentCall.args = [1, 2]; - */ - this.mostRecentCall = {}; - - /** - * Holds arguments for each call to the spy, indexed by call count - * @example - * var mySpy = jasmine.createSpy('foo'); - * mySpy(1, 2); - * mySpy(7, 8); - * mySpy.mostRecentCall.args = [7, 8]; - * mySpy.argsForCall[0] = [1, 2]; - * mySpy.argsForCall[1] = [7, 8]; - */ - this.argsForCall = []; - this.calls = []; -}; - -/** - * Tells a spy to call through to the actual implemenatation. - * - * @example - * var foo = { - * bar: function() { // do some stuff } - * } - * - * // defining a spy on an existing property: foo.bar - * spyOn(foo, 'bar').andCallThrough(); - */ -jasmine.Spy.prototype.andCallThrough = function() { - this.plan = this.originalValue; - return this; -}; - -/** - * For setting the return value of a spy. - * - * @example - * // defining a spy from scratch: foo() returns 'baz' - * var foo = jasmine.createSpy('spy on foo').andReturn('baz'); - * - * // defining a spy on an existing property: foo.bar() returns 'baz' - * spyOn(foo, 'bar').andReturn('baz'); - * - * @param {Object} value - */ -jasmine.Spy.prototype.andReturn = function(value) { - this.plan = function() { - return value; - }; - return this; -}; - -/** - * For throwing an exception when a spy is called. - * - * @example - * // defining a spy from scratch: foo() throws an exception w/ message 'ouch' - * var foo = jasmine.createSpy('spy on foo').andThrow('baz'); - * - * // defining a spy on an existing property: foo.bar() throws an exception w/ message 'ouch' - * spyOn(foo, 'bar').andThrow('baz'); - * - * @param {String} exceptionMsg - */ -jasmine.Spy.prototype.andThrow = function(exceptionMsg) { - this.plan = function() { - throw exceptionMsg; - }; - return this; -}; - -/** - * Calls an alternate implementation when a spy is called. - * - * @example - * var baz = function() { - * // do some stuff, return something - * } - * // defining a spy from scratch: foo() calls the function baz - * var foo = jasmine.createSpy('spy on foo').andCall(baz); - * - * // defining a spy on an existing property: foo.bar() calls an anonymnous function - * spyOn(foo, 'bar').andCall(function() { return 'baz';} ); - * - * @param {Function} fakeFunc - */ -jasmine.Spy.prototype.andCallFake = function(fakeFunc) { - this.plan = fakeFunc; - return this; -}; - -/** - * Resets all of a spy's the tracking variables so that it can be used again. - * - * @example - * spyOn(foo, 'bar'); - * - * foo.bar(); - * - * expect(foo.bar.callCount).toEqual(1); - * - * foo.bar.reset(); - * - * expect(foo.bar.callCount).toEqual(0); - */ -jasmine.Spy.prototype.reset = function() { - this.wasCalled = false; - this.callCount = 0; - this.argsForCall = []; - this.calls = []; - this.mostRecentCall = {}; -}; - -jasmine.createSpy = function(name) { - - var spyObj = function() { - spyObj.wasCalled = true; - spyObj.callCount++; - var args = jasmine.util.argsToArray(arguments); - spyObj.mostRecentCall.object = this; - spyObj.mostRecentCall.args = args; - spyObj.argsForCall.push(args); - spyObj.calls.push({object: this, args: args}); - return spyObj.plan.apply(this, arguments); - }; - - var spy = new jasmine.Spy(name); - - for (var prop in spy) { - spyObj[prop] = spy[prop]; - } - - spyObj.reset(); - - return spyObj; -}; - -/** - * Determines whether an object is a spy. - * - * @param {jasmine.Spy|Object} putativeSpy - * @returns {Boolean} - */ -jasmine.isSpy = function(putativeSpy) { - return putativeSpy && putativeSpy.isSpy; -}; - -/** - * Creates a more complicated spy: an Object that has every property a function that is a spy. Used for stubbing something - * large in one call. - * - * @param {String} baseName name of spy class - * @param {Array} methodNames array of names of methods to make spies - */ -jasmine.createSpyObj = function(baseName, methodNames) { - if (!jasmine.isArray_(methodNames) || methodNames.length === 0) { - throw new Error('createSpyObj requires a non-empty array of method names to create spies for'); - } - var obj = {}; - for (var i = 0; i < methodNames.length; i++) { - obj[methodNames[i]] = jasmine.createSpy(baseName + '.' + methodNames[i]); - } - return obj; -}; - -/** - * All parameters are pretty-printed and concatenated together, then written to the current spec's output. - * - * Be careful not to leave calls to jasmine.log in production code. - */ -jasmine.log = function() { - var spec = jasmine.getEnv().currentSpec; - spec.log.apply(spec, arguments); -}; - -/** - * Function that installs a spy on an existing object's method name. Used within a Spec to create a spy. - * - * @example - * // spy example - * var foo = { - * not: function(bool) { return !bool; } - * } - * spyOn(foo, 'not'); // actual foo.not will not be called, execution stops - * - * @see jasmine.createSpy - * @param obj - * @param methodName - * @returns a Jasmine spy that can be chained with all spy methods - */ -var spyOn = function(obj, methodName) { - return jasmine.getEnv().currentSpec.spyOn(obj, methodName); -}; -if (isCommonJS) exports.spyOn = spyOn; - -/** - * Creates a Jasmine spec that will be added to the current suite. - * - * // TODO: pending tests - * - * @example - * it('should be true', function() { - * expect(true).toEqual(true); - * }); - * - * @param {String} desc description of this specification - * @param {Function} func defines the preconditions and expectations of the spec - */ -var it = function(desc, func) { - return jasmine.getEnv().it(desc, func); -}; -if (isCommonJS) exports.it = it; - -/** - * Creates a disabled Jasmine spec. - * - * A convenience method that allows existing specs to be disabled temporarily during development. - * - * @param {String} desc description of this specification - * @param {Function} func defines the preconditions and expectations of the spec - */ -var xit = function(desc, func) { - return jasmine.getEnv().xit(desc, func); -}; -if (isCommonJS) exports.xit = xit; - -/** - * Starts a chain for a Jasmine expectation. - * - * It is passed an Object that is the actual value and should chain to one of the many - * jasmine.Matchers functions. - * - * @param {Object} actual Actual value to test against and expected value - */ -var expect = function(actual) { - return jasmine.getEnv().currentSpec.expect(actual); -}; -if (isCommonJS) exports.expect = expect; - -/** - * Defines part of a jasmine spec. Used in cominbination with waits or waitsFor in asynchrnous specs. - * - * @param {Function} func Function that defines part of a jasmine spec. - */ -var runs = function(func) { - jasmine.getEnv().currentSpec.runs(func); -}; -if (isCommonJS) exports.runs = runs; - -/** - * Waits a fixed time period before moving to the next block. - * - * @deprecated Use waitsFor() instead - * @param {Number} timeout milliseconds to wait - */ -var waits = function(timeout) { - jasmine.getEnv().currentSpec.waits(timeout); -}; -if (isCommonJS) exports.waits = waits; - -/** - * Waits for the latchFunction to return true before proceeding to the next block. - * - * @param {Function} latchFunction - * @param {String} optional_timeoutMessage - * @param {Number} optional_timeout - */ -var waitsFor = function(latchFunction, optional_timeoutMessage, optional_timeout) { - jasmine.getEnv().currentSpec.waitsFor.apply(jasmine.getEnv().currentSpec, arguments); -}; -if (isCommonJS) exports.waitsFor = waitsFor; - -/** - * A function that is called before each spec in a suite. - * - * Used for spec setup, including validating assumptions. - * - * @param {Function} beforeEachFunction - */ -var beforeEach = function(beforeEachFunction) { - jasmine.getEnv().beforeEach(beforeEachFunction); -}; -if (isCommonJS) exports.beforeEach = beforeEach; - -/** - * A function that is called after each spec in a suite. - * - * Used for restoring any state that is hijacked during spec execution. - * - * @param {Function} afterEachFunction - */ -var afterEach = function(afterEachFunction) { - jasmine.getEnv().afterEach(afterEachFunction); -}; -if (isCommonJS) exports.afterEach = afterEach; - -/** - * Defines a suite of specifications. - * - * Stores the description and all defined specs in the Jasmine environment as one suite of specs. Variables declared - * are accessible by calls to beforeEach, it, and afterEach. Describe blocks can be nested, allowing for specialization - * of setup in some tests. - * - * @example - * // TODO: a simple suite - * - * // TODO: a simple suite with a nested describe block - * - * @param {String} description A string, usually the class under test. - * @param {Function} specDefinitions function that defines several specs. - */ -var describe = function(description, specDefinitions) { - return jasmine.getEnv().describe(description, specDefinitions); -}; -if (isCommonJS) exports.describe = describe; - -/** - * Disables a suite of specifications. Used to disable some suites in a file, or files, temporarily during development. - * - * @param {String} description A string, usually the class under test. - * @param {Function} specDefinitions function that defines several specs. - */ -var xdescribe = function(description, specDefinitions) { - return jasmine.getEnv().xdescribe(description, specDefinitions); -}; -if (isCommonJS) exports.xdescribe = xdescribe; - - -// Provide the XMLHttpRequest class for IE 5.x-6.x: -jasmine.XmlHttpRequest = (typeof XMLHttpRequest == "undefined") ? function() { - function tryIt(f) { - try { - return f(); - } catch(e) { - } - return null; - } - - var xhr = tryIt(function() { - return new ActiveXObject("Msxml2.XMLHTTP.6.0"); - }) || - tryIt(function() { - return new ActiveXObject("Msxml2.XMLHTTP.3.0"); - }) || - tryIt(function() { - return new ActiveXObject("Msxml2.XMLHTTP"); - }) || - tryIt(function() { - return new ActiveXObject("Microsoft.XMLHTTP"); - }); - - if (!xhr) throw new Error("This browser does not support XMLHttpRequest."); - - return xhr; -} : XMLHttpRequest; -/** - * @namespace - */ -jasmine.util = {}; - -/** - * Declare that a child class inherit it's prototype from the parent class. - * - * @private - * @param {Function} childClass - * @param {Function} parentClass - */ -jasmine.util.inherit = function(childClass, parentClass) { - /** - * @private - */ - var subclass = function() { - }; - subclass.prototype = parentClass.prototype; - childClass.prototype = new subclass(); -}; - -jasmine.util.formatException = function(e) { - var lineNumber; - if (e.line) { - lineNumber = e.line; - } - else if (e.lineNumber) { - lineNumber = e.lineNumber; - } - - var file; - - if (e.sourceURL) { - file = e.sourceURL; - } - else if (e.fileName) { - file = e.fileName; - } - - var message = (e.name && e.message) ? (e.name + ': ' + e.message) : e.toString(); - - if (file && lineNumber) { - message += ' in ' + file + ' (line ' + lineNumber + ')'; - } - - return message; -}; - -jasmine.util.htmlEscape = function(str) { - if (!str) return str; - return str.replace(/&/g, '&') - .replace(//g, '>'); -}; - -jasmine.util.argsToArray = function(args) { - var arrayOfArgs = []; - for (var i = 0; i < args.length; i++) arrayOfArgs.push(args[i]); - return arrayOfArgs; -}; - -jasmine.util.extend = function(destination, source) { - for (var property in source) destination[property] = source[property]; - return destination; -}; - -/** - * Environment for Jasmine - * - * @constructor - */ -jasmine.Env = function() { - this.currentSpec = null; - this.currentSuite = null; - this.currentRunner_ = new jasmine.Runner(this); - - this.reporter = new jasmine.MultiReporter(); - - this.updateInterval = jasmine.DEFAULT_UPDATE_INTERVAL; - this.defaultTimeoutInterval = jasmine.DEFAULT_TIMEOUT_INTERVAL; - this.lastUpdate = 0; - this.specFilter = function() { - return true; - }; - - this.nextSpecId_ = 0; - this.nextSuiteId_ = 0; - this.equalityTesters_ = []; - - // wrap matchers - this.matchersClass = function() { - jasmine.Matchers.apply(this, arguments); - }; - jasmine.util.inherit(this.matchersClass, jasmine.Matchers); - - jasmine.Matchers.wrapInto_(jasmine.Matchers.prototype, this.matchersClass); -}; - - -jasmine.Env.prototype.setTimeout = jasmine.setTimeout; -jasmine.Env.prototype.clearTimeout = jasmine.clearTimeout; -jasmine.Env.prototype.setInterval = jasmine.setInterval; -jasmine.Env.prototype.clearInterval = jasmine.clearInterval; - -/** - * @returns an object containing jasmine version build info, if set. - */ -jasmine.Env.prototype.version = function () { - if (jasmine.version_) { - return jasmine.version_; - } else { - throw new Error('Version not set'); - } -}; - -/** - * @returns string containing jasmine version build info, if set. - */ -jasmine.Env.prototype.versionString = function() { - if (!jasmine.version_) { - return "version unknown"; - } - - var version = this.version(); - var versionString = version.major + "." + version.minor + "." + version.build; - if (version.release_candidate) { - versionString += ".rc" + version.release_candidate; - } - versionString += " revision " + version.revision; - return versionString; -}; - -/** - * @returns a sequential integer starting at 0 - */ -jasmine.Env.prototype.nextSpecId = function () { - return this.nextSpecId_++; -}; - -/** - * @returns a sequential integer starting at 0 - */ -jasmine.Env.prototype.nextSuiteId = function () { - return this.nextSuiteId_++; -}; - -/** - * Register a reporter to receive status updates from Jasmine. - * @param {jasmine.Reporter} reporter An object which will receive status updates. - */ -jasmine.Env.prototype.addReporter = function(reporter) { - this.reporter.addReporter(reporter); -}; - -jasmine.Env.prototype.execute = function() { - this.currentRunner_.execute(); -}; - -jasmine.Env.prototype.describe = function(description, specDefinitions) { - var suite = new jasmine.Suite(this, description, specDefinitions, this.currentSuite); - - var parentSuite = this.currentSuite; - if (parentSuite) { - parentSuite.add(suite); - } else { - this.currentRunner_.add(suite); - } - - this.currentSuite = suite; - - var declarationError = null; - try { - specDefinitions.call(suite); - } catch(e) { - declarationError = e; - } - - if (declarationError) { - this.it("encountered a declaration exception", function() { - throw declarationError; - }); - } - - this.currentSuite = parentSuite; - - return suite; -}; - -jasmine.Env.prototype.beforeEach = function(beforeEachFunction) { - if (this.currentSuite) { - this.currentSuite.beforeEach(beforeEachFunction); - } else { - this.currentRunner_.beforeEach(beforeEachFunction); - } -}; - -jasmine.Env.prototype.currentRunner = function () { - return this.currentRunner_; -}; - -jasmine.Env.prototype.afterEach = function(afterEachFunction) { - if (this.currentSuite) { - this.currentSuite.afterEach(afterEachFunction); - } else { - this.currentRunner_.afterEach(afterEachFunction); - } - -}; - -jasmine.Env.prototype.xdescribe = function(desc, specDefinitions) { - return { - execute: function() { - } - }; -}; - -jasmine.Env.prototype.it = function(description, func) { - var spec = new jasmine.Spec(this, this.currentSuite, description); - this.currentSuite.add(spec); - this.currentSpec = spec; - - if (func) { - spec.runs(func); - } - - return spec; -}; - -jasmine.Env.prototype.xit = function(desc, func) { - return { - id: this.nextSpecId(), - runs: function() { - } - }; -}; - -jasmine.Env.prototype.compareObjects_ = function(a, b, mismatchKeys, mismatchValues) { - if (a.__Jasmine_been_here_before__ === b && b.__Jasmine_been_here_before__ === a) { - return true; - } - - a.__Jasmine_been_here_before__ = b; - b.__Jasmine_been_here_before__ = a; - - var hasKey = function(obj, keyName) { - return obj !== null && obj[keyName] !== jasmine.undefined; - }; - - for (var property in b) { - if (!hasKey(a, property) && hasKey(b, property)) { - mismatchKeys.push("expected has key '" + property + "', but missing from actual."); - } - } - for (property in a) { - if (!hasKey(b, property) && hasKey(a, property)) { - mismatchKeys.push("expected missing key '" + property + "', but present in actual."); - } - } - for (property in b) { - if (property == '__Jasmine_been_here_before__') continue; - if (!this.equals_(a[property], b[property], mismatchKeys, mismatchValues)) { - mismatchValues.push("'" + property + "' was '" + (b[property] ? jasmine.util.htmlEscape(b[property].toString()) : b[property]) + "' in expected, but was '" + (a[property] ? jasmine.util.htmlEscape(a[property].toString()) : a[property]) + "' in actual."); - } - } - - if (jasmine.isArray_(a) && jasmine.isArray_(b) && a.length != b.length) { - mismatchValues.push("arrays were not the same length"); - } - - delete a.__Jasmine_been_here_before__; - delete b.__Jasmine_been_here_before__; - return (mismatchKeys.length === 0 && mismatchValues.length === 0); -}; - -jasmine.Env.prototype.equals_ = function(a, b, mismatchKeys, mismatchValues) { - mismatchKeys = mismatchKeys || []; - mismatchValues = mismatchValues || []; - - for (var i = 0; i < this.equalityTesters_.length; i++) { - var equalityTester = this.equalityTesters_[i]; - var result = equalityTester(a, b, this, mismatchKeys, mismatchValues); - if (result !== jasmine.undefined) return result; - } - - if (a === b) return true; - - if (a === jasmine.undefined || a === null || b === jasmine.undefined || b === null) { - return (a == jasmine.undefined && b == jasmine.undefined); - } - - if (jasmine.isDomNode(a) && jasmine.isDomNode(b)) { - return a === b; - } - - if (a instanceof Date && b instanceof Date) { - return a.getTime() == b.getTime(); - } - - if (a.jasmineMatches) { - return a.jasmineMatches(b); - } - - if (b.jasmineMatches) { - return b.jasmineMatches(a); - } - - if (a instanceof jasmine.Matchers.ObjectContaining) { - return a.matches(b); - } - - if (b instanceof jasmine.Matchers.ObjectContaining) { - return b.matches(a); - } - - if (jasmine.isString_(a) && jasmine.isString_(b)) { - return (a == b); - } - - if (jasmine.isNumber_(a) && jasmine.isNumber_(b)) { - return (a == b); - } - - if (typeof a === "object" && typeof b === "object") { - return this.compareObjects_(a, b, mismatchKeys, mismatchValues); - } - - //Straight check - return (a === b); -}; - -jasmine.Env.prototype.contains_ = function(haystack, needle) { - if (jasmine.isArray_(haystack)) { - for (var i = 0; i < haystack.length; i++) { - if (this.equals_(haystack[i], needle)) return true; - } - return false; - } - return haystack.indexOf(needle) >= 0; -}; - -jasmine.Env.prototype.addEqualityTester = function(equalityTester) { - this.equalityTesters_.push(equalityTester); -}; -/** No-op base class for Jasmine reporters. - * - * @constructor - */ -jasmine.Reporter = function() { -}; - -//noinspection JSUnusedLocalSymbols -jasmine.Reporter.prototype.reportRunnerStarting = function(runner) { -}; - -//noinspection JSUnusedLocalSymbols -jasmine.Reporter.prototype.reportRunnerResults = function(runner) { -}; - -//noinspection JSUnusedLocalSymbols -jasmine.Reporter.prototype.reportSuiteResults = function(suite) { -}; - -//noinspection JSUnusedLocalSymbols -jasmine.Reporter.prototype.reportSpecStarting = function(spec) { -}; - -//noinspection JSUnusedLocalSymbols -jasmine.Reporter.prototype.reportSpecResults = function(spec) { -}; - -//noinspection JSUnusedLocalSymbols -jasmine.Reporter.prototype.log = function(str) { -}; - -/** - * Blocks are functions with executable code that make up a spec. - * - * @constructor - * @param {jasmine.Env} env - * @param {Function} func - * @param {jasmine.Spec} spec - */ -jasmine.Block = function(env, func, spec) { - this.env = env; - this.func = func; - this.spec = spec; -}; - -jasmine.Block.prototype.execute = function(onComplete) { - try { - this.func.apply(this.spec); - } catch (e) { - this.spec.fail(e); - } - onComplete(); -}; -/** JavaScript API reporter. - * - * @constructor - */ -jasmine.JsApiReporter = function() { - this.started = false; - this.finished = false; - this.suites_ = []; - this.results_ = {}; -}; - -jasmine.JsApiReporter.prototype.reportRunnerStarting = function(runner) { - this.started = true; - var suites = runner.topLevelSuites(); - for (var i = 0; i < suites.length; i++) { - var suite = suites[i]; - this.suites_.push(this.summarize_(suite)); - } -}; - -jasmine.JsApiReporter.prototype.suites = function() { - return this.suites_; -}; - -jasmine.JsApiReporter.prototype.summarize_ = function(suiteOrSpec) { - var isSuite = suiteOrSpec instanceof jasmine.Suite; - var summary = { - id: suiteOrSpec.id, - name: suiteOrSpec.description, - type: isSuite ? 'suite' : 'spec', - children: [] - }; - - if (isSuite) { - var children = suiteOrSpec.children(); - for (var i = 0; i < children.length; i++) { - summary.children.push(this.summarize_(children[i])); - } - } - return summary; -}; - -jasmine.JsApiReporter.prototype.results = function() { - return this.results_; -}; - -jasmine.JsApiReporter.prototype.resultsForSpec = function(specId) { - return this.results_[specId]; -}; - -//noinspection JSUnusedLocalSymbols -jasmine.JsApiReporter.prototype.reportRunnerResults = function(runner) { - this.finished = true; -}; - -//noinspection JSUnusedLocalSymbols -jasmine.JsApiReporter.prototype.reportSuiteResults = function(suite) { -}; - -//noinspection JSUnusedLocalSymbols -jasmine.JsApiReporter.prototype.reportSpecResults = function(spec) { - this.results_[spec.id] = { - messages: spec.results().getItems(), - result: spec.results().failedCount > 0 ? "failed" : "passed" - }; -}; - -//noinspection JSUnusedLocalSymbols -jasmine.JsApiReporter.prototype.log = function(str) { -}; - -jasmine.JsApiReporter.prototype.resultsForSpecs = function(specIds){ - var results = {}; - for (var i = 0; i < specIds.length; i++) { - var specId = specIds[i]; - results[specId] = this.summarizeResult_(this.results_[specId]); - } - return results; -}; - -jasmine.JsApiReporter.prototype.summarizeResult_ = function(result){ - var summaryMessages = []; - var messagesLength = result.messages.length; - for (var messageIndex = 0; messageIndex < messagesLength; messageIndex++) { - var resultMessage = result.messages[messageIndex]; - summaryMessages.push({ - text: resultMessage.type == 'log' ? resultMessage.toString() : jasmine.undefined, - passed: resultMessage.passed ? resultMessage.passed() : true, - type: resultMessage.type, - message: resultMessage.message, - trace: { - stack: resultMessage.passed && !resultMessage.passed() ? resultMessage.trace.stack : jasmine.undefined - } - }); - } - - return { - result : result.result, - messages : summaryMessages - }; -}; - -/** - * @constructor - * @param {jasmine.Env} env - * @param actual - * @param {jasmine.Spec} spec - */ -jasmine.Matchers = function(env, actual, spec, opt_isNot) { - this.env = env; - this.actual = actual; - this.spec = spec; - this.isNot = opt_isNot || false; - this.reportWasCalled_ = false; -}; - -// todo: @deprecated as of Jasmine 0.11, remove soon [xw] -jasmine.Matchers.pp = function(str) { - throw new Error("jasmine.Matchers.pp() is no longer supported, please use jasmine.pp() instead!"); -}; - -// todo: @deprecated Deprecated as of Jasmine 0.10. Rewrite your custom matchers to return true or false. [xw] -jasmine.Matchers.prototype.report = function(result, failing_message, details) { - throw new Error("As of jasmine 0.11, custom matchers must be implemented differently -- please see jasmine docs"); -}; - -jasmine.Matchers.wrapInto_ = function(prototype, matchersClass) { - for (var methodName in prototype) { - if (methodName == 'report') continue; - var orig = prototype[methodName]; - matchersClass.prototype[methodName] = jasmine.Matchers.matcherFn_(methodName, orig); - } -}; - -jasmine.Matchers.matcherFn_ = function(matcherName, matcherFunction) { - return function() { - var matcherArgs = jasmine.util.argsToArray(arguments); - var result = matcherFunction.apply(this, arguments); - - if (this.isNot) { - result = !result; - } - - if (this.reportWasCalled_) return result; - - var message; - if (!result) { - if (this.message) { - message = this.message.apply(this, arguments); - if (jasmine.isArray_(message)) { - message = message[this.isNot ? 1 : 0]; - } - } else { - var englishyPredicate = matcherName.replace(/[A-Z]/g, function(s) { return ' ' + s.toLowerCase(); }); - message = "Expected " + jasmine.pp(this.actual) + (this.isNot ? " not " : " ") + englishyPredicate; - if (matcherArgs.length > 0) { - for (var i = 0; i < matcherArgs.length; i++) { - if (i > 0) message += ","; - message += " " + jasmine.pp(matcherArgs[i]); - } - } - message += "."; - } - } - var expectationResult = new jasmine.ExpectationResult({ - matcherName: matcherName, - passed: result, - expected: matcherArgs.length > 1 ? matcherArgs : matcherArgs[0], - actual: this.actual, - message: message - }); - this.spec.addMatcherResult(expectationResult); - return jasmine.undefined; - }; -}; - - - - -/** - * toBe: compares the actual to the expected using === - * @param expected - */ -jasmine.Matchers.prototype.toBe = function(expected) { - return this.actual === expected; -}; - -/** - * toNotBe: compares the actual to the expected using !== - * @param expected - * @deprecated as of 1.0. Use not.toBe() instead. - */ -jasmine.Matchers.prototype.toNotBe = function(expected) { - return this.actual !== expected; -}; - -/** - * toEqual: compares the actual to the expected using common sense equality. Handles Objects, Arrays, etc. - * - * @param expected - */ -jasmine.Matchers.prototype.toEqual = function(expected) { - return this.env.equals_(this.actual, expected); -}; - -/** - * toNotEqual: compares the actual to the expected using the ! of jasmine.Matchers.toEqual - * @param expected - * @deprecated as of 1.0. Use not.toEqual() instead. - */ -jasmine.Matchers.prototype.toNotEqual = function(expected) { - return !this.env.equals_(this.actual, expected); -}; - -/** - * Matcher that compares the actual to the expected using a regular expression. Constructs a RegExp, so takes - * a pattern or a String. - * - * @param expected - */ -jasmine.Matchers.prototype.toMatch = function(expected) { - return new RegExp(expected).test(this.actual); -}; - -/** - * Matcher that compares the actual to the expected using the boolean inverse of jasmine.Matchers.toMatch - * @param expected - * @deprecated as of 1.0. Use not.toMatch() instead. - */ -jasmine.Matchers.prototype.toNotMatch = function(expected) { - return !(new RegExp(expected).test(this.actual)); -}; - -/** - * Matcher that compares the actual to jasmine.undefined. - */ -jasmine.Matchers.prototype.toBeDefined = function() { - return (this.actual !== jasmine.undefined); -}; - -/** - * Matcher that compares the actual to jasmine.undefined. - */ -jasmine.Matchers.prototype.toBeUndefined = function() { - return (this.actual === jasmine.undefined); -}; - -/** - * Matcher that compares the actual to null. - */ -jasmine.Matchers.prototype.toBeNull = function() { - return (this.actual === null); -}; - -/** - * Matcher that boolean not-nots the actual. - */ -jasmine.Matchers.prototype.toBeTruthy = function() { - return !!this.actual; -}; - - -/** - * Matcher that boolean nots the actual. - */ -jasmine.Matchers.prototype.toBeFalsy = function() { - return !this.actual; -}; - - -/** - * Matcher that checks to see if the actual, a Jasmine spy, was called. - */ -jasmine.Matchers.prototype.toHaveBeenCalled = function() { - if (arguments.length > 0) { - throw new Error('toHaveBeenCalled does not take arguments, use toHaveBeenCalledWith'); - } - - if (!jasmine.isSpy(this.actual)) { - throw new Error('Expected a spy, but got ' + jasmine.pp(this.actual) + '.'); - } - - this.message = function() { - return [ - "Expected spy " + this.actual.identity + " to have been called.", - "Expected spy " + this.actual.identity + " not to have been called." - ]; - }; - - return this.actual.wasCalled; -}; - -/** @deprecated Use expect(xxx).toHaveBeenCalled() instead */ -jasmine.Matchers.prototype.wasCalled = jasmine.Matchers.prototype.toHaveBeenCalled; - -/** - * Matcher that checks to see if the actual, a Jasmine spy, was not called. - * - * @deprecated Use expect(xxx).not.toHaveBeenCalled() instead - */ -jasmine.Matchers.prototype.wasNotCalled = function() { - if (arguments.length > 0) { - throw new Error('wasNotCalled does not take arguments'); - } - - if (!jasmine.isSpy(this.actual)) { - throw new Error('Expected a spy, but got ' + jasmine.pp(this.actual) + '.'); - } - - this.message = function() { - return [ - "Expected spy " + this.actual.identity + " to not have been called.", - "Expected spy " + this.actual.identity + " to have been called." - ]; - }; - - return !this.actual.wasCalled; -}; - -/** - * Matcher that checks to see if the actual, a Jasmine spy, was called with a set of parameters. - * - * @example - * - */ -jasmine.Matchers.prototype.toHaveBeenCalledWith = function() { - var expectedArgs = jasmine.util.argsToArray(arguments); - if (!jasmine.isSpy(this.actual)) { - throw new Error('Expected a spy, but got ' + jasmine.pp(this.actual) + '.'); - } - this.message = function() { - if (this.actual.callCount === 0) { - // todo: what should the failure message for .not.toHaveBeenCalledWith() be? is this right? test better. [xw] - return [ - "Expected spy " + this.actual.identity + " to have been called with " + jasmine.pp(expectedArgs) + " but it was never called.", - "Expected spy " + this.actual.identity + " not to have been called with " + jasmine.pp(expectedArgs) + " but it was." - ]; - } else { - return [ - "Expected spy " + this.actual.identity + " to have been called with " + jasmine.pp(expectedArgs) + " but was called with " + jasmine.pp(this.actual.argsForCall), - "Expected spy " + this.actual.identity + " not to have been called with " + jasmine.pp(expectedArgs) + " but was called with " + jasmine.pp(this.actual.argsForCall) - ]; - } - }; - - return this.env.contains_(this.actual.argsForCall, expectedArgs); -}; - -/** @deprecated Use expect(xxx).toHaveBeenCalledWith() instead */ -jasmine.Matchers.prototype.wasCalledWith = jasmine.Matchers.prototype.toHaveBeenCalledWith; - -/** @deprecated Use expect(xxx).not.toHaveBeenCalledWith() instead */ -jasmine.Matchers.prototype.wasNotCalledWith = function() { - var expectedArgs = jasmine.util.argsToArray(arguments); - if (!jasmine.isSpy(this.actual)) { - throw new Error('Expected a spy, but got ' + jasmine.pp(this.actual) + '.'); - } - - this.message = function() { - return [ - "Expected spy not to have been called with " + jasmine.pp(expectedArgs) + " but it was", - "Expected spy to have been called with " + jasmine.pp(expectedArgs) + " but it was" - ]; - }; - - return !this.env.contains_(this.actual.argsForCall, expectedArgs); -}; - -/** - * Matcher that checks that the expected item is an element in the actual Array. - * - * @param {Object} expected - */ -jasmine.Matchers.prototype.toContain = function(expected) { - return this.env.contains_(this.actual, expected); -}; - -/** - * Matcher that checks that the expected item is NOT an element in the actual Array. - * - * @param {Object} expected - * @deprecated as of 1.0. Use not.toContain() instead. - */ -jasmine.Matchers.prototype.toNotContain = function(expected) { - return !this.env.contains_(this.actual, expected); -}; - -jasmine.Matchers.prototype.toBeLessThan = function(expected) { - return this.actual < expected; -}; - -jasmine.Matchers.prototype.toBeGreaterThan = function(expected) { - return this.actual > expected; -}; - -/** - * Matcher that checks that the expected item is equal to the actual item - * up to a given level of decimal precision (default 2). - * - * @param {Number} expected - * @param {Number} precision - */ -jasmine.Matchers.prototype.toBeCloseTo = function(expected, precision) { - if (!(precision === 0)) { - precision = precision || 2; - } - var multiplier = Math.pow(10, precision); - var actual = Math.round(this.actual * multiplier); - expected = Math.round(expected * multiplier); - return expected == actual; -}; - -/** - * Matcher that checks that the expected exception was thrown by the actual. - * - * @param {String} expected - */ -jasmine.Matchers.prototype.toThrow = function(expected) { - var result = false; - var exception; - if (typeof this.actual != 'function') { - throw new Error('Actual is not a function'); - } - try { - this.actual(); - } catch (e) { - exception = e; - } - if (exception) { - result = (expected === jasmine.undefined || this.env.equals_(exception.message || exception, expected.message || expected)); - } - - var not = this.isNot ? "not " : ""; - - this.message = function() { - if (exception && (expected === jasmine.undefined || !this.env.equals_(exception.message || exception, expected.message || expected))) { - return ["Expected function " + not + "to throw", expected ? expected.message || expected : "an exception", ", but it threw", exception.message || exception].join(' '); - } else { - return "Expected function to throw an exception."; - } - }; - - return result; -}; - -jasmine.Matchers.Any = function(expectedClass) { - this.expectedClass = expectedClass; -}; - -jasmine.Matchers.Any.prototype.jasmineMatches = function(other) { - if (this.expectedClass == String) { - return typeof other == 'string' || other instanceof String; - } - - if (this.expectedClass == Number) { - return typeof other == 'number' || other instanceof Number; - } - - if (this.expectedClass == Function) { - return typeof other == 'function' || other instanceof Function; - } - - if (this.expectedClass == Object) { - return typeof other == 'object'; - } - - return other instanceof this.expectedClass; -}; - -jasmine.Matchers.Any.prototype.jasmineToString = function() { - return ''; -}; - -jasmine.Matchers.ObjectContaining = function (sample) { - this.sample = sample; -}; - -jasmine.Matchers.ObjectContaining.prototype.jasmineMatches = function(other, mismatchKeys, mismatchValues) { - mismatchKeys = mismatchKeys || []; - mismatchValues = mismatchValues || []; - - var env = jasmine.getEnv(); - - var hasKey = function(obj, keyName) { - return obj != null && obj[keyName] !== jasmine.undefined; - }; - - for (var property in this.sample) { - if (!hasKey(other, property) && hasKey(this.sample, property)) { - mismatchKeys.push("expected has key '" + property + "', but missing from actual."); - } - else if (!env.equals_(this.sample[property], other[property], mismatchKeys, mismatchValues)) { - mismatchValues.push("'" + property + "' was '" + (other[property] ? jasmine.util.htmlEscape(other[property].toString()) : other[property]) + "' in expected, but was '" + (this.sample[property] ? jasmine.util.htmlEscape(this.sample[property].toString()) : this.sample[property]) + "' in actual."); - } - } - - return (mismatchKeys.length === 0 && mismatchValues.length === 0); -}; - -jasmine.Matchers.ObjectContaining.prototype.jasmineToString = function () { - return ""; -}; -// Mock setTimeout, clearTimeout -// Contributed by Pivotal Computer Systems, www.pivotalsf.com - -jasmine.FakeTimer = function() { - this.reset(); - - var self = this; - self.setTimeout = function(funcToCall, millis) { - self.timeoutsMade++; - self.scheduleFunction(self.timeoutsMade, funcToCall, millis, false); - return self.timeoutsMade; - }; - - self.setInterval = function(funcToCall, millis) { - self.timeoutsMade++; - self.scheduleFunction(self.timeoutsMade, funcToCall, millis, true); - return self.timeoutsMade; - }; - - self.clearTimeout = function(timeoutKey) { - self.scheduledFunctions[timeoutKey] = jasmine.undefined; - }; - - self.clearInterval = function(timeoutKey) { - self.scheduledFunctions[timeoutKey] = jasmine.undefined; - }; - -}; - -jasmine.FakeTimer.prototype.reset = function() { - this.timeoutsMade = 0; - this.scheduledFunctions = {}; - this.nowMillis = 0; -}; - -jasmine.FakeTimer.prototype.tick = function(millis) { - var oldMillis = this.nowMillis; - var newMillis = oldMillis + millis; - this.runFunctionsWithinRange(oldMillis, newMillis); - this.nowMillis = newMillis; -}; - -jasmine.FakeTimer.prototype.runFunctionsWithinRange = function(oldMillis, nowMillis) { - var scheduledFunc; - var funcsToRun = []; - for (var timeoutKey in this.scheduledFunctions) { - scheduledFunc = this.scheduledFunctions[timeoutKey]; - if (scheduledFunc != jasmine.undefined && - scheduledFunc.runAtMillis >= oldMillis && - scheduledFunc.runAtMillis <= nowMillis) { - funcsToRun.push(scheduledFunc); - this.scheduledFunctions[timeoutKey] = jasmine.undefined; - } - } - - if (funcsToRun.length > 0) { - funcsToRun.sort(function(a, b) { - return a.runAtMillis - b.runAtMillis; - }); - for (var i = 0; i < funcsToRun.length; ++i) { - try { - var funcToRun = funcsToRun[i]; - this.nowMillis = funcToRun.runAtMillis; - funcToRun.funcToCall(); - if (funcToRun.recurring) { - this.scheduleFunction(funcToRun.timeoutKey, - funcToRun.funcToCall, - funcToRun.millis, - true); - } - } catch(e) { - } - } - this.runFunctionsWithinRange(oldMillis, nowMillis); - } -}; - -jasmine.FakeTimer.prototype.scheduleFunction = function(timeoutKey, funcToCall, millis, recurring) { - this.scheduledFunctions[timeoutKey] = { - runAtMillis: this.nowMillis + millis, - funcToCall: funcToCall, - recurring: recurring, - timeoutKey: timeoutKey, - millis: millis - }; -}; - -/** - * @namespace - */ -jasmine.Clock = { - defaultFakeTimer: new jasmine.FakeTimer(), - - reset: function() { - jasmine.Clock.assertInstalled(); - jasmine.Clock.defaultFakeTimer.reset(); - }, - - tick: function(millis) { - jasmine.Clock.assertInstalled(); - jasmine.Clock.defaultFakeTimer.tick(millis); - }, - - runFunctionsWithinRange: function(oldMillis, nowMillis) { - jasmine.Clock.defaultFakeTimer.runFunctionsWithinRange(oldMillis, nowMillis); - }, - - scheduleFunction: function(timeoutKey, funcToCall, millis, recurring) { - jasmine.Clock.defaultFakeTimer.scheduleFunction(timeoutKey, funcToCall, millis, recurring); - }, - - useMock: function() { - if (!jasmine.Clock.isInstalled()) { - var spec = jasmine.getEnv().currentSpec; - spec.after(jasmine.Clock.uninstallMock); - - jasmine.Clock.installMock(); - } - }, - - installMock: function() { - jasmine.Clock.installed = jasmine.Clock.defaultFakeTimer; - }, - - uninstallMock: function() { - jasmine.Clock.assertInstalled(); - jasmine.Clock.installed = jasmine.Clock.real; - }, - - real: { - setTimeout: jasmine.getGlobal().setTimeout, - clearTimeout: jasmine.getGlobal().clearTimeout, - setInterval: jasmine.getGlobal().setInterval, - clearInterval: jasmine.getGlobal().clearInterval - }, - - assertInstalled: function() { - if (!jasmine.Clock.isInstalled()) { - throw new Error("Mock clock is not installed, use jasmine.Clock.useMock()"); - } - }, - - isInstalled: function() { - return jasmine.Clock.installed == jasmine.Clock.defaultFakeTimer; - }, - - installed: null -}; -jasmine.Clock.installed = jasmine.Clock.real; - -//else for IE support -jasmine.getGlobal().setTimeout = function(funcToCall, millis) { - if (jasmine.Clock.installed.setTimeout.apply) { - return jasmine.Clock.installed.setTimeout.apply(this, arguments); - } else { - return jasmine.Clock.installed.setTimeout(funcToCall, millis); - } -}; - -jasmine.getGlobal().setInterval = function(funcToCall, millis) { - if (jasmine.Clock.installed.setInterval.apply) { - return jasmine.Clock.installed.setInterval.apply(this, arguments); - } else { - return jasmine.Clock.installed.setInterval(funcToCall, millis); - } -}; - -jasmine.getGlobal().clearTimeout = function(timeoutKey) { - if (jasmine.Clock.installed.clearTimeout.apply) { - return jasmine.Clock.installed.clearTimeout.apply(this, arguments); - } else { - return jasmine.Clock.installed.clearTimeout(timeoutKey); - } -}; - -jasmine.getGlobal().clearInterval = function(timeoutKey) { - if (jasmine.Clock.installed.clearTimeout.apply) { - return jasmine.Clock.installed.clearInterval.apply(this, arguments); - } else { - return jasmine.Clock.installed.clearInterval(timeoutKey); - } -}; - -/** - * @constructor - */ -jasmine.MultiReporter = function() { - this.subReporters_ = []; -}; -jasmine.util.inherit(jasmine.MultiReporter, jasmine.Reporter); - -jasmine.MultiReporter.prototype.addReporter = function(reporter) { - this.subReporters_.push(reporter); -}; - -(function() { - var functionNames = [ - "reportRunnerStarting", - "reportRunnerResults", - "reportSuiteResults", - "reportSpecStarting", - "reportSpecResults", - "log" - ]; - for (var i = 0; i < functionNames.length; i++) { - var functionName = functionNames[i]; - jasmine.MultiReporter.prototype[functionName] = (function(functionName) { - return function() { - for (var j = 0; j < this.subReporters_.length; j++) { - var subReporter = this.subReporters_[j]; - if (subReporter[functionName]) { - subReporter[functionName].apply(subReporter, arguments); - } - } - }; - })(functionName); - } -})(); -/** - * Holds results for a set of Jasmine spec. Allows for the results array to hold another jasmine.NestedResults - * - * @constructor - */ -jasmine.NestedResults = function() { - /** - * The total count of results - */ - this.totalCount = 0; - /** - * Number of passed results - */ - this.passedCount = 0; - /** - * Number of failed results - */ - this.failedCount = 0; - /** - * Was this suite/spec skipped? - */ - this.skipped = false; - /** - * @ignore - */ - this.items_ = []; -}; - -/** - * Roll up the result counts. - * - * @param result - */ -jasmine.NestedResults.prototype.rollupCounts = function(result) { - this.totalCount += result.totalCount; - this.passedCount += result.passedCount; - this.failedCount += result.failedCount; -}; - -/** - * Adds a log message. - * @param values Array of message parts which will be concatenated later. - */ -jasmine.NestedResults.prototype.log = function(values) { - this.items_.push(new jasmine.MessageResult(values)); -}; - -/** - * Getter for the results: message & results. - */ -jasmine.NestedResults.prototype.getItems = function() { - return this.items_; -}; - -/** - * Adds a result, tracking counts (total, passed, & failed) - * @param {jasmine.ExpectationResult|jasmine.NestedResults} result - */ -jasmine.NestedResults.prototype.addResult = function(result) { - if (result.type != 'log') { - if (result.items_) { - this.rollupCounts(result); - } else { - this.totalCount++; - if (result.passed()) { - this.passedCount++; - } else { - this.failedCount++; - } - } - } - this.items_.push(result); -}; - -/** - * @returns {Boolean} True if everything below passed - */ -jasmine.NestedResults.prototype.passed = function() { - return this.passedCount === this.totalCount; -}; -/** - * Base class for pretty printing for expectation results. - */ -jasmine.PrettyPrinter = function() { - this.ppNestLevel_ = 0; -}; - -/** - * Formats a value in a nice, human-readable string. - * - * @param value - */ -jasmine.PrettyPrinter.prototype.format = function(value) { - if (this.ppNestLevel_ > 40) { - throw new Error('jasmine.PrettyPrinter: format() nested too deeply!'); - } - - this.ppNestLevel_++; - try { - if (value === jasmine.undefined) { - this.emitScalar('undefined'); - } else if (value === null) { - this.emitScalar('null'); - } else if (value === jasmine.getGlobal()) { - this.emitScalar(''); - } else if (value.jasmineToString) { - this.emitScalar(value.jasmineToString()); - } else if (typeof value === 'string') { - this.emitString(value); - } else if (jasmine.isSpy(value)) { - this.emitScalar("spy on " + value.identity); - } else if (value instanceof RegExp) { - this.emitScalar(value.toString()); - } else if (typeof value === 'function') { - this.emitScalar('Function'); - } else if (typeof value.nodeType === 'number') { - this.emitScalar('HTMLNode'); - } else if (value instanceof Date) { - this.emitScalar('Date(' + value + ')'); - } else if (value.__Jasmine_been_here_before__) { - this.emitScalar(''); - } else if (jasmine.isArray_(value) || typeof value == 'object') { - value.__Jasmine_been_here_before__ = true; - if (jasmine.isArray_(value)) { - this.emitArray(value); - } else { - this.emitObject(value); - } - delete value.__Jasmine_been_here_before__; - } else { - this.emitScalar(value.toString()); - } - } finally { - this.ppNestLevel_--; - } -}; - -jasmine.PrettyPrinter.prototype.iterateObject = function(obj, fn) { - for (var property in obj) { - if (property == '__Jasmine_been_here_before__') continue; - fn(property, obj.__lookupGetter__ ? (obj.__lookupGetter__(property) !== jasmine.undefined && - obj.__lookupGetter__(property) !== null) : false); - } -}; - -jasmine.PrettyPrinter.prototype.emitArray = jasmine.unimplementedMethod_; -jasmine.PrettyPrinter.prototype.emitObject = jasmine.unimplementedMethod_; -jasmine.PrettyPrinter.prototype.emitScalar = jasmine.unimplementedMethod_; -jasmine.PrettyPrinter.prototype.emitString = jasmine.unimplementedMethod_; - -jasmine.StringPrettyPrinter = function() { - jasmine.PrettyPrinter.call(this); - - this.string = ''; -}; -jasmine.util.inherit(jasmine.StringPrettyPrinter, jasmine.PrettyPrinter); - -jasmine.StringPrettyPrinter.prototype.emitScalar = function(value) { - this.append(value); -}; - -jasmine.StringPrettyPrinter.prototype.emitString = function(value) { - this.append("'" + value + "'"); -}; - -jasmine.StringPrettyPrinter.prototype.emitArray = function(array) { - this.append('[ '); - for (var i = 0; i < array.length; i++) { - if (i > 0) { - this.append(', '); - } - this.format(array[i]); - } - this.append(' ]'); -}; - -jasmine.StringPrettyPrinter.prototype.emitObject = function(obj) { - var self = this; - this.append('{ '); - var first = true; - - this.iterateObject(obj, function(property, isGetter) { - if (first) { - first = false; - } else { - self.append(', '); - } - - self.append(property); - self.append(' : '); - if (isGetter) { - self.append(''); - } else { - self.format(obj[property]); - } - }); - - this.append(' }'); -}; - -jasmine.StringPrettyPrinter.prototype.append = function(value) { - this.string += value; -}; -jasmine.Queue = function(env) { - this.env = env; - this.blocks = []; - this.running = false; - this.index = 0; - this.offset = 0; - this.abort = false; -}; - -jasmine.Queue.prototype.addBefore = function(block) { - this.blocks.unshift(block); -}; - -jasmine.Queue.prototype.add = function(block) { - this.blocks.push(block); -}; - -jasmine.Queue.prototype.insertNext = function(block) { - this.blocks.splice((this.index + this.offset + 1), 0, block); - this.offset++; -}; - -jasmine.Queue.prototype.start = function(onComplete) { - this.running = true; - this.onComplete = onComplete; - this.next_(); -}; - -jasmine.Queue.prototype.isRunning = function() { - return this.running; -}; - -jasmine.Queue.LOOP_DONT_RECURSE = true; - -jasmine.Queue.prototype.next_ = function() { - var self = this; - var goAgain = true; - - while (goAgain) { - goAgain = false; - - if (self.index < self.blocks.length && !this.abort) { - var calledSynchronously = true; - var completedSynchronously = false; - - var onComplete = function () { - if (jasmine.Queue.LOOP_DONT_RECURSE && calledSynchronously) { - completedSynchronously = true; - return; - } - - if (self.blocks[self.index].abort) { - self.abort = true; - } - - self.offset = 0; - self.index++; - - var now = new Date().getTime(); - if (self.env.updateInterval && now - self.env.lastUpdate > self.env.updateInterval) { - self.env.lastUpdate = now; - self.env.setTimeout(function() { - self.next_(); - }, 0); - } else { - if (jasmine.Queue.LOOP_DONT_RECURSE && completedSynchronously) { - goAgain = true; - } else { - self.next_(); - } - } - }; - self.blocks[self.index].execute(onComplete); - - calledSynchronously = false; - if (completedSynchronously) { - onComplete(); - } - - } else { - self.running = false; - if (self.onComplete) { - self.onComplete(); - } - } - } -}; - -jasmine.Queue.prototype.results = function() { - var results = new jasmine.NestedResults(); - for (var i = 0; i < this.blocks.length; i++) { - if (this.blocks[i].results) { - results.addResult(this.blocks[i].results()); - } - } - return results; -}; - - -/** - * Runner - * - * @constructor - * @param {jasmine.Env} env - */ -jasmine.Runner = function(env) { - var self = this; - self.env = env; - self.queue = new jasmine.Queue(env); - self.before_ = []; - self.after_ = []; - self.suites_ = []; -}; - -jasmine.Runner.prototype.execute = function() { - var self = this; - if (self.env.reporter.reportRunnerStarting) { - self.env.reporter.reportRunnerStarting(this); - } - self.queue.start(function () { - self.finishCallback(); - }); -}; - -jasmine.Runner.prototype.beforeEach = function(beforeEachFunction) { - beforeEachFunction.typeName = 'beforeEach'; - this.before_.splice(0,0,beforeEachFunction); -}; - -jasmine.Runner.prototype.afterEach = function(afterEachFunction) { - afterEachFunction.typeName = 'afterEach'; - this.after_.splice(0,0,afterEachFunction); -}; - - -jasmine.Runner.prototype.finishCallback = function() { - this.env.reporter.reportRunnerResults(this); -}; - -jasmine.Runner.prototype.addSuite = function(suite) { - this.suites_.push(suite); -}; - -jasmine.Runner.prototype.add = function(block) { - if (block instanceof jasmine.Suite) { - this.addSuite(block); - } - this.queue.add(block); -}; - -jasmine.Runner.prototype.specs = function () { - var suites = this.suites(); - var specs = []; - for (var i = 0; i < suites.length; i++) { - specs = specs.concat(suites[i].specs()); - } - return specs; -}; - -jasmine.Runner.prototype.suites = function() { - return this.suites_; -}; - -jasmine.Runner.prototype.topLevelSuites = function() { - var topLevelSuites = []; - for (var i = 0; i < this.suites_.length; i++) { - if (!this.suites_[i].parentSuite) { - topLevelSuites.push(this.suites_[i]); - } - } - return topLevelSuites; -}; - -jasmine.Runner.prototype.results = function() { - return this.queue.results(); -}; -/** - * Internal representation of a Jasmine specification, or test. - * - * @constructor - * @param {jasmine.Env} env - * @param {jasmine.Suite} suite - * @param {String} description - */ -jasmine.Spec = function(env, suite, description) { - if (!env) { - throw new Error('jasmine.Env() required'); - } - if (!suite) { - throw new Error('jasmine.Suite() required'); - } - var spec = this; - spec.id = env.nextSpecId ? env.nextSpecId() : null; - spec.env = env; - spec.suite = suite; - spec.description = description; - spec.queue = new jasmine.Queue(env); - - spec.afterCallbacks = []; - spec.spies_ = []; - - spec.results_ = new jasmine.NestedResults(); - spec.results_.description = description; - spec.matchersClass = null; -}; - -jasmine.Spec.prototype.getFullName = function() { - return this.suite.getFullName() + ' ' + this.description + '.'; -}; - - -jasmine.Spec.prototype.results = function() { - return this.results_; -}; - -/** - * All parameters are pretty-printed and concatenated together, then written to the spec's output. - * - * Be careful not to leave calls to jasmine.log in production code. - */ -jasmine.Spec.prototype.log = function() { - return this.results_.log(arguments); -}; - -jasmine.Spec.prototype.runs = function (func) { - var block = new jasmine.Block(this.env, func, this); - this.addToQueue(block); - return this; -}; - -jasmine.Spec.prototype.addToQueue = function (block) { - if (this.queue.isRunning()) { - this.queue.insertNext(block); - } else { - this.queue.add(block); - } -}; - -/** - * @param {jasmine.ExpectationResult} result - */ -jasmine.Spec.prototype.addMatcherResult = function(result) { - this.results_.addResult(result); -}; - -jasmine.Spec.prototype.expect = function(actual) { - var positive = new (this.getMatchersClass_())(this.env, actual, this); - positive.not = new (this.getMatchersClass_())(this.env, actual, this, true); - return positive; -}; - -/** - * Waits a fixed time period before moving to the next block. - * - * @deprecated Use waitsFor() instead - * @param {Number} timeout milliseconds to wait - */ -jasmine.Spec.prototype.waits = function(timeout) { - var waitsFunc = new jasmine.WaitsBlock(this.env, timeout, this); - this.addToQueue(waitsFunc); - return this; -}; - -/** - * Waits for the latchFunction to return true before proceeding to the next block. - * - * @param {Function} latchFunction - * @param {String} optional_timeoutMessage - * @param {Number} optional_timeout - */ -jasmine.Spec.prototype.waitsFor = function(latchFunction, optional_timeoutMessage, optional_timeout) { - var latchFunction_ = null; - var optional_timeoutMessage_ = null; - var optional_timeout_ = null; - - for (var i = 0; i < arguments.length; i++) { - var arg = arguments[i]; - switch (typeof arg) { - case 'function': - latchFunction_ = arg; - break; - case 'string': - optional_timeoutMessage_ = arg; - break; - case 'number': - optional_timeout_ = arg; - break; - } - } - - var waitsForFunc = new jasmine.WaitsForBlock(this.env, optional_timeout_, latchFunction_, optional_timeoutMessage_, this); - this.addToQueue(waitsForFunc); - return this; -}; - -jasmine.Spec.prototype.fail = function (e) { - var expectationResult = new jasmine.ExpectationResult({ - passed: false, - message: e ? jasmine.util.formatException(e) : 'Exception', - trace: { stack: e.stack } - }); - this.results_.addResult(expectationResult); -}; - -jasmine.Spec.prototype.getMatchersClass_ = function() { - return this.matchersClass || this.env.matchersClass; -}; - -jasmine.Spec.prototype.addMatchers = function(matchersPrototype) { - var parent = this.getMatchersClass_(); - var newMatchersClass = function() { - parent.apply(this, arguments); - }; - jasmine.util.inherit(newMatchersClass, parent); - jasmine.Matchers.wrapInto_(matchersPrototype, newMatchersClass); - this.matchersClass = newMatchersClass; -}; - -jasmine.Spec.prototype.finishCallback = function() { - this.env.reporter.reportSpecResults(this); -}; - -jasmine.Spec.prototype.finish = function(onComplete) { - this.removeAllSpies(); - this.finishCallback(); - if (onComplete) { - onComplete(); - } -}; - -jasmine.Spec.prototype.after = function(doAfter) { - if (this.queue.isRunning()) { - this.queue.add(new jasmine.Block(this.env, doAfter, this)); - } else { - this.afterCallbacks.unshift(doAfter); - } -}; - -jasmine.Spec.prototype.execute = function(onComplete) { - var spec = this; - if (!spec.env.specFilter(spec)) { - spec.results_.skipped = true; - spec.finish(onComplete); - return; - } - - this.env.reporter.reportSpecStarting(this); - - spec.env.currentSpec = spec; - - spec.addBeforesAndAftersToQueue(); - - spec.queue.start(function () { - spec.finish(onComplete); - }); -}; - -jasmine.Spec.prototype.addBeforesAndAftersToQueue = function() { - var runner = this.env.currentRunner(); - var i; - - for (var suite = this.suite; suite; suite = suite.parentSuite) { - for (i = 0; i < suite.before_.length; i++) { - this.queue.addBefore(new jasmine.Block(this.env, suite.before_[i], this)); - } - } - for (i = 0; i < runner.before_.length; i++) { - this.queue.addBefore(new jasmine.Block(this.env, runner.before_[i], this)); - } - for (i = 0; i < this.afterCallbacks.length; i++) { - this.queue.add(new jasmine.Block(this.env, this.afterCallbacks[i], this)); - } - for (suite = this.suite; suite; suite = suite.parentSuite) { - for (i = 0; i < suite.after_.length; i++) { - this.queue.add(new jasmine.Block(this.env, suite.after_[i], this)); - } - } - for (i = 0; i < runner.after_.length; i++) { - this.queue.add(new jasmine.Block(this.env, runner.after_[i], this)); - } -}; - -jasmine.Spec.prototype.explodes = function() { - throw 'explodes function should not have been called'; -}; - -jasmine.Spec.prototype.spyOn = function(obj, methodName, ignoreMethodDoesntExist) { - if (obj == jasmine.undefined) { - throw "spyOn could not find an object to spy upon for " + methodName + "()"; - } - - if (!ignoreMethodDoesntExist && obj[methodName] === jasmine.undefined) { - throw methodName + '() method does not exist'; - } - - if (!ignoreMethodDoesntExist && obj[methodName] && obj[methodName].isSpy) { - throw new Error(methodName + ' has already been spied upon'); - } - - var spyObj = jasmine.createSpy(methodName); - - this.spies_.push(spyObj); - spyObj.baseObj = obj; - spyObj.methodName = methodName; - spyObj.originalValue = obj[methodName]; - - obj[methodName] = spyObj; - - return spyObj; -}; - -jasmine.Spec.prototype.removeAllSpies = function() { - for (var i = 0; i < this.spies_.length; i++) { - var spy = this.spies_[i]; - spy.baseObj[spy.methodName] = spy.originalValue; - } - this.spies_ = []; -}; - -/** - * Internal representation of a Jasmine suite. - * - * @constructor - * @param {jasmine.Env} env - * @param {String} description - * @param {Function} specDefinitions - * @param {jasmine.Suite} parentSuite - */ -jasmine.Suite = function(env, description, specDefinitions, parentSuite) { - var self = this; - self.id = env.nextSuiteId ? env.nextSuiteId() : null; - self.description = description; - self.queue = new jasmine.Queue(env); - self.parentSuite = parentSuite; - self.env = env; - self.before_ = []; - self.after_ = []; - self.children_ = []; - self.suites_ = []; - self.specs_ = []; -}; - -jasmine.Suite.prototype.getFullName = function() { - var fullName = this.description; - for (var parentSuite = this.parentSuite; parentSuite; parentSuite = parentSuite.parentSuite) { - fullName = parentSuite.description + ' ' + fullName; - } - return fullName; -}; - -jasmine.Suite.prototype.finish = function(onComplete) { - this.env.reporter.reportSuiteResults(this); - this.finished = true; - if (typeof(onComplete) == 'function') { - onComplete(); - } -}; - -jasmine.Suite.prototype.beforeEach = function(beforeEachFunction) { - beforeEachFunction.typeName = 'beforeEach'; - this.before_.unshift(beforeEachFunction); -}; - -jasmine.Suite.prototype.afterEach = function(afterEachFunction) { - afterEachFunction.typeName = 'afterEach'; - this.after_.unshift(afterEachFunction); -}; - -jasmine.Suite.prototype.results = function() { - return this.queue.results(); -}; - -jasmine.Suite.prototype.add = function(suiteOrSpec) { - this.children_.push(suiteOrSpec); - if (suiteOrSpec instanceof jasmine.Suite) { - this.suites_.push(suiteOrSpec); - this.env.currentRunner().addSuite(suiteOrSpec); - } else { - this.specs_.push(suiteOrSpec); - } - this.queue.add(suiteOrSpec); -}; - -jasmine.Suite.prototype.specs = function() { - return this.specs_; -}; - -jasmine.Suite.prototype.suites = function() { - return this.suites_; -}; - -jasmine.Suite.prototype.children = function() { - return this.children_; -}; - -jasmine.Suite.prototype.execute = function(onComplete) { - var self = this; - this.queue.start(function () { - self.finish(onComplete); - }); -}; -jasmine.WaitsBlock = function(env, timeout, spec) { - this.timeout = timeout; - jasmine.Block.call(this, env, null, spec); -}; - -jasmine.util.inherit(jasmine.WaitsBlock, jasmine.Block); - -jasmine.WaitsBlock.prototype.execute = function (onComplete) { - if (jasmine.VERBOSE) { - this.env.reporter.log('>> Jasmine waiting for ' + this.timeout + ' ms...'); - } - this.env.setTimeout(function () { - onComplete(); - }, this.timeout); -}; -/** - * A block which waits for some condition to become true, with timeout. - * - * @constructor - * @extends jasmine.Block - * @param {jasmine.Env} env The Jasmine environment. - * @param {Number} timeout The maximum time in milliseconds to wait for the condition to become true. - * @param {Function} latchFunction A function which returns true when the desired condition has been met. - * @param {String} message The message to display if the desired condition hasn't been met within the given time period. - * @param {jasmine.Spec} spec The Jasmine spec. - */ -jasmine.WaitsForBlock = function(env, timeout, latchFunction, message, spec) { - this.timeout = timeout || env.defaultTimeoutInterval; - this.latchFunction = latchFunction; - this.message = message; - this.totalTimeSpentWaitingForLatch = 0; - jasmine.Block.call(this, env, null, spec); -}; -jasmine.util.inherit(jasmine.WaitsForBlock, jasmine.Block); - -jasmine.WaitsForBlock.TIMEOUT_INCREMENT = 10; - -jasmine.WaitsForBlock.prototype.execute = function(onComplete) { - if (jasmine.VERBOSE) { - this.env.reporter.log('>> Jasmine waiting for ' + (this.message || 'something to happen')); - } - var latchFunctionResult; - try { - latchFunctionResult = this.latchFunction.apply(this.spec); - } catch (e) { - this.spec.fail(e); - onComplete(); - return; - } - - if (latchFunctionResult) { - onComplete(); - } else if (this.totalTimeSpentWaitingForLatch >= this.timeout) { - var message = 'timed out after ' + this.timeout + ' msec waiting for ' + (this.message || 'something to happen'); - this.spec.fail({ - name: 'timeout', - message: message - }); - - this.abort = true; - onComplete(); - } else { - this.totalTimeSpentWaitingForLatch += jasmine.WaitsForBlock.TIMEOUT_INCREMENT; - var self = this; - this.env.setTimeout(function() { - self.execute(onComplete); - }, jasmine.WaitsForBlock.TIMEOUT_INCREMENT); - } -}; - -jasmine.version_= { - "major": 1, - "minor": 2, - "build": 0, - "revision": 1333310630, - "release_candidate": 1 -}; diff --git a/plugins/org.apache.cordova.core.file/test/autotest/pages/file.html b/plugins/org.apache.cordova.core.file/test/autotest/pages/file.html deleted file mode 100644 index d143c74..0000000 --- a/plugins/org.apache.cordova.core.file/test/autotest/pages/file.html +++ /dev/null @@ -1,90 +0,0 @@ - - - - - - - Cordova: File API Specs - - - - - - - - - - - - - - - - - - - - - - - - - - Back - - diff --git a/plugins/org.apache.cordova.core.file/test/autotest/test-runner.js b/plugins/org.apache.cordova.core.file/test/autotest/test-runner.js deleted file mode 100644 index f72b3cc..0000000 --- a/plugins/org.apache.cordova.core.file/test/autotest/test-runner.js +++ /dev/null @@ -1,62 +0,0 @@ -/* - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - * -*/ - -if (window.sessionStorage != null) { - window.sessionStorage.clear(); -} - -// Timeout is 2 seconds to allow physical devices enough -// time to query the response. This is important for some -// Android devices. -var Tests = function() {}; -Tests.TEST_TIMEOUT = 7500; - -// Creates a spy that will fail if called. -function createDoNotCallSpy(name, opt_extraMessage) { - return jasmine.createSpy().andCallFake(function() { - var errorMessage = name + ' should not have been called.'; - if (arguments.length) { - errorMessage += ' Got args: ' + JSON.stringify(arguments); - } - if (opt_extraMessage) { - errorMessage += '\n' + opt_extraMessage; - } - expect(false).toBe(true, errorMessage); - }); -} - -// Waits for any of the given spys to be called. -// Last param may be a custom timeout duration. -function waitsForAny() { - var spys = [].slice.call(arguments); - var timeout = Tests.TEST_TIMEOUT; - if (typeof spys[spys.length - 1] == 'number') { - timeout = spys.pop(); - } - waitsFor(function() { - for (var i = 0; i < spys.length; ++i) { - if (spys[i].wasCalled) { - return true; - } - } - return false; - }, "Expecting callbacks to be called.", timeout); -} diff --git a/plugins/org.apache.cordova.core.file/test/autotest/tests/file.tests.js b/plugins/org.apache.cordova.core.file/test/autotest/tests/file.tests.js deleted file mode 100644 index 3ebaffc..0000000 --- a/plugins/org.apache.cordova.core.file/test/autotest/tests/file.tests.js +++ /dev/null @@ -1,3590 +0,0 @@ -/* - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - * -*/ - -describe('File API', function() { - // Adding a Jasmine helper matcher, to report errors when comparing to FileError better. - var fileErrorMap = { - 1: 'NOT_FOUND_ERR', - 2: 'SECURITY_ERR', - 3: 'ABORT_ERR', - 4: 'NOT_READABLE_ERR', - 5: 'ENCODING_ERR', - 6: 'NO_MODIFICATION_ALLOWED_ERR', - 7: 'INVALID_STATE_ERR', - 8: 'SYNTAX_ERR', - 9: 'INVALID_MODIFICATION_ERR', - 10:'QUOTA_EXCEEDED_ERR', - 11:'TYPE_MISMATCH_ERR', - 12:'PATH_EXISTS_ERR' - }; - beforeEach(function() { - this.addMatchers({ - toBeFileError: function(code) { - var error = this.actual; - this.message = function(){ - return "Expected FileError with code " + fileErrorMap[error.code] + " (" + error.code + ") to be " + fileErrorMap[code] + "(" + code + ")"; - }; - return (error.code == code); - }, - toCanonicallyMatch:function(path){ - this.message = function(){ - return "Expected paths to match : " + path + " should be " + this.actual; - }; - - var a = path.split("/").join("").split("\\").join(""); - var b = this.actual.split("/").join("").split("\\").join(""); - - return a == b; - } - }); - }); - - // HELPER FUNCTIONS - - // deletes specified file or directory - var deleteEntry = function(name, success, error) { - // deletes entry, if it exists - window.resolveLocalFileSystemURI(root.toURL() + '/' + name, - function(entry) { - if (entry.isDirectory === true) { - entry.removeRecursively(success, error); - } else { - entry.remove(success, error); - } - }, success); - }; - // deletes file, if it exists, then invokes callback - var deleteFile = function(fileName, callback) { - root.getFile(fileName, null, - // remove file system entry - function(entry) { - entry.remove(callback, function() { console.log('[ERROR] deleteFile cleanup method invoked fail callback.'); }); - }, - // doesn't exist - callback); - }; - // deletes and re-creates the specified file - var createFile = function(fileName, success, error) { - deleteEntry(fileName, function() { - root.getFile(fileName, {create: true}, success, error); - }, error); - }; - // deletes and re-creates the specified directory - var createDirectory = function(dirName, success, error) { - deleteEntry(dirName, function() { - root.getDirectory(dirName, {create: true}, success, error); - }, error); - }; - - var createFail = function(module) { - return jasmine.createSpy().andCallFake(function(err) { - console.log('[ERROR ' + module + '] ' + JSON.stringify(err)); - }); - }; - - var createWin = function(module) { - return jasmine.createSpy().andCallFake(function() { - console.log('[ERROR ' + module + '] Unexpected success callback'); - }); - }; - - describe('FileError object', function() { - it("file.spec.1 should define FileError constants", function() { - expect(FileError.NOT_FOUND_ERR).toBe(1); - expect(FileError.SECURITY_ERR).toBe(2); - expect(FileError.ABORT_ERR).toBe(3); - expect(FileError.NOT_READABLE_ERR).toBe(4); - expect(FileError.ENCODING_ERR).toBe(5); - expect(FileError.NO_MODIFICATION_ALLOWED_ERR).toBe(6); - expect(FileError.INVALID_STATE_ERR).toBe(7); - expect(FileError.SYNTAX_ERR).toBe(8); - expect(FileError.INVALID_MODIFICATION_ERR).toBe(9); - expect(FileError.QUOTA_EXCEEDED_ERR).toBe(10); - expect(FileError.TYPE_MISMATCH_ERR).toBe(11); - expect(FileError.PATH_EXISTS_ERR).toBe(12); - }); - }); - - describe('LocalFileSystem', function() { - - it("file.spec.2 should define LocalFileSystem constants", function() { - expect(LocalFileSystem.TEMPORARY).toBe(0); - expect(LocalFileSystem.PERSISTENT).toBe(1); - }); - - describe('window.requestFileSystem', function() { - it("file.spec.3 should be defined", function() { - expect(window.requestFileSystem).toBeDefined(); - }); - it("file.spec.4 should be able to retrieve a PERSISTENT file system", function() { - var win = jasmine.createSpy().andCallFake(function(fileSystem) { - expect(fileSystem).toBeDefined(); - expect(fileSystem.name).toBeDefined(); - expect(fileSystem.name).toBe("persistent"); - expect(fileSystem.root).toBeDefined(); - }), - fail = createFail('window.requestFileSystem'); - - // retrieve PERSISTENT file system - runs(function() { - window.requestFileSystem(LocalFileSystem.PERSISTENT, 0, win, fail); - }); - - waitsFor(function() { return win.wasCalled; }, "success callback never called", Tests.TEST_TIMEOUT); - - runs(function() { - expect(fail).not.toHaveBeenCalled(); - expect(win).toHaveBeenCalled(); - }); - }); - it("file.spec.5 should be able to retrieve a TEMPORARY file system", function() { - var win = jasmine.createSpy().andCallFake(function(fileSystem) { - expect(fileSystem).toBeDefined(); - expect(fileSystem.name).toBeDefined(); - expect(fileSystem.name).toBe("temporary"); - expect(fileSystem.root).toBeDefined(); - }), - fail = createFail('window.requestFileSystem'); - - // Request the file system - runs(function() { - window.requestFileSystem(LocalFileSystem.TEMPORARY, 0, win, fail); - }); - - waitsFor(function() { return win.wasCalled; }, "success callback never called", Tests.TEST_TIMEOUT); - - runs(function() { - expect(fail).not.toHaveBeenCalled(); - expect(win).toHaveBeenCalled(); - }); - }); - it("file.spec.6 should error if you request a file system that is too large", function() { - var fail = jasmine.createSpy().andCallFake(function(error) { - expect(error).toBeDefined(); - expect(error).toBeFileError(FileError.QUOTA_EXCEEDED_ERR); - }), - win = createWin('window.requestFileSystem'); - - // Request the file system - runs(function() { - window.requestFileSystem(LocalFileSystem.TEMPORARY, 1000000000000000, win, fail); - }); - - waitsFor(function() { return fail.wasCalled; }, "error callback never called", Tests.TEST_TIMEOUT); - - runs(function() { - expect(win).not.toHaveBeenCalled(); - expect(fail).toHaveBeenCalled(); - }); - }); - it("file.spec.7 should error out if you request a file system that does not exist", function() { - var fail = jasmine.createSpy().andCallFake(function(error) { - expect(error).toBeDefined(); - expect(error).toBeFileError(FileError.SYNTAX_ERR); - }), - win = createWin('window.requestFileSystem'); - - // Request the file system - runs(function() { - window.requestFileSystem(-1, 0, win, fail); - }); - - waitsFor(function() { return fail.wasCalled; }, "error callback never called", Tests.TEST_TIMEOUT); - - runs(function() { - expect(win).not.toHaveBeenCalled(); - expect(fail).toHaveBeenCalled(); - }); - }); - }); - - describe('window.resolveLocalFileSystemURI', function() { - it("file.spec.3 should be defined", function() { - expect(window.resolveLocalFileSystemURI).toBeDefined(); - }); - it("file.spec.9 should resolve a valid file name", function() { - var fileName = "resolve.file.uri", - win = jasmine.createSpy().andCallFake(function(fileEntry) { - expect(fileEntry).toBeDefined(); - expect(fileEntry.name).toCanonicallyMatch(fileName); - - // cleanup - deleteEntry(fileName); - }), - fail = createFail('window.resolveLocalFileSystemURI'); - resolveCallback = jasmine.createSpy().andCallFake(function(entry) { - // lookup file system entry - runs(function() { - window.resolveLocalFileSystemURI(entry.toURL(), win, fail); - }); - - waitsFor(function() { return win.wasCalled; }, "resolveLocalFileSystemURI callback never called", Tests.TEST_TIMEOUT); - - runs(function() { - expect(win).toHaveBeenCalled(); - expect(fail).not.toHaveBeenCalled(); - }); - }); - - // create a new file entry - runs(function() { - createFile(fileName, resolveCallback, fail); - }); - - waitsFor(function() { return resolveCallback.wasCalled; }, "createFile callback never called", Tests.TEST_TIMEOUT); - }); - it("file.spec.10 resolve valid file name with parameters", function() { - var fileName = "resolve.file.uri.params", - win = jasmine.createSpy().andCallFake(function(fileEntry) { - expect(fileEntry).toBeDefined(); - expect(fileEntry.name).toBe(fileName); - - // cleanup - deleteEntry(fileName); - }), - fail = createFail('window.resolveLocalFileSystemURI'); - resolveCallback = jasmine.createSpy().andCallFake(function(entry) { - // lookup file system entry - runs(function() { - window.resolveLocalFileSystemURI(entry.toURL() + "?1234567890", win, fail); - }); - - waitsFor(function() { return win.wasCalled; }, "resolveLocalFileSystemURI callback never called", Tests.TEST_TIMEOUT); - - runs(function() { - expect(win).toHaveBeenCalled(); - expect(fail).not.toHaveBeenCalled(); - }); - }); - - // create a new file entry - runs(function() { - createFile(fileName, resolveCallback, fail); - }); - - waitsFor(function() { return resolveCallback.wasCalled; }, "createFile callback never called", Tests.TEST_TIMEOUT); - }); - it("file.spec.11 should error (NOT_FOUND_ERR) when resolving (non-existent) invalid file name", function() { - var fail = jasmine.createSpy().andCallFake(function(error) { - expect(error).toBeDefined(); - expect(error).toBeFileError(FileError.NOT_FOUND_ERR); - }), - win = createWin('window.resolveLocalFileSystemURI'); - - // lookup file system entry - runs(function() { - window.resolveLocalFileSystemURI("file:///this.is.not.a.valid.file.txt", win, fail); - }); - - waitsFor(function() { return fail.wasCalled; }, "error callback never called", Tests.TEST_TIMEOUT); - - runs(function() { - expect(fail).toHaveBeenCalled(); - expect(win).not.toHaveBeenCalled(); - }); - }); - it("file.spec.12 should error (ENCODING_ERR) when resolving invalid URI with leading /", function() { - var fail = jasmine.createSpy().andCallFake(function(error) { - expect(error).toBeDefined(); - expect(error).toBeFileError(FileError.ENCODING_ERR); - }), - win = createWin('window.resolveLocalFileSystemURI'); - - // lookup file system entry - runs(function() { - window.resolveLocalFileSystemURI("/this.is.not.a.valid.url", win, fail); - }); - - waitsFor(function() { return fail.wasCalled; }, "error callback never called", Tests.TEST_TIMEOUT); - - runs(function() { - expect(fail).toHaveBeenCalled(); - expect(win).not.toHaveBeenCalled(); - }); - }); - }); - }); - - describe('Metadata interface', function() { - it("file.spec.13 should exist and have the right properties", function() { - var metadata = new Metadata(); - expect(metadata).toBeDefined(); - expect(metadata.modificationTime).toBeDefined(); - }); - }); - - describe('Flags interface', function() { - it("file.spec.13 should exist and have the right properties", function() { - var flags = new Flags(false, true); - expect(flags).toBeDefined(); - expect(flags.create).toBeDefined(); - expect(flags.create).toBe(false); - expect(flags.exclusive).toBeDefined(); - expect(flags.exclusive).toBe(true); - }); - }); - - describe('FileSystem interface', function() { - it("file.spec.15 should have a root that is a DirectoryEntry", function() { - var win = jasmine.createSpy().andCallFake(function(entry) { - expect(entry).toBeDefined(); - expect(entry.isFile).toBe(false); - expect(entry.isDirectory).toBe(true); - expect(entry.name).toBeDefined(); - expect(entry.fullPath).toBeDefined(); - expect(entry.getMetadata).toBeDefined(); - expect(entry.moveTo).toBeDefined(); - expect(entry.copyTo).toBeDefined(); - expect(entry.toURL).toBeDefined(); - expect(entry.remove).toBeDefined(); - expect(entry.getParent).toBeDefined(); - expect(entry.createReader).toBeDefined(); - expect(entry.getFile).toBeDefined(); - expect(entry.getDirectory).toBeDefined(); - expect(entry.removeRecursively).toBeDefined(); - }), - fail = createFail('FileSystem'); - - runs(function() { - window.resolveLocalFileSystemURI(root.toURL(), win, fail); - }); - - waitsFor(function() { return win.wasCalled; }, "success callback never called", Tests.TEST_TIMEOUT); - - runs(function() { - expect(fail).not.toHaveBeenCalled(); - expect(win).toHaveBeenCalled(); - }); - }); - }); - - describe('DirectoryEntry', function() { - it("file.spec.16 getFile: get Entry for file that does not exist", function() { - var fileName = "de.no.file", - filePath = root.fullPath + '/' + fileName, - fail = jasmine.createSpy().andCallFake(function(error) { - expect(error).toBeDefined(); - expect(error).toBeFileError(FileError.NOT_FOUND_ERR); - }), - win = createWin('DirectoryEntry'); - - // create:false, exclusive:false, file does not exist - runs(function() { - root.getFile(fileName, {create:false}, win, fail); - }); - - waitsFor(function() { return fail.wasCalled; }, "error callback never called", Tests.TEST_TIMEOUT); - - runs(function() { - expect(fail).toHaveBeenCalled(); - expect(win).not.toHaveBeenCalled(); - }); - }); - it("file.spec.17 etFile: create new file", function() { - var fileName = "de.create.file", - filePath = root.fullPath + '/' + fileName, - win = jasmine.createSpy().andCallFake(function(entry) { - expect(entry).toBeDefined(); - expect(entry.isFile).toBe(true); - expect(entry.isDirectory).toBe(false); - expect(entry.name).toCanonicallyMatch(fileName); - expect(entry.fullPath).toBe(filePath); - // cleanup - entry.remove(null, null); - }), - fail = createFail('DirectoryEntry'); - - // create:true, exclusive:false, file does not exist - runs(function() { - root.getFile(fileName, {create: true}, win, fail); - }); - - waitsFor(function() { return win.wasCalled; }, "success callback never called", Tests.TEST_TIMEOUT); - - runs(function() { - expect(win).toHaveBeenCalled(); - expect(fail).not.toHaveBeenCalled(); - }); - }); - it("file.spec.18 getFile: create new file (exclusive)", function() { - var fileName = "de.create.exclusive.file", - filePath = root.fullPath + '/' + fileName, - win = jasmine.createSpy().andCallFake(function(entry) { - expect(entry).toBeDefined(); - expect(entry.isFile).toBe(true); - expect(entry.isDirectory).toBe(false); - expect(entry.name).toBe(fileName); - expect(entry.fullPath).toBe(filePath); - - // cleanup - entry.remove(null, null); - }), - fail = createFail('DirectoryEntry'); - - // create:true, exclusive:true, file does not exist - runs(function() { - root.getFile(fileName, {create: true, exclusive:true}, win, fail); - }); - - waitsFor(function() { return win.wasCalled; }, "success callback never called", Tests.TEST_TIMEOUT); - - runs(function() { - expect(win).toHaveBeenCalled(); - expect(fail).not.toHaveBeenCalled(); - }); - }); - it("file.spec.19 getFile: create file that already exists", function() { - var fileName = "de.create.existing.file", - filePath = root.fullPath + '/' + fileName, - getFile = jasmine.createSpy().andCallFake(function(file) { - // create:true, exclusive:false, file exists - runs(function() { - root.getFile(fileName, {create:true}, win, fail); - }); - - waitsFor(function() { return win.wasCalled; }, "win was never called", Tests.TEST_TIMEOUT); - - runs(function() { - expect(win).toHaveBeenCalled(); - expect(fail).not.toHaveBeenCalled(); - }); - }), - fail = createFail('DirectoryEntry'), - win = jasmine.createSpy().andCallFake(function(entry) { - expect(entry).toBeDefined(); - expect(entry.isFile).toBe(true); - expect(entry.isDirectory).toBe(false); - expect(entry.name).toCanonicallyMatch(fileName); - expect(entry.fullPath).toBe(filePath); - - // cleanup - entry.remove(null, fail); - }); - // create file to kick off it - runs(function() { - root.getFile(fileName, {create:true}, getFile, fail); - }); - - waitsFor(function() { return getFile.wasCalled; }, "getFile was never called", Tests.TEST_TIMEOUT); - }); - it("file.spec.20 getFile: create file that already exists (exclusive)", function() { - var fileName = "de.create.exclusive.existing.file", - filePath = root.fullPath + '/' + fileName, - existingFile, - getFile = jasmine.createSpy().andCallFake(function(file) { - existingFile = file; - // create:true, exclusive:true, file exists - runs(function() { - root.getFile(fileName, {create:true, exclusive:true}, win, fail); - }); - - waitsFor(function() { return fail.wasCalled; }, "fail never called", Tests.TEST_TIMEOUT); - - runs(function() { - expect(fail).toHaveBeenCalled(); - expect(win).not.toHaveBeenCalled(); - }); - }), - fail = jasmine.createSpy().andCallFake(function(error) { - expect(error).toBeDefined(); - expect(error).toBeFileError(FileError.PATH_EXISTS_ERR); - - // cleanup - existingFile.remove(null, fail); - }), - win = createWin('DirectoryEntry'); - - // create file to kick off it - runs(function() { - root.getFile(fileName, {create:true}, getFile, fail); - }); - - waitsFor(function() { return getFile.wasCalled; }, "getFile never called", Tests.TEST_TIMEOUT); - }); - it("file.spec.21 getFile: get Entry for existing file", function() { - var fileName = "de.get.file", - filePath = root.fullPath + '/' + fileName, - win = jasmine.createSpy().andCallFake(function(entry) { - expect(entry).toBeDefined(); - expect(entry.isFile).toBe(true); - expect(entry.isDirectory).toBe(false); - expect(entry.name).toCanonicallyMatch(fileName); - expect(entry.fullPath).toCanonicallyMatch(filePath); - - entry.remove(null, fail); //clean up - }), - fail = createFail('DirectoryEntry'), - getFile = jasmine.createSpy().andCallFake(function(file) { - // create:false, exclusive:false, file exists - runs(function() { - root.getFile(fileName, {create:false}, win, fail); - }); - - waitsFor(function() { return win.wasCalled; }, "getFile success callback", Tests.TEST_TIMEOUT); - - runs(function() { - expect(win).toHaveBeenCalled(); - expect(fail).not.toHaveBeenCalled(); - }); - }); - - // create file to kick off it - runs(function() { - root.getFile(fileName, {create:true}, getFile, fail); - }); - - waitsFor(function() { return getFile.wasCalled; }, "file creation", Tests.TEST_TIMEOUT); - }); - it("file.spec.22 DirectoryEntry.getFile: get FileEntry for invalid path", function() { - var fileName = "de:invalid:path", - fail = jasmine.createSpy().andCallFake(function(error) { - expect(error).toBeDefined(); - expect(error).toBeFileError(FileError.ENCODING_ERR); - }), - win = createWin('DirectoryEntry'); - - // create:false, exclusive:false, invalid path - runs(function() { - root.getFile(fileName, {create:false}, win, fail); - }); - - waitsFor(function() { return fail.wasCalled; }, "fail never called", Tests.TEST_TIMEOUT); - - runs(function() { - expect(fail).toHaveBeenCalled(); - expect(win).not.toHaveBeenCalled(); - }); - - }); - it("file.spec.23 DirectoryEntry.getDirectory: get Entry for directory that does not exist", function() { - var dirName = "de.no.dir", - dirPath = root.fullPath + '/' + dirName, - fail = jasmine.createSpy().andCallFake(function(error) { - expect(error).toBeDefined(); - expect(error).toBeFileError(FileError.NOT_FOUND_ERR); - }), - win = createWin('DirectoryEntry'); - - // create:false, exclusive:false, directory does not exist - runs(function() { - root.getDirectory(dirName, {create:false}, win, fail); - }); - - waitsFor(function() { return fail.wasCalled; }, "fail never called", Tests.TEST_TIMEOUT); - - runs(function() { - expect(fail).toHaveBeenCalled(); - expect(win).not.toHaveBeenCalled(); - }); - }); - it("file.spec.24 DirectoryEntry.getDirectory: create new dir with space then resolveFileSystemURI", function() { - var dirName = "de create dir", - dirPath = root.fullPath + '/' + dirName, - getDir = jasmine.createSpy().andCallFake(function(dirEntry) { - var dirURI = dirEntry.toURL(); - // now encode URI and try to resolve - runs(function() { - window.resolveLocalFileSystemURI(dirURI, win, fail); - }); - - waitsFor(function() { return win.wasCalled; }, "win never called", Tests.TEST_TIMEOUT); - - runs(function() { - expect(win).toHaveBeenCalled(); - expect(fail).not.toHaveBeenCalled(); - }); - - }), win = jasmine.createSpy().andCallFake(function(directory) { - expect(directory).toBeDefined(); - expect(directory.isFile).toBe(false); - expect(directory.isDirectory).toBe(true); - expect(directory.name).toCanonicallyMatch(dirName); - expect(directory.fullPath).toCanonicallyMatch(dirPath); - - // cleanup - directory.remove(null, fail); - }), - fail = createFail('DirectoryEntry'); - - // create:true, exclusive:false, directory does not exist - runs(function() { - root.getDirectory(dirName, {create: true}, getDir, fail); - }); - - waitsFor(function() { return getDir.wasCalled; }, "getDir never called", Tests.TEST_TIMEOUT); - }); - it("file.spec.25 DirectoryEntry.getDirectory: create new dir with space resolveFileSystemURI with encoded URI", function() { - var dirName = "de create dir", - dirPath = root.fullPath + '/' + dirName, - getDir = jasmine.createSpy().andCallFake(function(dirEntry) { - var dirURI = dirEntry.toURL(); - // now encode URI and try to resolve - runs(function() { - window.resolveLocalFileSystemURI(encodeURI(dirURI), win, fail); - }); - - waitsFor(function() { return win.wasCalled; }, "win never called", Tests.TEST_TIMEOUT); - - runs(function() { - expect(win).toHaveBeenCalled(); - expect(fail).not.toHaveBeenCalled(); - }); - }), - win = jasmine.createSpy().andCallFake(function(directory) { - expect(directory).toBeDefined(); - expect(directory.isFile).toBe(false); - expect(directory.isDirectory).toBe(true); - expect(directory.name).toCanonicallyMatch(dirName); - expect(directory.fullPath).toCanonicallyMatch(dirPath); - // cleanup - directory.remove(null, fail); - }), - fail = createFail('DirectoryEntry'); - - // create:true, exclusive:false, directory does not exist - runs(function() { - root.getDirectory(dirName, {create: true}, getDir, fail); - }); - - waitsFor(function() { return getDir.wasCalled; }, "getDir never called", Tests.TEST_TIMEOUT); - }); - - it("file.spec.26 DirectoryEntry.getDirectory: create new directory", function() { - var dirName = "de.create.dir", - dirPath = root.fullPath + '/' + dirName, - win = jasmine.createSpy().andCallFake(function(directory) { - expect(directory).toBeDefined(); - expect(directory.isFile).toBe(false); - expect(directory.isDirectory).toBe(true); - expect(directory.name).toCanonicallyMatch(dirName); - expect(directory.fullPath).toCanonicallyMatch(dirPath); - - // cleanup - directory.remove(null, fail); - }), - fail = createFail('DirectoryEntry'); - - // create:true, exclusive:false, directory does not exist - runs(function() { - root.getDirectory(dirName, {create: true}, win, fail); - }); - - waitsFor(function() { return win.wasCalled; }, "win never called", Tests.TEST_TIMEOUT); - - runs(function() { - expect(win).toHaveBeenCalled(); - expect(fail).not.toHaveBeenCalled(); - }); - }); - - it("file.spec.27 DirectoryEntry.getDirectory: create new directory (exclusive)", function() { - var dirName = "de.create.exclusive.dir", - dirPath = root.fullPath + '/' + dirName, - win = jasmine.createSpy().andCallFake(function(directory) { - expect(directory).toBeDefined(); - expect(directory.isFile).toBe(false); - expect(directory.isDirectory).toBe(true); - expect(directory.name).toCanonicallyMatch(dirName); - expect(directory.fullPath).toCanonicallyMatch(dirPath); - - // cleanup - directory.remove(null, fail); - }), - fail = createFail('DirectoryEntry'); - // create:true, exclusive:true, directory does not exist - runs(function() { - root.getDirectory(dirName, {create: true, exclusive:true}, win, fail); - }); - - waitsFor(function() { return win.wasCalled; }, "win never called", Tests.TEST_TIMEOUT); - - runs(function() { - expect(win).toHaveBeenCalled(); - expect(fail).not.toHaveBeenCalled(); - }); - }); - it("file.spec.28 DirectoryEntry.getDirectory: create directory that already exists", function() { - var dirName = "de.create.existing.dir", - dirPath = root.fullPath + '/' + dirName, - getDir = jasmine.createSpy().andCallFake(function(directory) { - // create:true, exclusive:false, directory exists - runs(function() { - root.getDirectory(dirName, {create:true}, win, fail); - }); - - waitsFor(function() { return win.wasCalled; }, "win never called", Tests.TEST_TIMEOUT); - - runs(function() { - expect(win).toHaveBeenCalled(); - expect(fail).not.toHaveBeenCalled(); - }); - }), - win = jasmine.createSpy().andCallFake(function(directory) { - expect(directory).toBeDefined(); - expect(directory.isFile).toBe(false); - expect(directory.isDirectory).toBe(true); - expect(directory.name).toCanonicallyMatch(dirName); - expect(directory.fullPath).toCanonicallyMatch(dirPath); - - // cleanup - directory.remove(null, fail); - }), - fail = createFail('DirectoryEntry'); - - // create directory to kick off it - runs(function() { - root.getDirectory(dirName, {create:true}, getDir, this.fail); - }); - - waitsFor(function() { return getDir.wasCalled; }, "getDir never called", Tests.TEST_TIMEOUT); - }); - it("file.spec.29 DirectoryEntry.getDirectory: create directory that already exists (exclusive)", function() { - var dirName = "de.create.exclusive.existing.dir", - dirPath = root.fullPath + '/' + dirName, - existingDir, - getDir = jasmine.createSpy().andCallFake(function(directory) { - existingDir = directory; - // create:true, exclusive:true, directory exists - runs(function() { - root.getDirectory(dirName, {create:true, exclusive:true}, win, fail); - }); - - waitsFor(function() { return fail.wasCalled; }, "fail never called", Tests.TEST_TIMEOUT); - - runs(function() { - expect(fail).toHaveBeenCalled(); - expect(win).not.toHaveBeenCalled(); - }); - }), - fail = jasmine.createSpy().andCallFake(function(error) { - expect(error).toBeDefined(); - expect(error).toBeFileError(FileError.PATH_EXISTS_ERR); - - // cleanup - existingDir.remove(null, fail); - }), - win = createWin('DirectoryEntry'); - - // create directory to kick off it - runs(function() { - root.getDirectory(dirName, {create:true}, getDir, fail); - }); - - waitsFor(function() { return getDir.wasCalled; }, "getDir never called", Tests.TEST_TIMEOUT); - }); - it("file.spec.30 DirectoryEntry.getDirectory: get Entry for existing directory", function() { - var dirName = "de.get.dir", - dirPath = root.fullPath + '/' + dirName, - getDir = jasmine.createSpy().andCallFake(function(directory) { - // create:false, exclusive:false, directory exists - runs(function() { - root.getDirectory(dirName, {create:false}, win, fail); - }); - - waitsFor(function() { return win.wasCalled; }, "win never called", Tests.TEST_TIMEOUT); - - runs(function() { - expect(win).toHaveBeenCalled(); - expect(fail).not.toHaveBeenCalled(); - }); - }), - win = jasmine.createSpy().andCallFake(function(directory) { - expect(directory).toBeDefined(); - expect(directory.isFile).toBe(false); - expect(directory.isDirectory).toBe(true); - expect(directory.name).toCanonicallyMatch(dirName); - - expect(directory.fullPath).toCanonicallyMatch(dirPath); - - // cleanup - directory.remove(null, fail); - }), - fail = createFail('DirectoryEntry'); - - // create directory to kick off it - root.getDirectory(dirName, {create:true}, getDir, fail); - }); - it("file.spec.31 DirectoryEntry.getDirectory: get DirectoryEntry for invalid path", function() { - var dirName = "de:invalid:path", - fail = jasmine.createSpy().andCallFake(function(error) { - expect(error).toBeDefined(); - expect(error).toBeFileError(FileError.ENCODING_ERR); - }), - win = createWin('DirectoryEntry'); - - // create:false, exclusive:false, invalid path - runs(function() { - root.getDirectory(dirName, {create:false}, win, fail); - }); - - waitsFor(function() { return fail.wasCalled; }, "fail never called", Tests.TEST_TIMEOUT); - - runs(function() { - expect(fail).toHaveBeenCalled(); - expect(win).not.toHaveBeenCalled(); - }); - }); - it("file.spec.32 DirectoryEntry.getDirectory: get DirectoryEntry for existing file", function() { - var fileName = "de.existing.file", - existingFile, - filePath = root.fullPath + '/' + fileName, - getDir = jasmine.createSpy().andCallFake(function(file) { - existingFile = file; - // create:false, exclusive:false, existing file - runs(function() { - root.getDirectory(fileName, {create:false}, win, fail); - }); - - waitsFor(function() { return fail.wasCalled; }, "fail never called", Tests.TEST_TIMEOUT); - - runs(function() { - expect(fail).toHaveBeenCalled(); - expect(win).not.toHaveBeenCalled(); - }); - }), - fail = jasmine.createSpy().andCallFake(function(error) { - expect(error).toBeDefined(); - expect(error).toBeFileError(FileError.TYPE_MISMATCH_ERR); - - // cleanup - existingFile.remove(null, null); - }), - win = createWin('DirectoryEntry'); - - // create file to kick off it - runs(function() { - root.getFile(fileName, {create:true}, getDir, fail); - }); - - waitsFor(function() { return getDir.wasCalled; }, "getDir was called", Tests.TEST_TIMEOUT); - }); - it("file.spec.33 DirectoryEntry.getFile: get FileEntry for existing directory", function() { - var dirName = "de.existing.dir", - existingDir, - dirPath = root.fullPath + '/' + dirName, - getFile = jasmine.createSpy().andCallFake(function(directory) { - existingDir = directory; - // create:false, exclusive:false, existing directory - runs(function() { - root.getFile(dirName, {create:false}, win, fail); - }); - - waitsFor(function() { return fail.wasCalled; }, "fail never called", Tests.TEST_TIMEOUT); - - runs(function() { - expect(fail).toHaveBeenCalled(); - expect(win).not.toHaveBeenCalled(); - }); - }), - fail = jasmine.createSpy().andCallFake(function(error) { - expect(error).toBeDefined(); - expect(error).toBeFileError(FileError.TYPE_MISMATCH_ERR); - - // cleanup - existingDir.remove(null, null); - }), - win = createWin('DirectoryEntry'); - - // create directory to kick off it - runs(function() { - root.getDirectory(dirName, {create:true}, getFile, fail); - }); - - waitsFor(function() { return getFile.wasCalled; }, "getFile never called", Tests.TEST_TIMEOUT); - }); - it("file.spec.34 DirectoryEntry.removeRecursively on directory", function() { - var dirName = "de.removeRecursively", - subDirName = "dir", - dirPath = root.fullPath + '/' + dirName, - //subDirPath = this.root.fullPath + '/' + subDirName, - subDirPath = dirPath + '/' + subDirName, - entryCallback = jasmine.createSpy().andCallFake(function(entry) { - // delete directory - var deleteDirectory = jasmine.createSpy().andCallFake(function(directory) { - runs(function() { - entry.removeRecursively(remove, fail); - }); - - waitsFor(function() { return remove.wasCalled; }, "remove never called", Tests.TEST_TIMEOUT); - }); - // create a sub-directory within directory - runs(function() { - entry.getDirectory(subDirName, {create: true}, deleteDirectory, fail); - }); - - waitsFor(function() { return deleteDirectory.wasCalled; }, "deleteDirectory never called", Tests.TEST_TIMEOUT); - }), - remove = jasmine.createSpy().andCallFake(function() { - // it that removed directory no longer exists - runs(function() { - root.getDirectory(dirName, {create:false}, win, dirExists); - }); - - waitsFor(function() { return dirExists.wasCalled; }, "dirExists never called", Tests.TEST_TIMEOUT); - - runs(function() { - expect(dirExists).toHaveBeenCalled(); - expect(win).not.toHaveBeenCalled(); - }); - }), - dirExists = jasmine.createSpy().andCallFake(function(error){ - expect(error).toBeDefined(); - expect(error).toBeFileError(FileError.NOT_FOUND_ERR); - }), - fail = createFail('DirectoryEntry'), - win = createWin('DirectoryEntry'); - - // create a new directory entry to kick off it - runs(function() { - root.getDirectory(dirName, {create:true}, entryCallback, fail); - }); - - waitsFor(function() { return entryCallback.wasCalled; }, "entryCallback never called", Tests.TEST_TIMEOUT); - }); - it("file.spec.35 createReader: create reader on existing directory", function() { - // create reader for root directory - var reader = root.createReader(); - expect(reader).toBeDefined(); - expect(typeof reader.readEntries).toBe('function'); - }); - it("file.spec.36 removeRecursively on root file system", function() { - var remove = jasmine.createSpy().andCallFake(function(error) { - expect(error).toBeDefined(); - expect(error).toBeFileError(FileError.NO_MODIFICATION_ALLOWED_ERR); - }), - win = createWin('DirectoryEntry'); - - // remove root file system - runs(function() { - root.removeRecursively(win, remove); - }); - - waitsFor(function() { return remove.wasCalled; }, "remove never called", Tests.TEST_TIMEOUT); - - runs(function() { - expect(win).not.toHaveBeenCalled(); - expect(remove).toHaveBeenCalled(); - }); - }); - }); - - describe('DirectoryReader interface', function() { - describe("readEntries", function() { - it("file.spec.37 should read contents of existing directory", function() { - var reader, - win = jasmine.createSpy().andCallFake(function(entries) { - expect(entries).toBeDefined(); - expect(entries instanceof Array).toBe(true); - }), - fail = createFail('DirectoryReader'); - - // create reader for root directory - reader = root.createReader(); - // read entries - runs(function() { - reader.readEntries(win, fail); - }); - - waitsFor(function() { return win.wasCalled; }, "win never called", Tests.TEST_TIMEOUT); - - runs(function() { - expect(win).toHaveBeenCalled(); - expect(fail).not.toHaveBeenCalled(); - }); - }); - it("file.spec.38 should read contents of directory that has been removed", function() { - var dirName = "de.createReader.notfound", - dirPath = root.fullPath + '/' + dirName, - entryCallback = jasmine.createSpy().andCallFake(function(directory) { - // read entries - var readEntries = jasmine.createSpy().andCallFake(function() { - var reader = directory.createReader(); - - runs(function() { - reader.readEntries(win, itReader); - }); - - waitsFor(function() { return itReader.wasCalled; }, "itReader never called", Tests.TEST_TIMEOUT); - }); - // delete directory - runs(function() { - directory.removeRecursively(readEntries, fail); - }); - - waitsFor(function() { return readEntries.wasCalled; }, "readEntries never called", Tests.TEST_TIMEOUT); - }), - itReader = jasmine.createSpy().andCallFake(function(error) { - var itDirectoryExists = jasmine.createSpy().andCallFake(function(error) { - expect(error).toBeDefined(); - expect(error).toBeFileError(FileError.NOT_FOUND_ERR); - }); - - expect(error).toBeDefined(); - expect(error).toBeFileError(FileError.NOT_FOUND_ERR); - - runs(function() { - root.getDirectory(dirName, {create:false}, win, itDirectoryExists); - }); - - waitsFor(function() { return itDirectoryExists.wasCalled; }, "itDirectoryExists never called", Tests.TEST_TIMEOUT); - - runs(function() { - expect(itDirectoryExists).toHaveBeenCalled(); - expect(win).not.toHaveBeenCalled(); - }); - }), - fail = createFail('DirectoryReader'), - win = createWin('DirectoryReader'); - - // create a new directory entry to kick off it - runs(function() { - root.getDirectory(dirName, {create:true}, entryCallback, fail); - }); - - waitsFor(function() { return entryCallback.wasCalled; }, "entryCallback never called", Tests.TEST_TIMEOUT); - }); - }); - }); - - describe('File', function() { - it("file.spec.39 constructor should be defined", function() { - expect(File).toBeDefined(); - expect(typeof File).toBe('function'); - }); - it("file.spec.40 should be define File attributes", function() { - var file = new File(); - expect(file.name).toBeDefined(); - expect(file.fullPath).toBeDefined(); - expect(file.type).toBeDefined(); - expect(file.lastModifiedDate).toBeDefined(); - expect(file.size).toBeDefined(); - }); - }); - - describe('FileEntry', function() { - it("file.spec.41 should be define FileEntry methods", function() { - var fileName = "fe.methods", - itFileEntry = jasmine.createSpy().andCallFake(function(fileEntry) { - expect(fileEntry).toBeDefined(); - expect(typeof fileEntry.createWriter).toBe('function'); - expect(typeof fileEntry.file).toBe('function'); - - // cleanup - fileEntry.remove(null, fail); - }), - fail = createFail('FileEntry'); - - // create a new file entry to kick off it - runs(function() { - root.getFile(fileName, {create:true}, itFileEntry, fail); - }); - - waitsFor(function() { return itFileEntry.wasCalled; }, "itFileEntry never called", Tests.TEST_TIMEOUT); - - runs(function() { - expect(itFileEntry).toHaveBeenCalled(); - expect(fail).not.toHaveBeenCalled(); - }); - }); - it("file.spec.42 createWriter should return a FileWriter object", function() { - var fileName = "fe.createWriter", - itFile, - entryCallback = jasmine.createSpy().andCallFake(function(fileEntry) { - itFile = fileEntry; - - runs(function() { - fileEntry.createWriter(itWriter, fail); - }); - - waitsFor(function() { return itWriter.wasCalled; }, "itWriter", Tests.TEST_TIMEOUT); - - runs(function() { - expect(itWriter).toHaveBeenCalled(); - expect(fail).not.toHaveBeenCalled(); - }); - }), - itWriter = jasmine.createSpy().andCallFake(function(writer) { - expect(writer).toBeDefined(); - expect(writer instanceof FileWriter).toBe(true); - - // cleanup - itFile.remove(null, fail); - }), - fail = createFail('FileEntry'); - - // create a new file entry to kick off it - runs(function() { - root.getFile(fileName, {create:true}, entryCallback, fail); - }); - - waitsFor(function() { return entryCallback.wasCalled; }, "entryCallback never called", Tests.TEST_TIMEOUT); - }); - it("file.spec.43 file should return a File object", function() { - var fileName = "fe.file", - newFile, - entryCallback = jasmine.createSpy().andCallFake(function(fileEntry) { - newFile = fileEntry; - - runs(function() { - fileEntry.file(itFile, fail); - }); - - waitsFor(function() { return itFile.wasCalled; }, "itFile never called", Tests.TEST_TIMEOUT); - - runs(function() { - expect(itFile).toHaveBeenCalled(); - expect(fail).not.toHaveBeenCalled(); - }); - }), - itFile = jasmine.createSpy().andCallFake(function(file) { - expect(file).toBeDefined(); - expect(file instanceof File).toBe(true); - - // cleanup - newFile.remove(null, fail); - }), - fail = createFail('FileEntry'); - - // create a new file entry to kick off it - runs(function() { - root.getFile(fileName, {create:true}, entryCallback, fail); - }); - - waitsFor(function() { return entryCallback.wasCalled; }, "entryCallback never called", Tests.TEST_TIMEOUT); - }); - it("file.spec.44 file: on File that has been removed", function() { - var fileName = "fe.no.file", - entryCallback = jasmine.createSpy().andCallFake(function(fileEntry) { - // create File object - var getFile = jasmine.createSpy().andCallFake(function() { - runs(function() { - fileEntry.file(win, itFile); - }); - - waitsFor(function() { return itFile.wasCalled; }, "itFile never called", Tests.TEST_TIMEOUT); - - runs(function() { - expect(itFile).toHaveBeenCalled(); - expect(win).not.toHaveBeenCalled(); - }); - }); - // delete file - runs(function() { - fileEntry.remove(getFile, fail); - }); - - waitsFor(function() { return getFile.wasCalled; }, "getFile never called", Tests.TEST_TIMEOUT); - }), - itFile = jasmine.createSpy().andCallFake(function(error) { - expect(error).toBeDefined(); - expect(error).toBeFileError(FileError.NOT_FOUND_ERR); - }), - fail = createFail('FileEntry'), - win = createWin('FileEntry'); - - // create a new file entry to kick off it - runs(function() { - root.getFile(fileName, {create:true}, entryCallback, fail); - }); - - waitsFor(function() { return entryCallback.wasCalled; }, "entryCallback never called", Tests.TEST_TIMEOUT); - }); - }); - describe('Entry', function() { - it("file.spec.45 Entry object", function() { - var fileName = "entry", - fullPath = root.fullPath + '/' + fileName, - fail = createFail('Entry'), - itEntry = jasmine.createSpy().andCallFake(function(entry) { - expect(entry).toBeDefined(); - expect(entry.isFile).toBe(true); - expect(entry.isDirectory).toBe(false); - expect(entry.name).toCanonicallyMatch(fileName); - expect(entry.fullPath).toCanonicallyMatch(fullPath); - expect(typeof entry.getMetadata).toBe('function'); - expect(typeof entry.setMetadata).toBe('function'); - expect(typeof entry.moveTo).toBe('function'); - expect(typeof entry.copyTo).toBe('function'); - expect(typeof entry.toURL).toBe('function'); - expect(typeof entry.remove).toBe('function'); - expect(typeof entry.getParent).toBe('function'); - expect(typeof entry.createWriter).toBe('function'); - expect(typeof entry.file).toBe('function'); - - // cleanup - deleteEntry(fileName); - }); - - // create a new file entry - runs(function() { - createFile(fileName, itEntry, fail); - }); - - waitsFor(function() { return itEntry.wasCalled; }, "itEntry", Tests.TEST_TIMEOUT); - - runs(function() { - expect(itEntry).toHaveBeenCalled(); - expect(fail).not.toHaveBeenCalled(); - }); - }); - it("file.spec.46 Entry.getMetadata on file", function() { - var fileName = "entry.metadata.file", - entryCallback = jasmine.createSpy().andCallFake(function(entry) { - runs(function() { - entry.getMetadata(itMetadata, fail); - }); - - waitsFor(function() { return itMetadata.wasCalled; }, "itMetadata never called", Tests.TEST_TIMEOUT); - - runs(function() { - expect(itMetadata).toHaveBeenCalled(); - expect(fail).not.toHaveBeenCalled(); - }); - }), - fail = createFail('Entry'), - itMetadata = jasmine.createSpy().andCallFake(function(metadata) { - expect(metadata).toBeDefined(); - expect(metadata.modificationTime instanceof Date).toBe(true); - - // cleanup - deleteEntry(fileName); - }); - - // create a new file entry - createFile(fileName, entryCallback, fail); - }); - it("file.spec.47 Entry.getMetadata on directory", function() { - var dirName = "entry.metadata.dir", - entryCallback = jasmine.createSpy().andCallFake(function(entry) { - runs(function() { - entry.getMetadata(itMetadata, fail); - }); - - waitsFor(function() { return itMetadata.wasCalled; }, "itMetadata never called", Tests.TEST_TIMEOUT); - - runs(function() { - expect(itMetadata).toHaveBeenCalled(); - expect(fail).not.toHaveBeenCalled(); - }); - }), - fail = createFail('Entry'), - itMetadata = jasmine.createSpy().andCallFake(function(metadata) { - expect(metadata).toBeDefined(); - expect(metadata.modificationTime instanceof Date).toBe(true); - - // cleanup - deleteEntry(dirName); - }); - - // create a new directory entry - runs(function() { - createDirectory(dirName, entryCallback, fail); - }); - - waitsFor(function() { return entryCallback.wasCalled; }, "entryCallback never called", Tests.TEST_TIMEOUT); - }); - it("file.spec.48 Entry.getParent on file in root file system", function() { - var fileName = "entry.parent.file", - rootPath = root.fullPath, - fail = createFail('Entry'), - entryCallback = jasmine.createSpy().andCallFake(function(entry) { - runs(function() { - entry.getParent(itParent, fail); - }); - - waitsFor(function() { return itParent.wasCalled; }, "itCalled never called", Tests.TEST_TIMEOUT); - - runs(function() { - expect(itParent).toHaveBeenCalled(); - expect(fail).not.toHaveBeenCalled(); - }); - }), - itParent = jasmine.createSpy().andCallFake(function(parent) { - expect(parent).toBeDefined(); - expect(parent.fullPath).toCanonicallyMatch(rootPath); - - // cleanup - deleteEntry(fileName); - }); - - // create a new file entry - runs(function() { - createFile(fileName, entryCallback, fail); - }); - - waitsFor(function() { return entryCallback.wasCalled; }, "entryCallback never called", Tests.TEST_TIMEOUT); - }); - it("file.spec.49 Entry.getParent on directory in root file system", function() { - var dirName = "entry.parent.dir", - rootPath = root.fullPath, - fail = createFail('Entry'), - entryCallback = jasmine.createSpy().andCallFake(function(entry) { - runs(function() { - entry.getParent(itParent, fail); - }); - - waitsFor(function() { return itParent.wasCalled; }, "itParent never called", Tests.TEST_TIMEOUT); - - runs(function() { - expect(itParent).toHaveBeenCalled(); - expect(fail).not.toHaveBeenCalled(); - }); - }), - itParent = jasmine.createSpy().andCallFake(function(parent) { - expect(parent).toBeDefined(); - expect(parent.fullPath).toCanonicallyMatch(rootPath); - - // cleanup - deleteEntry(dirName); - }); - - // create a new directory entry - runs(function() { - createDirectory(dirName, entryCallback, fail); - }); - - waitsFor(function() { return entryCallback.wasCalled; }, "entryCallback never called", Tests.TEST_TIMEOUT); - }); - it("file.spec.50 Entry.getParent on root file system", function() { - var rootPath = root.fullPath, - itParent = jasmine.createSpy().andCallFake(function(parent) { - expect(parent).toBeDefined(); - expect(parent.fullPath).toCanonicallyMatch(rootPath); - }), - fail = createFail('Entry'); - - // create a new directory entry - runs(function() { - root.getParent(itParent, fail); - }); - - waitsFor(function() { return itParent.wasCalled; }, "itParent never called", Tests.TEST_TIMEOUT); - - runs(function() { - expect(itParent).toHaveBeenCalled(); - expect(fail).not.toHaveBeenCalled(); - }); - }); - it("file.spec.51 Entry.toURL on file", function() { - var fileName = "entry.uri.file", - rootPath = root.fullPath, - itURI = jasmine.createSpy().andCallFake(function(entry) { - var uri = entry.toURL(); - expect(uri).toBeDefined(); - expect(uri.indexOf(rootPath)).not.toBe(-1); - - // cleanup - deleteEntry(fileName); - }), - fail = createFail('Entry'); - - // create a new file entry - runs(function() { - createFile(fileName, itURI, fail); - }); - - waitsFor(function() { return itURI.wasCalled; }, "itURI never called", Tests.TEST_TIMEOUT); - - runs(function() { - expect(itURI).toHaveBeenCalled(); - expect(fail).not.toHaveBeenCalled(); - }); - }); - it("file.spec.52 Entry.toURL on directory", function() { - var dirName = "entry.uri.dir", - rootPath = root.fullPath, - itURI = jasmine.createSpy().andCallFake(function(entry) { - var uri = entry.toURL(); - expect(uri).toBeDefined(); - expect(uri.indexOf(rootPath)).not.toBe(-1); - - // cleanup - deleteEntry(dirName); - }), - fail = createFail('Entry'); - - // create a new directory entry - runs(function() { - createDirectory(dirName, itURI, fail); - }); - - waitsFor(function() { return itURI.wasCalled; }, "itURI never called", Tests.TEST_TIMEOUT); - - runs(function() { - expect(itURI).toHaveBeenCalled(); - expect(fail).not.toHaveBeenCalled(); - }); - }); - it("file.spec.53 Entry.remove on file", function() { - var fileName = "entry.rm.file", - fullPath = root.fullPath + '/' + fileName, - win = createWin('Entry'), - entryCallback = jasmine.createSpy().andCallFake(function(entry) { - var checkRemove = jasmine.createSpy().andCallFake(function() { - runs(function() { - root.getFile(fileName, null, win, itRemove); - }); - - waitsFor(function() { return itRemove.wasCalled; }, "itRemove never called", Tests.TEST_TIMEOUT); - - runs(function() { - expect(win).not.toHaveBeenCalled(); - expect(fail).not.toHaveBeenCalled(); - expect(itRemove).toHaveBeenCalled(); - }); - }); - expect(entry).toBeDefined(); - - runs(function() { - entry.remove(checkRemove, fail); - }); - - waitsFor(function() { return checkRemove.wasCalled; }, "checkRemove never called", Tests.TEST_TIMEOUT); - }), - itRemove = jasmine.createSpy().andCallFake(function(error) { - expect(error).toBeDefined(); - expect(error).toBeFileError(FileError.NOT_FOUND_ERR); - // cleanup - deleteEntry(fileName); - }), - fail = createFail('Entry'); - - // create a new file entry - runs(function() { - createFile(fileName, entryCallback, fail); - }); - - waitsFor(function() { return entryCallback.wasCalled; }, "entryCallback never called", Tests.TEST_TIMEOUT); - }); - it("file.spec.54 remove on empty directory", function() { - var dirName = "entry.rm.dir", - fullPath = root.fullPath + '/' + dirName, - entryCallback = jasmine.createSpy().andCallFake(function(entry) { - var checkRemove = jasmine.createSpy().andCallFake(function() { - runs(function() { - root.getDirectory(dirName, null, win, itRemove); - }); - - waitsFor(function() { return itRemove.wasCalled; }, "itRemove never called", Tests.TEST_TIMEOUT); - - runs(function() { - expect(itRemove).toHaveBeenCalled(); - expect(win).not.toHaveBeenCalled(); - expect(fail).not.toHaveBeenCalled(); - }); - }); - - expect(entry).toBeDefined(); - - runs(function() { - entry.remove(checkRemove, fail); - }); - - waitsFor(function() { return checkRemove.wasCalled; }, "checkRemove never called", Tests.TEST_TIMEOUT); - }), - itRemove = jasmine.createSpy().andCallFake(function(error) { - expect(error).toBeDefined(); - expect(error).toBeFileError(FileError.NOT_FOUND_ERR); - // cleanup - deleteEntry(dirName); - }), - win = createWin('Entry'), - fail = createFail('Entry'); - - // create a new directory entry - runs(function() { - createDirectory(dirName, entryCallback, fail); - }); - - waitsFor(function() { return entryCallback.wasCalled; }, "entryCallback never called", Tests.TEST_TIMEOUT); - }); - it("file.spec.55 remove on non-empty directory", function() { - var dirName = "entry.rm.dir.not.empty", - fullPath = root.fullPath + '/' + dirName, - fileName = "remove.txt", - entryCallback = jasmine.createSpy().andCallFake(function(entry) { - var checkFile = jasmine.createSpy().andCallFake(function(error) { - expect(error).toBeDefined(); - expect(error).toBeFileError(FileError.INVALID_MODIFICATION_ERR); - // verify that dir still exists - runs(function() { - root.getDirectory(dirName, null, itRemove, fail); - }); - - waitsFor(function() { return itRemove.wasCalled; }, "itRemove never called", Tests.TEST_TIMEOUT); - - runs(function() { - expect(win).not.toHaveBeenCalled(); - expect(fail).not.toHaveBeenCalled(); - expect(itRemove).toHaveBeenCalled(); - }); - }); - // delete directory - var deleteDirectory = jasmine.createSpy().andCallFake(function(fileEntry) { - runs(function() { - entry.remove(win, checkFile); - }); - - waitsFor(function() { return checkFile.wasCalled; }, "checkFile never called", Tests.TEST_TIMEOUT); - }); - // create a file within directory, then try to delete directory - runs(function() { - entry.getFile(fileName, {create: true}, deleteDirectory, fail); - }); - - waitsFor(function() { return deleteDirectory.wasCalled; }, "deleteDirectory never called", Tests.TEST_TIMEOUT); - }), - itRemove = jasmine.createSpy().andCallFake(function(entry) { - expect(entry).toBeDefined(); - expect(entry.fullPath).toCanonicallyMatch(fullPath); - // cleanup - deleteEntry(dirName); - }), - win = createWin('Entry'), - fail = createFail('Entry'); - - // create a new directory entry - runs(function() { - createDirectory(dirName, entryCallback, fail); - }); - - waitsFor(function() { return entryCallback.wasCalled; }, "entryCallback never called", Tests.TEST_TIMEOUT); - }); - it("file.spec.56 remove on root file system", function() { - var itRemove = jasmine.createSpy().andCallFake(function(error) { - expect(error).toBeDefined(); - expect(error).toBeFileError(FileError.NO_MODIFICATION_ALLOWED_ERR); - }), - win = createWin('Entry'); - - // remove entry that doesn't exist - runs(function() { - root.remove(win, itRemove); - }); - - waitsFor(function() { return itRemove.wasCalled; }, "itRemove never called", Tests.TEST_TIMEOUT); - - runs(function() { - expect(win).not.toHaveBeenCalled(); - expect(itRemove).toHaveBeenCalled(); - }); - }); - it("file.spec.57 copyTo: file", function() { - var file1 = "entry.copy.file1", - file2 = "entry.copy.file2", - fullPath = root.fullPath + '/' + file2, - fail = createFail('Entry'), - entryCallback = jasmine.createSpy().andCallFake(function(entry) { - // copy file1 to file2 - runs(function() { - entry.copyTo(root, file2, itCopy, fail); - }); - - waitsFor(function() { return itCopy.wasCalled; }, "itCopy never called", Tests.TEST_TIMEOUT); - }), - itCopy = jasmine.createSpy().andCallFake(function(entry) { - expect(entry).toBeDefined(); - expect(entry.isFile).toBe(true); - expect(entry.isDirectory).toBe(false); - expect(entry.fullPath).toCanonicallyMatch(fullPath); - expect(entry.name).toCanonicallyMatch(file2); - - runs(function() { - root.getFile(file2, {create:false}, itFileExists, fail); - }); - - waitsFor(function() { return itFileExists.wasCalled; }, "itFileExists never called", Tests.TEST_TIMEOUT); - - runs(function() { - expect(fail).not.toHaveBeenCalled(); - expect(itFileExists).toHaveBeenCalled(); - }); - }), - itFileExists = jasmine.createSpy().andCallFake(function(entry2) { - // a bit redundant since copy returned this entry already - expect(entry2).toBeDefined(); - expect(entry2.isFile).toBe(true); - expect(entry2.isDirectory).toBe(false); - expect(entry2.fullPath).toCanonicallyMatch(fullPath); - expect(entry2.name).toCanonicallyMatch(file2); - - // cleanup - deleteEntry(file1); - deleteEntry(file2); - }); - - // create a new file entry to kick off it - runs(function() { - createFile(file1, entryCallback, fail); - }); - - waitsFor(function() { return entryCallback.wasCalled; }, "entryCallback never called", Tests.TEST_TIMEOUT); - }); - it("file.spec.58 copyTo: file onto itself", function() { - var file1 = "entry.copy.fos.file1", - entryCallback = jasmine.createSpy().andCallFake(function(entry) { - // copy file1 onto itself - runs(function() { - entry.copyTo(root, null, win, itCopy); - }); - - waitsFor(function() { return itCopy.wasCalled; }, "itCopy never called", Tests.TEST_TIMEOUT); - - runs(function() { - expect(itCopy).toHaveBeenCalled(); - expect(fail).not.toHaveBeenCalled(); - expect(win).not.toHaveBeenCalled(); - }); - }), - fail = createFail('Entry'), - win = createWin('Entry'), - itCopy = jasmine.createSpy().andCallFake(function(error) { - expect(error).toBeDefined(); - expect(error).toBeFileError(FileError.INVALID_MODIFICATION_ERR); - - // cleanup - deleteEntry(file1); - }); - - // create a new file entry to kick off it - runs(function() { - createFile(file1, entryCallback, fail); - }); - - waitsFor(function() { return entryCallback.wasCalled; }, "entryCallback never called", Tests.TEST_TIMEOUT); - }); - it("file.spec.59 copyTo: directory", function() { - var file1 = "file1", - srcDir = "entry.copy.srcDir", - dstDir = "entry.copy.dstDir", - dstPath = root.fullPath + '/' + dstDir, - filePath = dstPath + '/' + file1, - entryCallback = jasmine.createSpy().andCallFake(function(directory) { - var copyDir = jasmine.createSpy().andCallFake(function(fileEntry) { - // copy srcDir to dstDir - runs(function() { - directory.copyTo(root, dstDir, itCopy, fail); - }); - - waitsFor(function() { return itCopy.wasCalled; }, "itCopy never called", Tests.TEST_TIMEOUT); - }); - - // create a file within new directory - runs(function() { - directory.getFile(file1, {create: true}, copyDir, fail); - }); - - waitsFor(function() { return copyDir.wasCalled; }, "copyDir never called", Tests.TEST_TIMEOUT); - }), - itCopy = jasmine.createSpy().andCallFake(function(directory) { - expect(directory).toBeDefined(); - expect(directory.isFile).toBe(false); - expect(directory.isDirectory).toBe(true); - expect(directory.fullPath).toCanonicallyMatch(dstPath); - expect(directory.name).toCanonicallyMatch(dstDir); - - runs(function() { - root.getDirectory(dstDir, {create:false}, itDirExists, fail); - }); - - waitsFor(function() { return itDirExists.wasCalled; }, "itDirExists never called", Tests.TEST_TIMEOUT); - }), - itDirExists = jasmine.createSpy().andCallFake(function(dirEntry) { - expect(dirEntry).toBeDefined(); - expect(dirEntry.isFile).toBe(false); - expect(dirEntry.isDirectory).toBe(true); - expect(dirEntry.fullPath).toCanonicallyMatch(dstPath); - expect(dirEntry.name).toCanonicallyMatch(dstDir); - - runs(function() { - dirEntry.getFile(file1, {create:false}, itFileExists, fail); - }); - - waitsFor(function() { return itFileExists.wasCalled; }, "itFileExists never called", Tests.TEST_TIMEOUT); - - runs(function() { - expect(itFileExists).toHaveBeenCalled(); - expect(fail).not.toHaveBeenCalled(); - }); - }), - itFileExists = jasmine.createSpy().andCallFake(function(fileEntry) { - expect(fileEntry).toBeDefined(); - expect(fileEntry.isFile).toBe(true); - expect(fileEntry.isDirectory).toBe(false); - expect(fileEntry.fullPath).toCanonicallyMatch(filePath); - expect(fileEntry.name).toCanonicallyMatch(file1); - - // cleanup - deleteEntry(srcDir); - deleteEntry(dstDir); - }), - fail = createFail('Entry'); - - // create a new directory entry to kick off it - runs(function() { - createDirectory(srcDir, entryCallback, fail); - }); - - waitsFor(function() { return entryCallback.wasCalled; }, "entryCallback never called", Tests.TEST_TIMEOUT); - }); - it("file.spec.60 copyTo: directory to backup at same root directory", function() { - var file1 = "file1", - srcDir = "entry.copy.srcDirSame", - dstDir = "entry.copy.srcDirSame-backup", - dstPath = root.fullPath + '/' + dstDir, - filePath = dstPath + '/' + file1, - fail = createFail('Entry copyTo: directory to backup at same root'), - entryCallback = function(directory) { - var copyDir = function(fileEntry) { - // copy srcDir to dstDir - directory.copyTo(root, dstDir, itCopy, fail); - }; - // create a file within new directory - directory.getFile(file1, {create: true}, copyDir, fail); - }, - itCopy = function(directory) { - expect(directory).toBeDefined(); - expect(directory.isFile).toBe(false); - expect(directory.isDirectory).toBe(true); - expect(directory.fullPath).toCanonicallyMatch(dstPath); - expect(directory.name).toCanonicallyMatch(dstDir); - - root.getDirectory(dstDir, {create:false}, itDirExists, fail); - }, - itDirExists = function(dirEntry) { - expect(dirEntry).toBeDefined(); - expect(dirEntry.isFile).toBe(false); - expect(dirEntry.isDirectory).toBe(true); - expect(dirEntry.fullPath).toCanonicallyMatch(dstPath); - expect(dirEntry.name).toCanonicallyMatch(dstDir); - - dirEntry.getFile(file1, {create:false}, itFileExists, fail); - }, - itFileExists = jasmine.createSpy().andCallFake(function(fileEntry) { - var cleanSrc = jasmine.createSpy(); - var cleanDst = jasmine.createSpy(); - runs(function() { - expect(fileEntry).toBeDefined(); - expect(fileEntry.isFile).toBe(true); - expect(fileEntry.isDirectory).toBe(false); - expect(fileEntry.fullPath).toCanonicallyMatch(filePath); - expect(fileEntry.name).toCanonicallyMatch(file1); - expect(fail).not.toHaveBeenCalled(); - - // cleanup - deleteEntry(srcDir, cleanSrc); - deleteEntry(dstDir, cleanDst); - }); - - waitsFor(function() { return cleanSrc.wasCalled && cleanDst.wasCalled; }, "cleanSrc and cleanDst cleanup methods", Tests.TEST_TIMEOUT); - }); - - // create a new directory entry to kick off it - runs(function() { - createDirectory(srcDir, entryCallback, fail); - }); - - waitsFor(function() { return itFileExists.wasCalled; }, "itFileExists", 10000); - }); - it("file.spec.61 copyTo: directory onto itself", function() { - var file1 = "file1", - srcDir = "entry.copy.dos.srcDir", - srcPath = root.fullPath + '/' + srcDir, - filePath = srcPath + '/' + file1, - win = createWin('Entry'), - fail = createFail('Entry copyTo: directory onto itself'), - entryCallback = jasmine.createSpy().andCallFake(function(directory) { - var copyDir = jasmine.createSpy().andCallFake(function(fileEntry) { - // copy srcDir onto itself - runs(function() { - directory.copyTo(root, null, win, itCopy); - }); - - waitsFor(function() { return itCopy.wasCalled; }, "itCopy never called", Tests.TEST_TIMEOUT); - }); - // create a file within new directory - runs(function() { - directory.getFile(file1, {create: true}, copyDir, fail); - }); - - waitsFor(function() { return copyDir.wasCalled; }, "copyDir never called", Tests.TEST_TIMEOUT); - }), - itCopy = jasmine.createSpy().andCallFake(function(error) { - expect(error).toBeDefined(); - expect(error).toBeFileError(FileError.INVALID_MODIFICATION_ERR); - - runs(function() { - root.getDirectory(srcDir, {create:false}, itDirectoryExists, fail); - }); - - waitsFor(function() { return itDirectoryExists.wasCalled; }, "itDirectoryExists", Tests.TEST_TIMEOUT); - }), - itDirectoryExists = jasmine.createSpy().andCallFake(function(dirEntry) { - // returning confirms existence so just check fullPath entry - expect(dirEntry).toBeDefined(); - expect(dirEntry.fullPath).toCanonicallyMatch(srcPath); - - runs(function() { - dirEntry.getFile(file1, {create:false}, itFileExists, fail); - }); - - waitsFor(function() { return itFileExists.wasCalled; }, "itFileExists never called", Tests.TEST_TIMEOUT); - - runs(function() { - expect(win).not.toHaveBeenCalled(); - expect(fail).not.toHaveBeenCalled(); - expect(itFileExists).toHaveBeenCalled(); - }); - }), - itFileExists = jasmine.createSpy().andCallFake(function(fileEntry) { - expect(fileEntry).toBeDefined(); - expect(fileEntry.fullPath).toCanonicallyMatch(filePath); - - // cleanup - deleteEntry(srcDir); - }); - - // create a new directory entry to kick off it - runs(function() { - createDirectory(srcDir, entryCallback, fail); - }); - - waitsFor(function() { return entryCallback.wasCalled; }, "entryCallback never called", Tests.TEST_TIMEOUT); - }); - it("file.spec.62 copyTo: directory into itself", function() { - var srcDir = "entry.copy.dis.srcDir", - dstDir = "entry.copy.dis.dstDir", - fail = createFail('Entry'), - win = createWin('Entry'), - srcPath = root.fullPath + '/' + srcDir, - entryCallback = jasmine.createSpy().andCallFake(function(directory) { - // copy source directory into itself - runs(function() { - directory.copyTo(directory, dstDir, win, itCopy); - }); - - waitsFor(function() { return itCopy.wasCalled; }, "itCopy", Tests.TEST_TIMEOUT); - }), - itCopy = jasmine.createSpy().andCallFake(function(error) { - expect(error).toBeDefined(); - expect(error).toBeFileError(FileError.INVALID_MODIFICATION_ERR); - - runs(function() { - root.getDirectory(srcDir, {create:false}, itDirectoryExists, fail); - }); - - waitsFor(function() { return itDirectoryExists.wasCalled; }, "itDirectoryExists never called", Tests.TEST_TIMEOUT); - - runs(function() { - expect(itDirectoryExists).toHaveBeenCalled(); - expect(win).not.toHaveBeenCalled(); - expect(fail).not.toHaveBeenCalled(); - }); - }), - itDirectoryExists = jasmine.createSpy().andCallFake(function(dirEntry) { - // returning confirms existence so just check fullPath entry - expect(dirEntry).toBeDefined(); - expect(dirEntry.fullPath).toCanonicallyMatch(srcPath); - - // cleanup - deleteEntry(srcDir); - }); - - // create a new directory entry to kick off it - runs(function() { - createDirectory(srcDir, entryCallback, fail); - }); - - waitsFor(function() { return entryCallback.wasCalled; }, "entryCallback never called", Tests.TEST_TIMEOUT); - }); - it("file.spec.63 copyTo: directory that does not exist", function() { - var file1 = "entry.copy.dnf.file1", - dstDir = "entry.copy.dnf.dstDir", - filePath = root.fullPath + '/' + file1, - dstPath = root.fullPath + '/' + dstDir, - win = createWin('Entry'), - fail = createFail('Entry'), - entryCallback = jasmine.createSpy().andCallFake(function(entry) { - // copy file to target directory that does not exist - runs(function() { - directory = new DirectoryEntry(); - directory.fullPath = dstPath; - entry.copyTo(directory, null, win, itCopy); - }); - - waitsFor(function() { return itCopy.wasCalled; }, "itCopy never called", Tests.TEST_TIMEOUT); - }), - itCopy = jasmine.createSpy().andCallFake(function(error) { - expect(error).toBeDefined(); - expect(error).toBeFileError(FileError.NOT_FOUND_ERR); - runs(function() { - root.getFile(file1, {create: false}, itFileExists, fail); - }); - - waitsFor(function() { return itFileExists.wasCalled; }, "itFileExists never called", Tests.TEST_TIMEOUT); - - runs(function() { - expect(itFileExists).toHaveBeenCalled(); - expect(win).not.toHaveBeenCalled(); - expect(fail).not.toHaveBeenCalled(); - }); - }), - itFileExists = jasmine.createSpy().andCallFake(function(fileEntry) { - expect(fileEntry).toBeDefined(); - expect(fileEntry.fullPath).toCanonicallyMatch(filePath); - - // cleanup - deleteEntry(file1); - }); - - // create a new file entry to kick off it - runs(function() { - createFile(file1, entryCallback, fail); - }); - - waitsFor(function() { return entryCallback.wasCalled; }, "entryCallback never called", Tests.TEST_TIMEOUT); - }); - it("file.spec.64 copyTo: invalid target name", function() { - var file1 = "entry.copy.itn.file1", - file2 = "bad:file:name", - filePath = root.fullPath + '/' + file1, - fail = createFail('Entry'), - win = createWin('Entry'), - entryCallback = jasmine.createSpy().andCallFake(function(entry) { - // copy file1 to file2 - runs(function() { - entry.copyTo(root, file2, win, itCopy); - }); - - waitsFor(function() { return itCopy.wasCalled; }, "itCopy never called", Tests.TEST_TIMEOUT); - - runs(function() { - expect(fail).not.toHaveBeenCalled(); - expect(win).not.toHaveBeenCalled(); - expect(itCopy).toHaveBeenCalled(); - }); - }), - itCopy = jasmine.createSpy().andCallFake(function(error) { - expect(error).toBeDefined(); - expect(error).toBeFileError(FileError.ENCODING_ERR); - - // cleanup - deleteEntry(file1); - }); - - // create a new file entry - runs(function() { - createFile(file1, entryCallback, fail); - }); - - waitsFor(function() { return entryCallback.wasCalled; }, "entryCallback never called", Tests.TEST_TIMEOUT); - }); - it("file.spec.65 moveTo: file to same parent", function() { - var file1 = "entry.move.fsp.file1", - file2 = "entry.move.fsp.file2", - srcPath = root.fullPath + '/' + file1, - dstPath = root.fullPath + '/' + file2, - fail = createFail('Entry'), - win = createWin('Entry'), - entryCallback = jasmine.createSpy().andCallFake(function(entry) { - // move file1 to file2 - runs(function() { - entry.moveTo(root, file2, itMove, fail); - }); - - waitsFor(function() { return itMove.wasCalled; }, "itMove never called", Tests.TEST_TIMEOUT); - }), - itMove = jasmine.createSpy().andCallFake(function(entry) { - expect(entry).toBeDefined(); - expect(entry.isFile).toBe(true); - expect(entry.isDirectory).toBe(false); - expect(entry.fullPath).toCanonicallyMatch(dstPath); - expect(entry.name).toCanonicallyMatch(file2); - - runs(function() { - root.getFile(file2, {create:false}, itMovedExists, fail); - }); - - waitsFor(function() { return itMovedExists.wasCalled; }, "itMovedExists never called", Tests.TEST_TIMEOUT); - }), - itMovedExists = jasmine.createSpy().andCallFake(function(fileEntry) { - expect(fileEntry).toBeDefined(); - expect(fileEntry.fullPath).toCanonicallyMatch(dstPath); - - runs(function() { - root.getFile(file1, {create:false}, win, itOrig); - }); - - waitsFor(function() { return itOrig.wasCalled; }, "itOrig never called", Tests.TEST_TIMEOUT); - - runs(function() { - expect(win).not.toHaveBeenCalled(); - expect(fail).not.toHaveBeenCalled(); - expect(itOrig).toHaveBeenCalled(); - }); - }), - itOrig = jasmine.createSpy().andCallFake(function(error) { - //expect(navigator.fileMgr.itFileExists(srcPath) === false, "original file should not exist."); - expect(error).toBeDefined(); - expect(error).toBeFileError(FileError.NOT_FOUND_ERR); - - // cleanup - deleteEntry(file1); - deleteEntry(file2); - }); - - // create a new file entry to kick off it - runs(function() { - createFile(file1, entryCallback, fail); - }); - - waitsFor(function() { return entryCallback.wasCalled; }, "entryCallback never called", Tests.TEST_TIMEOUT); - }); - it("file.spec.66 moveTo: file to new parent", function() { - var file1 = "entry.move.fnp.file1", - dir = "entry.move.fnp.dir", - srcPath = root.fullPath + '/' + file1, - win = createWin('Entry'), - fail = createFail('Entry'), - dstPath = root.fullPath + '/' + dir + '/' + file1, - entryCallback = jasmine.createSpy().andCallFake(function(entry) { - // move file1 to new directory - var moveFile = jasmine.createSpy().andCallFake(function(directory) { - var itMove = jasmine.createSpy().andCallFake(function(entry) { - expect(entry).toBeDefined(); - expect(entry.isFile).toBe(true); - expect(entry.isDirectory).toBe(false); - expect(entry.fullPath).toCanonicallyMatch(dstPath); - expect(entry.name).toCanonicallyMatch(file1); - // it the moved file exists - runs(function() { - directory.getFile(file1, {create:false}, itMovedExists, fail); - }); - - waitsFor(function() { return itMovedExists.wasCalled; }, "itMovedExists never called", Tests.TEST_TIMEOUT); - }); - // move the file - runs(function() { - entry.moveTo(directory, null, itMove, fail); - }); - - waitsFor(function() { return itMove.wasCalled; }, "itMove never called", Tests.TEST_TIMEOUT); - }); - - // create a parent directory to move file to - runs(function() { - root.getDirectory(dir, {create: true}, moveFile, fail); - }); - - waitsFor(function() { return moveFile.wasCalled; }, "moveFile never called", Tests.TEST_TIMEOUT); - }), - itMovedExists = jasmine.createSpy().andCallFake(function(fileEntry) { - expect(fileEntry).toBeDefined(); - expect(fileEntry.fullPath).toCanonicallyMatch(dstPath); - - runs(function() { - root.getFile(file1, {create:false}, win, itOrig); - }); - - waitsFor(function() { return itOrig.wasCalled; }, "itOrig never called", Tests.TEST_TIMEOUT); - - runs(function() { - expect(win).not.toHaveBeenCalled(); - expect(fail).not.toHaveBeenCalled(); - expect(itOrig).toHaveBeenCalled(); - }); - }), - itOrig = jasmine.createSpy().andCallFake(function(error) { - expect(error).toBeDefined(); - expect(error).toBeFileError(FileError.NOT_FOUND_ERR); - - // cleanup - deleteEntry(file1); - deleteEntry(dir); - }); - - // ensure destination directory is cleaned up first - runs(function() { - deleteEntry(dir, function() { - // create a new file entry to kick off it - createFile(file1, entryCallback, fail); - }, fail); - }); - waitsFor(function() { return entryCallback.wasCalled; }, "entryCallback never called", Tests.TEST_TIMEOUT); - }); - it("file.spec.67 moveTo: directory to same parent", function() { - var file1 = "file1", - srcDir = "entry.move.dsp.srcDir", - dstDir = "entry.move.dsp.dstDir", - srcPath = root.fullPath + '/' + srcDir, - dstPath = root.fullPath + '/' + dstDir, - filePath = dstPath + '/' + file1, - win = createWin('Entry'), - fail = createFail('Entry'), - entryCallback = jasmine.createSpy().andCallFake(function(directory) { - var moveDir = jasmine.createSpy().andCallFake(function(fileEntry) { - // move srcDir to dstDir - runs(function() { - directory.moveTo(root, dstDir, itMove, fail); - }); - - waitsFor(function() { return itMove.wasCalled; }, "itMove never called", Tests.TEST_TIMEOUT); - }); - // create a file within directory - runs(function() { - directory.getFile(file1, {create: true}, moveDir, fail); - }); - - waitsFor(function() { return moveDir.wasCalled; }, "moveDir never called", Tests.TEST_TIMEOUT); - }), - itMove = jasmine.createSpy().andCallFake(function(directory) { - expect(directory).toBeDefined(); - expect(directory.isFile).toBe(false); - expect(directory.isDirectory).toBe(true); - expect(directory.fullPath).toCanonicallyMatch(dstPath); - expect(directory.name).toCanonicallyMatch(dstDir); - // it that moved file exists in destination dir - - runs(function() { - directory.getFile(file1, {create:false}, itMovedExists, fail); - }); - - waitsFor(function() { return itMovedExists.wasCalled; }, "itMovedExists never called", Tests.TEST_TIMEOUT); - }), - itMovedExists = jasmine.createSpy().andCallFake(function(fileEntry) { - expect(fileEntry).toBeDefined(); - expect(fileEntry.fullPath).toCanonicallyMatch(filePath); - - // check that the moved file no longer exists in original dir - runs(function() { - root.getFile(file1, {create:false}, win, itOrig); - }); - - waitsFor(function() { return itOrig.wasCalled; }, "itOrig never called", Tests.TEST_TIMEOUT); - - runs(function() { - expect(win).not.toHaveBeenCalled(); - expect(fail).not.toHaveBeenCalled(); - expect(itOrig).toHaveBeenCalled(); - }); - }), - itOrig = jasmine.createSpy().andCallFake(function(error) { - expect(error).toBeDefined(); - expect(error).toBeFileError(FileError.NOT_FOUND_ERR); - - // cleanup - deleteEntry(srcDir); - deleteEntry(dstDir); - }); - - // ensure destination directory is cleaned up before it - runs(function() { - deleteEntry(dstDir, function() { - // create a new directory entry to kick off it - createDirectory(srcDir, entryCallback, fail); - }, fail); - }); - - waitsFor(function() { return entryCallback.wasCalled; }, "entryCallback never called", Tests.TEST_TIMEOUT); - }); - it("file.spec.68 moveTo: directory to same parent with same name", function() { - var file1 = "file1", - srcDir = "entry.move.dsp.srcDir", - dstDir = "entry.move.dsp.srcDir-backup", - srcPath = root.fullPath + '/' + srcDir, - dstPath = root.fullPath + '/' + dstDir, - filePath = dstPath + '/' + file1, - win = createWin('Entry'), - fail = createFail('Entry'), - entryCallback = jasmine.createSpy().andCallFake(function(directory) { - var moveDir = jasmine.createSpy().andCallFake(function(fileEntry) { - // move srcDir to dstDir - runs(function() { - directory.moveTo(root, dstDir, itMove, fail); - }); - - waitsFor(function() { return itMove.wasCalled; }, "itMove never called", Tests.TEST_TIMEOUT); - }); - // create a file within directory - runs(function() { - directory.getFile(file1, {create: true}, moveDir, fail); - }); - - waitsFor(function() { return moveDir.wasCalled; }, "moveDir never called", Tests.TEST_TIMEOUT); - }), - itMove = jasmine.createSpy().andCallFake(function(directory) { - expect(directory).toBeDefined(); - expect(directory.isFile).toBe(false); - expect(directory.isDirectory).toBe(true); - expect(directory.fullPath).toCanonicallyMatch(dstPath); - expect(directory.name).toCanonicallyMatch(dstDir); - // check that moved file exists in destination dir - runs(function() { - directory.getFile(file1, {create:false}, itMovedExists, null); - }); - - waitsFor(function() { return itMovedExists.wasCalled; }, "itMovedExists never called", Tests.TEST_TIMEOUT); - }), - itMovedExists = jasmine.createSpy().andCallFake(function(fileEntry) { - expect(fileEntry).toBeDefined(); - expect(fileEntry.fullPath).toCanonicallyMatch(filePath); - // check that the moved file no longer exists in original dir - runs(function() { - root.getFile(file1, {create:false}, win, itOrig); - }); - - waitsFor(function() { return itOrig.wasCalled; }, "itOrig never called", Tests.TEST_TIMEOUT); - - runs(function() { - expect(win).not.toHaveBeenCalled(); - expect(fail).not.toHaveBeenCalled(); - expect(itOrig).toHaveBeenCalled(); - }); - }), - itOrig = jasmine.createSpy().andCallFake(function(error) { - expect(error).toBeDefined(); - expect(error).toBeFileError(FileError.NOT_FOUND_ERR); - - // cleanup - deleteEntry(srcDir); - deleteEntry(dstDir); - }); - - // ensure destination directory is cleaned up before it - runs(function() { - deleteEntry(dstDir, function() { - // create a new directory entry to kick off it - createDirectory(srcDir, entryCallback, fail); - }, fail); - }); - - waitsFor(function() { return entryCallback.wasCalled; }, "entryCallback never called", Tests.TEST_TIMEOUT); - }); - it("file.spec.69 moveTo: directory to new parent", function() { - var file1 = "file1", - srcDir = "entry.move.dnp.srcDir", - dstDir = "entry.move.dnp.dstDir", - srcPath = root.fullPath + '/' + srcDir, - dstPath = root.fullPath + '/' + dstDir, - filePath = dstPath + '/' + file1, - win = createWin('Entry'), - fail = createFail('Entry'), - entryCallback = jasmine.createSpy().andCallFake(function(directory) { - var moveDir = jasmine.createSpy().andCallFake(function(fileEntry) { - // move srcDir to dstDir - runs(function() { - directory.moveTo(root, dstDir, itMove, fail); - }); - - waitsFor(function() { return itMove.wasCalled; }, "itMove never called", Tests.TEST_TIMEOUT); - }); - // create a file within directory - runs(function() { - directory.getFile(file1, {create: true}, moveDir, fail); - }); - - waitsFor(function() { return moveDir.wasCalled; }, "moveDir never called", Tests.TEST_TIMEOUT); - }), - itMove = jasmine.createSpy().andCallFake(function(directory) { - expect(directory).toBeDefined(); - expect(directory.isFile).toBe(false); - expect(directory.isDirectory).toBe(true); - expect(directory.fullPath).toCanonicallyMatch(dstPath); - expect(directory.name).toCanonicallyMatch(dstDir); - // it that moved file exists in destination dir - runs(function() { - directory.getFile(file1, {create:false}, itMovedExists, fail); - }); - - waitsFor(function() { return itMovedExists.wasCalled; }, "itMovedExists never called", Tests.TEST_TIMEOUT); - }), - itMovedExists = jasmine.createSpy().andCallFake(function(fileEntry) { - expect(fileEntry).toBeDefined(); - expect(fileEntry.fullPath).toCanonicallyMatch(filePath); - // it that the moved file no longer exists in original dir - runs(function() { - root.getFile(file1, {create:false}, win, itOrig); - }); - - waitsFor(function() { return itOrig.wasCalled; }, "itOrig never called", Tests.TEST_TIMEOUT); - - runs(function() { - expect(win).not.toHaveBeenCalled(); - expect(fail).not.toHaveBeenCalled(); - expect(itOrig).toHaveBeenCalled(); - }); - }), - itOrig = jasmine.createSpy().andCallFake(function(error) { - expect(error).toBeDefined(); - expect(error).toBeFileError(FileError.NOT_FOUND_ERR); - - // cleanup - deleteEntry(srcDir); - deleteEntry(dstDir); - }); - - // ensure destination directory is cleaned up before it - runs(function() { - deleteEntry(dstDir, function() { - // create a new directory entry to kick off it - createDirectory(srcDir, entryCallback, fail); - }, fail); - }); - - waitsFor(function() { return entryCallback.wasCalled; }, "entryCallback never called", Tests.TEST_TIMEOUT); - }); - it("file.spec.70 moveTo: directory onto itself", function() { - var file1 = "file1", - srcDir = "entry.move.dos.srcDir", - srcPath = root.fullPath + '/' + srcDir, - filePath = srcPath + '/' + file1, - fail = createFail('Entry'), - win = createWin('Entry'), - entryCallback = jasmine.createSpy().andCallFake(function(directory) { - var moveDir = jasmine.createSpy().andCallFake(function(fileEntry) { - // move srcDir onto itself - runs(function() { - directory.moveTo(root, null, win, itMove); - }); - - waitsFor(function() { return itMove.wasCalled; }, "itMove never called", Tests.TEST_TIMEOUT); - }); - // create a file within new directory - runs(function() { - directory.getFile(file1, {create: true}, moveDir, fail); - }); - - waitsFor(function() { return moveDir.wasCalled; }, "moveDir never called", Tests.TEST_TIMEOUT); - }), - itMove = jasmine.createSpy().andCallFake(function(error) { - expect(error).toBeDefined(); - expect(error).toBeFileError(FileError.INVALID_MODIFICATION_ERR); - - // it that original dir still exists - runs(function() { - root.getDirectory(srcDir, {create:false}, itDirectoryExists, fail); - }); - - waitsFor(function() { return itDirectoryExists.wasCalled; }, "itDirectoryExists", Tests.TEST_TIMEOUT); - }), - itDirectoryExists = jasmine.createSpy().andCallFake(function(dirEntry) { - // returning confirms existence so just check fullPath entry - expect(dirEntry).toBeDefined(); - expect(dirEntry.fullPath).toCanonicallyMatch(srcPath); - - runs(function() { - dirEntry.getFile(file1, {create:false}, itFileExists, fail); - }); - - waitsFor(function() { return itFileExists.wasCalled; }, "itFileExists never called", Tests.TEST_TIMEOUT); - - runs(function() { - expect(itFileExists).toHaveBeenCalled(); - expect(win).not.toHaveBeenCalled(); - expect(fail).not.toHaveBeenCalled(); - }); - }), - itFileExists = jasmine.createSpy().andCallFake(function(fileEntry) { - expect(fileEntry).toBeDefined(); - expect(fileEntry.fullPath).toCanonicallyMatch(filePath); - - // cleanup - deleteEntry(srcDir); - }); - - // create a new directory entry to kick off it - runs(function() { - createDirectory(srcDir, entryCallback, fail); - }); - - waitsFor(function() { return entryCallback.wasCalled; }, "entryCallback never called", Tests.TEST_TIMEOUT); - }); - it("file.spec.71 moveTo: directory into itself", function() { - var srcDir = "entry.move.dis.srcDir", - dstDir = "entry.move.dis.dstDir", - srcPath = root.fullPath + '/' + srcDir, - win = createWin('Entry'), - fail = createFail('Entry'), - entryCallback = jasmine.createSpy().andCallFake(function(directory) { - // move source directory into itself - runs(function() { - directory.moveTo(directory, dstDir, win, itMove); - }); - - waitsFor(function() { return itMove.wasCalled; }, "itMove never called", Tests.TEST_TIMEOUT); - }), - itMove = jasmine.createSpy().andCallFake(function(error) { - expect(error).toBeDefined(); - expect(error).toBeFileError(FileError.INVALID_MODIFICATION_ERR); - // make sure original directory still exists - runs(function() { - root.getDirectory(srcDir, {create:false}, itDirectoryExists, fail); - }); - - waitsFor(function() { return itDirectoryExists.wasCalled; }, "itDirectoryExists never called", Tests.TEST_TIMEOUT); - - runs(function() { - expect(fail).not.toHaveBeenCalled(); - expect(win).not.toHaveBeenCalled(); - expect(itDirectoryExists).toHaveBeenCalled(); - }); - }), - itDirectoryExists = jasmine.createSpy().andCallFake(function(entry) { - expect(entry).toBeDefined(); - expect(entry.fullPath).toCanonicallyMatch(srcPath); - - // cleanup - deleteEntry(srcDir); - }); - - // create a new directory entry to kick off it - runs(function() { - createDirectory(srcDir, entryCallback, fail); - }); - - waitsFor(function() { return entryCallback.wasCalled; }, "entryCallback never called", Tests.TEST_TIMEOUT); - }); - it("file.spec.72 moveTo: file onto itself", function() { - var file1 = "entry.move.fos.file1", - filePath = root.fullPath + '/' + file1, - win = createWin('Entry'), - fail = createFail('Entry'), - entryCallback = jasmine.createSpy().andCallFake(function(entry) { - // move file1 onto itself - runs(function() { - entry.moveTo(root, null, win, itMove); - }); - - waitsFor(function() { return itMove.wasCalled; }, "itMove never called", Tests.TEST_TIMEOUT); - }), - itMove = jasmine.createSpy().andCallFake(function(error) { - expect(error).toBeDefined(); - expect(error).toBeFileError(FileError.INVALID_MODIFICATION_ERR); - - //it that original file still exists - runs(function() { - root.getFile(file1, {create:false}, itFileExists, fail); - }); - - waitsFor(function() { return itFileExists.wasCalled; }, "itFileExists never called", Tests.TEST_TIMEOUT); - - runs(function() { - expect(itFileExists).toHaveBeenCalled(); - expect(win).not.toHaveBeenCalled(); - expect(fail).not.toHaveBeenCalled(); - }); - }), - itFileExists = jasmine.createSpy().andCallFake(function(fileEntry) { - expect(fileEntry).toBeDefined(); - expect(fileEntry.fullPath).toCanonicallyMatch(filePath); - - // cleanup - deleteEntry(file1); - }); - - // create a new file entry to kick off it - runs(function() { - createFile(file1, entryCallback, fail); - }); - - waitsFor(function() { return entryCallback.wasCalled; }, "entryCallback never called", Tests.TEST_TIMEOUT); - }); - it("file.spec.73 moveTo: file onto existing directory", function() { - var file1 = "entry.move.fod.file1", - dstDir = "entry.move.fod.dstDir", - subDir = "subDir", - dirPath = root.fullPath + '/' + dstDir + '/' + subDir, - filePath = root.fullPath + '/' + file1, - win = createWin('Entry'), - fail = createFail('Entry'), - entryCallback = function(entry) { - var createSubDirectory = function(directory) { - var moveFile = function(subDirectory) { - var itMove = function(error) { - expect(error).toBeDefined(); - expect(error).toBeFileError(FileError.INVALID_MODIFICATION_ERR); - // check that original dir still exists - directory.getDirectory(subDir, {create:false}, itDirectoryExists, fail); - }; - // move file1 onto sub-directory - entry.moveTo(directory, subDir, win, itMove); - }; - // create sub-directory - directory.getDirectory(subDir, {create: true}, moveFile, fail); - }; - // create top level directory - root.getDirectory(dstDir, {create: true}, createSubDirectory, fail); - }, - itDirectoryExists = function(dirEntry) { - expect(dirEntry).toBeDefined(); - expect(dirEntry.fullPath).toCanonicallyMatch(dirPath); - // check that original file still exists - root.getFile(file1, {create:false},itFileExists, fail); - }, - itFileExists = jasmine.createSpy().andCallFake(function(fileEntry) { - expect(fileEntry).toBeDefined(); - expect(fileEntry.fullPath).toCanonicallyMatch(filePath); - - // cleanup - deleteEntry(file1); - deleteEntry(dstDir); - }); - - // ensure destination directory is cleaned up before it - runs(function() { - deleteEntry(dstDir, function() { - // create a new file entry to kick off it - createFile(file1, entryCallback, fail); - }, fail); - }); - - waitsFor(function() { return itFileExists.wasCalled; }, "itFileExists never called", Tests.TEST_TIMEOUT); - - runs(function() { - expect(itFileExists).toHaveBeenCalled(); - expect(win).not.toHaveBeenCalled(); - expect(fail).not.toHaveBeenCalled(); - }); - }); - it("file.spec.74 moveTo: directory onto existing file", function() { - var file1 = "entry.move.dof.file1", - srcDir = "entry.move.dof.srcDir", - dirPath = root.fullPath + '/' + srcDir, - filePath = root.fullPath + '/' + file1, - win = createWin('Entry'), - fail = createFail('Entry'), - entryCallback = function(entry) { - var moveDir = function(fileEntry) { - // move directory onto file - entry.moveTo(root, file1, win, itMove); - }; - // create file - root.getFile(file1, {create: true}, moveDir, fail); - }, - itMove = function(error) { - expect(error).toBeDefined(); - expect(error).toBeFileError(FileError.INVALID_MODIFICATION_ERR); - // it that original directory exists - root.getDirectory(srcDir, {create:false}, itDirectoryExists, fail); - }, - itDirectoryExists = function(dirEntry) { - // returning confirms existence so just check fullPath entry - expect(dirEntry).toBeDefined(); - expect(dirEntry.fullPath).toCanonicallyMatch(dirPath); - // it that original file exists - root.getFile(file1, {create:false}, itFileExists, fail); - }, - itFileExists = jasmine.createSpy().andCallFake(function(fileEntry) { - expect(fileEntry).toBeDefined(); - expect(fileEntry.fullPath).toCanonicallyMatch(filePath); - - // cleanup - deleteEntry(file1); - deleteEntry(srcDir); - }); - - // create a new directory entry to kick off it - runs(function() { - createDirectory(srcDir, entryCallback, fail); - }); - - waitsFor(function() { return itFileExists.wasCalled; }, "itFileExists never called", Tests.TEST_TIMEOUT); - - runs(function() { - expect(itFileExists).toHaveBeenCalled(); - expect(win).not.toHaveBeenCalled(); - expect(fail).not.toHaveBeenCalled(); - }); - }); - it("file.spec.75 copyTo: directory onto existing file", function() { - var file1 = "entry.copy.dof.file1", - srcDir = "entry.copy.dof.srcDir", - dirPath = root.fullPath + '/' + srcDir, - filePath = root.fullPath + '/' + file1, - win = createWin('Entry'), - fail = createFail('Entry'), - entryCallback = function(entry) { - var copyDir = function(fileEntry) { - // move directory onto file - entry.copyTo(root, file1, win, itMove); - }; - // create file - root.getFile(file1, {create: true}, copyDir, fail); - }, - itMove = function(error) { - expect(error).toBeDefined(); - expect(error).toBeFileError(FileError.INVALID_MODIFICATION_ERR); - //check that original dir still exists - root.getDirectory(srcDir, {create:false}, itDirectoryExists, fail); - }, - itDirectoryExists = function(dirEntry) { - // returning confirms existence so just check fullPath entry - expect(dirEntry).toBeDefined(); - expect(dirEntry.fullPath).toCanonicallyMatch(dirPath); - // it that original file still exists - root.getFile(file1, {create:false}, itFileExists, fail); - }, - itFileExists = jasmine.createSpy().andCallFake(function(fileEntry) { - expect(fileEntry).toBeDefined(); - expect(fileEntry.fullPath).toCanonicallyMatch(filePath); - - // cleanup - deleteEntry(file1); - deleteEntry(srcDir); - }); - - // create a new directory entry to kick off it - runs(function() { - createDirectory(srcDir, entryCallback, fail); - }); - - waitsFor(function() { return itFileExists.wasCalled; }, "itFileExists never called", Tests.TEST_TIMEOUT); - - runs(function() { - expect(itFileExists).toHaveBeenCalled(); - expect(win).not.toHaveBeenCalled(); - expect(fail).not.toHaveBeenCalled(); - }); - }); - it("file.spec.76 moveTo: directory onto directory that is not empty", function() { - var srcDir = "entry.move.dod.srcDir", - dstDir = "entry.move.dod.dstDir", - subDir = "subDir", - srcPath = root.fullPath + '/' + srcDir, - dstPath = root.fullPath + '/' + dstDir + '/' + subDir, - win = createWin('Entry'), - fail = createFail('Entry'), - entryCallback = function(entry) { - var createSubDirectory = function(directory) { - var moveDir = function(subDirectory) { - // move srcDir onto dstDir (not empty) - entry.moveTo(root, dstDir, win, itMove); - }; - var itMove = function(error) { - expect(error).toBeDefined(); - expect(error).toBeFileError(FileError.INVALID_MODIFICATION_ERR); - - // it that destination directory still exists - directory.getDirectory(subDir, {create:false}, itDirectoryExists, fail); - }; - // create sub-directory - directory.getDirectory(subDir, {create: true}, moveDir, fail); - }; - // create top level directory - root.getDirectory(dstDir, {create: true}, createSubDirectory, fail); - }, - itDirectoryExists = function(dirEntry) { - // returning confirms existence so just check fullPath entry - expect(dirEntry).toBeDefined(); - expect(dirEntry.fullPath).toCanonicallyMatch(dstPath); - // it that source directory exists - root.getDirectory(srcDir,{create:false}, itSrcDirectoryExists, fail); - }, - itSrcDirectoryExists = jasmine.createSpy().andCallFake(function(srcEntry){ - expect(srcEntry).toBeDefined(); - expect(srcEntry.fullPath).toCanonicallyMatch(srcPath); - // cleanup - deleteEntry(srcDir); - deleteEntry(dstDir); - }); - - // ensure destination directory is cleaned up before it - runs(function() { - deleteEntry(dstDir, function() { - // create a new file entry to kick off it - createDirectory(srcDir, entryCallback, fail); - }, fail); - }); - - waitsFor(function() { return itSrcDirectoryExists.wasCalled; }, "itSrcDirectoryExists never called", Tests.TEST_TIMEOUT); - - runs(function() { - expect(itSrcDirectoryExists).toHaveBeenCalled(); - expect(win).not.toHaveBeenCalled(); - expect(fail).not.toHaveBeenCalled(); - }); - }); - it("file.spec.77 moveTo: file replace existing file", function() { - var file1 = "entry.move.frf.file1", - file2 = "entry.move.frf.file2", - file1Path = root.fullPath + '/' + file1, - file2Path = root.fullPath + '/' + file2, - win = createWin('Entry'), - fail = createFail('Entry'), - entryCallback = function(entry) { - var moveFile = function(fileEntry) { - // replace file2 with file1 - entry.moveTo(root, file2, itMove, fail); - }; - // create file - root.getFile(file2, {create: true}, moveFile,fail); - }, - itMove = function(entry) { - expect(entry).toBeDefined(); - expect(entry.isFile).toBe(true); - expect(entry.isDirectory).toBe(false); - expect(entry.fullPath).toCanonicallyMatch(file2Path); - expect(entry.name).toCanonicallyMatch(file2); - - // it that old file does not exists - root.getFile(file1, {create:false}, win, itFileMoved); - }, - itFileMoved = function(error){ - expect(error).toBeDefined(); - expect(error).toBeFileError(FileError.NOT_FOUND_ERR); - // it that new file exists - root.getFile(file2, {create:false}, itFileExists, fail); - }, - itFileExists = jasmine.createSpy().andCallFake(function(fileEntry) { - expect(fileEntry).toBeDefined(); - expect(fileEntry.fullPath).toCanonicallyMatch(file2Path); - - // cleanup - deleteEntry(file1); - deleteEntry(file2); - }); - - // create a new directory entry to kick off it - runs(function() { - createFile(file1, entryCallback, fail); - }); - - waitsFor(function() { return itFileExists.wasCalled; }, "itFileExists never called", Tests.TEST_TIMEOUT); - - runs(function() { - expect(itFileExists).toHaveBeenCalled(); - expect(win).not.toHaveBeenCalled(); - expect(fail).not.toHaveBeenCalled(); - }); - }); - it("file.spec.78 moveTo: directory replace empty directory", function() { - var file1 = "file1", - srcDir = "entry.move.drd.srcDir", - dstDir = "entry.move.drd.dstDir", - srcPath = root.fullPath + '/' + srcDir, - dstPath = root.fullPath + '/' + dstDir, - win = createWin('Entry'), - fail = createFail('Entry'), - filePath = dstPath + '/' + file1, - entryCallback = function(directory) { - var mkdir = function(fileEntry) { - // create destination directory - root.getDirectory(dstDir, {create: true}, moveDir, fail); - }; - var moveDir = function(fileEntry) { - // move srcDir to dstDir - directory.moveTo(root, dstDir, itMove, fail); - }; - // create a file within source directory - directory.getFile(file1, {create: true}, mkdir, fail); - }, - itMove = function(directory) { - expect(directory).toBeDefined(); - expect(directory.isFile).toBe(false); - expect(directory.isDirectory).toBe(true); - expect(directory.fullPath).toCanonicallyMatch(dstPath); - expect(directory.name).toCanonicallyMatch(dstDir); - // check that old directory contents have been moved - directory.getFile(file1, {create:false}, itFileExists, fail); - }, - itFileExists = function(fileEntry) { - expect(fileEntry).toBeDefined(); - expect(fileEntry.fullPath).toCanonicallyMatch(filePath); - - // check that old directory no longer exists - root.getDirectory(srcDir, {create:false}, win, itRemoved); - }, - itRemoved = jasmine.createSpy().andCallFake(function(error){ - expect(error).toBeDefined(); - expect(error).toBeFileError(FileError.NOT_FOUND_ERR); - - // cleanup - deleteEntry(srcDir); - deleteEntry(dstDir); - }); - - // ensure destination directory is cleaned up before it - runs(function() { - deleteEntry(dstDir, function() { - // create a new directory entry to kick off it - createDirectory(srcDir, entryCallback, fail); - }, fail); - }); - - waitsFor(function() { return itRemoved.wasCalled; }, "itRemoved never called", Tests.TEST_TIMEOUT); - - runs(function() { - expect(itRemoved).toHaveBeenCalled(); - expect(win).not.toHaveBeenCalled(); - expect(fail).not.toHaveBeenCalled(); - }); - }); - it("file.spec.79 moveTo: directory that does not exist", function() { - var file1 = "entry.move.dnf.file1", - dstDir = "entry.move.dnf.dstDir", - filePath = root.fullPath + '/' + file1, - dstPath = root.fullPath + '/' + dstDir, - win = createWin('Entry'), - fail = createFail('Entry'), - entryCallback = function(entry) { - // move file to directory that does not exist - directory = new DirectoryEntry(); - directory.fullPath = dstPath; - entry.moveTo(directory, null, win, itMove); - }, - itMove = jasmine.createSpy().andCallFake(function(error) { - expect(error).toBeDefined(); - expect(error).toBeFileError(FileError.NOT_FOUND_ERR); - - // cleanup - deleteEntry(file1); - }); - - // create a new file entry to kick off it - runs(function() { - createFile(file1, entryCallback, fail); - }); - - waitsFor(function() { return itMove.wasCalled; }, "itMove never called", Tests.TEST_TIMEOUT); - - runs(function() { - expect(itMove).toHaveBeenCalled(); - expect(win).not.toHaveBeenCalled(); - expect(fail).not.toHaveBeenCalled(); - }); - }); - it("file.spec.80 moveTo: invalid target name", function() { - var file1 = "entry.move.itn.file1", - file2 = "bad:file:name", - filePath = root.fullPath + '/' + file1, - win = createWin('Entry'), - fail = createFail('Entry'), - entryCallback = function(entry) { - // move file1 to file2 - entry.moveTo(root, file2, win, itMove); - }, - itMove = jasmine.createSpy().andCallFake(function(error) { - expect(error).toBeDefined(); - expect(error).toBeFileError(FileError.ENCODING_ERR); - - // cleanup - deleteEntry(file1); - }); - - // create a new file entry to kick off it - runs(function() { - createFile(file1,entryCallback, fail); - }); - - waitsFor(function() { return itMove.wasCalled; }, "itMove never called", Tests.TEST_TIMEOUT); - - runs(function() { - expect(itMove).toHaveBeenCalled(); - expect(win).not.toHaveBeenCalled(); - expect(fail).not.toHaveBeenCalled(); - }); - }); - }); - - describe('FileReader', function() { - it("file.spec.81 should have correct methods", function() { - var reader = new FileReader(); - expect(reader).toBeDefined(); - expect(typeof reader.readAsBinaryString).toBe('function'); - expect(typeof reader.readAsDataURL).toBe('function'); - expect(typeof reader.readAsText).toBe('function'); - expect(typeof reader.readAsArrayBuffer).toBe('function'); - expect(typeof reader.abort).toBe('function'); - }); - }); - - describe('read method', function(){ - it("file.spec.82 should error out on non-existent file", function() { - var reader = new FileReader(); - var verifier = jasmine.createSpy().andCallFake(function(evt) { - expect(evt).toBeDefined(); - expect(evt.target.error).toBeFileError(FileError.NOT_FOUND_ERR); - }); - reader.onerror = verifier; - var myFile = new File(); - myFile.fullPath = root.fullPath + '/' + "doesnotexist.err"; - - reader.readAsText(myFile); - - waitsFor(function() { return verifier.wasCalled; }, "verifier never called", Tests.TEST_TIMEOUT); - }); - it("file.spec.83 should be able to read native blob objects", function() { - // Skip test if blobs are not supported (e.g.: Android 2.3). - if (typeof window.Blob == 'undefined' || typeof window.Uint8Array == 'undefined') { - return; - } - var contents = 'asdf'; - var uint8Array = new Uint8Array(contents.length); - for (var i = 0; i < contents.length; ++i) { - uint8Array[i] = contents.charCodeAt(i); - } - var Builder = window.BlobBuilder || window.WebKitBlobBuilder; - var blob; - if (Builder) { - var builder = new Builder(); - builder.append(uint8Array.buffer); - builder.append(contents); - blob = builder.getBlob("text/plain"); - } else { - try { - // iOS 6 does not support Views, so pass in the buffer. - blob = new Blob([uint8Array.buffer, contents]); - } catch (e) { - // Skip the test if we can't create a blob (e.g.: iOS 5). - if (e instanceof TypeError) { - return; - } - throw e; - } - } - var verifier = jasmine.createSpy().andCallFake(function(evt) { - expect(evt).toBeDefined(); - expect(evt.target.result).toBe('asdfasdf'); - }); - var reader = new FileReader(); - reader.onloadend = verifier; - reader.readAsText(blob); - - waitsFor(function() { return verifier.wasCalled; }, "verifier never called", 300); - }); - - function writeDummyFile(writeBinary, callback) { - var fileName = "dummy.txt", - fileEntry = null, - writerFail = createFail('createWriter'), - getFileFail = createFail('getFile'), - fileFail = createFail('file'), - callback = jasmine.createSpy().andCallFake(callback), - fileData = '\u20AC\xEB - There is an exception to every rule. Except this one.', - fileDataAsBinaryString = '\xe2\x82\xac\xc3\xab - There is an exception to every rule. Except this one.', - createWriter = function(fe) { - fileEntry = fe; - fileEntry.createWriter(writeFile, writerFail); - }, - // writes file and reads it back in - writeFile = function(writer) { - writer.onwriteend = function() { - fileEntry.file(function(f) { - callback(fileEntry, f, fileData, fileDataAsBinaryString); - }, fileFail); - }; - writer.write(fileData); - }; - fileData += writeBinary ? 'bin:\x01\x00' : ''; - fileDataAsBinaryString += writeBinary ? 'bin:\x01\x00' : ''; - // create a file, write to it, and read it in again - root.getFile(fileName, {create: true}, createWriter, getFileFail); - waitsForAny(getFileFail, writerFail, fileFail, callback); - } - - function runReaderTest(funcName, writeBinary, verifierFunc, sliceStart, sliceEnd) { - writeDummyFile(writeBinary, function(fileEntry, file, fileData, fileDataAsBinaryString) { - var readWin = jasmine.createSpy().andCallFake(function(evt) { - expect(evt).toBeDefined(); - verifierFunc(evt, fileData, fileDataAsBinaryString); - }); - - var reader = new FileReader(); - var readFail = createFail(funcName); - reader.onload = readWin; - reader.onerror = readFail; - if (sliceEnd !== undefined) { - file = file.slice(sliceStart, sliceEnd); - } else if (sliceStart !== undefined) { - file = file.slice(sliceStart); - } - reader[funcName](file); - - waitsForAny(readWin, readFail); - }); - } - - function arrayBufferEqualsString(buf, str) { - var buf = new Uint8Array(ab); - var match = buf.length == str.length; - - for (var i = 0; match && i < buf.length; i++) { - match = buf[i] == str.charCodeAt(i); - } - return match; - } - - it("file.spec.84 should read file properly, readAsText", function() { - runReaderTest('readAsText', false, function(evt, fileData, fileDataAsBinaryString) { - expect(evt.target.result).toBe(fileData); - }); - }); - it("file.spec.85 should read file properly, Data URI", function() { - runReaderTest('readAsDataURL', true, function(evt, fileData, fileDataAsBinaryString) { - expect(evt.target.result.substr(0,23)).toBe("data:text/plain;base64,"); - expect(evt.target.result.slice(23)).toBe(atob(fileData)); - }); - }); - it("file.spec.86 should read file properly, readAsBinaryString", function() { - runReaderTest('readAsBinaryString', true, function(evt, fileData, fileDataAsBinaryString) { - expect(evt.target.result).toBe(fileDataAsBinaryString); - }); - }); - it("file.spec.87 should read file properly, readAsArrayBuffer", function() { - // Skip test if ArrayBuffers are not supported (e.g.: Android 2.3). - if (typeof window.ArrayBuffer == 'undefined') { - return; - } - runReaderTest('readAsArrayBuffer', true, function(evt, fileData, fileDataAsBinaryString) { - expect(arrayBufferEqualsString(evt.target.result, fileDataAsBinaryString)).toBe(true); - }); - }); - it("file.spec.88 should read sliced file: readAsText", function() { - runReaderTest('readAsText', false, function(evt, fileData, fileDataAsBinaryString) { - expect(evt.target.result).toBe(fileDataAsBinaryString.slice(10, 40)); - }, 10, 40); - }); - it("file.spec.89 should read sliced file: slice past eof", function() { - runReaderTest('readAsText', false, function(evt, fileData, fileDataAsBinaryString) { - expect(evt.target.result).toBe(fileData.slice(-5, 9999)); - }, -5, 9999); - }); - it("file.spec.90 should read sliced file: slice to eof", function() { - runReaderTest('readAsText', false, function(evt, fileData, fileDataAsBinaryString) { - expect(evt.target.result).toBe(fileData.slice(-5)); - }, -5); - }); - it("file.spec.91 should read empty slice", function() { - runReaderTest('readAsText', false, function(evt, fileData, fileDataAsBinaryString) { - expect(evt.target.result).toBe(''); - }, 0, 0); - }); - it("file.spec.92 should read sliced file properly, readAsDataURL", function() { - runReaderTest('readAsDataURL', true, function(evt, fileData, fileDataAsBinaryString) { - expect(evt.target.result.slice(0, 23)).toBe("data:text/plain;base64,"); - expect(evt.target.result.slice(23)).toBe(atob(fileDataAsBinaryString.slice( 10, -3))); - }, 10, -3); - }); - it("file.spec.93 should read sliced file properly, readAsBinaryString", function() { - runReaderTest('readAsBinaryString', true, function(evt, fileData, fileDataAsBinaryString) { - expect(evt.target.result).toBe(fileDataAsBinaryString.slice(-10, -5)); - }, -10, -5); - }); - it("file.spec.94 should read sliced file properly, readAsArrayBuffer", function() { - // Skip test if ArrayBuffers are not supported (e.g.: Android 2.3). - if (typeof window.ArrayBuffer == 'undefined') { - return; - } - runReaderTest('readAsArrayBuffer', true, function(evt, fileData, fileDataAsBinaryString) { - expect(arrayBufferEqualsString(evt.target.result, fileDataAsBinaryString.slice(0, -1))).toBe(true); - }, 0, -1); - }); - }); - - describe('FileWriter', function(){ - it("file.spec.81 should have correct methods", function() { - // retrieve a FileWriter object - var fileName = "writer.methods", - fail = createFail('FileWriter'), - verifier = jasmine.createSpy().andCallFake(function(writer) { - expect(writer).toBeDefined(); - expect(typeof writer.write).toBe('function'); - expect(typeof writer.seek).toBe('function'); - expect(typeof writer.truncate).toBe('function'); - expect(typeof writer.abort).toBe('function'); - - // cleanup - deleteFile(fileName); - }), - it_writer = function(fileEntry) { - fileEntry.createWriter(verifier, fail); - }; - - // it FileWriter - runs(function() { - root.getFile(fileName, {create: true}, it_writer, fail); - }); - - waitsFor(function() { return verifier.wasCalled; }, "verifier never called", Tests.TEST_TIMEOUT); - - runs(function() { - expect(fail).not.toHaveBeenCalled(); - expect(verifier).toHaveBeenCalled(); - }); - }); - it("file.spec.96 should be able to write and append to file, createWriter", function() { - var fileName = "writer.append", - theWriter, - filePath = root.fullPath + '/' + fileName, - // file content - rule = "There is an exception to every rule.", - // for checkin file length - length = rule.length, - fail = createFail('FileWriter'), - verifier = jasmine.createSpy().andCallFake(function(evt) { - expect(theWriter.length).toBe(length); - expect(theWriter.position).toBe(length); - - // append some more stuff - var exception = " Except this one."; - theWriter.onwriteend = anotherVerifier; - length += exception.length; - theWriter.seek(theWriter.length); - theWriter.write(exception); - }), - anotherVerifier = jasmine.createSpy().andCallFake(function(evt) { - expect(theWriter.length).toBe(length); - expect(theWriter.position).toBe(length); - - // cleanup - deleteFile(fileName); - }), - // writes initial file content - write_file = function(fileEntry) { - fileEntry.createWriter(function(writer) { - theWriter = writer; - writer.onwriteend = verifier; - writer.write(rule); - }, fail); - }; - - // create file, then write and append to it - runs(function() { - createFile(fileName, write_file); - }); - - waitsFor(function() { return anotherVerifier.wasCalled; }, "verifier never called", Tests.TEST_TIMEOUT); - - runs(function() { - expect(fail).not.toHaveBeenCalled(); - expect(verifier).toHaveBeenCalled(); - expect(anotherVerifier).toHaveBeenCalled(); - }); - }); - it("file.spec.97 should be able to write and append to file, File object", function() { - var fileName = "writer.append", - theWriter, - filePath = root.fullPath + '/' + fileName, - // file content - rule = "There is an exception to every rule.", - // for checking file length - length = rule.length, - verifier = jasmine.createSpy().andCallFake(function(evt) { - expect(theWriter.length).toBe(length); - expect(theWriter.position).toBe(length); - - // append some more stuff - var exception = " Except this one."; - theWriter.onwriteend = anotherVerifier; - length += exception.length; - theWriter.seek(theWriter.length); - theWriter.write(exception); - }), - anotherVerifier = jasmine.createSpy().andCallFake(function(evt) { - expect(theWriter.length).toBe(length); - expect(theWriter.position).toBe(length); - - // cleanup - deleteFile(fileName); - }), - // writes initial file content - write_file = function(file) { - theWriter = new FileWriter(file); - theWriter.onwriteend = verifier; - theWriter.write(rule); - }; - - // create file, then write and append to it - runs(function() { - var file = new File(); - file.fullPath = filePath; - write_file(file); - }); - - waitsFor(function() { return anotherVerifier.wasCalled; }, "verifier", Tests.TEST_TIMEOUT); - - runs(function() { - expect(verifier).toHaveBeenCalled(); - expect(anotherVerifier).toHaveBeenCalled(); - }); - }); - it("file.spec.98 should be able to seek to the middle of the file and write more data than file.length", function() { - var fileName = "writer.seek.write", - filePath = root.fullPath + '/' + fileName, - theWriter, - // file content - rule = "This is our sentence.", - // for iting file length - length = rule.length, - fail = createFail('FileWriter'), - verifier = jasmine.createSpy().andCallFake(function(evt) { - expect(theWriter.length).toBe(length); - expect(theWriter.position).toBe(length); - - // append some more stuff - var exception = "newer sentence."; - theWriter.onwriteend = anotherVerifier; - length = 12 + exception.length; - theWriter.seek(12); - theWriter.write(exception); - }), - anotherVerifier = jasmine.createSpy().andCallFake(function(evt) { - expect(theWriter.length).toBe(length); - expect(theWriter.position).toBe(length); - - // cleanup - deleteFile(fileName); - }), - // writes initial file content - write_file = function(fileEntry) { - fileEntry.createWriter(function(writer) { - theWriter = writer; - theWriter.onwriteend = verifier; - theWriter.write(rule); - }, fail); - }; - - // create file, then write and append to it - runs(function() { - createFile(fileName, write_file); - }); - - waitsFor(function() { return anotherVerifier.wasCalled; }, "verifier never called", Tests.TEST_TIMEOUT); - - runs(function() { - expect(verifier).toHaveBeenCalled(); - expect(anotherVerifier).toHaveBeenCalled(); - }); - }); - it("file.spec.99 should be able to seek to the middle of the file and write less data than file.length", function() { - var fileName = "writer.seek.write2", - filePath = root.fullPath + '/' + fileName, - // file content - rule = "This is our sentence.", - theWriter, - fail = createFail('FileWriter'), - // for iting file length - length = rule.length, - verifier = jasmine.createSpy().andCallFake(function(evt) { - expect(theWriter.length).toBe(length); - expect(theWriter.position).toBe(length); - - // append some more stuff - var exception = "new."; - theWriter.onwriteend = anotherVerifier; - length = 8 + exception.length; - theWriter.seek(8); - theWriter.write(exception); - }), - anotherVerifier = jasmine.createSpy().andCallFake(function(evt) { - expect(theWriter.length).toBe(length); - expect(theWriter.position).toBe(length); - - // cleanup - deleteFile(fileName); - }), - // writes initial file content - write_file = function(fileEntry) { - fileEntry.createWriter(function(writer) { - theWriter = writer; - theWriter.onwriteend = verifier; - theWriter.write(rule); - }, fail); - }; - - // create file, then write and append to it - runs(function() { - createFile(fileName, write_file); - }); - - waitsFor(function() { return anotherVerifier.wasCalled; }, "verifier never called", Tests.TEST_TIMEOUT); - - runs(function() { - expect(verifier).toHaveBeenCalled(); - expect(anotherVerifier).toHaveBeenCalled(); - expect(fail).not.toHaveBeenCalled(); - }); - }); - it("file.spec.100 should be able to write XML data", function() { - var fileName = "writer.xml", - filePath = root.fullPath + '/' + fileName, - fail = createFail('FileWriter'), - theWriter, - // file content - rule = '\n\nData\n\n', - // for iting file length - length = rule.length, - verifier = jasmine.createSpy().andCallFake(function(evt) { - expect(theWriter.length).toBe(length); - expect(theWriter.position).toBe(length); - - // cleanup - deleteFile(fileName); - }), - // writes file content - write_file = function(fileEntry) { - fileEntry.createWriter(function(writer) { - theWriter = writer; - theWriter.onwriteend = verifier; - theWriter.write(rule); - }, fail); - }; - - // creates file, then write XML data - runs(function() { - createFile(fileName, write_file); - }); - - waitsFor(function() { return verifier.wasCalled; }, "verifier", Tests.TEST_TIMEOUT); - - runs(function() { - expect(verifier).toHaveBeenCalled(); - expect(fail).not.toHaveBeenCalled(); - }); - }); - it("file.spec.101 should be able to write JSON data", function() { - var fileName = "writer.json", - filePath = root.fullPath + '/' + fileName, - theWriter, - // file content - rule = '{ "name": "Guy Incognito", "email": "here@there.com" }', - fail = createFail('FileWriter'), - // for iting file length - length = rule.length, - verifier = jasmine.createSpy().andCallFake(function(evt) { - expect(theWriter.length).toBe(length); - expect(theWriter.position).toBe(length); - - // cleanup - deleteFile(fileName); - }), - // writes file content - write_file = function(fileEntry) { - fileEntry.createWriter(function(writer) { - theWriter = writer; - theWriter.onwriteend = verifier; - theWriter.write(rule); - }, fail); - }; - - // creates file, then write JSON content - runs(function() { - createFile(fileName, write_file); - }); - - waitsFor(function() { return verifier.wasCalled; }, "verifier", Tests.TEST_TIMEOUT); - - runs(function() { - expect(verifier).toHaveBeenCalled(); - expect(fail).not.toHaveBeenCalled(); - }); - }); - it("file.spec.102 should be able to seek", function() { - var fileName = "writer.seek", - // file content - rule = "There is an exception to every rule. Except this one.", - theWriter, - // for iting file length - length = rule.length, - fail = createFail('FileWriter'), - verifier = jasmine.createSpy().andCallFake(function(evt) { - expect(theWriter.position).toBe(length); - theWriter.seek(-5); - expect(theWriter.position).toBe(length-5); - theWriter.seek(length + 100); - expect(theWriter.position).toBe(length); - theWriter.seek(10); - expect(theWriter.position).toBe(10); - - // cleanup - deleteFile(fileName); - }), - // writes file content and its writer.seek - seek_file = function(fileEntry) { - fileEntry.createWriter(function(writer) { - theWriter = writer; - theWriter.onwriteend = verifier; - theWriter.seek(-100); - expect(theWriter.position).toBe(0); - theWriter.write(rule); - }, fail); - }; - - // creates file, then write JSON content - runs(function() { - createFile(fileName, seek_file); - }); - - waitsFor(function() { return verifier.wasCalled; }, "verifier never called", Tests.TEST_TIMEOUT); - - runs(function() { - expect(verifier).toHaveBeenCalled(); - expect(fail).not.toHaveBeenCalled(); - }); - }); - it("file.spec.103 should be able to truncate", function() { - var fileName = "writer.truncate", - rule = "There is an exception to every rule. Except this one.", - fail = createFail('FileWriter'), - theWriter, - // writes file content - write_file = function(fileEntry) { - fileEntry.createWriter(function(writer) { - theWriter = writer; - theWriter.onwriteend = function(evt) { - truncate_file(theWriter); - }; - theWriter.write(rule); - }, fail); - }, - verifier = jasmine.createSpy().andCallFake(function(evt) { - expect(theWriter.length).toBe(36); - expect(theWriter.position).toBe(36); - - // cleanup - deleteFile(fileName); - }), - // and its writer.truncate - truncate_file = function(writer) { - writer.onwriteend = verifier; - writer.truncate(36); - }; - - // creates file, writes to it, then truncates it - runs(function() { - createFile(fileName, write_file); - }); - - waitsFor(function() { return verifier.wasCalled; }, "verifier never called", Tests.TEST_TIMEOUT); - - runs(function() { - expect(verifier).toHaveBeenCalled(); - expect(fail).not.toHaveBeenCalled(); - }); - }); - it("file.spec.104 should be able to write binary data from an ArrayBuffer", function() { - // Skip test if ArrayBuffers are not supported (e.g.: Android 2.3). - if (typeof window.ArrayBuffer == 'undefined') { - return; - } - var fileName = "bufferwriter.bin", - filePath = root.fullPath + '/' + fileName, - theWriter, - // file content - data = new ArrayBuffer(32), - dataView = new Int8Array(data), - fail = createFail('FileWriter'), - // for verifying file length - length = 32, - verifier = jasmine.createSpy().andCallFake(function(evt) { - expect(theWriter.length).toBe(length); - expect(theWriter.position).toBe(length); - - // cleanup - deleteFile(fileName); - }), - // writes file content - write_file = function(fileEntry) { - fileEntry.createWriter(function(writer) { - theWriter = writer; - theWriter.onwriteend = verifier; - theWriter.write(data); - }, fail); - }; - - for (i=0; i < dataView.length; i++) { - dataView[i] = i; - } - - // creates file, then write content - runs(function() { - createFile(fileName, write_file); - }); - - waitsFor(function() { return verifier.wasCalled; }, "verifier", Tests.TEST_TIMEOUT); - - runs(function() { - expect(verifier).toHaveBeenCalled(); - expect(fail).not.toHaveBeenCalled(); - }); - }); - it("file.spec.105 should be able to write binary data from a Blob", function() { - // Skip test if Blobs are not supported (e.g.: Android 2.3). - if (typeof window.Blob == 'undefined' || typeof window.ArrayBuffer == 'undefined') { - return; - } - var fileName = "blobwriter.bin", - filePath = root.fullPath + '/' + fileName, - theWriter, - fail = createFail('FileWriter'), - // file content - data = new ArrayBuffer(32), - dataView = new Int8Array(data), - blob, - // for verifying file length - length = 32, - verifier = jasmine.createSpy().andCallFake(function(evt) { - expect(theWriter.length).toBe(length); - expect(theWriter.position).toBe(length); - - // cleanup - deleteFile(fileName); - }), - // writes file content - write_file = function(fileEntry) { - fileEntry.createWriter(function(writer) { - theWriter = writer; - theWriter.onwriteend = verifier; - theWriter.write(blob); - }, fail); - }; - for (i=0; i < dataView.length; i++) { - dataView[i] = i; - } - try { - // Mobile Safari: Use Blob constructor - blob = new Blob([data], {"type": "application/octet-stream"}) - } catch(e) { - if (window.WebKitBlobBuilder) { - // Android Browser: Use deprecated BlobBuilder - var builder = new WebKitBlobBuilder() - builder.append(data) - blob = builder.getBlob('application/octet-stream'); - } else { - // We have no way defined to create a Blob, so fail - fail(); - } - } - - // creates file, then write content - runs(function() { - createFile(fileName, write_file); - }); - - waitsFor(function() { return verifier.wasCalled; }, "verifier", Tests.TEST_TIMEOUT); - - runs(function() { - expect(verifier).toHaveBeenCalled(); - expect(fail).not.toHaveBeenCalled(); - }); - }); - }); -}); diff --git a/plugins/org.apache.cordova.core.file/test/cordova-incl.js b/plugins/org.apache.cordova.core.file/test/cordova-incl.js deleted file mode 100644 index a82c590..0000000 --- a/plugins/org.apache.cordova.core.file/test/cordova-incl.js +++ /dev/null @@ -1,85 +0,0 @@ -/* - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - * -*/ - -var PLAT; -(function getPlatform() { - var platforms = { - android: /Android/, - ios: /(iPad)|(iPhone)|(iPod)/, - blackberry10: /(BB10)/, - blackberry: /(PlayBook)|(BlackBerry)/, - windows8: /MSAppHost/, - windowsphone: /Windows Phone/ - }; - for (var key in platforms) { - if (platforms[key].exec(navigator.userAgent)) { - PLAT = key; - break; - } - } -})(); - -var scripts = document.getElementsByTagName('script'); -var currentPath = scripts[scripts.length - 1].src; -var platformCordovaPath = currentPath.replace("cordova-incl.js", "cordova." + PLAT + ".js"); -var normalCordovaPath = currentPath.replace("cordova-incl.js", "cordova.js"); -var cordovaPath = normalCordovaPath; - -if (PLAT) { - // XHR to local file is an error on some platforms, windowsphone for one - try { - var xhr = new XMLHttpRequest(); - xhr.open("GET", platformCordovaPath, false); - xhr.onreadystatechange = function() { - - if (this.readyState == this.DONE && this.responseText.length > 0) { - if(parseInt(this.status) >= 400){ - cordovaPath = normalCordovaPath; - }else{ - cordovaPath = platformCordovaPath; - } - } - }; - xhr.send(null); - } - catch(e){ - cordovaPath = normalCordovaPath; - } // access denied! -} - -if (!window._doNotWriteCordovaScript) { - if (PLAT != "windows8") { - document.write(''); - } else { - var s = document.createElement('script'); - s.src = cordovaPath; - document.head.appendChild(s); - } -} - -function backHome() { - if (window.device && device.platform && device.platform.toLowerCase() == 'android') { - navigator.app.backHistory(); - } - else { - window.history.go(-1); - } -} diff --git a/plugins/org.apache.cordova.core.file/test/index.html b/plugins/org.apache.cordova.core.file/test/index.html deleted file mode 100644 index 727c504..0000000 --- a/plugins/org.apache.cordova.core.file/test/index.html +++ /dev/null @@ -1,64 +0,0 @@ - - - - - - - - - Cordova Mobile Spec - - - - - - -

Apache Cordova Tests

-
-

Platform:

-

Version:

-

UUID:

-

Model:

-

Width: , Height: - , Color Depth:

-

User-Agent:

-
- Automatic Test - Accelerometer - Audio Play/Record - Battery - Camera - Compass - Contacts - Events - Location - Lazy Loading of cordova-incl.js - Misc Content - Network - Notification - Splashscreen - Web SQL - Local Storage - Benchmarks - In App Browser - - diff --git a/plugins/org.apache.cordova.core.file/test/main.js b/plugins/org.apache.cordova.core.file/test/main.js deleted file mode 100644 index 5f071c4..0000000 --- a/plugins/org.apache.cordova.core.file/test/main.js +++ /dev/null @@ -1,162 +0,0 @@ -/* - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - * -*/ - -var deviceInfo = function() { - document.getElementById("platform").innerHTML = device.platform; - document.getElementById("version").innerHTML = device.version; - document.getElementById("uuid").innerHTML = device.uuid; - document.getElementById("model").innerHTML = device.model; - document.getElementById("width").innerHTML = screen.width; - document.getElementById("height").innerHTML = screen.height; - document.getElementById("colorDepth").innerHTML = screen.colorDepth; -}; - -var getLocation = function() { - var suc = function(p) { - alert(p.coords.latitude + " " + p.coords.longitude); - }; - var locFail = function() { - }; - navigator.geolocation.getCurrentPosition(suc, locFail); -}; - -var beep = function() { - navigator.notification.beep(2); -}; - -var vibrate = function() { - navigator.notification.vibrate(0); -}; - -function roundNumber(num) { - var dec = 3; - var result = Math.round(num * Math.pow(10, dec)) / Math.pow(10, dec); - return result; -} - -var accelerationWatch = null; - -function updateAcceleration(a) { - document.getElementById('x').innerHTML = roundNumber(a.x); - document.getElementById('y').innerHTML = roundNumber(a.y); - document.getElementById('z').innerHTML = roundNumber(a.z); -} - -var toggleAccel = function() { - if (accelerationWatch !== null) { - navigator.accelerometer.clearWatch(accelerationWatch); - updateAcceleration({ - x : "", - y : "", - z : "" - }); - accelerationWatch = null; - } else { - var options = {}; - options.frequency = 1000; - accelerationWatch = navigator.accelerometer.watchAcceleration( - updateAcceleration, function(ex) { - alert("accel fail (" + ex.name + ": " + ex.message + ")"); - }, options); - } -}; - -var preventBehavior = function(e) { - e.preventDefault(); -}; - -function dump_pic(data) { - var viewport = document.getElementById('viewport'); - console.log(data); - viewport.style.display = ""; - viewport.style.position = "absolute"; - viewport.style.top = "10px"; - viewport.style.left = "10px"; - document.getElementById("test_img").src = "data:image/jpeg;base64," + data; -} - -function fail(msg) { - alert(msg); -} - -function show_pic() { - navigator.camera.getPicture(dump_pic, fail, { - quality : 50 - }); -} - -function close() { - var viewport = document.getElementById('viewport'); - viewport.style.position = "relative"; - viewport.style.display = "none"; -} - -// This is just to do this. -function readFile() { - navigator.file.read('/sdcard/cordova.txt', fail, fail); -} - -function writeFile() { - navigator.file.write('foo.txt', "This is a test of writing to a file", - fail, fail); -} - -function contacts_success(contacts) { - alert(contacts.length - + ' contacts returned.' - + (contacts[2] && contacts[2].name ? (' Third contact is ' + contacts[2].name.formatted) - : '')); -} - -function get_contacts() { - var obj = new ContactFindOptions(); - obj.filter = ""; - obj.multiple = true; - obj.limit = 5; - navigator.service.contacts.find( - [ "displayName", "name" ], contacts_success, - fail, obj); -} - -var networkReachableCallback = function(reachability) { - // There is no consistency on the format of reachability - var networkState = reachability.code || reachability; - - var currentState = {}; - currentState[NetworkStatus.NOT_REACHABLE] = 'No network connection'; - currentState[NetworkStatus.REACHABLE_VIA_CARRIER_DATA_NETWORK] = 'Carrier data connection'; - currentState[NetworkStatus.REACHABLE_VIA_WIFI_NETWORK] = 'WiFi connection'; - - confirm("Connection type:\n" + currentState[networkState]); -}; - -function check_network() { - navigator.network.isReachable("www.mobiledevelopersolutions.com", - networkReachableCallback, {}); -} - -function init() { - // the next line makes it impossible to see Contacts on the HTC Evo since it - // doesn't have a scroll button - // document.addEventListener("touchmove", preventBehavior, false); - document.addEventListener("deviceready", deviceInfo, true); - document.getElementById("user-agent").textContent = navigator.userAgent; -} diff --git a/plugins/org.apache.cordova.core.file/test/master.css b/plugins/org.apache.cordova.core.file/test/master.css deleted file mode 100644 index e93c937..0000000 --- a/plugins/org.apache.cordova.core.file/test/master.css +++ /dev/null @@ -1,164 +0,0 @@ -/* - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - * -*/ - - body { - background:#222 none repeat scroll 0 0; - color:#666; - font-family:Helvetica; - font-size:72%; - line-height:1.5em; - margin:0; - border-top:1px solid #393939; - } - - #info{ - background:#ffa; - border: 1px solid #ffd324; - -webkit-border-radius: 5px; - border-radius: 5px; - clear:both; - margin:15px 6px 0; - min-width:295px; - max-width:97%; - padding:4px 0px 2px 10px; - word-wrap:break-word; - margin-bottom:10px; - display:inline-block; - min-height: 160px; - max-height: 300px; - overflow: auto; - -webkit-overflow-scrolling: touch; - } - - #info > h4{ - font-size:.95em; - margin:5px 0; - } - - #stage.theme{ - padding-top:3px; - } - - /* Definition List */ - #stage.theme > dl{ - padding-top:10px; - clear:both; - margin:0; - list-style-type:none; - padding-left:10px; - overflow:auto; - } - - #stage.theme > dl > dt{ - font-weight:bold; - float:left; - margin-left:5px; - } - - #stage.theme > dl > dd{ - width:45px; - float:left; - color:#a87; - font-weight:bold; - } - - /* Content Styling */ - #stage.theme > h1, #stage.theme > h2, #stage.theme > p{ - margin:1em 0 .5em 13px; - } - - #stage.theme > h1{ - color:#eee; - font-size:1.6em; - text-align:center; - margin:0; - margin-top:15px; - padding:0; - } - - #stage.theme > h2{ - clear:both; - margin:0; - padding:3px; - font-size:1em; - text-align:center; - } - - /* Stage Buttons */ - #stage.theme .btn{ - border: 1px solid #555; - -webkit-border-radius: 5px; - border-radius: 5px; - text-align:center; - display:inline-block; - background:#444; - width:150px; - color:#9ab; - font-size:1.1em; - text-decoration:none; - padding:1.2em 0; - margin:3px 0px 3px 5px; - } - - #stage.theme .large{ - width:308px; - padding:1.2em 0; - } - - #stage.theme .wide{ - width:100%; - padding:1.2em 0; - } - - #stage.theme .backBtn{ - border: 1px solid #555; - -webkit-border-radius: 5px; - border-radius: 5px; - text-align:center; - display:block; - float:right; - background:#666; - width:75px; - color:#9ab; - font-size:1.1em; - text-decoration:none; - padding:1.2em 0; - margin:3px 5px 3px 5px; - } - - #stage.theme .input{ - border: 1px solid #555; - -webkit-border-radius: 5px; - border-radius: 5px; - text-align:center; - display:block; - float:light; - background:#888; - color:#9cd; - font-size:1.1em; - text-decoration:none; - padding:1.2em 0; - margin:3px 0px 3px 5px; - } - - #stage.theme .numeric{ - width:100%; - } diff --git a/plugins/org.apache.cordova.core.file/www/DirectoryEntry.js b/plugins/org.apache.cordova.core.file/www/DirectoryEntry.js deleted file mode 100644 index 9e55adf..0000000 --- a/plugins/org.apache.cordova.core.file/www/DirectoryEntry.js +++ /dev/null @@ -1,106 +0,0 @@ -/* - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - * -*/ - -var argscheck = require('cordova/argscheck'), - utils = require('cordova/utils'), - exec = require('cordova/exec'), - Entry = require('./Entry'), - FileError = require('./FileError'), - DirectoryReader = require('./DirectoryReader'); - -/** - * An interface representing a directory on the file system. - * - * {boolean} isFile always false (readonly) - * {boolean} isDirectory always true (readonly) - * {DOMString} name of the directory, excluding the path leading to it (readonly) - * {DOMString} fullPath the absolute full path to the directory (readonly) - * TODO: implement this!!! {FileSystem} filesystem on which the directory resides (readonly) - */ -var DirectoryEntry = function(name, fullPath) { - DirectoryEntry.__super__.constructor.call(this, false, true, name, fullPath); -}; - -utils.extend(DirectoryEntry, Entry); - -/** - * Creates a new DirectoryReader to read entries from this directory - */ -DirectoryEntry.prototype.createReader = function() { - return new DirectoryReader(this.fullPath); -}; - -/** - * Creates or looks up a directory - * - * @param {DOMString} path either a relative or absolute path from this directory in which to look up or create a directory - * @param {Flags} options to create or exclusively create the directory - * @param {Function} successCallback is called with the new entry - * @param {Function} errorCallback is called with a FileError - */ -DirectoryEntry.prototype.getDirectory = function(path, options, successCallback, errorCallback) { - argscheck.checkArgs('sOFF', 'DirectoryEntry.getDirectory', arguments); - var win = successCallback && function(result) { - var entry = new DirectoryEntry(result.name, result.fullPath); - successCallback(entry); - }; - var fail = errorCallback && function(code) { - errorCallback(new FileError(code)); - }; - exec(win, fail, "File", "getDirectory", [this.fullPath, path, options]); -}; - -/** - * Deletes a directory and all of it's contents - * - * @param {Function} successCallback is called with no parameters - * @param {Function} errorCallback is called with a FileError - */ -DirectoryEntry.prototype.removeRecursively = function(successCallback, errorCallback) { - argscheck.checkArgs('FF', 'DirectoryEntry.removeRecursively', arguments); - var fail = errorCallback && function(code) { - errorCallback(new FileError(code)); - }; - exec(successCallback, fail, "File", "removeRecursively", [this.fullPath]); -}; - -/** - * Creates or looks up a file - * - * @param {DOMString} path either a relative or absolute path from this directory in which to look up or create a file - * @param {Flags} options to create or exclusively create the file - * @param {Function} successCallback is called with the new entry - * @param {Function} errorCallback is called with a FileError - */ -DirectoryEntry.prototype.getFile = function(path, options, successCallback, errorCallback) { - argscheck.checkArgs('sOFF', 'DirectoryEntry.getFile', arguments); - var win = successCallback && function(result) { - var FileEntry = require('./FileEntry'); - var entry = new FileEntry(result.name, result.fullPath); - successCallback(entry); - }; - var fail = errorCallback && function(code) { - errorCallback(new FileError(code)); - }; - exec(win, fail, "File", "getFile", [this.fullPath, path, options]); -}; - -module.exports = DirectoryEntry; diff --git a/plugins/org.apache.cordova.core.file/www/DirectoryReader.js b/plugins/org.apache.cordova.core.file/www/DirectoryReader.js deleted file mode 100644 index 07e7bf6..0000000 --- a/plugins/org.apache.cordova.core.file/www/DirectoryReader.js +++ /dev/null @@ -1,71 +0,0 @@ -/* - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - * -*/ - -var exec = require('cordova/exec'), - FileError = require('./FileError') ; - -/** - * An interface that lists the files and directories in a directory. - */ -function DirectoryReader(path) { - this.path = path || null; - this.hasReadEntries = false; -} - -/** - * Returns a list of entries from a directory. - * - * @param {Function} successCallback is called with a list of entries - * @param {Function} errorCallback is called with a FileError - */ -DirectoryReader.prototype.readEntries = function(successCallback, errorCallback) { - // If we've already read and passed on this directory's entries, return an empty list. - if (this.hasReadEntries) { - successCallback([]); - return; - } - var reader = this; - var win = typeof successCallback !== 'function' ? null : function(result) { - var retVal = []; - for (var i=0; i= 2) { - if (end < 0) { - newEnd = Math.max(size + end, 0); - } else { - newEnd = Math.min(end, size); - } - } - - var newFile = new File(this.name, this.fullPath, this.type, this.lastModifiedData, this.size); - newFile.start = this.start + newStart; - newFile.end = this.start + newEnd; - return newFile; -}; - - -module.exports = File; diff --git a/plugins/org.apache.cordova.core.file/www/FileEntry.js b/plugins/org.apache.cordova.core.file/www/FileEntry.js deleted file mode 100644 index 79064ac..0000000 --- a/plugins/org.apache.cordova.core.file/www/FileEntry.js +++ /dev/null @@ -1,80 +0,0 @@ -/* - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - * -*/ - -var utils = require('cordova/utils'), - exec = require('cordova/exec'), - Entry = require('./Entry'), - FileWriter = require('./FileWriter'), - File = require('./File'), - FileError = require('./FileError'); - -/** - * An interface representing a file on the file system. - * - * {boolean} isFile always true (readonly) - * {boolean} isDirectory always false (readonly) - * {DOMString} name of the file, excluding the path leading to it (readonly) - * {DOMString} fullPath the absolute full path to the file (readonly) - * {FileSystem} filesystem on which the file resides (readonly) - */ -var FileEntry = function(name, fullPath) { - FileEntry.__super__.constructor.apply(this, [true, false, name, fullPath]); -}; - -utils.extend(FileEntry, Entry); - -/** - * Creates a new FileWriter associated with the file that this FileEntry represents. - * - * @param {Function} successCallback is called with the new FileWriter - * @param {Function} errorCallback is called with a FileError - */ -FileEntry.prototype.createWriter = function(successCallback, errorCallback) { - this.file(function(filePointer) { - var writer = new FileWriter(filePointer); - - if (writer.fileName === null || writer.fileName === "") { - errorCallback && errorCallback(new FileError(FileError.INVALID_STATE_ERR)); - } else { - successCallback && successCallback(writer); - } - }, errorCallback); -}; - -/** - * Returns a File that represents the current state of the file that this FileEntry represents. - * - * @param {Function} successCallback is called with the new File object - * @param {Function} errorCallback is called with a FileError - */ -FileEntry.prototype.file = function(successCallback, errorCallback) { - var win = successCallback && function(f) { - var file = new File(f.name, f.fullPath, f.type, f.lastModifiedDate, f.size); - successCallback(file); - }; - var fail = errorCallback && function(code) { - errorCallback(new FileError(code)); - }; - exec(win, fail, "File", "getFileMetadata", [this.fullPath]); -}; - - -module.exports = FileEntry; diff --git a/plugins/org.apache.cordova.core.file/www/FileError.js b/plugins/org.apache.cordova.core.file/www/FileError.js deleted file mode 100644 index 6507921..0000000 --- a/plugins/org.apache.cordova.core.file/www/FileError.js +++ /dev/null @@ -1,46 +0,0 @@ -/* - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - * -*/ - -/** - * FileError - */ -function FileError(error) { - this.code = error || null; -} - -// File error codes -// Found in DOMException -FileError.NOT_FOUND_ERR = 1; -FileError.SECURITY_ERR = 2; -FileError.ABORT_ERR = 3; - -// Added by File API specification -FileError.NOT_READABLE_ERR = 4; -FileError.ENCODING_ERR = 5; -FileError.NO_MODIFICATION_ALLOWED_ERR = 6; -FileError.INVALID_STATE_ERR = 7; -FileError.SYNTAX_ERR = 8; -FileError.INVALID_MODIFICATION_ERR = 9; -FileError.QUOTA_EXCEEDED_ERR = 10; -FileError.TYPE_MISMATCH_ERR = 11; -FileError.PATH_EXISTS_ERR = 12; - -module.exports = FileError; diff --git a/plugins/org.apache.cordova.core.file/www/FileReader.js b/plugins/org.apache.cordova.core.file/www/FileReader.js deleted file mode 100644 index 3cc75b5..0000000 --- a/plugins/org.apache.cordova.core.file/www/FileReader.js +++ /dev/null @@ -1,387 +0,0 @@ -/* - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - * -*/ - -var exec = require('cordova/exec'), - modulemapper = require('cordova/modulemapper'), - utils = require('cordova/utils'), - File = require('./File'), - FileError = require('./FileError'), - ProgressEvent = require('./ProgressEvent'), - origFileReader = modulemapper.getOriginalSymbol(this, 'FileReader'); - -/** - * This class reads the mobile device file system. - * - * For Android: - * The root directory is the root of the file system. - * To read from the SD card, the file name is "sdcard/my_file.txt" - * @constructor - */ -var FileReader = function() { - this._readyState = 0; - this._error = null; - this._result = null; - this._fileName = ''; - this._realReader = origFileReader ? new origFileReader() : {}; -}; - -// States -FileReader.EMPTY = 0; -FileReader.LOADING = 1; -FileReader.DONE = 2; - -utils.defineGetter(FileReader.prototype, 'readyState', function() { - return this._fileName ? this._readyState : this._realReader.readyState; -}); - -utils.defineGetter(FileReader.prototype, 'error', function() { - return this._fileName ? this._error: this._realReader.error; -}); - -utils.defineGetter(FileReader.prototype, 'result', function() { - return this._fileName ? this._result: this._realReader.result; -}); - -function defineEvent(eventName) { - utils.defineGetterSetter(FileReader.prototype, eventName, function() { - return this._realReader[eventName] || null; - }, function(value) { - this._realReader[eventName] = value; - }); -} -defineEvent('onloadstart'); // When the read starts. -defineEvent('onprogress'); // While reading (and decoding) file or fileBlob data, and reporting partial file data (progress.loaded/progress.total) -defineEvent('onload'); // When the read has successfully completed. -defineEvent('onerror'); // When the read has failed (see errors). -defineEvent('onloadend'); // When the request has completed (either in success or failure). -defineEvent('onabort'); // When the read has been aborted. For instance, by invoking the abort() method. - -function initRead(reader, file) { - // Already loading something - if (reader.readyState == FileReader.LOADING) { - throw new FileError(FileError.INVALID_STATE_ERR); - } - - reader._result = null; - reader._error = null; - reader._readyState = FileReader.LOADING; - - if (typeof file.fullPath == 'string') { - reader._fileName = file.fullPath; - } else { - reader._fileName = ''; - return true; - } - - reader.onloadstart && reader.onloadstart(new ProgressEvent("loadstart", {target:reader})); -} - -/** - * Abort reading file. - */ -FileReader.prototype.abort = function() { - if (origFileReader && !this._fileName) { - return this._realReader.abort(); - } - this._result = null; - - if (this._readyState == FileReader.DONE || this._readyState == FileReader.EMPTY) { - return; - } - - this._readyState = FileReader.DONE; - - // If abort callback - if (typeof this.onabort === 'function') { - this.onabort(new ProgressEvent('abort', {target:this})); - } - // If load end callback - if (typeof this.onloadend === 'function') { - this.onloadend(new ProgressEvent('loadend', {target:this})); - } -}; - -/** - * Read text file. - * - * @param file {File} File object containing file properties - * @param encoding [Optional] (see http://www.iana.org/assignments/character-sets) - */ -FileReader.prototype.readAsText = function(file, encoding) { - if (initRead(this, file)) { - return this._realReader.readAsText(file, encoding); - } - - // Default encoding is UTF-8 - var enc = encoding ? encoding : "UTF-8"; - var me = this; - var execArgs = [this._fileName, enc, file.start, file.end]; - - // Read file - exec( - // Success callback - function(r) { - // If DONE (cancelled), then don't do anything - if (me._readyState === FileReader.DONE) { - return; - } - - // Save result - me._result = r; - - // If onload callback - if (typeof me.onload === "function") { - me.onload(new ProgressEvent("load", {target:me})); - } - - // DONE state - me._readyState = FileReader.DONE; - - // If onloadend callback - if (typeof me.onloadend === "function") { - me.onloadend(new ProgressEvent("loadend", {target:me})); - } - }, - // Error callback - function(e) { - // If DONE (cancelled), then don't do anything - if (me._readyState === FileReader.DONE) { - return; - } - - // DONE state - me._readyState = FileReader.DONE; - - // null result - me._result = null; - - // Save error - me._error = new FileError(e); - - // If onerror callback - if (typeof me.onerror === "function") { - me.onerror(new ProgressEvent("error", {target:me})); - } - - // If onloadend callback - if (typeof me.onloadend === "function") { - me.onloadend(new ProgressEvent("loadend", {target:me})); - } - }, "File", "readAsText", execArgs); -}; - - -/** - * Read file and return data as a base64 encoded data url. - * A data url is of the form: - * data:[][;base64], - * - * @param file {File} File object containing file properties - */ -FileReader.prototype.readAsDataURL = function(file) { - if (initRead(this, file)) { - return this._realReader.readAsDataURL(file); - } - - var me = this; - var execArgs = [this._fileName, file.start, file.end]; - - // Read file - exec( - // Success callback - function(r) { - // If DONE (cancelled), then don't do anything - if (me._readyState === FileReader.DONE) { - return; - } - - // DONE state - me._readyState = FileReader.DONE; - - // Save result - me._result = r; - - // If onload callback - if (typeof me.onload === "function") { - me.onload(new ProgressEvent("load", {target:me})); - } - - // If onloadend callback - if (typeof me.onloadend === "function") { - me.onloadend(new ProgressEvent("loadend", {target:me})); - } - }, - // Error callback - function(e) { - // If DONE (cancelled), then don't do anything - if (me._readyState === FileReader.DONE) { - return; - } - - // DONE state - me._readyState = FileReader.DONE; - - me._result = null; - - // Save error - me._error = new FileError(e); - - // If onerror callback - if (typeof me.onerror === "function") { - me.onerror(new ProgressEvent("error", {target:me})); - } - - // If onloadend callback - if (typeof me.onloadend === "function") { - me.onloadend(new ProgressEvent("loadend", {target:me})); - } - }, "File", "readAsDataURL", execArgs); -}; - -/** - * Read file and return data as a binary data. - * - * @param file {File} File object containing file properties - */ -FileReader.prototype.readAsBinaryString = function(file) { - if (initRead(this, file)) { - return this._realReader.readAsBinaryString(file); - } - - var me = this; - var execArgs = [this._fileName, file.start, file.end]; - - // Read file - exec( - // Success callback - function(r) { - // If DONE (cancelled), then don't do anything - if (me._readyState === FileReader.DONE) { - return; - } - - // DONE state - me._readyState = FileReader.DONE; - - me._result = r; - - // If onload callback - if (typeof me.onload === "function") { - me.onload(new ProgressEvent("load", {target:me})); - } - - // If onloadend callback - if (typeof me.onloadend === "function") { - me.onloadend(new ProgressEvent("loadend", {target:me})); - } - }, - // Error callback - function(e) { - // If DONE (cancelled), then don't do anything - if (me._readyState === FileReader.DONE) { - return; - } - - // DONE state - me._readyState = FileReader.DONE; - - me._result = null; - - // Save error - me._error = new FileError(e); - - // If onerror callback - if (typeof me.onerror === "function") { - me.onerror(new ProgressEvent("error", {target:me})); - } - - // If onloadend callback - if (typeof me.onloadend === "function") { - me.onloadend(new ProgressEvent("loadend", {target:me})); - } - }, "File", "readAsBinaryString", execArgs); -}; - -/** - * Read file and return data as a binary data. - * - * @param file {File} File object containing file properties - */ -FileReader.prototype.readAsArrayBuffer = function(file) { - if (initRead(this, file)) { - return this._realReader.readAsArrayBuffer(file); - } - - var me = this; - var execArgs = [this._fileName, file.start, file.end]; - - // Read file - exec( - // Success callback - function(r) { - // If DONE (cancelled), then don't do anything - if (me._readyState === FileReader.DONE) { - return; - } - - // DONE state - me._readyState = FileReader.DONE; - - me._result = r; - - // If onload callback - if (typeof me.onload === "function") { - me.onload(new ProgressEvent("load", {target:me})); - } - - // If onloadend callback - if (typeof me.onloadend === "function") { - me.onloadend(new ProgressEvent("loadend", {target:me})); - } - }, - // Error callback - function(e) { - // If DONE (cancelled), then don't do anything - if (me._readyState === FileReader.DONE) { - return; - } - - // DONE state - me._readyState = FileReader.DONE; - - me._result = null; - - // Save error - me._error = new FileError(e); - - // If onerror callback - if (typeof me.onerror === "function") { - me.onerror(new ProgressEvent("error", {target:me})); - } - - // If onloadend callback - if (typeof me.onloadend === "function") { - me.onloadend(new ProgressEvent("loadend", {target:me})); - } - }, "File", "readAsArrayBuffer", execArgs); -}; - -module.exports = FileReader; diff --git a/plugins/org.apache.cordova.core.file/www/FileSystem.js b/plugins/org.apache.cordova.core.file/www/FileSystem.js deleted file mode 100644 index 030365f..0000000 --- a/plugins/org.apache.cordova.core.file/www/FileSystem.js +++ /dev/null @@ -1,38 +0,0 @@ -/* - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - * -*/ - -var DirectoryEntry = require('./DirectoryEntry'); - -/** - * An interface representing a file system - * - * @constructor - * {DOMString} name the unique name of the file system (readonly) - * {DirectoryEntry} root directory of the file system (readonly) - */ -var FileSystem = function(name, root) { - this.name = name || null; - if (root) { - this.root = new DirectoryEntry(root.name, root.fullPath); - } -}; - -module.exports = FileSystem; diff --git a/plugins/org.apache.cordova.core.file/www/FileUploadOptions.js b/plugins/org.apache.cordova.core.file/www/FileUploadOptions.js deleted file mode 100644 index b2977de..0000000 --- a/plugins/org.apache.cordova.core.file/www/FileUploadOptions.js +++ /dev/null @@ -1,41 +0,0 @@ -/* - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - * -*/ - -/** - * Options to customize the HTTP request used to upload files. - * @constructor - * @param fileKey {String} Name of file request parameter. - * @param fileName {String} Filename to be used by the server. Defaults to image.jpg. - * @param mimeType {String} Mimetype of the uploaded file. Defaults to image/jpeg. - * @param params {Object} Object with key: value params to send to the server. - * @param headers {Object} Keys are header names, values are header values. Multiple - * headers of the same name are not supported. - */ -var FileUploadOptions = function(fileKey, fileName, mimeType, params, headers, httpMethod) { - this.fileKey = fileKey || null; - this.fileName = fileName || null; - this.mimeType = mimeType || null; - this.params = params || null; - this.headers = headers || null; - this.httpMethod = httpMethod || null; -}; - -module.exports = FileUploadOptions; diff --git a/plugins/org.apache.cordova.core.file/www/FileUploadResult.js b/plugins/org.apache.cordova.core.file/www/FileUploadResult.js deleted file mode 100644 index 294995f..0000000 --- a/plugins/org.apache.cordova.core.file/www/FileUploadResult.js +++ /dev/null @@ -1,32 +0,0 @@ -/* - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - * -*/ - -/** - * FileUploadResult - * @constructor - */ -var FileUploadResult = function() { - this.bytesSent = 0; - this.responseCode = null; - this.response = null; -}; - -module.exports = FileUploadResult; diff --git a/plugins/org.apache.cordova.core.file/www/FileWriter.js b/plugins/org.apache.cordova.core.file/www/FileWriter.js deleted file mode 100644 index 44d7a32..0000000 --- a/plugins/org.apache.cordova.core.file/www/FileWriter.js +++ /dev/null @@ -1,297 +0,0 @@ -/* - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - * -*/ - -var exec = require('cordova/exec'), - FileError = require('./FileError'), - ProgressEvent = require('./ProgressEvent'); - -/** - * This class writes to the mobile device file system. - * - * For Android: - * The root directory is the root of the file system. - * To write to the SD card, the file name is "sdcard/my_file.txt" - * - * @constructor - * @param file {File} File object containing file properties - * @param append if true write to the end of the file, otherwise overwrite the file - */ -var FileWriter = function(file) { - this.fileName = ""; - this.length = 0; - if (file) { - this.fileName = file.fullPath || file; - this.length = file.size || 0; - } - // default is to write at the beginning of the file - this.position = 0; - - this.readyState = 0; // EMPTY - - this.result = null; - - // Error - this.error = null; - - // Event handlers - this.onwritestart = null; // When writing starts - this.onprogress = null; // While writing the file, and reporting partial file data - this.onwrite = null; // When the write has successfully completed. - this.onwriteend = null; // When the request has completed (either in success or failure). - this.onabort = null; // When the write has been aborted. For instance, by invoking the abort() method. - this.onerror = null; // When the write has failed (see errors). -}; - -// States -FileWriter.INIT = 0; -FileWriter.WRITING = 1; -FileWriter.DONE = 2; - -/** - * Abort writing file. - */ -FileWriter.prototype.abort = function() { - // check for invalid state - if (this.readyState === FileWriter.DONE || this.readyState === FileWriter.INIT) { - throw new FileError(FileError.INVALID_STATE_ERR); - } - - // set error - this.error = new FileError(FileError.ABORT_ERR); - - this.readyState = FileWriter.DONE; - - // If abort callback - if (typeof this.onabort === "function") { - this.onabort(new ProgressEvent("abort", {"target":this})); - } - - // If write end callback - if (typeof this.onwriteend === "function") { - this.onwriteend(new ProgressEvent("writeend", {"target":this})); - } -}; - -/** - * Writes data to the file - * - * @param data text or blob to be written - */ -FileWriter.prototype.write = function(data) { - - var that=this; - var supportsBinary = (typeof window.Blob !== 'undefined' && typeof window.ArrayBuffer !== 'undefined'); - var isBinary; - - // Check to see if the incoming data is a blob - if (data instanceof File || (supportsBinary && data instanceof Blob)) { - var fileReader = new FileReader(); - fileReader.onload = function() { - // Call this method again, with the arraybuffer as argument - FileWriter.prototype.write.call(that, this.result); - }; - if (supportsBinary) { - fileReader.readAsArrayBuffer(data); - } else { - fileReader.readAsText(data); - } - return; - } - - // Mark data type for safer transport over the binary bridge - isBinary = supportsBinary && (data instanceof ArrayBuffer); - - // Throw an exception if we are already writing a file - if (this.readyState === FileWriter.WRITING) { - throw new FileError(FileError.INVALID_STATE_ERR); - } - - // WRITING state - this.readyState = FileWriter.WRITING; - - var me = this; - - // If onwritestart callback - if (typeof me.onwritestart === "function") { - me.onwritestart(new ProgressEvent("writestart", {"target":me})); - } - - // Write file - exec( - // Success callback - function(r) { - // If DONE (cancelled), then don't do anything - if (me.readyState === FileWriter.DONE) { - return; - } - - // position always increases by bytes written because file would be extended - me.position += r; - // The length of the file is now where we are done writing. - - me.length = me.position; - - // DONE state - me.readyState = FileWriter.DONE; - - // If onwrite callback - if (typeof me.onwrite === "function") { - me.onwrite(new ProgressEvent("write", {"target":me})); - } - - // If onwriteend callback - if (typeof me.onwriteend === "function") { - me.onwriteend(new ProgressEvent("writeend", {"target":me})); - } - }, - // Error callback - function(e) { - // If DONE (cancelled), then don't do anything - if (me.readyState === FileWriter.DONE) { - return; - } - - // DONE state - me.readyState = FileWriter.DONE; - - // Save error - me.error = new FileError(e); - - // If onerror callback - if (typeof me.onerror === "function") { - me.onerror(new ProgressEvent("error", {"target":me})); - } - - // If onwriteend callback - if (typeof me.onwriteend === "function") { - me.onwriteend(new ProgressEvent("writeend", {"target":me})); - } - }, "File", "write", [this.fileName, data, this.position, isBinary]); -}; - -/** - * Moves the file pointer to the location specified. - * - * If the offset is a negative number the position of the file - * pointer is rewound. If the offset is greater than the file - * size the position is set to the end of the file. - * - * @param offset is the location to move the file pointer to. - */ -FileWriter.prototype.seek = function(offset) { - // Throw an exception if we are already writing a file - if (this.readyState === FileWriter.WRITING) { - throw new FileError(FileError.INVALID_STATE_ERR); - } - - if (!offset && offset !== 0) { - return; - } - - // See back from end of file. - if (offset < 0) { - this.position = Math.max(offset + this.length, 0); - } - // Offset is bigger than file size so set position - // to the end of the file. - else if (offset > this.length) { - this.position = this.length; - } - // Offset is between 0 and file size so set the position - // to start writing. - else { - this.position = offset; - } -}; - -/** - * Truncates the file to the size specified. - * - * @param size to chop the file at. - */ -FileWriter.prototype.truncate = function(size) { - // Throw an exception if we are already writing a file - if (this.readyState === FileWriter.WRITING) { - throw new FileError(FileError.INVALID_STATE_ERR); - } - - // WRITING state - this.readyState = FileWriter.WRITING; - - var me = this; - - // If onwritestart callback - if (typeof me.onwritestart === "function") { - me.onwritestart(new ProgressEvent("writestart", {"target":this})); - } - - // Write file - exec( - // Success callback - function(r) { - // If DONE (cancelled), then don't do anything - if (me.readyState === FileWriter.DONE) { - return; - } - - // DONE state - me.readyState = FileWriter.DONE; - - // Update the length of the file - me.length = r; - me.position = Math.min(me.position, r); - - // If onwrite callback - if (typeof me.onwrite === "function") { - me.onwrite(new ProgressEvent("write", {"target":me})); - } - - // If onwriteend callback - if (typeof me.onwriteend === "function") { - me.onwriteend(new ProgressEvent("writeend", {"target":me})); - } - }, - // Error callback - function(e) { - // If DONE (cancelled), then don't do anything - if (me.readyState === FileWriter.DONE) { - return; - } - - // DONE state - me.readyState = FileWriter.DONE; - - // Save error - me.error = new FileError(e); - - // If onerror callback - if (typeof me.onerror === "function") { - me.onerror(new ProgressEvent("error", {"target":me})); - } - - // If onwriteend callback - if (typeof me.onwriteend === "function") { - me.onwriteend(new ProgressEvent("writeend", {"target":me})); - } - }, "File", "truncate", [this.fileName, size]); -}; - -module.exports = FileWriter; diff --git a/plugins/org.apache.cordova.core.file/www/Flags.js b/plugins/org.apache.cordova.core.file/www/Flags.js deleted file mode 100644 index a9ae6da..0000000 --- a/plugins/org.apache.cordova.core.file/www/Flags.js +++ /dev/null @@ -1,36 +0,0 @@ -/* - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - * -*/ - -/** - * Supplies arguments to methods that lookup or create files and directories. - * - * @param create - * {boolean} file or directory if it doesn't exist - * @param exclusive - * {boolean} used with create; if true the command will fail if - * target path exists - */ -function Flags(create, exclusive) { - this.create = create || false; - this.exclusive = exclusive || false; -} - -module.exports = Flags; diff --git a/plugins/org.apache.cordova.core.file/www/LocalFileSystem.js b/plugins/org.apache.cordova.core.file/www/LocalFileSystem.js deleted file mode 100644 index dae7683..0000000 --- a/plugins/org.apache.cordova.core.file/www/LocalFileSystem.js +++ /dev/null @@ -1,34 +0,0 @@ -/* - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - * -*/ - -var exec = require('cordova/exec'); - -/** - * Represents a local file system. - */ -var LocalFileSystem = function() { - -}; - -LocalFileSystem.TEMPORARY = 0; //temporary, with no guarantee of persistence -LocalFileSystem.PERSISTENT = 1; //persistent - -module.exports = LocalFileSystem; diff --git a/plugins/org.apache.cordova.core.file/www/Metadata.js b/plugins/org.apache.cordova.core.file/www/Metadata.js deleted file mode 100644 index bee26bd..0000000 --- a/plugins/org.apache.cordova.core.file/www/Metadata.js +++ /dev/null @@ -1,31 +0,0 @@ -/* - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - * -*/ - -/** - * Information about the state of the file or directory - * - * {Date} modificationTime (readonly) - */ -var Metadata = function(time) { - this.modificationTime = (typeof time != 'undefined'?new Date(time):null); -}; - -module.exports = Metadata; diff --git a/plugins/org.apache.cordova.core.file/www/ProgressEvent.js b/plugins/org.apache.cordova.core.file/www/ProgressEvent.js deleted file mode 100644 index f176f80..0000000 --- a/plugins/org.apache.cordova.core.file/www/ProgressEvent.js +++ /dev/null @@ -1,67 +0,0 @@ -/* - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - * -*/ - -// If ProgressEvent exists in global context, use it already, otherwise use our own polyfill -// Feature test: See if we can instantiate a native ProgressEvent; -// if so, use that approach, -// otherwise fill-in with our own implementation. -// -// NOTE: right now we always fill in with our own. Down the road would be nice if we can use whatever is native in the webview. -var ProgressEvent = (function() { - /* - var createEvent = function(data) { - var event = document.createEvent('Events'); - event.initEvent('ProgressEvent', false, false); - if (data) { - for (var i in data) { - if (data.hasOwnProperty(i)) { - event[i] = data[i]; - } - } - if (data.target) { - // TODO: cannot call .dispatchEvent - // need to first figure out how to implement EventTarget - } - } - return event; - }; - try { - var ev = createEvent({type:"abort",target:document}); - return function ProgressEvent(type, data) { - data.type = type; - return createEvent(data); - }; - } catch(e){ - */ - return function ProgressEvent(type, dict) { - this.type = type; - this.bubbles = false; - this.cancelBubble = false; - this.cancelable = false; - this.lengthComputable = false; - this.loaded = dict && dict.loaded ? dict.loaded : 0; - this.total = dict && dict.total ? dict.total : 0; - this.target = dict && dict.target ? dict.target : null; - }; - //} -})(); - -module.exports = ProgressEvent; diff --git a/plugins/org.apache.cordova.core.file/www/blackberry10/DirectoryEntry.js b/plugins/org.apache.cordova.core.file/www/blackberry10/DirectoryEntry.js deleted file mode 100644 index 15289a7..0000000 --- a/plugins/org.apache.cordova.core.file/www/blackberry10/DirectoryEntry.js +++ /dev/null @@ -1,57 +0,0 @@ -/* - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - * -*/ - -var argscheck = require('cordova/argscheck'), - utils = require('cordova/utils'), - Entry = require('./BB10Entry'), - FileError = require('./FileError'), - DirectoryReader = require('./BB10DirectoryReader'), - fileUtils = require('./BB10Utils'), - DirectoryEntry = function (name, fullPath) { - DirectoryEntry.__super__.constructor.call(this, false, true, name, fullPath); - }; - -utils.extend(DirectoryEntry, Entry); - -DirectoryEntry.prototype.createReader = function () { - return new DirectoryReader(this.fullPath); -}; - -DirectoryEntry.prototype.getDirectory = function (path, options, successCallback, errorCallback) { - argscheck.checkArgs('sOFF', 'DirectoryEntry.getDirectory', arguments); - this.nativeEntry.getDirectory(path, options, function (entry) { - successCallback(fileUtils.createEntry(entry)); - }, errorCallback); -}; - -DirectoryEntry.prototype.removeRecursively = function (successCallback, errorCallback) { - argscheck.checkArgs('FF', 'DirectoryEntry.removeRecursively', arguments); - this.nativeEntry.removeRecursively(successCallback, errorCallback); -}; - -DirectoryEntry.prototype.getFile = function (path, options, successCallback, errorCallback) { - argscheck.checkArgs('sOFF', 'DirectoryEntry.getFile', arguments); - this.nativeEntry.getFile(path, options, function (entry) { - successCallback(fileUtils.createEntry(entry)); - }, errorCallback); -}; - -module.exports = DirectoryEntry; diff --git a/plugins/org.apache.cordova.core.file/www/blackberry10/DirectoryReader.js b/plugins/org.apache.cordova.core.file/www/blackberry10/DirectoryReader.js deleted file mode 100644 index a188545..0000000 --- a/plugins/org.apache.cordova.core.file/www/blackberry10/DirectoryReader.js +++ /dev/null @@ -1,47 +0,0 @@ -/* - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - * -*/ - -var FileError = require('./FileError'), - fileUtils = require('./BB10Utils'); - -function DirectoryReader(path) { - this.path = path; -} - -DirectoryReader.prototype.readEntries = function(successCallback, errorCallback) { - var win = typeof successCallback !== 'function' ? null : function(result) { - var retVal = []; - for (var i=0; i= 1000000000000000) { - fail(new FileError(FileError.QUOTA_EXCEEDED_ERR)); - } else if (type !== 1 && type !== 0) { - fail(new FileError(FileError.SYNTAX_ERR)); - } else { - window.webkitRequestFileSystem(type, size, function (fs) { - success((new FileSystem(fileUtils.getFileSystemName(fs), fileUtils.createEntry(fs.root)))); - }, function (error) { - fail(new FileError(error)); - }); - } -}; diff --git a/plugins/org.apache.cordova.core.file/www/blackberry10/resolveLocalFileSystemURI.js b/plugins/org.apache.cordova.core.file/www/blackberry10/resolveLocalFileSystemURI.js deleted file mode 100644 index 02e9e6c..0000000 --- a/plugins/org.apache.cordova.core.file/www/blackberry10/resolveLocalFileSystemURI.js +++ /dev/null @@ -1,55 +0,0 @@ -/* - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - * -*/ - -var fileUtils = require('./BB10Utils'), - FileError = require('./FileError'); - -module.exports = function (uri, success, fail) { - var type, - path, - paramPath; - if (!uri || uri.indexOf("/") === 0) { - fail(new FileError(FileError.ENCODING_ERR)); - } else { - type = uri.indexOf("persistent") === -1 ? 0 : 1; - path = uri.substring(type === 1 ? uri.indexOf("persistent") + 11 : uri.indexOf("temporary") + 10); - if (path.substring(0,1) == "/") { - path = path.substring(1); - } - paramPath = path.indexOf("?"); - if (paramPath > -1) { - path = path.substring(0, paramPath); - } - window.webkitRequestFileSystem(type, 25*1024*1024, function (fs) { - if (path === "") { - success(fileUtils.createEntry(fs.root)); - } else { - fs.root.getDirectory(path, {}, function (entry) { - success(fileUtils.createEntry(entry)); - }, function () { - fs.root.getFile(path, {}, function (entry) { - success(fileUtils.createEntry(entry)); - }, fail); - }); - } - }, fail); - } -}; diff --git a/plugins/org.apache.cordova.core.file/www/ios/Entry.js b/plugins/org.apache.cordova.core.file/www/ios/Entry.js deleted file mode 100644 index bb8d43c..0000000 --- a/plugins/org.apache.cordova.core.file/www/ios/Entry.js +++ /dev/null @@ -1,32 +0,0 @@ -/* - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - * -*/ - -module.exports = { - toURL:function() { - // TODO: refactor path in a cross-platform way so we can eliminate - // these kinds of platform-specific hacks. - return "file://localhost" + this.fullPath; - }, - toURI: function() { - console.log("DEPRECATED: Update your code to use 'toURL'"); - return "file://localhost" + this.fullPath; - } -}; diff --git a/plugins/org.apache.cordova.core.file/www/requestFileSystem.js b/plugins/org.apache.cordova.core.file/www/requestFileSystem.js deleted file mode 100644 index bad3291..0000000 --- a/plugins/org.apache.cordova.core.file/www/requestFileSystem.js +++ /dev/null @@ -1,61 +0,0 @@ -/* - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - * -*/ - -var argscheck = require('cordova/argscheck'), - FileError = require('./FileError'), - FileSystem = require('./FileSystem'), - exec = require('cordova/exec'); - -/** - * Request a file system in which to store application data. - * @param type local file system type - * @param size indicates how much storage space, in bytes, the application expects to need - * @param successCallback invoked with a FileSystem object - * @param errorCallback invoked if error occurs retrieving file system - */ -var requestFileSystem = function(type, size, successCallback, errorCallback) { - argscheck.checkArgs('nnFF', 'requestFileSystem', arguments); - var fail = function(code) { - errorCallback && errorCallback(new FileError(code)); - }; - - if (type < 0 || type > 3) { - fail(FileError.SYNTAX_ERR); - } else { - // if successful, return a FileSystem object - var success = function(file_system) { - if (file_system) { - if (successCallback) { - // grab the name and root from the file system object - var result = new FileSystem(file_system.name, file_system.root); - successCallback(result); - } - } - else { - // no FileSystem object returned - fail(FileError.NOT_FOUND_ERR); - } - }; - exec(success, fail, "File", "requestFileSystem", [type, size]); - } -}; - -module.exports = requestFileSystem; diff --git a/plugins/org.apache.cordova.core.file/www/resolveLocalFileSystemURI.js b/plugins/org.apache.cordova.core.file/www/resolveLocalFileSystemURI.js deleted file mode 100644 index b5a0deb..0000000 --- a/plugins/org.apache.cordova.core.file/www/resolveLocalFileSystemURI.js +++ /dev/null @@ -1,64 +0,0 @@ -/* - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - * -*/ - -var argscheck = require('cordova/argscheck'), - DirectoryEntry = require('./DirectoryEntry'), - FileEntry = require('./FileEntry'), - FileError = require('./FileError'), - exec = require('cordova/exec'); - -/** - * Look up file system Entry referred to by local URI. - * @param {DOMString} uri URI referring to a local file or directory - * @param successCallback invoked with Entry object corresponding to URI - * @param errorCallback invoked if error occurs retrieving file system entry - */ -module.exports = function(uri, successCallback, errorCallback) { - argscheck.checkArgs('sFF', 'resolveLocalFileSystemURI', arguments); - // error callback - var fail = function(error) { - errorCallback && errorCallback(new FileError(error)); - }; - // sanity check for 'not:valid:filename' - if(!uri || uri.split(":").length > 2) { - setTimeout( function() { - fail(FileError.ENCODING_ERR); - },0); - return; - } - // if successful, return either a file or directory entry - var success = function(entry) { - var result; - if (entry) { - if (successCallback) { - // create appropriate Entry object - result = (entry.isDirectory) ? new DirectoryEntry(entry.name, entry.fullPath) : new FileEntry(entry.name, entry.fullPath); - successCallback(result); - } - } - else { - // no Entry object returned - fail(FileError.NOT_FOUND_ERR); - } - }; - - exec(success, fail, "File", "resolveLocalFileSystemURI", [uri]); -}; diff --git a/plugins/org.apache.cordova.core.file/www/wp/FileUploadOptions.js b/plugins/org.apache.cordova.core.file/www/wp/FileUploadOptions.js deleted file mode 100644 index 696573a..0000000 --- a/plugins/org.apache.cordova.core.file/www/wp/FileUploadOptions.js +++ /dev/null @@ -1,49 +0,0 @@ -/* - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - * -*/ - -/** - * Options to customize the HTTP request used to upload files. - * @constructor - * @param fileKey {String} Name of file request parameter. - * @param fileName {String} Filename to be used by the server. Defaults to image.jpg. - * @param mimeType {String} Mimetype of the uploaded file. Defaults to image/jpeg. - * @param params {Object} Object with key: value params to send to the server. - */ -var FileUploadOptions = function(fileKey, fileName, mimeType, params, headers, httpMethod) { - this.fileKey = fileKey || null; - this.fileName = fileName || null; - this.mimeType = mimeType || null; - this.headers = headers || null; - this.httpMethod = httpMethod || null; - - if(params && typeof params != typeof "") { - var arrParams = []; - for(var v in params) { - arrParams.push(v + "=" + params[v]); - } - this.params = encodeURIComponent(arrParams.join("&")); - } - else { - this.params = params || null; - } -}; - -module.exports = FileUploadOptions; diff --git a/plugins/org.apache.cordova.core.inappbrowser/.fetch.json b/plugins/org.apache.cordova.core.inappbrowser/.fetch.json deleted file mode 100644 index 99d17ca..0000000 --- a/plugins/org.apache.cordova.core.inappbrowser/.fetch.json +++ /dev/null @@ -1 +0,0 @@ -{"source":{"type":"git","url":"https://git-wip-us.apache.org/repos/asf/cordova-plugin-inappbrowser.git","subdir":"."}} \ No newline at end of file diff --git a/plugins/org.apache.cordova.core.inappbrowser/README.md b/plugins/org.apache.cordova.core.inappbrowser/README.md deleted file mode 100644 index d107c69..0000000 --- a/plugins/org.apache.cordova.core.inappbrowser/README.md +++ /dev/null @@ -1,5 +0,0 @@ -cordova-plugin-inappbrowser ------------------------------ -To install this plugin, follow the [Command-line Interface Guide](http://cordova.apache.org/docs/en/edge/guide_cli_index.md.html#The%20Command-line%20Interface). - -If you are not using the Cordova Command-line Interface, follow [Using Plugman to Manage Plugins](http://cordova.apache.org/docs/en/edge/guide_plugin_ref_plugman.md.html). diff --git a/plugins/org.apache.cordova.core.inappbrowser/docs/inappbrowser.md b/plugins/org.apache.cordova.core.inappbrowser/docs/inappbrowser.md deleted file mode 100644 index 3ea6f4c..0000000 --- a/plugins/org.apache.cordova.core.inappbrowser/docs/inappbrowser.md +++ /dev/null @@ -1,427 +0,0 @@ ---- -license: Licensed to the Apache Software Foundation (ASF) under one - or more contributor license agreements. See the NOTICE file - distributed with this work for additional information - regarding copyright ownership. The ASF licenses this file - to you under the Apache License, Version 2.0 (the - "License"); you may not use this file except in compliance - with the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, - software distributed under the License is distributed on an - "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - KIND, either express or implied. See the License for the - specific language governing permissions and limitations - under the License. ---- - -InAppBrowser -============ - -> The `InAppBrowser` is a web browser that displays in the app when calling `window.open`. - - var ref = window.open('http://apache.org', '_blank', 'location=yes'); - -Description ------------ - -The object returned from a call to `window.open`. - -Methods ----------- - -- addEventListener -- removeEventListener -- close - -Permissions ------------ - -### Android - -#### app/res/xml/config.xml - - - -### iOS - -#### config.xml - - - -### Windows Phone 7 + 8 - -#### config.xml - - - -addEventListener -================ - -> Adds a listener for an event from the `InAppBrowser`. - - ref.addEventListener(eventname, callback); - -- __ref__: reference to the `InAppBrowser` window _(InAppBrowser)_ -- __eventname__: the event to listen for _(String)_ - - - __loadstart__: event fires when the `InAppBrowser` starts to load a URL. - - __loadstop__: event fires when the `InAppBrowser` finishes loading a URL. - - __loaderror__: event fires when the `InAppBrowser` encounters an error when loading a URL. - - __exit__: event fires when the `InAppBrowser` window is closed. - -- __callback__: the function that executes when the event fires. The function is passed an `InAppBrowserEvent` object as a parameter. - -Supported Platforms -------------------- - -- Android -- iOS -- Windows Phone 7 + 8 - -Quick Example -------------- - - var ref = window.open('http://apache.org', '_blank', 'location=yes'); - ref.addEventListener('loadstart', function() { alert(event.url); }); - -Full Example ------------- - - - - - InAppBrowser.addEventListener Example - - - - - - - - -removeEventListener -=================== - -> Removes a listener for an event from the `InAppBrowser`. - - ref.removeEventListener(eventname, callback); - -- __ref__: reference to the `InAppBrowser` window. _(InAppBrowser)_ -- __eventname__: the event to stop listening for. _(String)_ - - - __loadstart__: event fires when the `InAppBrowser` starts to load a URL. - - __loadstop__: event fires when the `InAppBrowser` finishes loading a URL. - - __loaderror__: event fires when the `InAppBrowser` encounters an error loading a URL. - - __exit__: event fires when the `InAppBrowser` window is closed. - -- __callback__: the function to execute when the event fires. -The function is passed an `InAppBrowserEvent` object. - -Supported Platforms -------------------- - -- Android -- iOS -- Windows Phone 7 + 8 - -Quick Example -------------- - - var ref = window.open('http://apache.org', '_blank', 'location=yes'); - var myCallback = function() { alert(event.url); } - ref.addEventListener('loadstart', myCallback); - ref.removeEventListener('loadstart', myCallback); - -Full Example ------------- - - - - - InAppBrowser.removeEventListener Example - - - - - - - - -close -===== - -> Closes the `InAppBrowser` window. - - ref.close(); - -- __ref__: reference to the `InAppBrowser` window _(InAppBrowser)_ - -Supported Platforms -------------------- - -- Android -- iOS -- Windows Phone 7 + 8 -- BlackBerry 10 - -Quick Example -------------- - - var ref = window.open('http://apache.org', '_blank', 'location=yes'); - ref.close(); - -Full Example ------------- - - - - - InAppBrowser.close Example - - - - - - - - -executeScript -============= - -> Injects JavaScript code into the `InAppBrowser` window - - ref.executeScript(details, callback); - -- __ref__: reference to the `InAppBrowser` window. _(InAppBrowser)_ -- __injectDetails__: details of the script to run, specifying either a `file` or `code` key. _(Object)_ - - __file__: URL of the script to inject. - - __code__: Text of the script to inject. -- __callback__: the function that executes after the JavaScript code is injected. - - If the injected script is of type `code`, the callback executes - with a single parameter, which is the return value of the - script, wrapped in an `Array`. For multi-line scripts, this is - the return value of the last statement, or the last expression - evaluated. - -Supported Platforms -------------------- - -- Android -- iOS - -Quick Example -------------- - - var ref = window.open('http://apache.org', '_blank', 'location=yes'); - ref.addEventListener('loadstop', function() { - ref.executeSript({file: "myscript.js"}); - }); - -Full Example ------------- - - - - - InAppBrowser.executeScript Example - - - - - - - - -insertCSS -========= - -> Injects CSS into the `InAppBrowser` window. - - ref.insertCSS(details, callback); - -- __ref__: reference to the `InAppBrowser` window _(InAppBrowser)_ -- __injectDetails__: details of the script to run, specifying either a `file` or `code` key. _(Object)_ - - __file__: URL of the stylesheet to inject. - - __code__: Text of the stylesheet to inject. -- __callback__: the function that executes after the CSS is injected. - -Supported Platforms -------------------- - -- Android -- iOS - -Quick Example -------------- - - var ref = window.open('http://apache.org', '_blank', 'location=yes'); - ref.addEventListener('loadstop', function() { - ref.insertCSS({file: "mystyles.css"}); - }); - -Full Example ------------- - - - - - InAppBrowser.executeScript Example - - - - - - - - -InAppBrowserEvent -================= - -The object that is passed to the callback function from an -`addEventListener` call on an `InAppBrowser` object. - -Properties ----------- - -- __type__: the eventname, either `loadstart`, `loadstop`, `loaderror`, or `exit`. _(String)_ -- __url__: the URL that was loaded. _(String)_ -- __code__: the error code, only in the case of `loaderror`. _(Number)_ -- __message__: the error message, only in the case of `loaderror`. _(String)_ diff --git a/plugins/org.apache.cordova.core.inappbrowser/docs/window.open.md b/plugins/org.apache.cordova.core.inappbrowser/docs/window.open.md deleted file mode 100644 index f64eee5..0000000 --- a/plugins/org.apache.cordova.core.inappbrowser/docs/window.open.md +++ /dev/null @@ -1,100 +0,0 @@ ---- -license: Licensed to the Apache Software Foundation (ASF) under one - or more contributor license agreements. See the NOTICE file - distributed with this work for additional information - regarding copyright ownership. The ASF licenses this file - to you under the Apache License, Version 2.0 (the - "License"); you may not use this file except in compliance - with the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, - software distributed under the License is distributed on an - "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - KIND, either express or implied. See the License for the - specific language governing permissions and limitations - under the License. ---- - -window.open -=========== - -Opens a URL in a new `InAppBrowser` instance, the current browser -instance, or the system browser. - - var ref = window.open(url, target, options); - -- __ref__: Reference to the `InAppBrowser` window. _(InAppBrowser)_ -- __url__: The URL to load _(String)_. Call `encodeURI()` on this if the URL contains Unicode characters. -- __target__: The target in which to load the URL, an optional parameter that defaults to `_self`. _(String)_ - - - `_self`: Opens in the Cordova WebView if the URL is in the white list, otherwise it opens in the `InAppBrowser`. - - `_blank`: Opens in the `InAppBrowser`. - - `_system`: Opens in the system's web browser. - -- __options__: Options for the `InAppBrowser`. Optional, defaulting to: `location=yes`. _(String)_ - - The `options` string must not contain any blank space, and each feature's name/value pairs must be separated by a comma. Feature names are case insensitive. All platforms support the value below: - - - __location__: Set to `yes` or `no` to turn the `InAppBrowser`'s location bar on or off. - - Android only - ------------ - - __closebuttoncaption__ - set to a string that will be the caption for the "Done" button. - - iOS only - -------- - - __closebuttoncaption__ - set to a string that will be the caption for the "Done" button. Note that you will have to localize this value yourself. - - __toolbar__ - set to 'yes' or 'no' to turn the toolbar on or off for the InAppBrowser (defaults to 'yes') - - __enableViewportScale__: Set to `yes` or `no` to prevent viewport scaling through a meta tag (defaults to `no`). - - __mediaPlaybackRequiresUserAction__: Set to `yes` or `no` to prevent HTML5 audio or video from autoplaying (defaults to `no`). - - __allowInlineMediaPlayback__: Set to `yes` or `no` to allow inline HTML5 media playback, displaying within the browser window rather than a device-specific playback interface. The HTML's `video` element must also include the `webkit-playsinline` attribute (defaults to `no`) - - __keyboardDisplayRequiresUserAction__: Set to `yes` or `no` to open the keyboard when form elements receive focus via JavaScript's `focus()` call (defaults to `yes`). - - __suppressesIncrementalRendering__: Set to `yes` or `no` to wait until all new view content is received before being rendered (defaults to `no`). - - __presentationstyle__: Set to `pagesheet`, `formsheet` or `fullscreen` to set the [presentation style](http://developer.apple.com/library/ios/documentation/UIKit/Reference/UIViewController_Class/Reference/Reference.html#//apple_ref/occ/instp/UIViewController/modalPresentationStyle) (defaults to `fullscreen`). - - __transitionstyle__: Set to `fliphorizontal`, `crossdissolve` or `coververtical` to set the [transition style](http://developer.apple.com/library/ios/#documentation/UIKit/Reference/UIViewController_Class/Reference/Reference.html#//apple_ref/occ/instp/UIViewController/modalTransitionStyle) (defaults to `coververtical`). - -Supported Platforms -------------------- - -- Android -- iOS -- BlackBerry 10 -- Windows Phone 7 + 8 - -Quick Example -------------- - - var ref = window.open('http://apache.org', '_blank', 'location=yes'); - var ref2 = window.open(encodeURI('http://ja.m.wikipedia.org/wiki/ハングル'), '_blank', 'location=yes'); - -Full Example ------------- - - - - - window.open Example - - - - - - - diff --git a/plugins/org.apache.cordova.core.inappbrowser/plugin.xml b/plugins/org.apache.cordova.core.inappbrowser/plugin.xml deleted file mode 100644 index 0ae3936..0000000 --- a/plugins/org.apache.cordova.core.inappbrowser/plugin.xml +++ /dev/null @@ -1,70 +0,0 @@ - - - - InAppBrowser - Cordova InAppBrowser Plugin - Apache - cordova,in,app,browser,inappbrowser - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/plugins/org.apache.cordova.core.inappbrowser/src/android/InAppBrowser.java b/plugins/org.apache.cordova.core.inappbrowser/src/android/InAppBrowser.java deleted file mode 100644 index 581a4a0..0000000 --- a/plugins/org.apache.cordova.core.inappbrowser/src/android/InAppBrowser.java +++ /dev/null @@ -1,832 +0,0 @@ -/* - Licensed to the Apache Software Foundation (ASF) under one - or more contributor license agreements. See the NOTICE file - distributed with this work for additional information - regarding copyright ownership. The ASF licenses this file - to you under the Apache License, Version 2.0 (the - "License"); you may not use this file except in compliance - with the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, - software distributed under the License is distributed on an - "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - KIND, either express or implied. See the License for the - specific language governing permissions and limitations - under the License. -*/ -package org.apache.cordova.core; - -import java.util.HashMap; -import java.util.StringTokenizer; - - -import org.apache.cordova.Config; -import org.apache.cordova.CordovaWebView; -import org.apache.cordova.CallbackContext; -import org.apache.cordova.CordovaPlugin; -import org.apache.cordova.LOG; -import org.apache.cordova.PluginResult; -import org.json.JSONArray; -import org.json.JSONException; -import org.json.JSONObject; - -import android.annotation.SuppressLint; -import android.app.Dialog; -import android.content.Context; -import android.content.DialogInterface; -import android.content.Intent; -import android.graphics.Bitmap; -import android.net.Uri; -import android.os.Bundle; -import android.text.InputType; -import android.util.Log; -import android.util.TypedValue; -import android.view.Gravity; -import android.view.KeyEvent; -import android.view.View; -import android.view.Window; -import android.view.WindowManager; -import android.view.WindowManager.LayoutParams; -import android.view.inputmethod.EditorInfo; -import android.view.inputmethod.InputMethodManager; -import android.webkit.WebChromeClient; -import android.webkit.GeolocationPermissions.Callback; -import android.webkit.JsPromptResult; -import android.webkit.WebSettings; -import android.webkit.WebStorage; -import android.webkit.WebView; -import android.webkit.WebViewClient; -import android.widget.Button; -import android.widget.EditText; -import android.widget.LinearLayout; -import android.widget.RelativeLayout; - -@SuppressLint("SetJavaScriptEnabled") -public class InAppBrowser extends CordovaPlugin { - - private static final String NULL = "null"; - protected static final String LOG_TAG = "InAppBrowser"; - private static final String SELF = "_self"; - private static final String SYSTEM = "_system"; - // private static final String BLANK = "_blank"; - private static final String EXIT_EVENT = "exit"; - private static final String LOCATION = "location"; - private static final String HIDDEN = "hidden"; - private static final String LOAD_START_EVENT = "loadstart"; - private static final String LOAD_STOP_EVENT = "loadstop"; - private static final String LOAD_ERROR_EVENT = "loaderror"; - private static final String CLOSE_BUTTON_CAPTION = "closebuttoncaption"; - private long MAX_QUOTA = 100 * 1024 * 1024; - - private Dialog dialog; - private WebView inAppWebView; - private EditText edittext; - private CallbackContext callbackContext; - private boolean showLocationBar = true; - private boolean openWindowHidden = false; - private String buttonLabel = "Done"; - - /** - * Executes the request and returns PluginResult. - * - * @param action The action to execute. - * @param args JSONArry of arguments for the plugin. - * @param callbackId The callback id used when calling back into JavaScript. - * @return A PluginResult object with a status and message. - */ - public boolean execute(String action, JSONArray args, CallbackContext callbackContext) throws JSONException { - try { - if (action.equals("open")) { - this.callbackContext = callbackContext; - String url = args.getString(0); - String target = args.optString(1); - if (target == null || target.equals("") || target.equals(NULL)) { - target = SELF; - } - HashMap features = parseFeature(args.optString(2)); - - Log.d(LOG_TAG, "target = " + target); - - url = updateUrl(url); - String result = ""; - - // SELF - if (SELF.equals(target)) { - Log.d(LOG_TAG, "in self"); - // load in webview - if (url.startsWith("file://") || url.startsWith("javascript:") - || Config.isUrlWhiteListed(url)) { - this.webView.loadUrl(url); - } - //Load the dialer - else if (url.startsWith(WebView.SCHEME_TEL)) - { - try { - Intent intent = new Intent(Intent.ACTION_DIAL); - intent.setData(Uri.parse(url)); - this.cordova.getActivity().startActivity(intent); - } catch (android.content.ActivityNotFoundException e) { - LOG.e(LOG_TAG, "Error dialing " + url + ": " + e.toString()); - } - } - // load in InAppBrowser - else { - result = this.showWebPage(url, features); - } - } - // SYSTEM - else if (SYSTEM.equals(target)) { - Log.d(LOG_TAG, "in system"); - result = this.openExternal(url); - } - // BLANK - or anything else - else { - Log.d(LOG_TAG, "in blank"); - result = this.showWebPage(url, features); - } - - PluginResult pluginResult = new PluginResult(PluginResult.Status.OK, result); - pluginResult.setKeepCallback(true); - this.callbackContext.sendPluginResult(pluginResult); - } - else if (action.equals("close")) { - closeDialog(); - this.callbackContext.sendPluginResult(new PluginResult(PluginResult.Status.OK)); - } - else if (action.equals("injectScriptCode")) { - String jsWrapper = null; - if (args.getBoolean(1)) { - jsWrapper = String.format("prompt(JSON.stringify([eval(%%s)]), 'gap-iab://%s')", callbackContext.getCallbackId()); - } - injectDeferredObject(args.getString(0), jsWrapper); - } - else if (action.equals("injectScriptFile")) { - String jsWrapper; - if (args.getBoolean(1)) { - jsWrapper = String.format("(function(d) { var c = d.createElement('script'); c.src = %%s; c.onload = function() { prompt('', 'gap-iab://%s'); }; d.body.appendChild(c); })(document)", callbackContext.getCallbackId()); - } else { - jsWrapper = "(function(d) { var c = d.createElement('script'); c.src = %s; d.body.appendChild(c); })(document)"; - } - injectDeferredObject(args.getString(0), jsWrapper); - } - else if (action.equals("injectStyleCode")) { - String jsWrapper; - if (args.getBoolean(1)) { - jsWrapper = String.format("(function(d) { var c = d.createElement('style'); c.innerHTML = %%s; d.body.appendChild(c); prompt('', 'gap-iab://%s');})(document)", callbackContext.getCallbackId()); - } else { - jsWrapper = "(function(d) { var c = d.createElement('style'); c.innerHTML = %s; d.body.appendChild(c); })(document)"; - } - injectDeferredObject(args.getString(0), jsWrapper); - } - else if (action.equals("injectStyleFile")) { - String jsWrapper; - if (args.getBoolean(1)) { - jsWrapper = String.format("(function(d) { var c = d.createElement('link'); c.rel='stylesheet'; c.type='text/css'; c.href = %%s; d.head.appendChild(c); prompt('', 'gap-iab://%s');})(document)", callbackContext.getCallbackId()); - } else { - jsWrapper = "(function(d) { var c = d.createElement('link'); c.rel='stylesheet'; c.type='text/css'; c.href = %s; d.head.appendChild(c); })(document)"; - } - injectDeferredObject(args.getString(0), jsWrapper); - } - else if (action.equals("show")) { - Runnable runnable = new Runnable() { - @Override - public void run() { - dialog.show(); - } - }; - this.cordova.getActivity().runOnUiThread(runnable); - this.callbackContext.sendPluginResult(new PluginResult(PluginResult.Status.OK)); - } - else { - return false; - } - } catch (JSONException e) { - this.callbackContext.sendPluginResult(new PluginResult(PluginResult.Status.JSON_EXCEPTION)); - } - return true; - } - - /** - * Inject an object (script or style) into the InAppBrowser WebView. - * - * This is a helper method for the inject{Script|Style}{Code|File} API calls, which - * provides a consistent method for injecting JavaScript code into the document. - * - * If a wrapper string is supplied, then the source string will be JSON-encoded (adding - * quotes) and wrapped using string formatting. (The wrapper string should have a single - * '%s' marker) - * - * @param source The source object (filename or script/style text) to inject into - * the document. - * @param jsWrapper A JavaScript string to wrap the source string in, so that the object - * is properly injected, or null if the source string is JavaScript text - * which should be executed directly. - */ - private void injectDeferredObject(String source, String jsWrapper) { - String scriptToInject; - if (jsWrapper != null) { - org.json.JSONArray jsonEsc = new org.json.JSONArray(); - jsonEsc.put(source); - String jsonRepr = jsonEsc.toString(); - String jsonSourceString = jsonRepr.substring(1, jsonRepr.length()-1); - scriptToInject = String.format(jsWrapper, jsonSourceString); - } else { - scriptToInject = source; - } - // This action will have the side-effect of blurring the currently focused element - this.inAppWebView.loadUrl("javascript:" + scriptToInject); - } - - /** - * Put the list of features into a hash map - * - * @param optString - * @return - */ - private HashMap parseFeature(String optString) { - if (optString.equals(NULL)) { - return null; - } else { - HashMap map = new HashMap(); - StringTokenizer features = new StringTokenizer(optString, ","); - StringTokenizer option; - while(features.hasMoreElements()) { - option = new StringTokenizer(features.nextToken(), "="); - if (option.hasMoreElements()) { - String key = option.nextToken(); - if (key.equalsIgnoreCase(CLOSE_BUTTON_CAPTION)) { - this.buttonLabel = option.nextToken(); - } else { - Boolean value = option.nextToken().equals("no") ? Boolean.FALSE : Boolean.TRUE; - map.put(key, value); - } - } - } - return map; - } - } - - /** - * Convert relative URL to full path - * - * @param url - * @return - */ - private String updateUrl(String url) { - Uri newUrl = Uri.parse(url); - if (newUrl.isRelative()) { - url = this.webView.getUrl().substring(0, this.webView.getUrl().lastIndexOf("/")+1) + url; - } - return url; - } - - /** - * Display a new browser with the specified URL. - * - * @param url The url to load. - * @param usePhoneGap Load url in PhoneGap webview - * @return "" if ok, or error message. - */ - public String openExternal(String url) { - try { - Intent intent = null; - intent = new Intent(Intent.ACTION_VIEW); - intent.setData(Uri.parse(url)); - this.cordova.getActivity().startActivity(intent); - return ""; - } catch (android.content.ActivityNotFoundException e) { - Log.d(LOG_TAG, "InAppBrowser: Error loading url "+url+":"+ e.toString()); - return e.toString(); - } - } - - /** - * Closes the dialog - */ - private void closeDialog() { - try { - this.inAppWebView.loadUrl("about:blank"); - JSONObject obj = new JSONObject(); - obj.put("type", EXIT_EVENT); - - sendUpdate(obj, false); - } catch (JSONException ex) { - Log.d(LOG_TAG, "Should never happen"); - } - - if (dialog != null) { - dialog.dismiss(); - } - } - - /** - * Checks to see if it is possible to go back one page in history, then does so. - */ - private void goBack() { - if (this.inAppWebView.canGoBack()) { - this.inAppWebView.goBack(); - } - } - - /** - * Checks to see if it is possible to go forward one page in history, then does so. - */ - private void goForward() { - if (this.inAppWebView.canGoForward()) { - this.inAppWebView.goForward(); - } - } - - /** - * Navigate to the new page - * - * @param url to load - */ - private void navigate(String url) { - InputMethodManager imm = (InputMethodManager)this.cordova.getActivity().getSystemService(Context.INPUT_METHOD_SERVICE); - imm.hideSoftInputFromWindow(edittext.getWindowToken(), 0); - - if (!url.startsWith("http") && !url.startsWith("file:")) { - this.inAppWebView.loadUrl("http://" + url); - } else { - this.inAppWebView.loadUrl(url); - } - this.inAppWebView.requestFocus(); - } - - - /** - * Should we show the location bar? - * - * @return boolean - */ - private boolean getShowLocationBar() { - return this.showLocationBar; - } - - /** - * Display a new browser with the specified URL. - * - * @param url The url to load. - * @param jsonObject - */ - public String showWebPage(final String url, HashMap features) { - // Determine if we should hide the location bar. - showLocationBar = true; - openWindowHidden = false; - if (features != null) { - Boolean show = features.get(LOCATION); - if (show != null) { - showLocationBar = show.booleanValue(); - } - Boolean hidden = features.get(HIDDEN); - if(hidden != null) { - openWindowHidden = hidden.booleanValue(); - } - } - - final CordovaWebView thatWebView = this.webView; - - // Create dialog in new thread - Runnable runnable = new Runnable() { - /** - * Convert our DIP units to Pixels - * - * @return int - */ - private int dpToPixels(int dipValue) { - int value = (int) TypedValue.applyDimension( TypedValue.COMPLEX_UNIT_DIP, - (float) dipValue, - cordova.getActivity().getResources().getDisplayMetrics() - ); - - return value; - } - - public void run() { - // Let's create the main dialog - dialog = new Dialog(cordova.getActivity(), android.R.style.Theme_NoTitleBar); - dialog.getWindow().getAttributes().windowAnimations = android.R.style.Animation_Dialog; - dialog.requestWindowFeature(Window.FEATURE_NO_TITLE); - dialog.setCancelable(true); - dialog.setOnDismissListener(new DialogInterface.OnDismissListener() { - public void onDismiss(DialogInterface dialog) { - try { - JSONObject obj = new JSONObject(); - obj.put("type", EXIT_EVENT); - - sendUpdate(obj, false); - } catch (JSONException e) { - Log.d(LOG_TAG, "Should never happen"); - } - } - }); - - // Main container layout - LinearLayout main = new LinearLayout(cordova.getActivity()); - main.setOrientation(LinearLayout.VERTICAL); - - // Toolbar layout - RelativeLayout toolbar = new RelativeLayout(cordova.getActivity()); - toolbar.setLayoutParams(new RelativeLayout.LayoutParams(LayoutParams.MATCH_PARENT, this.dpToPixels(44))); - toolbar.setPadding(this.dpToPixels(2), this.dpToPixels(2), this.dpToPixels(2), this.dpToPixels(2)); - toolbar.setHorizontalGravity(Gravity.LEFT); - toolbar.setVerticalGravity(Gravity.TOP); - - // Action Button Container layout - RelativeLayout actionButtonContainer = new RelativeLayout(cordova.getActivity()); - actionButtonContainer.setLayoutParams(new RelativeLayout.LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT)); - actionButtonContainer.setHorizontalGravity(Gravity.LEFT); - actionButtonContainer.setVerticalGravity(Gravity.CENTER_VERTICAL); - actionButtonContainer.setId(1); - - // Back button - Button back = new Button(cordova.getActivity()); - RelativeLayout.LayoutParams backLayoutParams = new RelativeLayout.LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.MATCH_PARENT); - backLayoutParams.addRule(RelativeLayout.ALIGN_LEFT); - back.setLayoutParams(backLayoutParams); - back.setContentDescription("Back Button"); - back.setId(2); - back.setText("<"); - back.setOnClickListener(new View.OnClickListener() { - public void onClick(View v) { - goBack(); - } - }); - - // Forward button - Button forward = new Button(cordova.getActivity()); - RelativeLayout.LayoutParams forwardLayoutParams = new RelativeLayout.LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.MATCH_PARENT); - forwardLayoutParams.addRule(RelativeLayout.RIGHT_OF, 2); - forward.setLayoutParams(forwardLayoutParams); - forward.setContentDescription("Forward Button"); - forward.setId(3); - forward.setText(">"); - forward.setOnClickListener(new View.OnClickListener() { - public void onClick(View v) { - goForward(); - } - }); - - // Edit Text Box - edittext = new EditText(cordova.getActivity()); - RelativeLayout.LayoutParams textLayoutParams = new RelativeLayout.LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT); - textLayoutParams.addRule(RelativeLayout.RIGHT_OF, 1); - textLayoutParams.addRule(RelativeLayout.LEFT_OF, 5); - edittext.setLayoutParams(textLayoutParams); - edittext.setId(4); - edittext.setSingleLine(true); - edittext.setText(url); - edittext.setInputType(InputType.TYPE_TEXT_VARIATION_URI); - edittext.setImeOptions(EditorInfo.IME_ACTION_GO); - edittext.setInputType(InputType.TYPE_NULL); // Will not except input... Makes the text NON-EDITABLE - edittext.setOnKeyListener(new View.OnKeyListener() { - public boolean onKey(View v, int keyCode, KeyEvent event) { - // If the event is a key-down event on the "enter" button - if ((event.getAction() == KeyEvent.ACTION_DOWN) && (keyCode == KeyEvent.KEYCODE_ENTER)) { - navigate(edittext.getText().toString()); - return true; - } - return false; - } - }); - - // Close button - Button close = new Button(cordova.getActivity()); - RelativeLayout.LayoutParams closeLayoutParams = new RelativeLayout.LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.MATCH_PARENT); - closeLayoutParams.addRule(RelativeLayout.ALIGN_PARENT_RIGHT); - close.setLayoutParams(closeLayoutParams); - forward.setContentDescription("Close Button"); - close.setId(5); - close.setText(buttonLabel); - close.setOnClickListener(new View.OnClickListener() { - public void onClick(View v) { - closeDialog(); - } - }); - - // WebView - inAppWebView = new WebView(cordova.getActivity()); - inAppWebView.setLayoutParams(new LinearLayout.LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT)); - inAppWebView.setWebChromeClient(new InAppChromeClient(thatWebView)); - WebViewClient client = new InAppBrowserClient(thatWebView, edittext); - inAppWebView.setWebViewClient(client); - WebSettings settings = inAppWebView.getSettings(); - settings.setJavaScriptEnabled(true); - settings.setJavaScriptCanOpenWindowsAutomatically(true); - settings.setBuiltInZoomControls(true); - settings.setPluginState(android.webkit.WebSettings.PluginState.ON); - - //Toggle whether this is enabled or not! - Bundle appSettings = cordova.getActivity().getIntent().getExtras(); - boolean enableDatabase = appSettings == null ? true : appSettings.getBoolean("InAppBrowserStorageEnabled", true); - if(enableDatabase) - { - String databasePath = cordova.getActivity().getApplicationContext().getDir("inAppBrowserDB", Context.MODE_PRIVATE).getPath(); - settings.setDatabasePath(databasePath); - settings.setDatabaseEnabled(true); - } - settings.setDomStorageEnabled(true); - - inAppWebView.loadUrl(url); - inAppWebView.setId(6); - inAppWebView.getSettings().setLoadWithOverviewMode(true); - inAppWebView.getSettings().setUseWideViewPort(true); - inAppWebView.requestFocus(); - inAppWebView.requestFocusFromTouch(); - - // Add the back and forward buttons to our action button container layout - actionButtonContainer.addView(back); - actionButtonContainer.addView(forward); - - // Add the views to our toolbar - toolbar.addView(actionButtonContainer); - toolbar.addView(edittext); - toolbar.addView(close); - - // Don't add the toolbar if its been disabled - if (getShowLocationBar()) { - // Add our toolbar to our main view/layout - main.addView(toolbar); - } - - // Add our webview to our main view/layout - main.addView(inAppWebView); - - WindowManager.LayoutParams lp = new WindowManager.LayoutParams(); - lp.copyFrom(dialog.getWindow().getAttributes()); - lp.width = WindowManager.LayoutParams.MATCH_PARENT; - lp.height = WindowManager.LayoutParams.MATCH_PARENT; - - dialog.setContentView(main); - dialog.show(); - dialog.getWindow().setAttributes(lp); - // the goal of openhidden is to load the url and not display it - // Show() needs to be called to cause the URL to be loaded - if(openWindowHidden) { - dialog.hide(); - } - } - }; - this.cordova.getActivity().runOnUiThread(runnable); - return ""; - } - - /** - * Create a new plugin success result and send it back to JavaScript - * - * @param obj a JSONObject contain event payload information - */ - private void sendUpdate(JSONObject obj, boolean keepCallback) { - sendUpdate(obj, keepCallback, PluginResult.Status.OK); - } - - /** - * Create a new plugin result and send it back to JavaScript - * - * @param obj a JSONObject contain event payload information - * @param status the status code to return to the JavaScript environment - */ private void sendUpdate(JSONObject obj, boolean keepCallback, PluginResult.Status status) { - PluginResult result = new PluginResult(status, obj); - result.setKeepCallback(keepCallback); - this.callbackContext.sendPluginResult(result); - } - - public class InAppChromeClient extends WebChromeClient { - - private CordovaWebView webView; - - public InAppChromeClient(CordovaWebView webView) { - super(); - this.webView = webView; - } - /** - * Handle database quota exceeded notification. - * - * @param url - * @param databaseIdentifier - * @param currentQuota - * @param estimatedSize - * @param totalUsedQuota - * @param quotaUpdater - */ - @Override - public void onExceededDatabaseQuota(String url, String databaseIdentifier, long currentQuota, long estimatedSize, - long totalUsedQuota, WebStorage.QuotaUpdater quotaUpdater) - { - LOG.d(LOG_TAG, "onExceededDatabaseQuota estimatedSize: %d currentQuota: %d totalUsedQuota: %d", estimatedSize, currentQuota, totalUsedQuota); - - if (estimatedSize < MAX_QUOTA) - { - //increase for 1Mb - long newQuota = estimatedSize; - LOG.d(LOG_TAG, "calling quotaUpdater.updateQuota newQuota: %d", newQuota); - quotaUpdater.updateQuota(newQuota); - } - else - { - // Set the quota to whatever it is and force an error - // TODO: get docs on how to handle this properly - quotaUpdater.updateQuota(currentQuota); - } - } - - /** - * Instructs the client to show a prompt to ask the user to set the Geolocation permission state for the specified origin. - * - * @param origin - * @param callback - */ - @Override - public void onGeolocationPermissionsShowPrompt(String origin, Callback callback) { - super.onGeolocationPermissionsShowPrompt(origin, callback); - callback.invoke(origin, true, false); - } - - /** - * Tell the client to display a prompt dialog to the user. - * If the client returns true, WebView will assume that the client will - * handle the prompt dialog and call the appropriate JsPromptResult method. - * - * The prompt bridge provided for the InAppBrowser is capable of executing any - * oustanding callback belonging to the InAppBrowser plugin. Care has been - * taken that other callbacks cannot be triggered, and that no other code - * execution is possible. - * - * To trigger the bridge, the prompt default value should be of the form: - * - * gap-iab:// - * - * where is the string id of the callback to trigger (something - * like "InAppBrowser0123456789") - * - * If present, the prompt message is expected to be a JSON-encoded value to - * pass to the callback. A JSON_EXCEPTION is returned if the JSON is invalid. - * - * @param view - * @param url - * @param message - * @param defaultValue - * @param result - */ - @Override - public boolean onJsPrompt(WebView view, String url, String message, String defaultValue, JsPromptResult result) { - // See if the prompt string uses the 'gap-iab' protocol. If so, the remainder should be the id of a callback to execute. - if (defaultValue != null && defaultValue.startsWith("gap-iab://")) { - PluginResult scriptResult; - String scriptCallbackId = defaultValue.substring(10); - if (scriptCallbackId.startsWith("InAppBrowser")) { - if(message == null || message.length() == 0) { - scriptResult = new PluginResult(PluginResult.Status.OK, new JSONArray()); - } else { - try { - scriptResult = new PluginResult(PluginResult.Status.OK, new JSONArray(message)); - } catch(JSONException e) { - scriptResult = new PluginResult(PluginResult.Status.JSON_EXCEPTION, e.getMessage()); - } - } - this.webView.sendPluginResult(scriptResult, scriptCallbackId); - result.confirm(""); - return true; - } - } - return false; - } - - } - - /** - * The webview client receives notifications about appView - */ - public class InAppBrowserClient extends WebViewClient { - EditText edittext; - CordovaWebView webView; - - /** - * Constructor. - * - * @param mContext - * @param edittext - */ - public InAppBrowserClient(CordovaWebView webView, EditText mEditText) { - this.webView = webView; - this.edittext = mEditText; - } - - /** - * Notify the host application that a page has started loading. - * - * @param view The webview initiating the callback. - * @param url The url of the page. - */ - @Override - public void onPageStarted(WebView view, String url, Bitmap favicon) { - super.onPageStarted(view, url, favicon); - String newloc = ""; - if (url.startsWith("http:") || url.startsWith("https:") || url.startsWith("file:")) { - newloc = url; - } - // If dialing phone (tel:5551212) - else if (url.startsWith(WebView.SCHEME_TEL)) { - try { - Intent intent = new Intent(Intent.ACTION_DIAL); - intent.setData(Uri.parse(url)); - cordova.getActivity().startActivity(intent); - } catch (android.content.ActivityNotFoundException e) { - LOG.e(LOG_TAG, "Error dialing " + url + ": " + e.toString()); - } - } - - else if (url.startsWith("geo:") || url.startsWith(WebView.SCHEME_MAILTO) || url.startsWith("market:")) { - try { - Intent intent = new Intent(Intent.ACTION_VIEW); - intent.setData(Uri.parse(url)); - cordova.getActivity().startActivity(intent); - } catch (android.content.ActivityNotFoundException e) { - LOG.e(LOG_TAG, "Error with " + url + ": " + e.toString()); - } - } - // If sms:5551212?body=This is the message - else if (url.startsWith("sms:")) { - try { - Intent intent = new Intent(Intent.ACTION_VIEW); - - // Get address - String address = null; - int parmIndex = url.indexOf('?'); - if (parmIndex == -1) { - address = url.substring(4); - } - else { - address = url.substring(4, parmIndex); - - // If body, then set sms body - Uri uri = Uri.parse(url); - String query = uri.getQuery(); - if (query != null) { - if (query.startsWith("body=")) { - intent.putExtra("sms_body", query.substring(5)); - } - } - } - intent.setData(Uri.parse("sms:" + address)); - intent.putExtra("address", address); - intent.setType("vnd.android-dir/mms-sms"); - cordova.getActivity().startActivity(intent); - } catch (android.content.ActivityNotFoundException e) { - LOG.e(LOG_TAG, "Error sending sms " + url + ":" + e.toString()); - } - } - else { - newloc = "http://" + url; - } - - if (!newloc.equals(edittext.getText().toString())) { - edittext.setText(newloc); - } - - try { - JSONObject obj = new JSONObject(); - obj.put("type", LOAD_START_EVENT); - obj.put("url", newloc); - - sendUpdate(obj, true); - } catch (JSONException ex) { - Log.d(LOG_TAG, "Should never happen"); - } - } - - public void onPageFinished(WebView view, String url) { - super.onPageFinished(view, url); - - try { - JSONObject obj = new JSONObject(); - obj.put("type", LOAD_STOP_EVENT); - obj.put("url", url); - - sendUpdate(obj, true); - } catch (JSONException ex) { - Log.d(LOG_TAG, "Should never happen"); - } - } - - public void onReceivedError(WebView view, int errorCode, String description, String failingUrl) { - super.onReceivedError(view, errorCode, description, failingUrl); - - try { - JSONObject obj = new JSONObject(); - obj.put("type", LOAD_ERROR_EVENT); - obj.put("url", failingUrl); - obj.put("code", errorCode); - obj.put("message", description); - - sendUpdate(obj, true, PluginResult.Status.ERROR); - } catch (JSONException ex) { - Log.d(LOG_TAG, "Should never happen"); - } - - } - } -} diff --git a/plugins/org.apache.cordova.core.inappbrowser/src/blackberry10/README.md b/plugins/org.apache.cordova.core.inappbrowser/src/blackberry10/README.md deleted file mode 100644 index 0b16789..0000000 --- a/plugins/org.apache.cordova.core.inappbrowser/src/blackberry10/README.md +++ /dev/null @@ -1,25 +0,0 @@ -# BlackBerry 10 In-App-Browser Plugin - -The in app browser functionality is entirely contained within common js. There is no native implementation required. -To install this plugin, follow the [Command-line Interface Guide](http://cordova.apache.org/docs/en/edge/guide_cli_index.md.html#The%20Command-line%20Interface). - -If you are not using the Cordova Command-line Interface, follow [Using Plugman to Manage Plugins](http://cordova.apache.org/docs/en/edge/guide_plugin_ref_plugman.md.html). -./cordova-plugin-battery-status/README.md -./cordova-plugin-camera/README.md -./cordova-plugin-console/README.md -./cordova-plugin-contacts/README.md -./cordova-plugin-device/README.md -./cordova-plugin-device-motion/README.md -./cordova-plugin-device-orientation/README.md -./cordova-plugin-device-orientation/src/blackberry10/README.md -./cordova-plugin-file/README.md -./cordova-plugin-file-transfer/README.md -./cordova-plugin-geolocation/README.md -./cordova-plugin-globalization/README.md -./cordova-plugin-inappbrowser/README.md -./cordova-plugin-inappbrowser/src/blackberry10/README.md -./cordova-plugin-media/README.md -./cordova-plugin-media-capture/README.md -./cordova-plugin-network-information/README.md -./cordova-plugin-splashscreen/README.md -./cordova-plugin-vibration/README.md diff --git a/plugins/org.apache.cordova.core.inappbrowser/src/ios/CDVInAppBrowser.h b/plugins/org.apache.cordova.core.inappbrowser/src/ios/CDVInAppBrowser.h deleted file mode 100644 index 059edb0..0000000 --- a/plugins/org.apache.cordova.core.inappbrowser/src/ios/CDVInAppBrowser.h +++ /dev/null @@ -1,89 +0,0 @@ -/* - Licensed to the Apache Software Foundation (ASF) under one - or more contributor license agreements. See the NOTICE file - distributed with this work for additional information - regarding copyright ownership. The ASF licenses this file - to you under the Apache License, Version 2.0 (the - "License"); you may not use this file except in compliance - with the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, - software distributed under the License is distributed on an - "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - KIND, either express or implied. See the License for the - specific language governing permissions and limitations - under the License. - */ - -#import -#import -#import -#import - -@class CDVInAppBrowserViewController; - -@interface CDVInAppBrowser : CDVPlugin { - BOOL _injectedIframeBridge; -} - -@property (nonatomic, retain) CDVInAppBrowserViewController* inAppBrowserViewController; -@property (nonatomic, copy) NSString* callbackId; - -- (void)open:(CDVInvokedUrlCommand*)command; -- (void)close:(CDVInvokedUrlCommand*)command; -- (void)injectScriptCode:(CDVInvokedUrlCommand*)command; -- (void)show:(CDVInvokedUrlCommand*)command; - -@end - -@interface CDVInAppBrowserViewController : UIViewController { - @private - NSString* _userAgent; - NSString* _prevUserAgent; - NSInteger _userAgentLockToken; - CDVWebViewDelegate* _webViewDelegate; -} - -@property (nonatomic, strong) IBOutlet UIWebView* webView; -@property (nonatomic, strong) IBOutlet UIBarButtonItem* closeButton; -@property (nonatomic, strong) IBOutlet UILabel* addressLabel; -@property (nonatomic, strong) IBOutlet UIBarButtonItem* backButton; -@property (nonatomic, strong) IBOutlet UIBarButtonItem* forwardButton; -@property (nonatomic, strong) IBOutlet UIActivityIndicatorView* spinner; -@property (nonatomic, strong) IBOutlet UIToolbar* toolbar; - -@property (nonatomic, weak) id orientationDelegate; -@property (nonatomic, weak) CDVInAppBrowser* navigationDelegate; -@property (nonatomic) NSURL* currentURL; - -- (void)close; -- (void)navigateTo:(NSURL*)url; -- (void)showLocationBar:(BOOL)show; -- (void)showToolBar:(BOOL)show; -- (void)setCloseButtonTitle:(NSString*)title; - -- (id)initWithUserAgent:(NSString*)userAgent prevUserAgent:(NSString*)prevUserAgent; - -@end - -@interface CDVInAppBrowserOptions : NSObject {} - -@property (nonatomic, assign) BOOL location; -@property (nonatomic, assign) BOOL toolbar; -@property (nonatomic, copy) NSString* closebuttoncaption; - -@property (nonatomic, copy) NSString* presentationstyle; -@property (nonatomic, copy) NSString* transitionstyle; - -@property (nonatomic, assign) BOOL enableviewportscale; -@property (nonatomic, assign) BOOL mediaplaybackrequiresuseraction; -@property (nonatomic, assign) BOOL allowinlinemediaplayback; -@property (nonatomic, assign) BOOL keyboarddisplayrequiresuseraction; -@property (nonatomic, assign) BOOL suppressesincrementalrendering; -@property (nonatomic, assign) BOOL hidden; - -+ (CDVInAppBrowserOptions*)parseOptions:(NSString*)options; - -@end diff --git a/plugins/org.apache.cordova.core.inappbrowser/src/ios/CDVInAppBrowser.m b/plugins/org.apache.cordova.core.inappbrowser/src/ios/CDVInAppBrowser.m deleted file mode 100644 index 4170dd2..0000000 --- a/plugins/org.apache.cordova.core.inappbrowser/src/ios/CDVInAppBrowser.m +++ /dev/null @@ -1,834 +0,0 @@ -/* - Licensed to the Apache Software Foundation (ASF) under one - or more contributor license agreements. See the NOTICE file - distributed with this work for additional information - regarding copyright ownership. The ASF licenses this file - to you under the Apache License, Version 2.0 (the - "License"); you may not use this file except in compliance - with the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, - software distributed under the License is distributed on an - "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - KIND, either express or implied. See the License for the - specific language governing permissions and limitations - under the License. - */ - -#import "CDVInAppBrowser.h" -#import -#import -#import - -#define kInAppBrowserTargetSelf @"_self" -#define kInAppBrowserTargetSystem @"_system" -#define kInAppBrowserTargetBlank @"_blank" - -#define TOOLBAR_HEIGHT 44.0 -#define LOCATIONBAR_HEIGHT 21.0 -#define FOOTER_HEIGHT ((TOOLBAR_HEIGHT) + (LOCATIONBAR_HEIGHT)) - -#pragma mark CDVInAppBrowser - -@implementation CDVInAppBrowser - -- (CDVInAppBrowser*)initWithWebView:(UIWebView*)theWebView -{ - self = [super initWithWebView:theWebView]; - if (self != nil) { - // your initialization here - } - - return self; -} - -- (void)onReset -{ - [self close:nil]; -} - -- (void)close:(CDVInvokedUrlCommand*)command -{ - if (self.inAppBrowserViewController != nil) { - [self.inAppBrowserViewController close]; - self.inAppBrowserViewController = nil; - } - - self.callbackId = nil; -} - -- (BOOL) isSystemUrl:(NSURL*)url -{ - if ([[url host] isEqualToString:@"itunes.apple.com"]) { - return YES; - } - - return NO; -} - -- (void)open:(CDVInvokedUrlCommand*)command -{ - CDVPluginResult* pluginResult; - - NSString* url = [command argumentAtIndex:0]; - NSString* target = [command argumentAtIndex:1 withDefault:kInAppBrowserTargetSelf]; - NSString* options = [command argumentAtIndex:2 withDefault:@"" andClass:[NSString class]]; - - self.callbackId = command.callbackId; - - if (url != nil) { - NSURL* baseUrl = [self.webView.request URL]; - NSURL* absoluteUrl = [[NSURL URLWithString:url relativeToURL:baseUrl] absoluteURL]; - - if ([self isSystemUrl:absoluteUrl]) { - target = kInAppBrowserTargetSystem; - } - - if ([target isEqualToString:kInAppBrowserTargetSelf]) { - [self openInCordovaWebView:absoluteUrl withOptions:options]; - } else if ([target isEqualToString:kInAppBrowserTargetSystem]) { - [self openInSystem:absoluteUrl]; - } else { // _blank or anything else - [self openInInAppBrowser:absoluteUrl withOptions:options]; - } - - pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK]; - } else { - pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_ERROR messageAsString:@"incorrect number of arguments"]; - } - - [pluginResult setKeepCallback:[NSNumber numberWithBool:YES]]; - [self.commandDelegate sendPluginResult:pluginResult callbackId:command.callbackId]; -} - -- (void)openInInAppBrowser:(NSURL*)url withOptions:(NSString*)options -{ - if (self.inAppBrowserViewController == nil) { - NSString* originalUA = [CDVUserAgentUtil originalUserAgent]; - self.inAppBrowserViewController = [[CDVInAppBrowserViewController alloc] initWithUserAgent:originalUA prevUserAgent:[self.commandDelegate userAgent]]; - self.inAppBrowserViewController.navigationDelegate = self; - - if ([self.viewController conformsToProtocol:@protocol(CDVScreenOrientationDelegate)]) { - self.inAppBrowserViewController.orientationDelegate = (UIViewController *)self.viewController; - } - } - - - CDVInAppBrowserOptions* browserOptions = [CDVInAppBrowserOptions parseOptions:options]; - [self.inAppBrowserViewController showLocationBar:browserOptions.location]; - [self.inAppBrowserViewController showToolBar:browserOptions.toolbar]; - if (browserOptions.closebuttoncaption != nil) { - [self.inAppBrowserViewController setCloseButtonTitle:browserOptions.closebuttoncaption]; - } - // Set Presentation Style - UIModalPresentationStyle presentationStyle = UIModalPresentationFullScreen; // default - if (browserOptions.presentationstyle != nil) { - if ([[browserOptions.presentationstyle lowercaseString] isEqualToString:@"pagesheet"]) { - presentationStyle = UIModalPresentationPageSheet; - } else if ([[browserOptions.presentationstyle lowercaseString] isEqualToString:@"formsheet"]) { - presentationStyle = UIModalPresentationFormSheet; - } - } - self.inAppBrowserViewController.modalPresentationStyle = presentationStyle; - - // Set Transition Style - UIModalTransitionStyle transitionStyle = UIModalTransitionStyleCoverVertical; // default - if (browserOptions.transitionstyle != nil) { - if ([[browserOptions.transitionstyle lowercaseString] isEqualToString:@"fliphorizontal"]) { - transitionStyle = UIModalTransitionStyleFlipHorizontal; - } else if ([[browserOptions.transitionstyle lowercaseString] isEqualToString:@"crossdissolve"]) { - transitionStyle = UIModalTransitionStyleCrossDissolve; - } - } - self.inAppBrowserViewController.modalTransitionStyle = transitionStyle; - - - // UIWebView options - self.inAppBrowserViewController.webView.scalesPageToFit = browserOptions.enableviewportscale; - self.inAppBrowserViewController.webView.mediaPlaybackRequiresUserAction = browserOptions.mediaplaybackrequiresuseraction; - self.inAppBrowserViewController.webView.allowsInlineMediaPlayback = browserOptions.allowinlinemediaplayback; - if (IsAtLeastiOSVersion(@"6.0")) { - self.inAppBrowserViewController.webView.keyboardDisplayRequiresUserAction = browserOptions.keyboarddisplayrequiresuseraction; - self.inAppBrowserViewController.webView.suppressesIncrementalRendering = browserOptions.suppressesincrementalrendering; - } - - if (! browserOptions.hidden) { - if (self.viewController.modalViewController != self.inAppBrowserViewController) { - [self.viewController presentModalViewController:self.inAppBrowserViewController animated:YES]; - } - } - [self.inAppBrowserViewController navigateTo:url]; -} - -- (void)show:(CDVInvokedUrlCommand*)command -{ - if ([self.inAppBrowserViewController isViewLoaded] && self.inAppBrowserViewController.view.window) - return; - [self.viewController presentModalViewController:self.inAppBrowserViewController animated:YES]; -} - -- (void)openInCordovaWebView:(NSURL*)url withOptions:(NSString*)options -{ - if ([self.commandDelegate URLIsWhitelisted:url]) { - NSURLRequest* request = [NSURLRequest requestWithURL:url]; - [self.webView loadRequest:request]; - } else { // this assumes the InAppBrowser can be excepted from the white-list - [self openInInAppBrowser:url withOptions:options]; - } -} - -- (void)openInSystem:(NSURL*)url -{ - if ([[UIApplication sharedApplication] canOpenURL:url]) { - [[UIApplication sharedApplication] openURL:url]; - } else { // handle any custom schemes to plugins - [[NSNotificationCenter defaultCenter] postNotification:[NSNotification notificationWithName:CDVPluginHandleOpenURLNotification object:url]]; - } -} - -// This is a helper method for the inject{Script|Style}{Code|File} API calls, which -// provides a consistent method for injecting JavaScript code into the document. -// -// If a wrapper string is supplied, then the source string will be JSON-encoded (adding -// quotes) and wrapped using string formatting. (The wrapper string should have a single -// '%@' marker). -// -// If no wrapper is supplied, then the source string is executed directly. - -- (void)injectDeferredObject:(NSString*)source withWrapper:(NSString*)jsWrapper -{ - if (!_injectedIframeBridge) { - _injectedIframeBridge = YES; - // Create an iframe bridge in the new document to communicate with the CDVInAppBrowserViewController - [self.inAppBrowserViewController.webView stringByEvaluatingJavaScriptFromString:@"(function(d){var e = _cdvIframeBridge = d.createElement('iframe');e.style.display='none';d.body.appendChild(e);})(document)"]; - } - - if (jsWrapper != nil) { - NSString* sourceArrayString = [@[source] JSONString]; - if (sourceArrayString) { - NSString* sourceString = [sourceArrayString substringWithRange:NSMakeRange(1, [sourceArrayString length] - 2)]; - NSString* jsToInject = [NSString stringWithFormat:jsWrapper, sourceString]; - [self.inAppBrowserViewController.webView stringByEvaluatingJavaScriptFromString:jsToInject]; - } - } else { - [self.inAppBrowserViewController.webView stringByEvaluatingJavaScriptFromString:source]; - } -} - -- (void)injectScriptCode:(CDVInvokedUrlCommand*)command -{ - NSString* jsWrapper = nil; - - if ((command.callbackId != nil) && ![command.callbackId isEqualToString:@"INVALID"]) { - jsWrapper = [NSString stringWithFormat:@"_cdvIframeBridge.src='gap-iab://%@/'+window.escape(JSON.stringify([eval(%%@)]));", command.callbackId]; - } - [self injectDeferredObject:[command argumentAtIndex:0] withWrapper:jsWrapper]; -} - -- (void)injectScriptFile:(CDVInvokedUrlCommand*)command -{ - NSString* jsWrapper; - - if ((command.callbackId != nil) && ![command.callbackId isEqualToString:@"INVALID"]) { - jsWrapper = [NSString stringWithFormat:@"(function(d) { var c = d.createElement('script'); c.src = %%@; c.onload = function() { _cdvIframeBridge.src='gap-iab://%@'; }; d.body.appendChild(c); })(document)", command.callbackId]; - } else { - jsWrapper = @"(function(d) { var c = d.createElement('script'); c.src = %@; d.body.appendChild(c); })(document)"; - } - [self injectDeferredObject:[command argumentAtIndex:0] withWrapper:jsWrapper]; -} - -- (void)injectStyleCode:(CDVInvokedUrlCommand*)command -{ - NSString* jsWrapper; - - if ((command.callbackId != nil) && ![command.callbackId isEqualToString:@"INVALID"]) { - jsWrapper = [NSString stringWithFormat:@"(function(d) { var c = d.createElement('style'); c.innerHTML = %%@; c.onload = function() { _cdvIframeBridge.src='gap-iab://%@'; }; d.body.appendChild(c); })(document)", command.callbackId]; - } else { - jsWrapper = @"(function(d) { var c = d.createElement('style'); c.innerHTML = %@; d.body.appendChild(c); })(document)"; - } - [self injectDeferredObject:[command argumentAtIndex:0] withWrapper:jsWrapper]; -} - -- (void)injectStyleFile:(CDVInvokedUrlCommand*)command -{ - NSString* jsWrapper; - - if ((command.callbackId != nil) && ![command.callbackId isEqualToString:@"INVALID"]) { - jsWrapper = [NSString stringWithFormat:@"(function(d) { var c = d.createElement('link'); c.rel='stylesheet'; c.type='text/css'; c.href = %%@; c.onload = function() { _cdvIframeBridge.src='gap-iab://%@'; }; d.body.appendChild(c); })(document)", command.callbackId]; - } else { - jsWrapper = @"(function(d) { var c = d.createElement('link'); c.rel='stylesheet', c.type='text/css'; c.href = %@; d.body.appendChild(c); })(document)"; - } - [self injectDeferredObject:[command argumentAtIndex:0] withWrapper:jsWrapper]; -} - -/** - * The iframe bridge provided for the InAppBrowser is capable of executing any oustanding callback belonging - * to the InAppBrowser plugin. Care has been taken that other callbacks cannot be triggered, and that no - * other code execution is possible. - * - * To trigger the bridge, the iframe (or any other resource) should attempt to load a url of the form: - * - * gap-iab:/// - * - * where is the string id of the callback to trigger (something like "InAppBrowser0123456789") - * - * If present, the path component of the special gap-iab:// url is expected to be a URL-escaped JSON-encoded - * value to pass to the callback. [NSURL path] should take care of the URL-unescaping, and a JSON_EXCEPTION - * is returned if the JSON is invalid. - */ -- (BOOL)webView:(UIWebView*)theWebView shouldStartLoadWithRequest:(NSURLRequest*)request navigationType:(UIWebViewNavigationType)navigationType -{ - NSURL* url = request.URL; - BOOL isTopLevelNavigation = [request.URL isEqual:[request mainDocumentURL]]; - - // See if the url uses the 'gap-iab' protocol. If so, the host should be the id of a callback to execute, - // and the path, if present, should be a JSON-encoded value to pass to the callback. - if ([[url scheme] isEqualToString:@"gap-iab"]) { - NSString* scriptCallbackId = [url host]; - CDVPluginResult* pluginResult = nil; - - if ([scriptCallbackId hasPrefix:@"InAppBrowser"]) { - NSString* scriptResult = [url path]; - NSError* __autoreleasing error = nil; - - // The message should be a JSON-encoded array of the result of the script which executed. - if ((scriptResult != nil) && ([scriptResult length] > 1)) { - scriptResult = [scriptResult substringFromIndex:1]; - NSData* decodedResult = [NSJSONSerialization JSONObjectWithData:[scriptResult dataUsingEncoding:NSUTF8StringEncoding] options:kNilOptions error:&error]; - if ((error == nil) && [decodedResult isKindOfClass:[NSArray class]]) { - pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsArray:(NSArray*)decodedResult]; - } else { - pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_JSON_EXCEPTION]; - } - } else { - pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsArray:@[]]; - } - [self.commandDelegate sendPluginResult:pluginResult callbackId:scriptCallbackId]; - return NO; - } - } else if ((self.callbackId != nil) && isTopLevelNavigation) { - // Send a loadstart event for each top-level navigation (includes redirects). - CDVPluginResult* pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK - messageAsDictionary:@{@"type":@"loadstart", @"url":[url absoluteString]}]; - [pluginResult setKeepCallback:[NSNumber numberWithBool:YES]]; - - [self.commandDelegate sendPluginResult:pluginResult callbackId:self.callbackId]; - } - - return YES; -} - -- (void)webViewDidStartLoad:(UIWebView*)theWebView -{ - _injectedIframeBridge = NO; -} - -- (void)webViewDidFinishLoad:(UIWebView*)theWebView -{ - if (self.callbackId != nil) { - // TODO: It would be more useful to return the URL the page is actually on (e.g. if it's been redirected). - NSString* url = [self.inAppBrowserViewController.currentURL absoluteString]; - CDVPluginResult* pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK - messageAsDictionary:@{@"type":@"loadstop", @"url":url}]; - [pluginResult setKeepCallback:[NSNumber numberWithBool:YES]]; - - [self.commandDelegate sendPluginResult:pluginResult callbackId:self.callbackId]; - } -} - -- (void)webView:(UIWebView*)theWebView didFailLoadWithError:(NSError*)error -{ - if (self.callbackId != nil) { - NSString* url = [self.inAppBrowserViewController.currentURL absoluteString]; - CDVPluginResult* pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_ERROR - messageAsDictionary:@{@"type":@"loaderror", @"url":url, @"code": [NSNumber numberWithInt:error.code], @"message": error.localizedDescription}]; - [pluginResult setKeepCallback:[NSNumber numberWithBool:YES]]; - - [self.commandDelegate sendPluginResult:pluginResult callbackId:self.callbackId]; - } -} - -- (void)browserExit -{ - if (self.callbackId != nil) { - CDVPluginResult* pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK - messageAsDictionary:@{@"type":@"exit"}]; - [pluginResult setKeepCallback:[NSNumber numberWithBool:YES]]; - - [self.commandDelegate sendPluginResult:pluginResult callbackId:self.callbackId]; - } - // Don't recycle the ViewController since it may be consuming a lot of memory. - // Also - this is required for the PDF/User-Agent bug work-around. - self.inAppBrowserViewController = nil; -} - -@end - -#pragma mark CDVInAppBrowserViewController - -@implementation CDVInAppBrowserViewController - -@synthesize currentURL; - -- (id)initWithUserAgent:(NSString*)userAgent prevUserAgent:(NSString*)prevUserAgent -{ - self = [super init]; - if (self != nil) { - _userAgent = userAgent; - _prevUserAgent = prevUserAgent; - _webViewDelegate = [[CDVWebViewDelegate alloc] initWithDelegate:self]; - [self createViews]; - } - - return self; -} - -- (void)createViews -{ - // We create the views in code for primarily for ease of upgrades and not requiring an external .xib to be included - - CGRect webViewBounds = self.view.bounds; - - webViewBounds.size.height -= FOOTER_HEIGHT; - - self.webView = [[UIWebView alloc] initWithFrame:webViewBounds]; - self.webView.autoresizingMask = (UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight); - - [self.view addSubview:self.webView]; - [self.view sendSubviewToBack:self.webView]; - - self.webView.delegate = _webViewDelegate; - self.webView.backgroundColor = [UIColor whiteColor]; - - self.webView.clearsContextBeforeDrawing = YES; - self.webView.clipsToBounds = YES; - self.webView.contentMode = UIViewContentModeScaleToFill; - self.webView.contentStretch = CGRectFromString(@"{{0, 0}, {1, 1}}"); - self.webView.multipleTouchEnabled = YES; - self.webView.opaque = YES; - self.webView.scalesPageToFit = NO; - self.webView.userInteractionEnabled = YES; - - self.spinner = [[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleWhite]; - self.spinner.alpha = 1.000; - self.spinner.autoresizesSubviews = YES; - self.spinner.autoresizingMask = UIViewAutoresizingFlexibleLeftMargin | UIViewAutoresizingFlexibleTopMargin; - self.spinner.clearsContextBeforeDrawing = NO; - self.spinner.clipsToBounds = NO; - self.spinner.contentMode = UIViewContentModeScaleToFill; - self.spinner.contentStretch = CGRectFromString(@"{{0, 0}, {1, 1}}"); - self.spinner.frame = CGRectMake(454.0, 231.0, 20.0, 20.0); - self.spinner.hidden = YES; - self.spinner.hidesWhenStopped = YES; - self.spinner.multipleTouchEnabled = NO; - self.spinner.opaque = NO; - self.spinner.userInteractionEnabled = NO; - [self.spinner stopAnimating]; - - self.closeButton = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemDone target:self action:@selector(close)]; - self.closeButton.enabled = YES; - - UIBarButtonItem* flexibleSpaceButton = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemFlexibleSpace target:nil action:nil]; - - UIBarButtonItem* fixedSpaceButton = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemFixedSpace target:nil action:nil]; - fixedSpaceButton.width = 20; - - self.toolbar = [[UIToolbar alloc] initWithFrame:CGRectMake(0.0, (self.view.bounds.size.height - TOOLBAR_HEIGHT), self.view.bounds.size.width, TOOLBAR_HEIGHT)]; - self.toolbar.alpha = 1.000; - self.toolbar.autoresizesSubviews = YES; - self.toolbar.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleTopMargin; - self.toolbar.barStyle = UIBarStyleBlackOpaque; - self.toolbar.clearsContextBeforeDrawing = NO; - self.toolbar.clipsToBounds = NO; - self.toolbar.contentMode = UIViewContentModeScaleToFill; - self.toolbar.contentStretch = CGRectFromString(@"{{0, 0}, {1, 1}}"); - self.toolbar.hidden = NO; - self.toolbar.multipleTouchEnabled = NO; - self.toolbar.opaque = NO; - self.toolbar.userInteractionEnabled = YES; - - CGFloat labelInset = 5.0; - self.addressLabel = [[UILabel alloc] initWithFrame:CGRectMake(labelInset, (self.view.bounds.size.height - FOOTER_HEIGHT), self.view.bounds.size.width - labelInset, LOCATIONBAR_HEIGHT)]; - self.addressLabel.adjustsFontSizeToFitWidth = NO; - self.addressLabel.alpha = 1.000; - self.addressLabel.autoresizesSubviews = YES; - self.addressLabel.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleRightMargin | UIViewAutoresizingFlexibleTopMargin; - self.addressLabel.backgroundColor = [UIColor clearColor]; - self.addressLabel.baselineAdjustment = UIBaselineAdjustmentAlignCenters; - self.addressLabel.clearsContextBeforeDrawing = YES; - self.addressLabel.clipsToBounds = YES; - self.addressLabel.contentMode = UIViewContentModeScaleToFill; - self.addressLabel.contentStretch = CGRectFromString(@"{{0, 0}, {1, 1}}"); - self.addressLabel.enabled = YES; - self.addressLabel.hidden = NO; - self.addressLabel.lineBreakMode = UILineBreakModeTailTruncation; - self.addressLabel.minimumFontSize = 10.000; - self.addressLabel.multipleTouchEnabled = NO; - self.addressLabel.numberOfLines = 1; - self.addressLabel.opaque = NO; - self.addressLabel.shadowOffset = CGSizeMake(0.0, -1.0); - self.addressLabel.text = @"Loading..."; - self.addressLabel.textAlignment = UITextAlignmentLeft; - self.addressLabel.textColor = [UIColor colorWithWhite:1.000 alpha:1.000]; - self.addressLabel.userInteractionEnabled = NO; - - NSString* frontArrowString = @"►"; // create arrow from Unicode char - self.forwardButton = [[UIBarButtonItem alloc] initWithTitle:frontArrowString style:UIBarButtonItemStylePlain target:self action:@selector(goForward:)]; - self.forwardButton.enabled = YES; - self.forwardButton.imageInsets = UIEdgeInsetsZero; - - NSString* backArrowString = @"◄"; // create arrow from Unicode char - self.backButton = [[UIBarButtonItem alloc] initWithTitle:backArrowString style:UIBarButtonItemStylePlain target:self action:@selector(goBack:)]; - self.backButton.enabled = YES; - self.backButton.imageInsets = UIEdgeInsetsZero; - - [self.toolbar setItems:@[self.closeButton, flexibleSpaceButton, self.backButton, fixedSpaceButton, self.forwardButton]]; - - self.view.backgroundColor = [UIColor grayColor]; - [self.view addSubview:self.toolbar]; - [self.view addSubview:self.addressLabel]; - [self.view addSubview:self.spinner]; -} - -- (void)setCloseButtonTitle:(NSString*)title -{ - // the advantage of using UIBarButtonSystemItemDone is the system will localize it for you automatically - // but, if you want to set this yourself, knock yourself out (we can't set the title for a system Done button, so we have to create a new one) - self.closeButton = nil; - self.closeButton = [[UIBarButtonItem alloc] initWithTitle:title style:UIBarButtonItemStyleBordered target:self action:@selector(close)]; - self.closeButton.enabled = YES; - self.closeButton.tintColor = [UIColor colorWithRed:60.0 / 255.0 green:136.0 / 255.0 blue:230.0 / 255.0 alpha:1]; - - NSMutableArray* items = [self.toolbar.items mutableCopy]; - [items replaceObjectAtIndex:0 withObject:self.closeButton]; - [self.toolbar setItems:items]; -} - -- (void)showLocationBar:(BOOL)show -{ - CGRect locationbarFrame = self.addressLabel.frame; - - BOOL toolbarVisible = !self.toolbar.hidden; - - // prevent double show/hide - if (show == !(self.addressLabel.hidden)) { - return; - } - - if (show) { - self.addressLabel.hidden = NO; - - if (toolbarVisible) { - // toolBar at the bottom, leave as is - // put locationBar on top of the toolBar - - CGRect webViewBounds = self.view.bounds; - webViewBounds.size.height -= FOOTER_HEIGHT; - self.webView.frame = webViewBounds; - - locationbarFrame.origin.y = webViewBounds.size.height; - self.addressLabel.frame = locationbarFrame; - } else { - // no toolBar, so put locationBar at the bottom - - CGRect webViewBounds = self.view.bounds; - webViewBounds.size.height -= LOCATIONBAR_HEIGHT; - self.webView.frame = webViewBounds; - - locationbarFrame.origin.y = webViewBounds.size.height; - self.addressLabel.frame = locationbarFrame; - } - } else { - self.addressLabel.hidden = YES; - - if (toolbarVisible) { - // locationBar is on top of toolBar, hide locationBar - - // webView take up whole height less toolBar height - CGRect webViewBounds = self.view.bounds; - webViewBounds.size.height -= TOOLBAR_HEIGHT; - self.webView.frame = webViewBounds; - } else { - // no toolBar, expand webView to screen dimensions - - CGRect webViewBounds = self.view.bounds; - self.webView.frame = webViewBounds; - } - } -} - -- (void)showToolBar:(BOOL)show -{ - CGRect toolbarFrame = self.toolbar.frame; - CGRect locationbarFrame = self.addressLabel.frame; - - BOOL locationbarVisible = !self.addressLabel.hidden; - - // prevent double show/hide - if (show == !(self.toolbar.hidden)) { - return; - } - - if (show) { - self.toolbar.hidden = NO; - - if (locationbarVisible) { - // locationBar at the bottom, move locationBar up - // put toolBar at the bottom - - CGRect webViewBounds = self.view.bounds; - webViewBounds.size.height -= FOOTER_HEIGHT; - self.webView.frame = webViewBounds; - - locationbarFrame.origin.y = webViewBounds.size.height; - self.addressLabel.frame = locationbarFrame; - - toolbarFrame.origin.y = (webViewBounds.size.height + LOCATIONBAR_HEIGHT); - self.toolbar.frame = toolbarFrame; - } else { - // no locationBar, so put toolBar at the bottom - - CGRect webViewBounds = self.view.bounds; - webViewBounds.size.height -= TOOLBAR_HEIGHT; - self.webView.frame = webViewBounds; - - toolbarFrame.origin.y = webViewBounds.size.height; - self.toolbar.frame = toolbarFrame; - } - } else { - self.toolbar.hidden = YES; - - if (locationbarVisible) { - // locationBar is on top of toolBar, hide toolBar - // put locationBar at the bottom - - // webView take up whole height less locationBar height - CGRect webViewBounds = self.view.bounds; - webViewBounds.size.height -= LOCATIONBAR_HEIGHT; - self.webView.frame = webViewBounds; - - // move locationBar down - locationbarFrame.origin.y = webViewBounds.size.height; - self.addressLabel.frame = locationbarFrame; - } else { - // no locationBar, expand webView to screen dimensions - - CGRect webViewBounds = self.view.bounds; - self.webView.frame = webViewBounds; - } - } -} - -- (void)viewDidLoad -{ - [super viewDidLoad]; -} - -- (void)viewDidUnload -{ - [self.webView loadHTMLString:nil baseURL:nil]; - [CDVUserAgentUtil releaseLock:&_userAgentLockToken]; - [super viewDidUnload]; -} - -- (void)close -{ - [CDVUserAgentUtil releaseLock:&_userAgentLockToken]; - - if ([self respondsToSelector:@selector(presentingViewController)]) { - [[self presentingViewController] dismissViewControllerAnimated:YES completion:nil]; - } else { - [[self parentViewController] dismissModalViewControllerAnimated:YES]; - } - - self.currentURL = nil; - - if ((self.navigationDelegate != nil) && [self.navigationDelegate respondsToSelector:@selector(browserExit)]) { - [self.navigationDelegate browserExit]; - } -} - -- (void)navigateTo:(NSURL*)url -{ - NSURLRequest* request = [NSURLRequest requestWithURL:url]; - - if (_userAgentLockToken != 0) { - [self.webView loadRequest:request]; - } else { - [CDVUserAgentUtil acquireLock:^(NSInteger lockToken) { - _userAgentLockToken = lockToken; - [CDVUserAgentUtil setUserAgent:_userAgent lockToken:lockToken]; - [self.webView loadRequest:request]; - }]; - } -} - -- (void)goBack:(id)sender -{ - [self.webView goBack]; -} - -- (void)goForward:(id)sender -{ - [self.webView goForward]; -} - -#pragma mark UIWebViewDelegate - -- (void)webViewDidStartLoad:(UIWebView*)theWebView -{ - // loading url, start spinner, update back/forward - - self.addressLabel.text = @"Loading..."; - self.backButton.enabled = theWebView.canGoBack; - self.forwardButton.enabled = theWebView.canGoForward; - - [self.spinner startAnimating]; - - return [self.navigationDelegate webViewDidStartLoad:theWebView]; -} - -- (BOOL)webView:(UIWebView*)theWebView shouldStartLoadWithRequest:(NSURLRequest*)request navigationType:(UIWebViewNavigationType)navigationType -{ - BOOL isTopLevelNavigation = [request.URL isEqual:[request mainDocumentURL]]; - - if (isTopLevelNavigation) { - self.currentURL = request.URL; - } - return [self.navigationDelegate webView:theWebView shouldStartLoadWithRequest:request navigationType:navigationType]; -} - -- (void)webViewDidFinishLoad:(UIWebView*)theWebView -{ - // update url, stop spinner, update back/forward - - self.addressLabel.text = [self.currentURL absoluteString]; - self.backButton.enabled = theWebView.canGoBack; - self.forwardButton.enabled = theWebView.canGoForward; - - [self.spinner stopAnimating]; - - // Work around a bug where the first time a PDF is opened, all UIWebViews - // reload their User-Agent from NSUserDefaults. - // This work-around makes the following assumptions: - // 1. The app has only a single Cordova Webview. If not, then the app should - // take it upon themselves to load a PDF in the background as a part of - // their start-up flow. - // 2. That the PDF does not require any additional network requests. We change - // the user-agent here back to that of the CDVViewController, so requests - // from it must pass through its white-list. This *does* break PDFs that - // contain links to other remote PDF/websites. - // More info at https://issues.apache.org/jira/browse/CB-2225 - BOOL isPDF = [@"true" isEqualToString :[theWebView stringByEvaluatingJavaScriptFromString:@"document.body==null"]]; - if (isPDF) { - [CDVUserAgentUtil setUserAgent:_prevUserAgent lockToken:_userAgentLockToken]; - } - - [self.navigationDelegate webViewDidFinishLoad:theWebView]; -} - -- (void)webView:(UIWebView*)theWebView didFailLoadWithError:(NSError*)error -{ - // log fail message, stop spinner, update back/forward - NSLog(@"webView:didFailLoadWithError - %@", [error localizedDescription]); - - self.backButton.enabled = theWebView.canGoBack; - self.forwardButton.enabled = theWebView.canGoForward; - [self.spinner stopAnimating]; - - self.addressLabel.text = @"Load Error"; - - [self.navigationDelegate webView:theWebView didFailLoadWithError:error]; -} - -#pragma mark CDVScreenOrientationDelegate - -- (BOOL)shouldAutorotate -{ - if ((self.orientationDelegate != nil) && [self.orientationDelegate respondsToSelector:@selector(shouldAutorotate)]) { - return [self.orientationDelegate shouldAutorotate]; - } - return YES; -} - -- (NSUInteger)supportedInterfaceOrientations -{ - if ((self.orientationDelegate != nil) && [self.orientationDelegate respondsToSelector:@selector(supportedInterfaceOrientations)]) { - return [self.orientationDelegate supportedInterfaceOrientations]; - } - - return 1 << UIInterfaceOrientationPortrait; -} - -- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation -{ - if ((self.orientationDelegate != nil) && [self.orientationDelegate respondsToSelector:@selector(shouldAutorotateToInterfaceOrientation:)]) { - return [self.orientationDelegate shouldAutorotateToInterfaceOrientation:interfaceOrientation]; - } - - return YES; -} - -@end - -@implementation CDVInAppBrowserOptions - -- (id)init -{ - if (self = [super init]) { - // default values - self.location = YES; - self.toolbar = YES; - self.closebuttoncaption = nil; - - self.enableviewportscale = NO; - self.mediaplaybackrequiresuseraction = NO; - self.allowinlinemediaplayback = NO; - self.keyboarddisplayrequiresuseraction = YES; - self.suppressesincrementalrendering = NO; - self.hidden = NO; - } - - return self; -} - -+ (CDVInAppBrowserOptions*)parseOptions:(NSString*)options -{ - CDVInAppBrowserOptions* obj = [[CDVInAppBrowserOptions alloc] init]; - - // NOTE: this parsing does not handle quotes within values - NSArray* pairs = [options componentsSeparatedByString:@","]; - - // parse keys and values, set the properties - for (NSString* pair in pairs) { - NSArray* keyvalue = [pair componentsSeparatedByString:@"="]; - - if ([keyvalue count] == 2) { - NSString* key = [[keyvalue objectAtIndex:0] lowercaseString]; - NSString* value = [keyvalue objectAtIndex:1]; - NSString* value_lc = [value lowercaseString]; - - BOOL isBoolean = [value_lc isEqualToString:@"yes"] || [value_lc isEqualToString:@"no"]; - NSNumberFormatter* numberFormatter = [[NSNumberFormatter alloc] init]; - [numberFormatter setAllowsFloats:YES]; - BOOL isNumber = [numberFormatter numberFromString:value_lc] != nil; - - // set the property according to the key name - if ([obj respondsToSelector:NSSelectorFromString(key)]) { - if (isNumber) { - [obj setValue:[numberFormatter numberFromString:value_lc] forKey:key]; - } else if (isBoolean) { - [obj setValue:[NSNumber numberWithBool:[value_lc isEqualToString:@"yes"]] forKey:key]; - } else { - [obj setValue:value forKey:key]; - } - } - } - } - - return obj; -} - -@end diff --git a/plugins/org.apache.cordova.core.inappbrowser/src/wp/InAppBrowser.cs b/plugins/org.apache.cordova.core.inappbrowser/src/wp/InAppBrowser.cs deleted file mode 100644 index 46e1384..0000000 --- a/plugins/org.apache.cordova.core.inappbrowser/src/wp/InAppBrowser.cs +++ /dev/null @@ -1,277 +0,0 @@ -using System; -using System.Net; -using System.Windows; -using System.Windows.Controls; -using System.Windows.Documents; -using System.Windows.Ink; -using System.Windows.Input; -using System.Windows.Media; -using System.Windows.Media.Animation; -using System.Windows.Shapes; -using Microsoft.Phone.Controls; -using System.Diagnostics; -using System.Runtime.Serialization; -using WPCordovaClassLib.Cordova; -using WPCordovaClassLib.Cordova.Commands; -using WPCordovaClassLib.Cordova.JSON; -using Microsoft.Phone.Shell; -using Microsoft.Phone.Tasks; - -namespace WPCordovaClassLib.Cordova.Commands -{ - [DataContract] - public class BrowserOptions - { - [DataMember] - public string url; - - [DataMember] - public bool isGeolocationEnabled; - } - - public class InAppBrowser : BaseCommand - { - - private static WebBrowser browser; - private static ApplicationBarIconButton backButton; - private static ApplicationBarIconButton fwdButton; - - public void open(string options) - { - string[] args = JSON.JsonHelper.Deserialize(options); - //BrowserOptions opts = JSON.JsonHelper.Deserialize(options); - string urlLoc = args[0]; - string target = args[1]; - /* - _self - opens in the Cordova WebView if url is in the white-list, else it opens in the InAppBrowser - _blank - always open in the InAppBrowser - _system - always open in the system web browser - */ - switch (target) - { - case "_blank": - ShowInAppBrowser(urlLoc); - break; - case "_self": - ShowCordovaBrowser(urlLoc); - break; - case "_system": - ShowSystemBrowser(urlLoc); - break; - } - - - } - - private void ShowCordovaBrowser(string url) - { - Uri loc = new Uri(url, UriKind.RelativeOrAbsolute); - Deployment.Current.Dispatcher.BeginInvoke(() => - { - PhoneApplicationFrame frame = Application.Current.RootVisual as PhoneApplicationFrame; - if (frame != null) - { - PhoneApplicationPage page = frame.Content as PhoneApplicationPage; - if (page != null) - { - CordovaView cView = page.FindName("CordovaView") as CordovaView; - if (cView != null) - { - WebBrowser br = cView.Browser; - br.Navigate(loc); - } - } - - } - }); - } - - private void ShowSystemBrowser(string url) - { - WebBrowserTask webBrowserTask = new WebBrowserTask(); - webBrowserTask.Uri = new Uri(url, UriKind.Absolute); - webBrowserTask.Show(); - } - - - private void ShowInAppBrowser(string url) - { - Uri loc = new Uri(url); - - Deployment.Current.Dispatcher.BeginInvoke(() => - { - if (browser != null) - { - //browser.IsGeolocationEnabled = opts.isGeolocationEnabled; - browser.Navigate(loc); - } - else - { - PhoneApplicationFrame frame = Application.Current.RootVisual as PhoneApplicationFrame; - if (frame != null) - { - PhoneApplicationPage page = frame.Content as PhoneApplicationPage; - - string baseImageUrl = "Images/"; - - if (page != null) - { - Grid grid = page.FindName("LayoutRoot") as Grid; - if (grid != null) - { - browser = new WebBrowser(); - browser.IsScriptEnabled = true; - browser.LoadCompleted += new System.Windows.Navigation.LoadCompletedEventHandler(browser_LoadCompleted); - - browser.Navigating += new EventHandler(browser_Navigating); - browser.NavigationFailed += new System.Windows.Navigation.NavigationFailedEventHandler(browser_NavigationFailed); - browser.Navigated += new EventHandler(browser_Navigated); - browser.Navigate(loc); - //browser.IsGeolocationEnabled = opts.isGeolocationEnabled; - grid.Children.Add(browser); - } - - ApplicationBar bar = new ApplicationBar(); - bar.BackgroundColor = Colors.Gray; - bar.IsMenuEnabled = false; - - backButton = new ApplicationBarIconButton(); - backButton.Text = "Back"; - - backButton.IconUri = new Uri(baseImageUrl + "appbar.back.rest.png", UriKind.Relative); - backButton.Click += new EventHandler(backButton_Click); - bar.Buttons.Add(backButton); - - - fwdButton = new ApplicationBarIconButton(); - fwdButton.Text = "Forward"; - fwdButton.IconUri = new Uri(baseImageUrl + "appbar.next.rest.png", UriKind.Relative); - fwdButton.Click += new EventHandler(fwdButton_Click); - bar.Buttons.Add(fwdButton); - - ApplicationBarIconButton closeBtn = new ApplicationBarIconButton(); - closeBtn.Text = "Close"; - closeBtn.IconUri = new Uri(baseImageUrl + "appbar.close.rest.png", UriKind.Relative); - closeBtn.Click += new EventHandler(closeBtn_Click); - bar.Buttons.Add(closeBtn); - - page.ApplicationBar = bar; - } - - } - } - }); - } - - void browser_LoadCompleted(object sender, System.Windows.Navigation.NavigationEventArgs e) - { - - } - - void fwdButton_Click(object sender, EventArgs e) - { - if (browser != null) - { - try - { -#if WP8 - browser.GoForward(); -#else - browser.InvokeScript("execScript", "history.forward();"); -#endif - } - catch (Exception) - { - - } - } - } - - void backButton_Click(object sender, EventArgs e) - { - if (browser != null) - { - try - { -#if WP8 - browser.GoBack(); -#else - browser.InvokeScript("execScript", "history.back();"); -#endif - } - catch (Exception) - { - - } - } - } - - void closeBtn_Click(object sender, EventArgs e) - { - this.close(); - } - - - public void close(string options = "") - { - if (browser != null) - { - Deployment.Current.Dispatcher.BeginInvoke(() => - { - PhoneApplicationFrame frame = Application.Current.RootVisual as PhoneApplicationFrame; - if (frame != null) - { - PhoneApplicationPage page = frame.Content as PhoneApplicationPage; - if (page != null) - { - Grid grid = page.FindName("LayoutRoot") as Grid; - if (grid != null) - { - grid.Children.Remove(browser); - } - page.ApplicationBar = null; - } - } - browser = null; - string message = "{\"type\":\"exit\"}"; - PluginResult result = new PluginResult(PluginResult.Status.OK, message); - result.KeepCallback = false; - this.DispatchCommandResult(result); - }); - } - } - - void browser_Navigated(object sender, System.Windows.Navigation.NavigationEventArgs e) - { -#if WP8 - if (browser != null) - { - backButton.IsEnabled = browser.CanGoBack; - fwdButton.IsEnabled = browser.CanGoForward; - - } -#endif - string message = "{\"type\":\"loadstop\", \"url\":\"" + e.Uri.AbsoluteUri + "\"}"; - PluginResult result = new PluginResult(PluginResult.Status.OK, message); - result.KeepCallback = true; - this.DispatchCommandResult(result); - } - - void browser_NavigationFailed(object sender, System.Windows.Navigation.NavigationFailedEventArgs e) - { - string message = "{\"type\":\"error\",\"url\":\"" + e.Uri.AbsoluteUri + "\"}"; - PluginResult result = new PluginResult(PluginResult.Status.ERROR, message); - result.KeepCallback = true; - this.DispatchCommandResult(result); - } - - void browser_Navigating(object sender, NavigatingEventArgs e) - { - string message = "{\"type\":\"loadstart\",\"url\":\"" + e.Uri.AbsoluteUri + "\"}"; - PluginResult result = new PluginResult(PluginResult.Status.OK, message); - result.KeepCallback = true; - this.DispatchCommandResult(result); - } - - } -} diff --git a/plugins/org.apache.cordova.core.inappbrowser/test/cordova-incl.js b/plugins/org.apache.cordova.core.inappbrowser/test/cordova-incl.js deleted file mode 100644 index dbcd1a6..0000000 --- a/plugins/org.apache.cordova.core.inappbrowser/test/cordova-incl.js +++ /dev/null @@ -1,70 +0,0 @@ -/* - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - * -*/ - -var PLAT; -if (/Android/.exec(navigator.userAgent)) { - PLAT = 'android'; -} else if (/(iPad)|(iPhone)|(iPod)/.exec(navigator.userAgent)) { - PLAT = 'ios'; -} else if (/(BB10)|(PlayBook)|(BlackBerry)/.exec(navigator.userAgent)) { - PLAT = 'blackberry'; -} - -var scripts = document.getElementsByTagName('script'); -var currentPath = scripts[scripts.length - 1].src; -var platformCordovaPath = currentPath.replace("cordova-incl.js", "cordova." + PLAT + ".js"); -var normalCordovaPath = currentPath.replace("cordova-incl.js", "cordova.js"); -var cordovaPath = normalCordovaPath; - -if (PLAT) { - // XHR to local file is an error on some platforms, windowsphone for one - try { - var xhr = new XMLHttpRequest(); - xhr.open("GET", platformCordovaPath, false); - xhr.onreadystatechange = function() { - - if (this.readyState == this.DONE && this.responseText.length > 0) { - if(parseInt(this.status) >= 400){ - cordovaPath = normalCordovaPath; - }else{ - cordovaPath = platformCordovaPath; - } - } - }; - xhr.send(null); - } - catch(e){ - cordovaPath = normalCordovaPath; - } // access denied! -} - -if (!window._doNotWriteCordovaScript) { - document.write(''); -} - -function backHome() { - if (window.device && device.platform && device.platform.toLowerCase() == 'android') { - navigator.app.backHistory(); - } - else { - window.history.go(-1); - } -} diff --git a/plugins/org.apache.cordova.core.inappbrowser/test/inappbrowser/index.html b/plugins/org.apache.cordova.core.inappbrowser/test/inappbrowser/index.html deleted file mode 100644 index dbc094d..0000000 --- a/plugins/org.apache.cordova.core.inappbrowser/test/inappbrowser/index.html +++ /dev/null @@ -1,258 +0,0 @@ - - - - - - - - - Cordova Mobile Spec - - - - - - - - -

InAppBrowser

-
- Make sure http://www.google.com is white listed.
- Make sure http://www.apple.com is not in the white list.
In iOS, starred * tests will leave the app with no way to return.
-

User-Agent:

-
-
Back
-

Local URL

-
Default: CordovaWebView
-
Target=Self: CordovaWebView
-
Target=System: Error
-
Target=Blank: InAppBrowser
-
Target=Random: InAppBrowser
-
Target=Random, no location bar: InAppBrowser
-

White Listed URL

-
Default: CordovaWebView*
-
Target=Self: CordovaWebView*
-
Target=System: System Browser
-
Target=Blank: InAppBrowser
-
Target=Random: InAppBrowser
-
Target=Random, no location bar: InAppBrowser
-

Non White Listed URL

-
Default: InAppBrowser
-
Target=Self: InAppBrowser
-
Target=System: System
-
Target=Blank: InAppBrowser
-
Target=Random: InAppBrowser
-
Target=Random, no location bar: InAppBrowser
-

Page with redirect

-
http://google.com (should 301)
-
http://www.zhihu.com/answer/16714076 (should 302)
-

PDF URL

-
Remote URL
-
Local URL
-

INVALID URL

-
Invalid Scheme
-
Invalid Host
-
Missing File
-

CSS / JS Injection

-
Original Document
-
CSS File Injection
-
CSS File Injection (CB)
-
CSS Literal Injection
-
CSS Literal Injection (CB)
-
Script File Injection
-
Script File Injection (CB)
-
Script Literal Injection
-
Script Literal Injection (CB)
-

Open Hidden

-
google.com hidden
-
show hidden
-
close hidden
-
google.com not hidden
-

Back
- - diff --git a/plugins/org.apache.cordova.core.inappbrowser/test/inappbrowser/inject.css b/plugins/org.apache.cordova.core.inappbrowser/test/inappbrowser/inject.css deleted file mode 100644 index 3f6e41c..0000000 --- a/plugins/org.apache.cordova.core.inappbrowser/test/inappbrowser/inject.css +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. -*/ -#style-update-file { - display: block !important; -} diff --git a/plugins/org.apache.cordova.core.inappbrowser/test/inappbrowser/inject.html b/plugins/org.apache.cordova.core.inappbrowser/test/inappbrowser/inject.html deleted file mode 100644 index 0f1efdd..0000000 --- a/plugins/org.apache.cordova.core.inappbrowser/test/inappbrowser/inject.html +++ /dev/null @@ -1,43 +0,0 @@ - - - - - - - - - Cordova Mobile Spec - - - -

InAppBrowser - Script / Style Injection Test

- - - - - diff --git a/plugins/org.apache.cordova.core.inappbrowser/test/inappbrowser/inject.js b/plugins/org.apache.cordova.core.inappbrowser/test/inappbrowser/inject.js deleted file mode 100644 index 6f25493..0000000 --- a/plugins/org.apache.cordova.core.inappbrowser/test/inappbrowser/inject.js +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. -*/ -var d = document.getElementById("header") -d.innerHTML = "Script file successfully injected"; diff --git a/plugins/org.apache.cordova.core.inappbrowser/test/inappbrowser/local.html b/plugins/org.apache.cordova.core.inappbrowser/test/inappbrowser/local.html deleted file mode 100644 index d5edbf9..0000000 --- a/plugins/org.apache.cordova.core.inappbrowser/test/inappbrowser/local.html +++ /dev/null @@ -1,51 +0,0 @@ - - - - - - - - - Cordova Mobile Spec - - - - -

InAppBrowser - Local URL

-
- You have successfully loaded a local URL -
-
User-Agent =
- - - - -

Back
- - - diff --git a/plugins/org.apache.cordova.core.inappbrowser/test/inappbrowser/local.pdf b/plugins/org.apache.cordova.core.inappbrowser/test/inappbrowser/local.pdf deleted file mode 100644 index b54f1b7..0000000 Binary files a/plugins/org.apache.cordova.core.inappbrowser/test/inappbrowser/local.pdf and /dev/null differ diff --git a/plugins/org.apache.cordova.core.inappbrowser/test/index.html b/plugins/org.apache.cordova.core.inappbrowser/test/index.html deleted file mode 100644 index 2c5447b..0000000 --- a/plugins/org.apache.cordova.core.inappbrowser/test/index.html +++ /dev/null @@ -1,65 +0,0 @@ - - - - - - - - - Cordova Mobile Spec - - - - - - -

Apache Cordova Tests

-
-

Platform:

-

Version:

-

UUID:

-

Name:

-

Model:

-

Width: , Height: - , Color Depth:

-

User-Agent:

-
- Automatic Test - Accelerometer - Audio Play/Record - Battery - Camera - Compass - Contacts - Events - Location - Lazy Loading of cordova-incl.js - Misc Content - Network - Notification - Splashscreen - Web SQL - Local Storage - Benchmarks - In App Browser - - diff --git a/plugins/org.apache.cordova.core.inappbrowser/test/main.js b/plugins/org.apache.cordova.core.inappbrowser/test/main.js deleted file mode 100644 index 66c1bd3..0000000 --- a/plugins/org.apache.cordova.core.inappbrowser/test/main.js +++ /dev/null @@ -1,163 +0,0 @@ -/* - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - * -*/ - -var deviceInfo = function() { - document.getElementById("platform").innerHTML = device.platform; - document.getElementById("version").innerHTML = device.version; - document.getElementById("uuid").innerHTML = device.uuid; - document.getElementById("name").innerHTML = device.name; - document.getElementById("model").innerHTML = device.model; - document.getElementById("width").innerHTML = screen.width; - document.getElementById("height").innerHTML = screen.height; - document.getElementById("colorDepth").innerHTML = screen.colorDepth; -}; - -var getLocation = function() { - var suc = function(p) { - alert(p.coords.latitude + " " + p.coords.longitude); - }; - var locFail = function() { - }; - navigator.geolocation.getCurrentPosition(suc, locFail); -}; - -var beep = function() { - navigator.notification.beep(2); -}; - -var vibrate = function() { - navigator.notification.vibrate(0); -}; - -function roundNumber(num) { - var dec = 3; - var result = Math.round(num * Math.pow(10, dec)) / Math.pow(10, dec); - return result; -} - -var accelerationWatch = null; - -function updateAcceleration(a) { - document.getElementById('x').innerHTML = roundNumber(a.x); - document.getElementById('y').innerHTML = roundNumber(a.y); - document.getElementById('z').innerHTML = roundNumber(a.z); -} - -var toggleAccel = function() { - if (accelerationWatch !== null) { - navigator.accelerometer.clearWatch(accelerationWatch); - updateAcceleration({ - x : "", - y : "", - z : "" - }); - accelerationWatch = null; - } else { - var options = {}; - options.frequency = 1000; - accelerationWatch = navigator.accelerometer.watchAcceleration( - updateAcceleration, function(ex) { - alert("accel fail (" + ex.name + ": " + ex.message + ")"); - }, options); - } -}; - -var preventBehavior = function(e) { - e.preventDefault(); -}; - -function dump_pic(data) { - var viewport = document.getElementById('viewport'); - console.log(data); - viewport.style.display = ""; - viewport.style.position = "absolute"; - viewport.style.top = "10px"; - viewport.style.left = "10px"; - document.getElementById("test_img").src = "data:image/jpeg;base64," + data; -} - -function fail(msg) { - alert(msg); -} - -function show_pic() { - navigator.camera.getPicture(dump_pic, fail, { - quality : 50 - }); -} - -function close() { - var viewport = document.getElementById('viewport'); - viewport.style.position = "relative"; - viewport.style.display = "none"; -} - -// This is just to do this. -function readFile() { - navigator.file.read('/sdcard/cordova.txt', fail, fail); -} - -function writeFile() { - navigator.file.write('foo.txt', "This is a test of writing to a file", - fail, fail); -} - -function contacts_success(contacts) { - alert(contacts.length - + ' contacts returned.' - + (contacts[2] && contacts[2].name ? (' Third contact is ' + contacts[2].name.formatted) - : '')); -} - -function get_contacts() { - var obj = new ContactFindOptions(); - obj.filter = ""; - obj.multiple = true; - obj.limit = 5; - navigator.service.contacts.find( - [ "displayName", "name" ], contacts_success, - fail, obj); -} - -var networkReachableCallback = function(reachability) { - // There is no consistency on the format of reachability - var networkState = reachability.code || reachability; - - var currentState = {}; - currentState[NetworkStatus.NOT_REACHABLE] = 'No network connection'; - currentState[NetworkStatus.REACHABLE_VIA_CARRIER_DATA_NETWORK] = 'Carrier data connection'; - currentState[NetworkStatus.REACHABLE_VIA_WIFI_NETWORK] = 'WiFi connection'; - - confirm("Connection type:\n" + currentState[networkState]); -}; - -function check_network() { - navigator.network.isReachable("www.mobiledevelopersolutions.com", - networkReachableCallback, {}); -} - -function init() { - // the next line makes it impossible to see Contacts on the HTC Evo since it - // doesn't have a scroll button - // document.addEventListener("touchmove", preventBehavior, false); - document.addEventListener("deviceready", deviceInfo, true); - document.getElementById("user-agent").textContent = navigator.userAgent; -} diff --git a/plugins/org.apache.cordova.core.inappbrowser/test/master.css b/plugins/org.apache.cordova.core.inappbrowser/test/master.css deleted file mode 100644 index e93c937..0000000 --- a/plugins/org.apache.cordova.core.inappbrowser/test/master.css +++ /dev/null @@ -1,164 +0,0 @@ -/* - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - * -*/ - - body { - background:#222 none repeat scroll 0 0; - color:#666; - font-family:Helvetica; - font-size:72%; - line-height:1.5em; - margin:0; - border-top:1px solid #393939; - } - - #info{ - background:#ffa; - border: 1px solid #ffd324; - -webkit-border-radius: 5px; - border-radius: 5px; - clear:both; - margin:15px 6px 0; - min-width:295px; - max-width:97%; - padding:4px 0px 2px 10px; - word-wrap:break-word; - margin-bottom:10px; - display:inline-block; - min-height: 160px; - max-height: 300px; - overflow: auto; - -webkit-overflow-scrolling: touch; - } - - #info > h4{ - font-size:.95em; - margin:5px 0; - } - - #stage.theme{ - padding-top:3px; - } - - /* Definition List */ - #stage.theme > dl{ - padding-top:10px; - clear:both; - margin:0; - list-style-type:none; - padding-left:10px; - overflow:auto; - } - - #stage.theme > dl > dt{ - font-weight:bold; - float:left; - margin-left:5px; - } - - #stage.theme > dl > dd{ - width:45px; - float:left; - color:#a87; - font-weight:bold; - } - - /* Content Styling */ - #stage.theme > h1, #stage.theme > h2, #stage.theme > p{ - margin:1em 0 .5em 13px; - } - - #stage.theme > h1{ - color:#eee; - font-size:1.6em; - text-align:center; - margin:0; - margin-top:15px; - padding:0; - } - - #stage.theme > h2{ - clear:both; - margin:0; - padding:3px; - font-size:1em; - text-align:center; - } - - /* Stage Buttons */ - #stage.theme .btn{ - border: 1px solid #555; - -webkit-border-radius: 5px; - border-radius: 5px; - text-align:center; - display:inline-block; - background:#444; - width:150px; - color:#9ab; - font-size:1.1em; - text-decoration:none; - padding:1.2em 0; - margin:3px 0px 3px 5px; - } - - #stage.theme .large{ - width:308px; - padding:1.2em 0; - } - - #stage.theme .wide{ - width:100%; - padding:1.2em 0; - } - - #stage.theme .backBtn{ - border: 1px solid #555; - -webkit-border-radius: 5px; - border-radius: 5px; - text-align:center; - display:block; - float:right; - background:#666; - width:75px; - color:#9ab; - font-size:1.1em; - text-decoration:none; - padding:1.2em 0; - margin:3px 5px 3px 5px; - } - - #stage.theme .input{ - border: 1px solid #555; - -webkit-border-radius: 5px; - border-radius: 5px; - text-align:center; - display:block; - float:light; - background:#888; - color:#9cd; - font-size:1.1em; - text-decoration:none; - padding:1.2em 0; - margin:3px 0px 3px 5px; - } - - #stage.theme .numeric{ - width:100%; - } diff --git a/plugins/org.apache.cordova.core.inappbrowser/www/InAppBrowser.js b/plugins/org.apache.cordova.core.inappbrowser/www/InAppBrowser.js deleted file mode 100644 index 5da53fd..0000000 --- a/plugins/org.apache.cordova.core.inappbrowser/www/InAppBrowser.js +++ /dev/null @@ -1,94 +0,0 @@ -/* - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - * -*/ - -var exec = require('cordova/exec'); -var channel = require('cordova/channel'); -var modulemapper = require('cordova/modulemapper'); - -function InAppBrowser() { - this.channels = { - 'loadstart': channel.create('loadstart'), - 'loadstop' : channel.create('loadstop'), - 'loaderror' : channel.create('loaderror'), - 'exit' : channel.create('exit') - }; -} - -InAppBrowser.prototype = { - _eventHandler: function (event) { - if (event.type in this.channels) { - this.channels[event.type].fire(event); - } - }, - close: function (eventname) { - exec(null, null, "InAppBrowser", "close", []); - }, - show: function (eventname) { - exec(null, null, "InAppBrowser", "show", []); - }, - addEventListener: function (eventname,f) { - if (eventname in this.channels) { - this.channels[eventname].subscribe(f); - } - }, - removeEventListener: function(eventname, f) { - if (eventname in this.channels) { - this.channels[eventname].unsubscribe(f); - } - }, - - executeScript: function(injectDetails, cb) { - if (injectDetails.code) { - exec(cb, null, "InAppBrowser", "injectScriptCode", [injectDetails.code, !!cb]); - } else if (injectDetails.file) { - exec(cb, null, "InAppBrowser", "injectScriptFile", [injectDetails.file, !!cb]); - } else { - throw new Error('executeScript requires exactly one of code or file to be specified'); - } - }, - - insertCSS: function(injectDetails, cb) { - if (injectDetails.code) { - exec(cb, null, "InAppBrowser", "injectStyleCode", [injectDetails.code, !!cb]); - } else if (injectDetails.file) { - exec(cb, null, "InAppBrowser", "injectStyleFile", [injectDetails.file, !!cb]); - } else { - throw new Error('insertCSS requires exactly one of code or file to be specified'); - } - } -}; - -module.exports = function(strUrl, strWindowName, strWindowFeatures) { - var iab = new InAppBrowser(); - var cb = function(eventname) { - iab._eventHandler(eventname); - }; - - // Don't catch calls that write to existing frames (e.g. named iframes). - if (window.frames && window.frames[strWindowName]) { - var origOpenFunc = modulemapper.getOriginalSymbol(window, 'open'); - return origOpenFunc.apply(window, arguments); - } - - exec(cb, cb, "InAppBrowser", "open", [strUrl, strWindowName, strWindowFeatures]); - return iab; -}; - diff --git a/plugins/org.apache.cordova.core.network-information/.fetch.json b/plugins/org.apache.cordova.core.network-information/.fetch.json deleted file mode 100644 index 0d3465a..0000000 --- a/plugins/org.apache.cordova.core.network-information/.fetch.json +++ /dev/null @@ -1 +0,0 @@ -{"source":{"type":"git","url":"https://git-wip-us.apache.org/repos/asf/cordova-plugin-network-information.git","subdir":"."}} \ No newline at end of file diff --git a/plugins/org.apache.cordova.core.network-information/README.md b/plugins/org.apache.cordova.core.network-information/README.md deleted file mode 100644 index 0dbf122..0000000 --- a/plugins/org.apache.cordova.core.network-information/README.md +++ /dev/null @@ -1,5 +0,0 @@ -cordova-plugin-network-information ----------------------------------- -To install this plugin, follow the [Command-line Interface Guide](http://cordova.apache.org/docs/en/edge/guide_cli_index.md.html#The%20Command-line%20Interface). - -If you are not using the Cordova Command-line Interface, follow [Using Plugman to Manage Plugins](http://cordova.apache.org/docs/en/edge/guide_plugin_ref_plugman.md.html). diff --git a/plugins/org.apache.cordova.core.network-information/docs/connection.md b/plugins/org.apache.cordova.core.network-information/docs/connection.md deleted file mode 100644 index ebecd12..0000000 --- a/plugins/org.apache.cordova.core.network-information/docs/connection.md +++ /dev/null @@ -1,97 +0,0 @@ ---- -license: Licensed to the Apache Software Foundation (ASF) under one - or more contributor license agreements. See the NOTICE file - distributed with this work for additional information - regarding copyright ownership. The ASF licenses this file - to you under the Apache License, Version 2.0 (the - "License"); you may not use this file except in compliance - with the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, - software distributed under the License is distributed on an - "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - KIND, either express or implied. See the License for the - specific language governing permissions and limitations - under the License. ---- - -Connection -========== - -> The `connection` object gives access to the device's cellular and wifi connection information. - -This object is exposed as `navigator.connection`. - -Properties ----------- - -- connection.type - -Constants ---------- - -- Connection.UNKNOWN -- Connection.ETHERNET -- Connection.WIFI -- Connection.CELL_2G -- Connection.CELL_3G -- Connection.CELL_4G -- Connection.CELL -- Connection.NONE - -Permissions ------------ - -### Android - -#### app/res/xml/config.xml - - - -#### app/AndroidManifest.xml - - - - - -### Bada - - - SYSTEM_SERVICE - - -### BlackBerry WebWorks - -#### www/plugins.xml - - - -### iOS - -#### config.xml - - - -### webOS - - No permissions are required. - -### Windows Phone - -#### Properties/WPAppManifest.xml - - - - - -Reference: [Application Manifest for Windows Phone](http://msdn.microsoft.com/en-us/library/ff769509%28v=vs.92%29.aspx) - -### Tizen - -#### config.xml - - - -Reference: [Application Manifest for Tizen Web Application](https://developer.tizen.org/help/topic/org.tizen.help.gs/Creating%20a%20Project.html?path=0_1_1_3#8814682_CreatingaProject-EditingconfigxmlFeatures) diff --git a/plugins/org.apache.cordova.core.network-information/docs/connection.type.md b/plugins/org.apache.cordova.core.network-information/docs/connection.type.md deleted file mode 100644 index c18e58b..0000000 --- a/plugins/org.apache.cordova.core.network-information/docs/connection.type.md +++ /dev/null @@ -1,143 +0,0 @@ ---- -license: Licensed to the Apache Software Foundation (ASF) under one - or more contributor license agreements. See the NOTICE file - distributed with this work for additional information - regarding copyright ownership. The ASF licenses this file - to you under the Apache License, Version 2.0 (the - "License"); you may not use this file except in compliance - with the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, - software distributed under the License is distributed on an - "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - KIND, either express or implied. See the License for the - specific language governing permissions and limitations - under the License. ---- - -connection.type -=================== - -Checks the active network connection that is being used. - -Description ------------ - -This property is a fast way to determine the device's network connection state, and type of connection. - -Supported Platforms -------------------- - -- iOS -- Android -- BlackBerry WebWorks (OS 5.0 and higher) -- Windows Phone 7 and 8 -- Bada 2.x -- webOS -- Tizen -- Windows 8 - -Quick Example -------------- - - function checkConnection() { - var networkState = navigator.connection.type; - - var states = {}; - states[Connection.UNKNOWN] = 'Unknown connection'; - states[Connection.ETHERNET] = 'Ethernet connection'; - states[Connection.WIFI] = 'WiFi connection'; - states[Connection.CELL_2G] = 'Cell 2G connection'; - states[Connection.CELL_3G] = 'Cell 3G connection'; - states[Connection.CELL_4G] = 'Cell 4G connection'; - states[Connection.CELL] = 'Cell generic connection'; - states[Connection.NONE] = 'No network connection'; - - alert('Connection type: ' + states[networkState]); - } - - checkConnection(); - -Full Example ------------- - - - - - navigator.connection.type Example - - - - - -

A dialog box will report the network state.

- - - -API Change ----------- -Before Cordova 2.3.0, the Connection object existed at: `navigator.network.connection`. - -To match the spec, this was changed to `navigator.connection` in 2.3.0. - -`navigator.network.connection` still exists, but is now deprecated and will be removed in a future release. - -iOS Quirks ----------- - -- iOS cannot detect the type of cellular network connection. - - `navigator.connection.type` is set to `Connection.CELL_2G` for all cellular data. This is deprecated as of 2.6.0 and will be changed to return `Connection.CELL` in a future release. - -Bada Quirks ------------ - -- Bada can only detect a WiFi or cellular connection. - - `navigator.connection.type` is set to `Connection.CELL_2G` for all cellular data. - -webOS Quirks ------------- - -- Only shows that a connection is available, but not which type. - -Windows Phone Quirks --------------------- - -- When running in the emulator, always detects `navigator.connection.type` as `Connection.UNKNOWN`. -- Windows Phone cannot detect the type of cellular network connection. - - `navigator.connection.type` is set to `Connection.CELL` for all cellular data. - -Tizen Quirks --------------------- - -- Tizen can only detect a WiFi or cellular connection. - - `navigator.connection.type` is set to `Connection.CELL_2G` for all cellular data. diff --git a/plugins/org.apache.cordova.core.network-information/plugin.xml b/plugins/org.apache.cordova.core.network-information/plugin.xml deleted file mode 100644 index 6ca2935..0000000 --- a/plugins/org.apache.cordova.core.network-information/plugin.xml +++ /dev/null @@ -1,106 +0,0 @@ - - - - - Network Information - Cordova Network Information Plugin - Apache - cordova,network,information - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/plugins/org.apache.cordova.core.network-information/src/android/NetworkManager.java b/plugins/org.apache.cordova.core.network-information/src/android/NetworkManager.java deleted file mode 100644 index 42282bf..0000000 --- a/plugins/org.apache.cordova.core.network-information/src/android/NetworkManager.java +++ /dev/null @@ -1,249 +0,0 @@ -/* - Licensed to the Apache Software Foundation (ASF) under one - or more contributor license agreements. See the NOTICE file - distributed with this work for additional information - regarding copyright ownership. The ASF licenses this file - to you under the Apache License, Version 2.0 (the - "License"); you may not use this file except in compliance - with the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, - software distributed under the License is distributed on an - "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - KIND, either express or implied. See the License for the - specific language governing permissions and limitations - under the License. -*/ -package org.apache.cordova.core; - -import org.apache.cordova.CallbackContext; -import org.apache.cordova.CordovaInterface; -import org.apache.cordova.CordovaPlugin; -import org.apache.cordova.PluginResult; -import org.apache.cordova.CordovaWebView; -import org.json.JSONArray; - -import android.content.BroadcastReceiver; -import android.content.Context; -import android.content.Intent; -import android.content.IntentFilter; -import android.net.ConnectivityManager; -import android.net.NetworkInfo; -import android.util.Log; - -public class NetworkManager extends CordovaPlugin { - - public static int NOT_REACHABLE = 0; - public static int REACHABLE_VIA_CARRIER_DATA_NETWORK = 1; - public static int REACHABLE_VIA_WIFI_NETWORK = 2; - - public static final String WIFI = "wifi"; - public static final String WIMAX = "wimax"; - // mobile - public static final String MOBILE = "mobile"; - // 2G network types - public static final String GSM = "gsm"; - public static final String GPRS = "gprs"; - public static final String EDGE = "edge"; - // 3G network types - public static final String CDMA = "cdma"; - public static final String UMTS = "umts"; - public static final String HSPA = "hspa"; - public static final String HSUPA = "hsupa"; - public static final String HSDPA = "hsdpa"; - public static final String ONEXRTT = "1xrtt"; - public static final String EHRPD = "ehrpd"; - // 4G network types - public static final String LTE = "lte"; - public static final String UMB = "umb"; - public static final String HSPA_PLUS = "hspa+"; - // return type - public static final String TYPE_UNKNOWN = "unknown"; - public static final String TYPE_ETHERNET = "ethernet"; - public static final String TYPE_WIFI = "wifi"; - public static final String TYPE_2G = "2g"; - public static final String TYPE_3G = "3g"; - public static final String TYPE_4G = "4g"; - public static final String TYPE_NONE = "none"; - - private static final String LOG_TAG = "NetworkManager"; - - private CallbackContext connectionCallbackContext; - private boolean registered = false; - - ConnectivityManager sockMan; - BroadcastReceiver receiver; - private String lastStatus = ""; - - /** - * Constructor. - */ - public NetworkManager() { - this.receiver = null; - } - - /** - * Sets the context of the Command. This can then be used to do things like - * get file paths associated with the Activity. - * - * @param cordova The context of the main Activity. - * @param webView The CordovaWebView Cordova is running in. - */ - public void initialize(CordovaInterface cordova, CordovaWebView webView) { - super.initialize(cordova, webView); - this.sockMan = (ConnectivityManager) cordova.getActivity().getSystemService(Context.CONNECTIVITY_SERVICE); - this.connectionCallbackContext = null; - - // We need to listen to connectivity events to update navigator.connection - IntentFilter intentFilter = new IntentFilter(); - intentFilter.addAction(ConnectivityManager.CONNECTIVITY_ACTION); - if (this.receiver == null) { - this.receiver = new BroadcastReceiver() { - @Override - public void onReceive(Context context, Intent intent) { - // (The null check is for the ARM Emulator, please use Intel Emulator for better results) - if(NetworkManager.this.webView != null) - updateConnectionInfo(sockMan.getActiveNetworkInfo()); - } - }; - cordova.getActivity().registerReceiver(this.receiver, intentFilter); - this.registered = true; - } - - } - - /** - * Executes the request and returns PluginResult. - * - * @param action The action to execute. - * @param args JSONArry of arguments for the plugin. - * @param callbackContext The callback id used when calling back into JavaScript. - * @return True if the action was valid, false otherwise. - */ - public boolean execute(String action, JSONArray args, CallbackContext callbackContext) { - if (action.equals("getConnectionInfo")) { - this.connectionCallbackContext = callbackContext; - NetworkInfo info = sockMan.getActiveNetworkInfo(); - PluginResult pluginResult = new PluginResult(PluginResult.Status.OK, this.getConnectionInfo(info)); - pluginResult.setKeepCallback(true); - callbackContext.sendPluginResult(pluginResult); - return true; - } - return false; - } - - /** - * Stop network receiver. - */ - public void onDestroy() { - if (this.receiver != null && this.registered) { - try { - this.cordova.getActivity().unregisterReceiver(this.receiver); - this.registered = false; - } catch (Exception e) { - Log.e(LOG_TAG, "Error unregistering network receiver: " + e.getMessage(), e); - } - } - } - - //-------------------------------------------------------------------------- - // LOCAL METHODS - //-------------------------------------------------------------------------- - - /** - * Updates the JavaScript side whenever the connection changes - * - * @param info the current active network info - * @return - */ - private void updateConnectionInfo(NetworkInfo info) { - // send update to javascript "navigator.network.connection" - // Jellybean sends its own info - String thisStatus = this.getConnectionInfo(info); - if(!thisStatus.equals(lastStatus)) - { - sendUpdate(thisStatus); - lastStatus = thisStatus; - } - - } - - /** - * Get the latest network connection information - * - * @param info the current active network info - * @return a JSONObject that represents the network info - */ - private String getConnectionInfo(NetworkInfo info) { - String type = TYPE_NONE; - if (info != null) { - // If we are not connected to any network set type to none - if (!info.isConnected()) { - type = TYPE_NONE; - } - else { - type = getType(info); - } - } - Log.d("CordovaNetworkManager", "Connection Type: " + type); - return type; - } - - /** - * Create a new plugin result and send it back to JavaScript - * - * @param connection the network info to set as navigator.connection - */ - private void sendUpdate(String type) { - if (connectionCallbackContext != null) { - PluginResult result = new PluginResult(PluginResult.Status.OK, type); - result.setKeepCallback(true); - connectionCallbackContext.sendPluginResult(result); - } - webView.postMessage("networkconnection", type); - } - - /** - * Determine the type of connection - * - * @param info the network info so we can determine connection type. - * @return the type of mobile network we are on - */ - private String getType(NetworkInfo info) { - if (info != null) { - String type = info.getTypeName(); - - if (type.toLowerCase().equals(WIFI)) { - return TYPE_WIFI; - } - else if (type.toLowerCase().equals(MOBILE)) { - type = info.getSubtypeName(); - if (type.toLowerCase().equals(GSM) || - type.toLowerCase().equals(GPRS) || - type.toLowerCase().equals(EDGE)) { - return TYPE_2G; - } - else if (type.toLowerCase().startsWith(CDMA) || - type.toLowerCase().equals(UMTS) || - type.toLowerCase().equals(ONEXRTT) || - type.toLowerCase().equals(EHRPD) || - type.toLowerCase().equals(HSUPA) || - type.toLowerCase().equals(HSDPA) || - type.toLowerCase().equals(HSPA)) { - return TYPE_3G; - } - else if (type.toLowerCase().equals(LTE) || - type.toLowerCase().equals(UMB) || - type.toLowerCase().equals(HSPA_PLUS)) { - return TYPE_4G; - } - } - } - else { - return TYPE_NONE; - } - return TYPE_UNKNOWN; - } -} diff --git a/plugins/org.apache.cordova.core.network-information/src/blackberry10/index.js b/plugins/org.apache.cordova.core.network-information/src/blackberry10/index.js deleted file mode 100644 index 5a991fe..0000000 --- a/plugins/org.apache.cordova.core.network-information/src/blackberry10/index.js +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Copyright 2010-2011 Research In Motion Limited. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -//map from BB10 to cordova connection types: -//https://github.com/apache/cordova-js/blob/master/lib/common/plugin/Connection.js -function mapConnectionType(con) { - switch (con.type) { - case 'wired': - return 'ethernet'; - case 'wifi': - return 'wifi'; - case 'none': - return 'none'; - case 'cellular': - switch (con.technology) { - case 'edge': - case 'gsm': - return '2g'; - case 'evdo': - return '3g'; - case 'umts': - return '3g'; - case 'lte': - return '4g'; - } - return "cellular"; - } - return 'unknown'; -} - -function currentConnectionType() { - try { - //possible for webplatform to throw pps exception - return mapConnectionType(window.qnx.webplatform.device.activeConnection || { type : 'none' }); - } - catch (e) { - return 'unknown'; - } -} - -module.exports = { - getConnectionInfo: function (success, fail, args, env) { - var result = new PluginResult(args, env); - result.ok(currentConnectionType()); - } -}; diff --git a/plugins/org.apache.cordova.core.network-information/src/firefoxos/network.js b/plugins/org.apache.cordova.core.network-information/src/firefoxos/network.js deleted file mode 100644 index e4298a0..0000000 --- a/plugins/org.apache.cordova.core.network-information/src/firefoxos/network.js +++ /dev/null @@ -1,29 +0,0 @@ -/* - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - * -*/ - -var cordova = require('cordova'); - -module.exports = { - getConnectionInfo: function (win, fail, args) { - var connection = navigator.connection || navigator.mozConnection || navigator.webkitConnection; - win(connection.bandwidth); - } -}; \ No newline at end of file diff --git a/plugins/org.apache.cordova.core.network-information/src/ios/CDVConnection.h b/plugins/org.apache.cordova.core.network-information/src/ios/CDVConnection.h deleted file mode 100644 index 8add027..0000000 --- a/plugins/org.apache.cordova.core.network-information/src/ios/CDVConnection.h +++ /dev/null @@ -1,34 +0,0 @@ -/* - Licensed to the Apache Software Foundation (ASF) under one - or more contributor license agreements. See the NOTICE file - distributed with this work for additional information - regarding copyright ownership. The ASF licenses this file - to you under the Apache License, Version 2.0 (the - "License"); you may not use this file except in compliance - with the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, - software distributed under the License is distributed on an - "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - KIND, either express or implied. See the License for the - specific language governing permissions and limitations - under the License. - */ - -#import -#import -#import "CDVReachability.h" - -@interface CDVConnection : CDVPlugin { - NSString* type; - NSString* _callbackId; - - CDVReachability* internetReach; -} - -@property (copy) NSString* connectionType; -@property (strong) CDVReachability* internetReach; - -@end diff --git a/plugins/org.apache.cordova.core.network-information/src/ios/CDVConnection.m b/plugins/org.apache.cordova.core.network-information/src/ios/CDVConnection.m deleted file mode 100644 index 3cfdc33..0000000 --- a/plugins/org.apache.cordova.core.network-information/src/ios/CDVConnection.m +++ /dev/null @@ -1,125 +0,0 @@ -/* - Licensed to the Apache Software Foundation (ASF) under one - or more contributor license agreements. See the NOTICE file - distributed with this work for additional information - regarding copyright ownership. The ASF licenses this file - to you under the Apache License, Version 2.0 (the - "License"); you may not use this file except in compliance - with the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, - software distributed under the License is distributed on an - "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - KIND, either express or implied. See the License for the - specific language governing permissions and limitations - under the License. - */ - -#import "CDVConnection.h" -#import "CDVReachability.h" - -@interface CDVConnection (PrivateMethods) -- (void)updateOnlineStatus; -- (void)sendPluginResult; -@end - -@implementation CDVConnection - -@synthesize connectionType, internetReach; - -- (void)getConnectionInfo:(CDVInvokedUrlCommand*)command -{ - _callbackId = command.callbackId; - [self sendPluginResult]; -} - -- (void)sendPluginResult -{ - CDVPluginResult* result = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsString:self.connectionType]; - - [result setKeepCallbackAsBool:YES]; - [self.commandDelegate sendPluginResult:result callbackId:_callbackId]; -} - -- (NSString*)w3cConnectionTypeFor:(CDVReachability*)reachability -{ - NetworkStatus networkStatus = [reachability currentReachabilityStatus]; - - switch (networkStatus) { - case NotReachable: - return @"none"; - - case ReachableViaWWAN: - return @"cellular"; - - case ReachableViaWiFi: - return @"wifi"; - - default: - return @"unknown"; - } -} - -- (BOOL)isCellularConnection:(NSString*)theConnectionType -{ - return [theConnectionType isEqualToString:@"2g"] || - [theConnectionType isEqualToString:@"3g"] || - [theConnectionType isEqualToString:@"4g"] || - [theConnectionType isEqualToString:@"cellular"]; -} - -- (void)updateReachability:(CDVReachability*)reachability -{ - if (reachability) { - // check whether the connection type has changed - NSString* newConnectionType = [self w3cConnectionTypeFor:reachability]; - if ([newConnectionType isEqualToString:self.connectionType]) { // the same as before, remove dupes - return; - } else { - self.connectionType = [self w3cConnectionTypeFor:reachability]; - } - } - [self sendPluginResult]; -} - -- (void)updateConnectionType:(NSNotification*)note -{ - CDVReachability* curReach = [note object]; - - if ((curReach != nil) && [curReach isKindOfClass:[CDVReachability class]]) { - [self updateReachability:curReach]; - } -} - -- (void)onPause -{ - [self.internetReach stopNotifier]; -} - -- (void)onResume -{ - [self.internetReach startNotifier]; - [self updateReachability:self.internetReach]; -} - -- (CDVPlugin*)initWithWebView:(UIWebView*)theWebView -{ - self = [super initWithWebView:theWebView]; - if (self) { - self.connectionType = @"none"; - self.internetReach = [CDVReachability reachabilityForInternetConnection]; - self.connectionType = [self w3cConnectionTypeFor:self.internetReach]; - [self.internetReach startNotifier]; - [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(updateConnectionType:) - name:kReachabilityChangedNotification object:nil]; - if (&UIApplicationDidEnterBackgroundNotification && &UIApplicationWillEnterForegroundNotification) { - [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(onPause) name:UIApplicationDidEnterBackgroundNotification object:nil]; - [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(onResume) name:UIApplicationWillEnterForegroundNotification object:nil]; - } - } - return self; -} - -@end diff --git a/plugins/org.apache.cordova.core.network-information/src/ios/CDVReachability.h b/plugins/org.apache.cordova.core.network-information/src/ios/CDVReachability.h deleted file mode 100644 index 01a95c3..0000000 --- a/plugins/org.apache.cordova.core.network-information/src/ios/CDVReachability.h +++ /dev/null @@ -1,85 +0,0 @@ -/* - - File: Reachability.h - Abstract: Basic demonstration of how to use the SystemConfiguration Reachability APIs. - Version: 2.2 - - Disclaimer: IMPORTANT: This Apple software is supplied to you by Apple Inc. - ("Apple") in consideration of your agreement to the following terms, and your - use, installation, modification or redistribution of this Apple software - constitutes acceptance of these terms. If you do not agree with these terms, - please do not use, install, modify or redistribute this Apple software. - - In consideration of your agreement to abide by the following terms, and subject - to these terms, Apple grants you a personal, non-exclusive license, under - Apple's copyrights in this original Apple software (the "Apple Software"), to - use, reproduce, modify and redistribute the Apple Software, with or without - modifications, in source and/or binary forms; provided that if you redistribute - the Apple Software in its entirety and without modifications, you must retain - this notice and the following text and disclaimers in all such redistributions - of the Apple Software. - Neither the name, trademarks, service marks or logos of Apple Inc. may be used - to endorse or promote products derived from the Apple Software without specific - prior written permission from Apple. Except as expressly stated in this notice, - no other rights or licenses, express or implied, are granted by Apple herein, - including but not limited to any patent rights that may be infringed by your - derivative works or by other works in which the Apple Software may be - incorporated. - - The Apple Software is provided by Apple on an "AS IS" basis. APPLE MAKES NO - WARRANTIES, EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION THE IMPLIED - WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY AND FITNESS FOR A PARTICULAR - PURPOSE, REGARDING THE APPLE SOFTWARE OR ITS USE AND OPERATION ALONE OR IN - COMBINATION WITH YOUR PRODUCTS. - - IN NO EVENT SHALL APPLE BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL OR - CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE - GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - ARISING IN ANY WAY OUT OF THE USE, REPRODUCTION, MODIFICATION AND/OR - DISTRIBUTION OF THE APPLE SOFTWARE, HOWEVER CAUSED AND WHETHER UNDER THEORY OF - CONTRACT, TORT (INCLUDING NEGLIGENCE), STRICT LIABILITY OR OTHERWISE, EVEN IF - APPLE HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - - Copyright (C) 2010 Apple Inc. All Rights Reserved. - -*/ - -#import -#import -#import - -typedef enum { - NotReachable = 0, - ReachableViaWWAN, // this value has been swapped with ReachableViaWiFi for Cordova backwards compat. reasons - ReachableViaWiFi // this value has been swapped with ReachableViaWWAN for Cordova backwards compat. reasons -} NetworkStatus; -#define kReachabilityChangedNotification @"kNetworkReachabilityChangedNotification" - -@interface CDVReachability : NSObject -{ - BOOL localWiFiRef; - SCNetworkReachabilityRef reachabilityRef; -} - -// reachabilityWithHostName- Use to check the reachability of a particular host name. -+ (CDVReachability*)reachabilityWithHostName:(NSString*)hostName; - -// reachabilityWithAddress- Use to check the reachability of a particular IP address. -+ (CDVReachability*)reachabilityWithAddress:(const struct sockaddr_in*)hostAddress; - -// reachabilityForInternetConnection- checks whether the default route is available. -// Should be used by applications that do not connect to a particular host -+ (CDVReachability*)reachabilityForInternetConnection; - -// reachabilityForLocalWiFi- checks whether a local wifi connection is available. -+ (CDVReachability*)reachabilityForLocalWiFi; - -// Start listening for reachability notifications on the current run loop -- (BOOL)startNotifier; -- (void)stopNotifier; - -- (NetworkStatus)currentReachabilityStatus; -// WWAN may be available, but not active until a connection has been established. -// WiFi may require a connection for VPN on Demand. -- (BOOL)connectionRequired; -@end diff --git a/plugins/org.apache.cordova.core.network-information/src/ios/CDVReachability.m b/plugins/org.apache.cordova.core.network-information/src/ios/CDVReachability.m deleted file mode 100644 index 89f4ec9..0000000 --- a/plugins/org.apache.cordova.core.network-information/src/ios/CDVReachability.m +++ /dev/null @@ -1,260 +0,0 @@ -/* - - File: Reachability.m - Abstract: Basic demonstration of how to use the SystemConfiguration Reachability APIs. - Version: 2.2 - - Disclaimer: IMPORTANT: This Apple software is supplied to you by Apple Inc. - ("Apple") in consideration of your agreement to the following terms, and your - use, installation, modification or redistribution of this Apple software - constitutes acceptance of these terms. If you do not agree with these terms, - please do not use, install, modify or redistribute this Apple software. - - In consideration of your agreement to abide by the following terms, and subject - to these terms, Apple grants you a personal, non-exclusive license, under - Apple's copyrights in this original Apple software (the "Apple Software"), to - use, reproduce, modify and redistribute the Apple Software, with or without - modifications, in source and/or binary forms; provided that if you redistribute - the Apple Software in its entirety and without modifications, you must retain - this notice and the following text and disclaimers in all such redistributions - of the Apple Software. - Neither the name, trademarks, service marks or logos of Apple Inc. may be used - to endorse or promote products derived from the Apple Software without specific - prior written permission from Apple. Except as expressly stated in this notice, - no other rights or licenses, express or implied, are granted by Apple herein, - including but not limited to any patent rights that may be infringed by your - derivative works or by other works in which the Apple Software may be - incorporated. - - The Apple Software is provided by Apple on an "AS IS" basis. APPLE MAKES NO - WARRANTIES, EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION THE IMPLIED - WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY AND FITNESS FOR A PARTICULAR - PURPOSE, REGARDING THE APPLE SOFTWARE OR ITS USE AND OPERATION ALONE OR IN - COMBINATION WITH YOUR PRODUCTS. - - IN NO EVENT SHALL APPLE BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL OR - CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE - GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - ARISING IN ANY WAY OUT OF THE USE, REPRODUCTION, MODIFICATION AND/OR - DISTRIBUTION OF THE APPLE SOFTWARE, HOWEVER CAUSED AND WHETHER UNDER THEORY OF - CONTRACT, TORT (INCLUDING NEGLIGENCE), STRICT LIABILITY OR OTHERWISE, EVEN IF - APPLE HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - - Copyright (C) 2010 Apple Inc. All Rights Reserved. - -*/ - -#import -#import -#import -#import -#import -#import - -#import - -#import "CDVReachability.h" - -#define kShouldPrintReachabilityFlags 0 - -static void CDVPrintReachabilityFlags(SCNetworkReachabilityFlags flags, const char* comment) -{ -#if kShouldPrintReachabilityFlags - NSLog(@"Reachability Flag Status: %c%c %c%c%c%c%c%c%c %s\n", - (flags & kSCNetworkReachabilityFlagsIsWWAN) ? 'W' : '-', - (flags & kSCNetworkReachabilityFlagsReachable) ? 'R' : '-', - - (flags & kSCNetworkReachabilityFlagsTransientConnection) ? 't' : '-', - (flags & kSCNetworkReachabilityFlagsConnectionRequired) ? 'c' : '-', - (flags & kSCNetworkReachabilityFlagsConnectionOnTraffic) ? 'C' : '-', - (flags & kSCNetworkReachabilityFlagsInterventionRequired) ? 'i' : '-', - (flags & kSCNetworkReachabilityFlagsConnectionOnDemand) ? 'D' : '-', - (flags & kSCNetworkReachabilityFlagsIsLocalAddress) ? 'l' : '-', - (flags & kSCNetworkReachabilityFlagsIsDirect) ? 'd' : '-', - comment - ); -#endif -} - -@implementation CDVReachability - -static void CDVReachabilityCallback(SCNetworkReachabilityRef target, SCNetworkReachabilityFlags flags, void* info) -{ -#pragma unused (target, flags) - // NSCAssert(info != NULL, @"info was NULL in ReachabilityCallback"); - // NSCAssert([(NSObject*) info isKindOfClass: [Reachability class]], @"info was wrong class in ReachabilityCallback"); - - // Converted the asserts above to conditionals, with safe return from the function - if (info == NULL) { - NSLog(@"info was NULL in ReachabilityCallback"); - return; - } - - if (![(__bridge NSObject*)info isKindOfClass :[CDVReachability class]]) { - NSLog(@"info was wrong class in ReachabilityCallback"); - return; - } - - // We're on the main RunLoop, so an NSAutoreleasePool is not necessary, but is added defensively - // in case someon uses the Reachability object in a different thread. - @autoreleasepool { - CDVReachability* noteObject = (__bridge CDVReachability*)info; - // Post a notification to notify the client that the network reachability changed. - [[NSNotificationCenter defaultCenter] postNotificationName:kReachabilityChangedNotification object:noteObject]; - } -} - -- (BOOL)startNotifier -{ - BOOL retVal = NO; - SCNetworkReachabilityContext context = {0, (__bridge void*)(self), NULL, NULL, NULL}; - - if (SCNetworkReachabilitySetCallback(reachabilityRef, CDVReachabilityCallback, &context)) { - if (SCNetworkReachabilityScheduleWithRunLoop(reachabilityRef, CFRunLoopGetCurrent(), kCFRunLoopDefaultMode)) { - retVal = YES; - } - } - return retVal; -} - -- (void)stopNotifier -{ - if (reachabilityRef != NULL) { - SCNetworkReachabilityUnscheduleFromRunLoop(reachabilityRef, CFRunLoopGetCurrent(), kCFRunLoopDefaultMode); - } -} - -- (void)dealloc -{ - [self stopNotifier]; - if (reachabilityRef != NULL) { - CFRelease(reachabilityRef); - } -} - -+ (CDVReachability*)reachabilityWithHostName:(NSString*)hostName; -{ - CDVReachability* retVal = NULL; - SCNetworkReachabilityRef reachability = SCNetworkReachabilityCreateWithName(NULL, [hostName UTF8String]); - if (reachability != NULL) { - retVal = [[self alloc] init]; - if (retVal != NULL) { - retVal->reachabilityRef = reachability; - retVal->localWiFiRef = NO; - } - } - return retVal; -} - -+ (CDVReachability*)reachabilityWithAddress:(const struct sockaddr_in*)hostAddress; -{ - SCNetworkReachabilityRef reachability = SCNetworkReachabilityCreateWithAddress(kCFAllocatorDefault, (const struct sockaddr*)hostAddress); - CDVReachability* retVal = NULL; - if (reachability != NULL) { - retVal = [[self alloc] init]; - if (retVal != NULL) { - retVal->reachabilityRef = reachability; - retVal->localWiFiRef = NO; - } - } - return retVal; -} - -+ (CDVReachability*)reachabilityForInternetConnection; -{ - struct sockaddr_in zeroAddress; - bzero(&zeroAddress, sizeof(zeroAddress)); - zeroAddress.sin_len = sizeof(zeroAddress); - zeroAddress.sin_family = AF_INET; - return [self reachabilityWithAddress:&zeroAddress]; -} - -+ (CDVReachability*)reachabilityForLocalWiFi; -{ - struct sockaddr_in localWifiAddress; - bzero(&localWifiAddress, sizeof(localWifiAddress)); - localWifiAddress.sin_len = sizeof(localWifiAddress); - localWifiAddress.sin_family = AF_INET; - // IN_LINKLOCALNETNUM is defined in as 169.254.0.0 - localWifiAddress.sin_addr.s_addr = htonl(IN_LINKLOCALNETNUM); - CDVReachability* retVal = [self reachabilityWithAddress:&localWifiAddress]; - if (retVal != NULL) { - retVal->localWiFiRef = YES; - } - return retVal; -} - -#pragma mark Network Flag Handling - -- (NetworkStatus)localWiFiStatusForFlags:(SCNetworkReachabilityFlags)flags -{ - CDVPrintReachabilityFlags(flags, "localWiFiStatusForFlags"); - - BOOL retVal = NotReachable; - if ((flags & kSCNetworkReachabilityFlagsReachable) && (flags & kSCNetworkReachabilityFlagsIsDirect)) { - retVal = ReachableViaWiFi; - } - return retVal; -} - -- (NetworkStatus)networkStatusForFlags:(SCNetworkReachabilityFlags)flags -{ - CDVPrintReachabilityFlags(flags, "networkStatusForFlags"); - if ((flags & kSCNetworkReachabilityFlagsReachable) == 0) { - // if target host is not reachable - return NotReachable; - } - - BOOL retVal = NotReachable; - - if ((flags & kSCNetworkReachabilityFlagsConnectionRequired) == 0) { - // if target host is reachable and no connection is required - // then we'll assume (for now) that your on Wi-Fi - retVal = ReachableViaWiFi; - } - - if ((((flags & kSCNetworkReachabilityFlagsConnectionOnDemand) != 0) || - ((flags & kSCNetworkReachabilityFlagsConnectionOnTraffic) != 0))) { - // ... and the connection is on-demand (or on-traffic) if the - // calling application is using the CFSocketStream or higher APIs - - if ((flags & kSCNetworkReachabilityFlagsInterventionRequired) == 0) { - // ... and no [user] intervention is needed - retVal = ReachableViaWiFi; - } - } - - if ((flags & kSCNetworkReachabilityFlagsIsWWAN) == kSCNetworkReachabilityFlagsIsWWAN) { - // ... but WWAN connections are OK if the calling application - // is using the CFNetwork (CFSocketStream?) APIs. - retVal = ReachableViaWWAN; - } - return retVal; -} - -- (BOOL)connectionRequired; -{ - NSAssert(reachabilityRef != NULL, @"connectionRequired called with NULL reachabilityRef"); - SCNetworkReachabilityFlags flags; - if (SCNetworkReachabilityGetFlags(reachabilityRef, &flags)) { - return flags & kSCNetworkReachabilityFlagsConnectionRequired; - } - return NO; -} - -- (NetworkStatus)currentReachabilityStatus -{ - NSAssert(reachabilityRef != NULL, @"currentNetworkStatus called with NULL reachabilityRef"); - NetworkStatus retVal = NotReachable; - SCNetworkReachabilityFlags flags; - if (SCNetworkReachabilityGetFlags(reachabilityRef, &flags)) { - if (localWiFiRef) { - retVal = [self localWiFiStatusForFlags:flags]; - } else { - retVal = [self networkStatusForFlags:flags]; - } - } - return retVal; -} - -@end diff --git a/plugins/org.apache.cordova.core.network-information/src/windows8/NetworkInfoProxy.js b/plugins/org.apache.cordova.core.network-information/src/windows8/NetworkInfoProxy.js deleted file mode 100644 index 37cb5fe..0000000 --- a/plugins/org.apache.cordova.core.network-information/src/windows8/NetworkInfoProxy.js +++ /dev/null @@ -1,87 +0,0 @@ -/* - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - * -*/ - -/*global Windows:true */ - -var cordova = require('cordova'); -var Connection = require('./Connection'); - -module.exports = { - - getConnectionInfo:function(win,fail,args) - { - console.log("NetworkStatusProxy::getConnectionInfo"); - var winNetConn = Windows.Networking.Connectivity; - var networkInfo = winNetConn.NetworkInformation; - var networkCostInfo = winNetConn.NetworkCostType; - var networkConnectivityInfo = winNetConn.NetworkConnectivityLevel; - var networkAuthenticationInfo = winNetConn.NetworkAuthenticationType; - var networkEncryptionInfo = winNetConn.NetworkEncryptionType; - - var connectionType; - - var profile = Windows.Networking.Connectivity.NetworkInformation.getInternetConnectionProfile(); - if(profile) { - var conLevel = profile.getNetworkConnectivityLevel(); - var interfaceType = profile.networkAdapter.ianaInterfaceType; - - if (conLevel == Windows.Networking.Connectivity.NetworkConnectivityLevel.none) { - connectionType = Connection.NONE; - } - else { - switch (interfaceType) { - case 71: - connectionType = Connection.WIFI; - break; - case 6: - connectionType = Connection.ETHERNET; - break; - case 243: // (3GPP WWAN) // Fallthrough is intentional - case 244: // (3GPP2 WWAN) - connectionType = Connection.CELL_3G; - break; - default: - connectionType = Connection.UNKNOWN; - break; - } - } - } - // FYI - //Connection.UNKNOWN 'Unknown connection'; - //Connection.ETHERNET 'Ethernet connection'; - //Connection.WIFI 'WiFi connection'; - //Connection.CELL_2G 'Cell 2G connection'; - //Connection.CELL_3G 'Cell 3G connection'; - //Connection.CELL_4G 'Cell 4G connection'; - //Connection.NONE 'No network connection'; - - setTimeout(function () { - if (connectionType) { - win(connectionType); - } else { - win(Connection.NONE); - } - },0); - } - -}; - -require("cordova/commandProxy").add("NetworkStatus",module.exports); \ No newline at end of file diff --git a/plugins/org.apache.cordova.core.network-information/src/wp/NetworkStatus.cs b/plugins/org.apache.cordova.core.network-information/src/wp/NetworkStatus.cs deleted file mode 100644 index 12eb061..0000000 --- a/plugins/org.apache.cordova.core.network-information/src/wp/NetworkStatus.cs +++ /dev/null @@ -1,129 +0,0 @@ -/* - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -using System; -using System.Diagnostics; -using System.Net; -using System.Net.NetworkInformation; -using System.Windows; -using System.Windows.Controls; -using System.Windows.Documents; -using System.Windows.Ink; -using System.Windows.Input; -using System.Windows.Media; -using System.Windows.Media.Animation; -using System.Windows.Shapes; -using Microsoft.Phone.Net.NetworkInformation; - -namespace WPCordovaClassLib.Cordova.Commands -{ - - // http://msdn.microsoft.com/en-us/library/microsoft.phone.net.networkinformation(v=VS.92).aspx - // http://msdn.microsoft.com/en-us/library/microsoft.phone.net.networkinformation.devicenetworkinformation(v=VS.92).aspx - - public class NetworkStatus : BaseCommand - { - const string UNKNOWN = "unknown"; - const string ETHERNET = "ethernet"; - const string WIFI = "wifi"; - const string CELL_2G = "2g"; - const string CELL_3G = "3g"; - const string CELL_4G = "4g"; - const string NONE = "none"; - const string CELL = "cellular"; - - private bool HasCallback = false; - - public NetworkStatus() - { - DeviceNetworkInformation.NetworkAvailabilityChanged += new EventHandler(ChangeDetected); - } - - public override void OnResume(object sender, Microsoft.Phone.Shell.ActivatedEventArgs e) - { - this.getConnectionInfo(""); - } - - public void getConnectionInfo(string empty) - { - HasCallback = true; - updateConnectionType(checkConnectionType()); - } - - private string checkConnectionType() - { - if (DeviceNetworkInformation.IsNetworkAvailable) - { - if (DeviceNetworkInformation.IsWiFiEnabled) - { - return WIFI; - } - else - { - return DeviceNetworkInformation.IsCellularDataEnabled ? CELL : UNKNOWN; - } - } - return NONE; - } - - private string checkConnectionType(NetworkInterfaceSubType type) - { - switch (type) - { - case NetworkInterfaceSubType.Cellular_1XRTT: //cell - case NetworkInterfaceSubType.Cellular_GPRS: //cell - return CELL; - case NetworkInterfaceSubType.Cellular_EDGE: //2 - return CELL_2G; - case NetworkInterfaceSubType.Cellular_3G: - case NetworkInterfaceSubType.Cellular_EVDO: //3 - case NetworkInterfaceSubType.Cellular_EVDV: //3 - case NetworkInterfaceSubType.Cellular_HSPA: //3 - return CELL_3G; - case NetworkInterfaceSubType.WiFi: - return WIFI; - case NetworkInterfaceSubType.Unknown: - case NetworkInterfaceSubType.Desktop_PassThru: - default: - return UNKNOWN; - } - } - - void ChangeDetected(object sender, NetworkNotificationEventArgs e) - { - switch (e.NotificationType) - { - case NetworkNotificationType.InterfaceConnected: - updateConnectionType(checkConnectionType(e.NetworkInterface.InterfaceSubtype)); - break; - case NetworkNotificationType.InterfaceDisconnected: - updateConnectionType(NONE); - break; - default: - break; - } - } - - private void updateConnectionType(string type) - { - // This should also implicitly fire offline/online events as that is handled on the JS side - if (this.HasCallback) - { - PluginResult result = new PluginResult(PluginResult.Status.OK, type); - result.KeepCallback = true; - DispatchCommandResult(result); - } - } - } -} diff --git a/plugins/org.apache.cordova.core.network-information/test/autotest/html/HtmlReporter.js b/plugins/org.apache.cordova.core.network-information/test/autotest/html/HtmlReporter.js deleted file mode 100644 index 7d9d924..0000000 --- a/plugins/org.apache.cordova.core.network-information/test/autotest/html/HtmlReporter.js +++ /dev/null @@ -1,101 +0,0 @@ -jasmine.HtmlReporter = function(_doc) { - var self = this; - var doc = _doc || window.document; - - var reporterView; - - var dom = {}; - - // Jasmine Reporter Public Interface - self.logRunningSpecs = false; - - self.reportRunnerStarting = function(runner) { - var specs = runner.specs() || []; - - if (specs.length == 0) { - return; - } - - createReporterDom(runner.env.versionString()); - doc.body.appendChild(dom.reporter); - - reporterView = new jasmine.HtmlReporter.ReporterView(dom); - reporterView.addSpecs(specs, self.specFilter); - }; - - self.reportRunnerResults = function(runner) { - reporterView && reporterView.complete(); - }; - - self.reportSuiteResults = function(suite) { - reporterView.suiteComplete(suite); - }; - - self.reportSpecStarting = function(spec) { - if (self.logRunningSpecs) { - self.log('>> Jasmine Running ' + spec.suite.description + ' ' + spec.description + '...'); - } - }; - - self.reportSpecResults = function(spec) { - reporterView.specComplete(spec); - }; - - self.log = function() { - var console = jasmine.getGlobal().console; - if (console && console.log) { - if (console.log.apply) { - console.log.apply(console, arguments); - } else { - console.log(arguments); // ie fix: console.log.apply doesn't exist on ie - } - } - }; - - self.specFilter = function(spec) { - if (!focusedSpecName()) { - return true; - } - - return spec.getFullName().indexOf(focusedSpecName()) === 0; - }; - - return self; - - function focusedSpecName() { - var specName; - - (function memoizeFocusedSpec() { - if (specName) { - return; - } - - var paramMap = []; - var params = doc.location.search.substring(1).split('&'); - - for (var i = 0; i < params.length; i++) { - var p = params[i].split('='); - paramMap[decodeURIComponent(p[0])] = decodeURIComponent(p[1]); - } - - specName = paramMap.spec; - })(); - - return specName; - } - - function createReporterDom(version) { - dom.reporter = self.createDom('div', { id: 'HTMLReporter', className: 'jasmine_reporter' }, - dom.banner = self.createDom('div', { className: 'banner' }, - self.createDom('span', { className: 'title' }, "Jasmine "), - self.createDom('span', { className: 'version' }, version)), - - dom.symbolSummary = self.createDom('ul', {className: 'symbolSummary'}), - dom.alert = self.createDom('div', {className: 'alert'}), - dom.results = self.createDom('div', {className: 'results'}, - dom.summary = self.createDom('div', { className: 'summary' }), - dom.details = self.createDom('div', { id: 'details' })) - ); - } -}; -jasmine.HtmlReporterHelpers.addHelpers(jasmine.HtmlReporter); diff --git a/plugins/org.apache.cordova.core.network-information/test/autotest/html/HtmlReporterHelpers.js b/plugins/org.apache.cordova.core.network-information/test/autotest/html/HtmlReporterHelpers.js deleted file mode 100644 index 745e1e0..0000000 --- a/plugins/org.apache.cordova.core.network-information/test/autotest/html/HtmlReporterHelpers.js +++ /dev/null @@ -1,60 +0,0 @@ -jasmine.HtmlReporterHelpers = {}; - -jasmine.HtmlReporterHelpers.createDom = function(type, attrs, childrenVarArgs) { - var el = document.createElement(type); - - for (var i = 2; i < arguments.length; i++) { - var child = arguments[i]; - - if (typeof child === 'string') { - el.appendChild(document.createTextNode(child)); - } else { - if (child) { - el.appendChild(child); - } - } - } - - for (var attr in attrs) { - if (attr == "className") { - el[attr] = attrs[attr]; - } else { - el.setAttribute(attr, attrs[attr]); - } - } - - return el; -}; - -jasmine.HtmlReporterHelpers.getSpecStatus = function(child) { - var results = child.results(); - var status = results.passed() ? 'passed' : 'failed'; - if (results.skipped) { - status = 'skipped'; - } - - return status; -}; - -jasmine.HtmlReporterHelpers.appendToSummary = function(child, childElement) { - var parentDiv = this.dom.summary; - var parentSuite = (typeof child.parentSuite == 'undefined') ? 'suite' : 'parentSuite'; - var parent = child[parentSuite]; - - if (parent) { - if (typeof this.views.suites[parent.id] == 'undefined') { - this.views.suites[parent.id] = new jasmine.HtmlReporter.SuiteView(parent, this.dom, this.views); - } - parentDiv = this.views.suites[parent.id].element; - } - - parentDiv.appendChild(childElement); -}; - - -jasmine.HtmlReporterHelpers.addHelpers = function(ctor) { - for(var fn in jasmine.HtmlReporterHelpers) { - ctor.prototype[fn] = jasmine.HtmlReporterHelpers[fn]; - } -}; - diff --git a/plugins/org.apache.cordova.core.network-information/test/autotest/html/ReporterView.js b/plugins/org.apache.cordova.core.network-information/test/autotest/html/ReporterView.js deleted file mode 100644 index 6a6d005..0000000 --- a/plugins/org.apache.cordova.core.network-information/test/autotest/html/ReporterView.js +++ /dev/null @@ -1,164 +0,0 @@ -jasmine.HtmlReporter.ReporterView = function(dom) { - this.startedAt = new Date(); - this.runningSpecCount = 0; - this.completeSpecCount = 0; - this.passedCount = 0; - this.failedCount = 0; - this.skippedCount = 0; - - this.createResultsMenu = function() { - this.resultsMenu = this.createDom('span', {className: 'resultsMenu bar'}, - this.summaryMenuItem = this.createDom('a', {className: 'summaryMenuItem', href: "#"}, '0 specs'), - ' | ', - this.detailsMenuItem = this.createDom('a', {className: 'detailsMenuItem', href: "#"}, '0 failing')); - - this.summaryMenuItem.onclick = function() { - dom.reporter.className = dom.reporter.className.replace(/ showDetails/g, ''); - }; - - this.detailsMenuItem.onclick = function() { - showDetails(); - }; - }; - - this.addSpecs = function(specs, specFilter) { - this.totalSpecCount = specs.length; - - this.views = { - specs: {}, - suites: {} - }; - - for (var i = 0; i < specs.length; i++) { - var spec = specs[i]; - this.views.specs[spec.id] = new jasmine.HtmlReporter.SpecView(spec, dom, this.views); - if (specFilter(spec)) { - this.runningSpecCount++; - } - } - }; - - this.specComplete = function(spec) { - this.completeSpecCount++; - - if (isUndefined(this.views.specs[spec.id])) { - this.views.specs[spec.id] = new jasmine.HtmlReporter.SpecView(spec, dom); - } - - var specView = this.views.specs[spec.id]; - - switch (specView.status()) { - case 'passed': - this.passedCount++; - break; - - case 'failed': - this.failedCount++; - break; - - case 'skipped': - this.skippedCount++; - break; - } - - specView.refresh(); - this.refresh(); - }; - - this.suiteComplete = function(suite) { - var suiteView = this.views.suites[suite.id]; - if (isUndefined(suiteView)) { - return; - } - suiteView.refresh(); - }; - - this.refresh = function() { - - if (isUndefined(this.resultsMenu)) { - this.createResultsMenu(); - } - - // currently running UI - if (isUndefined(this.runningAlert)) { - this.runningAlert = this.createDom('a', {href: "?", className: "runningAlert bar"}); - dom.alert.appendChild(this.runningAlert); - } - this.runningAlert.innerHTML = "Running " + this.completeSpecCount + " of " + specPluralizedFor(this.totalSpecCount); - - // skipped specs UI - if (isUndefined(this.skippedAlert)) { - this.skippedAlert = this.createDom('a', {href: "?", className: "skippedAlert bar"}); - } - - this.skippedAlert.innerHTML = "Skipping " + this.skippedCount + " of " + specPluralizedFor(this.totalSpecCount) + " - run all"; - - if (this.skippedCount === 1 && isDefined(dom.alert)) { - dom.alert.appendChild(this.skippedAlert); - } - - // passing specs UI - if (isUndefined(this.passedAlert)) { - this.passedAlert = this.createDom('span', {href: "?", className: "passingAlert bar"}); - } - this.passedAlert.innerHTML = "Passing " + specPluralizedFor(this.passedCount); - - // failing specs UI - if (isUndefined(this.failedAlert)) { - this.failedAlert = this.createDom('span', {href: "?", className: "failingAlert bar"}); - } - this.failedAlert.innerHTML = "Failing " + specPluralizedFor(this.failedCount); - - if (this.failedCount === 1 && isDefined(dom.alert)) { - dom.alert.appendChild(this.failedAlert); - dom.alert.appendChild(this.resultsMenu); - } - - // summary info - this.summaryMenuItem.innerHTML = "" + specPluralizedFor(this.runningSpecCount); - this.detailsMenuItem.innerHTML = "" + this.failedCount + " failing"; - }; - - this.complete = function() { - dom.alert.removeChild(this.runningAlert); - - this.skippedAlert.innerHTML = "Ran " + this.runningSpecCount + " of " + specPluralizedFor(this.totalSpecCount) + " - run all"; - - if (this.failedCount === 0) { - dom.alert.appendChild(this.createDom('span', {className: 'passingAlert bar'}, "Passing " + specPluralizedFor(this.passedCount))); - } else { - showDetails(); - } - - dom.banner.appendChild(this.createDom('span', {className: 'duration'}, "finished in " + ((new Date().getTime() - this.startedAt.getTime()) / 1000) + "s")); - }; - - return this; - - function showDetails() { - if (dom.reporter.className.search(/showDetails/) === -1) { - dom.reporter.className += " showDetails"; - } - } - - function isUndefined(obj) { - return typeof obj === 'undefined'; - } - - function isDefined(obj) { - return !isUndefined(obj); - } - - function specPluralizedFor(count) { - var str = count + " spec"; - if (count > 1) { - str += "s" - } - return str; - } - -}; - -jasmine.HtmlReporterHelpers.addHelpers(jasmine.HtmlReporter.ReporterView); - - diff --git a/plugins/org.apache.cordova.core.network-information/test/autotest/html/SpecView.js b/plugins/org.apache.cordova.core.network-information/test/autotest/html/SpecView.js deleted file mode 100644 index e8a3c23..0000000 --- a/plugins/org.apache.cordova.core.network-information/test/autotest/html/SpecView.js +++ /dev/null @@ -1,79 +0,0 @@ -jasmine.HtmlReporter.SpecView = function(spec, dom, views) { - this.spec = spec; - this.dom = dom; - this.views = views; - - this.symbol = this.createDom('li', { className: 'pending' }); - this.dom.symbolSummary.appendChild(this.symbol); - - this.summary = this.createDom('div', { className: 'specSummary' }, - this.createDom('a', { - className: 'description', - href: '?spec=' + encodeURIComponent(this.spec.getFullName()), - title: this.spec.getFullName() - }, this.spec.description) - ); - - this.detail = this.createDom('div', { className: 'specDetail' }, - this.createDom('a', { - className: 'description', - href: '?spec=' + encodeURIComponent(this.spec.getFullName()), - title: this.spec.getFullName() - }, this.spec.getFullName()) - ); -}; - -jasmine.HtmlReporter.SpecView.prototype.status = function() { - return this.getSpecStatus(this.spec); -}; - -jasmine.HtmlReporter.SpecView.prototype.refresh = function() { - this.symbol.className = this.status(); - - switch (this.status()) { - case 'skipped': - break; - - case 'passed': - this.appendSummaryToSuiteDiv(); - break; - - case 'failed': - this.appendSummaryToSuiteDiv(); - this.appendFailureDetail(); - break; - } -}; - -jasmine.HtmlReporter.SpecView.prototype.appendSummaryToSuiteDiv = function() { - this.summary.className += ' ' + this.status(); - this.appendToSummary(this.spec, this.summary); -}; - -jasmine.HtmlReporter.SpecView.prototype.appendFailureDetail = function() { - this.detail.className += ' ' + this.status(); - - var resultItems = this.spec.results().getItems(); - var messagesDiv = this.createDom('div', { className: 'messages' }); - - for (var i = 0; i < resultItems.length; i++) { - var result = resultItems[i]; - - if (result.type == 'log') { - messagesDiv.appendChild(this.createDom('div', {className: 'resultMessage log'}, result.toString())); - } else if (result.type == 'expect' && result.passed && !result.passed()) { - messagesDiv.appendChild(this.createDom('div', {className: 'resultMessage fail'}, result.message)); - - if (result.trace.stack) { - messagesDiv.appendChild(this.createDom('div', {className: 'stackTrace'}, result.trace.stack)); - } - } - } - - if (messagesDiv.childNodes.length > 0) { - this.detail.appendChild(messagesDiv); - this.dom.details.appendChild(this.detail); - } -}; - -jasmine.HtmlReporterHelpers.addHelpers(jasmine.HtmlReporter.SpecView); diff --git a/plugins/org.apache.cordova.core.network-information/test/autotest/html/SuiteView.js b/plugins/org.apache.cordova.core.network-information/test/autotest/html/SuiteView.js deleted file mode 100644 index 19a1efa..0000000 --- a/plugins/org.apache.cordova.core.network-information/test/autotest/html/SuiteView.js +++ /dev/null @@ -1,22 +0,0 @@ -jasmine.HtmlReporter.SuiteView = function(suite, dom, views) { - this.suite = suite; - this.dom = dom; - this.views = views; - - this.element = this.createDom('div', { className: 'suite' }, - this.createDom('a', { className: 'description', href: '?spec=' + encodeURIComponent(this.suite.getFullName()) }, this.suite.description) - ); - - this.appendToSummary(this.suite, this.element); -}; - -jasmine.HtmlReporter.SuiteView.prototype.status = function() { - return this.getSpecStatus(this.suite); -}; - -jasmine.HtmlReporter.SuiteView.prototype.refresh = function() { - this.element.className += " " + this.status(); -}; - -jasmine.HtmlReporterHelpers.addHelpers(jasmine.HtmlReporter.SuiteView); - diff --git a/plugins/org.apache.cordova.core.network-information/test/autotest/html/TrivialReporter.js b/plugins/org.apache.cordova.core.network-information/test/autotest/html/TrivialReporter.js deleted file mode 100644 index 167ac50..0000000 --- a/plugins/org.apache.cordova.core.network-information/test/autotest/html/TrivialReporter.js +++ /dev/null @@ -1,192 +0,0 @@ -/* @deprecated Use jasmine.HtmlReporter instead - */ -jasmine.TrivialReporter = function(doc) { - this.document = doc || document; - this.suiteDivs = {}; - this.logRunningSpecs = false; -}; - -jasmine.TrivialReporter.prototype.createDom = function(type, attrs, childrenVarArgs) { - var el = document.createElement(type); - - for (var i = 2; i < arguments.length; i++) { - var child = arguments[i]; - - if (typeof child === 'string') { - el.appendChild(document.createTextNode(child)); - } else { - if (child) { el.appendChild(child); } - } - } - - for (var attr in attrs) { - if (attr == "className") { - el[attr] = attrs[attr]; - } else { - el.setAttribute(attr, attrs[attr]); - } - } - - return el; -}; - -jasmine.TrivialReporter.prototype.reportRunnerStarting = function(runner) { - var showPassed, showSkipped; - - this.outerDiv = this.createDom('div', { id: 'TrivialReporter', className: 'jasmine_reporter' }, - this.createDom('div', { className: 'banner' }, - this.createDom('div', { className: 'logo' }, - this.createDom('span', { className: 'title' }, "Jasmine"), - this.createDom('span', { className: 'version' }, runner.env.versionString())), - this.createDom('div', { className: 'options' }, - "Show ", - showPassed = this.createDom('input', { id: "__jasmine_TrivialReporter_showPassed__", type: 'checkbox' }), - this.createDom('label', { "for": "__jasmine_TrivialReporter_showPassed__" }, " passed "), - showSkipped = this.createDom('input', { id: "__jasmine_TrivialReporter_showSkipped__", type: 'checkbox' }), - this.createDom('label', { "for": "__jasmine_TrivialReporter_showSkipped__" }, " skipped") - ) - ), - - this.runnerDiv = this.createDom('div', { className: 'runner running' }, - this.createDom('a', { className: 'run_spec', href: '?' }, "run all"), - this.runnerMessageSpan = this.createDom('span', {}, "Running..."), - this.finishedAtSpan = this.createDom('span', { className: 'finished-at' }, "")) - ); - - this.document.body.appendChild(this.outerDiv); - - var suites = runner.suites(); - for (var i = 0; i < suites.length; i++) { - var suite = suites[i]; - var suiteDiv = this.createDom('div', { className: 'suite' }, - this.createDom('a', { className: 'run_spec', href: '?spec=' + encodeURIComponent(suite.getFullName()) }, "run"), - this.createDom('a', { className: 'description', href: '?spec=' + encodeURIComponent(suite.getFullName()) }, suite.description)); - this.suiteDivs[suite.id] = suiteDiv; - var parentDiv = this.outerDiv; - if (suite.parentSuite) { - parentDiv = this.suiteDivs[suite.parentSuite.id]; - } - parentDiv.appendChild(suiteDiv); - } - - this.startedAt = new Date(); - - var self = this; - showPassed.onclick = function(evt) { - if (showPassed.checked) { - self.outerDiv.className += ' show-passed'; - } else { - self.outerDiv.className = self.outerDiv.className.replace(/ show-passed/, ''); - } - }; - - showSkipped.onclick = function(evt) { - if (showSkipped.checked) { - self.outerDiv.className += ' show-skipped'; - } else { - self.outerDiv.className = self.outerDiv.className.replace(/ show-skipped/, ''); - } - }; -}; - -jasmine.TrivialReporter.prototype.reportRunnerResults = function(runner) { - var results = runner.results(); - var className = (results.failedCount > 0) ? "runner failed" : "runner passed"; - this.runnerDiv.setAttribute("class", className); - //do it twice for IE - this.runnerDiv.setAttribute("className", className); - var specs = runner.specs(); - var specCount = 0; - for (var i = 0; i < specs.length; i++) { - if (this.specFilter(specs[i])) { - specCount++; - } - } - var message = "" + specCount + " spec" + (specCount == 1 ? "" : "s" ) + ", " + results.failedCount + " failure" + ((results.failedCount == 1) ? "" : "s"); - message += " in " + ((new Date().getTime() - this.startedAt.getTime()) / 1000) + "s"; - this.runnerMessageSpan.replaceChild(this.createDom('a', { className: 'description', href: '?'}, message), this.runnerMessageSpan.firstChild); - - this.finishedAtSpan.appendChild(document.createTextNode("Finished at " + new Date().toString())); -}; - -jasmine.TrivialReporter.prototype.reportSuiteResults = function(suite) { - var results = suite.results(); - var status = results.passed() ? 'passed' : 'failed'; - if (results.totalCount === 0) { // todo: change this to check results.skipped - status = 'skipped'; - } - this.suiteDivs[suite.id].className += " " + status; -}; - -jasmine.TrivialReporter.prototype.reportSpecStarting = function(spec) { - if (this.logRunningSpecs) { - this.log('>> Jasmine Running ' + spec.suite.description + ' ' + spec.description + '...'); - } -}; - -jasmine.TrivialReporter.prototype.reportSpecResults = function(spec) { - var results = spec.results(); - var status = results.passed() ? 'passed' : 'failed'; - if (results.skipped) { - status = 'skipped'; - } - var specDiv = this.createDom('div', { className: 'spec ' + status }, - this.createDom('a', { className: 'run_spec', href: '?spec=' + encodeURIComponent(spec.getFullName()) }, "run"), - this.createDom('a', { - className: 'description', - href: '?spec=' + encodeURIComponent(spec.getFullName()), - title: spec.getFullName() - }, spec.description)); - - - var resultItems = results.getItems(); - var messagesDiv = this.createDom('div', { className: 'messages' }); - for (var i = 0; i < resultItems.length; i++) { - var result = resultItems[i]; - - if (result.type == 'log') { - messagesDiv.appendChild(this.createDom('div', {className: 'resultMessage log'}, result.toString())); - } else if (result.type == 'expect' && result.passed && !result.passed()) { - messagesDiv.appendChild(this.createDom('div', {className: 'resultMessage fail'}, result.message)); - - if (result.trace.stack) { - messagesDiv.appendChild(this.createDom('div', {className: 'stackTrace'}, result.trace.stack)); - } - } - } - - if (messagesDiv.childNodes.length > 0) { - specDiv.appendChild(messagesDiv); - } - - this.suiteDivs[spec.suite.id].appendChild(specDiv); -}; - -jasmine.TrivialReporter.prototype.log = function() { - var console = jasmine.getGlobal().console; - if (console && console.log) { - if (console.log.apply) { - console.log.apply(console, arguments); - } else { - console.log(arguments); // ie fix: console.log.apply doesn't exist on ie - } - } -}; - -jasmine.TrivialReporter.prototype.getLocation = function() { - return this.document.location; -}; - -jasmine.TrivialReporter.prototype.specFilter = function(spec) { - var paramMap = {}; - var params = this.getLocation().search.substring(1).split('&'); - for (var i = 0; i < params.length; i++) { - var p = params[i].split('='); - paramMap[decodeURIComponent(p[0])] = decodeURIComponent(p[1]); - } - - if (!paramMap.spec) { - return true; - } - return spec.getFullName().indexOf(paramMap.spec) === 0; -}; diff --git a/plugins/org.apache.cordova.core.network-information/test/autotest/index.html b/plugins/org.apache.cordova.core.network-information/test/autotest/index.html deleted file mode 100644 index 6ebccbd..0000000 --- a/plugins/org.apache.cordova.core.network-information/test/autotest/index.html +++ /dev/null @@ -1,59 +0,0 @@ - - - - - - - - - - Cordova API Specs - - - - - -

Cordova API Specs

- - Run All Tests - Run Accelerometer Tests - Run Battery Tests - Run Camera Tests - Run Capture Tests - Run Compass Tests - Run Contacts Tests - Run Data URI Tests - Run Device Tests - Run File Tests - Run FileTransfer Tests - Run Geolocation Tests - Run Globalization Tests - Run Media Tests - Run Network Tests - Run Notification Tests - Run Platform Tests - Run Storage Tests - Run Bridge Tests - -

Back
- - diff --git a/plugins/org.apache.cordova.core.network-information/test/autotest/jasmine.css b/plugins/org.apache.cordova.core.network-information/test/autotest/jasmine.css deleted file mode 100644 index 826e575..0000000 --- a/plugins/org.apache.cordova.core.network-information/test/autotest/jasmine.css +++ /dev/null @@ -1,81 +0,0 @@ -body { background-color: #eeeeee; padding: 0; margin: 5px; overflow-y: scroll; } - -#HTMLReporter { font-size: 11px; font-family: Monaco, "Lucida Console", monospace; line-height: 14px; color: #333333; } -#HTMLReporter a { text-decoration: none; } -#HTMLReporter a:hover { text-decoration: underline; } -#HTMLReporter p, #HTMLReporter h1, #HTMLReporter h2, #HTMLReporter h3, #HTMLReporter h4, #HTMLReporter h5, #HTMLReporter h6 { margin: 0; line-height: 14px; } -#HTMLReporter .banner, #HTMLReporter .symbolSummary, #HTMLReporter .summary, #HTMLReporter .resultMessage, #HTMLReporter .specDetail .description, #HTMLReporter .alert .bar, #HTMLReporter .stackTrace { padding-left: 9px; padding-right: 9px; } -#HTMLReporter #jasmine_content { position: fixed; right: 100%; } -#HTMLReporter .version { color: #aaaaaa; } -#HTMLReporter .banner { margin-top: 14px; } -#HTMLReporter .duration { color: #aaaaaa; float: right; } -#HTMLReporter .symbolSummary { overflow: hidden; *zoom: 1; margin: 14px 0; } -#HTMLReporter .symbolSummary li { display: block; float: left; height: 7px; width: 14px; margin-bottom: 7px; font-size: 16px; } -#HTMLReporter .symbolSummary li.passed { font-size: 14px; } -#HTMLReporter .symbolSummary li.passed:before { color: #5e7d00; content: "\02022"; } -#HTMLReporter .symbolSummary li.failed { line-height: 9px; } -#HTMLReporter .symbolSummary li.failed:before { color: #b03911; content: "x"; font-weight: bold; margin-left: -1px; } -#HTMLReporter .symbolSummary li.skipped { font-size: 14px; } -#HTMLReporter .symbolSummary li.skipped:before { color: #bababa; content: "\02022"; } -#HTMLReporter .symbolSummary li.pending { line-height: 11px; } -#HTMLReporter .symbolSummary li.pending:before { color: #aaaaaa; content: "-"; } -#HTMLReporter .bar { line-height: 28px; font-size: 14px; display: block; color: #eee; } -#HTMLReporter .runningAlert { background-color: #666666; } -#HTMLReporter .skippedAlert { background-color: #aaaaaa; } -#HTMLReporter .skippedAlert:first-child { background-color: #333333; } -#HTMLReporter .skippedAlert:hover { text-decoration: none; color: white; text-decoration: underline; } -#HTMLReporter .passingAlert { background-color: #a6b779; } -#HTMLReporter .passingAlert:first-child { background-color: #5e7d00; } -#HTMLReporter .failingAlert { background-color: #cf867e; } -#HTMLReporter .failingAlert:first-child { background-color: #b03911; } -#HTMLReporter .results { margin-top: 14px; } -#HTMLReporter #details { display: none; } -#HTMLReporter .resultsMenu, #HTMLReporter .resultsMenu a { background-color: #fff; color: #333333; } -#HTMLReporter.showDetails .summaryMenuItem { font-weight: normal; text-decoration: inherit; } -#HTMLReporter.showDetails .summaryMenuItem:hover { text-decoration: underline; } -#HTMLReporter.showDetails .detailsMenuItem { font-weight: bold; text-decoration: underline; } -#HTMLReporter.showDetails .summary { display: none; } -#HTMLReporter.showDetails #details { display: block; } -#HTMLReporter .summaryMenuItem { font-weight: bold; text-decoration: underline; } -#HTMLReporter .summary { margin-top: 14px; } -#HTMLReporter .summary .suite .suite, #HTMLReporter .summary .specSummary { margin-left: 14px; } -#HTMLReporter .summary .specSummary.passed a { color: #5e7d00; } -#HTMLReporter .summary .specSummary.failed a { color: #b03911; } -#HTMLReporter .description + .suite { margin-top: 0; } -#HTMLReporter .suite { margin-top: 14px; } -#HTMLReporter .suite a { color: #333333; } -#HTMLReporter #details .specDetail { margin-bottom: 28px; } -#HTMLReporter #details .specDetail .description { display: block; color: white; background-color: #b03911; } -#HTMLReporter .resultMessage { padding-top: 14px; color: #333333; } -#HTMLReporter .resultMessage span.result { display: block; } -#HTMLReporter .stackTrace { margin: 5px 0 0 0; max-height: 224px; overflow: auto; line-height: 18px; color: #666666; border: 1px solid #ddd; background: white; white-space: pre; } - -#TrivialReporter { padding: 8px 13px; position: absolute; top: 0; bottom: 0; left: 0; right: 0; overflow-y: scroll; background-color: white; font-family: "Helvetica Neue Light", "Lucida Grande", "Calibri", "Arial", sans-serif; /*.resultMessage {*/ /*white-space: pre;*/ /*}*/ } -#TrivialReporter a:visited, #TrivialReporter a { color: #303; } -#TrivialReporter a:hover, #TrivialReporter a:active { color: blue; } -#TrivialReporter .run_spec { float: right; padding-right: 5px; font-size: .8em; text-decoration: none; } -#TrivialReporter .banner { color: #303; background-color: #fef; padding: 5px; } -#TrivialReporter .logo { float: left; font-size: 1.1em; padding-left: 5px; } -#TrivialReporter .logo .version { font-size: .6em; padding-left: 1em; } -#TrivialReporter .runner.running { background-color: yellow; } -#TrivialReporter .options { text-align: right; font-size: .8em; } -#TrivialReporter .suite { border: 1px outset gray; margin: 5px 0; padding-left: 1em; } -#TrivialReporter .suite .suite { margin: 5px; } -#TrivialReporter .suite.passed { background-color: #dfd; } -#TrivialReporter .suite.failed { background-color: #fdd; } -#TrivialReporter .spec { margin: 5px; padding-left: 1em; clear: both; } -#TrivialReporter .spec.failed, #TrivialReporter .spec.passed, #TrivialReporter .spec.skipped { padding-bottom: 5px; border: 1px solid gray; } -#TrivialReporter .spec.failed { background-color: #fbb; border-color: red; } -#TrivialReporter .spec.passed { background-color: #bfb; border-color: green; } -#TrivialReporter .spec.skipped { background-color: #bbb; } -#TrivialReporter .messages { border-left: 1px dashed gray; padding-left: 1em; padding-right: 1em; } -#TrivialReporter .passed { background-color: #cfc; display: none; } -#TrivialReporter .failed { background-color: #fbb; } -#TrivialReporter .skipped { color: #777; background-color: #eee; display: none; } -#TrivialReporter .resultMessage span.result { display: block; line-height: 2em; color: black; } -#TrivialReporter .resultMessage .mismatch { color: black; } -#TrivialReporter .stackTrace { white-space: pre; font-size: .8em; margin-left: 10px; max-height: 5em; overflow: auto; border: 1px inset red; padding: 1em; background: #eef; } -#TrivialReporter .finished-at { padding-left: 1em; font-size: .6em; } -#TrivialReporter.show-passed .passed, #TrivialReporter.show-skipped .skipped { display: block; } -#TrivialReporter #jasmine_content { position: fixed; right: 100%; } -#TrivialReporter .runner { border: 1px solid gray; display: block; margin: 5px 0; padding: 2px 0 2px 10px; } diff --git a/plugins/org.apache.cordova.core.network-information/test/autotest/jasmine.js b/plugins/org.apache.cordova.core.network-information/test/autotest/jasmine.js deleted file mode 100644 index bccb66c..0000000 --- a/plugins/org.apache.cordova.core.network-information/test/autotest/jasmine.js +++ /dev/null @@ -1,2530 +0,0 @@ -var isCommonJS = typeof window == "undefined"; - -/** - * Top level namespace for Jasmine, a lightweight JavaScript BDD/spec/testing framework. - * - * @namespace - */ -var jasmine = {}; -if (isCommonJS) exports.jasmine = jasmine; -/** - * @private - */ -jasmine.unimplementedMethod_ = function() { - throw new Error("unimplemented method"); -}; - -/** - * Use jasmine.undefined instead of undefined, since undefined is just - * a plain old variable and may be redefined by somebody else. - * - * @private - */ -jasmine.undefined = jasmine.___undefined___; - -/** - * Show diagnostic messages in the console if set to true - * - */ -jasmine.VERBOSE = false; - -/** - * Default interval in milliseconds for event loop yields (e.g. to allow network activity or to refresh the screen with the HTML-based runner). Small values here may result in slow test running. Zero means no updates until all tests have completed. - * - */ -jasmine.DEFAULT_UPDATE_INTERVAL = 250; - -/** - * Default timeout interval in milliseconds for waitsFor() blocks. - */ -jasmine.DEFAULT_TIMEOUT_INTERVAL = 5000; - -jasmine.getGlobal = function() { - function getGlobal() { - return this; - } - - return getGlobal(); -}; - -/** - * Allows for bound functions to be compared. Internal use only. - * - * @ignore - * @private - * @param base {Object} bound 'this' for the function - * @param name {Function} function to find - */ -jasmine.bindOriginal_ = function(base, name) { - var original = base[name]; - if (original.apply) { - return function() { - return original.apply(base, arguments); - }; - } else { - // IE support - return jasmine.getGlobal()[name]; - } -}; - -jasmine.setTimeout = jasmine.bindOriginal_(jasmine.getGlobal(), 'setTimeout'); -jasmine.clearTimeout = jasmine.bindOriginal_(jasmine.getGlobal(), 'clearTimeout'); -jasmine.setInterval = jasmine.bindOriginal_(jasmine.getGlobal(), 'setInterval'); -jasmine.clearInterval = jasmine.bindOriginal_(jasmine.getGlobal(), 'clearInterval'); - -jasmine.MessageResult = function(values) { - this.type = 'log'; - this.values = values; - this.trace = new Error(); // todo: test better -}; - -jasmine.MessageResult.prototype.toString = function() { - var text = ""; - for (var i = 0; i < this.values.length; i++) { - if (i > 0) text += " "; - if (jasmine.isString_(this.values[i])) { - text += this.values[i]; - } else { - text += jasmine.pp(this.values[i]); - } - } - return text; -}; - -jasmine.ExpectationResult = function(params) { - this.type = 'expect'; - this.matcherName = params.matcherName; - this.passed_ = params.passed; - this.expected = params.expected; - this.actual = params.actual; - this.message = this.passed_ ? 'Passed.' : params.message; - - var trace = (params.trace || new Error(this.message)); - this.trace = this.passed_ ? '' : trace; -}; - -jasmine.ExpectationResult.prototype.toString = function () { - return this.message; -}; - -jasmine.ExpectationResult.prototype.passed = function () { - return this.passed_; -}; - -/** - * Getter for the Jasmine environment. Ensures one gets created - */ -jasmine.getEnv = function() { - var env = jasmine.currentEnv_ = jasmine.currentEnv_ || new jasmine.Env(); - return env; -}; - -/** - * @ignore - * @private - * @param value - * @returns {Boolean} - */ -jasmine.isArray_ = function(value) { - return jasmine.isA_("Array", value); -}; - -/** - * @ignore - * @private - * @param value - * @returns {Boolean} - */ -jasmine.isString_ = function(value) { - return jasmine.isA_("String", value); -}; - -/** - * @ignore - * @private - * @param value - * @returns {Boolean} - */ -jasmine.isNumber_ = function(value) { - return jasmine.isA_("Number", value); -}; - -/** - * @ignore - * @private - * @param {String} typeName - * @param value - * @returns {Boolean} - */ -jasmine.isA_ = function(typeName, value) { - return Object.prototype.toString.apply(value) === '[object ' + typeName + ']'; -}; - -/** - * Pretty printer for expecations. Takes any object and turns it into a human-readable string. - * - * @param value {Object} an object to be outputted - * @returns {String} - */ -jasmine.pp = function(value) { - var stringPrettyPrinter = new jasmine.StringPrettyPrinter(); - stringPrettyPrinter.format(value); - return stringPrettyPrinter.string; -}; - -/** - * Returns true if the object is a DOM Node. - * - * @param {Object} obj object to check - * @returns {Boolean} - */ -jasmine.isDomNode = function(obj) { - return obj.nodeType > 0; -}; - -/** - * Returns a matchable 'generic' object of the class type. For use in expecations of type when values don't matter. - * - * @example - * // don't care about which function is passed in, as long as it's a function - * expect(mySpy).toHaveBeenCalledWith(jasmine.any(Function)); - * - * @param {Class} clazz - * @returns matchable object of the type clazz - */ -jasmine.any = function(clazz) { - return new jasmine.Matchers.Any(clazz); -}; - -/** - * Returns a matchable subset of a JSON object. For use in expectations when you don't care about all of the - * attributes on the object. - * - * @example - * // don't care about any other attributes than foo. - * expect(mySpy).toHaveBeenCalledWith(jasmine.objectContaining({foo: "bar"}); - * - * @param sample {Object} sample - * @returns matchable object for the sample - */ -jasmine.objectContaining = function (sample) { - return new jasmine.Matchers.ObjectContaining(sample); -}; - -/** - * Jasmine Spies are test doubles that can act as stubs, spies, fakes or when used in an expecation, mocks. - * - * Spies should be created in test setup, before expectations. They can then be checked, using the standard Jasmine - * expectation syntax. Spies can be checked if they were called or not and what the calling params were. - * - * A Spy has the following fields: wasCalled, callCount, mostRecentCall, and argsForCall (see docs). - * - * Spies are torn down at the end of every spec. - * - * Note: Do not call new jasmine.Spy() directly - a spy must be created using spyOn, jasmine.createSpy or jasmine.createSpyObj. - * - * @example - * // a stub - * var myStub = jasmine.createSpy('myStub'); // can be used anywhere - * - * // spy example - * var foo = { - * not: function(bool) { return !bool; } - * } - * - * // actual foo.not will not be called, execution stops - * spyOn(foo, 'not'); - - // foo.not spied upon, execution will continue to implementation - * spyOn(foo, 'not').andCallThrough(); - * - * // fake example - * var foo = { - * not: function(bool) { return !bool; } - * } - * - * // foo.not(val) will return val - * spyOn(foo, 'not').andCallFake(function(value) {return value;}); - * - * // mock example - * foo.not(7 == 7); - * expect(foo.not).toHaveBeenCalled(); - * expect(foo.not).toHaveBeenCalledWith(true); - * - * @constructor - * @see spyOn, jasmine.createSpy, jasmine.createSpyObj - * @param {String} name - */ -jasmine.Spy = function(name) { - /** - * The name of the spy, if provided. - */ - this.identity = name || 'unknown'; - /** - * Is this Object a spy? - */ - this.isSpy = true; - /** - * The actual function this spy stubs. - */ - this.plan = function() { - }; - /** - * Tracking of the most recent call to the spy. - * @example - * var mySpy = jasmine.createSpy('foo'); - * mySpy(1, 2); - * mySpy.mostRecentCall.args = [1, 2]; - */ - this.mostRecentCall = {}; - - /** - * Holds arguments for each call to the spy, indexed by call count - * @example - * var mySpy = jasmine.createSpy('foo'); - * mySpy(1, 2); - * mySpy(7, 8); - * mySpy.mostRecentCall.args = [7, 8]; - * mySpy.argsForCall[0] = [1, 2]; - * mySpy.argsForCall[1] = [7, 8]; - */ - this.argsForCall = []; - this.calls = []; -}; - -/** - * Tells a spy to call through to the actual implemenatation. - * - * @example - * var foo = { - * bar: function() { // do some stuff } - * } - * - * // defining a spy on an existing property: foo.bar - * spyOn(foo, 'bar').andCallThrough(); - */ -jasmine.Spy.prototype.andCallThrough = function() { - this.plan = this.originalValue; - return this; -}; - -/** - * For setting the return value of a spy. - * - * @example - * // defining a spy from scratch: foo() returns 'baz' - * var foo = jasmine.createSpy('spy on foo').andReturn('baz'); - * - * // defining a spy on an existing property: foo.bar() returns 'baz' - * spyOn(foo, 'bar').andReturn('baz'); - * - * @param {Object} value - */ -jasmine.Spy.prototype.andReturn = function(value) { - this.plan = function() { - return value; - }; - return this; -}; - -/** - * For throwing an exception when a spy is called. - * - * @example - * // defining a spy from scratch: foo() throws an exception w/ message 'ouch' - * var foo = jasmine.createSpy('spy on foo').andThrow('baz'); - * - * // defining a spy on an existing property: foo.bar() throws an exception w/ message 'ouch' - * spyOn(foo, 'bar').andThrow('baz'); - * - * @param {String} exceptionMsg - */ -jasmine.Spy.prototype.andThrow = function(exceptionMsg) { - this.plan = function() { - throw exceptionMsg; - }; - return this; -}; - -/** - * Calls an alternate implementation when a spy is called. - * - * @example - * var baz = function() { - * // do some stuff, return something - * } - * // defining a spy from scratch: foo() calls the function baz - * var foo = jasmine.createSpy('spy on foo').andCall(baz); - * - * // defining a spy on an existing property: foo.bar() calls an anonymnous function - * spyOn(foo, 'bar').andCall(function() { return 'baz';} ); - * - * @param {Function} fakeFunc - */ -jasmine.Spy.prototype.andCallFake = function(fakeFunc) { - this.plan = fakeFunc; - return this; -}; - -/** - * Resets all of a spy's the tracking variables so that it can be used again. - * - * @example - * spyOn(foo, 'bar'); - * - * foo.bar(); - * - * expect(foo.bar.callCount).toEqual(1); - * - * foo.bar.reset(); - * - * expect(foo.bar.callCount).toEqual(0); - */ -jasmine.Spy.prototype.reset = function() { - this.wasCalled = false; - this.callCount = 0; - this.argsForCall = []; - this.calls = []; - this.mostRecentCall = {}; -}; - -jasmine.createSpy = function(name) { - - var spyObj = function() { - spyObj.wasCalled = true; - spyObj.callCount++; - var args = jasmine.util.argsToArray(arguments); - spyObj.mostRecentCall.object = this; - spyObj.mostRecentCall.args = args; - spyObj.argsForCall.push(args); - spyObj.calls.push({object: this, args: args}); - return spyObj.plan.apply(this, arguments); - }; - - var spy = new jasmine.Spy(name); - - for (var prop in spy) { - spyObj[prop] = spy[prop]; - } - - spyObj.reset(); - - return spyObj; -}; - -/** - * Determines whether an object is a spy. - * - * @param {jasmine.Spy|Object} putativeSpy - * @returns {Boolean} - */ -jasmine.isSpy = function(putativeSpy) { - return putativeSpy && putativeSpy.isSpy; -}; - -/** - * Creates a more complicated spy: an Object that has every property a function that is a spy. Used for stubbing something - * large in one call. - * - * @param {String} baseName name of spy class - * @param {Array} methodNames array of names of methods to make spies - */ -jasmine.createSpyObj = function(baseName, methodNames) { - if (!jasmine.isArray_(methodNames) || methodNames.length === 0) { - throw new Error('createSpyObj requires a non-empty array of method names to create spies for'); - } - var obj = {}; - for (var i = 0; i < methodNames.length; i++) { - obj[methodNames[i]] = jasmine.createSpy(baseName + '.' + methodNames[i]); - } - return obj; -}; - -/** - * All parameters are pretty-printed and concatenated together, then written to the current spec's output. - * - * Be careful not to leave calls to jasmine.log in production code. - */ -jasmine.log = function() { - var spec = jasmine.getEnv().currentSpec; - spec.log.apply(spec, arguments); -}; - -/** - * Function that installs a spy on an existing object's method name. Used within a Spec to create a spy. - * - * @example - * // spy example - * var foo = { - * not: function(bool) { return !bool; } - * } - * spyOn(foo, 'not'); // actual foo.not will not be called, execution stops - * - * @see jasmine.createSpy - * @param obj - * @param methodName - * @returns a Jasmine spy that can be chained with all spy methods - */ -var spyOn = function(obj, methodName) { - return jasmine.getEnv().currentSpec.spyOn(obj, methodName); -}; -if (isCommonJS) exports.spyOn = spyOn; - -/** - * Creates a Jasmine spec that will be added to the current suite. - * - * // TODO: pending tests - * - * @example - * it('should be true', function() { - * expect(true).toEqual(true); - * }); - * - * @param {String} desc description of this specification - * @param {Function} func defines the preconditions and expectations of the spec - */ -var it = function(desc, func) { - return jasmine.getEnv().it(desc, func); -}; -if (isCommonJS) exports.it = it; - -/** - * Creates a disabled Jasmine spec. - * - * A convenience method that allows existing specs to be disabled temporarily during development. - * - * @param {String} desc description of this specification - * @param {Function} func defines the preconditions and expectations of the spec - */ -var xit = function(desc, func) { - return jasmine.getEnv().xit(desc, func); -}; -if (isCommonJS) exports.xit = xit; - -/** - * Starts a chain for a Jasmine expectation. - * - * It is passed an Object that is the actual value and should chain to one of the many - * jasmine.Matchers functions. - * - * @param {Object} actual Actual value to test against and expected value - */ -var expect = function(actual) { - return jasmine.getEnv().currentSpec.expect(actual); -}; -if (isCommonJS) exports.expect = expect; - -/** - * Defines part of a jasmine spec. Used in cominbination with waits or waitsFor in asynchrnous specs. - * - * @param {Function} func Function that defines part of a jasmine spec. - */ -var runs = function(func) { - jasmine.getEnv().currentSpec.runs(func); -}; -if (isCommonJS) exports.runs = runs; - -/** - * Waits a fixed time period before moving to the next block. - * - * @deprecated Use waitsFor() instead - * @param {Number} timeout milliseconds to wait - */ -var waits = function(timeout) { - jasmine.getEnv().currentSpec.waits(timeout); -}; -if (isCommonJS) exports.waits = waits; - -/** - * Waits for the latchFunction to return true before proceeding to the next block. - * - * @param {Function} latchFunction - * @param {String} optional_timeoutMessage - * @param {Number} optional_timeout - */ -var waitsFor = function(latchFunction, optional_timeoutMessage, optional_timeout) { - jasmine.getEnv().currentSpec.waitsFor.apply(jasmine.getEnv().currentSpec, arguments); -}; -if (isCommonJS) exports.waitsFor = waitsFor; - -/** - * A function that is called before each spec in a suite. - * - * Used for spec setup, including validating assumptions. - * - * @param {Function} beforeEachFunction - */ -var beforeEach = function(beforeEachFunction) { - jasmine.getEnv().beforeEach(beforeEachFunction); -}; -if (isCommonJS) exports.beforeEach = beforeEach; - -/** - * A function that is called after each spec in a suite. - * - * Used for restoring any state that is hijacked during spec execution. - * - * @param {Function} afterEachFunction - */ -var afterEach = function(afterEachFunction) { - jasmine.getEnv().afterEach(afterEachFunction); -}; -if (isCommonJS) exports.afterEach = afterEach; - -/** - * Defines a suite of specifications. - * - * Stores the description and all defined specs in the Jasmine environment as one suite of specs. Variables declared - * are accessible by calls to beforeEach, it, and afterEach. Describe blocks can be nested, allowing for specialization - * of setup in some tests. - * - * @example - * // TODO: a simple suite - * - * // TODO: a simple suite with a nested describe block - * - * @param {String} description A string, usually the class under test. - * @param {Function} specDefinitions function that defines several specs. - */ -var describe = function(description, specDefinitions) { - return jasmine.getEnv().describe(description, specDefinitions); -}; -if (isCommonJS) exports.describe = describe; - -/** - * Disables a suite of specifications. Used to disable some suites in a file, or files, temporarily during development. - * - * @param {String} description A string, usually the class under test. - * @param {Function} specDefinitions function that defines several specs. - */ -var xdescribe = function(description, specDefinitions) { - return jasmine.getEnv().xdescribe(description, specDefinitions); -}; -if (isCommonJS) exports.xdescribe = xdescribe; - - -// Provide the XMLHttpRequest class for IE 5.x-6.x: -jasmine.XmlHttpRequest = (typeof XMLHttpRequest == "undefined") ? function() { - function tryIt(f) { - try { - return f(); - } catch(e) { - } - return null; - } - - var xhr = tryIt(function() { - return new ActiveXObject("Msxml2.XMLHTTP.6.0"); - }) || - tryIt(function() { - return new ActiveXObject("Msxml2.XMLHTTP.3.0"); - }) || - tryIt(function() { - return new ActiveXObject("Msxml2.XMLHTTP"); - }) || - tryIt(function() { - return new ActiveXObject("Microsoft.XMLHTTP"); - }); - - if (!xhr) throw new Error("This browser does not support XMLHttpRequest."); - - return xhr; -} : XMLHttpRequest; -/** - * @namespace - */ -jasmine.util = {}; - -/** - * Declare that a child class inherit it's prototype from the parent class. - * - * @private - * @param {Function} childClass - * @param {Function} parentClass - */ -jasmine.util.inherit = function(childClass, parentClass) { - /** - * @private - */ - var subclass = function() { - }; - subclass.prototype = parentClass.prototype; - childClass.prototype = new subclass(); -}; - -jasmine.util.formatException = function(e) { - var lineNumber; - if (e.line) { - lineNumber = e.line; - } - else if (e.lineNumber) { - lineNumber = e.lineNumber; - } - - var file; - - if (e.sourceURL) { - file = e.sourceURL; - } - else if (e.fileName) { - file = e.fileName; - } - - var message = (e.name && e.message) ? (e.name + ': ' + e.message) : e.toString(); - - if (file && lineNumber) { - message += ' in ' + file + ' (line ' + lineNumber + ')'; - } - - return message; -}; - -jasmine.util.htmlEscape = function(str) { - if (!str) return str; - return str.replace(/&/g, '&') - .replace(//g, '>'); -}; - -jasmine.util.argsToArray = function(args) { - var arrayOfArgs = []; - for (var i = 0; i < args.length; i++) arrayOfArgs.push(args[i]); - return arrayOfArgs; -}; - -jasmine.util.extend = function(destination, source) { - for (var property in source) destination[property] = source[property]; - return destination; -}; - -/** - * Environment for Jasmine - * - * @constructor - */ -jasmine.Env = function() { - this.currentSpec = null; - this.currentSuite = null; - this.currentRunner_ = new jasmine.Runner(this); - - this.reporter = new jasmine.MultiReporter(); - - this.updateInterval = jasmine.DEFAULT_UPDATE_INTERVAL; - this.defaultTimeoutInterval = jasmine.DEFAULT_TIMEOUT_INTERVAL; - this.lastUpdate = 0; - this.specFilter = function() { - return true; - }; - - this.nextSpecId_ = 0; - this.nextSuiteId_ = 0; - this.equalityTesters_ = []; - - // wrap matchers - this.matchersClass = function() { - jasmine.Matchers.apply(this, arguments); - }; - jasmine.util.inherit(this.matchersClass, jasmine.Matchers); - - jasmine.Matchers.wrapInto_(jasmine.Matchers.prototype, this.matchersClass); -}; - - -jasmine.Env.prototype.setTimeout = jasmine.setTimeout; -jasmine.Env.prototype.clearTimeout = jasmine.clearTimeout; -jasmine.Env.prototype.setInterval = jasmine.setInterval; -jasmine.Env.prototype.clearInterval = jasmine.clearInterval; - -/** - * @returns an object containing jasmine version build info, if set. - */ -jasmine.Env.prototype.version = function () { - if (jasmine.version_) { - return jasmine.version_; - } else { - throw new Error('Version not set'); - } -}; - -/** - * @returns string containing jasmine version build info, if set. - */ -jasmine.Env.prototype.versionString = function() { - if (!jasmine.version_) { - return "version unknown"; - } - - var version = this.version(); - var versionString = version.major + "." + version.minor + "." + version.build; - if (version.release_candidate) { - versionString += ".rc" + version.release_candidate; - } - versionString += " revision " + version.revision; - return versionString; -}; - -/** - * @returns a sequential integer starting at 0 - */ -jasmine.Env.prototype.nextSpecId = function () { - return this.nextSpecId_++; -}; - -/** - * @returns a sequential integer starting at 0 - */ -jasmine.Env.prototype.nextSuiteId = function () { - return this.nextSuiteId_++; -}; - -/** - * Register a reporter to receive status updates from Jasmine. - * @param {jasmine.Reporter} reporter An object which will receive status updates. - */ -jasmine.Env.prototype.addReporter = function(reporter) { - this.reporter.addReporter(reporter); -}; - -jasmine.Env.prototype.execute = function() { - this.currentRunner_.execute(); -}; - -jasmine.Env.prototype.describe = function(description, specDefinitions) { - var suite = new jasmine.Suite(this, description, specDefinitions, this.currentSuite); - - var parentSuite = this.currentSuite; - if (parentSuite) { - parentSuite.add(suite); - } else { - this.currentRunner_.add(suite); - } - - this.currentSuite = suite; - - var declarationError = null; - try { - specDefinitions.call(suite); - } catch(e) { - declarationError = e; - } - - if (declarationError) { - this.it("encountered a declaration exception", function() { - throw declarationError; - }); - } - - this.currentSuite = parentSuite; - - return suite; -}; - -jasmine.Env.prototype.beforeEach = function(beforeEachFunction) { - if (this.currentSuite) { - this.currentSuite.beforeEach(beforeEachFunction); - } else { - this.currentRunner_.beforeEach(beforeEachFunction); - } -}; - -jasmine.Env.prototype.currentRunner = function () { - return this.currentRunner_; -}; - -jasmine.Env.prototype.afterEach = function(afterEachFunction) { - if (this.currentSuite) { - this.currentSuite.afterEach(afterEachFunction); - } else { - this.currentRunner_.afterEach(afterEachFunction); - } - -}; - -jasmine.Env.prototype.xdescribe = function(desc, specDefinitions) { - return { - execute: function() { - } - }; -}; - -jasmine.Env.prototype.it = function(description, func) { - var spec = new jasmine.Spec(this, this.currentSuite, description); - this.currentSuite.add(spec); - this.currentSpec = spec; - - if (func) { - spec.runs(func); - } - - return spec; -}; - -jasmine.Env.prototype.xit = function(desc, func) { - return { - id: this.nextSpecId(), - runs: function() { - } - }; -}; - -jasmine.Env.prototype.compareObjects_ = function(a, b, mismatchKeys, mismatchValues) { - if (a.__Jasmine_been_here_before__ === b && b.__Jasmine_been_here_before__ === a) { - return true; - } - - a.__Jasmine_been_here_before__ = b; - b.__Jasmine_been_here_before__ = a; - - var hasKey = function(obj, keyName) { - return obj !== null && obj[keyName] !== jasmine.undefined; - }; - - for (var property in b) { - if (!hasKey(a, property) && hasKey(b, property)) { - mismatchKeys.push("expected has key '" + property + "', but missing from actual."); - } - } - for (property in a) { - if (!hasKey(b, property) && hasKey(a, property)) { - mismatchKeys.push("expected missing key '" + property + "', but present in actual."); - } - } - for (property in b) { - if (property == '__Jasmine_been_here_before__') continue; - if (!this.equals_(a[property], b[property], mismatchKeys, mismatchValues)) { - mismatchValues.push("'" + property + "' was '" + (b[property] ? jasmine.util.htmlEscape(b[property].toString()) : b[property]) + "' in expected, but was '" + (a[property] ? jasmine.util.htmlEscape(a[property].toString()) : a[property]) + "' in actual."); - } - } - - if (jasmine.isArray_(a) && jasmine.isArray_(b) && a.length != b.length) { - mismatchValues.push("arrays were not the same length"); - } - - delete a.__Jasmine_been_here_before__; - delete b.__Jasmine_been_here_before__; - return (mismatchKeys.length === 0 && mismatchValues.length === 0); -}; - -jasmine.Env.prototype.equals_ = function(a, b, mismatchKeys, mismatchValues) { - mismatchKeys = mismatchKeys || []; - mismatchValues = mismatchValues || []; - - for (var i = 0; i < this.equalityTesters_.length; i++) { - var equalityTester = this.equalityTesters_[i]; - var result = equalityTester(a, b, this, mismatchKeys, mismatchValues); - if (result !== jasmine.undefined) return result; - } - - if (a === b) return true; - - if (a === jasmine.undefined || a === null || b === jasmine.undefined || b === null) { - return (a == jasmine.undefined && b == jasmine.undefined); - } - - if (jasmine.isDomNode(a) && jasmine.isDomNode(b)) { - return a === b; - } - - if (a instanceof Date && b instanceof Date) { - return a.getTime() == b.getTime(); - } - - if (a.jasmineMatches) { - return a.jasmineMatches(b); - } - - if (b.jasmineMatches) { - return b.jasmineMatches(a); - } - - if (a instanceof jasmine.Matchers.ObjectContaining) { - return a.matches(b); - } - - if (b instanceof jasmine.Matchers.ObjectContaining) { - return b.matches(a); - } - - if (jasmine.isString_(a) && jasmine.isString_(b)) { - return (a == b); - } - - if (jasmine.isNumber_(a) && jasmine.isNumber_(b)) { - return (a == b); - } - - if (typeof a === "object" && typeof b === "object") { - return this.compareObjects_(a, b, mismatchKeys, mismatchValues); - } - - //Straight check - return (a === b); -}; - -jasmine.Env.prototype.contains_ = function(haystack, needle) { - if (jasmine.isArray_(haystack)) { - for (var i = 0; i < haystack.length; i++) { - if (this.equals_(haystack[i], needle)) return true; - } - return false; - } - return haystack.indexOf(needle) >= 0; -}; - -jasmine.Env.prototype.addEqualityTester = function(equalityTester) { - this.equalityTesters_.push(equalityTester); -}; -/** No-op base class for Jasmine reporters. - * - * @constructor - */ -jasmine.Reporter = function() { -}; - -//noinspection JSUnusedLocalSymbols -jasmine.Reporter.prototype.reportRunnerStarting = function(runner) { -}; - -//noinspection JSUnusedLocalSymbols -jasmine.Reporter.prototype.reportRunnerResults = function(runner) { -}; - -//noinspection JSUnusedLocalSymbols -jasmine.Reporter.prototype.reportSuiteResults = function(suite) { -}; - -//noinspection JSUnusedLocalSymbols -jasmine.Reporter.prototype.reportSpecStarting = function(spec) { -}; - -//noinspection JSUnusedLocalSymbols -jasmine.Reporter.prototype.reportSpecResults = function(spec) { -}; - -//noinspection JSUnusedLocalSymbols -jasmine.Reporter.prototype.log = function(str) { -}; - -/** - * Blocks are functions with executable code that make up a spec. - * - * @constructor - * @param {jasmine.Env} env - * @param {Function} func - * @param {jasmine.Spec} spec - */ -jasmine.Block = function(env, func, spec) { - this.env = env; - this.func = func; - this.spec = spec; -}; - -jasmine.Block.prototype.execute = function(onComplete) { - try { - this.func.apply(this.spec); - } catch (e) { - this.spec.fail(e); - } - onComplete(); -}; -/** JavaScript API reporter. - * - * @constructor - */ -jasmine.JsApiReporter = function() { - this.started = false; - this.finished = false; - this.suites_ = []; - this.results_ = {}; -}; - -jasmine.JsApiReporter.prototype.reportRunnerStarting = function(runner) { - this.started = true; - var suites = runner.topLevelSuites(); - for (var i = 0; i < suites.length; i++) { - var suite = suites[i]; - this.suites_.push(this.summarize_(suite)); - } -}; - -jasmine.JsApiReporter.prototype.suites = function() { - return this.suites_; -}; - -jasmine.JsApiReporter.prototype.summarize_ = function(suiteOrSpec) { - var isSuite = suiteOrSpec instanceof jasmine.Suite; - var summary = { - id: suiteOrSpec.id, - name: suiteOrSpec.description, - type: isSuite ? 'suite' : 'spec', - children: [] - }; - - if (isSuite) { - var children = suiteOrSpec.children(); - for (var i = 0; i < children.length; i++) { - summary.children.push(this.summarize_(children[i])); - } - } - return summary; -}; - -jasmine.JsApiReporter.prototype.results = function() { - return this.results_; -}; - -jasmine.JsApiReporter.prototype.resultsForSpec = function(specId) { - return this.results_[specId]; -}; - -//noinspection JSUnusedLocalSymbols -jasmine.JsApiReporter.prototype.reportRunnerResults = function(runner) { - this.finished = true; -}; - -//noinspection JSUnusedLocalSymbols -jasmine.JsApiReporter.prototype.reportSuiteResults = function(suite) { -}; - -//noinspection JSUnusedLocalSymbols -jasmine.JsApiReporter.prototype.reportSpecResults = function(spec) { - this.results_[spec.id] = { - messages: spec.results().getItems(), - result: spec.results().failedCount > 0 ? "failed" : "passed" - }; -}; - -//noinspection JSUnusedLocalSymbols -jasmine.JsApiReporter.prototype.log = function(str) { -}; - -jasmine.JsApiReporter.prototype.resultsForSpecs = function(specIds){ - var results = {}; - for (var i = 0; i < specIds.length; i++) { - var specId = specIds[i]; - results[specId] = this.summarizeResult_(this.results_[specId]); - } - return results; -}; - -jasmine.JsApiReporter.prototype.summarizeResult_ = function(result){ - var summaryMessages = []; - var messagesLength = result.messages.length; - for (var messageIndex = 0; messageIndex < messagesLength; messageIndex++) { - var resultMessage = result.messages[messageIndex]; - summaryMessages.push({ - text: resultMessage.type == 'log' ? resultMessage.toString() : jasmine.undefined, - passed: resultMessage.passed ? resultMessage.passed() : true, - type: resultMessage.type, - message: resultMessage.message, - trace: { - stack: resultMessage.passed && !resultMessage.passed() ? resultMessage.trace.stack : jasmine.undefined - } - }); - } - - return { - result : result.result, - messages : summaryMessages - }; -}; - -/** - * @constructor - * @param {jasmine.Env} env - * @param actual - * @param {jasmine.Spec} spec - */ -jasmine.Matchers = function(env, actual, spec, opt_isNot) { - this.env = env; - this.actual = actual; - this.spec = spec; - this.isNot = opt_isNot || false; - this.reportWasCalled_ = false; -}; - -// todo: @deprecated as of Jasmine 0.11, remove soon [xw] -jasmine.Matchers.pp = function(str) { - throw new Error("jasmine.Matchers.pp() is no longer supported, please use jasmine.pp() instead!"); -}; - -// todo: @deprecated Deprecated as of Jasmine 0.10. Rewrite your custom matchers to return true or false. [xw] -jasmine.Matchers.prototype.report = function(result, failing_message, details) { - throw new Error("As of jasmine 0.11, custom matchers must be implemented differently -- please see jasmine docs"); -}; - -jasmine.Matchers.wrapInto_ = function(prototype, matchersClass) { - for (var methodName in prototype) { - if (methodName == 'report') continue; - var orig = prototype[methodName]; - matchersClass.prototype[methodName] = jasmine.Matchers.matcherFn_(methodName, orig); - } -}; - -jasmine.Matchers.matcherFn_ = function(matcherName, matcherFunction) { - return function() { - var matcherArgs = jasmine.util.argsToArray(arguments); - var result = matcherFunction.apply(this, arguments); - - if (this.isNot) { - result = !result; - } - - if (this.reportWasCalled_) return result; - - var message; - if (!result) { - if (this.message) { - message = this.message.apply(this, arguments); - if (jasmine.isArray_(message)) { - message = message[this.isNot ? 1 : 0]; - } - } else { - var englishyPredicate = matcherName.replace(/[A-Z]/g, function(s) { return ' ' + s.toLowerCase(); }); - message = "Expected " + jasmine.pp(this.actual) + (this.isNot ? " not " : " ") + englishyPredicate; - if (matcherArgs.length > 0) { - for (var i = 0; i < matcherArgs.length; i++) { - if (i > 0) message += ","; - message += " " + jasmine.pp(matcherArgs[i]); - } - } - message += "."; - } - } - var expectationResult = new jasmine.ExpectationResult({ - matcherName: matcherName, - passed: result, - expected: matcherArgs.length > 1 ? matcherArgs : matcherArgs[0], - actual: this.actual, - message: message - }); - this.spec.addMatcherResult(expectationResult); - return jasmine.undefined; - }; -}; - - - - -/** - * toBe: compares the actual to the expected using === - * @param expected - */ -jasmine.Matchers.prototype.toBe = function(expected) { - return this.actual === expected; -}; - -/** - * toNotBe: compares the actual to the expected using !== - * @param expected - * @deprecated as of 1.0. Use not.toBe() instead. - */ -jasmine.Matchers.prototype.toNotBe = function(expected) { - return this.actual !== expected; -}; - -/** - * toEqual: compares the actual to the expected using common sense equality. Handles Objects, Arrays, etc. - * - * @param expected - */ -jasmine.Matchers.prototype.toEqual = function(expected) { - return this.env.equals_(this.actual, expected); -}; - -/** - * toNotEqual: compares the actual to the expected using the ! of jasmine.Matchers.toEqual - * @param expected - * @deprecated as of 1.0. Use not.toEqual() instead. - */ -jasmine.Matchers.prototype.toNotEqual = function(expected) { - return !this.env.equals_(this.actual, expected); -}; - -/** - * Matcher that compares the actual to the expected using a regular expression. Constructs a RegExp, so takes - * a pattern or a String. - * - * @param expected - */ -jasmine.Matchers.prototype.toMatch = function(expected) { - return new RegExp(expected).test(this.actual); -}; - -/** - * Matcher that compares the actual to the expected using the boolean inverse of jasmine.Matchers.toMatch - * @param expected - * @deprecated as of 1.0. Use not.toMatch() instead. - */ -jasmine.Matchers.prototype.toNotMatch = function(expected) { - return !(new RegExp(expected).test(this.actual)); -}; - -/** - * Matcher that compares the actual to jasmine.undefined. - */ -jasmine.Matchers.prototype.toBeDefined = function() { - return (this.actual !== jasmine.undefined); -}; - -/** - * Matcher that compares the actual to jasmine.undefined. - */ -jasmine.Matchers.prototype.toBeUndefined = function() { - return (this.actual === jasmine.undefined); -}; - -/** - * Matcher that compares the actual to null. - */ -jasmine.Matchers.prototype.toBeNull = function() { - return (this.actual === null); -}; - -/** - * Matcher that boolean not-nots the actual. - */ -jasmine.Matchers.prototype.toBeTruthy = function() { - return !!this.actual; -}; - - -/** - * Matcher that boolean nots the actual. - */ -jasmine.Matchers.prototype.toBeFalsy = function() { - return !this.actual; -}; - - -/** - * Matcher that checks to see if the actual, a Jasmine spy, was called. - */ -jasmine.Matchers.prototype.toHaveBeenCalled = function() { - if (arguments.length > 0) { - throw new Error('toHaveBeenCalled does not take arguments, use toHaveBeenCalledWith'); - } - - if (!jasmine.isSpy(this.actual)) { - throw new Error('Expected a spy, but got ' + jasmine.pp(this.actual) + '.'); - } - - this.message = function() { - return [ - "Expected spy " + this.actual.identity + " to have been called.", - "Expected spy " + this.actual.identity + " not to have been called." - ]; - }; - - return this.actual.wasCalled; -}; - -/** @deprecated Use expect(xxx).toHaveBeenCalled() instead */ -jasmine.Matchers.prototype.wasCalled = jasmine.Matchers.prototype.toHaveBeenCalled; - -/** - * Matcher that checks to see if the actual, a Jasmine spy, was not called. - * - * @deprecated Use expect(xxx).not.toHaveBeenCalled() instead - */ -jasmine.Matchers.prototype.wasNotCalled = function() { - if (arguments.length > 0) { - throw new Error('wasNotCalled does not take arguments'); - } - - if (!jasmine.isSpy(this.actual)) { - throw new Error('Expected a spy, but got ' + jasmine.pp(this.actual) + '.'); - } - - this.message = function() { - return [ - "Expected spy " + this.actual.identity + " to not have been called.", - "Expected spy " + this.actual.identity + " to have been called." - ]; - }; - - return !this.actual.wasCalled; -}; - -/** - * Matcher that checks to see if the actual, a Jasmine spy, was called with a set of parameters. - * - * @example - * - */ -jasmine.Matchers.prototype.toHaveBeenCalledWith = function() { - var expectedArgs = jasmine.util.argsToArray(arguments); - if (!jasmine.isSpy(this.actual)) { - throw new Error('Expected a spy, but got ' + jasmine.pp(this.actual) + '.'); - } - this.message = function() { - if (this.actual.callCount === 0) { - // todo: what should the failure message for .not.toHaveBeenCalledWith() be? is this right? test better. [xw] - return [ - "Expected spy " + this.actual.identity + " to have been called with " + jasmine.pp(expectedArgs) + " but it was never called.", - "Expected spy " + this.actual.identity + " not to have been called with " + jasmine.pp(expectedArgs) + " but it was." - ]; - } else { - return [ - "Expected spy " + this.actual.identity + " to have been called with " + jasmine.pp(expectedArgs) + " but was called with " + jasmine.pp(this.actual.argsForCall), - "Expected spy " + this.actual.identity + " not to have been called with " + jasmine.pp(expectedArgs) + " but was called with " + jasmine.pp(this.actual.argsForCall) - ]; - } - }; - - return this.env.contains_(this.actual.argsForCall, expectedArgs); -}; - -/** @deprecated Use expect(xxx).toHaveBeenCalledWith() instead */ -jasmine.Matchers.prototype.wasCalledWith = jasmine.Matchers.prototype.toHaveBeenCalledWith; - -/** @deprecated Use expect(xxx).not.toHaveBeenCalledWith() instead */ -jasmine.Matchers.prototype.wasNotCalledWith = function() { - var expectedArgs = jasmine.util.argsToArray(arguments); - if (!jasmine.isSpy(this.actual)) { - throw new Error('Expected a spy, but got ' + jasmine.pp(this.actual) + '.'); - } - - this.message = function() { - return [ - "Expected spy not to have been called with " + jasmine.pp(expectedArgs) + " but it was", - "Expected spy to have been called with " + jasmine.pp(expectedArgs) + " but it was" - ]; - }; - - return !this.env.contains_(this.actual.argsForCall, expectedArgs); -}; - -/** - * Matcher that checks that the expected item is an element in the actual Array. - * - * @param {Object} expected - */ -jasmine.Matchers.prototype.toContain = function(expected) { - return this.env.contains_(this.actual, expected); -}; - -/** - * Matcher that checks that the expected item is NOT an element in the actual Array. - * - * @param {Object} expected - * @deprecated as of 1.0. Use not.toContain() instead. - */ -jasmine.Matchers.prototype.toNotContain = function(expected) { - return !this.env.contains_(this.actual, expected); -}; - -jasmine.Matchers.prototype.toBeLessThan = function(expected) { - return this.actual < expected; -}; - -jasmine.Matchers.prototype.toBeGreaterThan = function(expected) { - return this.actual > expected; -}; - -/** - * Matcher that checks that the expected item is equal to the actual item - * up to a given level of decimal precision (default 2). - * - * @param {Number} expected - * @param {Number} precision - */ -jasmine.Matchers.prototype.toBeCloseTo = function(expected, precision) { - if (!(precision === 0)) { - precision = precision || 2; - } - var multiplier = Math.pow(10, precision); - var actual = Math.round(this.actual * multiplier); - expected = Math.round(expected * multiplier); - return expected == actual; -}; - -/** - * Matcher that checks that the expected exception was thrown by the actual. - * - * @param {String} expected - */ -jasmine.Matchers.prototype.toThrow = function(expected) { - var result = false; - var exception; - if (typeof this.actual != 'function') { - throw new Error('Actual is not a function'); - } - try { - this.actual(); - } catch (e) { - exception = e; - } - if (exception) { - result = (expected === jasmine.undefined || this.env.equals_(exception.message || exception, expected.message || expected)); - } - - var not = this.isNot ? "not " : ""; - - this.message = function() { - if (exception && (expected === jasmine.undefined || !this.env.equals_(exception.message || exception, expected.message || expected))) { - return ["Expected function " + not + "to throw", expected ? expected.message || expected : "an exception", ", but it threw", exception.message || exception].join(' '); - } else { - return "Expected function to throw an exception."; - } - }; - - return result; -}; - -jasmine.Matchers.Any = function(expectedClass) { - this.expectedClass = expectedClass; -}; - -jasmine.Matchers.Any.prototype.jasmineMatches = function(other) { - if (this.expectedClass == String) { - return typeof other == 'string' || other instanceof String; - } - - if (this.expectedClass == Number) { - return typeof other == 'number' || other instanceof Number; - } - - if (this.expectedClass == Function) { - return typeof other == 'function' || other instanceof Function; - } - - if (this.expectedClass == Object) { - return typeof other == 'object'; - } - - return other instanceof this.expectedClass; -}; - -jasmine.Matchers.Any.prototype.jasmineToString = function() { - return ''; -}; - -jasmine.Matchers.ObjectContaining = function (sample) { - this.sample = sample; -}; - -jasmine.Matchers.ObjectContaining.prototype.jasmineMatches = function(other, mismatchKeys, mismatchValues) { - mismatchKeys = mismatchKeys || []; - mismatchValues = mismatchValues || []; - - var env = jasmine.getEnv(); - - var hasKey = function(obj, keyName) { - return obj != null && obj[keyName] !== jasmine.undefined; - }; - - for (var property in this.sample) { - if (!hasKey(other, property) && hasKey(this.sample, property)) { - mismatchKeys.push("expected has key '" + property + "', but missing from actual."); - } - else if (!env.equals_(this.sample[property], other[property], mismatchKeys, mismatchValues)) { - mismatchValues.push("'" + property + "' was '" + (other[property] ? jasmine.util.htmlEscape(other[property].toString()) : other[property]) + "' in expected, but was '" + (this.sample[property] ? jasmine.util.htmlEscape(this.sample[property].toString()) : this.sample[property]) + "' in actual."); - } - } - - return (mismatchKeys.length === 0 && mismatchValues.length === 0); -}; - -jasmine.Matchers.ObjectContaining.prototype.jasmineToString = function () { - return ""; -}; -// Mock setTimeout, clearTimeout -// Contributed by Pivotal Computer Systems, www.pivotalsf.com - -jasmine.FakeTimer = function() { - this.reset(); - - var self = this; - self.setTimeout = function(funcToCall, millis) { - self.timeoutsMade++; - self.scheduleFunction(self.timeoutsMade, funcToCall, millis, false); - return self.timeoutsMade; - }; - - self.setInterval = function(funcToCall, millis) { - self.timeoutsMade++; - self.scheduleFunction(self.timeoutsMade, funcToCall, millis, true); - return self.timeoutsMade; - }; - - self.clearTimeout = function(timeoutKey) { - self.scheduledFunctions[timeoutKey] = jasmine.undefined; - }; - - self.clearInterval = function(timeoutKey) { - self.scheduledFunctions[timeoutKey] = jasmine.undefined; - }; - -}; - -jasmine.FakeTimer.prototype.reset = function() { - this.timeoutsMade = 0; - this.scheduledFunctions = {}; - this.nowMillis = 0; -}; - -jasmine.FakeTimer.prototype.tick = function(millis) { - var oldMillis = this.nowMillis; - var newMillis = oldMillis + millis; - this.runFunctionsWithinRange(oldMillis, newMillis); - this.nowMillis = newMillis; -}; - -jasmine.FakeTimer.prototype.runFunctionsWithinRange = function(oldMillis, nowMillis) { - var scheduledFunc; - var funcsToRun = []; - for (var timeoutKey in this.scheduledFunctions) { - scheduledFunc = this.scheduledFunctions[timeoutKey]; - if (scheduledFunc != jasmine.undefined && - scheduledFunc.runAtMillis >= oldMillis && - scheduledFunc.runAtMillis <= nowMillis) { - funcsToRun.push(scheduledFunc); - this.scheduledFunctions[timeoutKey] = jasmine.undefined; - } - } - - if (funcsToRun.length > 0) { - funcsToRun.sort(function(a, b) { - return a.runAtMillis - b.runAtMillis; - }); - for (var i = 0; i < funcsToRun.length; ++i) { - try { - var funcToRun = funcsToRun[i]; - this.nowMillis = funcToRun.runAtMillis; - funcToRun.funcToCall(); - if (funcToRun.recurring) { - this.scheduleFunction(funcToRun.timeoutKey, - funcToRun.funcToCall, - funcToRun.millis, - true); - } - } catch(e) { - } - } - this.runFunctionsWithinRange(oldMillis, nowMillis); - } -}; - -jasmine.FakeTimer.prototype.scheduleFunction = function(timeoutKey, funcToCall, millis, recurring) { - this.scheduledFunctions[timeoutKey] = { - runAtMillis: this.nowMillis + millis, - funcToCall: funcToCall, - recurring: recurring, - timeoutKey: timeoutKey, - millis: millis - }; -}; - -/** - * @namespace - */ -jasmine.Clock = { - defaultFakeTimer: new jasmine.FakeTimer(), - - reset: function() { - jasmine.Clock.assertInstalled(); - jasmine.Clock.defaultFakeTimer.reset(); - }, - - tick: function(millis) { - jasmine.Clock.assertInstalled(); - jasmine.Clock.defaultFakeTimer.tick(millis); - }, - - runFunctionsWithinRange: function(oldMillis, nowMillis) { - jasmine.Clock.defaultFakeTimer.runFunctionsWithinRange(oldMillis, nowMillis); - }, - - scheduleFunction: function(timeoutKey, funcToCall, millis, recurring) { - jasmine.Clock.defaultFakeTimer.scheduleFunction(timeoutKey, funcToCall, millis, recurring); - }, - - useMock: function() { - if (!jasmine.Clock.isInstalled()) { - var spec = jasmine.getEnv().currentSpec; - spec.after(jasmine.Clock.uninstallMock); - - jasmine.Clock.installMock(); - } - }, - - installMock: function() { - jasmine.Clock.installed = jasmine.Clock.defaultFakeTimer; - }, - - uninstallMock: function() { - jasmine.Clock.assertInstalled(); - jasmine.Clock.installed = jasmine.Clock.real; - }, - - real: { - setTimeout: jasmine.getGlobal().setTimeout, - clearTimeout: jasmine.getGlobal().clearTimeout, - setInterval: jasmine.getGlobal().setInterval, - clearInterval: jasmine.getGlobal().clearInterval - }, - - assertInstalled: function() { - if (!jasmine.Clock.isInstalled()) { - throw new Error("Mock clock is not installed, use jasmine.Clock.useMock()"); - } - }, - - isInstalled: function() { - return jasmine.Clock.installed == jasmine.Clock.defaultFakeTimer; - }, - - installed: null -}; -jasmine.Clock.installed = jasmine.Clock.real; - -//else for IE support -jasmine.getGlobal().setTimeout = function(funcToCall, millis) { - if (jasmine.Clock.installed.setTimeout.apply) { - return jasmine.Clock.installed.setTimeout.apply(this, arguments); - } else { - return jasmine.Clock.installed.setTimeout(funcToCall, millis); - } -}; - -jasmine.getGlobal().setInterval = function(funcToCall, millis) { - if (jasmine.Clock.installed.setInterval.apply) { - return jasmine.Clock.installed.setInterval.apply(this, arguments); - } else { - return jasmine.Clock.installed.setInterval(funcToCall, millis); - } -}; - -jasmine.getGlobal().clearTimeout = function(timeoutKey) { - if (jasmine.Clock.installed.clearTimeout.apply) { - return jasmine.Clock.installed.clearTimeout.apply(this, arguments); - } else { - return jasmine.Clock.installed.clearTimeout(timeoutKey); - } -}; - -jasmine.getGlobal().clearInterval = function(timeoutKey) { - if (jasmine.Clock.installed.clearTimeout.apply) { - return jasmine.Clock.installed.clearInterval.apply(this, arguments); - } else { - return jasmine.Clock.installed.clearInterval(timeoutKey); - } -}; - -/** - * @constructor - */ -jasmine.MultiReporter = function() { - this.subReporters_ = []; -}; -jasmine.util.inherit(jasmine.MultiReporter, jasmine.Reporter); - -jasmine.MultiReporter.prototype.addReporter = function(reporter) { - this.subReporters_.push(reporter); -}; - -(function() { - var functionNames = [ - "reportRunnerStarting", - "reportRunnerResults", - "reportSuiteResults", - "reportSpecStarting", - "reportSpecResults", - "log" - ]; - for (var i = 0; i < functionNames.length; i++) { - var functionName = functionNames[i]; - jasmine.MultiReporter.prototype[functionName] = (function(functionName) { - return function() { - for (var j = 0; j < this.subReporters_.length; j++) { - var subReporter = this.subReporters_[j]; - if (subReporter[functionName]) { - subReporter[functionName].apply(subReporter, arguments); - } - } - }; - })(functionName); - } -})(); -/** - * Holds results for a set of Jasmine spec. Allows for the results array to hold another jasmine.NestedResults - * - * @constructor - */ -jasmine.NestedResults = function() { - /** - * The total count of results - */ - this.totalCount = 0; - /** - * Number of passed results - */ - this.passedCount = 0; - /** - * Number of failed results - */ - this.failedCount = 0; - /** - * Was this suite/spec skipped? - */ - this.skipped = false; - /** - * @ignore - */ - this.items_ = []; -}; - -/** - * Roll up the result counts. - * - * @param result - */ -jasmine.NestedResults.prototype.rollupCounts = function(result) { - this.totalCount += result.totalCount; - this.passedCount += result.passedCount; - this.failedCount += result.failedCount; -}; - -/** - * Adds a log message. - * @param values Array of message parts which will be concatenated later. - */ -jasmine.NestedResults.prototype.log = function(values) { - this.items_.push(new jasmine.MessageResult(values)); -}; - -/** - * Getter for the results: message & results. - */ -jasmine.NestedResults.prototype.getItems = function() { - return this.items_; -}; - -/** - * Adds a result, tracking counts (total, passed, & failed) - * @param {jasmine.ExpectationResult|jasmine.NestedResults} result - */ -jasmine.NestedResults.prototype.addResult = function(result) { - if (result.type != 'log') { - if (result.items_) { - this.rollupCounts(result); - } else { - this.totalCount++; - if (result.passed()) { - this.passedCount++; - } else { - this.failedCount++; - } - } - } - this.items_.push(result); -}; - -/** - * @returns {Boolean} True if everything below passed - */ -jasmine.NestedResults.prototype.passed = function() { - return this.passedCount === this.totalCount; -}; -/** - * Base class for pretty printing for expectation results. - */ -jasmine.PrettyPrinter = function() { - this.ppNestLevel_ = 0; -}; - -/** - * Formats a value in a nice, human-readable string. - * - * @param value - */ -jasmine.PrettyPrinter.prototype.format = function(value) { - if (this.ppNestLevel_ > 40) { - throw new Error('jasmine.PrettyPrinter: format() nested too deeply!'); - } - - this.ppNestLevel_++; - try { - if (value === jasmine.undefined) { - this.emitScalar('undefined'); - } else if (value === null) { - this.emitScalar('null'); - } else if (value === jasmine.getGlobal()) { - this.emitScalar(''); - } else if (value.jasmineToString) { - this.emitScalar(value.jasmineToString()); - } else if (typeof value === 'string') { - this.emitString(value); - } else if (jasmine.isSpy(value)) { - this.emitScalar("spy on " + value.identity); - } else if (value instanceof RegExp) { - this.emitScalar(value.toString()); - } else if (typeof value === 'function') { - this.emitScalar('Function'); - } else if (typeof value.nodeType === 'number') { - this.emitScalar('HTMLNode'); - } else if (value instanceof Date) { - this.emitScalar('Date(' + value + ')'); - } else if (value.__Jasmine_been_here_before__) { - this.emitScalar(''); - } else if (jasmine.isArray_(value) || typeof value == 'object') { - value.__Jasmine_been_here_before__ = true; - if (jasmine.isArray_(value)) { - this.emitArray(value); - } else { - this.emitObject(value); - } - delete value.__Jasmine_been_here_before__; - } else { - this.emitScalar(value.toString()); - } - } finally { - this.ppNestLevel_--; - } -}; - -jasmine.PrettyPrinter.prototype.iterateObject = function(obj, fn) { - for (var property in obj) { - if (property == '__Jasmine_been_here_before__') continue; - fn(property, obj.__lookupGetter__ ? (obj.__lookupGetter__(property) !== jasmine.undefined && - obj.__lookupGetter__(property) !== null) : false); - } -}; - -jasmine.PrettyPrinter.prototype.emitArray = jasmine.unimplementedMethod_; -jasmine.PrettyPrinter.prototype.emitObject = jasmine.unimplementedMethod_; -jasmine.PrettyPrinter.prototype.emitScalar = jasmine.unimplementedMethod_; -jasmine.PrettyPrinter.prototype.emitString = jasmine.unimplementedMethod_; - -jasmine.StringPrettyPrinter = function() { - jasmine.PrettyPrinter.call(this); - - this.string = ''; -}; -jasmine.util.inherit(jasmine.StringPrettyPrinter, jasmine.PrettyPrinter); - -jasmine.StringPrettyPrinter.prototype.emitScalar = function(value) { - this.append(value); -}; - -jasmine.StringPrettyPrinter.prototype.emitString = function(value) { - this.append("'" + value + "'"); -}; - -jasmine.StringPrettyPrinter.prototype.emitArray = function(array) { - this.append('[ '); - for (var i = 0; i < array.length; i++) { - if (i > 0) { - this.append(', '); - } - this.format(array[i]); - } - this.append(' ]'); -}; - -jasmine.StringPrettyPrinter.prototype.emitObject = function(obj) { - var self = this; - this.append('{ '); - var first = true; - - this.iterateObject(obj, function(property, isGetter) { - if (first) { - first = false; - } else { - self.append(', '); - } - - self.append(property); - self.append(' : '); - if (isGetter) { - self.append(''); - } else { - self.format(obj[property]); - } - }); - - this.append(' }'); -}; - -jasmine.StringPrettyPrinter.prototype.append = function(value) { - this.string += value; -}; -jasmine.Queue = function(env) { - this.env = env; - this.blocks = []; - this.running = false; - this.index = 0; - this.offset = 0; - this.abort = false; -}; - -jasmine.Queue.prototype.addBefore = function(block) { - this.blocks.unshift(block); -}; - -jasmine.Queue.prototype.add = function(block) { - this.blocks.push(block); -}; - -jasmine.Queue.prototype.insertNext = function(block) { - this.blocks.splice((this.index + this.offset + 1), 0, block); - this.offset++; -}; - -jasmine.Queue.prototype.start = function(onComplete) { - this.running = true; - this.onComplete = onComplete; - this.next_(); -}; - -jasmine.Queue.prototype.isRunning = function() { - return this.running; -}; - -jasmine.Queue.LOOP_DONT_RECURSE = true; - -jasmine.Queue.prototype.next_ = function() { - var self = this; - var goAgain = true; - - while (goAgain) { - goAgain = false; - - if (self.index < self.blocks.length && !this.abort) { - var calledSynchronously = true; - var completedSynchronously = false; - - var onComplete = function () { - if (jasmine.Queue.LOOP_DONT_RECURSE && calledSynchronously) { - completedSynchronously = true; - return; - } - - if (self.blocks[self.index].abort) { - self.abort = true; - } - - self.offset = 0; - self.index++; - - var now = new Date().getTime(); - if (self.env.updateInterval && now - self.env.lastUpdate > self.env.updateInterval) { - self.env.lastUpdate = now; - self.env.setTimeout(function() { - self.next_(); - }, 0); - } else { - if (jasmine.Queue.LOOP_DONT_RECURSE && completedSynchronously) { - goAgain = true; - } else { - self.next_(); - } - } - }; - self.blocks[self.index].execute(onComplete); - - calledSynchronously = false; - if (completedSynchronously) { - onComplete(); - } - - } else { - self.running = false; - if (self.onComplete) { - self.onComplete(); - } - } - } -}; - -jasmine.Queue.prototype.results = function() { - var results = new jasmine.NestedResults(); - for (var i = 0; i < this.blocks.length; i++) { - if (this.blocks[i].results) { - results.addResult(this.blocks[i].results()); - } - } - return results; -}; - - -/** - * Runner - * - * @constructor - * @param {jasmine.Env} env - */ -jasmine.Runner = function(env) { - var self = this; - self.env = env; - self.queue = new jasmine.Queue(env); - self.before_ = []; - self.after_ = []; - self.suites_ = []; -}; - -jasmine.Runner.prototype.execute = function() { - var self = this; - if (self.env.reporter.reportRunnerStarting) { - self.env.reporter.reportRunnerStarting(this); - } - self.queue.start(function () { - self.finishCallback(); - }); -}; - -jasmine.Runner.prototype.beforeEach = function(beforeEachFunction) { - beforeEachFunction.typeName = 'beforeEach'; - this.before_.splice(0,0,beforeEachFunction); -}; - -jasmine.Runner.prototype.afterEach = function(afterEachFunction) { - afterEachFunction.typeName = 'afterEach'; - this.after_.splice(0,0,afterEachFunction); -}; - - -jasmine.Runner.prototype.finishCallback = function() { - this.env.reporter.reportRunnerResults(this); -}; - -jasmine.Runner.prototype.addSuite = function(suite) { - this.suites_.push(suite); -}; - -jasmine.Runner.prototype.add = function(block) { - if (block instanceof jasmine.Suite) { - this.addSuite(block); - } - this.queue.add(block); -}; - -jasmine.Runner.prototype.specs = function () { - var suites = this.suites(); - var specs = []; - for (var i = 0; i < suites.length; i++) { - specs = specs.concat(suites[i].specs()); - } - return specs; -}; - -jasmine.Runner.prototype.suites = function() { - return this.suites_; -}; - -jasmine.Runner.prototype.topLevelSuites = function() { - var topLevelSuites = []; - for (var i = 0; i < this.suites_.length; i++) { - if (!this.suites_[i].parentSuite) { - topLevelSuites.push(this.suites_[i]); - } - } - return topLevelSuites; -}; - -jasmine.Runner.prototype.results = function() { - return this.queue.results(); -}; -/** - * Internal representation of a Jasmine specification, or test. - * - * @constructor - * @param {jasmine.Env} env - * @param {jasmine.Suite} suite - * @param {String} description - */ -jasmine.Spec = function(env, suite, description) { - if (!env) { - throw new Error('jasmine.Env() required'); - } - if (!suite) { - throw new Error('jasmine.Suite() required'); - } - var spec = this; - spec.id = env.nextSpecId ? env.nextSpecId() : null; - spec.env = env; - spec.suite = suite; - spec.description = description; - spec.queue = new jasmine.Queue(env); - - spec.afterCallbacks = []; - spec.spies_ = []; - - spec.results_ = new jasmine.NestedResults(); - spec.results_.description = description; - spec.matchersClass = null; -}; - -jasmine.Spec.prototype.getFullName = function() { - return this.suite.getFullName() + ' ' + this.description + '.'; -}; - - -jasmine.Spec.prototype.results = function() { - return this.results_; -}; - -/** - * All parameters are pretty-printed and concatenated together, then written to the spec's output. - * - * Be careful not to leave calls to jasmine.log in production code. - */ -jasmine.Spec.prototype.log = function() { - return this.results_.log(arguments); -}; - -jasmine.Spec.prototype.runs = function (func) { - var block = new jasmine.Block(this.env, func, this); - this.addToQueue(block); - return this; -}; - -jasmine.Spec.prototype.addToQueue = function (block) { - if (this.queue.isRunning()) { - this.queue.insertNext(block); - } else { - this.queue.add(block); - } -}; - -/** - * @param {jasmine.ExpectationResult} result - */ -jasmine.Spec.prototype.addMatcherResult = function(result) { - this.results_.addResult(result); -}; - -jasmine.Spec.prototype.expect = function(actual) { - var positive = new (this.getMatchersClass_())(this.env, actual, this); - positive.not = new (this.getMatchersClass_())(this.env, actual, this, true); - return positive; -}; - -/** - * Waits a fixed time period before moving to the next block. - * - * @deprecated Use waitsFor() instead - * @param {Number} timeout milliseconds to wait - */ -jasmine.Spec.prototype.waits = function(timeout) { - var waitsFunc = new jasmine.WaitsBlock(this.env, timeout, this); - this.addToQueue(waitsFunc); - return this; -}; - -/** - * Waits for the latchFunction to return true before proceeding to the next block. - * - * @param {Function} latchFunction - * @param {String} optional_timeoutMessage - * @param {Number} optional_timeout - */ -jasmine.Spec.prototype.waitsFor = function(latchFunction, optional_timeoutMessage, optional_timeout) { - var latchFunction_ = null; - var optional_timeoutMessage_ = null; - var optional_timeout_ = null; - - for (var i = 0; i < arguments.length; i++) { - var arg = arguments[i]; - switch (typeof arg) { - case 'function': - latchFunction_ = arg; - break; - case 'string': - optional_timeoutMessage_ = arg; - break; - case 'number': - optional_timeout_ = arg; - break; - } - } - - var waitsForFunc = new jasmine.WaitsForBlock(this.env, optional_timeout_, latchFunction_, optional_timeoutMessage_, this); - this.addToQueue(waitsForFunc); - return this; -}; - -jasmine.Spec.prototype.fail = function (e) { - var expectationResult = new jasmine.ExpectationResult({ - passed: false, - message: e ? jasmine.util.formatException(e) : 'Exception', - trace: { stack: e.stack } - }); - this.results_.addResult(expectationResult); -}; - -jasmine.Spec.prototype.getMatchersClass_ = function() { - return this.matchersClass || this.env.matchersClass; -}; - -jasmine.Spec.prototype.addMatchers = function(matchersPrototype) { - var parent = this.getMatchersClass_(); - var newMatchersClass = function() { - parent.apply(this, arguments); - }; - jasmine.util.inherit(newMatchersClass, parent); - jasmine.Matchers.wrapInto_(matchersPrototype, newMatchersClass); - this.matchersClass = newMatchersClass; -}; - -jasmine.Spec.prototype.finishCallback = function() { - this.env.reporter.reportSpecResults(this); -}; - -jasmine.Spec.prototype.finish = function(onComplete) { - this.removeAllSpies(); - this.finishCallback(); - if (onComplete) { - onComplete(); - } -}; - -jasmine.Spec.prototype.after = function(doAfter) { - if (this.queue.isRunning()) { - this.queue.add(new jasmine.Block(this.env, doAfter, this)); - } else { - this.afterCallbacks.unshift(doAfter); - } -}; - -jasmine.Spec.prototype.execute = function(onComplete) { - var spec = this; - if (!spec.env.specFilter(spec)) { - spec.results_.skipped = true; - spec.finish(onComplete); - return; - } - - this.env.reporter.reportSpecStarting(this); - - spec.env.currentSpec = spec; - - spec.addBeforesAndAftersToQueue(); - - spec.queue.start(function () { - spec.finish(onComplete); - }); -}; - -jasmine.Spec.prototype.addBeforesAndAftersToQueue = function() { - var runner = this.env.currentRunner(); - var i; - - for (var suite = this.suite; suite; suite = suite.parentSuite) { - for (i = 0; i < suite.before_.length; i++) { - this.queue.addBefore(new jasmine.Block(this.env, suite.before_[i], this)); - } - } - for (i = 0; i < runner.before_.length; i++) { - this.queue.addBefore(new jasmine.Block(this.env, runner.before_[i], this)); - } - for (i = 0; i < this.afterCallbacks.length; i++) { - this.queue.add(new jasmine.Block(this.env, this.afterCallbacks[i], this)); - } - for (suite = this.suite; suite; suite = suite.parentSuite) { - for (i = 0; i < suite.after_.length; i++) { - this.queue.add(new jasmine.Block(this.env, suite.after_[i], this)); - } - } - for (i = 0; i < runner.after_.length; i++) { - this.queue.add(new jasmine.Block(this.env, runner.after_[i], this)); - } -}; - -jasmine.Spec.prototype.explodes = function() { - throw 'explodes function should not have been called'; -}; - -jasmine.Spec.prototype.spyOn = function(obj, methodName, ignoreMethodDoesntExist) { - if (obj == jasmine.undefined) { - throw "spyOn could not find an object to spy upon for " + methodName + "()"; - } - - if (!ignoreMethodDoesntExist && obj[methodName] === jasmine.undefined) { - throw methodName + '() method does not exist'; - } - - if (!ignoreMethodDoesntExist && obj[methodName] && obj[methodName].isSpy) { - throw new Error(methodName + ' has already been spied upon'); - } - - var spyObj = jasmine.createSpy(methodName); - - this.spies_.push(spyObj); - spyObj.baseObj = obj; - spyObj.methodName = methodName; - spyObj.originalValue = obj[methodName]; - - obj[methodName] = spyObj; - - return spyObj; -}; - -jasmine.Spec.prototype.removeAllSpies = function() { - for (var i = 0; i < this.spies_.length; i++) { - var spy = this.spies_[i]; - spy.baseObj[spy.methodName] = spy.originalValue; - } - this.spies_ = []; -}; - -/** - * Internal representation of a Jasmine suite. - * - * @constructor - * @param {jasmine.Env} env - * @param {String} description - * @param {Function} specDefinitions - * @param {jasmine.Suite} parentSuite - */ -jasmine.Suite = function(env, description, specDefinitions, parentSuite) { - var self = this; - self.id = env.nextSuiteId ? env.nextSuiteId() : null; - self.description = description; - self.queue = new jasmine.Queue(env); - self.parentSuite = parentSuite; - self.env = env; - self.before_ = []; - self.after_ = []; - self.children_ = []; - self.suites_ = []; - self.specs_ = []; -}; - -jasmine.Suite.prototype.getFullName = function() { - var fullName = this.description; - for (var parentSuite = this.parentSuite; parentSuite; parentSuite = parentSuite.parentSuite) { - fullName = parentSuite.description + ' ' + fullName; - } - return fullName; -}; - -jasmine.Suite.prototype.finish = function(onComplete) { - this.env.reporter.reportSuiteResults(this); - this.finished = true; - if (typeof(onComplete) == 'function') { - onComplete(); - } -}; - -jasmine.Suite.prototype.beforeEach = function(beforeEachFunction) { - beforeEachFunction.typeName = 'beforeEach'; - this.before_.unshift(beforeEachFunction); -}; - -jasmine.Suite.prototype.afterEach = function(afterEachFunction) { - afterEachFunction.typeName = 'afterEach'; - this.after_.unshift(afterEachFunction); -}; - -jasmine.Suite.prototype.results = function() { - return this.queue.results(); -}; - -jasmine.Suite.prototype.add = function(suiteOrSpec) { - this.children_.push(suiteOrSpec); - if (suiteOrSpec instanceof jasmine.Suite) { - this.suites_.push(suiteOrSpec); - this.env.currentRunner().addSuite(suiteOrSpec); - } else { - this.specs_.push(suiteOrSpec); - } - this.queue.add(suiteOrSpec); -}; - -jasmine.Suite.prototype.specs = function() { - return this.specs_; -}; - -jasmine.Suite.prototype.suites = function() { - return this.suites_; -}; - -jasmine.Suite.prototype.children = function() { - return this.children_; -}; - -jasmine.Suite.prototype.execute = function(onComplete) { - var self = this; - this.queue.start(function () { - self.finish(onComplete); - }); -}; -jasmine.WaitsBlock = function(env, timeout, spec) { - this.timeout = timeout; - jasmine.Block.call(this, env, null, spec); -}; - -jasmine.util.inherit(jasmine.WaitsBlock, jasmine.Block); - -jasmine.WaitsBlock.prototype.execute = function (onComplete) { - if (jasmine.VERBOSE) { - this.env.reporter.log('>> Jasmine waiting for ' + this.timeout + ' ms...'); - } - this.env.setTimeout(function () { - onComplete(); - }, this.timeout); -}; -/** - * A block which waits for some condition to become true, with timeout. - * - * @constructor - * @extends jasmine.Block - * @param {jasmine.Env} env The Jasmine environment. - * @param {Number} timeout The maximum time in milliseconds to wait for the condition to become true. - * @param {Function} latchFunction A function which returns true when the desired condition has been met. - * @param {String} message The message to display if the desired condition hasn't been met within the given time period. - * @param {jasmine.Spec} spec The Jasmine spec. - */ -jasmine.WaitsForBlock = function(env, timeout, latchFunction, message, spec) { - this.timeout = timeout || env.defaultTimeoutInterval; - this.latchFunction = latchFunction; - this.message = message; - this.totalTimeSpentWaitingForLatch = 0; - jasmine.Block.call(this, env, null, spec); -}; -jasmine.util.inherit(jasmine.WaitsForBlock, jasmine.Block); - -jasmine.WaitsForBlock.TIMEOUT_INCREMENT = 10; - -jasmine.WaitsForBlock.prototype.execute = function(onComplete) { - if (jasmine.VERBOSE) { - this.env.reporter.log('>> Jasmine waiting for ' + (this.message || 'something to happen')); - } - var latchFunctionResult; - try { - latchFunctionResult = this.latchFunction.apply(this.spec); - } catch (e) { - this.spec.fail(e); - onComplete(); - return; - } - - if (latchFunctionResult) { - onComplete(); - } else if (this.totalTimeSpentWaitingForLatch >= this.timeout) { - var message = 'timed out after ' + this.timeout + ' msec waiting for ' + (this.message || 'something to happen'); - this.spec.fail({ - name: 'timeout', - message: message - }); - - this.abort = true; - onComplete(); - } else { - this.totalTimeSpentWaitingForLatch += jasmine.WaitsForBlock.TIMEOUT_INCREMENT; - var self = this; - this.env.setTimeout(function() { - self.execute(onComplete); - }, jasmine.WaitsForBlock.TIMEOUT_INCREMENT); - } -}; - -jasmine.version_= { - "major": 1, - "minor": 2, - "build": 0, - "revision": 1333310630, - "release_candidate": 1 -}; diff --git a/plugins/org.apache.cordova.core.network-information/test/autotest/pages/network.html b/plugins/org.apache.cordova.core.network-information/test/autotest/pages/network.html deleted file mode 100644 index dcdec18..0000000 --- a/plugins/org.apache.cordova.core.network-information/test/autotest/pages/network.html +++ /dev/null @@ -1,71 +0,0 @@ - - - - - - - - Cordova: Network API Specs - - - - - - - - - - - - - - - - - - - - - - - - - - Back - - - diff --git a/plugins/org.apache.cordova.core.network-information/test/autotest/test-runner.js b/plugins/org.apache.cordova.core.network-information/test/autotest/test-runner.js deleted file mode 100644 index f72b3cc..0000000 --- a/plugins/org.apache.cordova.core.network-information/test/autotest/test-runner.js +++ /dev/null @@ -1,62 +0,0 @@ -/* - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - * -*/ - -if (window.sessionStorage != null) { - window.sessionStorage.clear(); -} - -// Timeout is 2 seconds to allow physical devices enough -// time to query the response. This is important for some -// Android devices. -var Tests = function() {}; -Tests.TEST_TIMEOUT = 7500; - -// Creates a spy that will fail if called. -function createDoNotCallSpy(name, opt_extraMessage) { - return jasmine.createSpy().andCallFake(function() { - var errorMessage = name + ' should not have been called.'; - if (arguments.length) { - errorMessage += ' Got args: ' + JSON.stringify(arguments); - } - if (opt_extraMessage) { - errorMessage += '\n' + opt_extraMessage; - } - expect(false).toBe(true, errorMessage); - }); -} - -// Waits for any of the given spys to be called. -// Last param may be a custom timeout duration. -function waitsForAny() { - var spys = [].slice.call(arguments); - var timeout = Tests.TEST_TIMEOUT; - if (typeof spys[spys.length - 1] == 'number') { - timeout = spys.pop(); - } - waitsFor(function() { - for (var i = 0; i < spys.length; ++i) { - if (spys[i].wasCalled) { - return true; - } - } - return false; - }, "Expecting callbacks to be called.", timeout); -} diff --git a/plugins/org.apache.cordova.core.network-information/test/autotest/tests/network.tests.js b/plugins/org.apache.cordova.core.network-information/test/autotest/tests/network.tests.js deleted file mode 100644 index 8399b26..0000000 --- a/plugins/org.apache.cordova.core.network-information/test/autotest/tests/network.tests.js +++ /dev/null @@ -1,55 +0,0 @@ -/* - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - * -*/ - -describe('Network (navigator.connection)', function () { - it("network.spec.1 should exist", function() { - expect(navigator.network && navigator.network.connection).toBeDefined(); - expect(navigator.connection).toBeDefined(); - }); - - it("network.spec.2 should be set to a valid value", function() { - var validValues = { - 'unknown': 1, - 'ethernet': 1, - 'wifi': 1, - '2g': 1, - '3g': 1, - '4g': 1, - 'none': 1 - }; - expect(validValues[navigator.connection.type]).toBe(1); - }); - - it("network.spec.3 should have the same value in deprecated and non-deprecated apis", function() { - expect(navigator.network.connection.type).toBe(navigator.connection.type); - }); - - it("network.spec.4 should define constants for connection status", function() { - expect(Connection.UNKNOWN).toBe("unknown"); - expect(Connection.ETHERNET).toBe("ethernet"); - expect(Connection.WIFI).toBe("wifi"); - expect(Connection.CELL_2G).toBe("2g"); - expect(Connection.CELL_3G).toBe("3g"); - expect(Connection.CELL_4G).toBe("4g"); - expect(Connection.NONE).toBe("none"); - expect(Connection.CELL).toBe("cellular"); - }); -}); diff --git a/plugins/org.apache.cordova.core.network-information/test/cordova-incl.js b/plugins/org.apache.cordova.core.network-information/test/cordova-incl.js deleted file mode 100644 index dbcd1a6..0000000 --- a/plugins/org.apache.cordova.core.network-information/test/cordova-incl.js +++ /dev/null @@ -1,70 +0,0 @@ -/* - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - * -*/ - -var PLAT; -if (/Android/.exec(navigator.userAgent)) { - PLAT = 'android'; -} else if (/(iPad)|(iPhone)|(iPod)/.exec(navigator.userAgent)) { - PLAT = 'ios'; -} else if (/(BB10)|(PlayBook)|(BlackBerry)/.exec(navigator.userAgent)) { - PLAT = 'blackberry'; -} - -var scripts = document.getElementsByTagName('script'); -var currentPath = scripts[scripts.length - 1].src; -var platformCordovaPath = currentPath.replace("cordova-incl.js", "cordova." + PLAT + ".js"); -var normalCordovaPath = currentPath.replace("cordova-incl.js", "cordova.js"); -var cordovaPath = normalCordovaPath; - -if (PLAT) { - // XHR to local file is an error on some platforms, windowsphone for one - try { - var xhr = new XMLHttpRequest(); - xhr.open("GET", platformCordovaPath, false); - xhr.onreadystatechange = function() { - - if (this.readyState == this.DONE && this.responseText.length > 0) { - if(parseInt(this.status) >= 400){ - cordovaPath = normalCordovaPath; - }else{ - cordovaPath = platformCordovaPath; - } - } - }; - xhr.send(null); - } - catch(e){ - cordovaPath = normalCordovaPath; - } // access denied! -} - -if (!window._doNotWriteCordovaScript) { - document.write(''); -} - -function backHome() { - if (window.device && device.platform && device.platform.toLowerCase() == 'android') { - navigator.app.backHistory(); - } - else { - window.history.go(-1); - } -} diff --git a/plugins/org.apache.cordova.core.network-information/test/index.html b/plugins/org.apache.cordova.core.network-information/test/index.html deleted file mode 100644 index 2c5447b..0000000 --- a/plugins/org.apache.cordova.core.network-information/test/index.html +++ /dev/null @@ -1,65 +0,0 @@ - - - - - - - - - Cordova Mobile Spec - - - - - - -

Apache Cordova Tests

-
-

Platform:

-

Version:

-

UUID:

-

Name:

-

Model:

-

Width: , Height: - , Color Depth:

-

User-Agent:

-
- Automatic Test - Accelerometer - Audio Play/Record - Battery - Camera - Compass - Contacts - Events - Location - Lazy Loading of cordova-incl.js - Misc Content - Network - Notification - Splashscreen - Web SQL - Local Storage - Benchmarks - In App Browser - - diff --git a/plugins/org.apache.cordova.core.network-information/test/main.js b/plugins/org.apache.cordova.core.network-information/test/main.js deleted file mode 100644 index 66c1bd3..0000000 --- a/plugins/org.apache.cordova.core.network-information/test/main.js +++ /dev/null @@ -1,163 +0,0 @@ -/* - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - * -*/ - -var deviceInfo = function() { - document.getElementById("platform").innerHTML = device.platform; - document.getElementById("version").innerHTML = device.version; - document.getElementById("uuid").innerHTML = device.uuid; - document.getElementById("name").innerHTML = device.name; - document.getElementById("model").innerHTML = device.model; - document.getElementById("width").innerHTML = screen.width; - document.getElementById("height").innerHTML = screen.height; - document.getElementById("colorDepth").innerHTML = screen.colorDepth; -}; - -var getLocation = function() { - var suc = function(p) { - alert(p.coords.latitude + " " + p.coords.longitude); - }; - var locFail = function() { - }; - navigator.geolocation.getCurrentPosition(suc, locFail); -}; - -var beep = function() { - navigator.notification.beep(2); -}; - -var vibrate = function() { - navigator.notification.vibrate(0); -}; - -function roundNumber(num) { - var dec = 3; - var result = Math.round(num * Math.pow(10, dec)) / Math.pow(10, dec); - return result; -} - -var accelerationWatch = null; - -function updateAcceleration(a) { - document.getElementById('x').innerHTML = roundNumber(a.x); - document.getElementById('y').innerHTML = roundNumber(a.y); - document.getElementById('z').innerHTML = roundNumber(a.z); -} - -var toggleAccel = function() { - if (accelerationWatch !== null) { - navigator.accelerometer.clearWatch(accelerationWatch); - updateAcceleration({ - x : "", - y : "", - z : "" - }); - accelerationWatch = null; - } else { - var options = {}; - options.frequency = 1000; - accelerationWatch = navigator.accelerometer.watchAcceleration( - updateAcceleration, function(ex) { - alert("accel fail (" + ex.name + ": " + ex.message + ")"); - }, options); - } -}; - -var preventBehavior = function(e) { - e.preventDefault(); -}; - -function dump_pic(data) { - var viewport = document.getElementById('viewport'); - console.log(data); - viewport.style.display = ""; - viewport.style.position = "absolute"; - viewport.style.top = "10px"; - viewport.style.left = "10px"; - document.getElementById("test_img").src = "data:image/jpeg;base64," + data; -} - -function fail(msg) { - alert(msg); -} - -function show_pic() { - navigator.camera.getPicture(dump_pic, fail, { - quality : 50 - }); -} - -function close() { - var viewport = document.getElementById('viewport'); - viewport.style.position = "relative"; - viewport.style.display = "none"; -} - -// This is just to do this. -function readFile() { - navigator.file.read('/sdcard/cordova.txt', fail, fail); -} - -function writeFile() { - navigator.file.write('foo.txt', "This is a test of writing to a file", - fail, fail); -} - -function contacts_success(contacts) { - alert(contacts.length - + ' contacts returned.' - + (contacts[2] && contacts[2].name ? (' Third contact is ' + contacts[2].name.formatted) - : '')); -} - -function get_contacts() { - var obj = new ContactFindOptions(); - obj.filter = ""; - obj.multiple = true; - obj.limit = 5; - navigator.service.contacts.find( - [ "displayName", "name" ], contacts_success, - fail, obj); -} - -var networkReachableCallback = function(reachability) { - // There is no consistency on the format of reachability - var networkState = reachability.code || reachability; - - var currentState = {}; - currentState[NetworkStatus.NOT_REACHABLE] = 'No network connection'; - currentState[NetworkStatus.REACHABLE_VIA_CARRIER_DATA_NETWORK] = 'Carrier data connection'; - currentState[NetworkStatus.REACHABLE_VIA_WIFI_NETWORK] = 'WiFi connection'; - - confirm("Connection type:\n" + currentState[networkState]); -}; - -function check_network() { - navigator.network.isReachable("www.mobiledevelopersolutions.com", - networkReachableCallback, {}); -} - -function init() { - // the next line makes it impossible to see Contacts on the HTC Evo since it - // doesn't have a scroll button - // document.addEventListener("touchmove", preventBehavior, false); - document.addEventListener("deviceready", deviceInfo, true); - document.getElementById("user-agent").textContent = navigator.userAgent; -} diff --git a/plugins/org.apache.cordova.core.network-information/test/master.css b/plugins/org.apache.cordova.core.network-information/test/master.css deleted file mode 100644 index e93c937..0000000 --- a/plugins/org.apache.cordova.core.network-information/test/master.css +++ /dev/null @@ -1,164 +0,0 @@ -/* - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - * -*/ - - body { - background:#222 none repeat scroll 0 0; - color:#666; - font-family:Helvetica; - font-size:72%; - line-height:1.5em; - margin:0; - border-top:1px solid #393939; - } - - #info{ - background:#ffa; - border: 1px solid #ffd324; - -webkit-border-radius: 5px; - border-radius: 5px; - clear:both; - margin:15px 6px 0; - min-width:295px; - max-width:97%; - padding:4px 0px 2px 10px; - word-wrap:break-word; - margin-bottom:10px; - display:inline-block; - min-height: 160px; - max-height: 300px; - overflow: auto; - -webkit-overflow-scrolling: touch; - } - - #info > h4{ - font-size:.95em; - margin:5px 0; - } - - #stage.theme{ - padding-top:3px; - } - - /* Definition List */ - #stage.theme > dl{ - padding-top:10px; - clear:both; - margin:0; - list-style-type:none; - padding-left:10px; - overflow:auto; - } - - #stage.theme > dl > dt{ - font-weight:bold; - float:left; - margin-left:5px; - } - - #stage.theme > dl > dd{ - width:45px; - float:left; - color:#a87; - font-weight:bold; - } - - /* Content Styling */ - #stage.theme > h1, #stage.theme > h2, #stage.theme > p{ - margin:1em 0 .5em 13px; - } - - #stage.theme > h1{ - color:#eee; - font-size:1.6em; - text-align:center; - margin:0; - margin-top:15px; - padding:0; - } - - #stage.theme > h2{ - clear:both; - margin:0; - padding:3px; - font-size:1em; - text-align:center; - } - - /* Stage Buttons */ - #stage.theme .btn{ - border: 1px solid #555; - -webkit-border-radius: 5px; - border-radius: 5px; - text-align:center; - display:inline-block; - background:#444; - width:150px; - color:#9ab; - font-size:1.1em; - text-decoration:none; - padding:1.2em 0; - margin:3px 0px 3px 5px; - } - - #stage.theme .large{ - width:308px; - padding:1.2em 0; - } - - #stage.theme .wide{ - width:100%; - padding:1.2em 0; - } - - #stage.theme .backBtn{ - border: 1px solid #555; - -webkit-border-radius: 5px; - border-radius: 5px; - text-align:center; - display:block; - float:right; - background:#666; - width:75px; - color:#9ab; - font-size:1.1em; - text-decoration:none; - padding:1.2em 0; - margin:3px 5px 3px 5px; - } - - #stage.theme .input{ - border: 1px solid #555; - -webkit-border-radius: 5px; - border-radius: 5px; - text-align:center; - display:block; - float:light; - background:#888; - color:#9cd; - font-size:1.1em; - text-decoration:none; - padding:1.2em 0; - margin:3px 0px 3px 5px; - } - - #stage.theme .numeric{ - width:100%; - } diff --git a/plugins/org.apache.cordova.core.network-information/test/network/index.html b/plugins/org.apache.cordova.core.network-information/test/network/index.html deleted file mode 100644 index 2902849..0000000 --- a/plugins/org.apache.cordova.core.network-information/test/network/index.html +++ /dev/null @@ -1,85 +0,0 @@ - - - - - - - - - Cordova Mobile Spec - - - - - - - - - -

Network Events and State

-
- Results:
- -
- -

Action

-
Show Network Connection
-

Back
- - - diff --git a/plugins/org.apache.cordova.core.network-information/www/Connection.js b/plugins/org.apache.cordova.core.network-information/www/Connection.js deleted file mode 100644 index f20a485..0000000 --- a/plugins/org.apache.cordova.core.network-information/www/Connection.js +++ /dev/null @@ -1,34 +0,0 @@ -/* - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - * -*/ - -/** - * Network status - */ -module.exports = { - UNKNOWN: "unknown", - ETHERNET: "ethernet", - WIFI: "wifi", - CELL_2G: "2g", - CELL_3G: "3g", - CELL_4G: "4g", - CELL:"cellular", - NONE: "none" -}; diff --git a/plugins/org.apache.cordova.core.network-information/www/network.js b/plugins/org.apache.cordova.core.network-information/www/network.js deleted file mode 100644 index ccb8556..0000000 --- a/plugins/org.apache.cordova.core.network-information/www/network.js +++ /dev/null @@ -1,89 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - * -*/ - -var exec = require('cordova/exec'), - cordova = require('cordova'), - channel = require('cordova/channel'), - utils = require('cordova/utils'); - -// Link the onLine property with the Cordova-supplied network info. -// This works because we clobber the naviagtor object with our own -// object in bootstrap.js. -if (typeof navigator != 'undefined') { - utils.defineGetter(navigator, 'onLine', function() { - return this.connection.type != 'none'; - }); -} - -function NetworkConnection() { - this.type = 'unknown'; -} - -/** - * Get connection info - * - * @param {Function} successCallback The function to call when the Connection data is available - * @param {Function} errorCallback The function to call when there is an error getting the Connection data. (OPTIONAL) - */ -NetworkConnection.prototype.getInfo = function(successCallback, errorCallback) { - exec(successCallback, errorCallback, "NetworkStatus", "getConnectionInfo", []); -}; - -var me = new NetworkConnection(); -var timerId = null; -var timeout = 500; - -channel.createSticky('onCordovaConnectionReady'); -channel.waitForInitialization('onCordovaConnectionReady'); - -channel.onCordovaReady.subscribe(function() { - me.getInfo(function(info) { - me.type = info; - if (info === "none") { - // set a timer if still offline at the end of timer send the offline event - timerId = setTimeout(function(){ - cordova.fireDocumentEvent("offline"); - timerId = null; - }, timeout); - } else { - // If there is a current offline event pending clear it - if (timerId !== null) { - clearTimeout(timerId); - timerId = null; - } - cordova.fireDocumentEvent("online"); - } - - // should only fire this once - if (channel.onCordovaConnectionReady.state !== 2) { - channel.onCordovaConnectionReady.fire(); - } - }, - function (e) { - // If we can't get the network info we should still tell Cordova - // to fire the deviceready event. - if (channel.onCordovaConnectionReady.state !== 2) { - channel.onCordovaConnectionReady.fire(); - } - console.log("Error initializing Network Connection: " + e); - }); -}); - -module.exports = me; diff --git a/plugins/org.apache.cordova.core.splashscreen/.fetch.json b/plugins/org.apache.cordova.core.splashscreen/.fetch.json deleted file mode 100644 index 1d1561d..0000000 --- a/plugins/org.apache.cordova.core.splashscreen/.fetch.json +++ /dev/null @@ -1 +0,0 @@ -{"source":{"type":"git","url":"https://git-wip-us.apache.org/repos/asf/cordova-plugin-splashscreen.git","subdir":"."}} \ No newline at end of file diff --git a/plugins/org.apache.cordova.core.splashscreen/README.md b/plugins/org.apache.cordova.core.splashscreen/README.md deleted file mode 100644 index 59ce338..0000000 --- a/plugins/org.apache.cordova.core.splashscreen/README.md +++ /dev/null @@ -1,18 +0,0 @@ -cordova-plugin-splashscreen ----------------------------- - -For Android, - -In your config.xml, you need to add the following preference - -`` - -Where foo is the name of the splashscreen file. Preferably a 9 patch file. Make sure to add your splashcreen files to your res/xml directory under the appropriate folders. - -For Android, you also have to edit your projects main java file. You must add a second parameter representing a time delay to your super.loadUrl. - -`super.loadUrl(Config.getStartUrl(), 10000);` - -To install this plugin, follow the [Command-line Interface Guide](http://cordova.apache.org/docs/en/edge/guide_cli_index.md.html#The%20Command-line%20Interface). - -If you are not using the Cordova Command-line Interface, follow [Using Plugman to Manage Plugins](http://cordova.apache.org/docs/en/edge/guide_plugin_ref_plugman.md.html). diff --git a/plugins/org.apache.cordova.core.splashscreen/docs/splashscreen.hide.md b/plugins/org.apache.cordova.core.splashscreen/docs/splashscreen.hide.md deleted file mode 100644 index 2b07d73..0000000 --- a/plugins/org.apache.cordova.core.splashscreen/docs/splashscreen.hide.md +++ /dev/null @@ -1,80 +0,0 @@ ---- -license: Licensed to the Apache Software Foundation (ASF) under one - or more contributor license agreements. See the NOTICE file - distributed with this work for additional information - regarding copyright ownership. The ASF licenses this file - to you under the Apache License, Version 2.0 (the - "License"); you may not use this file except in compliance - with the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, - software distributed under the License is distributed on an - "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - KIND, either express or implied. See the License for the - specific language governing permissions and limitations - under the License. ---- - -hide -=============== - -Dismiss the splash screen. - - navigator.splashscreen.hide(); - -Description ------------ - -navigator.splashscreen.hide() dismisses the applications splash screen. - -Supported Platforms -------------------- - -- Android -- iOS - -Quick Example -------------- - - navigator.splashscreen.hide(); - -Full Example ------------- - - - - - Splashscreen Example - - - - - -

Example

- - - -iOS Quirk ------------- - -1. In your **config.xml**, you need to [modify the value](guide_project-settings_index.md.html#Project%20Settings) for **"AutoHideSplashScreen”** to false - -2. Then, if you want to delay hiding the splash screen for 2 seconds, you can do this in your **deviceready** event handler: - - setTimeout(function() { - navigator.splashscreen.hide(); - }, 2000); diff --git a/plugins/org.apache.cordova.core.splashscreen/docs/splashscreen.md b/plugins/org.apache.cordova.core.splashscreen/docs/splashscreen.md deleted file mode 100644 index 20074bf..0000000 --- a/plugins/org.apache.cordova.core.splashscreen/docs/splashscreen.md +++ /dev/null @@ -1,90 +0,0 @@ ---- -license: Licensed to the Apache Software Foundation (ASF) under one - or more contributor license agreements. See the NOTICE file - distributed with this work for additional information - regarding copyright ownership. The ASF licenses this file - to you under the Apache License, Version 2.0 (the - "License"); you may not use this file except in compliance - with the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, - software distributed under the License is distributed on an - "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - KIND, either express or implied. See the License for the - specific language governing permissions and limitations - under the License. ---- - -Splashscreen -========== - -> Enables developers to show/hide the application's splash screen. - - -Methods -------- - -- show -- hide - -Permissions ------------ - -### Android - -#### app/res/xml/config.xml - - - -### iOS - -#### config.xml - - - -Setup ------ - -### Android - -1. Copy your splash screen image into the res/drawable directories of your Android project. The sizes of each image should be: - - - xlarge (xhdpi): at least 960 x 720 - - large (hdpi): at least 640 x 480 - - medium (mdpi): at least 470 x 320 - - small (ldpi): at least 426 x 320 - - It is highly recommended that you use a [9-patch image](https://developer.android.com/tools/help/draw9patch.html) for your splash screen. - -2. In the onCreate method of the class that extends DroidGap add the following two lines: - - super.setIntegerProperty("splashscreen", R.drawable.splash); - super.loadUrl(Config.getStartUrl(), 10000); - - The first line 'super.setIntegerProperty' sets the image to be displayed as the splashscreen. If you have named your image anything other than splash.png you will have to modify this line. - The second line is the normal 'super.loadUrl' line but it has a second parameter which is the timeout value for the splash screen. In this example the splash screen will display for 10 seconds. If you want to dismiss the splash screen once you get the "deviceready" event you should call the navigator.splashscreen.hide() method. - -### iOS - -1. Copy your splash screen images into the **Resources/splash** directory of your iOS project. Only add the images for the devices you want to support (iPad screen size or iPhone screen size). The sizes of each image should be: - - - Default-568h@2x~iphone.png (640x1136 pixels) - - Default-Landscape@2x~ipad.png (2048x1496 pixels) - - Default-Landscape~ipad.png (1024x748 pixels) - - Default-Portrait@2x~ipad.png (1536x2008 pixels) - - Default-Portrait~ipad.png (768x1004 pixels) - - Default@2x~iphone.png (640x960 pixels) - - Default~iphone.png (320x480 pixels) - -### BlackBerry10 - -## Quirks - -The SplashScreen BlackBerry10 plugin implements hide(), but show() is not possible using the built in OS mechanism. The advantage to using this is the splash screen is displayed before WebKit boots and issupports multiple images for various device resolutions and orientations. -We also implemented the AutoHideSplashScreen config.xml value, similar to iOS. - - - - diff --git a/plugins/org.apache.cordova.core.splashscreen/docs/splashscreen.show.md b/plugins/org.apache.cordova.core.splashscreen/docs/splashscreen.show.md deleted file mode 100644 index 3e22736..0000000 --- a/plugins/org.apache.cordova.core.splashscreen/docs/splashscreen.show.md +++ /dev/null @@ -1,69 +0,0 @@ ---- -license: Licensed to the Apache Software Foundation (ASF) under one - or more contributor license agreements. See the NOTICE file - distributed with this work for additional information - regarding copyright ownership. The ASF licenses this file - to you under the Apache License, Version 2.0 (the - "License"); you may not use this file except in compliance - with the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, - software distributed under the License is distributed on an - "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - KIND, either express or implied. See the License for the - specific language governing permissions and limitations - under the License. ---- - -show -=============== - -Displays the splash screen. - - navigator.splashscreen.show(); - -Description ------------ - -navigator.splashscreen.show() displays the applications splash screen. - -Supported Platforms -------------------- - -- Android -- iOS - -Quick Example -------------- - - navigator.splashscreen.show(); - -Full Example ------------- - - - - - Splashscreen Example - - - - - -

Example

- - diff --git a/plugins/org.apache.cordova.core.splashscreen/plugin.xml b/plugins/org.apache.cordova.core.splashscreen/plugin.xml deleted file mode 100644 index 315d5b1..0000000 --- a/plugins/org.apache.cordova.core.splashscreen/plugin.xml +++ /dev/null @@ -1,80 +0,0 @@ - - - - Splashscreen - Cordova Splashscreen Plugin - Apache - cordova,splashscreen - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/plugins/org.apache.cordova.core.splashscreen/src/android/SplashScreen.java b/plugins/org.apache.cordova.core.splashscreen/src/android/SplashScreen.java deleted file mode 100644 index 95a9497..0000000 --- a/plugins/org.apache.cordova.core.splashscreen/src/android/SplashScreen.java +++ /dev/null @@ -1,43 +0,0 @@ -/* - Licensed to the Apache Software Foundation (ASF) under one - or more contributor license agreements. See the NOTICE file - distributed with this work for additional information - regarding copyright ownership. The ASF licenses this file - to you under the Apache License, Version 2.0 (the - "License"); you may not use this file except in compliance - with the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, - software distributed under the License is distributed on an - "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - KIND, either express or implied. See the License for the - specific language governing permissions and limitations - under the License. -*/ - -package org.apache.cordova.core; - -import org.apache.cordova.CallbackContext; -import org.apache.cordova.CordovaPlugin; -import org.json.JSONArray; - -public class SplashScreen extends CordovaPlugin { - - @Override - public boolean execute(String action, JSONArray args, CallbackContext callbackContext) { - if (action.equals("hide")) { - this.webView.postMessage("splashscreen", "hide"); - } else if (action.equals("show")){ - this.webView.postMessage("splashscreen", "show"); - } - else { - return false; - } - - callbackContext.success(); - return true; - } - -} diff --git a/plugins/org.apache.cordova.core.splashscreen/src/blackberry10/index.js b/plugins/org.apache.cordova.core.splashscreen/src/blackberry10/index.js deleted file mode 100644 index bd7e48c..0000000 --- a/plugins/org.apache.cordova.core.splashscreen/src/blackberry10/index.js +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Copyright 2013 Research In Motion Limited. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -module.exports = { - show: function (success, fail, args, env) { - var result = new PluginResult(args, env); - result.error("Not supported on platform", false); - }, - - hide: function (success, fail, args, env) { - var result = new PluginResult(args, env); - window.qnx.webplatform.getApplication().windowVisible = true; - result.ok(undefined, false); - } -}; diff --git a/plugins/org.apache.cordova.core.splashscreen/src/ios/CDVSplashScreen.h b/plugins/org.apache.cordova.core.splashscreen/src/ios/CDVSplashScreen.h deleted file mode 100644 index 932ad06..0000000 --- a/plugins/org.apache.cordova.core.splashscreen/src/ios/CDVSplashScreen.h +++ /dev/null @@ -1,33 +0,0 @@ -/* - Licensed to the Apache Software Foundation (ASF) under one - or more contributor license agreements. See the NOTICE file - distributed with this work for additional information - regarding copyright ownership. The ASF licenses this file - to you under the Apache License, Version 2.0 (the - "License"); you may not use this file except in compliance - with the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, - software distributed under the License is distributed on an - "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - KIND, either express or implied. See the License for the - specific language governing permissions and limitations - under the License. - */ - -#import -#import - -@interface CDVSplashScreen : CDVPlugin { - UIActivityIndicatorView* _activityView; - UIImageView* _imageView; - NSString* _curImageName; - BOOL _visible; -} - -- (void)show:(CDVInvokedUrlCommand*)command; -- (void)hide:(CDVInvokedUrlCommand*)command; - -@end diff --git a/plugins/org.apache.cordova.core.splashscreen/src/ios/CDVSplashScreen.m b/plugins/org.apache.cordova.core.splashscreen/src/ios/CDVSplashScreen.m deleted file mode 100644 index ba8d108..0000000 --- a/plugins/org.apache.cordova.core.splashscreen/src/ios/CDVSplashScreen.m +++ /dev/null @@ -1,230 +0,0 @@ -/* - Licensed to the Apache Software Foundation (ASF) under one - or more contributor license agreements. See the NOTICE file - distributed with this work for additional information - regarding copyright ownership. The ASF licenses this file - to you under the Apache License, Version 2.0 (the - "License"); you may not use this file except in compliance - with the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, - software distributed under the License is distributed on an - "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - KIND, either express or implied. See the License for the - specific language governing permissions and limitations - under the License. - */ - -#import "CDVSplashScreen.h" - -#define kSplashScreenDurationDefault 0.25f - -@implementation CDVSplashScreen - -- (void)pluginInitialize -{ - [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(pageDidLoad) name:CDVPageDidLoadNotification object:self.webView]; - - [self setVisible:YES]; -} - -- (void)show:(CDVInvokedUrlCommand*)command -{ - [self setVisible:YES]; -} - -- (void)hide:(CDVInvokedUrlCommand*)command -{ - [self setVisible:NO]; -} - -- (void)pageDidLoad -{ - id autoHideSplashScreenValue = [self.commandDelegate.settings objectForKey:[@"AutoHideSplashScreen" lowercaseString]]; - - // if value is missing, default to yes - if ((autoHideSplashScreenValue == nil) || [autoHideSplashScreenValue boolValue]) { - [self setVisible:NO]; - } -} - -- (void)observeValueForKeyPath:(NSString*)keyPath ofObject:(id)object change:(NSDictionary*)change context:(void*)context -{ - [self updateImage]; -} - -- (void)createViews -{ - /* - * The Activity View is the top spinning throbber in the status/battery bar. We init it with the default Grey Style. - * - * whiteLarge = UIActivityIndicatorViewStyleWhiteLarge - * white = UIActivityIndicatorViewStyleWhite - * gray = UIActivityIndicatorViewStyleGray - * - */ - NSString* topActivityIndicator = [self.commandDelegate.settings objectForKey:[@"TopActivityIndicator" lowercaseString]]; - UIActivityIndicatorViewStyle topActivityIndicatorStyle = UIActivityIndicatorViewStyleGray; - - if ([topActivityIndicator isEqualToString:@"whiteLarge"]) { - topActivityIndicatorStyle = UIActivityIndicatorViewStyleWhiteLarge; - } else if ([topActivityIndicator isEqualToString:@"white"]) { - topActivityIndicatorStyle = UIActivityIndicatorViewStyleWhite; - } else if ([topActivityIndicator isEqualToString:@"gray"]) { - topActivityIndicatorStyle = UIActivityIndicatorViewStyleGray; - } - - UIView* parentView = self.viewController.view; - parentView.userInteractionEnabled = NO; // disable user interaction while splashscreen is shown - _activityView = [[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:topActivityIndicatorStyle]; - _activityView.center = CGPointMake(parentView.bounds.size.width / 2, parentView.bounds.size.height / 2); - _activityView.autoresizingMask = UIViewAutoresizingFlexibleTopMargin | UIViewAutoresizingFlexibleLeftMargin - | UIViewAutoresizingFlexibleBottomMargin | UIViewAutoresizingFlexibleRightMargin; - [_activityView startAnimating]; - - // Set the frame & image later. - _imageView = [[UIImageView alloc] init]; - [parentView addSubview:_imageView]; - - id showSplashScreenSpinnerValue = [self.commandDelegate.settings objectForKey:[@"ShowSplashScreenSpinner" lowercaseString]]; - // backwards compatibility - if key is missing, default to true - if ((showSplashScreenSpinnerValue == nil) || [showSplashScreenSpinnerValue boolValue]) { - [parentView addSubview:_activityView]; - } - - // Frame is required when launching in portrait mode. - // Bounds for landscape since it captures the rotation. - [parentView addObserver:self forKeyPath:@"frame" options:0 context:nil]; - [parentView addObserver:self forKeyPath:@"bounds" options:0 context:nil]; - - [self updateImage]; -} - -- (void)destroyViews -{ - [_imageView removeFromSuperview]; - [_activityView removeFromSuperview]; - _imageView = nil; - _activityView = nil; - _curImageName = nil; - - self.viewController.view.userInteractionEnabled = YES; // re-enable user interaction upon completion - [self.viewController.view removeObserver:self forKeyPath:@"frame"]; - [self.viewController.view removeObserver:self forKeyPath:@"bounds"]; -} - -// Sets the view's frame and image. -- (void)updateImage -{ - UIInterfaceOrientation orientation = self.viewController.interfaceOrientation; - - // Use UILaunchImageFile if specified in plist. Otherwise, use Default. - NSString* imageName = [[NSBundle mainBundle] objectForInfoDictionaryKey:@"UILaunchImageFile"]; - - if (imageName) { - imageName = [imageName stringByDeletingPathExtension]; - } else { - imageName = @"Default"; - } - - if (CDV_IsIPhone5()) { - imageName = [imageName stringByAppendingString:@"-568h"]; - } else if (CDV_IsIPad()) { - switch (orientation) { - case UIInterfaceOrientationLandscapeLeft: - case UIInterfaceOrientationLandscapeRight: - imageName = [imageName stringByAppendingString:@"-Landscape"]; - break; - - case UIInterfaceOrientationPortrait: - case UIInterfaceOrientationPortraitUpsideDown: - default: - imageName = [imageName stringByAppendingString:@"-Portrait"]; - break; - } - } - - if (![imageName isEqualToString:_curImageName]) { - UIImage* img = [UIImage imageNamed:imageName]; - _imageView.image = img; - _curImageName = imageName; - } - - // Check that splash screen's image exists before updating bounds - if (_imageView.image) { - [self updateBounds]; - } else { - NSLog(@"WARNING: The splashscreen image named %@ was not found", imageName); - } -} - -- (void)updateBounds -{ - UIImage* img = _imageView.image; - CGRect imgBounds = CGRectMake(0, 0, img.size.width, img.size.height); - - CGSize screenSize = [self.viewController.view convertRect:[UIScreen mainScreen].bounds fromView:nil].size; - - // There's a special case when the image is the size of the screen. - if (CGSizeEqualToSize(screenSize, imgBounds.size)) { - CGRect statusFrame = [self.viewController.view convertRect:[UIApplication sharedApplication].statusBarFrame fromView:nil]; - imgBounds.origin.y -= statusFrame.size.height; - } else { - CGRect viewBounds = self.viewController.view.bounds; - CGFloat imgAspect = imgBounds.size.width / imgBounds.size.height; - CGFloat viewAspect = viewBounds.size.width / viewBounds.size.height; - // This matches the behaviour of the native splash screen. - CGFloat ratio; - if (viewAspect > imgAspect) { - ratio = viewBounds.size.width / imgBounds.size.width; - } else { - ratio = viewBounds.size.height / imgBounds.size.height; - } - imgBounds.size.height *= ratio; - imgBounds.size.width *= ratio; - } - - _imageView.frame = imgBounds; -} - -- (void)setVisible:(BOOL)visible -{ - if (visible == _visible) { - return; - } - _visible = visible; - - id fadeSplashScreenValue = [self.commandDelegate.settings objectForKey:[@"FadeSplashScreen" lowercaseString]]; - id fadeSplashScreenDuration = [self.commandDelegate.settings objectForKey:[@"FadeSplashScreenDuration" lowercaseString]]; - - float fadeDuration = fadeSplashScreenDuration == nil ? kSplashScreenDurationDefault : [fadeSplashScreenDuration floatValue]; - - if ((fadeSplashScreenValue == nil) || ![fadeSplashScreenValue boolValue]) { - fadeDuration = 0; - } - - // Never animate the showing of the splash screen. - if (visible) { - if (_imageView == nil) { - [self createViews]; - } - } else if (fadeDuration == 0) { - [self destroyViews]; - } else { - [UIView transitionWithView:self.viewController.view - duration:fadeDuration - options:UIViewAnimationOptionTransitionNone - animations:^(void) { - [_imageView setAlpha:0]; - [_activityView setAlpha:0]; - } - - completion:^(BOOL finished) { - [self destroyViews]; - }]; - } -} - -@end diff --git a/plugins/org.apache.cordova.core.splashscreen/src/wp/SplashScreen.cs b/plugins/org.apache.cordova.core.splashscreen/src/wp/SplashScreen.cs deleted file mode 100644 index 2eda771..0000000 --- a/plugins/org.apache.cordova.core.splashscreen/src/wp/SplashScreen.cs +++ /dev/null @@ -1,69 +0,0 @@ -/* - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -using System; -using System.Net; -using System.Windows; -using System.Windows.Controls; -using System.Windows.Documents; -using System.Windows.Ink; -using System.Windows.Input; -using System.Windows.Media; -using System.Windows.Media.Animation; -using System.Windows.Shapes; -using Microsoft.Phone.Info; -using System.Windows.Controls.Primitives; -using System.Diagnostics; -using System.Windows.Media.Imaging; - -namespace WPCordovaClassLib.Cordova.Commands -{ - /// - /// Listens for changes to the state of the battery on the device. - /// Currently only the "isPlugged" parameter available via native APIs. - /// - public class SplashScreen : BaseCommand - { - private Popup popup; - - public SplashScreen() - { - Image SplashScreen = new Image(); - BitmapImage splash_image = new BitmapImage(); - splash_image.SetSource(Application.GetResourceStream(new Uri(@"SplashScreenImage.jpg", UriKind.Relative)).Stream); - SplashScreen.Source = splash_image; - - // Instansiate the popup and set the Child property of Popup to SplashScreen - this.popup = new Popup() {IsOpen = false, Child = SplashScreen }; - // Orient the popup accordingly - this.popup.HorizontalAlignment = HorizontalAlignment.Stretch; - this.popup.VerticalAlignment = VerticalAlignment.Center; - } - - public void show(string options) - { - Deployment.Current.Dispatcher.BeginInvoke(() => - { - this.popup.IsOpen = true; - }); - } - public void hide(string options) - { - Deployment.Current.Dispatcher.BeginInvoke(() => - { - this.popup.IsOpen = false; - }); - } - } -} diff --git a/plugins/org.apache.cordova.core.splashscreen/test/cordova-incl.js b/plugins/org.apache.cordova.core.splashscreen/test/cordova-incl.js deleted file mode 100644 index dbcd1a6..0000000 --- a/plugins/org.apache.cordova.core.splashscreen/test/cordova-incl.js +++ /dev/null @@ -1,70 +0,0 @@ -/* - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - * -*/ - -var PLAT; -if (/Android/.exec(navigator.userAgent)) { - PLAT = 'android'; -} else if (/(iPad)|(iPhone)|(iPod)/.exec(navigator.userAgent)) { - PLAT = 'ios'; -} else if (/(BB10)|(PlayBook)|(BlackBerry)/.exec(navigator.userAgent)) { - PLAT = 'blackberry'; -} - -var scripts = document.getElementsByTagName('script'); -var currentPath = scripts[scripts.length - 1].src; -var platformCordovaPath = currentPath.replace("cordova-incl.js", "cordova." + PLAT + ".js"); -var normalCordovaPath = currentPath.replace("cordova-incl.js", "cordova.js"); -var cordovaPath = normalCordovaPath; - -if (PLAT) { - // XHR to local file is an error on some platforms, windowsphone for one - try { - var xhr = new XMLHttpRequest(); - xhr.open("GET", platformCordovaPath, false); - xhr.onreadystatechange = function() { - - if (this.readyState == this.DONE && this.responseText.length > 0) { - if(parseInt(this.status) >= 400){ - cordovaPath = normalCordovaPath; - }else{ - cordovaPath = platformCordovaPath; - } - } - }; - xhr.send(null); - } - catch(e){ - cordovaPath = normalCordovaPath; - } // access denied! -} - -if (!window._doNotWriteCordovaScript) { - document.write(''); -} - -function backHome() { - if (window.device && device.platform && device.platform.toLowerCase() == 'android') { - navigator.app.backHistory(); - } - else { - window.history.go(-1); - } -} diff --git a/plugins/org.apache.cordova.core.splashscreen/test/index.html b/plugins/org.apache.cordova.core.splashscreen/test/index.html deleted file mode 100644 index 2c5447b..0000000 --- a/plugins/org.apache.cordova.core.splashscreen/test/index.html +++ /dev/null @@ -1,65 +0,0 @@ - - - - - - - - - Cordova Mobile Spec - - - - - - -

Apache Cordova Tests

-
-

Platform:

-

Version:

-

UUID:

-

Name:

-

Model:

-

Width: , Height: - , Color Depth:

-

User-Agent:

-
- Automatic Test - Accelerometer - Audio Play/Record - Battery - Camera - Compass - Contacts - Events - Location - Lazy Loading of cordova-incl.js - Misc Content - Network - Notification - Splashscreen - Web SQL - Local Storage - Benchmarks - In App Browser - - diff --git a/plugins/org.apache.cordova.core.splashscreen/test/main.js b/plugins/org.apache.cordova.core.splashscreen/test/main.js deleted file mode 100644 index 66c1bd3..0000000 --- a/plugins/org.apache.cordova.core.splashscreen/test/main.js +++ /dev/null @@ -1,163 +0,0 @@ -/* - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - * -*/ - -var deviceInfo = function() { - document.getElementById("platform").innerHTML = device.platform; - document.getElementById("version").innerHTML = device.version; - document.getElementById("uuid").innerHTML = device.uuid; - document.getElementById("name").innerHTML = device.name; - document.getElementById("model").innerHTML = device.model; - document.getElementById("width").innerHTML = screen.width; - document.getElementById("height").innerHTML = screen.height; - document.getElementById("colorDepth").innerHTML = screen.colorDepth; -}; - -var getLocation = function() { - var suc = function(p) { - alert(p.coords.latitude + " " + p.coords.longitude); - }; - var locFail = function() { - }; - navigator.geolocation.getCurrentPosition(suc, locFail); -}; - -var beep = function() { - navigator.notification.beep(2); -}; - -var vibrate = function() { - navigator.notification.vibrate(0); -}; - -function roundNumber(num) { - var dec = 3; - var result = Math.round(num * Math.pow(10, dec)) / Math.pow(10, dec); - return result; -} - -var accelerationWatch = null; - -function updateAcceleration(a) { - document.getElementById('x').innerHTML = roundNumber(a.x); - document.getElementById('y').innerHTML = roundNumber(a.y); - document.getElementById('z').innerHTML = roundNumber(a.z); -} - -var toggleAccel = function() { - if (accelerationWatch !== null) { - navigator.accelerometer.clearWatch(accelerationWatch); - updateAcceleration({ - x : "", - y : "", - z : "" - }); - accelerationWatch = null; - } else { - var options = {}; - options.frequency = 1000; - accelerationWatch = navigator.accelerometer.watchAcceleration( - updateAcceleration, function(ex) { - alert("accel fail (" + ex.name + ": " + ex.message + ")"); - }, options); - } -}; - -var preventBehavior = function(e) { - e.preventDefault(); -}; - -function dump_pic(data) { - var viewport = document.getElementById('viewport'); - console.log(data); - viewport.style.display = ""; - viewport.style.position = "absolute"; - viewport.style.top = "10px"; - viewport.style.left = "10px"; - document.getElementById("test_img").src = "data:image/jpeg;base64," + data; -} - -function fail(msg) { - alert(msg); -} - -function show_pic() { - navigator.camera.getPicture(dump_pic, fail, { - quality : 50 - }); -} - -function close() { - var viewport = document.getElementById('viewport'); - viewport.style.position = "relative"; - viewport.style.display = "none"; -} - -// This is just to do this. -function readFile() { - navigator.file.read('/sdcard/cordova.txt', fail, fail); -} - -function writeFile() { - navigator.file.write('foo.txt', "This is a test of writing to a file", - fail, fail); -} - -function contacts_success(contacts) { - alert(contacts.length - + ' contacts returned.' - + (contacts[2] && contacts[2].name ? (' Third contact is ' + contacts[2].name.formatted) - : '')); -} - -function get_contacts() { - var obj = new ContactFindOptions(); - obj.filter = ""; - obj.multiple = true; - obj.limit = 5; - navigator.service.contacts.find( - [ "displayName", "name" ], contacts_success, - fail, obj); -} - -var networkReachableCallback = function(reachability) { - // There is no consistency on the format of reachability - var networkState = reachability.code || reachability; - - var currentState = {}; - currentState[NetworkStatus.NOT_REACHABLE] = 'No network connection'; - currentState[NetworkStatus.REACHABLE_VIA_CARRIER_DATA_NETWORK] = 'Carrier data connection'; - currentState[NetworkStatus.REACHABLE_VIA_WIFI_NETWORK] = 'WiFi connection'; - - confirm("Connection type:\n" + currentState[networkState]); -}; - -function check_network() { - navigator.network.isReachable("www.mobiledevelopersolutions.com", - networkReachableCallback, {}); -} - -function init() { - // the next line makes it impossible to see Contacts on the HTC Evo since it - // doesn't have a scroll button - // document.addEventListener("touchmove", preventBehavior, false); - document.addEventListener("deviceready", deviceInfo, true); - document.getElementById("user-agent").textContent = navigator.userAgent; -} diff --git a/plugins/org.apache.cordova.core.splashscreen/test/master.css b/plugins/org.apache.cordova.core.splashscreen/test/master.css deleted file mode 100644 index e93c937..0000000 --- a/plugins/org.apache.cordova.core.splashscreen/test/master.css +++ /dev/null @@ -1,164 +0,0 @@ -/* - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - * -*/ - - body { - background:#222 none repeat scroll 0 0; - color:#666; - font-family:Helvetica; - font-size:72%; - line-height:1.5em; - margin:0; - border-top:1px solid #393939; - } - - #info{ - background:#ffa; - border: 1px solid #ffd324; - -webkit-border-radius: 5px; - border-radius: 5px; - clear:both; - margin:15px 6px 0; - min-width:295px; - max-width:97%; - padding:4px 0px 2px 10px; - word-wrap:break-word; - margin-bottom:10px; - display:inline-block; - min-height: 160px; - max-height: 300px; - overflow: auto; - -webkit-overflow-scrolling: touch; - } - - #info > h4{ - font-size:.95em; - margin:5px 0; - } - - #stage.theme{ - padding-top:3px; - } - - /* Definition List */ - #stage.theme > dl{ - padding-top:10px; - clear:both; - margin:0; - list-style-type:none; - padding-left:10px; - overflow:auto; - } - - #stage.theme > dl > dt{ - font-weight:bold; - float:left; - margin-left:5px; - } - - #stage.theme > dl > dd{ - width:45px; - float:left; - color:#a87; - font-weight:bold; - } - - /* Content Styling */ - #stage.theme > h1, #stage.theme > h2, #stage.theme > p{ - margin:1em 0 .5em 13px; - } - - #stage.theme > h1{ - color:#eee; - font-size:1.6em; - text-align:center; - margin:0; - margin-top:15px; - padding:0; - } - - #stage.theme > h2{ - clear:both; - margin:0; - padding:3px; - font-size:1em; - text-align:center; - } - - /* Stage Buttons */ - #stage.theme .btn{ - border: 1px solid #555; - -webkit-border-radius: 5px; - border-radius: 5px; - text-align:center; - display:inline-block; - background:#444; - width:150px; - color:#9ab; - font-size:1.1em; - text-decoration:none; - padding:1.2em 0; - margin:3px 0px 3px 5px; - } - - #stage.theme .large{ - width:308px; - padding:1.2em 0; - } - - #stage.theme .wide{ - width:100%; - padding:1.2em 0; - } - - #stage.theme .backBtn{ - border: 1px solid #555; - -webkit-border-radius: 5px; - border-radius: 5px; - text-align:center; - display:block; - float:right; - background:#666; - width:75px; - color:#9ab; - font-size:1.1em; - text-decoration:none; - padding:1.2em 0; - margin:3px 5px 3px 5px; - } - - #stage.theme .input{ - border: 1px solid #555; - -webkit-border-radius: 5px; - border-radius: 5px; - text-align:center; - display:block; - float:light; - background:#888; - color:#9cd; - font-size:1.1em; - text-decoration:none; - padding:1.2em 0; - margin:3px 0px 3px 5px; - } - - #stage.theme .numeric{ - width:100%; - } diff --git a/plugins/org.apache.cordova.core.splashscreen/test/splashscreen/index.html b/plugins/org.apache.cordova.core.splashscreen/test/splashscreen/index.html deleted file mode 100644 index 19132a4..0000000 --- a/plugins/org.apache.cordova.core.splashscreen/test/splashscreen/index.html +++ /dev/null @@ -1,48 +0,0 @@ - - - - - - - - - Cordova Mobile Spec - - - - - - -

Splashscreen

-

Action

-
Show for 1 second
-
Show for 5 seconds
-

Back
- - diff --git a/plugins/org.apache.cordova.core.splashscreen/www/splashscreen.js b/plugins/org.apache.cordova.core.splashscreen/www/splashscreen.js deleted file mode 100644 index 7cb48bd..0000000 --- a/plugins/org.apache.cordova.core.splashscreen/www/splashscreen.js +++ /dev/null @@ -1,33 +0,0 @@ -/* - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - * -*/ - -var exec = require('cordova/exec'); - -var splashscreen = { - show:function() { - exec(null, null, "SplashScreen", "show", []); - }, - hide:function() { - exec(null, null, "SplashScreen", "hide", []); - } -}; - -module.exports = splashscreen; diff --git a/plugins/org.apache.cordova.core.splashscreen/www/windows8/SplashScreenProxy.js b/plugins/org.apache.cordova.core.splashscreen/www/windows8/SplashScreenProxy.js deleted file mode 100644 index aa592c1..0000000 --- a/plugins/org.apache.cordova.core.splashscreen/www/windows8/SplashScreenProxy.js +++ /dev/null @@ -1,104 +0,0 @@ -/* - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - * -*/ - -/*global Windows:true */ - - var cordova = require('cordova'), - channel = require('cordova/channel'); - -/* This is the actual implementation part that returns the result on Windows 8 -*/ - - var position = { x: 0, y: 0, width: 0, height: 0 }; // defined by evt.detail.splashScreen.imageLocation - var splash = null; // - var localSplash; // the image to display - var localSplashImage; - var bgColor = "#464646"; - - function onResize(evt) { - if (splash) { - position = splash.imageLocation; - updateImageLocation(); - } - } - - function updateImageLocation() { - localSplash.style.width = window.innerWidth + "px"; - localSplash.style.height = window.innerHeight + "px"; - localSplash.style.top = "0px"; - localSplash.style.left = "0px"; - - localSplashImage.style.top = position.y + "px"; - localSplashImage.style.left = position.x + "px"; - localSplashImage.style.height = position.height + "px"; - localSplashImage.style.width = position.width + "px"; - } - - var SplashScreen = { - setBGColor:function(cssBGColor) { - bgColor = cssBGColor; - if (localSplash) { - localSplash.style.backgroundColor = bgColor; - } - }, - show:function(){ - window.addEventListener("resize", onResize, false); - localSplash = document.createElement("div"); - localSplash.style.backgroundColor = bgColor;; - localSplash.style.position = "absolute"; - - var img = localSplashImage = document.createElement("img"); - img.src = "img/splashscreen.png"; - img.style.position = "absolute"; - - updateImageLocation(); - - localSplash.appendChild(localSplashImage); - document.body.appendChild(localSplash); - }, - hide:function(){ - window.removeEventListener("resize", onResize, false); - document.body.removeChild(localSplash); - localSplash = null; - } - } - - module.exports = SplashScreen; - -function activated(evt) { - if (evt.detail.kind === Windows.ApplicationModel.Activation.ActivationKind.launch) { - splash = evt.detail.splashScreen; - position = evt.detail.splashScreen.imageLocation; - SplashScreen.show(); - } -} - - - - -channel.onCordovaReady.subscribe(function (evt) { - document.addEventListener("DOMContentLoaded", function (evt) { - WinJS.Application.addEventListener("activated", activated, false); - }, false); -}); - -require("cordova/commandProxy").add("SplashScreen",SplashScreen); - diff --git a/resources/4s/iOS Simulator Screen Shot 29 Dec 2014 16.31.03.png b/resources/4s/iOS Simulator Screen Shot 29 Dec 2014 16.31.03.png new file mode 100644 index 0000000..42ef208 Binary files /dev/null and b/resources/4s/iOS Simulator Screen Shot 29 Dec 2014 16.31.03.png differ diff --git a/resources/4s/iOS Simulator Screen Shot 29 Dec 2014 16.31.09.png b/resources/4s/iOS Simulator Screen Shot 29 Dec 2014 16.31.09.png new file mode 100644 index 0000000..61958d7 Binary files /dev/null and b/resources/4s/iOS Simulator Screen Shot 29 Dec 2014 16.31.09.png differ diff --git a/resources/4s/iOS Simulator Screen Shot 29 Dec 2014 16.31.25.png b/resources/4s/iOS Simulator Screen Shot 29 Dec 2014 16.31.25.png new file mode 100644 index 0000000..12f5b19 Binary files /dev/null and b/resources/4s/iOS Simulator Screen Shot 29 Dec 2014 16.31.25.png differ diff --git a/resources/4s/iOS Simulator Screen Shot 29 Dec 2014 16.31.36.png b/resources/4s/iOS Simulator Screen Shot 29 Dec 2014 16.31.36.png new file mode 100644 index 0000000..4532821 Binary files /dev/null and b/resources/4s/iOS Simulator Screen Shot 29 Dec 2014 16.31.36.png differ diff --git a/resources/4s/iOS Simulator Screen Shot 29 Dec 2014 16.31.50.png b/resources/4s/iOS Simulator Screen Shot 29 Dec 2014 16.31.50.png new file mode 100644 index 0000000..8010f81 Binary files /dev/null and b/resources/4s/iOS Simulator Screen Shot 29 Dec 2014 16.31.50.png differ diff --git a/resources/5s/iOS Simulator Screen Shot 29 Dec 2014 16.39.17.png b/resources/5s/iOS Simulator Screen Shot 29 Dec 2014 16.39.17.png new file mode 100644 index 0000000..01012d6 Binary files /dev/null and b/resources/5s/iOS Simulator Screen Shot 29 Dec 2014 16.39.17.png differ diff --git a/resources/5s/iOS Simulator Screen Shot 29 Dec 2014 16.39.27.png b/resources/5s/iOS Simulator Screen Shot 29 Dec 2014 16.39.27.png new file mode 100644 index 0000000..d0ae3a4 Binary files /dev/null and b/resources/5s/iOS Simulator Screen Shot 29 Dec 2014 16.39.27.png differ diff --git a/resources/5s/iOS Simulator Screen Shot 29 Dec 2014 16.39.34.png b/resources/5s/iOS Simulator Screen Shot 29 Dec 2014 16.39.34.png new file mode 100644 index 0000000..8044d29 Binary files /dev/null and b/resources/5s/iOS Simulator Screen Shot 29 Dec 2014 16.39.34.png differ diff --git a/resources/5s/iOS Simulator Screen Shot 29 Dec 2014 16.39.52.png b/resources/5s/iOS Simulator Screen Shot 29 Dec 2014 16.39.52.png new file mode 100644 index 0000000..fb4568c Binary files /dev/null and b/resources/5s/iOS Simulator Screen Shot 29 Dec 2014 16.39.52.png differ diff --git a/resources/6+/iOS Simulator Screen Shot 29 Dec 2014 16.41.03.png b/resources/6+/iOS Simulator Screen Shot 29 Dec 2014 16.41.03.png new file mode 100644 index 0000000..1768372 Binary files /dev/null and b/resources/6+/iOS Simulator Screen Shot 29 Dec 2014 16.41.03.png differ diff --git a/resources/6+/iOS Simulator Screen Shot 29 Dec 2014 16.41.09.png b/resources/6+/iOS Simulator Screen Shot 29 Dec 2014 16.41.09.png new file mode 100644 index 0000000..10e131a Binary files /dev/null and b/resources/6+/iOS Simulator Screen Shot 29 Dec 2014 16.41.09.png differ diff --git a/resources/6+/iOS Simulator Screen Shot 29 Dec 2014 16.41.24.png b/resources/6+/iOS Simulator Screen Shot 29 Dec 2014 16.41.24.png new file mode 100644 index 0000000..0a347c6 Binary files /dev/null and b/resources/6+/iOS Simulator Screen Shot 29 Dec 2014 16.41.24.png differ diff --git a/resources/6+/iOS Simulator Screen Shot 29 Dec 2014 16.41.27.png b/resources/6+/iOS Simulator Screen Shot 29 Dec 2014 16.41.27.png new file mode 100644 index 0000000..7498a77 Binary files /dev/null and b/resources/6+/iOS Simulator Screen Shot 29 Dec 2014 16.41.27.png differ diff --git a/resources/6/iOS Simulator Screen Shot 29 Dec 2014 16.41.58.png b/resources/6/iOS Simulator Screen Shot 29 Dec 2014 16.41.58.png new file mode 100644 index 0000000..dbd912c Binary files /dev/null and b/resources/6/iOS Simulator Screen Shot 29 Dec 2014 16.41.58.png differ diff --git a/resources/6/iOS Simulator Screen Shot 29 Dec 2014 16.42.02.png b/resources/6/iOS Simulator Screen Shot 29 Dec 2014 16.42.02.png new file mode 100644 index 0000000..5991ca8 Binary files /dev/null and b/resources/6/iOS Simulator Screen Shot 29 Dec 2014 16.42.02.png differ diff --git a/resources/6/iOS Simulator Screen Shot 29 Dec 2014 16.42.11.png b/resources/6/iOS Simulator Screen Shot 29 Dec 2014 16.42.11.png new file mode 100644 index 0000000..4edf0bd Binary files /dev/null and b/resources/6/iOS Simulator Screen Shot 29 Dec 2014 16.42.11.png differ diff --git a/resources/6/iOS Simulator Screen Shot 29 Dec 2014 16.42.13.png b/resources/6/iOS Simulator Screen Shot 29 Dec 2014 16.42.13.png new file mode 100644 index 0000000..39c1cea Binary files /dev/null and b/resources/6/iOS Simulator Screen Shot 29 Dec 2014 16.42.13.png differ diff --git a/resources/Media.xcassets/AppIcon.appiconset/Contents.json b/resources/Media.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 0000000..44676ae --- /dev/null +++ b/resources/Media.xcassets/AppIcon.appiconset/Contents.json @@ -0,0 +1,122 @@ +{ + "images" : [ + { + "size" : "40x40", + "idiom" : "ipad", + "filename" : "Icon-40.png", + "scale" : "1x" + }, + { + "size" : "40x40", + "idiom" : "ipad", + "filename" : "Icon-40@2x.png", + "scale" : "2x" + }, + { + "size" : "60x60", + "idiom" : "iphone", + "filename" : "Icon-60@2x.png", + "scale" : "2x" + }, + { + "size" : "72x72", + "idiom" : "ipad", + "filename" : "Icon-72.png", + "scale" : "1x" + }, + { + "size" : "72x72", + "idiom" : "ipad", + "filename" : "Icon-72@2x.png", + "scale" : "2x" + }, + { + "size" : "76x76", + "idiom" : "ipad", + "filename" : "Icon-76.png", + "scale" : "1x" + }, + { + "size" : "76x76", + "idiom" : "ipad", + "filename" : "Icon-76@2x.png", + "scale" : "2x" + }, + { + "size" : "50x50", + "idiom" : "ipad", + "filename" : "Icon-Small-50.png", + "scale" : "1x" + }, + { + "size" : "50x50", + "idiom" : "ipad", + "filename" : "Icon-Small-50@2x.png", + "scale" : "2x" + }, + { + "size" : "29x29", + "idiom" : "iphone", + "filename" : "Icon-Small.png", + "scale" : "1x" + }, + { + "size" : "29x29", + "idiom" : "iphone", + "filename" : "Icon-Small@2x.png", + "scale" : "2x" + }, + { + "size" : "57x57", + "idiom" : "iphone", + "filename" : "Icon.png", + "scale" : "1x" + }, + { + "size" : "57x57", + "idiom" : "iphone", + "filename" : "Icon@2x.png", + "scale" : "2x" + }, + { + "size" : "29x29", + "idiom" : "iphone", + "filename" : "Icon-Small@3x.png", + "scale" : "3x" + }, + { + "size" : "40x40", + "idiom" : "iphone", + "filename" : "Icon-40@3x.png", + "scale" : "3x" + }, + { + "size" : "60x60", + "idiom" : "iphone", + "filename" : "Icon-60@3x.png", + "scale" : "3x" + }, + { + "size" : "40x40", + "idiom" : "iphone", + "filename" : "Icon-40@2x.png", + "scale" : "2x" + }, + { + "size" : "29x29", + "idiom" : "ipad", + "filename" : "Icon-Small.png", + "scale" : "1x" + }, + { + "size" : "29x29", + "idiom" : "ipad", + "filename" : "Icon-Small@2x.png", + "scale" : "2x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/resources/Media.xcassets/AppIcon.appiconset/Icon-40.png b/resources/Media.xcassets/AppIcon.appiconset/Icon-40.png new file mode 100644 index 0000000..daa7b1f Binary files /dev/null and b/resources/Media.xcassets/AppIcon.appiconset/Icon-40.png differ diff --git a/resources/Media.xcassets/AppIcon.appiconset/Icon-40@2x.png b/resources/Media.xcassets/AppIcon.appiconset/Icon-40@2x.png new file mode 100644 index 0000000..0abb36b Binary files /dev/null and b/resources/Media.xcassets/AppIcon.appiconset/Icon-40@2x.png differ diff --git a/resources/Media.xcassets/AppIcon.appiconset/Icon-40@3x.png b/resources/Media.xcassets/AppIcon.appiconset/Icon-40@3x.png new file mode 100644 index 0000000..af7d095 Binary files /dev/null and b/resources/Media.xcassets/AppIcon.appiconset/Icon-40@3x.png differ diff --git a/resources/Media.xcassets/AppIcon.appiconset/Icon-60@2x.png b/resources/Media.xcassets/AppIcon.appiconset/Icon-60@2x.png new file mode 100644 index 0000000..af7d095 Binary files /dev/null and b/resources/Media.xcassets/AppIcon.appiconset/Icon-60@2x.png differ diff --git a/resources/Media.xcassets/AppIcon.appiconset/Icon-60@3x.png b/resources/Media.xcassets/AppIcon.appiconset/Icon-60@3x.png new file mode 100644 index 0000000..b73906d Binary files /dev/null and b/resources/Media.xcassets/AppIcon.appiconset/Icon-60@3x.png differ diff --git a/resources/Media.xcassets/AppIcon.appiconset/Icon-72.png b/resources/Media.xcassets/AppIcon.appiconset/Icon-72.png new file mode 100644 index 0000000..59f3f5f Binary files /dev/null and b/resources/Media.xcassets/AppIcon.appiconset/Icon-72.png differ diff --git a/resources/Media.xcassets/AppIcon.appiconset/Icon-72@2x.png b/resources/Media.xcassets/AppIcon.appiconset/Icon-72@2x.png new file mode 100644 index 0000000..fa725b5 Binary files /dev/null and b/resources/Media.xcassets/AppIcon.appiconset/Icon-72@2x.png differ diff --git a/resources/Media.xcassets/AppIcon.appiconset/Icon-76.png b/resources/Media.xcassets/AppIcon.appiconset/Icon-76.png new file mode 100644 index 0000000..cd57aca Binary files /dev/null and b/resources/Media.xcassets/AppIcon.appiconset/Icon-76.png differ diff --git a/resources/Media.xcassets/AppIcon.appiconset/Icon-76@2x.png b/resources/Media.xcassets/AppIcon.appiconset/Icon-76@2x.png new file mode 100644 index 0000000..db0ac08 Binary files /dev/null and b/resources/Media.xcassets/AppIcon.appiconset/Icon-76@2x.png differ diff --git a/resources/Media.xcassets/AppIcon.appiconset/Icon-Small-50.png b/resources/Media.xcassets/AppIcon.appiconset/Icon-Small-50.png new file mode 100644 index 0000000..a717d2a Binary files /dev/null and b/resources/Media.xcassets/AppIcon.appiconset/Icon-Small-50.png differ diff --git a/resources/Media.xcassets/AppIcon.appiconset/Icon-Small-50@2x.png b/resources/Media.xcassets/AppIcon.appiconset/Icon-Small-50@2x.png new file mode 100644 index 0000000..eb5efb1 Binary files /dev/null and b/resources/Media.xcassets/AppIcon.appiconset/Icon-Small-50@2x.png differ diff --git a/resources/Media.xcassets/AppIcon.appiconset/Icon-Small.png b/resources/Media.xcassets/AppIcon.appiconset/Icon-Small.png new file mode 100644 index 0000000..7c912ea Binary files /dev/null and b/resources/Media.xcassets/AppIcon.appiconset/Icon-Small.png differ diff --git a/resources/Media.xcassets/AppIcon.appiconset/Icon-Small@2x.png b/resources/Media.xcassets/AppIcon.appiconset/Icon-Small@2x.png new file mode 100644 index 0000000..e04e538 Binary files /dev/null and b/resources/Media.xcassets/AppIcon.appiconset/Icon-Small@2x.png differ diff --git a/resources/Media.xcassets/AppIcon.appiconset/Icon-Small@3x.png b/resources/Media.xcassets/AppIcon.appiconset/Icon-Small@3x.png new file mode 100644 index 0000000..1cfb96b Binary files /dev/null and b/resources/Media.xcassets/AppIcon.appiconset/Icon-Small@3x.png differ diff --git a/resources/Media.xcassets/AppIcon.appiconset/Icon.png b/resources/Media.xcassets/AppIcon.appiconset/Icon.png new file mode 100644 index 0000000..ef6c948 Binary files /dev/null and b/resources/Media.xcassets/AppIcon.appiconset/Icon.png differ diff --git a/resources/Media.xcassets/AppIcon.appiconset/Icon@2x.png b/resources/Media.xcassets/AppIcon.appiconset/Icon@2x.png new file mode 100644 index 0000000..5565cb8 Binary files /dev/null and b/resources/Media.xcassets/AppIcon.appiconset/Icon@2x.png differ diff --git a/resources/TDA Enrichment Icon.psd b/resources/TDA Enrichment Icon.psd new file mode 100644 index 0000000..df8b5c1 Binary files /dev/null and b/resources/TDA Enrichment Icon.psd differ diff --git a/resources/iOS Simulator Screen Shot 29 Dec 2014 15.49.30.png b/resources/iOS Simulator Screen Shot 29 Dec 2014 15.49.30.png new file mode 100644 index 0000000..7083ee6 Binary files /dev/null and b/resources/iOS Simulator Screen Shot 29 Dec 2014 15.49.30.png differ diff --git a/resources/iOS Simulator Screen Shot 29 Dec 2014 15.49.50.png b/resources/iOS Simulator Screen Shot 29 Dec 2014 15.49.50.png new file mode 100644 index 0000000..cc1c915 Binary files /dev/null and b/resources/iOS Simulator Screen Shot 29 Dec 2014 15.49.50.png differ diff --git a/resources/iOS Simulator Screen Shot 29 Dec 2014 15.50.04.png b/resources/iOS Simulator Screen Shot 29 Dec 2014 15.50.04.png new file mode 100644 index 0000000..2bc3d6f Binary files /dev/null and b/resources/iOS Simulator Screen Shot 29 Dec 2014 15.50.04.png differ diff --git a/resources/iOS Simulator Screen Shot 29 Dec 2014 15.56.45.png b/resources/iOS Simulator Screen Shot 29 Dec 2014 15.56.45.png new file mode 100644 index 0000000..8cab189 Binary files /dev/null and b/resources/iOS Simulator Screen Shot 29 Dec 2014 15.56.45.png differ diff --git a/resources/iTunesArtwork@2x.png b/resources/iTunesArtwork@2x.png new file mode 100644 index 0000000..91a7808 Binary files /dev/null and b/resources/iTunesArtwork@2x.png differ diff --git a/www/config.xml b/www/config.xml deleted file mode 100644 index 31960a1..0000000 --- a/www/config.xml +++ /dev/null @@ -1,17 +0,0 @@ - - - TDA Enrichment - - Thomas Deacon Academy Sports Enrichment App - - - George Garside - - - - - - - - - diff --git a/www/cordova.js b/www/cordova.js deleted file mode 100755 index fd8aa39..0000000 --- a/www/cordova.js +++ /dev/null @@ -1,6521 +0,0 @@ -// Platform: ios -// 2.9.0-0-g83dc4bd -/* - Licensed to the Apache Software Foundation (ASF) under one - or more contributor license agreements. See the NOTICE file - distributed with this work for additional information - regarding copyright ownership. The ASF licenses this file - to you under the Apache License, Version 2.0 (the - "License"); you may not use this file except in compliance - with the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, - software distributed under the License is distributed on an - "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - KIND, either express or implied. See the License for the - specific language governing permissions and limitations - under the License. -*/ -;(function() { -var CORDOVA_JS_BUILD_LABEL = '2.9.0-0-g83dc4bd'; -// file: lib/scripts/require.js - -var require, - define; - -(function () { - var modules = {}, - // Stack of moduleIds currently being built. - requireStack = [], - // Map of module ID -> index into requireStack of modules currently being built. - inProgressModules = {}, - SEPERATOR = "."; - - - - function build(module) { - var factory = module.factory, - localRequire = function (id) { - var resultantId = id; - //Its a relative path, so lop off the last portion and add the id (minus "./") - if (id.charAt(0) === ".") { - resultantId = module.id.slice(0, module.id.lastIndexOf(SEPERATOR)) + SEPERATOR + id.slice(2); - } - return require(resultantId); - }; - module.exports = {}; - delete module.factory; - factory(localRequire, module.exports, module); - return module.exports; - } - - require = function (id) { - if (!modules[id]) { - throw "module " + id + " not found"; - } else if (id in inProgressModules) { - var cycle = requireStack.slice(inProgressModules[id]).join('->') + '->' + id; - throw "Cycle in require graph: " + cycle; - } - if (modules[id].factory) { - try { - inProgressModules[id] = requireStack.length; - requireStack.push(id); - return build(modules[id]); - } finally { - delete inProgressModules[id]; - requireStack.pop(); - } - } - return modules[id].exports; - }; - - define = function (id, factory) { - if (modules[id]) { - throw "module " + id + " already defined"; - } - - modules[id] = { - id: id, - factory: factory - }; - }; - - define.remove = function (id) { - delete modules[id]; - }; - - define.moduleMap = modules; -})(); - -//Export for use in node -if (typeof module === "object" && typeof require === "function") { - module.exports.require = require; - module.exports.define = define; -} - -// file: lib/cordova.js -define("cordova", function(require, exports, module) { - - -var channel = require('cordova/channel'); - -/** - * Listen for DOMContentLoaded and notify our channel subscribers. - */ -document.addEventListener('DOMContentLoaded', function() { - channel.onDOMContentLoaded.fire(); -}, false); -if (document.readyState == 'complete' || document.readyState == 'interactive') { - channel.onDOMContentLoaded.fire(); -} - -/** - * Intercept calls to addEventListener + removeEventListener and handle deviceready, - * resume, and pause events. - */ -var m_document_addEventListener = document.addEventListener; -var m_document_removeEventListener = document.removeEventListener; -var m_window_addEventListener = window.addEventListener; -var m_window_removeEventListener = window.removeEventListener; - -/** - * Houses custom event handlers to intercept on document + window event listeners. - */ -var documentEventHandlers = {}, - windowEventHandlers = {}; - -document.addEventListener = function(evt, handler, capture) { - var e = evt.toLowerCase(); - if (typeof documentEventHandlers[e] != 'undefined') { - documentEventHandlers[e].subscribe(handler); - } else { - m_document_addEventListener.call(document, evt, handler, capture); - } -}; - -window.addEventListener = function(evt, handler, capture) { - var e = evt.toLowerCase(); - if (typeof windowEventHandlers[e] != 'undefined') { - windowEventHandlers[e].subscribe(handler); - } else { - m_window_addEventListener.call(window, evt, handler, capture); - } -}; - -document.removeEventListener = function(evt, handler, capture) { - var e = evt.toLowerCase(); - // If unsubscribing from an event that is handled by a plugin - if (typeof documentEventHandlers[e] != "undefined") { - documentEventHandlers[e].unsubscribe(handler); - } else { - m_document_removeEventListener.call(document, evt, handler, capture); - } -}; - -window.removeEventListener = function(evt, handler, capture) { - var e = evt.toLowerCase(); - // If unsubscribing from an event that is handled by a plugin - if (typeof windowEventHandlers[e] != "undefined") { - windowEventHandlers[e].unsubscribe(handler); - } else { - m_window_removeEventListener.call(window, evt, handler, capture); - } -}; - -function createEvent(type, data) { - var event = document.createEvent('Events'); - event.initEvent(type, false, false); - if (data) { - for (var i in data) { - if (data.hasOwnProperty(i)) { - event[i] = data[i]; - } - } - } - return event; -} - -if(typeof window.console === "undefined") { - window.console = { - log:function(){} - }; -} - -var cordova = { - define:define, - require:require, - /** - * Methods to add/remove your own addEventListener hijacking on document + window. - */ - addWindowEventHandler:function(event) { - return (windowEventHandlers[event] = channel.create(event)); - }, - addStickyDocumentEventHandler:function(event) { - return (documentEventHandlers[event] = channel.createSticky(event)); - }, - addDocumentEventHandler:function(event) { - return (documentEventHandlers[event] = channel.create(event)); - }, - removeWindowEventHandler:function(event) { - delete windowEventHandlers[event]; - }, - removeDocumentEventHandler:function(event) { - delete documentEventHandlers[event]; - }, - /** - * Retrieve original event handlers that were replaced by Cordova - * - * @return object - */ - getOriginalHandlers: function() { - return {'document': {'addEventListener': m_document_addEventListener, 'removeEventListener': m_document_removeEventListener}, - 'window': {'addEventListener': m_window_addEventListener, 'removeEventListener': m_window_removeEventListener}}; - }, - /** - * Method to fire event from native code - * bNoDetach is required for events which cause an exception which needs to be caught in native code - */ - fireDocumentEvent: function(type, data, bNoDetach) { - var evt = createEvent(type, data); - if (typeof documentEventHandlers[type] != 'undefined') { - if( bNoDetach ) { - documentEventHandlers[type].fire(evt); - } - else { - setTimeout(function() { - // Fire deviceready on listeners that were registered before cordova.js was loaded. - if (type == 'deviceready') { - document.dispatchEvent(evt); - } - documentEventHandlers[type].fire(evt); - }, 0); - } - } else { - document.dispatchEvent(evt); - } - }, - fireWindowEvent: function(type, data) { - var evt = createEvent(type,data); - if (typeof windowEventHandlers[type] != 'undefined') { - setTimeout(function() { - windowEventHandlers[type].fire(evt); - }, 0); - } else { - window.dispatchEvent(evt); - } - }, - - /** - * Plugin callback mechanism. - */ - // Randomize the starting callbackId to avoid collisions after refreshing or navigating. - // This way, it's very unlikely that any new callback would get the same callbackId as an old callback. - callbackId: Math.floor(Math.random() * 2000000000), - callbacks: {}, - callbackStatus: { - NO_RESULT: 0, - OK: 1, - CLASS_NOT_FOUND_EXCEPTION: 2, - ILLEGAL_ACCESS_EXCEPTION: 3, - INSTANTIATION_EXCEPTION: 4, - MALFORMED_URL_EXCEPTION: 5, - IO_EXCEPTION: 6, - INVALID_ACTION: 7, - JSON_EXCEPTION: 8, - ERROR: 9 - }, - - /** - * Called by native code when returning successful result from an action. - */ - callbackSuccess: function(callbackId, args) { - try { - cordova.callbackFromNative(callbackId, true, args.status, [args.message], args.keepCallback); - } catch (e) { - console.log("Error in error callback: " + callbackId + " = "+e); - } - }, - - /** - * Called by native code when returning error result from an action. - */ - callbackError: function(callbackId, args) { - // TODO: Deprecate callbackSuccess and callbackError in favour of callbackFromNative. - // Derive success from status. - try { - cordova.callbackFromNative(callbackId, false, args.status, [args.message], args.keepCallback); - } catch (e) { - console.log("Error in error callback: " + callbackId + " = "+e); - } - }, - - /** - * Called by native code when returning the result from an action. - */ - callbackFromNative: function(callbackId, success, status, args, keepCallback) { - var callback = cordova.callbacks[callbackId]; - if (callback) { - if (success && status == cordova.callbackStatus.OK) { - callback.success && callback.success.apply(null, args); - } else if (!success) { - callback.fail && callback.fail.apply(null, args); - } - - // Clear callback if not expecting any more results - if (!keepCallback) { - delete cordova.callbacks[callbackId]; - } - } - }, - addConstructor: function(func) { - channel.onCordovaReady.subscribe(function() { - try { - func(); - } catch(e) { - console.log("Failed to run constructor: " + e); - } - }); - } -}; - -// Register pause, resume and deviceready channels as events on document. -channel.onPause = cordova.addDocumentEventHandler('pause'); -channel.onResume = cordova.addDocumentEventHandler('resume'); -channel.onDeviceReady = cordova.addStickyDocumentEventHandler('deviceready'); - -module.exports = cordova; - -}); - -// file: lib/common/argscheck.js -define("cordova/argscheck", function(require, exports, module) { - -var exec = require('cordova/exec'); -var utils = require('cordova/utils'); - -var moduleExports = module.exports; - -var typeMap = { - 'A': 'Array', - 'D': 'Date', - 'N': 'Number', - 'S': 'String', - 'F': 'Function', - 'O': 'Object' -}; - -function extractParamName(callee, argIndex) { - return (/.*?\((.*?)\)/).exec(callee)[1].split(', ')[argIndex]; -} - -function checkArgs(spec, functionName, args, opt_callee) { - if (!moduleExports.enableChecks) { - return; - } - var errMsg = null; - var typeName; - for (var i = 0; i < spec.length; ++i) { - var c = spec.charAt(i), - cUpper = c.toUpperCase(), - arg = args[i]; - // Asterix means allow anything. - if (c == '*') { - continue; - } - typeName = utils.typeName(arg); - if ((arg === null || arg === undefined) && c == cUpper) { - continue; - } - if (typeName != typeMap[cUpper]) { - errMsg = 'Expected ' + typeMap[cUpper]; - break; - } - } - if (errMsg) { - errMsg += ', but got ' + typeName + '.'; - errMsg = 'Wrong type for parameter "' + extractParamName(opt_callee || args.callee, i) + '" of ' + functionName + ': ' + errMsg; - // Don't log when running jake test. - if (typeof jasmine == 'undefined') { - console.error(errMsg); - } - throw TypeError(errMsg); - } -} - -function getValue(value, defaultValue) { - return value === undefined ? defaultValue : value; -} - -moduleExports.checkArgs = checkArgs; -moduleExports.getValue = getValue; -moduleExports.enableChecks = true; - - -}); - -// file: lib/common/builder.js -define("cordova/builder", function(require, exports, module) { - -var utils = require('cordova/utils'); - -function each(objects, func, context) { - for (var prop in objects) { - if (objects.hasOwnProperty(prop)) { - func.apply(context, [objects[prop], prop]); - } - } -} - -function clobber(obj, key, value) { - exports.replaceHookForTesting(obj, key); - obj[key] = value; - // Getters can only be overridden by getters. - if (obj[key] !== value) { - utils.defineGetter(obj, key, function() { - return value; - }); - } -} - -function assignOrWrapInDeprecateGetter(obj, key, value, message) { - if (message) { - utils.defineGetter(obj, key, function() { - console.log(message); - delete obj[key]; - clobber(obj, key, value); - return value; - }); - } else { - clobber(obj, key, value); - } -} - -function include(parent, objects, clobber, merge) { - each(objects, function (obj, key) { - try { - var result = obj.path ? require(obj.path) : {}; - - if (clobber) { - // Clobber if it doesn't exist. - if (typeof parent[key] === 'undefined') { - assignOrWrapInDeprecateGetter(parent, key, result, obj.deprecated); - } else if (typeof obj.path !== 'undefined') { - // If merging, merge properties onto parent, otherwise, clobber. - if (merge) { - recursiveMerge(parent[key], result); - } else { - assignOrWrapInDeprecateGetter(parent, key, result, obj.deprecated); - } - } - result = parent[key]; - } else { - // Overwrite if not currently defined. - if (typeof parent[key] == 'undefined') { - assignOrWrapInDeprecateGetter(parent, key, result, obj.deprecated); - } else { - // Set result to what already exists, so we can build children into it if they exist. - result = parent[key]; - } - } - - if (obj.children) { - include(result, obj.children, clobber, merge); - } - } catch(e) { - utils.alert('Exception building cordova JS globals: ' + e + ' for key "' + key + '"'); - } - }); -} - -/** - * Merge properties from one object onto another recursively. Properties from - * the src object will overwrite existing target property. - * - * @param target Object to merge properties into. - * @param src Object to merge properties from. - */ -function recursiveMerge(target, src) { - for (var prop in src) { - if (src.hasOwnProperty(prop)) { - if (target.prototype && target.prototype.constructor === target) { - // If the target object is a constructor override off prototype. - clobber(target.prototype, prop, src[prop]); - } else { - if (typeof src[prop] === 'object' && typeof target[prop] === 'object') { - recursiveMerge(target[prop], src[prop]); - } else { - clobber(target, prop, src[prop]); - } - } - } - } -} - -exports.buildIntoButDoNotClobber = function(objects, target) { - include(target, objects, false, false); -}; -exports.buildIntoAndClobber = function(objects, target) { - include(target, objects, true, false); -}; -exports.buildIntoAndMerge = function(objects, target) { - include(target, objects, true, true); -}; -exports.recursiveMerge = recursiveMerge; -exports.assignOrWrapInDeprecateGetter = assignOrWrapInDeprecateGetter; -exports.replaceHookForTesting = function() {}; - -}); - -// file: lib/common/channel.js -define("cordova/channel", function(require, exports, module) { - -var utils = require('cordova/utils'), - nextGuid = 1; - -/** - * Custom pub-sub "channel" that can have functions subscribed to it - * This object is used to define and control firing of events for - * cordova initialization, as well as for custom events thereafter. - * - * The order of events during page load and Cordova startup is as follows: - * - * onDOMContentLoaded* Internal event that is received when the web page is loaded and parsed. - * onNativeReady* Internal event that indicates the Cordova native side is ready. - * onCordovaReady* Internal event fired when all Cordova JavaScript objects have been created. - * onCordovaInfoReady* Internal event fired when device properties are available. - * onCordovaConnectionReady* Internal event fired when the connection property has been set. - * onDeviceReady* User event fired to indicate that Cordova is ready - * onResume User event fired to indicate a start/resume lifecycle event - * onPause User event fired to indicate a pause lifecycle event - * onDestroy* Internal event fired when app is being destroyed (User should use window.onunload event, not this one). - * - * The events marked with an * are sticky. Once they have fired, they will stay in the fired state. - * All listeners that subscribe after the event is fired will be executed right away. - * - * The only Cordova events that user code should register for are: - * deviceready Cordova native code is initialized and Cordova APIs can be called from JavaScript - * pause App has moved to background - * resume App has returned to foreground - * - * Listeners can be registered as: - * document.addEventListener("deviceready", myDeviceReadyListener, false); - * document.addEventListener("resume", myResumeListener, false); - * document.addEventListener("pause", myPauseListener, false); - * - * The DOM lifecycle events should be used for saving and restoring state - * window.onload - * window.onunload - * - */ - -/** - * Channel - * @constructor - * @param type String the channel name - */ -var Channel = function(type, sticky) { - this.type = type; - // Map of guid -> function. - this.handlers = {}; - // 0 = Non-sticky, 1 = Sticky non-fired, 2 = Sticky fired. - this.state = sticky ? 1 : 0; - // Used in sticky mode to remember args passed to fire(). - this.fireArgs = null; - // Used by onHasSubscribersChange to know if there are any listeners. - this.numHandlers = 0; - // Function that is called when the first listener is subscribed, or when - // the last listener is unsubscribed. - this.onHasSubscribersChange = null; -}, - channel = { - /** - * Calls the provided function only after all of the channels specified - * have been fired. All channels must be sticky channels. - */ - join: function(h, c) { - var len = c.length, - i = len, - f = function() { - if (!(--i)) h(); - }; - for (var j=0; jNative messages. - isInContextOfEvalJs = 0; - -function createExecIframe() { - var iframe = document.createElement("iframe"); - iframe.style.display = 'none'; - document.body.appendChild(iframe); - return iframe; -} - -function shouldBundleCommandJson() { - if (bridgeMode == jsToNativeModes.XHR_WITH_PAYLOAD) { - return true; - } - if (bridgeMode == jsToNativeModes.XHR_OPTIONAL_PAYLOAD) { - var payloadLength = 0; - for (var i = 0; i < commandQueue.length; ++i) { - payloadLength += commandQueue[i].length; - } - // The value here was determined using the benchmark within CordovaLibApp on an iPad 3. - return payloadLength < 4500; - } - return false; -} - -function massageArgsJsToNative(args) { - if (!args || utils.typeName(args) != 'Array') { - return args; - } - var ret = []; - var encodeArrayBufferAs8bitString = function(ab) { - return String.fromCharCode.apply(null, new Uint8Array(ab)); - }; - var encodeArrayBufferAsBase64 = function(ab) { - return window.btoa(encodeArrayBufferAs8bitString(ab)); - }; - args.forEach(function(arg, i) { - if (utils.typeName(arg) == 'ArrayBuffer') { - ret.push({ - 'CDVType': 'ArrayBuffer', - 'data': encodeArrayBufferAsBase64(arg) - }); - } else { - ret.push(arg); - } - }); - return ret; -} - -function massageMessageNativeToJs(message) { - if (message.CDVType == 'ArrayBuffer') { - var stringToArrayBuffer = function(str) { - var ret = new Uint8Array(str.length); - for (var i = 0; i < str.length; i++) { - ret[i] = str.charCodeAt(i); - } - return ret.buffer; - }; - var base64ToArrayBuffer = function(b64) { - return stringToArrayBuffer(atob(b64)); - }; - message = base64ToArrayBuffer(message.data); - } - return message; -} - -function convertMessageToArgsNativeToJs(message) { - var args = []; - if (!message || !message.hasOwnProperty('CDVType')) { - args.push(message); - } else if (message.CDVType == 'MultiPart') { - message.messages.forEach(function(e) { - args.push(massageMessageNativeToJs(e)); - }); - } else { - args.push(massageMessageNativeToJs(message)); - } - return args; -} - -function iOSExec() { - // XHR mode does not work on iOS 4.2, so default to IFRAME_NAV for such devices. - // XHR mode's main advantage is working around a bug in -webkit-scroll, which - // doesn't exist in 4.X devices anyways. - if (bridgeMode === undefined) { - bridgeMode = navigator.userAgent.indexOf(' 4_') == -1 ? jsToNativeModes.XHR_NO_PAYLOAD : jsToNativeModes.IFRAME_NAV; - } - - var successCallback, failCallback, service, action, actionArgs, splitCommand; - var callbackId = null; - if (typeof arguments[0] !== "string") { - // FORMAT ONE - successCallback = arguments[0]; - failCallback = arguments[1]; - service = arguments[2]; - action = arguments[3]; - actionArgs = arguments[4]; - - // Since we need to maintain backwards compatibility, we have to pass - // an invalid callbackId even if no callback was provided since plugins - // will be expecting it. The Cordova.exec() implementation allocates - // an invalid callbackId and passes it even if no callbacks were given. - callbackId = 'INVALID'; - } else { - // FORMAT TWO, REMOVED - try { - splitCommand = arguments[0].split("."); - action = splitCommand.pop(); - service = splitCommand.join("."); - actionArgs = Array.prototype.splice.call(arguments, 1); - - console.log('The old format of this exec call has been removed (deprecated since 2.1). Change to: ' + - "cordova.exec(null, null, \"" + service + "\", \"" + action + "\"," + JSON.stringify(actionArgs) + ");" - ); - return; - } catch (e) { - } - } - - // Register the callbacks and add the callbackId to the positional - // arguments if given. - if (successCallback || failCallback) { - callbackId = service + cordova.callbackId++; - cordova.callbacks[callbackId] = - {success:successCallback, fail:failCallback}; - } - - actionArgs = massageArgsJsToNative(actionArgs); - - var command = [callbackId, service, action, actionArgs]; - - // Stringify and queue the command. We stringify to command now to - // effectively clone the command arguments in case they are mutated before - // the command is executed. - commandQueue.push(JSON.stringify(command)); - - // If we're in the context of a stringByEvaluatingJavaScriptFromString call, - // then the queue will be flushed when it returns; no need for a poke. - // Also, if there is already a command in the queue, then we've already - // poked the native side, so there is no reason to do so again. - if (!isInContextOfEvalJs && commandQueue.length == 1) { - if (bridgeMode != jsToNativeModes.IFRAME_NAV) { - // This prevents sending an XHR when there is already one being sent. - // This should happen only in rare circumstances (refer to unit tests). - if (execXhr && execXhr.readyState != 4) { - execXhr = null; - } - // Re-using the XHR improves exec() performance by about 10%. - execXhr = execXhr || new XMLHttpRequest(); - // Changing this to a GET will make the XHR reach the URIProtocol on 4.2. - // For some reason it still doesn't work though... - // Add a timestamp to the query param to prevent caching. - execXhr.open('HEAD', "/!gap_exec?" + (+new Date()), true); - if (!vcHeaderValue) { - vcHeaderValue = /.*\((.*)\)/.exec(navigator.userAgent)[1]; - } - execXhr.setRequestHeader('vc', vcHeaderValue); - execXhr.setRequestHeader('rc', ++requestCount); - if (shouldBundleCommandJson()) { - execXhr.setRequestHeader('cmds', iOSExec.nativeFetchMessages()); - } - execXhr.send(null); - } else { - execIframe = execIframe || createExecIframe(); - execIframe.src = "gap://ready"; - } - } -} - -iOSExec.jsToNativeModes = jsToNativeModes; - -iOSExec.setJsToNativeBridgeMode = function(mode) { - // Remove the iFrame since it may be no longer required, and its existence - // can trigger browser bugs. - // https://issues.apache.org/jira/browse/CB-593 - if (execIframe) { - execIframe.parentNode.removeChild(execIframe); - execIframe = null; - } - bridgeMode = mode; -}; - -iOSExec.nativeFetchMessages = function() { - // Each entry in commandQueue is a JSON string already. - if (!commandQueue.length) { - return ''; - } - var json = '[' + commandQueue.join(',') + ']'; - commandQueue.length = 0; - return json; -}; - -iOSExec.nativeCallback = function(callbackId, status, message, keepCallback) { - return iOSExec.nativeEvalAndFetch(function() { - var success = status === 0 || status === 1; - var args = convertMessageToArgsNativeToJs(message); - cordova.callbackFromNative(callbackId, success, status, args, keepCallback); - }); -}; - -iOSExec.nativeEvalAndFetch = function(func) { - // This shouldn't be nested, but better to be safe. - isInContextOfEvalJs++; - try { - func(); - return iOSExec.nativeFetchMessages(); - } finally { - isInContextOfEvalJs--; - } -}; - -module.exports = iOSExec; - -}); - -// file: lib/common/modulemapper.js -define("cordova/modulemapper", function(require, exports, module) { - -var builder = require('cordova/builder'), - moduleMap = define.moduleMap, - symbolList, - deprecationMap; - -exports.reset = function() { - symbolList = []; - deprecationMap = {}; -}; - -function addEntry(strategy, moduleName, symbolPath, opt_deprecationMessage) { - if (!(moduleName in moduleMap)) { - throw new Error('Module ' + moduleName + ' does not exist.'); - } - symbolList.push(strategy, moduleName, symbolPath); - if (opt_deprecationMessage) { - deprecationMap[symbolPath] = opt_deprecationMessage; - } -} - -// Note: Android 2.3 does have Function.bind(). -exports.clobbers = function(moduleName, symbolPath, opt_deprecationMessage) { - addEntry('c', moduleName, symbolPath, opt_deprecationMessage); -}; - -exports.merges = function(moduleName, symbolPath, opt_deprecationMessage) { - addEntry('m', moduleName, symbolPath, opt_deprecationMessage); -}; - -exports.defaults = function(moduleName, symbolPath, opt_deprecationMessage) { - addEntry('d', moduleName, symbolPath, opt_deprecationMessage); -}; - -function prepareNamespace(symbolPath, context) { - if (!symbolPath) { - return context; - } - var parts = symbolPath.split('.'); - var cur = context; - for (var i = 0, part; part = parts[i]; ++i) { - cur = cur[part] = cur[part] || {}; - } - return cur; -} - -exports.mapModules = function(context) { - var origSymbols = {}; - context.CDV_origSymbols = origSymbols; - for (var i = 0, len = symbolList.length; i < len; i += 3) { - var strategy = symbolList[i]; - var moduleName = symbolList[i + 1]; - var symbolPath = symbolList[i + 2]; - var lastDot = symbolPath.lastIndexOf('.'); - var namespace = symbolPath.substr(0, lastDot); - var lastName = symbolPath.substr(lastDot + 1); - - var module = require(moduleName); - var deprecationMsg = symbolPath in deprecationMap ? 'Access made to deprecated symbol: ' + symbolPath + '. ' + deprecationMsg : null; - var parentObj = prepareNamespace(namespace, context); - var target = parentObj[lastName]; - - if (strategy == 'm' && target) { - builder.recursiveMerge(target, module); - } else if ((strategy == 'd' && !target) || (strategy != 'd')) { - if (!(symbolPath in origSymbols)) { - origSymbols[symbolPath] = target; - } - builder.assignOrWrapInDeprecateGetter(parentObj, lastName, module, deprecationMsg); - } - } -}; - -exports.getOriginalSymbol = function(context, symbolPath) { - var origSymbols = context.CDV_origSymbols; - if (origSymbols && (symbolPath in origSymbols)) { - return origSymbols[symbolPath]; - } - var parts = symbolPath.split('.'); - var obj = context; - for (var i = 0; i < parts.length; ++i) { - obj = obj && obj[parts[i]]; - } - return obj; -}; - -exports.loadMatchingModules = function(matchingRegExp) { - for (var k in moduleMap) { - if (matchingRegExp.exec(k)) { - require(k); - } - } -}; - -exports.reset(); - - -}); - -// file: lib/ios/platform.js -define("cordova/platform", function(require, exports, module) { - -module.exports = { - id: "ios", - initialize:function() { - var modulemapper = require('cordova/modulemapper'); - - modulemapper.loadMatchingModules(/cordova.*\/plugininit$/); - - modulemapper.loadMatchingModules(/cordova.*\/symbols$/); - modulemapper.mapModules(window); - } -}; - - -}); - -// file: lib/common/plugin/Acceleration.js -define("cordova/plugin/Acceleration", function(require, exports, module) { - -var Acceleration = function(x, y, z, timestamp) { - this.x = x; - this.y = y; - this.z = z; - this.timestamp = timestamp || (new Date()).getTime(); -}; - -module.exports = Acceleration; - -}); - -// file: lib/common/plugin/Camera.js -define("cordova/plugin/Camera", function(require, exports, module) { - -var argscheck = require('cordova/argscheck'), - exec = require('cordova/exec'), - Camera = require('cordova/plugin/CameraConstants'), - CameraPopoverHandle = require('cordova/plugin/CameraPopoverHandle'); - -var cameraExport = {}; - -// Tack on the Camera Constants to the base camera plugin. -for (var key in Camera) { - cameraExport[key] = Camera[key]; -} - -/** - * Gets a picture from source defined by "options.sourceType", and returns the - * image as defined by the "options.destinationType" option. - - * The defaults are sourceType=CAMERA and destinationType=FILE_URI. - * - * @param {Function} successCallback - * @param {Function} errorCallback - * @param {Object} options - */ -cameraExport.getPicture = function(successCallback, errorCallback, options) { - argscheck.checkArgs('fFO', 'Camera.getPicture', arguments); - options = options || {}; - var getValue = argscheck.getValue; - - var quality = getValue(options.quality, 50); - var destinationType = getValue(options.destinationType, Camera.DestinationType.FILE_URI); - var sourceType = getValue(options.sourceType, Camera.PictureSourceType.CAMERA); - var targetWidth = getValue(options.targetWidth, -1); - var targetHeight = getValue(options.targetHeight, -1); - var encodingType = getValue(options.encodingType, Camera.EncodingType.JPEG); - var mediaType = getValue(options.mediaType, Camera.MediaType.PICTURE); - var allowEdit = !!options.allowEdit; - var correctOrientation = !!options.correctOrientation; - var saveToPhotoAlbum = !!options.saveToPhotoAlbum; - var popoverOptions = getValue(options.popoverOptions, null); - var cameraDirection = getValue(options.cameraDirection, Camera.Direction.BACK); - - var args = [quality, destinationType, sourceType, targetWidth, targetHeight, encodingType, - mediaType, allowEdit, correctOrientation, saveToPhotoAlbum, popoverOptions, cameraDirection]; - - exec(successCallback, errorCallback, "Camera", "takePicture", args); - return new CameraPopoverHandle(); -}; - -cameraExport.cleanup = function(successCallback, errorCallback) { - exec(successCallback, errorCallback, "Camera", "cleanup", []); -}; - -module.exports = cameraExport; - -}); - -// file: lib/common/plugin/CameraConstants.js -define("cordova/plugin/CameraConstants", function(require, exports, module) { - -module.exports = { - DestinationType:{ - DATA_URL: 0, // Return base64 encoded string - FILE_URI: 1, // Return file uri (content://media/external/images/media/2 for Android) - NATIVE_URI: 2 // Return native uri (eg. asset-library://... for iOS) - }, - EncodingType:{ - JPEG: 0, // Return JPEG encoded image - PNG: 1 // Return PNG encoded image - }, - MediaType:{ - PICTURE: 0, // allow selection of still pictures only. DEFAULT. Will return format specified via DestinationType - VIDEO: 1, // allow selection of video only, ONLY RETURNS URL - ALLMEDIA : 2 // allow selection from all media types - }, - PictureSourceType:{ - PHOTOLIBRARY : 0, // Choose image from picture library (same as SAVEDPHOTOALBUM for Android) - CAMERA : 1, // Take picture from camera - SAVEDPHOTOALBUM : 2 // Choose image from picture library (same as PHOTOLIBRARY for Android) - }, - PopoverArrowDirection:{ - ARROW_UP : 1, // matches iOS UIPopoverArrowDirection constants to specify arrow location on popover - ARROW_DOWN : 2, - ARROW_LEFT : 4, - ARROW_RIGHT : 8, - ARROW_ANY : 15 - }, - Direction:{ - BACK: 0, - FRONT: 1 - } -}; - -}); - -// file: lib/ios/plugin/CameraPopoverHandle.js -define("cordova/plugin/CameraPopoverHandle", function(require, exports, module) { - -var exec = require('cordova/exec'); - -/** - * A handle to an image picker popover. - */ -var CameraPopoverHandle = function() { - this.setPosition = function(popoverOptions) { - var args = [ popoverOptions ]; - exec(null, null, "Camera", "repositionPopover", args); - }; -}; - -module.exports = CameraPopoverHandle; - -}); - -// file: lib/common/plugin/CameraPopoverOptions.js -define("cordova/plugin/CameraPopoverOptions", function(require, exports, module) { - -var Camera = require('cordova/plugin/CameraConstants'); - -/** - * Encapsulates options for iOS Popover image picker - */ -var CameraPopoverOptions = function(x,y,width,height,arrowDir){ - // information of rectangle that popover should be anchored to - this.x = x || 0; - this.y = y || 32; - this.width = width || 320; - this.height = height || 480; - // The direction of the popover arrow - this.arrowDir = arrowDir || Camera.PopoverArrowDirection.ARROW_ANY; -}; - -module.exports = CameraPopoverOptions; - -}); - -// file: lib/common/plugin/CaptureAudioOptions.js -define("cordova/plugin/CaptureAudioOptions", function(require, exports, module) { - -/** - * Encapsulates all audio capture operation configuration options. - */ -var CaptureAudioOptions = function(){ - // Upper limit of sound clips user can record. Value must be equal or greater than 1. - this.limit = 1; - // Maximum duration of a single sound clip in seconds. - this.duration = 0; -}; - -module.exports = CaptureAudioOptions; - -}); - -// file: lib/common/plugin/CaptureError.js -define("cordova/plugin/CaptureError", function(require, exports, module) { - -/** - * The CaptureError interface encapsulates all errors in the Capture API. - */ -var CaptureError = function(c) { - this.code = c || null; -}; - -// Camera or microphone failed to capture image or sound. -CaptureError.CAPTURE_INTERNAL_ERR = 0; -// Camera application or audio capture application is currently serving other capture request. -CaptureError.CAPTURE_APPLICATION_BUSY = 1; -// Invalid use of the API (e.g. limit parameter has value less than one). -CaptureError.CAPTURE_INVALID_ARGUMENT = 2; -// User exited camera application or audio capture application before capturing anything. -CaptureError.CAPTURE_NO_MEDIA_FILES = 3; -// The requested capture operation is not supported. -CaptureError.CAPTURE_NOT_SUPPORTED = 20; - -module.exports = CaptureError; - -}); - -// file: lib/common/plugin/CaptureImageOptions.js -define("cordova/plugin/CaptureImageOptions", function(require, exports, module) { - -/** - * Encapsulates all image capture operation configuration options. - */ -var CaptureImageOptions = function(){ - // Upper limit of images user can take. Value must be equal or greater than 1. - this.limit = 1; -}; - -module.exports = CaptureImageOptions; - -}); - -// file: lib/common/plugin/CaptureVideoOptions.js -define("cordova/plugin/CaptureVideoOptions", function(require, exports, module) { - -/** - * Encapsulates all video capture operation configuration options. - */ -var CaptureVideoOptions = function(){ - // Upper limit of videos user can record. Value must be equal or greater than 1. - this.limit = 1; - // Maximum duration of a single video clip in seconds. - this.duration = 0; -}; - -module.exports = CaptureVideoOptions; - -}); - -// file: lib/common/plugin/CompassError.js -define("cordova/plugin/CompassError", function(require, exports, module) { - -/** - * CompassError. - * An error code assigned by an implementation when an error has occurred - * @constructor - */ -var CompassError = function(err) { - this.code = (err !== undefined ? err : null); -}; - -CompassError.COMPASS_INTERNAL_ERR = 0; -CompassError.COMPASS_NOT_SUPPORTED = 20; - -module.exports = CompassError; - -}); - -// file: lib/common/plugin/CompassHeading.js -define("cordova/plugin/CompassHeading", function(require, exports, module) { - -var CompassHeading = function(magneticHeading, trueHeading, headingAccuracy, timestamp) { - this.magneticHeading = magneticHeading; - this.trueHeading = trueHeading; - this.headingAccuracy = headingAccuracy; - this.timestamp = timestamp || new Date().getTime(); -}; - -module.exports = CompassHeading; - -}); - -// file: lib/common/plugin/ConfigurationData.js -define("cordova/plugin/ConfigurationData", function(require, exports, module) { - -/** - * Encapsulates a set of parameters that the capture device supports. - */ -function ConfigurationData() { - // The ASCII-encoded string in lower case representing the media type. - this.type = null; - // The height attribute represents height of the image or video in pixels. - // In the case of a sound clip this attribute has value 0. - this.height = 0; - // The width attribute represents width of the image or video in pixels. - // In the case of a sound clip this attribute has value 0 - this.width = 0; -} - -module.exports = ConfigurationData; - -}); - -// file: lib/common/plugin/Connection.js -define("cordova/plugin/Connection", function(require, exports, module) { - -/** - * Network status - */ -module.exports = { - UNKNOWN: "unknown", - ETHERNET: "ethernet", - WIFI: "wifi", - CELL_2G: "2g", - CELL_3G: "3g", - CELL_4G: "4g", - CELL:"cellular", - NONE: "none" -}; - -}); - -// file: lib/common/plugin/Contact.js -define("cordova/plugin/Contact", function(require, exports, module) { - -var argscheck = require('cordova/argscheck'), - exec = require('cordova/exec'), - ContactError = require('cordova/plugin/ContactError'), - utils = require('cordova/utils'); - -/** -* Converts primitives into Complex Object -* Currently only used for Date fields -*/ -function convertIn(contact) { - var value = contact.birthday; - try { - contact.birthday = new Date(parseFloat(value)); - } catch (exception){ - console.log("Cordova Contact convertIn error: exception creating date."); - } - return contact; -} - -/** -* Converts Complex objects into primitives -* Only conversion at present is for Dates. -**/ - -function convertOut(contact) { - var value = contact.birthday; - if (value !== null) { - // try to make it a Date object if it is not already - if (!utils.isDate(value)){ - try { - value = new Date(value); - } catch(exception){ - value = null; - } - } - if (utils.isDate(value)){ - value = value.valueOf(); // convert to milliseconds - } - contact.birthday = value; - } - return contact; -} - -/** -* Contains information about a single contact. -* @constructor -* @param {DOMString} id unique identifier -* @param {DOMString} displayName -* @param {ContactName} name -* @param {DOMString} nickname -* @param {Array.} phoneNumbers array of phone numbers -* @param {Array.} emails array of email addresses -* @param {Array.} addresses array of addresses -* @param {Array.} ims instant messaging user ids -* @param {Array.} organizations -* @param {DOMString} birthday contact's birthday -* @param {DOMString} note user notes about contact -* @param {Array.} photos -* @param {Array.} categories -* @param {Array.} urls contact's web sites -*/ -var Contact = function (id, displayName, name, nickname, phoneNumbers, emails, addresses, - ims, organizations, birthday, note, photos, categories, urls) { - this.id = id || null; - this.rawId = null; - this.displayName = displayName || null; - this.name = name || null; // ContactName - this.nickname = nickname || null; - this.phoneNumbers = phoneNumbers || null; // ContactField[] - this.emails = emails || null; // ContactField[] - this.addresses = addresses || null; // ContactAddress[] - this.ims = ims || null; // ContactField[] - this.organizations = organizations || null; // ContactOrganization[] - this.birthday = birthday || null; - this.note = note || null; - this.photos = photos || null; // ContactField[] - this.categories = categories || null; // ContactField[] - this.urls = urls || null; // ContactField[] -}; - -/** -* Removes contact from device storage. -* @param successCB success callback -* @param errorCB error callback -*/ -Contact.prototype.remove = function(successCB, errorCB) { - argscheck.checkArgs('FF', 'Contact.remove', arguments); - var fail = errorCB && function(code) { - errorCB(new ContactError(code)); - }; - if (this.id === null) { - fail(ContactError.UNKNOWN_ERROR); - } - else { - exec(successCB, fail, "Contacts", "remove", [this.id]); - } -}; - -/** -* Creates a deep copy of this Contact. -* With the contact ID set to null. -* @return copy of this Contact -*/ -Contact.prototype.clone = function() { - var clonedContact = utils.clone(this); - clonedContact.id = null; - clonedContact.rawId = null; - - function nullIds(arr) { - if (arr) { - for (var i = 0; i < arr.length; ++i) { - arr[i].id = null; - } - } - } - - // Loop through and clear out any id's in phones, emails, etc. - nullIds(clonedContact.phoneNumbers); - nullIds(clonedContact.emails); - nullIds(clonedContact.addresses); - nullIds(clonedContact.ims); - nullIds(clonedContact.organizations); - nullIds(clonedContact.categories); - nullIds(clonedContact.photos); - nullIds(clonedContact.urls); - return clonedContact; -}; - -/** -* Persists contact to device storage. -* @param successCB success callback -* @param errorCB error callback -*/ -Contact.prototype.save = function(successCB, errorCB) { - argscheck.checkArgs('FFO', 'Contact.save', arguments); - var fail = errorCB && function(code) { - errorCB(new ContactError(code)); - }; - var success = function(result) { - if (result) { - if (successCB) { - var fullContact = require('cordova/plugin/contacts').create(result); - successCB(convertIn(fullContact)); - } - } - else { - // no Entry object returned - fail(ContactError.UNKNOWN_ERROR); - } - }; - var dupContact = convertOut(utils.clone(this)); - exec(success, fail, "Contacts", "save", [dupContact]); -}; - - -module.exports = Contact; - -}); - -// file: lib/common/plugin/ContactAddress.js -define("cordova/plugin/ContactAddress", function(require, exports, module) { - -/** -* Contact address. -* @constructor -* @param {DOMString} id unique identifier, should only be set by native code -* @param formatted // NOTE: not a W3C standard -* @param streetAddress -* @param locality -* @param region -* @param postalCode -* @param country -*/ - -var ContactAddress = function(pref, type, formatted, streetAddress, locality, region, postalCode, country) { - this.id = null; - this.pref = (typeof pref != 'undefined' ? pref : false); - this.type = type || null; - this.formatted = formatted || null; - this.streetAddress = streetAddress || null; - this.locality = locality || null; - this.region = region || null; - this.postalCode = postalCode || null; - this.country = country || null; -}; - -module.exports = ContactAddress; - -}); - -// file: lib/common/plugin/ContactError.js -define("cordova/plugin/ContactError", function(require, exports, module) { - -/** - * ContactError. - * An error code assigned by an implementation when an error has occurred - * @constructor - */ -var ContactError = function(err) { - this.code = (typeof err != 'undefined' ? err : null); -}; - -/** - * Error codes - */ -ContactError.UNKNOWN_ERROR = 0; -ContactError.INVALID_ARGUMENT_ERROR = 1; -ContactError.TIMEOUT_ERROR = 2; -ContactError.PENDING_OPERATION_ERROR = 3; -ContactError.IO_ERROR = 4; -ContactError.NOT_SUPPORTED_ERROR = 5; -ContactError.PERMISSION_DENIED_ERROR = 20; - -module.exports = ContactError; - -}); - -// file: lib/common/plugin/ContactField.js -define("cordova/plugin/ContactField", function(require, exports, module) { - -/** -* Generic contact field. -* @constructor -* @param {DOMString} id unique identifier, should only be set by native code // NOTE: not a W3C standard -* @param type -* @param value -* @param pref -*/ -var ContactField = function(type, value, pref) { - this.id = null; - this.type = (type && type.toString()) || null; - this.value = (value && value.toString()) || null; - this.pref = (typeof pref != 'undefined' ? pref : false); -}; - -module.exports = ContactField; - -}); - -// file: lib/common/plugin/ContactFindOptions.js -define("cordova/plugin/ContactFindOptions", function(require, exports, module) { - -/** - * ContactFindOptions. - * @constructor - * @param filter used to match contacts against - * @param multiple boolean used to determine if more than one contact should be returned - */ - -var ContactFindOptions = function(filter, multiple) { - this.filter = filter || ''; - this.multiple = (typeof multiple != 'undefined' ? multiple : false); -}; - -module.exports = ContactFindOptions; - -}); - -// file: lib/common/plugin/ContactName.js -define("cordova/plugin/ContactName", function(require, exports, module) { - -/** -* Contact name. -* @constructor -* @param formatted // NOTE: not part of W3C standard -* @param familyName -* @param givenName -* @param middle -* @param prefix -* @param suffix -*/ -var ContactName = function(formatted, familyName, givenName, middle, prefix, suffix) { - this.formatted = formatted || null; - this.familyName = familyName || null; - this.givenName = givenName || null; - this.middleName = middle || null; - this.honorificPrefix = prefix || null; - this.honorificSuffix = suffix || null; -}; - -module.exports = ContactName; - -}); - -// file: lib/common/plugin/ContactOrganization.js -define("cordova/plugin/ContactOrganization", function(require, exports, module) { - -/** -* Contact organization. -* @constructor -* @param {DOMString} id unique identifier, should only be set by native code // NOTE: not a W3C standard -* @param name -* @param dept -* @param title -* @param startDate -* @param endDate -* @param location -* @param desc -*/ - -var ContactOrganization = function(pref, type, name, dept, title) { - this.id = null; - this.pref = (typeof pref != 'undefined' ? pref : false); - this.type = type || null; - this.name = name || null; - this.department = dept || null; - this.title = title || null; -}; - -module.exports = ContactOrganization; - -}); - -// file: lib/common/plugin/Coordinates.js -define("cordova/plugin/Coordinates", function(require, exports, module) { - -/** - * This class contains position information. - * @param {Object} lat - * @param {Object} lng - * @param {Object} alt - * @param {Object} acc - * @param {Object} head - * @param {Object} vel - * @param {Object} altacc - * @constructor - */ -var Coordinates = function(lat, lng, alt, acc, head, vel, altacc) { - /** - * The latitude of the position. - */ - this.latitude = lat; - /** - * The longitude of the position, - */ - this.longitude = lng; - /** - * The accuracy of the position. - */ - this.accuracy = acc; - /** - * The altitude of the position. - */ - this.altitude = (alt !== undefined ? alt : null); - /** - * The direction the device is moving at the position. - */ - this.heading = (head !== undefined ? head : null); - /** - * The velocity with which the device is moving at the position. - */ - this.speed = (vel !== undefined ? vel : null); - - if (this.speed === 0 || this.speed === null) { - this.heading = NaN; - } - - /** - * The altitude accuracy of the position. - */ - this.altitudeAccuracy = (altacc !== undefined) ? altacc : null; -}; - -module.exports = Coordinates; - -}); - -// file: lib/common/plugin/DirectoryEntry.js -define("cordova/plugin/DirectoryEntry", function(require, exports, module) { - -var argscheck = require('cordova/argscheck'), - utils = require('cordova/utils'), - exec = require('cordova/exec'), - Entry = require('cordova/plugin/Entry'), - FileError = require('cordova/plugin/FileError'), - DirectoryReader = require('cordova/plugin/DirectoryReader'); - -/** - * An interface representing a directory on the file system. - * - * {boolean} isFile always false (readonly) - * {boolean} isDirectory always true (readonly) - * {DOMString} name of the directory, excluding the path leading to it (readonly) - * {DOMString} fullPath the absolute full path to the directory (readonly) - * TODO: implement this!!! {FileSystem} filesystem on which the directory resides (readonly) - */ -var DirectoryEntry = function(name, fullPath) { - DirectoryEntry.__super__.constructor.call(this, false, true, name, fullPath); -}; - -utils.extend(DirectoryEntry, Entry); - -/** - * Creates a new DirectoryReader to read entries from this directory - */ -DirectoryEntry.prototype.createReader = function() { - return new DirectoryReader(this.fullPath); -}; - -/** - * Creates or looks up a directory - * - * @param {DOMString} path either a relative or absolute path from this directory in which to look up or create a directory - * @param {Flags} options to create or exclusively create the directory - * @param {Function} successCallback is called with the new entry - * @param {Function} errorCallback is called with a FileError - */ -DirectoryEntry.prototype.getDirectory = function(path, options, successCallback, errorCallback) { - argscheck.checkArgs('sOFF', 'DirectoryEntry.getDirectory', arguments); - var win = successCallback && function(result) { - var entry = new DirectoryEntry(result.name, result.fullPath); - successCallback(entry); - }; - var fail = errorCallback && function(code) { - errorCallback(new FileError(code)); - }; - exec(win, fail, "File", "getDirectory", [this.fullPath, path, options]); -}; - -/** - * Deletes a directory and all of it's contents - * - * @param {Function} successCallback is called with no parameters - * @param {Function} errorCallback is called with a FileError - */ -DirectoryEntry.prototype.removeRecursively = function(successCallback, errorCallback) { - argscheck.checkArgs('FF', 'DirectoryEntry.removeRecursively', arguments); - var fail = errorCallback && function(code) { - errorCallback(new FileError(code)); - }; - exec(successCallback, fail, "File", "removeRecursively", [this.fullPath]); -}; - -/** - * Creates or looks up a file - * - * @param {DOMString} path either a relative or absolute path from this directory in which to look up or create a file - * @param {Flags} options to create or exclusively create the file - * @param {Function} successCallback is called with the new entry - * @param {Function} errorCallback is called with a FileError - */ -DirectoryEntry.prototype.getFile = function(path, options, successCallback, errorCallback) { - argscheck.checkArgs('sOFF', 'DirectoryEntry.getFile', arguments); - var win = successCallback && function(result) { - var FileEntry = require('cordova/plugin/FileEntry'); - var entry = new FileEntry(result.name, result.fullPath); - successCallback(entry); - }; - var fail = errorCallback && function(code) { - errorCallback(new FileError(code)); - }; - exec(win, fail, "File", "getFile", [this.fullPath, path, options]); -}; - -module.exports = DirectoryEntry; - -}); - -// file: lib/common/plugin/DirectoryReader.js -define("cordova/plugin/DirectoryReader", function(require, exports, module) { - -var exec = require('cordova/exec'), - FileError = require('cordova/plugin/FileError') ; - -/** - * An interface that lists the files and directories in a directory. - */ -function DirectoryReader(path) { - this.path = path || null; -} - -/** - * Returns a list of entries from a directory. - * - * @param {Function} successCallback is called with a list of entries - * @param {Function} errorCallback is called with a FileError - */ -DirectoryReader.prototype.readEntries = function(successCallback, errorCallback) { - var win = typeof successCallback !== 'function' ? null : function(result) { - var retVal = []; - for (var i=0; i= 2) { - if (end < 0) { - newEnd = Math.max(size + end, 0); - } else { - newEnd = Math.min(end, size); - } - } - - var newFile = new File(this.name, this.fullPath, this.type, this.lastModifiedData, this.size); - newFile.start = this.start + newStart; - newFile.end = this.start + newEnd; - return newFile; -}; - - -module.exports = File; - -}); - -// file: lib/common/plugin/FileEntry.js -define("cordova/plugin/FileEntry", function(require, exports, module) { - -var utils = require('cordova/utils'), - exec = require('cordova/exec'), - Entry = require('cordova/plugin/Entry'), - FileWriter = require('cordova/plugin/FileWriter'), - File = require('cordova/plugin/File'), - FileError = require('cordova/plugin/FileError'); - -/** - * An interface representing a file on the file system. - * - * {boolean} isFile always true (readonly) - * {boolean} isDirectory always false (readonly) - * {DOMString} name of the file, excluding the path leading to it (readonly) - * {DOMString} fullPath the absolute full path to the file (readonly) - * {FileSystem} filesystem on which the file resides (readonly) - */ -var FileEntry = function(name, fullPath) { - FileEntry.__super__.constructor.apply(this, [true, false, name, fullPath]); -}; - -utils.extend(FileEntry, Entry); - -/** - * Creates a new FileWriter associated with the file that this FileEntry represents. - * - * @param {Function} successCallback is called with the new FileWriter - * @param {Function} errorCallback is called with a FileError - */ -FileEntry.prototype.createWriter = function(successCallback, errorCallback) { - this.file(function(filePointer) { - var writer = new FileWriter(filePointer); - - if (writer.fileName === null || writer.fileName === "") { - errorCallback && errorCallback(new FileError(FileError.INVALID_STATE_ERR)); - } else { - successCallback && successCallback(writer); - } - }, errorCallback); -}; - -/** - * Returns a File that represents the current state of the file that this FileEntry represents. - * - * @param {Function} successCallback is called with the new File object - * @param {Function} errorCallback is called with a FileError - */ -FileEntry.prototype.file = function(successCallback, errorCallback) { - var win = successCallback && function(f) { - var file = new File(f.name, f.fullPath, f.type, f.lastModifiedDate, f.size); - successCallback(file); - }; - var fail = errorCallback && function(code) { - errorCallback(new FileError(code)); - }; - exec(win, fail, "File", "getFileMetadata", [this.fullPath]); -}; - - -module.exports = FileEntry; - -}); - -// file: lib/common/plugin/FileError.js -define("cordova/plugin/FileError", function(require, exports, module) { - -/** - * FileError - */ -function FileError(error) { - this.code = error || null; -} - -// File error codes -// Found in DOMException -FileError.NOT_FOUND_ERR = 1; -FileError.SECURITY_ERR = 2; -FileError.ABORT_ERR = 3; - -// Added by File API specification -FileError.NOT_READABLE_ERR = 4; -FileError.ENCODING_ERR = 5; -FileError.NO_MODIFICATION_ALLOWED_ERR = 6; -FileError.INVALID_STATE_ERR = 7; -FileError.SYNTAX_ERR = 8; -FileError.INVALID_MODIFICATION_ERR = 9; -FileError.QUOTA_EXCEEDED_ERR = 10; -FileError.TYPE_MISMATCH_ERR = 11; -FileError.PATH_EXISTS_ERR = 12; - -module.exports = FileError; - -}); - -// file: lib/common/plugin/FileReader.js -define("cordova/plugin/FileReader", function(require, exports, module) { - -var exec = require('cordova/exec'), - modulemapper = require('cordova/modulemapper'), - utils = require('cordova/utils'), - File = require('cordova/plugin/File'), - FileError = require('cordova/plugin/FileError'), - ProgressEvent = require('cordova/plugin/ProgressEvent'), - origFileReader = modulemapper.getOriginalSymbol(this, 'FileReader'); - -/** - * This class reads the mobile device file system. - * - * For Android: - * The root directory is the root of the file system. - * To read from the SD card, the file name is "sdcard/my_file.txt" - * @constructor - */ -var FileReader = function() { - this._readyState = 0; - this._error = null; - this._result = null; - this._fileName = ''; - this._realReader = origFileReader ? new origFileReader() : {}; -}; - -// States -FileReader.EMPTY = 0; -FileReader.LOADING = 1; -FileReader.DONE = 2; - -utils.defineGetter(FileReader.prototype, 'readyState', function() { - return this._fileName ? this._readyState : this._realReader.readyState; -}); - -utils.defineGetter(FileReader.prototype, 'error', function() { - return this._fileName ? this._error: this._realReader.error; -}); - -utils.defineGetter(FileReader.prototype, 'result', function() { - return this._fileName ? this._result: this._realReader.result; -}); - -function defineEvent(eventName) { - utils.defineGetterSetter(FileReader.prototype, eventName, function() { - return this._realReader[eventName] || null; - }, function(value) { - this._realReader[eventName] = value; - }); -} -defineEvent('onloadstart'); // When the read starts. -defineEvent('onprogress'); // While reading (and decoding) file or fileBlob data, and reporting partial file data (progress.loaded/progress.total) -defineEvent('onload'); // When the read has successfully completed. -defineEvent('onerror'); // When the read has failed (see errors). -defineEvent('onloadend'); // When the request has completed (either in success or failure). -defineEvent('onabort'); // When the read has been aborted. For instance, by invoking the abort() method. - -function initRead(reader, file) { - // Already loading something - if (reader.readyState == FileReader.LOADING) { - throw new FileError(FileError.INVALID_STATE_ERR); - } - - reader._result = null; - reader._error = null; - reader._readyState = FileReader.LOADING; - - if (typeof file.fullPath == 'string') { - reader._fileName = file.fullPath; - } else { - reader._fileName = ''; - return true; - } - - reader.onloadstart && reader.onloadstart(new ProgressEvent("loadstart", {target:reader})); -} - -/** - * Abort reading file. - */ -FileReader.prototype.abort = function() { - if (origFileReader && !this._fileName) { - return this._realReader.abort(); - } - this._result = null; - - if (this._readyState == FileReader.DONE || this._readyState == FileReader.EMPTY) { - return; - } - - this._readyState = FileReader.DONE; - - // If abort callback - if (typeof this.onabort === 'function') { - this.onabort(new ProgressEvent('abort', {target:this})); - } - // If load end callback - if (typeof this.onloadend === 'function') { - this.onloadend(new ProgressEvent('loadend', {target:this})); - } -}; - -/** - * Read text file. - * - * @param file {File} File object containing file properties - * @param encoding [Optional] (see http://www.iana.org/assignments/character-sets) - */ -FileReader.prototype.readAsText = function(file, encoding) { - if (initRead(this, file)) { - return this._realReader.readAsText(file, encoding); - } - - // Default encoding is UTF-8 - var enc = encoding ? encoding : "UTF-8"; - var me = this; - var execArgs = [this._fileName, enc, file.start, file.end]; - - // Read file - exec( - // Success callback - function(r) { - // If DONE (cancelled), then don't do anything - if (me._readyState === FileReader.DONE) { - return; - } - - // Save result - me._result = r; - - // If onload callback - if (typeof me.onload === "function") { - me.onload(new ProgressEvent("load", {target:me})); - } - - // DONE state - me._readyState = FileReader.DONE; - - // If onloadend callback - if (typeof me.onloadend === "function") { - me.onloadend(new ProgressEvent("loadend", {target:me})); - } - }, - // Error callback - function(e) { - // If DONE (cancelled), then don't do anything - if (me._readyState === FileReader.DONE) { - return; - } - - // DONE state - me._readyState = FileReader.DONE; - - // null result - me._result = null; - - // Save error - me._error = new FileError(e); - - // If onerror callback - if (typeof me.onerror === "function") { - me.onerror(new ProgressEvent("error", {target:me})); - } - - // If onloadend callback - if (typeof me.onloadend === "function") { - me.onloadend(new ProgressEvent("loadend", {target:me})); - } - }, "File", "readAsText", execArgs); -}; - - -/** - * Read file and return data as a base64 encoded data url. - * A data url is of the form: - * data:[][;base64], - * - * @param file {File} File object containing file properties - */ -FileReader.prototype.readAsDataURL = function(file) { - if (initRead(this, file)) { - return this._realReader.readAsDataURL(file); - } - - var me = this; - var execArgs = [this._fileName, file.start, file.end]; - - // Read file - exec( - // Success callback - function(r) { - // If DONE (cancelled), then don't do anything - if (me._readyState === FileReader.DONE) { - return; - } - - // DONE state - me._readyState = FileReader.DONE; - - // Save result - me._result = r; - - // If onload callback - if (typeof me.onload === "function") { - me.onload(new ProgressEvent("load", {target:me})); - } - - // If onloadend callback - if (typeof me.onloadend === "function") { - me.onloadend(new ProgressEvent("loadend", {target:me})); - } - }, - // Error callback - function(e) { - // If DONE (cancelled), then don't do anything - if (me._readyState === FileReader.DONE) { - return; - } - - // DONE state - me._readyState = FileReader.DONE; - - me._result = null; - - // Save error - me._error = new FileError(e); - - // If onerror callback - if (typeof me.onerror === "function") { - me.onerror(new ProgressEvent("error", {target:me})); - } - - // If onloadend callback - if (typeof me.onloadend === "function") { - me.onloadend(new ProgressEvent("loadend", {target:me})); - } - }, "File", "readAsDataURL", execArgs); -}; - -/** - * Read file and return data as a binary data. - * - * @param file {File} File object containing file properties - */ -FileReader.prototype.readAsBinaryString = function(file) { - if (initRead(this, file)) { - return this._realReader.readAsBinaryString(file); - } - - var me = this; - var execArgs = [this._fileName, file.start, file.end]; - - // Read file - exec( - // Success callback - function(r) { - // If DONE (cancelled), then don't do anything - if (me._readyState === FileReader.DONE) { - return; - } - - // DONE state - me._readyState = FileReader.DONE; - - me._result = r; - - // If onload callback - if (typeof me.onload === "function") { - me.onload(new ProgressEvent("load", {target:me})); - } - - // If onloadend callback - if (typeof me.onloadend === "function") { - me.onloadend(new ProgressEvent("loadend", {target:me})); - } - }, - // Error callback - function(e) { - // If DONE (cancelled), then don't do anything - if (me._readyState === FileReader.DONE) { - return; - } - - // DONE state - me._readyState = FileReader.DONE; - - me._result = null; - - // Save error - me._error = new FileError(e); - - // If onerror callback - if (typeof me.onerror === "function") { - me.onerror(new ProgressEvent("error", {target:me})); - } - - // If onloadend callback - if (typeof me.onloadend === "function") { - me.onloadend(new ProgressEvent("loadend", {target:me})); - } - }, "File", "readAsBinaryString", execArgs); -}; - -/** - * Read file and return data as a binary data. - * - * @param file {File} File object containing file properties - */ -FileReader.prototype.readAsArrayBuffer = function(file) { - if (initRead(this, file)) { - return this._realReader.readAsArrayBuffer(file); - } - - var me = this; - var execArgs = [this._fileName, file.start, file.end]; - - // Read file - exec( - // Success callback - function(r) { - // If DONE (cancelled), then don't do anything - if (me._readyState === FileReader.DONE) { - return; - } - - // DONE state - me._readyState = FileReader.DONE; - - me._result = r; - - // If onload callback - if (typeof me.onload === "function") { - me.onload(new ProgressEvent("load", {target:me})); - } - - // If onloadend callback - if (typeof me.onloadend === "function") { - me.onloadend(new ProgressEvent("loadend", {target:me})); - } - }, - // Error callback - function(e) { - // If DONE (cancelled), then don't do anything - if (me._readyState === FileReader.DONE) { - return; - } - - // DONE state - me._readyState = FileReader.DONE; - - me._result = null; - - // Save error - me._error = new FileError(e); - - // If onerror callback - if (typeof me.onerror === "function") { - me.onerror(new ProgressEvent("error", {target:me})); - } - - // If onloadend callback - if (typeof me.onloadend === "function") { - me.onloadend(new ProgressEvent("loadend", {target:me})); - } - }, "File", "readAsArrayBuffer", execArgs); -}; - -module.exports = FileReader; - -}); - -// file: lib/common/plugin/FileSystem.js -define("cordova/plugin/FileSystem", function(require, exports, module) { - -var DirectoryEntry = require('cordova/plugin/DirectoryEntry'); - -/** - * An interface representing a file system - * - * @constructor - * {DOMString} name the unique name of the file system (readonly) - * {DirectoryEntry} root directory of the file system (readonly) - */ -var FileSystem = function(name, root) { - this.name = name || null; - if (root) { - this.root = new DirectoryEntry(root.name, root.fullPath); - } -}; - -module.exports = FileSystem; - -}); - -// file: lib/common/plugin/FileTransfer.js -define("cordova/plugin/FileTransfer", function(require, exports, module) { - -var argscheck = require('cordova/argscheck'), - exec = require('cordova/exec'), - FileTransferError = require('cordova/plugin/FileTransferError'), - ProgressEvent = require('cordova/plugin/ProgressEvent'); - -function newProgressEvent(result) { - var pe = new ProgressEvent(); - pe.lengthComputable = result.lengthComputable; - pe.loaded = result.loaded; - pe.total = result.total; - return pe; -} - -function getBasicAuthHeader(urlString) { - var header = null; - - if (window.btoa) { - // parse the url using the Location object - var url = document.createElement('a'); - url.href = urlString; - - var credentials = null; - var protocol = url.protocol + "//"; - var origin = protocol + url.host; - - // check whether there are the username:password credentials in the url - if (url.href.indexOf(origin) !== 0) { // credentials found - var atIndex = url.href.indexOf("@"); - credentials = url.href.substring(protocol.length, atIndex); - } - - if (credentials) { - var authHeader = "Authorization"; - var authHeaderValue = "Basic " + window.btoa(credentials); - - header = { - name : authHeader, - value : authHeaderValue - }; - } - } - - return header; -} - -var idCounter = 0; - -/** - * FileTransfer uploads a file to a remote server. - * @constructor - */ -var FileTransfer = function() { - this._id = ++idCounter; - this.onprogress = null; // optional callback -}; - -/** -* Given an absolute file path, uploads a file on the device to a remote server -* using a multipart HTTP request. -* @param filePath {String} Full path of the file on the device -* @param server {String} URL of the server to receive the file -* @param successCallback (Function} Callback to be invoked when upload has completed -* @param errorCallback {Function} Callback to be invoked upon error -* @param options {FileUploadOptions} Optional parameters such as file name and mimetype -* @param trustAllHosts {Boolean} Optional trust all hosts (e.g. for self-signed certs), defaults to false -*/ -FileTransfer.prototype.upload = function(filePath, server, successCallback, errorCallback, options, trustAllHosts) { - argscheck.checkArgs('ssFFO*', 'FileTransfer.upload', arguments); - // check for options - var fileKey = null; - var fileName = null; - var mimeType = null; - var params = null; - var chunkedMode = true; - var headers = null; - var httpMethod = null; - var basicAuthHeader = getBasicAuthHeader(server); - if (basicAuthHeader) { - options = options || {}; - options.headers = options.headers || {}; - options.headers[basicAuthHeader.name] = basicAuthHeader.value; - } - - if (options) { - fileKey = options.fileKey; - fileName = options.fileName; - mimeType = options.mimeType; - headers = options.headers; - httpMethod = options.httpMethod || "POST"; - if (httpMethod.toUpperCase() == "PUT"){ - httpMethod = "PUT"; - } else { - httpMethod = "POST"; - } - if (options.chunkedMode !== null || typeof options.chunkedMode != "undefined") { - chunkedMode = options.chunkedMode; - } - if (options.params) { - params = options.params; - } - else { - params = {}; - } - } - - var fail = errorCallback && function(e) { - var error = new FileTransferError(e.code, e.source, e.target, e.http_status, e.body); - errorCallback(error); - }; - - var self = this; - var win = function(result) { - if (typeof result.lengthComputable != "undefined") { - if (self.onprogress) { - self.onprogress(newProgressEvent(result)); - } - } else { - successCallback && successCallback(result); - } - }; - exec(win, fail, 'FileTransfer', 'upload', [filePath, server, fileKey, fileName, mimeType, params, trustAllHosts, chunkedMode, headers, this._id, httpMethod]); -}; - -/** - * Downloads a file form a given URL and saves it to the specified directory. - * @param source {String} URL of the server to receive the file - * @param target {String} Full path of the file on the device - * @param successCallback (Function} Callback to be invoked when upload has completed - * @param errorCallback {Function} Callback to be invoked upon error - * @param trustAllHosts {Boolean} Optional trust all hosts (e.g. for self-signed certs), defaults to false - * @param options {FileDownloadOptions} Optional parameters such as headers - */ -FileTransfer.prototype.download = function(source, target, successCallback, errorCallback, trustAllHosts, options) { - argscheck.checkArgs('ssFF*', 'FileTransfer.download', arguments); - var self = this; - - var basicAuthHeader = getBasicAuthHeader(source); - if (basicAuthHeader) { - options = options || {}; - options.headers = options.headers || {}; - options.headers[basicAuthHeader.name] = basicAuthHeader.value; - } - - var headers = null; - if (options) { - headers = options.headers || null; - } - - var win = function(result) { - if (typeof result.lengthComputable != "undefined") { - if (self.onprogress) { - return self.onprogress(newProgressEvent(result)); - } - } else if (successCallback) { - var entry = null; - if (result.isDirectory) { - entry = new (require('cordova/plugin/DirectoryEntry'))(); - } - else if (result.isFile) { - entry = new (require('cordova/plugin/FileEntry'))(); - } - entry.isDirectory = result.isDirectory; - entry.isFile = result.isFile; - entry.name = result.name; - entry.fullPath = result.fullPath; - successCallback(entry); - } - }; - - var fail = errorCallback && function(e) { - var error = new FileTransferError(e.code, e.source, e.target, e.http_status, e.body); - errorCallback(error); - }; - - exec(win, fail, 'FileTransfer', 'download', [source, target, trustAllHosts, this._id, headers]); -}; - -/** - * Aborts the ongoing file transfer on this object. The original error - * callback for the file transfer will be called if necessary. - */ -FileTransfer.prototype.abort = function() { - exec(null, null, 'FileTransfer', 'abort', [this._id]); -}; - -module.exports = FileTransfer; - -}); - -// file: lib/common/plugin/FileTransferError.js -define("cordova/plugin/FileTransferError", function(require, exports, module) { - -/** - * FileTransferError - * @constructor - */ -var FileTransferError = function(code, source, target, status, body) { - this.code = code || null; - this.source = source || null; - this.target = target || null; - this.http_status = status || null; - this.body = body || null; -}; - -FileTransferError.FILE_NOT_FOUND_ERR = 1; -FileTransferError.INVALID_URL_ERR = 2; -FileTransferError.CONNECTION_ERR = 3; -FileTransferError.ABORT_ERR = 4; - -module.exports = FileTransferError; - -}); - -// file: lib/common/plugin/FileUploadOptions.js -define("cordova/plugin/FileUploadOptions", function(require, exports, module) { - -/** - * Options to customize the HTTP request used to upload files. - * @constructor - * @param fileKey {String} Name of file request parameter. - * @param fileName {String} Filename to be used by the server. Defaults to image.jpg. - * @param mimeType {String} Mimetype of the uploaded file. Defaults to image/jpeg. - * @param params {Object} Object with key: value params to send to the server. - * @param headers {Object} Keys are header names, values are header values. Multiple - * headers of the same name are not supported. - */ -var FileUploadOptions = function(fileKey, fileName, mimeType, params, headers, httpMethod) { - this.fileKey = fileKey || null; - this.fileName = fileName || null; - this.mimeType = mimeType || null; - this.params = params || null; - this.headers = headers || null; - this.httpMethod = httpMethod || null; -}; - -module.exports = FileUploadOptions; - -}); - -// file: lib/common/plugin/FileUploadResult.js -define("cordova/plugin/FileUploadResult", function(require, exports, module) { - -/** - * FileUploadResult - * @constructor - */ -var FileUploadResult = function() { - this.bytesSent = 0; - this.responseCode = null; - this.response = null; -}; - -module.exports = FileUploadResult; - -}); - -// file: lib/common/plugin/FileWriter.js -define("cordova/plugin/FileWriter", function(require, exports, module) { - -var exec = require('cordova/exec'), - FileError = require('cordova/plugin/FileError'), - ProgressEvent = require('cordova/plugin/ProgressEvent'); - -/** - * This class writes to the mobile device file system. - * - * For Android: - * The root directory is the root of the file system. - * To write to the SD card, the file name is "sdcard/my_file.txt" - * - * @constructor - * @param file {File} File object containing file properties - * @param append if true write to the end of the file, otherwise overwrite the file - */ -var FileWriter = function(file) { - this.fileName = ""; - this.length = 0; - if (file) { - this.fileName = file.fullPath || file; - this.length = file.size || 0; - } - // default is to write at the beginning of the file - this.position = 0; - - this.readyState = 0; // EMPTY - - this.result = null; - - // Error - this.error = null; - - // Event handlers - this.onwritestart = null; // When writing starts - this.onprogress = null; // While writing the file, and reporting partial file data - this.onwrite = null; // When the write has successfully completed. - this.onwriteend = null; // When the request has completed (either in success or failure). - this.onabort = null; // When the write has been aborted. For instance, by invoking the abort() method. - this.onerror = null; // When the write has failed (see errors). -}; - -// States -FileWriter.INIT = 0; -FileWriter.WRITING = 1; -FileWriter.DONE = 2; - -/** - * Abort writing file. - */ -FileWriter.prototype.abort = function() { - // check for invalid state - if (this.readyState === FileWriter.DONE || this.readyState === FileWriter.INIT) { - throw new FileError(FileError.INVALID_STATE_ERR); - } - - // set error - this.error = new FileError(FileError.ABORT_ERR); - - this.readyState = FileWriter.DONE; - - // If abort callback - if (typeof this.onabort === "function") { - this.onabort(new ProgressEvent("abort", {"target":this})); - } - - // If write end callback - if (typeof this.onwriteend === "function") { - this.onwriteend(new ProgressEvent("writeend", {"target":this})); - } -}; - -/** - * Writes data to the file - * - * @param data text or blob to be written - */ -FileWriter.prototype.write = function(data) { - - var isBinary = false; - - // If we don't have Blob or ArrayBuffer support, don't bother. - if (typeof window.Blob !== 'undefined' && typeof window.ArrayBuffer !== 'undefined') { - - // Check to see if the incoming data is a blob - if (data instanceof Blob) { - var that=this; - var fileReader = new FileReader(); - fileReader.onload = function() { - // Call this method again, with the arraybuffer as argument - FileWriter.prototype.write.call(that, this.result); - }; - fileReader.readAsArrayBuffer(data); - return; - } - - // Mark data type for safer transport over the binary bridge - isBinary = (data instanceof ArrayBuffer); - } - - // Throw an exception if we are already writing a file - if (this.readyState === FileWriter.WRITING) { - throw new FileError(FileError.INVALID_STATE_ERR); - } - - // WRITING state - this.readyState = FileWriter.WRITING; - - var me = this; - - // If onwritestart callback - if (typeof me.onwritestart === "function") { - me.onwritestart(new ProgressEvent("writestart", {"target":me})); - } - - // Write file - exec( - // Success callback - function(r) { - // If DONE (cancelled), then don't do anything - if (me.readyState === FileWriter.DONE) { - return; - } - - // position always increases by bytes written because file would be extended - me.position += r; - // The length of the file is now where we are done writing. - - me.length = me.position; - - // DONE state - me.readyState = FileWriter.DONE; - - // If onwrite callback - if (typeof me.onwrite === "function") { - me.onwrite(new ProgressEvent("write", {"target":me})); - } - - // If onwriteend callback - if (typeof me.onwriteend === "function") { - me.onwriteend(new ProgressEvent("writeend", {"target":me})); - } - }, - // Error callback - function(e) { - // If DONE (cancelled), then don't do anything - if (me.readyState === FileWriter.DONE) { - return; - } - - // DONE state - me.readyState = FileWriter.DONE; - - // Save error - me.error = new FileError(e); - - // If onerror callback - if (typeof me.onerror === "function") { - me.onerror(new ProgressEvent("error", {"target":me})); - } - - // If onwriteend callback - if (typeof me.onwriteend === "function") { - me.onwriteend(new ProgressEvent("writeend", {"target":me})); - } - }, "File", "write", [this.fileName, data, this.position, isBinary]); -}; - -/** - * Moves the file pointer to the location specified. - * - * If the offset is a negative number the position of the file - * pointer is rewound. If the offset is greater than the file - * size the position is set to the end of the file. - * - * @param offset is the location to move the file pointer to. - */ -FileWriter.prototype.seek = function(offset) { - // Throw an exception if we are already writing a file - if (this.readyState === FileWriter.WRITING) { - throw new FileError(FileError.INVALID_STATE_ERR); - } - - if (!offset && offset !== 0) { - return; - } - - // See back from end of file. - if (offset < 0) { - this.position = Math.max(offset + this.length, 0); - } - // Offset is bigger than file size so set position - // to the end of the file. - else if (offset > this.length) { - this.position = this.length; - } - // Offset is between 0 and file size so set the position - // to start writing. - else { - this.position = offset; - } -}; - -/** - * Truncates the file to the size specified. - * - * @param size to chop the file at. - */ -FileWriter.prototype.truncate = function(size) { - // Throw an exception if we are already writing a file - if (this.readyState === FileWriter.WRITING) { - throw new FileError(FileError.INVALID_STATE_ERR); - } - - // WRITING state - this.readyState = FileWriter.WRITING; - - var me = this; - - // If onwritestart callback - if (typeof me.onwritestart === "function") { - me.onwritestart(new ProgressEvent("writestart", {"target":this})); - } - - // Write file - exec( - // Success callback - function(r) { - // If DONE (cancelled), then don't do anything - if (me.readyState === FileWriter.DONE) { - return; - } - - // DONE state - me.readyState = FileWriter.DONE; - - // Update the length of the file - me.length = r; - me.position = Math.min(me.position, r); - - // If onwrite callback - if (typeof me.onwrite === "function") { - me.onwrite(new ProgressEvent("write", {"target":me})); - } - - // If onwriteend callback - if (typeof me.onwriteend === "function") { - me.onwriteend(new ProgressEvent("writeend", {"target":me})); - } - }, - // Error callback - function(e) { - // If DONE (cancelled), then don't do anything - if (me.readyState === FileWriter.DONE) { - return; - } - - // DONE state - me.readyState = FileWriter.DONE; - - // Save error - me.error = new FileError(e); - - // If onerror callback - if (typeof me.onerror === "function") { - me.onerror(new ProgressEvent("error", {"target":me})); - } - - // If onwriteend callback - if (typeof me.onwriteend === "function") { - me.onwriteend(new ProgressEvent("writeend", {"target":me})); - } - }, "File", "truncate", [this.fileName, size]); -}; - -module.exports = FileWriter; - -}); - -// file: lib/common/plugin/Flags.js -define("cordova/plugin/Flags", function(require, exports, module) { - -/** - * Supplies arguments to methods that lookup or create files and directories. - * - * @param create - * {boolean} file or directory if it doesn't exist - * @param exclusive - * {boolean} used with create; if true the command will fail if - * target path exists - */ -function Flags(create, exclusive) { - this.create = create || false; - this.exclusive = exclusive || false; -} - -module.exports = Flags; - -}); - -// file: lib/common/plugin/GlobalizationError.js -define("cordova/plugin/GlobalizationError", function(require, exports, module) { - - -/** - * Globalization error object - * - * @constructor - * @param code - * @param message - */ -var GlobalizationError = function(code, message) { - this.code = code || null; - this.message = message || ''; -}; - -// Globalization error codes -GlobalizationError.UNKNOWN_ERROR = 0; -GlobalizationError.FORMATTING_ERROR = 1; -GlobalizationError.PARSING_ERROR = 2; -GlobalizationError.PATTERN_ERROR = 3; - -module.exports = GlobalizationError; - -}); - -// file: lib/common/plugin/InAppBrowser.js -define("cordova/plugin/InAppBrowser", function(require, exports, module) { - -var exec = require('cordova/exec'); -var channel = require('cordova/channel'); -var modulemapper = require('cordova/modulemapper'); - -function InAppBrowser() { - this.channels = { - 'loadstart': channel.create('loadstart'), - 'loadstop' : channel.create('loadstop'), - 'loaderror' : channel.create('loaderror'), - 'exit' : channel.create('exit') - }; -} - -InAppBrowser.prototype = { - _eventHandler: function (event) { - if (event.type in this.channels) { - this.channels[event.type].fire(event); - } - }, - close: function (eventname) { - exec(null, null, "InAppBrowser", "close", []); - }, - show: function (eventname) { - exec(null, null, "InAppBrowser", "show", []); - }, - addEventListener: function (eventname,f) { - if (eventname in this.channels) { - this.channels[eventname].subscribe(f); - } - }, - removeEventListener: function(eventname, f) { - if (eventname in this.channels) { - this.channels[eventname].unsubscribe(f); - } - }, - - executeScript: function(injectDetails, cb) { - if (injectDetails.code) { - exec(cb, null, "InAppBrowser", "injectScriptCode", [injectDetails.code, !!cb]); - } else if (injectDetails.file) { - exec(cb, null, "InAppBrowser", "injectScriptFile", [injectDetails.file, !!cb]); - } else { - throw new Error('executeScript requires exactly one of code or file to be specified'); - } - }, - - insertCSS: function(injectDetails, cb) { - if (injectDetails.code) { - exec(cb, null, "InAppBrowser", "injectStyleCode", [injectDetails.code, !!cb]); - } else if (injectDetails.file) { - exec(cb, null, "InAppBrowser", "injectStyleFile", [injectDetails.file, !!cb]); - } else { - throw new Error('insertCSS requires exactly one of code or file to be specified'); - } - } -}; - -module.exports = function(strUrl, strWindowName, strWindowFeatures) { - var iab = new InAppBrowser(); - var cb = function(eventname) { - iab._eventHandler(eventname); - }; - - // Don't catch calls that write to existing frames (e.g. named iframes). - if (window.frames && window.frames[strWindowName]) { - var origOpenFunc = modulemapper.getOriginalSymbol(window, 'open'); - return origOpenFunc.apply(window, arguments); - } - - exec(cb, cb, "InAppBrowser", "open", [strUrl, strWindowName, strWindowFeatures]); - return iab; -}; - - -}); - -// file: lib/common/plugin/LocalFileSystem.js -define("cordova/plugin/LocalFileSystem", function(require, exports, module) { - -var exec = require('cordova/exec'); - -/** - * Represents a local file system. - */ -var LocalFileSystem = function() { - -}; - -LocalFileSystem.TEMPORARY = 0; //temporary, with no guarantee of persistence -LocalFileSystem.PERSISTENT = 1; //persistent - -module.exports = LocalFileSystem; - -}); - -// file: lib/common/plugin/Media.js -define("cordova/plugin/Media", function(require, exports, module) { - -var argscheck = require('cordova/argscheck'), - utils = require('cordova/utils'), - exec = require('cordova/exec'); - -var mediaObjects = {}; - -/** - * This class provides access to the device media, interfaces to both sound and video - * - * @constructor - * @param src The file name or url to play - * @param successCallback The callback to be called when the file is done playing or recording. - * successCallback() - * @param errorCallback The callback to be called if there is an error. - * errorCallback(int errorCode) - OPTIONAL - * @param statusCallback The callback to be called when media status has changed. - * statusCallback(int statusCode) - OPTIONAL - */ -var Media = function(src, successCallback, errorCallback, statusCallback) { - argscheck.checkArgs('SFFF', 'Media', arguments); - this.id = utils.createUUID(); - mediaObjects[this.id] = this; - this.src = src; - this.successCallback = successCallback; - this.errorCallback = errorCallback; - this.statusCallback = statusCallback; - this._duration = -1; - this._position = -1; - exec(null, this.errorCallback, "Media", "create", [this.id, this.src]); -}; - -// Media messages -Media.MEDIA_STATE = 1; -Media.MEDIA_DURATION = 2; -Media.MEDIA_POSITION = 3; -Media.MEDIA_ERROR = 9; - -// Media states -Media.MEDIA_NONE = 0; -Media.MEDIA_STARTING = 1; -Media.MEDIA_RUNNING = 2; -Media.MEDIA_PAUSED = 3; -Media.MEDIA_STOPPED = 4; -Media.MEDIA_MSG = ["None", "Starting", "Running", "Paused", "Stopped"]; - -// "static" function to return existing objs. -Media.get = function(id) { - return mediaObjects[id]; -}; - -/** - * Start or resume playing audio file. - */ -Media.prototype.play = function(options) { - exec(null, null, "Media", "startPlayingAudio", [this.id, this.src, options]); -}; - -/** - * Stop playing audio file. - */ -Media.prototype.stop = function() { - var me = this; - exec(function() { - me._position = 0; - }, this.errorCallback, "Media", "stopPlayingAudio", [this.id]); -}; - -/** - * Seek or jump to a new time in the track.. - */ -Media.prototype.seekTo = function(milliseconds) { - var me = this; - exec(function(p) { - me._position = p; - }, this.errorCallback, "Media", "seekToAudio", [this.id, milliseconds]); -}; - -/** - * Pause playing audio file. - */ -Media.prototype.pause = function() { - exec(null, this.errorCallback, "Media", "pausePlayingAudio", [this.id]); -}; - -/** - * Get duration of an audio file. - * The duration is only set for audio that is playing, paused or stopped. - * - * @return duration or -1 if not known. - */ -Media.prototype.getDuration = function() { - return this._duration; -}; - -/** - * Get position of audio. - */ -Media.prototype.getCurrentPosition = function(success, fail) { - var me = this; - exec(function(p) { - me._position = p; - success(p); - }, fail, "Media", "getCurrentPositionAudio", [this.id]); -}; - -/** - * Start recording audio file. - */ -Media.prototype.startRecord = function() { - exec(null, this.errorCallback, "Media", "startRecordingAudio", [this.id, this.src]); -}; - -/** - * Stop recording audio file. - */ -Media.prototype.stopRecord = function() { - exec(null, this.errorCallback, "Media", "stopRecordingAudio", [this.id]); -}; - -/** - * Release the resources. - */ -Media.prototype.release = function() { - exec(null, this.errorCallback, "Media", "release", [this.id]); -}; - -/** - * Adjust the volume. - */ -Media.prototype.setVolume = function(volume) { - exec(null, null, "Media", "setVolume", [this.id, volume]); -}; - -/** - * Audio has status update. - * PRIVATE - * - * @param id The media object id (string) - * @param msgType The 'type' of update this is - * @param value Use of value is determined by the msgType - */ -Media.onStatus = function(id, msgType, value) { - - var media = mediaObjects[id]; - - if(media) { - switch(msgType) { - case Media.MEDIA_STATE : - media.statusCallback && media.statusCallback(value); - if(value == Media.MEDIA_STOPPED) { - media.successCallback && media.successCallback(); - } - break; - case Media.MEDIA_DURATION : - media._duration = value; - break; - case Media.MEDIA_ERROR : - media.errorCallback && media.errorCallback(value); - break; - case Media.MEDIA_POSITION : - media._position = Number(value); - break; - default : - console.error && console.error("Unhandled Media.onStatus :: " + msgType); - break; - } - } - else { - console.error && console.error("Received Media.onStatus callback for unknown media :: " + id); - } - -}; - -module.exports = Media; - -}); - -// file: lib/common/plugin/MediaError.js -define("cordova/plugin/MediaError", function(require, exports, module) { - -/** - * This class contains information about any Media errors. -*/ -/* - According to :: http://dev.w3.org/html5/spec-author-view/video.html#mediaerror - We should never be creating these objects, we should just implement the interface - which has 1 property for an instance, 'code' - - instead of doing : - errorCallbackFunction( new MediaError(3,'msg') ); -we should simply use a literal : - errorCallbackFunction( {'code':3} ); - */ - - var _MediaError = window.MediaError; - - -if(!_MediaError) { - window.MediaError = _MediaError = function(code, msg) { - this.code = (typeof code != 'undefined') ? code : null; - this.message = msg || ""; // message is NON-standard! do not use! - }; -} - -_MediaError.MEDIA_ERR_NONE_ACTIVE = _MediaError.MEDIA_ERR_NONE_ACTIVE || 0; -_MediaError.MEDIA_ERR_ABORTED = _MediaError.MEDIA_ERR_ABORTED || 1; -_MediaError.MEDIA_ERR_NETWORK = _MediaError.MEDIA_ERR_NETWORK || 2; -_MediaError.MEDIA_ERR_DECODE = _MediaError.MEDIA_ERR_DECODE || 3; -_MediaError.MEDIA_ERR_NONE_SUPPORTED = _MediaError.MEDIA_ERR_NONE_SUPPORTED || 4; -// TODO: MediaError.MEDIA_ERR_NONE_SUPPORTED is legacy, the W3 spec now defines it as below. -// as defined by http://dev.w3.org/html5/spec-author-view/video.html#error-codes -_MediaError.MEDIA_ERR_SRC_NOT_SUPPORTED = _MediaError.MEDIA_ERR_SRC_NOT_SUPPORTED || 4; - -module.exports = _MediaError; - -}); - -// file: lib/common/plugin/MediaFile.js -define("cordova/plugin/MediaFile", function(require, exports, module) { - -var utils = require('cordova/utils'), - exec = require('cordova/exec'), - File = require('cordova/plugin/File'), - CaptureError = require('cordova/plugin/CaptureError'); -/** - * Represents a single file. - * - * name {DOMString} name of the file, without path information - * fullPath {DOMString} the full path of the file, including the name - * type {DOMString} mime type - * lastModifiedDate {Date} last modified date - * size {Number} size of the file in bytes - */ -var MediaFile = function(name, fullPath, type, lastModifiedDate, size){ - MediaFile.__super__.constructor.apply(this, arguments); -}; - -utils.extend(MediaFile, File); - -/** - * Request capture format data for a specific file and type - * - * @param {Function} successCB - * @param {Function} errorCB - */ -MediaFile.prototype.getFormatData = function(successCallback, errorCallback) { - if (typeof this.fullPath === "undefined" || this.fullPath === null) { - errorCallback(new CaptureError(CaptureError.CAPTURE_INVALID_ARGUMENT)); - } else { - exec(successCallback, errorCallback, "Capture", "getFormatData", [this.fullPath, this.type]); - } -}; - -module.exports = MediaFile; - -}); - -// file: lib/common/plugin/MediaFileData.js -define("cordova/plugin/MediaFileData", function(require, exports, module) { - -/** - * MediaFileData encapsulates format information of a media file. - * - * @param {DOMString} codecs - * @param {long} bitrate - * @param {long} height - * @param {long} width - * @param {float} duration - */ -var MediaFileData = function(codecs, bitrate, height, width, duration){ - this.codecs = codecs || null; - this.bitrate = bitrate || 0; - this.height = height || 0; - this.width = width || 0; - this.duration = duration || 0; -}; - -module.exports = MediaFileData; - -}); - -// file: lib/common/plugin/Metadata.js -define("cordova/plugin/Metadata", function(require, exports, module) { - -/** - * Information about the state of the file or directory - * - * {Date} modificationTime (readonly) - */ -var Metadata = function(time) { - this.modificationTime = (typeof time != 'undefined'?new Date(time):null); -}; - -module.exports = Metadata; - -}); - -// file: lib/common/plugin/Position.js -define("cordova/plugin/Position", function(require, exports, module) { - -var Coordinates = require('cordova/plugin/Coordinates'); - -var Position = function(coords, timestamp) { - if (coords) { - this.coords = new Coordinates(coords.latitude, coords.longitude, coords.altitude, coords.accuracy, coords.heading, coords.velocity, coords.altitudeAccuracy); - } else { - this.coords = new Coordinates(); - } - this.timestamp = (timestamp !== undefined) ? timestamp : new Date(); -}; - -module.exports = Position; - -}); - -// file: lib/common/plugin/PositionError.js -define("cordova/plugin/PositionError", function(require, exports, module) { - -/** - * Position error object - * - * @constructor - * @param code - * @param message - */ -var PositionError = function(code, message) { - this.code = code || null; - this.message = message || ''; -}; - -PositionError.PERMISSION_DENIED = 1; -PositionError.POSITION_UNAVAILABLE = 2; -PositionError.TIMEOUT = 3; - -module.exports = PositionError; - -}); - -// file: lib/common/plugin/ProgressEvent.js -define("cordova/plugin/ProgressEvent", function(require, exports, module) { - -// If ProgressEvent exists in global context, use it already, otherwise use our own polyfill -// Feature test: See if we can instantiate a native ProgressEvent; -// if so, use that approach, -// otherwise fill-in with our own implementation. -// -// NOTE: right now we always fill in with our own. Down the road would be nice if we can use whatever is native in the webview. -var ProgressEvent = (function() { - /* - var createEvent = function(data) { - var event = document.createEvent('Events'); - event.initEvent('ProgressEvent', false, false); - if (data) { - for (var i in data) { - if (data.hasOwnProperty(i)) { - event[i] = data[i]; - } - } - if (data.target) { - // TODO: cannot call .dispatchEvent - // need to first figure out how to implement EventTarget - } - } - return event; - }; - try { - var ev = createEvent({type:"abort",target:document}); - return function ProgressEvent(type, data) { - data.type = type; - return createEvent(data); - }; - } catch(e){ - */ - return function ProgressEvent(type, dict) { - this.type = type; - this.bubbles = false; - this.cancelBubble = false; - this.cancelable = false; - this.lengthComputable = false; - this.loaded = dict && dict.loaded ? dict.loaded : 0; - this.total = dict && dict.total ? dict.total : 0; - this.target = dict && dict.target ? dict.target : null; - }; - //} -})(); - -module.exports = ProgressEvent; - -}); - -// file: lib/common/plugin/accelerometer.js -define("cordova/plugin/accelerometer", function(require, exports, module) { - -/** - * This class provides access to device accelerometer data. - * @constructor - */ -var argscheck = require('cordova/argscheck'), - utils = require("cordova/utils"), - exec = require("cordova/exec"), - Acceleration = require('cordova/plugin/Acceleration'); - -// Is the accel sensor running? -var running = false; - -// Keeps reference to watchAcceleration calls. -var timers = {}; - -// Array of listeners; used to keep track of when we should call start and stop. -var listeners = []; - -// Last returned acceleration object from native -var accel = null; - -// Tells native to start. -function start() { - exec(function(a) { - var tempListeners = listeners.slice(0); - accel = new Acceleration(a.x, a.y, a.z, a.timestamp); - for (var i = 0, l = tempListeners.length; i < l; i++) { - tempListeners[i].win(accel); - } - }, function(e) { - var tempListeners = listeners.slice(0); - for (var i = 0, l = tempListeners.length; i < l; i++) { - tempListeners[i].fail(e); - } - }, "Accelerometer", "start", []); - running = true; -} - -// Tells native to stop. -function stop() { - exec(null, null, "Accelerometer", "stop", []); - running = false; -} - -// Adds a callback pair to the listeners array -function createCallbackPair(win, fail) { - return {win:win, fail:fail}; -} - -// Removes a win/fail listener pair from the listeners array -function removeListeners(l) { - var idx = listeners.indexOf(l); - if (idx > -1) { - listeners.splice(idx, 1); - if (listeners.length === 0) { - stop(); - } - } -} - -var accelerometer = { - /** - * Asynchronously acquires the current acceleration. - * - * @param {Function} successCallback The function to call when the acceleration data is available - * @param {Function} errorCallback The function to call when there is an error getting the acceleration data. (OPTIONAL) - * @param {AccelerationOptions} options The options for getting the accelerometer data such as timeout. (OPTIONAL) - */ - getCurrentAcceleration: function(successCallback, errorCallback, options) { - argscheck.checkArgs('fFO', 'accelerometer.getCurrentAcceleration', arguments); - - var p; - var win = function(a) { - removeListeners(p); - successCallback(a); - }; - var fail = function(e) { - removeListeners(p); - errorCallback && errorCallback(e); - }; - - p = createCallbackPair(win, fail); - listeners.push(p); - - if (!running) { - start(); - } - }, - - /** - * Asynchronously acquires the acceleration repeatedly at a given interval. - * - * @param {Function} successCallback The function to call each time the acceleration data is available - * @param {Function} errorCallback The function to call when there is an error getting the acceleration data. (OPTIONAL) - * @param {AccelerationOptions} options The options for getting the accelerometer data such as timeout. (OPTIONAL) - * @return String The watch id that must be passed to #clearWatch to stop watching. - */ - watchAcceleration: function(successCallback, errorCallback, options) { - argscheck.checkArgs('fFO', 'accelerometer.watchAcceleration', arguments); - // Default interval (10 sec) - var frequency = (options && options.frequency && typeof options.frequency == 'number') ? options.frequency : 10000; - - // Keep reference to watch id, and report accel readings as often as defined in frequency - var id = utils.createUUID(); - - var p = createCallbackPair(function(){}, function(e) { - removeListeners(p); - errorCallback && errorCallback(e); - }); - listeners.push(p); - - timers[id] = { - timer:window.setInterval(function() { - if (accel) { - successCallback(accel); - } - }, frequency), - listeners:p - }; - - if (running) { - // If we're already running then immediately invoke the success callback - // but only if we have retrieved a value, sample code does not check for null ... - if (accel) { - successCallback(accel); - } - } else { - start(); - } - - return id; - }, - - /** - * Clears the specified accelerometer watch. - * - * @param {String} id The id of the watch returned from #watchAcceleration. - */ - clearWatch: function(id) { - // Stop javascript timer & remove from timer list - if (id && timers[id]) { - window.clearInterval(timers[id].timer); - removeListeners(timers[id].listeners); - delete timers[id]; - } - } -}; - -module.exports = accelerometer; - -}); - -// file: lib/common/plugin/accelerometer/symbols.js -define("cordova/plugin/accelerometer/symbols", function(require, exports, module) { - - -var modulemapper = require('cordova/modulemapper'); - -modulemapper.defaults('cordova/plugin/Acceleration', 'Acceleration'); -modulemapper.defaults('cordova/plugin/accelerometer', 'navigator.accelerometer'); - -}); - -// file: lib/common/plugin/battery.js -define("cordova/plugin/battery", function(require, exports, module) { - -/** - * This class contains information about the current battery status. - * @constructor - */ -var cordova = require('cordova'), - exec = require('cordova/exec'); - -function handlers() { - return battery.channels.batterystatus.numHandlers + - battery.channels.batterylow.numHandlers + - battery.channels.batterycritical.numHandlers; -} - -var Battery = function() { - this._level = null; - this._isPlugged = null; - // Create new event handlers on the window (returns a channel instance) - this.channels = { - batterystatus:cordova.addWindowEventHandler("batterystatus"), - batterylow:cordova.addWindowEventHandler("batterylow"), - batterycritical:cordova.addWindowEventHandler("batterycritical") - }; - for (var key in this.channels) { - this.channels[key].onHasSubscribersChange = Battery.onHasSubscribersChange; - } -}; -/** - * Event handlers for when callbacks get registered for the battery. - * Keep track of how many handlers we have so we can start and stop the native battery listener - * appropriately (and hopefully save on battery life!). - */ -Battery.onHasSubscribersChange = function() { - // If we just registered the first handler, make sure native listener is started. - if (this.numHandlers === 1 && handlers() === 1) { - exec(battery._status, battery._error, "Battery", "start", []); - } else if (handlers() === 0) { - exec(null, null, "Battery", "stop", []); - } -}; - -/** - * Callback for battery status - * - * @param {Object} info keys: level, isPlugged - */ -Battery.prototype._status = function(info) { - if (info) { - var me = battery; - var level = info.level; - if (me._level !== level || me._isPlugged !== info.isPlugged) { - // Fire batterystatus event - cordova.fireWindowEvent("batterystatus", info); - - // Fire low battery event - if (level === 20 || level === 5) { - if (level === 20) { - cordova.fireWindowEvent("batterylow", info); - } - else { - cordova.fireWindowEvent("batterycritical", info); - } - } - } - me._level = level; - me._isPlugged = info.isPlugged; - } -}; - -/** - * Error callback for battery start - */ -Battery.prototype._error = function(e) { - console.log("Error initializing Battery: " + e); -}; - -var battery = new Battery(); - -module.exports = battery; - -}); - -// file: lib/common/plugin/battery/symbols.js -define("cordova/plugin/battery/symbols", function(require, exports, module) { - - -var modulemapper = require('cordova/modulemapper'); - -modulemapper.defaults('cordova/plugin/battery', 'navigator.battery'); - -}); - -// file: lib/common/plugin/camera/symbols.js -define("cordova/plugin/camera/symbols", function(require, exports, module) { - - -var modulemapper = require('cordova/modulemapper'); - -modulemapper.defaults('cordova/plugin/Camera', 'navigator.camera'); -modulemapper.defaults('cordova/plugin/CameraConstants', 'Camera'); -modulemapper.defaults('cordova/plugin/CameraPopoverOptions', 'CameraPopoverOptions'); - -}); - -// file: lib/common/plugin/capture.js -define("cordova/plugin/capture", function(require, exports, module) { - -var exec = require('cordova/exec'), - MediaFile = require('cordova/plugin/MediaFile'); - -/** - * Launches a capture of different types. - * - * @param (DOMString} type - * @param {Function} successCB - * @param {Function} errorCB - * @param {CaptureVideoOptions} options - */ -function _capture(type, successCallback, errorCallback, options) { - var win = function(pluginResult) { - var mediaFiles = []; - var i; - for (i = 0; i < pluginResult.length; i++) { - var mediaFile = new MediaFile(); - mediaFile.name = pluginResult[i].name; - mediaFile.fullPath = pluginResult[i].fullPath; - mediaFile.type = pluginResult[i].type; - mediaFile.lastModifiedDate = pluginResult[i].lastModifiedDate; - mediaFile.size = pluginResult[i].size; - mediaFiles.push(mediaFile); - } - successCallback(mediaFiles); - }; - exec(win, errorCallback, "Capture", type, [options]); -} -/** - * The Capture interface exposes an interface to the camera and microphone of the hosting device. - */ -function Capture() { - this.supportedAudioModes = []; - this.supportedImageModes = []; - this.supportedVideoModes = []; -} - -/** - * Launch audio recorder application for recording audio clip(s). - * - * @param {Function} successCB - * @param {Function} errorCB - * @param {CaptureAudioOptions} options - */ -Capture.prototype.captureAudio = function(successCallback, errorCallback, options){ - _capture("captureAudio", successCallback, errorCallback, options); -}; - -/** - * Launch camera application for taking image(s). - * - * @param {Function} successCB - * @param {Function} errorCB - * @param {CaptureImageOptions} options - */ -Capture.prototype.captureImage = function(successCallback, errorCallback, options){ - _capture("captureImage", successCallback, errorCallback, options); -}; - -/** - * Launch device camera application for recording video(s). - * - * @param {Function} successCB - * @param {Function} errorCB - * @param {CaptureVideoOptions} options - */ -Capture.prototype.captureVideo = function(successCallback, errorCallback, options){ - _capture("captureVideo", successCallback, errorCallback, options); -}; - - -module.exports = new Capture(); - -}); - -// file: lib/common/plugin/capture/symbols.js -define("cordova/plugin/capture/symbols", function(require, exports, module) { - -var modulemapper = require('cordova/modulemapper'); - -modulemapper.clobbers('cordova/plugin/CaptureError', 'CaptureError'); -modulemapper.clobbers('cordova/plugin/CaptureAudioOptions', 'CaptureAudioOptions'); -modulemapper.clobbers('cordova/plugin/CaptureImageOptions', 'CaptureImageOptions'); -modulemapper.clobbers('cordova/plugin/CaptureVideoOptions', 'CaptureVideoOptions'); -modulemapper.clobbers('cordova/plugin/ConfigurationData', 'ConfigurationData'); -modulemapper.clobbers('cordova/plugin/MediaFile', 'MediaFile'); -modulemapper.clobbers('cordova/plugin/MediaFileData', 'MediaFileData'); -modulemapper.clobbers('cordova/plugin/capture', 'navigator.device.capture'); - -}); - -// file: lib/common/plugin/compass.js -define("cordova/plugin/compass", function(require, exports, module) { - -var argscheck = require('cordova/argscheck'), - exec = require('cordova/exec'), - utils = require('cordova/utils'), - CompassHeading = require('cordova/plugin/CompassHeading'), - CompassError = require('cordova/plugin/CompassError'), - timers = {}, - compass = { - /** - * Asynchronously acquires the current heading. - * @param {Function} successCallback The function to call when the heading - * data is available - * @param {Function} errorCallback The function to call when there is an error - * getting the heading data. - * @param {CompassOptions} options The options for getting the heading data (not used). - */ - getCurrentHeading:function(successCallback, errorCallback, options) { - argscheck.checkArgs('fFO', 'compass.getCurrentHeading', arguments); - - var win = function(result) { - var ch = new CompassHeading(result.magneticHeading, result.trueHeading, result.headingAccuracy, result.timestamp); - successCallback(ch); - }; - var fail = errorCallback && function(code) { - var ce = new CompassError(code); - errorCallback(ce); - }; - - // Get heading - exec(win, fail, "Compass", "getHeading", [options]); - }, - - /** - * Asynchronously acquires the heading repeatedly at a given interval. - * @param {Function} successCallback The function to call each time the heading - * data is available - * @param {Function} errorCallback The function to call when there is an error - * getting the heading data. - * @param {HeadingOptions} options The options for getting the heading data - * such as timeout and the frequency of the watch. For iOS, filter parameter - * specifies to watch via a distance filter rather than time. - */ - watchHeading:function(successCallback, errorCallback, options) { - argscheck.checkArgs('fFO', 'compass.watchHeading', arguments); - // Default interval (100 msec) - var frequency = (options !== undefined && options.frequency !== undefined) ? options.frequency : 100; - var filter = (options !== undefined && options.filter !== undefined) ? options.filter : 0; - - var id = utils.createUUID(); - if (filter > 0) { - // is an iOS request for watch by filter, no timer needed - timers[id] = "iOS"; - compass.getCurrentHeading(successCallback, errorCallback, options); - } else { - // Start watch timer to get headings - timers[id] = window.setInterval(function() { - compass.getCurrentHeading(successCallback, errorCallback); - }, frequency); - } - - return id; - }, - - /** - * Clears the specified heading watch. - * @param {String} watchId The ID of the watch returned from #watchHeading. - */ - clearWatch:function(id) { - // Stop javascript timer & remove from timer list - if (id && timers[id]) { - if (timers[id] != "iOS") { - clearInterval(timers[id]); - } else { - // is iOS watch by filter so call into device to stop - exec(null, null, "Compass", "stopHeading", []); - } - delete timers[id]; - } - } - }; - -module.exports = compass; - -}); - -// file: lib/common/plugin/compass/symbols.js -define("cordova/plugin/compass/symbols", function(require, exports, module) { - - -var modulemapper = require('cordova/modulemapper'); - -modulemapper.clobbers('cordova/plugin/CompassHeading', 'CompassHeading'); -modulemapper.clobbers('cordova/plugin/CompassError', 'CompassError'); -modulemapper.clobbers('cordova/plugin/compass', 'navigator.compass'); - -}); - -// file: lib/common/plugin/console-via-logger.js -define("cordova/plugin/console-via-logger", function(require, exports, module) { - -//------------------------------------------------------------------------------ - -var logger = require("cordova/plugin/logger"); -var utils = require("cordova/utils"); - -//------------------------------------------------------------------------------ -// object that we're exporting -//------------------------------------------------------------------------------ -var console = module.exports; - -//------------------------------------------------------------------------------ -// copy of the original console object -//------------------------------------------------------------------------------ -var WinConsole = window.console; - -//------------------------------------------------------------------------------ -// whether to use the logger -//------------------------------------------------------------------------------ -var UseLogger = false; - -//------------------------------------------------------------------------------ -// Timers -//------------------------------------------------------------------------------ -var Timers = {}; - -//------------------------------------------------------------------------------ -// used for unimplemented methods -//------------------------------------------------------------------------------ -function noop() {} - -//------------------------------------------------------------------------------ -// used for unimplemented methods -//------------------------------------------------------------------------------ -console.useLogger = function (value) { - if (arguments.length) UseLogger = !!value; - - if (UseLogger) { - if (logger.useConsole()) { - throw new Error("console and logger are too intertwingly"); - } - } - - return UseLogger; -}; - -//------------------------------------------------------------------------------ -console.log = function() { - if (logger.useConsole()) return; - logger.log.apply(logger, [].slice.call(arguments)); -}; - -//------------------------------------------------------------------------------ -console.error = function() { - if (logger.useConsole()) return; - logger.error.apply(logger, [].slice.call(arguments)); -}; - -//------------------------------------------------------------------------------ -console.warn = function() { - if (logger.useConsole()) return; - logger.warn.apply(logger, [].slice.call(arguments)); -}; - -//------------------------------------------------------------------------------ -console.info = function() { - if (logger.useConsole()) return; - logger.info.apply(logger, [].slice.call(arguments)); -}; - -//------------------------------------------------------------------------------ -console.debug = function() { - if (logger.useConsole()) return; - logger.debug.apply(logger, [].slice.call(arguments)); -}; - -//------------------------------------------------------------------------------ -console.assert = function(expression) { - if (expression) return; - - var message = logger.format.apply(logger.format, [].slice.call(arguments, 1)); - console.log("ASSERT: " + message); -}; - -//------------------------------------------------------------------------------ -console.clear = function() {}; - -//------------------------------------------------------------------------------ -console.dir = function(object) { - console.log("%o", object); -}; - -//------------------------------------------------------------------------------ -console.dirxml = function(node) { - console.log(node.innerHTML); -}; - -//------------------------------------------------------------------------------ -console.trace = noop; - -//------------------------------------------------------------------------------ -console.group = console.log; - -//------------------------------------------------------------------------------ -console.groupCollapsed = console.log; - -//------------------------------------------------------------------------------ -console.groupEnd = noop; - -//------------------------------------------------------------------------------ -console.time = function(name) { - Timers[name] = new Date().valueOf(); -}; - -//------------------------------------------------------------------------------ -console.timeEnd = function(name) { - var timeStart = Timers[name]; - if (!timeStart) { - console.warn("unknown timer: " + name); - return; - } - - var timeElapsed = new Date().valueOf() - timeStart; - console.log(name + ": " + timeElapsed + "ms"); -}; - -//------------------------------------------------------------------------------ -console.timeStamp = noop; - -//------------------------------------------------------------------------------ -console.profile = noop; - -//------------------------------------------------------------------------------ -console.profileEnd = noop; - -//------------------------------------------------------------------------------ -console.count = noop; - -//------------------------------------------------------------------------------ -console.exception = console.log; - -//------------------------------------------------------------------------------ -console.table = function(data, columns) { - console.log("%o", data); -}; - -//------------------------------------------------------------------------------ -// return a new function that calls both functions passed as args -//------------------------------------------------------------------------------ -function wrappedOrigCall(orgFunc, newFunc) { - return function() { - var args = [].slice.call(arguments); - try { orgFunc.apply(WinConsole, args); } catch (e) {} - try { newFunc.apply(console, args); } catch (e) {} - }; -} - -//------------------------------------------------------------------------------ -// For every function that exists in the original console object, that -// also exists in the new console object, wrap the new console method -// with one that calls both -//------------------------------------------------------------------------------ -for (var key in console) { - if (typeof WinConsole[key] == "function") { - console[key] = wrappedOrigCall(WinConsole[key], console[key]); - } -} - -}); - -// file: lib/common/plugin/contacts.js -define("cordova/plugin/contacts", function(require, exports, module) { - -var argscheck = require('cordova/argscheck'), - exec = require('cordova/exec'), - ContactError = require('cordova/plugin/ContactError'), - utils = require('cordova/utils'), - Contact = require('cordova/plugin/Contact'); - -/** -* Represents a group of Contacts. -* @constructor -*/ -var contacts = { - /** - * Returns an array of Contacts matching the search criteria. - * @param fields that should be searched - * @param successCB success callback - * @param errorCB error callback - * @param {ContactFindOptions} options that can be applied to contact searching - * @return array of Contacts matching search criteria - */ - find:function(fields, successCB, errorCB, options) { - argscheck.checkArgs('afFO', 'contacts.find', arguments); - if (!fields.length) { - errorCB && errorCB(new ContactError(ContactError.INVALID_ARGUMENT_ERROR)); - } else { - var win = function(result) { - var cs = []; - for (var i = 0, l = result.length; i < l; i++) { - cs.push(contacts.create(result[i])); - } - successCB(cs); - }; - exec(win, errorCB, "Contacts", "search", [fields, options]); - } - }, - - /** - * This function creates a new contact, but it does not persist the contact - * to device storage. To persist the contact to device storage, invoke - * contact.save(). - * @param properties an object whose properties will be examined to create a new Contact - * @returns new Contact object - */ - create:function(properties) { - argscheck.checkArgs('O', 'contacts.create', arguments); - var contact = new Contact(); - for (var i in properties) { - if (typeof contact[i] !== 'undefined' && properties.hasOwnProperty(i)) { - contact[i] = properties[i]; - } - } - return contact; - } -}; - -module.exports = contacts; - -}); - -// file: lib/common/plugin/contacts/symbols.js -define("cordova/plugin/contacts/symbols", function(require, exports, module) { - - -var modulemapper = require('cordova/modulemapper'); - -modulemapper.clobbers('cordova/plugin/contacts', 'navigator.contacts'); -modulemapper.clobbers('cordova/plugin/Contact', 'Contact'); -modulemapper.clobbers('cordova/plugin/ContactAddress', 'ContactAddress'); -modulemapper.clobbers('cordova/plugin/ContactError', 'ContactError'); -modulemapper.clobbers('cordova/plugin/ContactField', 'ContactField'); -modulemapper.clobbers('cordova/plugin/ContactFindOptions', 'ContactFindOptions'); -modulemapper.clobbers('cordova/plugin/ContactName', 'ContactName'); -modulemapper.clobbers('cordova/plugin/ContactOrganization', 'ContactOrganization'); - -}); - -// file: lib/common/plugin/device.js -define("cordova/plugin/device", function(require, exports, module) { - -var argscheck = require('cordova/argscheck'), - channel = require('cordova/channel'), - utils = require('cordova/utils'), - exec = require('cordova/exec'); - -// Tell cordova channel to wait on the CordovaInfoReady event -channel.waitForInitialization('onCordovaInfoReady'); - -/** - * This represents the mobile device, and provides properties for inspecting the model, version, UUID of the - * phone, etc. - * @constructor - */ -function Device() { - this.available = false; - this.platform = null; - this.version = null; - this.uuid = null; - this.cordova = null; - this.model = null; - - var me = this; - - channel.onCordovaReady.subscribe(function() { - me.getInfo(function(info) { - var buildLabel = info.cordova; - if (buildLabel != CORDOVA_JS_BUILD_LABEL) { - buildLabel += ' JS=' + CORDOVA_JS_BUILD_LABEL; - } - me.available = true; - me.platform = info.platform; - me.version = info.version; - me.uuid = info.uuid; - me.cordova = buildLabel; - me.model = info.model; - channel.onCordovaInfoReady.fire(); - },function(e) { - me.available = false; - utils.alert("[ERROR] Error initializing Cordova: " + e); - }); - }); -} - -/** - * Get device info - * - * @param {Function} successCallback The function to call when the heading data is available - * @param {Function} errorCallback The function to call when there is an error getting the heading data. (OPTIONAL) - */ -Device.prototype.getInfo = function(successCallback, errorCallback) { - argscheck.checkArgs('fF', 'Device.getInfo', arguments); - exec(successCallback, errorCallback, "Device", "getDeviceInfo", []); -}; - -module.exports = new Device(); - -}); - -// file: lib/common/plugin/device/symbols.js -define("cordova/plugin/device/symbols", function(require, exports, module) { - - -var modulemapper = require('cordova/modulemapper'); - -modulemapper.clobbers('cordova/plugin/device', 'device'); - -}); - -// file: lib/common/plugin/echo.js -define("cordova/plugin/echo", function(require, exports, module) { - -var exec = require('cordova/exec'), - utils = require('cordova/utils'); - -/** - * Sends the given message through exec() to the Echo plugin, which sends it back to the successCallback. - * @param successCallback invoked with a FileSystem object - * @param errorCallback invoked if error occurs retrieving file system - * @param message The string to be echoed. - * @param forceAsync Whether to force an async return value (for testing native->js bridge). - */ -module.exports = function(successCallback, errorCallback, message, forceAsync) { - var action = 'echo'; - var messageIsMultipart = (utils.typeName(message) == "Array"); - var args = messageIsMultipart ? message : [message]; - - if (utils.typeName(message) == 'ArrayBuffer') { - if (forceAsync) { - console.warn('Cannot echo ArrayBuffer with forced async, falling back to sync.'); - } - action += 'ArrayBuffer'; - } else if (messageIsMultipart) { - if (forceAsync) { - console.warn('Cannot echo MultiPart Array with forced async, falling back to sync.'); - } - action += 'MultiPart'; - } else if (forceAsync) { - action += 'Async'; - } - - exec(successCallback, errorCallback, "Echo", action, args); -}; - - -}); - -// file: lib/ios/plugin/file/symbols.js -define("cordova/plugin/file/symbols", function(require, exports, module) { - - -var modulemapper = require('cordova/modulemapper'), - symbolshelper = require('cordova/plugin/file/symbolshelper'); - -symbolshelper(modulemapper.clobbers); -modulemapper.merges('cordova/plugin/ios/Entry', 'Entry'); - -}); - -// file: lib/common/plugin/file/symbolshelper.js -define("cordova/plugin/file/symbolshelper", function(require, exports, module) { - -module.exports = function(exportFunc) { - exportFunc('cordova/plugin/DirectoryEntry', 'DirectoryEntry'); - exportFunc('cordova/plugin/DirectoryReader', 'DirectoryReader'); - exportFunc('cordova/plugin/Entry', 'Entry'); - exportFunc('cordova/plugin/File', 'File'); - exportFunc('cordova/plugin/FileEntry', 'FileEntry'); - exportFunc('cordova/plugin/FileError', 'FileError'); - exportFunc('cordova/plugin/FileReader', 'FileReader'); - exportFunc('cordova/plugin/FileSystem', 'FileSystem'); - exportFunc('cordova/plugin/FileUploadOptions', 'FileUploadOptions'); - exportFunc('cordova/plugin/FileUploadResult', 'FileUploadResult'); - exportFunc('cordova/plugin/FileWriter', 'FileWriter'); - exportFunc('cordova/plugin/Flags', 'Flags'); - exportFunc('cordova/plugin/LocalFileSystem', 'LocalFileSystem'); - exportFunc('cordova/plugin/Metadata', 'Metadata'); - exportFunc('cordova/plugin/ProgressEvent', 'ProgressEvent'); - exportFunc('cordova/plugin/requestFileSystem', 'requestFileSystem'); - exportFunc('cordova/plugin/resolveLocalFileSystemURI', 'resolveLocalFileSystemURI'); -}; - -}); - -// file: lib/common/plugin/filetransfer/symbols.js -define("cordova/plugin/filetransfer/symbols", function(require, exports, module) { - - -var modulemapper = require('cordova/modulemapper'); - -modulemapper.clobbers('cordova/plugin/FileTransfer', 'FileTransfer'); -modulemapper.clobbers('cordova/plugin/FileTransferError', 'FileTransferError'); - -}); - -// file: lib/common/plugin/geolocation.js -define("cordova/plugin/geolocation", function(require, exports, module) { - -var argscheck = require('cordova/argscheck'), - utils = require('cordova/utils'), - exec = require('cordova/exec'), - PositionError = require('cordova/plugin/PositionError'), - Position = require('cordova/plugin/Position'); - -var timers = {}; // list of timers in use - -// Returns default params, overrides if provided with values -function parseParameters(options) { - var opt = { - maximumAge: 0, - enableHighAccuracy: false, - timeout: Infinity - }; - - if (options) { - if (options.maximumAge !== undefined && !isNaN(options.maximumAge) && options.maximumAge > 0) { - opt.maximumAge = options.maximumAge; - } - if (options.enableHighAccuracy !== undefined) { - opt.enableHighAccuracy = options.enableHighAccuracy; - } - if (options.timeout !== undefined && !isNaN(options.timeout)) { - if (options.timeout < 0) { - opt.timeout = 0; - } else { - opt.timeout = options.timeout; - } - } - } - - return opt; -} - -// Returns a timeout failure, closed over a specified timeout value and error callback. -function createTimeout(errorCallback, timeout) { - var t = setTimeout(function() { - clearTimeout(t); - t = null; - errorCallback({ - code:PositionError.TIMEOUT, - message:"Position retrieval timed out." - }); - }, timeout); - return t; -} - -var geolocation = { - lastPosition:null, // reference to last known (cached) position returned - /** - * Asynchronously acquires the current position. - * - * @param {Function} successCallback The function to call when the position data is available - * @param {Function} errorCallback The function to call when there is an error getting the heading position. (OPTIONAL) - * @param {PositionOptions} options The options for getting the position data. (OPTIONAL) - */ - getCurrentPosition:function(successCallback, errorCallback, options) { - argscheck.checkArgs('fFO', 'geolocation.getCurrentPosition', arguments); - options = parseParameters(options); - - // Timer var that will fire an error callback if no position is retrieved from native - // before the "timeout" param provided expires - var timeoutTimer = {timer:null}; - - var win = function(p) { - clearTimeout(timeoutTimer.timer); - if (!(timeoutTimer.timer)) { - // Timeout already happened, or native fired error callback for - // this geo request. - // Don't continue with success callback. - return; - } - var pos = new Position( - { - latitude:p.latitude, - longitude:p.longitude, - altitude:p.altitude, - accuracy:p.accuracy, - heading:p.heading, - velocity:p.velocity, - altitudeAccuracy:p.altitudeAccuracy - }, - (p.timestamp === undefined ? new Date() : ((p.timestamp instanceof Date) ? p.timestamp : new Date(p.timestamp))) - ); - geolocation.lastPosition = pos; - successCallback(pos); - }; - var fail = function(e) { - clearTimeout(timeoutTimer.timer); - timeoutTimer.timer = null; - var err = new PositionError(e.code, e.message); - if (errorCallback) { - errorCallback(err); - } - }; - - // Check our cached position, if its timestamp difference with current time is less than the maximumAge, then just - // fire the success callback with the cached position. - if (geolocation.lastPosition && options.maximumAge && (((new Date()).getTime() - geolocation.lastPosition.timestamp.getTime()) <= options.maximumAge)) { - successCallback(geolocation.lastPosition); - // If the cached position check failed and the timeout was set to 0, error out with a TIMEOUT error object. - } else if (options.timeout === 0) { - fail({ - code:PositionError.TIMEOUT, - message:"timeout value in PositionOptions set to 0 and no cached Position object available, or cached Position object's age exceeds provided PositionOptions' maximumAge parameter." - }); - // Otherwise we have to call into native to retrieve a position. - } else { - if (options.timeout !== Infinity) { - // If the timeout value was not set to Infinity (default), then - // set up a timeout function that will fire the error callback - // if no successful position was retrieved before timeout expired. - timeoutTimer.timer = createTimeout(fail, options.timeout); - } else { - // This is here so the check in the win function doesn't mess stuff up - // may seem weird but this guarantees timeoutTimer is - // always truthy before we call into native - timeoutTimer.timer = true; - } - exec(win, fail, "Geolocation", "getLocation", [options.enableHighAccuracy, options.maximumAge]); - } - return timeoutTimer; - }, - /** - * Asynchronously watches the geolocation for changes to geolocation. When a change occurs, - * the successCallback is called with the new location. - * - * @param {Function} successCallback The function to call each time the location data is available - * @param {Function} errorCallback The function to call when there is an error getting the location data. (OPTIONAL) - * @param {PositionOptions} options The options for getting the location data such as frequency. (OPTIONAL) - * @return String The watch id that must be passed to #clearWatch to stop watching. - */ - watchPosition:function(successCallback, errorCallback, options) { - argscheck.checkArgs('fFO', 'geolocation.getCurrentPosition', arguments); - options = parseParameters(options); - - var id = utils.createUUID(); - - // Tell device to get a position ASAP, and also retrieve a reference to the timeout timer generated in getCurrentPosition - timers[id] = geolocation.getCurrentPosition(successCallback, errorCallback, options); - - var fail = function(e) { - clearTimeout(timers[id].timer); - var err = new PositionError(e.code, e.message); - if (errorCallback) { - errorCallback(err); - } - }; - - var win = function(p) { - clearTimeout(timers[id].timer); - if (options.timeout !== Infinity) { - timers[id].timer = createTimeout(fail, options.timeout); - } - var pos = new Position( - { - latitude:p.latitude, - longitude:p.longitude, - altitude:p.altitude, - accuracy:p.accuracy, - heading:p.heading, - velocity:p.velocity, - altitudeAccuracy:p.altitudeAccuracy - }, - (p.timestamp === undefined ? new Date() : ((p.timestamp instanceof Date) ? p.timestamp : new Date(p.timestamp))) - ); - geolocation.lastPosition = pos; - successCallback(pos); - }; - - exec(win, fail, "Geolocation", "addWatch", [id, options.enableHighAccuracy]); - - return id; - }, - /** - * Clears the specified heading watch. - * - * @param {String} id The ID of the watch returned from #watchPosition - */ - clearWatch:function(id) { - if (id && timers[id] !== undefined) { - clearTimeout(timers[id].timer); - timers[id].timer = false; - exec(null, null, "Geolocation", "clearWatch", [id]); - } - } -}; - -module.exports = geolocation; - -}); - -// file: lib/common/plugin/geolocation/symbols.js -define("cordova/plugin/geolocation/symbols", function(require, exports, module) { - - -var modulemapper = require('cordova/modulemapper'); - -modulemapper.defaults('cordova/plugin/geolocation', 'navigator.geolocation'); -modulemapper.clobbers('cordova/plugin/PositionError', 'PositionError'); -modulemapper.clobbers('cordova/plugin/Position', 'Position'); -modulemapper.clobbers('cordova/plugin/Coordinates', 'Coordinates'); - -}); - -// file: lib/common/plugin/globalization.js -define("cordova/plugin/globalization", function(require, exports, module) { - -var argscheck = require('cordova/argscheck'), - exec = require('cordova/exec'), - GlobalizationError = require('cordova/plugin/GlobalizationError'); - -var globalization = { - -/** -* Returns the string identifier for the client's current language. -* It returns the language identifier string to the successCB callback with a -* properties object as a parameter. If there is an error getting the language, -* then the errorCB callback is invoked. -* -* @param {Function} successCB -* @param {Function} errorCB -* -* @return Object.value {String}: The language identifier -* -* @error GlobalizationError.UNKNOWN_ERROR -* -* Example -* globalization.getPreferredLanguage(function (language) {alert('language:' + language.value + '\n');}, -* function () {}); -*/ -getPreferredLanguage:function(successCB, failureCB) { - argscheck.checkArgs('fF', 'Globalization.getPreferredLanguage', arguments); - exec(successCB, failureCB, "Globalization","getPreferredLanguage", []); -}, - -/** -* Returns the string identifier for the client's current locale setting. -* It returns the locale identifier string to the successCB callback with a -* properties object as a parameter. If there is an error getting the locale, -* then the errorCB callback is invoked. -* -* @param {Function} successCB -* @param {Function} errorCB -* -* @return Object.value {String}: The locale identifier -* -* @error GlobalizationError.UNKNOWN_ERROR -* -* Example -* globalization.getLocaleName(function (locale) {alert('locale:' + locale.value + '\n');}, -* function () {}); -*/ -getLocaleName:function(successCB, failureCB) { - argscheck.checkArgs('fF', 'Globalization.getLocaleName', arguments); - exec(successCB, failureCB, "Globalization","getLocaleName", []); -}, - - -/** -* Returns a date formatted as a string according to the client's user preferences and -* calendar using the time zone of the client. It returns the formatted date string to the -* successCB callback with a properties object as a parameter. If there is an error -* formatting the date, then the errorCB callback is invoked. -* -* The defaults are: formatLenght="short" and selector="date and time" -* -* @param {Date} date -* @param {Function} successCB -* @param {Function} errorCB -* @param {Object} options {optional} -* formatLength {String}: 'short', 'medium', 'long', or 'full' -* selector {String}: 'date', 'time', or 'date and time' -* -* @return Object.value {String}: The localized date string -* -* @error GlobalizationError.FORMATTING_ERROR -* -* Example -* globalization.dateToString(new Date(), -* function (date) {alert('date:' + date.value + '\n');}, -* function (errorCode) {alert(errorCode);}, -* {formatLength:'short'}); -*/ -dateToString:function(date, successCB, failureCB, options) { - argscheck.checkArgs('dfFO', 'Globalization.dateToString', arguments); - var dateValue = date.valueOf(); - exec(successCB, failureCB, "Globalization", "dateToString", [{"date": dateValue, "options": options}]); -}, - - -/** -* Parses a date formatted as a string according to the client's user -* preferences and calendar using the time zone of the client and returns -* the corresponding date object. It returns the date to the successCB -* callback with a properties object as a parameter. If there is an error -* parsing the date string, then the errorCB callback is invoked. -* -* The defaults are: formatLength="short" and selector="date and time" -* -* @param {String} dateString -* @param {Function} successCB -* @param {Function} errorCB -* @param {Object} options {optional} -* formatLength {String}: 'short', 'medium', 'long', or 'full' -* selector {String}: 'date', 'time', or 'date and time' -* -* @return Object.year {Number}: The four digit year -* Object.month {Number}: The month from (0 - 11) -* Object.day {Number}: The day from (1 - 31) -* Object.hour {Number}: The hour from (0 - 23) -* Object.minute {Number}: The minute from (0 - 59) -* Object.second {Number}: The second from (0 - 59) -* Object.millisecond {Number}: The milliseconds (from 0 - 999), -* not available on all platforms -* -* @error GlobalizationError.PARSING_ERROR -* -* Example -* globalization.stringToDate('4/11/2011', -* function (date) { alert('Month:' + date.month + '\n' + -* 'Day:' + date.day + '\n' + -* 'Year:' + date.year + '\n');}, -* function (errorCode) {alert(errorCode);}, -* {selector:'date'}); -*/ -stringToDate:function(dateString, successCB, failureCB, options) { - argscheck.checkArgs('sfFO', 'Globalization.stringToDate', arguments); - exec(successCB, failureCB, "Globalization", "stringToDate", [{"dateString": dateString, "options": options}]); -}, - - -/** -* Returns a pattern string for formatting and parsing dates according to the client's -* user preferences. It returns the pattern to the successCB callback with a -* properties object as a parameter. If there is an error obtaining the pattern, -* then the errorCB callback is invoked. -* -* The defaults are: formatLength="short" and selector="date and time" -* -* @param {Function} successCB -* @param {Function} errorCB -* @param {Object} options {optional} -* formatLength {String}: 'short', 'medium', 'long', or 'full' -* selector {String}: 'date', 'time', or 'date and time' -* -* @return Object.pattern {String}: The date and time pattern for formatting and parsing dates. -* The patterns follow Unicode Technical Standard #35 -* http://unicode.org/reports/tr35/tr35-4.html -* Object.timezone {String}: The abbreviated name of the time zone on the client -* Object.utc_offset {Number}: The current difference in seconds between the client's -* time zone and coordinated universal time. -* Object.dst_offset {Number}: The current daylight saving time offset in seconds -* between the client's non-daylight saving's time zone -* and the client's daylight saving's time zone. -* -* @error GlobalizationError.PATTERN_ERROR -* -* Example -* globalization.getDatePattern( -* function (date) {alert('pattern:' + date.pattern + '\n');}, -* function () {}, -* {formatLength:'short'}); -*/ -getDatePattern:function(successCB, failureCB, options) { - argscheck.checkArgs('fFO', 'Globalization.getDatePattern', arguments); - exec(successCB, failureCB, "Globalization", "getDatePattern", [{"options": options}]); -}, - - -/** -* Returns an array of either the names of the months or days of the week -* according to the client's user preferences and calendar. It returns the array of names to the -* successCB callback with a properties object as a parameter. If there is an error obtaining the -* names, then the errorCB callback is invoked. -* -* The defaults are: type="wide" and item="months" -* -* @param {Function} successCB -* @param {Function} errorCB -* @param {Object} options {optional} -* type {String}: 'narrow' or 'wide' -* item {String}: 'months', or 'days' -* -* @return Object.value {Array{String}}: The array of names starting from either -* the first month in the year or the -* first day of the week. -* @error GlobalizationError.UNKNOWN_ERROR -* -* Example -* globalization.getDateNames(function (names) { -* for(var i = 0; i < names.value.length; i++) { -* alert('Month:' + names.value[i] + '\n');}}, -* function () {}); -*/ -getDateNames:function(successCB, failureCB, options) { - argscheck.checkArgs('fFO', 'Globalization.getDateNames', arguments); - exec(successCB, failureCB, "Globalization", "getDateNames", [{"options": options}]); -}, - -/** -* Returns whether daylight savings time is in effect for a given date using the client's -* time zone and calendar. It returns whether or not daylight savings time is in effect -* to the successCB callback with a properties object as a parameter. If there is an error -* reading the date, then the errorCB callback is invoked. -* -* @param {Date} date -* @param {Function} successCB -* @param {Function} errorCB -* -* @return Object.dst {Boolean}: The value "true" indicates that daylight savings time is -* in effect for the given date and "false" indicate that it is not. -* -* @error GlobalizationError.UNKNOWN_ERROR -* -* Example -* globalization.isDayLightSavingsTime(new Date(), -* function (date) {alert('dst:' + date.dst + '\n');} -* function () {}); -*/ -isDayLightSavingsTime:function(date, successCB, failureCB) { - argscheck.checkArgs('dfF', 'Globalization.isDayLightSavingsTime', arguments); - var dateValue = date.valueOf(); - exec(successCB, failureCB, "Globalization", "isDayLightSavingsTime", [{"date": dateValue}]); -}, - -/** -* Returns the first day of the week according to the client's user preferences and calendar. -* The days of the week are numbered starting from 1 where 1 is considered to be Sunday. -* It returns the day to the successCB callback with a properties object as a parameter. -* If there is an error obtaining the pattern, then the errorCB callback is invoked. -* -* @param {Function} successCB -* @param {Function} errorCB -* -* @return Object.value {Number}: The number of the first day of the week. -* -* @error GlobalizationError.UNKNOWN_ERROR -* -* Example -* globalization.getFirstDayOfWeek(function (day) -* { alert('Day:' + day.value + '\n');}, -* function () {}); -*/ -getFirstDayOfWeek:function(successCB, failureCB) { - argscheck.checkArgs('fF', 'Globalization.getFirstDayOfWeek', arguments); - exec(successCB, failureCB, "Globalization", "getFirstDayOfWeek", []); -}, - - -/** -* Returns a number formatted as a string according to the client's user preferences. -* It returns the formatted number string to the successCB callback with a properties object as a -* parameter. If there is an error formatting the number, then the errorCB callback is invoked. -* -* The defaults are: type="decimal" -* -* @param {Number} number -* @param {Function} successCB -* @param {Function} errorCB -* @param {Object} options {optional} -* type {String}: 'decimal', "percent", or 'currency' -* -* @return Object.value {String}: The formatted number string. -* -* @error GlobalizationError.FORMATTING_ERROR -* -* Example -* globalization.numberToString(3.25, -* function (number) {alert('number:' + number.value + '\n');}, -* function () {}, -* {type:'decimal'}); -*/ -numberToString:function(number, successCB, failureCB, options) { - argscheck.checkArgs('nfFO', 'Globalization.numberToString', arguments); - exec(successCB, failureCB, "Globalization", "numberToString", [{"number": number, "options": options}]); -}, - -/** -* Parses a number formatted as a string according to the client's user preferences and -* returns the corresponding number. It returns the number to the successCB callback with a -* properties object as a parameter. If there is an error parsing the number string, then -* the errorCB callback is invoked. -* -* The defaults are: type="decimal" -* -* @param {String} numberString -* @param {Function} successCB -* @param {Function} errorCB -* @param {Object} options {optional} -* type {String}: 'decimal', "percent", or 'currency' -* -* @return Object.value {Number}: The parsed number. -* -* @error GlobalizationError.PARSING_ERROR -* -* Example -* globalization.stringToNumber('1234.56', -* function (number) {alert('Number:' + number.value + '\n');}, -* function () { alert('Error parsing number');}); -*/ -stringToNumber:function(numberString, successCB, failureCB, options) { - argscheck.checkArgs('sfFO', 'Globalization.stringToNumber', arguments); - exec(successCB, failureCB, "Globalization", "stringToNumber", [{"numberString": numberString, "options": options}]); -}, - -/** -* Returns a pattern string for formatting and parsing numbers according to the client's user -* preferences. It returns the pattern to the successCB callback with a properties object as a -* parameter. If there is an error obtaining the pattern, then the errorCB callback is invoked. -* -* The defaults are: type="decimal" -* -* @param {Function} successCB -* @param {Function} errorCB -* @param {Object} options {optional} -* type {String}: 'decimal', "percent", or 'currency' -* -* @return Object.pattern {String}: The number pattern for formatting and parsing numbers. -* The patterns follow Unicode Technical Standard #35. -* http://unicode.org/reports/tr35/tr35-4.html -* Object.symbol {String}: The symbol to be used when formatting and parsing -* e.g., percent or currency symbol. -* Object.fraction {Number}: The number of fractional digits to use when parsing and -* formatting numbers. -* Object.rounding {Number}: The rounding increment to use when parsing and formatting. -* Object.positive {String}: The symbol to use for positive numbers when parsing and formatting. -* Object.negative: {String}: The symbol to use for negative numbers when parsing and formatting. -* Object.decimal: {String}: The decimal symbol to use for parsing and formatting. -* Object.grouping: {String}: The grouping symbol to use for parsing and formatting. -* -* @error GlobalizationError.PATTERN_ERROR -* -* Example -* globalization.getNumberPattern( -* function (pattern) {alert('Pattern:' + pattern.pattern + '\n');}, -* function () {}); -*/ -getNumberPattern:function(successCB, failureCB, options) { - argscheck.checkArgs('fFO', 'Globalization.getNumberPattern', arguments); - exec(successCB, failureCB, "Globalization", "getNumberPattern", [{"options": options}]); -}, - -/** -* Returns a pattern string for formatting and parsing currency values according to the client's -* user preferences and ISO 4217 currency code. It returns the pattern to the successCB callback with a -* properties object as a parameter. If there is an error obtaining the pattern, then the errorCB -* callback is invoked. -* -* @param {String} currencyCode -* @param {Function} successCB -* @param {Function} errorCB -* -* @return Object.pattern {String}: The currency pattern for formatting and parsing currency values. -* The patterns follow Unicode Technical Standard #35 -* http://unicode.org/reports/tr35/tr35-4.html -* Object.code {String}: The ISO 4217 currency code for the pattern. -* Object.fraction {Number}: The number of fractional digits to use when parsing and -* formatting currency. -* Object.rounding {Number}: The rounding increment to use when parsing and formatting. -* Object.decimal: {String}: The decimal symbol to use for parsing and formatting. -* Object.grouping: {String}: The grouping symbol to use for parsing and formatting. -* -* @error GlobalizationError.FORMATTING_ERROR -* -* Example -* globalization.getCurrencyPattern('EUR', -* function (currency) {alert('Pattern:' + currency.pattern + '\n');} -* function () {}); -*/ -getCurrencyPattern:function(currencyCode, successCB, failureCB) { - argscheck.checkArgs('sfF', 'Globalization.getCurrencyPattern', arguments); - exec(successCB, failureCB, "Globalization", "getCurrencyPattern", [{"currencyCode": currencyCode}]); -} - -}; - -module.exports = globalization; - -}); - -// file: lib/common/plugin/globalization/symbols.js -define("cordova/plugin/globalization/symbols", function(require, exports, module) { - - -var modulemapper = require('cordova/modulemapper'); - -modulemapper.clobbers('cordova/plugin/globalization', 'navigator.globalization'); -modulemapper.clobbers('cordova/plugin/GlobalizationError', 'GlobalizationError'); - -}); - -// file: lib/ios/plugin/inappbrowser/symbols.js -define("cordova/plugin/inappbrowser/symbols", function(require, exports, module) { - - -var modulemapper = require('cordova/modulemapper'); - -modulemapper.clobbers('cordova/plugin/InAppBrowser', 'open'); - -}); - -// file: lib/ios/plugin/ios/Contact.js -define("cordova/plugin/ios/Contact", function(require, exports, module) { - -var exec = require('cordova/exec'), - ContactError = require('cordova/plugin/ContactError'); - -/** - * Provides iOS Contact.display API. - */ -module.exports = { - display : function(errorCB, options) { - /* - * Display a contact using the iOS Contact Picker UI - * NOT part of W3C spec so no official documentation - * - * @param errorCB error callback - * @param options object - * allowsEditing: boolean AS STRING - * "true" to allow editing the contact - * "false" (default) display contact - */ - - if (this.id === null) { - if (typeof errorCB === "function") { - var errorObj = new ContactError(ContactError.UNKNOWN_ERROR); - errorCB(errorObj); - } - } - else { - exec(null, errorCB, "Contacts","displayContact", [this.id, options]); - } - } -}; - -}); - -// file: lib/ios/plugin/ios/Entry.js -define("cordova/plugin/ios/Entry", function(require, exports, module) { - -module.exports = { - toURL:function() { - // TODO: refactor path in a cross-platform way so we can eliminate - // these kinds of platform-specific hacks. - return "file://localhost" + this.fullPath; - }, - toURI: function() { - console.log("DEPRECATED: Update your code to use 'toURL'"); - return "file://localhost" + this.fullPath; - } -}; - -}); - -// file: lib/ios/plugin/ios/contacts.js -define("cordova/plugin/ios/contacts", function(require, exports, module) { - -var exec = require('cordova/exec'); - -/** - * Provides iOS enhanced contacts API. - */ -module.exports = { - newContactUI : function(successCallback) { - /* - * Create a contact using the iOS Contact Picker UI - * NOT part of W3C spec so no official documentation - * - * returns: the id of the created contact as param to successCallback - */ - exec(successCallback, null, "Contacts","newContact", []); - }, - chooseContact : function(successCallback, options) { - /* - * Select a contact using the iOS Contact Picker UI - * NOT part of W3C spec so no official documentation - * - * @param errorCB error callback - * @param options object - * allowsEditing: boolean AS STRING - * "true" to allow editing the contact - * "false" (default) display contact - * fields: array of fields to return in contact object (see ContactOptions.fields) - * - * @returns - * id of contact selected - * ContactObject - * if no fields provided contact contains just id information - * if fields provided contact object contains information for the specified fields - * - */ - var win = function(result) { - var fullContact = require('cordova/plugin/contacts').create(result); - successCallback(fullContact.id, fullContact); - }; - exec(win, null, "Contacts","chooseContact", [options]); - } -}; - -}); - -// file: lib/ios/plugin/ios/contacts/symbols.js -define("cordova/plugin/ios/contacts/symbols", function(require, exports, module) { - -require('cordova/plugin/contacts/symbols'); - -var modulemapper = require('cordova/modulemapper'); - -modulemapper.merges('cordova/plugin/ios/contacts', 'navigator.contacts'); -modulemapper.merges('cordova/plugin/ios/Contact', 'Contact'); - -}); - -// file: lib/ios/plugin/ios/geolocation/symbols.js -define("cordova/plugin/ios/geolocation/symbols", function(require, exports, module) { - -var modulemapper = require('cordova/modulemapper'); - -modulemapper.merges('cordova/plugin/geolocation', 'navigator.geolocation'); - -}); - -// file: lib/ios/plugin/ios/logger/plugininit.js -define("cordova/plugin/ios/logger/plugininit", function(require, exports, module) { - -// use the native logger -var logger = require("cordova/plugin/logger"); -logger.useConsole(true); - -}); - -// file: lib/ios/plugin/ios/logger/symbols.js -define("cordova/plugin/ios/logger/symbols", function(require, exports, module) { - - -var modulemapper = require('cordova/modulemapper'); - -modulemapper.clobbers('cordova/plugin/logger', 'console'); - -}); - -// file: lib/ios/plugin/ios/notification.js -define("cordova/plugin/ios/notification", function(require, exports, module) { - -var Media = require('cordova/plugin/Media'); - -module.exports = { - beep:function(count) { - (new Media('beep.wav')).play(); - } -}; - -}); - -// file: lib/common/plugin/logger.js -define("cordova/plugin/logger", function(require, exports, module) { - -//------------------------------------------------------------------------------ -// The logger module exports the following properties/functions: -// -// LOG - constant for the level LOG -// ERROR - constant for the level ERROR -// WARN - constant for the level WARN -// INFO - constant for the level INFO -// DEBUG - constant for the level DEBUG -// logLevel() - returns current log level -// logLevel(value) - sets and returns a new log level -// useConsole() - returns whether logger is using console -// useConsole(value) - sets and returns whether logger is using console -// log(message,...) - logs a message at level LOG -// error(message,...) - logs a message at level ERROR -// warn(message,...) - logs a message at level WARN -// info(message,...) - logs a message at level INFO -// debug(message,...) - logs a message at level DEBUG -// logLevel(level,message,...) - logs a message specified level -// -//------------------------------------------------------------------------------ - -var logger = exports; - -var exec = require('cordova/exec'); -var utils = require('cordova/utils'); - -var UseConsole = true; -var UseLogger = true; -var Queued = []; -var DeviceReady = false; -var CurrentLevel; - -var originalConsole = console; - -/** - * Logging levels - */ - -var Levels = [ - "LOG", - "ERROR", - "WARN", - "INFO", - "DEBUG" -]; - -/* - * add the logging levels to the logger object and - * to a separate levelsMap object for testing - */ - -var LevelsMap = {}; -for (var i=0; i CurrentLevel) return; - - // queue the message if not yet at deviceready - if (!DeviceReady && !UseConsole) { - Queued.push([level, message]); - return; - } - - // Log using the native logger if that is enabled - if (UseLogger) { - exec(null, null, "Logger", "logLevel", [level, message]); - } - - // Log using the console if that is enabled - if (UseConsole) { - // make sure console is not using logger - if (console.__usingCordovaLogger) { - throw new Error("console and logger are too intertwingly"); - } - - // log to the console - switch (level) { - case logger.LOG: originalConsole.log(message); break; - case logger.ERROR: originalConsole.log("ERROR: " + message); break; - case logger.WARN: originalConsole.log("WARN: " + message); break; - case logger.INFO: originalConsole.log("INFO: " + message); break; - case logger.DEBUG: originalConsole.log("DEBUG: " + message); break; - } - } -}; - - -/** - * Formats a string and arguments following it ala console.log() - * - * Any remaining arguments will be appended to the formatted string. - * - * for rationale, see FireBug's Console API: - * http://getfirebug.com/wiki/index.php/Console_API - */ -logger.format = function(formatString, args) { - return __format(arguments[0], [].slice.call(arguments,1)).join(' '); -}; - - -//------------------------------------------------------------------------------ -/** - * Formats a string and arguments following it ala vsprintf() - * - * format chars: - * %j - format arg as JSON - * %o - format arg as JSON - * %c - format arg as '' - * %% - replace with '%' - * any other char following % will format it's - * arg via toString(). - * - * Returns an array containing the formatted string and any remaining - * arguments. - */ -function __format(formatString, args) { - if (formatString === null || formatString === undefined) return [""]; - if (arguments.length == 1) return [formatString.toString()]; - - if (typeof formatString != "string") - formatString = formatString.toString(); - - var pattern = /(.*?)%(.)(.*)/; - var rest = formatString; - var result = []; - - while (args.length) { - var match = pattern.exec(rest); - if (!match) break; - - var arg = args.shift(); - rest = match[3]; - result.push(match[1]); - - if (match[2] == '%') { - result.push('%'); - args.unshift(arg); - continue; - } - - result.push(__formatted(arg, match[2])); - } - - result.push(rest); - - var remainingArgs = [].slice.call(args); - remainingArgs.unshift(result.join('')); - return remainingArgs; -} - -function __formatted(object, formatChar) { - - try { - switch(formatChar) { - case 'j': - case 'o': return JSON.stringify(object); - case 'c': return ''; - } - } - catch (e) { - return "error JSON.stringify()ing argument: " + e; - } - - if ((object === null) || (object === undefined)) { - return Object.prototype.toString.call(object); - } - - return object.toString(); -} - - -//------------------------------------------------------------------------------ -// when deviceready fires, log queued messages -logger.__onDeviceReady = function() { - if (DeviceReady) return; - - DeviceReady = true; - - for (var i=0; i 3) { - fail(FileError.SYNTAX_ERR); - } else { - // if successful, return a FileSystem object - var success = function(file_system) { - if (file_system) { - if (successCallback) { - // grab the name and root from the file system object - var result = new FileSystem(file_system.name, file_system.root); - successCallback(result); - } - } - else { - // no FileSystem object returned - fail(FileError.NOT_FOUND_ERR); - } - }; - exec(success, fail, "File", "requestFileSystem", [type, size]); - } -}; - -module.exports = requestFileSystem; - -}); - -// file: lib/common/plugin/resolveLocalFileSystemURI.js -define("cordova/plugin/resolveLocalFileSystemURI", function(require, exports, module) { - -var argscheck = require('cordova/argscheck'), - DirectoryEntry = require('cordova/plugin/DirectoryEntry'), - FileEntry = require('cordova/plugin/FileEntry'), - FileError = require('cordova/plugin/FileError'), - exec = require('cordova/exec'); - -/** - * Look up file system Entry referred to by local URI. - * @param {DOMString} uri URI referring to a local file or directory - * @param successCallback invoked with Entry object corresponding to URI - * @param errorCallback invoked if error occurs retrieving file system entry - */ -module.exports = function(uri, successCallback, errorCallback) { - argscheck.checkArgs('sFF', 'resolveLocalFileSystemURI', arguments); - // error callback - var fail = function(error) { - errorCallback && errorCallback(new FileError(error)); - }; - // sanity check for 'not:valid:filename' - if(!uri || uri.split(":").length > 2) { - setTimeout( function() { - fail(FileError.ENCODING_ERR); - },0); - return; - } - // if successful, return either a file or directory entry - var success = function(entry) { - var result; - if (entry) { - if (successCallback) { - // create appropriate Entry object - result = (entry.isDirectory) ? new DirectoryEntry(entry.name, entry.fullPath) : new FileEntry(entry.name, entry.fullPath); - successCallback(result); - } - } - else { - // no Entry object returned - fail(FileError.NOT_FOUND_ERR); - } - }; - - exec(success, fail, "File", "resolveLocalFileSystemURI", [uri]); -}; - -}); - -// file: lib/common/plugin/splashscreen.js -define("cordova/plugin/splashscreen", function(require, exports, module) { - -var exec = require('cordova/exec'); - -var splashscreen = { - show:function() { - exec(null, null, "SplashScreen", "show", []); - }, - hide:function() { - exec(null, null, "SplashScreen", "hide", []); - } -}; - -module.exports = splashscreen; - -}); - -// file: lib/common/plugin/splashscreen/symbols.js -define("cordova/plugin/splashscreen/symbols", function(require, exports, module) { - - -var modulemapper = require('cordova/modulemapper'); - -modulemapper.clobbers('cordova/plugin/splashscreen', 'navigator.splashscreen'); - -}); - -// file: lib/common/symbols.js -define("cordova/symbols", function(require, exports, module) { - -var modulemapper = require('cordova/modulemapper'); - -// Use merges here in case others symbols files depend on this running first, -// but fail to declare the dependency with a require(). -modulemapper.merges('cordova', 'cordova'); -modulemapper.clobbers('cordova/exec', 'cordova.exec'); -modulemapper.clobbers('cordova/exec', 'Cordova.exec'); - -}); - -// file: lib/common/utils.js -define("cordova/utils", function(require, exports, module) { - -var utils = exports; - -/** - * Defines a property getter / setter for obj[key]. - */ -utils.defineGetterSetter = function(obj, key, getFunc, opt_setFunc) { - if (Object.defineProperty) { - var desc = { - get: getFunc, - configurable: true - }; - if (opt_setFunc) { - desc.set = opt_setFunc; - } - Object.defineProperty(obj, key, desc); - } else { - obj.__defineGetter__(key, getFunc); - if (opt_setFunc) { - obj.__defineSetter__(key, opt_setFunc); - } - } -}; - -/** - * Defines a property getter for obj[key]. - */ -utils.defineGetter = utils.defineGetterSetter; - -utils.arrayIndexOf = function(a, item) { - if (a.indexOf) { - return a.indexOf(item); - } - var len = a.length; - for (var i = 0; i < len; ++i) { - if (a[i] == item) { - return i; - } - } - return -1; -}; - -/** - * Returns whether the item was found in the array. - */ -utils.arrayRemove = function(a, item) { - var index = utils.arrayIndexOf(a, item); - if (index != -1) { - a.splice(index, 1); - } - return index != -1; -}; - -utils.typeName = function(val) { - return Object.prototype.toString.call(val).slice(8, -1); -}; - -/** - * Returns an indication of whether the argument is an array or not - */ -utils.isArray = function(a) { - return utils.typeName(a) == 'Array'; -}; - -/** - * Returns an indication of whether the argument is a Date or not - */ -utils.isDate = function(d) { - return utils.typeName(d) == 'Date'; -}; - -/** - * Does a deep clone of the object. - */ -utils.clone = function(obj) { - if(!obj || typeof obj == 'function' || utils.isDate(obj) || typeof obj != 'object') { - return obj; - } - - var retVal, i; - - if(utils.isArray(obj)){ - retVal = []; - for(i = 0; i < obj.length; ++i){ - retVal.push(utils.clone(obj[i])); - } - return retVal; - } - - retVal = {}; - for(i in obj){ - if(!(i in retVal) || retVal[i] != obj[i]) { - retVal[i] = utils.clone(obj[i]); - } - } - return retVal; -}; - -/** - * Returns a wrapped version of the function - */ -utils.close = function(context, func, params) { - if (typeof params == 'undefined') { - return function() { - return func.apply(context, arguments); - }; - } else { - return function() { - return func.apply(context, params); - }; - } -}; - -/** - * Create a UUID - */ -utils.createUUID = function() { - return UUIDcreatePart(4) + '-' + - UUIDcreatePart(2) + '-' + - UUIDcreatePart(2) + '-' + - UUIDcreatePart(2) + '-' + - UUIDcreatePart(6); -}; - -/** - * Extends a child object from a parent object using classical inheritance - * pattern. - */ -utils.extend = (function() { - // proxy used to establish prototype chain - var F = function() {}; - // extend Child from Parent - return function(Child, Parent) { - F.prototype = Parent.prototype; - Child.prototype = new F(); - Child.__super__ = Parent.prototype; - Child.prototype.constructor = Child; - }; -}()); - -/** - * Alerts a message in any available way: alert or console.log. - */ -utils.alert = function(msg) { - if (window.alert) { - window.alert(msg); - } else if (console && console.log) { - console.log(msg); - } -}; - - -//------------------------------------------------------------------------------ -function UUIDcreatePart(length) { - var uuidpart = ""; - for (var i=0; i tag. - function injectScript(path) { - scriptCounter++; - var script = document.createElement("script"); - script.onload = scriptLoadedCallback; - script.onerror = scriptErrorCallback; - script.src = path; - document.head.appendChild(script); - } - - // Called when: - // * There are plugins defined and all plugins are finished loading. - // * There are no plugins to load. - function finishPluginLoading() { - context.cordova.require('cordova/channel').onPluginsReady.fire(); - } - - // Handler for the cordova_plugins.js content. - // See plugman's plugin_loader.js for the details of this object. - // This function is only called if the really is a plugins array that isn't empty. - // Otherwise the onerror response handler will just call finishPluginLoading(). - function handlePluginsObject(modules, path) { - // First create the callback for when all plugins are loaded. - var mapper = context.cordova.require('cordova/modulemapper'); - onScriptLoadingComplete = function() { - // Loop through all the plugins and then through their clobbers and merges. - for (var i = 0; i < modules.length; i++) { - var module = modules[i]; - if (module) { - try { - if (module.clobbers && module.clobbers.length) { - for (var j = 0; j < module.clobbers.length; j++) { - mapper.clobbers(module.id, module.clobbers[j]); - } - } - - if (module.merges && module.merges.length) { - for (var k = 0; k < module.merges.length; k++) { - mapper.merges(module.id, module.merges[k]); - } - } - - // Finally, if runs is truthy we want to simply require() the module. - // This can be skipped if it had any merges or clobbers, though, - // since the mapper will already have required the module. - if (module.runs && !(module.clobbers && module.clobbers.length) && !(module.merges && module.merges.length)) { - context.cordova.require(module.id); - } - } - catch(err) { - // error with module, most likely clobbers, should we continue? - } - } - } - - finishPluginLoading(); - }; - - // Now inject the scripts. - for (var i = 0; i < modules.length; i++) { - injectScript(path + modules[i].file); - } - } - - // Find the root of the app - var path = ''; - var scripts = document.getElementsByTagName('script'); - var term = 'cordova.js'; - for (var n = scripts.length-1; n>-1; n--) { - var src = scripts[n].src; - if (src.indexOf(term) == (src.length - term.length)) { - path = src.substring(0, src.length - term.length); - break; - } - } - - var plugins_json = path + 'cordova_plugins.json'; - var plugins_js = path + 'cordova_plugins.js'; - - // One some phones (Windows) this xhr.open throws an Access Denied exception - // So lets keep trying, but with a script tag injection technique instead of XHR - var injectPluginScript = function injectPluginScript() { - try { - var script = document.createElement("script"); - script.onload = function(){ - var list = cordova.require("cordova/plugin_list"); - handlePluginsObject(list,path); - }; - script.onerror = function() { - // Error loading cordova_plugins.js, file not found or something - // this is an acceptable error, pre-3.0.0, so we just move on. - finishPluginLoading(); - }; - script.src = plugins_js; - document.head.appendChild(script); - - } catch(err){ - finishPluginLoading(); - } - } - - - // Try to XHR the cordova_plugins.json file asynchronously. - var xhr = new XMLHttpRequest(); - xhr.onload = function() { - // If the response is a JSON string which composes an array, call handlePluginsObject. - // If the request fails, or the response is not a JSON array, just call finishPluginLoading. - var obj; - try { - obj = (this.status == 0 || this.status == 200) && this.responseText && JSON.parse(this.responseText); - } catch (err) { - // obj will be undefined. - } - if (Array.isArray(obj) && obj.length > 0) { - handlePluginsObject(obj, path); - } else { - finishPluginLoading(); - } - }; - xhr.onerror = function() { - // In this case, the json file was not present, but XHR was allowed, - // so we should still try the script injection technique with the js file - // in case that is there. - injectPluginScript(); - }; - try { // we commented we were going to try, so let us actually try and catch - xhr.open('GET', plugins_json, true); // Async - xhr.send(); - } catch(err){ - injectPluginScript(); - } -}(window)); - - -})(); \ No newline at end of file diff --git a/www/css/GeorgeCustom.min.css b/www/css/GeorgeCustom.min.css deleted file mode 100755 index 93a55db..0000000 --- a/www/css/GeorgeCustom.min.css +++ /dev/null @@ -1,11 +0,0 @@ -/* -* jQuery Mobile Git Build: SHA1: 9130927464f2d3e0300a9fb36ebfd69448cf3675 <> Date: Wed Feb 20 11:08:42 2013 -0800 -* http://jquerymobile.com -* -* Copyright 2010, 2013 jQuery Foundation, Inc. and other contributors -* Released under the MIT license. -* http://jquery.org/license -* -*/ - -.ui-bar-a{border:1px solid #333333 ;background:#111111 ;color:#ffffff ;font-weight:bold;text-shadow:0 -1px 0 #000000 ;background-image:-webkit-gradient(linear,left top,left bottom,from( #3c3c3c ),to( #111111 )); background-image:-webkit-linear-gradient( #3c3c3c,#111111 ); background-image: -moz-linear-gradient( #3c3c3c,#111111 ); background-image: -ms-linear-gradient( #3c3c3c,#111111 ); background-image: -o-linear-gradient( #3c3c3c,#111111 ); background-image: linear-gradient( #3c3c3c,#111111 );}.ui-bar-a .ui-link-inherit{color:#ffffff ;}.ui-bar-a a.ui-link{color:#7cc4e7 ;font-weight:bold;}.ui-bar-a a.ui-link:visited{ color:#2489ce ;}.ui-bar-a a.ui-link:hover{color:#2489ce ;}.ui-bar-a a.ui-link:active{color:#2489ce ;}.ui-bar-a,.ui-bar-a input,.ui-bar-a select,.ui-bar-a textarea,.ui-bar-a button{ font-family:Helvetica,Arial,sans-serif ;}.ui-body-a,.ui-overlay-a{border:1px solid #444444 ;color:#ffffff ;text-shadow:0 1px 0 #111111 ;background:#222222 ;background-image:-webkit-gradient(linear,left top,left bottom,from( #444444 ),to( #222222 )); background-image:-webkit-linear-gradient( #444444,#222222 ); background-image: -moz-linear-gradient( #444444,#222222 ); background-image: -ms-linear-gradient( #444444,#222222 ); background-image: -o-linear-gradient( #444444,#222222 ); background-image: linear-gradient( #444444,#222222 );}.ui-overlay-a{background-image:none;border-width:0;}.ui-body-a,.ui-body-a input,.ui-body-a select,.ui-body-a textarea,.ui-body-a button{ font-family:Helvetica,Arial,sans-serif ;}.ui-body-a .ui-link-inherit{color:#ffffff ;}.ui-body-a .ui-link{color:#2489ce ;font-weight:bold;}.ui-body-a .ui-link:visited{ color:#2489ce ;}.ui-body-a .ui-link:hover{color:#2489ce ;}.ui-body-a .ui-link:active{color:#2489ce ;}.ui-btn-up-a{border:1px solid #111111 ;background:#333333 ;font-weight:bold;color:#ffffff ;text-shadow:0 1px 0 #111111 ;background-image:-webkit-gradient(linear,left top,left bottom,from( #444444 ),to( #2d2d2d )); background-image:-webkit-linear-gradient( #444444,#2d2d2d ); background-image: -moz-linear-gradient( #444444,#2d2d2d ); background-image: -ms-linear-gradient( #444444,#2d2d2d ); background-image: -o-linear-gradient( #444444,#2d2d2d ); background-image: linear-gradient( #444444,#2d2d2d );}.ui-btn-up-a:visited,.ui-btn-up-a a.ui-link-inherit{color:#ffffff ;}.ui-btn-hover-a{border:1px solid #000000 ;background:#444444 ;font-weight:bold;color:#ffffff ;text-shadow:0 1px 0 #111111 ;background-image:-webkit-gradient(linear,left top,left bottom,from( #555555 ),to( #383838 )); background-image:-webkit-linear-gradient( #555555,#383838 ); background-image: -moz-linear-gradient( #555555,#383838 ); background-image: -ms-linear-gradient( #555555,#383838 ); background-image: -o-linear-gradient( #555555,#383838 ); background-image: linear-gradient( #555555,#383838 );}.ui-btn-hover-a:visited,.ui-btn-hover-a:hover,.ui-btn-hover-a a.ui-link-inherit{color:#ffffff ;}.ui-btn-down-a{border:1px solid #000000 ;background:#222222 ;font-weight:bold;color:#ffffff ;text-shadow:0 1px 0 #111111 ;background-image:-webkit-gradient(linear,left top,left bottom,from( #202020 ),to( #2c2c2c )); background-image:-webkit-linear-gradient( #202020,#2c2c2c ); background-image: -moz-linear-gradient( #202020,#2c2c2c ); background-image: -ms-linear-gradient( #202020,#2c2c2c ); background-image: -o-linear-gradient( #202020,#2c2c2c ); background-image: linear-gradient( #202020,#2c2c2c );}.ui-btn-down-a:visited,.ui-btn-down-a:hover,.ui-btn-down-a a.ui-link-inherit{color:#ffffff ;}.ui-btn-up-a,.ui-btn-hover-a,.ui-btn-down-a{ font-family:Helvetica,Arial,sans-serif ;text-decoration:none;}.ui-bar-b{border:1px solid #456f9a ;background:#5e87b0 ;color:#ffffff ;font-weight:bold;text-shadow:0 1px 0 #3e6790 ;background-image:-webkit-gradient(linear,left top,left bottom,from( #6facd5 ),to( #497bae )); background-image:-webkit-linear-gradient( #6facd5,#497bae ); background-image: -moz-linear-gradient( #6facd5,#497bae ); background-image: -ms-linear-gradient( #6facd5,#497bae ); background-image: -o-linear-gradient( #6facd5,#497bae ); background-image: linear-gradient( #6facd5,#497bae );}.ui-bar-b .ui-link-inherit{color:#ffffff ;}.ui-bar-b a.ui-link{color:#ddf0f8 ;font-weight:bold;}.ui-bar-b a.ui-link:visited{ color:#ddf0f8 ;}.ui-bar-b a.ui-link:hover{color:#ddf0f8 ;}.ui-bar-b a.ui-link:active{color:#ddf0f8 ;}.ui-bar-b,.ui-bar-b input,.ui-bar-b select,.ui-bar-b textarea,.ui-bar-b button{ font-family:Helvetica,Arial,sans-serif ;}.ui-body-b,.ui-overlay-b{border:1px solid #999999 ;color:#333333 ;text-shadow:0 1px 0 #ffffff ;background:#f3f3f3 ;background-image:-webkit-gradient(linear,left top,left bottom,from( #dddddd ),to( #cccccc )); background-image:-webkit-linear-gradient( #dddddd,#cccccc ); background-image: -moz-linear-gradient( #dddddd,#cccccc ); background-image: -ms-linear-gradient( #dddddd,#cccccc ); background-image: -o-linear-gradient( #dddddd,#cccccc ); background-image: linear-gradient( #dddddd,#cccccc );}.ui-overlay-b{background-image:none;border-width:0;}.ui-body-b,.ui-body-b input,.ui-body-b select,.ui-body-b textarea,.ui-body-b button{ font-family:Helvetica,Arial,sans-serif ;}.ui-body-b .ui-link-inherit{color:#333333 ;}.ui-body-b .ui-link{color:#2489ce ;font-weight:bold;}.ui-body-b .ui-link:visited{ color:#2489ce ;}.ui-body-b .ui-link:hover{color:#2489ce ;}.ui-body-b .ui-link:active{color:#2489ce ;}.ui-btn-up-b{border:1px solid #044062 ;background:#396b9e ;font-weight:bold;color:#ffffff ;text-shadow:0 1px 0 #194b7e ;background-image:-webkit-gradient(linear,left top,left bottom,from( #5f9cc5 ),to( #396b9e )); background-image:-webkit-linear-gradient( #5f9cc5,#396b9e ); background-image: -moz-linear-gradient( #5f9cc5,#396b9e ); background-image: -ms-linear-gradient( #5f9cc5,#396b9e ); background-image: -o-linear-gradient( #5f9cc5,#396b9e ); background-image: linear-gradient( #5f9cc5,#396b9e );}.ui-btn-up-b:visited,.ui-btn-up-b a.ui-link-inherit{color:#ffffff ;}.ui-btn-hover-b{border:1px solid #00415e ;background:#4b88b6 ;font-weight:bold;color:#ffffff ;text-shadow:0 1px 0 #194b7e ;background-image:-webkit-gradient(linear,left top,left bottom,from( #6facd5 ),to( #4272a4 )); background-image:-webkit-linear-gradient( #6facd5,#4272a4 ); background-image: -moz-linear-gradient( #6facd5,#4272a4 ); background-image: -ms-linear-gradient( #6facd5,#4272a4 ); background-image: -o-linear-gradient( #6facd5,#4272a4 ); background-image: linear-gradient( #6facd5,#4272a4 );}.ui-btn-hover-b:visited,.ui-btn-hover-b:hover,.ui-btn-hover-b a.ui-link-inherit{color:#ffffff ;}.ui-btn-down-b{border:1px solid #225377 ;background:#4e89c5 ;font-weight:bold;color:#ffffff ;text-shadow:0 1px 0 #194b7e ;background-image:-webkit-gradient(linear,left top,left bottom,from( #295b8e ),to( #3e79b5 )); background-image:-webkit-linear-gradient( #295b8e,#3e79b5 ); background-image: -moz-linear-gradient( #295b8e,#3e79b5 ); background-image: -ms-linear-gradient( #295b8e,#3e79b5 ); background-image: -o-linear-gradient( #295b8e,#3e79b5 ); background-image: linear-gradient( #295b8e,#3e79b5 );}.ui-btn-down-b:visited,.ui-btn-down-b:hover,.ui-btn-down-b a.ui-link-inherit{color:#ffffff ;}.ui-btn-up-b,.ui-btn-hover-b,.ui-btn-down-b{ font-family:Helvetica,Arial,sans-serif ;text-decoration:none;}.ui-bar-c{border:1px solid #b3b3b3 ;background:#eeeeee ;color:#3e3e3e ;font-weight:bold;text-shadow:0 1px 0 #ffffff ;background-image:-webkit-gradient(linear,left top,left bottom,from( #f0f0f0 ),to( #dddddd )); background-image:-webkit-linear-gradient( #f0f0f0,#dddddd ); background-image: -moz-linear-gradient( #f0f0f0,#dddddd ); background-image: -ms-linear-gradient( #f0f0f0,#dddddd ); background-image: -o-linear-gradient( #f0f0f0,#dddddd ); background-image: linear-gradient( #f0f0f0,#dddddd );}.ui-bar-c .ui-link-inherit{color:#3e3e3e ;}.ui-bar-c a.ui-link{color:#7cc4e7 ;font-weight:bold;}.ui-bar-c a.ui-link:visited{ color:#2489ce ;}.ui-bar-c a.ui-link:hover{color:#2489ce ;}.ui-bar-c a.ui-link:active{color:#2489ce ;}.ui-bar-c,.ui-bar-c input,.ui-bar-c select,.ui-bar-c textarea,.ui-bar-c button{ font-family:Helvetica,Arial,sans-serif ;}.ui-body-c,.ui-overlay-c{border:1px solid #aaaaaa ;color:#333333 ;text-shadow:0 1px 0 #ffffff ;background:#f9f9f9 ;background-image:-webkit-gradient(linear,left top,left bottom,from( #f9f9f9 ),to( #eeeeee )); background-image:-webkit-linear-gradient( #f9f9f9,#eeeeee ); background-image: -moz-linear-gradient( #f9f9f9,#eeeeee ); background-image: -ms-linear-gradient( #f9f9f9,#eeeeee ); background-image: -o-linear-gradient( #f9f9f9,#eeeeee ); background-image: linear-gradient( #f9f9f9,#eeeeee );}.ui-overlay-c{background-image:none;border-width:0;}.ui-body-c,.ui-body-c input,.ui-body-c select,.ui-body-c textarea,.ui-body-c button{ font-family:Helvetica,Arial,sans-serif ;}.ui-body-c .ui-link-inherit{color:#333333 ;}.ui-body-c .ui-link{color:#2489ce ;font-weight:bold;}.ui-body-c .ui-link:visited{ color:#2489ce ;}.ui-body-c .ui-link:hover{color:#2489ce ;}.ui-body-c .ui-link:active{color:#2489ce ;}.ui-btn-up-c{border:1px solid #cccccc ;background:#eeeeee ;font-weight:bold;color:#2f3e46 ;text-shadow:0 1px 0 #ffffff ;background-image:-webkit-gradient(linear,left top,left bottom,from( #ffffff ),to( #f1f1f1 )); background-image:-webkit-linear-gradient( #ffffff,#f1f1f1 ); background-image: -moz-linear-gradient( #ffffff,#f1f1f1 ); background-image: -ms-linear-gradient( #ffffff,#f1f1f1 ); background-image: -o-linear-gradient( #ffffff,#f1f1f1 ); background-image: linear-gradient( #ffffff,#f1f1f1 );}.ui-btn-up-c:visited,.ui-btn-up-c a.ui-link-inherit{color:#2f3e46 ;}.ui-btn-hover-c{border:1px solid #bbbbbb ;background:#dfdfdf ;font-weight:bold;color:#2f3e46 ;text-shadow:0 1px 0 #ffffff ;background-image:-webkit-gradient(linear,left top,left bottom,from( #f6f6f6 ),to( #e0e0e0 )); background-image:-webkit-linear-gradient( #f6f6f6,#e0e0e0 ); background-image: -moz-linear-gradient( #f6f6f6,#e0e0e0 ); background-image: -ms-linear-gradient( #f6f6f6,#e0e0e0 ); background-image: -o-linear-gradient( #f6f6f6,#e0e0e0 ); background-image: linear-gradient( #f6f6f6,#e0e0e0 );}.ui-btn-hover-c:visited,.ui-btn-hover-c:hover,.ui-btn-hover-c a.ui-link-inherit{color:#2f3e46 ;}.ui-btn-down-c{border:1px solid #bbbbbb ;background:#d6d6d6 ;font-weight:bold;color:#2f3e46 ;text-shadow:0 1px 0 #ffffff ;background-image:-webkit-gradient(linear,left top,left bottom,from( #d0d0d0 ),to( #dfdfdf )); background-image:-webkit-linear-gradient( #d0d0d0,#dfdfdf ); background-image: -moz-linear-gradient( #d0d0d0,#dfdfdf ); background-image: -ms-linear-gradient( #d0d0d0,#dfdfdf ); background-image: -o-linear-gradient( #d0d0d0,#dfdfdf ); background-image: linear-gradient( #d0d0d0,#dfdfdf );}.ui-btn-down-c:visited,.ui-btn-down-c:hover,.ui-btn-down-c a.ui-link-inherit{color:#2f3e46 ;}.ui-btn-up-c,.ui-btn-hover-c,.ui-btn-down-c{ font-family:Helvetica,Arial,sans-serif ;text-decoration:none;}.ui-bar-d{border:1px solid #bbbbbb ;background:#bbbbbb ;color:#333333 ;font-weight:bold;text-shadow:0 1px 0 #eeeeee ;background-image:-webkit-gradient(linear,left top,left bottom,from( #dddddd ),to( #bbbbbb )); background-image:-webkit-linear-gradient( #dddddd,#bbbbbb ); background-image: -moz-linear-gradient( #dddddd,#bbbbbb ); background-image: -ms-linear-gradient( #dddddd,#bbbbbb ); background-image: -o-linear-gradient( #dddddd,#bbbbbb ); background-image: linear-gradient( #dddddd,#bbbbbb );}.ui-bar-d .ui-link-inherit{color:#333333 ;}.ui-bar-d a.ui-link{color:#2489ce ;font-weight:bold;}.ui-bar-d a.ui-link:visited{ color:#2489ce ;}.ui-bar-d a.ui-link:hover{color:#2489ce ;}.ui-bar-d a.ui-link:active{color:#2489ce ;}.ui-bar-d,.ui-bar-d input,.ui-bar-d select,.ui-bar-d textarea,.ui-bar-d button{ font-family:Helvetica,Arial,sans-serif ;}.ui-body-d,.ui-overlay-d{border:1px solid #bbbbbb ;color:#333333 ;text-shadow:0 1px 0 #ffffff ;background:#ffffff ;background-image:-webkit-gradient(linear,left top,left bottom,from( #ffffff ),to( #ffffff )); background-image:-webkit-linear-gradient( #ffffff,#ffffff ); background-image: -moz-linear-gradient( #ffffff,#ffffff ); background-image: -ms-linear-gradient( #ffffff,#ffffff ); background-image: -o-linear-gradient( #ffffff,#ffffff ); background-image: linear-gradient( #ffffff,#ffffff );}.ui-overlay-d{background-image:none;border-width:0;}.ui-body-d,.ui-body-d input,.ui-body-d select,.ui-body-d textarea,.ui-body-d button{ font-family:Helvetica,Arial,sans-serif ;}.ui-body-d .ui-link-inherit{color:#333333 ;}.ui-body-d .ui-link{color:#2489ce ;font-weight:bold;}.ui-body-d .ui-link:visited{ color:#2489ce ;}.ui-body-d .ui-link:hover{color:#2489ce ;}.ui-body-d .ui-link:active{color:#2489ce ;}.ui-btn-up-d{border:1px solid #bbbbbb ;background:#ffffff ;font-weight:bold;color:#333333 ;text-shadow:0 1px 0 #ffffff ;background-image:-webkit-gradient(linear,left top,left bottom,from( #fafafa ),to( #f6f6f6 )); background-image:-webkit-linear-gradient( #fafafa,#f6f6f6 ); background-image: -moz-linear-gradient( #fafafa,#f6f6f6 ); background-image: -ms-linear-gradient( #fafafa,#f6f6f6 ); background-image: -o-linear-gradient( #fafafa,#f6f6f6 ); background-image: linear-gradient( #fafafa,#f6f6f6 );}.ui-btn-up-d:visited,.ui-btn-up-d a.ui-link-inherit{color:#333333 ;}.ui-btn-hover-d{border:1px solid #aaaaaa ;background:#eeeeee ;font-weight:bold;color:#333333 ;text-shadow:0 1px 0 #ffffff ;background-image:-webkit-gradient(linear,left top,left bottom,from( #eeeeee ),to( #ffffff )); background-image:-webkit-linear-gradient( #eeeeee,#ffffff ); background-image: -moz-linear-gradient( #eeeeee,#ffffff ); background-image: -ms-linear-gradient( #eeeeee,#ffffff ); background-image: -o-linear-gradient( #eeeeee,#ffffff ); background-image: linear-gradient( #eeeeee,#ffffff );}.ui-btn-hover-d:visited,.ui-btn-hover-d:hover,.ui-btn-hover-d a.ui-link-inherit{color:#333333 ;}.ui-btn-down-d{border:1px solid #aaaaaa ;background:#eeeeee ;font-weight:bold;color:#333333 ;text-shadow:0 1px 0 #ffffff ;background-image:-webkit-gradient(linear,left top,left bottom,from( #e5e5e5 ),to( #f2f2f2 )); background-image:-webkit-linear-gradient( #e5e5e5,#f2f2f2 ); background-image: -moz-linear-gradient( #e5e5e5,#f2f2f2 ); background-image: -ms-linear-gradient( #e5e5e5,#f2f2f2 ); background-image: -o-linear-gradient( #e5e5e5,#f2f2f2 ); background-image: linear-gradient( #e5e5e5,#f2f2f2 );}.ui-btn-down-d:visited,.ui-btn-down-d:hover,.ui-btn-down-d a.ui-link-inherit{color:#333333 ;}.ui-btn-up-d,.ui-btn-hover-d,.ui-btn-down-d{ font-family:Helvetica,Arial,sans-serif ;text-decoration:none;}.ui-bar-e{border:1px solid #f7c942 ;background:#fadb4e ;color:#333333 ;font-weight:bold;text-shadow:0 1px 0 #ffffff ;background-image:-webkit-gradient(linear,left top,left bottom,from( #fceda7 ),to( #fbef7e )); background-image:-webkit-linear-gradient( #fceda7,#fbef7e ); background-image: -moz-linear-gradient( #fceda7,#fbef7e ); background-image: -ms-linear-gradient( #fceda7,#fbef7e ); background-image: -o-linear-gradient( #fceda7,#fbef7e ); background-image: linear-gradient( #fceda7,#fbef7e );}.ui-bar-e .ui-link-inherit{color:#333333 ;}.ui-bar-e a.ui-link{color:#2489ce ;font-weight:bold;}.ui-bar-e a.ui-link:visited{ color:#2489ce ;}.ui-bar-e a.ui-link:hover{color:#2489ce ;}.ui-bar-e a.ui-link:active{color:#2489ce ;}.ui-bar-e,.ui-bar-e input,.ui-bar-e select,.ui-bar-e textarea,.ui-bar-e button{ font-family:Helvetica,Arial,sans-serif ;}.ui-body-e,.ui-overlay-e{border:1px solid #f7c942 ;color:#222222 ;text-shadow:0 1px 0 #ffffff ;background:#fff9df ;background-image:-webkit-gradient(linear,left top,left bottom,from( #fffadf ),to( #fff3a5 )); background-image:-webkit-linear-gradient( #fffadf,#fff3a5 ); background-image: -moz-linear-gradient( #fffadf,#fff3a5 ); background-image: -ms-linear-gradient( #fffadf,#fff3a5 ); background-image: -o-linear-gradient( #fffadf,#fff3a5 ); background-image: linear-gradient( #fffadf,#fff3a5 );}.ui-overlay-e{background-image:none;border-width:0;}.ui-body-e,.ui-body-e input,.ui-body-e select,.ui-body-e textarea,.ui-body-e button{ font-family:Helvetica,Arial,sans-serif ;}.ui-body-e .ui-link-inherit{color:#222222 ;}.ui-body-e .ui-link{color:#2489ce ;font-weight:bold;}.ui-body-e .ui-link:visited{ color:#2489ce ;}.ui-body-e .ui-link:hover{color:#2489ce ;}.ui-body-e .ui-link:active{color:#2489ce ;}.ui-btn-up-e{border:1px solid #f4c63f ;background:#fadb4e ;font-weight:bold;color:#222222 ;text-shadow:0 1px 0 #ffffff ;background-image:-webkit-gradient(linear,left top,left bottom,from( #ffefaa ),to( #ffe155 )); background-image:-webkit-linear-gradient( #ffefaa,#ffe155 ); background-image: -moz-linear-gradient( #ffefaa,#ffe155 ); background-image: -ms-linear-gradient( #ffefaa,#ffe155 ); background-image: -o-linear-gradient( #ffefaa,#ffe155 ); background-image: linear-gradient( #ffefaa,#ffe155 );}.ui-btn-up-e:visited,.ui-btn-up-e a.ui-link-inherit{color:#222222 ;}.ui-btn-hover-e{border:1px solid #f2c43d ;background:#fbe26f ;font-weight:bold;color:#333333 ;text-shadow:0 1px 0 #ffffff ;background-image:-webkit-gradient(linear,left top,left bottom,from( #fff5ba ),to( #fbdd52 )); background-image:-webkit-linear-gradient( #fff5ba,#fbdd52 ); background-image: -moz-linear-gradient( #fff5ba,#fbdd52 ); background-image: -ms-linear-gradient( #fff5ba,#fbdd52 ); background-image: -o-linear-gradient( #fff5ba,#fbdd52 ); background-image: linear-gradient( #fff5ba,#fbdd52 );}.ui-btn-hover-e:visited,.ui-btn-hover-e:hover,.ui-btn-hover-e a.ui-link-inherit{color:#333333 ;}.ui-btn-down-e{border:1px solid #f2c43d ;background:#fceda7 ;font-weight:bold;color:#333333 ;text-shadow:0 1px 0 #ffffff ;background-image:-webkit-gradient(linear,left top,left bottom,from( #f8d94c ),to( #fadb4e )); background-image:-webkit-linear-gradient( #f8d94c,#fadb4e ); background-image: -moz-linear-gradient( #f8d94c,#fadb4e ); background-image: -ms-linear-gradient( #f8d94c,#fadb4e ); background-image: -o-linear-gradient( #f8d94c,#fadb4e ); background-image: linear-gradient( #f8d94c,#fadb4e );}.ui-btn-down-e:visited,.ui-btn-down-e:hover,.ui-btn-down-e a.ui-link-inherit{color:#333333 ;}.ui-btn-up-e,.ui-btn-hover-e,.ui-btn-down-e{ font-family:Helvetica,Arial,sans-serif ;text-decoration:none;}.ui-bar-f{border:1px solid #a6d36a ;background:#a6d36a ;color:#000000 ;font-weight:bold;text-shadow:0 1px 0 #eeeeee ;background-image:-webkit-gradient(linear,left top,left bottom,from( #b6e874 ),to( #95bd5f )); background-image:-webkit-linear-gradient( #b6e874,#95bd5f ); background-image: -moz-linear-gradient( #b6e874,#95bd5f ); background-image: -ms-linear-gradient( #b6e874,#95bd5f ); background-image: -o-linear-gradient( #b6e874,#95bd5f ); background-image: linear-gradient( #b6e874,#95bd5f );}.ui-bar-f .ui-link-inherit{color:#000000 ;}.ui-bar-f a.ui-link{color:#7cc4e7 ;font-weight:bold;}.ui-bar-f a.ui-link:visited{ color:#2489ce ;}.ui-bar-f a.ui-link:hover{color:#2489ce ;}.ui-bar-f a.ui-link:active{color:#2489ce ;}.ui-bar-f,.ui-bar-f input,.ui-bar-f select,.ui-bar-f textarea,.ui-bar-f button{ font-family:Helvetica,Arial,sans-serif ;}.ui-body-f,.ui-overlay-f{border:1px solid #7c8b69 ;color:#000000 ;text-shadow:0 1px 0 #eeeeee ;background:#e2fdbf ;background-image:-webkit-gradient(linear,left top,left bottom,from( #f8FFd2 ),to( #cbe3ab )); background-image:-webkit-linear-gradient( #f8FFd2,#cbe3ab ); background-image: -moz-linear-gradient( #f8FFd2,#cbe3ab ); background-image: -ms-linear-gradient( #f8FFd2,#cbe3ab ); background-image: -o-linear-gradient( #f8FFd2,#cbe3ab ); background-image: linear-gradient( #f8FFd2,#cbe3ab );}.ui-overlay-f{background-image:none;border-width:0;}.ui-body-f,.ui-body-f input,.ui-body-f select,.ui-body-f textarea,.ui-body-f button{ font-family:Helvetica,Arial,sans-serif ;}.ui-body-f .ui-link-inherit{color:#000000 ;}.ui-body-f .ui-link{color:#2489ce ;font-weight:bold;}.ui-body-f .ui-link:visited{ color:#2489ce ;}.ui-body-f .ui-link:hover{color:#2489ce ;}.ui-body-f .ui-link:active{color:#2489ce ;}.ui-btn-up-f{border:1px solid #b1e46d ;background:#b1e46d ;font-weight:bold;color:#000000 ;text-shadow:0 1px 0 #eeeeee ;background-image:-webkit-gradient(linear,left top,left bottom,from( #c2fa77 ),to( #9fcd62 )); background-image:-webkit-linear-gradient( #c2fa77,#9fcd62 ); background-image: -moz-linear-gradient( #c2fa77,#9fcd62 ); background-image: -ms-linear-gradient( #c2fa77,#9fcd62 ); background-image: -o-linear-gradient( #c2fa77,#9fcd62 ); background-image: linear-gradient( #c2fa77,#9fcd62 );}.ui-btn-up-f:visited,.ui-btn-up-f a.ui-link-inherit{color:#000000 ;}.ui-btn-hover-f{border:1px solid #cbFF7d ;background:#cbFF7d ;font-weight:bold;color:#000000 ;text-shadow:0 1px 0 #eeeeee ;background-image:-webkit-gradient(linear,left top,left bottom,from( #dfFF89 ),to( #b6e570 )); background-image:-webkit-linear-gradient( #dfFF89,#b6e570 ); background-image: -moz-linear-gradient( #dfFF89,#b6e570 ); background-image: -ms-linear-gradient( #dfFF89,#b6e570 ); background-image: -o-linear-gradient( #dfFF89,#b6e570 ); background-image: linear-gradient( #dfFF89,#b6e570 );}.ui-btn-hover-f:visited,.ui-btn-hover-f:hover,.ui-btn-hover-f a.ui-link-inherit{color:#000000 ;}.ui-btn-down-f{border:1px solid #cbFF7d ;background:#cbFF7d ;font-weight:bold;color:#000000 ;text-shadow:0 1px 0 #eeeeee ;background-image:-webkit-gradient(linear,left top,left bottom,from( #b6e570 ),to( #dfFF89 )); background-image:-webkit-linear-gradient( #b6e570,#dfFF89 ); background-image: -moz-linear-gradient( #b6e570,#dfFF89 ); background-image: -ms-linear-gradient( #b6e570,#dfFF89 ); background-image: -o-linear-gradient( #b6e570,#dfFF89 ); background-image: linear-gradient( #b6e570,#dfFF89 );}.ui-btn-down-f:visited,.ui-btn-down-f:hover,.ui-btn-down-f a.ui-link-inherit{color:#000000 ;}.ui-btn-up-f,.ui-btn-hover-f,.ui-btn-down-f{ font-family:Helvetica,Arial,sans-serif ;text-decoration:none;}.ui-bar-g{border:1px solid #cc8945 ;background:#cc8945 ;color:#ffffff ;font-weight:bold;text-shadow:0 1px 0 #444444 ;background-image:-webkit-gradient(linear,left top,left bottom,from( #e0964b ),to( #b77b3e )); background-image:-webkit-linear-gradient( #e0964b,#b77b3e ); background-image: -moz-linear-gradient( #e0964b,#b77b3e ); background-image: -ms-linear-gradient( #e0964b,#b77b3e ); background-image: -o-linear-gradient( #e0964b,#b77b3e ); background-image: linear-gradient( #e0964b,#b77b3e );}.ui-bar-g .ui-link-inherit{color:#ffffff ;}.ui-bar-g a.ui-link{color:#7cc4e7 ;font-weight:bold;}.ui-bar-g a.ui-link:visited{ color:#2489ce ;}.ui-bar-g a.ui-link:hover{color:#2489ce ;}.ui-bar-g a.ui-link:active{color:#2489ce ;}.ui-bar-g,.ui-bar-g input,.ui-bar-g select,.ui-bar-g textarea,.ui-bar-g button{ font-family:Helvetica,Arial,sans-serif ;}.ui-body-g,.ui-overlay-g{border:1px solid #7f766b ;color:#000000 ;text-shadow:0 1px 0 #eeeeee ;background:#e8d8c4 ;background-image:-webkit-gradient(linear,left top,left bottom,from( #FFedd7 ),to( #d0c2b0 )); background-image:-webkit-linear-gradient( #FFedd7,#d0c2b0 ); background-image: -moz-linear-gradient( #FFedd7,#d0c2b0 ); background-image: -ms-linear-gradient( #FFedd7,#d0c2b0 ); background-image: -o-linear-gradient( #FFedd7,#d0c2b0 ); background-image: linear-gradient( #FFedd7,#d0c2b0 );}.ui-overlay-g{background-image:none;border-width:0;}.ui-body-g,.ui-body-g input,.ui-body-g select,.ui-body-g textarea,.ui-body-g button{ font-family:Helvetica,Arial,sans-serif ;}.ui-body-g .ui-link-inherit{color:#000000 ;}.ui-body-g .ui-link{color:#2489ce ;font-weight:bold;}.ui-body-g .ui-link:visited{ color:#2489ce ;}.ui-body-g .ui-link:hover{color:#2489ce ;}.ui-body-g .ui-link:active{color:#2489ce ;}.ui-btn-up-g{border:1px solid #ad876a ;background:#ad876a ;font-weight:bold;color:#ffffff ;text-shadow:0 1px 0 #444444 ;background-image:-webkit-gradient(linear,left top,left bottom,from( #be9474 ),to( #9b795f )); background-image:-webkit-linear-gradient( #be9474,#9b795f ); background-image: -moz-linear-gradient( #be9474,#9b795f ); background-image: -ms-linear-gradient( #be9474,#9b795f ); background-image: -o-linear-gradient( #be9474,#9b795f ); background-image: linear-gradient( #be9474,#9b795f );}.ui-btn-up-g:visited,.ui-btn-up-g a.ui-link-inherit{color:#ffffff ;}.ui-btn-hover-g{border:1px solid #c69b79 ;background:#c69b79 ;font-weight:bold;color:#ffffff ;text-shadow:0 1px 0 #444444 ;background-image:-webkit-gradient(linear,left top,left bottom,from( #d9aa85 ),to( #b28b6c )); background-image:-webkit-linear-gradient( #d9aa85,#b28b6c ); background-image: -moz-linear-gradient( #d9aa85,#b28b6c ); background-image: -ms-linear-gradient( #d9aa85,#b28b6c ); background-image: -o-linear-gradient( #d9aa85,#b28b6c ); background-image: linear-gradient( #d9aa85,#b28b6c );}.ui-btn-hover-g:visited,.ui-btn-hover-g:hover,.ui-btn-hover-g a.ui-link-inherit{color:#ffffff ;}.ui-btn-down-g{border:1px solid #c69b79 ;background:#c69b79 ;font-weight:bold;color:#000000 ;text-shadow:0 1px 0 #eeeeee ;background-image:-webkit-gradient(linear,left top,left bottom,from( #b28b6c ),to( #d9aa85 )); background-image:-webkit-linear-gradient( #b28b6c,#d9aa85 ); background-image: -moz-linear-gradient( #b28b6c,#d9aa85 ); background-image: -ms-linear-gradient( #b28b6c,#d9aa85 ); background-image: -o-linear-gradient( #b28b6c,#d9aa85 ); background-image: linear-gradient( #b28b6c,#d9aa85 );}.ui-btn-down-g:visited,.ui-btn-down-g:hover,.ui-btn-down-g a.ui-link-inherit{color:#000000 ;}.ui-btn-up-g,.ui-btn-hover-g,.ui-btn-down-g{ font-family:Helvetica,Arial,sans-serif ;text-decoration:none;}.ui-bar-h{border:1px solid #ff575c ;background:#ff575c ;color:#ffffff ;font-weight:bold;text-shadow:0 1px 0 #444444 ;background-image:-webkit-gradient(linear,left top,left bottom,from( #FF5f65 ),to( #e54e52 )); background-image:-webkit-linear-gradient( #FF5f65,#e54e52 ); background-image: -moz-linear-gradient( #FF5f65,#e54e52 ); background-image: -ms-linear-gradient( #FF5f65,#e54e52 ); background-image: -o-linear-gradient( #FF5f65,#e54e52 ); background-image: linear-gradient( #FF5f65,#e54e52 );}.ui-bar-h .ui-link-inherit{color:#ffffff ;}.ui-bar-h a.ui-link{color:#7cc4e7 ;font-weight:bold;}.ui-bar-h a.ui-link:visited{ color:#2489ce ;}.ui-bar-h a.ui-link:hover{color:#2489ce ;}.ui-bar-h a.ui-link:active{color:#2489ce ;}.ui-bar-h,.ui-bar-h input,.ui-bar-h select,.ui-bar-h textarea,.ui-bar-h button{ font-family:Helvetica,Arial,sans-serif ;}.ui-body-h,.ui-overlay-h{border:1px solid #8a7b7c ;color:#000000 ;text-shadow:0 1px 0 #eeeeee ;background:#fce1e2 ;background-image:-webkit-gradient(linear,left top,left bottom,from( #FFf7f8 ),to( #e2cacb )); background-image:-webkit-linear-gradient( #FFf7f8,#e2cacb ); background-image: -moz-linear-gradient( #FFf7f8,#e2cacb ); background-image: -ms-linear-gradient( #FFf7f8,#e2cacb ); background-image: -o-linear-gradient( #FFf7f8,#e2cacb ); background-image: linear-gradient( #FFf7f8,#e2cacb );}.ui-overlay-h{background-image:none;border-width:0;}.ui-body-h,.ui-body-h input,.ui-body-h select,.ui-body-h textarea,.ui-body-h button{ font-family:Helvetica,Arial,sans-serif ;}.ui-body-h .ui-link-inherit{color:#000000 ;}.ui-body-h .ui-link{color:#2489ce ;font-weight:bold;}.ui-body-h .ui-link:visited{ color:#2489ce ;}.ui-body-h .ui-link:hover{color:#2489ce ;}.ui-body-h .ui-link:active{color:#2489ce ;}.ui-btn-up-h{border:1px solid #ec484e ;background:#ec484e ;font-weight:bold;color:#ffffff ;text-shadow:0 1px 0 #444444 ;background-image:-webkit-gradient(linear,left top,left bottom,from( #FF4f55 ),to( #d44046 )); background-image:-webkit-linear-gradient( #FF4f55,#d44046 ); background-image: -moz-linear-gradient( #FF4f55,#d44046 ); background-image: -ms-linear-gradient( #FF4f55,#d44046 ); background-image: -o-linear-gradient( #FF4f55,#d44046 ); background-image: linear-gradient( #FF4f55,#d44046 );}.ui-btn-up-h:visited,.ui-btn-up-h a.ui-link-inherit{color:#ffffff ;}.ui-btn-hover-h{border:1px solid #FF5259 ;background:#FF5259 ;font-weight:bold;color:#ffffff ;text-shadow:0 1px 0 #444444 ;background-image:-webkit-gradient(linear,left top,left bottom,from( #FF5a61 ),to( #e54950 )); background-image:-webkit-linear-gradient( #FF5a61,#e54950 ); background-image: -moz-linear-gradient( #FF5a61,#e54950 ); background-image: -ms-linear-gradient( #FF5a61,#e54950 ); background-image: -o-linear-gradient( #FF5a61,#e54950 ); background-image: linear-gradient( #FF5a61,#e54950 );}.ui-btn-hover-h:visited,.ui-btn-hover-h:hover,.ui-btn-hover-h a.ui-link-inherit{color:#ffffff ;}.ui-btn-down-h{border:1px solid #FF5259 ;background:#FF5259 ;font-weight:bold;color:#ffffff ;text-shadow:0 1px 0 #444444 ;background-image:-webkit-gradient(linear,left top,left bottom,from( #e54950 ),to( #FF5a61 )); background-image:-webkit-linear-gradient( #e54950,#FF5a61 ); background-image: -moz-linear-gradient( #e54950,#FF5a61 ); background-image: -ms-linear-gradient( #e54950,#FF5a61 ); background-image: -o-linear-gradient( #e54950,#FF5a61 ); background-image: linear-gradient( #e54950,#FF5a61 );}.ui-btn-down-h:visited,.ui-btn-down-h:hover,.ui-btn-down-h a.ui-link-inherit{color:#ffffff ;}.ui-btn-up-h,.ui-btn-hover-h,.ui-btn-down-h{ font-family:Helvetica,Arial,sans-serif ;text-decoration:none;}.ui-bar-i{border:1px solid #621f95 ;background:#621f95 ;color:#ffffff ;font-weight:bold;text-shadow:0 1px 0 #444444 ;background-image:-webkit-gradient(linear,left top,left bottom,from( #6b22a3 ),to( #581b86 )); background-image:-webkit-linear-gradient( #6b22a3,#581b86 ); background-image: -moz-linear-gradient( #6b22a3,#581b86 ); background-image: -ms-linear-gradient( #6b22a3,#581b86 ); background-image: -o-linear-gradient( #6b22a3,#581b86 ); background-image: linear-gradient( #6b22a3,#581b86 );}.ui-bar-i .ui-link-inherit{color:#ffffff ;}.ui-bar-i a.ui-link{color:#7cc4e7 ;font-weight:bold;}.ui-bar-i a.ui-link:visited{ color:#2489ce ;}.ui-bar-i a.ui-link:hover{color:#2489ce ;}.ui-bar-i a.ui-link:active{color:#2489ce ;}.ui-bar-i,.ui-bar-i input,.ui-bar-i select,.ui-bar-i textarea,.ui-bar-i button{ font-family:Helvetica,Arial,sans-serif ;}.ui-body-i,.ui-overlay-i{border:1px solid #aaaaaa ;color:#333333 ;text-shadow:0 1px 0 #ffffff ;background:#f9f9f9 ;background-image:-webkit-gradient(linear,left top,left bottom,from( #f9f9f9 ),to( #eeeeee )); background-image:-webkit-linear-gradient( #f9f9f9,#eeeeee ); background-image: -moz-linear-gradient( #f9f9f9,#eeeeee ); background-image: -ms-linear-gradient( #f9f9f9,#eeeeee ); background-image: -o-linear-gradient( #f9f9f9,#eeeeee ); background-image: linear-gradient( #f9f9f9,#eeeeee );}.ui-overlay-i{background-image:none;border-width:0;}.ui-body-i,.ui-body-i input,.ui-body-i select,.ui-body-i textarea,.ui-body-i button{ font-family:Helvetica,Arial,sans-serif ;}.ui-body-i .ui-link-inherit{color:#333333 ;}.ui-body-i .ui-link{color:#2489ce ;font-weight:bold;}.ui-body-i .ui-link:visited{ color:#2489ce ;}.ui-body-i .ui-link:hover{color:#2489ce ;}.ui-body-i .ui-link:active{color:#2489ce ;}.ui-btn-up-i{border:1px solid #8e31d4 ;background:#8e31d4 ;font-weight:bold;color:#ffffff ;text-shadow:0 1px 0 #444444 ;background-image:-webkit-gradient(linear,left top,left bottom,from( #9c35e9 ),to( #7f2cbe )); background-image:-webkit-linear-gradient( #9c35e9,#7f2cbe ); background-image: -moz-linear-gradient( #9c35e9,#7f2cbe ); background-image: -ms-linear-gradient( #9c35e9,#7f2cbe ); background-image: -o-linear-gradient( #9c35e9,#7f2cbe ); background-image: linear-gradient( #9c35e9,#7f2cbe );}.ui-btn-up-i:visited,.ui-btn-up-i a.ui-link-inherit{color:#ffffff ;}.ui-btn-hover-i{border:1px solid #a338f3 ;background:#a338f3 ;font-weight:bold;color:#ffffff ;text-shadow:0 1px 0 #444444 ;background-image:-webkit-gradient(linear,left top,left bottom,from( #b33dFF ),to( #9232da )); background-image:-webkit-linear-gradient( #b33dFF,#9232da ); background-image: -moz-linear-gradient( #b33dFF,#9232da ); background-image: -ms-linear-gradient( #b33dFF,#9232da ); background-image: -o-linear-gradient( #b33dFF,#9232da ); background-image: linear-gradient( #b33dFF,#9232da );}.ui-btn-hover-i:visited,.ui-btn-hover-i:hover,.ui-btn-hover-i a.ui-link-inherit{color:#ffffff ;}.ui-btn-down-i{border:1px solid #a338f3 ;background:#a338f3 ;font-weight:bold;color:#000000 ;text-shadow:0 1px 0 #eeeeee ;background-image:-webkit-gradient(linear,left top,left bottom,from( #9232da ),to( #b33dFF )); background-image:-webkit-linear-gradient( #9232da,#b33dFF ); background-image: -moz-linear-gradient( #9232da,#b33dFF ); background-image: -ms-linear-gradient( #9232da,#b33dFF ); background-image: -o-linear-gradient( #9232da,#b33dFF ); background-image: linear-gradient( #9232da,#b33dFF );}.ui-btn-down-i:visited,.ui-btn-down-i:hover,.ui-btn-down-i a.ui-link-inherit{color:#000000 ;}.ui-btn-up-i,.ui-btn-hover-i,.ui-btn-down-i{ font-family:Helvetica,Arial,sans-serif ;text-decoration:none;}.ui-bar-j{border:1px solid #29c9ff ;background:#29c9ff ;color:#000000 ;font-weight:bold;text-shadow:0 1px 0 #eeeeee ;background-image:-webkit-gradient(linear,left top,left bottom,from( #2dddFF ),to( #24b4e5 )); background-image:-webkit-linear-gradient( #2dddFF,#24b4e5 ); background-image: -moz-linear-gradient( #2dddFF,#24b4e5 ); background-image: -ms-linear-gradient( #2dddFF,#24b4e5 ); background-image: -o-linear-gradient( #2dddFF,#24b4e5 ); background-image: linear-gradient( #2dddFF,#24b4e5 );}.ui-bar-j .ui-link-inherit{color:#000000 ;}.ui-bar-j a.ui-link{color:#7cc4e7 ;font-weight:bold;}.ui-bar-j a.ui-link:visited{ color:#2489ce ;}.ui-bar-j a.ui-link:hover{color:#2489ce ;}.ui-bar-j a.ui-link:active{color:#2489ce ;}.ui-bar-j,.ui-bar-j input,.ui-bar-j select,.ui-bar-j textarea,.ui-bar-j button{ font-family:Helvetica,Arial,sans-serif ;}.ui-body-j,.ui-overlay-j{border:1px solid #678686 ;color:#000000 ;text-shadow:0 1px 0 #eeeeee ;background:#bdf5f5 ;background-image:-webkit-gradient(linear,left top,left bottom,from( #cfFFFF ),to( #aadcdc )); background-image:-webkit-linear-gradient( #cfFFFF,#aadcdc ); background-image: -moz-linear-gradient( #cfFFFF,#aadcdc ); background-image: -ms-linear-gradient( #cfFFFF,#aadcdc ); background-image: -o-linear-gradient( #cfFFFF,#aadcdc ); background-image: linear-gradient( #cfFFFF,#aadcdc );}.ui-overlay-j{background-image:none;border-width:0;}.ui-body-j,.ui-body-j input,.ui-body-j select,.ui-body-j textarea,.ui-body-j button{ font-family:Helvetica,Arial,sans-serif ;}.ui-body-j .ui-link-inherit{color:#000000 ;}.ui-body-j .ui-link{color:#2489ce ;font-weight:bold;}.ui-body-j .ui-link:visited{ color:#2489ce ;}.ui-body-j .ui-link:hover{color:#2489ce ;}.ui-body-j .ui-link:active{color:#2489ce ;}.ui-btn-up-j{border:1px solid #006bb2 ;background:#006bb2 ;font-weight:bold;color:#ffffff ;text-shadow:0 1px 0 #444444 ;background-image:-webkit-gradient(linear,left top,left bottom,from( #0075c3 ),to( #0060a0 )); background-image:-webkit-linear-gradient( #0075c3,#0060a0 ); background-image: -moz-linear-gradient( #0075c3,#0060a0 ); background-image: -ms-linear-gradient( #0075c3,#0060a0 ); background-image: -o-linear-gradient( #0075c3,#0060a0 ); background-image: linear-gradient( #0075c3,#0060a0 );}.ui-btn-up-j:visited,.ui-btn-up-j a.ui-link-inherit{color:#ffffff ;}.ui-btn-hover-j{border:1px solid #457bcc ;background:#457bcc ;font-weight:bold;color:#ffffff ;text-shadow:0 1px 0 #444444 ;background-image:-webkit-gradient(linear,left top,left bottom,from( #4b87e0 ),to( #3e6eb7 )); background-image:-webkit-linear-gradient( #4b87e0,#3e6eb7 ); background-image: -moz-linear-gradient( #4b87e0,#3e6eb7 ); background-image: -ms-linear-gradient( #4b87e0,#3e6eb7 ); background-image: -o-linear-gradient( #4b87e0,#3e6eb7 ); background-image: linear-gradient( #4b87e0,#3e6eb7 );}.ui-btn-hover-j:visited,.ui-btn-hover-j:hover,.ui-btn-hover-j a.ui-link-inherit{color:#ffffff ;}.ui-btn-down-j{border:1px solid #457bcc ;background:#457bcc ;font-weight:bold;color:#ffffff ;text-shadow:0 1px 0 #444444 ;background-image:-webkit-gradient(linear,left top,left bottom,from( #3e6eb7 ),to( #4b87e0 )); background-image:-webkit-linear-gradient( #3e6eb7,#4b87e0 ); background-image: -moz-linear-gradient( #3e6eb7,#4b87e0 ); background-image: -ms-linear-gradient( #3e6eb7,#4b87e0 ); background-image: -o-linear-gradient( #3e6eb7,#4b87e0 ); background-image: linear-gradient( #3e6eb7,#4b87e0 );}.ui-btn-down-j:visited,.ui-btn-down-j:hover,.ui-btn-down-j a.ui-link-inherit{color:#ffffff ;}.ui-btn-up-j,.ui-btn-hover-j,.ui-btn-down-j{ font-family:Helvetica,Arial,sans-serif ;text-decoration:none;}.ui-bar-k{border:1px solid #ffa135 ;background:#ffa135 ;color:#000000 ;font-weight:bold;text-shadow:0 1px 0 #eeeeee ;background-image:-webkit-gradient(linear,left top,left bottom,from( #FFb13a ),to( #e5902f )); background-image:-webkit-linear-gradient( #FFb13a,#e5902f ); background-image: -moz-linear-gradient( #FFb13a,#e5902f ); background-image: -ms-linear-gradient( #FFb13a,#e5902f ); background-image: -o-linear-gradient( #FFb13a,#e5902f ); background-image: linear-gradient( #FFb13a,#e5902f );}.ui-bar-k .ui-link-inherit{color:#000000 ;}.ui-bar-k a.ui-link{color:#7cc4e7 ;font-weight:bold;}.ui-bar-k a.ui-link:visited{ color:#2489ce ;}.ui-bar-k a.ui-link:hover{color:#2489ce ;}.ui-bar-k a.ui-link:active{color:#2489ce ;}.ui-bar-k,.ui-bar-k input,.ui-bar-k select,.ui-bar-k textarea,.ui-bar-k button{ font-family:Helvetica,Arial,sans-serif ;}.ui-body-k,.ui-overlay-k{border:1px solid #8c7a65 ;color:#000000 ;text-shadow:0 1px 0 #eeeeee ;background:#ffdeb9 ;background-image:-webkit-gradient(linear,left top,left bottom,from( #FFf4cb ),to( #e5c7a6 )); background-image:-webkit-linear-gradient( #FFf4cb,#e5c7a6 ); background-image: -moz-linear-gradient( #FFf4cb,#e5c7a6 ); background-image: -ms-linear-gradient( #FFf4cb,#e5c7a6 ); background-image: -o-linear-gradient( #FFf4cb,#e5c7a6 ); background-image: linear-gradient( #FFf4cb,#e5c7a6 );}.ui-overlay-k{background-image:none;border-width:0;}.ui-body-k,.ui-body-k input,.ui-body-k select,.ui-body-k textarea,.ui-body-k button{ font-family:Helvetica,Arial,sans-serif ;}.ui-body-k .ui-link-inherit{color:#000000 ;}.ui-body-k .ui-link{color:#2489ce ;font-weight:bold;}.ui-body-k .ui-link:visited{ color:#2489ce ;}.ui-body-k .ui-link:hover{color:#2489ce ;}.ui-body-k .ui-link:active{color:#2489ce ;}.ui-btn-up-k{border:1px solid #ffd452 ;background:#ffd452 ;font-weight:bold;color:#000000 ;text-shadow:0 1px 0 #eeeeee ;background-image:-webkit-gradient(linear,left top,left bottom,from( #FFe95a ),to( #e5be49 )); background-image:-webkit-linear-gradient( #FFe95a,#e5be49 ); background-image: -moz-linear-gradient( #FFe95a,#e5be49 ); background-image: -ms-linear-gradient( #FFe95a,#e5be49 ); background-image: -o-linear-gradient( #FFe95a,#e5be49 ); background-image: linear-gradient( #FFe95a,#e5be49 );}.ui-btn-up-k:visited,.ui-btn-up-k a.ui-link-inherit{color:#000000 ;}.ui-btn-hover-k{border:1px solid #FFf35e ;background:#FFf35e ;font-weight:bold;color:#000000 ;text-shadow:0 1px 0 #eeeeee ;background-image:-webkit-gradient(linear,left top,left bottom,from( #FFFF67 ),to( #e5da54 )); background-image:-webkit-linear-gradient( #FFFF67,#e5da54 ); background-image: -moz-linear-gradient( #FFFF67,#e5da54 ); background-image: -ms-linear-gradient( #FFFF67,#e5da54 ); background-image: -o-linear-gradient( #FFFF67,#e5da54 ); background-image: linear-gradient( #FFFF67,#e5da54 );}.ui-btn-hover-k:visited,.ui-btn-hover-k:hover,.ui-btn-hover-k a.ui-link-inherit{color:#000000 ;}.ui-btn-down-k{border:1px solid #FFf35e ;background:#FFf35e ;font-weight:bold;color:#000000 ;text-shadow:0 1px 0 #eeeeee ;background-image:-webkit-gradient(linear,left top,left bottom,from( #e5da54 ),to( #FFFF67 )); background-image:-webkit-linear-gradient( #e5da54,#FFFF67 ); background-image: -moz-linear-gradient( #e5da54,#FFFF67 ); background-image: -ms-linear-gradient( #e5da54,#FFFF67 ); background-image: -o-linear-gradient( #e5da54,#FFFF67 ); background-image: linear-gradient( #e5da54,#FFFF67 );}.ui-btn-down-k:visited,.ui-btn-down-k:hover,.ui-btn-down-k a.ui-link-inherit{color:#000000 ;}.ui-btn-up-k,.ui-btn-hover-k,.ui-btn-down-k{ font-family:Helvetica,Arial,sans-serif ;text-decoration:none;}.ui-bar-l{border:1px solid #59891b ;background:#59891b ;color:#ffffff ;font-weight:bold;text-shadow:0 1px 0 #444444 ;background-image:-webkit-gradient(linear,left top,left bottom,from( #61961d ),to( #507b18 )); background-image:-webkit-linear-gradient( #61961d,#507b18 ); background-image: -moz-linear-gradient( #61961d,#507b18 ); background-image: -ms-linear-gradient( #61961d,#507b18 ); background-image: -o-linear-gradient( #61961d,#507b18 ); background-image: linear-gradient( #61961d,#507b18 );}.ui-bar-l .ui-link-inherit{color:#ffffff ;}.ui-bar-l a.ui-link{color:#7cc4e7 ;font-weight:bold;}.ui-bar-l a.ui-link:visited{ color:#2489ce ;}.ui-bar-l a.ui-link:hover{color:#2489ce ;}.ui-bar-l a.ui-link:active{color:#2489ce ;}.ui-bar-l,.ui-bar-l input,.ui-bar-l select,.ui-bar-l textarea,.ui-bar-l button{font-family:Helvetica,Arial,sans-serif ;}.ui-body-l,.ui-overlay-l{border:1px solid #82877b ;color:#000000 ;text-shadow:0 1px 0 #eeeeee ;background:#edf6e0 ;background-image:-webkit-gradient(linear,left top,left bottom,from( #FFFFf6 ),to( #d5ddc9 )); background-image:-webkit-linear-gradient( #FFFFf6,#d5ddc9 ); background-image: -moz-linear-gradient( #FFFFf6,#d5ddc9 ); background-image: -ms-linear-gradient( #FFFFf6,#d5ddc9 ); background-image: -o-linear-gradient( #FFFFf6,#d5ddc9 ); background-image: linear-gradient( #FFFFf6,#d5ddc9 );}.ui-overlay-l{background-image:none;border-width:0;}.ui-body-l,.ui-body-l input,.ui-body-l select,.ui-body-l textarea,.ui-body-l button{font-family:Helvetica,Arial,sans-serif ;}.ui-body-l .ui-link-inherit{color:#000000 ;}.ui-body-l .ui-link{color:#2489ce ;font-weight:bold;}.ui-body-l .ui-link:visited{ color:#2489ce ;}.ui-body-l .ui-link:hover{color:#2489ce ;}.ui-body-l .ui-link:active{color:#2489ce ;}.ui-btn-up-l{border:1px solid #004b23 ;background:#004b23 ;font-weight:bold;color:#ffffff ;text-shadow:0 1px 0 #444444 ;background-image:-webkit-gradient(linear,left top,left bottom,from( #005226 ),to( #00431f )); background-image:-webkit-linear-gradient( #005226,#00431f ); background-image: -moz-linear-gradient( #005226,#00431f ); background-image: -ms-linear-gradient( #005226,#00431f ); background-image: -o-linear-gradient( #005226,#00431f ); background-image: linear-gradient( #005226,#00431f );}.ui-btn-up-l:visited,.ui-btn-up-l a.ui-link-inherit{color:#ffffff ;}.ui-btn-hover-l{border:1px solid #455628 ;background:#455628 ;font-weight:bold;color:#ffffff ;text-shadow:0 1px 0 #444444 ;background-image:-webkit-gradient(linear,left top,left bottom,from( #4b5e2c ),to( #3e4d24 )); background-image:-webkit-linear-gradient( #4b5e2c,#3e4d24 ); background-image: -moz-linear-gradient( #4b5e2c,#3e4d24 ); background-image: -ms-linear-gradient( #4b5e2c,#3e4d24 ); background-image: -o-linear-gradient( #4b5e2c,#3e4d24 ); background-image: linear-gradient( #4b5e2c,#3e4d24 );}.ui-btn-hover-l:visited,.ui-btn-hover-l:hover,.ui-btn-hover-l a.ui-link-inherit{color:#ffffff ;}.ui-btn-down-l{border:1px solid #455628 ;background:#455628 ;font-weight:bold;color:#ffffff ;text-shadow:0 1px 0 #444444 ;background-image:-webkit-gradient(linear,left top,left bottom,from( #3e4d24 ),to( #4b5e2c )); background-image:-webkit-linear-gradient( #3e4d24,#4b5e2c ); background-image: -moz-linear-gradient( #3e4d24,#4b5e2c ); background-image: -ms-linear-gradient( #3e4d24,#4b5e2c ); background-image: -o-linear-gradient( #3e4d24,#4b5e2c ); background-image: linear-gradient( #3e4d24,#4b5e2c );}.ui-btn-down-l:visited,.ui-btn-down-l:hover,.ui-btn-down-l a.ui-link-inherit{color:#ffffff ;}.ui-btn-up-l,.ui-btn-hover-l,.ui-btn-down-l{font-family:Helvetica,Arial,sans-serif ;text-decoration:none;}a.ui-link-inherit{text-decoration:none !important;}.ui-btn-active{border:1px solid #2373a5 ;background:#387bbe ;font-weight:bold;color:#ffffff ;cursor:pointer;text-shadow:0 1px 0 #3373a5 ;text-decoration:none;background-image:-webkit-gradient(linear,left top,left bottom,from( #5393c5 ),to( #6facd5 )); background-image:-webkit-linear-gradient( #5393c5,#6facd5 ); background-image: -moz-linear-gradient( #5393c5,#6facd5 ); background-image: -ms-linear-gradient( #5393c5,#6facd5 ); background-image: -o-linear-gradient( #5393c5,#6facd5 ); background-image: linear-gradient( #5393c5,#6facd5 ); font-family:Helvetica,Arial,sans-serif ;}.ui-btn-active:visited,.ui-btn-active:hover,.ui-btn-active a.ui-link-inherit{color:#ffffff ;}.ui-btn-inner{border-top:1px solid #fff;border-color:rgba(255,255,255,.3);}.ui-corner-all{-webkit-border-radius:0.3em ;border-radius:0.3em ;}.ui-br{border-color:rgb(130,130,130);border-color:rgba(130,130,130,.3);border-style:solid;}.ui-disabled{filter:Alpha(Opacity=30);opacity:.3;zoom:1;}.ui-disabled,.ui-disabled a{cursor:default !important;pointer-events:none;}.ui-icon,.ui-icon-searchfield:after{background-color:#000000 ;background-color:rgba(0,0,0,0.4) ;background-image:url(images/icons-18-white.png) ;background-repeat:no-repeat;-webkit-border-radius:9px;border-radius:9px;}.ui-icon-alt .ui-icon,.ui-icon-alt .ui-icon-searchfield:after{background-color:#fff;background-color:rgba(255,255,255,.3);background-image:url(images/icons-18-black.png);background-repeat:no-repeat;}.ui-icon-nodisc .ui-icon,.ui-icon-nodisc .ui-icon-searchfield:after,.ui-icon-nodisc .ui-icon-alt .ui-icon,.ui-icon-nodisc .ui-icon-alt .ui-icon-searchfield:after{background-color:transparent;}.ui-icon-plus{background-position:-1px -1px;}.ui-icon-minus{background-position:-37px -1px;}.ui-icon-delete{background-position:-73px -1px;}.ui-icon-arrow-r{background-position:-108px -1px;}.ui-icon-arrow-l{background-position:-144px -1px;}.ui-icon-arrow-u{background-position:-180px -1px;}.ui-icon-arrow-d{background-position:-216px -1px;}.ui-icon-check{background-position:-252px -1px;}.ui-icon-gear{background-position:-288px -1px;}.ui-icon-refresh{background-position:-323px -1px;}.ui-icon-forward{background-position:-360px -1px;}.ui-icon-back{background-position:-396px -1px;}.ui-icon-grid{background-position:-432px -1px;}.ui-icon-star{background-position:-467px -1px;}.ui-icon-alert{background-position:-503px -1px;}.ui-icon-info{background-position:-539px -1px;}.ui-icon-home{background-position:-575px -1px;}.ui-icon-search,.ui-icon-searchfield:after{background-position:-611px -1px;}.ui-icon-checkbox-on{background-position:-647px -1px;}.ui-icon-checkbox-off{background-position:-683px -1px;}.ui-icon-radio-on{background-position:-718px -1px;}.ui-icon-radio-off{background-position:-754px -1px;}.ui-icon-bars{background-position:-788px -1px;}.ui-icon-edit{background-position:-824px -1px;}@media only screen and (-webkit-min-device-pixel-ratio:1.3), only screen and (min--moz-device-pixel-ratio:1.3), only screen and (min-resolution:200dpi){.ui-icon-plus,.ui-icon-minus,.ui-icon-delete,.ui-icon-arrow-r,.ui-icon-arrow-l,.ui-icon-arrow-u,.ui-icon-arrow-d,.ui-icon-check,.ui-icon-gear,.ui-icon-refresh,.ui-icon-forward,.ui-icon-back,.ui-icon-grid,.ui-icon-star,.ui-icon-alert,.ui-icon-info,.ui-icon-home,.ui-icon-bars,.ui-icon-edit,.ui-icon-search,.ui-icon-searchfield:after,.ui-icon-checkbox-off,.ui-icon-checkbox-on,.ui-icon-radio-off,.ui-icon-radio-on{background-image:url(images/icons-36-white.png);-moz-background-size:864px 18px;-o-background-size:864px 18px;-webkit-background-size:864px 18px;background-size:864px 18px;}.ui-icon-alt .ui-icon{background-image:url(images/icons-36-black.png);}.ui-icon-plus{background-position:0px 50%;}.ui-icon-minus{background-position:-36px 50%;}.ui-icon-delete{background-position:-72px 50%;}.ui-icon-arrow-r{background-position:-108px 50%;}.ui-icon-arrow-l{background-position:-144px 50%;}.ui-icon-arrow-u{background-position:-179px 50%;}.ui-icon-arrow-d{background-position:-215px 50%;}.ui-icon-check{background-position:-252px 50%;}.ui-icon-gear{background-position:-287px 50%;}.ui-icon-refresh{background-position:-323px 50%;}.ui-icon-forward{background-position:-360px 50%;}.ui-icon-back{background-position:-395px 50%;}.ui-icon-grid{background-position:-431px 50%;}.ui-icon-star{background-position:-467px 50%;}.ui-icon-alert{background-position:-503px 50%;}.ui-icon-info{background-position:-538px 50%;}.ui-icon-home{background-position:-575px 50%;}.ui-icon-search,.ui-icon-searchfield:after{background-position:-611px 50%;}.ui-icon-checkbox-on{background-position:-647px 50%;}.ui-icon-checkbox-off{background-position:-683px 50%;}.ui-icon-radio-on{background-position:-718px 50%;}.ui-icon-radio-off{background-position:-754px 50%;}.ui-icon-bars{background-position:-788px 50%;}.ui-icon-edit{background-position:-824px 50%;}}.ui-checkbox .ui-icon,.ui-selectmenu-list .ui-icon{-webkit-border-radius:3px;border-radius:3px;}.ui-icon-checkbox-off,.ui-icon-radio-off{background-color:transparent;}.ui-checkbox-on .ui-icon,.ui-radio-on .ui-icon{background-color:#387bbe ; }.ui-icon-loading{background:url(images/ajax-loader.gif);background-size:46px 46px;}.ui-btn-corner-all{-webkit-border-radius:0.6em ;border-radius:0.6em ;}.ui-corner-all,.ui-btn-corner-all{-webkit-background-clip:padding;background-clip:padding-box;}.ui-overlay{background:#666;filter:Alpha(Opacity=50);opacity:.5;position:absolute;width:100%;height:100%;}.ui-overlay-shadow{-moz-box-shadow:0px 0px 12px rgba(0,0,0,.6);-webkit-box-shadow:0px 0px 12px rgba(0,0,0,.6);box-shadow:0px 0px 12px rgba(0,0,0,.6);}.ui-shadow{-moz-box-shadow:0px 1px 3px rgba(0,0,0,.2) ;-webkit-box-shadow:0px 1px 3px rgba(0,0,0,.2) ;box-shadow:0px 1px 3px rgba(0,0,0,.2) ;}.ui-bar-a .ui-shadow,.ui-bar-b .ui-shadow,.ui-bar-c .ui-shadow {-moz-box-shadow:0px 1px 0 rgba(255,255,255,.3);-webkit-box-shadow:0px 1px 0 rgba(255,255,255,.3);box-shadow:0px 1px 0 rgba(255,255,255,.3);}.ui-shadow-inset{-moz-box-shadow:inset 0px 1px 4px rgba(0,0,0,.2);-webkit-box-shadow:inset 0px 1px 4px rgba(0,0,0,.2);box-shadow:inset 0px 1px 4px rgba(0,0,0,.2);}.ui-icon-shadow{-moz-box-shadow:0px 1px 0 rgba(255,255,255,.4) ;-webkit-box-shadow:0px 1px 0 rgba(255,255,255,.4) ;box-shadow:0px 1px 0 rgba(255,255,255,.4) ;}.ui-btn:focus,.ui-link-inherit:focus{outline:0;}.ui-btn.ui-focus{z-index:1;}.ui-focus,.ui-btn:focus{-moz-box-shadow:inset 0px 0px 3px #387bbe,0px 0px 9px #387bbe ;-webkit-box-shadow:inset 0px 0px 3px #387bbe,0px 0px 9px #387bbe ;box-shadow:inset 0px 0px 3px #387bbe,0px 0px 9px #387bbe ;}.ui-input-text.ui-focus,.ui-input-search.ui-focus{-moz-box-shadow:0px 0px 12px #387bbe ;-webkit-box-shadow:0px 0px 12px #387bbe ;box-shadow:0px 0px 12px #387bbe ;}.ui-mobile-nosupport-boxshadow *{-moz-box-shadow:none !important;-webkit-box-shadow:none !important;box-shadow:none !important;}.ui-mobile-nosupport-boxshadow .ui-focus,.ui-mobile-nosupport-boxshadow .ui-btn:focus,.ui-mobile-nosupport-boxshadow .ui-link-inherit:focus{outline-width:1px;outline-style:auto;} \ No newline at end of file diff --git a/www/css/Graphite.css b/www/css/Graphite.css deleted file mode 100755 index f4bb100..0000000 --- a/www/css/Graphite.css +++ /dev/null @@ -1,1076 +0,0 @@ -/*! -* jQuery Mobile 1.3.2 -* Git HEAD hash: 528cf0e96940644ea644096bfeb913ed920ffaef <> Date: Fri Jul 19 2013 22:17:57 UTC -* http://jquerymobile.com -* -* Copyright 2010, 2013 jQuery Foundation, Inc. and other contributors -* Released under the MIT license. -* http://jquery.org/license -* -*/ - - -/* Swatches */ - -/* C ------------------------------------------------------------------------------------------------------------*/ -.ui-bar-c { - border: 1px solid #61778d /*{c-bar-border}*/; - background: #61778d /*{c-bar-background-color}*/; - color: #ffffff /*{c-bar-color}*/; - font-weight: bold; - text-shadow: 0 /*{c-bar-shadow-x}*/ 1px /*{c-bar-shadow-y}*/ 0 /*{c-bar-shadow-radius}*/ #444444 /*{c-bar-shadow-color}*/; - background-image: -webkit-gradient(linear, left top, left bottom, from( #637a91 /*{c-bar-background-start}*/), to( #5e7388 /*{c-bar-background-end}*/)); /* Saf4+, Chrome */ - background-image: -webkit-linear-gradient( #637a91 /*{c-bar-background-start}*/, #5e7388 /*{c-bar-background-end}*/); /* Chrome 10+, Saf5.1+ */ - background-image: -moz-linear-gradient( #637a91 /*{c-bar-background-start}*/, #5e7388 /*{c-bar-background-end}*/); /* FF3.6 */ - background-image: -ms-linear-gradient( #637a91 /*{c-bar-background-start}*/, #5e7388 /*{c-bar-background-end}*/); /* IE10 */ - background-image: -o-linear-gradient( #637a91 /*{c-bar-background-start}*/, #5e7388 /*{c-bar-background-end}*/); /* Opera 11.10+ */ - background-image: linear-gradient( #637a91 /*{c-bar-background-start}*/, #5e7388 /*{c-bar-background-end}*/); -} -.ui-bar-c .ui-link-inherit { - color: #ffffff /*{c-bar-color}*/; -} -.ui-bar-c a.ui-link { - color: #7cc4e7 /*{c-bar-link-color}*/; - font-weight: bold; -} -.ui-bar-c a.ui-link:visited { - color: #2489ce /*{c-bar-link-visited}*/; -} -.ui-bar-c a.ui-link:hover { - color: #2489ce /*{c-bar-link-hover}*/; -} -.ui-bar-c a.ui-link:active { - color: #2489ce /*{c-bar-link-active}*/; -} -.ui-bar-c, -.ui-bar-c input, -.ui-bar-c select, -.ui-bar-c textarea, -.ui-bar-c button { - font-family: sans-serif /*{global-font-family}*/; -} -.ui-body-c, -.ui-overlay-c { - border: 1px solid #35414d /*{c-body-border}*/; - color: #ffffff /*{c-body-color}*/; - text-shadow: 0 /*{c-body-shadow-x}*/ 1px /*{c-body-shadow-y}*/ 0 /*{c-body-shadow-radius}*/ #444444 /*{c-body-shadow-color}*/; - background: #61778d /*{c-body-background-color}*/; - background-image: -webkit-gradient(linear, left top, left bottom, from( #708aa3 /*{c-body-background-start}*/), to( #516376 /*{c-body-background-end}*/)); /* Saf4+, Chrome */ - background-image: -webkit-linear-gradient( #708aa3 /*{c-body-background-start}*/, #516376 /*{c-body-background-end}*/); /* Chrome 10+, Saf5.1+ */ - background-image: -moz-linear-gradient( #708aa3 /*{c-body-background-start}*/, #516376 /*{c-body-background-end}*/); /* FF3.6 */ - background-image: -ms-linear-gradient( #708aa3 /*{c-body-background-start}*/, #516376 /*{c-body-background-end}*/); /* IE10 */ - background-image: -o-linear-gradient( #708aa3 /*{c-body-background-start}*/, #516376 /*{c-body-background-end}*/); /* Opera 11.10+ */ - background-image: linear-gradient( #708aa3 /*{c-body-background-start}*/, #516376 /*{c-body-background-end}*/); -} -.ui-overlay-c { - background-image: none; - border-width: 0; -} -.ui-body-c, -.ui-body-c input, -.ui-body-c select, -.ui-body-c textarea, -.ui-body-c button { - font-family: sans-serif /*{global-font-family}*/; -} -.ui-body-c .ui-link-inherit { - color: #ffffff /*{c-body-color}*/; -} -.ui-body-c .ui-link { - color: #2489ce /*{c-body-link-color}*/; - font-weight: bold; -} -.ui-body-c .ui-link:visited { - color: #2489ce /*{c-body-link-visited}*/; -} -.ui-body-c .ui-link:hover { - color: #2489ce /*{c-body-link-hover}*/; -} -.ui-body-c .ui-link:active { - color: #2489ce /*{c-body-link-active}*/; -} -.ui-btn-up-c { - border: 1px solid #61778d /*{c-bup-border}*/; - background: #61778d /*{c-bup-background-color}*/; - font-weight: bold; - color: #ffffff /*{c-bup-color}*/; - text-shadow: 0 /*{c-bup-shadow-x}*/ 1px /*{c-bup-shadow-y}*/ 0 /*{c-bup-shadow-radius}*/ #444444 /*{c-bup-shadow-color}*/; - background-image: -webkit-gradient(linear, left top, left bottom, from( #677f96 /*{c-bup-background-start}*/), to( #5a6e83 /*{c-bup-background-end}*/)); /* Saf4+, Chrome */ - background-image: -webkit-linear-gradient( #677f96 /*{c-bup-background-start}*/, #5a6e83 /*{c-bup-background-end}*/); /* Chrome 10+, Saf5.1+ */ - background-image: -moz-linear-gradient( #677f96 /*{c-bup-background-start}*/, #5a6e83 /*{c-bup-background-end}*/); /* FF3.6 */ - background-image: -ms-linear-gradient( #677f96 /*{c-bup-background-start}*/, #5a6e83 /*{c-bup-background-end}*/); /* IE10 */ - background-image: -o-linear-gradient( #677f96 /*{c-bup-background-start}*/, #5a6e83 /*{c-bup-background-end}*/); /* Opera 11.10+ */ - background-image: linear-gradient( #677f96 /*{c-bup-background-start}*/, #5a6e83 /*{c-bup-background-end}*/); -} -.ui-btn-up-c:visited, -.ui-btn-up-c a.ui-link-inherit { - color: #ffffff /*{c-bup-color}*/; -} -.ui-btn-hover-c { - border: 1px solid #6f88a2 /*{c-bhover-border}*/; - background: #6f88a2 /*{c-bhover-background-color}*/; - font-weight: bold; - color: #ffffff /*{c-bhover-color}*/; - text-shadow: 0 /*{c-bhover-shadow-x}*/ 1px /*{c-bhover-shadow-y}*/ 0 /*{c-bhover-shadow-radius}*/ #444444 /*{c-bhover-shadow-color}*/; - background-image: -webkit-gradient(linear, left top, left bottom, from( #7a95b2 /*{c-bhover-background-start}*/), to( #637a91 /*{c-bhover-background-end}*/)); /* Saf4+, Chrome */ - background-image: -webkit-linear-gradient( #7a95b2 /*{c-bhover-background-start}*/, #637a91 /*{c-bhover-background-end}*/); /* Chrome 10+, Saf5.1+ */ - background-image: -moz-linear-gradient( #7a95b2 /*{c-bhover-background-start}*/, #637a91 /*{c-bhover-background-end}*/); /* FF3.6 */ - background-image: -ms-linear-gradient( #7a95b2 /*{c-bhover-background-start}*/, #637a91 /*{c-bhover-background-end}*/); /* IE10 */ - background-image: -o-linear-gradient( #7a95b2 /*{c-bhover-background-start}*/, #637a91 /*{c-bhover-background-end}*/); /* Opera 11.10+ */ - background-image: linear-gradient( #7a95b2 /*{c-bhover-background-start}*/, #637a91 /*{c-bhover-background-end}*/); -} -.ui-btn-hover-c:visited, -.ui-btn-hover-c:hover, -.ui-btn-hover-c a.ui-link-inherit { - color: #ffffff /*{c-bhover-color}*/; -} -.ui-btn-down-c { - border: 1px solid #6f88a2 /*{c-bdown-border}*/; - background: #6f88a2 /*{c-bdown-background-color}*/; - font-weight: bold; - color: #ffffff /*{c-bdown-color}*/; - text-shadow: 0 /*{c-bdown-shadow-x}*/ 1px /*{c-bdown-shadow-y}*/ 0 /*{c-bdown-shadow-radius}*/ #444444 /*{c-bdown-shadow-color}*/; - background-image: -webkit-gradient(linear, left top, left bottom, from( #637a91 /*{c-bdown-background-start}*/), to( #7a95b2 /*{c-bdown-background-end}*/)); /* Saf4+, Chrome */ - background-image: -webkit-linear-gradient( #637a91 /*{c-bdown-background-start}*/, #7a95b2 /*{c-bdown-background-end}*/); /* Chrome 10+, Saf5.1+ */ - background-image: -moz-linear-gradient( #637a91 /*{c-bdown-background-start}*/, #7a95b2 /*{c-bdown-background-end}*/); /* FF3.6 */ - background-image: -ms-linear-gradient( #637a91 /*{c-bdown-background-start}*/, #7a95b2 /*{c-bdown-background-end}*/); /* IE10 */ - background-image: -o-linear-gradient( #637a91 /*{c-bdown-background-start}*/, #7a95b2 /*{c-bdown-background-end}*/); /* Opera 11.10+ */ - background-image: linear-gradient( #637a91 /*{c-bdown-background-start}*/, #7a95b2 /*{c-bdown-background-end}*/); -} -.ui-btn-down-c:visited, -.ui-btn-down-c:hover, -.ui-btn-down-c a.ui-link-inherit { - color: #ffffff /*{c-bdown-color}*/; -} -.ui-btn-up-c, -.ui-btn-hover-c, -.ui-btn-down-c { - font-family: sans-serif /*{global-font-family}*/; - text-decoration: none; -} - - -/* D ------------------------------------------------------------------------------------------------------------*/ -.ui-bar-d { - border: 1px solid #2e3340 /*{d-bar-border}*/; - background: #2e3340 /*{d-bar-background-color}*/; - color: #ffffff /*{d-bar-color}*/; - font-weight: bold; - text-shadow: 0 /*{d-bar-shadow-x}*/ 1px /*{d-bar-shadow-y}*/ 0 /*{d-bar-shadow-radius}*/ #444444 /*{d-bar-shadow-color}*/; - background-image: -webkit-gradient(linear, left top, left bottom, from( #323846 /*{d-bar-background-start}*/), to( #292d39 /*{d-bar-background-end}*/)); /* Saf4+, Chrome */ - background-image: -webkit-linear-gradient( #323846 /*{d-bar-background-start}*/, #292d39 /*{d-bar-background-end}*/); /* Chrome 10+, Saf5.1+ */ - background-image: -moz-linear-gradient( #323846 /*{d-bar-background-start}*/, #292d39 /*{d-bar-background-end}*/); /* FF3.6 */ - background-image: -ms-linear-gradient( #323846 /*{d-bar-background-start}*/, #292d39 /*{d-bar-background-end}*/); /* IE10 */ - background-image: -o-linear-gradient( #323846 /*{d-bar-background-start}*/, #292d39 /*{d-bar-background-end}*/); /* Opera 11.10+ */ - background-image: linear-gradient( #323846 /*{d-bar-background-start}*/, #292d39 /*{d-bar-background-end}*/); -} -.ui-bar-d .ui-link-inherit { - color: #ffffff /*{d-bar-color}*/; -} -.ui-bar-d a.ui-link { - color: #7cc4e7 /*{d-bar-link-color}*/; - font-weight: bold; -} -.ui-bar-d a.ui-link:visited { - color: #2489ce /*{d-bar-link-visited}*/; -} -.ui-bar-d a.ui-link:hover { - color: #2489ce /*{d-bar-link-hover}*/; -} -.ui-bar-d a.ui-link:active { - color: #2489ce /*{d-bar-link-active}*/; -} -.ui-bar-d, -.ui-bar-d input, -.ui-bar-d select, -.ui-bar-d textarea, -.ui-bar-d button { - font-family: sans-serif /*{global-font-family}*/; -} -.ui-body-d, -.ui-overlay-d { - border: 1px solid #404759 /*{d-body-border}*/; - color: #ffffff /*{d-body-color}*/; - text-shadow: 0 /*{d-body-shadow-x}*/ 1px /*{d-body-shadow-y}*/ 0 /*{d-body-shadow-radius}*/ #444444 /*{d-body-shadow-color}*/; - background: #2e3340 /*{d-body-background-color}*/; - background-image: -webkit-gradient(linear, left top, left bottom, from( #323846 /*{d-body-background-start}*/), to( #292d39 /*{d-body-background-end}*/)); /* Saf4+, Chrome */ - background-image: -webkit-linear-gradient( #323846 /*{d-body-background-start}*/, #292d39 /*{d-body-background-end}*/); /* Chrome 10+, Saf5.1+ */ - background-image: -moz-linear-gradient( #323846 /*{d-body-background-start}*/, #292d39 /*{d-body-background-end}*/); /* FF3.6 */ - background-image: -ms-linear-gradient( #323846 /*{d-body-background-start}*/, #292d39 /*{d-body-background-end}*/); /* IE10 */ - background-image: -o-linear-gradient( #323846 /*{d-body-background-start}*/, #292d39 /*{d-body-background-end}*/); /* Opera 11.10+ */ - background-image: linear-gradient( #323846 /*{d-body-background-start}*/, #292d39 /*{d-body-background-end}*/); -} -.ui-overlay-d { - background-image: none; - border-width: 0; -} -.ui-body-d, -.ui-body-d input, -.ui-body-d select, -.ui-body-d textarea, -.ui-body-d button { - font-family: sans-serif /*{global-font-family}*/; -} -.ui-body-d .ui-link-inherit { - color: #ffffff /*{d-body-color}*/; -} -.ui-body-d .ui-link { - color: #2489ce /*{d-body-link-color}*/; - font-weight: bold; -} -.ui-body-d .ui-link:visited { - color: #2489ce /*{d-body-link-visited}*/; -} -.ui-body-d .ui-link:hover { - color: #2489ce /*{d-body-link-hover}*/; -} -.ui-body-d .ui-link:active { - color: #2489ce /*{d-body-link-active}*/; -} -.ui-btn-up-d { - border: 1px solid #2e3340 /*{d-bup-border}*/; - background: #2e3340 /*{d-bup-background-color}*/; - font-weight: bold; - color: #ffffff /*{d-bup-color}*/; - text-shadow: 0 /*{d-bup-shadow-x}*/ 1px /*{d-bup-shadow-y}*/ 0 /*{d-bup-shadow-radius}*/ #444444 /*{d-bup-shadow-color}*/; - background-image: -webkit-gradient(linear, left top, left bottom, from( #323846 /*{d-bup-background-start}*/), to( #292d39 /*{d-bup-background-end}*/)); /* Saf4+, Chrome */ - background-image: -webkit-linear-gradient( #323846 /*{d-bup-background-start}*/, #292d39 /*{d-bup-background-end}*/); /* Chrome 10+, Saf5.1+ */ - background-image: -moz-linear-gradient( #323846 /*{d-bup-background-start}*/, #292d39 /*{d-bup-background-end}*/); /* FF3.6 */ - background-image: -ms-linear-gradient( #323846 /*{d-bup-background-start}*/, #292d39 /*{d-bup-background-end}*/); /* IE10 */ - background-image: -o-linear-gradient( #323846 /*{d-bup-background-start}*/, #292d39 /*{d-bup-background-end}*/); /* Opera 11.10+ */ - background-image: linear-gradient( #323846 /*{d-bup-background-start}*/, #292d39 /*{d-bup-background-end}*/); -} -.ui-btn-up-d:visited, -.ui-btn-up-d a.ui-link-inherit { - color: #ffffff /*{d-bup-color}*/; -} -.ui-btn-hover-d { - border: 1px solid #343a49 /*{d-bhover-border}*/; - background: #343a49 /*{d-bhover-background-color}*/; - font-weight: bold; - color: #ffffff /*{d-bhover-color}*/; - text-shadow: 0 /*{d-bhover-shadow-x}*/ 1px /*{d-bhover-shadow-y}*/ 0 /*{d-bhover-shadow-radius}*/ #444444 /*{d-bhover-shadow-color}*/; - background-image: -webkit-gradient(linear, left top, left bottom, from( #393f50 /*{d-bhover-background-start}*/), to( #2e3441 /*{d-bhover-background-end}*/)); /* Saf4+, Chrome */ - background-image: -webkit-linear-gradient( #393f50 /*{d-bhover-background-start}*/, #2e3441 /*{d-bhover-background-end}*/); /* Chrome 10+, Saf5.1+ */ - background-image: -moz-linear-gradient( #393f50 /*{d-bhover-background-start}*/, #2e3441 /*{d-bhover-background-end}*/); /* FF3.6 */ - background-image: -ms-linear-gradient( #393f50 /*{d-bhover-background-start}*/, #2e3441 /*{d-bhover-background-end}*/); /* IE10 */ - background-image: -o-linear-gradient( #393f50 /*{d-bhover-background-start}*/, #2e3441 /*{d-bhover-background-end}*/); /* Opera 11.10+ */ - background-image: linear-gradient( #393f50 /*{d-bhover-background-start}*/, #2e3441 /*{d-bhover-background-end}*/); -} -.ui-btn-hover-d:visited, -.ui-btn-hover-d:hover, -.ui-btn-hover-d a.ui-link-inherit { - color: #ffffff /*{d-bhover-color}*/; -} -.ui-btn-down-d { - border: 1px solid #343a49 /*{d-bdown-border}*/; - background: #343a49 /*{d-bdown-background-color}*/; - font-weight: bold; - color: #ffffff /*{d-bdown-color}*/; - text-shadow: 0 /*{d-bdown-shadow-x}*/ 1px /*{d-bdown-shadow-y}*/ 0 /*{d-bdown-shadow-radius}*/ #444444 /*{d-bdown-shadow-color}*/; - background-image: -webkit-gradient(linear, left top, left bottom, from( #2e3441 /*{d-bdown-background-start}*/), to( #393f50 /*{d-bdown-background-end}*/)); /* Saf4+, Chrome */ - background-image: -webkit-linear-gradient( #2e3441 /*{d-bdown-background-start}*/, #393f50 /*{d-bdown-background-end}*/); /* Chrome 10+, Saf5.1+ */ - background-image: -moz-linear-gradient( #2e3441 /*{d-bdown-background-start}*/, #393f50 /*{d-bdown-background-end}*/); /* FF3.6 */ - background-image: -ms-linear-gradient( #2e3441 /*{d-bdown-background-start}*/, #393f50 /*{d-bdown-background-end}*/); /* IE10 */ - background-image: -o-linear-gradient( #2e3441 /*{d-bdown-background-start}*/, #393f50 /*{d-bdown-background-end}*/); /* Opera 11.10+ */ - background-image: linear-gradient( #2e3441 /*{d-bdown-background-start}*/, #393f50 /*{d-bdown-background-end}*/); -} -.ui-btn-down-d:visited, -.ui-btn-down-d:hover, -.ui-btn-down-d a.ui-link-inherit { - color: #ffffff /*{d-bdown-color}*/; -} -.ui-btn-up-d, -.ui-btn-hover-d, -.ui-btn-down-d { - font-family: sans-serif /*{global-font-family}*/; - text-decoration: none; -} - - -/* E ------------------------------------------------------------------------------------------------------------*/ -.ui-bar-e { - border: 1px solid #2c4259 /*{e-bar-border}*/; - background: #2c4259 /*{e-bar-background-color}*/; - color: #ffffff /*{e-bar-color}*/; - font-weight: bold; - text-shadow: 0 /*{e-bar-shadow-x}*/ 1px /*{e-bar-shadow-y}*/ 0 /*{e-bar-shadow-radius}*/ #444444 /*{e-bar-shadow-color}*/; - background-image: -webkit-gradient(linear, left top, left bottom, from( #304861 /*{e-bar-background-start}*/), to( #273b50 /*{e-bar-background-end}*/)); /* Saf4+, Chrome */ - background-image: -webkit-linear-gradient( #304861 /*{e-bar-background-start}*/, #273b50 /*{e-bar-background-end}*/); /* Chrome 10+, Saf5.1+ */ - background-image: -moz-linear-gradient( #304861 /*{e-bar-background-start}*/, #273b50 /*{e-bar-background-end}*/); /* FF3.6 */ - background-image: -ms-linear-gradient( #304861 /*{e-bar-background-start}*/, #273b50 /*{e-bar-background-end}*/); /* IE10 */ - background-image: -o-linear-gradient( #304861 /*{e-bar-background-start}*/, #273b50 /*{e-bar-background-end}*/); /* Opera 11.10+ */ - background-image: linear-gradient( #304861 /*{e-bar-background-start}*/, #273b50 /*{e-bar-background-end}*/); -} -.ui-bar-e .ui-link-inherit { - color: #ffffff /*{e-bar-color}*/; -} -.ui-bar-e a.ui-link { - color: #7cc4e7 /*{e-bar-link-color}*/; - font-weight: bold; -} -.ui-bar-e a.ui-link:visited { - color: #2489ce /*{e-bar-link-visited}*/; -} -.ui-bar-e a.ui-link:hover { - color: #2489ce /*{e-bar-link-hover}*/; -} -.ui-bar-e a.ui-link:active { - color: #2489ce /*{e-bar-link-active}*/; -} -.ui-bar-e, -.ui-bar-e input, -.ui-bar-e select, -.ui-bar-e textarea, -.ui-bar-e button { - font-family: sans-serif /*{global-font-family}*/; -} -.ui-body-e, -.ui-overlay-e { - border: 1px solid #3d5c7c /*{e-body-border}*/; - color: #ffffff /*{e-body-color}*/; - text-shadow: 0 /*{e-body-shadow-x}*/ 1px /*{e-body-shadow-y}*/ 0 /*{e-body-shadow-radius}*/ #444444 /*{e-body-shadow-color}*/; - background: #2c4259 /*{e-body-background-color}*/; - background-image: -webkit-gradient(linear, left top, left bottom, from( #304861 /*{e-body-background-start}*/), to( #273b50 /*{e-body-background-end}*/)); /* Saf4+, Chrome */ - background-image: -webkit-linear-gradient( #304861 /*{e-body-background-start}*/, #273b50 /*{e-body-background-end}*/); /* Chrome 10+, Saf5.1+ */ - background-image: -moz-linear-gradient( #304861 /*{e-body-background-start}*/, #273b50 /*{e-body-background-end}*/); /* FF3.6 */ - background-image: -ms-linear-gradient( #304861 /*{e-body-background-start}*/, #273b50 /*{e-body-background-end}*/); /* IE10 */ - background-image: -o-linear-gradient( #304861 /*{e-body-background-start}*/, #273b50 /*{e-body-background-end}*/); /* Opera 11.10+ */ - background-image: linear-gradient( #304861 /*{e-body-background-start}*/, #273b50 /*{e-body-background-end}*/); -} -.ui-overlay-e { - background-image: none; - border-width: 0; -} -.ui-body-e, -.ui-body-e input, -.ui-body-e select, -.ui-body-e textarea, -.ui-body-e button { - font-family: sans-serif /*{global-font-family}*/; -} -.ui-body-e .ui-link-inherit { - color: #ffffff /*{e-body-color}*/; -} -.ui-body-e .ui-link { - color: #2489ce /*{e-body-link-color}*/; - font-weight: bold; -} -.ui-body-e .ui-link:visited { - color: #2489ce /*{e-body-link-visited}*/; -} -.ui-body-e .ui-link:hover { - color: #2489ce /*{e-body-link-hover}*/; -} -.ui-body-e .ui-link:active { - color: #2489ce /*{e-body-link-active}*/; -} -.ui-btn-up-e { - border: 1px solid #2c4259 /*{e-bup-border}*/; - background: #2c4259 /*{e-bup-background-color}*/; - font-weight: bold; - color: #ffffff /*{e-bup-color}*/; - text-shadow: 0 /*{e-bup-shadow-x}*/ 1px /*{e-bup-shadow-y}*/ 0 /*{e-bup-shadow-radius}*/ #444444 /*{e-bup-shadow-color}*/; - background-image: -webkit-gradient(linear, left top, left bottom, from( #304861 /*{e-bup-background-start}*/), to( #273b50 /*{e-bup-background-end}*/)); /* Saf4+, Chrome */ - background-image: -webkit-linear-gradient( #304861 /*{e-bup-background-start}*/, #273b50 /*{e-bup-background-end}*/); /* Chrome 10+, Saf5.1+ */ - background-image: -moz-linear-gradient( #304861 /*{e-bup-background-start}*/, #273b50 /*{e-bup-background-end}*/); /* FF3.6 */ - background-image: -ms-linear-gradient( #304861 /*{e-bup-background-start}*/, #273b50 /*{e-bup-background-end}*/); /* IE10 */ - background-image: -o-linear-gradient( #304861 /*{e-bup-background-start}*/, #273b50 /*{e-bup-background-end}*/); /* Opera 11.10+ */ - background-image: linear-gradient( #304861 /*{e-bup-background-start}*/, #273b50 /*{e-bup-background-end}*/); -} -.ui-btn-up-e:visited, -.ui-btn-up-e a.ui-link-inherit { - color: #ffffff /*{e-bup-color}*/; -} -.ui-btn-hover-e { - border: 1px solid #324b66 /*{e-bhover-border}*/; - background: #324b66 /*{e-bhover-background-color}*/; - font-weight: bold; - color: #ffffff /*{e-bhover-color}*/; - text-shadow: 0 /*{e-bhover-shadow-x}*/ 1px /*{e-bhover-shadow-y}*/ 0 /*{e-bhover-shadow-radius}*/ #444444 /*{e-bhover-shadow-color}*/; - background-image: -webkit-gradient(linear, left top, left bottom, from( #375270 /*{e-bhover-background-start}*/), to( #2d435b /*{e-bhover-background-end}*/)); /* Saf4+, Chrome */ - background-image: -webkit-linear-gradient( #375270 /*{e-bhover-background-start}*/, #2d435b /*{e-bhover-background-end}*/); /* Chrome 10+, Saf5.1+ */ - background-image: -moz-linear-gradient( #375270 /*{e-bhover-background-start}*/, #2d435b /*{e-bhover-background-end}*/); /* FF3.6 */ - background-image: -ms-linear-gradient( #375270 /*{e-bhover-background-start}*/, #2d435b /*{e-bhover-background-end}*/); /* IE10 */ - background-image: -o-linear-gradient( #375270 /*{e-bhover-background-start}*/, #2d435b /*{e-bhover-background-end}*/); /* Opera 11.10+ */ - background-image: linear-gradient( #375270 /*{e-bhover-background-start}*/, #2d435b /*{e-bhover-background-end}*/); -} -.ui-btn-hover-e:visited, -.ui-btn-hover-e:hover, -.ui-btn-hover-e a.ui-link-inherit { - color: #ffffff /*{e-bhover-color}*/; -} -.ui-btn-down-e { - border: 1px solid #324b66 /*{e-bdown-border}*/; - background: #324b66 /*{e-bdown-background-color}*/; - font-weight: bold; - color: #ffffff /*{e-bdown-color}*/; - text-shadow: 0 /*{e-bdown-shadow-x}*/ 1px /*{e-bdown-shadow-y}*/ 0 /*{e-bdown-shadow-radius}*/ #444444 /*{e-bdown-shadow-color}*/; - background-image: -webkit-gradient(linear, left top, left bottom, from( #2d435b /*{e-bdown-background-start}*/), to( #375270 /*{e-bdown-background-end}*/)); /* Saf4+, Chrome */ - background-image: -webkit-linear-gradient( #2d435b /*{e-bdown-background-start}*/, #375270 /*{e-bdown-background-end}*/); /* Chrome 10+, Saf5.1+ */ - background-image: -moz-linear-gradient( #2d435b /*{e-bdown-background-start}*/, #375270 /*{e-bdown-background-end}*/); /* FF3.6 */ - background-image: -ms-linear-gradient( #2d435b /*{e-bdown-background-start}*/, #375270 /*{e-bdown-background-end}*/); /* IE10 */ - background-image: -o-linear-gradient( #2d435b /*{e-bdown-background-start}*/, #375270 /*{e-bdown-background-end}*/); /* Opera 11.10+ */ - background-image: linear-gradient( #2d435b /*{e-bdown-background-start}*/, #375270 /*{e-bdown-background-end}*/); -} -.ui-btn-down-e:visited, -.ui-btn-down-e:hover, -.ui-btn-down-e a.ui-link-inherit { - color: #ffffff /*{e-bdown-color}*/; -} -.ui-btn-up-e, -.ui-btn-hover-e, -.ui-btn-down-e { - font-family: sans-serif /*{global-font-family}*/; - text-decoration: none; -} - - -/* F ------------------------------------------------------------------------------------------------------------*/ -.ui-bar-f { - border: 1px solid #2f334a /*{f-bar-border}*/; - background: #2f334a /*{f-bar-background-color}*/; - color: #ffffff /*{f-bar-color}*/; - font-weight: bold; - text-shadow: 0 /*{f-bar-shadow-x}*/ 1px /*{f-bar-shadow-y}*/ 0 /*{f-bar-shadow-radius}*/ #444444 /*{f-bar-shadow-color}*/; - background-image: -webkit-gradient(linear, left top, left bottom, from( #333851 /*{f-bar-background-start}*/), to( #2a2d42 /*{f-bar-background-end}*/)); /* Saf4+, Chrome */ - background-image: -webkit-linear-gradient( #333851 /*{f-bar-background-start}*/, #2a2d42 /*{f-bar-background-end}*/); /* Chrome 10+, Saf5.1+ */ - background-image: -moz-linear-gradient( #333851 /*{f-bar-background-start}*/, #2a2d42 /*{f-bar-background-end}*/); /* FF3.6 */ - background-image: -ms-linear-gradient( #333851 /*{f-bar-background-start}*/, #2a2d42 /*{f-bar-background-end}*/); /* IE10 */ - background-image: -o-linear-gradient( #333851 /*{f-bar-background-start}*/, #2a2d42 /*{f-bar-background-end}*/); /* Opera 11.10+ */ - background-image: linear-gradient( #333851 /*{f-bar-background-start}*/, #2a2d42 /*{f-bar-background-end}*/); -} -.ui-bar-f .ui-link-inherit { - color: #ffffff /*{f-bar-color}*/; -} -.ui-bar-f a.ui-link { - color: #7cc4e7 /*{f-bar-link-color}*/; - font-weight: bold; -} -.ui-bar-f a.ui-link:visited { - color: #2489ce /*{f-bar-link-visited}*/; -} -.ui-bar-f a.ui-link:hover { - color: #2489ce /*{f-bar-link-hover}*/; -} -.ui-bar-f a.ui-link:active { - color: #2489ce /*{f-bar-link-active}*/; -} -.ui-bar-f, -.ui-bar-f input, -.ui-bar-f select, -.ui-bar-f textarea, -.ui-bar-f button { - font-family: sans-serif /*{global-font-family}*/; -} -.ui-body-f, -.ui-overlay-f { - border: 1px solid #414767 /*{f-body-border}*/; - color: #ffffff /*{f-body-color}*/; - text-shadow: 0 /*{f-body-shadow-x}*/ 1px /*{f-body-shadow-y}*/ 0 /*{f-body-shadow-radius}*/ #444444 /*{f-body-shadow-color}*/; - background: #2f334a /*{f-body-background-color}*/; - background-image: -webkit-gradient(linear, left top, left bottom, from( #333851 /*{f-body-background-start}*/), to( #2a2d42 /*{f-body-background-end}*/)); /* Saf4+, Chrome */ - background-image: -webkit-linear-gradient( #333851 /*{f-body-background-start}*/, #2a2d42 /*{f-body-background-end}*/); /* Chrome 10+, Saf5.1+ */ - background-image: -moz-linear-gradient( #333851 /*{f-body-background-start}*/, #2a2d42 /*{f-body-background-end}*/); /* FF3.6 */ - background-image: -ms-linear-gradient( #333851 /*{f-body-background-start}*/, #2a2d42 /*{f-body-background-end}*/); /* IE10 */ - background-image: -o-linear-gradient( #333851 /*{f-body-background-start}*/, #2a2d42 /*{f-body-background-end}*/); /* Opera 11.10+ */ - background-image: linear-gradient( #333851 /*{f-body-background-start}*/, #2a2d42 /*{f-body-background-end}*/); -} -.ui-overlay-f { - background-image: none; - border-width: 0; -} -.ui-body-f, -.ui-body-f input, -.ui-body-f select, -.ui-body-f textarea, -.ui-body-f button { - font-family: sans-serif /*{global-font-family}*/; -} -.ui-body-f .ui-link-inherit { - color: #ffffff /*{f-body-color}*/; -} -.ui-body-f .ui-link { - color: #2489ce /*{f-body-link-color}*/; - font-weight: bold; -} -.ui-body-f .ui-link:visited { - color: #2489ce /*{f-body-link-visited}*/; -} -.ui-body-f .ui-link:hover { - color: #2489ce /*{f-body-link-hover}*/; -} -.ui-body-f .ui-link:active { - color: #2489ce /*{f-body-link-active}*/; -} -.ui-btn-up-f { - border: 1px solid #2f334a /*{f-bup-border}*/; - background: #2f334a /*{f-bup-background-color}*/; - font-weight: bold; - color: #ffffff /*{f-bup-color}*/; - text-shadow: 0 /*{f-bup-shadow-x}*/ 1px /*{f-bup-shadow-y}*/ 0 /*{f-bup-shadow-radius}*/ #444444 /*{f-bup-shadow-color}*/; - background-image: -webkit-gradient(linear, left top, left bottom, from( #333851 /*{f-bup-background-start}*/), to( #2a2d42 /*{f-bup-background-end}*/)); /* Saf4+, Chrome */ - background-image: -webkit-linear-gradient( #333851 /*{f-bup-background-start}*/, #2a2d42 /*{f-bup-background-end}*/); /* Chrome 10+, Saf5.1+ */ - background-image: -moz-linear-gradient( #333851 /*{f-bup-background-start}*/, #2a2d42 /*{f-bup-background-end}*/); /* FF3.6 */ - background-image: -ms-linear-gradient( #333851 /*{f-bup-background-start}*/, #2a2d42 /*{f-bup-background-end}*/); /* IE10 */ - background-image: -o-linear-gradient( #333851 /*{f-bup-background-start}*/, #2a2d42 /*{f-bup-background-end}*/); /* Opera 11.10+ */ - background-image: linear-gradient( #333851 /*{f-bup-background-start}*/, #2a2d42 /*{f-bup-background-end}*/); -} -.ui-btn-up-f:visited, -.ui-btn-up-f a.ui-link-inherit { - color: #ffffff /*{f-bup-color}*/; -} -.ui-btn-hover-f { - border: 1px solid #363a55 /*{f-bhover-border}*/; - background: #363a55 /*{f-bhover-background-color}*/; - font-weight: bold; - color: #ffffff /*{f-bhover-color}*/; - text-shadow: 0 /*{f-bhover-shadow-x}*/ 1px /*{f-bhover-shadow-y}*/ 0 /*{f-bhover-shadow-radius}*/ #444444 /*{f-bhover-shadow-color}*/; - background-image: -webkit-gradient(linear, left top, left bottom, from( #3b3f5d /*{f-bhover-background-start}*/), to( #30344c /*{f-bhover-background-end}*/)); /* Saf4+, Chrome */ - background-image: -webkit-linear-gradient( #3b3f5d /*{f-bhover-background-start}*/, #30344c /*{f-bhover-background-end}*/); /* Chrome 10+, Saf5.1+ */ - background-image: -moz-linear-gradient( #3b3f5d /*{f-bhover-background-start}*/, #30344c /*{f-bhover-background-end}*/); /* FF3.6 */ - background-image: -ms-linear-gradient( #3b3f5d /*{f-bhover-background-start}*/, #30344c /*{f-bhover-background-end}*/); /* IE10 */ - background-image: -o-linear-gradient( #3b3f5d /*{f-bhover-background-start}*/, #30344c /*{f-bhover-background-end}*/); /* Opera 11.10+ */ - background-image: linear-gradient( #3b3f5d /*{f-bhover-background-start}*/, #30344c /*{f-bhover-background-end}*/); -} -.ui-btn-hover-f:visited, -.ui-btn-hover-f:hover, -.ui-btn-hover-f a.ui-link-inherit { - color: #ffffff /*{f-bhover-color}*/; -} -.ui-btn-down-f { - border: 1px solid #363a55 /*{f-bdown-border}*/; - background: #363a55 /*{f-bdown-background-color}*/; - font-weight: bold; - color: #ffffff /*{f-bdown-color}*/; - text-shadow: 0 /*{f-bdown-shadow-x}*/ 1px /*{f-bdown-shadow-y}*/ 0 /*{f-bdown-shadow-radius}*/ #444444 /*{f-bdown-shadow-color}*/; - background-image: -webkit-gradient(linear, left top, left bottom, from( #30344c /*{f-bdown-background-start}*/), to( #3b3f5d /*{f-bdown-background-end}*/)); /* Saf4+, Chrome */ - background-image: -webkit-linear-gradient( #30344c /*{f-bdown-background-start}*/, #3b3f5d /*{f-bdown-background-end}*/); /* Chrome 10+, Saf5.1+ */ - background-image: -moz-linear-gradient( #30344c /*{f-bdown-background-start}*/, #3b3f5d /*{f-bdown-background-end}*/); /* FF3.6 */ - background-image: -ms-linear-gradient( #30344c /*{f-bdown-background-start}*/, #3b3f5d /*{f-bdown-background-end}*/); /* IE10 */ - background-image: -o-linear-gradient( #30344c /*{f-bdown-background-start}*/, #3b3f5d /*{f-bdown-background-end}*/); /* Opera 11.10+ */ - background-image: linear-gradient( #30344c /*{f-bdown-background-start}*/, #3b3f5d /*{f-bdown-background-end}*/); -} -.ui-btn-down-f:visited, -.ui-btn-down-f:hover, -.ui-btn-down-f a.ui-link-inherit { - color: #ffffff /*{f-bdown-color}*/; -} -.ui-btn-up-f, -.ui-btn-hover-f, -.ui-btn-down-f { - font-family: sans-serif /*{global-font-family}*/; - text-decoration: none; -} - - -/* G ------------------------------------------------------------------------------------------------------------*/ -.ui-bar-g { - border: 1px solid #ffffff /*{g-bar-border}*/; - background: #ffffff /*{g-bar-background-color}*/; - color: #000000 /*{g-bar-color}*/; - font-weight: bold; - text-shadow: 0 /*{g-bar-shadow-x}*/ 1px /*{g-bar-shadow-y}*/ 0 /*{g-bar-shadow-radius}*/ #eeeeee /*{g-bar-shadow-color}*/; - background-image: -webkit-gradient(linear, left top, left bottom, from( #FFFFFF /*{g-bar-background-start}*/), to( #e5e5e5 /*{g-bar-background-end}*/)); /* Saf4+, Chrome */ - background-image: -webkit-linear-gradient( #FFFFFF /*{g-bar-background-start}*/, #e5e5e5 /*{g-bar-background-end}*/); /* Chrome 10+, Saf5.1+ */ - background-image: -moz-linear-gradient( #FFFFFF /*{g-bar-background-start}*/, #e5e5e5 /*{g-bar-background-end}*/); /* FF3.6 */ - background-image: -ms-linear-gradient( #FFFFFF /*{g-bar-background-start}*/, #e5e5e5 /*{g-bar-background-end}*/); /* IE10 */ - background-image: -o-linear-gradient( #FFFFFF /*{g-bar-background-start}*/, #e5e5e5 /*{g-bar-background-end}*/); /* Opera 11.10+ */ - background-image: linear-gradient( #FFFFFF /*{g-bar-background-start}*/, #e5e5e5 /*{g-bar-background-end}*/); -} -.ui-bar-g .ui-link-inherit { - color: #000000 /*{g-bar-color}*/; -} -.ui-bar-g a.ui-link { - color: #7cc4e7 /*{g-bar-link-color}*/; - font-weight: bold; -} -.ui-bar-g a.ui-link:visited { - color: #2489ce /*{g-bar-link-visited}*/; -} -.ui-bar-g a.ui-link:hover { - color: #2489ce /*{g-bar-link-hover}*/; -} -.ui-bar-g a.ui-link:active { - color: #2489ce /*{g-bar-link-active}*/; -} -.ui-bar-g, -.ui-bar-g input, -.ui-bar-g select, -.ui-bar-g textarea, -.ui-bar-g button { - font-family: sans-serif /*{global-font-family}*/; -} -.ui-body-g, -.ui-overlay-g { - border: 1px solid #8c8c8c /*{g-body-border}*/; - color: #000000 /*{g-body-color}*/; - text-shadow: 0 /*{g-body-shadow-x}*/ 1px /*{g-body-shadow-y}*/ 0 /*{g-body-shadow-radius}*/ #eeeeee /*{g-body-shadow-color}*/; - background: #ffffff /*{g-body-background-color}*/; - background-image: -webkit-gradient(linear, left top, left bottom, from( #FFFFFF /*{g-body-background-start}*/), to( #e5e5e5 /*{g-body-background-end}*/)); /* Saf4+, Chrome */ - background-image: -webkit-linear-gradient( #FFFFFF /*{g-body-background-start}*/, #e5e5e5 /*{g-body-background-end}*/); /* Chrome 10+, Saf5.1+ */ - background-image: -moz-linear-gradient( #FFFFFF /*{g-body-background-start}*/, #e5e5e5 /*{g-body-background-end}*/); /* FF3.6 */ - background-image: -ms-linear-gradient( #FFFFFF /*{g-body-background-start}*/, #e5e5e5 /*{g-body-background-end}*/); /* IE10 */ - background-image: -o-linear-gradient( #FFFFFF /*{g-body-background-start}*/, #e5e5e5 /*{g-body-background-end}*/); /* Opera 11.10+ */ - background-image: linear-gradient( #FFFFFF /*{g-body-background-start}*/, #e5e5e5 /*{g-body-background-end}*/); -} -.ui-overlay-g { - background-image: none; - border-width: 0; -} -.ui-body-g, -.ui-body-g input, -.ui-body-g select, -.ui-body-g textarea, -.ui-body-g button { - font-family: sans-serif /*{global-font-family}*/; -} -.ui-body-g .ui-link-inherit { - color: #000000 /*{g-body-color}*/; -} -.ui-body-g .ui-link { - color: #2489ce /*{g-body-link-color}*/; - font-weight: bold; -} -.ui-body-g .ui-link:visited { - color: #2489ce /*{g-body-link-visited}*/; -} -.ui-body-g .ui-link:hover { - color: #2489ce /*{g-body-link-hover}*/; -} -.ui-body-g .ui-link:active { - color: #2489ce /*{g-body-link-active}*/; -} -.ui-btn-up-g { - border: 1px solid #ffffff /*{g-bup-border}*/; - background: #ffffff /*{g-bup-background-color}*/; - font-weight: bold; - color: #000000 /*{g-bup-color}*/; - text-shadow: 0 /*{g-bup-shadow-x}*/ 1px /*{g-bup-shadow-y}*/ 0 /*{g-bup-shadow-radius}*/ #eeeeee /*{g-bup-shadow-color}*/; - background-image: -webkit-gradient(linear, left top, left bottom, from( #FFFFFF /*{g-bup-background-start}*/), to( #e5e5e5 /*{g-bup-background-end}*/)); /* Saf4+, Chrome */ - background-image: -webkit-linear-gradient( #FFFFFF /*{g-bup-background-start}*/, #e5e5e5 /*{g-bup-background-end}*/); /* Chrome 10+, Saf5.1+ */ - background-image: -moz-linear-gradient( #FFFFFF /*{g-bup-background-start}*/, #e5e5e5 /*{g-bup-background-end}*/); /* FF3.6 */ - background-image: -ms-linear-gradient( #FFFFFF /*{g-bup-background-start}*/, #e5e5e5 /*{g-bup-background-end}*/); /* IE10 */ - background-image: -o-linear-gradient( #FFFFFF /*{g-bup-background-start}*/, #e5e5e5 /*{g-bup-background-end}*/); /* Opera 11.10+ */ - background-image: linear-gradient( #FFFFFF /*{g-bup-background-start}*/, #e5e5e5 /*{g-bup-background-end}*/); -} -.ui-btn-up-g:visited, -.ui-btn-up-g a.ui-link-inherit { - color: #000000 /*{g-bup-color}*/; -} -.ui-btn-hover-g { - border: 1px solid #FFFFFF /*{g-bhover-border}*/; - background: #FFFFFF /*{g-bhover-background-color}*/; - font-weight: bold; - color: #000000 /*{g-bhover-color}*/; - text-shadow: 0 /*{g-bhover-shadow-x}*/ 1px /*{g-bhover-shadow-y}*/ 0 /*{g-bhover-shadow-radius}*/ #eeeeee /*{g-bhover-shadow-color}*/; - background-image: -webkit-gradient(linear, left top, left bottom, from( #FFFFFF /*{g-bhover-background-start}*/), to( #e5e5e5 /*{g-bhover-background-end}*/)); /* Saf4+, Chrome */ - background-image: -webkit-linear-gradient( #FFFFFF /*{g-bhover-background-start}*/, #e5e5e5 /*{g-bhover-background-end}*/); /* Chrome 10+, Saf5.1+ */ - background-image: -moz-linear-gradient( #FFFFFF /*{g-bhover-background-start}*/, #e5e5e5 /*{g-bhover-background-end}*/); /* FF3.6 */ - background-image: -ms-linear-gradient( #FFFFFF /*{g-bhover-background-start}*/, #e5e5e5 /*{g-bhover-background-end}*/); /* IE10 */ - background-image: -o-linear-gradient( #FFFFFF /*{g-bhover-background-start}*/, #e5e5e5 /*{g-bhover-background-end}*/); /* Opera 11.10+ */ - background-image: linear-gradient( #FFFFFF /*{g-bhover-background-start}*/, #e5e5e5 /*{g-bhover-background-end}*/); -} -.ui-btn-hover-g:visited, -.ui-btn-hover-g:hover, -.ui-btn-hover-g a.ui-link-inherit { - color: #000000 /*{g-bhover-color}*/; -} -.ui-btn-down-g { - border: 1px solid #FFFFFF /*{g-bdown-border}*/; - background: #FFFFFF /*{g-bdown-background-color}*/; - font-weight: bold; - color: #000000 /*{g-bdown-color}*/; - text-shadow: 0 /*{g-bdown-shadow-x}*/ 1px /*{g-bdown-shadow-y}*/ 0 /*{g-bdown-shadow-radius}*/ #eeeeee /*{g-bdown-shadow-color}*/; - background-image: -webkit-gradient(linear, left top, left bottom, from( #e5e5e5 /*{g-bdown-background-start}*/), to( #FFFFFF /*{g-bdown-background-end}*/)); /* Saf4+, Chrome */ - background-image: -webkit-linear-gradient( #e5e5e5 /*{g-bdown-background-start}*/, #FFFFFF /*{g-bdown-background-end}*/); /* Chrome 10+, Saf5.1+ */ - background-image: -moz-linear-gradient( #e5e5e5 /*{g-bdown-background-start}*/, #FFFFFF /*{g-bdown-background-end}*/); /* FF3.6 */ - background-image: -ms-linear-gradient( #e5e5e5 /*{g-bdown-background-start}*/, #FFFFFF /*{g-bdown-background-end}*/); /* IE10 */ - background-image: -o-linear-gradient( #e5e5e5 /*{g-bdown-background-start}*/, #FFFFFF /*{g-bdown-background-end}*/); /* Opera 11.10+ */ - background-image: linear-gradient( #e5e5e5 /*{g-bdown-background-start}*/, #FFFFFF /*{g-bdown-background-end}*/); -} -.ui-btn-down-g:visited, -.ui-btn-down-g:hover, -.ui-btn-down-g a.ui-link-inherit { - color: #000000 /*{g-bdown-color}*/; -} -.ui-btn-up-g, -.ui-btn-hover-g, -.ui-btn-down-g { - font-family: sans-serif /*{global-font-family}*/; - text-decoration: none; -} - - -/* Structure */ -/* links within "buttons" ------------------------------------------------------------------------------------------------------------*/ -a.ui-link-inherit { - text-decoration: none !important; -} -/* Active class used as the "on" state across all themes ------------------------------------------------------------------------------------------------------------*/ -.ui-btn-active { - border: 1px solid undefined /*{global-active-border}*/; - background: undefined /*{global-active-background-color}*/; - font-weight: bold; - color: undefined /*{global-active-color}*/; - cursor: pointer; - text-shadow: undefined /*{global-active-shadow-x}*/ undefined /*{global-active-shadow-y}*/ undefined /*{global-active-shadow-radius}*/ undefined /*{global-active-shadow-color}*/; - text-decoration: none; - background-image: -webkit-gradient(linear, left top, left bottom, from( undefined /*{global-active-background-start}*/), to( undefined /*{global-active-background-end}*/)); /* Saf4+, Chrome */ - background-image: -webkit-linear-gradient( undefined /*{global-active-background-start}*/, undefined /*{global-active-background-end}*/); /* Chrome 10+, Saf5.1+ */ - background-image: -moz-linear-gradient( undefined /*{global-active-background-start}*/, undefined /*{global-active-background-end}*/); /* FF3.6 */ - background-image: -ms-linear-gradient( undefined /*{global-active-background-start}*/, undefined /*{global-active-background-end}*/); /* IE10 */ - background-image: -o-linear-gradient( undefined /*{global-active-background-start}*/, undefined /*{global-active-background-end}*/); /* Opera 11.10+ */ - background-image: linear-gradient( undefined /*{global-active-background-start}*/, undefined /*{global-active-background-end}*/); - font-family: sans-serif /*{global-font-family}*/; -} -.ui-btn-active:visited, -.ui-btn-active:hover, -.ui-btn-active a.ui-link-inherit { - color: undefined /*{global-active-color}*/; -} -/* button inner top highlight ------------------------------------------------------------------------------------------------------------*/ -.ui-btn-inner { - border-top: 1px solid #fff; - border-color: rgba(255,255,255,.3); -} -/* corner rounding classes ------------------------------------------------------------------------------------------------------------*/ -.ui-corner-all { - -webkit-border-radius: .6em /*{global-radii-blocks}*/; - border-radius: .6em /*{global-radii-blocks}*/; -} -/* Form field separator ------------------------------------------------------------------------------------------------------------*/ -.ui-br { - border-color: rgb(130,130,130); - border-color: rgba(130,130,130,.3); - border-style: solid; -} -/* Interaction cues ------------------------------------------------------------------------------------------------------------*/ -.ui-disabled { - filter: Alpha(Opacity=30); - opacity: .3; - zoom: 1; -} -.ui-disabled, -.ui-disabled a { - cursor: default !important; - pointer-events: none; -} -/* Icons ------------------------------------------------------------------------------------------------------------*/ -.ui-icon, -.ui-icon-searchfield:after { - background: #999 /*{global-icon-color}*/; - background: rgba(0,0,0,.3) /*{global-icon-disc}*/; - background-image: undefined /*{global-icon-set}*/; - background-repeat: no-repeat; - -webkit-border-radius: 9px; - border-radius: 9px; -} -/* Alt icon color ------------------------------------------------------------------------------------------------------------*/ -.ui-icon-alt .ui-icon, -.ui-icon-alt .ui-icon-searchfield:after { - background-color: #fff; - background-color: rgba(255,255,255,.3); - background-image: url(images/icons-18-black.png); - background-repeat: no-repeat; -} -/* No disc ------------------------------------------------------------------------------------------------------------*/ -.ui-icon-nodisc .ui-icon, -.ui-icon-nodisc .ui-icon-searchfield:after, -.ui-icon-nodisc .ui-icon-alt .ui-icon, -.ui-icon-nodisc .ui-icon-alt .ui-icon-searchfield:after { - background-color: transparent; -} -/* Icon sprite ------------------------------------------------------------------------------------------------------------*/ -/* plus minus */ -.ui-icon-plus { - background-position: -1px -1px; -} -.ui-icon-minus { - background-position: -37px -1px; -} -/* delete/close */ -.ui-icon-delete { - background-position: -73px -1px; -} -/* arrows */ -.ui-icon-arrow-r { - background-position: -108px -1px; -} -.ui-icon-arrow-l { - background-position: -144px -1px; -} -.ui-icon-arrow-u { - background-position: -180px -1px; -} -.ui-icon-arrow-d { - background-position: -216px -1px; -} -/* misc */ -.ui-icon-check { - background-position: -252px -1px; -} -.ui-icon-gear { - background-position: -288px -1px; -} -.ui-icon-refresh { - background-position: -323px -1px; -} -.ui-icon-forward { - background-position: -360px -1px; -} -.ui-icon-back { - background-position: -396px -1px; -} -.ui-icon-grid { - background-position: -432px -1px; -} -.ui-icon-star { - background-position: -467px -1px; -} -.ui-icon-alert { - background-position: -503px -1px; -} -.ui-icon-info { - background-position: -539px -1px; -} -.ui-icon-home { - background-position: -575px -1px; -} -/* search */ -.ui-icon-search, -.ui-icon-searchfield:after { - background-position: -611px -1px; -} -/* checkbox radio */ -.ui-icon-checkbox-on { - background-position: -647px -1px; -} -.ui-icon-checkbox-off { - background-position: -683px -1px; -} -.ui-icon-radio-on { - background-position: -718px -1px; -} -.ui-icon-radio-off { - background-position: -754px -1px; -} -/* menu edit */ -.ui-icon-bars { - background-position: -788px -1px; -} -.ui-icon-edit { - background-position: -824px -1px; -} -/* HD/"retina" sprite ------------------------------------------------------------------------------------------------------------*/ -@media only screen and (-webkit-min-device-pixel-ratio: 1.3), - only screen and (min--moz-device-pixel-ratio: 1.3), - only screen and (min-resolution: 200dpi) { - - .ui-icon-plus, .ui-icon-minus, .ui-icon-delete, .ui-icon-arrow-r, - .ui-icon-arrow-l, .ui-icon-arrow-u, .ui-icon-arrow-d, .ui-icon-check, - .ui-icon-gear, .ui-icon-refresh, .ui-icon-forward, .ui-icon-back, - .ui-icon-grid, .ui-icon-star, .ui-icon-alert, .ui-icon-info, .ui-icon-home, .ui-icon-bars, .ui-icon-edit, - .ui-icon-search, .ui-icon-searchfield:after, - .ui-icon-checkbox-off, .ui-icon-checkbox-on, .ui-icon-radio-off, .ui-icon-radio-on { - background-image: url(images/icons-36-white.png); - -moz-background-size: 864px 18px; - -o-background-size: 864px 18px; - -webkit-background-size: 864px 18px; - background-size: 864px 18px; - } - .ui-icon-alt .ui-icon { - background-image: url(images/icons-36-black.png); - } - .ui-icon-plus { - background-position: 0 50%; - } - .ui-icon-minus { - background-position: -36px 50%; - } - .ui-icon-delete { - background-position: -72px 50%; - } - .ui-icon-arrow-r { - background-position: -108px 50%; - } - .ui-icon-arrow-l { - background-position: -144px 50%; - } - .ui-icon-arrow-u { - background-position: -179px 50%; - } - .ui-icon-arrow-d { - background-position: -215px 50%; - } - .ui-icon-check { - background-position: -252px 50%; - } - .ui-icon-gear { - background-position: -287px 50%; - } - .ui-icon-refresh { - background-position: -323px 50%; - } - .ui-icon-forward { - background-position: -360px 50%; - } - .ui-icon-back { - background-position: -395px 50%; - } - .ui-icon-grid { - background-position: -431px 50%; - } - .ui-icon-star { - background-position: -467px 50%; - } - .ui-icon-alert { - background-position: -503px 50%; - } - .ui-icon-info { - background-position: -538px 50%; - } - .ui-icon-home { - background-position: -575px 50%; - } - .ui-icon-search, - .ui-icon-searchfield:after { - background-position: -611px 50%; - } - .ui-icon-checkbox-on { - background-position: -647px 50%; - } - .ui-icon-checkbox-off { - background-position: -683px 50%; - } - .ui-icon-radio-on { - background-position: -718px 50%; - } - .ui-icon-radio-off { - background-position: -754px 50%; - } - .ui-icon-bars { - background-position: -788px 50%; - - }.ui-icon-edit { - background-position: -824px 50%; - } -} -/* checks,radios */ -.ui-checkbox .ui-icon, -.ui-selectmenu-list .ui-icon { - -webkit-border-radius: 3px; - border-radius: 3px; -} -.ui-icon-checkbox-off, -.ui-icon-radio-off { - background-color: transparent; -} -.ui-checkbox-on .ui-icon, -.ui-radio-on .ui-icon { - background-color: undefined /*{global-active-background-color}*/; /* NOTE: this hex should match the active state color. It's repeated here for cascade */ -} -/* loading icon */ -.ui-icon-loading { - background: url(images/ajax-loader.gif); - background-size: 46px 46px; -} -/* Button corner class ------------------------------------------------------------------------------------------------------------*/ -.ui-btn-corner-all { - -webkit-border-radius: .3125em /*{global-radii-buttons}*/; - border-radius: .3125em /*{global-radii-buttons}*/; -} -/* radius clip workaround for cleaning up corner trapping */ -.ui-corner-all, -.ui-btn-corner-all { - -webkit-background-clip: padding; - background-clip: padding-box; -} -/* Overlay / modal ------------------------------------------------------------------------------------------------------------*/ -.ui-overlay { - background: #666; - filter: Alpha(Opacity=50); - opacity: .5; - position: absolute; - width: 100%; - height: 100%; -} -.ui-overlay-shadow { - -moz-box-shadow: 0 0 12px rgba(0,0,0,.6); - -webkit-box-shadow: 0 0 12px rgba(0,0,0,.6); - box-shadow: 0 0 12px rgba(0,0,0,.6); -} -.ui-shadow { - -moz-box-shadow: 0 1px 3px /*{global-box-shadow-size}*/ rgba(0,0,0,.2) /*{global-box-shadow-color}*/; - -webkit-box-shadow: 0 1px 3px /*{global-box-shadow-size}*/ rgba(0,0,0,.2) /*{global-box-shadow-color}*/; - box-shadow: 0 1px 3px /*{global-box-shadow-size}*/ rgba(0,0,0,.2) /*{global-box-shadow-color}*/ -} -.ui-bar-a .ui-shadow, -.ui-bar-b .ui-shadow , -.ui-bar-c .ui-shadow { - -moz-box-shadow: 0 1px 0 rgba(255,255,255,.3); - -webkit-box-shadow: 0 1px 0 rgba(255,255,255,.3); - box-shadow: 0 1px 0 rgba(255,255,255,.3); -} -.ui-shadow-inset { - -moz-box-shadow: inset 0 1px 4px rgba(0,0,0,.2); - -webkit-box-shadow: inset 0 1px 4px rgba(0,0,0,.2); - box-shadow: inset 0 1px 4px rgba(0,0,0,.2); -} -.ui-icon-shadow { - -moz-box-shadow: 0 1px 0 rgba(255,255,255,.3) /*{global-icon-shadow}*/; - -webkit-box-shadow: 0 1px 0 rgba(255,255,255,.3) /*{global-icon-shadow}*/; - box-shadow: 0 1px 0 rgba(255,255,255,.3) /*{global-icon-shadow}*/; -} -/* Focus state - set here for specificity (note: these classes are added by JavaScript) ------------------------------------------------------------------------------------------------------------*/ -.ui-btn:focus, .ui-link-inherit:focus { - outline: 0; -} -.ui-btn.ui-focus { - z-index: 1; -} -.ui-focus, -.ui-btn:focus { - -moz-box-shadow: inset 0 0 3px undefined /*{global-active-background-color}*/, 0 0 9px undefined /*{global-active-background-color}*/; - -webkit-box-shadow: inset 0 0 3px undefined /*{global-active-background-color}*/, 0 0 9px undefined /*{global-active-background-color}*/; - box-shadow: inset 0 0 3px undefined /*{global-active-background-color}*/, 0 0 9px undefined /*{global-active-background-color}*/; -} -.ui-input-text.ui-focus, -.ui-input-search.ui-focus { - -moz-box-shadow: 0 0 12px undefined /*{global-active-background-color}*/; - -webkit-box-shadow: 0 0 12px undefined /*{global-active-background-color}*/; - box-shadow: 0 0 12px undefined /*{global-active-background-color}*/; -} -/* unset box shadow in browsers that don't do it right ------------------------------------------------------------------------------------------------------------*/ -.ui-mobile-nosupport-boxshadow * { - -moz-box-shadow: none !important; - -webkit-box-shadow: none !important; - box-shadow: none !important; -} -/* ...and bring back focus */ -.ui-mobile-nosupport-boxshadow .ui-focus, -.ui-mobile-nosupport-boxshadow .ui-btn:focus, -.ui-mobile-nosupport-boxshadow .ui-link-inherit:focus { - outline-width: 1px; - outline-style: auto; -} diff --git a/www/css/font-awesome.min.css b/www/css/font-awesome.min.css new file mode 100644 index 0000000..e51a505 --- /dev/null +++ b/www/css/font-awesome.min.css @@ -0,0 +1,4 @@ +/*! + * Font Awesome 4.2.0 by @davegandy - http://fontawesome.io - @fontawesome + * License - http://fontawesome.io/license (Font: SIL OFL 1.1, CSS: MIT License) + */@font-face{font-family:'FontAwesome';src:url('fonts/fontawesome-webfont.eot?v=4.2.0');src:url('../fonts/fontawesome-webfont.eot?#iefix&v=4.2.0') format('embedded-opentype'),url('../fonts/fontawesome-webfont.woff?v=4.2.0') format('woff'),url('../fonts/fontawesome-webfont.ttf?v=4.2.0') format('truetype'),url('../fonts/fontawesome-webfont.svg?v=4.2.0#fontawesomeregular') format('svg');font-weight:normal;font-style:normal}.fa{display:inline-block;font:normal normal normal 14px/1 FontAwesome;font-size:inherit;text-rendering:auto;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.fa-lg{font-size:1.33333333em;line-height:.75em;vertical-align:-15%}.fa-2x{font-size:2em}.fa-3x{font-size:3em}.fa-4x{font-size:4em}.fa-5x{font-size:5em}.fa-fw{width:1.28571429em;text-align:center}.fa-ul{padding-left:0;margin-left:2.14285714em;list-style-type:none}.fa-ul>li{position:relative}.fa-li{position:absolute;left:-2.14285714em;width:2.14285714em;top:.14285714em;text-align:center}.fa-li.fa-lg{left:-1.85714286em}.fa-border{padding:.2em .25em .15em;border:solid .08em #eee;border-radius:.1em}.pull-right{float:right}.pull-left{float:left}.fa.pull-left{margin-right:.3em}.fa.pull-right{margin-left:.3em}.fa-spin{-webkit-animation:fa-spin 2s infinite linear;animation:fa-spin 2s infinite linear}@-webkit-keyframes fa-spin{0%{-webkit-transform:rotate(0deg);transform:rotate(0deg)}100%{-webkit-transform:rotate(359deg);transform:rotate(359deg)}}@keyframes fa-spin{0%{-webkit-transform:rotate(0deg);transform:rotate(0deg)}100%{-webkit-transform:rotate(359deg);transform:rotate(359deg)}}.fa-rotate-90{filter:progid:DXImageTransform.Microsoft.BasicImage(rotation=1);-webkit-transform:rotate(90deg);-ms-transform:rotate(90deg);transform:rotate(90deg)}.fa-rotate-180{filter:progid:DXImageTransform.Microsoft.BasicImage(rotation=2);-webkit-transform:rotate(180deg);-ms-transform:rotate(180deg);transform:rotate(180deg)}.fa-rotate-270{filter:progid:DXImageTransform.Microsoft.BasicImage(rotation=3);-webkit-transform:rotate(270deg);-ms-transform:rotate(270deg);transform:rotate(270deg)}.fa-flip-horizontal{filter:progid:DXImageTransform.Microsoft.BasicImage(rotation=0, mirror=1);-webkit-transform:scale(-1, 1);-ms-transform:scale(-1, 1);transform:scale(-1, 1)}.fa-flip-vertical{filter:progid:DXImageTransform.Microsoft.BasicImage(rotation=2, mirror=1);-webkit-transform:scale(1, -1);-ms-transform:scale(1, -1);transform:scale(1, -1)}:root .fa-rotate-90,:root .fa-rotate-180,:root .fa-rotate-270,:root .fa-flip-horizontal,:root .fa-flip-vertical{filter:none}.fa-stack{position:relative;display:inline-block;width:2em;height:2em;line-height:2em;vertical-align:middle}.fa-stack-1x,.fa-stack-2x{position:absolute;left:0;width:100%;text-align:center}.fa-stack-1x{line-height:inherit}.fa-stack-2x{font-size:2em}.fa-inverse{color:#fff}.fa-glass:before{content:"\f000"}.fa-music:before{content:"\f001"}.fa-search:before{content:"\f002"}.fa-envelope-o:before{content:"\f003"}.fa-heart:before{content:"\f004"}.fa-star:before{content:"\f005"}.fa-star-o:before{content:"\f006"}.fa-user:before{content:"\f007"}.fa-film:before{content:"\f008"}.fa-th-large:before{content:"\f009"}.fa-th:before{content:"\f00a"}.fa-th-list:before{content:"\f00b"}.fa-check:before{content:"\f00c"}.fa-remove:before,.fa-close:before,.fa-times:before{content:"\f00d"}.fa-search-plus:before{content:"\f00e"}.fa-search-minus:before{content:"\f010"}.fa-power-off:before{content:"\f011"}.fa-signal:before{content:"\f012"}.fa-gear:before,.fa-cog:before{content:"\f013"}.fa-trash-o:before{content:"\f014"}.fa-home:before{content:"\f015"}.fa-file-o:before{content:"\f016"}.fa-clock-o:before{content:"\f017"}.fa-road:before{content:"\f018"}.fa-download:before{content:"\f019"}.fa-arrow-circle-o-down:before{content:"\f01a"}.fa-arrow-circle-o-up:before{content:"\f01b"}.fa-inbox:before{content:"\f01c"}.fa-play-circle-o:before{content:"\f01d"}.fa-rotate-right:before,.fa-repeat:before{content:"\f01e"}.fa-refresh:before{content:"\f021"}.fa-list-alt:before{content:"\f022"}.fa-lock:before{content:"\f023"}.fa-flag:before{content:"\f024"}.fa-headphones:before{content:"\f025"}.fa-volume-off:before{content:"\f026"}.fa-volume-down:before{content:"\f027"}.fa-volume-up:before{content:"\f028"}.fa-qrcode:before{content:"\f029"}.fa-barcode:before{content:"\f02a"}.fa-tag:before{content:"\f02b"}.fa-tags:before{content:"\f02c"}.fa-book:before{content:"\f02d"}.fa-bookmark:before{content:"\f02e"}.fa-print:before{content:"\f02f"}.fa-camera:before{content:"\f030"}.fa-font:before{content:"\f031"}.fa-bold:before{content:"\f032"}.fa-italic:before{content:"\f033"}.fa-text-height:before{content:"\f034"}.fa-text-width:before{content:"\f035"}.fa-align-left:before{content:"\f036"}.fa-align-center:before{content:"\f037"}.fa-align-right:before{content:"\f038"}.fa-align-justify:before{content:"\f039"}.fa-list:before{content:"\f03a"}.fa-dedent:before,.fa-outdent:before{content:"\f03b"}.fa-indent:before{content:"\f03c"}.fa-video-camera:before{content:"\f03d"}.fa-photo:before,.fa-image:before,.fa-picture-o:before{content:"\f03e"}.fa-pencil:before{content:"\f040"}.fa-map-marker:before{content:"\f041"}.fa-adjust:before{content:"\f042"}.fa-tint:before{content:"\f043"}.fa-edit:before,.fa-pencil-square-o:before{content:"\f044"}.fa-share-square-o:before{content:"\f045"}.fa-check-square-o:before{content:"\f046"}.fa-arrows:before{content:"\f047"}.fa-step-backward:before{content:"\f048"}.fa-fast-backward:before{content:"\f049"}.fa-backward:before{content:"\f04a"}.fa-play:before{content:"\f04b"}.fa-pause:before{content:"\f04c"}.fa-stop:before{content:"\f04d"}.fa-forward:before{content:"\f04e"}.fa-fast-forward:before{content:"\f050"}.fa-step-forward:before{content:"\f051"}.fa-eject:before{content:"\f052"}.fa-chevron-left:before{content:"\f053"}.fa-chevron-right:before{content:"\f054"}.fa-plus-circle:before{content:"\f055"}.fa-minus-circle:before{content:"\f056"}.fa-times-circle:before{content:"\f057"}.fa-check-circle:before{content:"\f058"}.fa-question-circle:before{content:"\f059"}.fa-info-circle:before{content:"\f05a"}.fa-crosshairs:before{content:"\f05b"}.fa-times-circle-o:before{content:"\f05c"}.fa-check-circle-o:before{content:"\f05d"}.fa-ban:before{content:"\f05e"}.fa-arrow-left:before{content:"\f060"}.fa-arrow-right:before{content:"\f061"}.fa-arrow-up:before{content:"\f062"}.fa-arrow-down:before{content:"\f063"}.fa-mail-forward:before,.fa-share:before{content:"\f064"}.fa-expand:before{content:"\f065"}.fa-compress:before{content:"\f066"}.fa-plus:before{content:"\f067"}.fa-minus:before{content:"\f068"}.fa-asterisk:before{content:"\f069"}.fa-exclamation-circle:before{content:"\f06a"}.fa-gift:before{content:"\f06b"}.fa-leaf:before{content:"\f06c"}.fa-fire:before{content:"\f06d"}.fa-eye:before{content:"\f06e"}.fa-eye-slash:before{content:"\f070"}.fa-warning:before,.fa-exclamation-triangle:before{content:"\f071"}.fa-plane:before{content:"\f072"}.fa-calendar:before{content:"\f073"}.fa-random:before{content:"\f074"}.fa-comment:before{content:"\f075"}.fa-magnet:before{content:"\f076"}.fa-chevron-up:before{content:"\f077"}.fa-chevron-down:before{content:"\f078"}.fa-retweet:before{content:"\f079"}.fa-shopping-cart:before{content:"\f07a"}.fa-folder:before{content:"\f07b"}.fa-folder-open:before{content:"\f07c"}.fa-arrows-v:before{content:"\f07d"}.fa-arrows-h:before{content:"\f07e"}.fa-bar-chart-o:before,.fa-bar-chart:before{content:"\f080"}.fa-twitter-square:before{content:"\f081"}.fa-facebook-square:before{content:"\f082"}.fa-camera-retro:before{content:"\f083"}.fa-key:before{content:"\f084"}.fa-gears:before,.fa-cogs:before{content:"\f085"}.fa-comments:before{content:"\f086"}.fa-thumbs-o-up:before{content:"\f087"}.fa-thumbs-o-down:before{content:"\f088"}.fa-star-half:before{content:"\f089"}.fa-heart-o:before{content:"\f08a"}.fa-sign-out:before{content:"\f08b"}.fa-linkedin-square:before{content:"\f08c"}.fa-thumb-tack:before{content:"\f08d"}.fa-external-link:before{content:"\f08e"}.fa-sign-in:before{content:"\f090"}.fa-trophy:before{content:"\f091"}.fa-github-square:before{content:"\f092"}.fa-upload:before{content:"\f093"}.fa-lemon-o:before{content:"\f094"}.fa-phone:before{content:"\f095"}.fa-square-o:before{content:"\f096"}.fa-bookmark-o:before{content:"\f097"}.fa-phone-square:before{content:"\f098"}.fa-twitter:before{content:"\f099"}.fa-facebook:before{content:"\f09a"}.fa-github:before{content:"\f09b"}.fa-unlock:before{content:"\f09c"}.fa-credit-card:before{content:"\f09d"}.fa-rss:before{content:"\f09e"}.fa-hdd-o:before{content:"\f0a0"}.fa-bullhorn:before{content:"\f0a1"}.fa-bell:before{content:"\f0f3"}.fa-certificate:before{content:"\f0a3"}.fa-hand-o-right:before{content:"\f0a4"}.fa-hand-o-left:before{content:"\f0a5"}.fa-hand-o-up:before{content:"\f0a6"}.fa-hand-o-down:before{content:"\f0a7"}.fa-arrow-circle-left:before{content:"\f0a8"}.fa-arrow-circle-right:before{content:"\f0a9"}.fa-arrow-circle-up:before{content:"\f0aa"}.fa-arrow-circle-down:before{content:"\f0ab"}.fa-globe:before{content:"\f0ac"}.fa-wrench:before{content:"\f0ad"}.fa-tasks:before{content:"\f0ae"}.fa-filter:before{content:"\f0b0"}.fa-briefcase:before{content:"\f0b1"}.fa-arrows-alt:before{content:"\f0b2"}.fa-group:before,.fa-users:before{content:"\f0c0"}.fa-chain:before,.fa-link:before{content:"\f0c1"}.fa-cloud:before{content:"\f0c2"}.fa-flask:before{content:"\f0c3"}.fa-cut:before,.fa-scissors:before{content:"\f0c4"}.fa-copy:before,.fa-files-o:before{content:"\f0c5"}.fa-paperclip:before{content:"\f0c6"}.fa-save:before,.fa-floppy-o:before{content:"\f0c7"}.fa-square:before{content:"\f0c8"}.fa-navicon:before,.fa-reorder:before,.fa-bars:before{content:"\f0c9"}.fa-list-ul:before{content:"\f0ca"}.fa-list-ol:before{content:"\f0cb"}.fa-strikethrough:before{content:"\f0cc"}.fa-underline:before{content:"\f0cd"}.fa-table:before{content:"\f0ce"}.fa-magic:before{content:"\f0d0"}.fa-truck:before{content:"\f0d1"}.fa-pinterest:before{content:"\f0d2"}.fa-pinterest-square:before{content:"\f0d3"}.fa-google-plus-square:before{content:"\f0d4"}.fa-google-plus:before{content:"\f0d5"}.fa-money:before{content:"\f0d6"}.fa-caret-down:before{content:"\f0d7"}.fa-caret-up:before{content:"\f0d8"}.fa-caret-left:before{content:"\f0d9"}.fa-caret-right:before{content:"\f0da"}.fa-columns:before{content:"\f0db"}.fa-unsorted:before,.fa-sort:before{content:"\f0dc"}.fa-sort-down:before,.fa-sort-desc:before{content:"\f0dd"}.fa-sort-up:before,.fa-sort-asc:before{content:"\f0de"}.fa-envelope:before{content:"\f0e0"}.fa-linkedin:before{content:"\f0e1"}.fa-rotate-left:before,.fa-undo:before{content:"\f0e2"}.fa-legal:before,.fa-gavel:before{content:"\f0e3"}.fa-dashboard:before,.fa-tachometer:before{content:"\f0e4"}.fa-comment-o:before{content:"\f0e5"}.fa-comments-o:before{content:"\f0e6"}.fa-flash:before,.fa-bolt:before{content:"\f0e7"}.fa-sitemap:before{content:"\f0e8"}.fa-umbrella:before{content:"\f0e9"}.fa-paste:before,.fa-clipboard:before{content:"\f0ea"}.fa-lightbulb-o:before{content:"\f0eb"}.fa-exchange:before{content:"\f0ec"}.fa-cloud-download:before{content:"\f0ed"}.fa-cloud-upload:before{content:"\f0ee"}.fa-user-md:before{content:"\f0f0"}.fa-stethoscope:before{content:"\f0f1"}.fa-suitcase:before{content:"\f0f2"}.fa-bell-o:before{content:"\f0a2"}.fa-coffee:before{content:"\f0f4"}.fa-cutlery:before{content:"\f0f5"}.fa-file-text-o:before{content:"\f0f6"}.fa-building-o:before{content:"\f0f7"}.fa-hospital-o:before{content:"\f0f8"}.fa-ambulance:before{content:"\f0f9"}.fa-medkit:before{content:"\f0fa"}.fa-fighter-jet:before{content:"\f0fb"}.fa-beer:before{content:"\f0fc"}.fa-h-square:before{content:"\f0fd"}.fa-plus-square:before{content:"\f0fe"}.fa-angle-double-left:before{content:"\f100"}.fa-angle-double-right:before{content:"\f101"}.fa-angle-double-up:before{content:"\f102"}.fa-angle-double-down:before{content:"\f103"}.fa-angle-left:before{content:"\f104"}.fa-angle-right:before{content:"\f105"}.fa-angle-up:before{content:"\f106"}.fa-angle-down:before{content:"\f107"}.fa-desktop:before{content:"\f108"}.fa-laptop:before{content:"\f109"}.fa-tablet:before{content:"\f10a"}.fa-mobile-phone:before,.fa-mobile:before{content:"\f10b"}.fa-circle-o:before{content:"\f10c"}.fa-quote-left:before{content:"\f10d"}.fa-quote-right:before{content:"\f10e"}.fa-spinner:before{content:"\f110"}.fa-circle:before{content:"\f111"}.fa-mail-reply:before,.fa-reply:before{content:"\f112"}.fa-github-alt:before{content:"\f113"}.fa-folder-o:before{content:"\f114"}.fa-folder-open-o:before{content:"\f115"}.fa-smile-o:before{content:"\f118"}.fa-frown-o:before{content:"\f119"}.fa-meh-o:before{content:"\f11a"}.fa-gamepad:before{content:"\f11b"}.fa-keyboard-o:before{content:"\f11c"}.fa-flag-o:before{content:"\f11d"}.fa-flag-checkered:before{content:"\f11e"}.fa-terminal:before{content:"\f120"}.fa-code:before{content:"\f121"}.fa-mail-reply-all:before,.fa-reply-all:before{content:"\f122"}.fa-star-half-empty:before,.fa-star-half-full:before,.fa-star-half-o:before{content:"\f123"}.fa-location-arrow:before{content:"\f124"}.fa-crop:before{content:"\f125"}.fa-code-fork:before{content:"\f126"}.fa-unlink:before,.fa-chain-broken:before{content:"\f127"}.fa-question:before{content:"\f128"}.fa-info:before{content:"\f129"}.fa-exclamation:before{content:"\f12a"}.fa-superscript:before{content:"\f12b"}.fa-subscript:before{content:"\f12c"}.fa-eraser:before{content:"\f12d"}.fa-puzzle-piece:before{content:"\f12e"}.fa-microphone:before{content:"\f130"}.fa-microphone-slash:before{content:"\f131"}.fa-shield:before{content:"\f132"}.fa-calendar-o:before{content:"\f133"}.fa-fire-extinguisher:before{content:"\f134"}.fa-rocket:before{content:"\f135"}.fa-maxcdn:before{content:"\f136"}.fa-chevron-circle-left:before{content:"\f137"}.fa-chevron-circle-right:before{content:"\f138"}.fa-chevron-circle-up:before{content:"\f139"}.fa-chevron-circle-down:before{content:"\f13a"}.fa-html5:before{content:"\f13b"}.fa-css3:before{content:"\f13c"}.fa-anchor:before{content:"\f13d"}.fa-unlock-alt:before{content:"\f13e"}.fa-bullseye:before{content:"\f140"}.fa-ellipsis-h:before{content:"\f141"}.fa-ellipsis-v:before{content:"\f142"}.fa-rss-square:before{content:"\f143"}.fa-play-circle:before{content:"\f144"}.fa-ticket:before{content:"\f145"}.fa-minus-square:before{content:"\f146"}.fa-minus-square-o:before{content:"\f147"}.fa-level-up:before{content:"\f148"}.fa-level-down:before{content:"\f149"}.fa-check-square:before{content:"\f14a"}.fa-pencil-square:before{content:"\f14b"}.fa-external-link-square:before{content:"\f14c"}.fa-share-square:before{content:"\f14d"}.fa-compass:before{content:"\f14e"}.fa-toggle-down:before,.fa-caret-square-o-down:before{content:"\f150"}.fa-toggle-up:before,.fa-caret-square-o-up:before{content:"\f151"}.fa-toggle-right:before,.fa-caret-square-o-right:before{content:"\f152"}.fa-euro:before,.fa-eur:before{content:"\f153"}.fa-gbp:before{content:"\f154"}.fa-dollar:before,.fa-usd:before{content:"\f155"}.fa-rupee:before,.fa-inr:before{content:"\f156"}.fa-cny:before,.fa-rmb:before,.fa-yen:before,.fa-jpy:before{content:"\f157"}.fa-ruble:before,.fa-rouble:before,.fa-rub:before{content:"\f158"}.fa-won:before,.fa-krw:before{content:"\f159"}.fa-bitcoin:before,.fa-btc:before{content:"\f15a"}.fa-file:before{content:"\f15b"}.fa-file-text:before{content:"\f15c"}.fa-sort-alpha-asc:before{content:"\f15d"}.fa-sort-alpha-desc:before{content:"\f15e"}.fa-sort-amount-asc:before{content:"\f160"}.fa-sort-amount-desc:before{content:"\f161"}.fa-sort-numeric-asc:before{content:"\f162"}.fa-sort-numeric-desc:before{content:"\f163"}.fa-thumbs-up:before{content:"\f164"}.fa-thumbs-down:before{content:"\f165"}.fa-youtube-square:before{content:"\f166"}.fa-youtube:before{content:"\f167"}.fa-xing:before{content:"\f168"}.fa-xing-square:before{content:"\f169"}.fa-youtube-play:before{content:"\f16a"}.fa-dropbox:before{content:"\f16b"}.fa-stack-overflow:before{content:"\f16c"}.fa-instagram:before{content:"\f16d"}.fa-flickr:before{content:"\f16e"}.fa-adn:before{content:"\f170"}.fa-bitbucket:before{content:"\f171"}.fa-bitbucket-square:before{content:"\f172"}.fa-tumblr:before{content:"\f173"}.fa-tumblr-square:before{content:"\f174"}.fa-long-arrow-down:before{content:"\f175"}.fa-long-arrow-up:before{content:"\f176"}.fa-long-arrow-left:before{content:"\f177"}.fa-long-arrow-right:before{content:"\f178"}.fa-apple:before{content:"\f179"}.fa-windows:before{content:"\f17a"}.fa-android:before{content:"\f17b"}.fa-linux:before{content:"\f17c"}.fa-dribbble:before{content:"\f17d"}.fa-skype:before{content:"\f17e"}.fa-foursquare:before{content:"\f180"}.fa-trello:before{content:"\f181"}.fa-female:before{content:"\f182"}.fa-male:before{content:"\f183"}.fa-gittip:before{content:"\f184"}.fa-sun-o:before{content:"\f185"}.fa-moon-o:before{content:"\f186"}.fa-archive:before{content:"\f187"}.fa-bug:before{content:"\f188"}.fa-vk:before{content:"\f189"}.fa-weibo:before{content:"\f18a"}.fa-renren:before{content:"\f18b"}.fa-pagelines:before{content:"\f18c"}.fa-stack-exchange:before{content:"\f18d"}.fa-arrow-circle-o-right:before{content:"\f18e"}.fa-arrow-circle-o-left:before{content:"\f190"}.fa-toggle-left:before,.fa-caret-square-o-left:before{content:"\f191"}.fa-dot-circle-o:before{content:"\f192"}.fa-wheelchair:before{content:"\f193"}.fa-vimeo-square:before{content:"\f194"}.fa-turkish-lira:before,.fa-try:before{content:"\f195"}.fa-plus-square-o:before{content:"\f196"}.fa-space-shuttle:before{content:"\f197"}.fa-slack:before{content:"\f198"}.fa-envelope-square:before{content:"\f199"}.fa-wordpress:before{content:"\f19a"}.fa-openid:before{content:"\f19b"}.fa-institution:before,.fa-bank:before,.fa-university:before{content:"\f19c"}.fa-mortar-board:before,.fa-graduation-cap:before{content:"\f19d"}.fa-yahoo:before{content:"\f19e"}.fa-google:before{content:"\f1a0"}.fa-reddit:before{content:"\f1a1"}.fa-reddit-square:before{content:"\f1a2"}.fa-stumbleupon-circle:before{content:"\f1a3"}.fa-stumbleupon:before{content:"\f1a4"}.fa-delicious:before{content:"\f1a5"}.fa-digg:before{content:"\f1a6"}.fa-pied-piper:before{content:"\f1a7"}.fa-pied-piper-alt:before{content:"\f1a8"}.fa-drupal:before{content:"\f1a9"}.fa-joomla:before{content:"\f1aa"}.fa-language:before{content:"\f1ab"}.fa-fax:before{content:"\f1ac"}.fa-building:before{content:"\f1ad"}.fa-child:before{content:"\f1ae"}.fa-paw:before{content:"\f1b0"}.fa-spoon:before{content:"\f1b1"}.fa-cube:before{content:"\f1b2"}.fa-cubes:before{content:"\f1b3"}.fa-behance:before{content:"\f1b4"}.fa-behance-square:before{content:"\f1b5"}.fa-steam:before{content:"\f1b6"}.fa-steam-square:before{content:"\f1b7"}.fa-recycle:before{content:"\f1b8"}.fa-automobile:before,.fa-car:before{content:"\f1b9"}.fa-cab:before,.fa-taxi:before{content:"\f1ba"}.fa-tree:before{content:"\f1bb"}.fa-spotify:before{content:"\f1bc"}.fa-deviantart:before{content:"\f1bd"}.fa-soundcloud:before{content:"\f1be"}.fa-database:before{content:"\f1c0"}.fa-file-pdf-o:before{content:"\f1c1"}.fa-file-word-o:before{content:"\f1c2"}.fa-file-excel-o:before{content:"\f1c3"}.fa-file-powerpoint-o:before{content:"\f1c4"}.fa-file-photo-o:before,.fa-file-picture-o:before,.fa-file-image-o:before{content:"\f1c5"}.fa-file-zip-o:before,.fa-file-archive-o:before{content:"\f1c6"}.fa-file-sound-o:before,.fa-file-audio-o:before{content:"\f1c7"}.fa-file-movie-o:before,.fa-file-video-o:before{content:"\f1c8"}.fa-file-code-o:before{content:"\f1c9"}.fa-vine:before{content:"\f1ca"}.fa-codepen:before{content:"\f1cb"}.fa-jsfiddle:before{content:"\f1cc"}.fa-life-bouy:before,.fa-life-buoy:before,.fa-life-saver:before,.fa-support:before,.fa-life-ring:before{content:"\f1cd"}.fa-circle-o-notch:before{content:"\f1ce"}.fa-ra:before,.fa-rebel:before{content:"\f1d0"}.fa-ge:before,.fa-empire:before{content:"\f1d1"}.fa-git-square:before{content:"\f1d2"}.fa-git:before{content:"\f1d3"}.fa-hacker-news:before{content:"\f1d4"}.fa-tencent-weibo:before{content:"\f1d5"}.fa-qq:before{content:"\f1d6"}.fa-wechat:before,.fa-weixin:before{content:"\f1d7"}.fa-send:before,.fa-paper-plane:before{content:"\f1d8"}.fa-send-o:before,.fa-paper-plane-o:before{content:"\f1d9"}.fa-history:before{content:"\f1da"}.fa-circle-thin:before{content:"\f1db"}.fa-header:before{content:"\f1dc"}.fa-paragraph:before{content:"\f1dd"}.fa-sliders:before{content:"\f1de"}.fa-share-alt:before{content:"\f1e0"}.fa-share-alt-square:before{content:"\f1e1"}.fa-bomb:before{content:"\f1e2"}.fa-soccer-ball-o:before,.fa-futbol-o:before{content:"\f1e3"}.fa-tty:before{content:"\f1e4"}.fa-binoculars:before{content:"\f1e5"}.fa-plug:before{content:"\f1e6"}.fa-slideshare:before{content:"\f1e7"}.fa-twitch:before{content:"\f1e8"}.fa-yelp:before{content:"\f1e9"}.fa-newspaper-o:before{content:"\f1ea"}.fa-wifi:before{content:"\f1eb"}.fa-calculator:before{content:"\f1ec"}.fa-paypal:before{content:"\f1ed"}.fa-google-wallet:before{content:"\f1ee"}.fa-cc-visa:before{content:"\f1f0"}.fa-cc-mastercard:before{content:"\f1f1"}.fa-cc-discover:before{content:"\f1f2"}.fa-cc-amex:before{content:"\f1f3"}.fa-cc-paypal:before{content:"\f1f4"}.fa-cc-stripe:before{content:"\f1f5"}.fa-bell-slash:before{content:"\f1f6"}.fa-bell-slash-o:before{content:"\f1f7"}.fa-trash:before{content:"\f1f8"}.fa-copyright:before{content:"\f1f9"}.fa-at:before{content:"\f1fa"}.fa-eyedropper:before{content:"\f1fb"}.fa-paint-brush:before{content:"\f1fc"}.fa-birthday-cake:before{content:"\f1fd"}.fa-area-chart:before{content:"\f1fe"}.fa-pie-chart:before{content:"\f200"}.fa-line-chart:before{content:"\f201"}.fa-lastfm:before{content:"\f202"}.fa-lastfm-square:before{content:"\f203"}.fa-toggle-off:before{content:"\f204"}.fa-toggle-on:before{content:"\f205"}.fa-bicycle:before{content:"\f206"}.fa-bus:before{content:"\f207"}.fa-ioxhost:before{content:"\f208"}.fa-angellist:before{content:"\f209"}.fa-cc:before{content:"\f20a"}.fa-shekel:before,.fa-sheqel:before,.fa-ils:before{content:"\f20b"}.fa-meanpath:before{content:"\f20c"} \ No newline at end of file diff --git a/www/css/framework7.css b/www/css/framework7.css new file mode 100755 index 0000000..41e7b7e --- /dev/null +++ b/www/css/framework7.css @@ -0,0 +1,5108 @@ +/* + * Framework7 0.10.0 + * Full Featured HTML Framework For Building iOS 7 Apps + * + * http://www.idangero.us/framework7 + * + * Copyright 2014, Vladimir Kharlampidi + * The iDangero.us + * http://www.idangero.us/ + * + * Licensed under MIT + * + * Released on: December 8, 2014 +*/ +html, +body { + position: relative; + height: 100%; + width: 100%; + overflow-x: hidden; +} +body { + font-family: Helvetica Neue, Helvetica, Arial, sans-serif; + margin: 0; + padding: 0; + color: #000; + font-size: 14px; + line-height: 1.4; + width: 100%; + -webkit-text-size-adjust: 100%; + background: #fff; + overflow: hidden; +} +@media all and (width: 1024px) and (height: 691px) and (orientation: landscape) { + html, + body { + height: 671px; + } +} +@media all and (width: 1024px) and (height: 692px) and (orientation: landscape) { + html, + body { + height: 672px; + } +} +* { + -webkit-tap-highlight-color: rgba(0, 0, 0, 0); + -webkit-touch-callout: none; +} +a, +input, +textarea, +select { + outline: 0; +} +a { + text-decoration: none; + color: #007aff; +} +p { + margin: 1em 0; +} +/* === Grid === */ +.row { + display: -webkit-box; + display: -ms-flexbox; + display: -webkit-flex; + display: flex; + -webkit-box-pack: justify; + -ms-flex-pack: justify; + -webkit-justify-content: space-between; + justify-content: space-between; + -webkit-box-lines: multiple; + -moz-box-lines: multiple; + -webkit-flex-wrap: wrap; + -ms-flex-wrap: wrap; + flex-wrap: wrap; + -webkit-box-align: start; + -ms-flex-align: start; + -webkit-align-items: flex-start; + align-items: flex-start; +} +.row > [class*="col-"] { + -webkit-box-sizing: border-box; + -moz-box-sizing: border-box; + box-sizing: border-box; +} +.row .col-100 { + width: 100%; + width: -webkit-calc( (100% - 15px*0) / 1); + width: calc( (100% - 15px*0) / 1); +} +.row.no-gutter .col-100 { + width: 100%; +} +.row .col-95 { + width: 95%; + width: -webkit-calc( (100% - 15px*0.05263157894736836) / 1.0526315789473684); + width: calc( (100% - 15px*0.05263157894736836) / 1.0526315789473684); +} +.row.no-gutter .col-95 { + width: 95%; +} +.row .col-90 { + width: 90%; + width: -webkit-calc( (100% - 15px*0.11111111111111116) / 1.1111111111111112); + width: calc( (100% - 15px*0.11111111111111116) / 1.1111111111111112); +} +.row.no-gutter .col-90 { + width: 90%; +} +.row .col-85 { + width: 85%; + width: -webkit-calc( (100% - 15px*0.17647058823529416) / 1.1764705882352942); + width: calc( (100% - 15px*0.17647058823529416) / 1.1764705882352942); +} +.row.no-gutter .col-85 { + width: 85%; +} +.row .col-80 { + width: 80%; + width: -webkit-calc( (100% - 15px*0.25) / 1.25); + width: calc( (100% - 15px*0.25) / 1.25); +} +.row.no-gutter .col-80 { + width: 80%; +} +.row .col-75 { + width: 75%; + width: -webkit-calc( (100% - 15px*0.33333333333333326) / 1.3333333333333333); + width: calc( (100% - 15px*0.33333333333333326) / 1.3333333333333333); +} +.row.no-gutter .col-75 { + width: 75%; +} +.row .col-66 { + width: 66.66666666666666%; + width: -webkit-calc( (100% - 15px*0.5000000000000002) / 1.5000000000000002); + width: calc( (100% - 15px*0.5000000000000002) / 1.5000000000000002); +} +.row.no-gutter .col-66 { + width: 66.66666666666666%; +} +.row .col-60 { + width: 60%; + width: -webkit-calc( (100% - 15px*0.6666666666666667) / 1.6666666666666667); + width: calc( (100% - 15px*0.6666666666666667) / 1.6666666666666667); +} +.row.no-gutter .col-60 { + width: 60%; +} +.row .col-50 { + width: 50%; + width: -webkit-calc( (100% - 15px*1) / 2); + width: calc( (100% - 15px*1) / 2); +} +.row.no-gutter .col-50 { + width: 50%; +} +.row .col-40 { + width: 40%; + width: -webkit-calc( (100% - 15px*1.5) / 2.5); + width: calc( (100% - 15px*1.5) / 2.5); +} +.row.no-gutter .col-40 { + width: 40%; +} +.row .col-33 { + width: 33.333333333333336%; + width: -webkit-calc( (100% - 15px*2) / 3); + width: calc( (100% - 15px*2) / 3); +} +.row.no-gutter .col-33 { + width: 33.333333333333336%; +} +.row .col-25 { + width: 25%; + width: -webkit-calc( (100% - 15px*3) / 4); + width: calc( (100% - 15px*3) / 4); +} +.row.no-gutter .col-25 { + width: 25%; +} +.row .col-20 { + width: 20%; + width: -webkit-calc( (100% - 15px*4) / 5); + width: calc( (100% - 15px*4) / 5); +} +.row.no-gutter .col-20 { + width: 20%; +} +.row .col-15 { + width: 15%; + width: -webkit-calc( (100% - 15px*5.666666666666667) / 6.666666666666667); + width: calc( (100% - 15px*5.666666666666667) / 6.666666666666667); +} +.row.no-gutter .col-15 { + width: 15%; +} +.row .col-10 { + width: 10%; + width: -webkit-calc( (100% - 15px*9) / 10); + width: calc( (100% - 15px*9) / 10); +} +.row.no-gutter .col-10 { + width: 10%; +} +.row .col-5 { + width: 5%; + width: -webkit-calc( (100% - 15px*19) / 20); + width: calc( (100% - 15px*19) / 20); +} +.row.no-gutter .col-5 { + width: 5%; +} +@media all and (min-width: 768px) { + .row .tablet-100 { + width: 100%; + width: -webkit-calc( (100% - 15px*0) / 1); + width: calc( (100% - 15px*0) / 1); + } + .row.no-gutter .tablet-100 { + width: 100%; + } + .row .tablet-95 { + width: 95%; + width: -webkit-calc( (100% - 15px*0.05263157894736836) / 1.0526315789473684); + width: calc( (100% - 15px*0.05263157894736836) / 1.0526315789473684); + } + .row.no-gutter .tablet-95 { + width: 95%; + } + .row .tablet-90 { + width: 90%; + width: -webkit-calc( (100% - 15px*0.11111111111111116) / 1.1111111111111112); + width: calc( (100% - 15px*0.11111111111111116) / 1.1111111111111112); + } + .row.no-gutter .tablet-90 { + width: 90%; + } + .row .tablet-85 { + width: 85%; + width: -webkit-calc( (100% - 15px*0.17647058823529416) / 1.1764705882352942); + width: calc( (100% - 15px*0.17647058823529416) / 1.1764705882352942); + } + .row.no-gutter .tablet-85 { + width: 85%; + } + .row .tablet-80 { + width: 80%; + width: -webkit-calc( (100% - 15px*0.25) / 1.25); + width: calc( (100% - 15px*0.25) / 1.25); + } + .row.no-gutter .tablet-80 { + width: 80%; + } + .row .tablet-75 { + width: 75%; + width: -webkit-calc( (100% - 15px*0.33333333333333326) / 1.3333333333333333); + width: calc( (100% - 15px*0.33333333333333326) / 1.3333333333333333); + } + .row.no-gutter .tablet-75 { + width: 75%; + } + .row .tablet-66 { + width: 66.66666666666666%; + width: -webkit-calc( (100% - 15px*0.5000000000000002) / 1.5000000000000002); + width: calc( (100% - 15px*0.5000000000000002) / 1.5000000000000002); + } + .row.no-gutter .tablet-66 { + width: 66.66666666666666%; + } + .row .tablet-60 { + width: 60%; + width: -webkit-calc( (100% - 15px*0.6666666666666667) / 1.6666666666666667); + width: calc( (100% - 15px*0.6666666666666667) / 1.6666666666666667); + } + .row.no-gutter .tablet-60 { + width: 60%; + } + .row .tablet-50 { + width: 50%; + width: -webkit-calc( (100% - 15px*1) / 2); + width: calc( (100% - 15px*1) / 2); + } + .row.no-gutter .tablet-50 { + width: 50%; + } + .row .tablet-40 { + width: 40%; + width: -webkit-calc( (100% - 15px*1.5) / 2.5); + width: calc( (100% - 15px*1.5) / 2.5); + } + .row.no-gutter .tablet-40 { + width: 40%; + } + .row .tablet-33 { + width: 33.333333333333336%; + width: -webkit-calc( (100% - 15px*2) / 3); + width: calc( (100% - 15px*2) / 3); + } + .row.no-gutter .tablet-33 { + width: 33.333333333333336%; + } + .row .tablet-25 { + width: 25%; + width: -webkit-calc( (100% - 15px*3) / 4); + width: calc( (100% - 15px*3) / 4); + } + .row.no-gutter .tablet-25 { + width: 25%; + } + .row .tablet-20 { + width: 20%; + width: -webkit-calc( (100% - 15px*4) / 5); + width: calc( (100% - 15px*4) / 5); + } + .row.no-gutter .tablet-20 { + width: 20%; + } + .row .tablet-15 { + width: 15%; + width: -webkit-calc( (100% - 15px*5.666666666666667) / 6.666666666666667); + width: calc( (100% - 15px*5.666666666666667) / 6.666666666666667); + } + .row.no-gutter .tablet-15 { + width: 15%; + } + .row .tablet-10 { + width: 10%; + width: -webkit-calc( (100% - 15px*9) / 10); + width: calc( (100% - 15px*9) / 10); + } + .row.no-gutter .tablet-10 { + width: 10%; + } + .row .tablet-5 { + width: 5%; + width: -webkit-calc( (100% - 15px*19) / 20); + width: calc( (100% - 15px*19) / 20); + } + .row.no-gutter .tablet-5 { + width: 5%; + } +} +/* === Views === */ +.views, +.view { + position: relative; + width: 100%; + height: 100%; + z-index: 5000; +} +.views { + overflow: auto; + -webkit-overflow-scrolling: touch; +} +.view { + overflow: hidden; + -webkit-box-sizing: border-box; + -moz-box-sizing: border-box; + box-sizing: border-box; +} +/* === Pages === */ +.pages { + position: relative; + width: 100%; + height: 100%; + overflow: hidden; + background: #000; +} +.page { + -webkit-box-sizing: border-box; + -moz-box-sizing: border-box; + box-sizing: border-box; + position: absolute; + left: 0; + top: 0; + width: 100%; + height: 100%; + overflow: hidden; + background: #efeff4; + -webkit-transform: translate3d(0, 0, 0); + -ms-transform: translate3d(0, 0, 0); + transform: translate3d(0, 0, 0); + opacity: 1; + -webkit-box-shadow: none; + box-shadow: none; +} +.page.cached { + display: none; +} +.page-on-left { + opacity: 0.9; + -webkit-box-shadow: 0 0 12px rgba(0, 0, 0, 0.5); + box-shadow: 0 0 12px rgba(0, 0, 0, 0.5); + -webkit-transform: translate3d(-20%, 0, 0); + -ms-transform: translate3d(-20%, 0, 0); + transform: translate3d(-20%, 0, 0); +} +.page-on-center { + opacity: 1; + -webkit-box-shadow: 0 0 12px rgba(0, 0, 0, 0.5); + box-shadow: 0 0 12px rgba(0, 0, 0, 0.5); + -webkit-transform: translate3d(0, 0, 0); + -ms-transform: translate3d(0, 0, 0); + transform: translate3d(0, 0, 0); +} +.page-on-right { + -webkit-box-shadow: none; + box-shadow: none; + opacity: 1; + -webkit-transform: translate3d(100%, 0, 0); + -ms-transform: translate3d(100%, 0, 0); + transform: translate3d(100%, 0, 0); +} +.page-content { + overflow: auto; + -webkit-overflow-scrolling: touch; + -webkit-box-sizing: border-box; + -moz-box-sizing: border-box; + box-sizing: border-box; + height: 100%; +} +.page-transitioning { + -webkit-transition-duration: 400ms; + transition-duration: 400ms; +} +.page-from-right-to-center { + -webkit-animation: pageFromRightToCenter 400ms forwards; + animation: pageFromRightToCenter 400ms forwards; +} +.page-from-center-to-right { + -webkit-animation: pageFromCenterToRight 400ms forwards; + animation: pageFromCenterToRight 400ms forwards; +} +@-webkit-keyframes pageFromRightToCenter { + from { + -webkit-box-shadow: none; + box-shadow: none; + -webkit-transform: translate3d(100%, 0, 0); + } + to { + -webkit-box-shadow: 0 0 12px rgba(0, 0, 0, 0.5); + box-shadow: 0 0 12px rgba(0, 0, 0, 0.5); + -webkit-transform: translate3d(0, 0, 0); + } +} +@-webkit-keyframes pageFromCenterToRight { + from { + -webkit-box-shadow: 0 0 12px rgba(0, 0, 0, 0.5); + box-shadow: 0 0 12px rgba(0, 0, 0, 0.5); + -webkit-transform: translate3d(0, 0, 0); + } + to { + -webkit-box-shadow: none; + box-shadow: none; + -webkit-transform: translate3d(100%, 0, 0); + } +} +@keyframes pageFromRightToCenter { + from { + -webkit-box-shadow: none; + box-shadow: none; + transform: translate3d(100%, 0, 0); + } + to { + -webkit-box-shadow: 0 0 12px rgba(0, 0, 0, 0.5); + box-shadow: 0 0 12px rgba(0, 0, 0, 0.5); + transform: translate3d(0, 0, 0); + } +} +@keyframes pageFromCenterToRight { + from { + -webkit-box-shadow: 0 0 12px rgba(0, 0, 0, 0.5); + box-shadow: 0 0 12px rgba(0, 0, 0, 0.5); + transform: translate3d(0, 0, 0); + } + to { + -webkit-box-shadow: none; + box-shadow: none; + transform: translate3d(100%, 0, 0); + } +} +.page-from-center-to-left { + -webkit-animation: pageFromCenterToLeft 400ms forwards; + animation: pageFromCenterToLeft 400ms forwards; +} +.page-from-left-to-center { + -webkit-animation: pageFromLeftToCenter 400ms forwards; + animation: pageFromLeftToCenter 400ms forwards; +} +@-webkit-keyframes pageFromCenterToLeft { + from { + opacity: 1; + -webkit-transform: translate3d(0, 0, 0); + } + to { + opacity: 0.9; + -webkit-transform: translate3d(-20%, 0, 0); + } +} +@-webkit-keyframes pageFromLeftToCenter { + from { + opacity: 0.9; + -webkit-transform: translate3d(-20%, 0, 0); + } + to { + opacity: 1; + -webkit-transform: translate3d(0, 0, 0); + } +} +@keyframes pageFromCenterToLeft { + from { + opacity: 1; + transform: translate3d(0, 0, 0); + } + to { + opacity: 0.9; + transform: translate3d(-20%, 0, 0); + } +} +@keyframes pageFromLeftToCenter { + from { + opacity: 0.9; + transform: translate3d(-20%, 0, 0); + } + to { + opacity: 1; + transform: translate3d(0, 0, 0); + } +} +html.android .page { + box-shadow: none !important; +} +html.android .page-from-right-to-center { + -webkit-animation: pageFromRightToCenterDegrade 400ms forwards; + animation: pageFromRightToCenterDegrade 400ms forwards; +} +html.android .page-from-center-to-right { + -webkit-animation: pageFromCenterToRightDegrade 400ms forwards; + animation: pageFromCenterToRightDegrade 400ms forwards; +} +@-webkit-keyframes pageFromRightToCenterDegrade { + from { + -webkit-transform: translate3d(100%, 0, 0); + } + to { + -webkit-transform: translate3d(0, 0, 0); + } +} +@-webkit-keyframes pageFromCenterToRightDegrade { + from { + -webkit-transform: translate3d(0, 0, 0); + } + to { + -webkit-transform: translate3d(100%, 0, 0); + } +} +@keyframes pageFromRightToCenterDegrade { + from { + transform: translate3d(100%, 0, 0); + } + to { + transform: translate3d(0, 0, 0); + } +} +@keyframes pageFromCenterToRightDegrade { + from { + transform: translate3d(0, 0, 0); + } + to { + transform: translate3d(100%, 0, 0); + } +} +/* === Toolbars === */ +.navbar-inner, +.toolbar-inner { + position: absolute; + left: 0; + top: 0; + width: 100%; + height: 100%; + padding: 0 8px; + -webkit-box-sizing: border-box; + -moz-box-sizing: border-box; + box-sizing: border-box; + display: -webkit-box; + display: -ms-flexbox; + display: -webkit-flex; + display: flex; + -webkit-box-pack: justify; + -ms-flex-pack: justify; + -webkit-justify-content: space-between; + justify-content: space-between; + -webkit-box-align: center; + -ms-flex-align: center; + -webkit-align-items: center; + align-items: center; +} +.navbar-inner.cached { + display: none; +} +.navbar, +.toolbar { + height: 44px; + width: 100%; + -webkit-box-sizing: border-box; + -moz-box-sizing: border-box; + box-sizing: border-box; + font-size: 17px; + position: relative; + margin: 0; + z-index: 500; + -webkit-backface-visibility: hidden; + backface-visibility: hidden; +} +.navbar b, +.toolbar b { + font-weight: 500; +} +.navbar a.link, +.toolbar a.link { + line-height: 44px; + height: 44px; + text-decoration: none; + position: relative; + display: -webkit-box; + display: -ms-flexbox; + display: -webkit-flex; + display: flex; + -webkit-box-pack: start; + -ms-flex-pack: start; + -webkit-justify-content: flex-start; + justify-content: flex-start; + -webkit-box-align: center; + -ms-flex-align: center; + -webkit-align-items: center; + align-items: center; + -webkit-transition-duration: 300ms; + transition-duration: 300ms; +} +html:not(.watch-active-state) .navbar a.link:active, +html:not(.watch-active-state) .toolbar a.link:active, +.navbar a.link.active-state, +.toolbar a.link.active-state { + opacity: 0.3; + -webkit-transition-duration: 0ms; + transition-duration: 0ms; +} +.navbar a.link i + span, +.toolbar a.link i + span, +.navbar a.link i + i, +.toolbar a.link i + i, +.navbar a.link span + i, +.toolbar a.link span + i, +.navbar a.link span + span, +.toolbar a.link span + span { + margin-left: 7px; +} +.navbar a.icon-only, +.toolbar a.icon-only { + min-width: 44px; + display: -webkit-box; + display: -ms-flexbox; + display: -webkit-flex; + display: flex; + -webkit-box-pack: center; + -ms-flex-pack: center; + -webkit-justify-content: center; + justify-content: center; + -webkit-box-align: center; + -ms-flex-align: center; + -webkit-align-items: center; + align-items: center; + margin: 0; +} +.navbar i.icon, +.toolbar i.icon { + display: block; +} +.navbar { + left: 0; + top: 0; + background: #f7f7f8; + border-bottom: 1px solid #c4c4c4; +} +html.retina.ios-gt-7 .navbar { + border-bottom-width: 0.5px; +} +.navbar .center { + font-size: 17px; + font-weight: 500; + text-align: center; + margin: 0; + position: relative; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; + line-height: 44px; + -webkit-flex-shrink: 10; + -ms-flex: 0 10 auto; + flex-shrink: 10; + display: -webkit-box; + display: -ms-flexbox; + display: -webkit-flex; + display: flex; + -webkit-box-align: center; + -ms-flex-align: center; + -webkit-align-items: center; + align-items: center; +} +.navbar .left, +.navbar .right { + -webkit-flex-shrink: 0; + -ms-flex: 0 0 auto; + flex-shrink: 0; + display: -webkit-box; + display: -ms-flexbox; + display: -webkit-flex; + display: flex; + -webkit-box-pack: start; + -ms-flex-pack: start; + -webkit-justify-content: flex-start; + justify-content: flex-start; + -webkit-box-align: center; + -ms-flex-align: center; + -webkit-align-items: center; + align-items: center; + -webkit-transform: translate3d(0, 0, 0); + -ms-transform: translate3d(0, 0, 0); + transform: translate3d(0, 0, 0); +} +.navbar .left a + a, +.navbar .right a + a { + margin-left: 15px; +} +.navbar .left { + margin-right: 10px; +} +.navbar .right { + margin-left: 10px; +} +.navbar .right:first-child { + position: absolute; + right: 8px; + height: 100%; +} +.toolbar { + left: 0; + bottom: 0; + background: #f7f7f8; + border-top: 1px solid #c4c4c4; +} +html.retina.ios-gt-7 .toolbar { + border-top-width: 0.5px; +} +.toolbar a { + -webkit-flex-shrink: 1; + -ms-flex: 0 1 auto; + flex-shrink: 1; + position: relative; + white-space: nowrap; + text-overflow: ellipsis; + overflow: hidden; +} +.tabbar { + color: #929292; + z-index: 5001; +} +.tabbar a { + color: #929292; +} +.tabbar a.active { + color: #007aff; +} +.tabbar a.link { + line-height: 1.4; +} +.tabbar a.tab-link, +.tabbar a.link { + height: 100%; + width: 100%; + -webkit-box-sizing: border-box; + -moz-box-sizing: border-box; + box-sizing: border-box; + display: -webkit-box; + display: -ms-flexbox; + display: -webkit-flex; + display: flex; + -webkit-box-pack: center; + -ms-flex-pack: center; + -webkit-justify-content: center; + justify-content: center; + -webkit-box-align: center; + -ms-flex-align: center; + -webkit-align-items: center; + align-items: center; + overflow: visible; + -webkit-box-flex: 1; + -ms-flex: 1; + -webkit-box-orient: vertical; + -moz-box-orient: vertical; + -ms-flex-direction: column; + -webkit-flex-direction: column; + flex-direction: column; +} +.tabbar i.icon { + height: 30px; +} +.tabbar-labels { + height: 50px; +} +.tabbar-labels a.tab-link, +.tabbar-labels a.link { + padding-top: 4px; + padding-bottom: 4px; + height: 100%; + -webkit-box-pack: justify; + -ms-flex-pack: justify; + -webkit-justify-content: space-between; + justify-content: space-between; +} +.tabbar-labels a.tab-link i + span, +.tabbar-labels a.link i + span { + margin: 0; +} +.tabbar-labels span.tabbar-label { + line-height: 1; + display: block; + margin: 0; + letter-spacing: 0.01em; + font-size: 10px; + position: relative; + text-overflow: ellipsis; + white-space: nowrap; +} +@media all and (min-width: 768px) { + .tabbar .toolbar-inner { + -webkit-box-pack: center; + -ms-flex-pack: center; + -webkit-justify-content: center; + justify-content: center; + } + .tabbar a.tab-link, + .tabbar a.link { + width: auto; + min-width: 105px; + } + .tabbar-labels { + height: 56px; + } + .tabbar-labels span.tabbar-label { + font-size: 14px; + } +} +.navbar-from-right-to-center .left, +.navbar-from-right-to-center .right, +.navbar-from-right-to-center .center { + -webkit-animation: navbarElementFadeIn 400ms forwards; + animation: navbarElementFadeIn 400ms forwards; +} +.navbar-from-right-to-center .sliding { + opacity: 1; +} +.navbar-from-center-to-right .left, +.navbar-from-center-to-right .right, +.navbar-from-center-to-right .center { + -webkit-animation: navbarElementFadeOut 400ms forwards; + animation: navbarElementFadeOut 400ms forwards; +} +.navbar-from-center-to-right .sliding { + opacity: 0; +} +@-webkit-keyframes navbarElementFadeIn { + from { + opacity: 0; + } + to { + opacity: 1; + } +} +@keyframes navbarElementFadeIn { + from { + opacity: 0; + } + to { + opacity: 1; + } +} +.navbar-from-center-to-left .left, +.navbar-from-center-to-left .right, +.navbar-from-center-to-left .center { + -webkit-animation: navbarElementFadeOut 400ms forwards; + animation: navbarElementFadeOut 400ms forwards; +} +.navbar-from-center-to-left .sliding { + opacity: 0; +} +.navbar-from-left-to-center .left, +.navbar-from-left-to-center .right, +.navbar-from-left-to-center .center { + -webkit-animation: navbarElementFadeIn 400ms forwards; + animation: navbarElementFadeIn 400ms forwards; +} +.navbar-from-left-to-center .sliding { + opacity: 1; +} +.navbar-on-left .left, +.navbar-on-left .right, +.navbar-on-left .center { + opacity: 0; +} +.navbar-on-left .sliding { + opacity: 0; +} +.navbar-on-right .left, +.navbar-on-right .right, +.navbar-on-right .center { + opacity: 0; +} +.navbar-on-right .sliding { + opacity: 0; +} +@-webkit-keyframes navbarElementFadeOut { + from { + opacity: 1; + } + to { + opacity: 0; + } +} +@keyframes navbarElementFadeOut { + from { + opacity: 1; + } + to { + opacity: 0; + } +} +.navbar-from-right-to-center .left.sliding .back.link .icon, +.navbar-from-center-to-right .left.sliding .back.link .icon, +.navbar-from-center-to-left .left.sliding .back.link .icon, +.navbar-from-left-to-center .left.sliding .back.link .icon { + -webkit-transition-duration: 400ms; + transition-duration: 400ms; +} +.navbar-from-right-to-center .sliding, +.navbar-from-center-to-right .sliding, +.navbar-from-center-to-left .sliding, +.navbar-from-left-to-center .sliding { + -webkit-transition-duration: 400ms; + transition-duration: 400ms; + -webkit-animation: none; + animation: none; +} +/* === Relation between toolbar/navbar types and pages === */ +.page > .navbar, +.view > .navbar, +.views > .navbar, +.page > .toolbar, +.view > .toolbar, +.views > .toolbar { + position: absolute; +} +.navbar-through .page-content, +.navbar-fixed .page-content { + padding-top: 44px; +} +.toolbar-through .page-content, +.toolbar-fixed .page-content, +.tabbar-through .page-content, +.tabbar-fixed .page-content { + padding-bottom: 44px; +} +.tabbar-labels-fixed .page-content, +.tabbar-labels-through .page-content { + padding-bottom: 50px; +} +@media all and (min-width: 768px) { + .tabbar-labels-fixed .page-content, + .tabbar-labels-through .page-content { + padding-bottom: 56px; + } +} +.navbar.navbar-hiding { + -webkit-transition-duration: 400ms; + transition-duration: 400ms; + -webkit-transform: translate3d(0, 0, 0); + -ms-transform: translate3d(0, 0, 0); + transform: translate3d(0, 0, 0); +} +.navbar.navbar-hidden { + -webkit-transition-duration: 400ms; + transition-duration: 400ms; + -webkit-transform: translate3d(0, -100%, 0); + -ms-transform: translate3d(0, -100%, 0); + transform: translate3d(0, -100%, 0); +} +.page.no-navbar .page-content { + padding-top: 0; +} +.toolbar.toolbar-hiding, +.tabbar.toolbar-hiding, +.toolbar.tabbar-hiding, +.tabbar.tabbar-hiding { + -webkit-transition-duration: 400ms; + transition-duration: 400ms; + -webkit-transform: translate3d(0, 0, 0); + -ms-transform: translate3d(0, 0, 0); + transform: translate3d(0, 0, 0); +} +.toolbar.toolbar-hidden, +.tabbar.toolbar-hidden, +.toolbar.tabbar-hidden, +.tabbar.tabbar-hidden { + -webkit-transition-duration: 400ms; + transition-duration: 400ms; + -webkit-transform: translate3d(0, 100%, 0); + -ms-transform: translate3d(0, 100%, 0); + transform: translate3d(0, 100%, 0); +} +.page.no-toolbar .page-content, +.page.no-tabbar .page-content { + padding-bottom: 0; +} +/* === Search Bar === */ +.searchbar { + height: 44px; + background: #c9c9ce; + -webkit-box-sizing: border-box; + -moz-box-sizing: border-box; + box-sizing: border-box; + border-bottom: 1px solid #b4b4b4; + padding: 0 8px; + overflow: hidden; + position: relative; + display: -webkit-box; + display: -ms-flexbox; + display: -webkit-flex; + display: flex; + -webkit-box-align: center; + -ms-flex-align: center; + -webkit-align-items: center; + align-items: center; +} +html.retina.ios-gt-7 .searchbar { + border-bottom-width: 0.5px; +} +.searchbar .searchbar-input { + width: 100%; + height: 28px; + position: relative; + -webkit-flex-shrink: 1; + -ms-flex: 0 1 auto; + flex-shrink: 1; +} +.searchbar input[type="search"] { + -webkit-box-sizing: border-box; + -moz-box-sizing: border-box; + box-sizing: border-box; + width: 100%; + height: 100%; + display: block; + border: none; + -webkit-appearance: none; + -moz-appearance: none; + -ms-appearance: none; + appearance: none; + border-radius: 5px; + font-family: inherit; + color: #000; + font-size: 14px; + font-weight: normal; + padding: 0 28px; + background: #ffffff url("data:image/svg+xml;charset=utf-8,") no-repeat 8px center; + -webkit-background-size: 13px 13px; + background-size: 13px 13px; +} +.searchbar input[type="search"]::-webkit-input-placeholder { + color: #939398; + opacity: 1; +} +.searchbar input[type="search"]::-webkit-search-cancel-button { + -webkit-appearance: none; +} +.searchbar .searchbar-clear { + position: absolute; + width: 28px; + height: 28px; + right: 0; + top: 0; + opacity: 0; + pointer-events: none; + background: url("data:image/svg+xml;charset=utf-8,") no-repeat center; + -webkit-background-size: 14px 14px; + background-size: 14px 14px; + -webkit-transition-duration: 300ms; + transition-duration: 300ms; + cursor: pointer; +} +.searchbar .searchbar-cancel { + -webkit-transition-duration: 300ms; + transition-duration: 300ms; + -webkit-transform: translate3d(0, 0, 0); + -ms-transform: translate3d(0, 0, 0); + transform: translate3d(0, 0, 0); + font-size: 17px; + cursor: pointer; + opacity: 0; + -webkit-flex-shrink: 0; + -ms-flex: 0 0 auto; + flex-shrink: 0; + margin-left: 0; + pointer-events: none; +} +.searchbar.searchbar-active .searchbar-cancel { + margin-left: 8px; + opacity: 1; + pointer-events: auto; +} +html:not(.watch-active-state) .searchbar.searchbar-active .searchbar-cancel:active, +.searchbar.searchbar-active .searchbar-cancel.active-state { + opacity: 0.3; + -webkit-transition-duration: 0ms; + transition-duration: 0ms; +} +.searchbar.searchbar-not-empty .searchbar-clear { + pointer-events: auto; + opacity: 1; +} +.searchbar-overlay { + position: absolute; + left: 0; + top: 0; + width: 100%; + height: 100%; + z-index: 100; + opacity: 0; + pointer-events: none; + background: rgba(0, 0, 0, 0.4); + -webkit-transition-duration: 300ms; + transition-duration: 300ms; + -webkit-transform: translate3d(0, 0, 0); + -ms-transform: translate3d(0, 0, 0); + transform: translate3d(0, 0, 0); +} +.searchbar-overlay.searchbar-overlay-active { + opacity: 1; + pointer-events: auto; +} +.searchbar-not-found { + display: none; +} +.hidden-by-searchbar, +.list-block .hidden-by-searchbar, +.list-block li.hidden-by-searchbar { + display: none; +} +.page > .searchbar { + position: absolute; + width: 100%; + left: 0; + top: 0; + z-index: 200; +} +.page > .searchbar ~ .page-content { + padding-top: 44px; +} +.navbar-fixed .page > .searchbar, +.navbar-through .page > .searchbar, +.navbar-fixed > .searchbar, +.navbar-through > .searchbar { + top: 44px; +} +.navbar-fixed .page > .searchbar ~ .page-content, +.navbar-through .page > .searchbar ~ .page-content, +.navbar-fixed > .searchbar ~ .page-content, +.navbar-through > .searchbar ~ .page-content { + padding-top: 88px; +} +/* === Message Bar === */ +.messagebar { + -webkit-transform: translate3d(0, 0, 0); + -ms-transform: translate3d(0, 0, 0); + transform: translate3d(0, 0, 0); + -webkit-transition-duration: 0ms; + transition-duration: 0ms; +} +.messagebar textarea { + -webkit-appearance: none; + -moz-appearance: none; + -ms-appearance: none; + appearance: none; + -webkit-box-sizing: border-box; + -moz-box-sizing: border-box; + box-sizing: border-box; + border: 1px solid #c8c8cd; + background: #fff; + border-radius: 5px; + box-shadow: none; + display: block; + padding: 3px 8px 3px; + margin: 0; + width: 100%; + height: 28px; + color: #000; + font-size: 17px; + line-height: 20px; + font-family: inherit; + resize: none; + -webkit-flex-shrink: 1; + -ms-flex: 0 1 auto; + flex-shrink: 1; +} +.messagebar .link { + -ms-flex-item-align: flex-end; + -webkit-align-self: flex-end; + align-self: flex-end; +} +.messagebar .link.icon-only:first-child { + margin-left: -6px; +} +.messagebar .link:not(.icon-only) + textarea { + margin-left: 8px; +} +.messagebar textarea + .link { + margin-left: 8px; +} +.messagebar .link { + -webkit-flex-shrink: 0; + -ms-flex: 0 0 auto; + flex-shrink: 0; +} +.messagebar ~ .page-content { + padding-bottom: 44px; +} +.page.no-toolbar .messagebar ~ .page-content { + padding-bottom: 44px; +} +.hidden-toolbar .messagebar { + -webkit-transform: translate3d(0, 0, 0); + -ms-transform: translate3d(0, 0, 0); + transform: translate3d(0, 0, 0); + -webkit-transition-duration: 0ms; + transition-duration: 0ms; +} +/* === Icons === */ +i.icon { + display: inline-block; + vertical-align: middle; + background-size: 100% auto; + background-position: center; + background-repeat: no-repeat; + font-style: normal; + position: relative; +} +i.icon.icon-back { + width: 12px; + height: 20px; + background-image: url("data:image/svg+xml;charset=utf-8,"); +} +i.icon.icon-bars { + width: 21px; + height: 13px; + background-image: url("data:image/svg+xml;charset=utf-8,"); +} +@media all and (-webkit-max-device-pixel-ratio: 1), (max-resolution: 120dpi) { + i.icon.icon-bars { + height: 14px; + background-image: url("data:image/svg+xml;charset=utf-8,"); + } +} +i.icon.icon-camera { + width: 25px; + height: 20px; + background-image: url("data:image/svg+xml;charset=utf-8,"); +} +i.icon.icon-f7 { + width: 29px; + height: 29px; + background-image: url("../img/i-f7.png"); +} +i.icon.icon-form-name { + width: 29px; + height: 29px; + background-image: url("../img/i-form-name.png"); +} +i.icon.icon-form-password { + width: 29px; + height: 29px; + background-image: url("../img/i-form-password.png"); +} +i.icon.icon-form-email { + width: 29px; + height: 29px; + background-image: url("../img/i-form-email.png"); +} +i.icon.icon-form-calendar { + width: 29px; + height: 29px; + background-image: url("../img/i-form-calendar.png"); +} +i.icon.icon-form-tel { + width: 29px; + height: 29px; + background-image: url("../img/i-form-tel.png"); +} +i.icon.icon-form-gender { + width: 29px; + height: 29px; + background-image: url("../img/i-form-gender.png"); +} +i.icon.icon-form-toggle { + width: 29px; + height: 29px; + background-image: url("../img/i-form-toggle.png"); +} +i.icon.icon-form-comment { + width: 29px; + height: 29px; + background-image: url("../img/i-form-comment.png"); +} +i.icon.icon-form-settings { + width: 29px; + height: 29px; + background-image: url("../img/i-form-settings.png"); +} +i.icon.icon-form-url { + width: 29px; + height: 29px; + background-image: url("../img/i-form-url.png"); +} +i.icon.icon-next, +i.icon.icon-prev { + width: 15px; + height: 15px; +} +i.icon.icon-next { + background: url("data:image/svg+xml;charset=utf-8,"); +} +i.icon.icon-prev { + background: url("data:image/svg+xml;charset=utf-8,"); +} +i.icon.icon-plus { + width: 25px; + height: 25px; + font-size: 31px; + line-height: 20px; + text-align: center; + font-weight: 100; +} +.badge { + font-size: 13px; + display: inline-block; + color: #fff; + background: #8e8e93; + border-radius: 20px; + padding: 1px 7px; + -webkit-box-sizing: border-box; + -moz-box-sizing: border-box; + box-sizing: border-box; +} +.icon .badge { + position: absolute; + left: 100%; + margin-left: -10px; + top: -2px; + font-size: 10px; + line-height: 1.4; + padding: 1px 5px; +} +/* === Content Block === */ +.content-block { + margin: 35px 0; + padding: 0 15px; + color: #6d6d72; +} +.content-block-title { + position: relative; + overflow: hidden; + margin: 0; + white-space: nowrap; + text-overflow: ellipsis; + font-size: 14px; + text-transform: uppercase; + line-height: 1; + color: #6d6d72; + margin: 35px 15px 10px; +} +.content-block-title + .list-block, +.content-block-title + .content-block { + margin-top: 10px; +} +.content-block-inner { + background: #fff; + padding: 10px 15px; + margin-left: -15px; + width: 100%; + border-bottom: 1px solid #c8c7cc; + border-top: 1px solid #c8c7cc; + color: #000; +} +html.retina.ios-gt-7 .content-block-inner { + border-top-width: 0.5px; + border-bottom-width: 0.5px; +} +.content-block.inset { + margin-left: 15px; + margin-right: 15px; + border-radius: 7px; +} +.content-block.inset .content-block-inner { + border: none; + border-radius: 7px; +} +@media all and (min-width: 768px) { + .content-block.tablet-inset { + margin-left: 15px; + margin-right: 15px; + border-radius: 7px; + } + .content-block.tablet-inset .content-block-inner { + border: none; + border-radius: 7px; + } +} +/* === Lists === */ +.list-block { + margin: 35px 0; + font-size: 17px; +} +.list-block ul { + background: #ffffff; + list-style: none; + padding: 0; + margin: 0; + border-top: 1px solid #c8c7cc; + border-bottom: 1px solid #c8c7cc; + position: relative; +} +.list-block ul ul { + border-top: none; + border-bottom: none; + padding-left: 45px; +} +.list-block .align-top, +.list-block .align-top .item-content, +.list-block .align-top .item-inner { + -webkit-box-align: start; + -ms-flex-align: start; + -webkit-align-items: flex-start; + align-items: flex-start; +} +.list-block.inset { + margin-left: 15px; + margin-right: 15px; + border-radius: 7px; +} +.list-block.inset .content-block-title { + margin-left: 0; + margin-right: 0; +} +.list-block.inset ul { + border-radius: 7px; + border-top: none; + border-bottom: none; +} +.list-block.inset li:first-child > a { + border-radius: 7px 7px 0 0; +} +.list-block.inset li:last-child > a { + border-radius: 0 0 7px 7px; +} +.list-block.inset li:first-child:last-child > a { + border-radius: 7px; +} +@media all and (min-width: 768px) { + .list-block.tablet-inset { + margin-left: 15px; + margin-right: 15px; + border-radius: 7px; + } + .list-block.tablet-inset .content-block-title { + margin-left: 0; + margin-right: 0; + } + .list-block.tablet-inset ul { + border-radius: 7px; + border-top: none; + border-bottom: none; + } + .list-block.tablet-inset li:first-child > a { + border-radius: 7px 7px 0 0; + } + .list-block.tablet-inset li:last-child > a { + border-radius: 0 0 7px 7px; + } + .list-block.tablet-inset li:first-child:last-child > a { + border-radius: 7px; + } + .list-block.tablet-inset .content-block-title { + margin-left: 0; + margin-right: 0; + } + .list-block.tablet-inset ul { + border-radius: 7px; + border-top: none; + border-bottom: none; + } + .list-block.tablet-inset li:first-child > a { + border-radius: 7px 7px 0 0; + } + .list-block.tablet-inset li:last-child > a { + border-radius: 0 0 7px 7px; + } + .list-block.tablet-inset li:first-child:last-child > a { + border-radius: 7px; + } +} +.list-block li { + -webkit-box-sizing: border-box; + -moz-box-sizing: border-box; + box-sizing: border-box; + position: relative; +} +.list-block .item-media { + display: -webkit-box; + display: -ms-flexbox; + display: -webkit-flex; + display: flex; + -webkit-flex-shrink: 0; + -ms-flex: 0 0 auto; + flex-shrink: 0; + -webkit-box-lines: single; + -moz-box-lines: single; + -webkit-flex-wrap: nowrap; + -ms-flex-wrap: none; + -ms-flex-wrap: nowrap; + flex-wrap: nowrap; + -webkit-box-sizing: border-box; + -moz-box-sizing: border-box; + box-sizing: border-box; + -webkit-box-align: center; + -ms-flex-align: center; + -webkit-align-items: center; + align-items: center; + padding-top: 7px; + padding-bottom: 8px; +} +.list-block .item-media i + i { + margin-left: 5px; +} +.list-block .item-media i + img { + margin-left: 5px; +} +.list-block .item-media + .item-inner { + margin-left: 15px; +} +.list-block .item-inner { + padding-right: 15px; + border-bottom: 1px solid #c8c7cc; + width: 100%; + padding-top: 8px; + padding-bottom: 7px; + min-height: 44px; + -webkit-box-sizing: border-box; + -moz-box-sizing: border-box; + box-sizing: border-box; + display: -webkit-box; + display: -ms-flexbox; + display: -webkit-flex; + display: flex; + -webkit-box-flex: 1; + -ms-flex: 1; + -webkit-box-pack: justify; + -ms-flex-pack: justify; + -webkit-justify-content: space-between; + justify-content: space-between; + -webkit-box-align: center; + -ms-flex-align: center; + -webkit-align-items: center; + align-items: center; +} +.list-block .item-title { + -webkit-flex-shrink: 1; + -ms-flex: 0 1 auto; + flex-shrink: 1; + white-space: nowrap; + position: relative; + overflow: hidden; + text-overflow: ellipsis; + max-width: 100%; +} +.list-block .item-title.label { + width: 35%; + -webkit-flex-shrink: 0; + -ms-flex: 0 0 auto; + flex-shrink: 0; +} +.list-block .item-input { + width: 100%; + margin-top: -8px; + margin-bottom: -7px; + -webkit-box-flex: 1; + -ms-flex: 1; + -webkit-flex-shrink: 1; + -ms-flex: 0 1 auto; + flex-shrink: 1; +} +.list-block .item-after { + white-space: nowrap; + color: #8e8e93; + -webkit-flex-shrink: 0; + -ms-flex: 0 0 auto; + flex-shrink: 0; + margin-left: 5px; + display: -webkit-box; + display: -ms-flexbox; + display: -webkit-flex; + display: flex; + max-height: 28px; +} +.list-block .smart-select .item-after { + max-width: 70%; + overflow: hidden; + text-overflow: ellipsis; + position: relative; +} +.list-block .item-link { + -webkit-transition-duration: 300ms; + transition-duration: 300ms; + display: block; + color: inherit; +} +.list-block .item-link .item-inner { + padding-right: 35px; + background: no-repeat -webkit-calc(100% - 15px) center; + background: no-repeat calc(100% - 15px) center; + background-image: url("data:image/svg+xml;charset=utf-8,"); + background-size: 10px 20px; +} +html:not(.watch-active-state) .list-block .item-link:active, +.list-block .item-link.active-state { + -webkit-transition-duration: 0ms; + transition-duration: 0ms; + background-color: #d9d9d9; +} +html:not(.watch-active-state) .list-block .item-link:active .item-inner, +.list-block .item-link.active-state .item-inner { + border-bottom-color: transparent; +} +.list-block .item-link.list-button { + padding: 0 15px; + text-align: center; + color: #007aff; + display: block; + border-bottom: 1px solid #c8c7cc; + line-height: 43px; +} +.list-block .item-content { + -webkit-box-sizing: border-box; + -moz-box-sizing: border-box; + box-sizing: border-box; + padding-left: 15px; + min-height: 44px; + display: -webkit-box; + display: -ms-flexbox; + display: -webkit-flex; + display: flex; + -webkit-box-pack: justify; + -ms-flex-pack: justify; + -webkit-justify-content: space-between; + justify-content: space-between; + -webkit-box-align: center; + -ms-flex-align: center; + -webkit-align-items: center; + align-items: center; +} +.list-block .list-block-label { + margin: 10px 0 35px; + padding: 0 15px; + font-size: 14px; + color: #8f8f94; +} +.list-block .swipeout { + overflow: hidden; + -webkit-transform-style: preserve-3d; + transform-style: preserve-3d; +} +.list-block .swipeout.deleting { + -webkit-transition-duration: 300ms; + transition-duration: 300ms; +} +.list-block .swipeout.deleting .swipeout-content { + -webkit-transform: translateX(-100%); + -ms-transform: translateX(-100%); + transform: translateX(-100%); +} +.list-block .swipeout.transitioning .swipeout-content, +.list-block .swipeout.transitioning .swipeout-actions-right a, +.list-block .swipeout.transitioning .swipeout-actions-left a, +.list-block .swipeout.transitioning .swipeout-overswipe { + -webkit-transition: 300ms; + transition: 300ms; +} +.list-block .swipeout-content { + position: relative; + z-index: 10; +} +.list-block .swipeout-overswipe { + -webkit-transition: 200ms left; + transition: 200ms left; +} +.list-block .swipeout-actions-left, +.list-block .swipeout-actions-right { + position: absolute; + top: 0; + height: 100%; + display: -webkit-box; + display: -ms-flexbox; + display: -webkit-flex; + display: flex; +} +.list-block .swipeout-actions-left a, +.list-block .swipeout-actions-right a { + padding: 0 30px; + color: #fff; + background: #c7c7cc; + display: -webkit-box; + display: -ms-flexbox; + display: -webkit-flex; + display: flex; + -webkit-box-align: center; + -ms-flex-align: center; + -webkit-align-items: center; + align-items: center; + position: relative; + left: 0; +} +.list-block .swipeout-actions-left a:after, +.list-block .swipeout-actions-right a:after { + content: ''; + position: absolute; + top: 0; + width: 600%; + height: 100%; + background: inherit; + z-index: -1; +} +.list-block .swipeout-actions-left a.swipeout-delete, +.list-block .swipeout-actions-right a.swipeout-delete { + background: #ff3b30; +} +.list-block .swipeout-actions-right { + right: 0%; + -webkit-transform: translateX(100%); + -ms-transform: translateX(100%); + transform: translateX(100%); +} +.list-block .swipeout-actions-right a:after { + left: 100%; + margin-left: -1px; +} +.list-block .swipeout-actions-left { + left: 0%; + -webkit-transform: translateX(-100%); + -ms-transform: translateX(-100%); + transform: translateX(-100%); +} +.list-block .swipeout-actions-left a:after { + right: 100%; + margin-right: -1px; +} +.list-block .item-subtitle { + font-size: 15px; + position: relative; + overflow: hidden; + white-space: nowrap; + max-width: 100%; + text-overflow: ellipsis; +} +.list-block .item-text { + font-size: 15px; + color: #8e8e93; + line-height: 21px; + position: relative; + overflow: hidden; + height: 42px; + text-overflow: ellipsis; + -webkit-line-clamp: 2; + -webkit-box-orient: vertical; + display: -webkit-box; +} +.list-block.media-list .item-title, +.list-block li.media-item .item-title { + font-weight: 500; +} +.list-block.media-list .item-inner, +.list-block li.media-item .item-inner { + display: block; + padding-top: 10px; + padding-bottom: 9px; + -ms-flex-item-align: stretch; + -webkit-align-self: stretch; + align-self: stretch; +} +.list-block.media-list .item-link .item-inner, +.list-block li.media-item .item-link .item-inner { + background: none; + padding-right: 15px; +} +.list-block.media-list .item-link .item-title-row, +.list-block li.media-item .item-link .item-title-row { + padding-right: 20px; + background: no-repeat right center; + background-image: url("data:image/svg+xml;charset=utf-8,"); + background-size: 10px 20px; +} +.list-block.media-list .item-media, +.list-block li.media-item .item-media { + padding-top: 9px; + padding-bottom: 10px; +} +.list-block.media-list .item-media img, +.list-block li.media-item .item-media img { + display: block; +} +.list-block.media-list .item-title-row, +.list-block li.media-item .item-title-row { + display: -webkit-box; + display: -ms-flexbox; + display: -webkit-flex; + display: flex; + -webkit-box-pack: justify; + -ms-flex-pack: justify; + -webkit-justify-content: space-between; + justify-content: space-between; +} +.list-block .list-group:nth-child(n+2) ul { + border-top: none; +} +.list-block .item-divider, +.list-block .list-group-title { + background: #f7f7f7; + border-top: 1px solid #c8c7cc; + margin-top: -1px; + padding: 4px 15px; + white-space: nowrap; + position: relative; + max-width: 100%; + text-overflow: ellipsis; + overflow: hidden; + color: #8e8e93; +} +.list-block .list-group-title { + position: relative; + position: -webkit-sticky; + position: -moz-sticky; + position: sticky; + top: 0px; + z-index: 10; + margin-top: 0; + border-top: none; +} +.list-block .sortable-handler { + position: absolute; + right: 0; + top: 0; + height: -webkit-calc(100% - 1px); + height: calc(100% - 1px); + z-index: 10; + background-repeat: no-repeat; + background-size: 18px 12px; + background-position: center; + width: 35px; + background-image: url("data:image/svg+xml;charset=utf-8,"); + opacity: 0; + visibility: hidden; + cursor: pointer; + -webkit-transition-duration: 300ms; + transition-duration: 300ms; +} +.list-block.sortable .item-inner { + -webkit-transition-duration: 300ms; + transition-duration: 300ms; +} +.list-block.sortable-opened .sortable-handler { + visibility: visible; + opacity: 1; +} +.list-block.sortable-opened .item-inner, +.list-block.sortable-opened .item-link .item-inner { + padding-right: 35px; +} +.list-block.sortable-opened .item-link .item-inner, +.list-block.sortable-opened .item-link .item-title-row { + background-image: none; +} +.list-block.sortable-sorting li { + -webkit-transition-duration: 300ms; + transition-duration: 300ms; +} +.list-block li.sorting { + z-index: 50; + background: rgba(255, 255, 255, 0.8); + box-shadow: 0px 2px 8px rgba(0, 0, 0, 0.6); + -webkit-transition-duration: 0ms; + transition-duration: 0ms; +} +.list-block li.sorting .item-inner { + border-bottom: none; +} +.list-block li:last-child .list-button { + border-bottom: none; +} +.list-block li:last-child .item-inner, +.list-block li:last-child li:last-child .item-inner { + border-bottom: none; +} +.list-block li li:last-child .item-inner, +.list-block li:last-child li .item-inner { + border-bottom: 1px solid #c8c7cc; +} +html.retina.ios-gt-7 .list-block ul { + border-top-width: 0.5px; + border-bottom-width: 0.5px; +} +html.retina.ios-gt-7 .list-block li:not(:last-child) .item-inner { + border-bottom-width: 0.5px; +} +html.retina.ios-gt-7 .item-divider { + border-top-width: 0.5px; + margin-top: -0.5px; +} +html.retina.ios-gt-7 .item-link.list-button { + border-bottom-width: 0.5px; +} +/* === Contacts === */ +.contacts-content { + background: #fff; +} +.contacts-block { + margin: 0; +} +.contacts-block .list-group-title { + padding: 0 15px; + background: #f7f7f7; + color: #000; + font-weight: 500; + line-height: 22px; + height: 22px; +} +.contacts-block .list-group:first-child ul { + border-top: none; +} +.contacts-block .list-group:last-child ul { + border-bottom: none; +} +/* === Forms === */ +.list-block input[type="text"], +.list-block input[type="password"], +.list-block input[type="email"], +.list-block input[type="tel"], +.list-block input[type="url"], +.list-block input[type="date"], +.list-block input[type="datetime-local"], +.list-block input[type="time"], +.list-block input[type="number"], +.list-block select, +.list-block textarea { + -webkit-appearance: none; + -moz-appearance: none; + -ms-appearance: none; + appearance: none; + -webkit-box-sizing: border-box; + -moz-box-sizing: border-box; + box-sizing: border-box; + border: none; + background: none; + border-radius: 0 0 0 0; + -webkit-box-shadow: none; + box-shadow: none; + display: block; + padding: 0 0 0 5px; + margin: 0; + width: 100%; + height: 43px; + color: #000; + font-size: 17px; + font-family: inherit; +} +.list-block input[type="date"], +.list-block input[type="datetime-local"] { + line-height: 44px; +} +.list-block select { + -webkit-appearance: none; + -moz-appearance: none; + -ms-appearance: none; + appearance: none; +} +.list-block .lable { + vertical-align: top; +} +.list-block textarea { + height: 100px; + resize: none; + line-height: 1.4; + padding-top: 8px; + padding-bottom: 7px; +} +.label-switch { + display: inline-block; + vertical-align: middle; + width: 52px; + border-radius: 16px; + -webkit-box-sizing: border-box; + -moz-box-sizing: border-box; + box-sizing: border-box; + height: 32px; + position: relative; + cursor: pointer; + -ms-flex-item-align: center; + -webkit-align-self: center; + align-self: center; +} +.label-switch .checkbox { + width: 52px; + border-radius: 16px; + -webkit-box-sizing: border-box; + -moz-box-sizing: border-box; + box-sizing: border-box; + height: 32px; + background: #e5e5e5; + z-index: 0; + margin: 0; + padding: 0; + -webkit-appearance: none; + -moz-appearance: none; + -ms-appearance: none; + appearance: none; + border: none; + cursor: pointer; + position: relative; + -webkit-transition-duration: 300ms; + transition-duration: 300ms; +} +.label-switch .checkbox:before { + content: ' '; + position: absolute; + left: 2px; + top: 2px; + width: 48px; + border-radius: 16px; + -webkit-box-sizing: border-box; + -moz-box-sizing: border-box; + box-sizing: border-box; + height: 28px; + background: #fff; + z-index: 1; + -webkit-transition-duration: 300ms; + transition-duration: 300ms; + -webkit-transform: scale(1); + -ms-transform: scale(1); + transform: scale(1); +} +.label-switch .checkbox:after { + content: ' '; + height: 28px; + width: 28px; + border-radius: 28px; + background: #fff; + position: absolute; + z-index: 2; + top: 2px; + left: 2px; + -webkit-box-shadow: 0 2px 5px rgba(0, 0, 0, 0.4); + box-shadow: 0 2px 5px rgba(0, 0, 0, 0.4); + -webkit-transform: translateX(0px); + -ms-transform: translateX(0px); + transform: translateX(0px); + -webkit-transition-duration: 300ms; + transition-duration: 300ms; +} +.label-switch input[type="checkbox"] { + display: none; +} +.label-switch input[type="checkbox"]:checked + .checkbox { + background: #4cd964; +} +.label-switch input[type="checkbox"]:checked + .checkbox:before { + -webkit-transform: scale(0); + -ms-transform: scale(0); + transform: scale(0); +} +.label-switch input[type="checkbox"]:checked + .checkbox:after { + -webkit-transform: translateX(22px); + -ms-transform: translateX(22px); + transform: translateX(22px); +} +html.android .label-switch input[type="checkbox"] + .checkbox { + -webkit-transition-duration: 0; + transition-duration: 0; +} +html.android .label-switch input[type="checkbox"] + .checkbox:after, +html.android .label-switch input[type="checkbox"] + .checkbox:before { + -webkit-transition-duration: 0; + transition-duration: 0; +} +.button { + border: 1px solid #007aff; + color: #007aff; + text-decoration: none; + text-align: center; + display: block; + border-radius: 5px; + line-height: 27px; + -webkit-box-sizing: border-box; + -moz-box-sizing: border-box; + box-sizing: border-box; + -webkit-appearance: none; + -moz-appearance: none; + -ms-appearance: none; + appearance: none; + background: none; + padding: 0 10px; + margin: 0; + height: 29px; + white-space: nowrap; + position: relative; + overflow: hidden; + text-overflow: ellipsis; + font-size: 14px; + font-family: inherit; + cursor: pointer; +} +input[type="submit"].button, +input[type="button"].button { + width: 100%; +} +html:not(.watch-active-state) .button:active, +.button.active-state { + background: rgba(0, 122, 255, 0.15); +} +.button.button-round { + border-radius: 27px; +} +.button.active { + background: #007aff; + color: #fff; +} +.button.button-big { + font-size: 17px; + height: 44px; + line-height: 42px; +} +.button.button-fill { + color: #fff; + background: #007aff; + border: none; +} +html:not(.watch-active-state) .button.button-fill:active, +.button.button-fill.active-state { + opacity: 0.8; +} +.button i.icon:first-child { + margin-right: 10px; +} +.button i.icon:last-child { + margin-left: 10px; +} +.button i.icon:first-child:last-child { + margin-left: 0; + margin-right: 0; +} +.buttons-row { + -ms-flex-item-align: center; + -webkit-align-self: center; + align-self: center; + display: -webkit-box; + display: -ms-flexbox; + display: -webkit-flex; + display: flex; + -webkit-box-lines: single; + -moz-box-lines: single; + -webkit-flex-wrap: nowrap; + -ms-flex-wrap: none; + -ms-flex-wrap: nowrap; + flex-wrap: nowrap; +} +.buttons-row .button { + border-radius: 0 0 0 0; + border-left-width: 0; + width: 100%; + -webkit-box-flex: 1; + -ms-flex: 1; +} +.buttons-row .button:first-child { + border-radius: 5px 0 0 5px; + border-left-width: 1px; + border-left-style: solid; +} +.buttons-row .button:last-child { + border-radius: 0 5px 5px 0; +} +.buttons-row .button.button-round:first-child { + border-radius: 27px 0 0 27px; +} +.buttons-row .button.button-round:last-child { + border-radius: 0 27px 27px 0; +} +.range-slider { + width: 100%; + position: relative; + overflow: hidden; + padding-left: 3px; + padding-right: 3px; + margin-left: -1px; + -ms-flex-item-align: center; + -webkit-align-self: center; + align-self: center; +} +.range-slider input[type="range"] { + position: relative; + height: 28px; + width: 100%; + margin: 4px 0 5px 0; + -webkit-appearance: none; + -moz-appearance: none; + -ms-appearance: none; + appearance: none; + background: -webkit-gradient(linear, 50% 0, 50% 100%, color-stop(0, #b7b8b7), color-stop(100%, #b7b8b7)); + background: linear-gradient(to right, #b7b8b7 0, #b7b8b7 100%); + background-position: center; + background-size: 100% 2px; + background-repeat: no-repeat; + outline: 0; +} +.range-slider input[type="range"]:after { + height: 2px; + background: #fff; + content: ' '; + width: 5px; + top: 50%; + margin-top: -1px; + left: -5px; + z-index: 1; + position: absolute; +} +.range-slider input[type="range"]::-webkit-slider-thumb { + -webkit-appearance: none; + -moz-appearance: none; + -ms-appearance: none; + appearance: none; + border: none; + height: 28px; + width: 28px; + position: relative; + background: none; +} +.range-slider input[type="range"]::-webkit-slider-thumb:after { + height: 28px; + width: 28px; + border-radius: 28px; + background: #fff; + z-index: 10; + -webkit-box-shadow: 0 2px 4px rgba(0, 0, 0, 0.4); + box-shadow: 0 2px 4px rgba(0, 0, 0, 0.4); + position: absolute; + left: 0; + top: 0; + content: ' '; +} +.range-slider input[type="range"]::-webkit-slider-thumb:before { + position: absolute; + top: 50%; + right: 100%; + width: 2000px; + height: 2px; + margin-top: -1px; + z-index: 1; + background: #007aff; + content: ' '; +} +label.label-checkbox { + cursor: pointer; +} +label.label-checkbox i.icon-form-checkbox { + width: 22px; + height: 22px; + position: relative; + border-radius: 22px; + border: 1px solid #c7c7cc; + -webkit-box-sizing: border-box; + -moz-box-sizing: border-box; + box-sizing: border-box; +} +label.label-checkbox i.icon-form-checkbox:after { + content: ' '; + position: absolute; + left: 50%; + margin-left: -6px; + top: 50%; + margin-top: -4px; + width: 12px; + height: 9px; +} +label.label-checkbox input[type="checkbox"], +label.label-checkbox input[type="radio"] { + display: none; +} +label.label-checkbox input[type="checkbox"]:checked + .item-media i.icon-form-checkbox, +label.label-checkbox input[type="radio"]:checked + .item-media i.icon-form-checkbox { + border: none; + background-color: #007aff; +} +label.label-checkbox input[type="checkbox"]:checked + .item-media i.icon-form-checkbox:after, +label.label-checkbox input[type="radio"]:checked + .item-media i.icon-form-checkbox:after { + background: no-repeat center; + background-image: url("data:image/svg+xml;charset=utf-8,"); + -webkit-background-size: 12px 9px; + background-size: 12px 9px; +} +label.label-radio { + cursor: pointer; +} +label.label-radio input[type="checkbox"], +label.label-radio input[type="radio"] { + display: none; +} +label.label-radio input[type="checkbox"] ~ .item-inner, +label.label-radio input[type="radio"] ~ .item-inner { + padding-right: 35px; +} +label.label-radio input[type="checkbox"]:checked ~ .item-inner, +label.label-radio input[type="radio"]:checked ~ .item-inner { + background: no-repeat center; + background-image: url("data:image/svg+xml;charset=utf-8, "); + background-position: 90% center; + background-position: -webkit-calc(100% - 15px) center; + background-position: calc(100% - 15px) center; + -webkit-background-size: 13px 10px; + background-size: 13px 10px; +} +label.label-checkbox, +label.label-radio { + -webkit-transition-duration: 300ms; + transition-duration: 300ms; +} +html:not(.watch-active-state) label.label-checkbox:active, +html:not(.watch-active-state) label.label-radio:active, +label.label-checkbox.active-state, +label.label-radio.active-state { + -webkit-transition-duration: 0ms; + transition-duration: 0ms; + background-color: #d9d9d9; +} +html:not(.watch-active-state) label.label-checkbox:active .item-inner, +html:not(.watch-active-state) label.label-radio:active .item-inner, +label.label-checkbox.active-state .item-inner, +label.label-radio.active-state .item-inner { + border-bottom-color: transparent; +} +.smart-select select { + display: none; +} +/* === Accordion === */ +.list-block .accordion-item-toggle { + cursor: pointer; + -webkit-transition-duration: 300ms; + transition-duration: 300ms; +} +.list-block .accordion-item-toggle .item-inner { + padding-right: 35px; + background: no-repeat -webkit-calc(100% - 15px) center; + background: no-repeat calc(100% - 15px) center; + background-image: url("data:image/svg+xml;charset=utf-8,"); + background-size: 10px 20px; +} +html:not(.watch-active-state) .list-block .accordion-item-toggle:active, +.list-block .accordion-item-toggle.active-state { + -webkit-transition-duration: 0ms; + transition-duration: 0ms; + background-color: #d9d9d9; +} +html:not(.watch-active-state) .list-block .accordion-item-toggle:active > .item-inner, +.list-block .accordion-item-toggle.active-state > .item-inner { + border-bottom-color: transparent; +} +.list-block .accordion-item-toggle .item-inner, +.list-block .accordion-item > .item-link .item-inner { + -webkit-transition-duration: 300ms; + transition-duration: 300ms; + -webkit-transition-property: background-color, border-color; + transition-property: background-color, border-color; +} +.list-block .accordion-item-expanded .accordion-item-toggle .item-inner, +.list-block .accordion-item-expanded > .item-link .item-inner { + background-image: url("data:image/svg+xml;charset=utf-8,"); + background-size: 20px 20px; + border-bottom-color: transparent; +} +.list-block .accordion-item .content-block, +.list-block .accordion-item .list-block { + margin-top: 0; + margin-bottom: 0; +} +.list-block .accordion-item ul { + padding-left: 0; +} +.accordion-item-content { + position: relative; + overflow: hidden; + height: 0; + font-size: 14px; + -webkit-transition-duration: 300ms; + transition-duration: 300ms; + -webkit-transform: translate3d(0, 0, 0); + -ms-transform: translate3d(0, 0, 0); + transform: translate3d(0, 0, 0); +} +.accordion-item-expanded > .accordion-item-content { + height: auto; +} +html.android-4 .accordion-item-content { + -webkit-transform: none; + -ms-transform: none; + transform: none; +} +/* === Modals === */ +.modal-overlay, +.preloader-indicator-overlay, +.popup-overlay { + position: absolute; + left: 0; + top: 0; + width: 100%; + height: 100%; + background: rgba(0, 0, 0, 0.4); + z-index: 10600; + visibility: hidden; + opacity: 0; + -webkit-transition-duration: 400ms; + transition-duration: 400ms; +} +.modal-overlay.modal-overlay-visible, +.preloader-indicator-overlay.modal-overlay-visible, +.popup-overlay.modal-overlay-visible { + visibility: visible; + opacity: 1; +} +html.ios .modal-overlay.modal-overlay-visible, +html.ios .preloader-indicator-overlay.modal-overlay-visible, +html.ios .popup-overlay.modal-overlay-visible { + overflow: auto; + -webkit-overflow-scrolling: touch; +} +.popup-overlay { + z-index: 10200; +} +.modal { + width: 270px; + position: absolute; + z-index: 11000; + left: 50%; + margin-left: -135px; + margin-top: 0; + top: 50%; + text-align: center; + border-radius: 7px; + opacity: 0; + -webkit-transform: translate3d(0, 0, 0) scale(1.185); + -ms-transform: translate3d(0, 0, 0) scale(1.185); + transform: translate3d(0, 0, 0) scale(1.185); + -webkit-transition-property: -webkit-transform, opacity; + -moz-transition-property: -moz-transform, opacity; + -ms-transition-property: -ms-transform, opacity; + -o-transition-property: -o-transform, opacity; + transition-property: transform, opacity; + color: #000; +} +.modal.modal-in { + opacity: 1; + -webkit-transition-duration: 400ms; + transition-duration: 400ms; + -webkit-transform: translate3d(0, 0, 0) scale(1); + -ms-transform: translate3d(0, 0, 0) scale(1); + transform: translate3d(0, 0, 0) scale(1); +} +.modal.modal-out { + opacity: 0; + z-index: 10999; + -webkit-transition-duration: 400ms; + transition-duration: 400ms; + -webkit-transform: translate3d(0, 0, 0) scale(0.815); + -ms-transform: translate3d(0, 0, 0) scale(0.815); + transform: translate3d(0, 0, 0) scale(0.815); +} +.modal-inner { + padding: 15px; + border-bottom: 1px solid #b5b5b5; + border-radius: 7px 7px 0 0; + background: #e8e8e8; +} +.modal-title { + font-weight: 500; + font-size: 18px; + text-align: center; +} +.modal-title + .modal-text { + margin-top: 5px; +} +.modal-buttons { + height: 44px; + overflow: hidden; + display: -webkit-box; + display: -ms-flexbox; + display: -webkit-flex; + display: flex; + -webkit-box-pack: center; + -ms-flex-pack: center; + -webkit-justify-content: center; + justify-content: center; +} +.modal-buttons.modal-buttons-vertical { + display: block; + height: auto; +} +.modal-button { + width: 100%; + padding: 0 5px; + height: 44px; + font-size: 17px; + line-height: 44px; + text-align: center; + color: #007aff; + background: #e8e8e8; + display: block; + position: relative; + white-space: nowrap; + text-overflow: ellipsis; + overflow: hidden; + cursor: pointer; + -webkit-box-sizing: border-box; + -moz-box-sizing: border-box; + box-sizing: border-box; + border-right: 1px solid #b5b5b5; + -webkit-box-flex: 1; + -ms-flex: 1; +} +.modal-button:first-child { + border-radius: 0 0 0 7px; +} +.modal-button:last-child { + border-right: none; + border-radius: 0 0 7px 0; +} +.modal-button:first-child:last-child { + border-radius: 0 0 7px 7px; +} +.modal-button.modal-button-bold { + font-weight: 500; +} +html:not(.watch-active-state) .modal-button:active, +.modal-button.active-state { + background: #d4d4d4; +} +.modal-buttons-vertical .modal-button { + border-right: none; + border-bottom: 1px solid #b5b5b5; + border-radius: 0; +} +.modal-buttons-vertical .modal-button:last-child { + border-radius: 0 0 7px 7px; + border-bottom: none; +} +.modal-no-buttons .modal-inner { + border-radius: 7px; + border-bottom: none; +} +.modal-no-buttons .modal-buttons { + display: none; +} +.actions-modal { + position: absolute; + left: 0; + bottom: 0; + z-index: 11000; + width: 100%; + -webkit-transform: translate3d(0, 100%, 0); + -ms-transform: translate3d(0, 100%, 0); + transform: translate3d(0, 100%, 0); +} +.actions-modal.modal-in { + -webkit-transition-duration: 300ms; + transition-duration: 300ms; + -webkit-transform: translate3d(0, 0, 0); + -ms-transform: translate3d(0, 0, 0); + transform: translate3d(0, 0, 0); +} +.actions-modal.modal-out { + z-index: 10999; + -webkit-transition-duration: 300ms; + transition-duration: 300ms; + -webkit-transform: translate3d(0, 100%, 0); + -ms-transform: translate3d(0, 100%, 0); + transform: translate3d(0, 100%, 0); +} +.actions-modal-group { + margin: 8px; +} +.actions-modal-button, +.actions-modal-label { + width: 100%; + text-align: center; + font-weight: normal; + margin: 0; + background: rgba(243, 243, 243, 0.95); + -webkit-box-sizing: border-box; + -moz-box-sizing: border-box; + box-sizing: border-box; + display: block; + border-bottom: 1px solid #d2d2d6; +} +.actions-modal-button a, +.actions-modal-label a { + text-decoration: none; + color: inherit; +} +.actions-modal-button b, +.actions-modal-label b { + font-weight: 500; +} +.actions-modal-button.actions-modal-button-bold, +.actions-modal-label.actions-modal-button-bold { + font-weight: 500; +} +.actions-modal-button.actions-modal-button-red, +.actions-modal-label.actions-modal-button-red { + color: #ff3b30; +} +.actions-modal-button:first-child, +.actions-modal-label:first-child { + border-radius: 4px 4px 0 0; +} +.actions-modal-button:last-child, +.actions-modal-label:last-child { + border: none; + border-radius: 0 0 4px 4px; +} +.actions-modal-button:first-child:last-child, +.actions-modal-label:first-child:last-child { + border-radius: 4px; +} +.actions-modal-button { + cursor: pointer; + line-height: 43px; + font-size: 20px; + color: #007aff; +} +html:not(.watch-active-state) .actions-modal-button:active, +.actions-modal-button.active-state { + background: #dcdcdc; +} +.actions-modal-label { + font-size: 13px; + line-height: 1.3; + min-height: 44px; + padding: 8px 10px; + color: #8a8a8a; + display: -webkit-box; + display: -ms-flexbox; + display: -webkit-flex; + display: flex; + -webkit-box-pack: center; + -ms-flex-pack: center; + -webkit-justify-content: center; + justify-content: center; + -webkit-box-align: center; + -ms-flex-align: center; + -webkit-align-items: center; + align-items: center; +} +input.modal-text-input { + -webkit-box-sizing: border-box; + -moz-box-sizing: border-box; + box-sizing: border-box; + height: 30px; + background: #fff; + margin: 0; + margin-top: 15px; + padding: 0 5px; + border: 1px solid #a0a0a0; + border-radius: 5px; + width: 100%; + font-size: 14px; + font-family: inherit; + display: block; + -webkit-box-shadow: 0 0 0 rgba(0, 0, 0, 0); + box-shadow: 0 0 0 rgba(0, 0, 0, 0); + -webkit-appearance: none; + -moz-appearance: none; + -ms-appearance: none; + appearance: none; +} +input.modal-text-input + input.modal-text-input { + margin-top: 5px; +} +input.modal-text-input.modal-text-input-double { + border-radius: 5px 5px 0 0; +} +input.modal-text-input.modal-text-input-double + input.modal-text-input { + margin-top: 0; + border-top: 0; + border-radius: 0 0 5px 5px; +} +.popover { + width: 320px; + background: rgba(255, 255, 255, 0.95); + z-index: 11000; + margin: 0; + top: 0; + opacity: 0; + left: 0; + border-radius: 7px; + position: absolute; + display: none; + -webkit-transform: none; + -ms-transform: none; + transform: none; + -webkit-transition-property: opacity; + -moz-transition-property: opacity; + -ms-transition-property: opacity; + -o-transition-property: opacity; + transition-property: opacity; +} +.popover.modal-in { + -webkit-transition-duration: 300ms; + transition-duration: 300ms; + opacity: 1; +} +.popover .list-block { + margin: 0; +} +.popover .list-block ul { + background: none; +} +.popover .list-block:first-child ul { + border-top: none; + border-radius: 7px 7px 0 0; +} +.popover .list-block:first-child li:first-child a { + border-radius: 7px 7px 0 0; +} +.popover .list-block:last-child ul { + border-bottom: none; + border-radius: 0 0 7px 7px; +} +.popover .list-block:last-child li:last-child a { + border-radius: 0 0 7px 7px; +} +.popover .list-block:first-child:last-child li:first-child:last-child a, +.popover .list-block:first-child:last-child ul:first-child:last-child { + border-radius: 7px; +} +.popover .list-block + .list-block { + margin-top: 35px; +} +.popover-angle { + width: 26px; + height: 26px; + position: absolute; + left: -26px; + top: 0; + z-index: 100; + overflow: hidden; +} +.popover-angle:after { + content: ' '; + background: rgba(255, 255, 255, 0.95); + width: 26px; + height: 26px; + position: absolute; + left: 0; + top: 0; + border-radius: 3px; + -webkit-transform: rotate(45deg); + -ms-transform: rotate(45deg); + transform: rotate(45deg); +} +.popover-angle.on-left { + left: -26px; +} +.popover-angle.on-left:after { + left: 19px; + top: 0; +} +.popover-angle.on-right { + left: 100%; +} +.popover-angle.on-right:after { + left: -19px; + top: 0; +} +.popover-angle.on-top { + left: 0; + top: -26px; +} +.popover-angle.on-top:after { + left: 0; + top: 19px; +} +.popover-angle.on-bottom { + left: 0; + top: 100%; +} +.popover-angle.on-bottom:after { + left: 0; + top: -19px; +} +.popover-inner { + overflow: auto; + -webkit-overflow-scrolling: touch; +} +.actions-popover .list-block + .list-block { + margin-top: 20px; +} +.actions-popover .list-block ul { + background: #fff; +} +.actions-popover-label { + padding: 8px 10px; + color: #8a8a8a; + font-size: 13px; + line-height: 1.3; + text-align: center; + border-bottom: 1px solid #d2d2d6; +} +.actions-popover-label:last-child { + border-bottom: none; +} +.popup, +.login-screen { + position: absolute; + left: 0; + top: 0; + width: 100%; + height: 100%; + z-index: 10400; + background: #fff; + -webkit-box-sizing: border-box; + -moz-box-sizing: border-box; + box-sizing: border-box; + display: none; + overflow: auto; + -webkit-overflow-scrolling: touch; + -webkit-transition-property: -webkit-transform; + -moz-transition-property: -moz-transform; + -ms-transition-property: -ms-transform; + -o-transition-property: -o-transform; + transition-property: transform; + -webkit-transform: translate3d(0, 100%, 0); + -ms-transform: translate3d(0, 100%, 0); + transform: translate3d(0, 100%, 0); +} +.popup.modal-in, +.login-screen.modal-in, +.popup.modal-out, +.login-screen.modal-out { + -webkit-transition-duration: 400ms; + transition-duration: 400ms; +} +.popup.modal-in, +.login-screen.modal-in { + -webkit-transform: translate3d(0, 0, 0); + -ms-transform: translate3d(0, 0, 0); + transform: translate3d(0, 0, 0); +} +.popup.modal-out, +.login-screen.modal-out { + -webkit-transform: translate3d(0, 100%, 0); + -ms-transform: translate3d(0, 100%, 0); + transform: translate3d(0, 100%, 0); +} +.login-screen.modal-in, +.login-screen.modal-out { + display: block; +} +@media all and (min-width: 630px) and (min-height: 630px) { + .popup:not(.tablet-fullscreen) { + width: 630px; + height: 630px; + left: 50%; + top: 50%; + margin-left: -315px; + margin-top: -315px; + -webkit-transform: translate3d(0, 1024px, 0); + -ms-transform: translate3d(0, 1024px, 0); + transform: translate3d(0, 1024px, 0); + } + .popup:not(.tablet-fullscreen).modal-in { + -webkit-transform: translate3d(0, 0, 0); + -ms-transform: translate3d(0, 0, 0); + transform: translate3d(0, 0, 0); + } + .popup:not(.tablet-fullscreen).modal-out { + -webkit-transform: translate3d(0, 1024px, 0); + -ms-transform: translate3d(0, 1024px, 0); + transform: translate3d(0, 1024px, 0); + } +} +@media all and (max-width: 629px), (max-height: 629px) { + html.with-statusbar-overlay .popup { + height: -webkit-calc(100% - 20px); + height: calc(100% - 20px); + top: 20px; + } + html.with-statusbar-overlay .popup-overlay { + z-index: 9800; + } +} +html.with-statusbar-overlay .login-screen, +html.with-statusbar-overlay .popup.tablet-fullscreen { + height: -webkit-calc(100% - 20px); + height: calc(100% - 20px); + top: 20px; +} +.modal .preloader { + width: 34px; + height: 34px; +} +.preloader-indicator-overlay { + visibility: visible; + opacity: 0; + background: none; +} +.preloader-indicator-modal { + position: absolute; + left: 50%; + top: 50%; + padding: 8px; + margin-left: -25px; + margin-top: -25px; + background: rgba(0, 0, 0, 0.8); + z-index: 11000; + border-radius: 5px; +} +.preloader-indicator-modal .preloader { + display: block; + width: 34px; + height: 34px; +} +html.retina.ios-gt-7 .modal-inner { + border-bottom-width: 0.5px; +} +html.retina.ios-gt-7 .modal-button { + border-right-width: 0.5px; +} +html.retina.ios-gt-7 .actions-modal-button, +html.retina.ios-gt-7 .actions-modal-label { + border-bottom-width: 0.5px; +} +html.retina.ios-gt-7 .actions-popover-label { + border-bottom-width: 0.5px; +} +html.retina.ios-gt-7 input.modal-text-input { + border-width: 0.5px; +} +/* === Panels === */ +.panel-overlay { + position: absolute; + left: 0; + top: 0; + width: 100%; + height: 100%; + background: rgba(0, 0, 0, 0); + opacity: 0; + z-index: 5999; + display: none; +} +.panel { + z-index: 1000; + display: none; + background: #111; + -webkit-box-sizing: border-box; + -moz-box-sizing: border-box; + box-sizing: border-box; + overflow: auto; + -webkit-overflow-scrolling: touch; + position: absolute; + width: 260px; + top: 0; + height: 100%; + -webkit-transform: translate3d(0, 0, 0); + -ms-transform: translate3d(0, 0, 0); + transform: translate3d(0, 0, 0); + -webkit-transition-duration: 400ms; + transition-duration: 400ms; +} +.panel.panel-left.panel-cover { + z-index: 6000; + left: -260px; +} +.panel.panel-left.panel-reveal { + left: 0; +} +.panel.panel-right.panel-cover { + z-index: 6000; + right: -260px; +} +.panel.panel-right.panel-reveal { + right: 0; +} +body.with-panel-left-cover .views, +body.with-panel-right-cover .views { + -webkit-transform: translate3d(0, 0, 0); + -ms-transform: translate3d(0, 0, 0); + transform: translate3d(0, 0, 0); +} +body.with-panel-left-cover .panel-overlay, +body.with-panel-right-cover .panel-overlay { + display: block; +} +body.with-panel-left-reveal .views, +body.with-panel-right-reveal .views { + -webkit-transition-duration: 400ms; + transition-duration: 400ms; + -webkit-transition-property: -webkit-transform; + -moz-transition-property: -moz-transform; + transition-property: transform; +} +body.with-panel-left-reveal .panel-overlay, +body.with-panel-right-reveal .panel-overlay { + display: block; +} +body.with-panel-left-reveal .views { + -webkit-transform: translate3d(260px, 0, 0); + -ms-transform: translate3d(260px, 0, 0); + transform: translate3d(260px, 0, 0); +} +body.with-panel-left-reveal .panel-overlay { + margin-left: 260px; +} +body.with-panel-left-cover .panel-left { + -webkit-transform: translate3d(260px, 0, 0); + -ms-transform: translate3d(260px, 0, 0); + transform: translate3d(260px, 0, 0); +} +body.with-panel-right-reveal .views { + -webkit-transform: translate3d(-260px, 0, 0); + -ms-transform: translate3d(-260px, 0, 0); + transform: translate3d(-260px, 0, 0); +} +body.with-panel-right-reveal .panel-overlay { + margin-left: -260px; +} +body.with-panel-right-cover .panel-right { + -webkit-transform: translate3d(-260px, 0, 0); + -ms-transform: translate3d(-260px, 0, 0); + transform: translate3d(-260px, 0, 0); +} +body.panel-closing .views { + -webkit-transition-duration: 400ms; + transition-duration: 400ms; + -webkit-transition-property: -webkit-transform; + -moz-transition-property: -moz-transform; + transition-property: transform; +} +/* === Tabs === */ +.tabs .tab { + display: none; +} +.tabs .tab.active { + display: block; +} +.tabs-animated-wrap { + position: relative; + width: 100%; + overflow: hidden; + height: 100%; +} +.tabs-animated-wrap > .tabs { + display: -webkit-box; + display: -ms-flexbox; + display: -webkit-flex; + display: flex; + height: 100%; + -webkit-transition-duration: 300ms; + transition-duration: 300ms; +} +.tabs-animated-wrap > .tabs > .tab { + width: 100%; + display: block; + -webkit-flex-shrink: 0; + -ms-flex: 0 0 auto; + flex-shrink: 0; +} +/* === Messages === */ +.messages-content { + background: #fff; +} +.messages { + display: -webkit-box; + display: -ms-flexbox; + display: -webkit-flex; + display: flex; + -webkit-box-orient: vertical; + -moz-box-orient: vertical; + -ms-flex-direction: column; + -webkit-flex-direction: column; + flex-direction: column; +} +.messages-date { + text-align: center; + font-weight: 500; + font-size: 11px; + line-height: 1; + margin: 10px 15px; + color: #8e8e93; +} +.messages-date span { + font-weight: 400; +} +.message { + -webkit-box-sizing: border-box; + -moz-box-sizing: border-box; + box-sizing: border-box; + margin: 1px 10px 0; + max-width: 70%; + display: -webkit-box; + display: -ms-flexbox; + display: -webkit-flex; + display: flex; + -webkit-box-orient: vertical; + -moz-box-orient: vertical; + -ms-flex-direction: column; + -webkit-flex-direction: column; + flex-direction: column; +} +.message:first-child { + margin-top: 10px; +} +.message .message-text { + -webkit-box-sizing: border-box; + -moz-box-sizing: border-box; + box-sizing: border-box; + border-radius: 16px; + padding: 6px 16px 9px; + min-width: 48px; + min-height: 35px; + font-size: 17px; + line-height: 1.2; + word-break: break-word; +} +.message.message-pic .message-text { + padding: 0; + background: none; +} +.message.message-pic img { + display: block; + height: auto; + max-width: 100%; + border-radius: 16px; +} +.message-name { + font-size: 12px; + line-height: 1; + color: #8e8e93; + margin-bottom: 2px; + margin-top: 7px; +} +.message-hide-name .message-name { + display: none; +} +.message-label { + font-size: 12px; + line-height: 1; + color: #8e8e93; + margin-top: 4px; +} +.message-hide-label .message-label { + display: none; +} +.message-avatar { + width: 29px; + height: 29px; + border-radius: 100%; + margin-top: -29px; + position: relative; + top: 1px; + background-size: cover; + opacity: 1; + -webkit-transition-duration: 400ms; + transition-duration: 400ms; +} +.message-hide-avatar .message-avatar { + opacity: 0; +} +.message-sent { + -ms-flex-item-align: end; + -webkit-align-self: flex-end; + align-self: flex-end; + -webkit-box-align: end; + -ms-flex-align: end; + -webkit-align-items: flex-end; + align-items: flex-end; +} +.message-sent .message-name { + margin-right: 16px; +} +.message-sent .message-label { + margin-right: 6px; +} +.message-sent.message-with-avatar .message-text { + margin-right: 29px; +} +.message-sent.message-with-avatar .message-name { + margin-right: 45px; +} +.message-sent.message-with-avatar .message-label { + margin-right: 34px; +} +.message-sent .message-text { + padding-right: 22px; + background-color: #00d449; + color: white; + margin-left: auto; + -webkit-mask-box-image: url("data:image/svg+xml;charset=utf-8,") 50% 56% 46% 42%; +} +.message-sent.message-last .message-text, +.message-sent.message-with-tail .message-text { + border-radius: 16px 16px 0 16px; + -webkit-mask-box-image: url("data:image/svg+xml;charset=utf-8,") 50% 56% 46% 42%; +} +.message-sent.message-last.message-pic img, +.message-sent.message-with-tail.message-pic img { + border-radius: 16px 16px 0 16px; +} +.message-received { + -ms-flex-item-align: start; + -webkit-align-self: flex-start; + align-self: flex-start; + -webkit-box-align: start; + -ms-flex-align: start; + -webkit-align-items: flex-start; + align-items: flex-start; +} +.message-received .message-text { + padding-left: 22px; + background-color: #e5e5ea; + color: #000; + -webkit-mask-box-image: url("data:image/svg+xml;charset=utf-8,") 50% 42% 46% 56%; +} +.message-received .message-name { + margin-left: 16px; +} +.message-received .message-label { + margin-left: 6px; +} +.message-received.message-with-avatar .message-text { + margin-left: 29px; +} +.message-received.message-with-avatar .message-name { + margin-left: 45px; +} +.message-received.message-with-avatar .message-label { + margin-left: 34px; +} +.message-received.message-last .message-text, +.message-received.message-with-tail .message-text { + border-radius: 16px 16px 16px 0; + -webkit-mask-box-image: url("data:image/svg+xml;charset=utf-8,") 50% 42% 46% 56%; +} +.message-received.message-last.message-pic img, +.message-received.message-with-tail.message-pic img { + border-radius: 16px 16px 16px 0; +} +.message-last { + margin-bottom: 8px; +} +.message-appear { + -webkit-animation: messageAppearFromBottom 400ms; + animation: messageAppearFromBottom 400ms; +} +.new-messages-first .message-appear { + -webkit-animation: messageAppearFromTop 400ms; + animation: messageAppearFromTop 400ms; +} +.messages-auto-layout .message-name, +.messages-auto-layout .message-label { + display: none; +} +.messages-auto-layout .message-avatar { + opacity: 0; +} +.messages-auto-layout .message-first .message-name { + display: block; +} +.messages-auto-layout .message-last .message-avatar { + opacity: 1; +} +.messages-auto-layout .message-last .message-label { + display: block; +} +html.retina.ios-6 .message, +html.retina.ios-6 .message.message-pic img { + -webkit-mask-box-image: none; + border-radius: 16px; +} +@-webkit-keyframes messageAppearFromBottom { + from { + -webkit-transform: translate3d(0, 100%, 0); + } + to { + -webkit-transform: translate3d(0, 0, 0); + } +} +@keyframes messageAppearFromBottom { + from { + transform: translate3d(0, 100%, 0); + } + to { + transform: translate3d(0, 0, 0); + } +} +@-webkit-keyframes messageAppearFromTop { + from { + -webkit-transform: translate3d(0, -100%, 0); + } + to { + -webkit-transform: translate3d(0, 0, 0); + } +} +@keyframes messageAppearFromTop { + from { + transform: translate3d(0, -100%, 0); + } + to { + transform: translate3d(0, 0, 0); + } +} +/* === Statusbar overlay === */ +html.with-statusbar-overlay body { + padding-top: 20px; + -webkit-box-sizing: border-box; + -moz-box-sizing: border-box; + box-sizing: border-box; +} +html.with-statusbar-overlay body .statusbar-overlay { + display: block; +} +html.with-statusbar-overlay body .panel { + padding-top: 20px; +} +.statusbar-overlay { + background: #f7f7f8; + z-index: 10000; + position: absolute; + left: 0; + top: 0; + height: 20px; + width: 100%; + display: none; + -webkit-transition-duration: 400ms; + transition-duration: 400ms; +} +/* === Preloader === */ +.preloader { + display: inline-block; + width: 20px; + height: 20px; + -webkit-transform-origin: 50%; + transform-origin: 50%; + -webkit-animation: preloader-spin 1s step-end infinite; + animation: preloader-spin 1s step-end infinite; +} +.preloader:after { + display: block; + content: ""; + width: 100%; + height: 100%; + background-image: url("data:image/svg+xml;charset=utf-8,"); + background-position: 50%; + background-size: 100%; + background-repeat: no-repeat; +} +.preloader-white:after { + background-image: url("data:image/svg+xml;charset=utf-8,"); +} +@-webkit-keyframes preloader-spin { + 0% { + -webkit-transform: rotate(0deg); + } + 8.33333333% { + -webkit-transform: rotate(30deg); + } + 16.66666667% { + -webkit-transform: rotate(60deg); + } + 25% { + -webkit-transform: rotate(90deg); + } + 33.33333333% { + -webkit-transform: rotate(120deg); + } + 41.66666667% { + -webkit-transform: rotate(150deg); + } + 50% { + -webkit-transform: rotate(180deg); + } + 58.33333333% { + -webkit-transform: rotate(210deg); + } + 66.66666667% { + -webkit-transform: rotate(240deg); + } + 75% { + -webkit-transform: rotate(270deg); + } + 83.33333333% { + -webkit-transform: rotate(300deg); + } + 91.66666667% { + -webkit-transform: rotate(330deg); + } + 100% { + -webkit-transform: rotate(360deg); + } +} +@keyframes preloader-spin { + 0% { + transform: rotate(0deg); + } + 8.33333333% { + transform: rotate(30deg); + } + 16.66666667% { + transform: rotate(60deg); + } + 25% { + transform: rotate(90deg); + } + 33.33333333% { + transform: rotate(120deg); + } + 41.66666667% { + transform: rotate(150deg); + } + 50% { + transform: rotate(180deg); + } + 58.33333333% { + transform: rotate(210deg); + } + 66.66666667% { + transform: rotate(240deg); + } + 75% { + transform: rotate(270deg); + } + 83.33333333% { + transform: rotate(300deg); + } + 91.66666667% { + transform: rotate(330deg); + } + 100% { + transform: rotate(360deg); + } +} +/* === Pull To Refresh === */ +.pull-to-refresh-layer { + position: absolute; + position: relative; + margin-top: -44px; + left: 0; + top: 0; + width: 100%; + height: 44px; +} +.pull-to-refresh-layer .preloader { + position: absolute; + left: 50%; + top: 50%; + margin-left: -10px; + margin-top: -10px; + visibility: hidden; +} +.pull-to-refresh-layer .pull-to-refresh-arrow { + width: 13px; + height: 20px; + position: absolute; + left: 50%; + top: 50%; + margin-left: -6px; + margin-top: -10px; + background: no-repeat center; + background-image: url("data:image/svg+xml;charset=utf-8,"); + background-size: 13px 20px; + z-index: 10; + -webkit-transform: rotate(0deg) translate3d(0, 0, 0); + -ms-transform: rotate(0deg) translate3d(0, 0, 0); + transform: rotate(0deg) translate3d(0, 0, 0); + -webkit-transition-duration: 300ms; + transition-duration: 300ms; +} +.pull-to-refresh-content.pull-to-refresh-no-navbar { + margin-top: -44px; + height: -webkit-calc(100% + 44px); + height: -moz-calc(100% + 44px); + height: calc(100% + 44px); +} +.pull-to-refresh-content.pull-to-refresh-no-navbar .pull-to-refresh-layer { + margin-top: 0; +} +.pull-to-refresh-content.transitioning, +.pull-to-refresh-content.refreshing { + -webkit-transition-duration: 400ms; + transition-duration: 400ms; +} +.pull-to-refresh-content:not(.refreshing) .preloader { + -webkit-animation: none; + animation: none; +} +.pull-to-refresh-content.refreshing { + -webkit-transform: translate3d(0, 44px, 0); + -ms-transform: translate3d(0, 44px, 0); + transform: translate3d(0, 44px, 0); +} +.pull-to-refresh-content.refreshing .pull-to-refresh-arrow { + visibility: hidden; + -webkit-transition-duration: 0ms; + transition-duration: 0ms; +} +.pull-to-refresh-content.refreshing .preloader { + visibility: visible; +} +.pull-to-refresh-content.pull-up .pull-to-refresh-arrow { + -webkit-transform: rotate(180deg) translate3d(0, 0, 0); + -ms-transform: rotate(180deg) translate3d(0, 0, 0); + transform: rotate(180deg) translate3d(0, 0, 0); +} +/* === Slider === */ +.slider-container { + position: relative; + overflow: hidden; + width: 100%; + height: 100%; +} +.slider-wrapper { + display: -webkit-box; + display: -ms-flexbox; + display: -webkit-flex; + display: flex; + width: 100%; + height: 100%; + position: relative; + -webkit-transition-property: -webkit-transform; + -moz-transition-property: -moz-transform; + transition-property: transform; + -webkit-transform: translate3d(0, 0, 0); + -ms-transform: translate3d(0, 0, 0); + transform: translate3d(0, 0, 0); +} +.slider-container-vertical > .slider-wrapper { + -webkit-box-orient: vertical; + -moz-box-orient: vertical; + -ms-flex-direction: column; + -webkit-flex-direction: column; + flex-direction: column; +} +.slider-slide { + -webkit-flex-shrink: 0; + -ms-flex: 0 0 auto; + flex-shrink: 0; + width: 100%; + height: 100%; +} +.slider-pagination { + position: absolute; + z-index: 10; + -webkit-transform: translate3d(0, 0, 0); + -ms-transform: translate3d(0, 0, 0); + transform: translate3d(0, 0, 0); + left: 0; + bottom: 10px; + width: 100%; + text-align: center; + -webkit-transition-duration: 300ms; + transition-duration: 300ms; + opacity: 1; + -webkit-transition-property: opacity; + -moz-transition-property: opacity; + transition-property: opacity; +} +.slider-pagination.slider-pagination-hidden { + opacity: 0; + pointer-events: none; +} +.slider-container-vertical > .slider-pagination { + right: 10px; + left: auto; + top: 50%; + bottom: auto; + width: auto; + height: auto; + -webkit-transform: translate3d(0, -50%, 0); + -ms-transform: translate3d(0, -50%, 0); + transform: translate3d(0, -50%, 0); +} +.slider-container-vertical > .slider-pagination .slider-pagination-bullet { + display: block; + margin: 5px 0; +} +.slider-pagination-bullet { + width: 8px; + height: 8px; + display: inline-block; + border-radius: 100%; + background: #000; + opacity: 0.2; + margin: 0 5px; +} +.slider-pagination-active { + opacity: 1; + background: #007aff; +} +/* === Photo Browser === */ +.photo-browser { + position: absolute; + left: 0; + top: 0; + width: 100%; + height: 100%; + z-index: 10500; +} +body > .photo-browser { + opacity: 0; + display: none; + -webkit-transform: translate3d(0, 0, 0); + -ms-transform: translate3d(0, 0, 0); + transform: translate3d(0, 0, 0); +} +body > .photo-browser.photo-browser-in { + display: block; + -webkit-animation: photoBrowserIn 400ms forwards; + animation: photoBrowserIn 400ms forwards; +} +body > .photo-browser.photo-browser-out { + display: block; + -webkit-animation: photoBrowserOut 400ms forwards; + animation: photoBrowserOut 400ms forwards; +} +html.with-statusbar-overlay body > .photo-browser { + height: -webkit-calc(100% - 20px); + height: calc(100% - 20px); + top: 20px; +} +.popup > .photo-browser .navbar, +body > .photo-browser .navbar, +.popup > .photo-browser .toolbar, +body > .photo-browser .toolbar { + -webkit-transform: translate3d(0, 0, 0); + -ms-transform: translate3d(0, 0, 0); + transform: translate3d(0, 0, 0); +} +.photo-browser .page[data-page="photo-browser-slides"] { + background: none; +} +.photo-browser-popup { + background: none; +} +.photo-browser .navbar, +.view[data-page="photo-browser-slides"] .navbar, +.photo-browser .toolbar, +.view[data-page="photo-browser-slides"] .toolbar { + background: rgba(247, 247, 247, 0.95); + -webkit-transition-duration: 400ms; + transition-duration: 400ms; +} +.view[data-page="photo-browser-slides"] .page[data-page="photo-browser-slides"] .navbar, +.view[data-page="photo-browser-slides"] .page[data-page="photo-browser-slides"] .toolbar { + -webkit-transform: translate3d(0, 0, 0); + -ms-transform: translate3d(0, 0, 0); + transform: translate3d(0, 0, 0); +} +.photo-browser-exposed .navbar, +.photo-browser-exposed .toolbar { + opacity: 0; + visibility: hidden; + pointer-events: none; +} +.photo-browser-exposed .photo-browser-slider-container { + background: #000; +} +.photo-browser-of { + margin: 0 5px; +} +.photo-browser-captions { + pointer-events: none; + position: absolute; + left: 0; + width: 100%; + bottom: 0; + z-index: 10; + opacity: 1; + -webkit-transition-duration: 400ms; + transition-duration: 400ms; +} +.photo-browser-captions.photo-browser-captions-exposed { + opacity: 0; +} +.toolbar ~ .photo-browser-captions { + bottom: 44px; + -webkit-transform: translate3d(0, 0px, 0); + -ms-transform: translate3d(0, 0px, 0); + transform: translate3d(0, 0px, 0); +} +.photo-browser-exposed .toolbar ~ .photo-browser-captions { + -webkit-transform: translate3d(0, 44px, 0); + -ms-transform: translate3d(0, 44px, 0); + transform: translate3d(0, 44px, 0); +} +.toolbar ~ .photo-browser-captions.photo-browser-captions-exposed { + -webkit-transform: translate3d(0, 0px, 0); + -ms-transform: translate3d(0, 0px, 0); + transform: translate3d(0, 0px, 0); +} +.photo-browser-caption { + -webkit-box-sizing: border-box; + -moz-box-sizing: border-box; + box-sizing: border-box; + -webkit-transition-duration: 300ms; + transition-duration: 300ms; + position: absolute; + bottom: 0; + left: 0; + opacity: 0; + padding: 4px 5px; + width: 100%; + text-align: center; + color: #fff; + background: rgba(0, 0, 0, 0.8); +} +.photo-browser-caption:empty { + display: none; +} +.photo-browser-caption.photo-browser-caption-active { + opacity: 1; +} +.photo-browser-captions-light .photo-browser-caption { + background: rgba(255, 255, 255, 0.8); + color: #000; +} +.photo-browser-exposed .photo-browser-caption { + color: #fff; + background: rgba(0, 0, 0, 0.8); +} +.photo-browser-slider-container { + position: absolute; + left: 0; + top: 0; + width: 100%; + height: 100%; + overflow: hidden; + background: #fff; + -webkit-transition-duration: 400ms; + transition-duration: 400ms; +} +.photo-browser-slider-wrapper { + position: absolute; + left: 0; + top: 0; + width: 100%; + height: 100%; + padding: 0; + display: -webkit-box; + display: -ms-flexbox; + display: -webkit-flex; + display: flex; +} +.photo-browser-link-inactive { + opacity: 0.3; +} +.photo-browser-slide { + width: 100%; + height: 100%; + position: relative; + overflow: hidden; + display: -webkit-box; + display: -ms-flexbox; + display: -webkit-flex; + display: flex; + -webkit-box-pack: center; + -ms-flex-pack: center; + -webkit-justify-content: center; + justify-content: center; + -webkit-box-align: center; + -ms-flex-align: center; + -webkit-align-items: center; + align-items: center; + -webkit-flex-shrink: 0; + -ms-flex: 0 0 auto; + flex-shrink: 0; + -webkit-box-sizing: border-box; + -moz-box-sizing: border-box; + box-sizing: border-box; +} +.photo-browser-slide.transitioning { + -webkit-transition-duration: 400ms; + transition-duration: 400ms; +} +.photo-browser-slide span.photo-browser-zoom-container { + width: 100%; + text-align: center; + display: none; +} +.photo-browser-slide img { + width: auto; + height: auto; + max-width: 100%; + max-height: 100%; + display: none; +} +.photo-browser-slide.slider-slide-active span.photo-browser-zoom-container, +.photo-browser-slide.slider-slide-next span.photo-browser-zoom-container, +.photo-browser-slide.slider-slide-prev span.photo-browser-zoom-container { + display: block; +} +.photo-browser-slide.slider-slide-active img, +.photo-browser-slide.slider-slide-next img, +.photo-browser-slide.slider-slide-prev img { + display: inline; +} +.photo-browser-slide.slider-slide-active.photo-browser-slide-lazy .preloader, +.photo-browser-slide.slider-slide-next.photo-browser-slide-lazy .preloader, +.photo-browser-slide.slider-slide-prev.photo-browser-slide-lazy .preloader { + display: block; +} +.photo-browser-slide iframe { + width: 100%; + height: 100%; +} +.photo-browser-slide .preloader { + display: none; + position: absolute; + width: 42px; + height: 42px; + margin-left: -21px; + margin-top: -21px; + left: 50%; + top: 50%; +} +.photo-browser-dark .navbar, +.photo-browser-dark .toolbar { + background: rgba(30, 30, 30, 0.8); + border: none; + color: #fff; +} +.photo-browser-dark .navbar a, +.photo-browser-dark .toolbar a { + color: #fff; +} +.photo-browser-dark .photo-browser-slider-container { + background: #000; +} +@-webkit-keyframes photoBrowserIn { + 0% { + -webkit-transform: translate3d(0, 0, 0) scale(0.5); + opacity: 0; + } + 100% { + -webkit-transform: translate3d(0, 0, 0) scale(1); + opacity: 1; + } +} +@keyframes photoBrowserIn { + 0% { + transform: translate3d(0, 0, 0) scale(0.5); + opacity: 0; + } + 100% { + transform: translate3d(0, 0, 0) scale(1); + opacity: 1; + } +} +@-webkit-keyframes photoBrowserOut { + 0% { + -webkit-transform: translate3d(0, 0, 0) scale(1); + opacity: 1; + } + 100% { + -webkit-transform: translate3d(0, 0, 0) scale(0.5); + opacity: 0; + } +} +@keyframes photoBrowserOut { + 0% { + transform: translate3d(0, 0, 0) scale(1); + opacity: 1; + } + 100% { + transform: translate3d(0, 0, 0) scale(0.5); + opacity: 0; + } +} +/* === Notifications === */ +.notifications { + position: absolute; + left: 0; + top: 0; + width: 100%; + z-index: 20000; + color: #fff; + font-size: 14px; + margin: 0; + border: none; + display: none; + -webkit-box-sizing: border-box; + -moz-box-sizing: border-box; + box-sizing: border-box; + max-height: 100%; + overflow: auto; + -webkit-overflow-scrolling: touch; + -webkit-transition-duration: 450ms; + transition-duration: 450ms; + background: rgba(0, 0, 0, 0.85); + -webkit-perspective: 1200px; + perspective: 1200px; +} +.notifications.list-block > ul { + border: none; + background: none; + margin: 0; +} +.with-statusbar-overlay .notifications { + padding-top: 20px; + -webkit-transform: translate3d(0, -20px, 0); + -ms-transform: translate3d(0, -20px, 0); + transform: translate3d(0, -20px, 0); +} +.notifications .item-content { + -webkit-box-align: start; + -ms-flex-align: start; + -webkit-align-items: flex-start; + align-items: flex-start; +} +.notifications .item-text, +.notifications .item-subtitle, +.notifications .item-title { + font-size: 14px; +} +.notifications .item-title { + font-weight: 500; +} +.notifications .item-text { + height: auto; + color: #d2d2d2; + line-height: inherit; +} +.notifications .item-text, +.notifications .item-subtitle { + font-weight: 300; +} +.notifications .item-inner { + border-bottom-color: rgba(255, 255, 255, 0.2); +} +.notifications .item-media i.icon { + width: 20px; + height: 20px; + -webkit-background-size: cover; + background-size: cover; + background-position: center; + background-repeat: no-repeat; +} +.notifications li.notification-item .item-media { + padding-top: 13px; +} +.notifications .close-notification { + width: 19px; + height: 19px; + background: url("data:image/svg+xml;charset=utf-8,") no-repeat center top; + -webkit-background-size: 100% auto; + background-size: 100% auto; + position: relative; +} +.notifications .close-notification span { + position: absolute; + width: 44px; + height: 44px; + left: 50%; + top: 50%; + margin-left: -22px; + margin-top: -22px; +} +.notifications .notification-item { + max-width: 568px; + margin: 0 auto; + -webkit-transition-duration: 450ms; + transition-duration: 450ms; + -webkit-transform: translate3d(0, 0, 0); + -ms-transform: translate3d(0, 0, 0); + transform: translate3d(0, 0, 0); + opacity: 1; +} +.notifications .notification-hidden { + opacity: 0; + -webkit-transform: translate3d(0, 0, 0); + -ms-transform: translate3d(0, 0, 0); + transform: translate3d(0, 0, 0); +} +/* === Login screen === */ +.login-screen-content { + background: #fff; +} +.login-screen-content .login-screen-title, +.login-screen-content .list-block, +.login-screen-content .content-block, +.login-screen-content .list-block-label { + max-width: 480px; + margin: 25px auto; +} +.login-screen-content .list-block ul { + border: none; + background: none; +} +.login-screen-content .list-block-label { + text-align: center; +} +.login-screen-title { + text-align: center; + font-size: 30px; +} +/* === Disabled elements === */ +.disabled, +[disabled] { + opacity: 0.55; + pointer-events: none; +} +.disabled .disabled, +.disabled [disabled], +[disabled] .disabled, +[disabled] [disabled] { + opacity: 1; +} +/* === Color Themes === */ +.color-gray { + color: #8e8e93; +} +.list-block .item-link.list-button.color-gray, +.tabbar a.active.color-gray, +a.color-gray { + color: #8e8e93; +} +.label-switch input[type="checkbox"]:checked + .checkbox.color-gray, +.label-switch.color-gray input[type="checkbox"]:checked + .checkbox { + background-color: #8e8e93; +} +.color-gray.button:not(.button-fill), +.color-gray.buttons-row .button, +.theme-gray .button:not(.button-fill) { + border-color: #8e8e93; +} +html:not(.watch-active-state) .color-gray.button:not(.button-fill):active, +html:not(.watch-active-state) .color-gray.buttons-row .button:active, +html:not(.watch-active-state) .theme-gray .button:not(.button-fill):active, +.color-gray.button:not(.button-fill).active-state, +.color-gray.buttons-row .button.active-state, +.theme-gray .button:not(.button-fill).active-state { + background-color: rgba(142, 142, 147, 0.15); +} +.color-gray.button:not(.button-fill).active, +.color-gray.buttons-row .button.active, +.theme-gray .button:not(.button-fill).active { + background-color: #8e8e93; + color: #fff; +} +.theme-gray .button.button-fill, +.button.button-fill.color-gray { + background: #8e8e93; + color: #fff; +} +.color-gray i.icon, +.theme-gray i.icon, +i.icon.color-gray, +i.icon.theme-gray { + color: #8e8e93; +} +i.icon-next.color-gray, +i.icon-next.theme-gray, +.theme-gray i.icon-next { + background-image: url("data:image/svg+xml;charset=utf-8,"); +} +i.icon-prev.color-gray, +i.icon-prev.theme-gray, +.theme-gray i.icon-prev { + background-image: url("data:image/svg+xml;charset=utf-8,"); +} +i.icon-back.color-gray, +i.icon-back.theme-gray, +.theme-gray i.icon-back { + background-image: url("data:image/svg+xml;charset=utf-8,"); +} +i.icon-bars.color-gray, +i.icon-bars.theme-gray, +.theme-gray i.icon-bars { + background-image: url("data:image/svg+xml;charset=utf-8,"); +} +@media all and (-webkit-max-device-pixel-ratio: 1), (max-resolution: 120dpi) { + i.icon-bars.color-gray, + i.icon-bars.theme-gray, + .theme-gray i.icon-bars { + background-image: url("data:image/svg+xml;charset=utf-8,"); + } +} +.theme-gray a, +.theme-gray .item-link.list-button { + color: #8e8e93; +} +.theme-gray .tabbar a, +.tabbar.theme-gray a { + color: inherit; +} +.theme-gray .tabbar a.active, +.tabbar.theme-gray a.active { + color: #8e8e93; +} +.theme-gray .range-slider input[type="range"]::-webkit-slider-thumb:before, +.range-slider.theme-gray input[type="range"]::-webkit-slider-thumb:before { + background-color: #8e8e93; +} +.theme-gray label.label-checkbox input[type="checkbox"]:checked + .item-media i.icon-form-checkbox, +.theme-gray label.label-checkbox input[type="radio"]:checked + .item-media i.icon-form-checkbox { + background-color: #8e8e93; +} +.theme-gray label.label-radio input[type="checkbox"]:checked ~ .item-inner, +.theme-gray label.label-radio input[type="radio"]:checked ~ .item-inner { + background-image: url("data:image/svg+xml;charset=utf-8, "); +} +.theme-gray .slider-pagination-active { + background-color: #8e8e93; +} +.bg-gray, +.button.button-fill.bg-gray, +a.bg-gray, +.list-block .swipeout-actions-left a.bg-gray, +.list-block .swipeout-actions-right a.bg-gray { + background-color: #8e8e93; +} +.border-gray { + border-color: #8e8e93; +} +.color-white { + color: #ffffff; +} +.list-block .item-link.list-button.color-white, +.tabbar a.active.color-white, +a.color-white { + color: #ffffff; +} +.label-switch input[type="checkbox"]:checked + .checkbox.color-white, +.label-switch.color-white input[type="checkbox"]:checked + .checkbox { + background-color: #ffffff; +} +.color-white.button:not(.button-fill), +.color-white.buttons-row .button, +.theme-white .button:not(.button-fill) { + border-color: #ffffff; +} +html:not(.watch-active-state) .color-white.button:not(.button-fill):active, +html:not(.watch-active-state) .color-white.buttons-row .button:active, +html:not(.watch-active-state) .theme-white .button:not(.button-fill):active, +.color-white.button:not(.button-fill).active-state, +.color-white.buttons-row .button.active-state, +.theme-white .button:not(.button-fill).active-state { + background-color: rgba(255, 255, 255, 0.15); +} +.color-white.button:not(.button-fill).active, +.color-white.buttons-row .button.active, +.theme-white .button:not(.button-fill).active { + background-color: #ffffff; + color: #fff; +} +.theme-white .button.button-fill, +.button.button-fill.color-white { + background: #ffffff; + color: #fff; +} +.color-white i.icon, +.theme-white i.icon, +i.icon.color-white, +i.icon.theme-white { + color: #ffffff; +} +i.icon-next.color-white, +i.icon-next.theme-white, +.theme-white i.icon-next { + background-image: url("data:image/svg+xml;charset=utf-8,"); +} +i.icon-prev.color-white, +i.icon-prev.theme-white, +.theme-white i.icon-prev { + background-image: url("data:image/svg+xml;charset=utf-8,"); +} +i.icon-back.color-white, +i.icon-back.theme-white, +.theme-white i.icon-back { + background-image: url("data:image/svg+xml;charset=utf-8,"); +} +i.icon-bars.color-white, +i.icon-bars.theme-white, +.theme-white i.icon-bars { + background-image: url("data:image/svg+xml;charset=utf-8,"); +} +@media all and (-webkit-max-device-pixel-ratio: 1), (max-resolution: 120dpi) { + i.icon-bars.color-white, + i.icon-bars.theme-white, + .theme-white i.icon-bars { + background-image: url("data:image/svg+xml;charset=utf-8,"); + } +} +.theme-white a, +.theme-white .item-link.list-button { + color: #ffffff; +} +.theme-white .tabbar a, +.tabbar.theme-white a { + color: inherit; +} +.theme-white .tabbar a.active, +.tabbar.theme-white a.active { + color: #ffffff; +} +.theme-white .range-slider input[type="range"]::-webkit-slider-thumb:before, +.range-slider.theme-white input[type="range"]::-webkit-slider-thumb:before { + background-color: #ffffff; +} +.theme-white label.label-checkbox input[type="checkbox"]:checked + .item-media i.icon-form-checkbox, +.theme-white label.label-checkbox input[type="radio"]:checked + .item-media i.icon-form-checkbox { + background-color: #ffffff; +} +.theme-white label.label-radio input[type="checkbox"]:checked ~ .item-inner, +.theme-white label.label-radio input[type="radio"]:checked ~ .item-inner { + background-image: url("data:image/svg+xml;charset=utf-8, "); +} +.theme-white .slider-pagination-active { + background-color: #ffffff; +} +.bg-white, +.button.button-fill.bg-white, +a.bg-white, +.list-block .swipeout-actions-left a.bg-white, +.list-block .swipeout-actions-right a.bg-white { + background-color: #ffffff; +} +.border-white { + border-color: #ffffff; +} +.color-black { + color: #000000; +} +.list-block .item-link.list-button.color-black, +.tabbar a.active.color-black, +a.color-black { + color: #000000; +} +.label-switch input[type="checkbox"]:checked + .checkbox.color-black, +.label-switch.color-black input[type="checkbox"]:checked + .checkbox { + background-color: #000000; +} +.color-black.button:not(.button-fill), +.color-black.buttons-row .button, +.theme-black .button:not(.button-fill) { + border-color: #000000; +} +html:not(.watch-active-state) .color-black.button:not(.button-fill):active, +html:not(.watch-active-state) .color-black.buttons-row .button:active, +html:not(.watch-active-state) .theme-black .button:not(.button-fill):active, +.color-black.button:not(.button-fill).active-state, +.color-black.buttons-row .button.active-state, +.theme-black .button:not(.button-fill).active-state { + background-color: rgba(0, 0, 0, 0.15); +} +.color-black.button:not(.button-fill).active, +.color-black.buttons-row .button.active, +.theme-black .button:not(.button-fill).active { + background-color: #000000; + color: #fff; +} +.theme-black .button.button-fill, +.button.button-fill.color-black { + background: #000000; + color: #fff; +} +.color-black i.icon, +.theme-black i.icon, +i.icon.color-black, +i.icon.theme-black { + color: #000000; +} +i.icon-next.color-black, +i.icon-next.theme-black, +.theme-black i.icon-next { + background-image: url("data:image/svg+xml;charset=utf-8,"); +} +i.icon-prev.color-black, +i.icon-prev.theme-black, +.theme-black i.icon-prev { + background-image: url("data:image/svg+xml;charset=utf-8,"); +} +i.icon-back.color-black, +i.icon-back.theme-black, +.theme-black i.icon-back { + background-image: url("data:image/svg+xml;charset=utf-8,"); +} +i.icon-bars.color-black, +i.icon-bars.theme-black, +.theme-black i.icon-bars { + background-image: url("data:image/svg+xml;charset=utf-8,"); +} +@media all and (-webkit-max-device-pixel-ratio: 1), (max-resolution: 120dpi) { + i.icon-bars.color-black, + i.icon-bars.theme-black, + .theme-black i.icon-bars { + background-image: url("data:image/svg+xml;charset=utf-8,"); + } +} +.theme-black a, +.theme-black .item-link.list-button { + color: #000000; +} +.theme-black .tabbar a, +.tabbar.theme-black a { + color: inherit; +} +.theme-black .tabbar a.active, +.tabbar.theme-black a.active { + color: #000000; +} +.theme-black .range-slider input[type="range"]::-webkit-slider-thumb:before, +.range-slider.theme-black input[type="range"]::-webkit-slider-thumb:before { + background-color: #000000; +} +.theme-black label.label-checkbox input[type="checkbox"]:checked + .item-media i.icon-form-checkbox, +.theme-black label.label-checkbox input[type="radio"]:checked + .item-media i.icon-form-checkbox { + background-color: #000000; +} +.theme-black label.label-radio input[type="checkbox"]:checked ~ .item-inner, +.theme-black label.label-radio input[type="radio"]:checked ~ .item-inner { + background-image: url("data:image/svg+xml;charset=utf-8, "); +} +.theme-black .slider-pagination-active { + background-color: #000000; +} +.bg-black, +.button.button-fill.bg-black, +a.bg-black, +.list-block .swipeout-actions-left a.bg-black, +.list-block .swipeout-actions-right a.bg-black { + background-color: #000000; +} +.border-black { + border-color: #000000; +} +.color-lightblue { + color: #5ac8fa; +} +.list-block .item-link.list-button.color-lightblue, +.tabbar a.active.color-lightblue, +a.color-lightblue { + color: #5ac8fa; +} +.label-switch input[type="checkbox"]:checked + .checkbox.color-lightblue, +.label-switch.color-lightblue input[type="checkbox"]:checked + .checkbox { + background-color: #5ac8fa; +} +.color-lightblue.button:not(.button-fill), +.color-lightblue.buttons-row .button, +.theme-lightblue .button:not(.button-fill) { + border-color: #5ac8fa; +} +html:not(.watch-active-state) .color-lightblue.button:not(.button-fill):active, +html:not(.watch-active-state) .color-lightblue.buttons-row .button:active, +html:not(.watch-active-state) .theme-lightblue .button:not(.button-fill):active, +.color-lightblue.button:not(.button-fill).active-state, +.color-lightblue.buttons-row .button.active-state, +.theme-lightblue .button:not(.button-fill).active-state { + background-color: rgba(90, 200, 250, 0.15); +} +.color-lightblue.button:not(.button-fill).active, +.color-lightblue.buttons-row .button.active, +.theme-lightblue .button:not(.button-fill).active { + background-color: #5ac8fa; + color: #fff; +} +.theme-lightblue .button.button-fill, +.button.button-fill.color-lightblue { + background: #5ac8fa; + color: #fff; +} +.color-lightblue i.icon, +.theme-lightblue i.icon, +i.icon.color-lightblue, +i.icon.theme-lightblue { + color: #5ac8fa; +} +i.icon-next.color-lightblue, +i.icon-next.theme-lightblue, +.theme-lightblue i.icon-next { + background-image: url("data:image/svg+xml;charset=utf-8,"); +} +i.icon-prev.color-lightblue, +i.icon-prev.theme-lightblue, +.theme-lightblue i.icon-prev { + background-image: url("data:image/svg+xml;charset=utf-8,"); +} +i.icon-back.color-lightblue, +i.icon-back.theme-lightblue, +.theme-lightblue i.icon-back { + background-image: url("data:image/svg+xml;charset=utf-8,"); +} +i.icon-bars.color-lightblue, +i.icon-bars.theme-lightblue, +.theme-lightblue i.icon-bars { + background-image: url("data:image/svg+xml;charset=utf-8,"); +} +@media all and (-webkit-max-device-pixel-ratio: 1), (max-resolution: 120dpi) { + i.icon-bars.color-lightblue, + i.icon-bars.theme-lightblue, + .theme-lightblue i.icon-bars { + background-image: url("data:image/svg+xml;charset=utf-8,"); + } +} +.theme-lightblue a, +.theme-lightblue .item-link.list-button { + color: #5ac8fa; +} +.theme-lightblue .tabbar a, +.tabbar.theme-lightblue a { + color: inherit; +} +.theme-lightblue .tabbar a.active, +.tabbar.theme-lightblue a.active { + color: #5ac8fa; +} +.theme-lightblue .range-slider input[type="range"]::-webkit-slider-thumb:before, +.range-slider.theme-lightblue input[type="range"]::-webkit-slider-thumb:before { + background-color: #5ac8fa; +} +.theme-lightblue label.label-checkbox input[type="checkbox"]:checked + .item-media i.icon-form-checkbox, +.theme-lightblue label.label-checkbox input[type="radio"]:checked + .item-media i.icon-form-checkbox { + background-color: #5ac8fa; +} +.theme-lightblue label.label-radio input[type="checkbox"]:checked ~ .item-inner, +.theme-lightblue label.label-radio input[type="radio"]:checked ~ .item-inner { + background-image: url("data:image/svg+xml;charset=utf-8, "); +} +.theme-lightblue .slider-pagination-active { + background-color: #5ac8fa; +} +.bg-lightblue, +.button.button-fill.bg-lightblue, +a.bg-lightblue, +.list-block .swipeout-actions-left a.bg-lightblue, +.list-block .swipeout-actions-right a.bg-lightblue { + background-color: #5ac8fa; +} +.border-lightblue { + border-color: #5ac8fa; +} +.color-yellow { + color: #ffcc00; +} +.list-block .item-link.list-button.color-yellow, +.tabbar a.active.color-yellow, +a.color-yellow { + color: #ffcc00; +} +.label-switch input[type="checkbox"]:checked + .checkbox.color-yellow, +.label-switch.color-yellow input[type="checkbox"]:checked + .checkbox { + background-color: #ffcc00; +} +.color-yellow.button:not(.button-fill), +.color-yellow.buttons-row .button, +.theme-yellow .button:not(.button-fill) { + border-color: #ffcc00; +} +html:not(.watch-active-state) .color-yellow.button:not(.button-fill):active, +html:not(.watch-active-state) .color-yellow.buttons-row .button:active, +html:not(.watch-active-state) .theme-yellow .button:not(.button-fill):active, +.color-yellow.button:not(.button-fill).active-state, +.color-yellow.buttons-row .button.active-state, +.theme-yellow .button:not(.button-fill).active-state { + background-color: rgba(255, 204, 0, 0.15); +} +.color-yellow.button:not(.button-fill).active, +.color-yellow.buttons-row .button.active, +.theme-yellow .button:not(.button-fill).active { + background-color: #ffcc00; + color: #fff; +} +.theme-yellow .button.button-fill, +.button.button-fill.color-yellow { + background: #ffcc00; + color: #fff; +} +.color-yellow i.icon, +.theme-yellow i.icon, +i.icon.color-yellow, +i.icon.theme-yellow { + color: #ffcc00; +} +i.icon-next.color-yellow, +i.icon-next.theme-yellow, +.theme-yellow i.icon-next { + background-image: url("data:image/svg+xml;charset=utf-8,"); +} +i.icon-prev.color-yellow, +i.icon-prev.theme-yellow, +.theme-yellow i.icon-prev { + background-image: url("data:image/svg+xml;charset=utf-8,"); +} +i.icon-back.color-yellow, +i.icon-back.theme-yellow, +.theme-yellow i.icon-back { + background-image: url("data:image/svg+xml;charset=utf-8,"); +} +i.icon-bars.color-yellow, +i.icon-bars.theme-yellow, +.theme-yellow i.icon-bars { + background-image: url("data:image/svg+xml;charset=utf-8,"); +} +@media all and (-webkit-max-device-pixel-ratio: 1), (max-resolution: 120dpi) { + i.icon-bars.color-yellow, + i.icon-bars.theme-yellow, + .theme-yellow i.icon-bars { + background-image: url("data:image/svg+xml;charset=utf-8,"); + } +} +.theme-yellow a, +.theme-yellow .item-link.list-button { + color: #ffcc00; +} +.theme-yellow .tabbar a, +.tabbar.theme-yellow a { + color: inherit; +} +.theme-yellow .tabbar a.active, +.tabbar.theme-yellow a.active { + color: #ffcc00; +} +.theme-yellow .range-slider input[type="range"]::-webkit-slider-thumb:before, +.range-slider.theme-yellow input[type="range"]::-webkit-slider-thumb:before { + background-color: #ffcc00; +} +.theme-yellow label.label-checkbox input[type="checkbox"]:checked + .item-media i.icon-form-checkbox, +.theme-yellow label.label-checkbox input[type="radio"]:checked + .item-media i.icon-form-checkbox { + background-color: #ffcc00; +} +.theme-yellow label.label-radio input[type="checkbox"]:checked ~ .item-inner, +.theme-yellow label.label-radio input[type="radio"]:checked ~ .item-inner { + background-image: url("data:image/svg+xml;charset=utf-8, "); +} +.theme-yellow .slider-pagination-active { + background-color: #ffcc00; +} +.bg-yellow, +.button.button-fill.bg-yellow, +a.bg-yellow, +.list-block .swipeout-actions-left a.bg-yellow, +.list-block .swipeout-actions-right a.bg-yellow { + background-color: #ffcc00; +} +.border-yellow { + border-color: #ffcc00; +} +.color-orange { + color: #ff9500; +} +.list-block .item-link.list-button.color-orange, +.tabbar a.active.color-orange, +a.color-orange { + color: #ff9500; +} +.label-switch input[type="checkbox"]:checked + .checkbox.color-orange, +.label-switch.color-orange input[type="checkbox"]:checked + .checkbox { + background-color: #ff9500; +} +.color-orange.button:not(.button-fill), +.color-orange.buttons-row .button, +.theme-orange .button:not(.button-fill) { + border-color: #ff9500; +} +html:not(.watch-active-state) .color-orange.button:not(.button-fill):active, +html:not(.watch-active-state) .color-orange.buttons-row .button:active, +html:not(.watch-active-state) .theme-orange .button:not(.button-fill):active, +.color-orange.button:not(.button-fill).active-state, +.color-orange.buttons-row .button.active-state, +.theme-orange .button:not(.button-fill).active-state { + background-color: rgba(255, 149, 0, 0.15); +} +.color-orange.button:not(.button-fill).active, +.color-orange.buttons-row .button.active, +.theme-orange .button:not(.button-fill).active { + background-color: #ff9500; + color: #fff; +} +.theme-orange .button.button-fill, +.button.button-fill.color-orange { + background: #ff9500; + color: #fff; +} +.color-orange i.icon, +.theme-orange i.icon, +i.icon.color-orange, +i.icon.theme-orange { + color: #ff9500; +} +i.icon-next.color-orange, +i.icon-next.theme-orange, +.theme-orange i.icon-next { + background-image: url("data:image/svg+xml;charset=utf-8,"); +} +i.icon-prev.color-orange, +i.icon-prev.theme-orange, +.theme-orange i.icon-prev { + background-image: url("data:image/svg+xml;charset=utf-8,"); +} +i.icon-back.color-orange, +i.icon-back.theme-orange, +.theme-orange i.icon-back { + background-image: url("data:image/svg+xml;charset=utf-8,"); +} +i.icon-bars.color-orange, +i.icon-bars.theme-orange, +.theme-orange i.icon-bars { + background-image: url("data:image/svg+xml;charset=utf-8,"); +} +@media all and (-webkit-max-device-pixel-ratio: 1), (max-resolution: 120dpi) { + i.icon-bars.color-orange, + i.icon-bars.theme-orange, + .theme-orange i.icon-bars { + background-image: url("data:image/svg+xml;charset=utf-8,"); + } +} +.theme-orange a, +.theme-orange .item-link.list-button { + color: #ff9500; +} +.theme-orange .tabbar a, +.tabbar.theme-orange a { + color: inherit; +} +.theme-orange .tabbar a.active, +.tabbar.theme-orange a.active { + color: #ff9500; +} +.theme-orange .range-slider input[type="range"]::-webkit-slider-thumb:before, +.range-slider.theme-orange input[type="range"]::-webkit-slider-thumb:before { + background-color: #ff9500; +} +.theme-orange label.label-checkbox input[type="checkbox"]:checked + .item-media i.icon-form-checkbox, +.theme-orange label.label-checkbox input[type="radio"]:checked + .item-media i.icon-form-checkbox { + background-color: #ff9500; +} +.theme-orange label.label-radio input[type="checkbox"]:checked ~ .item-inner, +.theme-orange label.label-radio input[type="radio"]:checked ~ .item-inner { + background-image: url("data:image/svg+xml;charset=utf-8, "); +} +.theme-orange .slider-pagination-active { + background-color: #ff9500; +} +.bg-orange, +.button.button-fill.bg-orange, +a.bg-orange, +.list-block .swipeout-actions-left a.bg-orange, +.list-block .swipeout-actions-right a.bg-orange { + background-color: #ff9500; +} +.border-orange { + border-color: #ff9500; +} +.color-pink { + color: #ff2d55; +} +.list-block .item-link.list-button.color-pink, +.tabbar a.active.color-pink, +a.color-pink { + color: #ff2d55; +} +.label-switch input[type="checkbox"]:checked + .checkbox.color-pink, +.label-switch.color-pink input[type="checkbox"]:checked + .checkbox { + background-color: #ff2d55; +} +.color-pink.button:not(.button-fill), +.color-pink.buttons-row .button, +.theme-pink .button:not(.button-fill) { + border-color: #ff2d55; +} +html:not(.watch-active-state) .color-pink.button:not(.button-fill):active, +html:not(.watch-active-state) .color-pink.buttons-row .button:active, +html:not(.watch-active-state) .theme-pink .button:not(.button-fill):active, +.color-pink.button:not(.button-fill).active-state, +.color-pink.buttons-row .button.active-state, +.theme-pink .button:not(.button-fill).active-state { + background-color: rgba(255, 45, 85, 0.15); +} +.color-pink.button:not(.button-fill).active, +.color-pink.buttons-row .button.active, +.theme-pink .button:not(.button-fill).active { + background-color: #ff2d55; + color: #fff; +} +.theme-pink .button.button-fill, +.button.button-fill.color-pink { + background: #ff2d55; + color: #fff; +} +.color-pink i.icon, +.theme-pink i.icon, +i.icon.color-pink, +i.icon.theme-pink { + color: #ff2d55; +} +i.icon-next.color-pink, +i.icon-next.theme-pink, +.theme-pink i.icon-next { + background-image: url("data:image/svg+xml;charset=utf-8,"); +} +i.icon-prev.color-pink, +i.icon-prev.theme-pink, +.theme-pink i.icon-prev { + background-image: url("data:image/svg+xml;charset=utf-8,"); +} +i.icon-back.color-pink, +i.icon-back.theme-pink, +.theme-pink i.icon-back { + background-image: url("data:image/svg+xml;charset=utf-8,"); +} +i.icon-bars.color-pink, +i.icon-bars.theme-pink, +.theme-pink i.icon-bars { + background-image: url("data:image/svg+xml;charset=utf-8,"); +} +@media all and (-webkit-max-device-pixel-ratio: 1), (max-resolution: 120dpi) { + i.icon-bars.color-pink, + i.icon-bars.theme-pink, + .theme-pink i.icon-bars { + background-image: url("data:image/svg+xml;charset=utf-8,"); + } +} +.theme-pink a, +.theme-pink .item-link.list-button { + color: #ff2d55; +} +.theme-pink .tabbar a, +.tabbar.theme-pink a { + color: inherit; +} +.theme-pink .tabbar a.active, +.tabbar.theme-pink a.active { + color: #ff2d55; +} +.theme-pink .range-slider input[type="range"]::-webkit-slider-thumb:before, +.range-slider.theme-pink input[type="range"]::-webkit-slider-thumb:before { + background-color: #ff2d55; +} +.theme-pink label.label-checkbox input[type="checkbox"]:checked + .item-media i.icon-form-checkbox, +.theme-pink label.label-checkbox input[type="radio"]:checked + .item-media i.icon-form-checkbox { + background-color: #ff2d55; +} +.theme-pink label.label-radio input[type="checkbox"]:checked ~ .item-inner, +.theme-pink label.label-radio input[type="radio"]:checked ~ .item-inner { + background-image: url("data:image/svg+xml;charset=utf-8, "); +} +.theme-pink .slider-pagination-active { + background-color: #ff2d55; +} +.bg-pink, +.button.button-fill.bg-pink, +a.bg-pink, +.list-block .swipeout-actions-left a.bg-pink, +.list-block .swipeout-actions-right a.bg-pink { + background-color: #ff2d55; +} +.border-pink { + border-color: #ff2d55; +} +.color-blue { + color: #007aff; +} +.list-block .item-link.list-button.color-blue, +.tabbar a.active.color-blue, +a.color-blue { + color: #007aff; +} +.label-switch input[type="checkbox"]:checked + .checkbox.color-blue, +.label-switch.color-blue input[type="checkbox"]:checked + .checkbox { + background-color: #007aff; +} +.color-blue.button:not(.button-fill), +.color-blue.buttons-row .button, +.theme-blue .button:not(.button-fill) { + border-color: #007aff; +} +html:not(.watch-active-state) .color-blue.button:not(.button-fill):active, +html:not(.watch-active-state) .color-blue.buttons-row .button:active, +html:not(.watch-active-state) .theme-blue .button:not(.button-fill):active, +.color-blue.button:not(.button-fill).active-state, +.color-blue.buttons-row .button.active-state, +.theme-blue .button:not(.button-fill).active-state { + background-color: rgba(0, 122, 255, 0.15); +} +.color-blue.button:not(.button-fill).active, +.color-blue.buttons-row .button.active, +.theme-blue .button:not(.button-fill).active { + background-color: #007aff; + color: #fff; +} +.theme-blue .button.button-fill, +.button.button-fill.color-blue { + background: #007aff; + color: #fff; +} +.color-blue i.icon, +.theme-blue i.icon, +i.icon.color-blue, +i.icon.theme-blue { + color: #007aff; +} +i.icon-next.color-blue, +i.icon-next.theme-blue, +.theme-blue i.icon-next { + background-image: url("data:image/svg+xml;charset=utf-8,"); +} +i.icon-prev.color-blue, +i.icon-prev.theme-blue, +.theme-blue i.icon-prev { + background-image: url("data:image/svg+xml;charset=utf-8,"); +} +i.icon-back.color-blue, +i.icon-back.theme-blue, +.theme-blue i.icon-back { + background-image: url("data:image/svg+xml;charset=utf-8,"); +} +i.icon-bars.color-blue, +i.icon-bars.theme-blue, +.theme-blue i.icon-bars { + background-image: url("data:image/svg+xml;charset=utf-8,"); +} +@media all and (-webkit-max-device-pixel-ratio: 1), (max-resolution: 120dpi) { + i.icon-bars.color-blue, + i.icon-bars.theme-blue, + .theme-blue i.icon-bars { + background-image: url("data:image/svg+xml;charset=utf-8,"); + } +} +.theme-blue a, +.theme-blue .item-link.list-button { + color: #007aff; +} +.theme-blue .tabbar a, +.tabbar.theme-blue a { + color: inherit; +} +.theme-blue .tabbar a.active, +.tabbar.theme-blue a.active { + color: #007aff; +} +.theme-blue .range-slider input[type="range"]::-webkit-slider-thumb:before, +.range-slider.theme-blue input[type="range"]::-webkit-slider-thumb:before { + background-color: #007aff; +} +.theme-blue label.label-checkbox input[type="checkbox"]:checked + .item-media i.icon-form-checkbox, +.theme-blue label.label-checkbox input[type="radio"]:checked + .item-media i.icon-form-checkbox { + background-color: #007aff; +} +.theme-blue label.label-radio input[type="checkbox"]:checked ~ .item-inner, +.theme-blue label.label-radio input[type="radio"]:checked ~ .item-inner { + background-image: url("data:image/svg+xml;charset=utf-8, "); +} +.theme-blue .slider-pagination-active { + background-color: #007aff; +} +.bg-blue, +.button.button-fill.bg-blue, +a.bg-blue, +.list-block .swipeout-actions-left a.bg-blue, +.list-block .swipeout-actions-right a.bg-blue { + background-color: #007aff; +} +.border-blue { + border-color: #007aff; +} +.color-green { + color: #4cd964; +} +.list-block .item-link.list-button.color-green, +.tabbar a.active.color-green, +a.color-green { + color: #4cd964; +} +.label-switch input[type="checkbox"]:checked + .checkbox.color-green, +.label-switch.color-green input[type="checkbox"]:checked + .checkbox { + background-color: #4cd964; +} +.color-green.button:not(.button-fill), +.color-green.buttons-row .button, +.theme-green .button:not(.button-fill) { + border-color: #4cd964; +} +html:not(.watch-active-state) .color-green.button:not(.button-fill):active, +html:not(.watch-active-state) .color-green.buttons-row .button:active, +html:not(.watch-active-state) .theme-green .button:not(.button-fill):active, +.color-green.button:not(.button-fill).active-state, +.color-green.buttons-row .button.active-state, +.theme-green .button:not(.button-fill).active-state { + background-color: rgba(76, 217, 100, 0.15); +} +.color-green.button:not(.button-fill).active, +.color-green.buttons-row .button.active, +.theme-green .button:not(.button-fill).active { + background-color: #4cd964; + color: #fff; +} +.theme-green .button.button-fill, +.button.button-fill.color-green { + background: #4cd964; + color: #fff; +} +.color-green i.icon, +.theme-green i.icon, +i.icon.color-green, +i.icon.theme-green { + color: #4cd964; +} +i.icon-next.color-green, +i.icon-next.theme-green, +.theme-green i.icon-next { + background-image: url("data:image/svg+xml;charset=utf-8,"); +} +i.icon-prev.color-green, +i.icon-prev.theme-green, +.theme-green i.icon-prev { + background-image: url("data:image/svg+xml;charset=utf-8,"); +} +i.icon-back.color-green, +i.icon-back.theme-green, +.theme-green i.icon-back { + background-image: url("data:image/svg+xml;charset=utf-8,"); +} +i.icon-bars.color-green, +i.icon-bars.theme-green, +.theme-green i.icon-bars { + background-image: url("data:image/svg+xml;charset=utf-8,"); +} +@media all and (-webkit-max-device-pixel-ratio: 1), (max-resolution: 120dpi) { + i.icon-bars.color-green, + i.icon-bars.theme-green, + .theme-green i.icon-bars { + background-image: url("data:image/svg+xml;charset=utf-8,"); + } +} +.theme-green a, +.theme-green .item-link.list-button { + color: #4cd964; +} +.theme-green .tabbar a, +.tabbar.theme-green a { + color: inherit; +} +.theme-green .tabbar a.active, +.tabbar.theme-green a.active { + color: #4cd964; +} +.theme-green .range-slider input[type="range"]::-webkit-slider-thumb:before, +.range-slider.theme-green input[type="range"]::-webkit-slider-thumb:before { + background-color: #4cd964; +} +.theme-green label.label-checkbox input[type="checkbox"]:checked + .item-media i.icon-form-checkbox, +.theme-green label.label-checkbox input[type="radio"]:checked + .item-media i.icon-form-checkbox { + background-color: #4cd964; +} +.theme-green label.label-radio input[type="checkbox"]:checked ~ .item-inner, +.theme-green label.label-radio input[type="radio"]:checked ~ .item-inner { + background-image: url("data:image/svg+xml;charset=utf-8, "); +} +.theme-green .slider-pagination-active { + background-color: #4cd964; +} +.bg-green, +.button.button-fill.bg-green, +a.bg-green, +.list-block .swipeout-actions-left a.bg-green, +.list-block .swipeout-actions-right a.bg-green { + background-color: #4cd964; +} +.border-green { + border-color: #4cd964; +} +.color-red { + color: #ff3b30; +} +.list-block .item-link.list-button.color-red, +.tabbar a.active.color-red, +a.color-red { + color: #ff3b30; +} +.label-switch input[type="checkbox"]:checked + .checkbox.color-red, +.label-switch.color-red input[type="checkbox"]:checked + .checkbox { + background-color: #ff3b30; +} +.color-red.button:not(.button-fill), +.color-red.buttons-row .button, +.theme-red .button:not(.button-fill) { + border-color: #ff3b30; +} +html:not(.watch-active-state) .color-red.button:not(.button-fill):active, +html:not(.watch-active-state) .color-red.buttons-row .button:active, +html:not(.watch-active-state) .theme-red .button:not(.button-fill):active, +.color-red.button:not(.button-fill).active-state, +.color-red.buttons-row .button.active-state, +.theme-red .button:not(.button-fill).active-state { + background-color: rgba(255, 59, 48, 0.15); +} +.color-red.button:not(.button-fill).active, +.color-red.buttons-row .button.active, +.theme-red .button:not(.button-fill).active { + background-color: #ff3b30; + color: #fff; +} +.theme-red .button.button-fill, +.button.button-fill.color-red { + background: #ff3b30; + color: #fff; +} +.color-red i.icon, +.theme-red i.icon, +i.icon.color-red, +i.icon.theme-red { + color: #ff3b30; +} +i.icon-next.color-red, +i.icon-next.theme-red, +.theme-red i.icon-next { + background-image: url("data:image/svg+xml;charset=utf-8,"); +} +i.icon-prev.color-red, +i.icon-prev.theme-red, +.theme-red i.icon-prev { + background-image: url("data:image/svg+xml;charset=utf-8,"); +} +i.icon-back.color-red, +i.icon-back.theme-red, +.theme-red i.icon-back { + background-image: url("data:image/svg+xml;charset=utf-8,"); +} +i.icon-bars.color-red, +i.icon-bars.theme-red, +.theme-red i.icon-bars { + background-image: url("data:image/svg+xml;charset=utf-8,"); +} +@media all and (-webkit-max-device-pixel-ratio: 1), (max-resolution: 120dpi) { + i.icon-bars.color-red, + i.icon-bars.theme-red, + .theme-red i.icon-bars { + background-image: url("data:image/svg+xml;charset=utf-8,"); + } +} +.theme-red a, +.theme-red .item-link.list-button { + color: #ff3b30; +} +.theme-red .tabbar a, +.tabbar.theme-red a { + color: inherit; +} +.theme-red .tabbar a.active, +.tabbar.theme-red a.active { + color: #ff3b30; +} +.theme-red .range-slider input[type="range"]::-webkit-slider-thumb:before, +.range-slider.theme-red input[type="range"]::-webkit-slider-thumb:before { + background-color: #ff3b30; +} +.theme-red label.label-checkbox input[type="checkbox"]:checked + .item-media i.icon-form-checkbox, +.theme-red label.label-checkbox input[type="radio"]:checked + .item-media i.icon-form-checkbox { + background-color: #ff3b30; +} +.theme-red label.label-radio input[type="checkbox"]:checked ~ .item-inner, +.theme-red label.label-radio input[type="radio"]:checked ~ .item-inner { + background-image: url("data:image/svg+xml;charset=utf-8, "); +} +.theme-red .slider-pagination-active { + background-color: #ff3b30; +} +.bg-red, +.button.button-fill.bg-red, +a.bg-red, +.list-block .swipeout-actions-left a.bg-red, +.list-block .swipeout-actions-right a.bg-red { + background-color: #ff3b30; +} +.border-red { + border-color: #ff3b30; +} diff --git a/www/css/framework7.min.css b/www/css/framework7.min.css new file mode 100755 index 0000000..e3bb7a5 --- /dev/null +++ b/www/css/framework7.min.css @@ -0,0 +1,15 @@ +/* + * Framework7 0.10.0 + * Full Featured HTML Framework For Building iOS 7 Apps + * + * http://www.idangero.us/framework7 + * + * Copyright 2014, Vladimir Kharlampidi + * The iDangero.us + * http://www.idangero.us/ + * + * Licensed under MIT + * + * Released on: December 8, 2014 +*/ +html,body{position:relative;height:100%;width:100%;overflow-x:hidden}body{font-family:Helvetica Neue,Helvetica,Arial,sans-serif;margin:0;padding:0;color:#000;font-size:14px;line-height:1.4;width:100%;-webkit-text-size-adjust:100%;background:#fff;overflow:hidden}@media all and (width:1024px) and (height:691px) and (orientation:landscape){html,body{height:671px}}@media all and (width:1024px) and (height:692px) and (orientation:landscape){html,body{height:672px}}*{-webkit-tap-highlight-color:transparent;-webkit-touch-callout:none}a,input,textarea,select{outline:0}a{text-decoration:none;color:#007aff}p{margin:1em 0}.row{display:-webkit-box;display:-ms-flexbox;display:-webkit-flex;display:flex;-webkit-box-pack:justify;-ms-flex-pack:justify;-webkit-justify-content:space-between;justify-content:space-between;-webkit-box-lines:multiple;-moz-box-lines:multiple;-webkit-flex-wrap:wrap;-ms-flex-wrap:wrap;flex-wrap:wrap;-webkit-box-align:start;-ms-flex-align:start;-webkit-align-items:flex-start;align-items:flex-start}.row>[class*=col-]{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.row .col-100{width:100%;width:-webkit-calc((100% - 15px*0) / 1);width:calc((100% - 15px*0) / 1)}.row.no-gutter .col-100{width:100%}.row .col-95{width:95%;width:-webkit-calc((100% - 15px*0.05263157894736836) / 1.0526315789473684);width:calc((100% - 15px*0.05263157894736836) / 1.0526315789473684)}.row.no-gutter .col-95{width:95%}.row .col-90{width:90%;width:-webkit-calc((100% - 15px*0.11111111111111116) / 1.1111111111111112);width:calc((100% - 15px*0.11111111111111116) / 1.1111111111111112)}.row.no-gutter .col-90{width:90%}.row .col-85{width:85%;width:-webkit-calc((100% - 15px*0.17647058823529416) / 1.1764705882352942);width:calc((100% - 15px*0.17647058823529416) / 1.1764705882352942)}.row.no-gutter .col-85{width:85%}.row .col-80{width:80%;width:-webkit-calc((100% - 15px*0.25) / 1.25);width:calc((100% - 15px*0.25) / 1.25)}.row.no-gutter .col-80{width:80%}.row .col-75{width:75%;width:-webkit-calc((100% - 15px*0.33333333333333326) / 1.3333333333333333);width:calc((100% - 15px*0.33333333333333326) / 1.3333333333333333)}.row.no-gutter .col-75{width:75%}.row .col-66{width:66.66666666666666%;width:-webkit-calc((100% - 15px*0.5000000000000002) / 1.5000000000000002);width:calc((100% - 15px*0.5000000000000002) / 1.5000000000000002)}.row.no-gutter .col-66{width:66.66666666666666%}.row .col-60{width:60%;width:-webkit-calc((100% - 15px*0.6666666666666667) / 1.6666666666666667);width:calc((100% - 15px*0.6666666666666667) / 1.6666666666666667)}.row.no-gutter .col-60{width:60%}.row .col-50{width:50%;width:-webkit-calc((100% - 15px*1) / 2);width:calc((100% - 15px*1) / 2)}.row.no-gutter .col-50{width:50%}.row .col-40{width:40%;width:-webkit-calc((100% - 15px*1.5) / 2.5);width:calc((100% - 15px*1.5) / 2.5)}.row.no-gutter .col-40{width:40%}.row .col-33{width:33.333333333333336%;width:-webkit-calc((100% - 15px*2) / 3);width:calc((100% - 15px*2) / 3)}.row.no-gutter .col-33{width:33.333333333333336%}.row .col-25{width:25%;width:-webkit-calc((100% - 15px*3) / 4);width:calc((100% - 15px*3) / 4)}.row.no-gutter .col-25{width:25%}.row .col-20{width:20%;width:-webkit-calc((100% - 15px*4) / 5);width:calc((100% - 15px*4) / 5)}.row.no-gutter .col-20{width:20%}.row .col-15{width:15%;width:-webkit-calc((100% - 15px*5.666666666666667) / 6.666666666666667);width:calc((100% - 15px*5.666666666666667) / 6.666666666666667)}.row.no-gutter .col-15{width:15%}.row .col-10{width:10%;width:-webkit-calc((100% - 15px*9) / 10);width:calc((100% - 15px*9) / 10)}.row.no-gutter .col-10{width:10%}.row .col-5{width:5%;width:-webkit-calc((100% - 15px*19) / 20);width:calc((100% - 15px*19) / 20)}.row.no-gutter .col-5{width:5%}@media all and (min-width:768px){.row .tablet-100{width:100%;width:-webkit-calc((100% - 15px*0) / 1);width:calc((100% - 15px*0) / 1)}.row.no-gutter .tablet-100{width:100%}.row .tablet-95{width:95%;width:-webkit-calc((100% - 15px*0.05263157894736836) / 1.0526315789473684);width:calc((100% - 15px*0.05263157894736836) / 1.0526315789473684)}.row.no-gutter .tablet-95{width:95%}.row .tablet-90{width:90%;width:-webkit-calc((100% - 15px*0.11111111111111116) / 1.1111111111111112);width:calc((100% - 15px*0.11111111111111116) / 1.1111111111111112)}.row.no-gutter .tablet-90{width:90%}.row .tablet-85{width:85%;width:-webkit-calc((100% - 15px*0.17647058823529416) / 1.1764705882352942);width:calc((100% - 15px*0.17647058823529416) / 1.1764705882352942)}.row.no-gutter .tablet-85{width:85%}.row .tablet-80{width:80%;width:-webkit-calc((100% - 15px*0.25) / 1.25);width:calc((100% - 15px*0.25) / 1.25)}.row.no-gutter .tablet-80{width:80%}.row .tablet-75{width:75%;width:-webkit-calc((100% - 15px*0.33333333333333326) / 1.3333333333333333);width:calc((100% - 15px*0.33333333333333326) / 1.3333333333333333)}.row.no-gutter .tablet-75{width:75%}.row .tablet-66{width:66.66666666666666%;width:-webkit-calc((100% - 15px*0.5000000000000002) / 1.5000000000000002);width:calc((100% - 15px*0.5000000000000002) / 1.5000000000000002)}.row.no-gutter .tablet-66{width:66.66666666666666%}.row .tablet-60{width:60%;width:-webkit-calc((100% - 15px*0.6666666666666667) / 1.6666666666666667);width:calc((100% - 15px*0.6666666666666667) / 1.6666666666666667)}.row.no-gutter .tablet-60{width:60%}.row .tablet-50{width:50%;width:-webkit-calc((100% - 15px*1) / 2);width:calc((100% - 15px*1) / 2)}.row.no-gutter .tablet-50{width:50%}.row .tablet-40{width:40%;width:-webkit-calc((100% - 15px*1.5) / 2.5);width:calc((100% - 15px*1.5) / 2.5)}.row.no-gutter .tablet-40{width:40%}.row .tablet-33{width:33.333333333333336%;width:-webkit-calc((100% - 15px*2) / 3);width:calc((100% - 15px*2) / 3)}.row.no-gutter .tablet-33{width:33.333333333333336%}.row .tablet-25{width:25%;width:-webkit-calc((100% - 15px*3) / 4);width:calc((100% - 15px*3) / 4)}.row.no-gutter .tablet-25{width:25%}.row .tablet-20{width:20%;width:-webkit-calc((100% - 15px*4) / 5);width:calc((100% - 15px*4) / 5)}.row.no-gutter .tablet-20{width:20%}.row .tablet-15{width:15%;width:-webkit-calc((100% - 15px*5.666666666666667) / 6.666666666666667);width:calc((100% - 15px*5.666666666666667) / 6.666666666666667)}.row.no-gutter .tablet-15{width:15%}.row .tablet-10{width:10%;width:-webkit-calc((100% - 15px*9) / 10);width:calc((100% - 15px*9) / 10)}.row.no-gutter .tablet-10{width:10%}.row .tablet-5{width:5%;width:-webkit-calc((100% - 15px*19) / 20);width:calc((100% - 15px*19) / 20)}.row.no-gutter .tablet-5{width:5%}}.views,.view{position:relative;width:100%;height:100%;z-index:5000}.views{overflow:auto;-webkit-overflow-scrolling:touch}.view{overflow:hidden;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.pages{position:relative;width:100%;height:100%;overflow:hidden;background:#000}.page{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;position:absolute;left:0;top:0;width:100%;height:100%;overflow:hidden;background:#efeff4;-webkit-transform:translate3d(0,0,0);-ms-transform:translate3d(0,0,0);transform:translate3d(0,0,0);opacity:1;-webkit-box-shadow:none;box-shadow:none}.page.cached{display:none}.page-on-left{opacity:.9;-webkit-box-shadow:0 0 12px rgba(0,0,0,.5);box-shadow:0 0 12px rgba(0,0,0,.5);-webkit-transform:translate3d(-20%,0,0);-ms-transform:translate3d(-20%,0,0);transform:translate3d(-20%,0,0)}.page-on-center{opacity:1;-webkit-box-shadow:0 0 12px rgba(0,0,0,.5);box-shadow:0 0 12px rgba(0,0,0,.5);-webkit-transform:translate3d(0,0,0);-ms-transform:translate3d(0,0,0);transform:translate3d(0,0,0)}.page-on-right{-webkit-box-shadow:none;box-shadow:none;opacity:1;-webkit-transform:translate3d(100%,0,0);-ms-transform:translate3d(100%,0,0);transform:translate3d(100%,0,0)}.page-content{overflow:auto;-webkit-overflow-scrolling:touch;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;height:100%}.page-transitioning{-webkit-transition-duration:400ms;transition-duration:400ms}.page-from-right-to-center{-webkit-animation:pageFromRightToCenter 400ms forwards;animation:pageFromRightToCenter 400ms forwards}.page-from-center-to-right{-webkit-animation:pageFromCenterToRight 400ms forwards;animation:pageFromCenterToRight 400ms forwards}@-webkit-keyframes pageFromRightToCenter{from{-webkit-box-shadow:none;box-shadow:none;-webkit-transform:translate3d(100%,0,0)}to{-webkit-box-shadow:0 0 12px rgba(0,0,0,.5);box-shadow:0 0 12px rgba(0,0,0,.5);-webkit-transform:translate3d(0,0,0)}}@-webkit-keyframes pageFromCenterToRight{from{-webkit-box-shadow:0 0 12px rgba(0,0,0,.5);box-shadow:0 0 12px rgba(0,0,0,.5);-webkit-transform:translate3d(0,0,0)}to{-webkit-box-shadow:none;box-shadow:none;-webkit-transform:translate3d(100%,0,0)}}@keyframes pageFromRightToCenter{from{-webkit-box-shadow:none;box-shadow:none;transform:translate3d(100%,0,0)}to{-webkit-box-shadow:0 0 12px rgba(0,0,0,.5);box-shadow:0 0 12px rgba(0,0,0,.5);transform:translate3d(0,0,0)}}@keyframes pageFromCenterToRight{from{-webkit-box-shadow:0 0 12px rgba(0,0,0,.5);box-shadow:0 0 12px rgba(0,0,0,.5);transform:translate3d(0,0,0)}to{-webkit-box-shadow:none;box-shadow:none;transform:translate3d(100%,0,0)}}.page-from-center-to-left{-webkit-animation:pageFromCenterToLeft 400ms forwards;animation:pageFromCenterToLeft 400ms forwards}.page-from-left-to-center{-webkit-animation:pageFromLeftToCenter 400ms forwards;animation:pageFromLeftToCenter 400ms forwards}@-webkit-keyframes pageFromCenterToLeft{from{opacity:1;-webkit-transform:translate3d(0,0,0)}to{opacity:.9;-webkit-transform:translate3d(-20%,0,0)}}@-webkit-keyframes pageFromLeftToCenter{from{opacity:.9;-webkit-transform:translate3d(-20%,0,0)}to{opacity:1;-webkit-transform:translate3d(0,0,0)}}@keyframes pageFromCenterToLeft{from{opacity:1;transform:translate3d(0,0,0)}to{opacity:.9;transform:translate3d(-20%,0,0)}}@keyframes pageFromLeftToCenter{from{opacity:.9;transform:translate3d(-20%,0,0)}to{opacity:1;transform:translate3d(0,0,0)}}html.android .page{box-shadow:none!important}html.android .page-from-right-to-center{-webkit-animation:pageFromRightToCenterDegrade 400ms forwards;animation:pageFromRightToCenterDegrade 400ms forwards}html.android .page-from-center-to-right{-webkit-animation:pageFromCenterToRightDegrade 400ms forwards;animation:pageFromCenterToRightDegrade 400ms forwards}@-webkit-keyframes pageFromRightToCenterDegrade{from{-webkit-transform:translate3d(100%,0,0)}to{-webkit-transform:translate3d(0,0,0)}}@-webkit-keyframes pageFromCenterToRightDegrade{from{-webkit-transform:translate3d(0,0,0)}to{-webkit-transform:translate3d(100%,0,0)}}@keyframes pageFromRightToCenterDegrade{from{transform:translate3d(100%,0,0)}to{transform:translate3d(0,0,0)}}@keyframes pageFromCenterToRightDegrade{from{transform:translate3d(0,0,0)}to{transform:translate3d(100%,0,0)}}.navbar-inner,.toolbar-inner{position:absolute;left:0;top:0;width:100%;height:100%;padding:0 8px;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;display:-webkit-box;display:-ms-flexbox;display:-webkit-flex;display:flex;-webkit-box-pack:justify;-ms-flex-pack:justify;-webkit-justify-content:space-between;justify-content:space-between;-webkit-box-align:center;-ms-flex-align:center;-webkit-align-items:center;align-items:center}.navbar-inner.cached{display:none}.navbar,.toolbar{height:44px;width:100%;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;font-size:17px;position:relative;margin:0;z-index:500;-webkit-backface-visibility:hidden;backface-visibility:hidden}.navbar b,.toolbar b{font-weight:500}.navbar a.link,.toolbar a.link{line-height:44px;height:44px;text-decoration:none;position:relative;display:-webkit-box;display:-ms-flexbox;display:-webkit-flex;display:flex;-webkit-box-pack:start;-ms-flex-pack:start;-webkit-justify-content:flex-start;justify-content:flex-start;-webkit-box-align:center;-ms-flex-align:center;-webkit-align-items:center;align-items:center;-webkit-transition-duration:300ms;transition-duration:300ms}html:not(.watch-active-state) .navbar a.link:active,html:not(.watch-active-state) .toolbar a.link:active,.navbar a.link.active-state,.toolbar a.link.active-state{opacity:.3;-webkit-transition-duration:0ms;transition-duration:0ms}.navbar a.link i+span,.toolbar a.link i+span,.navbar a.link i+i,.toolbar a.link i+i,.navbar a.link span+i,.toolbar a.link span+i,.navbar a.link span+span,.toolbar a.link span+span{margin-left:7px}.navbar a.icon-only,.toolbar a.icon-only{min-width:44px;display:-webkit-box;display:-ms-flexbox;display:-webkit-flex;display:flex;-webkit-box-pack:center;-ms-flex-pack:center;-webkit-justify-content:center;justify-content:center;-webkit-box-align:center;-ms-flex-align:center;-webkit-align-items:center;align-items:center;margin:0}.navbar i.icon,.toolbar i.icon{display:block}.navbar{left:0;top:0;background:#f7f7f8;border-bottom:1px solid #c4c4c4}html.retina.ios-gt-7 .navbar{border-bottom-width:.5px}.navbar .center{font-size:17px;font-weight:500;text-align:center;margin:0;position:relative;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;line-height:44px;-webkit-flex-shrink:10;-ms-flex:0 10 auto;flex-shrink:10;display:-webkit-box;display:-ms-flexbox;display:-webkit-flex;display:flex;-webkit-box-align:center;-ms-flex-align:center;-webkit-align-items:center;align-items:center}.navbar .left,.navbar .right{-webkit-flex-shrink:0;-ms-flex:0 0 auto;flex-shrink:0;display:-webkit-box;display:-ms-flexbox;display:-webkit-flex;display:flex;-webkit-box-pack:start;-ms-flex-pack:start;-webkit-justify-content:flex-start;justify-content:flex-start;-webkit-box-align:center;-ms-flex-align:center;-webkit-align-items:center;align-items:center;-webkit-transform:translate3d(0,0,0);-ms-transform:translate3d(0,0,0);transform:translate3d(0,0,0)}.navbar .left a+a,.navbar .right a+a{margin-left:15px}.navbar .left{margin-right:10px}.navbar .right{margin-left:10px}.navbar .right:first-child{position:absolute;right:8px;height:100%}.toolbar{left:0;bottom:0;background:#f7f7f8;border-top:1px solid #c4c4c4}html.retina.ios-gt-7 .toolbar{border-top-width:.5px}.toolbar a{-webkit-flex-shrink:1;-ms-flex:0 1 auto;flex-shrink:1;position:relative;white-space:nowrap;text-overflow:ellipsis;overflow:hidden}.tabbar{color:#929292;z-index:5001}.tabbar a{color:#929292}.tabbar a.active{color:#007aff}.tabbar a.link{line-height:1.4}.tabbar a.tab-link,.tabbar a.link{height:100%;width:100%;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;display:-webkit-box;display:-ms-flexbox;display:-webkit-flex;display:flex;-webkit-box-pack:center;-ms-flex-pack:center;-webkit-justify-content:center;justify-content:center;-webkit-box-align:center;-ms-flex-align:center;-webkit-align-items:center;align-items:center;overflow:visible;-webkit-box-flex:1;-ms-flex:1;-webkit-box-orient:vertical;-moz-box-orient:vertical;-ms-flex-direction:column;-webkit-flex-direction:column;flex-direction:column}.tabbar i.icon{height:30px}.tabbar-labels{height:50px}.tabbar-labels a.tab-link,.tabbar-labels a.link{padding-top:4px;padding-bottom:4px;height:100%;-webkit-box-pack:justify;-ms-flex-pack:justify;-webkit-justify-content:space-between;justify-content:space-between}.tabbar-labels a.tab-link i+span,.tabbar-labels a.link i+span{margin:0}.tabbar-labels span.tabbar-label{line-height:1;display:block;margin:0;letter-spacing:.01em;font-size:10px;position:relative;text-overflow:ellipsis;white-space:nowrap}@media all and (min-width:768px){.tabbar .toolbar-inner{-webkit-box-pack:center;-ms-flex-pack:center;-webkit-justify-content:center;justify-content:center}.tabbar a.tab-link,.tabbar a.link{width:auto;min-width:105px}.tabbar-labels{height:56px}.tabbar-labels span.tabbar-label{font-size:14px}}.navbar-from-right-to-center .left,.navbar-from-right-to-center .right,.navbar-from-right-to-center .center{-webkit-animation:navbarElementFadeIn 400ms forwards;animation:navbarElementFadeIn 400ms forwards}.navbar-from-right-to-center .sliding{opacity:1}.navbar-from-center-to-right .left,.navbar-from-center-to-right .right,.navbar-from-center-to-right .center{-webkit-animation:navbarElementFadeOut 400ms forwards;animation:navbarElementFadeOut 400ms forwards}.navbar-from-center-to-right .sliding{opacity:0}@-webkit-keyframes navbarElementFadeIn{from{opacity:0}to{opacity:1}}@keyframes navbarElementFadeIn{from{opacity:0}to{opacity:1}}.navbar-from-center-to-left .left,.navbar-from-center-to-left .right,.navbar-from-center-to-left .center{-webkit-animation:navbarElementFadeOut 400ms forwards;animation:navbarElementFadeOut 400ms forwards}.navbar-from-center-to-left .sliding{opacity:0}.navbar-from-left-to-center .left,.navbar-from-left-to-center .right,.navbar-from-left-to-center .center{-webkit-animation:navbarElementFadeIn 400ms forwards;animation:navbarElementFadeIn 400ms forwards}.navbar-from-left-to-center .sliding{opacity:1}.navbar-on-left .left,.navbar-on-left .right,.navbar-on-left .center{opacity:0}.navbar-on-left .sliding{opacity:0}.navbar-on-right .left,.navbar-on-right .right,.navbar-on-right .center{opacity:0}.navbar-on-right .sliding{opacity:0}@-webkit-keyframes navbarElementFadeOut{from{opacity:1}to{opacity:0}}@keyframes navbarElementFadeOut{from{opacity:1}to{opacity:0}}.navbar-from-right-to-center .left.sliding .back.link .icon,.navbar-from-center-to-right .left.sliding .back.link .icon,.navbar-from-center-to-left .left.sliding .back.link .icon,.navbar-from-left-to-center .left.sliding .back.link .icon{-webkit-transition-duration:400ms;transition-duration:400ms}.navbar-from-right-to-center .sliding,.navbar-from-center-to-right .sliding,.navbar-from-center-to-left .sliding,.navbar-from-left-to-center .sliding{-webkit-transition-duration:400ms;transition-duration:400ms;-webkit-animation:none;animation:none}.page>.navbar,.view>.navbar,.views>.navbar,.page>.toolbar,.view>.toolbar,.views>.toolbar{position:absolute}.navbar-through .page-content,.navbar-fixed .page-content{padding-top:44px}.toolbar-through .page-content,.toolbar-fixed .page-content,.tabbar-through .page-content,.tabbar-fixed .page-content{padding-bottom:44px}.tabbar-labels-fixed .page-content,.tabbar-labels-through .page-content{padding-bottom:50px}@media all and (min-width:768px){.tabbar-labels-fixed .page-content,.tabbar-labels-through .page-content{padding-bottom:56px}}.navbar.navbar-hiding{-webkit-transition-duration:400ms;transition-duration:400ms;-webkit-transform:translate3d(0,0,0);-ms-transform:translate3d(0,0,0);transform:translate3d(0,0,0)}.navbar.navbar-hidden{-webkit-transition-duration:400ms;transition-duration:400ms;-webkit-transform:translate3d(0,-100%,0);-ms-transform:translate3d(0,-100%,0);transform:translate3d(0,-100%,0)}.page.no-navbar .page-content{padding-top:0}.toolbar.toolbar-hiding,.tabbar.toolbar-hiding,.toolbar.tabbar-hiding,.tabbar.tabbar-hiding{-webkit-transition-duration:400ms;transition-duration:400ms;-webkit-transform:translate3d(0,0,0);-ms-transform:translate3d(0,0,0);transform:translate3d(0,0,0)}.toolbar.toolbar-hidden,.tabbar.toolbar-hidden,.toolbar.tabbar-hidden,.tabbar.tabbar-hidden{-webkit-transition-duration:400ms;transition-duration:400ms;-webkit-transform:translate3d(0,100%,0);-ms-transform:translate3d(0,100%,0);transform:translate3d(0,100%,0)}.page.no-toolbar .page-content,.page.no-tabbar .page-content{padding-bottom:0}.searchbar{height:44px;background:#c9c9ce;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;border-bottom:1px solid #b4b4b4;padding:0 8px;overflow:hidden;position:relative;display:-webkit-box;display:-ms-flexbox;display:-webkit-flex;display:flex;-webkit-box-align:center;-ms-flex-align:center;-webkit-align-items:center;align-items:center}html.retina.ios-gt-7 .searchbar{border-bottom-width:.5px}.searchbar .searchbar-input{width:100%;height:28px;position:relative;-webkit-flex-shrink:1;-ms-flex:0 1 auto;flex-shrink:1}.searchbar input[type=search]{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;width:100%;height:100%;display:block;border:none;-webkit-appearance:none;-moz-appearance:none;-ms-appearance:none;appearance:none;border-radius:5px;font-family:inherit;color:#000;font-size:14px;font-weight:400;padding:0 28px;background:#fff url("data:image/svg+xml;charset=utf-8,") no-repeat 8px center;-webkit-background-size:13px 13px;background-size:13px 13px}.searchbar input[type=search]::-webkit-input-placeholder{color:#939398;opacity:1}.searchbar input[type=search]::-webkit-search-cancel-button{-webkit-appearance:none}.searchbar .searchbar-clear{position:absolute;width:28px;height:28px;right:0;top:0;opacity:0;pointer-events:none;background:url("data:image/svg+xml;charset=utf-8,") no-repeat center;-webkit-background-size:14px 14px;background-size:14px 14px;-webkit-transition-duration:300ms;transition-duration:300ms;cursor:pointer}.searchbar .searchbar-cancel{-webkit-transition-duration:300ms;transition-duration:300ms;-webkit-transform:translate3d(0,0,0);-ms-transform:translate3d(0,0,0);transform:translate3d(0,0,0);font-size:17px;cursor:pointer;opacity:0;-webkit-flex-shrink:0;-ms-flex:0 0 auto;flex-shrink:0;margin-left:0;pointer-events:none}.searchbar.searchbar-active .searchbar-cancel{margin-left:8px;opacity:1;pointer-events:auto}html:not(.watch-active-state) .searchbar.searchbar-active .searchbar-cancel:active,.searchbar.searchbar-active .searchbar-cancel.active-state{opacity:.3;-webkit-transition-duration:0ms;transition-duration:0ms}.searchbar.searchbar-not-empty .searchbar-clear{pointer-events:auto;opacity:1}.searchbar-overlay{position:absolute;left:0;top:0;width:100%;height:100%;z-index:100;opacity:0;pointer-events:none;background:rgba(0,0,0,.4);-webkit-transition-duration:300ms;transition-duration:300ms;-webkit-transform:translate3d(0,0,0);-ms-transform:translate3d(0,0,0);transform:translate3d(0,0,0)}.searchbar-overlay.searchbar-overlay-active{opacity:1;pointer-events:auto}.searchbar-not-found{display:none}.hidden-by-searchbar,.list-block .hidden-by-searchbar,.list-block li.hidden-by-searchbar{display:none}.page>.searchbar{position:absolute;width:100%;left:0;top:0;z-index:200}.page>.searchbar~.page-content{padding-top:44px}.navbar-fixed .page>.searchbar,.navbar-through .page>.searchbar,.navbar-fixed>.searchbar,.navbar-through>.searchbar{top:44px}.navbar-fixed .page>.searchbar~.page-content,.navbar-through .page>.searchbar~.page-content,.navbar-fixed>.searchbar~.page-content,.navbar-through>.searchbar~.page-content{padding-top:88px}.messagebar{-webkit-transform:translate3d(0,0,0);-ms-transform:translate3d(0,0,0);transform:translate3d(0,0,0);-webkit-transition-duration:0ms;transition-duration:0ms}.messagebar textarea{-webkit-appearance:none;-moz-appearance:none;-ms-appearance:none;appearance:none;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;border:1px solid #c8c8cd;background:#fff;border-radius:5px;box-shadow:none;display:block;padding:3px 8px 3px;margin:0;width:100%;height:28px;color:#000;font-size:17px;line-height:20px;font-family:inherit;resize:none;-webkit-flex-shrink:1;-ms-flex:0 1 auto;flex-shrink:1}.messagebar .link{-ms-flex-item-align:flex-end;-webkit-align-self:flex-end;align-self:flex-end}.messagebar .link.icon-only:first-child{margin-left:-6px}.messagebar .link:not(.icon-only)+textarea{margin-left:8px}.messagebar textarea+.link{margin-left:8px}.messagebar .link{-webkit-flex-shrink:0;-ms-flex:0 0 auto;flex-shrink:0}.messagebar~.page-content{padding-bottom:44px}.page.no-toolbar .messagebar~.page-content{padding-bottom:44px}.hidden-toolbar .messagebar{-webkit-transform:translate3d(0,0,0);-ms-transform:translate3d(0,0,0);transform:translate3d(0,0,0);-webkit-transition-duration:0ms;transition-duration:0ms}i.icon{display:inline-block;vertical-align:middle;background-size:100% auto;background-position:center;background-repeat:no-repeat;font-style:normal;position:relative}i.icon.icon-back{width:12px;height:20px;background-image:url("data:image/svg+xml;charset=utf-8,")}i.icon.icon-bars{width:21px;height:13px;background-image:url("data:image/svg+xml;charset=utf-8,")}@media all and (-webkit-max-device-pixel-ratio:1),(max-resolution:120dpi){i.icon.icon-bars{height:14px;background-image:url("data:image/svg+xml;charset=utf-8,")}}i.icon.icon-camera{width:25px;height:20px;background-image:url("data:image/svg+xml;charset=utf-8,")}i.icon.icon-f7{width:29px;height:29px;background-image:url(../img/i-f7.png)}i.icon.icon-form-name{width:29px;height:29px;background-image:url(../img/i-form-name.png)}i.icon.icon-form-password{width:29px;height:29px;background-image:url(../img/i-form-password.png)}i.icon.icon-form-email{width:29px;height:29px;background-image:url(../img/i-form-email.png)}i.icon.icon-form-calendar{width:29px;height:29px;background-image:url(../img/i-form-calendar.png)}i.icon.icon-form-tel{width:29px;height:29px;background-image:url(../img/i-form-tel.png)}i.icon.icon-form-gender{width:29px;height:29px;background-image:url(../img/i-form-gender.png)}i.icon.icon-form-toggle{width:29px;height:29px;background-image:url(../img/i-form-toggle.png)}i.icon.icon-form-comment{width:29px;height:29px;background-image:url(../img/i-form-comment.png)}i.icon.icon-form-settings{width:29px;height:29px;background-image:url(../img/i-form-settings.png)}i.icon.icon-form-url{width:29px;height:29px;background-image:url(../img/i-form-url.png)}i.icon.icon-next,i.icon.icon-prev{width:15px;height:15px}i.icon.icon-next{background:url("data:image/svg+xml;charset=utf-8,")}i.icon.icon-prev{background:url("data:image/svg+xml;charset=utf-8,")}i.icon.icon-plus{width:25px;height:25px;font-size:31px;line-height:20px;text-align:center;font-weight:100}.badge{font-size:13px;display:inline-block;color:#fff;background:#8e8e93;border-radius:20px;padding:1px 7px;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.icon .badge{position:absolute;left:100%;margin-left:-10px;top:-2px;font-size:10px;line-height:1.4;padding:1px 5px}.content-block{margin:35px 0;padding:0 15px;color:#6d6d72}.content-block-title{position:relative;overflow:hidden;margin:0;white-space:nowrap;text-overflow:ellipsis;font-size:14px;text-transform:uppercase;line-height:1;color:#6d6d72;margin:35px 15px 10px}.content-block-title+.list-block,.content-block-title+.content-block{margin-top:10px}.content-block-inner{background:#fff;padding:10px 15px;margin-left:-15px;width:100%;border-bottom:1px solid #c8c7cc;border-top:1px solid #c8c7cc;color:#000}html.retina.ios-gt-7 .content-block-inner{border-top-width:.5px;border-bottom-width:.5px}.content-block.inset{margin-left:15px;margin-right:15px;border-radius:7px}.content-block.inset .content-block-inner{border:none;border-radius:7px}@media all and (min-width:768px){.content-block.tablet-inset{margin-left:15px;margin-right:15px;border-radius:7px}.content-block.tablet-inset .content-block-inner{border:none;border-radius:7px}}.list-block{margin:35px 0;font-size:17px}.list-block ul{background:#fff;list-style:none;padding:0;margin:0;border-top:1px solid #c8c7cc;border-bottom:1px solid #c8c7cc;position:relative}.list-block ul ul{border-top:none;border-bottom:none;padding-left:45px}.list-block .align-top,.list-block .align-top .item-content,.list-block .align-top .item-inner{-webkit-box-align:start;-ms-flex-align:start;-webkit-align-items:flex-start;align-items:flex-start}.list-block.inset{margin-left:15px;margin-right:15px;border-radius:7px}.list-block.inset .content-block-title{margin-left:0;margin-right:0}.list-block.inset ul{border-radius:7px;border-top:none;border-bottom:none}.list-block.inset li:first-child>a{border-radius:7px 7px 0 0}.list-block.inset li:last-child>a{border-radius:0 0 7px 7px}.list-block.inset li:first-child:last-child>a{border-radius:7px}@media all and (min-width:768px){.list-block.tablet-inset{margin-left:15px;margin-right:15px;border-radius:7px}.list-block.tablet-inset .content-block-title{margin-left:0;margin-right:0}.list-block.tablet-inset ul{border-radius:7px;border-top:none;border-bottom:none}.list-block.tablet-inset li:first-child>a{border-radius:7px 7px 0 0}.list-block.tablet-inset li:last-child>a{border-radius:0 0 7px 7px}.list-block.tablet-inset li:first-child:last-child>a{border-radius:7px}.list-block.tablet-inset .content-block-title{margin-left:0;margin-right:0}.list-block.tablet-inset ul{border-radius:7px;border-top:none;border-bottom:none}.list-block.tablet-inset li:first-child>a{border-radius:7px 7px 0 0}.list-block.tablet-inset li:last-child>a{border-radius:0 0 7px 7px}.list-block.tablet-inset li:first-child:last-child>a{border-radius:7px}}.list-block li{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;position:relative}.list-block .item-media{display:-webkit-box;display:-ms-flexbox;display:-webkit-flex;display:flex;-webkit-flex-shrink:0;-ms-flex:0 0 auto;flex-shrink:0;-webkit-box-lines:single;-moz-box-lines:single;-webkit-flex-wrap:nowrap;-ms-flex-wrap:none;-ms-flex-wrap:nowrap;flex-wrap:nowrap;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;-webkit-box-align:center;-ms-flex-align:center;-webkit-align-items:center;align-items:center;padding-top:7px;padding-bottom:8px}.list-block .item-media i+i{margin-left:5px}.list-block .item-media i+img{margin-left:5px}.list-block .item-media+.item-inner{margin-left:15px}.list-block .item-inner{padding-right:15px;border-bottom:1px solid #c8c7cc;width:100%;padding-top:8px;padding-bottom:7px;min-height:44px;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;display:-webkit-box;display:-ms-flexbox;display:-webkit-flex;display:flex;-webkit-box-flex:1;-ms-flex:1;-webkit-box-pack:justify;-ms-flex-pack:justify;-webkit-justify-content:space-between;justify-content:space-between;-webkit-box-align:center;-ms-flex-align:center;-webkit-align-items:center;align-items:center}.list-block .item-title{-webkit-flex-shrink:1;-ms-flex:0 1 auto;flex-shrink:1;white-space:nowrap;position:relative;overflow:hidden;text-overflow:ellipsis;max-width:100%}.list-block .item-title.label{width:35%;-webkit-flex-shrink:0;-ms-flex:0 0 auto;flex-shrink:0}.list-block .item-input{width:100%;margin-top:-8px;margin-bottom:-7px;-webkit-box-flex:1;-ms-flex:1;-webkit-flex-shrink:1;-ms-flex:0 1 auto;flex-shrink:1}.list-block .item-after{white-space:nowrap;color:#8e8e93;-webkit-flex-shrink:0;-ms-flex:0 0 auto;flex-shrink:0;margin-left:5px;display:-webkit-box;display:-ms-flexbox;display:-webkit-flex;display:flex;max-height:28px}.list-block .smart-select .item-after{max-width:70%;overflow:hidden;text-overflow:ellipsis;position:relative}.list-block .item-link{-webkit-transition-duration:300ms;transition-duration:300ms;display:block;color:inherit}.list-block .item-link .item-inner{padding-right:35px;background:no-repeat -webkit-calc(100% - 15px) center;background:no-repeat calc(100% - 15px) center;background-image:url("data:image/svg+xml;charset=utf-8,");background-size:10px 20px}html:not(.watch-active-state) .list-block .item-link:active,.list-block .item-link.active-state{-webkit-transition-duration:0ms;transition-duration:0ms;background-color:#d9d9d9}html:not(.watch-active-state) .list-block .item-link:active .item-inner,.list-block .item-link.active-state .item-inner{border-bottom-color:transparent}.list-block .item-link.list-button{padding:0 15px;text-align:center;color:#007aff;display:block;border-bottom:1px solid #c8c7cc;line-height:43px}.list-block .item-content{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;padding-left:15px;min-height:44px;display:-webkit-box;display:-ms-flexbox;display:-webkit-flex;display:flex;-webkit-box-pack:justify;-ms-flex-pack:justify;-webkit-justify-content:space-between;justify-content:space-between;-webkit-box-align:center;-ms-flex-align:center;-webkit-align-items:center;align-items:center}.list-block .list-block-label{margin:10px 0 35px;padding:0 15px;font-size:14px;color:#8f8f94}.list-block .swipeout{overflow:hidden;-webkit-transform-style:preserve-3d;transform-style:preserve-3d}.list-block .swipeout.deleting{-webkit-transition-duration:300ms;transition-duration:300ms}.list-block .swipeout.deleting .swipeout-content{-webkit-transform:translateX(-100%);-ms-transform:translateX(-100%);transform:translateX(-100%)}.list-block .swipeout.transitioning .swipeout-content,.list-block .swipeout.transitioning .swipeout-actions-right a,.list-block .swipeout.transitioning .swipeout-actions-left a,.list-block .swipeout.transitioning .swipeout-overswipe{-webkit-transition:300ms;transition:300ms}.list-block .swipeout-content{position:relative;z-index:10}.list-block .swipeout-overswipe{-webkit-transition:200ms left;transition:200ms left}.list-block .swipeout-actions-left,.list-block .swipeout-actions-right{position:absolute;top:0;height:100%;display:-webkit-box;display:-ms-flexbox;display:-webkit-flex;display:flex}.list-block .swipeout-actions-left a,.list-block .swipeout-actions-right a{padding:0 30px;color:#fff;background:#c7c7cc;display:-webkit-box;display:-ms-flexbox;display:-webkit-flex;display:flex;-webkit-box-align:center;-ms-flex-align:center;-webkit-align-items:center;align-items:center;position:relative;left:0}.list-block .swipeout-actions-left a:after,.list-block .swipeout-actions-right a:after{content:'';position:absolute;top:0;width:600%;height:100%;background:inherit;z-index:-1}.list-block .swipeout-actions-left a.swipeout-delete,.list-block .swipeout-actions-right a.swipeout-delete{background:#ff3b30}.list-block .swipeout-actions-right{right:0;-webkit-transform:translateX(100%);-ms-transform:translateX(100%);transform:translateX(100%)}.list-block .swipeout-actions-right a:after{left:100%;margin-left:-1px}.list-block .swipeout-actions-left{left:0;-webkit-transform:translateX(-100%);-ms-transform:translateX(-100%);transform:translateX(-100%)}.list-block .swipeout-actions-left a:after{right:100%;margin-right:-1px}.list-block .item-subtitle{font-size:15px;position:relative;overflow:hidden;white-space:nowrap;max-width:100%;text-overflow:ellipsis}.list-block .item-text{font-size:15px;color:#8e8e93;line-height:21px;position:relative;overflow:hidden;height:42px;text-overflow:ellipsis;-webkit-line-clamp:2;-webkit-box-orient:vertical;display:-webkit-box}.list-block.media-list .item-title,.list-block li.media-item .item-title{font-weight:500}.list-block.media-list .item-inner,.list-block li.media-item .item-inner{display:block;padding-top:10px;padding-bottom:9px;-ms-flex-item-align:stretch;-webkit-align-self:stretch;align-self:stretch}.list-block.media-list .item-link .item-inner,.list-block li.media-item .item-link .item-inner{background:0 0;padding-right:15px}.list-block.media-list .item-link .item-title-row,.list-block li.media-item .item-link .item-title-row{padding-right:20px;background:no-repeat right center;background-image:url("data:image/svg+xml;charset=utf-8,");background-size:10px 20px}.list-block.media-list .item-media,.list-block li.media-item .item-media{padding-top:9px;padding-bottom:10px}.list-block.media-list .item-media img,.list-block li.media-item .item-media img{display:block}.list-block.media-list .item-title-row,.list-block li.media-item .item-title-row{display:-webkit-box;display:-ms-flexbox;display:-webkit-flex;display:flex;-webkit-box-pack:justify;-ms-flex-pack:justify;-webkit-justify-content:space-between;justify-content:space-between}.list-block .list-group:nth-child(n+2) ul{border-top:none}.list-block .item-divider,.list-block .list-group-title{background:#f7f7f7;border-top:1px solid #c8c7cc;margin-top:-1px;padding:4px 15px;white-space:nowrap;position:relative;max-width:100%;text-overflow:ellipsis;overflow:hidden;color:#8e8e93}.list-block .list-group-title{position:relative;position:-webkit-sticky;position:-moz-sticky;position:sticky;top:0;z-index:10;margin-top:0;border-top:none}.list-block .sortable-handler{position:absolute;right:0;top:0;height:-webkit-calc(100% - 1px);height:calc(100% - 1px);z-index:10;background-repeat:no-repeat;background-size:18px 12px;background-position:center;width:35px;background-image:url("data:image/svg+xml;charset=utf-8,");opacity:0;visibility:hidden;cursor:pointer;-webkit-transition-duration:300ms;transition-duration:300ms}.list-block.sortable .item-inner{-webkit-transition-duration:300ms;transition-duration:300ms}.list-block.sortable-opened .sortable-handler{visibility:visible;opacity:1}.list-block.sortable-opened .item-inner,.list-block.sortable-opened .item-link .item-inner{padding-right:35px}.list-block.sortable-opened .item-link .item-inner,.list-block.sortable-opened .item-link .item-title-row{background-image:none}.list-block.sortable-sorting li{-webkit-transition-duration:300ms;transition-duration:300ms}.list-block li.sorting{z-index:50;background:rgba(255,255,255,.8);box-shadow:0 2px 8px rgba(0,0,0,.6);-webkit-transition-duration:0ms;transition-duration:0ms}.list-block li.sorting .item-inner{border-bottom:none}.list-block li:last-child .list-button{border-bottom:none}.list-block li:last-child .item-inner,.list-block li:last-child li:last-child .item-inner{border-bottom:none}.list-block li li:last-child .item-inner,.list-block li:last-child li .item-inner{border-bottom:1px solid #c8c7cc}html.retina.ios-gt-7 .list-block ul{border-top-width:.5px;border-bottom-width:.5px}html.retina.ios-gt-7 .list-block li:not(:last-child) .item-inner{border-bottom-width:.5px}html.retina.ios-gt-7 .item-divider{border-top-width:.5px;margin-top:-.5px}html.retina.ios-gt-7 .item-link.list-button{border-bottom-width:.5px}.contacts-content{background:#fff}.contacts-block{margin:0}.contacts-block .list-group-title{padding:0 15px;background:#f7f7f7;color:#000;font-weight:500;line-height:22px;height:22px}.contacts-block .list-group:first-child ul{border-top:none}.contacts-block .list-group:last-child ul{border-bottom:none}.list-block input[type=text],.list-block input[type=password],.list-block input[type=email],.list-block input[type=tel],.list-block input[type=url],.list-block input[type=date],.list-block input[type=datetime-local],.list-block input[type=time],.list-block input[type=number],.list-block select,.list-block textarea{-webkit-appearance:none;-moz-appearance:none;-ms-appearance:none;appearance:none;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;border:none;background:0 0;border-radius:0;-webkit-box-shadow:none;box-shadow:none;display:block;padding:0 0 0 5px;margin:0;width:100%;height:43px;color:#000;font-size:17px;font-family:inherit}.list-block input[type=date],.list-block input[type=datetime-local]{line-height:44px}.list-block select{-webkit-appearance:none;-moz-appearance:none;-ms-appearance:none;appearance:none}.list-block .lable{vertical-align:top}.list-block textarea{height:100px;resize:none;line-height:1.4;padding-top:8px;padding-bottom:7px}.label-switch{display:inline-block;vertical-align:middle;width:52px;border-radius:16px;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;height:32px;position:relative;cursor:pointer;-ms-flex-item-align:center;-webkit-align-self:center;align-self:center}.label-switch .checkbox{width:52px;border-radius:16px;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;height:32px;background:#e5e5e5;z-index:0;margin:0;padding:0;-webkit-appearance:none;-moz-appearance:none;-ms-appearance:none;appearance:none;border:none;cursor:pointer;position:relative;-webkit-transition-duration:300ms;transition-duration:300ms}.label-switch .checkbox:before{content:' ';position:absolute;left:2px;top:2px;width:48px;border-radius:16px;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;height:28px;background:#fff;z-index:1;-webkit-transition-duration:300ms;transition-duration:300ms;-webkit-transform:scale(1);-ms-transform:scale(1);transform:scale(1)}.label-switch .checkbox:after{content:' ';height:28px;width:28px;border-radius:28px;background:#fff;position:absolute;z-index:2;top:2px;left:2px;-webkit-box-shadow:0 2px 5px rgba(0,0,0,.4);box-shadow:0 2px 5px rgba(0,0,0,.4);-webkit-transform:translateX(0px);-ms-transform:translateX(0px);transform:translateX(0px);-webkit-transition-duration:300ms;transition-duration:300ms}.label-switch input[type=checkbox]{display:none}.label-switch input[type=checkbox]:checked+.checkbox{background:#4cd964}.label-switch input[type=checkbox]:checked+.checkbox:before{-webkit-transform:scale(0);-ms-transform:scale(0);transform:scale(0)}.label-switch input[type=checkbox]:checked+.checkbox:after{-webkit-transform:translateX(22px);-ms-transform:translateX(22px);transform:translateX(22px)}html.android .label-switch input[type=checkbox]+.checkbox{-webkit-transition-duration:0;transition-duration:0}html.android .label-switch input[type=checkbox]+.checkbox:after,html.android .label-switch input[type=checkbox]+.checkbox:before{-webkit-transition-duration:0;transition-duration:0}.button{border:1px solid #007aff;color:#007aff;text-decoration:none;text-align:center;display:block;border-radius:5px;line-height:27px;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;-webkit-appearance:none;-moz-appearance:none;-ms-appearance:none;appearance:none;background:0 0;padding:0 10px;margin:0;height:29px;white-space:nowrap;position:relative;overflow:hidden;text-overflow:ellipsis;font-size:14px;font-family:inherit;cursor:pointer}input[type=submit].button,input[type=button].button{width:100%}html:not(.watch-active-state) .button:active,.button.active-state{background:rgba(0,122,255,.15)}.button.button-round{border-radius:27px}.button.active{background:#007aff;color:#fff}.button.button-big{font-size:17px;height:44px;line-height:42px}.button.button-fill{color:#fff;background:#007aff;border:none}html:not(.watch-active-state) .button.button-fill:active,.button.button-fill.active-state{opacity:.8}.button i.icon:first-child{margin-right:10px}.button i.icon:last-child{margin-left:10px}.button i.icon:first-child:last-child{margin-left:0;margin-right:0}.buttons-row{-ms-flex-item-align:center;-webkit-align-self:center;align-self:center;display:-webkit-box;display:-ms-flexbox;display:-webkit-flex;display:flex;-webkit-box-lines:single;-moz-box-lines:single;-webkit-flex-wrap:nowrap;-ms-flex-wrap:none;-ms-flex-wrap:nowrap;flex-wrap:nowrap}.buttons-row .button{border-radius:0;border-left-width:0;width:100%;-webkit-box-flex:1;-ms-flex:1}.buttons-row .button:first-child{border-radius:5px 0 0 5px;border-left-width:1px;border-left-style:solid}.buttons-row .button:last-child{border-radius:0 5px 5px 0}.buttons-row .button.button-round:first-child{border-radius:27px 0 0 27px}.buttons-row .button.button-round:last-child{border-radius:0 27px 27px 0}.range-slider{width:100%;position:relative;overflow:hidden;padding-left:3px;padding-right:3px;margin-left:-1px;-ms-flex-item-align:center;-webkit-align-self:center;align-self:center}.range-slider input[type=range]{position:relative;height:28px;width:100%;margin:4px 0 5px 0;-webkit-appearance:none;-moz-appearance:none;-ms-appearance:none;appearance:none;background:-webkit-gradient(linear,50% 0,50% 100%,color-stop(0,#b7b8b7),color-stop(100%,#b7b8b7));background:linear-gradient(to right,#b7b8b7 0,#b7b8b7 100%);background-position:center;background-size:100% 2px;background-repeat:no-repeat;outline:0}.range-slider input[type=range]:after{height:2px;background:#fff;content:' ';width:5px;top:50%;margin-top:-1px;left:-5px;z-index:1;position:absolute}.range-slider input[type=range]::-webkit-slider-thumb{-webkit-appearance:none;-moz-appearance:none;-ms-appearance:none;appearance:none;border:none;height:28px;width:28px;position:relative;background:0 0}.range-slider input[type=range]::-webkit-slider-thumb:after{height:28px;width:28px;border-radius:28px;background:#fff;z-index:10;-webkit-box-shadow:0 2px 4px rgba(0,0,0,.4);box-shadow:0 2px 4px rgba(0,0,0,.4);position:absolute;left:0;top:0;content:' '}.range-slider input[type=range]::-webkit-slider-thumb:before{position:absolute;top:50%;right:100%;width:2000px;height:2px;margin-top:-1px;z-index:1;background:#007aff;content:' '}label.label-checkbox{cursor:pointer}label.label-checkbox i.icon-form-checkbox{width:22px;height:22px;position:relative;border-radius:22px;border:1px solid #c7c7cc;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}label.label-checkbox i.icon-form-checkbox:after{content:' ';position:absolute;left:50%;margin-left:-6px;top:50%;margin-top:-4px;width:12px;height:9px}label.label-checkbox input[type=checkbox],label.label-checkbox input[type=radio]{display:none}label.label-checkbox input[type=checkbox]:checked+.item-media i.icon-form-checkbox,label.label-checkbox input[type=radio]:checked+.item-media i.icon-form-checkbox{border:none;background-color:#007aff}label.label-checkbox input[type=checkbox]:checked+.item-media i.icon-form-checkbox:after,label.label-checkbox input[type=radio]:checked+.item-media i.icon-form-checkbox:after{background:no-repeat center;background-image:url("data:image/svg+xml;charset=utf-8,");-webkit-background-size:12px 9px;background-size:12px 9px}label.label-radio{cursor:pointer}label.label-radio input[type=checkbox],label.label-radio input[type=radio]{display:none}label.label-radio input[type=checkbox]~.item-inner,label.label-radio input[type=radio]~.item-inner{padding-right:35px}label.label-radio input[type=checkbox]:checked~.item-inner,label.label-radio input[type=radio]:checked~.item-inner{background:no-repeat center;background-image:url("data:image/svg+xml;charset=utf-8, ");background-position:90% center;background-position:-webkit-calc(100% - 15px) center;background-position:calc(100% - 15px) center;-webkit-background-size:13px 10px;background-size:13px 10px}label.label-checkbox,label.label-radio{-webkit-transition-duration:300ms;transition-duration:300ms}html:not(.watch-active-state) label.label-checkbox:active,html:not(.watch-active-state) label.label-radio:active,label.label-checkbox.active-state,label.label-radio.active-state{-webkit-transition-duration:0ms;transition-duration:0ms;background-color:#d9d9d9}html:not(.watch-active-state) label.label-checkbox:active .item-inner,html:not(.watch-active-state) label.label-radio:active .item-inner,label.label-checkbox.active-state .item-inner,label.label-radio.active-state .item-inner{border-bottom-color:transparent}.smart-select select{display:none}.list-block .accordion-item-toggle{cursor:pointer;-webkit-transition-duration:300ms;transition-duration:300ms}.list-block .accordion-item-toggle .item-inner{padding-right:35px;background:no-repeat -webkit-calc(100% - 15px) center;background:no-repeat calc(100% - 15px) center;background-image:url("data:image/svg+xml;charset=utf-8,");background-size:10px 20px}html:not(.watch-active-state) .list-block .accordion-item-toggle:active,.list-block .accordion-item-toggle.active-state{-webkit-transition-duration:0ms;transition-duration:0ms;background-color:#d9d9d9}html:not(.watch-active-state) .list-block .accordion-item-toggle:active>.item-inner,.list-block .accordion-item-toggle.active-state>.item-inner{border-bottom-color:transparent}.list-block .accordion-item-toggle .item-inner,.list-block .accordion-item>.item-link .item-inner{-webkit-transition-duration:300ms;transition-duration:300ms;-webkit-transition-property:background-color,border-color;transition-property:background-color,border-color}.list-block .accordion-item-expanded .accordion-item-toggle .item-inner,.list-block .accordion-item-expanded>.item-link .item-inner{background-image:url("data:image/svg+xml;charset=utf-8,");background-size:20px 20px;border-bottom-color:transparent}.list-block .accordion-item .content-block,.list-block .accordion-item .list-block{margin-top:0;margin-bottom:0}.list-block .accordion-item ul{padding-left:0}.accordion-item-content{position:relative;overflow:hidden;height:0;font-size:14px;-webkit-transition-duration:300ms;transition-duration:300ms;-webkit-transform:translate3d(0,0,0);-ms-transform:translate3d(0,0,0);transform:translate3d(0,0,0)}.accordion-item-expanded>.accordion-item-content{height:auto}html.android-4 .accordion-item-content{-webkit-transform:none;-ms-transform:none;transform:none}.modal-overlay,.preloader-indicator-overlay,.popup-overlay{position:absolute;left:0;top:0;width:100%;height:100%;background:rgba(0,0,0,.4);z-index:10600;visibility:hidden;opacity:0;-webkit-transition-duration:400ms;transition-duration:400ms}.modal-overlay.modal-overlay-visible,.preloader-indicator-overlay.modal-overlay-visible,.popup-overlay.modal-overlay-visible{visibility:visible;opacity:1}html.ios .modal-overlay.modal-overlay-visible,html.ios .preloader-indicator-overlay.modal-overlay-visible,html.ios .popup-overlay.modal-overlay-visible{overflow:auto;-webkit-overflow-scrolling:touch}.popup-overlay{z-index:10200}.modal{width:270px;position:absolute;z-index:11000;left:50%;margin-left:-135px;margin-top:0;top:50%;text-align:center;border-radius:7px;opacity:0;-webkit-transform:translate3d(0,0,0) scale(1.185);-ms-transform:translate3d(0,0,0) scale(1.185);transform:translate3d(0,0,0) scale(1.185);-webkit-transition-property:-webkit-transform,opacity;-moz-transition-property:-moz-transform,opacity;-ms-transition-property:-ms-transform,opacity;-o-transition-property:-o-transform,opacity;transition-property:transform,opacity;color:#000}.modal.modal-in{opacity:1;-webkit-transition-duration:400ms;transition-duration:400ms;-webkit-transform:translate3d(0,0,0) scale(1);-ms-transform:translate3d(0,0,0) scale(1);transform:translate3d(0,0,0) scale(1)}.modal.modal-out{opacity:0;z-index:10999;-webkit-transition-duration:400ms;transition-duration:400ms;-webkit-transform:translate3d(0,0,0) scale(0.815);-ms-transform:translate3d(0,0,0) scale(0.815);transform:translate3d(0,0,0) scale(0.815)}.modal-inner{padding:15px;border-bottom:1px solid #b5b5b5;border-radius:7px 7px 0 0;background:#e8e8e8}.modal-title{font-weight:500;font-size:18px;text-align:center}.modal-title+.modal-text{margin-top:5px}.modal-buttons{height:44px;overflow:hidden;display:-webkit-box;display:-ms-flexbox;display:-webkit-flex;display:flex;-webkit-box-pack:center;-ms-flex-pack:center;-webkit-justify-content:center;justify-content:center}.modal-buttons.modal-buttons-vertical{display:block;height:auto}.modal-button{width:100%;padding:0 5px;height:44px;font-size:17px;line-height:44px;text-align:center;color:#007aff;background:#e8e8e8;display:block;position:relative;white-space:nowrap;text-overflow:ellipsis;overflow:hidden;cursor:pointer;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;border-right:1px solid #b5b5b5;-webkit-box-flex:1;-ms-flex:1}.modal-button:first-child{border-radius:0 0 0 7px}.modal-button:last-child{border-right:none;border-radius:0 0 7px 0}.modal-button:first-child:last-child{border-radius:0 0 7px 7px}.modal-button.modal-button-bold{font-weight:500}html:not(.watch-active-state) .modal-button:active,.modal-button.active-state{background:#d4d4d4}.modal-buttons-vertical .modal-button{border-right:none;border-bottom:1px solid #b5b5b5;border-radius:0}.modal-buttons-vertical .modal-button:last-child{border-radius:0 0 7px 7px;border-bottom:none}.modal-no-buttons .modal-inner{border-radius:7px;border-bottom:none}.modal-no-buttons .modal-buttons{display:none}.actions-modal{position:absolute;left:0;bottom:0;z-index:11000;width:100%;-webkit-transform:translate3d(0,100%,0);-ms-transform:translate3d(0,100%,0);transform:translate3d(0,100%,0)}.actions-modal.modal-in{-webkit-transition-duration:300ms;transition-duration:300ms;-webkit-transform:translate3d(0,0,0);-ms-transform:translate3d(0,0,0);transform:translate3d(0,0,0)}.actions-modal.modal-out{z-index:10999;-webkit-transition-duration:300ms;transition-duration:300ms;-webkit-transform:translate3d(0,100%,0);-ms-transform:translate3d(0,100%,0);transform:translate3d(0,100%,0)}.actions-modal-group{margin:8px}.actions-modal-button,.actions-modal-label{width:100%;text-align:center;font-weight:400;margin:0;background:rgba(243,243,243,.95);-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;display:block;border-bottom:1px solid #d2d2d6}.actions-modal-button a,.actions-modal-label a{text-decoration:none;color:inherit}.actions-modal-button b,.actions-modal-label b{font-weight:500}.actions-modal-button.actions-modal-button-bold,.actions-modal-label.actions-modal-button-bold{font-weight:500}.actions-modal-button.actions-modal-button-red,.actions-modal-label.actions-modal-button-red{color:#ff3b30}.actions-modal-button:first-child,.actions-modal-label:first-child{border-radius:4px 4px 0 0}.actions-modal-button:last-child,.actions-modal-label:last-child{border:none;border-radius:0 0 4px 4px}.actions-modal-button:first-child:last-child,.actions-modal-label:first-child:last-child{border-radius:4px}.actions-modal-button{cursor:pointer;line-height:43px;font-size:20px;color:#007aff}html:not(.watch-active-state) .actions-modal-button:active,.actions-modal-button.active-state{background:#dcdcdc}.actions-modal-label{font-size:13px;line-height:1.3;min-height:44px;padding:8px 10px;color:#8a8a8a;display:-webkit-box;display:-ms-flexbox;display:-webkit-flex;display:flex;-webkit-box-pack:center;-ms-flex-pack:center;-webkit-justify-content:center;justify-content:center;-webkit-box-align:center;-ms-flex-align:center;-webkit-align-items:center;align-items:center}input.modal-text-input{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;height:30px;background:#fff;margin:0;margin-top:15px;padding:0 5px;border:1px solid #a0a0a0;border-radius:5px;width:100%;font-size:14px;font-family:inherit;display:block;-webkit-box-shadow:0 0 0 transparent;box-shadow:0 0 0 transparent;-webkit-appearance:none;-moz-appearance:none;-ms-appearance:none;appearance:none}input.modal-text-input+input.modal-text-input{margin-top:5px}input.modal-text-input.modal-text-input-double{border-radius:5px 5px 0 0}input.modal-text-input.modal-text-input-double+input.modal-text-input{margin-top:0;border-top:0;border-radius:0 0 5px 5px}.popover{width:320px;background:rgba(255,255,255,.95);z-index:11000;margin:0;top:0;opacity:0;left:0;border-radius:7px;position:absolute;display:none;-webkit-transform:none;-ms-transform:none;transform:none;-webkit-transition-property:opacity;-moz-transition-property:opacity;-ms-transition-property:opacity;-o-transition-property:opacity;transition-property:opacity}.popover.modal-in{-webkit-transition-duration:300ms;transition-duration:300ms;opacity:1}.popover .list-block{margin:0}.popover .list-block ul{background:0 0}.popover .list-block:first-child ul{border-top:none;border-radius:7px 7px 0 0}.popover .list-block:first-child li:first-child a{border-radius:7px 7px 0 0}.popover .list-block:last-child ul{border-bottom:none;border-radius:0 0 7px 7px}.popover .list-block:last-child li:last-child a{border-radius:0 0 7px 7px}.popover .list-block:first-child:last-child li:first-child:last-child a,.popover .list-block:first-child:last-child ul:first-child:last-child{border-radius:7px}.popover .list-block+.list-block{margin-top:35px}.popover-angle{width:26px;height:26px;position:absolute;left:-26px;top:0;z-index:100;overflow:hidden}.popover-angle:after{content:' ';background:rgba(255,255,255,.95);width:26px;height:26px;position:absolute;left:0;top:0;border-radius:3px;-webkit-transform:rotate(45deg);-ms-transform:rotate(45deg);transform:rotate(45deg)}.popover-angle.on-left{left:-26px}.popover-angle.on-left:after{left:19px;top:0}.popover-angle.on-right{left:100%}.popover-angle.on-right:after{left:-19px;top:0}.popover-angle.on-top{left:0;top:-26px}.popover-angle.on-top:after{left:0;top:19px}.popover-angle.on-bottom{left:0;top:100%}.popover-angle.on-bottom:after{left:0;top:-19px}.popover-inner{overflow:auto;-webkit-overflow-scrolling:touch}.actions-popover .list-block+.list-block{margin-top:20px}.actions-popover .list-block ul{background:#fff}.actions-popover-label{padding:8px 10px;color:#8a8a8a;font-size:13px;line-height:1.3;text-align:center;border-bottom:1px solid #d2d2d6}.actions-popover-label:last-child{border-bottom:none}.popup,.login-screen{position:absolute;left:0;top:0;width:100%;height:100%;z-index:10400;background:#fff;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;display:none;overflow:auto;-webkit-overflow-scrolling:touch;-webkit-transition-property:-webkit-transform;-moz-transition-property:-moz-transform;-ms-transition-property:-ms-transform;-o-transition-property:-o-transform;transition-property:transform;-webkit-transform:translate3d(0,100%,0);-ms-transform:translate3d(0,100%,0);transform:translate3d(0,100%,0)}.popup.modal-in,.login-screen.modal-in,.popup.modal-out,.login-screen.modal-out{-webkit-transition-duration:400ms;transition-duration:400ms}.popup.modal-in,.login-screen.modal-in{-webkit-transform:translate3d(0,0,0);-ms-transform:translate3d(0,0,0);transform:translate3d(0,0,0)}.popup.modal-out,.login-screen.modal-out{-webkit-transform:translate3d(0,100%,0);-ms-transform:translate3d(0,100%,0);transform:translate3d(0,100%,0)}.login-screen.modal-in,.login-screen.modal-out{display:block}@media all and (min-width:630px) and (min-height:630px){.popup:not(.tablet-fullscreen){width:630px;height:630px;left:50%;top:50%;margin-left:-315px;margin-top:-315px;-webkit-transform:translate3d(0,1024px,0);-ms-transform:translate3d(0,1024px,0);transform:translate3d(0,1024px,0)}.popup:not(.tablet-fullscreen).modal-in{-webkit-transform:translate3d(0,0,0);-ms-transform:translate3d(0,0,0);transform:translate3d(0,0,0)}.popup:not(.tablet-fullscreen).modal-out{-webkit-transform:translate3d(0,1024px,0);-ms-transform:translate3d(0,1024px,0);transform:translate3d(0,1024px,0)}}@media all and (max-width:629px),(max-height:629px){html.with-statusbar-overlay .popup{height:-webkit-calc(100% - 20px);height:calc(100% - 20px);top:20px}html.with-statusbar-overlay .popup-overlay{z-index:9800}}html.with-statusbar-overlay .login-screen,html.with-statusbar-overlay .popup.tablet-fullscreen{height:-webkit-calc(100% - 20px);height:calc(100% - 20px);top:20px}.modal .preloader{width:34px;height:34px}.preloader-indicator-overlay{visibility:visible;opacity:0;background:0 0}.preloader-indicator-modal{position:absolute;left:50%;top:50%;padding:8px;margin-left:-25px;margin-top:-25px;background:rgba(0,0,0,.8);z-index:11000;border-radius:5px}.preloader-indicator-modal .preloader{display:block;width:34px;height:34px}html.retina.ios-gt-7 .modal-inner{border-bottom-width:.5px}html.retina.ios-gt-7 .modal-button{border-right-width:.5px}html.retina.ios-gt-7 .actions-modal-button,html.retina.ios-gt-7 .actions-modal-label{border-bottom-width:.5px}html.retina.ios-gt-7 .actions-popover-label{border-bottom-width:.5px}html.retina.ios-gt-7 input.modal-text-input{border-width:.5px}.panel-overlay{position:absolute;left:0;top:0;width:100%;height:100%;background:0 0;opacity:0;z-index:5999;display:none}.panel{z-index:1000;display:none;background:#111;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;overflow:auto;-webkit-overflow-scrolling:touch;position:absolute;width:260px;top:0;height:100%;-webkit-transform:translate3d(0,0,0);-ms-transform:translate3d(0,0,0);transform:translate3d(0,0,0);-webkit-transition-duration:400ms;transition-duration:400ms}.panel.panel-left.panel-cover{z-index:6000;left:-260px}.panel.panel-left.panel-reveal{left:0}.panel.panel-right.panel-cover{z-index:6000;right:-260px}.panel.panel-right.panel-reveal{right:0}body.with-panel-left-cover .views,body.with-panel-right-cover .views{-webkit-transform:translate3d(0,0,0);-ms-transform:translate3d(0,0,0);transform:translate3d(0,0,0)}body.with-panel-left-cover .panel-overlay,body.with-panel-right-cover .panel-overlay{display:block}body.with-panel-left-reveal .views,body.with-panel-right-reveal .views{-webkit-transition-duration:400ms;transition-duration:400ms;-webkit-transition-property:-webkit-transform;-moz-transition-property:-moz-transform;transition-property:transform}body.with-panel-left-reveal .panel-overlay,body.with-panel-right-reveal .panel-overlay{display:block}body.with-panel-left-reveal .views{-webkit-transform:translate3d(260px,0,0);-ms-transform:translate3d(260px,0,0);transform:translate3d(260px,0,0)}body.with-panel-left-reveal .panel-overlay{margin-left:260px}body.with-panel-left-cover .panel-left{-webkit-transform:translate3d(260px,0,0);-ms-transform:translate3d(260px,0,0);transform:translate3d(260px,0,0)}body.with-panel-right-reveal .views{-webkit-transform:translate3d(-260px,0,0);-ms-transform:translate3d(-260px,0,0);transform:translate3d(-260px,0,0)}body.with-panel-right-reveal .panel-overlay{margin-left:-260px}body.with-panel-right-cover .panel-right{-webkit-transform:translate3d(-260px,0,0);-ms-transform:translate3d(-260px,0,0);transform:translate3d(-260px,0,0)}body.panel-closing .views{-webkit-transition-duration:400ms;transition-duration:400ms;-webkit-transition-property:-webkit-transform;-moz-transition-property:-moz-transform;transition-property:transform}.tabs .tab{display:none}.tabs .tab.active{display:block}.tabs-animated-wrap{position:relative;width:100%;overflow:hidden;height:100%}.tabs-animated-wrap>.tabs{display:-webkit-box;display:-ms-flexbox;display:-webkit-flex;display:flex;height:100%;-webkit-transition-duration:300ms;transition-duration:300ms}.tabs-animated-wrap>.tabs>.tab{width:100%;display:block;-webkit-flex-shrink:0;-ms-flex:0 0 auto;flex-shrink:0}.messages-content{background:#fff}.messages{display:-webkit-box;display:-ms-flexbox;display:-webkit-flex;display:flex;-webkit-box-orient:vertical;-moz-box-orient:vertical;-ms-flex-direction:column;-webkit-flex-direction:column;flex-direction:column}.messages-date{text-align:center;font-weight:500;font-size:11px;line-height:1;margin:10px 15px;color:#8e8e93}.messages-date span{font-weight:400}.message{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;margin:1px 10px 0;max-width:70%;display:-webkit-box;display:-ms-flexbox;display:-webkit-flex;display:flex;-webkit-box-orient:vertical;-moz-box-orient:vertical;-ms-flex-direction:column;-webkit-flex-direction:column;flex-direction:column}.message:first-child{margin-top:10px}.message .message-text{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;border-radius:16px;padding:6px 16px 9px;min-width:48px;min-height:35px;font-size:17px;line-height:1.2;word-break:break-word}.message.message-pic .message-text{padding:0;background:0 0}.message.message-pic img{display:block;height:auto;max-width:100%;border-radius:16px}.message-name{font-size:12px;line-height:1;color:#8e8e93;margin-bottom:2px;margin-top:7px}.message-hide-name .message-name{display:none}.message-label{font-size:12px;line-height:1;color:#8e8e93;margin-top:4px}.message-hide-label .message-label{display:none}.message-avatar{width:29px;height:29px;border-radius:100%;margin-top:-29px;position:relative;top:1px;background-size:cover;opacity:1;-webkit-transition-duration:400ms;transition-duration:400ms}.message-hide-avatar .message-avatar{opacity:0}.message-sent{-ms-flex-item-align:end;-webkit-align-self:flex-end;align-self:flex-end;-webkit-box-align:end;-ms-flex-align:end;-webkit-align-items:flex-end;align-items:flex-end}.message-sent .message-name{margin-right:16px}.message-sent .message-label{margin-right:6px}.message-sent.message-with-avatar .message-text{margin-right:29px}.message-sent.message-with-avatar .message-name{margin-right:45px}.message-sent.message-with-avatar .message-label{margin-right:34px}.message-sent .message-text{padding-right:22px;background-color:#00d449;color:#fff;margin-left:auto;-webkit-mask-box-image:url("data:image/svg+xml;charset=utf-8,") 50% 56% 46% 42%}.message-sent.message-last .message-text,.message-sent.message-with-tail .message-text{border-radius:16px 16px 0 16px;-webkit-mask-box-image:url("data:image/svg+xml;charset=utf-8,") 50% 56% 46% 42%}.message-sent.message-last.message-pic img,.message-sent.message-with-tail.message-pic img{border-radius:16px 16px 0 16px}.message-received{-ms-flex-item-align:start;-webkit-align-self:flex-start;align-self:flex-start;-webkit-box-align:start;-ms-flex-align:start;-webkit-align-items:flex-start;align-items:flex-start}.message-received .message-text{padding-left:22px;background-color:#e5e5ea;color:#000;-webkit-mask-box-image:url("data:image/svg+xml;charset=utf-8,") 50% 42% 46% 56%}.message-received .message-name{margin-left:16px}.message-received .message-label{margin-left:6px}.message-received.message-with-avatar .message-text{margin-left:29px}.message-received.message-with-avatar .message-name{margin-left:45px}.message-received.message-with-avatar .message-label{margin-left:34px}.message-received.message-last .message-text,.message-received.message-with-tail .message-text{border-radius:16px 16px 16px 0;-webkit-mask-box-image:url("data:image/svg+xml;charset=utf-8,") 50% 42% 46% 56%}.message-received.message-last.message-pic img,.message-received.message-with-tail.message-pic img{border-radius:16px 16px 16px 0}.message-last{margin-bottom:8px}.message-appear{-webkit-animation:messageAppearFromBottom 400ms;animation:messageAppearFromBottom 400ms}.new-messages-first .message-appear{-webkit-animation:messageAppearFromTop 400ms;animation:messageAppearFromTop 400ms}.messages-auto-layout .message-name,.messages-auto-layout .message-label{display:none}.messages-auto-layout .message-avatar{opacity:0}.messages-auto-layout .message-first .message-name{display:block}.messages-auto-layout .message-last .message-avatar{opacity:1}.messages-auto-layout .message-last .message-label{display:block}html.retina.ios-6 .message,html.retina.ios-6 .message.message-pic img{-webkit-mask-box-image:none;border-radius:16px}@-webkit-keyframes messageAppearFromBottom{from{-webkit-transform:translate3d(0,100%,0)}to{-webkit-transform:translate3d(0,0,0)}}@keyframes messageAppearFromBottom{from{transform:translate3d(0,100%,0)}to{transform:translate3d(0,0,0)}}@-webkit-keyframes messageAppearFromTop{from{-webkit-transform:translate3d(0,-100%,0)}to{-webkit-transform:translate3d(0,0,0)}}@keyframes messageAppearFromTop{from{transform:translate3d(0,-100%,0)}to{transform:translate3d(0,0,0)}}html.with-statusbar-overlay body{padding-top:20px;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}html.with-statusbar-overlay body .statusbar-overlay{display:block}html.with-statusbar-overlay body .panel{padding-top:20px}.statusbar-overlay{background:#f7f7f8;z-index:10000;position:absolute;left:0;top:0;height:20px;width:100%;display:none;-webkit-transition-duration:400ms;transition-duration:400ms}.preloader{display:inline-block;width:20px;height:20px;-webkit-transform-origin:50%;transform-origin:50%;-webkit-animation:preloader-spin 1s step-end infinite;animation:preloader-spin 1s step-end infinite}.preloader:after{display:block;content:"";width:100%;height:100%;background-image:url("data:image/svg+xml;charset=utf-8,");background-position:50%;background-size:100%;background-repeat:no-repeat}.preloader-white:after{background-image:url("data:image/svg+xml;charset=utf-8,")}@-webkit-keyframes preloader-spin{0%{-webkit-transform:rotate(0deg)}8.33333333%{-webkit-transform:rotate(30deg)}16.66666667%{-webkit-transform:rotate(60deg)}25%{-webkit-transform:rotate(90deg)}33.33333333%{-webkit-transform:rotate(120deg)}41.66666667%{-webkit-transform:rotate(150deg)}50%{-webkit-transform:rotate(180deg)}58.33333333%{-webkit-transform:rotate(210deg)}66.66666667%{-webkit-transform:rotate(240deg)}75%{-webkit-transform:rotate(270deg)}83.33333333%{-webkit-transform:rotate(300deg)}91.66666667%{-webkit-transform:rotate(330deg)}100%{-webkit-transform:rotate(360deg)}}@keyframes preloader-spin{0%{transform:rotate(0deg)}8.33333333%{transform:rotate(30deg)}16.66666667%{transform:rotate(60deg)}25%{transform:rotate(90deg)}33.33333333%{transform:rotate(120deg)}41.66666667%{transform:rotate(150deg)}50%{transform:rotate(180deg)}58.33333333%{transform:rotate(210deg)}66.66666667%{transform:rotate(240deg)}75%{transform:rotate(270deg)}83.33333333%{transform:rotate(300deg)}91.66666667%{transform:rotate(330deg)}100%{transform:rotate(360deg)}}.pull-to-refresh-layer{position:absolute;position:relative;margin-top:-44px;left:0;top:0;width:100%;height:44px}.pull-to-refresh-layer .preloader{position:absolute;left:50%;top:50%;margin-left:-10px;margin-top:-10px;visibility:hidden}.pull-to-refresh-layer .pull-to-refresh-arrow{width:13px;height:20px;position:absolute;left:50%;top:50%;margin-left:-6px;margin-top:-10px;background:no-repeat center;background-image:url("data:image/svg+xml;charset=utf-8,");background-size:13px 20px;z-index:10;-webkit-transform:rotate(0deg) translate3d(0,0,0);-ms-transform:rotate(0deg) translate3d(0,0,0);transform:rotate(0deg) translate3d(0,0,0);-webkit-transition-duration:300ms;transition-duration:300ms}.pull-to-refresh-content.pull-to-refresh-no-navbar{margin-top:-44px;height:-webkit-calc(100% + 44px);height:-moz-calc(100% + 44px);height:calc(100% + 44px)}.pull-to-refresh-content.pull-to-refresh-no-navbar .pull-to-refresh-layer{margin-top:0}.pull-to-refresh-content.transitioning,.pull-to-refresh-content.refreshing{-webkit-transition-duration:400ms;transition-duration:400ms}.pull-to-refresh-content:not(.refreshing) .preloader{-webkit-animation:none;animation:none}.pull-to-refresh-content.refreshing{-webkit-transform:translate3d(0,44px,0);-ms-transform:translate3d(0,44px,0);transform:translate3d(0,44px,0)}.pull-to-refresh-content.refreshing .pull-to-refresh-arrow{visibility:hidden;-webkit-transition-duration:0ms;transition-duration:0ms}.pull-to-refresh-content.refreshing .preloader{visibility:visible}.pull-to-refresh-content.pull-up .pull-to-refresh-arrow{-webkit-transform:rotate(180deg) translate3d(0,0,0);-ms-transform:rotate(180deg) translate3d(0,0,0);transform:rotate(180deg) translate3d(0,0,0)}.slider-container{position:relative;overflow:hidden;width:100%;height:100%}.slider-wrapper{display:-webkit-box;display:-ms-flexbox;display:-webkit-flex;display:flex;width:100%;height:100%;position:relative;-webkit-transition-property:-webkit-transform;-moz-transition-property:-moz-transform;transition-property:transform;-webkit-transform:translate3d(0,0,0);-ms-transform:translate3d(0,0,0);transform:translate3d(0,0,0)}.slider-container-vertical>.slider-wrapper{-webkit-box-orient:vertical;-moz-box-orient:vertical;-ms-flex-direction:column;-webkit-flex-direction:column;flex-direction:column}.slider-slide{-webkit-flex-shrink:0;-ms-flex:0 0 auto;flex-shrink:0;width:100%;height:100%}.slider-pagination{position:absolute;z-index:10;-webkit-transform:translate3d(0,0,0);-ms-transform:translate3d(0,0,0);transform:translate3d(0,0,0);left:0;bottom:10px;width:100%;text-align:center;-webkit-transition-duration:300ms;transition-duration:300ms;opacity:1;-webkit-transition-property:opacity;-moz-transition-property:opacity;transition-property:opacity}.slider-pagination.slider-pagination-hidden{opacity:0;pointer-events:none}.slider-container-vertical>.slider-pagination{right:10px;left:auto;top:50%;bottom:auto;width:auto;height:auto;-webkit-transform:translate3d(0,-50%,0);-ms-transform:translate3d(0,-50%,0);transform:translate3d(0,-50%,0)}.slider-container-vertical>.slider-pagination .slider-pagination-bullet{display:block;margin:5px 0}.slider-pagination-bullet{width:8px;height:8px;display:inline-block;border-radius:100%;background:#000;opacity:.2;margin:0 5px}.slider-pagination-active{opacity:1;background:#007aff}.photo-browser{position:absolute;left:0;top:0;width:100%;height:100%;z-index:10500}body>.photo-browser{opacity:0;display:none;-webkit-transform:translate3d(0,0,0);-ms-transform:translate3d(0,0,0);transform:translate3d(0,0,0)}body>.photo-browser.photo-browser-in{display:block;-webkit-animation:photoBrowserIn 400ms forwards;animation:photoBrowserIn 400ms forwards}body>.photo-browser.photo-browser-out{display:block;-webkit-animation:photoBrowserOut 400ms forwards;animation:photoBrowserOut 400ms forwards}html.with-statusbar-overlay body>.photo-browser{height:-webkit-calc(100% - 20px);height:calc(100% - 20px);top:20px}.popup>.photo-browser .navbar,body>.photo-browser .navbar,.popup>.photo-browser .toolbar,body>.photo-browser .toolbar{-webkit-transform:translate3d(0,0,0);-ms-transform:translate3d(0,0,0);transform:translate3d(0,0,0)}.photo-browser .page[data-page=photo-browser-slides]{background:0 0}.photo-browser-popup{background:0 0}.photo-browser .navbar,.view[data-page=photo-browser-slides] .navbar,.photo-browser .toolbar,.view[data-page=photo-browser-slides] .toolbar{background:rgba(247,247,247,.95);-webkit-transition-duration:400ms;transition-duration:400ms}.view[data-page=photo-browser-slides] .page[data-page=photo-browser-slides] .navbar,.view[data-page=photo-browser-slides] .page[data-page=photo-browser-slides] .toolbar{-webkit-transform:translate3d(0,0,0);-ms-transform:translate3d(0,0,0);transform:translate3d(0,0,0)}.photo-browser-exposed .navbar,.photo-browser-exposed .toolbar{opacity:0;visibility:hidden;pointer-events:none}.photo-browser-exposed .photo-browser-slider-container{background:#000}.photo-browser-of{margin:0 5px}.photo-browser-captions{pointer-events:none;position:absolute;left:0;width:100%;bottom:0;z-index:10;opacity:1;-webkit-transition-duration:400ms;transition-duration:400ms}.photo-browser-captions.photo-browser-captions-exposed{opacity:0}.toolbar~.photo-browser-captions{bottom:44px;-webkit-transform:translate3d(0,0,0);-ms-transform:translate3d(0,0,0);transform:translate3d(0,0,0)}.photo-browser-exposed .toolbar~.photo-browser-captions{-webkit-transform:translate3d(0,44px,0);-ms-transform:translate3d(0,44px,0);transform:translate3d(0,44px,0)}.toolbar~.photo-browser-captions.photo-browser-captions-exposed{-webkit-transform:translate3d(0,0,0);-ms-transform:translate3d(0,0,0);transform:translate3d(0,0,0)}.photo-browser-caption{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;-webkit-transition-duration:300ms;transition-duration:300ms;position:absolute;bottom:0;left:0;opacity:0;padding:4px 5px;width:100%;text-align:center;color:#fff;background:rgba(0,0,0,.8)}.photo-browser-caption:empty{display:none}.photo-browser-caption.photo-browser-caption-active{opacity:1}.photo-browser-captions-light .photo-browser-caption{background:rgba(255,255,255,.8);color:#000}.photo-browser-exposed .photo-browser-caption{color:#fff;background:rgba(0,0,0,.8)}.photo-browser-slider-container{position:absolute;left:0;top:0;width:100%;height:100%;overflow:hidden;background:#fff;-webkit-transition-duration:400ms;transition-duration:400ms}.photo-browser-slider-wrapper{position:absolute;left:0;top:0;width:100%;height:100%;padding:0;display:-webkit-box;display:-ms-flexbox;display:-webkit-flex;display:flex}.photo-browser-link-inactive{opacity:.3}.photo-browser-slide{width:100%;height:100%;position:relative;overflow:hidden;display:-webkit-box;display:-ms-flexbox;display:-webkit-flex;display:flex;-webkit-box-pack:center;-ms-flex-pack:center;-webkit-justify-content:center;justify-content:center;-webkit-box-align:center;-ms-flex-align:center;-webkit-align-items:center;align-items:center;-webkit-flex-shrink:0;-ms-flex:0 0 auto;flex-shrink:0;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.photo-browser-slide.transitioning{-webkit-transition-duration:400ms;transition-duration:400ms}.photo-browser-slide span.photo-browser-zoom-container{width:100%;text-align:center;display:none}.photo-browser-slide img{width:auto;height:auto;max-width:100%;max-height:100%;display:none}.photo-browser-slide.slider-slide-active span.photo-browser-zoom-container,.photo-browser-slide.slider-slide-next span.photo-browser-zoom-container,.photo-browser-slide.slider-slide-prev span.photo-browser-zoom-container{display:block}.photo-browser-slide.slider-slide-active img,.photo-browser-slide.slider-slide-next img,.photo-browser-slide.slider-slide-prev img{display:inline}.photo-browser-slide.slider-slide-active.photo-browser-slide-lazy .preloader,.photo-browser-slide.slider-slide-next.photo-browser-slide-lazy .preloader,.photo-browser-slide.slider-slide-prev.photo-browser-slide-lazy .preloader{display:block}.photo-browser-slide iframe{width:100%;height:100%}.photo-browser-slide .preloader{display:none;position:absolute;width:42px;height:42px;margin-left:-21px;margin-top:-21px;left:50%;top:50%}.photo-browser-dark .navbar,.photo-browser-dark .toolbar{background:rgba(30,30,30,.8);border:none;color:#fff}.photo-browser-dark .navbar a,.photo-browser-dark .toolbar a{color:#fff}.photo-browser-dark .photo-browser-slider-container{background:#000}@-webkit-keyframes photoBrowserIn{0%{-webkit-transform:translate3d(0,0,0) scale(0.5);opacity:0}100%{-webkit-transform:translate3d(0,0,0) scale(1);opacity:1}}@keyframes photoBrowserIn{0%{transform:translate3d(0,0,0) scale(0.5);opacity:0}100%{transform:translate3d(0,0,0) scale(1);opacity:1}}@-webkit-keyframes photoBrowserOut{0%{-webkit-transform:translate3d(0,0,0) scale(1);opacity:1}100%{-webkit-transform:translate3d(0,0,0) scale(0.5);opacity:0}}@keyframes photoBrowserOut{0%{transform:translate3d(0,0,0) scale(1);opacity:1}100%{transform:translate3d(0,0,0) scale(0.5);opacity:0}}.notifications{position:absolute;left:0;top:0;width:100%;z-index:20000;color:#fff;font-size:14px;margin:0;border:none;display:none;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;max-height:100%;overflow:auto;-webkit-overflow-scrolling:touch;-webkit-transition-duration:450ms;transition-duration:450ms;background:rgba(0,0,0,.85);-webkit-perspective:1200px;perspective:1200px}.notifications.list-block>ul{border:none;background:0 0;margin:0}.with-statusbar-overlay .notifications{padding-top:20px;-webkit-transform:translate3d(0,-20px,0);-ms-transform:translate3d(0,-20px,0);transform:translate3d(0,-20px,0)}.notifications .item-content{-webkit-box-align:start;-ms-flex-align:start;-webkit-align-items:flex-start;align-items:flex-start}.notifications .item-text,.notifications .item-subtitle,.notifications .item-title{font-size:14px}.notifications .item-title{font-weight:500}.notifications .item-text{height:auto;color:#d2d2d2;line-height:inherit}.notifications .item-text,.notifications .item-subtitle{font-weight:300}.notifications .item-inner{border-bottom-color:rgba(255,255,255,.2)}.notifications .item-media i.icon{width:20px;height:20px;-webkit-background-size:cover;background-size:cover;background-position:center;background-repeat:no-repeat}.notifications li.notification-item .item-media{padding-top:13px}.notifications .close-notification{width:19px;height:19px;background:url("data:image/svg+xml;charset=utf-8,") no-repeat center top;-webkit-background-size:100% auto;background-size:100% auto;position:relative}.notifications .close-notification span{position:absolute;width:44px;height:44px;left:50%;top:50%;margin-left:-22px;margin-top:-22px}.notifications .notification-item{max-width:568px;margin:0 auto;-webkit-transition-duration:450ms;transition-duration:450ms;-webkit-transform:translate3d(0,0,0);-ms-transform:translate3d(0,0,0);transform:translate3d(0,0,0);opacity:1}.notifications .notification-hidden{opacity:0;-webkit-transform:translate3d(0,0,0);-ms-transform:translate3d(0,0,0);transform:translate3d(0,0,0)}.login-screen-content{background:#fff}.login-screen-content .login-screen-title,.login-screen-content .list-block,.login-screen-content .content-block,.login-screen-content .list-block-label{max-width:480px;margin:25px auto}.login-screen-content .list-block ul{border:none;background:0 0}.login-screen-content .list-block-label{text-align:center}.login-screen-title{text-align:center;font-size:30px}.disabled,[disabled]{opacity:.55;pointer-events:none}.disabled .disabled,.disabled [disabled],[disabled] .disabled,[disabled] [disabled]{opacity:1}.color-gray{color:#8e8e93}.list-block .item-link.list-button.color-gray,.tabbar a.active.color-gray,a.color-gray{color:#8e8e93}.label-switch input[type=checkbox]:checked+.checkbox.color-gray,.label-switch.color-gray input[type=checkbox]:checked+.checkbox{background-color:#8e8e93}.color-gray.button:not(.button-fill),.color-gray.buttons-row .button,.theme-gray .button:not(.button-fill){border-color:#8e8e93}html:not(.watch-active-state) .color-gray.button:not(.button-fill):active,html:not(.watch-active-state) .color-gray.buttons-row .button:active,html:not(.watch-active-state) .theme-gray .button:not(.button-fill):active,.color-gray.button:not(.button-fill).active-state,.color-gray.buttons-row .button.active-state,.theme-gray .button:not(.button-fill).active-state{background-color:rgba(142,142,147,.15)}.color-gray.button:not(.button-fill).active,.color-gray.buttons-row .button.active,.theme-gray .button:not(.button-fill).active{background-color:#8e8e93;color:#fff}.theme-gray .button.button-fill,.button.button-fill.color-gray{background:#8e8e93;color:#fff}.color-gray i.icon,.theme-gray i.icon,i.icon.color-gray,i.icon.theme-gray{color:#8e8e93}i.icon-next.color-gray,i.icon-next.theme-gray,.theme-gray i.icon-next{background-image:url("data:image/svg+xml;charset=utf-8,")}i.icon-prev.color-gray,i.icon-prev.theme-gray,.theme-gray i.icon-prev{background-image:url("data:image/svg+xml;charset=utf-8,")}i.icon-back.color-gray,i.icon-back.theme-gray,.theme-gray i.icon-back{background-image:url("data:image/svg+xml;charset=utf-8,")}i.icon-bars.color-gray,i.icon-bars.theme-gray,.theme-gray i.icon-bars{background-image:url("data:image/svg+xml;charset=utf-8,")}@media all and (-webkit-max-device-pixel-ratio:1),(max-resolution:120dpi){i.icon-bars.color-gray,i.icon-bars.theme-gray,.theme-gray i.icon-bars{background-image:url("data:image/svg+xml;charset=utf-8,")}}.theme-gray a,.theme-gray .item-link.list-button{color:#8e8e93}.theme-gray .tabbar a,.tabbar.theme-gray a{color:inherit}.theme-gray .tabbar a.active,.tabbar.theme-gray a.active{color:#8e8e93}.theme-gray .range-slider input[type=range]::-webkit-slider-thumb:before,.range-slider.theme-gray input[type=range]::-webkit-slider-thumb:before{background-color:#8e8e93}.theme-gray label.label-checkbox input[type=checkbox]:checked+.item-media i.icon-form-checkbox,.theme-gray label.label-checkbox input[type=radio]:checked+.item-media i.icon-form-checkbox{background-color:#8e8e93}.theme-gray label.label-radio input[type=checkbox]:checked~.item-inner,.theme-gray label.label-radio input[type=radio]:checked~.item-inner{background-image:url("data:image/svg+xml;charset=utf-8, ")}.theme-gray .slider-pagination-active{background-color:#8e8e93}.bg-gray,.button.button-fill.bg-gray,a.bg-gray,.list-block .swipeout-actions-left a.bg-gray,.list-block .swipeout-actions-right a.bg-gray{background-color:#8e8e93}.border-gray{border-color:#8e8e93}.color-white{color:#fff}.list-block .item-link.list-button.color-white,.tabbar a.active.color-white,a.color-white{color:#fff}.label-switch input[type=checkbox]:checked+.checkbox.color-white,.label-switch.color-white input[type=checkbox]:checked+.checkbox{background-color:#fff}.color-white.button:not(.button-fill),.color-white.buttons-row .button,.theme-white .button:not(.button-fill){border-color:#fff}html:not(.watch-active-state) .color-white.button:not(.button-fill):active,html:not(.watch-active-state) .color-white.buttons-row .button:active,html:not(.watch-active-state) .theme-white .button:not(.button-fill):active,.color-white.button:not(.button-fill).active-state,.color-white.buttons-row .button.active-state,.theme-white .button:not(.button-fill).active-state{background-color:rgba(255,255,255,.15)}.color-white.button:not(.button-fill).active,.color-white.buttons-row .button.active,.theme-white .button:not(.button-fill).active{background-color:#fff;color:#fff}.theme-white .button.button-fill,.button.button-fill.color-white{background:#fff;color:#fff}.color-white i.icon,.theme-white i.icon,i.icon.color-white,i.icon.theme-white{color:#fff}i.icon-next.color-white,i.icon-next.theme-white,.theme-white i.icon-next{background-image:url("data:image/svg+xml;charset=utf-8,")}i.icon-prev.color-white,i.icon-prev.theme-white,.theme-white i.icon-prev{background-image:url("data:image/svg+xml;charset=utf-8,")}i.icon-back.color-white,i.icon-back.theme-white,.theme-white i.icon-back{background-image:url("data:image/svg+xml;charset=utf-8,")}i.icon-bars.color-white,i.icon-bars.theme-white,.theme-white i.icon-bars{background-image:url("data:image/svg+xml;charset=utf-8,")}@media all and (-webkit-max-device-pixel-ratio:1),(max-resolution:120dpi){i.icon-bars.color-white,i.icon-bars.theme-white,.theme-white i.icon-bars{background-image:url("data:image/svg+xml;charset=utf-8,")}}.theme-white a,.theme-white .item-link.list-button{color:#fff}.theme-white .tabbar a,.tabbar.theme-white a{color:inherit}.theme-white .tabbar a.active,.tabbar.theme-white a.active{color:#fff}.theme-white .range-slider input[type=range]::-webkit-slider-thumb:before,.range-slider.theme-white input[type=range]::-webkit-slider-thumb:before{background-color:#fff}.theme-white label.label-checkbox input[type=checkbox]:checked+.item-media i.icon-form-checkbox,.theme-white label.label-checkbox input[type=radio]:checked+.item-media i.icon-form-checkbox{background-color:#fff}.theme-white label.label-radio input[type=checkbox]:checked~.item-inner,.theme-white label.label-radio input[type=radio]:checked~.item-inner{background-image:url("data:image/svg+xml;charset=utf-8, ")}.theme-white .slider-pagination-active{background-color:#fff}.bg-white,.button.button-fill.bg-white,a.bg-white,.list-block .swipeout-actions-left a.bg-white,.list-block .swipeout-actions-right a.bg-white{background-color:#fff}.border-white{border-color:#fff}.color-black{color:#000}.list-block .item-link.list-button.color-black,.tabbar a.active.color-black,a.color-black{color:#000}.label-switch input[type=checkbox]:checked+.checkbox.color-black,.label-switch.color-black input[type=checkbox]:checked+.checkbox{background-color:#000}.color-black.button:not(.button-fill),.color-black.buttons-row .button,.theme-black .button:not(.button-fill){border-color:#000}html:not(.watch-active-state) .color-black.button:not(.button-fill):active,html:not(.watch-active-state) .color-black.buttons-row .button:active,html:not(.watch-active-state) .theme-black .button:not(.button-fill):active,.color-black.button:not(.button-fill).active-state,.color-black.buttons-row .button.active-state,.theme-black .button:not(.button-fill).active-state{background-color:rgba(0,0,0,.15)}.color-black.button:not(.button-fill).active,.color-black.buttons-row .button.active,.theme-black .button:not(.button-fill).active{background-color:#000;color:#fff}.theme-black .button.button-fill,.button.button-fill.color-black{background:#000;color:#fff}.color-black i.icon,.theme-black i.icon,i.icon.color-black,i.icon.theme-black{color:#000}i.icon-next.color-black,i.icon-next.theme-black,.theme-black i.icon-next{background-image:url("data:image/svg+xml;charset=utf-8,")}i.icon-prev.color-black,i.icon-prev.theme-black,.theme-black i.icon-prev{background-image:url("data:image/svg+xml;charset=utf-8,")}i.icon-back.color-black,i.icon-back.theme-black,.theme-black i.icon-back{background-image:url("data:image/svg+xml;charset=utf-8,")}i.icon-bars.color-black,i.icon-bars.theme-black,.theme-black i.icon-bars{background-image:url("data:image/svg+xml;charset=utf-8,")}@media all and (-webkit-max-device-pixel-ratio:1),(max-resolution:120dpi){i.icon-bars.color-black,i.icon-bars.theme-black,.theme-black i.icon-bars{background-image:url("data:image/svg+xml;charset=utf-8,")}}.theme-black a,.theme-black .item-link.list-button{color:#000}.theme-black .tabbar a,.tabbar.theme-black a{color:inherit}.theme-black .tabbar a.active,.tabbar.theme-black a.active{color:#000}.theme-black .range-slider input[type=range]::-webkit-slider-thumb:before,.range-slider.theme-black input[type=range]::-webkit-slider-thumb:before{background-color:#000}.theme-black label.label-checkbox input[type=checkbox]:checked+.item-media i.icon-form-checkbox,.theme-black label.label-checkbox input[type=radio]:checked+.item-media i.icon-form-checkbox{background-color:#000}.theme-black label.label-radio input[type=checkbox]:checked~.item-inner,.theme-black label.label-radio input[type=radio]:checked~.item-inner{background-image:url("data:image/svg+xml;charset=utf-8, ")}.theme-black .slider-pagination-active{background-color:#000}.bg-black,.button.button-fill.bg-black,a.bg-black,.list-block .swipeout-actions-left a.bg-black,.list-block .swipeout-actions-right a.bg-black{background-color:#000}.border-black{border-color:#000}.color-lightblue{color:#5ac8fa}.list-block .item-link.list-button.color-lightblue,.tabbar a.active.color-lightblue,a.color-lightblue{color:#5ac8fa}.label-switch input[type=checkbox]:checked+.checkbox.color-lightblue,.label-switch.color-lightblue input[type=checkbox]:checked+.checkbox{background-color:#5ac8fa}.color-lightblue.button:not(.button-fill),.color-lightblue.buttons-row .button,.theme-lightblue .button:not(.button-fill){border-color:#5ac8fa}html:not(.watch-active-state) .color-lightblue.button:not(.button-fill):active,html:not(.watch-active-state) .color-lightblue.buttons-row .button:active,html:not(.watch-active-state) .theme-lightblue .button:not(.button-fill):active,.color-lightblue.button:not(.button-fill).active-state,.color-lightblue.buttons-row .button.active-state,.theme-lightblue .button:not(.button-fill).active-state{background-color:rgba(90,200,250,.15)}.color-lightblue.button:not(.button-fill).active,.color-lightblue.buttons-row .button.active,.theme-lightblue .button:not(.button-fill).active{background-color:#5ac8fa;color:#fff}.theme-lightblue .button.button-fill,.button.button-fill.color-lightblue{background:#5ac8fa;color:#fff}.color-lightblue i.icon,.theme-lightblue i.icon,i.icon.color-lightblue,i.icon.theme-lightblue{color:#5ac8fa}i.icon-next.color-lightblue,i.icon-next.theme-lightblue,.theme-lightblue i.icon-next{background-image:url("data:image/svg+xml;charset=utf-8,")}i.icon-prev.color-lightblue,i.icon-prev.theme-lightblue,.theme-lightblue i.icon-prev{background-image:url("data:image/svg+xml;charset=utf-8,")}i.icon-back.color-lightblue,i.icon-back.theme-lightblue,.theme-lightblue i.icon-back{background-image:url("data:image/svg+xml;charset=utf-8,")}i.icon-bars.color-lightblue,i.icon-bars.theme-lightblue,.theme-lightblue i.icon-bars{background-image:url("data:image/svg+xml;charset=utf-8,")}@media all and (-webkit-max-device-pixel-ratio:1),(max-resolution:120dpi){i.icon-bars.color-lightblue,i.icon-bars.theme-lightblue,.theme-lightblue i.icon-bars{background-image:url("data:image/svg+xml;charset=utf-8,")}}.theme-lightblue a,.theme-lightblue .item-link.list-button{color:#5ac8fa}.theme-lightblue .tabbar a,.tabbar.theme-lightblue a{color:inherit}.theme-lightblue .tabbar a.active,.tabbar.theme-lightblue a.active{color:#5ac8fa}.theme-lightblue .range-slider input[type=range]::-webkit-slider-thumb:before,.range-slider.theme-lightblue input[type=range]::-webkit-slider-thumb:before{background-color:#5ac8fa}.theme-lightblue label.label-checkbox input[type=checkbox]:checked+.item-media i.icon-form-checkbox,.theme-lightblue label.label-checkbox input[type=radio]:checked+.item-media i.icon-form-checkbox{background-color:#5ac8fa}.theme-lightblue label.label-radio input[type=checkbox]:checked~.item-inner,.theme-lightblue label.label-radio input[type=radio]:checked~.item-inner{background-image:url("data:image/svg+xml;charset=utf-8, ")}.theme-lightblue .slider-pagination-active{background-color:#5ac8fa}.bg-lightblue,.button.button-fill.bg-lightblue,a.bg-lightblue,.list-block .swipeout-actions-left a.bg-lightblue,.list-block .swipeout-actions-right a.bg-lightblue{background-color:#5ac8fa}.border-lightblue{border-color:#5ac8fa}.color-yellow{color:#fc0}.list-block .item-link.list-button.color-yellow,.tabbar a.active.color-yellow,a.color-yellow{color:#fc0}.label-switch input[type=checkbox]:checked+.checkbox.color-yellow,.label-switch.color-yellow input[type=checkbox]:checked+.checkbox{background-color:#fc0}.color-yellow.button:not(.button-fill),.color-yellow.buttons-row .button,.theme-yellow .button:not(.button-fill){border-color:#fc0}html:not(.watch-active-state) .color-yellow.button:not(.button-fill):active,html:not(.watch-active-state) .color-yellow.buttons-row .button:active,html:not(.watch-active-state) .theme-yellow .button:not(.button-fill):active,.color-yellow.button:not(.button-fill).active-state,.color-yellow.buttons-row .button.active-state,.theme-yellow .button:not(.button-fill).active-state{background-color:rgba(255,204,0,.15)}.color-yellow.button:not(.button-fill).active,.color-yellow.buttons-row .button.active,.theme-yellow .button:not(.button-fill).active{background-color:#fc0;color:#fff}.theme-yellow .button.button-fill,.button.button-fill.color-yellow{background:#fc0;color:#fff}.color-yellow i.icon,.theme-yellow i.icon,i.icon.color-yellow,i.icon.theme-yellow{color:#fc0}i.icon-next.color-yellow,i.icon-next.theme-yellow,.theme-yellow i.icon-next{background-image:url("data:image/svg+xml;charset=utf-8,")}i.icon-prev.color-yellow,i.icon-prev.theme-yellow,.theme-yellow i.icon-prev{background-image:url("data:image/svg+xml;charset=utf-8,")}i.icon-back.color-yellow,i.icon-back.theme-yellow,.theme-yellow i.icon-back{background-image:url("data:image/svg+xml;charset=utf-8,")}i.icon-bars.color-yellow,i.icon-bars.theme-yellow,.theme-yellow i.icon-bars{background-image:url("data:image/svg+xml;charset=utf-8,")}@media all and (-webkit-max-device-pixel-ratio:1),(max-resolution:120dpi){i.icon-bars.color-yellow,i.icon-bars.theme-yellow,.theme-yellow i.icon-bars{background-image:url("data:image/svg+xml;charset=utf-8,")}}.theme-yellow a,.theme-yellow .item-link.list-button{color:#fc0}.theme-yellow .tabbar a,.tabbar.theme-yellow a{color:inherit}.theme-yellow .tabbar a.active,.tabbar.theme-yellow a.active{color:#fc0}.theme-yellow .range-slider input[type=range]::-webkit-slider-thumb:before,.range-slider.theme-yellow input[type=range]::-webkit-slider-thumb:before{background-color:#fc0}.theme-yellow label.label-checkbox input[type=checkbox]:checked+.item-media i.icon-form-checkbox,.theme-yellow label.label-checkbox input[type=radio]:checked+.item-media i.icon-form-checkbox{background-color:#fc0}.theme-yellow label.label-radio input[type=checkbox]:checked~.item-inner,.theme-yellow label.label-radio input[type=radio]:checked~.item-inner{background-image:url("data:image/svg+xml;charset=utf-8, ")}.theme-yellow .slider-pagination-active{background-color:#fc0}.bg-yellow,.button.button-fill.bg-yellow,a.bg-yellow,.list-block .swipeout-actions-left a.bg-yellow,.list-block .swipeout-actions-right a.bg-yellow{background-color:#fc0}.border-yellow{border-color:#fc0}.color-orange{color:#ff9500}.list-block .item-link.list-button.color-orange,.tabbar a.active.color-orange,a.color-orange{color:#ff9500}.label-switch input[type=checkbox]:checked+.checkbox.color-orange,.label-switch.color-orange input[type=checkbox]:checked+.checkbox{background-color:#ff9500}.color-orange.button:not(.button-fill),.color-orange.buttons-row .button,.theme-orange .button:not(.button-fill){border-color:#ff9500}html:not(.watch-active-state) .color-orange.button:not(.button-fill):active,html:not(.watch-active-state) .color-orange.buttons-row .button:active,html:not(.watch-active-state) .theme-orange .button:not(.button-fill):active,.color-orange.button:not(.button-fill).active-state,.color-orange.buttons-row .button.active-state,.theme-orange .button:not(.button-fill).active-state{background-color:rgba(255,149,0,.15)}.color-orange.button:not(.button-fill).active,.color-orange.buttons-row .button.active,.theme-orange .button:not(.button-fill).active{background-color:#ff9500;color:#fff}.theme-orange .button.button-fill,.button.button-fill.color-orange{background:#ff9500;color:#fff}.color-orange i.icon,.theme-orange i.icon,i.icon.color-orange,i.icon.theme-orange{color:#ff9500}i.icon-next.color-orange,i.icon-next.theme-orange,.theme-orange i.icon-next{background-image:url("data:image/svg+xml;charset=utf-8,")}i.icon-prev.color-orange,i.icon-prev.theme-orange,.theme-orange i.icon-prev{background-image:url("data:image/svg+xml;charset=utf-8,")}i.icon-back.color-orange,i.icon-back.theme-orange,.theme-orange i.icon-back{background-image:url("data:image/svg+xml;charset=utf-8,")}i.icon-bars.color-orange,i.icon-bars.theme-orange,.theme-orange i.icon-bars{background-image:url("data:image/svg+xml;charset=utf-8,")}@media all and (-webkit-max-device-pixel-ratio:1),(max-resolution:120dpi){i.icon-bars.color-orange,i.icon-bars.theme-orange,.theme-orange i.icon-bars{background-image:url("data:image/svg+xml;charset=utf-8,")}}.theme-orange a,.theme-orange .item-link.list-button{color:#ff9500}.theme-orange .tabbar a,.tabbar.theme-orange a{color:inherit}.theme-orange .tabbar a.active,.tabbar.theme-orange a.active{color:#ff9500}.theme-orange .range-slider input[type=range]::-webkit-slider-thumb:before,.range-slider.theme-orange input[type=range]::-webkit-slider-thumb:before{background-color:#ff9500}.theme-orange label.label-checkbox input[type=checkbox]:checked+.item-media i.icon-form-checkbox,.theme-orange label.label-checkbox input[type=radio]:checked+.item-media i.icon-form-checkbox{background-color:#ff9500}.theme-orange label.label-radio input[type=checkbox]:checked~.item-inner,.theme-orange label.label-radio input[type=radio]:checked~.item-inner{background-image:url("data:image/svg+xml;charset=utf-8, ")}.theme-orange .slider-pagination-active{background-color:#ff9500}.bg-orange,.button.button-fill.bg-orange,a.bg-orange,.list-block .swipeout-actions-left a.bg-orange,.list-block .swipeout-actions-right a.bg-orange{background-color:#ff9500}.border-orange{border-color:#ff9500}.color-pink{color:#ff2d55}.list-block .item-link.list-button.color-pink,.tabbar a.active.color-pink,a.color-pink{color:#ff2d55}.label-switch input[type=checkbox]:checked+.checkbox.color-pink,.label-switch.color-pink input[type=checkbox]:checked+.checkbox{background-color:#ff2d55}.color-pink.button:not(.button-fill),.color-pink.buttons-row .button,.theme-pink .button:not(.button-fill){border-color:#ff2d55}html:not(.watch-active-state) .color-pink.button:not(.button-fill):active,html:not(.watch-active-state) .color-pink.buttons-row .button:active,html:not(.watch-active-state) .theme-pink .button:not(.button-fill):active,.color-pink.button:not(.button-fill).active-state,.color-pink.buttons-row .button.active-state,.theme-pink .button:not(.button-fill).active-state{background-color:rgba(255,45,85,.15)}.color-pink.button:not(.button-fill).active,.color-pink.buttons-row .button.active,.theme-pink .button:not(.button-fill).active{background-color:#ff2d55;color:#fff}.theme-pink .button.button-fill,.button.button-fill.color-pink{background:#ff2d55;color:#fff}.color-pink i.icon,.theme-pink i.icon,i.icon.color-pink,i.icon.theme-pink{color:#ff2d55}i.icon-next.color-pink,i.icon-next.theme-pink,.theme-pink i.icon-next{background-image:url("data:image/svg+xml;charset=utf-8,")}i.icon-prev.color-pink,i.icon-prev.theme-pink,.theme-pink i.icon-prev{background-image:url("data:image/svg+xml;charset=utf-8,")}i.icon-back.color-pink,i.icon-back.theme-pink,.theme-pink i.icon-back{background-image:url("data:image/svg+xml;charset=utf-8,")}i.icon-bars.color-pink,i.icon-bars.theme-pink,.theme-pink i.icon-bars{background-image:url("data:image/svg+xml;charset=utf-8,")}@media all and (-webkit-max-device-pixel-ratio:1),(max-resolution:120dpi){i.icon-bars.color-pink,i.icon-bars.theme-pink,.theme-pink i.icon-bars{background-image:url("data:image/svg+xml;charset=utf-8,")}}.theme-pink a,.theme-pink .item-link.list-button{color:#ff2d55}.theme-pink .tabbar a,.tabbar.theme-pink a{color:inherit}.theme-pink .tabbar a.active,.tabbar.theme-pink a.active{color:#ff2d55}.theme-pink .range-slider input[type=range]::-webkit-slider-thumb:before,.range-slider.theme-pink input[type=range]::-webkit-slider-thumb:before{background-color:#ff2d55}.theme-pink label.label-checkbox input[type=checkbox]:checked+.item-media i.icon-form-checkbox,.theme-pink label.label-checkbox input[type=radio]:checked+.item-media i.icon-form-checkbox{background-color:#ff2d55}.theme-pink label.label-radio input[type=checkbox]:checked~.item-inner,.theme-pink label.label-radio input[type=radio]:checked~.item-inner{background-image:url("data:image/svg+xml;charset=utf-8, ")}.theme-pink .slider-pagination-active{background-color:#ff2d55}.bg-pink,.button.button-fill.bg-pink,a.bg-pink,.list-block .swipeout-actions-left a.bg-pink,.list-block .swipeout-actions-right a.bg-pink{background-color:#ff2d55}.border-pink{border-color:#ff2d55}.color-blue{color:#007aff}.list-block .item-link.list-button.color-blue,.tabbar a.active.color-blue,a.color-blue{color:#007aff}.label-switch input[type=checkbox]:checked+.checkbox.color-blue,.label-switch.color-blue input[type=checkbox]:checked+.checkbox{background-color:#007aff}.color-blue.button:not(.button-fill),.color-blue.buttons-row .button,.theme-blue .button:not(.button-fill){border-color:#007aff}html:not(.watch-active-state) .color-blue.button:not(.button-fill):active,html:not(.watch-active-state) .color-blue.buttons-row .button:active,html:not(.watch-active-state) .theme-blue .button:not(.button-fill):active,.color-blue.button:not(.button-fill).active-state,.color-blue.buttons-row .button.active-state,.theme-blue .button:not(.button-fill).active-state{background-color:rgba(0,122,255,.15)}.color-blue.button:not(.button-fill).active,.color-blue.buttons-row .button.active,.theme-blue .button:not(.button-fill).active{background-color:#007aff;color:#fff}.theme-blue .button.button-fill,.button.button-fill.color-blue{background:#007aff;color:#fff}.color-blue i.icon,.theme-blue i.icon,i.icon.color-blue,i.icon.theme-blue{color:#007aff}i.icon-next.color-blue,i.icon-next.theme-blue,.theme-blue i.icon-next{background-image:url("data:image/svg+xml;charset=utf-8,")}i.icon-prev.color-blue,i.icon-prev.theme-blue,.theme-blue i.icon-prev{background-image:url("data:image/svg+xml;charset=utf-8,")}i.icon-back.color-blue,i.icon-back.theme-blue,.theme-blue i.icon-back{background-image:url("data:image/svg+xml;charset=utf-8,")}i.icon-bars.color-blue,i.icon-bars.theme-blue,.theme-blue i.icon-bars{background-image:url("data:image/svg+xml;charset=utf-8,")}@media all and (-webkit-max-device-pixel-ratio:1),(max-resolution:120dpi){i.icon-bars.color-blue,i.icon-bars.theme-blue,.theme-blue i.icon-bars{background-image:url("data:image/svg+xml;charset=utf-8,")}}.theme-blue a,.theme-blue .item-link.list-button{color:#007aff}.theme-blue .tabbar a,.tabbar.theme-blue a{color:inherit}.theme-blue .tabbar a.active,.tabbar.theme-blue a.active{color:#007aff}.theme-blue .range-slider input[type=range]::-webkit-slider-thumb:before,.range-slider.theme-blue input[type=range]::-webkit-slider-thumb:before{background-color:#007aff}.theme-blue label.label-checkbox input[type=checkbox]:checked+.item-media i.icon-form-checkbox,.theme-blue label.label-checkbox input[type=radio]:checked+.item-media i.icon-form-checkbox{background-color:#007aff}.theme-blue label.label-radio input[type=checkbox]:checked~.item-inner,.theme-blue label.label-radio input[type=radio]:checked~.item-inner{background-image:url("data:image/svg+xml;charset=utf-8, ")}.theme-blue .slider-pagination-active{background-color:#007aff}.bg-blue,.button.button-fill.bg-blue,a.bg-blue,.list-block .swipeout-actions-left a.bg-blue,.list-block .swipeout-actions-right a.bg-blue{background-color:#007aff}.border-blue{border-color:#007aff}.color-green{color:#4cd964}.list-block .item-link.list-button.color-green,.tabbar a.active.color-green,a.color-green{color:#4cd964}.label-switch input[type=checkbox]:checked+.checkbox.color-green,.label-switch.color-green input[type=checkbox]:checked+.checkbox{background-color:#4cd964}.color-green.button:not(.button-fill),.color-green.buttons-row .button,.theme-green .button:not(.button-fill){border-color:#4cd964}html:not(.watch-active-state) .color-green.button:not(.button-fill):active,html:not(.watch-active-state) .color-green.buttons-row .button:active,html:not(.watch-active-state) .theme-green .button:not(.button-fill):active,.color-green.button:not(.button-fill).active-state,.color-green.buttons-row .button.active-state,.theme-green .button:not(.button-fill).active-state{background-color:rgba(76,217,100,.15)}.color-green.button:not(.button-fill).active,.color-green.buttons-row .button.active,.theme-green .button:not(.button-fill).active{background-color:#4cd964;color:#fff}.theme-green .button.button-fill,.button.button-fill.color-green{background:#4cd964;color:#fff}.color-green i.icon,.theme-green i.icon,i.icon.color-green,i.icon.theme-green{color:#4cd964}i.icon-next.color-green,i.icon-next.theme-green,.theme-green i.icon-next{background-image:url("data:image/svg+xml;charset=utf-8,")}i.icon-prev.color-green,i.icon-prev.theme-green,.theme-green i.icon-prev{background-image:url("data:image/svg+xml;charset=utf-8,")}i.icon-back.color-green,i.icon-back.theme-green,.theme-green i.icon-back{background-image:url("data:image/svg+xml;charset=utf-8,")}i.icon-bars.color-green,i.icon-bars.theme-green,.theme-green i.icon-bars{background-image:url("data:image/svg+xml;charset=utf-8,")}@media all and (-webkit-max-device-pixel-ratio:1),(max-resolution:120dpi){i.icon-bars.color-green,i.icon-bars.theme-green,.theme-green i.icon-bars{background-image:url("data:image/svg+xml;charset=utf-8,")}}.theme-green a,.theme-green .item-link.list-button{color:#4cd964}.theme-green .tabbar a,.tabbar.theme-green a{color:inherit}.theme-green .tabbar a.active,.tabbar.theme-green a.active{color:#4cd964}.theme-green .range-slider input[type=range]::-webkit-slider-thumb:before,.range-slider.theme-green input[type=range]::-webkit-slider-thumb:before{background-color:#4cd964}.theme-green label.label-checkbox input[type=checkbox]:checked+.item-media i.icon-form-checkbox,.theme-green label.label-checkbox input[type=radio]:checked+.item-media i.icon-form-checkbox{background-color:#4cd964}.theme-green label.label-radio input[type=checkbox]:checked~.item-inner,.theme-green label.label-radio input[type=radio]:checked~.item-inner{background-image:url("data:image/svg+xml;charset=utf-8, ")}.theme-green .slider-pagination-active{background-color:#4cd964}.bg-green,.button.button-fill.bg-green,a.bg-green,.list-block .swipeout-actions-left a.bg-green,.list-block .swipeout-actions-right a.bg-green{background-color:#4cd964}.border-green{border-color:#4cd964}.color-red{color:#ff3b30}.list-block .item-link.list-button.color-red,.tabbar a.active.color-red,a.color-red{color:#ff3b30}.label-switch input[type=checkbox]:checked+.checkbox.color-red,.label-switch.color-red input[type=checkbox]:checked+.checkbox{background-color:#ff3b30}.color-red.button:not(.button-fill),.color-red.buttons-row .button,.theme-red .button:not(.button-fill){border-color:#ff3b30}html:not(.watch-active-state) .color-red.button:not(.button-fill):active,html:not(.watch-active-state) .color-red.buttons-row .button:active,html:not(.watch-active-state) .theme-red .button:not(.button-fill):active,.color-red.button:not(.button-fill).active-state,.color-red.buttons-row .button.active-state,.theme-red .button:not(.button-fill).active-state{background-color:rgba(255,59,48,.15)}.color-red.button:not(.button-fill).active,.color-red.buttons-row .button.active,.theme-red .button:not(.button-fill).active{background-color:#ff3b30;color:#fff}.theme-red .button.button-fill,.button.button-fill.color-red{background:#ff3b30;color:#fff}.color-red i.icon,.theme-red i.icon,i.icon.color-red,i.icon.theme-red{color:#ff3b30}i.icon-next.color-red,i.icon-next.theme-red,.theme-red i.icon-next{background-image:url("data:image/svg+xml;charset=utf-8,")}i.icon-prev.color-red,i.icon-prev.theme-red,.theme-red i.icon-prev{background-image:url("data:image/svg+xml;charset=utf-8,")}i.icon-back.color-red,i.icon-back.theme-red,.theme-red i.icon-back{background-image:url("data:image/svg+xml;charset=utf-8,")}i.icon-bars.color-red,i.icon-bars.theme-red,.theme-red i.icon-bars{background-image:url("data:image/svg+xml;charset=utf-8,")}@media all and (-webkit-max-device-pixel-ratio:1),(max-resolution:120dpi){i.icon-bars.color-red,i.icon-bars.theme-red,.theme-red i.icon-bars{background-image:url("data:image/svg+xml;charset=utf-8,")}}.theme-red a,.theme-red .item-link.list-button{color:#ff3b30}.theme-red .tabbar a,.tabbar.theme-red a{color:inherit}.theme-red .tabbar a.active,.tabbar.theme-red a.active{color:#ff3b30}.theme-red .range-slider input[type=range]::-webkit-slider-thumb:before,.range-slider.theme-red input[type=range]::-webkit-slider-thumb:before{background-color:#ff3b30}.theme-red label.label-checkbox input[type=checkbox]:checked+.item-media i.icon-form-checkbox,.theme-red label.label-checkbox input[type=radio]:checked+.item-media i.icon-form-checkbox{background-color:#ff3b30}.theme-red label.label-radio input[type=checkbox]:checked~.item-inner,.theme-red label.label-radio input[type=radio]:checked~.item-inner{background-image:url("data:image/svg+xml;charset=utf-8, ")}.theme-red .slider-pagination-active{background-color:#ff3b30}.bg-red,.button.button-fill.bg-red,a.bg-red,.list-block .swipeout-actions-left a.bg-red,.list-block .swipeout-actions-right a.bg-red{background-color:#ff3b30}.border-red{border-color:#ff3b30} \ No newline at end of file diff --git a/www/css/framework7.rtl.css b/www/css/framework7.rtl.css new file mode 100755 index 0000000..befdf18 --- /dev/null +++ b/www/css/framework7.rtl.css @@ -0,0 +1,427 @@ +/*============= + Framework 7 RTL Additions +=============*/ +html { + direction: rtl; +} +/* === Lists === */ +.list-block ul ul { + padding-left: 0; + padding-right: 45px; +} +.list-block .item-content { + padding-left: 0; + padding-right: 15px; +} +.list-block .item-inner { + padding-right: 0; + padding-left: 15px; +} +.list-block .item-after { + margin-left: 0; + margin-right: 5px; +} +.list-block .item-media i + i, +.list-block .item-media i + img { + margin-left: 0; + margin-right: 5px; +} +.list-block .item-media + .item-inner { + margin-left: 0; + margin-right: 15px; +} +.list-block .item-link .item-inner { + padding-right: 0; + padding-left: 35px; + background-position: 15px center; + background-image: url("data:image/svg+xml;charset=utf-8,"); +} +.list-block.media-list .item-link .item-inner, +.list-block li.media-item .item-link .item-inner { + padding-right: 0; + padding-left: 15px; +} +.list-block.media-list .item-link .item-title-row, +.list-block li.media-item .item-link .item-title-row { + padding-right: 0; + padding-left: 20px; + background-position: center left; + background-image: url("data:image/svg+xml;charset=utf-8,"); +} +.list-block .sortable-handler { + right: auto; + left: 0; +} +.list-block.sortable-opened .item-inner, +.list-block.sortable-opened .item-link .item-inner { + padding-right: 0; + padding-left: 35px; +} +.list-block.sortable-opened .item-link .item-inner, +.list-block.sortable-opened .item-link .item-title-row { + background-image: none; +} +.list-block .swipeout-actions-left, +.list-block .swipeout-actions-right { + direction: ltr; +} +/* === Toolbars === */ +.navbar a.link i + span, +.toolbar a.link i + span, +.navbar a.link i + i, +.toolbar a.link i + i, +.navbar a.link span + i, +.toolbar a.link span + i, +.navbar a.link span + span, +.toolbar a.link span + span { + margin-left: 0; + margin-right: 7px; +} +.navbar .left a + a, +.navbar .right a + a { + margin-left: 0; + margin-right: 15px; +} +.navbar .left { + margin-right: 0px; + margin-left: 10px; +} +.navbar .right { + margin-left: 0px; + margin-right: 10px; +} +.navbar .right:first-child { + right: auto; + left: 8px; +} +/* === Forms === */ +.list-block input[type="text"], +.list-block input[type="password"], +.list-block input[type="email"], +.list-block input[type="tel"], +.list-block input[type="url"], +.list-block input[type="date"], +.list-block input[type="datetime-local"], +.list-block input[type="number"], +.list-block select, +.list-block textarea { + padding-left: 0; + padding-right: 5px; +} +.buttons-row .button:first-child { + border-radius: 0 5px 5px 0; + border-left: none; +} +.buttons-row .button:last-child { + border-radius: 5px 0 0 5px; + border-left-width: 1px; + border-left-style: solid; +} +.buttons-row .button.button-round:first-child { + border-radius: 0 27px 27px 0; +} +.buttons-row .button.button-round:last-child { + border-radius: 27px 0 0 27px; +} +.label-switch input[type="checkbox"] + .checkbox:before { + left: auto; + right: 2px; +} +.label-switch input[type="checkbox"] + .checkbox:after { + right: 2px; + left: auto; + -webkit-transform: translate3d(0, 0, 0); + -ms-transform: translate3d(0, 0, 0); + transform: translate3d(0, 0, 0); +} +.label-switch input[type="checkbox"]:checked + .checkbox:after { + left: auto; + right: 22px; +} +.range-slider { + padding-left: 0; + padding-right: 0; + margin-left: 0; + padding-right: 3px; + padding-left: 3px; + margin-right: -1px; +} +.range-slider input[type="range"]:after { + left: auto; + right: -5px; +} +.range-slider input[type="range"]::-webkit-slider-thumb:after { + left: auto; + right: 0; +} +.range-slider input[type="range"]::-webkit-slider-thumb:before { + right: auto; + left: 100%; +} +label.label-radio input[type="checkbox"] ~ .item-inner, +label.label-radio input[type="radio"] ~ .item-inner { + padding-left: 35px; + padding-right: 0; +} +label.label-radio input[type="checkbox"]:checked ~ .item-inner, +label.label-radio input[type="radio"]:checked ~ .item-inner { + background-position: 15px center; +} +/* === Search Bar === */ +.searchbar input[type="search"] { + background-position: right center; + background-position: -webkit-calc(100% - 8px) center; + background-position: calc(100% - 8px) center; +} +.searchbar .searchbar-clear { + right: auto; + left: 0; +} +.searchbar.searchbar-active .searchbar-cancel { + margin-left: 0; + margin-right: 8px; +} +/* === Message Bar === */ +.messagebar .link + textarea { + margin-left: 0; + margin-right: 8px; +} +.messagebar textarea + .link { + margin-left: 0; + margin-right: 8px; +} +/* === Modals === */ +.modal-button:first-child { + border-radius: 0 0 7px 0; + border-right: none; +} +.modal-button:last-child { + border-right: 1px solid #b5b5b5; + border-radius: 0 0 0 7px; +} +.modal-button:first-child:last-child { + border-radius: 0 0 7px 7px; +} +/* === Content Block === */ +.content-block-inner { + margin-left: 0; + margin-right: -15px; +} +/* === Pages === */ +.page-on-left { + -webkit-transform: translate3d(20%, 0, 0); + -ms-transform: translate3d(20%, 0, 0); + transform: translate3d(20%, 0, 0); +} +.page-on-right { + -webkit-transform: translate3d(-100%, 0, 0); + -ms-transform: translate3d(-100%, 0, 0); + transform: translate3d(-100%, 0, 0); +} +@-webkit-keyframes pageFromRightToCenter { + from { + -webkit-box-shadow: none; + box-shadow: none; + -webkit-transform: translate3d(-100%, 0, 0); + } + to { + -webkit-box-shadow: 0 0 12px rgba(0, 0, 0, 0.5); + box-shadow: 0 0 12px rgba(0, 0, 0, 0.5); + -webkit-transform: translate3d(0, 0, 0); + } +} +@-webkit-keyframes pageFromCenterToRight { + from { + -webkit-box-shadow: 0 0 12px rgba(0, 0, 0, 0.5); + box-shadow: 0 0 12px rgba(0, 0, 0, 0.5); + -webkit-transform: translate3d(0, 0, 0); + } + to { + -webkit-box-shadow: none; + box-shadow: none; + -webkit-transform: translate3d(-100%, 0, 0); + } +} +@keyframes pageFromRightToCenter { + from { + -webkit-box-shadow: none; + box-shadow: none; + transform: translate3d(-100%, 0, 0); + } + to { + -webkit-box-shadow: 0 0 12px rgba(0, 0, 0, 0.5); + box-shadow: 0 0 12px rgba(0, 0, 0, 0.5); + transform: translate3d(0, 0, 0); + } +} +@keyframes pageFromCenterToRight { + from { + -webkit-box-shadow: 0 0 12px rgba(0, 0, 0, 0.5); + box-shadow: 0 0 12px rgba(0, 0, 0, 0.5); + transform: translate3d(0, 0, 0); + } + to { + -webkit-box-shadow: none; + box-shadow: none; + transform: translate3d(100%, 0, 0); + } +} +@-webkit-keyframes pageFromCenterToLeft { + from { + opacity: 1; + -webkit-transform: translate3d(0, 0, 0); + } + to { + opacity: 0.9; + -webkit-transform: translate3d(20%, 0, 0); + } +} +@-webkit-keyframes pageFromLeftToCenter { + from { + opacity: 0.9; + -webkit-transform: translate3d(20%, 0, 0); + } + to { + opacity: 1; + -webkit-transform: translate3d(0, 0, 0); + } +} +@keyframes pageFromCenterToLeft { + from { + opacity: 1; + transform: translate3d(0, 0, 0); + } + to { + opacity: 0.9; + transform: translate3d(20%, 0, 0); + } +} +@keyframes pageFromLeftToCenter { + from { + opacity: 0.9; + transform: translate3d(20%, 0, 0); + } + to { + opacity: 1; + transform: translate3d(0, 0, 0); + } +} +@-webkit-keyframes pageFromRightToCenterDegrade { + from { + -webkit-transform: translate3d(-100%, 0, 0); + } + to { + -webkit-transform: translate3d(0, 0, 0); + } +} +@-webkit-keyframes pageFromCenterToRightDegrade { + from { + -webkit-transform: translate3d(0, 0, 0); + } + to { + -webkit-transform: translate3d(-100%, 0, 0); + } +} +@keyframes pageFromRightToCenterDegrade { + from { + transform: translate3d(-100%, 0, 0); + } + to { + transform: translate3d(0, 0, 0); + } +} +@keyframes pageFromCenterToRightDegrade { + from { + transform: translate3d(0, 0, 0); + } + to { + transform: translate3d(-100%, 0, 0); + } +} +/* === Messages === */ +.message-received { + -ms-flex-item-align: end; + -webkit-align-self: flex-end; + align-self: flex-end; + -webkit-box-align: end; + -ms-flex-align: end; + -webkit-align-items: flex-end; + align-items: flex-end; +} +.message-sent { + -ms-flex-item-align: start; + -webkit-align-self: flex-start; + align-self: flex-start; + -webkit-box-align: start; + -ms-flex-align: start; + -webkit-align-items: flex-start; + align-items: flex-start; +} +/* === Back Icons === */ +i.icon.icon-back { + background-image: url("data:image/svg+xml;charset=utf-8,"); +} +i.icon-back.color-gray, +i.icon-back.theme-gray, +.theme-gray i.icon-back { + background-image: url("data:image/svg+xml;charset=utf-8,"); +} +i.icon-back.color-white, +i.icon-back.theme-white, +.theme-white i.icon-back { + background-image: url("data:image/svg+xml;charset=utf-8,"); +} +i.icon-back.color-black, +i.icon-back.theme-black, +.theme-black i.icon-back { + background-image: url("data:image/svg+xml;charset=utf-8,"); +} +i.icon-back.color-lightblue, +i.icon-back.theme-lightblue, +.theme-lightblue i.icon-back { + background-image: url("data:image/svg+xml;charset=utf-8,"); +} +i.icon-back.color-yellow, +i.icon-back.theme-yellow, +.theme-yellow i.icon-back { + background-image: url("data:image/svg+xml;charset=utf-8,"); +} +i.icon-back.color-orange, +i.icon-back.theme-orange, +.theme-orange i.icon-back { + background-image: url("data:image/svg+xml;charset=utf-8,"); +} +i.icon-back.color-pink, +i.icon-back.theme-pink, +.theme-pink i.icon-back { + background-image: url("data:image/svg+xml;charset=utf-8,"); +} +i.icon-back.color-blue, +i.icon-back.theme-blue, +.theme-blue i.icon-back { + background-image: url("data:image/svg+xml;charset=utf-8,"); +} +i.icon-back.color-green, +i.icon-back.theme-green, +.theme-green i.icon-back { + background-image: url("data:image/svg+xml;charset=utf-8,"); +} +i.icon-back.color-red, +i.icon-back.theme-red, +.theme-red i.icon-back { + background-image: url("data:image/svg+xml;charset=utf-8,"); +} +/* === Accordion === */ +.list-block .accordion-toggle .item-inner { + padding-right: 0; + padding-left: 35px; + background-position: 15px center; + background-image: url("data:image/svg+xml;charset=utf-8,"); +} +.list-block .accordion-item-expanded .accordion-toggle .item-inner, +.list-block .accordion-item-expanded > .item-link .item-inner { + background-image: url("data:image/svg+xml;charset=utf-8,"); +} +.list-block .accordion-item ul { + padding-right: 0; +} diff --git a/www/css/framework7.rtl.min.css b/www/css/framework7.rtl.min.css new file mode 100755 index 0000000..bacdc89 --- /dev/null +++ b/www/css/framework7.rtl.min.css @@ -0,0 +1 @@ +html{direction:rtl}.list-block ul ul{padding-left:0;padding-right:45px}.list-block .item-content{padding-left:0;padding-right:15px}.list-block .item-inner{padding-right:0;padding-left:15px}.list-block .item-after{margin-left:0;margin-right:5px}.list-block .item-media i+i,.list-block .item-media i+img{margin-left:0;margin-right:5px}.list-block .item-media+.item-inner{margin-left:0;margin-right:15px}.list-block .item-link .item-inner{padding-right:0;padding-left:35px;background-position:15px center;background-image:url("data:image/svg+xml;charset=utf-8,")}.list-block.media-list .item-link .item-inner,.list-block li.media-item .item-link .item-inner{padding-right:0;padding-left:15px}.list-block.media-list .item-link .item-title-row,.list-block li.media-item .item-link .item-title-row{padding-right:0;padding-left:20px;background-position:center left;background-image:url("data:image/svg+xml;charset=utf-8,")}.list-block .sortable-handler{right:auto;left:0}.list-block.sortable-opened .item-inner,.list-block.sortable-opened .item-link .item-inner{padding-right:0;padding-left:35px}.list-block.sortable-opened .item-link .item-inner,.list-block.sortable-opened .item-link .item-title-row{background-image:none}.list-block .swipeout-actions-left,.list-block .swipeout-actions-right{direction:ltr}.navbar a.link i+span,.toolbar a.link i+span,.navbar a.link i+i,.toolbar a.link i+i,.navbar a.link span+i,.toolbar a.link span+i,.navbar a.link span+span,.toolbar a.link span+span{margin-left:0;margin-right:7px}.navbar .left a+a,.navbar .right a+a{margin-left:0;margin-right:15px}.navbar .left{margin-right:0;margin-left:10px}.navbar .right{margin-left:0;margin-right:10px}.navbar .right:first-child{right:auto;left:8px}.list-block input[type=text],.list-block input[type=password],.list-block input[type=email],.list-block input[type=tel],.list-block input[type=url],.list-block input[type=date],.list-block input[type=datetime-local],.list-block input[type=number],.list-block select,.list-block textarea{padding-left:0;padding-right:5px}.buttons-row .button:first-child{border-radius:0 5px 5px 0;border-left:none}.buttons-row .button:last-child{border-radius:5px 0 0 5px;border-left-width:1px;border-left-style:solid}.buttons-row .button.button-round:first-child{border-radius:0 27px 27px 0}.buttons-row .button.button-round:last-child{border-radius:27px 0 0 27px}.label-switch input[type=checkbox]+.checkbox:before{left:auto;right:2px}.label-switch input[type=checkbox]+.checkbox:after{right:2px;left:auto;-webkit-transform:translate3d(0,0,0);-ms-transform:translate3d(0,0,0);transform:translate3d(0,0,0)}.label-switch input[type=checkbox]:checked+.checkbox:after{left:auto;right:22px}.range-slider{padding-left:0;padding-right:0;margin-left:0;padding-right:3px;padding-left:3px;margin-right:-1px}.range-slider input[type=range]:after{left:auto;right:-5px}.range-slider input[type=range]::-webkit-slider-thumb:after{left:auto;right:0}.range-slider input[type=range]::-webkit-slider-thumb:before{right:auto;left:100%}label.label-radio input[type=checkbox]~.item-inner,label.label-radio input[type=radio]~.item-inner{padding-left:35px;padding-right:0}label.label-radio input[type=checkbox]:checked~.item-inner,label.label-radio input[type=radio]:checked~.item-inner{background-position:15px center}.searchbar input[type=search]{background-position:right center;background-position:-webkit-calc(100% - 8px) center;background-position:calc(100% - 8px) center}.searchbar .searchbar-clear{right:auto;left:0}.searchbar.searchbar-active .searchbar-cancel{margin-left:0;margin-right:8px}.messagebar .link+textarea{margin-left:0;margin-right:8px}.messagebar textarea+.link{margin-left:0;margin-right:8px}.modal-button:first-child{border-radius:0 0 7px 0;border-right:none}.modal-button:last-child{border-right:1px solid #b5b5b5;border-radius:0 0 0 7px}.modal-button:first-child:last-child{border-radius:0 0 7px 7px}.content-block-inner{margin-left:0;margin-right:-15px}.page-on-left{-webkit-transform:translate3d(20%,0,0);-ms-transform:translate3d(20%,0,0);transform:translate3d(20%,0,0)}.page-on-right{-webkit-transform:translate3d(-100%,0,0);-ms-transform:translate3d(-100%,0,0);transform:translate3d(-100%,0,0)}@-webkit-keyframes pageFromRightToCenter{from{-webkit-box-shadow:none;box-shadow:none;-webkit-transform:translate3d(-100%,0,0)}to{-webkit-box-shadow:0 0 12px rgba(0,0,0,.5);box-shadow:0 0 12px rgba(0,0,0,.5);-webkit-transform:translate3d(0,0,0)}}@-webkit-keyframes pageFromCenterToRight{from{-webkit-box-shadow:0 0 12px rgba(0,0,0,.5);box-shadow:0 0 12px rgba(0,0,0,.5);-webkit-transform:translate3d(0,0,0)}to{-webkit-box-shadow:none;box-shadow:none;-webkit-transform:translate3d(-100%,0,0)}}@keyframes pageFromRightToCenter{from{-webkit-box-shadow:none;box-shadow:none;transform:translate3d(-100%,0,0)}to{-webkit-box-shadow:0 0 12px rgba(0,0,0,.5);box-shadow:0 0 12px rgba(0,0,0,.5);transform:translate3d(0,0,0)}}@keyframes pageFromCenterToRight{from{-webkit-box-shadow:0 0 12px rgba(0,0,0,.5);box-shadow:0 0 12px rgba(0,0,0,.5);transform:translate3d(0,0,0)}to{-webkit-box-shadow:none;box-shadow:none;transform:translate3d(100%,0,0)}}@-webkit-keyframes pageFromCenterToLeft{from{opacity:1;-webkit-transform:translate3d(0,0,0)}to{opacity:.9;-webkit-transform:translate3d(20%,0,0)}}@-webkit-keyframes pageFromLeftToCenter{from{opacity:.9;-webkit-transform:translate3d(20%,0,0)}to{opacity:1;-webkit-transform:translate3d(0,0,0)}}@keyframes pageFromCenterToLeft{from{opacity:1;transform:translate3d(0,0,0)}to{opacity:.9;transform:translate3d(20%,0,0)}}@keyframes pageFromLeftToCenter{from{opacity:.9;transform:translate3d(20%,0,0)}to{opacity:1;transform:translate3d(0,0,0)}}@-webkit-keyframes pageFromRightToCenterDegrade{from{-webkit-transform:translate3d(-100%,0,0)}to{-webkit-transform:translate3d(0,0,0)}}@-webkit-keyframes pageFromCenterToRightDegrade{from{-webkit-transform:translate3d(0,0,0)}to{-webkit-transform:translate3d(-100%,0,0)}}@keyframes pageFromRightToCenterDegrade{from{transform:translate3d(-100%,0,0)}to{transform:translate3d(0,0,0)}}@keyframes pageFromCenterToRightDegrade{from{transform:translate3d(0,0,0)}to{transform:translate3d(-100%,0,0)}}.message-received{-ms-flex-item-align:end;-webkit-align-self:flex-end;align-self:flex-end;-webkit-box-align:end;-ms-flex-align:end;-webkit-align-items:flex-end;align-items:flex-end}.message-sent{-ms-flex-item-align:start;-webkit-align-self:flex-start;align-self:flex-start;-webkit-box-align:start;-ms-flex-align:start;-webkit-align-items:flex-start;align-items:flex-start}i.icon.icon-back{background-image:url("data:image/svg+xml;charset=utf-8,")}i.icon-back.color-gray,i.icon-back.theme-gray,.theme-gray i.icon-back{background-image:url("data:image/svg+xml;charset=utf-8,")}i.icon-back.color-white,i.icon-back.theme-white,.theme-white i.icon-back{background-image:url("data:image/svg+xml;charset=utf-8,")}i.icon-back.color-black,i.icon-back.theme-black,.theme-black i.icon-back{background-image:url("data:image/svg+xml;charset=utf-8,")}i.icon-back.color-lightblue,i.icon-back.theme-lightblue,.theme-lightblue i.icon-back{background-image:url("data:image/svg+xml;charset=utf-8,")}i.icon-back.color-yellow,i.icon-back.theme-yellow,.theme-yellow i.icon-back{background-image:url("data:image/svg+xml;charset=utf-8,")}i.icon-back.color-orange,i.icon-back.theme-orange,.theme-orange i.icon-back{background-image:url("data:image/svg+xml;charset=utf-8,")}i.icon-back.color-pink,i.icon-back.theme-pink,.theme-pink i.icon-back{background-image:url("data:image/svg+xml;charset=utf-8,")}i.icon-back.color-blue,i.icon-back.theme-blue,.theme-blue i.icon-back{background-image:url("data:image/svg+xml;charset=utf-8,")}i.icon-back.color-green,i.icon-back.theme-green,.theme-green i.icon-back{background-image:url("data:image/svg+xml;charset=utf-8,")}i.icon-back.color-red,i.icon-back.theme-red,.theme-red i.icon-back{background-image:url("data:image/svg+xml;charset=utf-8,")}.list-block .accordion-toggle .item-inner{padding-right:0;padding-left:35px;background-position:15px center;background-image:url("data:image/svg+xml;charset=utf-8,")}.list-block .accordion-item-expanded .accordion-toggle .item-inner,.list-block .accordion-item-expanded>.item-link .item-inner{background-image:url("data:image/svg+xml;charset=utf-8,")}.list-block .accordion-item ul{padding-right:0} \ No newline at end of file diff --git a/www/css/framework7.themes.css b/www/css/framework7.themes.css new file mode 100755 index 0000000..e2a9e72 --- /dev/null +++ b/www/css/framework7.themes.css @@ -0,0 +1,279 @@ +/*========================== +Framework7 Layouts Themes +==========================*/ +.layout-dark .navbar, +.navbar.layout-dark { + border-bottom-color: #333333; + background-color: #131313; + color: #ffffff; +} +.layout-dark .toolbar, +.toolbar.layout-dark { + border-top-color: #333333; + background-color: #131313; + color: #ffffff; +} +.layout-dark .photo-browser .navbar, +.photo-browser.layout-dark .navbar, +.layout-dark .view[data-page="photo-browser-slides"] .navbar, +.view[data-page="photo-browser-slides"].layout-dark .navbar, +.layout-dark .photo-browser .toolbar, +.photo-browser.layout-dark .toolbar, +.layout-dark .view[data-page="photo-browser-slides"] .toolbar, +.view[data-page="photo-browser-slides"].layout-dark .toolbar { + background: rgba(19, 19, 19, 0.95); +} +.layout-dark .tabbar a:not(.active) { + color: #ffffff; +} +.layout-dark .page, +.layout-dark .login-screen-content, +.page.layout-dark, +.layout-dark .panel, +.panel.layout-dark { + background-color: #222426; + color: #dddddd; +} +.layout-dark .content-block-title { + color: #ffffff; +} +.layout-dark .content-block, +.content-block.layout-dark { + color: #bbbbbb; +} +.layout-dark .content-block-inner { + background: #1c1d1f; + color: #dddddd; + border-color: #393939; +} +.layout-dark .list-block ul, +.list-block.layout-dark ul { + background: #1c1d1f; + border-color: #393939; +} +.layout-dark .list-block.inset ul, +.list-block.layout-dark.inset ul { + background: #1c1d1f; +} +.layout-dark .list-block.notifications > ul, +.list-block.layout-dark.notifications > ul { + background: none; +} +.layout-dark .popover, +.popover.layout-dark { + background: rgba(0, 0, 0, 0.8); +} +.layout-dark .popover .popover-angle:after, +.popover.layout-dark .popover-angle:after { + background: rgba(0, 0, 0, 0.8); +} +.layout-dark .popover .list-block ul, +.popover.layout-dark .list-block ul { + background: none; +} +.layout-dark .actions-popover .list-block ul { + border-color: #393939; +} +.layout-dark .actions-popover .actions-popover-label { + border-bottom-color: #393939; +} +.layout-dark li.sorting { + background-color: #29292f; +} +.layout-dark .swipeout-actions-left a, +.layout-dark .swipeout-actions-right a { + background-color: #444444; +} +.layout-dark .item-inner, +.layout-dark .list-block ul ul li:last-child .item-inner { + border-color: #393939; +} +.layout-dark .item-after { + color: #bbbbbb; +} +html:not(.watch-active-state) .layout-dark .item-link:active, +html:not(.watch-active-state) .layout-dark label.label-checkbox:active, +html:not(.watch-active-state) .layout-dark label.label-radio:active, +.layout-dark .item-link.active-state, +.layout-dark label.label-checkbox.active-state, +.layout-dark label.label-radio.active-state { + background-color: #29292f; +} +.layout-dark .item-link.list-button { + border-bottom-color: #393939; +} +.layout-dark .list-block-label { + color: #bbbbbb; +} +.layout-dark .item-divider, +.layout-dark .list-group-title { + background: #1a1a1a; + color: #bbbbbb; + border-top-color: #393939; +} +.layout-dark .searchbar { + background: #333333; + border-bottom-color: #333333; +} +.layout-dark .list-block input[type="text"], +.list-block.layout-dark input[type="text"], +.layout-dark .list-block input[type="password"], +.list-block.layout-dark input[type="password"], +.layout-dark .list-block input[type="email"], +.list-block.layout-dark input[type="email"], +.layout-dark .list-block input[type="tel"], +.list-block.layout-dark input[type="tel"], +.layout-dark .list-block input[type="url"], +.list-block.layout-dark input[type="url"], +.layout-dark .list-block input[type="date"], +.list-block.layout-dark input[type="date"], +.layout-dark .list-block input[type="datetime-local"], +.list-block.layout-dark input[type="datetime-local"], +.layout-dark .list-block input[type="number"], +.list-block.layout-dark input[type="number"], +.layout-dark .list-block select, +.list-block.layout-dark select, +.layout-dark .list-block textarea, +.list-block.layout-dark textarea { + color: #ffffff; +} +.layout-dark .label-switch .checkbox { + background-color: #393939; +} +.layout-dark .label-switch .checkbox:before { + background-color: #1c1d1f; +} +.layout-dark .range-slider input[type="range"]:after { + background: #1c1d1f; +} +/* === White layout === */ +.layout-white .navbar, +.navbar.layout-white { + border-bottom-color: #dddddd; + background-color: #ffffff; + color: #000000; +} +.layout-white .toolbar, +.toolbar.layout-white { + border-top-color: #dddddd; + background-color: #ffffff; + color: #000000; +} +.layout-white .photo-browser .navbar, +.photo-browser.layout-white .navbar, +.layout-white .view[data-page="photo-browser-slides"] .navbar, +.view[data-page="photo-browser-slides"].layout-white .navbar, +.layout-white .photo-browser .toolbar, +.photo-browser.layout-white .toolbar, +.layout-white .view[data-page="photo-browser-slides"] .toolbar, +.view[data-page="photo-browser-slides"].layout-white .toolbar { + background: rgba(255, 255, 255, 0.95); +} +.layout-white .tabbar a:not(.active) { + color: #777777; +} +.layout-white .page, +.layout-white .login-screen-content, +.page.layout-white, +.layout-white .panel, +.panel.layout-white { + background-color: #ffffff; + color: #000000; +} +.layout-white .content-block-title { + color: #777777; +} +.layout-white .content-block, +.content-block.layout-white { + color: #777777; +} +.layout-white .content-block-inner { + background: #fafafa; + color: #000000; + border-color: #dddddd; +} +.layout-white .list-block ul, +.list-block.layout-white ul { + background: #ffffff; + border-color: #dddddd; +} +.layout-white .list-block.inset ul, +.list-block.layout-white.inset ul { + background: #fafafa; +} +.layout-white .list-block.notifications > ul, +.list-block.layout-white.notifications > ul { + background: none; +} +.layout-white .popover-inner > .list-block ul { + background: none; +} +.layout-white li.sorting { + background-color: #eeeeee; +} +.layout-white .swipeout-actions-left a, +.layout-white .swipeout-actions-right a { + background-color: #c7c7cc; +} +.layout-white .item-inner, +.layout-white .list-block ul ul li:last-child .item-inner { + border-color: #dddddd; +} +.layout-white .item-after { + color: #8e8e93; +} +html:not(.watch-active-state) .layout-white .item-link:active, +html:not(.watch-active-state) .layout-white label.label-checkbox:active, +html:not(.watch-active-state) .layout-white label.label-radio:active, +.layout-white .item-link.active-state, +.layout-white label.label-checkbox.active-state, +.layout-white label.label-radio.active-state { + background-color: #eeeeee; +} +.layout-white .item-link.list-button { + border-bottom-color: #dddddd; +} +.layout-white .list-block-label { + color: #777777; +} +.layout-white .item-divider, +.layout-white .list-group-title { + background: #f7f7f7; + color: #777777; + border-top-color: #dddddd; +} +.layout-white .searchbar { + background: #c9c9ce; + border-bottom-color: #b4b4b4; +} +.layout-white .list-block input[type="text"], +.list-block.layout-white input[type="text"], +.layout-white .list-block input[type="password"], +.list-block.layout-white input[type="password"], +.layout-white .list-block input[type="email"], +.list-block.layout-white input[type="email"], +.layout-white .list-block input[type="tel"], +.list-block.layout-white input[type="tel"], +.layout-white .list-block input[type="url"], +.list-block.layout-white input[type="url"], +.layout-white .list-block input[type="date"], +.list-block.layout-white input[type="date"], +.layout-white .list-block input[type="datetime-local"], +.list-block.layout-white input[type="datetime-local"], +.layout-white .list-block input[type="number"], +.list-block.layout-white input[type="number"], +.layout-white .list-block select, +.list-block.layout-white select, +.layout-white .list-block textarea, +.list-block.layout-white textarea { + color: #777777; +} +.layout-white .label-switch .checkbox { + background-color: #e5e5e5; +} +.layout-white .label-switch .checkbox:before { + background-color: #ffffff; +} +.layout-white .range-slider input[type="range"]:after { + background: #ffffff; +} diff --git a/www/css/framework7.themes.min.css b/www/css/framework7.themes.min.css new file mode 100755 index 0000000..197376d --- /dev/null +++ b/www/css/framework7.themes.min.css @@ -0,0 +1 @@ +.layout-dark .navbar,.navbar.layout-dark{border-bottom-color:#333;background-color:#131313;color:#fff}.layout-dark .toolbar,.toolbar.layout-dark{border-top-color:#333;background-color:#131313;color:#fff}.layout-dark .photo-browser .navbar,.photo-browser.layout-dark .navbar,.layout-dark .view[data-page=photo-browser-slides] .navbar,.view[data-page=photo-browser-slides].layout-dark .navbar,.layout-dark .photo-browser .toolbar,.photo-browser.layout-dark .toolbar,.layout-dark .view[data-page=photo-browser-slides] .toolbar,.view[data-page=photo-browser-slides].layout-dark .toolbar{background:rgba(19,19,19,.95)}.layout-dark .tabbar a:not(.active){color:#fff}.layout-dark .page,.layout-dark .login-screen-content,.page.layout-dark,.layout-dark .panel,.panel.layout-dark{background-color:#222426;color:#ddd}.layout-dark .content-block-title{color:#fff}.layout-dark .content-block,.content-block.layout-dark{color:#bbb}.layout-dark .content-block-inner{background:#1c1d1f;color:#ddd;border-color:#393939}.layout-dark .list-block ul,.list-block.layout-dark ul{background:#1c1d1f;border-color:#393939}.layout-dark .list-block.inset ul,.list-block.layout-dark.inset ul{background:#1c1d1f}.layout-dark .list-block.notifications>ul,.list-block.layout-dark.notifications>ul{background:0 0}.layout-dark .popover,.popover.layout-dark{background:rgba(0,0,0,.8)}.layout-dark .popover .popover-angle:after,.popover.layout-dark .popover-angle:after{background:rgba(0,0,0,.8)}.layout-dark .popover .list-block ul,.popover.layout-dark .list-block ul{background:0 0}.layout-dark .actions-popover .list-block ul{border-color:#393939}.layout-dark .actions-popover .actions-popover-label{border-bottom-color:#393939}.layout-dark li.sorting{background-color:#29292f}.layout-dark .swipeout-actions-left a,.layout-dark .swipeout-actions-right a{background-color:#444}.layout-dark .item-inner,.layout-dark .list-block ul ul li:last-child .item-inner{border-color:#393939}.layout-dark .item-after{color:#bbb}html:not(.watch-active-state) .layout-dark .item-link:active,html:not(.watch-active-state) .layout-dark label.label-checkbox:active,html:not(.watch-active-state) .layout-dark label.label-radio:active,.layout-dark .item-link.active-state,.layout-dark label.label-checkbox.active-state,.layout-dark label.label-radio.active-state{background-color:#29292f}.layout-dark .item-link.list-button{border-bottom-color:#393939}.layout-dark .list-block-label{color:#bbb}.layout-dark .item-divider,.layout-dark .list-group-title{background:#1a1a1a;color:#bbb;border-top-color:#393939}.layout-dark .searchbar{background:#333;border-bottom-color:#333}.layout-dark .list-block input[type=text],.list-block.layout-dark input[type=text],.layout-dark .list-block input[type=password],.list-block.layout-dark input[type=password],.layout-dark .list-block input[type=email],.list-block.layout-dark input[type=email],.layout-dark .list-block input[type=tel],.list-block.layout-dark input[type=tel],.layout-dark .list-block input[type=url],.list-block.layout-dark input[type=url],.layout-dark .list-block input[type=date],.list-block.layout-dark input[type=date],.layout-dark .list-block input[type=datetime-local],.list-block.layout-dark input[type=datetime-local],.layout-dark .list-block input[type=number],.list-block.layout-dark input[type=number],.layout-dark .list-block select,.list-block.layout-dark select,.layout-dark .list-block textarea,.list-block.layout-dark textarea{color:#fff}.layout-dark .label-switch .checkbox{background-color:#393939}.layout-dark .label-switch .checkbox:before{background-color:#1c1d1f}.layout-dark .range-slider input[type=range]:after{background:#1c1d1f}.layout-white .navbar,.navbar.layout-white{border-bottom-color:#ddd;background-color:#fff;color:#000}.layout-white .toolbar,.toolbar.layout-white{border-top-color:#ddd;background-color:#fff;color:#000}.layout-white .photo-browser .navbar,.photo-browser.layout-white .navbar,.layout-white .view[data-page=photo-browser-slides] .navbar,.view[data-page=photo-browser-slides].layout-white .navbar,.layout-white .photo-browser .toolbar,.photo-browser.layout-white .toolbar,.layout-white .view[data-page=photo-browser-slides] .toolbar,.view[data-page=photo-browser-slides].layout-white .toolbar{background:rgba(255,255,255,.95)}.layout-white .tabbar a:not(.active){color:#777}.layout-white .page,.layout-white .login-screen-content,.page.layout-white,.layout-white .panel,.panel.layout-white{background-color:#fff;color:#000}.layout-white .content-block-title{color:#777}.layout-white .content-block,.content-block.layout-white{color:#777}.layout-white .content-block-inner{background:#fafafa;color:#000;border-color:#ddd}.layout-white .list-block ul,.list-block.layout-white ul{background:#fff;border-color:#ddd}.layout-white .list-block.inset ul,.list-block.layout-white.inset ul{background:#fafafa}.layout-white .list-block.notifications>ul,.list-block.layout-white.notifications>ul{background:0 0}.layout-white .popover-inner>.list-block ul{background:0 0}.layout-white li.sorting{background-color:#eee}.layout-white .swipeout-actions-left a,.layout-white .swipeout-actions-right a{background-color:#c7c7cc}.layout-white .item-inner,.layout-white .list-block ul ul li:last-child .item-inner{border-color:#ddd}.layout-white .item-after{color:#8e8e93}html:not(.watch-active-state) .layout-white .item-link:active,html:not(.watch-active-state) .layout-white label.label-checkbox:active,html:not(.watch-active-state) .layout-white label.label-radio:active,.layout-white .item-link.active-state,.layout-white label.label-checkbox.active-state,.layout-white label.label-radio.active-state{background-color:#eee}.layout-white .item-link.list-button{border-bottom-color:#ddd}.layout-white .list-block-label{color:#777}.layout-white .item-divider,.layout-white .list-group-title{background:#f7f7f7;color:#777;border-top-color:#ddd}.layout-white .searchbar{background:#c9c9ce;border-bottom-color:#b4b4b4}.layout-white .list-block input[type=text],.list-block.layout-white input[type=text],.layout-white .list-block input[type=password],.list-block.layout-white input[type=password],.layout-white .list-block input[type=email],.list-block.layout-white input[type=email],.layout-white .list-block input[type=tel],.list-block.layout-white input[type=tel],.layout-white .list-block input[type=url],.list-block.layout-white input[type=url],.layout-white .list-block input[type=date],.list-block.layout-white input[type=date],.layout-white .list-block input[type=datetime-local],.list-block.layout-white input[type=datetime-local],.layout-white .list-block input[type=number],.list-block.layout-white input[type=number],.layout-white .list-block select,.list-block.layout-white select,.layout-white .list-block textarea,.list-block.layout-white textarea{color:#777}.layout-white .label-switch .checkbox{background-color:#e5e5e5}.layout-white .label-switch .checkbox:before{background-color:#fff}.layout-white .range-slider input[type=range]:after{background:#fff} \ No newline at end of file diff --git a/www/css/images/ajax-loader.gif b/www/css/images/ajax-loader.gif deleted file mode 100755 index fd1a189..0000000 Binary files a/www/css/images/ajax-loader.gif and /dev/null differ diff --git a/www/css/images/icons-18-black.png b/www/css/images/icons-18-black.png deleted file mode 100755 index 7916463..0000000 Binary files a/www/css/images/icons-18-black.png and /dev/null differ diff --git a/www/css/images/icons-18-white.png b/www/css/images/icons-18-white.png deleted file mode 100755 index 3419b81..0000000 Binary files a/www/css/images/icons-18-white.png and /dev/null differ diff --git a/www/css/images/icons-36-black.png b/www/css/images/icons-36-black.png deleted file mode 100755 index 043bfcd..0000000 Binary files a/www/css/images/icons-36-black.png and /dev/null differ diff --git a/www/css/images/icons-36-white.png b/www/css/images/icons-36-white.png deleted file mode 100755 index 12455c9..0000000 Binary files a/www/css/images/icons-36-white.png and /dev/null differ diff --git a/www/css/index.css b/www/css/index.css deleted file mode 100755 index 51daa79..0000000 --- a/www/css/index.css +++ /dev/null @@ -1,115 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -* { - -webkit-tap-highlight-color: rgba(0,0,0,0); /* make transparent link selection, adjust last value opacity 0 to 1.0 */ -} - -body { - -webkit-touch-callout: none; /* prevent callout to copy image, etc when tap to hold */ - -webkit-text-size-adjust: none; /* prevent webkit from resizing text to fit */ - -webkit-user-select: none; /* prevent copy paste, to allow, change 'none' to 'text' */ - background-color:#E4E4E4; - background-image:linear-gradient(top, #A7A7A7 0%, #E4E4E4 51%); - background-image:-webkit-linear-gradient(top, #A7A7A7 0%, #E4E4E4 51%); - background-image:-ms-linear-gradient(top, #A7A7A7 0%, #E4E4E4 51%); - background-image:-webkit-gradient( - linear, - left top, - left bottom, - color-stop(0, #A7A7A7), - color-stop(0.51, #E4E4E4) - ); - background-attachment:fixed; - font-family:'HelveticaNeue-Light', 'HelveticaNeue', Helvetica, Arial, sans-serif; - font-size:12px; - height:100%; - margin:0px; - padding:0px; - text-transform:uppercase; - width:100%; -} - -/* Portrait layout (default) */ -.app { - background:url(../img/logo.png) no-repeat center top; /* 170px x 200px */ - position:absolute; /* position in the center of the screen */ - left:50%; - top:50%; - height:50px; /* text area height */ - width:225px; /* text area width */ - text-align:center; - padding:180px 0px 0px 0px; /* image height is 200px (bottom 20px are overlapped with text) */ - margin:-115px 0px 0px -112px; /* offset vertical: half of image height and text area height */ - /* offset horizontal: half of text area width */ -} - -/* Landscape layout (with min-width) */ -@media screen and (min-aspect-ratio: 1/1) and (min-width:400px) { - .app { - background-position:left center; - padding:75px 0px 75px 170px; /* padding-top + padding-bottom + text area = image height */ - margin:-90px 0px 0px -198px; /* offset vertical: half of image height */ - /* offset horizontal: half of image width and text area width */ - } -} - -h1 { - font-size:24px; - font-weight:normal; - margin:0px; - overflow:visible; - padding:0px; - text-align:center; -} - -.event { - border-radius:4px; - -webkit-border-radius:4px; - color:#FFFFFF; - font-size:12px; - margin:0px 30px; - padding:2px 0px; -} - -.event.listening { - background-color:#333333; - display:block; -} - -.event.received { - background-color:#4B946A; - display:none; -} - -@keyframes fade { - from { opacity: 1.0; } - 50% { opacity: 0.4; } - to { opacity: 1.0; } -} - -@-webkit-keyframes fade { - from { opacity: 1.0; } - 50% { opacity: 0.4; } - to { opacity: 1.0; } -} - -.blink { - animation:fade 3000ms infinite; - -webkit-animation:fade 3000ms infinite; -} diff --git a/www/css/my-app.css b/www/css/my-app.css new file mode 100755 index 0000000..a2ced65 --- /dev/null +++ b/www/css/my-app.css @@ -0,0 +1,18 @@ +.popover { + width: 270px; +} + +.content-block ul { + padding-left: 25px; + list-style: square; +} + +.list-block .content-block ul { + padding-left: 25px; + list-style: square; +} + +.content-block-inner ul { + padding-left: 25px; + list-style: square; +} \ No newline at end of file diff --git a/www/fonts/FontAwesome.otf b/www/fonts/FontAwesome.otf new file mode 100644 index 0000000..81c9ad9 Binary files /dev/null and b/www/fonts/FontAwesome.otf differ diff --git a/www/fonts/fontawesome-webfont.eot b/www/fonts/fontawesome-webfont.eot new file mode 100644 index 0000000..84677bc Binary files /dev/null and b/www/fonts/fontawesome-webfont.eot differ diff --git a/www/fonts/fontawesome-webfont.svg b/www/fonts/fontawesome-webfont.svg new file mode 100644 index 0000000..d907b25 --- /dev/null +++ b/www/fonts/fontawesome-webfont.svg @@ -0,0 +1,520 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/www/fonts/fontawesome-webfont.ttf b/www/fonts/fontawesome-webfont.ttf new file mode 100644 index 0000000..96a3639 Binary files /dev/null and b/www/fonts/fontawesome-webfont.ttf differ diff --git a/www/fonts/fontawesome-webfont.woff b/www/fonts/fontawesome-webfont.woff new file mode 100644 index 0000000..628b6a5 Binary files /dev/null and b/www/fonts/fontawesome-webfont.woff differ diff --git a/www/hf/5w/1.html b/www/hf/5w/1.html new file mode 100755 index 0000000..8c9bf5c --- /dev/null +++ b/www/hf/5w/1.html @@ -0,0 +1,49 @@ + +
+
+
+
+

This is the wheel that those desperate to lose weight fast always drive on first. Even though it's not the answer to helping you obtain that celebrity-perfect look by itself, aerobic exercise is still a valuable wheel.

+
+
The Facts
+
+
+

Without aerobic training, you'll lack the adequate stamina to push your muscles beyond what they're capable of doing so they will become stronger and shape up faster. Without aerobic training you'll have to watch calories religiously, your body wont be as efficient at flushing out the toxins that resistance training leaves behind, such as lactic acid. Add the fact that aerobic training improves the quality of your sleep and its pretty easy to see how it fits into the bigger picture.

+
+
+
Foundation
+
+
+

The term aerobic means with oxygen. Aerobic activity is any physical activity done for an extended period of time that forces your cardiovascular system (heart, lungs and blood vessels) to increase the amount of oxygen and blood circulating through your body, so that you're benefiting even at rest. Your body doesn't care how you make that happen, although choosing activities that work larger muscle groups, typically your legs, is more effective at getting that job done.

+

To count as aerobic exercise, any activity you choose has to keep your heart beating around sixty-five percent of your maximum heart rate for at least 20 minutes or more.

+

Your maximum heart rate, or MHR, is the highest number of times your heart can contract in one minute. To find yours, all you do is subtract your age from the number 220. That means if you're 35 years old, your MHR is 220 minus 35 (or 185 beats per minute). This is an important number to know, as it can help you know how hard you should be exercising.

+

To get the most from aerobic exercise, you need to keep your pulse between a range of 60% and 70% of your MHR to burn fat. For the 35 year old that equates to a pulse of between 111 to 130 per minute. If you increase the intensity you're working at to between 70% and 80% this will improve your aerobic fitness, the pulse rate will then be at 130 to 148 beats per minute.

+

Try to do some form of aerobic activity 3 times a week, for at least 20 minutes. More is better; less might be suitable if you have a favourable metabolism. If you can do more than 20 minutes, then do it: every minute past the twenty burns additional body fat as fuel. After that magic number (20 minutes), you've exhausted your body's glycogen (carbohydrate) stores, which it uses as fuel when you workout. From a fat-burning standpoint, if you can exercise beyond 20 minutes, your body has no choice but to use more of its own stored body fat for energy instead.

+
+
+
Your Options
+
+
+

There are hundreds of things you could do to get an aerobic workout besides using the typical gym machines (stationary bikes, treadmills, cross-trainers and rowing machines) and the obvious outside choices (biking, jogging, running, swimming and walking). If you're not into any of these don't write off exercise, as playing a sport, dancing, ice-skating skiing, kayaking, rollerblading, even house cleaning and gardening can be aerobic if done a certain way at a certain intensity!

+
+
+
Use everything in one workout
+
+
+

If you want a workout your body will never get used to (or forgive you for), try flip-flopping between your cardio choices at the gym (stationary bike, treadmill, step routine, jump rope, stair climber or rower) every three minutes. Make the first minute a warm-up, push yourself around 65% of your MHR for the second minute (or on a scale 1 to 10 in effort, around a 6), then go for it in the last minute (85% or level 8 effort).

+
+
+
Know when too much is too much
+
+
+

Pushing yourself higher within your target heart rate zone will definitely reap more results, but you need to know when too much is too much. If you can't speak a full sentence while exercising without being winded, then you're most likely pushing yourself to the far end of your target heart rate zone. On the other hand, if you're able to carry on a full conversation, then you're probably working at a level thats below your target heart rate zone.

+
+
+
+
+
\ No newline at end of file diff --git a/www/hf/5w/2.html b/www/hf/5w/2.html new file mode 100755 index 0000000..75d4c45 --- /dev/null +++ b/www/hf/5w/2.html @@ -0,0 +1,83 @@ + +
+
+
+
+

Whether you're brand new to this whole exercise experience, or fitness is old hat, you probably still know what resistance training entails, or know it by one of its many other names: strength training, weight training, pumping iron, anaerobic exercise, etc.

+

This is the chapter you've either been waiting for or dreading. If you're a male and breathing, you may start to get a bit fired up by now. If you're a female, and fairly new to fitness, you might have doubts, or even visions of morphing into a 300-pound monster with arms like ham hocks as soon as you start bench pressing. Relax, its not like that.

+
+
The Facts
+
+
+

Resistance training is not just about building muscle that will help you look great. Its also a prehab for preventing injuries and making sure you feel great. Resistance training also turns back the clock by reversing many factors that naturally occur in the ageing process.

+

Reshaping your muscles can even help you stay leaner. Aerobic exercise burns more calories per minute and gets your metabolism into overdrive faster than resistance training. However, after you've finished weight training, your body has to use extra calories throughout the day just to sustain the new, leaner body you've built for yourself. Using weights effectively will keep your metabolism turned on all day long.

+

So think of muscle as a fat burning friend who's with you all day long. The more muscle you have, the higher your Basal Metabolic Rate (BMR). What's a BMR, and why should you care about it? Your BMR is another important number: it is the number of calories you burn every day to keep your body functioning, your heart beating, your lungs breathing, and so on. It's your BMR that accounts for almost 75% of all of the calories you burn daily, with the other 25% being burned from all your daily physical activities.

+

Building more muscle though resistance training means you'll have extra muscle fibres consuming more energy. Even when you're just sitting there looking good but not doing a thing. In fact, every pound of muscle you add to your frame burns an additional 30 to 50 calories per day. Substitute 5 pounds of muscle for 5 pounds of fat and not only will you naturally be more aesthetically in shape, but you'll burn and extra 150-250 calories a day doing absolutely nothing at all.

+
+
+
Foundation
+
+
+

You already know that Aerobic activity is any activity that increases your pulse for an extended period of time, causing your heart and lungs to work harder to get more oxygen to your muscles. Resistance training, Anaerobic exercise is any activity done in short, intense bursts that works your body without requiring much oxygen.

+

Resistance training means working one muscle (or a group of muscles) against some form of resistance so that your muscles have no choice but to break down from fatigue and stress. Do it the right way, and those beaten-down muscles have no choice but to rebuild themselves so they're stronger for the next time you decide to put them through the paces.

+

No matter what tool you use to stress your muscles barbells, dumbbells, weight machines, stretch cords, medicine balls, your own body weight if you provide enough resistance to fatigue your muscles by making them repeat a movement for a given number of repetitions, you'll achieve the same goal.

+

Heres how it works: Lifting the weight one time is called a repetition (rep). A group of repetitions performed without stopping is called a set. The number of reps you should do to fatigue your muscles depends on your goals. Most experts stick with using a weight you can lift, raise, or pull 8 to 15 times. If you're looking to noticeably strengthen your muscles, then using a heavier weight that allows you do to between 6 and 10 reps is better. If improving muscle tone is your goal then 10 to 15 reps is more suited and lastly muscle endurance 15 to 20 reps.

+
+
+
Your Options
+
+
+

The choices you have with resistance training are virtually limitless there are literally hundreds of exercises that will prevent your muscles (or you) from being bored.

+

The best resistance training workout leaves no stone unturned. It's a program that targets every major muscle group in your body, not just the ones you're concerned with. These 13 exercises are for overall muscle-development. There are countless spin-off movements from these core exercises. Learn these, master them effectively, and then variations can be added.

+
    +
  • For your legs and butt → The squat and the lunge
  • +
  • For your chest → The chest press and the chest fly
  • +
  • For your back → The pulldown and the row
  • +
  • For your shoulders → The shoulder press and the raise
  • +
  • For your triceps → The pressdown and the extension
  • +
  • For your biceps → The curl
  • +
  • For your abs → The crunch and the reverse crunch
  • +
+
+
+
Focus
+
+
+

If resistance training has never worked for you and you use perfect form (perfect technique during an exercise), Id say that you're using weights that are too light for you. If you're not using a weight heavy enough to fully fatigue during each set, you'll never push them enough to make them want, and need, to improve themselves. For example, if an exercise asks you do 12-15 repetitions, you need to select a weight that you can complete only 12-15 reps with while keeping good form. If you could have easily eked out three more reps before quitting, your muscles were never really challenged enough to improve themselves, making the entire set less effective than it should and certainly could have been. Once you can do more than the required number of reps, then its time to raise the weight slightly.

+
+
+
Frequently asked questions
+
+
    +
  • +
    +
    Won't weights make me big?
    +
    +
    +
    +

    If you're a guy, you can probably skip over this question! If you're a woman You wont get big! As a rule, thats because most women are simply not genetically capable of ballooning up from strength training alone. Your body has 10% of the testosterone that the average male has and look at how hard it is for a man to add muscle. Even they cant do it without lifting heavy weights, eating steak for breakfast, milkshakes all day, and doing sets of 4 to 6 reps! I think you get my point!

    +

    If you're worried about adding a pound of muscle, it's estimated that the space of a pound of muscle is about 22% less than a pound of fat. That means adding 5 pounds of muscle and losing 5 pounds of fat would actually make you look smaller. I'd say thats a fair trade off. Finally, muscle isn't created by weights. It's created by food proteins to be more precise. You have to eat quality and a quantity of food above and beyond what you burn, and break the muscle down in the gym so they need to repair, plus eat every 3 to 4 hours, and get adequate rest so that they recover... Do you see what I mean? Besides, it's not an overnight process, so you could always back off or even stop.

    +
    +
    +
  • +
  • +
    +
    Can I burn fat from a specific area by doing specific exercise?
    +
    +
    +
    +

    Welcome to the biggest con in fitness and exercise. It may be the quick fix you're wishing for, but spot reduction (the popular term for it) is one of the biggest exercise lies out there. It's impossible to lose weight in one particular area by lifting weights or doing exercises that target only that area. You body burns fat in a genetically predetermined patter over which you have no control. But there's good news: As you start driving on all four wheels, you'll begin to burn fat gradually from all over your body, including your specific wish list of areas. Typically the last place you store fat is the first area you'll see a noticeable difference. Unfortunately, that also means the first place you started storing fat is usually the last area to get lean: men around the waist; women around the hips/butt.

    +

    Until you reduce the body fat above or around your muscles through cardiovascular exercise, resistance training, eating right, and adequate rest you'll never make those muscles or perfect set of abs visible.

    +
    +
    +
  • +
+
+
+
+
\ No newline at end of file diff --git a/www/hf/5w/3.html b/www/hf/5w/3.html new file mode 100755 index 0000000..a668d53 --- /dev/null +++ b/www/hf/5w/3.html @@ -0,0 +1,71 @@ + +
+
+
+
+

Eating right isn't really all that complicated. It's a choice, and a conscious, daily choice at that. Making the right choice on a regular basis, and sticking with your choice over time, will get you there.

+
+
The Facts
+
+
+

Choose to eat the right way and you won't just improve every possible aspect of your health, but you'll make the job of reshaping yourself through exercising that much easier. The time-starved amongst us are at the mercy of convenience eating. You are your own food-police deciding the type of foods you eat; I can't monitor that all the time because I'm only with you for 1 hour at the gym. The other 23 hours are your responsibility.

+

Ingest the wrong foods and you can easily prevent your system from operating at its most efficient level especially if you're active. Eat less than enough to counterbalance the extra nutritional requirements your body needs to maintain itself and you'll store the same excess fat you're trying to get rid of because your body thinks it's going to starve, and so it hold onto every calorie in anticipation of not getting any more.

+

Regardless of what your goals are from exercise, following a few basic nutrition rules of the thumb will make this 3rd wheel worth a lot more to your body than you ever thought it could be.

+
+
+
Foundation
+
+
+

If you're trying to lose weight, calories may represent a guilty pleasure or a great evil to your brain. But to your body, calories are just energy units to be used as fuel.

+

You wouldn't give your car more fuel than it really needed, would you? If you did, all the fuel would just overflow and make a mess, right? That's exactly what happens with your body: when you eat more calories than it needs, the result is overflow to every place your body holds excess calories (i.e. fat). It doesn't know you don't want to gain weight, it just sees all those extra calories and assumes you want to store them as energy for later on.

+

Stand up and jump an inch or two off the ground. Anything move? For every pound of stored body fat you felt jiggle, all you're really looking at is roughly 3500 calories. Just 3500 units of fuel your body thinks it needs to hold onto because you haven't given it any reason to think otherwise. But don't worry. Now that you know why you're storing calories, it's going to be easier to convince your body to use them up and stop storing then unnecessarily.

+

Eating a low-fat, high-fibre diet along with doing aerobic exercise to burn calories (and resistance training to maintain lean mass and to naturally boost your metabolism) is the most effective way to lose fat without holding you back from building muscle tissue. Try not to use the word diet because it makes people feel like they're walking a tightrope: one tiny misstep (doughnut!) and they assume that all their hopes and dreams will come crashing down. Diets are usually temporary by nature, leading to eventual failure, whereas an on-going healthy nutritional intake that is a lifestyle will last a lifetime.

+
+
+
Calories
+
+
+

How many calories you really need to eat every day depends on who you are. Some people can maintain their bodyweight on 1400 calories a day, whereas others have metabolisms like a hummingbird: eat suet at every meal and never put on an ounce of fat. It all depends on everything from your metabolism and level of activity to your age, heritage, gender, what you're putting in your mouth, and when you're putting it in your mouth.

+

As a starting point the most common method used by dieticians and other health-care professionals is the Harris-Benedict formula.

+

Men: 66 + (6.3 x wt in lbs) + (12.9 x height in inches) - (6.8 x age in years)

+

Women: 655 + (4.3 x wt in lbs) + (4.7 x height in inches) - (4.7 x age in years)

+

The number you are left with is your estimated basal metabolic rate expenditure (or BMR): the minimum number of calories your body needs just to keep you going. Getting to school, typing up that report, racing around trying to find a decent place to eat these are all extra actions that increase your BMR by around 20%. For example a 35 year old woman who weighs 140lbs and stands 5 feet 6 inches would have a BMR of approx. 1402 calories a day. Multiply this by 120% and all she really needs to eat every day is 1683 calories. If your goal is to trim down, its just a matter of eating less and/or burning extra calories through exercise to lose weight.

+
+
+
Carbohydrates, Proteins and Fats
+
+
+

No matter how many calories you need each day, its important to make sure they don't all come from the same place. Carbohydrates, proteins, and fats are all broken down at different speeds in the body to create a continual flow of caloric energy.

+

Most nutritionists recommend dividing up your daily Carbohydrates, proteins, and fats using a ratio of 5:3:2 (respectively). This translates into getting 50% of your daily calories from carbs, 30% from protein, and 20% from fat. Using the example above, the woman that requires 1683 calories to maintain her weight would have a nutritional profile as follows to maintain her weight:

+
    +
  • Carbohydrate 841.5 cal. (50%)
  • +
  • Protein 504.9 cal. (30%)
  • +
  • Fat 336.6 cal. (20%)
  • +
+

To make this number crunching easier to calculate for everyday living we can equate these numbers further into grams and workout how much to allow for each meal.

+
    +
  • Carbohydrate 210g (4 cal/g)
  • +
  • Protein 126g (4 cal/g)
  • +
  • Fat 37g (9 cal/g)
  • +
+

Its healthier to eat all day long, breaking-up your caloric intake into smaller increments (5 to 6 meals) instead of the standard 3, you also help curb binges, and also keep blood sugar levels even throughout the day. Larger meals raise your blood sugar, which can trigger an increase in the release of insulin within the bloodstream. Remember, little and often. The easiest way to accomplish 5 or even 6 meals per day is to moderate the traditional 3 meals in size and snack in between. One snack mid-morning and one mid-afternoon.

+

For the example above based on 1683 calories, each of the 5 meals would average 336 calories, carbs 42 grams, protein 25 grams, fats 7 grams. It would be unrealistic to expect an exact equality between meals but use these figures as a guide.

+

There is so much good information on nutrition: what's good, what's not, nutrition plans, when to eat, when to stop, etc. I'll leave that for you to decide whats a wise choice and what's an unwise choice (cue another 30 minutes cycling!).

+

These are my nutritional guidelines:

+
    +
  • Most caloric meal - breakfast; the least - dinner. Drink 4-pints of water a day. Chicken, tuna (packed in water), eggs, wholemeal bread and rice. Plenty of fruit and veg. Protein shakes are convenient as are smoothies for snacks.
  • +
  • Read all labels, avoid sugar and salt. After 4pm drop pasta, rice, potato and bread. Obtain carbs from veg and salads for evening meal.
  • +
  • Protein sources Lean mince beef, chicken, fish, soya, eggs
  • +
  • Carbs Wholemeal bread and rice, porridge. Plenty of fruit (such as apples, bananas, oranges, satsumas, grapes, pears, strawberries, peaches, apricots) and vegetables (carrots, broccoli, spinach, beans)
  • +
  • Healthy fats: vegetable oils, oily fish, nuts, omega 3 enriched eggs, olive oil olives, seeds.
  • +
+
+
+
+
+
\ No newline at end of file diff --git a/www/hf/5w/4.html b/www/hf/5w/4.html new file mode 100755 index 0000000..71d3d1b --- /dev/null +++ b/www/hf/5w/4.html @@ -0,0 +1,24 @@ + +
+
+
+
+

It sounds like the easiest wheel of the five to drive on, but it's actually the one that most frequently gets either too much or too little use. Give your body too much rest and it'll look like it. Give it too little and you increase your odds of not only injuring yourself, but never seeing the body-shaping results you're shooting for.

+
+
The Facts
+
+
+

Whether you hate or love exercise, your body interprets all that time you've spent pulling, pushing, and sweating on gym equipment as on thing: stress. Thats why the time you give your muscles to rest and recover in between each workout can make a huge difference in the kind of results you end up seeing for all of your hard work.

+

Rest is also important between sets at the gym, 30 to 180 seconds ideally, depending on the intensity of the exercise and the routine. This downtime gives your body time to drain the muscles of any leftover lactic acid (a by-product of exercise that gives that fun, burning sensation towards the end of a set!).

+

Resting between workouts or lack of it is one of the biggest mistakes most overzealous exercisers make. Lifting weight causes microscopic breaks or tears inside your muscle fibres, breaks that trick your body into thinking its about go to war. These fibres react by rebuilding their legions to be stronger and firmer for the next battle, that is, if you give them an armistice to start recruiting. After exhausting a muscle with resistance training, it needs at least 48-72 hours of recovery time in order to heal from all that microscopic damage. If you work out before that time you risk injury, you wont be able to lift as much weight which will hold you back from using enough resistance to make your muscles stronger. Muscle strength is directly relative to muscle size. Increase your strength and the muscles have to respond by increasing in volume.

+

A decent nights sleep. Most healthy adults need an average of 7 to 9 hours of sleep a night. Whatever your cycle is, find it, stick with it.

+
+
+
+
+
\ No newline at end of file diff --git a/www/hf/5w/5.html b/www/hf/5w/5.html new file mode 100755 index 0000000..5e9811f --- /dev/null +++ b/www/hf/5w/5.html @@ -0,0 +1,23 @@ + +
+
+
+
+
+

What makes one person lie on a sofa eating pizza, chips and cake, while another may be up at 6am pounding the streets trying to beat a personal best? Why are some people more motivated than others? Not just at sport, exercise or at work, but in life?

+

Each of us has motivations, goals and inspirational figures that shape what we do, what we think, how we react. Some of these goals are verbalised, debated and shared, some are deep rooted and personal. It all starts in the mind.

+

Life is a mind game. All your aspirations are played out in your head. All your relationships are shaped in your head. Your mind dictates whether you fulfil your potential or live your life dreaming. It's about attitude. The good thing in life is that you can choose your attitude, you cant always choose or change the circumstances in your arena, but you can always choose or change your attitude.

+

Sport and exercise provide a framework for personal development. It appeals to people because it meets a basic, instinctive need to want to take on challenges and succeed, and encourages people to develop skills along the way.

+

It's inappropriate to talk about a healthy lifestyle, fitness regime or weight training program as a sacrifice. What top performers do is make choices. We all have choices to make, its all about attitude.

+

If you want to lose weight or gain some definition in your arms you can visualise how you want to look after you've succeeded. So many people on diets (temporary punishment!) don't actually see themselves how they want to be, getting into certain clothes. If you visualise the result in advance it'll help on days when you lose your motivation. But what is visualisation? It's the process of seeing yourself doing what it is you need to do whether running a winning race, throwing a record breaking javelin distance or lifting your heaviest weight. What the mind imagines usually creates a capacity for the body to do it.

+

What a person believes can determine the outcome. There is no doubt that in sport as in many other areas of life, there is such a thing as the self-fulfilling prophecy. If you limit your beliefs, you limit your potential to achieve.

+
+
+
+
+
\ No newline at end of file diff --git a/www/hf/aerobic.html b/www/hf/aerobic.html new file mode 100755 index 0000000..0e6aa98 --- /dev/null +++ b/www/hf/aerobic.html @@ -0,0 +1,68 @@ + +
+
+
+
What is Aerobic Training?
+
+
+

Also known as cardiovascular exercise, it is any sustained, rhythmic activity that involves large muscle groups. Aerobic exercise makes the lungs work harder as the body’s need for oxygen is increased.

+

What are the benefits of aerobic exercise?

+

There are numerous benefits for health and general well being to be gained from regular cardiovascular exercise:

+
    +
  • Increased energy levels
  • +
  • Reduced stress and improved mental health (due to the release of endorphins in the brain)
  • +
  • Increased heart and lung efficiency
  • +
  • Reduced blood pressure, resting heart rate and risk of stroke or heart attack
  • +
+
+
+
Does aerobic exercise aid weight loss?
+
+
+

Weight is lost by creating a calorie deficit, burning more calories than you take in, so undertaking activities that burn large amounts of calories is an excellent accompaniment to a calorie controlled diet to help shift those unwanted pounds.

+

For example, half an hour of low paced jogging can burn around 300 calories. This can make a substantial contribution towards achieving the necessary calorie deficit to lose weight, or alternatively it can earn you a bar of chocolate that you feel less guilty about eating.

+
+
+
Aerobic Exercises: At home
+
+
+

It is not essential to join a gym or to go out in the middle of winter to get an aerobic workout. There are a number of exercises that you can do in the privacy of your own home.

+

The cheapest options being putting on your favourite CD and dancing around the living room or giving the house a vigorous clean.

+

There is also an ever increasing array of affordable home fitness products available, such as steps, skipping ropes (remember to put your breakables a safe distance away), dance mats that you can use with your games console and exercise videos so that you can workout with your favourite celebrity.

+
+
+
Aerobic Exercises: Outdoor
+
+
+

Even taking a few extra brisk walks can be enough to improve fitness and receive the benefits of aerobic exercise, just as long as you are working hard enough that your heart rate is increased and you are breathing faster.

+

Running, jogging or going out for a bike ride when the weather’s nice are all good forms of aerobic exercise.

+

Pretty much any exercise is better than no exercise at all, however, team sports are often less effective for developing aerobic fitness as while they involve periods where large amounts of energy is expended, these are often surrounded by periods of activity where the heart rate is allowed to drop.

+

The real benefits of aerobic exercise come from constant movement.

+
+
+
Aerobic Exercises: At TDA
+
+
+

Your local gym will provide a wide variety of aerobic options, such as treadmills, cross trainers, exercise bikes, stair masters, rowing and ski machines so that you can just switch on and get started with your workout. It can be a good idea to diversify between different machines and different speeds/levels of resistance as your body can get used to a certain routine and after a number of sessions the same routine will not work your heart and lungs as much as it once did.

+

For those who prefer to work out as part of a group, many gyms provide classes, such as various forms of dance, body pump, body combat and step aerobics with a trained instructor to ensure that you get the most out of your workout.

+

If you have access to a pool, swimming is also a very effective cardiovascular activity. As it is very low impact it is often suitable for people who have had injuries or problems with muscles or joints.

+
+
+
How often to train?
+
+
+

For good cardiovascular fitness it is generally recommended to exercise 3 to 5 times a week and for 30-60 minutes, not including warming up at the start and cooling down at the end.

+

The main thing is to ensure that your heart and lungs are worked hard enough and for long enough to gain the benefits of aerobic exercise but not so long that you run the risk of injury. To check whether you are working out at the correct intensity, you should be out of breath but still capable of speaking.

+

It is important to start slowly. If you have been inactive for some time, don’t throw on your trainers and set off on a ten mile run.

+

If a half an hour session feels like too much, start with 10 minute sessions for the first week then increase that to 15 or 20 minute sessions the next week and so on until you feel comfortable exercising for longer.

+

Make sure that you listen to your body. It’s ok for muscles to be tired, but if they or your joints start to feel sore or breathing becomes uncomfortable slow down or stop to ensure that you are in a fit state for your next session.

+
+
+
+
+
\ No newline at end of file diff --git a/www/hf/at/testing.html b/www/hf/at/testing.html new file mode 100755 index 0000000..465f410 --- /dev/null +++ b/www/hf/at/testing.html @@ -0,0 +1,31 @@ + +
+
+
+
Test
+
+
+

This test is designed to measure your cardiovascular endurance

+

Using a 12 inch high bench (or a similar sized stair in your house), step on and off for 3 minutes.

+

Step up with one foot and then the other. Step down with one foot followed by the other foot.

+

Try to maintain a steady four beat cycle. It's easy to maintain if you say "up, up, down, down".

+

Go at a steady and consistent pace.

+

At the end of 3 minutes, remain standing and immediately check your heart rate by taking your pulse…

+
+
+
Results
+
+
+

The Aerobic zone 70-80%: Training in this zone will develop your cardiovascular system. The body's ability to transport oxygen to, and carbon dioxide away from, the working muscles can be developed and improved. As you become fitter and stronger from training in this zone it will be possible to run some of your long weekend runs at up to 75%, so getting the benefits of some fat burning and improved aerobic capacity.

+

The Anaerobic Zone 80-90%: Training in this zone will develop your lactic acid system. In this zone, your individual anaerobic threshold (AT) is found - sometimes referred to the point of deflection (POD). During these heart rates, the amount of fat being utilised as the main source of energy is greatly reduced and glycogen stored in the muscle is predominantly used. One of the by-products of burning this glycogen is lactic acid. There is a point at which the body can no longer remove the lactic acid from the working muscles quickly enough. This is your anaerobic threshold (AT). Through the correct training, it is possible to delay the AT by being able to increase your ability to deal with the lactic acid for a longer period of time or by pushing the AT higher.

+

The Red-line Zone 90-100%: Training in this zone will only be possible for short periods. It effectively trains your fast twitch muscle fibres and helps to develop speed. This zone is reserved for interval running and only the very fit are able to train effectively within this zone.

+
+
+
+
+
\ No newline at end of file diff --git a/www/hf/at/zones.html b/www/hf/at/zones.html new file mode 100755 index 0000000..dae9dc0 --- /dev/null +++ b/www/hf/at/zones.html @@ -0,0 +1,21 @@ + +
+
+
+
+
+ +

The Energy Efficient zone 60-70%: Training within this zone develops basic endurance and aerobic capacity. All easy recovery running should be completed at a maximum of 70%. Another advantage to running in this zone is that while you are happily fat burning you may lose weight and you will be allowing your muscles to re-energise with glycogen, which has been expended during those faster paced workouts.

+

The Aerobic zone 70-80%: Training in this zone will develop your cardiovascular system. The body's ability to transport oxygen to, and carbon dioxide away from, the working muscles can be developed and improved. As you become fitter and stronger from training in this zone it will be possible to run some of your long weekend runs at up to 75%, so getting the benefits of some fat burning and improved aerobic capacity.

+

The Anaerobic Zone 80-90%: Training in this zone will develop your lactic acid system. In this zone, your individual anaerobic threshold (AT) is found - sometimes referred to the point of deflection (POD). During these heart rates, the amount of fat being utilised as the main source of energy is greatly reduced and glycogen stored in the muscle is predominantly used. One of the by-products of burning this glycogen is lactic acid. There is a point at which the body can no longer remove the lactic acid from the working muscles quickly enough. This is your anaerobic threshold (AT). Through the correct training, it is possible to delay the AT by being able to increase your ability to deal with the lactic acid for a longer period of time or by pushing the AT higher.

+

The Red-line Zone 90-100%: Training in this zone will only be possible for short periods. It effectively trains your fast twitch muscle fibres and helps to develop speed. This zone is reserved for interval running and only the very fit are able to train effectively within this zone.

+
+
+
+
+
\ No newline at end of file diff --git a/www/hf/cc/exercises.html b/www/hf/cc/exercises.html new file mode 100755 index 0000000..0fbdeae --- /dev/null +++ b/www/hf/cc/exercises.html @@ -0,0 +1,77 @@ + +
+
+
+
The Next Steps
+
+
+

Having learned to recruit the TA and MF muscles correctly in various positions, which can take anything from one session to one month or more, it is time to move onto simple core stability exercises. These exercises may also involve the oblique muscles, other lumbar muscles and gluteals to assist the TA and MF in maintaining the lumbar spine in a stable neutral position.

+

Lying leg lift stabilisation

+
    +
  • Lying on your back with your knees bent
  • +
  • Ensure your back is in neutral
  • +
  • Place your hands on your hips for biofeedback
  • +
  • Breathe in and relax
  • +
  • Breathe out and, as you do so, perform the abdominal hollowing or zipping-up action
  • +
  • Once you have established some TA tension, slowly slide your left leg out along the floor until it is straight and then slide it back
  • +
  • Your back should not have moved, and your pelvis should not have tilted as you performed this action
  • +
  • If your back or pelvis moved, you did not achieve the correct stability
  • +
  • Repeat for the other side 10 times each leg
  • +
  • Variations include the same exercise with knee lifts up and knee drops out to the side. Again, the aim is to retain a stable lumbar spine in the neutral position as the legs move.
  • +
  • he waiter's bow
  • +
  • Stand up with good posture, knees soft, lumbar spine in neutral, head up and shoulders back and relaxed
  • +
  • Breathe in and relax
  • +
  • Breathe out and as you do so perform the abdominal hollowing action
  • +
  • Keeping the tension, slowly lean forward from the hips 20° and stop, like a waiter's bow, keeping your back completely straight and long as you lean
  • +
  • Hold the lean position for 10 seconds - you will feel your TA and MF supporting you if you hold the correct position
  • +
  • Keeping the tension and the alignment, slowly return to your start position
  • +
  • Repeat 10 times
  • +
+

These exercises are two examples of learning how to keep the spine in neutral, using slow and controlled static contractions of the trunk stabiliser muscles. Notice how technique is vital and the aim is to build up the time you are able to maintain good stability.

+
+
+
Getting Functional
+
+
+

The ultimate aim of core stability training is to ensure the deep trunk muscles are working correctly to control the lumbar spine during dynamic movements, e.g. lifting a heavy box or running. Therefore, it is important that once you have achieved proficiency of the simple core exercises, you must progress on to achieving stability during more functional movements. Try the following two exercises.

+
+
+
The Lunge
+
+
+
    +
  • Stand with feet hip width apart in front of a mirror
  • +
  • Ensure your lumbar spine is in neutral and your back is tall with your shoulders back and head up
  • +
  • Lunge forward and bend your knee only halfway down
  • +
  • Ensure that your front knee is in line with your toes and your back has remained upright with your lumbar spine in neutral and your hips level
  • +
  • Push back up, initiating the movement by pushing down into the floor with your front foot
  • +
  • The force from your legs should bring you back up quickly and easily to your start position
  • +
  • Your back should have remained totally still and your hips level as you performed the push back
  • +
+

Many people wrongly initiate the up movement by pulling their heads and shoulders back first. This extends the lumbar spine, losing the neutral position. Others have problems keeping their pelvis level while performing the lunge. You must learn to use your deep trunk and gluteal muscles to hold your lumbar spine in neutral and pelvis level as you perform the movement up and down. The movement should only come from the leg muscles.

+
+
+
The Press-Up
+
+
+
    +
  • Start from your knees, even if this means it is easy for your upper body, to learn the correct technique
  • +
  • Your hands should be slightly wider than your shoulders and your head must be in front of your hands
  • +
  • Lift your hips so that there is a straight line from your knees through your pelvis and lower back, through your shoulders and all the way to your head
  • +
  • Ensure your lumbar spine is in neutral, using a mirror or a partner/trainer to help you
  • +
  • To maintain a neutral spine and a straight back during the exercise, the trunk muscles must provide active support
  • +
  • Slowly lower down, bending your arms all the way to the floor. Keep your head still with your neck straight relative to your back
  • +
  • Push up, initiating the movement by pressing down into the floor with your hands
  • +
  • Your back should remain straight and your lumbar spine in neutral throughout the exercise.
  • +
+

These two exercises enable you to learn core stability while performing dynamic movements. By reducing the resistance i.e. doing only half lunges and knee press ups, your are able to focus on the trunk stabilisers and achieving perfect technique rather than working the major muscle groups. The whole essence of core stability training is quality of movement and relaxation. The more you practice, the easier it becomes until you can control your lumbar stability at all times and during complex movements.

+
+
+
+
+
\ No newline at end of file diff --git a/www/hf/cc/sdcore.html b/www/hf/cc/sdcore.html new file mode 100755 index 0000000..2139415 --- /dev/null +++ b/www/hf/cc/sdcore.html @@ -0,0 +1,38 @@ + +
+
+
+
Static Floor Exercises
+
+
+

Plank

+

Hold a straight body position, supported on elbows and toes. Brace the abdominals and maintain a straight body line through feet, hips and head.

+

Side plank

+

Lie on one side, ensuring the top hip is above the bottom hip. Push up until there is a straight body line through feet, hips and head. Keep the elbow under the shoulder. Lower under control and repeat on opposite side.

+

Bridge

+

Lie on the floor with your knees bent and feet flat on the floor. Squeeze your gluteals and then push your hips up until there is a straight line through knee and hip to upper body and shoulders remain on the floor.

+

Superman

+

Kneel on the floor and place your hands below your shoulders and knees below your hips. Extend right leg back and the left arm forward. Maintain a straight body line through extended leg, body and extended arm. Repeat with opposite limbs

+
+
+
Dynamic Floor Exercises
+
+
+

Side lying hip abduction

+

Lie on your side with your top hip above the lower hip. Brace the abdominals and lift the top leg slowly up and down.

+

Oblique crunch

+

Lie on your back with your right ankle resting on your left knee. Right arm is placed on the floor out to the side. Keeping the right shoulder down, curl the left shoulder up to the right knee. Repeat with opposite limbs.

+

Straight leg raise

+

Lie on your back with knees bent. Brace your abdominals and lift your legs up straight in the air to an angle of 45 degrees keeping you back on the ground. Keeping one leg in the air, slowly lower the other down to the floor. Only go as far as you can until you feel the lumbar spine start to move. Keep bracing the abdominals and then lift the leg slowly back up. Repeat with the other leg.

+

Lying windscreen wipers

+

Lie on your back with arms out to the sides. Lift your legs straight up in the air until the hips are at 90 degrees. Keeping your legs straight and maintaining the hip angle, rotate the legs to one side. Go as far as you can keeping your upper back and shoulders on the floor. Bring the legs to a halt, pull them back up to the start position and then over to the other side.

+
+
+
+
+
\ No newline at end of file diff --git a/www/hf/cc/stability.html b/www/hf/cc/stability.html new file mode 100755 index 0000000..792df18 --- /dev/null +++ b/www/hf/cc/stability.html @@ -0,0 +1,57 @@ + +
+
+
+
+

The aim of core stability training is to effectively recruit the trunk musculature and then learn to control the position of the lumbar spine during dynamic movements. The information presented on this page is based on an article written by Raphael Brandon that was first published in Peak Performance.

+
+
The Muscles
+
+
+

The deep trunk muscles, Transversus Abdominis (TA), multifidus (MF), Internal Oblique (IO), paraspinal, pelvic floor, are key to the active support of the lumbar spine. The co-contraction of these muscles produce forces via the "theracolumbar fascia" (TLF) and the "intra-abdominal pressure" (IAP) mechanism which stabilise the lumbar spine, and the paraspinal and MF muscles act directly to resist the forces acting on the lumbar spine.

+

It is not just the recruitment of these deep-trunk muscles, but how they are recruited that is important. Hodges and Richardson (1996) showed that the co-contraction of the TA and MF muscles occurred prior to any movement of the limbs. This suggests that these muscles anticipate dynamic forces that may act on the lumbar spine and stabilise the area prior to any movement. Hodges and Richardson showed that the timing of co-ordination of these muscles was very significant.

+
+
+
Training
+
+
+

Having identified the key muscles and how they act, the next step is to establish how best to train these muscles. As with any type of strength and conditioning training, the training protocol for improving the function of the deep-trunk muscles must be specific to the task required. This specificity of training must take into account the type of contraction, the muscle fibre type and the anatomical position required. By definition, the deep-trunk muscles act as "stabilisers" and are not involved in producing movements, but instead involve static, or isometric, contractions. Furthermore, they must act as stabilisers continuously throughout everyday activities as well as fitness and sport activities, and so require very good endurance of low-level forces. These muscles do not need to be very strong, but they must be correctly coordinated and capable of working continuously. In addition, we want these stabiliser muscles to act by holding the lumbar spine in the neutral position, which is the correct alignment of the pelvis that allows for the natural 'S' curve of the spine. These characteristics underpin the following deep-trunk muscle training program.

+
+
+
The Basics
+
+
+

Core-stability training begins with learning to co-contract the TA and MF muscles effectively as this has been identified as key to the lumbar-support mechanism. To perform the TA and MF co-contraction, you must perform the "abdominal hollowing" technique with the spine in the neutral position.

+

To do this use the following guidelines:

+
    +
  • Start by lying on your back with knees bent
  • +
  • Your lumbar spine should be neither arched up nor flattened against the floor, but aligned normally with a small gap between the floor and your back. This is the "neutral" lumbar position you should learn to achieve
  • +
  • Breathe in deeply and relax all your stomach muscles
  • +
  • Breathe out and, as you do so, draw your lower abdomen inwards as if your belly button is going back towards the floor. Pilates teachers describe this as "zipping up", as if you are fastening up a tight pair of jeans
  • +
  • Hold the contraction for 10 seconds and stay relaxed, allowing yourself to breathe in and out as you hold the tension in your lower stomach area
  • +
  • Repeat 5-10 times
  • +
+

It is vital that you perform this abdominal hollowing exercise correctly otherwise you will not recruit the TA and MF effectively. Bear in mind the following points:

+
    +
  • Visualise the deep abdominal muscles as a corset that wraps round the abdomen
  • +
  • Place one hand above the umbilicus (belly button) and one below
  • +
  • Slowly draw in the lower abdomen, below the umbilicus, without drawing in the upper abdomen
  • +
  • Hold the contraction whilst breathing normally
  • +
  • Aim for a 10 second contraction, repeating it 10 times
  • +
  • Do not let the whole stomach tense up or your upper abdominals bulge outwards, as this means you have cheated by using the large rectus abdominus muscle (the six-pack) instead of TA
  • +
  • Do not brace your TA muscle too hard; just a gentle contraction is enough. Remember it's endurance not max strength your are trying to improve
  • +
  • Do not tilt your pelvis nor flatten your back, as this means you have lost the neutral position you are trying to learn to stabilise
  • +
  • Do not hold your breath, as this means you are not relaxed. You must learn to breathe normally and maintain the co-contraction of TA and MF
  • +
  • Use your fingers for biofeedback on either side of your lower abdomen (below the umbilicus) to feel the tension in the TA muscle
  • +
+

Once you have mastered the abdominal hollowing lying on your back, practice it lying on your front, four-point kneeling, sitting and standing. In each position, get your lumbar spine into neutral before you perform the hollowing movement.

+
+
+
+
+
\ No newline at end of file diff --git a/www/hf/corecond.html b/www/hf/corecond.html new file mode 100755 index 0000000..2d0ddc7 --- /dev/null +++ b/www/hf/corecond.html @@ -0,0 +1,38 @@ + + + \ No newline at end of file diff --git a/www/hf/hf.html b/www/hf/hf.html new file mode 100755 index 0000000..39e45c2 --- /dev/null +++ b/www/hf/hf.html @@ -0,0 +1,18 @@ + +
+
+
+
+
Welcome
+
+

Here is About page!

+
+
+
+
+
\ No newline at end of file diff --git a/www/hf/hfintro.html b/www/hf/hfintro.html new file mode 100755 index 0000000..405aff0 --- /dev/null +++ b/www/hf/hfintro.html @@ -0,0 +1,27 @@ + +
+
+
+
Welcome
+
+
+

Welcome to the TDA Health & Fitness mini-site. Here you will find information on the main aspects of Health and Fitness along with other resources. If you can't find what you want on here, or require further information, please e-mail Mr Hoffmann with suggestions or ideas.

+

Before you start on any fitness training program, remember: if you have any injuries, medical conditions or are not sure about what to do, ask a member of staff or check with your doctor that it's fine for you to train.

+

Warm-ups. You have to do them, read the Warm-Up page first and include one with every workout, run, row, team game, individual event. Make it a habit and it will go along way to help you stay injury-free.

+
+
+
Acknowledgements
+
+

‘G-Force’, the ultimate guide to you best body ever – Gunnar Peterson

+

‘ABSolution’ – Shawn Phillips

+

‘Mind Games’ – Jeff Grout & Sarah Perrin

+

Mr Hoffmann

+
+
+
+
\ No newline at end of file diff --git a/www/hf/hoff5w.html b/www/hf/hoff5w.html new file mode 100755 index 0000000..a5f6945 --- /dev/null +++ b/www/hf/hoff5w.html @@ -0,0 +1,52 @@ + + + \ No newline at end of file diff --git a/www/hf/howdoi.html b/www/hf/howdoi.html new file mode 100755 index 0000000..330df30 --- /dev/null +++ b/www/hf/howdoi.html @@ -0,0 +1,43 @@ + +
+
+
+
I want to burn calories quickly…
+
+
+

Answer: Interval training. It doesn’t matter what you do, run, row, or jog on the spot. If you do these exercises at FULL pace (after a warm up) for 20 seconds, then have a 40 second rest, repeating this for up to 5 minutes, it will burn a huge amount of calories. The good thing about this type of training is that your metabolism is given a jump-start so it keeps burning calories for hours after you have finished.

+
+
+
I want a fast fitness workout…
+
+
+

Answer: Crossfit training. This type of training focuses on strength and endurance training and is scalable to your own fitness and ability level. It also burns lots of calories. For example, a favourite of mine is to do 5 pull-ups, 10 push-ups then 15 bodyweight squats, one after the other, no rest. Each time you complete this its one rep. The idea is that you do as many reps as you can in 10 minutes. If you can’t do the pull-ups then swap them for something like bench-dips or anything you can do.

+
+
+
How do I lose weight?
+
+
+

Answer: Eat sensibly, increase your activity. We all know when the food we eat is a ‘treat’ or something that’s ‘clean’. The difference between the two is our own motivation. If we have a goal or a beach holiday coming up its much easier to be strict with what we eat. The way I look at it is this; its MUCH easier to stay in shape than to GET in shape. Maintenance is the key to a healthy weight, once you get there. Fast answer; walk briskly when you walk, jog up the stairs, bike instead of getting a lift, say no to the second helping, and yes just once a week to treats… you get the picture.

+

So try crossfit and interval training as faster ways to increase your activity. If this is too intense then start with 10 minutes on the cross-trainer or bike. Get into the habit of doing this and you will see a difference in your health.

+
+
+
How do I get bigger?
+
+
+

Answer: Just wait a few months. If you train regularly and eat well you will grow stronger and as a result, bigger. Steer clear of eating junk and sugary foods, they will slow you down and lower your performance generally, compared to a balanced diet.

+
+
+
How do I tone my legs?
+
+
+

Answer: Squats, lunges, running, rowing and eating less fatty foods. Your tone/muscles will show up if the fat under your skin is low enough. The training will promote muscle development and the correct nutrition will create the definition that results in toned legs, or arms, shoulders and stomach. Toning your upper body can be achieved by doing push-ups and stomach crunches as a starting point.

+
+
+
+
+
\ No newline at end of file diff --git a/www/hf/n/classes.html b/www/hf/n/classes.html new file mode 100755 index 0000000..d86cbb8 --- /dev/null +++ b/www/hf/n/classes.html @@ -0,0 +1,54 @@ + +
+
+
+
Carbohydrates
+
+
+

Energy can be stored in the body in the form of carbohydrates and this is particularly important for endurance performers, who may not be able to restock their energy stores adequately while they are competing. Carbohydrates are high in glucose and enter the blood. Excess glucose is stored as glycogen in the liver and muscles. Extra glucose is not wasted, but converted into glycogen or fat and stored.

+
+
+
Proteins
+
+
+

It contributes to the development and growth of hormones and haemoglobin in the blood, both of which are essential for those involved in sport or regular physical activity. Protein is necessary for the growth and repair of body tissues. It is also a relatively minor source of energy (10%).

+
+
+
Fats
+
+
+

There are many forms of fat in the body and it supplies around 70% of our energy requirements. Fat supplies energy (calories) that can either be used immediately or stored for future use. Although fat is the body’s preferred energy source, it also uses energy in the form of stored carbohydrate (glycogen) for intensive burst of energy. If we consume an excessive amount of fat, it is stored in the body tissues and causes us to become overweight. In order to avoid this, dieticians recommend that we should not consume more than ⅓rd of our daily nutritional needs in the form of fat.

+
+
+
Fibre
+
+
+

Dietary fibre comprises the edible parts of plants that are not broken down and absorbed in the small intestine. It does not contain any nutrients. It therefore adds bulk to our food without adding extra kilojoules. Fibre regulates the digestive system.

+
+
+
Minerals
+
+
+

Minerals are required by the body for a variety of functions including the formation of bones & teeth, as essential constituents of body fluids & tissues, components of enzyme systems, and nerve function.

+
+
+
Vitamins
+
+
+

Vitamins are chemical compounds found in the food we eat. Our bodies cannot make vitamins so must take them from our food. Vitamins perform the following functions: aiding growth, increasing resistance to infection, regulating some body functions such as good vision, and helping the metabolism of certain foods.

+
+
+
Water
+
+
+

Water makes up 70% of the human body. It is essential for the correct functioning of virtually all living cells. Water has many functions: it provides the medium in which most reactions in the body occur, it acts as a lubricant for joints and eyes, and it helps regulate body temperature. The amount of water we drink varies from person to person, depending on age, time of year, climatic conditions, diet, the amount of physical activity we do. Dehydration is common amongst athletes, especially in hot climates, or at altitude. As little as a 2% loss of bodyweight can result in impaired responses and performance. Water replacement is essential before, during and after exercise.

+
+
+
+
+
\ No newline at end of file diff --git a/www/hf/n/intro.html b/www/hf/n/intro.html new file mode 100755 index 0000000..cc5f554 --- /dev/null +++ b/www/hf/n/intro.html @@ -0,0 +1,47 @@ + +
+
+
+
+
+

There's SO much information on nutrition that I could fill this app with it! Here's what I'll do:

+
    +
  1. Cover the basics here, and
  2. +
  3. Provide the links for you to do some research for yourself.
  4. +
+

What YOU eat will literally shape your future. It won't be someone else putting food into your mouth. You won't be force fed food you don't want. It will be YOU eating, YOU making choices about what you eat, when you eat, how much you eat. What you eat is what you are. End of story. No myths, no fads, just YOUR choices.

+

teenweightwise.com

+

eatwell.gov.uk/agesandstages/teens

+

The basics…

+

If you want to get the balance of your diet right, use the eatwell plate. The eatwell plate makes healthy eating easier to understand by showing the types and proportions of foods we need to have a healthy and well balanced diet. The eatwell plate shows how much of what you eat should come from each food group. This includes everything you eat during the day, including snacks.

+

So, try to eat:

+
    +
  • Plenty of fruit and vegetables
  • +
  • Plenty of bread, rice, potatoes, pasta and other starchy foods – choose wholegrain varieties whenever you can
  • +
  • Some milk and dairy foods
  • +
  • Some meat, fish, eggs, beans and other non-dairy sources of protein
  • +
  • Just a small amount of foods and drinks high in fat and/or sugar
  • +
  • Look at the eatwell plate to see how much of your food should come from each food group. You don’t need to get the balance right at every meal. But try to get it right over time such as a whole day or week.
  • +
+

Try to choose options that are lower in fat, salt and sugar when you can.

+

The eatwell plate is consistent with the Government’s Eight tips for eating well, published in October 2005, which are:

+
    +
  1. Base your meals on starchy foods
  2. +
  3. Eat lots of fruit and veg
  4. +
  5. Eat more fish
  6. +
  7. Cut down on saturated fat and sugar
  8. +
  9. Try to eat less salt – no more than 6g a day
  10. +
  11. Get active and try to be a healthy weight
  12. +
  13. Drink plenty of water
  14. +
  15. Don’t skip breakfast
  16. +
+
+
+
+
+
\ No newline at end of file diff --git a/www/hf/n/labels.html b/www/hf/n/labels.html new file mode 100755 index 0000000..777fd77 --- /dev/null +++ b/www/hf/n/labels.html @@ -0,0 +1,69 @@ + +
+
+
+
+
+

You're standing in a supermarket aisle looking at two similar products, trying to decide which to choose. You want to make the healthier choice but, as usual, you're in a hurry. Well, help is at hand.

+

A growing number of supermarkets and food manufacturers are using traffic light colours on the labels of some products to help you make your choice.

+

What do the traffic light colours mean?

+

If we want to eat a healthy diet, one of the key things we should be doing is trying to cut down on fat (especially saturated fat), salt and added sugars.

+

Food products with traffic light labels on the front of the pack show you at-a-glance if the food you are thinking about buying has high, medium or low amounts of fat, saturated fat, sugars and salt, helping you get a better balance.

+

In addition to traffic light colours you will also see the number of grams of fat, saturated fat, sugars and salt in what the manufacturer or retailer suggests as a 'serving' of the food.

+

So, if you see a red light on the front of the pack, you know the food is high in something we should be trying to cut down on. It's fine to have the food occasionally, or as a treat, but try to keep an eye on how often you choose these foods, or try eating them in smaller amounts.

+

If you see amber, you know the food isn't high or low in the nutrient, so this is an ok choice most of the time, but you might want to go for green for that nutrient some of the time.

+

Green means the food is low in that nutrient. The more green lights, the healthier the choice.

+

Many of the foods with traffic light colours that you see in the shops will have a mixture of red, amber and greens. So, when you're choosing between similar products, try to go for more greens and ambers, and fewer reds, if you want to make the healthier choice.

+

The traffic light colours will make it easier for you to compare products at-a-glance. The label also tells you how much of each nutrient is in a portion, so if two labels have similar colours you can compare these figures, and choose the one that is lower to make a healthier choice.

+

But remember, it's all about getting the overall balance of our diet right.

+

How do traffic light colours fit into a healthy diet?

+

If you want to choose a healthy diet, you should:

+
    +
  • base your meals on starchy foods such as wholegrain bread, pasta and rice
  • +
  • eat lots of fruit and vegetables, which means try to go for at least five portions of a variety every day
  • +
  • have some protein-rich foods such as meat, fish, pulses, milk and dairy foods
  • +
  • keep foods (and drinks) high in fat, especially saturated fat, sugars or salt to a minimum
  • +
+

Traffic light colours can help you get the balance right by helping you to choose between products and keep a check on the amount of foods high in fat, sugars and salt that you are eating. You can use the signpost labelling to help put you in control, so keep a look out for the colours on the front of food packs.

+

Making the healthy choice isn't always easy – sometimes there seems to be so much to remember. But with traffic light colours you just need to go for as many greens as you can and avoid choosing too many reds. This way you'll know you'll be making a healthier choice.

+

You should also try to remember that although some products may contain a lot of sugars, they can be healthier choices if they contain lots of fruit. You can tell this by checking the ingredients list; the higher up the ingredients list the more fruit there is.

+
+
+
+
+

Check it out

+

Some products you might have thought were healthy choices could qualify for red lights.

+

Try comparing the fat and salt content of your favourite sandwich with other sandwiches. For example, a Waitrose poached salmon and cucumber sandwich qualifies for three green lights. Does your sandwich?

+

What do the different traffic lights look like?

+

Although the traffic light label designs may look different, you can still compare these foods because the companies are all using the Food Standards Agency guidelines. So when, for example, you are deciding between two pizzas, check out the colours to make a healthier choice.

+

Which foods have traffic light colours on them?

+

All of the manufacturers and retailers shown above are using traffic light labelling on some or all of their products, and the Agency is also in discussions with other companies that are considering using it.

+

Awareness of traffic light labelling is also on the increase in the service sector, with train companies such as GNER and Virgin, Roadchef motorway service stations, and shoppers websites such as Mysupermarket.com all using the Agency's recommended approach.

+

The Agency recommends that traffic light colours are used on processed convenience foods such as ready meals, pizzas, sausages, burgers, pies, sandwiches and breakfast cereals.

+

This is because people have told us that they find it difficult to understand the nutritional content of these sorts of foods.

+

When will the traffic light colours be in other supermarkets and in my local shop?

+

The FSA is continuing to encourage as many supermarkets, manufacturers and service providers as possible to use this approach.

+

If you'd like to see them in your supermarket, or on your favourite products, why not contact the supermarket or manufacturer yourself?

+

Please let us know what you think of traffic light labelling by completing our feedback form available at the link below.

+

How can I get more nutritional information?

+

The traffic light colours on the front of food packs are a quick and easy guide, but when you have time, and if you are particularly interested in finding out more, you can still check the back of packs for more information.

+

On the back of some food packs, you will find the nutrition panel, Guideline Daily Amounts information and the ingredients list.

+

Nutrition panel

+

You often see this panel on the back of food packs. It gives the nutritional breakdown of the food.

+

This is the sort of information you might see: the amount of energy, protein, carbohydrates, sugars, fat, dietary fibre and sodium.

+

You can use this information to help you make healthier choices.

+

Guideline Daily Amounts

+

Guideline Daily Amounts (GDAs) were developed by food manufacturers and retailers and you can find out more by visiting the IGD website. IGD is a food and grocery industry research organisation.

+

Ingredients list

+

To get a feel for whether a product is high in a certain ingredient such as fat, salt or added sugars, you might need to look at the ingredients list.

+

Ingredients lists always start with the biggest ingredient first and are listed in descending order of weight at the time they were used to make the food

+
+
+
+
+
\ No newline at end of file diff --git a/www/hf/nutrition.html b/www/hf/nutrition.html new file mode 100755 index 0000000..8033b88 --- /dev/null +++ b/www/hf/nutrition.html @@ -0,0 +1,38 @@ + + + \ No newline at end of file diff --git a/www/hf/resistancet.html b/www/hf/resistancet.html new file mode 100755 index 0000000..676c2aa --- /dev/null +++ b/www/hf/resistancet.html @@ -0,0 +1,92 @@ + + +
+
+
+
+
+

Resistance training is not just about building muscle that will help you look great. Its also a prehab for preventing injuries and making sure you feel great. Resistance training also turns back the clock by reversing many factors that naturally occur in the ageing process.

+

Reshaping your muscles can even help you stay leaner. Aerobic exercise burns more calories per minute and gets your metabolism into overdrive faster than resistance training. However, after you've finished weight training, your body has to use extra calories throughout the day just to sustain the new, leaner body you've built for yourself. Using weights effectively will keep your metabolism going all day long.

+

The Facts

+

Resistance training means working one muscle (or a group of muscles) against some form of resistance so that your muscles have no choice but to break down from fatigue and stress. Do it the right way, and those beaten-down muscles have no choice but to rebuild themselves so they're stronger for the next time you decide to put them through the paces.

+

No matter what tool you use to stress your muscles barbells, dumbbells, weight machines, stretch cords, medicine balls, your own body weight if you provide enough resistance to fatigue your muscles by making them repeat a movement for a given number of repetitions, you'll achieve the same goal.

+

Heres how it works: Lifting the weight one time is called a repetition (rep). A group of repetitions performed without stopping is called a set.

+

The number of reps you should do to fatigue your muscles depends on your goals. Most experts stick with using a weight you can lift, raise, or pull 8 to 15 times.

+
    +
  • For Strength - 6 to 10 reps
  • +
  • For Toning - 10 to 15 reps
  • +
  • For Endurance - 15 to 20 reps
  • +
+

…but remember, whatever amount of reps you are doing the weight needs to be heavy enough to make your muscles work. There is no point in doing a weight that's too easy, as your muscles won't be overloaded and forced to react or grow.

+
+
+ +
+
+
\ No newline at end of file diff --git a/www/hf/rt/1w.html b/www/hf/rt/1w.html new file mode 100755 index 0000000..9e40e80 --- /dev/null +++ b/www/hf/rt/1w.html @@ -0,0 +1,59 @@ + +
+
+
+
LEGS
+
+
    +
  • Squat 2 sets (12, 10)
  • +
  • Lunges 2 sets (12, 10)
  • +
  • Deadlift 2 sets (12, 10)
  • +
+
+
BACK
+
+
    +
  • Chin-ups 2 sets (10, 10) – either with assistance machine or using own bodyweight
  • +
  • Lat pull down to chest, medium grip, 2 sets (12, 10)
  • +
  • Seated Row, narrow handle, 2 sets (12, 10)
  • +
+
+
CHEST
+
+
    +
  • Flat Dumbbell bench press 2 sets (12, 10)
  • +
  • Incline Dumbbell Flys 2 sets (12, 10)
  • +
  • Chest press machine 2 sets (12, 10)
  • +
  • Optional: Dips, wide grip position, 2 sets of 10 or 12.
  • +
+
+
SHOULDERS
+
+
    +
  • Seated dumbbell press 2 sets (12, 10)
  • +
  • Upright Row 2 sets (12, 10)
  • +
  • Lateral Raise 2 sets (12, 10)
  • +
+
+
TRICEPS
+
+
    +
  • Lying Triceps extension 2 sets (12, 10)
  • +
  • Triceps press down 2 sets (12, 10)
  • +
+
+
BICEPS
+
+
    +
  • Standing barbell curls 2 sets (12, 10)
  • +
  • Seated Dumbbell curls 2 sets (12, 10)
  • +
+
+
+
+
\ No newline at end of file diff --git a/www/hf/rt/2w.html b/www/hf/rt/2w.html new file mode 100755 index 0000000..0da46f3 --- /dev/null +++ b/www/hf/rt/2w.html @@ -0,0 +1,68 @@ + +
+
+
+
+
    +
  • Mon: Workout 1
  • +
  • Tuesday: rest or cardio
  • +
  • Wed: rest or cardio
  • +
  • Thur: rest or cardio
  • +
  • Fri: Workout 2
  • +
+
+
Workout 1 – Chest, Shoulders, Triceps
+
+

Warm up first, then warm up specific muscle group with a couple of lighter sets, then go into the workout…

+
+

Chest

+
    +
  • Flat Dumbbell bench press 3 sets (15, 12, 10)
  • +
  • Incline Dumbbell Flys 3 sets (12, 12, 10)
  • +
  • Chest press machine 3 sets (15, 12, 10)
  • +
  • Optional: Dips, wide grip position, 3 sets of 10 or 12.
  • +
+

Shoulders

+
    +
  • Seated dumbbell press 3 sets (15, 12, 10)
  • +
  • Upright Row 3 sets (15, 12, 10)
  • +
  • Lateral Raise 3 sets (15, 12, 10)
  • +
+

Triceps

+
    +
  • Lying Triceps extension 3 sets (15, 12, 10)
  • +
  • Triceps press down 3 sets (12, 12, 10)
  • +
+
+
+
Workout 2 – Legs, Back, Biceps
+
+

Warm up first, then warm up specific muscle group with a couple of lighter sets, then go into the workout…

+
+

Legs

+
    +
  • Squat 3 sets (10, 10, 10)
  • +
  • Lunges 3 sets (12, 12, 10)
  • +
  • Deadlift 3 sets (15, 12, 10)
  • +
+

Back

+
    +
  • Chin-ups 3 sets (10, 10, 10) – either with assistance machine or using own body weight
  • +
  • Lat pull down to chest, medium grip, 3 sets (15, 12, 10)
  • +
  • Seated Row, narrow handle, 3 sets (15, 12, 10)
  • +
+

Biceps

+
    +
  • Standing barbell curls 3 sets (15, 12, 10)
  • +
  • Seated Dumbbell curls 3 sets (12, 12, 10)
  • +
+
+
+
+
+
\ No newline at end of file diff --git a/www/hf/rt/3w.html b/www/hf/rt/3w.html new file mode 100755 index 0000000..7ac81e2 --- /dev/null +++ b/www/hf/rt/3w.html @@ -0,0 +1,75 @@ + +
+
+
+
+
    +
  • Mon: Workout 1
  • +
  • Tue: rest or cardio
  • +
  • Wed: Workout 2
  • +
  • Thur: rest or cardio
  • +
  • Fri: Workout 1
  • +
  • Sat: rest or cardio
  • +
  • Sun: rest or cardio
  • +
  • Mon: Workout 2
  • +
  • Tue: rest or cardio
  • +
  • Wed: Workout 1
  • +
  • Thur: rest or cardio
  • +
  • Fri: Workout 2
  • +
+
+
Workout 1 – Chest, Shoulders, Triceps
+
+

Warm up first, then warm up specific muscle group with a couple of lighter sets, then go into the workout…

+
+

Chest

+
    +
  • Flat Dumbbell bench press 3 sets (15, 12, 10)
  • +
  • Incline Dumbbell Flys 3 sets (12, 12, 10)
  • +
  • Chest press machine 3 sets (15, 12, 10)
  • +
  • Optional: Dips, wide grip position, 3 sets of 10 or 12.
  • +
+

Shoulders

+
    +
  • Seated dumbbell press 3 sets (15, 12, 10)
  • +
  • Upright Row 3 sets (15, 12, 10)
  • +
  • Lateral Raise 3 sets (15, 12, 10)
  • +
+

Triceps

+
    +
  • Lying Triceps extension 3 sets (15, 12, 10)
  • +
  • Triceps press down 3 sets (12, 12, 10)
  • +
+
+
+
Workout 2 – Legs, Back, Biceps
+
+

Warm up first, then warm up specific muscle group with a couple of lighter sets, then go into the workout…

+
+

Legs

+
    +
  • Squat 3 sets (10, 10, 10)
  • +
  • Lunges 3 sets (12, 12, 10)
  • +
  • Deadlift 3 sets (15, 12, 10)
  • +
+

Back

+
    +
  • Chin-ups 3 sets (10, 10, 10) – either with assistance machine or using own body weight
  • +
  • Lat pull down to chest, medium grip, 3 sets (15, 12, 10)
  • +
  • Seated Row, narrow handle, 3 sets (15, 12, 10)
  • +
+

Biceps

+
    +
  • Standing barbell curls 3 sets (15, 12, 10)
  • +
  • Seated Dumbbell curls 3 sets (12, 12, 10)
  • +
+
+
+
+
+
\ No newline at end of file diff --git a/www/hf/rt/marms.html b/www/hf/rt/marms.html new file mode 100755 index 0000000..144035a --- /dev/null +++ b/www/hf/rt/marms.html @@ -0,0 +1,30 @@ + +
+
+
+
Basic arm workout
+
+
+

Warm-up: 3-5 minutes on Rower

+

Triceps

+
    +
  • Parallel Bar Triceps Dips 3 sets (10,10,10).
  • +
  • Lying Dumbbell Triceps Extension 3 sets (15,12,10). Increase weight with each set.
  • +
  • Close grip machine Bench Press 3 sets (15,12,10). Increase weight with each set.
  • +
+

Biceps

+
    +
  • Standing Barbell Curls 3 sets (15,12,10). Increase weight with each set.
  • +
  • Seated Dumbbell Curls 3 sets (15,12,10). Increase weight with each set.
  • +
  • Chin-ups 3 sets (10,10,10).
  • +
+
+
+
+
+
\ No newline at end of file diff --git a/www/hf/rt/mback.html b/www/hf/rt/mback.html new file mode 100755 index 0000000..4495ccf --- /dev/null +++ b/www/hf/rt/mback.html @@ -0,0 +1,25 @@ + +
+
+
+
Basic back workout
+
+
+
    +
  • Warm-up: Rower 3-5 minutes
  • +
  • Chin-ups 3 sets - 10, 10, 10 reverse grip. Change to overhand grip and wider hand position to increase difficulty.
  • +
  • Seated Rows 3 sets - 15, 12, 10 increasing weight with each set
  • +
  • Lat Pull-downs 3 sets - 15, 12, 10 increasing weight each set
  • +
  • Dumbbell pullovers 3 sets - 15, 12, 10 increasing weight with each
  • +
  • Back extensions using Swiss Ball 3 sets - 10, 10, 10 increasing weight with each set
  • +
+
+
+
+
+
\ No newline at end of file diff --git a/www/hf/rt/mchest.html b/www/hf/rt/mchest.html new file mode 100755 index 0000000..767406d --- /dev/null +++ b/www/hf/rt/mchest.html @@ -0,0 +1,24 @@ + +
+
+
+
Basic chest workout
+
+
+
    +
  • Warm-up: Rower 3-5 minutes
  • +
  • Chest Press machine 3 sets (15,12,10). Increase weight with each set.
  • +
  • Dumbbell Bench press (flat or incline) 3 sets. (15,12,10). Increase weight with each set.
  • +
  • Parallel Bar Dips 3 sets (10,10,10)
  • +
  • Flys (flat or incline) 3 sets (15, 12, 10). Increase weight with each set.
  • +
+
+
+
+
+
\ No newline at end of file diff --git a/www/hf/rt/mlegs.html b/www/hf/rt/mlegs.html new file mode 100755 index 0000000..77646ff --- /dev/null +++ b/www/hf/rt/mlegs.html @@ -0,0 +1,38 @@ + +
+
+
+
Basic leg workout
+
+
+
    +
  • Warm-up: Stationary bike 3-5 minutes
  • +
  • Squat 3 sets - 15, 12, 10 increasing weight with each set
  • +
  • Leg Extension 3 sets - 15, 12, 10 increasing weight with each set
  • +
  • Lunges holding Dumbbells 2 sets - 12, 10 increasing weight each set
  • +
  • Leg Curl machine 3 sets - 15, 12, 10 increasing weight with each
  • +
  • Deadlift 3 sets - 15, 12, 10 increasing weight with each set
  • +
  • Step-ups holding dumbbells 3 sets - 10, 10, 10
  • +
+
+
+
Super-set leg workout
+
+
+
    +
  • Warm-up: Stationary bike 3-5 minutes, then 2 sets of bodyweight squats, 15-20 reps
  • +
  • Leg Extension, 12 reps, then Squat, 12 reps, with no rest in between sets
  • +
  • Repeat three times, set number 2 increase weight and perform 10 reps, same for set number 3.
  • +
  • Leg Curl, 12 reps, then Deadlift, 12 reps, with no rest in between sets
  • +
  • Repeat three times, set number 2 increase weight and perform 10 reps, same for set number 3.
  • +
+
+
+
+
+
\ No newline at end of file diff --git a/www/hf/rt/mshoulders.html b/www/hf/rt/mshoulders.html new file mode 100755 index 0000000..db5a046 --- /dev/null +++ b/www/hf/rt/mshoulders.html @@ -0,0 +1,24 @@ + +
+
+
+
Basic shoulder workout
+
+
+
    +
  • Warm-up: Rower 3-5 minutes
  • +
  • Standing Barbell Shoulder Press 3 sets (15,12,10). Increase weight with each set.
  • +
  • Seated Dumbbell Shoulder press 3 sets. (15,12,10). Increase weight with each set.
  • +
  • Lateral Raise 3 sets (10,10,10)
  • +
  • Upright Row 3 sets (15, 12, 10). Increase weight with each set.
  • +
+
+
+
+
+
\ No newline at end of file diff --git a/www/hf/rt/y111213.html b/www/hf/rt/y111213.html new file mode 100755 index 0000000..27fff42 --- /dev/null +++ b/www/hf/rt/y111213.html @@ -0,0 +1,61 @@ + +
+
+
+
Workout 1 (Monday) - Upper body
+
+
+
    +
  • Flat Dumbbell (DB) Bench press 3x6 (this means 3 sets of 6 reps)
  • +
  • Barbell Row 3x6
  • +
  • Incline Barbell (BB) bench press 2x10
  • +
  • Lat Pull down 2x10
  • +
  • Seated DB shoulder press 2x10
  • +
  • Barbell curl 2x10
  • +
+
+
+
Workout 2 (Tuesday) - Lower body
+
+
+
    +
  • Squat 3x6
  • +
  • Good morning 3x6
  • +
  • Leg extension 2x10
  • +
  • Seated calf raise 3x6
  • +
+
+
+
Workout 3 (Thursday) - Upper body
+
+
+
    +
  • Incline DB press 3x6
  • +
  • Pull up 3x6
  • +
  • Flat BB bench 2x10
  • +
  • Cable row 2x10
  • +
  • Seated shoulder press 2x10
  • +
  • Barbell curl 2x10
  • +
  • Close grip bench press 2x10
  • +
+
+
+
Workout 4 (Friday or Saturday) - Lower body
+
+
+
    +
  • Dead lift 3x6
  • +
  • Lunges 3x6
  • +
  • Leg curl 2x10
  • +
  • Standing calf raise 3x10
  • +
+
+
+
+
+
\ No newline at end of file diff --git a/www/hf/rt/y78.html b/www/hf/rt/y78.html new file mode 100755 index 0000000..8d69fa8 --- /dev/null +++ b/www/hf/rt/y78.html @@ -0,0 +1,30 @@ + +
+
+
+
+

Training for years 7 & 8 should be based around aerobic activity, however there are some exercises that can be undertaken using bodyweight as resistance.

+

As a minimum you should be doing at least 30 minutes of Aerobic activity as a starter (bike, row, run, cross-train, power walk!). Try doing between 5 and 10 minutes on each, which makes the time go faster. You should get into the habit of recording what you do in those 5-10 minutes: how far you went, what the resistance was set on, how many calories you burned, etc. It'll give you a target each time you do your workout.

+
+
The Exercises
+
+
+

These can done as a circuit, repeat the circuit 3 times.

+
    +
  • Bodyweight squats or swiss ball squats, 12 reps
  • +
  • Lunges, 12 reps
  • +
  • Step-ups onto a reebok step, 20 reps
  • +
  • Push-ups, 12 reps
  • +
  • Bench dips, 12 reps
  • +
  • Crunches, 12 reps
  • +
+
+
+
+
+
\ No newline at end of file diff --git a/www/hf/rt/y910.html b/www/hf/rt/y910.html new file mode 100755 index 0000000..fa4f161 --- /dev/null +++ b/www/hf/rt/y910.html @@ -0,0 +1,57 @@ + +
+
+
+
+

Whole Body Workout – Legs, Back, Chest, Shoulders, Triceps, Biceps

+

Warm up first, then go into the workout…

+

Do this at lease twice a week, along with some cardio training or in game situations.

+
+
The Exercises
+
+
+

Legs

+
    +
  • Squat 2 sets (12,10)
  • +
  • Lunges 2 sets (12,10)
  • +
  • Deadlift 2 sets (12,10)
  • +
+

Back

+
    +
  • Chin-ups 2 sets (10,10) – either with assistance machine or using own bodyweight
  • +
  • Lat pull down to chest, medium grip, 2 sets (12,10)
  • +
  • Seated Row, narrow handle, 2 sets (12,10)
  • +
+

Chest

+
    +
  • Flat Dumbbell bench press 2 sets (12,10)
  • +
  • Incline Dumbbell Flys 2 sets (12,10)
  • +
  • Chest press machine 2 sets (12,10)
  • +
  • Optional: Dips, wide grip position, 2 sets of 10 or 12.
  • +
+

Shoulders

+
    +
  • Seated dumbbell press 2 sets (12,10)
  • +
  • Upright Row 2 sets (12,10)
  • +
  • Lateral Raise 2 sets (12,10)
  • +
+

Triceps

+
    +
  • Lying Triceps extension 2 sets (12,10)
  • +
  • Triceps press down 2 sets (12,10)
  • +
+

Biceps

+
    +
  • Standing barbell curls 2 sets (12,10)
  • +
  • Seated Dumbbell curls 2 sets (12,10)
  • +
+
+
+
+
+
\ No newline at end of file diff --git a/www/hf/warmcool.html b/www/hf/warmcool.html new file mode 100755 index 0000000..63f6470 --- /dev/null +++ b/www/hf/warmcool.html @@ -0,0 +1,76 @@ + +
+
+
+
+
    +
  • +
    +
    Warm Up
    +
    +
    +
    +

    Muscle stiffness is thought to be directly related to muscle injury and therefore the warm up should be aimed at reducing muscle stiffness.

    +

    Warming up should at least consist of the following:

    +
      +
    • 5 to 10 minutes jogging to increase body temperature
    • +
    • 10 to 15 minutes dynamic stretching exercises to reduce muscle stiffness
    • +
    • 10 to 15 minutes general and event specific drills to prepare for the session or competition: e.g. for a runner: +
        +
      • Lower leg drills
      • +
      • Leg drills
      • +
      • Technique drills
      • +
      +
    • +
    • 4 to 8 easy run outs over 30 to 60 metres - focus on correct running technique (Tall, Relaxed, Smooth and Drive)
    • +
    +

    Dynamic stretches are more appropriate to the warm up as they help reduce muscle stiffness. Static stretching exercises do not reduce muscle stiffness.

    +

    What are the benefits of a warm up?

    +

    Performance may be improved, as an appropriate warm up will result in an:

    +
      +
    • Increased speed of contraction and relaxation of warmed muscles
    • +
    • Dynamic exercises reduce muscle stiffness
    • +
    • Greater economy of movement because of lowered viscous resistance within warmed muscles
    • +
    • Facilitated oxygen utilisation by warmed muscles because haemoglobin releases oxygen more readily at higher muscle temperatures
    • +
    • Facilitated nerve transmission and muscle metabolism at higher temperatures; a specific warm up can facilitate motor unit recruitment required in subsequent all out activity
    • +
    • Increased blood flow through active tissues as local vascular beds dilate, increasing metabolism and muscle temperatures
    • +
    • Allows the heart rate get to a workable rate for beginning exercise
    • +
    • Mentally focused on the training or competition
    • +
    +
    +
    +
  • +
  • +
    +
    Cool Down
    +
    +
    +
    +

    Cooling down should consist of the following:

    +
      +
    • 5 to 10 minutes jogging/walking - decrease body temperature and remove waste products from the working muscles
    • +
    • 5 to 10 minutes static stretching exercises
    • +
    +

    Static stretches are more appropriate to the cool down as they help muscles to relax, realign muscle fibres and re-establish their normal range of movement. These stretches should be held for approximately 10 seconds.

    +

    What are the benefits of a cool down?

    +

    An appropriate cool down will:

    +
      +
    • aid in the dissipation of waste products, including lactic acid
    • +
    • reduce the potential for DOMS
    • +
    • reduce the chances of dizziness or fainting caused by the pooling of venous blood at the extremities
    • +
    • reduce the level of adrenaline in the blood
    • +
    • allows the heart rate to return to its resting rate
    • +
    +
    +
    +
  • +
+
+
+
+
\ No newline at end of file diff --git a/www/images/GDA_545px.jpg b/www/images/GDA_545px.jpg deleted file mode 100644 index 32dcc01..0000000 Binary files a/www/images/GDA_545px.jpg and /dev/null differ diff --git a/www/images/aerobictraining/boys.png b/www/images/aerobictraining/boys.png deleted file mode 100644 index 54a1bcc..0000000 Binary files a/www/images/aerobictraining/boys.png and /dev/null differ diff --git a/www/images/aerobictraining/girls.png b/www/images/aerobictraining/girls.png deleted file mode 100644 index b8bfdae..0000000 Binary files a/www/images/aerobictraining/girls.png and /dev/null differ diff --git a/www/images/aerobictraining/trainingzones.png b/www/images/aerobictraining/trainingzones.png deleted file mode 100644 index 39c57bd..0000000 Binary files a/www/images/aerobictraining/trainingzones.png and /dev/null differ diff --git a/www/img/i-f7.png b/www/img/i-f7.png new file mode 100755 index 0000000..6bb0f41 Binary files /dev/null and b/www/img/i-f7.png differ diff --git a/www/img/i-form-calendar.png b/www/img/i-form-calendar.png new file mode 100755 index 0000000..43b798f Binary files /dev/null and b/www/img/i-form-calendar.png differ diff --git a/www/img/i-form-comment.png b/www/img/i-form-comment.png new file mode 100755 index 0000000..1408c45 Binary files /dev/null and b/www/img/i-form-comment.png differ diff --git a/www/img/i-form-email.png b/www/img/i-form-email.png new file mode 100755 index 0000000..2457abd Binary files /dev/null and b/www/img/i-form-email.png differ diff --git a/www/img/i-form-gender.png b/www/img/i-form-gender.png new file mode 100755 index 0000000..8f337e2 Binary files /dev/null and b/www/img/i-form-gender.png differ diff --git a/www/img/i-form-name.png b/www/img/i-form-name.png new file mode 100755 index 0000000..cdc3c3a Binary files /dev/null and b/www/img/i-form-name.png differ diff --git a/www/img/i-form-password.png b/www/img/i-form-password.png new file mode 100755 index 0000000..1b975e1 Binary files /dev/null and b/www/img/i-form-password.png differ diff --git a/www/img/i-form-settings.png b/www/img/i-form-settings.png new file mode 100755 index 0000000..1405b88 Binary files /dev/null and b/www/img/i-form-settings.png differ diff --git a/www/img/i-form-tel.png b/www/img/i-form-tel.png new file mode 100755 index 0000000..98c66ab Binary files /dev/null and b/www/img/i-form-tel.png differ diff --git a/www/img/i-form-toggle.png b/www/img/i-form-toggle.png new file mode 100755 index 0000000..f1f85ea Binary files /dev/null and b/www/img/i-form-toggle.png differ diff --git a/www/img/i-form-url.png b/www/img/i-form-url.png new file mode 100755 index 0000000..112c4e0 Binary files /dev/null and b/www/img/i-form-url.png differ diff --git a/www/index.html b/www/index.html old mode 100644 new mode 100755 index 8f1f9a1..c9edb5e --- a/www/index.html +++ b/www/index.html @@ -1,2252 +1,103 @@ - + + - - - - TDA Enrichment App - - - - - - - - - + + + + + TDA Enrichment + + + + + - - -
- -
- -

TDA Enrichment

Info - - - -
- Close -
-

Welcome

-

Welcome to Thomas Deacon Academy's Sports Enrichment app! This app contains the full timetable for the after school sports enrichment as well as the Big Friday events. The app also contains details on attending inter-college enrichment as well as the results and rankings of the colleges.

-

This app was designed and built by George Garside.

-
-
- -
- -
- - - - - -
- -
- -
- -
- -
-

© George Garside

-
-
- - -
- -
- -

Monday

- -
- -
    -
  • Badminton
  • -
  • Week A & B

    -

    All Years

    -

    Staff: BCH / BHU

    -

    Location: Sports Hall

    -

    Time: 2:45 - 4:00pm

    -
  • -
  • CricketUPDATED!
  • -
  • Week A & B

    -

    Year 9 & 10

    -

    Staff: BHU / JHI

    -

    Location: Sports Hall

    -

    Time: 4:00 - 5:00pm

    -
  • -
  • FitnessUPDATED!
  • -
  • Week A & B

    -

    All Years

    -

    Staff: SHOFF / CTH

    -

    Location: Fitness Suite

    -

    Time: 2:45 - 4:00pm

    -
  • - -
  • Gold DoEUPDATED!
  • -
  • Week A & B

    -

    6th Form

    -

    Staff: CMCC / HED

    -

    Location: PE Classroom

    -

    Time: 5:00 - 6:00pm

    -
  • -
  • HockeyUPDATED!
  • -
  • Week A & B

    -

    Year 7

    -

    Staff: ARE / KGE

    -

    Location: Astro

    -

    Time: 2:45 - 4:00pm

    -
  • -
  • Week A & B

    -

    Year 8

    -

    Staff: EFI / MYE

    -

    Location: Astro

    -

    Time: 2:45 - 4:00pm

    -
  • -
  • Week A

    -

    Year 9

    -

    Staff: RLO

    -

    Location: PTHC

    -

    Time: 2:45 - 4:00pm

    -
  • -
  • Week B

    -

    Year 9

    -

    Staff: RLO / MYE

    -

    Location: Astro

    -

    Time: 4:00 - 5:30pm

    -
  • - -
  • RugbyUPDATED!
  • -
  • Week A & B

    -

    Year 7

    -

    Staff: JME / AME / CGE

    -

    Location: Field

    -

    Time: 2:45 - 4:00pm

    -
  • -
  • Week A

    -

    Year 10

    -

    Staff: SCL

    -

    Location: Field

    -

    Time: 2:45 - 4:00pm

    -
  • -
  • Silver DoENEW!
  • -
  • Week B

    -

    Year 11

    -

    Staff: CMCC / HED

    -

    Location: PE Classroom

    -

    Time: 4:00 - 5:00pm

    -
  • -
- -
- -
- Back -
-
- - -
- -
- -

Tuesday

- -
- -
    - - -
  • FitnessUPDATED!
  • -
  • Week A & B

    -

    All Years

    -

    Staff: SHOFF / RBR / BHU (B)

    -

    Location: Fitness Suite

    -

    Time: 2:45 - 4:00pm

    -
  • -
  • HockeyUPDATED!
  • -
  • Week A & B

    -

    Year 7 & 8

    -

    Staff: MYE

    -

    Location: Sports Hall

    -

    Time: 2:45 - 4:00pm

    -
  • -
  • Week A & B

    -

    All Years

    -

    Staff: MYE

    -

    Location: Astro

    -

    Time: 6:00 - 9:00pm

    -
  • - - -
  • Outdoor ActivitiesNEW!
  • -
  • Week A & B

    -

    All Years

    -

    Staff: CGEL

    -

    Location: Off-site

    -

    Time: 2:45 - 4:00pm

    -
  • -
  • RugbyNEW!
  • -
  • Week A & B

    -

    Year 8

    -

    Staff: SWI

    -

    Location: Field

    -

    Time: 2:45 - 4:00pm

    -
  • -
  • Week B

    -

    Year 10

    -

    Staff: SCL

    -

    Location: Field

    -

    Time: 2:45 - 4:00pm

    -
  • -
  • Table TennisUPDATED!
  • -
  • Week A & B

    -

    All Years

    -

    Staff: AHO (A) • BHU (B)

    -

    Location: Sports Hall

    -

    Time: 2:45 - 4:00pm

    -
  • -
- -
- -
- Back -
-
- - -
- -
- -

Wednesday

- -
- -
    - -
  • Athletics (Joggers)
  • -
  • Week A & B

    -

    All Years

    -

    Staff: OMA

    -

    Location: Field

    -

    Time: 2:45 - 4:00pm

    -
  • -
  • CCFUPDATED!
  • -
  • Week A & B

    -

    Year 8, 9, 10, 11 & 6th Form

    -

    Staff: CTH / CGEL / GWI / CMCC

    -

    Location: CCF HQ

    -

    Time: 2:45 - 4:15pm

    -
  • -
  • CricketUPDATED!
  • -
  • Week A & B

    -

    Year 7

    -

    Staff: BHU / JHI

    -

    Location: Sports Hall (Nets)

    -

    Time: 4:00 - 5:15pm

    -
  • -
  • FitnessUPDATED!
  • -
  • Week B

    -

    6th Form

    -

    Staff: SCL / AHO / BHU / SWI

    -

    Location: Field

    -

    Time: 1:45 - 2:00pm

    -
  • - -
  • Girls FitnessUPDATED!
  • -
  • Week A & B

    -

    All Years

    -

    Staff: EFI / KGE

    -

    Location: Fitness Suite

    -

    Time: 2:45 - 4:00pm

    -
  • -
  • GymnasticsNEW!
  • -
  • Week A & B

    -

    All Years

    -

    Staff: RBRO

    -

    Location: Spiral Gyn

    -

    Time: 2:45 - 4:00pm

    -
  • -
  • Indoor HockeyUPDATED!
  • -
  • Week A & B

    -

    Year 9 & 11

    -

    Staff: RLO / AHO / MYE

    -

    Location: Sports Hall

    -

    Time: 2:45 - 4:00pm

    -
  • -
  • Perse HockeyNEW!
  • -
  • Week A & B

    -

    All Years

    -

    Staff: MYE

    -

    Location: Astro

    -

    Time: 4:00 - 8:00pm

    -
  • - -
  • RugbyUPDATED!
  • -
  • Week A & B

    -

    Year 9

    -

    Staff: SWI

    -

    Location: Field

    -

    Time: 2:45 - 4:00pm

    -
  • -
  • Week A & B

    -

    Year 10

    -

    Staff: SCL / CGE

    -

    Location: Field

    -

    Time: 2:45 - 4:00pm

    -
  • -
  • Week A & B

    -

    Year 11

    -

    Staff: JME / SHO

    -

    Location: Field

    -

    Time: 2:45 - 4:00pm

    -
  • -
  • Week A & B

    -

    1st XV

    -

    Staff: AME

    -

    Location: Field

    -

    Time: 2:45 - 4:00pm

    -
  • - -
- -
- -
- Back -
-
- - -
- -
- -

Thursday

- -
- -
    -
  • FitnessUPDATED!
  • -
  • Week A & B

    -

    All Years

    -

    Staff: SHOFF / CTH / BHU (B)

    -

    Location: Fitness Suite

    -

    Time: 2:45 - 4:00pm

    -
  • -
  • BadmintonNEW!
  • -
  • Week A & B

    -

    All Years

    -

    Staff: BCH / CGEL

    -

    Location: Sports Hall

    -

    Time: 2:45 - 4:00pm

    -
  • -
  • BasketballUPDATED!
  • -
  • Week A & B

    -

    6th Form

    -

    Staff: IWH / LMA

    -

    Location: Sports Hall

    -

    Time: 4:00 - 5:30pm

    -
  • -
  • HockeyUPDATED!
  • -
  • Week A & B

    -

    Year 7

    -

    Staff: ARE / KGE

    -

    Location: Astro

    -

    Time: 2:45 - 4:00pm

    -
  • -
  • Week A & B

    -

    Year 8

    -

    Staff: COD / MYE (A) • EFI (B)

    -

    Location: Astro

    -

    Time: 2:45 - 4:00pm

    -
  • -
  • Week A

    -

    Year 11

    -

    Staff: AHO / RBR

    -

    Location: Astro

    -

    Time: 2:45 - 4:00pm

    -
  • -
  • Week B

    -

    Year 11

    -

    Staff: AHO / RBR

    -

    Location: Astro

    -

    Time: 4:00 - 5:30pm

    -
  • -
  • RugbyNEW!
  • -
  • Week A & B

    -

    Year 7

    -

    Staff: JME / AME / CGE

    -

    Location: Field

    -

    Time: 2:45 - 4:00pm

    -
  • -
  • Week A & B

    -

    Year 8

    -

    Staff: SWI / SCL

    -

    Location: Field

    -

    Time: 2:45 - 4:00pm

    -
  • -
- -
- -
- Back -
-
- - -
- -
- -

Friday

- -
- -
    -
  • Badminton
  • -
  • Week A & B

    -

    All Years

    -

    Staff: BCH / BHU

    -

    Location: Sports Hall

    -

    Time: 2:45 - 4:00pm

    -
  • -
  • CricketNEW!
  • -
  • Week A & B

    -

    Year 8

    -

    Staff: BHU

    -

    Location: Sports Hall (Nets)

    -

    Time: 4:00 - 5:15pm

    -
  • -
  • FitnessUPDATED!
  • -
  • Week A & B

    -

    All Years

    -

    Staff: SHOFF / RBR

    -

    Location: Fitness Suite

    -

    Time: 2:45 - 4:00pm

    -
  • - - -
  • RugbyNEW!
  • -
  • Week A & B

    -

    Year 9

    -

    Staff: SWI / SCL

    -

    Location: Field

    -

    Time: 2:45 - 4:00pm

    -
  • -
  • Week A & B

    -

    All Years

    -

    Staff: GWI / CTH

    -

    Location: Field

    -

    Time: 2:45 - 4:00pm

    -
  • -
  • Week A & B

    -

    1st XV & Year 11

    -

    Staff: JME / AME

    -

    Location: Field

    -

    Time: 2:45 - 4:00pm

    -
  • -
  • TrampolineUPDATED!
  • -
  • Week A & B

    -

    All Years

    -

    Staff: AGL / RLO (A) • CGE (B)

    -

    Location: Sports Hall

    -

    Time: 2:45 - 4:00pm

    -
  • -
- -
- -
- Back -
-
- - -
- -
- -

Dodgeball

- -
- - -

Now Tug of War has finished, it's time to get your Dodgeball teams ready!

-

Your college’s PE teachers will be coming round to get your team sheets filled in - get your name down if you want to play.

-

See below for when your competition is:

- -
-

Timetable

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
TimeLocation
March 22ndYear 11, 12, 13 & Staff DodgeballBig FridaySports Hall
Easter: Term 5
April 26thYear 10 DodgeballBig FridaySports Hall
May 10thYear 9 DodgeballBig FridaySports Hall
May 24thYear 8 DodgeballBig FridaySports Hall
Term Break: Term 6
June 14thYear 7 DodgeballBig FridaySports Hall
- -
- -
- -
- Back -
-
- - -
- -
- -

H&F HOFF's 5 Wheels

- -
- -
-
-

1st: Aerobic Training

-

This is the wheel that those desperate to lose weight fast always drive on first. Even though it's not the answer to helping you obtain that celebrity-perfect look by itself, aerobic exercise is still a valuable wheel.

-

The Facts

-

Without aerobic training, you'll lack the adequate stamina to push your muscles beyond what they're capable of doing so they will become stronger and shape up faster. Without aerobic training you'll have to watch calories religiously, your body wont be as efficient at flushing out the toxins that resistance training leaves behind, such as lactic acid. Add the fact that aerobic training improves the quality of your sleep and its pretty easy to see how it fits into the bigger picture.

-

Foundation

-

The term aerobic means with oxygen. Aerobic activity is any physical activity done for an extended period of time that forces your cardiovascular system (heart, lungs and blood vessels) to increase the amount of oxygen and blood circulating through your body, so that you're benefiting even at rest. Your body doesn't care how you make that happen, although choosing activities that work larger muscle groups, typically your legs, is more effective at getting that job done.

-

To count as aerobic exercise, any activity you choose has to keep your heart beating around sixty-five percent of your maximum heart rate for at least 20 minutes or more.

-

Your maximum heart rate, or MHR, is the highest number of times your heart can contract in one minute. To find yours, all you do is subtract your age from the number 220. That means if you're 35 years old, your MHR is 220 minus 35 (or 185 beats per minute). This is an important number to know, as it can help you know how hard you should be exercising.

-

To get the most from aerobic exercise, you need to keep your pulse between a range of 60% and 70% of your MHR to burn fat. For the 35 year old that equates to a pulse of between 111 to 130 per minute. If you increase the intensity you're working at to between 70% and 80% this will improve your aerobic fitness, the pulse rate will then be at 130 to 148 beats per minute.

-

Try to do some form of aerobic activity 3 times a week, for at least 20 minutes. More is better; less might be suitable if you have a favourable metabolism. If you can do more than 20 minutes, then do it: every minute past the twenty burns additional body fat as fuel. After that magic number (20 minutes), you've exhausted your body's glycogen (carbohydrate) stores, which it uses as fuel when you workout. From a fat-burning standpoint, if you can exercise beyond 20 minutes, your body has no choice but to use more of its own stored body fat for energy instead.

-

Your Options

- There are hundreds of things you could do to get an aerobic workout besides using the typical gym machines (stationary bikes, treadmills, cross-trainers and rowing machines) and the obvious outside choices (biking, jogging, running, swimming and walking). If you're not into any of these don't write off exercise, as playing a sport, dancing, ice-skating skiing, kayaking, rollerblading, even house cleaning and gardening can be aerobic if done a certain way at a certain intensity! -

Use Everything in One Workout

-

If you want a workout your body will never get used to (or forgive you for), try flip-flopping between your cardio choices at the gym (stationary bike, treadmill, step routine, jump rope, stair climber or rower) every three minutes. Make the first minute a warm-up, push yourself around 65% of your MHR for the second minute (or on a scale 1 to 10 in effort, around a 6), then go for it in the last minute (85% or level 8 effort).

-

Know When Too Much Is Too Much

-

Pushing yourself higher within your target heart rate zone will definitely reap more results, but you need to know when too much is too much. If you can't speak a full sentence while exercising without being winded, then you're most likely pushing yourself to the far end of your target heart rate zone. On the other hand, if you're able to carry on a full conversation, then you're probably working at a level thats below your target heart rate zone.

-
-
-

2nd: Resistance Training

-

Whether you're brand new to this whole exercise experience, or fitness is old hat, you probably still know what resistance training entails, or know it by one of its many other names: strength training, weight training, pumping iron, anaerobic exercise, etc.

-

This is the chapter you've either been waiting for or dreading. If you're a male and breathing, you may start to get a bit fired up by now. If you're a female, and fairly new to fitness, you might have doubts, or even visions of morphing into a 300-pound monster with arms like ham hocks as soon as you start bench pressing. Relax, its not like that.

-

The Facts

-

Resistance training is not just about building muscle that will help you look great. Its also a prehab for preventing injuries and making sure you feel great. Resistance training also turns back the clock by reversing many factors that naturally occur in the ageing process.

-

Reshaping your muscles can even help you stay leaner. Aerobic exercise burns more calories per minute and gets your metabolism into overdrive faster than resistance training. However, after you've finished weight training, your body has to use extra calories throughout the day just to sustain the new, leaner body you've built for yourself. Using weights effectively will keep your metabolism turned on all day long.

-

So think of muscle as a fat burning friend who's with you all day long. The more muscle you have, the higher your Basal Metabolic Rate (BMR). What's a BMR, and why should you care about it? Your BMR is another important number: it is the number of calories you burn every day to keep your body functioning, your heart beating, your lungs breathing, and so on. It's your BMR that accounts for almost 75% of all of the calories you burn daily, with the other 25% being burned from all your daily physical activities.

-

Building more muscle though resistance training means you'll have extra muscle fibres consuming more energy. Even when you're just sitting there looking good but not doing a thing. In fact, every pound of muscle you add to your frame burns an additional 30 to 50 calories per day. Substitute 5 pounds of muscle for 5 pounds of fat and not only will you naturally be more aesthetically in shape, but you'll burn and extra 150-250 calories a day doing absolutely nothing at all.

-

Foundation

-

You already know that Aerobic activity is any activity that increases your pulse for an extended period of time, causing your heart and lungs to work harder to get more oxygen to your muscles. Resistance training, Anaerobic exercise is any activity done in short, intense bursts that works your body without requiring much oxygen.

-

Resistance training means working one muscle (or a group of muscles) against some form of resistance so that your muscles have no choice but to break down from fatigue and stress. Do it the right way, and those beaten-down muscles have no choice but to rebuild themselves so they're stronger for the next time you decide to put them through the paces.

-

No matter what tool you use to stress your muscles barbells, dumbbells, weight machines, stretch cords, medicine balls, your own body weight if you provide enough resistance to fatigue your muscles by making them repeat a movement for a given number of repetitions, you'll achieve the same goal.

-

Heres how it works: Lifting the weight one time is called a repetition (rep). A group of repetitions performed without stopping is called a set. The number of reps you should do to fatigue your muscles depends on your goals. Most experts stick with using a weight you can lift, raise, or pull 8 to 15 times. If you're looking to noticeably strengthen your muscles, then using a heavier weight that allows you do to between 6 and 10 reps is better. If improving muscle tone is your goal then 10 to 15 reps is more suited and lastly muscle endurance 15 to 20 reps.

-

Your Options

-

The choices you have with resistance training are virtually limitless there are literally hundreds of exercises that will prevent your muscles (or you) from being bored.

-

The best resistance training workout leaves no stone unturned. It's a program that targets every major muscle group in your body, not just the ones you're concerned with. These 13 exercises are for overall muscle-development. There are countless spin-off movements from these core exercises. Learn these, master them effectively, and then variations can be added.

-
    -
  • For your legs and butt → The squat and the lunge
  • -
  • For your chest → The chest press and the chest fly
  • -
  • For your back → The pulldown and the row
  • -
  • For your shoulders → The shoulder press and the raise
  • -
  • For your triceps → The pressdown and the extension
  • -
  • For your biceps → The curl
  • -
  • For your abs → The crunch and the reverse crunch
  • -
-

Focus

-

If resistance training has never worked for you and you use perfect form (perfect technique during an exercise), Id say that you're using weights that are too light for you. If you're not using a weight heavy enough to fully fatigue during each set, you'll never push them enough to make them want, and need, to improve themselves. For example, if an exercise asks you do 12-15 repetitions, you need to select a weight that you can complete only 12-15 reps with while keeping good form. If you could have easily eked out three more reps before quitting, your muscles were never really challenged enough to improve themselves, making the entire set less effective than it should and certainly could have been. Once you can do more than the required number of reps, then its time to raise the weight slightly.

-

Frequently asked questions

-
Wont weights make me big?
-

If you're a guy, you can probably skip over this question! If you're a woman You wont get big! As a rule, thats because most women are simply not genetically capable of ballooning up from strength training alone. Your body has 10% of the testosterone that the average male has and look at how hard it is for a man to add muscle. Even they cant do it without lifting heavy weights, eating steak for breakfast, milkshakes all day, and doing sets of 4 to 6 reps! I think you get my point!

-

If you're worried about adding a pound of muscle, it's estimated that the space of a pound of muscle is about 22% less than a pound of fat. That means adding 5 pounds of muscle and losing 5 pounds of fat would actually make you look smaller. I'd say thats a fair trade off. Finally, muscle isn't created by weights. It's created by food proteins to be more precise. You have to eat quality and a quantity of food above and beyond what you burn, and break the muscle down in the gym so they need to repair, plus eat every 3 to 4 hours, and get adequate rest so that they recover... Do you see what I mean? Besides, it's not an overnight process, so you could always back off or even stop.

-
Can I burn fat from a specific area by doing specific exercise?
-

Welcome to the biggest con in fitness and exercise. It may be the quick fix you're wishing for, but spot reduction (the popular term for it) is one of the biggest exercise lies out there. It's impossible to lose weight in one particular area by lifting weights or doing exercises that target only that area. You body burns fat in a genetically predetermined patter over which you have no control. But there's good news: As you start driving on all four wheels, you'll begin to burn fat gradually from all over your body, including your specific wish list of areas. Typically the last place you store fat is the first area you'll see a noticeable difference. Unfortunately, that also means the first place you started storing fat is usually the last area to get lean: men around the waist; women around the hips/butt.

-

Until you reduce the body fat above or around your muscles through cardiovascular exercise, resistance training, eating right, and adequate rest you'll never make those muscles or perfect set of abs visible.

-
-
-

3rd: Nutrition

-

Eating right isn't really all that complicated. It's a choice, and a conscious, daily choice at that. Making the right choice on a regular basis, and sticking with your choice over time, will get you there.

-

The Facts

-

Choose to eat the right way and you won't just improve every possible aspect of your health, but you'll make the job of reshaping yourself through exercising that much easier. The time-starved amongst us are at the mercy of convenience eating. You are your own food-police deciding the type of foods you eat; I can't monitor that all the time because I'm only with you for 1 hour at the gym. The other 23 hours are your responsibility.

-

Ingest the wrong foods and you can easily prevent your system from operating at its most efficient level especially if you're active. Eat less than enough to counterbalance the extra nutritional requirements your body needs to maintain itself and you'll store the same excess fat you're trying to get rid of because your body thinks it's going to starve, and so it hold onto every calorie in anticipation of not getting any more.

-

Regardless of what your goals are from exercise, following a few basic nutrition rules of the thumb will make this 3rd wheel worth a lot more to your body than you ever thought it could be.

-

Foundation

-

If you're trying to lose weight, calories may represent a guilty pleasure or a great evil to your brain. But to your body, calories are just energy units to be used as fuel.

-

You wouldn't give your car more fuel than it really needed, would you? If you did, all the fuel would just overflow and make a mess, right? That's exactly what happens with your body: when you eat more calories than it needs, the result is overflow to every place your body holds excess calories (i.e. fat). It doesn't know you don't want to gain weight, it just sees all those extra calories and assumes you want to store them as energy for later on.

-

Stand up and jump an inch or two off the ground. Anything move? For every pound of stored body fat you felt jiggle, all you're really looking at is roughly 3500 calories. Just 3500 units of fuel your body thinks it needs to hold onto because you haven't given it any reason to think otherwise. But don't worry. Now that you know why you're storing calories, it's going to be easier to convince your body to use them up and stop storing then unnecessarily.

-

Eating a low-fat, high-fibre diet along with doing aerobic exercise to burn calories (and resistance training to maintain lean mass and to naturally boost your metabolism) is the most effective way to lose fat without holding you back from building muscle tissue. Try not to use the word diet because it makes people feel like they're walking a tightrope: one tiny misstep (doughnut!) and they assume that all their hopes and dreams will come crashing down. Diets are usually temporary by nature, leading to eventual failure, whereas an on-going healthy nutritional intake that is a lifestyle will last a lifetime.

-

Calories

-

How many calories you really need to eat every day depends on who you are. Some people can maintain their bodyweight on 1400 calories a day, whereas others have metabolisms like a hummingbird: eat suet at every meal and never put on an ounce of fat. It all depends on everything from your metabolism and level of activity to your age, heritage, gender, what you're putting in your mouth, and when you're putting it in your mouth.

-

As a starting point the most common method used by dieticians and other health-care professionals is the Harris-Benedict formula.

-

Men: 66 + (6.3 x wt in lbs) + (12.9 x height in inches) - (6.8 x age in years)

-

Women: 655 + (4.3 x wt in lbs) + (4.7 x height in inches) - (4.7 x age in years)

-

The number you are left with is your estimated basal metabolic rate expenditure (or BMR): the minimum number of calories your body needs just to keep you going. Getting to school, typing up that report, racing around trying to find a decent place to eat these are all extra actions that increase your BMR by around 20%. For example a 35 year old woman who weighs 140lbs and stands 5 feet 6 inches would have a BMR of approx. 1402 calories a day. Multiply this by 120% and all she really needs to eat every day is 1683 calories. If your goal is to trim down, its just a matter of eating less and/or burning extra calories through exercise to lose weight.

-

Carbohydrates, Proteins, and fats

-

No matter how many calories you need each day, its important to make sure they don't all come from the same place. Carbohydrates, proteins, and fats are all broken down at different speeds in the body to create a continual flow of caloric energy.

-

Most nutritionists recommend dividing up your daily Carbohydrates, proteins, and fats using a ratio of 5:3:2 (respectively). This translates into getting 50% of your daily calories from carbs, 30% from protein, and 20% from fat. Using the example above, the woman that requires 1683 calories to maintain her weight would have a nutritional profile as follows to maintain her weight:

-
    -
  • Carbohydrate 841.5 cal. (50%)
  • -
  • Protein 504.9 cal. (30%)
  • -
  • Fat 336.6 cal. (20%)
  • -
-

To make this number crunching easier to calculate for everyday living we can equate these numbers further into grams and workout how much to allow for each meal.

-
    -
  • Carbohydrate 210g (4 cal/g)
  • -
  • Protein 126g (4 cal/g)
  • -
  • Fat 37g (9 cal/g)
  • -
-

Its healthier to eat all day long, breaking-up your caloric intake into smaller increments (5 to 6 meals) instead of the standard 3, you also help curb binges, and also keep blood sugar levels even throughout the day. Larger meals raise your blood sugar, which can trigger an increase in the release of insulin within the bloodstream. Remember, little and often. The easiest way to accomplish 5 or even 6 meals per day is to moderate the traditional 3 meals in size and snack in between. One snack mid-morning and one mid-afternoon.

-

For the example above based on 1683 calories, each of the 5 meals would average 336 calories, carbs 42 grams, protein 25 grams, fats 7 grams. It would be unrealistic to expect an exact equality between meals but use these figures as a guide.

-

There is so much good information on nutrition: what's good, what's not, nutrition plans, when to eat, when to stop, etc. I'll leave that for you to decide whats a wise choice and what's an unwise choice (cue another 30 minutes cycling!).

-

These are my nutritional guidelines:

-
    -
  • Most caloric meal - breakfast; the least - dinner. Drink 4-pints of water a day. Chicken, tuna (packed in water), eggs, wholemeal bread and rice. Plenty of fruit and veg. Protein shakes are convenient as are smoothies for snacks.
  • -
  • Read all labels, avoid sugar and salt. After 4pm drop pasta, rice, potato and bread. Obtain carbs from veg and salads for evening meal.
  • -
  • Protein sources Lean mince beef, chicken, fish, soya, eggs
  • -
  • Carbs Wholemeal bread and rice, porridge. Plenty of fruit (such as apples, bananas, oranges, satsumas, grapes, pears, strawberries, peaches, apricots) and vegetables (carrots, broccoli, spinach, beans)
  • -
  • Healthy fats: vegetable oils, oily fish, nuts, omega 3 enriched eggs, olive oil olives, seeds.
  • -
-
-
-

4th: Rest and Recovery

-

It sounds like the easiest wheel of the five to drive on, but it's actually the one that most frequently gets either too much or too little use. Give your body too much rest and it'll look like it. Give it too little and you increase your odds of not only injuring yourself, but never seeing the body-shaping results you're shooting for.

-

The facts

-

Whether you hate or love exercise, your body interprets all that time you've spent pulling, pushing, and sweating on gym equipment as on thing: stress. Thats why the time you give your muscles to rest and recover in between each workout can make a huge difference in the kind of results you end up seeing for all of your hard work.

-

Rest is also important between sets at the gym, 30 to 180 seconds ideally, depending on the intensity of the exercise and the routine. This downtime gives your body time to drain the muscles of any leftover lactic acid (a by-product of exercise that gives that fun, burning sensation towards the end of a set!).

-

Resting between workouts or lack of it is one of the biggest mistakes most overzealous exercisers make. Lifting weight causes microscopic breaks or tears inside your muscle fibres, breaks that trick your body into thinking its about go to war. These fibres react by rebuilding their legions to be stronger and firmer for the next battle, that is, if you give them an armistice to start recruiting. After exhausting a muscle with resistance training, it needs at least 48-72 hours of recovery time in order to heal from all that microscopic damage. If you work out before that time you risk injury, you wont be able to lift as much weight which will hold you back from using enough resistance to make your muscles stronger. Muscle strength is directly relative to muscle size. Increase your strength and the muscles have to respond by increasing in volume.

-

A decent nights sleep. Most healthy adults need an average of 7 to 9 hours of sleep a night. Whatever your cycle is, find it, stick with it.

-
-
-

5th: Mental Conditioning

-

What makes one person lie on a sofa eating pizza, chips and cake, while another may be up at 6am pounding the streets trying to beat a personal best? Why are some people more motivated than others? Not just at sport, exercise or at work, but in life?

-

Each of us has motivations, goals and inspirational figures that shape what we do, what we think, how we react. Some of these goals are verbalised, debated and shared, some are deep rooted and personal. It all starts in the mind.

-

Life is a mind game. All your aspirations are played out in your head. All your relationships are shaped in your head. Your mind dictates whether you fulfil your potential or live your life dreaming. It's about attitude. The good thing in life is that you can choose your attitude, you cant always choose or change the circumstances in your arena, but you can always choose or change your attitude.

-

Sport and exercise provide a framework for personal development. It appeals to people because it meets a basic, instinctive need to want to take on challenges and succeed, and encourages people to develop skills along the way.

-

It's inappropriate to talk about a healthy lifestyle, fitness regime or weight training program as a sacrifice. What top performers do is make choices. We all have choices to make, its all about attitude.

-

If you want to lose weight or gain some definition in your arms you can visualise how you want to look after you've succeeded. So many people on diets (temporary punishment!) don't actually see themselves how they want to be, getting into certain clothes. If you visualise the result in advance it'll help on days when you lose your motivation. But what is visualisation? It's the process of seeing yourself doing what it is you need to do whether running a winning race, throwing a record breaking javelin distance or lifting your heaviest weight. What the mind imagines usually creates a capacity for the body to do it.

-

What a person believes can determine the outcome. There is no doubt that in sport as in many other areas of life, there is such a thing as the self-fulfilling prophecy. If you limit your beliefs, you limit your potential to achieve.

-
-
- -
- -
- Back -
-
- - -
- -
- -

H&F Warm-ups & Cool-downs

- -
- - -

-There is no doubt that time spent on warming up and cooling down will improve an athlete's level of performance and accelerate the recovery process needed before and after training or competition. As a result, the coach must encourage the athlete to regard the warm up and cool down as an essential part of both the training session and competition itself. -

- -
-
-

Warm-up

-

Muscle stiffness is thought to be directly related to muscle injury and therefore the warm up should be aimed at reducing muscle stiffness.

-

Warming up should at least consist of the following:

-
    -
  • 5 to 10 minutes jogging to increase body temperature
  • -
  • 10 to 15 minutes dynamic stretching exercises to reduce muscle stiffness
  • -
  • 10 to 15 minutes general and event specific drills to prepare for the session or competition: e.g. for a runner: -
      -
    • Lower leg drills
    • -
    • Leg drills
    • -
    • Technique drills
    • -
    -
  • -
  • 4 to 8 easy run outs over 30 to 60 metres - focus on correct running technique (Tall, Relaxed, Smooth and Drive)
  • -
-

Dynamic stretches are more appropriate to the warm up as they help reduce muscle stiffness. Static stretching exercises do not reduce muscle stiffness.

-

What are the benefits of a warm up?

-

Performance may be improved, as an appropriate warm up will result in an:

-
    -
  • Increased speed of contraction and relaxation of warmed muscles
  • -
  • Dynamic exercises reduce muscle stiffness
  • -
  • Greater economy of movement because of lowered viscous resistance within warmed muscles
  • -
  • Facilitated oxygen utilisation by warmed muscles because haemoglobin releases oxygen more readily at higher muscle temperatures
  • -
  • Facilitated nerve transmission and muscle metabolism at higher temperatures; a specific warm up can facilitate motor unit recruitment required in subsequent all out activity
  • -
  • Increased blood flow through active tissues as local vascular beds dilate, increasing metabolism and muscle temperatures
  • -
  • Allows the heart rate get to a workable rate for beginning exercise
  • -
  • Mentally focused on the training or competition
  • -
-
-
-

Cool-down

-

Cooling down should consist of the following:

-
    -
  • 5 to 10 minutes jogging/walking - decrease body temperature and remove waste products from the working muscles
  • -
  • 5 to 10 minutes static stretching exercises
  • -
-

Static stretches are more appropriate to the cool down as they help muscles to relax, realign muscle fibres and re-establish their normal range of movement. These stretches should be held for approximately 10 seconds.

-

What are the benefits of a cool down?

-

An appropriate cool down will:

-
    -
  • aid in the dissipation of waste products, including lactic acid
  • -
  • reduce the potential for DOMS
  • -
  • reduce the chances of dizziness or fainting caused by the pooling of venous blood at the extremities
  • -
  • reduce the level of adrenaline in the blood
  • -
  • allows the heart rate to return to its resting rate
  • -
-
-
- - -
- -
- Back -
-
- - -
- -
- -

H&F Resistance Training

- -
- - -

Resistance training is not just about building muscle that will help you look great. Its also a prehab for preventing injuries and making sure you feel great. Resistance training also turns back the clock by reversing many factors that naturally occur in the ageing process.

-

Reshaping your muscles can even help you stay leaner. Aerobic exercise burns more calories per minute and gets your metabolism into overdrive faster than resistance training. However, after you've finished weight training, your body has to use extra calories throughout the day just to sustain the new, leaner body you've built for yourself. Using weights effectively will keep your metabolism going all day long.

-

The Facts

-

Resistance training means working one muscle (or a group of muscles) against some form of resistance so that your muscles have no choice but to break down from fatigue and stress. Do it the right way, and those beaten-down muscles have no choice but to rebuild themselves so they're stronger for the next time you decide to put them through the paces.

-

No matter what tool you use to stress your muscles barbells, dumbbells, weight machines, stretch cords, medicine balls, your own body weight if you provide enough resistance to fatigue your muscles by making them repeat a movement for a given number of repetitions, you'll achieve the same goal.

-

Heres how it works: Lifting the weight one time is called a repetition (rep). A group of repetitions performed without stopping is called a set.

-

The number of reps you should do to fatigue your muscles depends on your goals. Most experts stick with using a weight you can lift, raise, or pull 8 to 15 times.

-
    -
  • For Strength - 6 to 10 reps
  • -
  • For Toning - 10 to 15 reps
  • -
  • For Endurance - 15 to 20 reps
  • -
-

…but remember, whatever amount of reps you are doing the weight needs to be heavy enough to make your muscles work. There is no point in doing a weight that's too easy, as your muscles won't be overloaded and forced to react or grow.

- -

Training Frequency

- - - -

Training Age

- - - -

Muscle Group Training

- -
- Legs - Arms -
-
- Back - Chest - Shoulders -
- -

Resources

- - - -
-
-

Are you sure you want to open this resource?

-

This action can use data, and may not work on some Android devices.

-
- - -
-
-
- -
- -
- Back -
-
- - -
- -
- -

H&F RTF 1/wk

- -
- -

LEGS

-

Squat 2 sets (12, 10)

-

Lunges 2 sets (12,10)

-

Deadlift 2 sets (12,10)

-

BACK

-

Chin-ups 2 sets (10,10) – either with assistance machine or using own bodyweight

-

Lat pull down to chest, medium grip, 2 sets (12,10)

-

Seated Row, narrow handle, 2 sets (12,10)

-

CHEST

-

Flat Dumbbell bench press 2 sets (12,10)

-

Incline Dumbbell Flys 2 sets (12,10)

-

Chest press machine 2 sets (12,10)

-

Optional;

-

Dips, wide grip position, 2 sets of 10 or 12.

-

SHOULDERS

-

Seated dumbbell press 2 sets (12,10)

-

Upright Row 2 sets (12,10)

-

Lateral Raise 2 sets (12,10)

-

TRICEPS

-

Lying Triceps extension 2 sets (12,10)

-

Triceps press down 2 sets (12,10)

-

BICEPS

-

Standing barbell curls 2 sets (12,10)

-

Seated Dumbbell curls 2 sets (,12,10)

- -

Back

- -
- -
- - -
- -
- -

H&F RTF 2/wk

- -
- -
    -
  • Mon: Workout 1
  • -
  • Tuesday: rest or cardio
  • -
  • Wed: rest or cardio
  • -
  • Thur: rest or cardio
  • -
  • Fri: Workout 2
  • -
-

Workout 1 – Chest, Shoulders, Triceps

-

Warm up first, then warm up specific muscle group with a couple of lighter sets, then go into the workout…

-

CHEST

-

Flat Dumbbell bench press 3 sets (15,12,10)

-

Incline Dumbbell Flys 3 sets (12,12,10)

-

Chest press machine 3 sets (15,12,10)

-

Optional;

-

Dips, wide grip position, 3 sets of 10 or 12.

-

SHOULDERS

-

Seated dumbbell press 3 sets (15,12,10)

-

Upright Row 3 sets (15,12,10)

-

Lateral Raise 3 sets (15,12,10)

-

TRICEPS

-

Lying Triceps extension 3 sets (15,12,10)

-

Triceps press down 3 sets (12,12,10)

-

Workout 2 – Legs, Back, Biceps

-

Warm up first, then warm up specific muscle group with a couple of lighter sets, then go into the workout....

-

LEGS

-

Squat 3 sets (10, 10, 10)

-

Lunges 3 sets (12,12,10)

-

Deadlift 3 sets (15,12,10)

-

BACK

-

Chin-ups 3 sets (10,10,10) – either with assistance machine or using own bodyweight

-

Lat pull down to chest, medium grip, 3 sets (15,12,10)

-

Seated Row, narrow handle, 3 sets (15,12,10)

-

BICEPS

-

Standing barbell curls 3 sets (15,12,10)

-

Seated Dumbbell curls 3 sets (12,12,10)

- -

Back

- -
- -
- - -
- -
- -

H&F RTF 3/wk

- -
- -
    -
  • Mon: Workout 1
  • -
  • Tue: rest or cardio
  • -
  • Wed: Workout 2
  • -
  • Thur: rest or cardio
  • -
  • Fri: Workout 1
  • -
  • Sat: rest or cardio
  • -
  • Sun: rest or cardio
  • -
  • Mon: Workout 2
  • -
  • Tue: rest or cardio
  • -
  • Wed: Workout 1
  • -
  • Thur: rest or cardio
  • -
  • Fri: Workout 2
  • -
-

Workout 1 – Chest, Shoulders, Triceps

-

Warm up first, then warm up specific muscle group with a couple of lighter sets, then go into the workout....

-

CHEST

-

Flat Dumbbell bench press 3 sets (15,12,10)

-

Incline Dumbbell Flys 3 sets (12,12,10)

-

Chest press machine 3 sets (15,12,10)

-

Optional;

-

Dips, wide grip position, 3 sets of 10 or 12.

-

SHOULDERS

-

Seated dumbbell press 3 sets (15,12,10)

-

Upright Row 3 sets (15,12,10)

-

Lateral Raise 3 sets (15,12,10)

-

TRICEPS

-

Lying Triceps extension 3 sets (15,12,10)

-

Triceps press down 3 sets (12,12,10)

-

Workout 2 – Legs, Back, Biceps

-

Warm up first, then warm up specific muscle group with a couple of lighter sets, then go into the workout....

-

LEGS

-

Squat 3 sets (10, 10, 10)

-

Lunges 3 sets (12,12,10)

-

Deadlift 3 sets (15,12,10)

-

BACK

-

Chin-ups 3 sets (10,10,10) – either with assistance machine or using own bodyweight

-

Lat pull down to chest, medium grip, 3 sets (15,12,10)

-

Seated Row, narrow handle, 3 sets (15,12,10)

-

BICEPS

-

Standing barbell curls 3 sets (15,12,10)

-

Seated Dumbbell curls 3 sets (12,12,10)

- -

Back

- -
- -
- - -
- -
- -

H&F Y7&8

- -
- -

Training for years 7 & 8 should be based around aerobic activity, however there are some exercises that can be undertaken using bodyweight as resistance.

-

As a minimum you should be doing at least 30 minutes of Aerobic activity as a starter (bike, row, run, cross-train, power walk!). Try doing between 5 and 10 minutes on each, which makes the time go faster. You should get into the habit of recording what you do in those 5-10 minutes: how far you went, what the resistance was set on, how many calories you burned, etc. It'll give you a target each time you do your workout.

-

The exercises

-

These can done as a circuit, repeat the circuit 3 times.

-
    -
  • Bodyweight squats or swiss ball squats, 12 reps
  • -
  • Lunges, 12 reps
  • -
  • Step-ups onto a reebok step, 20 reps
  • -
  • Push-ups, 12 reps
  • -
  • Bench dips, 12 reps
  • -
  • Crunches, 12 reps
  • -
- -

Back

- -
- -
- - -
- -
- -

H&F Y9&10

- -
- -

Whole Body Workout – Legs, Back, Chest, Shoulders, Triceps, Biceps

-

Warm up first, then go into the workout…

-

Do this at lease twice a week, along with some cardio training or in game situations.

-

LEGS

-

Squat 2 sets (12,10)

-

Lunges 2 sets (12,10)

-

Deadlift 2 sets (12,10)

-

BACK

-

Chin-ups 2 sets (10,10) – either with assistance machine or using own bodyweight

-

Lat pull down to chest, medium grip, 2 sets (12,10)

-

Seated Row, narrow handle, 2 sets (12,10)

-

CHEST

-

Flat Dumbbell bench press 2 sets (12,10)

-

Incline Dumbbell Flys 2 sets (12,10)

-

Chest press machine 2 sets (12,10)

-

Optional:

-

Dips, wide grip position, 2 sets of 10 or 12.

-

SHOULDERS

-

Seated dumbbell press 2 sets (12,10)

-

Upright Row 2 sets (12,10)

-

Lateral Raise 2 sets (12,10)

-

TRICEPS

-

Lying Triceps extension 2 sets (12,10)

-

Triceps press down 2 sets (12,10)

-

BICEPS

-

Standing barbell curls 2 sets (12,10)

-

Seated Dumbbell curls 2 sets (12,10)

- -
- -
- - -
- -
- -

H&F Y11,12&13

- -
- -

Workout 1 (Monday) - Upper body

-

Flat Dumbbell (DB) Bench press 3x6 (this means 3 sets of 6 reps)

-

Barbell Row 3x6

-

Incline Barbell (BB) bench press 2x10

-

Lat Pull down 2x10

-

Seated DB shoulder press 2x10

-

Barbell curl 2x10

-

Workout 2 (Tuesday) - Lower body

-

Squat 3x6

-

Good morning 3x6

-

Leg extension 2x10

-

Seated calf raise 3x6

-

Workout 3 (Thursday) - Upper body

-

Incline DB press 3x6

-

Pull up 3x6

-

Flat BB bench 2x10

-

Cable row 2x10

-

Seated shoulder press 2x10

-

Barbell curl 2x10

-

Close grip bench press 2x10

-

Workout 4 (Friday or Saturday) - Lower body

-

Dead lift 3x6

-

Lunges 3x6

-

Leg curl 2x10

-

Standing calf raise 3x10

- -

Back

- -
- -
- - -
- -
- -

H&F MGT Legs

- -
- -

Basic Leg workout

-
    -
  • Warm-up: Stationary bike 3-5 minutes
  • -
  • Squat 3 sets - 15, 12, 10 increasing weight with each set
  • -
  • Leg Extension 3 sets - 15, 12, 10 increasing weight with each set
  • -
  • Lunges holding Dumbbells 2 sets - 12, 10 increasing weight each set
  • -
  • Leg Curl machine 3 sets - 15, 12, 10 increasing weight with each
  • -
  • Deadlift 3 sets - 15, 12, 10 increasing weight with each set
  • -
  • Step-ups holding dumbbells 3 sets - 10, 10, 10
  • -
-

Super-set Leg workout

-
    -
  • Warm-up: Stationary bike 3-5 minutes, then 2 sets of bodyweight squats, 15-20 reps
  • -
  • Leg Extension, 12 reps, then Squat, 12 reps, with no rest in between sets
  • -
  • Repeat three times, set number 2 increase weight and perform 10 reps, same for set number 3.
  • -
  • Leg Curl, 12 reps, then Deadlift, 12 reps, with no rest in between sets
  • -
  • Repeat three times, set number 2 increase weight and perform 10 reps, same for set number 3.
  • -
- -

Back

- -
- -
- - -
- -
- -

H&F MGT Back

- -
- -

Basic Back Workout

-

Warm-up: Rower 3-5 minutes

-

Chin-ups 3 sets - 10, 10, 10 reverse grip. Change to overhand grip and wider hand position to increase difficulty.

-

Seated Rows 3 sets - 15, 12, 10 increasing weight with each set

-

Lat Pull-downs 3 sets - 15, 12, 10 increasing weight each set

-

Dumbbell pullovers 3 sets - 15, 12, 10 increasing weight with each

-

Back extensions using Swiss Ball 3 sets - 10, 10, 10 increasing weight with each set

- -

Back

- -
- -
- - -
- -
- -

H&F Y9&10

- -
- -

Basic Chest Workout

-

Warm-up : Rower 3-5 minutes

-

Chest Press machine 3 sets (15,12,10). Increase weight with each set.

-

Dumbbell Bench press (flat or incline) 3 sets. (15,12,10). Increase weight with each set.

-

Parallel Bar Dips 3 sets (10,10,10)

-

Flys (flat or incline) 3 sets (15, 12, 10). Increase weight with each set.

- -

Back

- -
- -
- - -
- -
- -

H&F Y9&10

- -
- -

Basic Shoulder Workout

-

Warm-up : Rower 3-5 minutes

-

Standing Barbell Shoulder Press 3 sets (15,12,10). Increase weight with each set.

-

Seated Dumbbell Shoulder press 3 sets. (15,12,10). Increase weight with each set.

-

Lateral Raise 3 sets (10,10,10)

-

Upright Row 3 sets (15, 12, 10). Increase weight with each set.

- -

Back

- -
- -
- - -
- -
- -

H&F Y9&10

- -
- -

Basic Arm Routine

-

Warm-up : 3-5 minutes on Rower

-

Triceps

-

Parallel Bar Triceps Dips 3 sets (10,10,10).

-

Lying Dumbbell Triceps Extension 3 sets (15,12,10). Increase weight with each set.

-

Close grip machine Bench Press 3 sets (15,12,10). Increase weight with each set.

-

Biceps

-

Standing Barbell Curls 3 sets (15,12,10). Increase weight with each set.

-

Seated Dumbbell Curls 3 sets (15,12,10). Increase weight with each set.

-

Chin-ups 3 sets (10,10,10).

- -

Back

- -
- -
- - -
- -
- -

Super Seven Strength

- -
- -

It’s absolutely essential you warm up first, 5/10 mins of light CV, then low weight reps until thoroughly warmed up.

-
    -
  1. Squats - 4 sets (heavy one week, moderate the next). 15/12/12/10 reps (moderate week, bodyweight x 20 reps, 3 sets.)
  2. -
  3. Lunges - 3 sets. 8/8/8 reps on each leg.
  4. -
  5. Deadlifts - 3 sets. 15/12/10 reps
  6. -
  7. Pullups - 2 sets, to failure. Aim for 10, then 5.
  8. -
  9. Bent over Rows - 2 sets. 12/10.
  10. -
  11. Bench Press - 3 sets. 12/10/8
  12. -
  13. Core - 3 sets of, swiss-ball roll-outs x 12/plank 45secs/supermans x 10
  14. -
-

If you can make the reps easily then increase the weight. The last couple of reps should be difficult/almost failure. Try to do this at least twice a week (Mon & Fri). Record what you do.

-

Forget the beach exercises (arm training!) until you've completed the above routine. Biceps and Triceps are already being used doing the above moves.

-

Back

- -
- -
- - - -
- -
- -

H&F Aerobic Training

- -
- - -

What is Aerobic Training?

-

Also known as cardiovascular exercise, it is any sustained, rhythmic activity that involves large muscle groups. Aerobic exercise makes the lungs work harder as the body’s need for oxygen is increased.

-

What are the benefits of aerobic exercise?

-

There are numerous benefits for health and general well being to be gained from regular cardiovascular exercise:

-
    -
  • Increased energy levels
  • -
  • Reduced stress and improved mental health (due to the release of endorphins in the brain)
  • -
  • Increased heart and lung efficiency
  • -
  • Reduced blood pressure, resting heart rate and risk of stroke or heart attack
  • -
-

Does aerobic exercise aid weight loss?

-

Weight is lost by creating a calorie deficit, burning more calories than you take in, so undertaking activities that burn large amounts of calories is an excellent accompaniment to a calorie controlled diet to help shift those unwanted pounds.

-

For example, half an hour of low paced jogging can burn around 300 calories. This can make a substantial contribution towards achieving the necessary calorie deficit to lose weight, or alternatively it can earn you a bar of chocolate that you feel less guilty about eating.

-

Aerobic exercises: At home

-

It is not essential to join a gym or to go out in the middle of winter to get an aerobic workout. There are a number of exercises that you can do in the privacy of your own home.

-

The cheapest options being putting on your favourite CD and dancing around the living room or giving the house a vigorous clean.

-

There is also an ever increasing array of affordable home fitness products available, such as steps, skipping ropes (remember to put your breakables a safe distance away), dance mats that you can use with your games console and exercise videos so that you can workout with your favourite celebrity.

-

Aerobic exercises: Outdoors

-

Even taking a few extra brisk walks can be enough to improve fitness and receive the benefits of aerobic exercise, just as long as you are working hard enough that your heart rate is increased and you are breathing faster.

-

Running, jogging or going out for a bike ride when the weather’s nice are all good forms of aerobic exercise.

-

Pretty much any exercise is better than no exercise at all, however, team sports are often less effective for developing aerobic fitness as while they involve periods where large amounts of energy is expended, these are often surrounded by periods of activity where the heart rate is allowed to drop.

-

The real benefits of aerobic exercise come from constant movement.

-

Aerobic exercises: Down the gym (or the TDA Fitness suite!)

-

Your local gym will provide a wide variety of aerobic options, such as treadmills, cross trainers, exercise bikes, stair masters, rowing and ski machines so that you can just switch on and get started with your workout. It can be a good idea to diversify between different machines and different speeds/levels of resistance as your body can get used to a certain routine and after a number of sessions the same routine will not work your heart and lungs as much as it once did.

-

For those who prefer to work out as part of a group, many gyms provide classes, such as various forms of dance, body pump, body combat and step aerobics with a trained instructor to ensure that you get the most out of your workout.

-

If you have access to a pool, swimming is also a very effective cardiovascular activity. As it is very low impact it is often suitable for people who have had injuries or problems with muscles or joints.

-

How often to train?

-

For good cardiovascular fitness it is generally recommended to exercise 3 to 5 times a week and for 30-60 minutes, not including warming up at the start and cooling down at the end.

-

The main thing is to ensure that your heart and lungs are worked hard enough and for long enough to gain the benefits of aerobic exercise but not so long that you run the risk of injury. To check whether you are working out at the correct intensity, you should be out of breath but still capable of speaking.

-

It is important to start slowly. If you have been inactive for some time, don’t throw on your trainers and set off on a ten mile run.

-

If a half an hour session feels like too much, start with 10 minute sessions for the first week then increase that to 15 or 20 minute sessions the next week and so on until you feel comfortable exercising for longer.

-

Make sure that you listen to your body. It’s ok for muscles to be tired, but if they or your joints start to feel sore or breathing becomes uncomfortable slow down or stop to ensure that you are in a fit state for your next session.

- -

Resources

- - - -
-
-

Are you sure you want to open this resource?

-

This action can use data, and may not work on some Android devices.

-
- - -
-
-
-
-
-

Are you sure you want to open this resource?

-

This action can use data, and may not work on some Android devices.

-
- - -
-
-
-
-
-

Disabled

- -

This external resource has been removed since it no longer exists. This button, along with this message, will be completely removed in a future update. Sorry for the inconvenience.

- -
- - -
-
-
- -
- -
- Back -
-
- - -
- -
- -

Training Zones

- -
- Training Zones -
- Close - Training Zones - -
- -

The Energy Efficient zone 60-70%: Training within this zone develops basic endurance and aerobic capacity. All easy recovery running should be completed at a maximum of 70%. Another advantage to running in this zone is that while you are happily fat burning you may lose weight and you will be allowing your muscles to re-energise with glycogen, which has been expended during those faster paced workouts.

-

The Aerobic zone 70-80%: Training in this zone will develop your cardiovascular system. The body's ability to transport oxygen to, and carbon dioxide away from, the working muscles can be developed and improved. As you become fitter and stronger from training in this zone it will be possible to run some of your long weekend runs at up to 75%, so getting the benefits of some fat burning and improved aerobic capacity.

-

The Anaerobic Zone 80-90%: Training in this zone will develop your lactic acid system. In this zone, your individual anaerobic threshold (AT) is found - sometimes referred to the point of deflection (POD). During these heart rates, the amount of fat being utilised as the main source of energy is greatly reduced and glycogen stored in the muscle is predominantly used. One of the by-products of burning this glycogen is lactic acid. There is a point at which the body can no longer remove the lactic acid from the working muscles quickly enough. This is your anaerobic threshold (AT). Through the correct training, it is possible to delay the AT by being able to increase your ability to deal with the lactic acid for a longer period of time or by pushing the AT higher.

-

The Red-line Zone 90-100%: Training in this zone will only be possible for short periods. It effectively trains your fast twitch muscle fibres and helps to develop speed. This zone is reserved for interval running and only the very fit are able to train effectively within this zone.

- -

Back

- -
- -
- - -
- -
- -

Fitness Testing

- -
-

This test is designed to measure your cardiovascular endurance

-

Using a 12 inch high bench (or a similar sized stair in your house), step on and off for 3 minutes.

-

Step up with one foot and then the other. Step down with one foot followed by the other foot.

-

Try to maintain a steady four beat cycle. It's easy to maintain if you say "up, up, down, down".

-

Go at a steady and consistent pace.

-

At the end of 3 minutes, remain standing and immediately check your heart rate by taking your pulse…

- - Fitness Testing Boys Table -
- Close - Fitness Testing Boys Table - -
- - Fitness Testing Girls Table -
- Close - Fitness Testing Girls Table - -
- -

The Aerobic zone 70-80%: Training in this zone will develop your cardiovascular system. The body's ability to transport oxygen to, and carbon dioxide away from, the working muscles can be developed and improved. As you become fitter and stronger from training in this zone it will be possible to run some of your long weekend runs at up to 75%, so getting the benefits of some fat burning and improved aerobic capacity.

-

The Anaerobic Zone 80-90%: Training in this zone will develop your lactic acid system. In this zone, your individual anaerobic threshold (AT) is found - sometimes referred to the point of deflection (POD). During these heart rates, the amount of fat being utilised as the main source of energy is greatly reduced and glycogen stored in the muscle is predominantly used. One of the by-products of burning this glycogen is lactic acid. There is a point at which the body can no longer remove the lactic acid from the working muscles quickly enough. This is your anaerobic threshold (AT). Through the correct training, it is possible to delay the AT by being able to increase your ability to deal with the lactic acid for a longer period of time or by pushing the AT higher.

-

The Red-line Zone 90-100%: Training in this zone will only be possible for short periods. It effectively trains your fast twitch muscle fibres and helps to develop speed. This zone is reserved for interval running and only the very fit are able to train effectively within this zone.

- -

Back

- -
- -
- - -
- -
- -

H&F Nutrition

- -
- - -

Introduction

-

There's SO much information on nutrition that I could fill this app with it! Here's what I'll do:

-
    -
  1. Cover the basics here, and
  2. -
  3. Provide the links for you to do some research for yourself.
  4. -
-

What YOU eat will literally shape your future. It won't be someone else putting food into your mouth. You won't be force fed food you don't want. It will be YOU eating, YOU making choices about what you eat, when you eat, how much you eat. What you eat is what you are. End of story. No myths, no fads, just YOUR choices.

-

teenweightwise.com

-

eatwell.gov.uk/agesandstages/teens

-

The basics…

-

If you want to get the balance of your diet right, use the eatwell plate. The eatwell plate makes healthy eating easier to understand by showing the types and proportions of foods we need to have a healthy and well balanced diet. The eatwell plate shows how much of what you eat should come from each food group. This includes everything you eat during the day, including snacks.

-

So, try to eat:

-
    -
  • Plenty of fruit and vegetables
  • -
  • Plenty of bread, rice, potatoes, pasta and other starchy foods – choose wholegrain varieties whenever you can
  • -
  • Some milk and dairy foods
  • -
  • Some meat, fish, eggs, beans and other non-dairy sources of protein
  • -
  • Just a small amount of foods and drinks high in fat and/or sugar
  • -
  • Look at the eatwell plate to see how much of your food should come from each food group. You don’t need to get the balance right at every meal. But try to get it right over time such as a whole day or week.
  • -
-

Try to choose options that are lower in fat, salt and sugar when you can.

-

The eatwell plate is consistent with the Government’s Eight tips for eating well, published in October 2005, which are:

-
    -
  1. Base your meals on starchy foods
  2. -
  3. Eat lots of fruit and veg
  4. -
  5. Eat more fish
  6. -
  7. Cut down on saturated fat and sugar
  8. -
  9. Try to eat less salt – no more than 6g a day
  10. -
  11. Get active and try to be a healthy weight
  12. -
  13. Drink plenty of water
  14. -
  15. Don’t skip breakfast
  16. -
- -

Resources

- - - -
- -
- Back -
-
- - -
- -
- -

Nutrition Food Labelling

- -
- - -

You're standing in a supermarket aisle looking at two similar products, trying to decide which to choose. You want to make the healthier choice but, as usual, you're in a hurry. Well, help is at hand.

-

A growing number of supermarkets and food manufacturers are using traffic light colours on the labels of some products to help you make your choice.

-

What do the traffic light colours mean?

-

If we want to eat a healthy diet, one of the key things we should be doing is trying to cut down on fat (especially saturated fat), salt and added sugars.

-

Food products with traffic light labels on the front of the pack show you at-a-glance if the food you are thinking about buying has high, medium or low amounts of fat, saturated fat, sugars and salt, helping you get a better balance.

-

In addition to traffic light colours you will also see the number of grams of fat, saturated fat, sugars and salt in what the manufacturer or retailer suggests as a 'serving' of the food.

-

So, if you see a red light on the front of the pack, you know the food is high in something we should be trying to cut down on. It's fine to have the food occasionally, or as a treat, but try to keep an eye on how often you choose these foods, or try eating them in smaller amounts.

-

If you see amber, you know the food isn't high or low in the nutrient, so this is an ok choice most of the time, but you might want to go for green for that nutrient some of the time.

-

Green means the food is low in that nutrient. The more green lights, the healthier the choice.

-

Many of the foods with traffic light colours that you see in the shops will have a mixture of red, amber and greens. So, when you're choosing between similar products, try to go for more greens and ambers, and fewer reds, if you want to make the healthier choice.

-

The traffic light colours will make it easier for you to compare products at-a-glance. The label also tells you how much of each nutrient is in a portion, so if two labels have similar colours you can compare these figures, and choose the one that is lower to make a healthier choice.

-

But remember, it's all about getting the overall balance of our diet right.

-

How do traffic light colours fit into a healthy diet?

-

If you want to choose a healthy diet, you should:

-
    -
  • base your meals on starchy foods such as wholegrain bread, pasta and rice
  • -
  • eat lots of fruit and vegetables, which means try to go for at least five portions of a variety every day
  • -
  • have some protein-rich foods such as meat, fish, pulses, milk and dairy foods
  • -
  • keep foods (and drinks) high in fat, especially saturated fat, sugars or salt to a minimum
  • -
-

Traffic light colours can help you get the balance right by helping you to choose between products and keep a check on the amount of foods high in fat, sugars and salt that you are eating. You can use the signpost labelling to help put you in control, so keep a look out for the colours on the front of food packs.

-

Making the healthy choice isn't always easy – sometimes there seems to be so much to remember. But with traffic light colours you just need to go for as many greens as you can and avoid choosing too many reds. This way you'll know you'll be making a healthier choice.

-

You should also try to remember that although some products may contain a lot of sugars, they can be healthier choices if they contain lots of fruit. You can tell this by checking the ingredients list; the higher up the ingredients list the more fruit there is.

-

Check it out

-

Some products you might have thought were healthy choices could qualify for red lights.

-

Try comparing the fat and salt content of your favourite sandwich with other sandwiches. For example, a Waitrose poached salmon and cucumber sandwich qualifies for three green lights. Does your sandwich?

-

What do the different traffic lights look like?

-

Although the traffic light label designs may look different, you can still compare these foods because the companies are all using the Food Standards Agency guidelines. So when, for example, you are deciding between two pizzas, check out the colours to make a healthier choice.

-

Which foods have traffic light colours on them?

-

All of the manufacturers and retailers shown above are using traffic light labelling on some or all of their products, and the Agency is also in discussions with other companies that are considering using it.

-

Awareness of traffic light labelling is also on the increase in the service sector, with train companies such as GNER and Virgin, Roadchef motorway service stations, and shoppers websites such as Mysupermarket.com all using the Agency's recommended approach.

-

The Agency recommends that traffic light colours are used on processed convenience foods such as ready meals, pizzas, sausages, burgers, pies, sandwiches and breakfast cereals.

-

This is because people have told us that they find it difficult to understand the nutritional content of these sorts of foods.

-

When will the traffic light colours be in other supermarkets and in my local shop?

-

The FSA is continuing to encourage as many supermarkets, manufacturers and service providers as possible to use this approach.

-

If you'd like to see them in your supermarket, or on your favourite products, why not contact the supermarket or manufacturer yourself?

-

Please let us know what you think of traffic light labelling by completing our feedback form available at the link below.

-

How can I get more nutritional information?

-

The traffic light colours on the front of food packs are a quick and easy guide, but when you have time, and if you are particularly interested in finding out more, you can still check the back of packs for more information.

-

On the back of some food packs, you will find the nutrition panel, Guideline Daily Amounts information and the ingredients list.

-

Nutrition panel

-

You often see this panel on the back of food packs. It gives the nutritional breakdown of the food.

-

This is the sort of information you might see: the amount of energy, protein, carbohydrates, sugars, fat, dietary fibre and sodium.

-

You can use this information to help you make healthier choices.

-

Guideline Daily Amounts

- GDA -
- Close - GDA - -

An example of a GDA. Source

- -
-

Guideline Daily Amounts (GDAs) were developed by food manufacturers and retailers and you can find out more by visiting the IGD website. IGD is a food and grocery industry research organisation.

-

Ingredients list

-

To get a feel for whether a product is high in a certain ingredient such as fat, salt or added sugars, you might need to look at the ingredients list.

-

Ingredients lists always start with the biggest ingredient first and are listed in descending order of weight at the time they were used to make the food

- -
- -
- Back -
-
- - -
- -
- -

Nutrition Classification

- -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
CarbohydratesEnergy can be stored in the body in the form of carbohydrates and this is particularly important for endurance performers, who may not be able to restock their energy stores adequately while they are competing. Carbohydrates are high in glucose and enter the blood. Excess glucose is stored as glycogen in the liver and muscles. Extra glucose is not wasted, but converted into glycogen or fat and stored.Cereals, All wholegrain foods, Potato, Rice, Vegetables, Fruits, Beans, Pasta.
ProteinsIt contributes to the development and growth of hormones and haemoglobin in the blood, both of which are essential for those involved in sport or regular physical activity. Protein is necessary for the growth and repair of body tissues. It is also a relatively minor source of energy (10%).Meat, Fish, Eggs, Milk, Cheese, Cereals, Nuts.
FatsThere are many forms of fat in the body and it supplies around 70% of our energy requirements. Fat supplies energy (calories) that can either be used immediately or stored for future use. Although fat is the body’s preferred energy source, it also uses energy in the form of stored carbohydrate (glycogen) for intensive burst of energy. If we consume an excessive amount of fat, it is stored in the body tissues and causes us to become overweight. In order to avoid this, dieticians recommend that we should not consume more than ⅓rd of our daily nutritional needs in the form of fat.

Saturated – meat, burgers, sausages, butter, cheese.

-

Hydrogenated – margarine, biscuits, cakes, puddings, chocolate.

-

Polyunsaturated / Omega 6 – vegetable oils, nuts, seeds

-

Omega 3 – Oily fish, walnuts, soya beans, sweet potatoes

-

Monounsaturated – Olive oil, olives, avocados, nuts, seeds, rapeseed oil

FibreDietary fibre comprises the edible parts of plants that are not broken down and absorbed in the small intestine. It does not contain any nutrients. It therefore adds bulk to our food without adding extra kilojoules. Fibre regulates the digestive system.Whole-grain and high-fibre breakfast cereals and bread, fruit and vegetables.
MineralsMinerals are required by the body for a variety of functions including the formation of bones & teeth, as essential constituents of body fluids & tissues, components of enzyme systems, and nerve function.

Calcium for bones and teeth – milk, cheese, dairy products.

-

Magnesium for energy metabolism – dark green leafy vegetables, grains and nuts.

-

Sodium for regulating body fluids - salted foods, crisps, canned foods.

-

Potassium for water and electrolyte balance – dried fruits, bananas, berries, veg, milk.

-

Iron for formation of haemoglobin/oxygen transport – spinach, dark green veg, liver, red meat, nuts, peas

-

Iodine for hormone formation – salt water fish, milk.

Vitamins

Vitamins are chemical compounds found in the food we eat. Our bodies cannot make vitamins so must take them from our food. Vitamins perform the following functions: aiding growth, increasing resistance to infection, regulating some body functions such as good vision, and helping the metabolism of certain foods.

-

There are two main groups of Vitamins:

-
    -
  1. FAT Soluble Vitamins – Vitamins A, D, & K, they can be stored in our body.
  2. -
  3. WATER Soluble Vitamins – Vitamins C & B, They cannot be stored in the body.
  4. -

Vitamin A – Liver, whole milk, cheese, butter, carrots, leafy veg.

-

Vitamin D – Oily fish, eggs, butter, and meat.

-

Vitamin K – most plant and animal sources, also made by bacteria in the gut.

-

Vitamin C – plant sources, fresh milk, liver.

-

Vitamin B1 – Whole grains, nuts, meat.

-

Vitamin B2 – milk, eggs, breakfast cereals, liver, green veg.

-

Niacin – meat.

-

Vitamin B6 – beef, fish, poultry, eggs, whole grains, some veg.

-

Vitamin B12 – milk, meat, eggs.

WaterWater makes up 70% of the human body. It is essential for the correct functioning of virtually all living cells. Water has many functions: it provides the medium in which most reactions in the body occur, it acts as a lubricant for joints and eyes, and it helps regulate body temperature. The amount of water we drink varies from person to person, depending on age, time of year, climatic conditions, diet, the amount of physical activity we do. Dehydration is common amongst athletes, especially in hot climates, or at altitude. As little as a 2% loss of bodyweight can result in impaired responses and performance. Water replacement is essential before, during and after exercise.

Tap water is suitable for replacing lost fluid following mild or moderate exercise.

-

Isotonic drinks are more suitable after vigorous or prolonged exercise.

- -
- -
- Back -
-
- - -
- -
- -

H&F CC Core Stability

- -
- - -

Core Stability

-

The aim of core stability training is to effectively recruit the trunk musculature and then learn to control the position of the lumbar spine during dynamic movements. The information presented on this page is based on an article written by Raphael Brandon that was first published in Peak Performance.

-

The Muscles

-

The deep trunk muscles, Transversus Abdominis (TA), multifidus (MF), Internal Oblique (IO), paraspinal, pelvic floor, are key to the active support of the lumbar spine. The co-contraction of these muscles produce forces via the "theracolumbar fascia" (TLF) and the "intra-abdominal pressure" (IAP) mechanism which stabilise the lumbar spine, and the paraspinal and MF muscles act directly to resist the forces acting on the lumbar spine.

-

It is not just the recruitment of these deep-trunk muscles, but how they are recruited that is important. Hodges and Richardson (1996) showed that the co-contraction of the TA and MF muscles occurred prior to any movement of the limbs. This suggests that these muscles anticipate dynamic forces that may act on the lumbar spine and stabilise the area prior to any movement. Hodges and Richardson showed that the timing of co-ordination of these muscles was very significant.

-

Training

-

Having identified the key muscles and how they act, the next step is to establish how best to train these muscles. As with any type of strength and conditioning training, the training protocol for improving the function of the deep-trunk muscles must be specific to the task required. This specificity of training must take into account the type of contraction, the muscle fibre type and the anatomical position required. By definition, the deep-trunk muscles act as "stabilisers" and are not involved in producing movements, but instead involve static, or isometric, contractions. Furthermore, they must act as stabilisers continuously throughout everyday activities as well as fitness and sport activities, and so require very good endurance of low-level forces. These muscles do not need to be very strong, but they must be correctly coordinated and capable of working continuously. In addition, we want these stabiliser muscles to act by holding the lumbar spine in the neutral position, which is the correct alignment of the pelvis that allows for the natural 'S' curve of the spine. These characteristics underpin the following deep-trunk muscle training program.

-

The basics

-

Core-stability training begins with learning to co-contract the TA and MF muscles effectively as this has been identified as key to the lumbar-support mechanism. To perform the TA and MF co-contraction, you must perform the "abdominal hollowing" technique with the spine in the neutral position.

-

To do this use the following guidelines:

-
    -
  • Start by lying on your back with knees bent
  • -
  • Your lumbar spine should be neither arched up nor flattened against the floor, but aligned normally with a small gap between the floor and your back. This is the "neutral" lumbar position you should learn to achieve
  • -
  • Breathe in deeply and relax all your stomach muscles
  • -
  • Breathe out and, as you do so, draw your lower abdomen inwards as if your belly button is going back towards the floor. Pilates teachers describe this as "zipping up", as if you are fastening up a tight pair of jeans
  • -
  • Hold the contraction for 10 seconds and stay relaxed, allowing yourself to breathe in and out as you hold the tension in your lower stomach area
  • -
  • Repeat 5-10 times
  • -
-

It is vital that you perform this abdominal hollowing exercise correctly otherwise you will not recruit the TA and MF effectively. Bear in mind the following points:

-
    -
  • Visualise the deep abdominal muscles as a corset that wraps round the abdomen
  • -
  • Place one hand above the umbilicus (belly button) and one below
  • -
  • Slowly draw in the lower abdomen, below the umbilicus, without drawing in the upper abdomen
  • -
  • Hold the contraction whilst breathing normally
  • -
  • Aim for a 10 second contraction, repeating it 10 times
  • -
  • Do not let the whole stomach tense up or your upper abdominals bulge outwards, as this means you have cheated by using the large rectus abdominus muscle (the six-pack) instead of TA
  • -
  • Do not brace your TA muscle too hard; just a gentle contraction is enough. Remember it's endurance not max strength your are trying to improve
  • -
  • Do not tilt your pelvis nor flatten your back, as this means you have lost the neutral position you are trying to learn to stabilise
  • -
  • Do not hold your breath, as this means you are not relaxed. You must learn to breathe normally and maintain the co-contraction of TA and MF
  • -
  • Use your fingers for biofeedback on either side of your lower abdomen (below the umbilicus) to feel the tension in the TA muscle
  • -
-

Once you have mastered the abdominal hollowing lying on your back, practice it lying on your front, four-point kneeling, sitting and standing. In each position, get your lumbar spine into neutral before you perform the hollowing movement.

- -
- -
- Back -
-
- - -
- -
- -

H&F CC Exercises

- -
- - -

The next step

-

Having learned to recruit the TA and MF muscles correctly in various positions, which can take anything from one session to one month or more, it is time to move onto simple core stability exercises. These exercises may also involve the oblique muscles, other lumbar muscles and gluteals to assist the TA and MF in maintaining the lumbar spine in a stable neutral position.

-

Lying leg lift stabilisation

-
    -
  • Lying on your back with your knees bent
  • -
  • Ensure your back is in neutral
  • -
  • Place your hands on your hips for biofeedback
  • -
  • Breathe in and relax
  • -
  • Breathe out and, as you do so, perform the abdominal hollowing or zipping-up action
  • -
  • Once you have established some TA tension, slowly slide your left leg out along the floor until it is straight and then slide it back
  • -
  • Your back should not have moved, and your pelvis should not have tilted as you performed this action
  • -
  • If your back or pelvis moved, you did not achieve the correct stability
  • -
  • Repeat for the other side 10 times each leg
  • -
  • Variations include the same exercise with knee lifts up and knee drops out to the side. Again, the aim is to retain a stable lumbar spine in the neutral position as the legs move.
  • -
  • he waiter's bow
  • -
  • Stand up with good posture, knees soft, lumbar spine in neutral, head up and shoulders back and relaxed
  • -
  • Breathe in and relax
  • -
  • Breathe out and as you do so perform the abdominal hollowing action
  • -
  • Keeping the tension, slowly lean forward from the hips 20° and stop, like a waiter's bow, keeping your back completely straight and long as you lean
  • -
  • Hold the lean position for 10 seconds - you will feel your TA and MF supporting you if you hold the correct position
  • -
  • Keeping the tension and the alignment, slowly return to your start position
  • -
  • Repeat 10 times
  • -
-

These exercises are two examples of learning how to keep the spine in neutral, using slow and controlled static contractions of the trunk stabiliser muscles. Notice how technique is vital and the aim is to build up the time you are able to maintain good stability.

-

Getting functional

-

The ultimate aim of core stability training is to ensure the deep trunk muscles are working correctly to control the lumbar spine during dynamic movements, e.g. lifting a heavy box or running. Therefore, it is important that once you have achieved proficiency of the simple core exercises, you must progress on to achieving stability during more functional movements. Try the following two exercises.

-

The lunge

-
    -
  • Stand with feet hip width apart in front of a mirror
  • -
  • Ensure your lumbar spine is in neutral and your back is tall with your shoulders back and head up
  • -
  • Lunge forward and bend your knee only halfway down
  • -
  • Ensure that your front knee is in line with your toes and your back has remained upright with your lumbar spine in neutral and your hips level
  • -
  • Push back up, initiating the movement by pushing down into the floor with your front foot
  • -
  • The force from your legs should bring you back up quickly and easily to your start position
  • -
  • Your back should have remained totally still and your hips level as you performed the push back
  • -
-

Many people wrongly initiate the up movement by pulling their heads and shoulders back first. This extends the lumbar spine, losing the neutral position. Others have problems keeping their pelvis level while performing the lunge. You must learn to use your deep trunk and gluteal muscles to hold your lumbar spine in neutral and pelvis level as you perform the movement up and down. The movement should only come from the leg muscles.

-

The Press-up

-
    -
  • Start from your knees, even if this means it is easy for your upper body, to learn the correct technique
  • -
  • Your hands should be slightly wider than your shoulders and your head must be in front of your hands
  • -
  • Lift your hips so that there is a straight line from your knees through your pelvis and lower back, through your shoulders and all the way to your head
  • -
  • Ensure your lumbar spine is in neutral, using a mirror or a partner/trainer to help you
  • -
  • To maintain a neutral spine and a straight back during the exercise, the trunk muscles must provide active support
  • -
  • Slowly lower down, bending your arms all the way to the floor. Keep your head still with your neck straight relative to your back
  • -
  • Push up, initiating the movement by pressing down into the floor with your hands
  • -
  • Your back should remain straight and your lumbar spine in neutral throughout the exercise.
  • -
-

These two exercises enable you to learn core stability while performing dynamic movements. By reducing the resistance i.e. doing only half lunges and knee press ups, your are able to focus on the trunk stabilisers and achieving perfect technique rather than working the major muscle groups. The whole essence of core stability training is quality of movement and relaxation. The more you practice, the easier it becomes until you can control your lumbar stability at all times and during complex movements.

- -
- -
- Back -
-
- - -
- -
- -

H&F CC Static & Dynamic Core

- -
- - -

Static Floor Exercises

- Plank -

Hold a straight body position, supported on elbows and toes. Brace the abdominals and maintain a straight body line through feet, hips and head.

- Side plank -

Lie on one side, ensuring the top hip is above the bottom hip. Push up until there is a straight body line through feet, hips and head. Keep the elbow under the shoulder. Lower under control and repeat on opposite side.

- Bridge -

Lie on the floor with your knees bent and feet flat on the floor. Squeeze your gluteals and then push your hips up until there is a straight line through knee and hip to upper body and shoulders remain on the floor.

- Superman -

Kneel on the floor and place your hands below your shoulders and knees below your hips. Extend right leg back and the left arm forward. Maintain a straight body line through extended leg, body and extended arm. Repeat with opposite limbs

-

Dynamic Floor Exercises

- Side lying hip abduction -

Lie on your side with your top hip above the lower hip. Brace the abdominals and lift the top leg slowly up and down.

- Oblique crunch -

Lie on your back with your right ankle resting on your left knee. Right arm is placed on the floor out to the side. Keeping the right shoulder down, curl the left shoulder up to the right knee. Repeat with opposite limbs.

- Straight leg raise -

Lie on your back with knees bent. Brace your abdominals and lift your legs up straight in the air to an angle of 45 degrees keeping you back on the ground. Keeping one leg in the air, slowly lower the other down to the floor. Only go as far as you can until you feel the lumbar spine start to move. Keep bracing the abdominals and then lift the leg slowly back up. Repeat with the other leg.

- Lying windscreen wipers -

Lie on your back with arms out to the sides. Lift your legs straight up in the air until the hips are at 90 degrees. Keeping your legs straight and maintaining the hip angle, rotate the legs to one side. Go as far as you can keeping your upper back and shoulders on the floor. Bring the legs to a halt, pull them back up to the start position and then over to the other side.

- -
- -
- Back -
-
- - -
- -
- -

H&F How do I?

- -
- - -

I want to burn calories quickly…

-

Answer: Interval training. It doesn’t matter what you do, run, row, or jog on the spot. If you do these exercises at FULL pace (after a warm up) for 20 seconds, then have a 40 second rest, repeating this for up to 5 minutes, it will burn a huge amount of calories. The good thing about this type of training is that your metabolism is given a jump-start so it keeps burning calories for hours after you have finished.

-

I want a fast fitness workout…

-

Answer: Crossfit training. This type of training focuses on strength and endurance training and is scalable to your own fitness and ability level. It also burns lots of calories. For example, a favourite of mine is to do 5 pull-ups, 10 push-ups then 15 bodyweight squats, one after the other, no rest. Each time you complete this its one rep. The idea is that you do as many reps as you can in 10 minutes. If you can’t do the pull-ups then swap them for something like bench-dips or anything you can do.

-
-

Here are a few crossfit routines:

- -
-

How do I lose weight?

-

Answer: Eat sensibly, increase your activity. We all know when the food we eat is a ‘treat’ or something that’s ‘clean’. The difference between the two is our own motivation. If we have a goal or a beach holiday coming up its much easier to be strict with what we eat. The way I look at it is this; its MUCH easier to stay in shape than to GET in shape. Maintenance is the key to a healthy weight, once you get there. Fast answer; walk briskly when you walk, jog up the stairs, bike instead of getting a lift, say no to the second helping, and yes just once a week to treats… you get the picture.

-

So try crossfit and interval training as faster ways to increase your activity. If this is too intense then start with 10 minutes on the cross-trainer or bike. Get into the habit of doing this and you will see a difference in your health.

-

How do I get bigger?

-

Answer: Just wait a few months. If you train regularly and eat well you will grow stronger and as a result, bigger. Steer clear of eating junk and sugary foods, they will slow you down and lower your performance generally, compared to a balanced diet.

-

How do I tone my legs?

-

Answer: Squats, lunges, running, rowing and eating less fatty foods. Your tone/muscles will show up if the fat under your skin is low enough. The training will promote muscle development and the correct nutrition will create the definition that results in toned legs, or arms, shoulders and stomach. Toning your upper body can be achieved by doing push-ups and stomach crunches as a starting point.

- -
- -
- Back -
-
- - -
- -
- -

Crossfit Routines

- -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Angie -
    -
  • 100 Pull-ups
  • -
  • 100 Push-ups
  • -
  • 100 Sit-ups
  • -
  • 100 Squats
  • -
-
For Time. Complete all reps of each exercise before moving to the next.
Barbara -
    -
  • 20 Pull-ups
  • -
  • 30 Push-ups
  • -
  • 40 Sit-ups
  • -
  • 50 Squats
  • -
-

Rest precisely three minutes between each round.

-
5 rounds, time each round.
Chelsea -
    -
  • 5 Pull-ups
  • -
  • 10 Push-ups
  • -
  • 15 Squats
  • -
-
Each min on the min for 30 min.
Cindy -
    -
  • 5 Pull-ups
  • -
  • 10 Push-ups
  • -
  • 15 Squats
  • -
-
As many rounds as possible in 20 min.
Fran -
    -
  • Thruster 95 lbs
  • -
  • Pull-ups
  • -
-
21-15-9 reps, for time.
Karen -
    -
  • Wall-ball 150 shots
  • -
-
For time.
Nancy -
    -
  • 400 meter run
  • -
  • Overhead squat 95 lbs x 15
  • -
-
5 rounds for time.
Kelly -
    -
  • Run 400 meters
  • -
  • 30 box jump, 24 inch box
  • -
  • 30 Wall ball shots, 20 pound ball
  • -
-
Five rounds for time.
Nicole -
    -
  • Run 400 meters
  • -
  • Max rep Pull-ups
  • -
-
As many rounds as possible in 20 minutes.
TDA 5 -

Five rounds of:

-
    -
  • 30 push-ups
  • -
  • 40 sit-ups
  • -
  • 50 Air Squats
  • -
-
For time.
Crossfit 25 -
    -
  • Sprint 100M
  • -
  • 25 push-ups
  • -
  • Sprint 100M
  • -
  • 25 crunches
  • -
  • Sprint 100M
  • -
  • 25 air Squats
  • -
  • Sprint 100
  • -
  • 25 burpees
  • -
-
Three rounds for time.
RSP -
    -
  • Run ½ mile (1 lap of back field)
  • -
  • 100 Air Squats
  • -
  • 50 push-ups
  • -
  • Run ½ mile
  • -
-
For time.
Filthy Fifty -
    -
  • 50 push-up
  • -
  • 50 squats
  • -
  • 50 crunches
  • -
  • 50 lunges
  • -
  • 50 burpees
  • -
-
For time.
Ten-minute Challenge -

One of the following:

-
    -
  • Max push-ups
  • -
  • Max Pull-ups
  • -
  • Air Squats
  • -
  • Burpees
  • -
-
Record score.
10-10-10 -

10 push-ups, 10-crunches, 10 air squats – 10 rounds of.

-

Set 10 cones, 10M apart, do 1st round at start cone then sprint to the next cone. Repeat. Sprint back from last cone.

-
Burpees for time -
    -
  • 100 burpees
  • -
-
For time.
- -

Back

- -
- -
- - -
- -
- -

H&F Info

- -
- - -

Welcome

- -

Welcome to the TDA Health & Fitness mini-site. Here you will find information on the main aspects of Health and Fitness along with other resources. If you can't find what you want on here, or require further information, please e-mail Mr Hoffmann with suggestions or ideas.

-

Before you start on ANY fitness training program, remember: if you have any injuries, medical conditions or are not sure about what to do, ask a member of staff or check with your doctor that it's fine for you to train.

-

Warm-ups. You HAVE to do them, read the WARM-UP page first and INCLUDE one with every workout, run, row, team game, individual event. Make it a HABIT and it will go along way to help you stay injury-free.

- -

Acknowledgements

- -
    -
  • ‘G-Force’, the ultimate guide to you best body ever – Gunnar Peterson
  • -
  • ‘ABSolution’ – Shawn Phillips
  • -
  • ‘Mind Games’ – Jeff Grout & Sarah Perrin
  • -
-
-

Some information also provided by Mr Hoffmann.

- -
- -
- Back -
-
+
+ + +
+
+
+
+

Welcome to Thomas Deacon Academy's Sports Enrichment app! This app contains the full timetable for the after school sports enrichment as well other fitness information.

+

For more information about this app, see the website at georgegarside.com/apps/tda-enrichment/

+
+
+
+ + + - + \ No newline at end of file diff --git a/www/jquery.mobile-1.4.0-alpha.1/images/ajax-loader.gif b/www/jquery.mobile-1.4.0-alpha.1/images/ajax-loader.gif deleted file mode 100755 index fd1a189..0000000 Binary files a/www/jquery.mobile-1.4.0-alpha.1/images/ajax-loader.gif and /dev/null differ diff --git a/www/jquery.mobile-1.4.0-alpha.1/jquery.mobile-1.4.0-alpha.1.min.css b/www/jquery.mobile-1.4.0-alpha.1/jquery.mobile-1.4.0-alpha.1.min.css deleted file mode 100755 index a28525e..0000000 --- a/www/jquery.mobile-1.4.0-alpha.1/jquery.mobile-1.4.0-alpha.1.min.css +++ /dev/null @@ -1,12 +0,0 @@ -/*! jQuery Mobile 1.4.0-alpha.1 | Git HEAD hash: d17d2ba <> 2013-07-25T22:32:20Z | (c) 2010, 2013 jQuery Foundation, Inc. | jquery.org/license */ - -/*! -* jQuery Mobile 1.4.0-alpha.1 -* Git HEAD hash: d17d2ba7a10af43dac930d1ee65b6b46268bb08d <> Date: Thu Jul 25 2013 22:32:20 UTC -* http://jquerymobile.com -* -* Copyright 2010, 2013 jQuery Foundation, Inc. and other contributors -* Released under the MIT license. -* http://jquery.org/license -* -*/.ui-icon-action:after{background-image:url(data:image/svg+xml;charset=US-ASCII,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22iso-8859-1%22%3F%3E%3C!DOCTYPE%20svg%20PUBLIC%20%22-%2F%2FW3C%2F%2FDTD%20SVG%201.1%2F%2FEN%22%20%22http%3A%2F%2Fwww.w3.org%2FGraphics%2FSVG%2F1.1%2FDTD%2Fsvg11.dtd%22%3E%3Csvg%20version%3D%221.1%22%20id%3D%22Layer_1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%20x%3D%220px%22%20y%3D%220px%22%20%20width%3D%2214px%22%20height%3D%2213px%22%20viewBox%3D%220%200%2014%2013%22%20style%3D%22enable-background%3Anew%200%200%2014%2013%3B%22%20xml%3Aspace%3D%22preserve%22%3E%3Cpath%20fill%3D%22%23FFF%22%20d%3D%22M9%2C5v3l5-4L9%2C0v3c0%2C0-5%2C0-5%2C7C6%2C5%2C9%2C5%2C9%2C5z%20M11%2C11H2V5h1l2-2H0v10h13V7l-2%2C2V11z%22%2F%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3C%2Fsvg%3E)}.ui-icon-arrow-d-l:after{background-image:url(data:image/svg+xml;charset=US-ASCII,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22iso-8859-1%22%3F%3E%3C!DOCTYPE%20svg%20PUBLIC%20%22-%2F%2FW3C%2F%2FDTD%20SVG%201.1%2F%2FEN%22%20%22http%3A%2F%2Fwww.w3.org%2FGraphics%2FSVG%2F1.1%2FDTD%2Fsvg11.dtd%22%3E%3Csvg%20version%3D%221.1%22%20id%3D%22Layer_1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%20x%3D%220px%22%20y%3D%220px%22%20%20width%3D%2214px%22%20height%3D%2214px%22%20viewBox%3D%220%200%2014%2014%22%20style%3D%22enable-background%3Anew%200%200%2014%2014%3B%22%20xml%3Aspace%3D%22preserve%22%3E%3Cpolygon%20fill%3D%22%23FFF%22%20points%3D%2214%2C3%2011%2C0%203.5%2C7.5%200%2C4%200%2C14%2010%2C14%206.5%2C10.5%20%22%2F%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3C%2Fsvg%3E)}.ui-icon-arrow-d-r:after{background-image:url(data:image/svg+xml;charset=US-ASCII,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22iso-8859-1%22%3F%3E%3C!DOCTYPE%20svg%20PUBLIC%20%22-%2F%2FW3C%2F%2FDTD%20SVG%201.1%2F%2FEN%22%20%22http%3A%2F%2Fwww.w3.org%2FGraphics%2FSVG%2F1.1%2FDTD%2Fsvg11.dtd%22%3E%3Csvg%20version%3D%221.1%22%20id%3D%22Layer_1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%20x%3D%220px%22%20y%3D%220px%22%20%20width%3D%2214px%22%20height%3D%2214px%22%20viewBox%3D%220%200%2014%2014%22%20style%3D%22enable-background%3Anew%200%200%2014%2014%3B%22%20xml%3Aspace%3D%22preserve%22%3E%3Cpolygon%20fill%3D%22%23FFF%22%20points%3D%2210.5%2C7.5%203%2C0%200%2C3%207.5%2C10.5%204%2C14%2014%2C14%2014%2C4%20%22%2F%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3C%2Fsvg%3E)}.ui-icon-arrow-d:after{background-image:url(data:image/svg+xml;charset=US-ASCII,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22iso-8859-1%22%3F%3E%3C!DOCTYPE%20svg%20PUBLIC%20%22-%2F%2FW3C%2F%2FDTD%20SVG%201.1%2F%2FEN%22%20%22http%3A%2F%2Fwww.w3.org%2FGraphics%2FSVG%2F1.1%2FDTD%2Fsvg11.dtd%22%3E%3Csvg%20version%3D%221.1%22%20id%3D%22Layer_1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%20x%3D%220px%22%20y%3D%220px%22%20%20width%3D%2214px%22%20height%3D%2214px%22%20viewBox%3D%220%200%2014%2014%22%20style%3D%22enable-background%3Anew%200%200%2014%2014%3B%22%20xml%3Aspace%3D%22preserve%22%3E%3Cpolygon%20fill%3D%22%23FFF%22%20points%3D%229%2C7%209%2C0%205%2C0%205%2C7%200%2C7%207%2C14%2014%2C7%20%22%2F%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3C%2Fsvg%3E)}.ui-icon-arrow-l:after{background-image:url(data:image/svg+xml;charset=US-ASCII,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22iso-8859-1%22%3F%3E%3C!DOCTYPE%20svg%20PUBLIC%20%22-%2F%2FW3C%2F%2FDTD%20SVG%201.1%2F%2FEN%22%20%22http%3A%2F%2Fwww.w3.org%2FGraphics%2FSVG%2F1.1%2FDTD%2Fsvg11.dtd%22%3E%3Csvg%20version%3D%221.1%22%20id%3D%22Layer_1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%20x%3D%220px%22%20y%3D%220px%22%20%20width%3D%2214px%22%20height%3D%2214px%22%20viewBox%3D%220%200%2014%2014%22%20style%3D%22enable-background%3Anew%200%200%2014%2014%3B%22%20xml%3Aspace%3D%22preserve%22%3E%3Cpolygon%20fill%3D%22%23FFF%22%20points%3D%227%2C5%207%2C0%200%2C7%207%2C14%207%2C9%2014%2C9%2014%2C5%20%22%2F%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3C%2Fsvg%3E)}.ui-icon-arrow-r:after{background-image:url(data:image/svg+xml;charset=US-ASCII,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22iso-8859-1%22%3F%3E%3C!DOCTYPE%20svg%20PUBLIC%20%22-%2F%2FW3C%2F%2FDTD%20SVG%201.1%2F%2FEN%22%20%22http%3A%2F%2Fwww.w3.org%2FGraphics%2FSVG%2F1.1%2FDTD%2Fsvg11.dtd%22%3E%3Csvg%20version%3D%221.1%22%20id%3D%22Layer_1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%20x%3D%220px%22%20y%3D%220px%22%20%20width%3D%2214px%22%20height%3D%2214px%22%20viewBox%3D%220%200%2014%2014%22%20style%3D%22enable-background%3Anew%200%200%2014%2014%3B%22%20xml%3Aspace%3D%22preserve%22%3E%3Cpolygon%20fill%3D%22%23FFF%22%20points%3D%2214%2C7%207%2C0%207%2C5%200%2C5%200%2C9%207%2C9%207%2C14%20%22%2F%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3C%2Fsvg%3E)}.ui-icon-arrow-u-l:after{background-image:url(data:image/svg+xml;charset=US-ASCII,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22iso-8859-1%22%3F%3E%3C!DOCTYPE%20svg%20PUBLIC%20%22-%2F%2FW3C%2F%2FDTD%20SVG%201.1%2F%2FEN%22%20%22http%3A%2F%2Fwww.w3.org%2FGraphics%2FSVG%2F1.1%2FDTD%2Fsvg11.dtd%22%3E%3Csvg%20version%3D%221.1%22%20id%3D%22Layer_1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%20x%3D%220px%22%20y%3D%220px%22%20%20width%3D%2214px%22%20height%3D%2214px%22%20viewBox%3D%220%200%2014%2014%22%20style%3D%22enable-background%3Anew%200%200%2014%2014%3B%22%20xml%3Aspace%3D%22preserve%22%3E%3Cpolygon%20fill%3D%22%23FFF%22%20points%3D%2214%2C11%206.5%2C3.5%2010%2C0%200%2C0%200%2C10%203.5%2C6.5%2011%2C14%20%22%2F%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3C%2Fsvg%3E)}.ui-icon-arrow-u-r:after{background-image:url(data:image/svg+xml;charset=US-ASCII,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22iso-8859-1%22%3F%3E%3C!DOCTYPE%20svg%20PUBLIC%20%22-%2F%2FW3C%2F%2FDTD%20SVG%201.1%2F%2FEN%22%20%22http%3A%2F%2Fwww.w3.org%2FGraphics%2FSVG%2F1.1%2FDTD%2Fsvg11.dtd%22%3E%3Csvg%20version%3D%221.1%22%20id%3D%22Layer_1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%20x%3D%220px%22%20y%3D%220px%22%20%20width%3D%2214px%22%20height%3D%2214px%22%20viewBox%3D%220%200%2014%2014%22%20style%3D%22enable-background%3Anew%200%200%2014%2014%3B%22%20xml%3Aspace%3D%22preserve%22%3E%3Cpolygon%20fill%3D%22%23FFF%22%20points%3D%2214%2C0%204%2C0%207.5%2C3.5%200%2C11%203%2C14%2010.5%2C6.5%2014%2C10%20%22%2F%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3C%2Fsvg%3E)}.ui-icon-arrow-u:after{background-image:url(data:image/svg+xml;charset=US-ASCII,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22iso-8859-1%22%3F%3E%3C!DOCTYPE%20svg%20PUBLIC%20%22-%2F%2FW3C%2F%2FDTD%20SVG%201.1%2F%2FEN%22%20%22http%3A%2F%2Fwww.w3.org%2FGraphics%2FSVG%2F1.1%2FDTD%2Fsvg11.dtd%22%3E%3Csvg%20version%3D%221.1%22%20id%3D%22Layer_1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%20x%3D%220px%22%20y%3D%220px%22%20%20width%3D%2214px%22%20height%3D%2214px%22%20viewBox%3D%220%200%2014%2014%22%20style%3D%22enable-background%3Anew%200%200%2014%2014%3B%22%20xml%3Aspace%3D%22preserve%22%3E%3Cpolygon%20fill%3D%22%23FFF%22%20points%3D%227%2C0%200%2C7%205%2C7%205%2C14%209%2C14%209%2C7%2014%2C7%20%22%2F%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3C%2Fsvg%3E)}.ui-icon-audio:after{background-image:url(data:image/svg+xml;charset=US-ASCII,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22iso-8859-1%22%3F%3E%3C!DOCTYPE%20svg%20PUBLIC%20%22-%2F%2FW3C%2F%2FDTD%20SVG%201.1%2F%2FEN%22%20%22http%3A%2F%2Fwww.w3.org%2FGraphics%2FSVG%2F1.1%2FDTD%2Fsvg11.dtd%22%3E%3Csvg%20version%3D%221.1%22%20id%3D%22Layer_1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%20x%3D%220px%22%20y%3D%220px%22%20%20width%3D%2214.018px%22%20height%3D%2214px%22%20viewBox%3D%220%200%2014.018%2014%22%20style%3D%22enable-background%3Anew%200%200%2014.018%2014%3B%22%20xml%3Aspace%3D%22preserve%22%3E%3Cpath%20fill%3D%22%23FFF%22%20d%3D%22M1%2C4C0.447%2C4%2C0%2C4.447%2C0%2C5v4c0%2C0.553%2C0.447%2C1%2C1%2C1h1l4%2C4V0L2%2C4H1z%20M10.346%2C7c0-1.699-1.042-3.154-2.546-3.867L6.982%2C4.68%20C7.885%2C5.107%2C8.51%2C5.98%2C8.51%2C7S7.885%2C8.893%2C6.982%2C9.32L7.8%2C10.867C9.304%2C10.154%2C10.346%2C8.699%2C10.346%2C7z%20M9.447%2C0.017L8.618%2C1.586%20C10.723%2C2.584%2C12.182%2C4.621%2C12.182%2C7s-1.459%2C4.416-3.563%2C5.414l0.829%2C1.569c2.707-1.283%2C4.57-3.925%2C4.57-6.983%20S12.154%2C1.3%2C9.447%2C0.017z%22%2F%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3C%2Fsvg%3E)}.ui-icon-calendar:after{background-image:url(data:image/svg+xml;charset=US-ASCII,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22iso-8859-1%22%3F%3E%3C!DOCTYPE%20svg%20PUBLIC%20%22-%2F%2FW3C%2F%2FDTD%20SVG%201.1%2F%2FEN%22%20%22http%3A%2F%2Fwww.w3.org%2FGraphics%2FSVG%2F1.1%2FDTD%2Fsvg11.dtd%22%3E%3Csvg%20version%3D%221.1%22%20id%3D%22Layer_1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%20x%3D%220px%22%20y%3D%220px%22%20%20width%3D%2214px%22%20height%3D%2214px%22%20viewBox%3D%220%200%2014%2014%22%20style%3D%22enable-background%3Anew%200%200%2014%2014%3B%22%20xml%3Aspace%3D%22preserve%22%3E%3Cpath%20fill%3D%22%23FFF%22%20d%3D%22M0%2C8h2V6H0V8z%20M3%2C8h2V6H3V8z%20M6%2C8h2V6H6V8z%20M9%2C8h2V6H9V8z%20M12%2C8h2V6h-2V8z%20M0%2C11h2V9H0V11z%20M3%2C11h2V9H3V11z%20M6%2C11h2V9H6V11z%20%20M9%2C11h2V9H9V11z%20M12%2C11h2V9h-2V11z%20M0%2C14h2v-2H0V14z%20M3%2C14h2v-2H3V14z%20M6%2C14h2v-2H6V14z%20M9%2C14h2v-2H9V14z%20M12%2C1%20c0-.553-.447-1-1-1s-1%2C0.447-1%2C1H4c0-.553-.447-1-1-1S2%2C0.447%2C2%2C1H0v4h14V1H12z%22%2F%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3C%2Fsvg%3E)}.ui-icon-camera:after{background-image:url(data:image/svg+xml;charset=US-ASCII,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22iso-8859-1%22%3F%3E%3C!DOCTYPE%20svg%20PUBLIC%20%22-%2F%2FW3C%2F%2FDTD%20SVG%201.1%2F%2FEN%22%20%22http%3A%2F%2Fwww.w3.org%2FGraphics%2FSVG%2F1.1%2FDTD%2Fsvg11.dtd%22%3E%3Csvg%20version%3D%221.1%22%20id%3D%22Layer_1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%20x%3D%220px%22%20y%3D%220px%22%20%20width%3D%2214px%22%20height%3D%2211px%22%20viewBox%3D%220%200%2014%2011%22%20style%3D%22enable-background%3Anew%200%200%2014%2011%3B%22%20xml%3Aspace%3D%22preserve%22%3E%3Cpath%20fill%3D%22%23FFF%22%20d%3D%22M12%2C1H9.908C9.702%2C0.419%2C9.152%2C0%2C8.5%2C0h-3C4.848%2C0%2C4.298%2C0.419%2C4.092%2C1H2C0.896%2C1%2C0%2C1.896%2C0%2C3v6c0%2C1.104%2C0.896%2C2%2C2%2C2h10%20c1.104%2C0%2C2-.896%2C2-2V3C14%2C1.896%2C13.104%2C1%2C12%2C1z%20M7%2C9C5.343%2C9%2C4%2C7.657%2C4%2C6s1.343-3%2C3-3s3%2C1.343%2C3%2C3S8.657%2C9%2C7%2C9z%20M7%2C4%20C5.896%2C4%2C5%2C4.896%2C5%2C6s0.896%2C2%2C2%2C2s2-.896%2C2-2S8.104%2C4%2C7%2C4z%22%2F%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3C%2Fsvg%3E)}.ui-icon-carat-d:after{background-image:url(data:image/svg+xml;charset=US-ASCII,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22iso-8859-1%22%3F%3E%3C!DOCTYPE%20svg%20PUBLIC%20%22-%2F%2FW3C%2F%2FDTD%20SVG%201.1%2F%2FEN%22%20%22http%3A%2F%2Fwww.w3.org%2FGraphics%2FSVG%2F1.1%2FDTD%2Fsvg11.dtd%22%3E%3Csvg%20version%3D%221.1%22%20id%3D%22Layer_1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%20x%3D%220px%22%20y%3D%220px%22%20%20width%3D%2212px%22%20height%3D%228px%22%20viewBox%3D%220%200%2012%208%22%20style%3D%22enable-background%3Anew%200%200%2012%208%3B%22%20xml%3Aspace%3D%22preserve%22%3E%3Cpolygon%20fill%3D%22%23FFF%22%20points%3D%2210%2C0%206%2C4%202%2C0%200%2C2%206%2C8%2012%2C2%20%22%2F%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3C%2Fsvg%3E)}.ui-icon-carat-l:after{background-image:url(data:image/svg+xml;charset=US-ASCII,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22iso-8859-1%22%3F%3E%3C!DOCTYPE%20svg%20PUBLIC%20%22-%2F%2FW3C%2F%2FDTD%20SVG%201.1%2F%2FEN%22%20%22http%3A%2F%2Fwww.w3.org%2FGraphics%2FSVG%2F1.1%2FDTD%2Fsvg11.dtd%22%3E%3Csvg%20version%3D%221.1%22%20id%3D%22Layer_1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%20x%3D%220px%22%20y%3D%220px%22%20%20width%3D%228px%22%20height%3D%2212px%22%20viewBox%3D%220%200%208%2012%22%20style%3D%22enable-background%3Anew%200%200%208%2012%3B%22%20xml%3Aspace%3D%22preserve%22%3E%3Cpolygon%20fill%3D%22%23FFF%22%20points%3D%228%2C2%206%2C0%200%2C6%206%2C12%208%2C10%204%2C6%20%22%2F%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3C%2Fsvg%3E)}.ui-icon-carat-r:after{background-image:url(data:image/svg+xml;charset=US-ASCII,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22iso-8859-1%22%3F%3E%3C!DOCTYPE%20svg%20PUBLIC%20%22-%2F%2FW3C%2F%2FDTD%20SVG%201.1%2F%2FEN%22%20%22http%3A%2F%2Fwww.w3.org%2FGraphics%2FSVG%2F1.1%2FDTD%2Fsvg11.dtd%22%3E%3Csvg%20version%3D%221.1%22%20id%3D%22Layer_1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%20x%3D%220px%22%20y%3D%220px%22%20%20width%3D%228px%22%20height%3D%2212px%22%20viewBox%3D%220%200%208%2012%22%20style%3D%22enable-background%3Anew%200%200%208%2012%3B%22%20xml%3Aspace%3D%22preserve%22%3E%3Cpolygon%20fill%3D%22%23FFF%22%20points%3D%222%2C0%200%2C2%204%2C6%200%2C10%202%2C12%208%2C6%20%22%2F%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3C%2Fsvg%3E)}.ui-icon-carat-u:after{background-image:url(data:image/svg+xml;charset=US-ASCII,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22iso-8859-1%22%3F%3E%3C!DOCTYPE%20svg%20PUBLIC%20%22-%2F%2FW3C%2F%2FDTD%20SVG%201.1%2F%2FEN%22%20%22http%3A%2F%2Fwww.w3.org%2FGraphics%2FSVG%2F1.1%2FDTD%2Fsvg11.dtd%22%3E%3Csvg%20version%3D%221.1%22%20id%3D%22Layer_1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%20x%3D%220px%22%20y%3D%220px%22%20%20width%3D%2212px%22%20height%3D%228px%22%20viewBox%3D%220%200%2012%208%22%20style%3D%22enable-background%3Anew%200%200%2012%208%3B%22%20xml%3Aspace%3D%22preserve%22%3E%3Cpolygon%20fill%3D%22%23FFF%22%20points%3D%226%2C0%200%2C6%202%2C8%206%2C4%2010%2C8%2012%2C6%20%22%2F%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3C%2Fsvg%3E)}.ui-icon-check:after,.ui-icon-checkbox-on:after{background-image:url(data:image/svg+xml;charset=US-ASCII,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22iso-8859-1%22%3F%3E%3C!DOCTYPE%20svg%20PUBLIC%20%22-%2F%2FW3C%2F%2FDTD%20SVG%201.1%2F%2FEN%22%20%22http%3A%2F%2Fwww.w3.org%2FGraphics%2FSVG%2F1.1%2FDTD%2Fsvg11.dtd%22%3E%3Csvg%20version%3D%221.1%22%20id%3D%22Layer_1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%20x%3D%220px%22%20y%3D%220px%22%20%20width%3D%2214px%22%20height%3D%2212px%22%20viewBox%3D%220%200%2014%2012%22%20style%3D%22enable-background%3Anew%200%200%2014%2012%3B%22%20xml%3Aspace%3D%22preserve%22%3E%3Cpolygon%20fill%3D%22%23FFF%22%20points%3D%2214%2C3%2011%2C0%205.003%2C5.997%203%2C4%200%2C7%204.966%2C12%204.983%2C11.983%205%2C12%20%22%2F%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3C%2Fsvg%3E)}.ui-icon-clock:after{background-image:url(data:image/svg+xml;charset=US-ASCII,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22iso-8859-1%22%3F%3E%3C!DOCTYPE%20svg%20PUBLIC%20%22-%2F%2FW3C%2F%2FDTD%20SVG%201.1%2F%2FEN%22%20%22http%3A%2F%2Fwww.w3.org%2FGraphics%2FSVG%2F1.1%2FDTD%2Fsvg11.dtd%22%3E%3Csvg%20version%3D%221.1%22%20id%3D%22Layer_1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%20x%3D%220px%22%20y%3D%220px%22%20%20width%3D%2214px%22%20height%3D%2214px%22%20viewBox%3D%220%200%2014%2014%22%20style%3D%22enable-background%3Anew%200%200%2014%2014%3B%22%20xml%3Aspace%3D%22preserve%22%3E%3Cpath%20fill%3D%22%23FFF%22%20d%3D%22M7%2C0C3.134%2C0%2C0%2C3.134%2C0%2C7s3.134%2C7%2C7%2C7s7-3.134%2C7-7S10.866%2C0%2C7%2C0z%20M7%2C12c-2.762%2C0-5-2.238-5-5s2.238-5%2C5-5s5%2C2.238%2C5%2C5%20S9.762%2C12%2C7%2C12z%20M9%2C6H8V4c0-.553-.447-1-1-1S6%2C3.447%2C6%2C4v3c0%2C0.553%2C0.447%2C1%2C1%2C1h2c0.553%2C0%2C1-.447%2C1-1S9.553%2C6%2C9%2C6z%22%2F%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3C%2Fsvg%3E)}.ui-icon-cloud:after{background-image:url(data:image/svg+xml;charset=US-ASCII,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22iso-8859-1%22%3F%3E%3C!DOCTYPE%20svg%20PUBLIC%20%22-%2F%2FW3C%2F%2FDTD%20SVG%201.1%2F%2FEN%22%20%22http%3A%2F%2Fwww.w3.org%2FGraphics%2FSVG%2F1.1%2FDTD%2Fsvg11.dtd%22%3E%3Csvg%20version%3D%221.1%22%20id%3D%22Layer_1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%20x%3D%220px%22%20y%3D%220px%22%20%20width%3D%2214px%22%20height%3D%229px%22%20viewBox%3D%220%200%2014%209%22%20style%3D%22enable-background%3Anew%200%200%2014%209%3B%22%20xml%3Aspace%3D%22preserve%22%3E%3Cpath%20fill%3D%22%23FFF%22%20d%3D%22M14%2C7c0-.793-.465-1.472-1.134-1.795C12.949%2C4.984%2C13%2C4.749%2C13%2C4.5c0-1.104-.896-2-2-2c-.158%2C0-.31%2C0.023-.457%2C0.058%20C9.816%2C1.049%2C8.286%2C0%2C6.5%2C0C4.17%2C0%2C2.276%2C1.777%2C2.046%2C4.046C0.883%2C4.26%2C0%2C5.274%2C0%2C6.5C0%2C7.881%2C1.119%2C9%2C2.5%2C9h10V8.93%20C13.361%2C8.706%2C14%2C7.931%2C14%2C7z%22%2F%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3C%2Fsvg%3E)}.ui-icon-grid:after{background-image:url(data:image/svg+xml;charset=US-ASCII,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22iso-8859-1%22%3F%3E%3C!DOCTYPE%20svg%20PUBLIC%20%22-%2F%2FW3C%2F%2FDTD%20SVG%201.1%2F%2FEN%22%20%22http%3A%2F%2Fwww.w3.org%2FGraphics%2FSVG%2F1.1%2FDTD%2Fsvg11.dtd%22%3E%3Csvg%20version%3D%221.1%22%20id%3D%22Layer_1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%20x%3D%220px%22%20y%3D%220px%22%20%20width%3D%2214px%22%20height%3D%2214px%22%20viewBox%3D%220%200%2014%2014%22%20style%3D%22enable-background%3Anew%200%200%2014%2014%3B%22%20xml%3Aspace%3D%22preserve%22%3E%3Cpath%20fill%3D%22%23FFF%22%20d%3D%22M3%2C0H1C0.447%2C0%2C0%2C0.447%2C0%2C1v2c0%2C0.553%2C0.447%2C1%2C1%2C1h2c0.553%2C0%2C1-.447%2C1-1V1C4%2C0.447%2C3.553%2C0%2C3%2C0z%20M8%2C0H6%20C5.447%2C0%2C5%2C0.447%2C5%2C1v2c0%2C0.553%2C0.447%2C1%2C1%2C1h2c0.553%2C0%2C1-.447%2C1-1V1C9%2C0.447%2C8.553%2C0%2C8%2C0z%20M13%2C0h-2c-.553%2C0-1%2C0.447-1%2C1v2%20c0%2C0.553%2C0.447%2C1%2C1%2C1h2c0.553%2C0%2C1-.447%2C1-1V1C14%2C0.447%2C13.553%2C0%2C13%2C0z%20M3%2C5H1C0.447%2C5%2C0%2C5.447%2C0%2C6v2c0%2C0.553%2C0.447%2C1%2C1%2C1h2%20c0.553%2C0%2C1-.447%2C1-1V6C4%2C5.447%2C3.553%2C5%2C3%2C5z%20M8%2C5H6C5.447%2C5%2C5%2C5.447%2C5%2C6v2c0%2C0.553%2C0.447%2C1%2C1%2C1h2c0.553%2C0%2C1-.447%2C1-1V6%20C9%2C5.447%2C8.553%2C5%2C8%2C5z%20M13%2C5h-2c-.553%2C0-1%2C0.447-1%2C1v2c0%2C0.553%2C0.447%2C1%2C1%2C1h2c0.553%2C0%2C1-.447%2C1-1V6C14%2C5.447%2C13.553%2C5%2C13%2C5z%20M3%2C10%20H1c-.553%2C0-1%2C0.447-1%2C1v2c0%2C0.553%2C0.447%2C1%2C1%2C1h2c0.553%2C0%2C1-.447%2C1-1v-2C4%2C10.447%2C3.553%2C10%2C3%2C10z%20M8%2C10H6c-.553%2C0-1%2C0.447-1%2C1v2%20c0%2C0.553%2C0.447%2C1%2C1%2C1h2c0.553%2C0%2C1-.447%2C1-1v-2C9%2C10.447%2C8.553%2C10%2C8%2C10z%20M13%2C10h-2c-.553%2C0-1%2C0.447-1%2C1v2c0%2C0.553%2C0.447%2C1%2C1%2C1h2%20c0.553%2C0%2C1-.447%2C1-1v-2C14%2C10.447%2C13.553%2C10%2C13%2C10z%22%2F%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3C%2Fsvg%3E)}.ui-icon-mail:after{background-image:url(data:image/svg+xml;charset=US-ASCII,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22iso-8859-1%22%3F%3E%3C!DOCTYPE%20svg%20PUBLIC%20%22-%2F%2FW3C%2F%2FDTD%20SVG%201.1%2F%2FEN%22%20%22http%3A%2F%2Fwww.w3.org%2FGraphics%2FSVG%2F1.1%2FDTD%2Fsvg11.dtd%22%3E%3Csvg%20version%3D%221.1%22%20id%3D%22Layer_1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%20x%3D%220px%22%20y%3D%220px%22%20%20width%3D%2214px%22%20height%3D%2210px%22%20viewBox%3D%220%200%2014%2010%22%20style%3D%22enable-background%3Anew%200%200%2014%2010%3B%22%20xml%3Aspace%3D%22preserve%22%3E%3Cpath%20fill%3D%22%23FFF%22%20d%3D%22M0%2C1.75V10h14V1.75L7%2C7L0%2C1.75z%20M14%2C0H0l7%2C5L14%2C0z%22%2F%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3C%2Fsvg%3E)}.ui-icon-eye:after{background-image:url(data:image/svg+xml;charset=US-ASCII,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22iso-8859-1%22%3F%3E%3C!DOCTYPE%20svg%20PUBLIC%20%22-%2F%2FW3C%2F%2FDTD%20SVG%201.1%2F%2FEN%22%20%22http%3A%2F%2Fwww.w3.org%2FGraphics%2FSVG%2F1.1%2FDTD%2Fsvg11.dtd%22%3E%3Csvg%20version%3D%221.1%22%20id%3D%22Layer_1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%20x%3D%220px%22%20y%3D%220px%22%20%20width%3D%2214px%22%20height%3D%2210px%22%20viewBox%3D%220%200%2014%2010%22%20style%3D%22enable-background%3Anew%200%200%2014%2010%3B%22%20xml%3Aspace%3D%22preserve%22%3E%3Cpath%20fill%3D%22%23FFF%22%20d%3D%22M7%2C0C3%2C0%2C0%2C5%2C0%2C5s3%2C5%2C7%2C5s7-5%2C7-5S11%2C0%2C7%2C0z%20M7%2C8C5.343%2C8%2C4%2C6.657%2C4%2C5s1.343-3%2C3-3s3%2C1.343%2C3%2C3S8.657%2C8%2C7%2C8z%20M7%2C4%20C6.448%2C4%2C6%2C4.447%2C6%2C5s0.448%2C1%2C1%2C1s1-.447%2C1-1S7.552%2C4%2C7%2C4z%22%2F%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3C%2Fsvg%3E)}.ui-icon-gear:after{background-image:url(data:image/svg+xml;charset=US-ASCII,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22iso-8859-1%22%3F%3E%3C!DOCTYPE%20svg%20PUBLIC%20%22-%2F%2FW3C%2F%2FDTD%20SVG%201.1%2F%2FEN%22%20%22http%3A%2F%2Fwww.w3.org%2FGraphics%2FSVG%2F1.1%2FDTD%2Fsvg11.dtd%22%3E%3Csvg%20version%3D%221.1%22%20id%3D%22Layer_1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%20x%3D%220px%22%20y%3D%220px%22%20%20width%3D%2214px%22%20height%3D%2214px%22%20viewBox%3D%220%200%2014%2014%22%20style%3D%22enable-background%3Anew%200%200%2014%2014%3B%22%20xml%3Aspace%3D%22preserve%22%3E%3Cpath%20fill%3D%22%23FFF%22%20d%3D%22M13.621%2C5.904l-1.036-.259c-.168-.042-.303-.168-.355-.332c-.092-.284-.205-.559-.339-.82%20c-.079-.153-.073-.337%2C0.017-.486l0.549-.915c0.118-.196%2C0.088-.448-.075-.61l-.862-.863%20c-.162-.163-.414-.193-.611-.075l-.916%2C0.55C9.844%2C2.182%2C9.659%2C2.188%2C9.506%2C2.109C9.244%2C1.975%2C8.97%2C1.861%2C8.686%2C1.77%20c-.165-.052-.29-.187-.332-.354L8.095%2C0.379C8.039%2C0.156%2C7.839%2C0%2C7.609%2C0H6.391c-.229%2C0-.43%2C0.156-.485%2C0.379L5.646%2C1.415%20C5.604%2C1.582%2C5.479%2C1.718%2C5.313%2C1.77c-.284%2C0.092-.559%2C0.206-.82%2C0.34C4.339%2C2.188%2C4.155%2C2.182%2C4.007%2C2.093L3.092%2C1.544%20c-.196-.118-.448-.087-.61%2C0.075L1.619%2C2.481C1.457%2C2.644%2C1.426%2C2.896%2C1.544%2C3.093l0.549%2C0.914%20c0.089%2C0.148%2C0.095%2C0.332%2C0.017%2C0.486C1.975%2C4.755%2C1.861%2C5.029%2C1.77%2C5.314c-.053%2C0.164-.188%2C0.29-.354%2C0.332L0.379%2C5.905%20C0.156%2C5.961%2C0%2C6.161%2C0%2C6.391v1.219c0%2C0.229%2C0.156%2C0.43%2C0.379%2C0.485l1.036%2C0.26C1.582%2C8.396%2C1.717%2C8.521%2C1.77%2C8.687%20c0.092%2C0.284%2C0.205%2C0.559%2C0.34%2C0.82C2.188%2C9.66%2C2.182%2C9.844%2C2.093%2C9.993l-.549%2C0.915c-.118%2C0.195-.087%2C0.448%2C0.075%2C0.61%20l0.862%2C0.862c0.162%2C0.163%2C0.414%2C0.193%2C0.61%2C0.075l0.915-.549c0.148-.089%2C0.332-.095%2C0.486-.017%20c0.262%2C0.135%2C0.536%2C0.248%2C0.82%2C0.34c0.165%2C0.053%2C0.291%2C0.187%2C0.332%2C0.354l0.259%2C1.036C5.96%2C13.844%2C6.16%2C14%2C6.39%2C14h1.22%20c0.229%2C0%2C0.43-.156%2C0.485-.379l0.259-1.036c0.042-.167%2C0.168-.302%2C0.333-.354c0.284-.092%2C0.559-.205%2C0.82-.34%20c0.154-.078%2C0.338-.072%2C0.486%2C0.017l0.914%2C0.549c0.197%2C0.118%2C0.449%2C0.088%2C0.611-.074l0.862-.863%20c0.163-.162%2C0.193-.415%2C0.075-.611l-.549-.915c-.089-.148-.096-.332-.017-.485c0.134-.263%2C0.248-.536%2C0.339-.82%20c0.053-.165%2C0.188-.291%2C0.355-.333l1.036-.259C13.844%2C8.039%2C14%2C7.839%2C14%2C7.609V6.39C14%2C6.16%2C13.844%2C5.96%2C13.621%2C5.904z%20M7%2C10%20c-1.657%2C0-3-1.343-3-3s1.343-3%2C3-3s3%2C1.343%2C3%2C3S8.657%2C10%2C7%2C10z%22%2F%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3C%2Fsvg%3E)}.ui-icon-heart:after{background-image:url(data:image/svg+xml;charset=US-ASCII,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22iso-8859-1%22%3F%3E%3C!DOCTYPE%20svg%20PUBLIC%20%22-%2F%2FW3C%2F%2FDTD%20SVG%201.1%2F%2FEN%22%20%22http%3A%2F%2Fwww.w3.org%2FGraphics%2FSVG%2F1.1%2FDTD%2Fsvg11.dtd%22%3E%3Csvg%20version%3D%221.1%22%20id%3D%22Layer_1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%20x%3D%220px%22%20y%3D%220px%22%20%20width%3D%2214px%22%20height%3D%2213.744px%22%20viewBox%3D%220%200%2014%2013.744%22%20style%3D%22enable-background%3Anew%200%200%2014%2013.744%3B%22%20xml%3Aspace%3D%22preserve%22%3E%3Cpath%20fill%3D%22%23FFF%22%20d%3D%22M7%2C1.744c-2-3-7-2-7%2C2c0%2C3%2C4%2C7%2C4%2C7s2.417%2C2.479%2C3%2C3c0.583-.521%2C3-3%2C3-3s4-4%2C4-7C14-.256%2C9-1.256%2C7%2C1.744z%22%2F%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3C%2Fsvg%3E)}.ui-icon-home:after{background-image:url(data:image/svg+xml;charset=US-ASCII,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22iso-8859-1%22%3F%3E%3C!DOCTYPE%20svg%20PUBLIC%20%22-%2F%2FW3C%2F%2FDTD%20SVG%201.1%2F%2FEN%22%20%22http%3A%2F%2Fwww.w3.org%2FGraphics%2FSVG%2F1.1%2FDTD%2Fsvg11.dtd%22%3E%3Csvg%20version%3D%221.1%22%20id%3D%22Layer_1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%20x%3D%220px%22%20y%3D%220px%22%20%20width%3D%2214px%22%20height%3D%2214px%22%20viewBox%3D%220%200%2014%2014%22%20style%3D%22enable-background%3Anew%200%200%2014%2014%3B%22%20xml%3Aspace%3D%22preserve%22%3E%3Cpolygon%20fill%3D%22%23FFF%22%20points%3D%227%2C0%200%2C7%202%2C7%202%2C14%205%2C14%205%2C9%209%2C9%209%2C14%2012%2C14%2012%2C7%2014%2C7%20%22%2F%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3C%2Fsvg%3E)}.ui-icon-info:after{background-image:url(data:image/svg+xml;charset=US-ASCII,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22iso-8859-1%22%3F%3E%3C!DOCTYPE%20svg%20PUBLIC%20%22-%2F%2FW3C%2F%2FDTD%20SVG%201.1%2F%2FEN%22%20%22http%3A%2F%2Fwww.w3.org%2FGraphics%2FSVG%2F1.1%2FDTD%2Fsvg11.dtd%22%3E%3Csvg%20version%3D%221.1%22%20id%3D%22Layer_1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%20x%3D%220px%22%20y%3D%220px%22%20%20width%3D%2214px%22%20height%3D%2214px%22%20viewBox%3D%220%200%2014%2014%22%20style%3D%22enable-background%3Anew%200%200%2014%2014%3B%22%20xml%3Aspace%3D%22preserve%22%3E%3Cpath%20fill%3D%22%23FFF%22%20d%3D%22M7%2C0C3.134%2C0%2C0%2C3.134%2C0%2C7s3.134%2C7%2C7%2C7s7-3.134%2C7-7S10.866%2C0%2C7%2C0z%20M7%2C2c0.552%2C0%2C1%2C0.447%2C1%2C1S7.552%2C4%2C7%2C4S6%2C3.553%2C6%2C3%20S6.448%2C2%2C7%2C2z%20M9%2C11H5v-1h1V6H5V5h3v5h1V11z%22%2F%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3C%2Fsvg%3E)}.ui-icon-bullets:after{background-image:url(data:image/svg+xml;charset=US-ASCII,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22iso-8859-1%22%3F%3E%3C!DOCTYPE%20svg%20PUBLIC%20%22-%2F%2FW3C%2F%2FDTD%20SVG%201.1%2F%2FEN%22%20%22http%3A%2F%2Fwww.w3.org%2FGraphics%2FSVG%2F1.1%2FDTD%2Fsvg11.dtd%22%3E%3Csvg%20version%3D%221.1%22%20id%3D%22Layer_1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%20x%3D%220px%22%20y%3D%220px%22%20%20width%3D%2214px%22%20height%3D%2210px%22%20viewBox%3D%220%200%2014%2010%22%20style%3D%22enable-background%3Anew%200%200%2014%2010%3B%22%20xml%3Aspace%3D%22preserve%22%3E%3Cpath%20fill%3D%22%23FFF%22%20d%3D%22M5%2C2h8c0.553%2C0%2C1-.447%2C1-1s-.447-1-1-1H5C4.447%2C0%2C4%2C0.447%2C4%2C1S4.447%2C2%2C5%2C2z%20M13%2C4H5C4.447%2C4%2C4%2C4.447%2C4%2C5s0.447%2C1%2C1%2C1h8%20c0.553%2C0%2C1-.447%2C1-1S13.553%2C4%2C13%2C4z%20M13%2C8H5C4.447%2C8%2C4%2C8.447%2C4%2C9s0.447%2C1%2C1%2C1h8c0.553%2C0%2C1-.447%2C1-1S13.553%2C8%2C13%2C8z%20M1%2C0%20C0.447%2C0%2C0%2C0.447%2C0%2C1s0.447%2C1%2C1%2C1s1-.447%2C1-1S1.553%2C0%2C1%2C0z%20M1%2C4C0.447%2C4%2C0%2C4.447%2C0%2C5s0.447%2C1%2C1%2C1s1-.447%2C1-1S1.553%2C4%2C1%2C4z%20M1%2C8%20C0.447%2C8%2C0%2C8.447%2C0%2C9s0.447%2C1%2C1%2C1s1-.447%2C1-1S1.553%2C8%2C1%2C8z%22%2F%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3C%2Fsvg%3E)}.ui-icon-bars:after{background-image:url(data:image/svg+xml;charset=US-ASCII,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22iso-8859-1%22%3F%3E%3C!DOCTYPE%20svg%20PUBLIC%20%22-%2F%2FW3C%2F%2FDTD%20SVG%201.1%2F%2FEN%22%20%22http%3A%2F%2Fwww.w3.org%2FGraphics%2FSVG%2F1.1%2FDTD%2Fsvg11.dtd%22%3E%3Csvg%20version%3D%221.1%22%20id%3D%22Layer_1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%20x%3D%220px%22%20y%3D%220px%22%20%20width%3D%2214px%22%20height%3D%2210px%22%20viewBox%3D%220%200%2014%2010%22%20style%3D%22enable-background%3Anew%200%200%2014%2010%3B%22%20xml%3Aspace%3D%22preserve%22%3E%3Cpath%20fill%3D%22%23FFF%22%20d%3D%22M1%2C2h12c0.553%2C0%2C1-.447%2C1-1s-.447-1-1-1H1C0.447%2C0%2C0%2C0.447%2C0%2C1S0.447%2C2%2C1%2C2z%20M13%2C4H1C0.447%2C4%2C0%2C4.447%2C0%2C5s0.447%2C1%2C1%2C1h12%20c0.553%2C0%2C1-.447%2C1-1S13.553%2C4%2C13%2C4z%20M13%2C8H1C0.447%2C8%2C0%2C8.447%2C0%2C9s0.447%2C1%2C1%2C1h12c0.553%2C0%2C1-.447%2C1-1S13.553%2C8%2C13%2C8z%22%2F%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3C%2Fsvg%3E)}.ui-icon-navigation:after{background-image:url(data:image/svg+xml;charset=US-ASCII,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22iso-8859-1%22%3F%3E%3C!DOCTYPE%20svg%20PUBLIC%20%22-%2F%2FW3C%2F%2FDTD%20SVG%201.1%2F%2FEN%22%20%22http%3A%2F%2Fwww.w3.org%2FGraphics%2FSVG%2F1.1%2FDTD%2Fsvg11.dtd%22%3E%3Csvg%20version%3D%221.1%22%20id%3D%22Layer_1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%20x%3D%220px%22%20y%3D%220px%22%20%20width%3D%2214px%22%20height%3D%2214px%22%20viewBox%3D%220%200%2014%2014%22%20style%3D%22enable-background%3Anew%200%200%2014%2014%3B%22%20xml%3Aspace%3D%22preserve%22%3E%3Cpolygon%20fill%3D%22%23FFF%22%20points%3D%2214%2C0%200%2C6%208%2C6%208%2C14%20%22%2F%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3C%2Fsvg%3E)}.ui-icon-lock:after{background-image:url(data:image/svg+xml;charset=US-ASCII,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22iso-8859-1%22%3F%3E%3C!DOCTYPE%20svg%20PUBLIC%20%22-%2F%2FW3C%2F%2FDTD%20SVG%201.1%2F%2FEN%22%20%22http%3A%2F%2Fwww.w3.org%2FGraphics%2FSVG%2F1.1%2FDTD%2Fsvg11.dtd%22%3E%3Csvg%20version%3D%221.1%22%20id%3D%22Layer_1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%20x%3D%220px%22%20y%3D%220px%22%20%20width%3D%2212px%22%20height%3D%2214px%22%20viewBox%3D%220%200%2012%2014%22%20style%3D%22enable-background%3Anew%200%200%2012%2014%3B%22%20xml%3Aspace%3D%22preserve%22%3E%3Cpath%20fill%3D%22%23FFF%22%20d%3D%22M11%2C6V5c0-2.762-2.239-5-5-5S1%2C2.238%2C1%2C5v1H0v8h12V6H11z%20M6.5%2C9.847V12h-1V9.847C5.207%2C9.673%2C5%2C9.366%2C5%2C9%20c0-.553%2C0.448-1%2C1-1s1%2C0.447%2C1%2C1C7%2C9.366%2C6.793%2C9.673%2C6.5%2C9.847z%20M9%2C6H3V5c0-1.657%2C1.343-3%2C3-3s3%2C1.343%2C3%2C3V6z%22%2F%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3C%2Fsvg%3E)}.ui-icon-search:after{background-image:url(data:image/svg+xml;charset=US-ASCII,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22iso-8859-1%22%3F%3E%3C!DOCTYPE%20svg%20PUBLIC%20%22-%2F%2FW3C%2F%2FDTD%20SVG%201.1%2F%2FEN%22%20%22http%3A%2F%2Fwww.w3.org%2FGraphics%2FSVG%2F1.1%2FDTD%2Fsvg11.dtd%22%3E%3Csvg%20version%3D%221.1%22%20id%3D%22Layer_1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%20x%3D%220px%22%20y%3D%220px%22%20%20width%3D%2213.701px%22%20height%3D%2213.721px%22%20viewBox%3D%220%200%2013.701%2013.721%22%20style%3D%22enable-background%3Anew%200%200%2013.701%2013.721%3B%22%20%20xml%3Aspace%3D%22preserve%22%3E%3Cpath%20fill%3D%22%23FFF%22%20d%3D%22M10.021%2C8.626C10.638%2C7.738%2C11%2C6.662%2C11%2C5.5C11%2C2.463%2C8.537%2C0%2C5.5%2C0S0%2C2.463%2C0%2C5.5S2.463%2C11%2C5.5%2C11%20c1.152%2C0%2C2.221-.356%2C3.105-.962l3.682%2C3.683l1.414-1.414L10.021%2C8.626z%20M5.5%2C9C3.567%2C9%2C2%2C7.433%2C2%2C5.5S3.567%2C2%2C5.5%2C2S9%2C3.567%2C9%2C5.5%20S7.433%2C9%2C5.5%2C9z%22%2F%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3C%2Fsvg%3E)}.ui-icon-location:after{background-image:url(data:image/svg+xml;charset=US-ASCII,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22iso-8859-1%22%3F%3E%3C!DOCTYPE%20svg%20PUBLIC%20%22-%2F%2FW3C%2F%2FDTD%20SVG%201.1%2F%2FEN%22%20%22http%3A%2F%2Fwww.w3.org%2FGraphics%2FSVG%2F1.1%2FDTD%2Fsvg11.dtd%22%3E%3Csvg%20version%3D%221.1%22%20id%3D%22Layer_1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%20x%3D%220px%22%20y%3D%220px%22%20%20width%3D%228px%22%20height%3D%2214px%22%20viewBox%3D%220%200%208%2014%22%20style%3D%22enable-background%3Anew%200%200%208%2014%3B%22%20xml%3Aspace%3D%22preserve%22%3E%3Cpath%20fill%3D%22%23FFF%22%20d%3D%22M4%2C0C1.791%2C0%2C0%2C1.791%2C0%2C4c0%2C2%2C4%2C10%2C4%2C10S8%2C6%2C8%2C4C8%2C1.791%2C6.209%2C0%2C4%2C0z%20M4%2C6C2.896%2C6%2C2%2C5.104%2C2%2C4s0.896-2%2C2-2s2%2C0.896%2C2%2C2%20S5.104%2C6%2C4%2C6z%22%2F%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3C%2Fsvg%3E)}.ui-icon-minus:after{background-image:url(data:image/svg+xml;charset=US-ASCII,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22iso-8859-1%22%3F%3E%3C!DOCTYPE%20svg%20PUBLIC%20%22-%2F%2FW3C%2F%2FDTD%20SVG%201.1%2F%2FEN%22%20%22http%3A%2F%2Fwww.w3.org%2FGraphics%2FSVG%2F1.1%2FDTD%2Fsvg11.dtd%22%3E%3Csvg%20version%3D%221.1%22%20id%3D%22Layer_1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%20x%3D%220px%22%20y%3D%220px%22%20%20width%3D%2214px%22%20height%3D%224px%22%20viewBox%3D%220%200%2014%204%22%20style%3D%22enable-background%3Anew%200%200%2014%204%3B%22%20xml%3Aspace%3D%22preserve%22%3E%3Crect%20fill%3D%22%23FFF%22%20width%3D%2214%22%20height%3D%224%22%2F%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3C%2Fsvg%3E)}.ui-icon-forbidden:after{background-image:url(data:image/svg+xml;charset=US-ASCII,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22iso-8859-1%22%3F%3E%3C!DOCTYPE%20svg%20PUBLIC%20%22-%2F%2FW3C%2F%2FDTD%20SVG%201.1%2F%2FEN%22%20%22http%3A%2F%2Fwww.w3.org%2FGraphics%2FSVG%2F1.1%2FDTD%2Fsvg11.dtd%22%3E%3Csvg%20version%3D%221.1%22%20id%3D%22Layer_1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%20x%3D%220px%22%20y%3D%220px%22%20%20width%3D%2214px%22%20height%3D%2214px%22%20viewBox%3D%220%200%2014%2014%22%20style%3D%22enable-background%3Anew%200%200%2014%2014%3B%22%20xml%3Aspace%3D%22preserve%22%3E%3Cpath%20fill%3D%22%23FFF%22%20d%3D%22M12.601%2C11.187C13.476%2C10.018%2C14%2C8.572%2C14%2C7c0-3.866-3.134-7-7-7C5.428%2C0%2C3.982%2C0.524%2C2.813%2C1.399L2.757%2C1.343L2.053%2C2.048%20L2.048%2C2.053L1.343%2C2.758l0.056%2C0.056C0.524%2C3.982%2C0%2C5.428%2C0%2C7c0%2C3.866%2C3.134%2C7%2C7%2C7c1.572%2C0%2C3.018-.524%2C4.187-1.399l0.056%2C0.057%20l0.705-.705l0.005-.005l0.705-.705L12.601%2C11.187z%20M7%2C2c2.761%2C0%2C5%2C2.238%2C5%2C5c0%2C1.019-.308%2C1.964-.832%2C2.754L4.246%2C2.832%20C5.036%2C2.308%2C5.981%2C2%2C7%2C2z%20M7%2C12c-2.761%2C0-5-2.238-5-5c0-1.019%2C0.308-1.964%2C0.832-2.754l6.922%2C6.922C8.964%2C11.692%2C8.019%2C12%2C7%2C12z%22%2F%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3C%2Fsvg%3E)}.ui-icon-edit:after{background-image:url(data:image/svg+xml;charset=US-ASCII,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22iso-8859-1%22%3F%3E%3C!DOCTYPE%20svg%20PUBLIC%20%22-%2F%2FW3C%2F%2FDTD%20SVG%201.1%2F%2FEN%22%20%22http%3A%2F%2Fwww.w3.org%2FGraphics%2FSVG%2F1.1%2FDTD%2Fsvg11.dtd%22%3E%3Csvg%20version%3D%221.1%22%20id%3D%22Layer_1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%20x%3D%220px%22%20y%3D%220px%22%20%20width%3D%2214px%22%20height%3D%2214px%22%20viewBox%3D%220%200%2014%2014%22%20style%3D%22enable-background%3Anew%200%200%2014%2014%3B%22%20xml%3Aspace%3D%22preserve%22%3E%3Cpath%20fill%3D%22%23FFF%22%20d%3D%22M1%2C10l-1%2C4l4-1l7-7L8%2C3L1%2C10z%20M11%2C0L9%2C2l3%2C3l2-2L11%2C0z%22%2F%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3C%2Fsvg%3E)}.ui-icon-user:after{background-image:url(data:image/svg+xml;charset=US-ASCII,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22iso-8859-1%22%3F%3E%3C!DOCTYPE%20svg%20PUBLIC%20%22-%2F%2FW3C%2F%2FDTD%20SVG%201.1%2F%2FEN%22%20%22http%3A%2F%2Fwww.w3.org%2FGraphics%2FSVG%2F1.1%2FDTD%2Fsvg11.dtd%22%3E%3Csvg%20version%3D%221.1%22%20id%3D%22Layer_1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%20x%3D%220px%22%20y%3D%220px%22%20%20width%3D%2214px%22%20height%3D%2214px%22%20viewBox%3D%220%200%2014%2014%22%20style%3D%22enable-background%3Anew%200%200%2014%2014%3B%22%20xml%3Aspace%3D%22preserve%22%3E%3Cpath%20fill%3D%22%23FFF%22%20d%3D%22M8.851%2C10.101c-.18-.399-.2-.763-.153-1.104C9.383%2C8.49%2C9.738%2C7.621%2C9.891%2C6.465C10.493%2C6.355%2C10.5%2C5.967%2C10.5%2C5.5%20c0-.437-.008-.804-.502-.94C9.999%2C4.539%2C10%2C4.521%2C10%2C4.5c0-2.103-1-4-2-4C8%2C0.5%2C7.5%2C0%2C6.5%2C0C5%2C0%2C4%2C1.877%2C4%2C4.5%20c0%2C0.021%2C0.001%2C0.039%2C0.002%2C0.06C3.508%2C4.696%2C3.5%2C5.063%2C3.5%2C5.5c0%2C0.467%2C0.007%2C0.855%2C0.609%2C0.965%20C4.262%2C7.621%2C4.617%2C8.49%2C5.303%2C8.997c0.047%2C0.341%2C0.026%2C0.704-.153%2C1.104C1.503%2C10.503%2C0%2C12%2C0%2C12v2h14v-2%20C14%2C12%2C12.497%2C10.503%2C8.851%2C10.101z%22%2F%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3C%2Fsvg%3E)}.ui-icon-phone:after{background-image:url(data:image/svg+xml;charset=US-ASCII,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22iso-8859-1%22%3F%3E%3C!DOCTYPE%20svg%20PUBLIC%20%22-%2F%2FW3C%2F%2FDTD%20SVG%201.1%2F%2FEN%22%20%22http%3A%2F%2Fwww.w3.org%2FGraphics%2FSVG%2F1.1%2FDTD%2Fsvg11.dtd%22%3E%3Csvg%20version%3D%221.1%22%20id%3D%22Layer_1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%20x%3D%220px%22%20y%3D%220px%22%20%20width%3D%2213.979px%22%20height%3D%2214.016px%22%20viewBox%3D%220%200%2013.979%2014.016%22%20style%3D%22enable-background%3Anew%200%200%2013.979%2014.016%3B%22%20%20xml%3Aspace%3D%22preserve%22%3E%3Cpath%20fill%3D%22%23FFF%22%20d%3D%22M6.939%2C9.189C6.165%2C8.557%2C5.271%2C7.705%2C4.497%2C6.744C3.953%2C6.071%2C3.473%2C5.363%2C3.969%2C4.866l-3.482-3.48%20C-.021%2C2.02-1.146%2C5.04%2C3.675%2C9.984c5.08%2C5.211%2C8.356%2C4.096%2C8.92%2C3.51l-3.396-3.4C8.725%2C10.568%2C8.113%2C10.146%2C6.939%2C9.189z%20%20M13.82%2C11.519v-.004c0%2C0-2.649-2.646-2.65-2.648c-.21-.21-.546-.205-.754%2C0.002L9.455%2C9.831l3.404%2C3.408%20c0%2C0%2C0.962-.96%2C0.961-.961l0.002-.001C14.043%2C12.056%2C14.021%2C11.721%2C13.82%2C11.519z%20M5.192%2C3.644V3.642%20c0.221-.222%2C0.2-.557%2C0-.758V2.881c0%2C0-2.726-2.724-2.727-2.725C2.255-.055%2C1.92-.05%2C1.712%2C0.157L0.751%2C1.121l3.48%2C3.483%20C4.231%2C4.604%2C5.192%2C3.645%2C5.192%2C3.644z%22%2F%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3C%2Fsvg%3E)}.ui-icon-plus:after{background-image:url(data:image/svg+xml;charset=US-ASCII,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22iso-8859-1%22%3F%3E%3C!DOCTYPE%20svg%20PUBLIC%20%22-%2F%2FW3C%2F%2FDTD%20SVG%201.1%2F%2FEN%22%20%22http%3A%2F%2Fwww.w3.org%2FGraphics%2FSVG%2F1.1%2FDTD%2Fsvg11.dtd%22%3E%3Csvg%20version%3D%221.1%22%20id%3D%22Layer_1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%20x%3D%220px%22%20y%3D%220px%22%20%20width%3D%2214px%22%20height%3D%2214px%22%20viewBox%3D%220%200%2014%2014%22%20style%3D%22enable-background%3Anew%200%200%2014%2014%3B%22%20xml%3Aspace%3D%22preserve%22%3E%3Cpolygon%20fill%3D%22%23FFF%22%20points%3D%2214%2C5%209%2C5%209%2C0%205%2C0%205%2C5%200%2C5%200%2C9%205%2C9%205%2C14%209%2C14%209%2C9%2014%2C9%20%22%2F%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3C%2Fsvg%3E)}.ui-icon-power:after{background-image:url(data:image/svg+xml;charset=US-ASCII,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22iso-8859-1%22%3F%3E%3C!DOCTYPE%20svg%20PUBLIC%20%22-%2F%2FW3C%2F%2FDTD%20SVG%201.1%2F%2FEN%22%20%22http%3A%2F%2Fwww.w3.org%2FGraphics%2FSVG%2F1.1%2FDTD%2Fsvg11.dtd%22%3E%3Csvg%20version%3D%221.1%22%20id%3D%22Layer_1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%20x%3D%220px%22%20y%3D%220px%22%20%20width%3D%2212px%22%20height%3D%2213.896px%22%20viewBox%3D%220%200%2012%2013.896%22%20style%3D%22enable-background%3Anew%200%200%2012%2013.896%3B%22%20xml%3Aspace%3D%22preserve%22%3E%3Cpath%20fill%3D%22%23FFF%22%20d%3D%22M10.243%2C3.356c-.392-.401-1.024-.401-1.415%2C0c-.39%2C0.402-.39%2C1.054%2C0%2C1.455C9.584%2C5.59%2C10%2C6.623%2C10%2C7.722%20c0%2C1.1-.416%2C2.133-1.172%2C2.911c-1.511%2C1.556-4.145%2C1.556-5.656%2C0C2.416%2C9.854%2C2%2C8.821%2C2%2C7.722c0-1.099%2C0.416-2.132%2C1.172-2.91%20c0.39-.401%2C0.39-1.053%2C0-1.455c-.391-.401-1.024-.401-1.415%2C0C0.624%2C4.522%2C0%2C6.073%2C0%2C7.722c0%2C1.649%2C0.624%2C3.2%2C1.757%2C4.366%20C2.891%2C13.254%2C4.397%2C13.896%2C6%2C13.896s3.109-.643%2C4.243-1.809C11.376%2C10.922%2C12%2C9.371%2C12%2C7.722C12%2C6.073%2C11.376%2C4.522%2C10.243%2C3.356z%20%20M6%2C8c0.553%2C0%2C1-.447%2C1-1V1c0-.553-.447-1-1-1S5%2C0.447%2C5%2C1v6C5%2C7.553%2C5.447%2C8%2C6%2C8z%22%2F%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3C%2Fsvg%3E)}.ui-icon-recycle:after{background-image:url(data:image/svg+xml;charset=US-ASCII,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22iso-8859-1%22%3F%3E%3C!DOCTYPE%20svg%20PUBLIC%20%22-%2F%2FW3C%2F%2FDTD%20SVG%201.1%2F%2FEN%22%20%22http%3A%2F%2Fwww.w3.org%2FGraphics%2FSVG%2F1.1%2FDTD%2Fsvg11.dtd%22%3E%3Csvg%20version%3D%221.1%22%20id%3D%22Layer_1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%20x%3D%220px%22%20y%3D%220px%22%20%20width%3D%2214px%22%20height%3D%2212px%22%20viewBox%3D%220%200%2014%2012%22%20style%3D%22enable-background%3Anew%200%200%2014%2012%3B%22%20xml%3Aspace%3D%22preserve%22%3E%3Cpath%20fill%3D%22%23FFF%22%20d%3D%22M3%2C6h1L2%2C3L0%2C6h1c0%2C3.313%2C2.687%2C6%2C6%2C6c0.702%2C0%2C1.374-.127%2C2-.349V9.445C8.41%2C9.789%2C7.732%2C10%2C7%2C10C4.791%2C10%2C3%2C8.209%2C3%2C6z%20%20M13%2C6c0-3.313-2.687-6-6-6C6.298%2C0%2C5.626%2C0.127%2C5%2C0.349v2.206C5.59%2C2.211%2C6.268%2C2%2C7%2C2c2.209%2C0%2C4%2C1.791%2C4%2C4h-1l2%2C3l2-3H13z%22%2F%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3C%2Fsvg%3E)}.ui-icon-forward:after{background-image:url(data:image/svg+xml;charset=US-ASCII,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22iso-8859-1%22%3F%3E%3C!DOCTYPE%20svg%20PUBLIC%20%22-%2F%2FW3C%2F%2FDTD%20SVG%201.1%2F%2FEN%22%20%22http%3A%2F%2Fwww.w3.org%2FGraphics%2FSVG%2F1.1%2FDTD%2Fsvg11.dtd%22%3E%3Csvg%20version%3D%221.1%22%20id%3D%22Layer_1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%20x%3D%220px%22%20y%3D%220px%22%20%20width%3D%2212px%22%20height%3D%2214px%22%20viewBox%3D%220%200%2012%2014%22%20style%3D%22enable-background%3Anew%200%200%2012%2014%3B%22%20xml%3Aspace%3D%22preserve%22%3E%3Cpath%20fill%3D%22%23FFF%22%20d%3D%22M12%2C4L8%2C0v3C5%2C3%2C0%2C4%2C0%2C8c0%2C5%2C7%2C6%2C7%2C6v-2c0%2C0-5-1-5-4s6-3%2C6-3v3L12%2C4z%22%2F%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3C%2Fsvg%3E)}.ui-icon-refresh:after{background-image:url(data:image/svg+xml;charset=US-ASCII,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22iso-8859-1%22%3F%3E%3C!DOCTYPE%20svg%20PUBLIC%20%22-%2F%2FW3C%2F%2FDTD%20SVG%201.1%2F%2FEN%22%20%22http%3A%2F%2Fwww.w3.org%2FGraphics%2FSVG%2F1.1%2FDTD%2Fsvg11.dtd%22%3E%3Csvg%20version%3D%221.1%22%20id%3D%22Layer_1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%20x%3D%220px%22%20y%3D%220px%22%20%20width%3D%2214.001px%22%20height%3D%2214.002px%22%20viewBox%3D%220%200%2014.001%2014.002%22%20style%3D%22enable-background%3Anew%200%200%2014.001%2014.002%3B%22%20%20xml%3Aspace%3D%22preserve%22%3E%3Cpath%20fill%3D%22%23FFF%22%20d%3D%22M14.001%2C6.001v-6l-2.06%2C2.06c-.423-.424-.897-.809-1.44-1.122C7.153-.994%2C2.872%2C0.153%2C0.939%2C3.501%20c-1.933%2C3.348-.786%2C7.629%2C2.562%2C9.562c3.348%2C1.933%2C7.629%2C0.785%2C9.562-2.562l-1.732-1c-1.381%2C2.392-4.438%2C3.211-6.83%2C1.83%20s-3.211-4.438-1.83-6.83s4.438-3.211%2C6.83-1.83c0.389%2C0.225%2C0.718%2C0.506%2C1.02%2C0.81l-2.52%2C2.52H14.001z%22%2F%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3C%2Fsvg%3E)}.ui-icon-shop:after{background-image:url(data:image/svg+xml;charset=US-ASCII,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22iso-8859-1%22%3F%3E%3C!DOCTYPE%20svg%20PUBLIC%20%22-%2F%2FW3C%2F%2FDTD%20SVG%201.1%2F%2FEN%22%20%22http%3A%2F%2Fwww.w3.org%2FGraphics%2FSVG%2F1.1%2FDTD%2Fsvg11.dtd%22%3E%3Csvg%20version%3D%221.1%22%20id%3D%22Layer_1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%20x%3D%220px%22%20y%3D%220px%22%20%20width%3D%2212px%22%20height%3D%2214px%22%20viewBox%3D%220%200%2012%2014%22%20style%3D%22enable-background%3Anew%200%200%2012%2014%3B%22%20xml%3Aspace%3D%22preserve%22%3E%3Cpath%20fill%3D%22%23FFF%22%20d%3D%22M9%2C4V3c0-1.657-1.343-3-3-3S3%2C1.343%2C3%2C3v1H0v10h12V4H9z%20M3.5%2C6C3.224%2C6%2C3%2C5.776%2C3%2C5.5S3.224%2C5%2C3.5%2C5S4%2C5.224%2C4%2C5.5%20S3.776%2C6%2C3.5%2C6z%20M4%2C3c0-1.104%2C0.896-2%2C2-2s2%2C0.896%2C2%2C2v1H4V3z%20M8.5%2C6C8.224%2C6%2C8%2C5.776%2C8%2C5.5S8.224%2C5%2C8.5%2C5S9%2C5.224%2C9%2C5.5%20S8.776%2C6%2C8.5%2C6z%22%2F%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3C%2Fsvg%3E)}.ui-icon-comment:after{background-image:url(data:image/svg+xml;charset=US-ASCII,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22iso-8859-1%22%3F%3E%3C!DOCTYPE%20svg%20PUBLIC%20%22-%2F%2FW3C%2F%2FDTD%20SVG%201.1%2F%2FEN%22%20%22http%3A%2F%2Fwww.w3.org%2FGraphics%2FSVG%2F1.1%2FDTD%2Fsvg11.dtd%22%3E%3Csvg%20version%3D%221.1%22%20id%3D%22Layer_1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%20x%3D%220px%22%20y%3D%220px%22%20%20width%3D%2214px%22%20height%3D%2214px%22%20viewBox%3D%220%200%2014%2014%22%20style%3D%22enable-background%3Anew%200%200%2014%2014%3B%22%20xml%3Aspace%3D%22preserve%22%3E%3Cpath%20fill%3D%22%23FFF%22%20d%3D%22M12%2C0H2C0.896%2C0%2C0%2C0.896%2C0%2C2v7c0%2C1.104%2C0.896%2C2%2C2%2C2h1v3l3-3h6c1.104%2C0%2C2-.896%2C2-2V2C14%2C0.896%2C13.104%2C0%2C12%2C0z%22%2F%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3C%2Fsvg%3E)}.ui-icon-star:after{background-image:url(data:image/svg+xml;charset=US-ASCII,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22iso-8859-1%22%3F%3E%3C!DOCTYPE%20svg%20PUBLIC%20%22-%2F%2FW3C%2F%2FDTD%20SVG%201.1%2F%2FEN%22%20%22http%3A%2F%2Fwww.w3.org%2FGraphics%2FSVG%2F1.1%2FDTD%2Fsvg11.dtd%22%3E%3Csvg%20version%3D%221.1%22%20id%3D%22Layer_1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%20x%3D%220px%22%20y%3D%220px%22%20%20width%3D%2214px%22%20height%3D%2213px%22%20viewBox%3D%220%200%2014%2013%22%20style%3D%22enable-background%3Anew%200%200%2014%2013%3B%22%20xml%3Aspace%3D%22preserve%22%3E%3Cpolygon%20fill%3D%22%23FFF%22%20points%3D%2214%2C5%209%2C5%207%2C0%205%2C5%200%2C5%204%2C8%202.625%2C13%207%2C10%2011.375%2C13%2010%2C8%20%22%2F%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3C%2Fsvg%3E)}.ui-icon-tag:after{background-image:url(data:image/svg+xml;charset=US-ASCII,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22iso-8859-1%22%3F%3E%3C!DOCTYPE%20svg%20PUBLIC%20%22-%2F%2FW3C%2F%2FDTD%20SVG%201.1%2F%2FEN%22%20%22http%3A%2F%2Fwww.w3.org%2FGraphics%2FSVG%2F1.1%2FDTD%2Fsvg11.dtd%22%3E%3Csvg%20version%3D%221.1%22%20id%3D%22Layer_1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%20x%3D%220px%22%20y%3D%220px%22%20%20width%3D%2214px%22%20height%3D%2214px%22%20viewBox%3D%220%200%2014%2014%22%20style%3D%22enable-background%3Anew%200%200%2014%2014%3B%22%20xml%3Aspace%3D%22preserve%22%3E%3Cpath%20fill%3D%22%23FFF%22%20d%3D%22M5%2C0H0v5l9%2C9l5-5L5%2C0z%20M3%2C4C2.447%2C4%2C2%2C3.553%2C2%2C3s0.447-1%2C1-1s1%2C0.447%2C1%2C1S3.553%2C4%2C3%2C4z%22%2F%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3C%2Fsvg%3E)}.ui-icon-back:after{background-image:url(data:image/svg+xml;charset=US-ASCII,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22iso-8859-1%22%3F%3E%3C!DOCTYPE%20svg%20PUBLIC%20%22-%2F%2FW3C%2F%2FDTD%20SVG%201.1%2F%2FEN%22%20%22http%3A%2F%2Fwww.w3.org%2FGraphics%2FSVG%2F1.1%2FDTD%2Fsvg11.dtd%22%3E%3Csvg%20version%3D%221.1%22%20id%3D%22Layer_1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%20x%3D%220px%22%20y%3D%220px%22%20%20width%3D%2212px%22%20height%3D%2214px%22%20viewBox%3D%220%200%2012%2014%22%20style%3D%22enable-background%3Anew%200%200%2012%2014%3B%22%20xml%3Aspace%3D%22preserve%22%3E%3Cpath%20fill%3D%22%23FFF%22%20d%3D%22M4%2C3V0L0%2C4l4%2C4V5c0%2C0%2C6%2C0%2C6%2C3s-5%2C4-5%2C4v2c0%2C0%2C7-1%2C7-6C12%2C4%2C7%2C3%2C4%2C3z%22%2F%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3C%2Fsvg%3E)}.ui-icon-video:after{background-image:url(data:image/svg+xml;charset=US-ASCII,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22iso-8859-1%22%3F%3E%3C!DOCTYPE%20svg%20PUBLIC%20%22-%2F%2FW3C%2F%2FDTD%20SVG%201.1%2F%2FEN%22%20%22http%3A%2F%2Fwww.w3.org%2FGraphics%2FSVG%2F1.1%2FDTD%2Fsvg11.dtd%22%3E%3Csvg%20version%3D%221.1%22%20id%3D%22Layer_1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%20x%3D%220px%22%20y%3D%220px%22%20%20width%3D%2214px%22%20height%3D%2210px%22%20viewBox%3D%220%200%2014%2010%22%20style%3D%22enable-background%3Anew%200%200%2014%2010%3B%22%20xml%3Aspace%3D%22preserve%22%3E%3Cpath%20fill%3D%22%23FFF%22%20d%3D%22M8%2C0H2C0.896%2C0%2C0%2C0.896%2C0%2C2v6c0%2C1.104%2C0.896%2C2%2C2%2C2h6c1.104%2C0%2C2-.896%2C2-2V5V2C10%2C0.896%2C9.104%2C0%2C8%2C0z%20M10%2C5l4%2C4V1L10%2C5z%22%2F%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3C%2Fsvg%3E)}.ui-icon-alert:after{background-image:url(data:image/svg+xml;charset=US-ASCII,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22iso-8859-1%22%3F%3E%3C!DOCTYPE%20svg%20PUBLIC%20%22-%2F%2FW3C%2F%2FDTD%20SVG%201.1%2F%2FEN%22%20%22http%3A%2F%2Fwww.w3.org%2FGraphics%2FSVG%2F1.1%2FDTD%2Fsvg11.dtd%22%3E%3Csvg%20version%3D%221.1%22%20id%3D%22Layer_1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%20x%3D%220px%22%20y%3D%220px%22%20%20width%3D%2214px%22%20height%3D%2212px%22%20viewBox%3D%220%200%2014%2012%22%20style%3D%22enable-background%3Anew%200%200%2014%2012%3B%22%20xml%3Aspace%3D%22preserve%22%3E%3Cpath%20fill%3D%22%23FFF%22%20d%3D%22M7%2C0L0%2C12h14L7%2C0z%20M7%2C11c-.553%2C0-1-.447-1-1s0.447-1%2C1-1s1%2C0.447%2C1%2C1S7.553%2C11%2C7%2C11z%20M7%2C8C6.447%2C8%2C6%2C7.553%2C6%2C7V5%20c0-.553%2C0.447-1%2C1-1s1%2C0.447%2C1%2C1v2C8%2C7.553%2C7.553%2C8%2C7%2C8z%22%2F%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3C%2Fsvg%3E)}.ui-icon-delete:after{background-image:url(data:image/svg+xml;charset=US-ASCII,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22iso-8859-1%22%3F%3E%3C!DOCTYPE%20svg%20PUBLIC%20%22-%2F%2FW3C%2F%2FDTD%20SVG%201.1%2F%2FEN%22%20%22http%3A%2F%2Fwww.w3.org%2FGraphics%2FSVG%2F1.1%2FDTD%2Fsvg11.dtd%22%3E%3Csvg%20version%3D%221.1%22%20id%3D%22Layer_1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%20x%3D%220px%22%20y%3D%220px%22%20%20width%3D%2214px%22%20height%3D%2214px%22%20viewBox%3D%220%200%2014%2014%22%20style%3D%22enable-background%3Anew%200%200%2014%2014%3B%22%20xml%3Aspace%3D%22preserve%22%3E%3Cpolygon%20fill%3D%22%23FFF%22%20points%3D%2214%2C3%2011%2C0%207%2C4%203%2C0%200%2C3%204%2C7%200%2C11%203%2C14%207%2C10%2011%2C14%2014%2C11%2010%2C7%20%22%2F%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3C%2Fsvg%3E)}.ui-icon-alt.ui-icon-action:after,.ui-icon-alt .ui-icon-action:after{background-image:url(data:image/svg+xml;charset=US-ASCII,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22iso-8859-1%22%3F%3E%3C!DOCTYPE%20svg%20PUBLIC%20%22-%2F%2FW3C%2F%2FDTD%20SVG%201.1%2F%2FEN%22%20%22http%3A%2F%2Fwww.w3.org%2FGraphics%2FSVG%2F1.1%2FDTD%2Fsvg11.dtd%22%3E%3Csvg%20version%3D%221.1%22%20id%3D%22Layer_1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%20x%3D%220px%22%20y%3D%220px%22%20%20width%3D%2214px%22%20height%3D%2213px%22%20viewBox%3D%220%200%2014%2013%22%20style%3D%22enable-background%3Anew%200%200%2014%2013%3B%22%20xml%3Aspace%3D%22preserve%22%3E%3Cpath%20d%3D%22M9%2C5v3l5-4L9%2C0v3c0%2C0-5%2C0-5%2C7C6%2C5%2C9%2C5%2C9%2C5z%20M11%2C11H2V5h1l2-2H0v10h13V7l-2%2C2V11z%22%2F%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3C%2Fsvg%3E)}.ui-icon-alt.ui-icon-arrow-d:after,.ui-icon-alt .ui-icon-arrow-d:after{background-image:url(data:image/svg+xml;charset=US-ASCII,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22iso-8859-1%22%3F%3E%3C!DOCTYPE%20svg%20PUBLIC%20%22-%2F%2FW3C%2F%2FDTD%20SVG%201.1%2F%2FEN%22%20%22http%3A%2F%2Fwww.w3.org%2FGraphics%2FSVG%2F1.1%2FDTD%2Fsvg11.dtd%22%3E%3Csvg%20version%3D%221.1%22%20id%3D%22Layer_1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%20x%3D%220px%22%20y%3D%220px%22%20%20width%3D%2214px%22%20height%3D%2214px%22%20viewBox%3D%220%200%2014%2014%22%20style%3D%22enable-background%3Anew%200%200%2014%2014%3B%22%20xml%3Aspace%3D%22preserve%22%3E%3Cpolygon%20points%3D%229%2C7%209%2C0%205%2C0%205%2C7%200%2C7%207%2C14%2014%2C7%20%22%2F%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3C%2Fsvg%3E)}.ui-icon-alt.ui-icon-arrow-d-l:after,.ui-icon-alt .ui-icon-arrow-d-l:after{background-image:url(data:image/svg+xml;charset=US-ASCII,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22iso-8859-1%22%3F%3E%3C!DOCTYPE%20svg%20PUBLIC%20%22-%2F%2FW3C%2F%2FDTD%20SVG%201.1%2F%2FEN%22%20%22http%3A%2F%2Fwww.w3.org%2FGraphics%2FSVG%2F1.1%2FDTD%2Fsvg11.dtd%22%3E%3Csvg%20version%3D%221.1%22%20id%3D%22Layer_1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%20x%3D%220px%22%20y%3D%220px%22%20%20width%3D%2214px%22%20height%3D%2214px%22%20viewBox%3D%220%200%2014%2014%22%20style%3D%22enable-background%3Anew%200%200%2014%2014%3B%22%20xml%3Aspace%3D%22preserve%22%3E%3Cpolygon%20points%3D%2214%2C3%2011%2C0%203.5%2C7.5%200%2C4%200%2C14%2010%2C14%206.5%2C10.5%20%22%2F%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3C%2Fsvg%3E)}.ui-icon-alt.ui-icon-arrow-d-r:after,.ui-icon-alt .ui-icon-arrow-d-r:after{background-image:url(data:image/svg+xml;charset=US-ASCII,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22iso-8859-1%22%3F%3E%3C!DOCTYPE%20svg%20PUBLIC%20%22-%2F%2FW3C%2F%2FDTD%20SVG%201.1%2F%2FEN%22%20%22http%3A%2F%2Fwww.w3.org%2FGraphics%2FSVG%2F1.1%2FDTD%2Fsvg11.dtd%22%3E%3Csvg%20version%3D%221.1%22%20id%3D%22Layer_1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%20x%3D%220px%22%20y%3D%220px%22%20%20width%3D%2214px%22%20height%3D%2214px%22%20viewBox%3D%220%200%2014%2014%22%20style%3D%22enable-background%3Anew%200%200%2014%2014%3B%22%20xml%3Aspace%3D%22preserve%22%3E%3Cpolygon%20points%3D%2210.5%2C7.5%203%2C0%200%2C3%207.5%2C10.5%204%2C14%2014%2C14%2014%2C4%20%22%2F%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3C%2Fsvg%3E)}.ui-icon-alt.ui-icon-arrow-l:after,.ui-icon-alt .ui-icon-arrow-l:after{background-image:url(data:image/svg+xml;charset=US-ASCII,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22iso-8859-1%22%3F%3E%3C!DOCTYPE%20svg%20PUBLIC%20%22-%2F%2FW3C%2F%2FDTD%20SVG%201.1%2F%2FEN%22%20%22http%3A%2F%2Fwww.w3.org%2FGraphics%2FSVG%2F1.1%2FDTD%2Fsvg11.dtd%22%3E%3Csvg%20version%3D%221.1%22%20id%3D%22Layer_1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%20x%3D%220px%22%20y%3D%220px%22%20%20width%3D%2214px%22%20height%3D%2214px%22%20viewBox%3D%220%200%2014%2014%22%20style%3D%22enable-background%3Anew%200%200%2014%2014%3B%22%20xml%3Aspace%3D%22preserve%22%3E%3Cpolygon%20points%3D%227%2C5%207%2C0%200%2C7%207%2C14%207%2C9%2014%2C9%2014%2C5%20%22%2F%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3C%2Fsvg%3E)}.ui-icon-alt.ui-icon-arrow-r:after,.ui-icon-alt .ui-icon-arrow-r:after{background-image:url(data:image/svg+xml;charset=US-ASCII,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22iso-8859-1%22%3F%3E%3C!DOCTYPE%20svg%20PUBLIC%20%22-%2F%2FW3C%2F%2FDTD%20SVG%201.1%2F%2FEN%22%20%22http%3A%2F%2Fwww.w3.org%2FGraphics%2FSVG%2F1.1%2FDTD%2Fsvg11.dtd%22%3E%3Csvg%20version%3D%221.1%22%20id%3D%22Layer_1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%20x%3D%220px%22%20y%3D%220px%22%20%20width%3D%2214px%22%20height%3D%2214px%22%20viewBox%3D%220%200%2014%2014%22%20style%3D%22enable-background%3Anew%200%200%2014%2014%3B%22%20xml%3Aspace%3D%22preserve%22%3E%3Cpolygon%20points%3D%2214%2C7%207%2C0%207%2C5%200%2C5%200%2C9%207%2C9%207%2C14%20%22%2F%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3C%2Fsvg%3E)}.ui-icon-alt.ui-icon-arrow-u:after,.ui-icon-alt .ui-icon-arrow-u:after{background-image:url(data:image/svg+xml;charset=US-ASCII,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22iso-8859-1%22%3F%3E%3C!DOCTYPE%20svg%20PUBLIC%20%22-%2F%2FW3C%2F%2FDTD%20SVG%201.1%2F%2FEN%22%20%22http%3A%2F%2Fwww.w3.org%2FGraphics%2FSVG%2F1.1%2FDTD%2Fsvg11.dtd%22%3E%3Csvg%20version%3D%221.1%22%20id%3D%22Layer_1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%20x%3D%220px%22%20y%3D%220px%22%20%20width%3D%2214px%22%20height%3D%2214px%22%20viewBox%3D%220%200%2014%2014%22%20style%3D%22enable-background%3Anew%200%200%2014%2014%3B%22%20xml%3Aspace%3D%22preserve%22%3E%3Cpolygon%20points%3D%227%2C0%200%2C7%205%2C7%205%2C14%209%2C14%209%2C7%2014%2C7%20%22%2F%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3C%2Fsvg%3E)}.ui-icon-alt.ui-icon-arrow-u-l:after,.ui-icon-alt .ui-icon-arrow-u-l:after{background-image:url(data:image/svg+xml;charset=US-ASCII,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22iso-8859-1%22%3F%3E%3C!DOCTYPE%20svg%20PUBLIC%20%22-%2F%2FW3C%2F%2FDTD%20SVG%201.1%2F%2FEN%22%20%22http%3A%2F%2Fwww.w3.org%2FGraphics%2FSVG%2F1.1%2FDTD%2Fsvg11.dtd%22%3E%3Csvg%20version%3D%221.1%22%20id%3D%22Layer_1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%20x%3D%220px%22%20y%3D%220px%22%20%20width%3D%2214px%22%20height%3D%2214px%22%20viewBox%3D%220%200%2014%2014%22%20style%3D%22enable-background%3Anew%200%200%2014%2014%3B%22%20xml%3Aspace%3D%22preserve%22%3E%3Cpolygon%20points%3D%2214%2C11%206.5%2C3.5%2010%2C0%200%2C0%200%2C10%203.5%2C6.5%2011%2C14%20%22%2F%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3C%2Fsvg%3E)}.ui-icon-alt.ui-icon-arrow-u-r:after,.ui-icon-alt .ui-icon-arrow-u-r:after{background-image:url(data:image/svg+xml;charset=US-ASCII,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22iso-8859-1%22%3F%3E%3C!DOCTYPE%20svg%20PUBLIC%20%22-%2F%2FW3C%2F%2FDTD%20SVG%201.1%2F%2FEN%22%20%22http%3A%2F%2Fwww.w3.org%2FGraphics%2FSVG%2F1.1%2FDTD%2Fsvg11.dtd%22%3E%3Csvg%20version%3D%221.1%22%20id%3D%22Layer_1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%20x%3D%220px%22%20y%3D%220px%22%20%20width%3D%2214px%22%20height%3D%2214px%22%20viewBox%3D%220%200%2014%2014%22%20style%3D%22enable-background%3Anew%200%200%2014%2014%3B%22%20xml%3Aspace%3D%22preserve%22%3E%3Cpolygon%20points%3D%2214%2C0%204%2C0%207.5%2C3.5%200%2C11%203%2C14%2010.5%2C6.5%2014%2C10%20%22%2F%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3C%2Fsvg%3E)}.ui-icon-alt.ui-icon-audio:after,.ui-icon-alt .ui-icon-audio:after{background-image:url(data:image/svg+xml;charset=US-ASCII,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22iso-8859-1%22%3F%3E%3C!DOCTYPE%20svg%20PUBLIC%20%22-%2F%2FW3C%2F%2FDTD%20SVG%201.1%2F%2FEN%22%20%22http%3A%2F%2Fwww.w3.org%2FGraphics%2FSVG%2F1.1%2FDTD%2Fsvg11.dtd%22%3E%3Csvg%20version%3D%221.1%22%20id%3D%22Layer_1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%20x%3D%220px%22%20y%3D%220px%22%20%20width%3D%2214.018px%22%20height%3D%2214px%22%20viewBox%3D%220%200%2014.018%2014%22%20style%3D%22enable-background%3Anew%200%200%2014.018%2014%3B%22%20xml%3Aspace%3D%22preserve%22%3E%3Cpath%20d%3D%22M1%2C4C0.447%2C4%2C0%2C4.447%2C0%2C5v4c0%2C0.553%2C0.447%2C1%2C1%2C1h1l4%2C4V0L2%2C4H1z%20M10.346%2C7c0-1.699-1.042-3.154-2.546-3.867L6.982%2C4.68%20C7.885%2C5.107%2C8.51%2C5.98%2C8.51%2C7S7.885%2C8.893%2C6.982%2C9.32L7.8%2C10.867C9.304%2C10.154%2C10.346%2C8.699%2C10.346%2C7z%20M9.447%2C0.017L8.618%2C1.586%20C10.723%2C2.584%2C12.182%2C4.621%2C12.182%2C7s-1.459%2C4.416-3.563%2C5.414l0.829%2C1.569c2.707-1.283%2C4.57-3.925%2C4.57-6.983%20S12.154%2C1.3%2C9.447%2C0.017z%22%2F%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3C%2Fsvg%3E)}.ui-icon-alt.ui-icon-calendar:after,.ui-icon-alt .ui-icon-calendar:after{background-image:url(data:image/svg+xml;charset=US-ASCII,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22iso-8859-1%22%3F%3E%3C!DOCTYPE%20svg%20PUBLIC%20%22-%2F%2FW3C%2F%2FDTD%20SVG%201.1%2F%2FEN%22%20%22http%3A%2F%2Fwww.w3.org%2FGraphics%2FSVG%2F1.1%2FDTD%2Fsvg11.dtd%22%3E%3Csvg%20version%3D%221.1%22%20id%3D%22Layer_1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%20x%3D%220px%22%20y%3D%220px%22%20%20width%3D%2214px%22%20height%3D%2214px%22%20viewBox%3D%220%200%2014%2014%22%20style%3D%22enable-background%3Anew%200%200%2014%2014%3B%22%20xml%3Aspace%3D%22preserve%22%3E%3Cpath%20d%3D%22M0%2C8h2V6H0V8z%20M3%2C8h2V6H3V8z%20M6%2C8h2V6H6V8z%20M9%2C8h2V6H9V8z%20M12%2C8h2V6h-2V8z%20M0%2C11h2V9H0V11z%20M3%2C11h2V9H3V11z%20M6%2C11h2V9H6V11z%20%20M9%2C11h2V9H9V11z%20M12%2C11h2V9h-2V11z%20M0%2C14h2v-2H0V14z%20M3%2C14h2v-2H3V14z%20M6%2C14h2v-2H6V14z%20M9%2C14h2v-2H9V14z%20M12%2C1%20c0-.553-.447-1-1-1s-1%2C0.447-1%2C1H4c0-.553-.447-1-1-1S2%2C0.447%2C2%2C1H0v4h14V1H12z%22%2F%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3C%2Fsvg%3E)}.ui-icon-alt.ui-icon-camera:after,.ui-icon-alt .ui-icon-camera:after{background-image:url(data:image/svg+xml;charset=US-ASCII,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22iso-8859-1%22%3F%3E%3C!DOCTYPE%20svg%20PUBLIC%20%22-%2F%2FW3C%2F%2FDTD%20SVG%201.1%2F%2FEN%22%20%22http%3A%2F%2Fwww.w3.org%2FGraphics%2FSVG%2F1.1%2FDTD%2Fsvg11.dtd%22%3E%3Csvg%20version%3D%221.1%22%20id%3D%22Layer_1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%20x%3D%220px%22%20y%3D%220px%22%20%20width%3D%2214px%22%20height%3D%2211px%22%20viewBox%3D%220%200%2014%2011%22%20style%3D%22enable-background%3Anew%200%200%2014%2011%3B%22%20xml%3Aspace%3D%22preserve%22%3E%3Cpath%20d%3D%22M12%2C1H9.908C9.702%2C0.419%2C9.152%2C0%2C8.5%2C0h-3C4.848%2C0%2C4.298%2C0.419%2C4.092%2C1H2C0.896%2C1%2C0%2C1.896%2C0%2C3v6c0%2C1.104%2C0.896%2C2%2C2%2C2h10%20c1.104%2C0%2C2-.896%2C2-2V3C14%2C1.896%2C13.104%2C1%2C12%2C1z%20M7%2C9C5.343%2C9%2C4%2C7.657%2C4%2C6s1.343-3%2C3-3s3%2C1.343%2C3%2C3S8.657%2C9%2C7%2C9z%20M7%2C4%20C5.896%2C4%2C5%2C4.896%2C5%2C6s0.896%2C2%2C2%2C2s2-.896%2C2-2S8.104%2C4%2C7%2C4z%22%2F%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3C%2Fsvg%3E)}.ui-icon-alt.ui-icon-carat-d:after,.ui-icon-alt .ui-icon-carat-d:after{background-image:url(data:image/svg+xml;charset=US-ASCII,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22iso-8859-1%22%3F%3E%3C!DOCTYPE%20svg%20PUBLIC%20%22-%2F%2FW3C%2F%2FDTD%20SVG%201.1%2F%2FEN%22%20%22http%3A%2F%2Fwww.w3.org%2FGraphics%2FSVG%2F1.1%2FDTD%2Fsvg11.dtd%22%3E%3Csvg%20version%3D%221.1%22%20id%3D%22Layer_1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%20x%3D%220px%22%20y%3D%220px%22%20%20width%3D%2212px%22%20height%3D%228px%22%20viewBox%3D%220%200%2012%208%22%20style%3D%22enable-background%3Anew%200%200%2012%208%3B%22%20xml%3Aspace%3D%22preserve%22%3E%3Cpolygon%20points%3D%2210%2C0%206%2C4%202%2C0%200%2C2%206%2C8%2012%2C2%20%22%2F%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3C%2Fsvg%3E)}.ui-icon-alt.ui-icon-carat-l:after,.ui-icon-alt .ui-icon-carat-l:after{background-image:url(data:image/svg+xml;charset=US-ASCII,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22iso-8859-1%22%3F%3E%3C!DOCTYPE%20svg%20PUBLIC%20%22-%2F%2FW3C%2F%2FDTD%20SVG%201.1%2F%2FEN%22%20%22http%3A%2F%2Fwww.w3.org%2FGraphics%2FSVG%2F1.1%2FDTD%2Fsvg11.dtd%22%3E%3Csvg%20version%3D%221.1%22%20id%3D%22Layer_1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%20x%3D%220px%22%20y%3D%220px%22%20%20width%3D%228px%22%20height%3D%2212px%22%20viewBox%3D%220%200%208%2012%22%20style%3D%22enable-background%3Anew%200%200%208%2012%3B%22%20xml%3Aspace%3D%22preserve%22%3E%3Cpolygon%20points%3D%228%2C2%206%2C0%200%2C6%206%2C12%208%2C10%204%2C6%20%22%2F%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3C%2Fsvg%3E)}.ui-icon-alt.ui-icon-carat-r:after,.ui-icon-alt .ui-icon-carat-r:after{background-image:url(data:image/svg+xml;charset=US-ASCII,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22iso-8859-1%22%3F%3E%3C!DOCTYPE%20svg%20PUBLIC%20%22-%2F%2FW3C%2F%2FDTD%20SVG%201.1%2F%2FEN%22%20%22http%3A%2F%2Fwww.w3.org%2FGraphics%2FSVG%2F1.1%2FDTD%2Fsvg11.dtd%22%3E%3Csvg%20version%3D%221.1%22%20id%3D%22Layer_1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%20x%3D%220px%22%20y%3D%220px%22%20%20width%3D%228px%22%20height%3D%2212px%22%20viewBox%3D%220%200%208%2012%22%20style%3D%22enable-background%3Anew%200%200%208%2012%3B%22%20xml%3Aspace%3D%22preserve%22%3E%3Cpolygon%20points%3D%222%2C0%200%2C2%204%2C6%200%2C10%202%2C12%208%2C6%20%22%2F%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3C%2Fsvg%3E)}.ui-icon-alt.ui-icon-carat-u:after,.ui-icon-alt .ui-icon-carat-u:after{background-image:url(data:image/svg+xml;charset=US-ASCII,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22iso-8859-1%22%3F%3E%3C!DOCTYPE%20svg%20PUBLIC%20%22-%2F%2FW3C%2F%2FDTD%20SVG%201.1%2F%2FEN%22%20%22http%3A%2F%2Fwww.w3.org%2FGraphics%2FSVG%2F1.1%2FDTD%2Fsvg11.dtd%22%3E%3Csvg%20version%3D%221.1%22%20id%3D%22Layer_1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%20x%3D%220px%22%20y%3D%220px%22%20%20width%3D%2212px%22%20height%3D%228px%22%20viewBox%3D%220%200%2012%208%22%20style%3D%22enable-background%3Anew%200%200%2012%208%3B%22%20xml%3Aspace%3D%22preserve%22%3E%3Cpolygon%20points%3D%226%2C0%200%2C6%202%2C8%206%2C4%2010%2C8%2012%2C6%20%22%2F%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3C%2Fsvg%3E)}.ui-icon-alt.ui-icon-check:after,.ui-icon-alt .ui-icon-check:after,.ui-icon-alt.ui-icon-checkbox-on:after,.ui-icon-alt .ui-icon-checkbox-on:after{background-image:url(data:image/svg+xml;charset=US-ASCII,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22iso-8859-1%22%3F%3E%3C!DOCTYPE%20svg%20PUBLIC%20%22-%2F%2FW3C%2F%2FDTD%20SVG%201.1%2F%2FEN%22%20%22http%3A%2F%2Fwww.w3.org%2FGraphics%2FSVG%2F1.1%2FDTD%2Fsvg11.dtd%22%3E%3Csvg%20version%3D%221.1%22%20id%3D%22Layer_1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%20x%3D%220px%22%20y%3D%220px%22%20%20width%3D%2214px%22%20height%3D%2212px%22%20viewBox%3D%220%200%2014%2012%22%20style%3D%22enable-background%3Anew%200%200%2014%2012%3B%22%20xml%3Aspace%3D%22preserve%22%3E%3Cpolygon%20points%3D%2214%2C3%2011%2C0%205.003%2C5.997%203%2C4%200%2C7%204.966%2C12%204.983%2C11.983%205%2C12%20%22%2F%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3C%2Fsvg%3E)}.ui-icon-alt.ui-icon-clock:after,.ui-icon-alt .ui-icon-clock:after{background-image:url(data:image/svg+xml;charset=US-ASCII,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22iso-8859-1%22%3F%3E%3C!DOCTYPE%20svg%20PUBLIC%20%22-%2F%2FW3C%2F%2FDTD%20SVG%201.1%2F%2FEN%22%20%22http%3A%2F%2Fwww.w3.org%2FGraphics%2FSVG%2F1.1%2FDTD%2Fsvg11.dtd%22%3E%3Csvg%20version%3D%221.1%22%20id%3D%22Layer_1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%20x%3D%220px%22%20y%3D%220px%22%20%20width%3D%2214px%22%20height%3D%2214px%22%20viewBox%3D%220%200%2014%2014%22%20style%3D%22enable-background%3Anew%200%200%2014%2014%3B%22%20xml%3Aspace%3D%22preserve%22%3E%3Cpath%20d%3D%22M7%2C0C3.134%2C0%2C0%2C3.134%2C0%2C7s3.134%2C7%2C7%2C7s7-3.134%2C7-7S10.866%2C0%2C7%2C0z%20M7%2C12c-2.762%2C0-5-2.238-5-5s2.238-5%2C5-5s5%2C2.238%2C5%2C5%20S9.762%2C12%2C7%2C12z%20M9%2C6H8V4c0-.553-.447-1-1-1S6%2C3.447%2C6%2C4v3c0%2C0.553%2C0.447%2C1%2C1%2C1h2c0.553%2C0%2C1-.447%2C1-1S9.553%2C6%2C9%2C6z%22%2F%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3C%2Fsvg%3E)}.ui-icon-alt.ui-icon-cloud:after,.ui-icon-alt .ui-icon-cloud:after{background-image:url(data:image/svg+xml;charset=US-ASCII,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22iso-8859-1%22%3F%3E%3C!DOCTYPE%20svg%20PUBLIC%20%22-%2F%2FW3C%2F%2FDTD%20SVG%201.1%2F%2FEN%22%20%22http%3A%2F%2Fwww.w3.org%2FGraphics%2FSVG%2F1.1%2FDTD%2Fsvg11.dtd%22%3E%3Csvg%20version%3D%221.1%22%20id%3D%22Layer_1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%20x%3D%220px%22%20y%3D%220px%22%20%20width%3D%2214px%22%20height%3D%229px%22%20viewBox%3D%220%200%2014%209%22%20style%3D%22enable-background%3Anew%200%200%2014%209%3B%22%20xml%3Aspace%3D%22preserve%22%3E%3Cpath%20d%3D%22M14%2C7c0-.793-.465-1.472-1.134-1.795C12.949%2C4.984%2C13%2C4.749%2C13%2C4.5c0-1.104-.896-2-2-2c-.158%2C0-.31%2C0.023-.457%2C0.058%20C9.816%2C1.049%2C8.286%2C0%2C6.5%2C0C4.17%2C0%2C2.276%2C1.777%2C2.046%2C4.046C0.883%2C4.26%2C0%2C5.274%2C0%2C6.5C0%2C7.881%2C1.119%2C9%2C2.5%2C9h10V8.93%20C13.361%2C8.706%2C14%2C7.931%2C14%2C7z%22%2F%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3C%2Fsvg%3E)}.ui-icon-alt.ui-icon-grid:after,.ui-icon-alt .ui-icon-grid:after{background-image:url(data:image/svg+xml;charset=US-ASCII,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22iso-8859-1%22%3F%3E%3C!DOCTYPE%20svg%20PUBLIC%20%22-%2F%2FW3C%2F%2FDTD%20SVG%201.1%2F%2FEN%22%20%22http%3A%2F%2Fwww.w3.org%2FGraphics%2FSVG%2F1.1%2FDTD%2Fsvg11.dtd%22%3E%3Csvg%20version%3D%221.1%22%20id%3D%22Layer_1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%20x%3D%220px%22%20y%3D%220px%22%20%20width%3D%2214px%22%20height%3D%2214px%22%20viewBox%3D%220%200%2014%2014%22%20style%3D%22enable-background%3Anew%200%200%2014%2014%3B%22%20xml%3Aspace%3D%22preserve%22%3E%3Cpath%20d%3D%22M3%2C0H1C0.447%2C0%2C0%2C0.447%2C0%2C1v2c0%2C0.553%2C0.447%2C1%2C1%2C1h2c0.553%2C0%2C1-.447%2C1-1V1C4%2C0.447%2C3.553%2C0%2C3%2C0z%20M8%2C0H6%20C5.447%2C0%2C5%2C0.447%2C5%2C1v2c0%2C0.553%2C0.447%2C1%2C1%2C1h2c0.553%2C0%2C1-.447%2C1-1V1C9%2C0.447%2C8.553%2C0%2C8%2C0z%20M13%2C0h-2c-.553%2C0-1%2C0.447-1%2C1v2%20c0%2C0.553%2C0.447%2C1%2C1%2C1h2c0.553%2C0%2C1-.447%2C1-1V1C14%2C0.447%2C13.553%2C0%2C13%2C0z%20M3%2C5H1C0.447%2C5%2C0%2C5.447%2C0%2C6v2c0%2C0.553%2C0.447%2C1%2C1%2C1h2%20c0.553%2C0%2C1-.447%2C1-1V6C4%2C5.447%2C3.553%2C5%2C3%2C5z%20M8%2C5H6C5.447%2C5%2C5%2C5.447%2C5%2C6v2c0%2C0.553%2C0.447%2C1%2C1%2C1h2c0.553%2C0%2C1-.447%2C1-1V6%20C9%2C5.447%2C8.553%2C5%2C8%2C5z%20M13%2C5h-2c-.553%2C0-1%2C0.447-1%2C1v2c0%2C0.553%2C0.447%2C1%2C1%2C1h2c0.553%2C0%2C1-.447%2C1-1V6C14%2C5.447%2C13.553%2C5%2C13%2C5z%20M3%2C10%20H1c-.553%2C0-1%2C0.447-1%2C1v2c0%2C0.553%2C0.447%2C1%2C1%2C1h2c0.553%2C0%2C1-.447%2C1-1v-2C4%2C10.447%2C3.553%2C10%2C3%2C10z%20M8%2C10H6c-.553%2C0-1%2C0.447-1%2C1v2%20c0%2C0.553%2C0.447%2C1%2C1%2C1h2c0.553%2C0%2C1-.447%2C1-1v-2C9%2C10.447%2C8.553%2C10%2C8%2C10z%20M13%2C10h-2c-.553%2C0-1%2C0.447-1%2C1v2c0%2C0.553%2C0.447%2C1%2C1%2C1h2%20c0.553%2C0%2C1-.447%2C1-1v-2C14%2C10.447%2C13.553%2C10%2C13%2C10z%22%2F%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3C%2Fsvg%3E)}.ui-icon-alt.ui-icon-mail:after,.ui-icon-alt .ui-icon-mail:after{background-image:url(data:image/svg+xml;charset=US-ASCII,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22iso-8859-1%22%3F%3E%3C!DOCTYPE%20svg%20PUBLIC%20%22-%2F%2FW3C%2F%2FDTD%20SVG%201.1%2F%2FEN%22%20%22http%3A%2F%2Fwww.w3.org%2FGraphics%2FSVG%2F1.1%2FDTD%2Fsvg11.dtd%22%3E%3Csvg%20version%3D%221.1%22%20id%3D%22Layer_1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%20x%3D%220px%22%20y%3D%220px%22%20%20width%3D%2214px%22%20height%3D%2210px%22%20viewBox%3D%220%200%2014%2010%22%20style%3D%22enable-background%3Anew%200%200%2014%2010%3B%22%20xml%3Aspace%3D%22preserve%22%3E%3Cpath%20d%3D%22M0%2C1.75V10h14V1.75L7%2C7L0%2C1.75z%20M14%2C0H0l7%2C5L14%2C0z%22%2F%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3C%2Fsvg%3E)}.ui-icon-alt.ui-icon-eye:after,.ui-icon-alt .ui-icon-eye:after{background-image:url(data:image/svg+xml;charset=US-ASCII,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22iso-8859-1%22%3F%3E%3C!DOCTYPE%20svg%20PUBLIC%20%22-%2F%2FW3C%2F%2FDTD%20SVG%201.1%2F%2FEN%22%20%22http%3A%2F%2Fwww.w3.org%2FGraphics%2FSVG%2F1.1%2FDTD%2Fsvg11.dtd%22%3E%3Csvg%20version%3D%221.1%22%20id%3D%22Layer_1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%20x%3D%220px%22%20y%3D%220px%22%20%20width%3D%2214px%22%20height%3D%2210px%22%20viewBox%3D%220%200%2014%2010%22%20style%3D%22enable-background%3Anew%200%200%2014%2010%3B%22%20xml%3Aspace%3D%22preserve%22%3E%3Cpath%20d%3D%22M7%2C0C3%2C0%2C0%2C5%2C0%2C5s3%2C5%2C7%2C5s7-5%2C7-5S11%2C0%2C7%2C0z%20M7%2C8C5.343%2C8%2C4%2C6.657%2C4%2C5s1.343-3%2C3-3s3%2C1.343%2C3%2C3S8.657%2C8%2C7%2C8z%20M7%2C4%20C6.448%2C4%2C6%2C4.447%2C6%2C5s0.448%2C1%2C1%2C1s1-.447%2C1-1S7.552%2C4%2C7%2C4z%22%2F%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3C%2Fsvg%3E)}.ui-icon-alt.ui-icon-gear:after,.ui-icon-alt .ui-icon-gear:after{background-image:url(data:image/svg+xml;charset=US-ASCII,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22iso-8859-1%22%3F%3E%3C!DOCTYPE%20svg%20PUBLIC%20%22-%2F%2FW3C%2F%2FDTD%20SVG%201.1%2F%2FEN%22%20%22http%3A%2F%2Fwww.w3.org%2FGraphics%2FSVG%2F1.1%2FDTD%2Fsvg11.dtd%22%3E%3Csvg%20version%3D%221.1%22%20id%3D%22Layer_1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%20x%3D%220px%22%20y%3D%220px%22%20%20width%3D%2214px%22%20height%3D%2214px%22%20viewBox%3D%220%200%2014%2014%22%20style%3D%22enable-background%3Anew%200%200%2014%2014%3B%22%20xml%3Aspace%3D%22preserve%22%3E%3Cpath%20d%3D%22M13.621%2C5.904l-1.036-.259c-.168-.042-.303-.168-.355-.332c-.092-.284-.205-.559-.339-.82%20c-.079-.153-.073-.337%2C0.017-.486l0.549-.915c0.118-.196%2C0.088-.448-.075-.61l-.862-.863%20c-.162-.163-.414-.193-.611-.075l-.916%2C0.55C9.844%2C2.182%2C9.659%2C2.188%2C9.506%2C2.109C9.244%2C1.975%2C8.97%2C1.861%2C8.686%2C1.77%20c-.165-.052-.29-.187-.332-.354L8.095%2C0.379C8.039%2C0.156%2C7.839%2C0%2C7.609%2C0H6.391c-.229%2C0-.43%2C0.156-.485%2C0.379L5.646%2C1.415%20C5.604%2C1.582%2C5.479%2C1.718%2C5.313%2C1.77c-.284%2C0.092-.559%2C0.206-.82%2C0.34C4.339%2C2.188%2C4.155%2C2.182%2C4.007%2C2.093L3.092%2C1.544%20c-.196-.118-.448-.087-.61%2C0.075L1.619%2C2.481C1.457%2C2.644%2C1.426%2C2.896%2C1.544%2C3.093l0.549%2C0.914%20c0.089%2C0.148%2C0.095%2C0.332%2C0.017%2C0.486C1.975%2C4.755%2C1.861%2C5.029%2C1.77%2C5.314c-.053%2C0.164-.188%2C0.29-.354%2C0.332L0.379%2C5.905%20C0.156%2C5.961%2C0%2C6.161%2C0%2C6.391v1.219c0%2C0.229%2C0.156%2C0.43%2C0.379%2C0.485l1.036%2C0.26C1.582%2C8.396%2C1.717%2C8.521%2C1.77%2C8.687%20c0.092%2C0.284%2C0.205%2C0.559%2C0.34%2C0.82C2.188%2C9.66%2C2.182%2C9.844%2C2.093%2C9.993l-.549%2C0.915c-.118%2C0.195-.087%2C0.448%2C0.075%2C0.61%20l0.862%2C0.862c0.162%2C0.163%2C0.414%2C0.193%2C0.61%2C0.075l0.915-.549c0.148-.089%2C0.332-.095%2C0.486-.017%20c0.262%2C0.135%2C0.536%2C0.248%2C0.82%2C0.34c0.165%2C0.053%2C0.291%2C0.187%2C0.332%2C0.354l0.259%2C1.036C5.96%2C13.844%2C6.16%2C14%2C6.39%2C14h1.22%20c0.229%2C0%2C0.43-.156%2C0.485-.379l0.259-1.036c0.042-.167%2C0.168-.302%2C0.333-.354c0.284-.092%2C0.559-.205%2C0.82-.34%20c0.154-.078%2C0.338-.072%2C0.486%2C0.017l0.914%2C0.549c0.197%2C0.118%2C0.449%2C0.088%2C0.611-.074l0.862-.863%20c0.163-.162%2C0.193-.415%2C0.075-.611l-.549-.915c-.089-.148-.096-.332-.017-.485c0.134-.263%2C0.248-.536%2C0.339-.82%20c0.053-.165%2C0.188-.291%2C0.355-.333l1.036-.259C13.844%2C8.039%2C14%2C7.839%2C14%2C7.609V6.39C14%2C6.16%2C13.844%2C5.96%2C13.621%2C5.904z%20M7%2C10%20c-1.657%2C0-3-1.343-3-3s1.343-3%2C3-3s3%2C1.343%2C3%2C3S8.657%2C10%2C7%2C10z%22%2F%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3C%2Fsvg%3E)}.ui-icon-alt.ui-icon-heart:after,.ui-icon-alt .ui-icon-heart:after{background-image:url(data:image/svg+xml;charset=US-ASCII,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22iso-8859-1%22%3F%3E%3C!DOCTYPE%20svg%20PUBLIC%20%22-%2F%2FW3C%2F%2FDTD%20SVG%201.1%2F%2FEN%22%20%22http%3A%2F%2Fwww.w3.org%2FGraphics%2FSVG%2F1.1%2FDTD%2Fsvg11.dtd%22%3E%3Csvg%20version%3D%221.1%22%20id%3D%22Layer_1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%20x%3D%220px%22%20y%3D%220px%22%20%20width%3D%2214px%22%20height%3D%2213.744px%22%20viewBox%3D%220%200%2014%2013.744%22%20style%3D%22enable-background%3Anew%200%200%2014%2013.744%3B%22%20xml%3Aspace%3D%22preserve%22%3E%3Cpath%20d%3D%22M7%2C1.744c-2-3-7-2-7%2C2c0%2C3%2C4%2C7%2C4%2C7s2.417%2C2.479%2C3%2C3c0.583-.521%2C3-3%2C3-3s4-4%2C4-7C14-.256%2C9-1.256%2C7%2C1.744z%22%2F%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3C%2Fsvg%3E)}.ui-icon-alt.ui-icon-home:after,.ui-icon-alt .ui-icon-home:after{background-image:url(data:image/svg+xml;charset=US-ASCII,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22iso-8859-1%22%3F%3E%3C!DOCTYPE%20svg%20PUBLIC%20%22-%2F%2FW3C%2F%2FDTD%20SVG%201.1%2F%2FEN%22%20%22http%3A%2F%2Fwww.w3.org%2FGraphics%2FSVG%2F1.1%2FDTD%2Fsvg11.dtd%22%3E%3Csvg%20version%3D%221.1%22%20id%3D%22Layer_1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%20x%3D%220px%22%20y%3D%220px%22%20%20width%3D%2214px%22%20height%3D%2214px%22%20viewBox%3D%220%200%2014%2014%22%20style%3D%22enable-background%3Anew%200%200%2014%2014%3B%22%20xml%3Aspace%3D%22preserve%22%3E%3Cpolygon%20points%3D%227%2C0%200%2C7%202%2C7%202%2C14%205%2C14%205%2C9%209%2C9%209%2C14%2012%2C14%2012%2C7%2014%2C7%20%22%2F%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3C%2Fsvg%3E)}.ui-icon-alt.ui-icon-info:after,.ui-icon-alt .ui-icon-info:after{background-image:url(data:image/svg+xml;charset=US-ASCII,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22iso-8859-1%22%3F%3E%3C!DOCTYPE%20svg%20PUBLIC%20%22-%2F%2FW3C%2F%2FDTD%20SVG%201.1%2F%2FEN%22%20%22http%3A%2F%2Fwww.w3.org%2FGraphics%2FSVG%2F1.1%2FDTD%2Fsvg11.dtd%22%3E%3Csvg%20version%3D%221.1%22%20id%3D%22Layer_1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%20x%3D%220px%22%20y%3D%220px%22%20%20width%3D%2214px%22%20height%3D%2214px%22%20viewBox%3D%220%200%2014%2014%22%20style%3D%22enable-background%3Anew%200%200%2014%2014%3B%22%20xml%3Aspace%3D%22preserve%22%3E%3Cpath%20d%3D%22M7%2C0C3.134%2C0%2C0%2C3.134%2C0%2C7s3.134%2C7%2C7%2C7s7-3.134%2C7-7S10.866%2C0%2C7%2C0z%20M7%2C2c0.552%2C0%2C1%2C0.447%2C1%2C1S7.552%2C4%2C7%2C4S6%2C3.553%2C6%2C3%20S6.448%2C2%2C7%2C2z%20M9%2C11H5v-1h1V6H5V5h3v5h1V11z%22%2F%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3C%2Fsvg%3E)}.ui-icon-alt.ui-icon-bars:after,.ui-icon-alt .ui-icon-bars:after{background-image:url(data:image/svg+xml;charset=US-ASCII,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22iso-8859-1%22%3F%3E%3C!DOCTYPE%20svg%20PUBLIC%20%22-%2F%2FW3C%2F%2FDTD%20SVG%201.1%2F%2FEN%22%20%22http%3A%2F%2Fwww.w3.org%2FGraphics%2FSVG%2F1.1%2FDTD%2Fsvg11.dtd%22%3E%3Csvg%20version%3D%221.1%22%20id%3D%22Layer_1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%20x%3D%220px%22%20y%3D%220px%22%20%20width%3D%2214px%22%20height%3D%2210px%22%20viewBox%3D%220%200%2014%2010%22%20style%3D%22enable-background%3Anew%200%200%2014%2010%3B%22%20xml%3Aspace%3D%22preserve%22%3E%3Cpath%20d%3D%22M1%2C2h12c0.553%2C0%2C1-.447%2C1-1s-.447-1-1-1H1C0.447%2C0%2C0%2C0.447%2C0%2C1S0.447%2C2%2C1%2C2z%20M13%2C4H1C0.447%2C4%2C0%2C4.447%2C0%2C5s0.447%2C1%2C1%2C1h12%20c0.553%2C0%2C1-.447%2C1-1S13.553%2C4%2C13%2C4z%20M13%2C8H1C0.447%2C8%2C0%2C8.447%2C0%2C9s0.447%2C1%2C1%2C1h12c0.553%2C0%2C1-.447%2C1-1S13.553%2C8%2C13%2C8z%22%2F%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3C%2Fsvg%3E)}.ui-icon-alt.ui-icon-bullets:after,.ui-icon-alt .ui-icon-bullets:after{background-image:url(data:image/svg+xml;charset=US-ASCII,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22iso-8859-1%22%3F%3E%3C!DOCTYPE%20svg%20PUBLIC%20%22-%2F%2FW3C%2F%2FDTD%20SVG%201.1%2F%2FEN%22%20%22http%3A%2F%2Fwww.w3.org%2FGraphics%2FSVG%2F1.1%2FDTD%2Fsvg11.dtd%22%3E%3Csvg%20version%3D%221.1%22%20id%3D%22Layer_1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%20x%3D%220px%22%20y%3D%220px%22%20%20width%3D%2214px%22%20height%3D%2210px%22%20viewBox%3D%220%200%2014%2010%22%20style%3D%22enable-background%3Anew%200%200%2014%2010%3B%22%20xml%3Aspace%3D%22preserve%22%3E%3Cpath%20d%3D%22M5%2C2h8c0.553%2C0%2C1-.447%2C1-1s-.447-1-1-1H5C4.447%2C0%2C4%2C0.447%2C4%2C1S4.447%2C2%2C5%2C2z%20M13%2C4H5C4.447%2C4%2C4%2C4.447%2C4%2C5s0.447%2C1%2C1%2C1h8%20c0.553%2C0%2C1-.447%2C1-1S13.553%2C4%2C13%2C4z%20M13%2C8H5C4.447%2C8%2C4%2C8.447%2C4%2C9s0.447%2C1%2C1%2C1h8c0.553%2C0%2C1-.447%2C1-1S13.553%2C8%2C13%2C8z%20M1%2C0%20C0.447%2C0%2C0%2C0.447%2C0%2C1s0.447%2C1%2C1%2C1s1-.447%2C1-1S1.553%2C0%2C1%2C0z%20M1%2C4C0.447%2C4%2C0%2C4.447%2C0%2C5s0.447%2C1%2C1%2C1s1-.447%2C1-1S1.553%2C4%2C1%2C4z%20M1%2C8%20C0.447%2C8%2C0%2C8.447%2C0%2C9s0.447%2C1%2C1%2C1s1-.447%2C1-1S1.553%2C8%2C1%2C8z%22%2F%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3C%2Fsvg%3E)}.ui-icon-alt.ui-icon-navigation:after,.ui-icon-alt .ui-icon-navigation:after{background-image:url(data:image/svg+xml;charset=US-ASCII,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22iso-8859-1%22%3F%3E%3C!DOCTYPE%20svg%20PUBLIC%20%22-%2F%2FW3C%2F%2FDTD%20SVG%201.1%2F%2FEN%22%20%22http%3A%2F%2Fwww.w3.org%2FGraphics%2FSVG%2F1.1%2FDTD%2Fsvg11.dtd%22%3E%3Csvg%20version%3D%221.1%22%20id%3D%22Layer_1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%20x%3D%220px%22%20y%3D%220px%22%20%20width%3D%2214px%22%20height%3D%2214px%22%20viewBox%3D%220%200%2014%2014%22%20style%3D%22enable-background%3Anew%200%200%2014%2014%3B%22%20xml%3Aspace%3D%22preserve%22%3E%3Cpolygon%20points%3D%2214%2C0%200%2C6%208%2C6%208%2C14%20%22%2F%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3C%2Fsvg%3E)}.ui-icon-alt.ui-icon-lock:after,.ui-icon-alt .ui-icon-lock:after{background-image:url(data:image/svg+xml;charset=US-ASCII,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22iso-8859-1%22%3F%3E%3C!DOCTYPE%20svg%20PUBLIC%20%22-%2F%2FW3C%2F%2FDTD%20SVG%201.1%2F%2FEN%22%20%22http%3A%2F%2Fwww.w3.org%2FGraphics%2FSVG%2F1.1%2FDTD%2Fsvg11.dtd%22%3E%3Csvg%20version%3D%221.1%22%20id%3D%22Layer_1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%20x%3D%220px%22%20y%3D%220px%22%20%20width%3D%2212px%22%20height%3D%2214px%22%20viewBox%3D%220%200%2012%2014%22%20style%3D%22enable-background%3Anew%200%200%2012%2014%3B%22%20xml%3Aspace%3D%22preserve%22%3E%3Cpath%20d%3D%22M11%2C6V5c0-2.762-2.239-5-5-5S1%2C2.238%2C1%2C5v1H0v8h12V6H11z%20M6.5%2C9.847V12h-1V9.847C5.207%2C9.673%2C5%2C9.366%2C5%2C9%20c0-.553%2C0.448-1%2C1-1s1%2C0.447%2C1%2C1C7%2C9.366%2C6.793%2C9.673%2C6.5%2C9.847z%20M9%2C6H3V5c0-1.657%2C1.343-3%2C3-3s3%2C1.343%2C3%2C3V6z%22%2F%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3C%2Fsvg%3E)}.ui-icon-alt.ui-icon-search:after,.ui-icon-alt .ui-icon-search:after,.ui-input-search:after{background-image:url(data:image/svg+xml;charset=US-ASCII,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22iso-8859-1%22%3F%3E%3C!DOCTYPE%20svg%20PUBLIC%20%22-%2F%2FW3C%2F%2FDTD%20SVG%201.1%2F%2FEN%22%20%22http%3A%2F%2Fwww.w3.org%2FGraphics%2FSVG%2F1.1%2FDTD%2Fsvg11.dtd%22%3E%3Csvg%20version%3D%221.1%22%20id%3D%22Layer_1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%20x%3D%220px%22%20y%3D%220px%22%20%20width%3D%2213.701px%22%20height%3D%2213.721px%22%20viewBox%3D%220%200%2013.701%2013.721%22%20style%3D%22enable-background%3Anew%200%200%2013.701%2013.721%3B%22%20%20xml%3Aspace%3D%22preserve%22%3E%3Cpath%20d%3D%22M10.021%2C8.626C10.638%2C7.738%2C11%2C6.662%2C11%2C5.5C11%2C2.463%2C8.537%2C0%2C5.5%2C0S0%2C2.463%2C0%2C5.5S2.463%2C11%2C5.5%2C11%20c1.152%2C0%2C2.221-.356%2C3.105-.962l3.682%2C3.683l1.414-1.414L10.021%2C8.626z%20M5.5%2C9C3.567%2C9%2C2%2C7.433%2C2%2C5.5S3.567%2C2%2C5.5%2C2S9%2C3.567%2C9%2C5.5%20S7.433%2C9%2C5.5%2C9z%22%2F%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3C%2Fsvg%3E)}.ui-icon-alt.ui-icon-location:after,.ui-icon-alt .ui-icon-location:after{background-image:url(data:image/svg+xml;charset=US-ASCII,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22iso-8859-1%22%3F%3E%3C!DOCTYPE%20svg%20PUBLIC%20%22-%2F%2FW3C%2F%2FDTD%20SVG%201.1%2F%2FEN%22%20%22http%3A%2F%2Fwww.w3.org%2FGraphics%2FSVG%2F1.1%2FDTD%2Fsvg11.dtd%22%3E%3Csvg%20version%3D%221.1%22%20id%3D%22Layer_1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%20x%3D%220px%22%20y%3D%220px%22%20%20width%3D%228px%22%20height%3D%2214px%22%20viewBox%3D%220%200%208%2014%22%20style%3D%22enable-background%3Anew%200%200%208%2014%3B%22%20xml%3Aspace%3D%22preserve%22%3E%3Cpath%20d%3D%22M4%2C0C1.791%2C0%2C0%2C1.791%2C0%2C4c0%2C2%2C4%2C10%2C4%2C10S8%2C6%2C8%2C4C8%2C1.791%2C6.209%2C0%2C4%2C0z%20M4%2C6C2.896%2C6%2C2%2C5.104%2C2%2C4s0.896-2%2C2-2s2%2C0.896%2C2%2C2%20S5.104%2C6%2C4%2C6z%22%2F%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3C%2Fsvg%3E)}.ui-icon-alt.ui-icon-minus:after,.ui-icon-alt .ui-icon-minus:after{background-image:url(data:image/svg+xml;charset=US-ASCII,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22iso-8859-1%22%3F%3E%3C!DOCTYPE%20svg%20PUBLIC%20%22-%2F%2FW3C%2F%2FDTD%20SVG%201.1%2F%2FEN%22%20%22http%3A%2F%2Fwww.w3.org%2FGraphics%2FSVG%2F1.1%2FDTD%2Fsvg11.dtd%22%3E%3Csvg%20version%3D%221.1%22%20id%3D%22Layer_1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%20x%3D%220px%22%20y%3D%220px%22%20%20width%3D%2214px%22%20height%3D%224px%22%20viewBox%3D%220%200%2014%204%22%20style%3D%22enable-background%3Anew%200%200%2014%204%3B%22%20xml%3Aspace%3D%22preserve%22%3E%3Crect%20width%3D%2214%22%20height%3D%224%22%2F%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3C%2Fsvg%3E)}.ui-icon-alt.ui-icon-forbidden:after,.ui-icon-alt .ui-icon-forbidden:after{background-image:url(data:image/svg+xml;charset=US-ASCII,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22iso-8859-1%22%3F%3E%3C!DOCTYPE%20svg%20PUBLIC%20%22-%2F%2FW3C%2F%2FDTD%20SVG%201.1%2F%2FEN%22%20%22http%3A%2F%2Fwww.w3.org%2FGraphics%2FSVG%2F1.1%2FDTD%2Fsvg11.dtd%22%3E%3Csvg%20version%3D%221.1%22%20id%3D%22Layer_1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%20x%3D%220px%22%20y%3D%220px%22%20%20width%3D%2214px%22%20height%3D%2214px%22%20viewBox%3D%220%200%2014%2014%22%20style%3D%22enable-background%3Anew%200%200%2014%2014%3B%22%20xml%3Aspace%3D%22preserve%22%3E%3Cpath%20d%3D%22M12.601%2C11.187C13.476%2C10.018%2C14%2C8.572%2C14%2C7c0-3.866-3.134-7-7-7C5.428%2C0%2C3.982%2C0.524%2C2.813%2C1.399L2.757%2C1.343L2.053%2C2.048%20L2.048%2C2.053L1.343%2C2.758l0.056%2C0.056C0.524%2C3.982%2C0%2C5.428%2C0%2C7c0%2C3.866%2C3.134%2C7%2C7%2C7c1.572%2C0%2C3.018-.524%2C4.187-1.399l0.056%2C0.057%20l0.705-.705l0.005-.005l0.705-.705L12.601%2C11.187z%20M7%2C2c2.761%2C0%2C5%2C2.238%2C5%2C5c0%2C1.019-.308%2C1.964-.832%2C2.754L4.246%2C2.832%20C5.036%2C2.308%2C5.981%2C2%2C7%2C2z%20M7%2C12c-2.761%2C0-5-2.238-5-5c0-1.019%2C0.308-1.964%2C0.832-2.754l6.922%2C6.922C8.964%2C11.692%2C8.019%2C12%2C7%2C12z%22%2F%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3C%2Fsvg%3E)}.ui-icon-alt.ui-icon-edit:after,.ui-icon-alt .ui-icon-edit:after{background-image:url(data:image/svg+xml;charset=US-ASCII,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22iso-8859-1%22%3F%3E%3C!DOCTYPE%20svg%20PUBLIC%20%22-%2F%2FW3C%2F%2FDTD%20SVG%201.1%2F%2FEN%22%20%22http%3A%2F%2Fwww.w3.org%2FGraphics%2FSVG%2F1.1%2FDTD%2Fsvg11.dtd%22%3E%3Csvg%20version%3D%221.1%22%20id%3D%22Layer_1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%20x%3D%220px%22%20y%3D%220px%22%20%20width%3D%2214px%22%20height%3D%2214px%22%20viewBox%3D%220%200%2014%2014%22%20style%3D%22enable-background%3Anew%200%200%2014%2014%3B%22%20xml%3Aspace%3D%22preserve%22%3E%3Cpath%20d%3D%22M1%2C10l-1%2C4l4-1l7-7L8%2C3L1%2C10z%20M11%2C0L9%2C2l3%2C3l2-2L11%2C0z%22%2F%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3C%2Fsvg%3E)}.ui-icon-alt.ui-icon-user:after,.ui-icon-alt .ui-icon-user:after{background-image:url(data:image/svg+xml;charset=US-ASCII,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22iso-8859-1%22%3F%3E%3C!DOCTYPE%20svg%20PUBLIC%20%22-%2F%2FW3C%2F%2FDTD%20SVG%201.1%2F%2FEN%22%20%22http%3A%2F%2Fwww.w3.org%2FGraphics%2FSVG%2F1.1%2FDTD%2Fsvg11.dtd%22%3E%3Csvg%20version%3D%221.1%22%20id%3D%22Layer_1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%20x%3D%220px%22%20y%3D%220px%22%20%20width%3D%2214px%22%20height%3D%2214px%22%20viewBox%3D%220%200%2014%2014%22%20style%3D%22enable-background%3Anew%200%200%2014%2014%3B%22%20xml%3Aspace%3D%22preserve%22%3E%3Cpath%20d%3D%22M8.851%2C10.101c-.18-.399-.2-.763-.153-1.104C9.383%2C8.49%2C9.738%2C7.621%2C9.891%2C6.465C10.493%2C6.355%2C10.5%2C5.967%2C10.5%2C5.5%20c0-.437-.008-.804-.502-.94C9.999%2C4.539%2C10%2C4.521%2C10%2C4.5c0-2.103-1-4-2-4C8%2C0.5%2C7.5%2C0%2C6.5%2C0C5%2C0%2C4%2C1.877%2C4%2C4.5%20c0%2C0.021%2C0.001%2C0.039%2C0.002%2C0.06C3.508%2C4.696%2C3.5%2C5.063%2C3.5%2C5.5c0%2C0.467%2C0.007%2C0.855%2C0.609%2C0.965%20C4.262%2C7.621%2C4.617%2C8.49%2C5.303%2C8.997c0.047%2C0.341%2C0.026%2C0.704-.153%2C1.104C1.503%2C10.503%2C0%2C12%2C0%2C12v2h14v-2%20C14%2C12%2C12.497%2C10.503%2C8.851%2C10.101z%22%2F%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3C%2Fsvg%3E)}.ui-icon-alt.ui-icon-phone:after,.ui-icon-alt .ui-icon-phone:after{background-image:url(data:image/svg+xml;charset=US-ASCII,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22iso-8859-1%22%3F%3E%3C!DOCTYPE%20svg%20PUBLIC%20%22-%2F%2FW3C%2F%2FDTD%20SVG%201.1%2F%2FEN%22%20%22http%3A%2F%2Fwww.w3.org%2FGraphics%2FSVG%2F1.1%2FDTD%2Fsvg11.dtd%22%3E%3Csvg%20version%3D%221.1%22%20id%3D%22Layer_1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%20x%3D%220px%22%20y%3D%220px%22%20%20width%3D%2213.979px%22%20height%3D%2214.016px%22%20viewBox%3D%220%200%2013.979%2014.016%22%20style%3D%22enable-background%3Anew%200%200%2013.979%2014.016%3B%22%20%20xml%3Aspace%3D%22preserve%22%3E%3Cpath%20d%3D%22M6.939%2C9.189C6.165%2C8.557%2C5.271%2C7.705%2C4.497%2C6.744C3.953%2C6.071%2C3.473%2C5.363%2C3.969%2C4.866l-3.482-3.48%20C-.021%2C2.02-1.146%2C5.04%2C3.675%2C9.984c5.08%2C5.211%2C8.356%2C4.096%2C8.92%2C3.51l-3.396-3.4C8.725%2C10.568%2C8.113%2C10.146%2C6.939%2C9.189z%20%20M13.82%2C11.519v-.004c0%2C0-2.649-2.646-2.65-2.648c-.21-.21-.546-.205-.754%2C0.002L9.455%2C9.831l3.404%2C3.408%20c0%2C0%2C0.962-.96%2C0.961-.961l0.002-.001C14.043%2C12.056%2C14.021%2C11.721%2C13.82%2C11.519z%20M5.192%2C3.644V3.642%20c0.221-.222%2C0.2-.557%2C0-.758V2.881c0%2C0-2.726-2.724-2.727-2.725C2.255-.055%2C1.92-.05%2C1.712%2C0.157L0.751%2C1.121l3.48%2C3.483%20C4.231%2C4.604%2C5.192%2C3.645%2C5.192%2C3.644z%22%2F%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3C%2Fsvg%3E)}.ui-icon-alt.ui-icon-plus:after,.ui-icon-alt .ui-icon-plus:after{background-image:url(data:image/svg+xml;charset=US-ASCII,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22iso-8859-1%22%3F%3E%3C!DOCTYPE%20svg%20PUBLIC%20%22-%2F%2FW3C%2F%2FDTD%20SVG%201.1%2F%2FEN%22%20%22http%3A%2F%2Fwww.w3.org%2FGraphics%2FSVG%2F1.1%2FDTD%2Fsvg11.dtd%22%3E%3Csvg%20version%3D%221.1%22%20id%3D%22Layer_1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%20x%3D%220px%22%20y%3D%220px%22%20%20width%3D%2214px%22%20height%3D%2214px%22%20viewBox%3D%220%200%2014%2014%22%20style%3D%22enable-background%3Anew%200%200%2014%2014%3B%22%20xml%3Aspace%3D%22preserve%22%3E%3Cpolygon%20points%3D%2214%2C5%209%2C5%209%2C0%205%2C0%205%2C5%200%2C5%200%2C9%205%2C9%205%2C14%209%2C14%209%2C9%2014%2C9%20%22%2F%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3C%2Fsvg%3E)}.ui-icon-alt.ui-icon-power:after,.ui-icon-alt .ui-icon-power:after{background-image:url(data:image/svg+xml;charset=US-ASCII,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22iso-8859-1%22%3F%3E%3C!DOCTYPE%20svg%20PUBLIC%20%22-%2F%2FW3C%2F%2FDTD%20SVG%201.1%2F%2FEN%22%20%22http%3A%2F%2Fwww.w3.org%2FGraphics%2FSVG%2F1.1%2FDTD%2Fsvg11.dtd%22%3E%3Csvg%20version%3D%221.1%22%20id%3D%22Layer_1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%20x%3D%220px%22%20y%3D%220px%22%20%20width%3D%2212px%22%20height%3D%2213.896px%22%20viewBox%3D%220%200%2012%2013.896%22%20style%3D%22enable-background%3Anew%200%200%2012%2013.896%3B%22%20xml%3Aspace%3D%22preserve%22%3E%3Cpath%20d%3D%22M10.243%2C3.356c-.392-.401-1.024-.401-1.415%2C0c-.39%2C0.402-.39%2C1.054%2C0%2C1.455C9.584%2C5.59%2C10%2C6.623%2C10%2C7.722%20c0%2C1.1-.416%2C2.133-1.172%2C2.911c-1.511%2C1.556-4.145%2C1.556-5.656%2C0C2.416%2C9.854%2C2%2C8.821%2C2%2C7.722c0-1.099%2C0.416-2.132%2C1.172-2.91%20c0.39-.401%2C0.39-1.053%2C0-1.455c-.391-.401-1.024-.401-1.415%2C0C0.624%2C4.522%2C0%2C6.073%2C0%2C7.722c0%2C1.649%2C0.624%2C3.2%2C1.757%2C4.366%20C2.891%2C13.254%2C4.397%2C13.896%2C6%2C13.896s3.109-.643%2C4.243-1.809C11.376%2C10.922%2C12%2C9.371%2C12%2C7.722C12%2C6.073%2C11.376%2C4.522%2C10.243%2C3.356z%20%20M6%2C8c0.553%2C0%2C1-.447%2C1-1V1c0-.553-.447-1-1-1S5%2C0.447%2C5%2C1v6C5%2C7.553%2C5.447%2C8%2C6%2C8z%22%2F%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3C%2Fsvg%3E)}.ui-icon-alt.ui-icon-recycle:after,.ui-icon-alt .ui-icon-recycle:after{background-image:url(data:image/svg+xml;charset=US-ASCII,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22iso-8859-1%22%3F%3E%3C!DOCTYPE%20svg%20PUBLIC%20%22-%2F%2FW3C%2F%2FDTD%20SVG%201.1%2F%2FEN%22%20%22http%3A%2F%2Fwww.w3.org%2FGraphics%2FSVG%2F1.1%2FDTD%2Fsvg11.dtd%22%3E%3Csvg%20version%3D%221.1%22%20id%3D%22Layer_1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%20x%3D%220px%22%20y%3D%220px%22%20%20width%3D%2214px%22%20height%3D%2212px%22%20viewBox%3D%220%200%2014%2012%22%20style%3D%22enable-background%3Anew%200%200%2014%2012%3B%22%20xml%3Aspace%3D%22preserve%22%3E%3Cpath%20d%3D%22M3%2C6h1L2%2C3L0%2C6h1c0%2C3.313%2C2.687%2C6%2C6%2C6c0.702%2C0%2C1.374-.127%2C2-.349V9.445C8.41%2C9.789%2C7.732%2C10%2C7%2C10C4.791%2C10%2C3%2C8.209%2C3%2C6z%20%20M13%2C6c0-3.313-2.687-6-6-6C6.298%2C0%2C5.626%2C0.127%2C5%2C0.349v2.206C5.59%2C2.211%2C6.268%2C2%2C7%2C2c2.209%2C0%2C4%2C1.791%2C4%2C4h-1l2%2C3l2-3H13z%22%2F%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3C%2Fsvg%3E)}.ui-icon-alt.ui-icon-forward:after,.ui-icon-alt .ui-icon-forward:after{background-image:url(data:image/svg+xml;charset=US-ASCII,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22iso-8859-1%22%3F%3E%3C!DOCTYPE%20svg%20PUBLIC%20%22-%2F%2FW3C%2F%2FDTD%20SVG%201.1%2F%2FEN%22%20%22http%3A%2F%2Fwww.w3.org%2FGraphics%2FSVG%2F1.1%2FDTD%2Fsvg11.dtd%22%3E%3Csvg%20version%3D%221.1%22%20id%3D%22Layer_1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%20x%3D%220px%22%20y%3D%220px%22%20%20width%3D%2212px%22%20height%3D%2214px%22%20viewBox%3D%220%200%2012%2014%22%20style%3D%22enable-background%3Anew%200%200%2012%2014%3B%22%20xml%3Aspace%3D%22preserve%22%3E%3Cpath%20d%3D%22M12%2C4L8%2C0v3C5%2C3%2C0%2C4%2C0%2C8c0%2C5%2C7%2C6%2C7%2C6v-2c0%2C0-5-1-5-4s6-3%2C6-3v3L12%2C4z%22%2F%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3C%2Fsvg%3E)}.ui-icon-alt.ui-icon-refresh:after,.ui-icon-alt .ui-icon-refresh:after{background-image:url(data:image/svg+xml;charset=US-ASCII,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22iso-8859-1%22%3F%3E%3C!DOCTYPE%20svg%20PUBLIC%20%22-%2F%2FW3C%2F%2FDTD%20SVG%201.1%2F%2FEN%22%20%22http%3A%2F%2Fwww.w3.org%2FGraphics%2FSVG%2F1.1%2FDTD%2Fsvg11.dtd%22%3E%3Csvg%20version%3D%221.1%22%20id%3D%22Layer_1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%20x%3D%220px%22%20y%3D%220px%22%20%20width%3D%2214.001px%22%20height%3D%2214.002px%22%20viewBox%3D%220%200%2014.001%2014.002%22%20style%3D%22enable-background%3Anew%200%200%2014.001%2014.002%3B%22%20%20xml%3Aspace%3D%22preserve%22%3E%3Cpath%20d%3D%22M14.001%2C6.001v-6l-2.06%2C2.06c-.423-.424-.897-.809-1.44-1.122C7.153-.994%2C2.872%2C0.153%2C0.939%2C3.501%20c-1.933%2C3.348-.786%2C7.629%2C2.562%2C9.562c3.348%2C1.933%2C7.629%2C0.785%2C9.562-2.562l-1.732-1c-1.381%2C2.392-4.438%2C3.211-6.83%2C1.83%20s-3.211-4.438-1.83-6.83s4.438-3.211%2C6.83-1.83c0.389%2C0.225%2C0.718%2C0.506%2C1.02%2C0.81l-2.52%2C2.52H14.001z%22%2F%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3C%2Fsvg%3E)}.ui-icon-alt.ui-icon-shop:after,.ui-icon-alt .ui-icon-shop:after{background-image:url(data:image/svg+xml;charset=US-ASCII,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22iso-8859-1%22%3F%3E%3C!DOCTYPE%20svg%20PUBLIC%20%22-%2F%2FW3C%2F%2FDTD%20SVG%201.1%2F%2FEN%22%20%22http%3A%2F%2Fwww.w3.org%2FGraphics%2FSVG%2F1.1%2FDTD%2Fsvg11.dtd%22%3E%3Csvg%20version%3D%221.1%22%20id%3D%22Layer_1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%20x%3D%220px%22%20y%3D%220px%22%20%20width%3D%2212px%22%20height%3D%2214px%22%20viewBox%3D%220%200%2012%2014%22%20style%3D%22enable-background%3Anew%200%200%2012%2014%3B%22%20xml%3Aspace%3D%22preserve%22%3E%3Cpath%20d%3D%22M9%2C4V3c0-1.657-1.343-3-3-3S3%2C1.343%2C3%2C3v1H0v10h12V4H9z%20M3.5%2C6C3.224%2C6%2C3%2C5.776%2C3%2C5.5S3.224%2C5%2C3.5%2C5S4%2C5.224%2C4%2C5.5%20S3.776%2C6%2C3.5%2C6z%20M4%2C3c0-1.104%2C0.896-2%2C2-2s2%2C0.896%2C2%2C2v1H4V3z%20M8.5%2C6C8.224%2C6%2C8%2C5.776%2C8%2C5.5S8.224%2C5%2C8.5%2C5S9%2C5.224%2C9%2C5.5%20S8.776%2C6%2C8.5%2C6z%22%2F%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3C%2Fsvg%3E)}.ui-icon-alt.ui-icon-comment:after,.ui-icon-alt .ui-icon-comment:after{background-image:url(data:image/svg+xml;charset=US-ASCII,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22iso-8859-1%22%3F%3E%3C!DOCTYPE%20svg%20PUBLIC%20%22-%2F%2FW3C%2F%2FDTD%20SVG%201.1%2F%2FEN%22%20%22http%3A%2F%2Fwww.w3.org%2FGraphics%2FSVG%2F1.1%2FDTD%2Fsvg11.dtd%22%3E%3Csvg%20version%3D%221.1%22%20id%3D%22Layer_1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%20x%3D%220px%22%20y%3D%220px%22%20%20width%3D%2214px%22%20height%3D%2214px%22%20viewBox%3D%220%200%2014%2014%22%20style%3D%22enable-background%3Anew%200%200%2014%2014%3B%22%20xml%3Aspace%3D%22preserve%22%3E%3Cpath%20d%3D%22M12%2C0H2C0.896%2C0%2C0%2C0.896%2C0%2C2v7c0%2C1.104%2C0.896%2C2%2C2%2C2h1v3l3-3h6c1.104%2C0%2C2-.896%2C2-2V2C14%2C0.896%2C13.104%2C0%2C12%2C0z%22%2F%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3C%2Fsvg%3E)}.ui-icon-alt.ui-icon-star:after,.ui-icon-alt .ui-icon-star:after{background-image:url(data:image/svg+xml;charset=US-ASCII,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22iso-8859-1%22%3F%3E%3C!DOCTYPE%20svg%20PUBLIC%20%22-%2F%2FW3C%2F%2FDTD%20SVG%201.1%2F%2FEN%22%20%22http%3A%2F%2Fwww.w3.org%2FGraphics%2FSVG%2F1.1%2FDTD%2Fsvg11.dtd%22%3E%3Csvg%20version%3D%221.1%22%20id%3D%22Layer_1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%20x%3D%220px%22%20y%3D%220px%22%20%20width%3D%2214px%22%20height%3D%2213px%22%20viewBox%3D%220%200%2014%2013%22%20style%3D%22enable-background%3Anew%200%200%2014%2013%3B%22%20xml%3Aspace%3D%22preserve%22%3E%3Cpolygon%20points%3D%2214%2C5%209%2C5%207%2C0%205%2C5%200%2C5%204%2C8%202.625%2C13%207%2C10%2011.375%2C13%2010%2C8%20%22%2F%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3C%2Fsvg%3E)}.ui-icon-alt.ui-icon-tag:after,.ui-icon-alt .ui-icon-tag:after{background-image:url(data:image/svg+xml;charset=US-ASCII,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22iso-8859-1%22%3F%3E%3C!DOCTYPE%20svg%20PUBLIC%20%22-%2F%2FW3C%2F%2FDTD%20SVG%201.1%2F%2FEN%22%20%22http%3A%2F%2Fwww.w3.org%2FGraphics%2FSVG%2F1.1%2FDTD%2Fsvg11.dtd%22%3E%3Csvg%20version%3D%221.1%22%20id%3D%22Layer_1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%20x%3D%220px%22%20y%3D%220px%22%20%20width%3D%2214px%22%20height%3D%2214px%22%20viewBox%3D%220%200%2014%2014%22%20style%3D%22enable-background%3Anew%200%200%2014%2014%3B%22%20xml%3Aspace%3D%22preserve%22%3E%3Cpath%20d%3D%22M5%2C0H0v5l9%2C9l5-5L5%2C0z%20M3%2C4C2.447%2C4%2C2%2C3.553%2C2%2C3s0.447-1%2C1-1s1%2C0.447%2C1%2C1S3.553%2C4%2C3%2C4z%22%2F%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3C%2Fsvg%3E)}.ui-icon-alt.ui-icon-back:after,.ui-icon-alt .ui-icon-back:after{background-image:url(data:image/svg+xml;charset=US-ASCII,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22iso-8859-1%22%3F%3E%3C!DOCTYPE%20svg%20PUBLIC%20%22-%2F%2FW3C%2F%2FDTD%20SVG%201.1%2F%2FEN%22%20%22http%3A%2F%2Fwww.w3.org%2FGraphics%2FSVG%2F1.1%2FDTD%2Fsvg11.dtd%22%3E%3Csvg%20version%3D%221.1%22%20id%3D%22Layer_1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%20x%3D%220px%22%20y%3D%220px%22%20%20width%3D%2212px%22%20height%3D%2214px%22%20viewBox%3D%220%200%2012%2014%22%20style%3D%22enable-background%3Anew%200%200%2012%2014%3B%22%20xml%3Aspace%3D%22preserve%22%3E%3Cpath%20d%3D%22M4%2C3V0L0%2C4l4%2C4V5c0%2C0%2C6%2C0%2C6%2C3s-5%2C4-5%2C4v2c0%2C0%2C7-1%2C7-6C12%2C4%2C7%2C3%2C4%2C3z%22%2F%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3C%2Fsvg%3E)}.ui-icon-alt.ui-icon-video:after,.ui-icon-alt .ui-icon-video:after{background-image:url(data:image/svg+xml;charset=US-ASCII,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22iso-8859-1%22%3F%3E%3C!DOCTYPE%20svg%20PUBLIC%20%22-%2F%2FW3C%2F%2FDTD%20SVG%201.1%2F%2FEN%22%20%22http%3A%2F%2Fwww.w3.org%2FGraphics%2FSVG%2F1.1%2FDTD%2Fsvg11.dtd%22%3E%3Csvg%20version%3D%221.1%22%20id%3D%22Layer_1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%20x%3D%220px%22%20y%3D%220px%22%20%20width%3D%2214px%22%20height%3D%2210px%22%20viewBox%3D%220%200%2014%2010%22%20style%3D%22enable-background%3Anew%200%200%2014%2010%3B%22%20xml%3Aspace%3D%22preserve%22%3E%3Cpath%20d%3D%22M8%2C0H2C0.896%2C0%2C0%2C0.896%2C0%2C2v6c0%2C1.104%2C0.896%2C2%2C2%2C2h6c1.104%2C0%2C2-.896%2C2-2V5V2C10%2C0.896%2C9.104%2C0%2C8%2C0z%20M10%2C5l4%2C4V1L10%2C5z%22%2F%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3C%2Fsvg%3E)}.ui-icon-alt.ui-icon-alert:after,.ui-icon-alt .ui-icon-alert:after{background-image:url(data:image/svg+xml;charset=US-ASCII,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22iso-8859-1%22%3F%3E%3C!DOCTYPE%20svg%20PUBLIC%20%22-%2F%2FW3C%2F%2FDTD%20SVG%201.1%2F%2FEN%22%20%22http%3A%2F%2Fwww.w3.org%2FGraphics%2FSVG%2F1.1%2FDTD%2Fsvg11.dtd%22%3E%3Csvg%20version%3D%221.1%22%20id%3D%22Layer_1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%20x%3D%220px%22%20y%3D%220px%22%20%20width%3D%2214px%22%20height%3D%2212px%22%20viewBox%3D%220%200%2014%2012%22%20style%3D%22enable-background%3Anew%200%200%2014%2012%3B%22%20xml%3Aspace%3D%22preserve%22%3E%3Cpath%20d%3D%22M7%2C0L0%2C12h14L7%2C0z%20M7%2C11c-.553%2C0-1-.447-1-1s0.447-1%2C1-1s1%2C0.447%2C1%2C1S7.553%2C11%2C7%2C11z%20M7%2C8C6.447%2C8%2C6%2C7.553%2C6%2C7V5%20c0-.553%2C0.447-1%2C1-1s1%2C0.447%2C1%2C1v2C8%2C7.553%2C7.553%2C8%2C7%2C8z%22%2F%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3C%2Fsvg%3E)}.ui-icon-alt.ui-icon-delete:after,.ui-icon-alt .ui-icon-delete:after{background-image:url(data:image/svg+xml;charset=US-ASCII,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22iso-8859-1%22%3F%3E%3C!DOCTYPE%20svg%20PUBLIC%20%22-%2F%2FW3C%2F%2FDTD%20SVG%201.1%2F%2FEN%22%20%22http%3A%2F%2Fwww.w3.org%2FGraphics%2FSVG%2F1.1%2FDTD%2Fsvg11.dtd%22%3E%3Csvg%20version%3D%221.1%22%20id%3D%22Layer_1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%20x%3D%220px%22%20y%3D%220px%22%20%20width%3D%2214px%22%20height%3D%2214px%22%20viewBox%3D%220%200%2014%2014%22%20style%3D%22enable-background%3Anew%200%200%2014%2014%3B%22%20xml%3Aspace%3D%22preserve%22%3E%3Cpolygon%20points%3D%2214%2C3%2011%2C0%207%2C4%203%2C0%200%2C3%204%2C7%200%2C11%203%2C14%207%2C10%2011%2C14%2014%2C11%2010%2C7%20%22%2F%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3C%2Fsvg%3E)}.ui-nosvg .ui-icon-action:after{background-image:url(images/icons-png/action-white.png)}.ui-nosvg .ui-icon-arrow-d-l:after{background-image:url(images/icons-png/arrow-d-l-white.png)}.ui-nosvg .ui-icon-arrow-d-r:after{background-image:url(images/icons-png/arrow-d-r-white.png)}.ui-nosvg .ui-icon-arrow-d:after{background-image:url(images/icons-png/arrow-d-white.png)}.ui-nosvg .ui-icon-arrow-l:after{background-image:url(images/icons-png/arrow-l-white.png)}.ui-nosvg .ui-icon-arrow-r:after{background-image:url(images/icons-png/arrow-r-white.png)}.ui-nosvg .ui-icon-arrow-u-l:after{background-image:url(images/icons-png/arrow-u-l-white.png)}.ui-nosvg .ui-icon-arrow-u-r:after{background-image:url(images/icons-png/arrow-u-r-white.png)}.ui-nosvg .ui-icon-arrow-u:after{background-image:url(images/icons-png/arrow-u-white.png)}.ui-nosvg .ui-icon-audio:after{background-image:url(images/icons-png/audio-white.png)}.ui-nosvg .ui-icon-calendar:after{background-image:url(images/icons-png/calendar-white.png)}.ui-nosvg .ui-icon-camera:after{background-image:url(images/icons-png/camera-white.png)}.ui-nosvg .ui-icon-carat-d:after{background-image:url(images/icons-png/carat-d-white.png)}.ui-nosvg .ui-icon-carat-l:after{background-image:url(images/icons-png/carat-l-white.png)}.ui-nosvg .ui-icon-carat-r:after{background-image:url(images/icons-png/carat-r-white.png)}.ui-nosvg .ui-icon-carat-u:after{background-image:url(images/icons-png/carat-u-white.png)}.ui-nosvg .ui-icon-check:after,.ui-nosvg .ui-icon-checkbox-on:after{background-image:url(images/icons-png/check-white.png)}.ui-nosvg .ui-icon-clock:after{background-image:url(images/icons-png/clock-white.png)}.ui-nosvg .ui-icon-cloud:after{background-image:url(images/icons-png/cloud-white.png)}.ui-nosvg .ui-icon-grid:after{background-image:url(images/icons-png/grid-white.png)}.ui-nosvg .ui-icon-mail:after{background-image:url(images/icons-png/mail-white.png)}.ui-nosvg .ui-icon-eye:after{background-image:url(images/icons-png/eye-white.png)}.ui-nosvg .ui-icon-gear:after{background-image:url(images/icons-png/gear-white.png)}.ui-nosvg .ui-icon-heart:after{background-image:url(images/icons-png/heart-white.png)}.ui-nosvg .ui-icon-home:after{background-image:url(images/icons-png/home-white.png)}.ui-nosvg .ui-icon-info:after{background-image:url(images/icons-png/info-white.png)}.ui-nosvg .ui-icon-bullets:after{background-image:url(images/icons-png/bullets-white.png)}.ui-nosvg .ui-icon-bars:after{background-image:url(images/icons-png/bars-white.png)}.ui-nosvg .ui-icon-navigation:after{background-image:url(images/icons-png/navigation-white.png)}.ui-nosvg .ui-icon-lock:after{background-image:url(images/icons-png/lock-white.png)}.ui-nosvg .ui-icon-search:after{background-image:url(images/icons-png/search-white.png)}.ui-nosvg .ui-icon-location:after{background-image:url(images/icons-png/location-white.png)}.ui-nosvg .ui-icon-minus:after{background-image:url(images/icons-png/minus-white.png)}.ui-nosvg .ui-icon-forbidden:after{background-image:url(images/icons-png/forbidden-white.png)}.ui-nosvg .ui-icon-edit:after{background-image:url(images/icons-png/edit-white.png)}.ui-nosvg .ui-icon-user:after{background-image:url(images/icons-png/user-white.png)}.ui-nosvg .ui-icon-phone:after{background-image:url(images/icons-png/phone-white.png)}.ui-nosvg .ui-icon-plus:after{background-image:url(images/icons-png/plus-white.png)}.ui-nosvg .ui-icon-power:after{background-image:url(images/icons-png/power-white.png)}.ui-nosvg .ui-icon-recycle:after{background-image:url(images/icons-png/recycle-white.png)}.ui-nosvg .ui-icon-forward:after{background-image:url(images/icons-png/forward-white.png)}.ui-nosvg .ui-icon-refresh:after{background-image:url(images/icons-png/refresh-white.png)}.ui-nosvg .ui-icon-shop:after{background-image:url(images/icons-png/shop-white.png)}.ui-nosvg .ui-icon-comment:after{background-image:url(images/icons-png/comment-white.png)}.ui-nosvg .ui-icon-star:after{background-image:url(images/icons-png/star-white.png)}.ui-nosvg .ui-icon-tag:after{background-image:url(images/icons-png/tag-white.png)}.ui-nosvg .ui-icon-back:after{background-image:url(images/icons-png/back-white.png)}.ui-nosvg .ui-icon-video:after{background-image:url(images/icons-png/video-white.png)}.ui-nosvg .ui-icon-alert:after{background-image:url(images/icons-png/alert-white.png)}.ui-nosvg .ui-icon-delete:after{background-image:url(images/icons-png/delete-white.png)}.ui-nosvg .ui-icon-alt.ui-icon-action:after,.ui-nosvg .ui-icon-alt .ui-icon-action:after{background-image:url(images/icons-png/action-black.png)}.ui-nosvg .ui-icon-alt.ui-icon-arrow-d:after,.ui-nosvg .ui-icon-alt .ui-icon-arrow-d:after{background-image:url(images/icons-png/arrow-d-black.png)}.ui-nosvg .ui-icon-alt.ui-icon-arrow-d-l:after,.ui-nosvg .ui-icon-alt .ui-icon-arrow-d-l:after{background-image:url(images/icons-png/arrow-d-l-black.png)}.ui-nosvg .ui-icon-alt.ui-icon-arrow-d-r:after,.ui-nosvg .ui-icon-alt .ui-icon-arrow-d-r:after{background-image:url(images/icons-png/arrow-d-r-black.png)}.ui-nosvg .ui-icon-alt.ui-icon-arrow-l:after,.ui-nosvg .ui-icon-alt .ui-icon-arrow-l:after{background-image:url(images/icons-png/arrow-l-black.png)}.ui-nosvg .ui-icon-alt.ui-icon-arrow-r:after,.ui-nosvg .ui-icon-alt .ui-icon-arrow-r:after{background-image:url(images/icons-png/arrow-r-black.png)}.ui-nosvg .ui-icon-alt.ui-icon-arrow-u:after,.ui-nosvg .ui-icon-alt .ui-icon-arrow-u:after{background-image:url(images/icons-png/arrow-u-black.png)}.ui-nosvg .ui-icon-alt.ui-icon-arrow-u-l:after,.ui-nosvg .ui-icon-alt .ui-icon-arrow-u-l:after{background-image:url(images/icons-png/arrow-u-l-black.png)}.ui-nosvg .ui-icon-alt.ui-icon-arrow-u-r:after,.ui-nosvg .ui-icon-alt .ui-icon-arrow-u-r:after{background-image:url(images/icons-png/arrow-u-r-black.png)}.ui-nosvg .ui-icon-alt.ui-icon-audio:after,.ui-nosvg .ui-icon-alt .ui-icon-audio:after{background-image:url(images/icons-png/audio-black.png)}.ui-nosvg .ui-icon-alt.ui-icon-calendar:after,.ui-nosvg .ui-icon-alt .ui-icon-calendar:after{background-image:url(images/icons-png/calendar-black.png)}.ui-nosvg .ui-icon-alt.ui-icon-camera:after,.ui-nosvg .ui-icon-alt .ui-icon-camera:after{background-image:url(images/icons-png/camera-black.png)}.ui-nosvg .ui-icon-alt.ui-icon-carat-d:after,.ui-nosvg .ui-icon-alt .ui-icon-carat-d:after{background-image:url(images/icons-png/carat-d-black.png)}.ui-nosvg .ui-icon-alt.ui-icon-carat-l:after,.ui-nosvg .ui-icon-alt .ui-icon-carat-l:after{background-image:url(images/icons-png/carat-l-black.png)}.ui-nosvg .ui-icon-alt.ui-icon-carat-r:after,.ui-nosvg .ui-icon-alt .ui-icon-carat-r:after{background-image:url(images/icons-png/carat-r-black.png)}.ui-nosvg .ui-icon-alt.ui-icon-carat-u:after,.ui-nosvg .ui-icon-alt .ui-icon-carat-u:after{background-image:url(images/icons-png/carat-u-black.png)}.ui-nosvg .ui-icon-alt.ui-icon-check:after,.ui-nosvg .ui-icon-alt .ui-icon-check:after,.ui-nosvg .ui-icon-alt.ui-icon-checkbox-on:after,.ui-nosvg .ui-icon-alt .ui-icon-checkbox-on:after{background-image:url(images/icons-png/check-black.png)}.ui-nosvg .ui-icon-alt.ui-icon-clock:after,.ui-nosvg .ui-icon-alt .ui-icon-clock:after{background-image:url(images/icons-png/clock-black.png)}.ui-nosvg .ui-icon-alt.ui-icon-cloud:after,.ui-nosvg .ui-icon-alt .ui-icon-cloud:after{background-image:url(images/icons-png/cloud-black.png)}.ui-nosvg .ui-icon-alt.ui-icon-grid:after,.ui-nosvg .ui-icon-alt .ui-icon-grid:after{background-image:url(images/icons-png/grid-black.png)}.ui-nosvg .ui-icon-alt.ui-icon-mail:after,.ui-nosvg .ui-icon-alt .ui-icon-mail:after{background-image:url(images/icons-png/mail-black.png)}.ui-nosvg .ui-icon-alt.ui-icon-eye:after,.ui-nosvg .ui-icon-alt .ui-icon-eye:after{background-image:url(images/icons-png/eye-black.png)}.ui-nosvg .ui-icon-alt.ui-icon-gear:after,.ui-nosvg .ui-icon-alt .ui-icon-gear:after{background-image:url(images/icons-png/gear-black.png)}.ui-nosvg .ui-icon-alt.ui-icon-heart:after,.ui-nosvg .ui-icon-alt .ui-icon-heart:after{background-image:url(images/icons-png/heart-black.png)}.ui-nosvg .ui-icon-alt.ui-icon-home:after,.ui-nosvg .ui-icon-alt .ui-icon-home:after{background-image:url(images/icons-png/home-black.png)}.ui-nosvg .ui-icon-alt.ui-icon-info:after,.ui-nosvg .ui-icon-alt .ui-icon-info:after{background-image:url(images/icons-png/info-black.png)}.ui-nosvg .ui-icon-alt.ui-icon-bars:after,.ui-nosvg .ui-icon-alt .ui-icon-bars:after{background-image:url(images/icons-png/bars-black.png)}.ui-nosvg .ui-icon-alt.ui-icon-bullets:after,.ui-nosvg .ui-icon-alt .ui-icon-bullets:after{background-image:url(images/icons-png/bullets-black.png)}.ui-nosvg .ui-icon-alt.ui-icon-navigation:after,.ui-nosvg .ui-icon-alt .ui-icon-navigation:after{background-image:url(images/icons-png/navigation-black.png)}.ui-nosvg .ui-icon-alt.ui-icon-lock:after,.ui-nosvg .ui-icon-alt .ui-icon-lock:after{background-image:url(images/icons-png/lock-black.png)}.ui-nosvg .ui-icon-alt.ui-icon-search:after,.ui-nosvg .ui-icon-alt .ui-icon-search:after,.ui-nosvg .ui-input-search:after{background-image:url(images/icons-png/search-black.png)}.ui-nosvg .ui-icon-alt.ui-icon-location:after,.ui-nosvg .ui-icon-alt .ui-icon-location:after{background-image:url(images/icons-png/location-black.png)}.ui-nosvg .ui-icon-alt.ui-icon-minus:after,.ui-nosvg .ui-icon-alt .ui-icon-minus:after{background-image:url(images/icons-png/minus-black.png)}.ui-nosvg .ui-icon-alt.ui-icon-forbidden:after,.ui-nosvg .ui-icon-alt .ui-icon-forbidden:after{background-image:url(images/icons-png/forbidden-black.png)}.ui-nosvg .ui-icon-alt.ui-icon-edit:after,.ui-nosvg .ui-icon-alt .ui-icon-edit:after{background-image:url(images/icons-png/edit-black.png)}.ui-nosvg .ui-icon-alt.ui-icon-user:after,.ui-nosvg .ui-icon-alt .ui-icon-user:after{background-image:url(images/icons-png/user-black.png)}.ui-nosvg .ui-icon-alt.ui-icon-phone:after,.ui-nosvg .ui-icon-alt .ui-icon-phone:after{background-image:url(images/icons-png/phone-black.png)}.ui-nosvg .ui-icon-alt.ui-icon-plus:after,.ui-nosvg .ui-icon-alt .ui-icon-plus:after{background-image:url(images/icons-png/plus-black.png)}.ui-nosvg .ui-icon-alt.ui-icon-power:after,.ui-nosvg .ui-icon-alt .ui-icon-power:after{background-image:url(images/icons-png/power-black.png)}.ui-nosvg .ui-icon-alt.ui-icon-recycle:after,.ui-nosvg .ui-icon-alt .ui-icon-recycle:after{background-image:url(images/icons-png/recycle-black.png)}.ui-nosvg .ui-icon-alt.ui-icon-forward:after,.ui-nosvg .ui-icon-alt .ui-icon-forward:after{background-image:url(images/icons-png/forward-black.png)}.ui-nosvg .ui-icon-alt.ui-icon-refresh:after,.ui-nosvg .ui-icon-alt .ui-icon-refresh:after{background-image:url(images/icons-png/refresh-black.png)}.ui-nosvg .ui-icon-alt.ui-icon-shop:after,.ui-nosvg .ui-icon-alt .ui-icon-shop:after{background-image:url(images/icons-png/shop-black.png)}.ui-nosvg .ui-icon-alt.ui-icon-comment:after,.ui-nosvg .ui-icon-alt .ui-icon-comment:after{background-image:url(images/icons-png/comment-black.png)}.ui-nosvg .ui-icon-alt.ui-icon-star:after,.ui-nosvg .ui-icon-alt .ui-icon-star:after{background-image:url(images/icons-png/star-black.png)}.ui-nosvg .ui-icon-alt.ui-icon-tag:after,.ui-nosvg .ui-icon-alt .ui-icon-tag:after{background-image:url(images/icons-png/tag-black.png)}.ui-nosvg .ui-icon-alt.ui-icon-back:after,.ui-nosvg .ui-icon-alt .ui-icon-back:after{background-image:url(images/icons-png/back-black.png)}.ui-nosvg .ui-icon-alt.ui-icon-video:after,.ui-nosvg .ui-icon-alt .ui-icon-video:after{background-image:url(images/icons-png/video-black.png)}.ui-nosvg .ui-icon-alt.ui-icon-alert:after,.ui-nosvg .ui-icon-alt .ui-icon-alert:after{background-image:url(images/icons-png/alert-black.png)}.ui-nosvg .ui-icon-alt.ui-icon-delete:after,.ui-nosvg .ui-icon-alt .ui-icon-delete:after{background-image:url(images/icons-png/delete-black.png)}html{font-size:100%}body,input,select,textarea,button,.ui-btn{font-size:1em;line-height:1.3;font-family:sans-serif}legend,.ui-input-text input,.ui-input-search input{color:inherit;text-shadow:inherit}.ui-mobile label,div.ui-controlgroup-label{font-weight:400;font-size:16px}.ui-field-contain{border-bottom-color:#828282;border-bottom-color:rgba(0,0,0,.15);border-bottom-width:1px;border-bottom-style:solid}.ui-btn,label.ui-btn{font-weight:700;border-width:1px;border-style:solid}.ui-btn:link{text-decoration:none!important}.ui-btn-active{cursor:pointer}.ui-corner-all{-webkit-border-radius:.6em;border-radius:.6em}.ui-btn-corner-all,.ui-btn.ui-corner-all,.ui-slider-track.ui-corner-all,.ui-flipswitch.ui-corner-all{-webkit-border-radius:.3125em;border-radius:.3125em}.ui-btn-icon-notext.ui-btn-corner-all,.ui-btn-icon-notext.ui-corner-all,.ui-li-count{-webkit-border-radius:1em;border-radius:1em}.ui-btn-corner-all,.ui-corner-all{-webkit-background-clip:padding;background-clip:padding-box}.ui-shadow{-webkit-box-shadow:0 1px 3px rgba(0,0,0,.15);-moz-box-shadow:0 1px 3px rgba(0,0,0,.15);box-shadow:0 1px 3px rgba(0,0,0,.15)}.ui-shadow-inset{-webkit-box-shadow:inset 0 1px 3px rgba(0,0,0,.2);-moz-box-shadow:inset 0 1px 3px rgba(0,0,0,.2);box-shadow:inset 0 1px 3px 0 1px 3px rgba(0,0,0,.2)}.ui-overlay-shadow{-webkit-box-shadow:0 0 12px rgba(0,0,0,.6);-moz-box-shadow:0 0 12px rgba(0,0,0,.6);box-shadow:0 0 12px rgba(0,0,0,.6)}.ui-btn:after,html .ui-btn.ui-icon-checkbox-off:after,html .ui-btn.ui-icon-radio-off:after{background-color:#999;background-color:rgba(0,0,0,.3);background-position:center center;background-repeat:no-repeat;-webkit-border-radius:1em;border-radius:1em;display:none}.ui-icon-alt.ui-btn:after,.ui-icon-alt .ui-btn:after,html .ui-icon-alt.ui-icon-checkbox-off:after,html .ui-icon-alt.ui-icon-radio-off:after,html .ui-icon-alt .ui-icon-checkbox-off:after,html .ui-icon-alt .ui-icon-radio-off:after{background-color:#999;background-color:rgba(255,255,255,.3)}.ui-icon-nodisc.ui-btn:after,.ui-icon-nodisc .ui-btn:after{background-color:transparent}.ui-shadow-icon.ui-btn:after,.ui-shadow-icon .ui-btn:after{-webkit-box-shadow:0 1px 0 rgba(255,255,255,.3);-moz-box-shadow:0 1px 0 rgba(255,255,255,.3);box-shadow:0 1px 0 rgba(255,255,255,.3)}.ui-icon-action:after,.ui-icon-arrow-d-l:after,.ui-icon-arrow-d-r:after,.ui-icon-arrow-d:after,.ui-icon-arrow-l:after,.ui-icon-arrow-r:after,.ui-icon-arrow-u-l:after,.ui-icon-arrow-u-r:after,.ui-icon-arrow-u:after,.ui-icon-audio:after,.ui-icon-calendar:after,.ui-icon-camera:after,.ui-icon-carat-d:after,.ui-icon-carat-l:after,.ui-icon-carat-r:after,.ui-icon-carat-u:after,.ui-icon-check:after,.ui-icon-clock:after,.ui-icon-cloud:after,.ui-icon-grid:after,.ui-icon-mail:after,.ui-icon-eye:after,.ui-icon-gear:after,.ui-icon-heart:after,.ui-icon-home:after,.ui-icon-info:after,.ui-icon-bullets:after,.ui-icon-bars:after,.ui-icon-navigation:after,.ui-icon-lock:after,.ui-icon-search:after,.ui-icon-location:after,.ui-icon-minus:after,.ui-icon-forbidden:after,.ui-icon-edit:after,.ui-icon-user:after,.ui-icon-phone:after,.ui-icon-plus:after,.ui-icon-power:after,.ui-icon-recycle:after,.ui-icon-forward:after,.ui-icon-refresh:after,.ui-icon-shop:after,.ui-icon-comment:after,.ui-icon-star:after,.ui-icon-tag:after,.ui-icon-back:after,.ui-icon-video:after,.ui-icon-alert:after,.ui-icon-delete:after{display:block}html .ui-btn.ui-icon-checkbox-off:after,html .ui-btn.ui-icon-checkbox-on:after,html .ui-btn.ui-icon-radio-off:after,html .ui-btn.ui-icon-radio-on:after{display:block;width:18px;height:18px;margin:-9px 2px 0 2px}.ui-btn.ui-icon-checkbox-off:after,.ui-btn.ui-icon-radio-off:after{background-image:none;filter:Alpha(Opacity=30);opacity:.3}.ui-btn.ui-icon-checkbox-off:after,.ui-btn.ui-icon-checkbox-on:after{-webkit-border-radius:.1875em;border-radius:.1875em}.ui-radio .ui-btn.ui-icon-radio-on:after{background-image:none;background-color:#fff;width:8px;height:8px;border-width:5px;border-style:solid}.ui-icon-alt.ui-btn.ui-icon-radio-on:after,.ui-icon-alt .ui-btn.ui-icon-radio-on:after{background-color:#000}.ui-icon-loading{background:url(images/ajax-loader.gif);background-size:2.875em 2.875em}.ui-bar-a,.ui-page-theme-a .ui-bar-inherit,html .ui-bar-a .ui-bar-inherit,html .ui-body-a .ui-bar-inherit,html body .ui-group-theme-a .ui-bar-inherit{background:#f1f1f1;border-color:#ddd;color:#111;text-shadow:0 1px 0 #eee;font-weight:700}.ui-bar-a{border-width:1px;border-style:solid}.ui-page-theme-a,.ui-page-theme-a .ui-panel-wrapper,.ui-page-theme-a .ui-li-count,html .ui-bar-a .ui-li-count,html .ui-body-a .ui-li-count,html body .ui-group-theme-a .ui-li-count,.ui-btn.ui-btn-a>.ui-li-count,.ui-li-static.ui-body-a>.ui-li-count,.ui-li-divider.ui-bar-a>.ui-li-count,.ui-listview li .ui-li-count.ui-body-a{background:#f9f9f9;border-color:#bbb;color:#111;text-shadow:0 1px 0 #eee}.ui-body-a,.ui-page-theme-a .ui-body-inherit,html .ui-bar-a .ui-body-inherit,html .ui-body-a .ui-body-inherit,html body .ui-group-theme-a .ui-body-inherit,.ui-overlay-a{background:#fff;border-color:#ddd;color:#111;text-shadow:0 1px 0 #eee}.ui-body-a{border-width:1px;border-style:solid}.ui-page-theme-a a,html .ui-bar-a a,html .ui-body-a a,html body .ui-group-theme-a a{color:#06f;font-weight:700}.ui-page-theme-a a:visited,html .ui-bar-a a:visited,html .ui-body-a a:visited,html body .ui-group-theme-a a:visited{color:#06f}.ui-page-theme-a a:hover,html .ui-bar-a a:hover,html .ui-body-a a:hover,html body .ui-group-theme-a a:hover{color:#03f}.ui-page-theme-a a:active,html .ui-bar-a a:active,html .ui-body-a a:active,html body .ui-group-theme-a a:active{color:#03f}.ui-page-theme-a .ui-btn,html .ui-bar-a .ui-btn,html .ui-body-a .ui-btn,html body .ui-btn.ui-btn-a,html body .ui-group-theme-a .ui-btn,[class*=ui-group-theme-] .ui-btn.ui-btn-a,.ui-page-theme-a .ui-btn:visited,html .ui-bar-a .ui-btn:visited,html .ui-body-a .ui-btn:visited,html body .ui-btn.ui-btn-a:visited,html body .ui-group-theme-a .ui-btn:visited,[class*=ui-group-theme-] .ui-btn.ui-btn-a:visited{background:#f6f6f6;border-color:#ddd;color:#111;text-shadow:0 1px 0 #eee}.ui-page-theme-a .ui-btn:hover,html .ui-bar-a .ui-btn:hover,html .ui-body-a .ui-btn:hover,html body .ui-btn.ui-btn-a:hover,html body .ui-group-theme-a .ui-btn:hover,[class*=ui-group-theme-] .ui-btn.ui-btn-a:hover{background:#ededed;border-color:#ddd;color:#111;text-shadow:0 1px 0 #eee}.ui-page-theme-a .ui-btn:active,html .ui-bar-a .ui-btn:active,html .ui-body-a .ui-btn:active,html body .ui-btn.ui-btn-a:active,html body .ui-group-theme-a .ui-btn:active,[class*=ui-group-theme-] .ui-btn.ui-btn-a:active{background:#e8e8e8;border-color:#ddd;color:#111;text-shadow:0 1px 0 #eee}.ui-page-theme-a .ui-btn.ui-btn-active,html .ui-bar-a .ui-btn.ui-btn-active,html .ui-body-a .ui-btn.ui-btn-active,html body .ui-btn.ui-btn-a.ui-btn-active,html body .ui-group-theme-a .ui-btn.ui-btn-active,[class*=ui-group-theme-] .ui-btn.ui-btn-a.ui-btn-active,.ui-page-theme-a .ui-icon-checkbox-on:after,html .ui-bar-a .ui-icon-checkbox-on:after,html .ui-body-a .ui-icon-checkbox-on:after,html body .ui-group-theme-a .ui-icon-checkbox-on:after,.ui-btn.ui-icon-checkbox-on.ui-btn-a:after,.ui-page-theme-a .ui-flipswitch-active,html .ui-bar-a .ui-flipswitch-active,html .ui-body-a .ui-flipswitch-active,html body .ui-group-theme-a .ui-flipswitch-active,html body .ui-flipswitch.ui-bar-a.ui-flipswitch-active,.ui-page-theme-a .ui-slider-track .ui-btn-active,html .ui-bar-a .ui-slider-track .ui-btn-active,html .ui-body-a .ui-slider-track .ui-btn-active,html body .ui-group-theme-a .ui-slider-track .ui-btn-active,html body div.ui-slider-track.ui-body-a .ui-btn-active{background-color:#06f;border-color:#03f;color:#fff;text-shadow:0 1px 0 #03f}.ui-page-theme-a .ui-icon-radio-on:after,html .ui-bar-a .ui-icon-radio-on:after,html .ui-body-a .ui-icon-radio-on:after,html body .ui-group-theme-a .ui-icon-radio-on:after,.ui-btn.ui-icon-radio-on.ui-btn-a:after{border-color:#06f}.ui-page-theme-a .ui-btn:focus,html .ui-bar-a .ui-btn:focus,html .ui-body-a .ui-btn:focus,html body .ui-btn.ui-btn-a:focus,html body .ui-group-theme-a .ui-btn:focus,[class*=ui-group-theme-] .ui-btn.ui-btn-a:focus,.ui-page-theme-a .ui-focus,html .ui-bar-a .ui-focus,html .ui-body-a .ui-focus,html body .ui-btn-a.ui-focus,html body .ui-body-a.ui-focus,html body .ui-group-theme-a .ui-focus,[class*=ui-group-theme-] .ui-btn-a.ui-focus,[class*=ui-group-theme-] .ui-body-a.ui-focus{-webkit-box-shadow:0 0 12px #06f;-moz-box-shadow:0 0 12px #06f;box-shadow:0 0 12px #06f}.ui-bar-b,.ui-page-theme-b .ui-bar-inherit,html .ui-bar-b .ui-bar-inherit,html .ui-body-b .ui-bar-inherit,html body .ui-group-theme-b .ui-bar-inherit{background:#1d1d1d;border-color:#1b1b1b;color:#fff;text-shadow:0 1px 0 #111;font-weight:700}.ui-bar-b{border-width:1px;border-style:solid}.ui-page-theme-b,.ui-page-theme-b .ui-panel-wrapper,.ui-page-theme-b .ui-li-count,html .ui-bar-b .ui-li-count,html .ui-body-b .ui-li-count,html body .ui-group-theme-b .ui-li-count,.ui-btn.ui-btn-b>.ui-li-count,.ui-li-static.ui-body-b>.ui-li-count,.ui-li-divider.ui-bar-b>.ui-li-count,.ui-listview li .ui-li-count.ui-body-b{background:#252525;border-color:#454545;color:#fff;text-shadow:0 1px 0 #111}.ui-body-b,.ui-page-theme-b .ui-body-inherit,html .ui-bar-b .ui-body-inherit,html .ui-body-b .ui-body-inherit,html body .ui-group-theme-b .ui-body-inherit,.ui-overlay-b{background:#2a2a2a;border-color:#1d1d1d;color:#fff;text-shadow:0 1px 0 #111}.ui-body-b{border-width:1px;border-style:solid}.ui-page-theme-b a,html .ui-bar-b a,html .ui-body-b a,html body .ui-group-theme-b a{color:#3cf;font-weight:700}.ui-page-theme-b a:visited,html .ui-bar-b a:visited,html .ui-body-b a:visited,html body .ui-group-theme-b a:visited{color:#3cf}.ui-page-theme-b a:hover,html .ui-bar-b a:hover,html .ui-body-b a:hover,html body .ui-group-theme-b a:hover{color:#39f}.ui-page-theme-b a:active,html .ui-bar-b a:active,html .ui-body-b a:active,html body .ui-group-theme-b a:active{color:#39f}.ui-page-theme-b .ui-btn,html .ui-bar-b .ui-btn,html .ui-body-b .ui-btn,html body .ui-btn.ui-btn-b,html body .ui-group-theme-b .ui-btn,[class*=ui-group-theme-] .ui-btn.ui-btn-b,.ui-page-theme-b .ui-btn:visited,html .ui-bar-b .ui-btn:visited,html .ui-body-b .ui-btn:visited,html body .ui-btn.ui-btn-b:visited,html body .ui-group-theme-b .ui-btn:visited,[class*=ui-group-theme-] .ui-btn.ui-btn-b:visited{background:#333;border-color:#1f1f1f;color:#fff;text-shadow:0 1px 0 #111}.ui-page-theme-b .ui-btn:hover,html .ui-bar-b .ui-btn:hover,html .ui-body-b .ui-btn:hover,html body .ui-btn.ui-btn-b:hover,html body .ui-group-theme-b .ui-btn:hover,[class*=ui-group-theme-] .ui-btn.ui-btn-b:hover{background:#373737;border-color:#1f1f1f;color:#fff;text-shadow:0 1px 0 #111}.ui-page-theme-b .ui-btn:active,html .ui-bar-b .ui-btn:active,html .ui-body-b .ui-btn:active,html body .ui-btn.ui-btn-b:active,html body .ui-group-theme-b .ui-btn:active,[class*=ui-group-theme-] .ui-btn.ui-btn-b:active{background:#404040;border-color:#1f1f1f;color:#fff;text-shadow:0 1px 0 #111}.ui-page-theme-b .ui-btn.ui-btn-active,html .ui-bar-b .ui-btn.ui-btn-active,html .ui-body-b .ui-btn.ui-btn-active,html body .ui-btn.ui-btn-b.ui-btn-active,html body .ui-group-theme-b .ui-btn.ui-btn-active,[class*=ui-group-theme-] .ui-btn.ui-btn-b.ui-btn-active,.ui-page-theme-b .ui-icon-checkbox-on:after,html .ui-bar-b .ui-icon-checkbox-on:after,html .ui-body-b .ui-icon-checkbox-on:after,html body .ui-group-theme-b .ui-icon-checkbox-on:after,.ui-btn.ui-icon-checkbox-on.ui-btn-b:after,.ui-page-theme-b .ui-flipswitch-active,html .ui-bar-b .ui-flipswitch-active,html .ui-body-b .ui-flipswitch-active,html body .ui-group-theme-b .ui-flipswitch-active,html body .ui-flipswitch.ui-bar-b.ui-flipswitch-active,.ui-page-theme-b .ui-slider-track .ui-btn-active,html .ui-bar-b .ui-slider-track .ui-btn-active,html .ui-body-b .ui-slider-track .ui-btn-active,html body .ui-group-theme-b .ui-slider-track .ui-btn-active,html body div.ui-slider-track.ui-body-b .ui-btn-active{background-color:#3cf;border-color:#39f;color:#fff;text-shadow:0 1px 0 #39f}.ui-page-theme-b .ui-icon-radio-on:after,html .ui-bar-b .ui-icon-radio-on:after,html .ui-body-b .ui-icon-radio-on:after,html body .ui-group-theme-b .ui-icon-radio-on:after,.ui-btn.ui-icon-radio-on.ui-btn-b:after{border-color:#3cf}.ui-page-theme-b .ui-btn:focus,html .ui-bar-b .ui-btn:focus,html .ui-body-b .ui-btn:focus,html body .ui-btn.ui-btn-b:focus,html body .ui-group-theme-b .ui-btn:focus,[class*=ui-group-theme-] .ui-btn.ui-btn-b:focus,.ui-page-theme-b .ui-focus,html .ui-bar-b .ui-focus,html .ui-body-b .ui-focus,html body .ui-btn-b.ui-focus,html body .ui-body-b.ui-focus,html body .ui-group-theme-b .ui-focus,[class*=ui-group-theme-] .ui-btn-b.ui-focus,[class*=ui-group-theme-] .ui-body-b.ui-focus{-webkit-box-shadow:0 0 12px #3cf;-moz-box-shadow:0 0 12px #3cf;box-shadow:0 0 12px #3cf}.ui-disabled,.ui-state-disabled,.ui-select .ui-btn.ui-state-disabled{filter:Alpha(Opacity=30);opacity:.3;cursor:default!important;pointer-events:none}.ui-btn:focus,.ui-btn.ui-focus{outline:0}.ui-noboxshadow *{-webkit-box-shadow:none!important;-moz-box-shadow:none!important;box-shadow:none!important}.ui-noboxshadow .ui-btn:focus,.ui-noboxshadow .ui-focus{outline-width:1px;outline-style:auto}.ui-mobile,.ui-mobile body{height:99.9%}.ui-mobile fieldset,.ui-page{padding:0;margin:0}.ui-mobile a img,.ui-mobile fieldset{border-width:0}.ui-mobile fieldset{min-width:0}@-moz-document url-prefix(){.ui-mobile fieldset{display:table-column}}.ui-mobile-viewport{margin:0;overflow-x:visible;-webkit-text-size-adjust:100%;-ms-text-size-adjust:none;-webkit-tap-highlight-color:rgba(0,0,0,0)}body.ui-mobile-viewport,div.ui-mobile-viewport{overflow-x:hidden}.ui-mobile [data-role=page],.ui-mobile [data-role=dialog],.ui-page{top:0;left:0;width:100%;min-height:100%;position:absolute;display:none;border:0}.ui-page{outline:0}.ui-mobile .ui-page-active{display:block;overflow:visible;overflow-x:hidden}@media screen and (orientation:portrait){.ui-mobile .ui-page{min-height:420px}}@media screen and (orientation:landscape){.ui-mobile .ui-page{min-height:300px}}.ui-mobile-rendering>*{visibility:hidden}.ui-nojs{position:absolute!important;height:1px;width:1px;overflow:hidden;clip:rect(1px,1px,1px,1px)}.ui-loading .ui-loader{display:block}.ui-loader{display:none;z-index:9999999;position:fixed;top:50%;left:50%;border:0}.ui-loader-default{background:0;filter:Alpha(Opacity=18);opacity:.18;width:2.875em;height:2.875em;margin-left:-1.4375em;margin-top:-1.4375em}.ui-loader-verbose{width:12.5em;filter:Alpha(Opacity=88);opacity:.88;box-shadow:0 1px 1px -1px #fff;height:auto;margin-left:-6.875em;margin-top:-2.6875em;padding:.625em}.ui-loader-default h1{font-size:0;width:0;height:0;overflow:hidden}.ui-loader-verbose h1{font-size:1em;margin:0;text-align:center}.ui-loader .ui-icon-loading{background-color:#000;display:block;margin:0;width:2.75em;height:2.75em;padding:.0625em;-webkit-border-radius:2.25em;border-radius:2.25em}.ui-loader-verbose .ui-icon-loading{margin:0 auto .625em;filter:Alpha(Opacity=75);opacity:.75}.ui-loader-textonly{padding:.9375em;margin-left:-7.1875em}.ui-loader-textonly .ui-icon-loading{display:none}.ui-loader-fakefix{position:absolute}.ui-bar,.ui-body{position:relative;padding:.4em 1em;overflow:hidden;display:block;clear:both}.ui-bar h1,.ui-bar h2,.ui-bar h3,.ui-bar h4,.ui-bar h5,.ui-bar h6{margin:0;padding:0;font-size:1em;display:inline-block}.ui-header,.ui-footer{border-width:1px 0;border-style:solid;position:relative}.ui-header .ui-title,.ui-footer .ui-title{font-size:1em;min-height:1.1em;text-align:center;display:block;margin:0 30%;padding:.7em 0;text-overflow:ellipsis;overflow:hidden;white-space:nowrap;outline:0!important}.ui-footer .ui-title{margin:0 1em}.ui-content{border-width:0;overflow:visible;overflow-x:hidden;padding:1em}.ui-corner-all>.ui-header:first-child,.ui-corner-all>.ui-content:first-child,.ui-corner-all>.ui-footer:first-child{-webkit-border-top-left-radius:inherit;border-top-left-radius:inherit;-webkit-border-top-right-radius:inherit;border-top-right-radius:inherit}.ui-corner-all>.ui-header:last-child,.ui-corner-all>.ui-content:last-child,.ui-corner-all>.ui-footer:last-child{-webkit-border-bottom-left-radius:inherit;border-bottom-left-radius:inherit;-webkit-border-bottom-right-radius:inherit;border-bottom-right-radius:inherit}.ui-btn{font-size:16px;margin:.5em 0;padding:.7em 1em;display:block;position:relative;text-align:center;text-overflow:ellipsis;overflow:hidden;white-space:nowrap;cursor:pointer;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.ui-btn-icon-notext{padding:0;width:1.75em;height:1.75em;text-indent:-9999px;white-space:nowrap!important}.ui-mini{font-size:12.5px}.ui-mini .ui-btn{font-size:inherit}.ui-mini .ui-controlgroup-label{font-size:16px}.ui-header .ui-btn,.ui-footer .ui-btn{font-size:12.5px;display:inline-block;vertical-align:middle}.ui-header .ui-btn-left,.ui-header .ui-btn-right{font-size:12.5px}.ui-mini.ui-btn-icon-notext,.ui-mini .ui-btn-icon-notext,.ui-header .ui-btn-icon-notext,.ui-footer .ui-btn-icon-notext{font-size:16px;padding:0}.ui-btn-inline{display:inline-block;vertical-align:middle;margin-right:.625em}.ui-btn-icon-left{padding-left:2.5em}.ui-btn-icon-right,.ui-listview>li>.ui-btn[class*=ui-icon-]{padding-right:2.5em}.ui-btn-icon-top{padding-top:2.5em}.ui-btn-icon-bottom{padding-bottom:2.5em}.ui-header .ui-btn-icon-top,.ui-footer .ui-btn-icon-top,.ui-header .ui-btn-icon-bottom,.ui-footer .ui-btn-icon-bottom{padding-left:.3125em;padding-right:.3125em}.ui-btn[class*=ui-icon-]:after{content:"";position:absolute;display:block;width:22px;height:22px}.ui-btn-icon-notext:after,.ui-btn-icon-left:after,.ui-btn-icon-right:after,.ui-listview>li>.ui-btn[class*=ui-icon-]:after{top:50%;margin-top:-11px}.ui-btn-icon-left:after{left:.5625em}.ui-btn-icon-right:after,.ui-listview>li>.ui-btn[class*=ui-icon-]:after{right:.5625em}.ui-mini.ui-btn-icon-left:after,.ui-mini .ui-btn-icon-left:after,.ui-header .ui-btn-icon-left:after,.ui-footer .ui-btn-icon-left:after{left:.37em}.ui-mini.ui-btn-icon-right:after,.ui-mini .ui-btn-icon-right:after,.ui-header .ui-btn-icon-right:after,.ui-footer .ui-btn-icon-right:after{right:.37em}.ui-btn-icon-notext:after,.ui-btn-icon-top:after,.ui-btn-icon-bottom:after{left:50%;margin-left:-11px}.ui-btn-icon-top:after{top:.5625em}.ui-btn-icon-bottom:after{top:auto;bottom:.5625em}.ui-header .ui-btn-left,.ui-header .ui-btn-right,.ui-btn-left>[class*=ui-],.ui-btn-right>[class*=ui-]{margin:0}.ui-btn-left,.ui-btn-right{position:absolute;top:.24em}.ui-btn-left{left:.4em}.ui-btn-right{right:.4em}.ui-btn-icon-notext.ui-btn-left{top:.3125em;left:.3125em}.ui-btn-icon-notext.ui-btn-right{top:.3125em;right:.3125em}.ui-mobile label,.ui-controlgroup-label{display:block;margin:0 0 .4em}.ui-hide-label>label,.ui-hide-label .ui-controlgroup-label,.ui-hide-label .ui-rangeslider label,.ui-hidden-accessible{position:absolute!important;height:1px;width:1px;overflow:hidden;clip:rect(1px,1px,1px,1px)}.ui-screen-hidden{display:none!important}.ui-mobile-viewport-transitioning,.ui-mobile-viewport-transitioning .ui-page{width:100%;height:100%;overflow:hidden;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.ui-page-pre-in{opacity:0}.in{-webkit-animation-timing-function:ease-out;-webkit-animation-duration:350ms;-moz-animation-timing-function:ease-out;-moz-animation-duration:350ms;animation-timing-function:ease-out;animation-duration:350ms}.out{-webkit-animation-timing-function:ease-in;-webkit-animation-duration:225ms;-moz-animation-timing-function:ease-in;-moz-animation-duration:225ms;animation-timing-function:ease-in;animation-duration:225ms}@-webkit-keyframes fadein{from{opacity:0}to{opacity:1}}@-moz-keyframes fadein{from{opacity:0}to{opacity:1}}@keyframes fadein{from{opacity:0}to{opacity:1}}@-webkit-keyframes fadeout{from{opacity:1}to{opacity:0}}@-moz-keyframes fadeout{from{opacity:1}to{opacity:0}}@keyframes fadeout{from{opacity:1}to{opacity:0}}.fade.out{opacity:0;-webkit-animation-duration:125ms;-webkit-animation-name:fadeout;-moz-animation-duration:125ms;-moz-animation-name:fadeout;animation-duration:125ms;animation-name:fadeout}.fade.in{opacity:1;-webkit-animation-duration:225ms;-webkit-animation-name:fadein;-moz-animation-duration:225ms;-moz-animation-name:fadein;animation-duration:225ms;animation-name:fadein}.pop{-webkit-transform-origin:50% 50%;-moz-transform-origin:50% 50%;transform-origin:50% 50%}.pop.in{-webkit-transform:scale(1);-webkit-animation-name:popin;-webkit-animation-duration:350ms;-moz-transform:scale(1);-moz-animation-name:popin;-moz-animation-duration:350ms;transform:scale(1);animation-name:popin;animation-duration:350ms;opacity:1}.pop.out{-webkit-animation-name:fadeout;-webkit-animation-duration:100ms;-moz-animation-name:fadeout;-moz-animation-duration:100ms;animation-name:fadeout;animation-duration:100ms;opacity:0}.pop.in.reverse{-webkit-animation-name:fadein;-moz-animation-name:fadein;animation-name:fadein}.pop.out.reverse{-webkit-transform:scale(.8);-webkit-animation-name:popout;-moz-transform:scale(.8);-moz-animation-name:popout;transform:scale(.8);animation-name:popout}@-webkit-keyframes popin{from{-webkit-transform:scale(.8);opacity:0}to{-webkit-transform:scale(1);opacity:1}}@-moz-keyframes popin{from{-moz-transform:scale(.8);opacity:0}to{-moz-transform:scale(1);opacity:1}}@keyframes popin{from{transform:scale(.8);opacity:0}to{transform:scale(1);opacity:1}}@-webkit-keyframes popout{from{-webkit-transform:scale(1);opacity:1}to{-webkit-transform:scale(.8);opacity:0}}@-moz-keyframes popout{from{-moz-transform:scale(1);opacity:1}to{-moz-transform:scale(.8);opacity:0}}@keyframes popout{from{transform:scale(1);opacity:1}to{transform:scale(.8);opacity:0}}@-webkit-keyframes slideinfromright{from{-webkit-transform:translate3d(100%,0,0)}to{-webkit-transform:translate3d(0,0,0)}}@-moz-keyframes slideinfromright{from{-moz-transform:translateX(100%)}to{-moz-transform:translateX(0)}}@keyframes slideinfromright{from{transform:translateX(100%)}to{transform:translateX(0)}}@-webkit-keyframes slideinfromleft{from{-webkit-transform:translate3d(-100%,0,0)}to{-webkit-transform:translate3d(0,0,0)}}@-moz-keyframes slideinfromleft{from{-moz-transform:translateX(-100%)}to{-moz-transform:translateX(0)}}@keyframes slideinfromleft{from{transform:translateX(-100%)}to{transform:translateX(0)}}@-webkit-keyframes slideouttoleft{from{-webkit-transform:translate3d(0,0,0)}to{-webkit-transform:translate3d(-100%,0,0)}}@-moz-keyframes slideouttoleft{from{-moz-transform:translateX(0)}to{-moz-transform:translateX(-100%)}}@keyframes slideouttoleft{from{transform:translateX(0)}to{transform:translateX(-100%)}}@-webkit-keyframes slideouttoright{from{-webkit-transform:translate3d(0,0,0)}to{-webkit-transform:translate3d(100%,0,0)}}@-moz-keyframes slideouttoright{from{-moz-transform:translateX(0)}to{-moz-transform:translateX(100%)}}@keyframes slideouttoright{from{transform:translateX(0)}to{transform:translateX(100%)}}.slide.out,.slide.in{-webkit-animation-timing-function:ease-out;-webkit-animation-duration:350ms;-moz-animation-timing-function:ease-out;-moz-animation-duration:350ms;animation-timing-function:ease-out;animation-duration:350ms}.slide.out{-webkit-transform:translate3d(-100%,0,0);-webkit-animation-name:slideouttoleft;-moz-transform:translateX(-100%);-moz-animation-name:slideouttoleft;transform:translateX(-100%);animation-name:slideouttoleft}.slide.in{-webkit-transform:translate3d(0,0,0);-webkit-animation-name:slideinfromright;-moz-transform:translateX(0);-moz-animation-name:slideinfromright;transform:translateX(0);animation-name:slideinfromright}.slide.out.reverse{-webkit-transform:translate3d(100%,0,0);-webkit-animation-name:slideouttoright;-moz-transform:translateX(100%);-moz-animation-name:slideouttoright;transform:translateX(100%);animation-name:slideouttoright}.slide.in.reverse{-webkit-transform:translate3d(0,0,0);-webkit-animation-name:slideinfromleft;-moz-transform:translateX(0);-moz-animation-name:slideinfromleft;transform:translateX(0);animation-name:slideinfromleft}.slidefade.out{-webkit-transform:translateX(-100%);-webkit-animation-name:slideouttoleft;-webkit-animation-duration:225ms;-moz-transform:translateX(-100%);-moz-animation-name:slideouttoleft;-moz-animation-duration:225ms;transform:translateX(-100%);animation-name:slideouttoleft;animation-duration:225ms}.slidefade.in{-webkit-transform:translateX(0);-webkit-animation-name:fadein;-webkit-animation-duration:200ms;-moz-transform:translateX(0);-moz-animation-name:fadein;-moz-animation-duration:200ms;transform:translateX(0);animation-name:fadein;animation-duration:200ms}.slidefade.out.reverse{-webkit-transform:translateX(100%);-webkit-animation-name:slideouttoright;-webkit-animation-duration:200ms;-moz-transform:translateX(100%);-moz-animation-name:slideouttoright;-moz-animation-duration:200ms;transform:translateX(100%);animation-name:slideouttoright;animation-duration:200ms}.slidefade.in.reverse{-webkit-transform:translateX(0);-webkit-animation-name:fadein;-webkit-animation-duration:200ms;-moz-transform:translateX(0);-moz-animation-name:fadein;-moz-animation-duration:200ms;transform:translateX(0);animation-name:fadein;animation-duration:200ms}.slidedown.out{-webkit-animation-name:fadeout;-webkit-animation-duration:100ms;-moz-animation-name:fadeout;-moz-animation-duration:100ms;animation-name:fadeout;animation-duration:100ms}.slidedown.in{-webkit-transform:translateY(0);-webkit-animation-name:slideinfromtop;-webkit-animation-duration:250ms;-moz-transform:translateY(0);-moz-animation-name:slideinfromtop;-moz-animation-duration:250ms;transform:translateY(0);animation-name:slideinfromtop;animation-duration:250ms}.slidedown.in.reverse{-webkit-animation-name:fadein;-webkit-animation-duration:150ms;-moz-animation-name:fadein;-moz-animation-duration:150ms;animation-name:fadein;animation-duration:150ms}.slidedown.out.reverse{-webkit-transform:translateY(-100%);-webkit-animation-name:slideouttotop;-webkit-animation-duration:200ms;-moz-transform:translateY(-100%);-moz-animation-name:slideouttotop;-moz-animation-duration:200ms;transform:translateY(-100%);animation-name:slideouttotop;animation-duration:200ms}@-webkit-keyframes slideinfromtop{from{-webkit-transform:translateY(-100%)}to{-webkit-transform:translateY(0)}}@-moz-keyframes slideinfromtop{from{-moz-transform:translateY(-100%)}to{-moz-transform:translateY(0)}}@keyframes slideinfromtop{from{transform:translateY(-100%)}to{transform:translateY(0)}}@-webkit-keyframes slideouttotop{from{-webkit-transform:translateY(0)}to{-webkit-transform:translateY(-100%)}}@-moz-keyframes slideouttotop{from{-moz-transform:translateY(0)}to{-moz-transform:translateY(-100%)}}@keyframes slideouttotop{from{transform:translateY(0)}to{transform:translateY(-100%)}}.slideup.out{-webkit-animation-name:fadeout;-webkit-animation-duration:100ms;-moz-animation-name:fadeout;-moz-animation-duration:100ms;animation-name:fadeout;animation-duration:100ms}.slideup.in{-webkit-transform:translateY(0);-webkit-animation-name:slideinfrombottom;-webkit-animation-duration:250ms;-moz-transform:translateY(0);-moz-animation-name:slideinfrombottom;-moz-animation-duration:250ms;transform:translateY(0);animation-name:slideinfrombottom;animation-duration:250ms}.slideup.in.reverse{-webkit-animation-name:fadein;-webkit-animation-duration:150ms;-moz-animation-name:fadein;-moz-animation-duration:150ms;animation-name:fadein;animation-duration:150ms}.slideup.out.reverse{-webkit-transform:translateY(100%);-webkit-animation-name:slideouttobottom;-webkit-animation-duration:200ms;-moz-transform:translateY(100%);-moz-animation-name:slideouttobottom;-moz-animation-duration:200ms;transform:translateY(100%);animation-name:slideouttobottom;animation-duration:200ms}@-webkit-keyframes slideinfrombottom{from{-webkit-transform:translateY(100%)}to{-webkit-transform:translateY(0)}}@-moz-keyframes slideinfrombottom{from{-moz-transform:translateY(100%)}to{-moz-transform:translateY(0)}}@keyframes slideinfrombottom{from{transform:translateY(100%)}to{transform:translateY(0)}}@-webkit-keyframes slideouttobottom{from{-webkit-transform:translateY(0)}to{-webkit-transform:translateY(100%)}}@-moz-keyframes slideouttobottom{from{-moz-transform:translateY(0)}to{-moz-transform:translateY(100%)}}@keyframes slideouttobottom{from{transform:translateY(0)}to{transform:translateY(100%)}}.viewport-flip{-webkit-perspective:1000;-moz-perspective:1000;perspective:1000;position:absolute}.flip{-webkit-backface-visibility:hidden;-webkit-transform:translateX(0);-moz-backface-visibility:hidden;-moz-transform:translateX(0);backface-visibility:hidden;transform:translateX(0)}.flip.out{-webkit-transform:rotateY(-90deg) scale(.9);-webkit-animation-name:flipouttoleft;-webkit-animation-duration:175ms;-moz-transform:rotateY(-90deg) scale(.9);-moz-animation-name:flipouttoleft;-moz-animation-duration:175ms;transform:rotateY(-90deg) scale(.9);animation-name:flipouttoleft;animation-duration:175ms}.flip.in{-webkit-animation-name:flipintoright;-webkit-animation-duration:225ms;-moz-animation-name:flipintoright;-moz-animation-duration:225ms;animation-name:flipintoright;animation-duration:225ms}.flip.out.reverse{-webkit-transform:rotateY(90deg) scale(.9);-webkit-animation-name:flipouttoright;-moz-transform:rotateY(90deg) scale(.9);-moz-animation-name:flipouttoright;transform:rotateY(90deg) scale(.9);animation-name:flipouttoright}.flip.in.reverse{-webkit-animation-name:flipintoleft;-moz-animation-name:flipintoleft;animation-name:flipintoleft}@-webkit-keyframes flipouttoleft{from{-webkit-transform:rotateY(0)}to{-webkit-transform:rotateY(-90deg) scale(.9)}}@-moz-keyframes flipouttoleft{from{-moz-transform:rotateY(0)}to{-moz-transform:rotateY(-90deg) scale(.9)}}@keyframes flipouttoleft{from{transform:rotateY(0)}to{transform:rotateY(-90deg) scale(.9)}}@-webkit-keyframes flipouttoright{from{-webkit-transform:rotateY(0)}to{-webkit-transform:rotateY(90deg) scale(.9)}}@-moz-keyframes flipouttoright{from{-moz-transform:rotateY(0)}to{-moz-transform:rotateY(90deg) scale(.9)}}@keyframes flipouttoright{from{transform:rotateY(0)}to{transform:rotateY(90deg) scale(.9)}}@-webkit-keyframes flipintoleft{from{-webkit-transform:rotateY(-90deg) scale(.9)}to{-webkit-transform:rotateY(0)}}@-moz-keyframes flipintoleft{from{-moz-transform:rotateY(-90deg) scale(.9)}to{-moz-transform:rotateY(0)}}@keyframes flipintoleft{from{transform:rotateY(-90deg) scale(.9)}to{transform:rotateY(0)}}@-webkit-keyframes flipintoright{from{-webkit-transform:rotateY(90deg) scale(.9)}to{-webkit-transform:rotateY(0)}}@-moz-keyframes flipintoright{from{-moz-transform:rotateY(90deg) scale(.9)}to{-moz-transform:rotateY(0)}}@keyframes flipintoright{from{transform:rotateY(90deg) scale(.9)}to{transform:rotateY(0)}}.viewport-turn{-webkit-perspective:200px;-moz-perspective:200px;-ms-perspective:200px;perspective:200px;position:absolute}.turn{-webkit-backface-visibility:hidden;-webkit-transform:translateX(0);-webkit-transform-origin:0;-moz-backface-visibility:hidden;-moz-transform:translateX(0);-moz-transform-origin:0;backface-visibility :hidden;transform:translateX(0);transform-origin:0}.turn.out{-webkit-transform:rotateY(-90deg) scale(.9);-webkit-animation-name:flipouttoleft;-webkit-animation-duration:125ms;-moz-transform:rotateY(-90deg) scale(.9);-moz-animation-name:flipouttoleft;-moz-animation-duration:125ms;transform:rotateY(-90deg) scale(.9);animation-name:flipouttoleft;animation-duration:125ms}.turn.in{-webkit-animation-name:flipintoright;-webkit-animation-duration:250ms;-moz-animation-name:flipintoright;-moz-animation-duration:250ms;animation-name:flipintoright;animation-duration:250ms}.turn.out.reverse{-webkit-transform:rotateY(90deg) scale(.9);-webkit-animation-name:flipouttoright;-moz-transform:rotateY(90deg) scale(.9);-moz-animation-name:flipouttoright;transform:rotateY(90deg) scale(.9);animation-name:flipouttoright}.turn.in.reverse{-webkit-animation-name:flipintoleft;-moz-animation-name:flipintoleft;animation-name:flipintoleft}@-webkit-keyframes flipouttoleft{from{-webkit-transform:rotateY(0)}to{-webkit-transform:rotateY(-90deg) scale(.9)}}@-moz-keyframes flipouttoleft{from{-moz-transform:rotateY(0)}to{-moz-transform:rotateY(-90deg) scale(.9)}}@keyframes flipouttoleft{from{transform:rotateY(0)}to{transform:rotateY(-90deg) scale(.9)}}@-webkit-keyframes flipouttoright{from{-webkit-transform:rotateY(0)}to{-webkit-transform:rotateY(90deg) scale(.9)}}@-moz-keyframes flipouttoright{from{-moz-transform:rotateY(0)}to{-moz-transform:rotateY(90deg) scale(.9)}}@keyframes flipouttoright{from{transform:rotateY(0)}to{transform:rotateY(90deg) scale(.9)}}@-webkit-keyframes flipintoleft{from{-webkit-transform:rotateY(-90deg) scale(.9)}to{-webkit-transform:rotateY(0)}}@-moz-keyframes flipintoleft{from{-moz-transform:rotateY(-90deg) scale(.9)}to{-moz-transform:rotateY(0)}}@keyframes flipintoleft{from{transform:rotateY(-90deg) scale(.9)}to{transform:rotateY(0)}}@-webkit-keyframes flipintoright{from{-webkit-transform:rotateY(90deg) scale(.9)}to{-webkit-transform:rotateY(0)}}@-moz-keyframes flipintoright{from{-moz-transform:rotateY(90deg) scale(.9)}to{-moz-transform:rotateY(0)}}@keyframes flipintoright{from{transform:rotateY(90deg) scale(.9)}to{transform:rotateY(0)}}.flow{-webkit-transform-origin:50% 30%;-webkit-box-shadow:0 0 20px rgba(0,0,0,.4);-moz-transform-origin:50% 30%;-moz-box-shadow:0 0 20px rgba(0,0,0,.4);transform-origin:50% 30%;box-shadow:0 0 20px rgba(0,0,0,.4)}.ui-dialog.flow{-webkit-transform-origin:none;-webkit-box-shadow:none;-moz-transform-origin:none;-moz-box-shadow:none;transform-origin:none;box-shadow:none}.flow.out{-webkit-transform:translateX(-100%) scale(.7);-webkit-animation-name:flowouttoleft;-webkit-animation-timing-function:ease;-webkit-animation-duration:350ms;-moz-transform:translateX(-100%) scale(.7);-moz-animation-name:flowouttoleft;-moz-animation-timing-function:ease;-moz-animation-duration:350ms;transform:translateX(-100%) scale(.7);animation-name:flowouttoleft;animation-timing-function:ease;animation-duration:350ms}.flow.in{-webkit-transform:translateX(0) scale(1);-webkit-animation-name:flowinfromright;-webkit-animation-timing-function:ease;-webkit-animation-duration:350ms;-moz-transform:translateX(0) scale(1);-moz-animation-name:flowinfromright;-moz-animation-timing-function:ease;-moz-animation-duration:350ms;transform:translateX(0) scale(1);animation-name:flowinfromright;animation-timing-function:ease;animation-duration:350ms}.flow.out.reverse{-webkit-transform:translateX(100%);-webkit-animation-name:flowouttoright;-moz-transform:translateX(100%);-moz-animation-name:flowouttoright;transform:translateX(100%);animation-name:flowouttoright}.flow.in.reverse{-webkit-animation-name:flowinfromleft;-moz-animation-name:flowinfromleft;animation-name:flowinfromleft}@-webkit-keyframes flowouttoleft{0%{-webkit-transform:translateX(0) scale(1)}60%,70%{-webkit-transform:translateX(0) scale(.7)}100%{-webkit-transform:translateX(-100%) scale(.7)}}@-moz-keyframes flowouttoleft{0%{-moz-transform:translateX(0) scale(1)}60%,70%{-moz-transform:translateX(0) scale(.7)}100%{-moz-transform:translateX(-100%) scale(.7)}}@keyframes flowouttoleft{0%{transform:translateX(0) scale(1)}60%,70%{transform:translateX(0) scale(.7)}100%{transform:translateX(-100%) scale(.7)}}@-webkit-keyframes flowouttoright{0%{-webkit-transform:translateX(0) scale(1)}60%,70%{-webkit-transform:translateX(0) scale(.7)}100%{-webkit-transform:translateX(100%) scale(.7)}}@-moz-keyframes flowouttoright{0%{-moz-transform:translateX(0) scale(1)}60%,70%{-moz-transform:translateX(0) scale(.7)}100%{-moz-transform:translateX(100%) scale(.7)}}@keyframes flowouttoright{0%{transform:translateX(0) scale(1)}60%,70%{transform:translateX(0) scale(.7)}100%{transform:translateX(100%) scale(.7)}}@-webkit-keyframes flowinfromleft{0%{-webkit-transform:translateX(-100%) scale(.7)}30%,40%{-webkit-transform:translateX(0) scale(.7)}100%{-webkit-transform:translateX(0) scale(1)}}@-moz-keyframes flowinfromleft{0%{-moz-transform:translateX(-100%) scale(.7)}30%,40%{-moz-transform:translateX(0) scale(.7)}100%{-moz-transform:translateX(0) scale(1)}}@keyframes flowinfromleft{0%{transform:translateX(-100%) scale(.7)}30%,40%{transform:translateX(0) scale(.7)}100%{transform:translateX(0) scale(1)}}@-webkit-keyframes flowinfromright{0%{-webkit-transform:translateX(100%) scale(.7)}30%,40%{-webkit-transform:translateX(0) scale(.7)}100%{-webkit-transform:translateX(0) scale(1)}}@-moz-keyframes flowinfromright{0%{-moz-transform:translateX(100%) scale(.7)}30%,40%{-moz-transform:translateX(0) scale(.7)}100%{-moz-transform:translateX(0) scale(1)}}@keyframes flowinfromright{0%{transform:translateX(100%) scale(.7)}30%,40%{transform:translateX(0) scale(.7)}100%{transform:translateX(0) scale(1)}}.ui-field-contain,.ui-mobile fieldset.ui-field-contain{display:block;position:relative;overflow:visible;clear:both;padding:.8em 0}.ui-field-contain>label+[class*=ui-],.ui-field-contain .ui-controlgroup-controls{margin:0}.ui-field-contain:last-child{border-bottom-width:0}@media (min-width:28em){.ui-field-contain,.ui-mobile fieldset.ui-field-contain{padding:0;margin:1em 0;border-bottom-width:0}.ui-field-contain:before,.ui-field-contain:after{content:"";display:table}.ui-field-contain:after{clear:both}.ui-field-contain>label,.ui-field-contain .ui-controlgroup-label,.ui-field-contain>.ui-rangeslider>label{float:left;width:20%;margin:.5em 2% 0 0}.ui-popup .ui-field-contain>label,.ui-popup .ui-field-contain .ui-controlgroup-label,.ui-popup .ui-field-contain>.ui-rangeslider>label{float:none;width:auto;margin:0 0 .4em}.ui-field-contain>label+[class*=ui-],.ui-field-contain .ui-controlgroup-controls{float:left;width:78%;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;-ms-box-sizing:border-box;box-sizing:border-box}.ui-hide-label>label+[class*=ui-],.ui-hide-label .ui-controlgroup-controls,.ui-popup .ui-field-contain>label+[class*=ui-],.ui-popup .ui-field-contain .ui-controlgroup-controls{float:none;width:100%}}.ui-grid-a,.ui-grid-b,.ui-grid-c,.ui-grid-d,.ui-grid-solo{overflow:hidden}.ui-block-a,.ui-block-b,.ui-block-c,.ui-block-d,.ui-block-e{margin:0;padding:0;border:0;float:left;min-height:1px;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.ui-block-a{clear:left}ul.ui-grid-a,ul.ui-grid-b,ul.ui-grid-c,ul.ui-grid-d,ul.ui-grid-solo,li.ui-block-a,li.ui-block-b,li.ui-block-c,li.ui-block-d,li.ui-block-e{margin-left:0;margin-right:0;padding:0;list-style:none}[class*=ui-grid-] .ui-btn,[class*=ui-grid-] button.ui-btn-inline,[class*=ui-grid-] button.ui-btn-icon-notext{margin-right:.3125em;margin-left:.3125em}.ui-grid-a>.ui-block-a,.ui-grid-a>.ui-block-b{width:50%}.ui-grid-b>.ui-block-a,.ui-grid-b>.ui-block-b,.ui-grid-b>.ui-block-c{width:33.333%}.ui-grid-c>.ui-block-a,.ui-grid-c>.ui-block-b,.ui-grid-c>.ui-block-c,.ui-grid-c>.ui-block-d{width:25%}.ui-grid-d>.ui-block-a,.ui-grid-d>.ui-block-b,.ui-grid-d>.ui-block-c,.ui-grid-d>.ui-block-d,.ui-grid-d>.ui-block-e{width:20%}.ui-grid-solo>.ui-block-a{width:100%;float:none}@media (max-width:35em){.ui-responsive>.ui-block-a,.ui-responsive>.ui-block-b,.ui-responsive>.ui-block-c,.ui-responsive>.ui-block-d,.ui-responsive>.ui-block-e{width:100%;float:none}}.ui-header-fixed,.ui-footer-fixed{left:0;right:0;width:100%;position:fixed;z-index:1000}.ui-header-fixed{top:-1px;padding-top:1px}.ui-header-fixed.ui-fixed-hidden{top:0;padding-top:0}.ui-header-fixed .ui-btn-left,.ui-header-fixed .ui-btn-right{margin-top:1px}.ui-header-fixed.ui-fixed-hidden .ui-btn-left,.ui-header-fixed.ui-fixed-hidden .ui-btn-right{margin-top:0}.ui-footer-fixed{bottom:-1px;padding-bottom:1px}.ui-footer-fixed.ui-fixed-hidden{bottom:0;padding-bottom:0}.ui-header-fullscreen,.ui-footer-fullscreen{filter:Alpha(Opacity=90);opacity:.9}.ui-page-header-fixed{padding-top:2.6875em}.ui-page-footer-fixed{padding-bottom:2.6875em}.ui-page-header-fullscreen>.ui-content,.ui-page-footer-fullscreen>.ui-content{padding:0}.ui-fixed-hidden{position:absolute}.ui-page-header-fullscreen .ui-fixed-hidden,.ui-page-footer-fullscreen .ui-fixed-hidden{position:absolute!important;height:1px;width:1px;overflow:hidden;clip:rect(1px,1px,1px,1px)}.ui-header-fixed .ui-btn,.ui-footer-fixed .ui-btn{z-index:10}.ui-android-2x-fixed .ui-li-has-thumb{-webkit-transform:translate3d(0,0,0)}.ui-navbar{max-width:100%}.ui-navbar ul:before,.ui-navbar ul:after{content:"";display:table}.ui-navbar ul:after{clear:both}.ui-navbar ul{list-style:none;margin:0;padding:0;position:relative;display:block;border:0;max-width:100%;overflow:visible}.ui-navbar li .ui-btn{font-size:12.5px;display:block;margin:0;border-right-width:0}.ui-navbar .ui-btn:focus{z-index:1}.ui-navbar li:last-child .ui-btn{margin-right:-4px}.ui-navbar li:last-child .ui-btn:after{margin-right:4px}.ui-content .ui-navbar li:last-child .ui-btn,.ui-content .ui-navbar .ui-grid-duo .ui-block-b .ui-btn{border-right-width:1px;margin-right:0}.ui-content .ui-navbar li:last-child .ui-btn:after,.ui-content .ui-navbar .ui-grid-duo .ui-block-b .ui-btn:after{margin-right:0}.ui-navbar .ui-grid-duo .ui-block-a:last-child .ui-btn{border-right-width:1px;margin-right:-1px}.ui-navbar .ui-grid-duo .ui-block-a:last-child .ui-btn:after{margin-right:1px}.ui-navbar .ui-grid-duo .ui-btn{border-top-width:0}.ui-navbar .ui-grid-duo .ui-block-a:first-child .ui-btn,.ui-navbar .ui-grid-duo .ui-block-a:first-child+.ui-block-b .ui-btn{border-top-width:1px}.ui-header .ui-navbar .ui-btn,.ui-footer .ui-navbar .ui-btn{border-top-width:0;border-bottom-width:0}.ui-header .ui-navbar .ui-grid-duo .ui-block-a:first-child .ui-btn,.ui-footer .ui-navbar .ui-grid-duo .ui-block-a:first-child .ui-btn,.ui-header .ui-navbar .ui-grid-duo .ui-block-a:first-child+.ui-block-b .ui-btn,.ui-footer .ui-navbar .ui-grid-duo .ui-block-a:first-child+.ui-block-b .ui-btn{border-top-width:0}.ui-header .ui-title~.ui-navbar .ui-btn,.ui-footer .ui-title~.ui-navbar .ui-btn,.ui-header .ui-navbar .ui-grid-duo .ui-btn,.ui-footer .ui-navbar .ui-grid-duo .ui-btn,.ui-header .ui-title~.ui-navbar .ui-grid-duo .ui-block-a:first-child .ui-btn,.ui-footer .ui-title~.ui-navbar .ui-grid-duo .ui-block-a:first-child .ui-btn,.ui-header .ui-title~.ui-navbar .ui-grid-duo .ui-block-a:first-child+.ui-block-b .ui-btn,.ui-footer .ui-title~.ui-navbar .ui-grid-duo .ui-block-a:first-child+.ui-block-b .ui-btn{border-top-width:1px}button.ui-btn{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;-webkit-appearance:none;-moz-appearance:none;width:100%}button.ui-btn::-moz-focus-inner{border:0}button.ui-btn-inline{width:auto}button.ui-btn-icon-notext{-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box;width:1.75em}[class*=ui-grid-] button.ui-btn{margin-right:0;margin-left:0}.ui-input-btn input{position:absolute;top:0;left:0;width:100%;height:100%;padding:0;border:0;outline:0;-webkit-border-radius:inherit;border-bottom-radius:inherit;-webkit-appearance:none;-moz-appearance:none;cursor:pointer;background:#fff;background:rgba(255,255,255,0);filter:Alpha(Opacity=0);opacity:.1;font-size:1px;text-indent:-9999px;z-index:2}.ui-input-btn.ui-state-disabled input{position:absolute!important;height:1px;width:1px;overflow:hidden;clip:rect(1px,1px,1px,1px)}.ui-collapsible{margin:.5em -1em}.ui-collapsible-inset,.ui-collapsible-set{margin:.5em 0}.ui-collapsible+.ui-collapsible{margin-top:-.5em}.ui-collapsible-heading{display:block;margin:0;padding:0;position:relative}.ui-collapsible-heading .ui-btn{text-align:left;margin:0;border-left-width:0;border-right-width:0}.ui-collapsible-heading .ui-btn-icon-top,.ui-collapsible-heading .ui-btn-icon-bottom{text-align:center}.ui-collapsible-inset .ui-collapsible-heading .ui-btn{border-right-width:1px;border-left-width:1px}.ui-collapsible-collapsed+.ui-collapsible:not(.ui-collapsible-inset)>.ui-collapsible-heading .ui-btn{border-top-width:0}.ui-collapsible-set .ui-collapsible:not(.ui-collapsible-inset) .ui-collapsible-heading .ui-btn{border-top-width:1px}.ui-collapsible-heading-status{position:absolute!important;height:1px;width:1px;overflow:hidden;clip:rect(1px,1px,1px,1px)}.ui-collapsible-content{display:block;margin:0;padding:.625em 1em;border-left-width:0;border-right-width:0;border-top-width:0;background-image:none}.ui-collapsible-inset .ui-collapsible-content{margin:0;border-right-width:1px;border-left-width:1px}.ui-collapsible-content-collapsed{display:none}.ui-collapsible-set>.ui-collapsible.ui-corner-all{-webkit-border-radius:0;border-radius:0}.ui-collapsible-heading,.ui-collapsible-heading>.ui-btn{-webkit-border-radius:inherit;border-radius:inherit}.ui-collapsible-set .ui-collapsible.ui-first-child{-webkit-border-top-right-radius:inherit;border-top-right-radius:inherit;-webkit-border-top-left-radius:inherit;border-top-left-radius:inherit}.ui-collapsible-content,.ui-collapsible-set .ui-collapsible.ui-last-child{-webkit-border-bottom-right-radius:inherit;border-bottom-right-radius:inherit;-webkit-border-bottom-left-radius:inherit;border-bottom-left-radius:inherit}.ui-collapsible-themed-content:not(.ui-collapsible-collapsed)>.ui-collapsible-heading{-webkit-border-bottom-right-radius:0;border-bottom-right-radius:0;-webkit-border-bottom-left-radius:0;border-bottom-left-radius:0}.ui-collapsible-set .ui-collapsible{margin:-1px -1em 0}.ui-collapsible-set .ui-collapsible-inset{margin:-1px 0 0}.ui-collapsible-set .ui-collapsible.ui-first-child{margin-top:0}.ui-controlgroup,fieldset.ui-controlgroup{padding:0;margin:.5em 0}.ui-field-contain .ui-controlgroup,.ui-field-contain fieldset.ui-controlgroup{margin:0}.ui-controlgroup-controls .ui-btn,.ui-controlgroup-controls .ui-checkbox,.ui-controlgroup-controls .ui-radio,.ui-controlgroup-controls .ui-select{margin:0}.ui-controlgroup-controls .ui-btn:focus,.ui-controlgroup-controls .ui-btn.ui-focus{z-index:1}.ui-controlgroup-controls li{list-style:none}.ui-controlgroup-horizontal .ui-controlgroup-controls{display:inline-block;vertical-align:middle}.ui-controlgroup-horizontal .ui-controlgroup-controls:before,.ui-controlgroup-horizontal .ui-controlgroup-controls:after{content:"";display:table}.ui-controlgroup-horizontal .ui-controlgroup-controls:after{clear:both}.ui-controlgroup-horizontal .ui-controlgroup-controls>.ui-btn,.ui-controlgroup-horizontal .ui-controlgroup-controls li>.ui-btn,.ui-controlgroup-horizontal .ui-controlgroup-controls .ui-checkbox,.ui-controlgroup-horizontal .ui-controlgroup-controls .ui-radio,.ui-controlgroup-horizontal .ui-controlgroup-controls .ui-select{float:left;clear:none}.ui-controlgroup-horizontal .ui-controlgroup-controls button.ui-btn,.ui-controlgroup-controls .ui-btn-icon-notext{width:auto}.ui-controlgroup-horizontal .ui-controlgroup-controls .ui-btn-icon-notext,.ui-controlgroup-horizontal .ui-controlgroup-controls button.ui-btn-icon-notext{width:1.5em}.ui-controlgroup-controls .ui-btn-icon-notext{height:auto;padding:.7em 1em}.ui-controlgroup-vertical .ui-controlgroup-controls .ui-btn{border-bottom-width:0}.ui-controlgroup-vertical .ui-controlgroup-controls .ui-btn.ui-last-child{border-bottom-width:1px}.ui-controlgroup-horizontal .ui-controlgroup-controls .ui-btn{border-right-width:0}.ui-controlgroup-horizontal .ui-controlgroup-controls .ui-btn.ui-last-child{border-right-width:1px}.ui-controlgroup-controls .ui-btn-corner-all,.ui-controlgroup-controls .ui-btn.ui-corner-all{-webkit-border-radius:0;border-radius:0}.ui-controlgroup-controls,.ui-controlgroup-controls .ui-radio,.ui-controlgroup-controls .ui-checkbox,.ui-controlgroup-controls .ui-select,.ui-controlgroup-controls li{-webkit-border-radius:inherit;border-radius:inherit}.ui-controlgroup-vertical .ui-btn.ui-first-child{-webkit-border-top-left-radius:inherit;border-top-left-radius:inherit;-webkit-border-top-right-radius:inherit;border-top-right-radius:inherit}.ui-controlgroup-vertical .ui-btn.ui-last-child{-webkit-border-bottom-left-radius:inherit;border-bottom-left-radius:inherit;-webkit-border-bottom-right-radius:inherit;border-bottom-right-radius:inherit}.ui-controlgroup-horizontal .ui-btn.ui-first-child{-webkit-border-top-left-radius:inherit;border-top-left-radius:inherit;-webkit-border-bottom-left-radius:inherit;border-bottom-left-radius:inherit}.ui-controlgroup-horizontal .ui-btn.ui-last-child{-webkit-border-top-right-radius:inherit;border-top-right-radius:inherit;-webkit-border-bottom-right-radius:inherit;border-bottom-right-radius:inherit}.ui-controlgroup-controls a.ui-shadow:not(:focus),.ui-controlgroup-controls button.ui-shadow:not(:focus),.ui-controlgroup-controls div.ui-shadow:not(.ui-focus){-moz-box-shadow:none;-webkit-box-shadow:none;box-shadow:none}.ui-controlgroup-label legend{max-width:100%}.ui-controlgroup-controls>label{position:absolute!important;height:1px;width:1px;overflow:hidden;clip:rect(1px,1px,1px,1px)}.ui-dialog{background:none!important}.ui-dialog-contain{width:92.5%;max-width:500px;margin:10% auto 1em;padding:0;position:relative;top:-1em}.ui-dialog-contain>.ui-header,.ui-dialog-contain>.ui-content,.ui-dialog-contain>.ui-footer{display:block;position:relative;width:auto;margin:0}.ui-dialog-contain>.ui-header{overflow:hidden;z-index:10;padding:0;border-top-width:0}.ui-dialog-contain>.ui-footer{z-index:10;padding:0 1em;border-bottom-width:0}.ui-popup-open .ui-header-fixed,.ui-popup-open .ui-footer-fixed{position:absolute!important}.ui-popup-screen{background-image:url(data:image/gif;base64,R0lGODlhAQABAID/AMDAwAAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==);top:0;left:0;right:0;bottom:1px;position:absolute;filter:Alpha(Opacity=0);opacity:0;z-index:1099}.ui-popup-screen.in{opacity:.5;filter:Alpha(Opacity=50)}.ui-popup-screen.out{opacity:0;filter:Alpha(Opacity=0)}.ui-popup-container{z-index:1100;display:inline-block;position:absolute;padding:0;outline:0}.ui-popup{position:relative}.ui-popup.ui-body-inherit{border-width:1px;border-style:solid}.ui-popup-hidden{left:0;top:0;position:absolute!important;visibility:hidden}.ui-popup-truncate{height:1px;width:1px;margin:-1px;overflow:hidden;clip:rect(1px,1px,1px,1px)}.ui-popup.ui-content,.ui-popup .ui-content{overflow:visible}.ui-popup>.ui-header{border-top-width:0}.ui-popup>.ui-footer{border-bottom-width:0}.ui-popup>p,.ui-popup>h1,.ui-popup>h2,.ui-popup>h3,.ui-popup>h4,.ui-popup>h5,.ui-popup>h6{margin:.5em .4375em}.ui-popup>span{display:block;margin:.5em .4375em}.ui-popup-container .ui-content>p,.ui-popup-container .ui-content>h1,.ui-popup-container .ui-content>h2,.ui-popup-container .ui-content>h3,.ui-popup-container .ui-content>h4,.ui-popup-container .ui-content>h5,.ui-popup-container .ui-content>h6{margin:.5em 0}.ui-popup-container .ui-content>span{margin:0}.ui-popup-container .ui-content>p:first-child,.ui-popup-container .ui-content>h1:first-child,.ui-popup-container .ui-content>h2:first-child,.ui-popup-container .ui-content>h3:first-child,.ui-popup-container .ui-content>h4:first-child,.ui-popup-container .ui-content>h5:first-child,.ui-popup-container .ui-content>h6:first-child{margin-top:0}.ui-popup-container .ui-content>p:last-child,.ui-popup-container .ui-content>h1:last-child,.ui-popup-container .ui-content>h2:last-child,.ui-popup-container .ui-content>h3:last-child,.ui-popup-container .ui-content>h4:last-child,.ui-popup-container .ui-content>h5:last-child,.ui-popup-container .ui-content>h6:last-child{margin-bottom:0}.ui-popup>img{max-width:100%;max-height:100%;vertical-align:middle}.ui-popup:not(.ui-content)>img:only-child,.ui-popup:not(.ui-content)>.ui-btn-left:first-child+img:last-child,.ui-popup:not(.ui-content)>.ui-btn-right:first-child+img:last-child{-webkit-border-radius:inherit;border-radius:inherit}.ui-popup iframe{vertical-align:middle}.ui-popup>.ui-btn-left,.ui-popup>.ui-btn-right{position:absolute;top:-11px;margin:0;z-index:1101}.ui-popup>.ui-btn-left{left:-11px}.ui-popup>.ui-btn-right{right:-11px}.ui-popup.ui-corner-all>.arrow-guide{left:.6em;right:.6em;top:.6em;bottom:.6em}.arrow-container{width:20px;height:20px}.arrow-container.l{left:-10px;clip:rect(-1000px,10px,2000px,-1000px)}.arrow-container.ie.l{clip:rect(-1000px 10px 2000px -1000px)}.arrow-container.t{top:-10px;clip:rect(-1000px,2000px,10px,-1000px)}.arrow-container.ie.t{clip:rect(-1000px 2000px 10px -1000px)}.arrow-container.r{right:-10px;clip:rect(-1000px,2000px,2000px,10px)}.arrow-container.ie.r{clip:rect(-1000px 2000px 2000px 10px)}.arrow-container.b{bottom:-10px;clip:rect(10px,2000px,1000px,-1000px)}.arrow-container.ie.b{clip:rect(10px 2000px 1000px -1000px)}.arrow{width:14.142135624px;height:14.142135624px;left:2.928932188px;top:2.928932188px}.arrow-container.ie .arrow{margin-left:-3px;margin-top:-3px}.arrow-background{width:20px;height:20px}.arrow-container.t .arrow-background{background-position:0 10px}.arrow-container.l .arrow-background{background-position:10px 0}.arrow-container.b .arrow-background{background-position:0 11px}.arrow-container.r .arrow-background{background-position:11px 0}.ui-popup>.arrow-guide{position:absolute;left:0;right:0;top:0;bottom:0;pointer-events:none}.arrow-container{position:absolute}.arrow{-webkit-transform:rotate(45deg);-moz-transform:rotate(45deg);-ms-transform:rotate(45deg);transform:rotate(45deg);position:absolute;overflow:hidden;box-sizing:border-box}.arrow-container.ie .arrow{-ms-filter:"progid:DXImageTransform.Microsoft.Matrix(M11=.7071067811865474, M12=-.7071067811865477, M21=.7071067811865477, M22=.7071067811865474, SizingMethod='auto expand')";filter:progid:DXImageTransform.Microsoft.Matrix(M11=.7071067811865474, M12=-.7071067811865477, M21=.7071067811865477, M22=.7071067811865474, SizingMethod='auto expand')}.arrow-background{position:absolute;border:0}.arrow-container.ie .arrow-background{background:0}.arrow-container.t .arrow-background,.arrow-container.b .arrow-background{-webkit-transform:rotate(-45deg) scale(1,-1);-moz-transform:rotate(-45deg) scale(1,-1);-ms-transform:rotate(-45deg) scale(1,-1);transform:rotate(-45deg) scale(1,-1)}.arrow-container.t.ie .arrow-background,.arrow-container.b.ie .arrow-background{-ms-filter:"progid:DXImageTransform.Microsoft.Matrix(M11=.7071067811865483, M12=-.7071067811865467, M21=-.7071067811865467, M22=-.7071067811865483, SizingMethod='auto expand')";filter:progid:DXImageTransform.Microsoft.Matrix(M11=.7071067811865483, M12=-.7071067811865467, M21=-.7071067811865467, M22=-.7071067811865483, SizingMethod='auto expand')}.arrow-container.l .arrow-background,.arrow-container.r .arrow-background{-webkit-transform:rotate(-45deg) scale(-1,1);-moz-transform:rotate(-45deg) scale(-1,1);-ms-transform:rotate(-45deg) scale(-1,1);transform:rotate(-45deg) scale(-1,1)}.arrow-container.l.ie .arrow-background,.arrow-container.r.ie .arrow-background{-ms-filter:"progid:DXImageTransform.Microsoft.Matrix(M11=-.7071067811865483, M12=.7071067811865467, M21=.7071067811865467, M22=.7071067811865483, SizingMethod='auto expand')";filter:progid:DXImageTransform.Microsoft.Matrix(M11=-.7071067811865483, M12=.7071067811865467, M21=.7071067811865467, M22=.7071067811865483, SizingMethod='auto expand')}.ui-checkbox,.ui-radio{margin:.5em 0;position:relative}.ui-checkbox .ui-btn,.ui-radio .ui-btn{margin:0;text-align:left;white-space:normal;z-index:2}.ui-controlgroup .ui-checkbox .ui-btn.ui-focus,.ui-controlgroup .ui-radio .ui-btn.ui-focus{z-index:3}.ui-checkbox .ui-btn-icon-top,.ui-radio .ui-btn-icon-top,.ui-checkbox .ui-btn-icon-bottom,.ui-radio .ui-btn-icon-bottom{text-align:center}.ui-controlgroup-horizontal .ui-checkbox .ui-btn:after,.ui-controlgroup-horizontal .ui-radio .ui-btn:after{content:none;display:none}.ui-checkbox input,.ui-radio input{position:absolute;left:.466em;top:50%;width:22px;height:22px;margin:-11px 0 0 0;outline:0!important;z-index:1}.ui-controlgroup-horizontal .ui-checkbox input,.ui-controlgroup-horizontal .ui-radio input{left:50%;margin-left:-9px}.ui-checkbox input:disabled,.ui-radio input:disabled{position:absolute!important;height:1px;width:1px;overflow:hidden;clip:rect(1px,1px,1px,1px)}.ui-select{margin-top:.5em;margin-bottom:.5em;position:relative}.ui-select>select{position:absolute!important;height:1px;width:1px;overflow:hidden;clip:rect(1px,1px,1px,1px)}.ui-select .ui-btn{margin:0;opacity:1}.ui-select .ui-btn select{position:absolute;top:0;left:0;width:100%;min-height:1.5em;min-height:100%;height:3em;max-height:100%;outline:0;-webkit-border-radius:inherit;border-radius:inherit;-webkit-appearance:none;-moz-appearance:none;cursor:pointer;filter:Alpha(Opacity=0);opacity:0;z-index:2}@-moz-document url-prefix(){.ui-select .ui-btn select{opacity:.0001}}.ui-select .ui-state-disabled select{display:none}.ui-select span.ui-state-disabled{filter:Alpha(Opacity=100);opacity:1}.ui-select .ui-btn.ui-select-nativeonly{border-radius:0;border:0}.ui-select .ui-btn.ui-select-nativeonly select{opacity:1;text-indent:0;display:block}.ui-select .ui-li-has-count.ui-btn{padding-right:2.8125em}.ui-select .ui-li-has-count.ui-btn-icon-right{padding-right:4.6875em}.ui-select .ui-btn-icon-right .ui-li-count{right:3.636em}.ui-select .ui-btn>span:not(.ui-li-count){display:block;text-overflow:ellipsis;overflow:hidden!important;white-space:nowrap}.ui-selectmenu.ui-popup{min-width:11em}.ui-selectmenu .ui-dialog-contain{overflow:hidden}.ui-selectmenu .ui-header{margin:0;padding:0;border:0}.ui-selectmenu.ui-dialog .ui-header{z-index:1;position:relative}.ui-selectmenu.ui-popup .ui-header{-webkit-border-bottom-right-radius:0;border-bottom-right-radius:0;-webkit-border-bottom-left-radius:0;border-bottom-left-radius:0}.ui-selectmenu.ui-popup .ui-header h1:after{content:'.';visibility:hidden}.ui-selectmenu .ui-header .ui-title{margin:0 2.875em}.ui-selectmenu.ui-dialog .ui-content{overflow:visible;z-index:1}.ui-selectmenu .ui-selectmenu-list{margin:0;-webkit-border-radius:inherit;border-radius:inherit}.ui-header:not(.ui-screen-hidden)+.ui-selectmenu-list{-webkit-border-top-right-radius:0;border-top-right-radius:0;-webkit-border-top-left-radius:0;border-top-left-radius:0}.ui-header.ui-screen-hidden+.ui-selectmenu-list li.ui-first-child .ui-btn{border-top-width:0}.ui-selectmenu .ui-selectmenu-list li.ui-last-child .ui-btn{border-bottom-width:0}.ui-selectmenu .ui-btn.ui-li-divider{cursor:default}.ui-selectmenu .ui-selectmenu-placeholder{display:none}.ui-listview,.ui-listview>li{margin:0;padding:0;list-style:none}.ui-content .ui-listview,.ui-panel-inner>.ui-listview{margin:-1em}.ui-collapsible-content>.ui-listview{margin:-.625em -1em}.ui-content .ui-listview-inset,.ui-panel-inner>.ui-listview-inset,.ui-collapsible-content>.ui-listview-inset{margin:1em 0}.ui-listview>li{display:block;position:relative;overflow:visible}.ui-listview .ui-li-static,.ui-listview .ui-li-divider,.ui-listview>li>a.ui-btn{margin:0;display:block;position:relative;text-align:left;text-overflow:ellipsis;overflow:hidden;white-space:nowrap}.ui-listview>li>.ui-btn:focus{z-index:1}.ui-listview .ui-li-static,.ui-listview .ui-li-divider,.ui-listview>li>a.ui-btn{border-width:1px 0 0;border-style:solid}.ui-listview-inset .ui-li-static,.ui-listview-inset .ui-li-divider,.ui-listview-inset>li>a.ui-btn{border-right-width:1px;border-left-width:1px}.ui-listview .ui-li-static.ui-last-child,.ui-listview .ui-li-divider.ui-last-child,.ui-listview>li.ui-last-child>a.ui-btn{border-bottom-width:1px}.ui-collapsible-content>.ui-listview:not(.ui-listview-inset)>li.ui-first-child,.ui-collapsible-content>.ui-listview:not(.ui-listview-inset)>li.ui-first-child>a.ui-btn{border-top-width:0}.ui-collapsible-themed-content .ui-listview:not(.ui-listview-inset)>li.ui-last-child,.ui-collapsible-themed-content .ui-listview:not(.ui-listview-inset)>li.ui-last-child>a.ui-btn{border-bottom-width:0}.ui-listview>li.ui-first-child,.ui-listview>li.ui-first-child>a.ui-btn{-webkit-border-top-right-radius:inherit;border-top-right-radius:inherit;-webkit-border-top-left-radius:inherit;border-top-left-radius:inherit}.ui-listview>li.ui-last-child,.ui-listview>li.ui-last-child>a.ui-btn{-webkit-border-bottom-right-radius:inherit;border-bottom-right-radius:inherit;-webkit-border-bottom-left-radius:inherit;border-bottom-left-radius:inherit}.ui-listview>li.ui-li-has-alt>a.ui-btn{-webkit-border-top-right-radius:0;border-top-right-radius:0;-webkit-border-bottom-right-radius:0;border-bottom-right-radius:0}.ui-listview>li.ui-first-child>a.ui-btn+a.ui-btn{-webkit-border-top-left-radius:0;border-top-left-radius:0;-webkit-border-top-right-radius:inherit;border-top-right-radius:inherit}.ui-listview>li.ui-last-child>a.ui-btn+a.ui-btn{-webkit-border-bottom-left-radius:0;border-bottom-left-radius:0;-webkit-border-bottom-right-radius:inherit;border-bottom-right-radius:inherit}.ui-listview>li.ui-first-child img:first-child:not(.ui-li-icon){-webkit-border-top-left-radius:inherit;border-top-left-radius:inherit}.ui-listview>li.ui-last-child img:first-child:not(.ui-li-icon){-webkit-border-bottom-left-radius:inherit;border-bottom-left-radius:inherit}.ui-collapsible-content>.ui-listview:not(.ui-listview-inset){-webkit-border-radius:inherit;border-bottom-radius:inherit}.ui-listview .ui-li-static{padding:.7em 1em}.ui-listview .ui-li-divider{padding:.5em 1.143em;font-size:14px;font-weight:700;cursor:default;outline:0}.ui-listview .ui-li-has-count>.ui-btn,.ui-listview .ui-li-static.ui-li-has-count,.ui-listview .ui-li-divider.ui-li-has-count{padding-right:2.8125em}.ui-listview .ui-li-has-count>.ui-btn[class*=ui-icon-]{padding-right:4.6875em}.ui-listview .ui-li-has-thumb>.ui-btn,.ui-listview .ui-li-static.ui-li-has-thumb{min-height:3.625em;padding-left:6.25em}.ui-listview .ui-li-has-icon>.ui-btn,.ui-listview .ui-li-static.ui-li-has-icon{min-height:1.25em;padding-left:2.5em}.ui-li-count{position:absolute;font-size:12px;font-weight:700;text-align:center;border-width:1px;border-style:solid;padding:0 .5em;line-height:1.666em;min-height:1.666em;min-width:.666em;right:.833em;top:50%;margin-top:-.916em}.ui-listview .ui-btn[class*=ui-icon-] .ui-li-count{right:3.636em}.ui-listview .ui-li-has-thumb>img:first-child,.ui-listview .ui-li-has-thumb>.ui-btn>img:first-child{position:absolute;left:0;top:0;max-height:5em;max-width:5em}.ui-listview .ui-li-has-icon>img:first-child,.ui-listview .ui-li-has-icon>.ui-btn>img:first-child{position:absolute;left:.625em;top:.9em;max-height:1em;max-width:1em}.ui-listview>li h1,.ui-listview>li h2,.ui-listview>li h3,.ui-listview>li h4,.ui-listview>li h5,.ui-listview>li h6{font-size:1em;font-weight:700;display:block;margin:.45em 0;text-overflow:ellipsis;overflow:hidden;white-space:nowrap}.ui-listview>li p{font-size:.75em;font-weight:400;display:block;margin:.6em 0;text-overflow:ellipsis;overflow:hidden;white-space:nowrap}.ui-listview .ui-li-aside{position:absolute;top:1em;right:3.333em;margin:0;text-align:right}.ui-listview>li.ui-li-has-alt>.ui-btn{margin-right:2.5em;border-right-width:0}.ui-listview>li.ui-li-has-alt>.ui-btn+.ui-btn{position:absolute;width:2.5em;height:100%;min-height:auto;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;border-left-width:1px;top:0;right:0;margin:0;padding:0;z-index:2}.ui-listview-inset>li.ui-li-has-alt>.ui-btn+.ui-btn{border-right-width:1px}.ui-listview>li.ui-li-has-alt>.ui-btn+.ui-btn:focus{z-index:3}ol.ui-listview,ol.ui-listview .ui-li-divider{counter-reset:listnumbering}ol.ui-listview>li>.ui-btn,ol.ui-listview>li.ui-li-static{vertical-align:middle}ol.ui-listview>li>.ui-btn:before,ol.ui-listview>li.ui-li-static:before,ol.ui-listview>li.ui-field-contain>label:before,ol.ui-listview>li.ui-field-contain>.ui-controlgroup-label:before{display:inline-block;font-size:.9em;font-weight:400;padding-right:.3em;min-width:1.4em;line-height:1.5;vertical-align:middle;counter-increment:listnumbering;content:counter(listnumbering) "."}ol.ui-listview>li.ui-field-contain:before{content:none;display:none}ol.ui-listview>li h1:first-child,ol.ui-listview>li h2:first-child,ol.ui-listview>li h3:first-child,ol.ui-listview>li h4:first-child,ol.ui-listview>li h5:first-child,ol.ui-listview>li h6:first-child,ol.ui-listview>li p:first-child,ol.ui-listview>li img:first-child+*{display:inline-block;vertical-align:middle}ol.ui-listview>li h1:first-child~*,ol.ui-listview>li h2:first-child~*,ol.ui-listview>li h3:first-child~*,ol.ui-listview>li h4:first-child~*,ol.ui-listview>li h5:first-child~*,ol.ui-listview>li h6:first-child~*,ol.ui-listview>li p:first-child~*,ol.ui-listview>li img:first-child+*~*{margin-top:0;text-indent:2.04em}div.ui-slider{height:30px;margin:.5em 0;padding:0;-ms-touch-action:pan-y pinch-zoom double-tap-zoom}div.ui-slider:before,div.ui-slider:after{content:"";display:table}div.ui-slider:after{clear:both}input.ui-slider-input{display:block;float:left;font-size:14px;font-weight:700;margin:0;padding:4px;width:40px;height:20px;line-height:20px;background-image:none;border-width:1px;border-style:solid;outline:0;text-align:center;vertical-align:text-bottom;-webkit-appearance:none;-moz-appearance:none;appearance:none;-webkit-box-sizing:content-box;-moz-box-sizing:content-box;-ms-box-sizing:content-box;box-sizing:content-box}.ui-slider-input::-webkit-outer-spin-button,.ui-slider-input::-webkit-inner-spin-button{-webkit-appearance:none;margin:0}.ui-slider-track{position:relative;overflow:visible;border-width:1px;border-style:solid;height:15px;margin:0 15px 0 68px;top:6px}.ui-slider-track.ui-mini{height:12px;top:8px}.ui-slider-track .ui-slider-bg{height:100%}.ui-slider-track .ui-btn.ui-slider-handle{position:absolute;z-index:1;top:50%;width:28px;height:28px;margin:-15px 0 0 -15px;outline:0;padding:0}.ui-slider-track.ui-mini .ui-slider-handle{height:14px;width:14px;margin:-8px 0 0 -8px}select.ui-slider-switch{position:absolute!important;height:1px;width:1px;overflow:hidden;clip:rect(1px,1px,1px,1px)}div.ui-slider-switch{display:inline-block;height:32px;width:5.8em;top:0}div.ui-slider-switch:before,div.ui-slider-switch:after{display:none;clear:none}div.ui-slider-switch.ui-mini{height:29px;top:0}.ui-slider-inneroffset{margin:0 16px;position:relative;z-index:1}.ui-slider-switch.ui-mini .ui-slider-inneroffset{margin:0 15px 0 14px}.ui-slider-switch .ui-btn.ui-slider-handle{margin:1px 0 0 -15px}.ui-slider-switch.ui-mini .ui-slider-handle{width:25px;height:25px;margin:1px 0 0 -13px;padding:0}.ui-slider-handle-snapping{-webkit-transition:left 70ms linear;-moz-transition:left 70ms linear}.ui-slider-switch .ui-slider-label{position:absolute;text-align:center;width:100%;overflow:hidden;font-size:16px;top:0;line-height:2;min-height:100%;white-space:nowrap;cursor:pointer}.ui-slider-switch.ui-mini .ui-slider-label{font-size:14px}.ui-slider-switch .ui-slider-label-a{z-index:1;left:0;text-indent:-1.5em}.ui-slider-switch .ui-slider-label-b{z-index:0;right:0;text-indent:1.5em}.ui-slider-track .ui-slider-bg,.ui-slider-switch .ui-slider-label,.ui-slider-switch .ui-slider-inneroffset,.ui-slider-handle{-webkit-border-radius:inherit;border-radius:inherit}.ui-field-contain div.ui-slider-switch{margin:0}@media (min-width:28em){.ui-field-contain div.ui-slider-switch,.ui-field-contain.ui-hide-label div.ui-slider-switch{display:inline-block;width:5.8em}}.ui-slider-popup{width:64px;height:64px;font-size:36px;padding-top:14px;opacity:.8}.ui-slider-popup{position:absolute!important;text-align:center;z-index:100}.ui-slider-track .ui-btn.ui-slider-handle{font-size:.9em;line-height:30px}.ui-rangeslider{margin:.5em 0}.ui-rangeslider:before,.ui-rangeslider:after{content:"";display:table}.ui-rangeslider:after{clear:both}.ui-rangeslider .ui-slider-input.ui-rangeslider-last{float:right}.ui-rangeslider .ui-rangeslider-sliders{position:relative;overflow:visible;height:30px;margin:0 68px}.ui-rangeslider .ui-rangeslider-sliders .ui-slider-track{position:absolute;top:6px;right:0;left:0;margin:0}.ui-rangeslider.ui-mini .ui-rangeslider-sliders .ui-slider-track{top:8px}.ui-rangeslider .ui-slider-track:first-child .ui-slider-bg{display:none}.ui-rangeslider .ui-rangeslider-sliders .ui-slider-track:first-child{background-color:transparent;background:0;border-width:0;height:0}html >body .ui-rangeslider .ui-rangeslider-sliders .ui-slider-track:first-child{height:15px;border-width:1px}html >body .ui-rangeslider.ui-mini .ui-rangeslider-sliders .ui-slider-track:first-child{height:12px}div.ui-rangeslider label{position:absolute!important;height:1px;width:1px;overflow:hidden;clip:rect(1px,1px,1px,1px)}.ui-field-contain .ui-rangeslider input.ui-slider-input,.ui-field-contain .ui-rangeslider.ui-mini input.ui-slider-input,.ui-field-contain .ui-rangeslider .ui-rangeslider-sliders,.ui-field-contain .ui-rangeslider.ui-mini .ui-rangeslider-sliders{margin-top:0;margin-bottom:0}.ui-input-text,.ui-input-search{margin:-.5em -.5em 1.5em -.5em;background-image:none;border-width:1px;border-style:solid}.ui-input-inset,textarea.ui-input-text{margin:.5em 0}.ui-input-text input,.ui-input-search input,textarea.ui-input-text{padding:.4em;min-height:2.2em;line-height:1.4em;display:block;width:100%;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;-ms-box-sizing:border-box;box-sizing:border-box;outline:0}.ui-input-text input,.ui-input-search input{margin:0;text-align:left;border:0;background:transparent none;-webkit-appearance:none;-webkit-border-radius:inherit;border-radius:inherit}textarea.ui-input-text{height:3.125em;overflow:auto;resize:vertical}.ui-mini .ui-input-text input,.ui-mini .ui-input-search input,.ui-input-text.ui-mini input,.ui-input-search.ui-mini input,.ui-mini textarea.ui-input-text,textarea.ui-mini{font-size:14px}.ui-mini textarea.ui-input-text,textarea.ui-mini{margin:.446em 0}.ui-input-has-clear,.ui-input-search{position:relative}.ui-input-has-clear{padding-right:2.25em}.ui-input-has-clear input{padding-right:0;-webkit-border-top-right-radius:0;border-top-right-radius:0;-webkit-border-bottom-right-radius:0;border-bottom-right-radius:0}.ui-input-search input{padding-left:1.75em}.ui-input-search:after{position:absolute;left:.3125em;top:50%;margin-top:-7px;content:"";background-position:center center;background-repeat:no-repeat;width:14px;height:14px;filter:Alpha(Opacity=50);opacity:.5}.ui-input-search.ui-input-has-clear .ui-btn.ui-input-clear,.ui-input-text.ui-input-has-clear .ui-btn.ui-input-clear{position:absolute;right:0;top:50%;margin:-15px .3125em 0;border:0;background-color:transparent}.ui-input-search .ui-input-clear-hidden,.ui-input-text .ui-input-clear-hidden{display:none}.ui-input-text input::-moz-placeholder,.ui-input-search input::-moz-placeholder,textarea.ui-input-text::-moz-placeholder{color:#aaa}.ui-input-text input:-ms-input-placeholder,.ui-input-search input:-ms-input-placeholder,textarea.ui-input-text:-ms-input-placeholder{color:#aaa}.ui-input-text input[type=number]::-webkit-outer-spin-button{margin:0}.ui-input-text input::-ms-clear,.ui-input-search input::-ms-clear{display:none}.ui-input-text input:focus,.ui-input-search input:focus{-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none}.ui-flipswitch{display:inline-block;vertical-align:middle;width:5.875em;height:1.875em;border-width:1px;border-style:solid;margin:.5em 0;overflow:hidden;-webkit-transition-property:padding,width,background-color,color,border-color;-moz-transition-property:padding,width,background-color,color,border-color;-o-transition-property:padding,width,background-color,color,border-color;transition-property:padding,width,background-color,color,border-color;-webkit-transition-duration:100ms;-moz-transition-duration:100ms;-o-transition-duration:100ms;transition-duration:100ms;-webkit-touch-callout:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;cursor:pointer}.ui-flipswitch.ui-flipswitch-active{padding-left:4em;width:1.875em}.ui-flipswitch-input{position:absolute;height:1px;width:1px;margin:-1px;overflow:hidden;clip:rect(1px,1px,1px,1px);border:0;outline:0;filter:Alpha(Opacity=0);opacity:0}.ui-flipswitch .ui-btn.ui-flipswitch-on,.ui-flipswitch .ui-flipswitch-off{float:left;height:1.75em;margin:.0625em;line-height:1.65em}.ui-flipswitch .ui-btn.ui-flipswitch-on{width:1.75em;padding:0;text-indent:-2.6em;text-align:left;border-width:1px;border-style:solid;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;-ms-box-sizing:border-box;box-sizing:border-box;border-radius:inherit;overflow:visible;color:inherit;text-shadow:inherit}.ui-flipswitch .ui-flipswitch-off{padding:1px;text-indent:1em}@media (min-width:28em){.ui-field-contain>label+.ui-flipswitch{display:inline-block;width:5.875em;-webkit-box-sizing:content-box;-moz-box-sizing:content-box;-ms-box-sizing:content-box;box-sizing:content-box}.ui-field-contain .ui-flipswitch.ui-flipswitch-active{width:1.875em}}.ui-table{border:0;border-collapse:collapse;padding:0;width:100%}.ui-table th,.ui-table td{line-height:1.5em;text-align:left;padding:.4em .5em;vertical-align:top}.ui-table th .ui-btn,.ui-table td .ui-btn{line-height:normal}.ui-table th{font-weight:700}.ui-table caption{text-align:left;margin-bottom:1.4em;opacity:.5}.table-stroke thead th{border-bottom:1px solid #d6d6d6;border-bottom:1px solid rgba(0,0,0,.1)}.table-stroke tbody th,.table-stroke tbody td{border-bottom:1px solid #e6e6e6;border-bottom:1px solid rgba(0,0,0,.05)}.table-stripe tbody tr:nth-child(odd) td,.table-stripe tbody tr:nth-child(odd) th{background-color:#eee;background-color:rgba(0,0,0,.04)}.table-stripe thead th,.table-stripe tbody tr:last-child{border-bottom:1px solid #d6d6d6;border-bottom:1px solid rgba(0,0,0,.1)}.ui-table-columntoggle-btn{float:right;margin-bottom:.8em}.ui-table-columntoggle-popup fieldset{margin:0}@media only all{th.ui-table-priority-6,td.ui-table-priority-6,th.ui-table-priority-5,td.ui-table-priority-5,th.ui-table-priority-4,td.ui-table-priority-4,th.ui-table-priority-3,td.ui-table-priority-3,th.ui-table-priority-2,td.ui-table-priority-2,th.ui-table-priority-1,td.ui-table-priority-1{display:none}}@media screen and (min-width:20em){.ui-table-columntoggle.ui-responsive th.ui-table-priority-1,.ui-table-columntoggle.ui-responsive td.ui-table-priority-1{display:table-cell}}@media screen and (min-width:30em){.ui-table-columntoggle.ui-responsive th.ui-table-priority-2,.ui-table-columntoggle.ui-responsive td.ui-table-priority-2{display:table-cell}}@media screen and (min-width:40em){.ui-table-columntoggle.ui-responsive th.ui-table-priority-3,.ui-table-columntoggle.ui-responsive td.ui-table-priority-3{display:table-cell}}@media screen and (min-width:50em){.ui-table-columntoggle.ui-responsive th.ui-table-priority-4,.ui-table-columntoggle.ui-responsive td.ui-table-priority-4{display:table-cell}}@media screen and (min-width:60em){.ui-table-columntoggle.ui-responsive th.ui-table-priority-5,.ui-table-columntoggle.ui-responsive td.ui-table-priority-5{display:table-cell}}@media screen and (min-width:70em){.ui-table-columntoggle.ui-responsive th.ui-table-priority-6,.ui-table-columntoggle.ui-responsive td.ui-table-priority-6{display:table-cell}}.ui-table-columntoggle th.ui-table-cell-hidden,.ui-table-columntoggle td.ui-table-cell-hidden,.ui-table-columntoggle.ui-responsive th.ui-table-cell-hidden,.ui-table-columntoggle.ui-responsive td.ui-table-cell-hidden{display:none}.ui-table-columntoggle th.ui-table-cell-visible,.ui-table-columntoggle td.ui-table-cell-visible,.ui-table-columntoggle.ui-responsive th.ui-table-cell-visible,.ui-table-columntoggle.ui-responsive td.ui-table-cell-visible{display:table-cell}.ui-table-reflow td .ui-table-cell-label,.ui-table-reflow th .ui-table-cell-label{display:none}@media only all{.ui-table-reflow thead td,.ui-table-reflow thead th{display:none}.ui-table-reflow td,.ui-table-reflow th{text-align:left;display:block}.ui-table-reflow tbody th{margin-top:3em}.ui-table-reflow td .ui-table-cell-label,.ui-table-reflow th .ui-table-cell-label{padding:.4em;min-width:30%;display:inline-block;margin:-.4em 1em -.4em -.4em}.ui-table-reflow th .ui-table-cell-label-top,.ui-table-reflow td .ui-table-cell-label-top{display:block;padding:.4em 0;margin:.4em 0;text-transform:uppercase;font-size:.9em;font-weight:400}}@media (min-width:35em){.ui-table-reflow.ui-responsive{display:table-row-group}.ui-table-reflow.ui-responsive td,.ui-table-reflow.ui-responsive th,.ui-table-reflow.ui-responsive tbody th,.ui-table-reflow.ui-responsive tbody td,.ui-table-reflow.ui-responsive thead td,.ui-table-reflow.ui-responsive thead th{display:table-cell;margin:0}.ui-table-reflow.ui-responsive td .ui-table-cell-label,.ui-table-reflow.ui-responsive th .ui-table-cell-label{display:none}}@media (max-width:35em){.ui-table-reflow.ui-responsive td,.ui-table-reflow.ui-responsive th{width:100%;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;float:left;clear:left}}.ui-panel{width:17em;min-height:100%;max-height:none;border-width:0;position:absolute;top:0;display:block}.ui-panel-closed{width:0;max-height:100%;overflow:hidden;visibility:hidden}.ui-panel-fixed{position:fixed;bottom:-1px;padding-bottom:1px}.ui-panel-display-reveal{z-index:0}.ui-panel-display-push{z-index:999}.ui-panel-display-overlay{z-index:1001}.ui-panel-inner{padding:1em}.ui-panel-page-container{-webkit-transform:translate3d(0,0,0)}.ui-panel-page-container .ui-page-active{background:0}.ui-panel-wrapper{position:relative;min-height:inherit;border:0;overflow-x:hidden;z-index:999}.ui-panel-fixed-toolbar{overflow-x:hidden}.ui-panel-dismiss{position:absolute;top:0;left:0;height:100%;width:100%;z-index:1002;display:none}.ui-panel-dismiss-open{display:block}.ui-panel-animate{-webkit-transition:-webkit-transform 300ms ease;-moz-transition:-moz-transform 300ms ease;transition:transform 300ms ease}.ui-panel-animate.ui-panel:not(.ui-panel-display-reveal){-webkit-backface-visibility:hidden;-webkit-transform:translate3d(0,0,0)}.ui-panel-position-left{left:-17em}.ui-panel-animate.ui-panel-position-left.ui-panel-display-overlay,.ui-panel-animate.ui-panel-position-left.ui-panel-display-push{left:0;-webkit-transform:translate3d(-17em,0,0);-moz-transform:translate3d(-17em,0,0);transform:translate3d(-17em,0,0)}.ui-panel-position-left.ui-panel-display-reveal,.ui-panel-position-left.ui-panel-open{left:0}.ui-panel-animate.ui-panel-position-left.ui-panel-open.ui-panel-display-overlay,.ui-panel-animate.ui-panel-position-left.ui-panel-open.ui-panel-display-push{-webkit-transform:translate3d(0,0,0);transform:translate3d(0,0,0);-moz-transform:none}.ui-panel-position-right{right:-17em}.ui-panel-animate.ui-panel-position-right.ui-panel-display-overlay,.ui-panel-animate.ui-panel-position-right.ui-panel-display-push{right:0;-webkit-transform:translate3d(17em,0,0);-moz-transform:translate3d(17em,0,0);transform:translate3d(17em,0,0)}.ui-panel-position-right.ui-panel-display-reveal,.ui-panel-position-right.ui-panel-open{right:0}.ui-panel-animate.ui-panel-position-right.ui-panel-open.ui-panel-display-overlay,.ui-panel-animate.ui-panel-position-right.ui-panel-open.ui-panel-display-push{-webkit-transform:translate3d(0,0,0);transform:translate3d(0,0,0);-moz-transform:none}.ui-panel-page-content-position-left.ui-panel-page-content-open,.ui-panel-dismiss-position-left.ui-panel-dismiss-open{left:17em;right:-17em}.ui-panel-animate.ui-panel-page-content-position-left.ui-panel-page-content-open.ui-panel-page-content-display-reveal,.ui-panel-animate.ui-panel-page-content-position-left.ui-panel-page-content-open.ui-panel-page-content-display-push{left:0;right:0;-webkit-transform:translate3d(17em,0,0);-moz-transform:translate3d(17em,0,0);transform:translate3d(17em,0,0)}.ui-panel-page-content-position-right.ui-panel-page-content-open,.ui-panel-dismiss-position-right.ui-panel-dismiss-open{left:-17em;right:17em}.ui-panel-animate.ui-panel-page-content-position-right.ui-panel-page-content-open.ui-panel-page-content-display-reveal,.ui-panel-animate.ui-panel-page-content-position-right.ui-panel-page-content-open.ui-panel-page-content-display-push{left:0;right:0;-webkit-transform:translate3d(-17em,0,0);-moz-transform:translate3d(-17em,0,0);transform:translate3d(-17em,0,0)}.ui-panel-page-content-open.ui-panel-page-content-display-overlay{left:0}.ui-panel-display-reveal{-webkit-box-shadow:inset -5px 0 5px rgba(0,0,0,.15);-moz-box-shadow:inset -5px 0 5px rgba(0,0,0,.15);box-shadow:inset -5px 0 5px rgba(0,0,0,.15)}.ui-panel-position-right.ui-panel-display-reveal{-webkit-box-shadow:inset 5px 0 5px rgba(0,0,0,.15);-moz-box-shadow:inset 5px 0 5px rgba(0,0,0,.15);box-shadow:inset 5px 0 5px rgba(0,0,0,.15)}.ui-panel-display-overlay{-webkit-box-shadow:5px 0 5px rgba(0,0,0,.15);-moz-box-shadow:5px 0 5px rgba(0,0,0,.15);box-shadow:5px 0 5px rgba(0,0,0,.15)}.ui-panel-position-right.ui-panel-display-overlay{-webkit-box-shadow:-5px 0 5px rgba(0,0,0,.15);-moz-box-shadow:-5px 0 5px rgba(0,0,0,.15);box-shadow:-5px 0 5px rgba(0,0,0,.15)}.ui-panel-display-push.ui-panel-open.ui-panel-position-left{border-right-width:1px;margin-right:-1px}.ui-panel-page-content-open.ui-panel-page-content-position-left.ui-panel-page-content-display-push{margin-left:1px;width:auto}.ui-panel-display-push.ui-panel-open.ui-panel-position-right{border-left-width:1px;margin-left:-1px}.ui-panel-page-content-open.ui-panel-page-content-position-right.ui-panel-page-content-display-push{margin-right:1px;width:auto}@media (min-width:55em){.ui-responsive-panel .ui-panel-page-content-open.ui-panel-page-content-position-left.ui-panel-page-content-display-push,.ui-responsive-panel .ui-panel-page-content-open.ui-panel-page-content-position-left.ui-panel-page-content-display-reveal,.ui-responsive-panel.ui-panel-fixed-toolbar.ui-panel-page-content-open.ui-panel-page-content-position-left.ui-panel-page-content-display-push,.ui-responsive-panel.ui-panel-fixed-toolbar.ui-panel-page-content-open.ui-panel-page-content-position-left.ui-panel-page-content-display-reveal{margin-right:17em}.ui-responsive-panel .ui-panel-page-content-open.ui-panel-page-content-position-right.ui-panel-page-content-display-push,.ui-responsive-panel .ui-panel-page-content-open.ui-panel-page-content-position-right.ui-panel-page-content-display-reveal,.ui-responsive-panel.ui-panel-fixed-toolbar.ui-panel-page-content-open.ui-panel-page-content-position-right.ui-panel-page-content-display-push,.ui-responsive-panel.ui-panel-fixed-toolbar.ui-panel-page-content-open.ui-panel-page-content-position-right.ui-panel-page-content-display-reveal{margin-left:17em}.ui-responsive-panel .ui-panel-page-content-open.ui-panel-page-content-display-push,.ui-responsive-panel .ui-panel-page-content-open.ui-panel-page-content-display-reveal{width:auto}.ui-responsive-panel .ui-panel-dismiss-display-push{display:none}}@import url(../../structure/jquery.mobile.filterable.css); \ No newline at end of file diff --git a/www/jquery.mobile-1.4.0-alpha.1/jquery.mobile-1.4.0-alpha.1.min.js b/www/jquery.mobile-1.4.0-alpha.1/jquery.mobile-1.4.0-alpha.1.min.js deleted file mode 100755 index eae0f3d..0000000 --- a/www/jquery.mobile-1.4.0-alpha.1/jquery.mobile-1.4.0-alpha.1.min.js +++ /dev/null @@ -1,10 +0,0 @@ -/*! jQuery Mobile 1.4.0-alpha.1 | Git HEAD hash: d17d2ba <> 2013-07-25T22:32:20Z | (c) 2010, 2013 jQuery Foundation, Inc. | jquery.org/license */ -!function(a,b,c){"function"==typeof define&&define.amd?define(["jquery"],function(d){return c(d,a,b),d.mobile}):c(a.jQuery,a,b)}(this,document,function(a,b,c,d){!function(a){a.mobile={}}(a),function(a){a.extend(a.mobile,{version:"1.4.0-alpha.1",subPageUrlKey:"ui-page",hideUrlBar:!0,activePageClass:"ui-page-active",activeBtnClass:"ui-btn-active",focusClass:"ui-focus",ajaxEnabled:!0,hashListeningEnabled:!0,linkBindingEnabled:!0,defaultPageTransition:"fade",maxTransitionWidth:!1,minScrollBack:250,touchOverflowEnabled:!1,defaultDialogTransition:"pop",pageLoadErrorMessage:"Error Loading Page",pageLoadErrorMessageTheme:"e",phonegapNavigationEnabled:!1,autoInitializePage:!0,pushStateEnabled:!0,ignoreContentEnabled:!1,buttonMarkup:{hoverDelay:200},dynamicBaseEnabled:!0,pageContainer:a()})}(a,this),function(a,b,c){var d={},e=a.find,f=/(?:\{[\s\S]*\}|\[[\s\S]*\])$/,g=/:jqmData\(([^)]*)\)/g;a.extend(a.mobile,{ns:"",getAttribute:function(b,c,d){var e;d&&(c="data-"+a.mobile.ns+c),e=b.getAttribute(c);try{e="true"===e?!0:"false"===e?!1:"null"===e?null:+e+""===e?+e:f.test(e)?JSON.parse(e):e}catch(g){}return e},nsNormalizeDict:d,nsNormalize:function(b){return d[b]||(d[b]=a.camelCase(a.mobile.ns+b))},closestPageData:function(a){return a.closest(":jqmData(role='page'), :jqmData(role='dialog')").data("mobile-page")}}),a.fn.jqmData=function(b,d){var e;return"undefined"!=typeof b&&(b&&(b=a.mobile.nsNormalize(b)),e=arguments.length<2||d===c?this.data(b):this.data(b,d)),e},a.jqmData=function(b,c,d){var e;return"undefined"!=typeof c&&(e=a.data(b,c?a.mobile.nsNormalize(c):c,d)),e},a.fn.jqmRemoveData=function(b){return this.removeData(a.mobile.nsNormalize(b))},a.jqmRemoveData=function(b,c){return a.removeData(b,a.mobile.nsNormalize(c))},a.find=function(b,c,d,f){return b=b.replace(g,"[data-"+(a.mobile.ns||"")+"$1]"),e.call(this,b,c,d,f)},a.extend(a.find,e)}(a,this),function(a,b){function d(b,c){var d,f,g,h=b.nodeName.toLowerCase();return"area"===h?(d=b.parentNode,f=d.name,b.href&&f&&"map"===d.nodeName.toLowerCase()?(g=a("img[usemap=#"+f+"]")[0],!!g&&e(g)):!1):(/input|select|textarea|button|object/.test(h)?!b.disabled:"a"===h?b.href||c:c)&&e(b)}function e(b){return a.expr.filters.visible(b)&&!a(b).parents().addBack().filter(function(){return"hidden"===a.css(this,"visibility")}).length}var f=0,g=/^ui-id-\d+$/;a.ui=a.ui||{},a.extend(a.ui,{version:"@VERSION",keyCode:{BACKSPACE:8,COMMA:188,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,LEFT:37,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SPACE:32,TAB:9,UP:38}}),a.fn.extend({focus:function(b){return function(c,d){return"number"==typeof c?this.each(function(){var b=this;setTimeout(function(){a(b).focus(),d&&d.call(b)},c)}):b.apply(this,arguments)}}(a.fn.focus),scrollParent:function(){var b;return b=a.ui.ie&&/(static|relative)/.test(this.css("position"))||/absolute/.test(this.css("position"))?this.parents().filter(function(){return/(relative|absolute|fixed)/.test(a.css(this,"position"))&&/(auto|scroll)/.test(a.css(this,"overflow")+a.css(this,"overflow-y")+a.css(this,"overflow-x"))}).eq(0):this.parents().filter(function(){return/(auto|scroll)/.test(a.css(this,"overflow")+a.css(this,"overflow-y")+a.css(this,"overflow-x"))}).eq(0),/fixed/.test(this.css("position"))||!b.length?a(this[0].ownerDocument||c):b},uniqueId:function(){return this.each(function(){this.id||(this.id="ui-id-"+ ++f)})},removeUniqueId:function(){return this.each(function(){g.test(this.id)&&a(this).removeAttr("id")})}}),a.extend(a.expr[":"],{data:a.expr.createPseudo?a.expr.createPseudo(function(b){return function(c){return!!a.data(c,b)}}):function(b,c,d){return!!a.data(b,d[3])},focusable:function(b){return d(b,!isNaN(a.attr(b,"tabindex")))},tabbable:function(b){var c=a.attr(b,"tabindex"),e=isNaN(c);return(e||c>=0)&&d(b,!e)}}),a("").outerWidth(1).jquery||a.each(["Width","Height"],function(c,d){function e(b,c,d,e){return a.each(f,function(){c-=parseFloat(a.css(b,"padding"+this))||0,d&&(c-=parseFloat(a.css(b,"border"+this+"Width"))||0),e&&(c-=parseFloat(a.css(b,"margin"+this))||0)}),c}var f="Width"===d?["Left","Right"]:["Top","Bottom"],g=d.toLowerCase(),h={innerWidth:a.fn.innerWidth,innerHeight:a.fn.innerHeight,outerWidth:a.fn.outerWidth,outerHeight:a.fn.outerHeight};a.fn["inner"+d]=function(c){return c===b?h["inner"+d].call(this):this.each(function(){a(this).css(g,e(this,c)+"px")})},a.fn["outer"+d]=function(b,c){return"number"!=typeof b?h["outer"+d].call(this,b):this.each(function(){a(this).css(g,e(this,b,!0,c)+"px")})}}),a.fn.addBack||(a.fn.addBack=function(a){return this.add(null==a?this.prevObject:this.prevObject.filter(a))}),a("").data("a-b","a").removeData("a-b").data("a-b")&&(a.fn.removeData=function(b){return function(c){return arguments.length?b.call(this,a.camelCase(c)):b.call(this)}}(a.fn.removeData)),a.ui.ie=!!/msie [\w.]+/.exec(navigator.userAgent.toLowerCase()),a.support.selectstart="onselectstart"in c.createElement("div"),a.fn.extend({disableSelection:function(){return this.bind((a.support.selectstart?"selectstart":"mousedown")+".ui-disableSelection",function(a){a.preventDefault()})},enableSelection:function(){return this.unbind(".ui-disableSelection")},zIndex:function(d){if(d!==b)return this.css("zIndex",d);if(this.length)for(var e,f,g=a(this[0]);g.length&&g[0]!==c;){if(e=g.css("position"),("absolute"===e||"relative"===e||"fixed"===e)&&(f=parseInt(g.css("zIndex"),10),!isNaN(f)&&0!==f))return f;g=g.parent()}return 0}}),a.ui.plugin={add:function(b,c,d){var e,f=a.ui[b].prototype;for(e in d)f.plugins[e]=f.plugins[e]||[],f.plugins[e].push([c,d[e]])},call:function(a,b,c,d){var e,f=a.plugins[b];if(f&&(d||a.element[0].parentNode&&11!==a.element[0].parentNode.nodeType))for(e=0;eg;g++){for(e=b.eq(g),f=!1,d=b[g];d;){if(h=d.getAttribute?d.getAttribute("data-"+a.mobile.ns+c):"","false"===h){f=!0;break}d=d.parentNode}f||(j=j.add(e))}return j},getScreenHeight:function(){return b.innerHeight||a.mobile.window.height()},resetActivePageHeight:function(b){var c=a("."+a.mobile.activePageClass),d=c.height(),e=c.outerHeight(!0);b="number"==typeof b?b:a.mobile.getScreenHeight(),c.css("min-height",b-(e-d))}}),a.fn.removeWithDependents=function(){a.removeWithDependents(this)},a.removeWithDependents=function(b){var c=a(b);(c.jqmData("dependents")||a()).remove(),c.remove()},a.fn.addDependents=function(b){a.addDependents(this,b)},a.addDependents=function(b,c){var d=a(b),e=d.jqmData("dependents")||a();d.jqmData("dependents",a(e).add(c))},a.fn.getEncodedText=function(){return a("").text(a(this).text()).html()},a.fn.jqmEnhanceable=function(){return a.mobile.enhanceable(this)},a.fn.jqmHijackable=function(){return a.mobile.hijackable(this)},a.find.matches=function(b,c){return a.find(b,null,null,c)},a.find.matchesSelector=function(b,c){return a.find(c,null,null,[b]).length>0}}(a,this),function(a,b){var c=0,d=Array.prototype.slice,e=a.cleanData;a.cleanData=function(b){for(var c,d=0;null!=(c=b[d]);d++)try{a(c).triggerHandler("remove")}catch(f){}e(b)},a.widget=function(b,c,d){var e,f,g,h,i={},j=b.split(".")[0];b=b.split(".")[1],e=j+"-"+b,d||(d=c,c=a.Widget),a.expr[":"][e.toLowerCase()]=function(b){return!!a.data(b,e)},a[j]=a[j]||{},f=a[j][b],g=a[j][b]=function(a,b){return this._createWidget?(arguments.length&&this._createWidget(a,b),void 0):new g(a,b)},a.extend(g,f,{version:d.version,_proto:a.extend({},d),_childConstructors:[]}),h=new c,h.options=a.widget.extend({},h.options),a.each(d,function(b,d){return a.isFunction(d)?(i[b]=function(){var a=function(){return c.prototype[b].apply(this,arguments)},e=function(a){return c.prototype[b].apply(this,a)};return function(){var b,c=this._super,f=this._superApply;return this._super=a,this._superApply=e,b=d.apply(this,arguments),this._super=c,this._superApply=f,b}}(),void 0):(i[b]=d,void 0)}),g.prototype=a.widget.extend(h,{widgetEventPrefix:f?h.widgetEventPrefix:b},i,{constructor:g,namespace:j,widgetName:b,widgetFullName:e}),f?(a.each(f._childConstructors,function(b,c){var d=c.prototype;a.widget(d.namespace+"."+d.widgetName,g,c._proto)}),delete f._childConstructors):c._childConstructors.push(g),a.widget.bridge(b,g)},a.widget.extend=function(c){for(var e,f,g=d.call(arguments,1),h=0,i=g.length;i>h;h++)for(e in g[h])f=g[h][e],g[h].hasOwnProperty(e)&&f!==b&&(c[e]=a.isPlainObject(f)?a.isPlainObject(c[e])?a.widget.extend({},c[e],f):a.widget.extend({},f):f);return c},a.widget.bridge=function(c,e){var f=e.prototype.widgetFullName||c;a.fn[c]=function(g){var h="string"==typeof g,i=d.call(arguments,1),j=this;return g=!h&&i.length?a.widget.extend.apply(null,[g].concat(i)):g,h?this.each(function(){var d,e=a.data(this,f);return e?a.isFunction(e[g])&&"_"!==g.charAt(0)?(d=e[g].apply(e,i),d!==e&&d!==b?(j=d&&d.jquery?j.pushStack(d.get()):d,!1):void 0):a.error("no such method '"+g+"' for "+c+" widget instance"):a.error("cannot call methods on "+c+" prior to initialization; "+"attempted to call method '"+g+"'")}):this.each(function(){var b=a.data(this,f);b?b.option(g||{})._init():a.data(this,f,new e(g,this))}),j}},a.Widget=function(){},a.Widget._childConstructors=[],a.Widget.prototype={widgetName:"widget",widgetEventPrefix:"",defaultElement:"
",options:{disabled:!1,create:null},_createWidget:function(b,d){d=a(d||this.defaultElement||this)[0],this.element=a(d),this.uuid=c++,this.eventNamespace="."+this.widgetName+this.uuid,this.options=a.widget.extend({},this.options,this._getCreateOptions(),b),this.bindings=a(),this.hoverable=a(),this.focusable=a(),d!==this&&(a.data(d,this.widgetFullName,this),this._on(!0,this.element,{remove:function(a){a.target===d&&this.destroy()}}),this.document=a(d.style?d.ownerDocument:d.document||d),this.window=a(this.document[0].defaultView||this.document[0].parentWindow)),this._create(),this._trigger("create",null,this._getCreateEventData()),this._init()},_getCreateOptions:a.noop,_getCreateEventData:a.noop,_create:a.noop,_init:a.noop,destroy:function(){this._destroy(),this.element.unbind(this.eventNamespace).removeData(this.widgetName).removeData(this.widgetFullName).removeData(a.camelCase(this.widgetFullName)),this.widget().unbind(this.eventNamespace).removeAttr("aria-disabled").removeClass(this.widgetFullName+"-disabled "+"ui-state-disabled"),this.bindings.unbind(this.eventNamespace),this.hoverable.removeClass("ui-state-hover"),this.focusable.removeClass("ui-state-focus")},_destroy:a.noop,widget:function(){return this.element},option:function(c,d){var e,f,g,h=c;if(0===arguments.length)return a.widget.extend({},this.options);if("string"==typeof c)if(h={},e=c.split("."),c=e.shift(),e.length){for(f=h[c]=a.widget.extend({},this.options[c]),g=0;g"+""+"

"+"
",fakeFixLoader:function(){var b=a("."+a.mobile.activeBtnClass).first();this.element.css({top:a.support.scrollTop&&e.scrollTop()+e.height()/2||b.length&&b.offset().top||100})},checkLoaderPosition:function(){var b=this.element.offset(),c=e.scrollTop(),d=a.mobile.getScreenHeight();(b.topd)&&(this.element.addClass("ui-loader-fakefix"),this.fakeFixLoader(),e.unbind("scroll",this.checkLoaderPosition).bind("scroll",a.proxy(this.fakeFixLoader,this)))},resetHtml:function(){this.element.html(a(this.defaultHtml).html())},show:function(f,g,h){var i,j,k;this.resetHtml(),"object"===a.type(f)?(k=a.extend({},this.options,f),f=k.theme||a.mobile.loadingMessageTheme):(k=this.options,f=f||a.mobile.loadingMessageTheme||k.theme),j=g||a.mobile.loadingMessage||k.text,c.addClass("ui-loading"),(a.mobile.loadingMessage!==!1||k.html)&&(i=a.mobile.loadingMessageTextVisible!==d?a.mobile.loadingMessageTextVisible:k.textVisible,this.element.attr("class",b+" ui-corner-all ui-body-"+f+" ui-loader-"+(i||g||f.text?"verbose":"default")+(k.textonly||h?" ui-loader-textonly":"")),k.html?this.element.html(k.html):this.element.find("h1").text(j),this.element.appendTo(a.mobile.pageContainer),this.checkLoaderPosition(),e.bind("scroll",a.proxy(this.checkLoaderPosition,this)))},hide:function(){c.removeClass("ui-loading"),a.mobile.loadingMessage&&this.element.removeClass("ui-loader-fakefix"),a.mobile.window.unbind("scroll",this.fakeFixLoader),a.mobile.window.unbind("scroll",this.checkLoaderPosition)}}),e.bind("pagecontainercreate",function(){a.mobile.loaderWidget=a.mobile.loaderWidget||a(a.mobile.loader.prototype.defaultHtml).loader()})}(a,this),function(a,b,d){function e(a){return a=a||location.href,"#"+a.replace(/^[^#]*#?(.*)$/,"$1")}var f,g="hashchange",h=c,i=a.event.special,j=h.documentMode,k="on"+g in b&&(j===d||j>7);a.fn[g]=function(a){return a?this.bind(g,a):this.trigger(g)},a.fn[g].delay=50,i[g]=a.extend(i[g],{setup:function(){return k?!1:(a(f.start),void 0)},teardown:function(){return k?!1:(a(f.stop),void 0)}}),f=function(){function c(){var d=e(),h=n(j);d!==j?(m(j=d,h),a(b).trigger(g)):h!==j&&(location.href=location.href.replace(/#.*/,"")+h),f=setTimeout(c,a.fn[g].delay)}var f,i={},j=e(),l=function(a){return a},m=l,n=l;return i.start=function(){f||c()},i.stop=function(){f&&clearTimeout(f),f=d},b.attachEvent&&!b.addEventListener&&!k&&function(){var b,d;i.start=function(){b||(d=a.fn[g].src,d=d&&d+e(),b=a('