Fixed directory structure
Project: http://git-wip-us.apache.org/repos/asf/cordova-browser/repo Commit: http://git-wip-us.apache.org/repos/asf/cordova-browser/commit/6effec38 Tree: http://git-wip-us.apache.org/repos/asf/cordova-browser/tree/6effec38 Diff: http://git-wip-us.apache.org/repos/asf/cordova-browser/diff/6effec38 Branch: refs/heads/master Commit: 6effec38067ab7c4b185062185ebcd99e1ec9555 Parents: 0324e88 Author: Suraj Pindoria <suraj.pindo...@yahoo.com> Authored: Fri Sep 5 10:42:09 2014 -0700 Committer: Suraj Pindoria <suraj.pindo...@yahoo.com> Committed: Fri Sep 5 10:42:09 2014 -0700 ---------------------------------------------------------------------- .gitignore | 2 +- VERSION | 1 + bin/create | 35 + bin/lib/check_reqs.js | 26 + bin/lib/create.js | 82 + bin/templates/project/cordova/build | 33 + bin/templates/project/cordova/build.bat | 26 + bin/templates/project/cordova/clean | 37 + bin/templates/project/cordova/defaults.xml | 22 + bin/templates/project/cordova/lib/build.js | 63 + bin/templates/project/cordova/lib/clean.js | 48 + bin/templates/project/cordova/run | 27 + bin/templates/project/cordova/version | 25 + bin/templates/project/cordova/version.bat | 26 + bin/templates/project/foo | 1 + bin/templates/project/www/css/index.css | 115 + bin/templates/project/www/img/logo.png | Bin 0 -> 21814 bytes bin/templates/project/www/index.html | 43 + bin/templates/project/www/js/index.js | 49 + bin/templates/project/www/manifest.webapp | 10 + .../www/res/icon/android/icon-36-ldpi.png | Bin 0 -> 3096 bytes .../www/res/icon/android/icon-48-mdpi.png | Bin 0 -> 4090 bytes .../www/res/icon/android/icon-72-hdpi.png | Bin 0 -> 6080 bytes .../www/res/icon/android/icon-96-xhdpi.png | Bin 0 -> 7685 bytes .../www/res/icon/bada-wac/icon-48-type5.png | Bin 0 -> 4111 bytes .../www/res/icon/bada-wac/icon-50-type3.png | Bin 0 -> 5758 bytes .../www/res/icon/bada-wac/icon-80-type4.png | Bin 0 -> 7287 bytes .../project/www/res/icon/bada/icon-128.png | Bin 0 -> 11401 bytes .../project/www/res/icon/blackberry/icon-80.png | Bin 0 -> 7287 bytes .../www/res/icon/blackberry10/icon-80.png | Bin 0 -> 7287 bytes .../project/www/res/icon/ios/icon-57-2x.png | Bin 0 -> 7869 bytes .../project/www/res/icon/ios/icon-57.png | Bin 0 -> 3908 bytes .../project/www/res/icon/ios/icon-72-2x.png | Bin 0 -> 11706 bytes .../project/www/res/icon/ios/icon-72.png | Bin 0 -> 4944 bytes .../project/www/res/icon/tizen/icon-128.png | Bin 0 -> 11401 bytes .../project/www/res/icon/webos/icon-64.png | Bin 0 -> 5463 bytes .../res/icon/windows-phone/icon-173-tile.png | Bin 0 -> 22878 bytes .../www/res/icon/windows-phone/icon-48.png | Bin 0 -> 4111 bytes .../www/res/icon/windows-phone/icon-62-tile.png | Bin 0 -> 7324 bytes .../screen/android/screen-hdpi-landscape.png | Bin 0 -> 218302 bytes .../res/screen/android/screen-hdpi-portrait.png | Bin 0 -> 222148 bytes .../screen/android/screen-ldpi-landscape.png | Bin 0 -> 42616 bytes .../res/screen/android/screen-ldpi-portrait.png | Bin 0 -> 42034 bytes .../screen/android/screen-mdpi-landscape.png | Bin 0 -> 92347 bytes .../res/screen/android/screen-mdpi-portrait.png | Bin 0 -> 90555 bytes .../screen/android/screen-xhdpi-landscape.png | Bin 0 -> 489604 bytes .../screen/android/screen-xhdpi-portrait.png | Bin 0 -> 504508 bytes .../www/res/screen/bada-wac/screen-type3.png | Bin 0 -> 90555 bytes .../www/res/screen/bada-wac/screen-type4.png | Bin 0 -> 222148 bytes .../www/res/screen/bada-wac/screen-type5.png | Bin 0 -> 107580 bytes .../www/res/screen/bada/screen-portrait.png | Bin 0 -> 222148 bytes .../www/res/screen/blackberry/screen-225.png | Bin 0 -> 16776 bytes .../res/screen/blackberry10/splash-1280x768.png | Bin 0 -> 60771 bytes .../res/screen/blackberry10/splash-720x720.png | Bin 0 -> 50431 bytes .../res/screen/blackberry10/splash-768x1280.png | Bin 0 -> 57145 bytes .../res/screen/ios/screen-ipad-landscape-2x.png | Bin 0 -> 1534088 bytes .../res/screen/ios/screen-ipad-landscape.png | Bin 0 -> 407370 bytes .../res/screen/ios/screen-ipad-portrait-2x.png | Bin 0 -> 1610434 bytes .../www/res/screen/ios/screen-ipad-portrait.png | Bin 0 -> 422441 bytes .../screen/ios/screen-iphone-landscape-2x.png | Bin 0 -> 339639 bytes .../res/screen/ios/screen-iphone-landscape.png | Bin 0 -> 92301 bytes .../screen/ios/screen-iphone-portrait-2x.png | Bin 0 -> 350593 bytes .../ios/screen-iphone-portrait-568h-2x.png | Bin 0 -> 34225 bytes .../res/screen/ios/screen-iphone-portrait.png | Bin 0 -> 93897 bytes .../project/www/res/screen/tizen/README.md | 3 + .../project/www/res/screen/webos/screen-64.png | Bin 0 -> 5463 bytes .../screen/windows-phone/screen-portrait.jpg | Bin 0 -> 22066 bytes bin/templates/project/www/spec.html | 68 + bin/templates/project/www/spec/helper.js | 33 + bin/templates/project/www/spec/index.js | 67 + .../www/spec/lib/jasmine-1.2.0/MIT.LICENSE | 20 + .../www/spec/lib/jasmine-1.2.0/jasmine-html.js | 616 +++++ .../www/spec/lib/jasmine-1.2.0/jasmine.css | 81 + .../www/spec/lib/jasmine-1.2.0/jasmine.js | 2529 ++++++++++++++++++ cordova-lib/cordova.js | 1525 +++++++++++ cordova/master/CONTRIBUTING.md | 37 - cordova/master/README.md | 24 - cordova/master/VERSION | 1 - cordova/master/bin/create | 35 - cordova/master/bin/lib/check_reqs.js | 26 - cordova/master/bin/lib/create.js | 82 - .../master/bin/templates/project/cordova/build | 33 - .../bin/templates/project/cordova/build.bat | 26 - .../master/bin/templates/project/cordova/clean | 37 - .../bin/templates/project/cordova/defaults.xml | 22 - .../bin/templates/project/cordova/lib/build.js | 63 - .../bin/templates/project/cordova/lib/clean.js | 48 - .../master/bin/templates/project/cordova/run | 27 - .../bin/templates/project/cordova/version | 25 - .../bin/templates/project/cordova/version.bat | 26 - cordova/master/bin/templates/project/foo | 1 - .../bin/templates/project/www/css/index.css | 115 - .../bin/templates/project/www/img/logo.png | Bin 21814 -> 0 bytes .../master/bin/templates/project/www/index.html | 43 - .../bin/templates/project/www/js/index.js | 49 - .../bin/templates/project/www/manifest.webapp | 10 - .../www/res/icon/android/icon-36-ldpi.png | Bin 3096 -> 0 bytes .../www/res/icon/android/icon-48-mdpi.png | Bin 4090 -> 0 bytes .../www/res/icon/android/icon-72-hdpi.png | Bin 6080 -> 0 bytes .../www/res/icon/android/icon-96-xhdpi.png | Bin 7685 -> 0 bytes .../www/res/icon/bada-wac/icon-48-type5.png | Bin 4111 -> 0 bytes .../www/res/icon/bada-wac/icon-50-type3.png | Bin 5758 -> 0 bytes .../www/res/icon/bada-wac/icon-80-type4.png | Bin 7287 -> 0 bytes .../project/www/res/icon/bada/icon-128.png | Bin 11401 -> 0 bytes .../project/www/res/icon/blackberry/icon-80.png | Bin 7287 -> 0 bytes .../www/res/icon/blackberry10/icon-80.png | Bin 7287 -> 0 bytes .../project/www/res/icon/ios/icon-57-2x.png | Bin 7869 -> 0 bytes .../project/www/res/icon/ios/icon-57.png | Bin 3908 -> 0 bytes .../project/www/res/icon/ios/icon-72-2x.png | Bin 11706 -> 0 bytes .../project/www/res/icon/ios/icon-72.png | Bin 4944 -> 0 bytes .../project/www/res/icon/tizen/icon-128.png | Bin 11401 -> 0 bytes .../project/www/res/icon/webos/icon-64.png | Bin 5463 -> 0 bytes .../res/icon/windows-phone/icon-173-tile.png | Bin 22878 -> 0 bytes .../www/res/icon/windows-phone/icon-48.png | Bin 4111 -> 0 bytes .../www/res/icon/windows-phone/icon-62-tile.png | Bin 7324 -> 0 bytes .../screen/android/screen-hdpi-landscape.png | Bin 218302 -> 0 bytes .../res/screen/android/screen-hdpi-portrait.png | Bin 222148 -> 0 bytes .../screen/android/screen-ldpi-landscape.png | Bin 42616 -> 0 bytes .../res/screen/android/screen-ldpi-portrait.png | Bin 42034 -> 0 bytes .../screen/android/screen-mdpi-landscape.png | Bin 92347 -> 0 bytes .../res/screen/android/screen-mdpi-portrait.png | Bin 90555 -> 0 bytes .../screen/android/screen-xhdpi-landscape.png | Bin 489604 -> 0 bytes .../screen/android/screen-xhdpi-portrait.png | Bin 504508 -> 0 bytes .../www/res/screen/bada-wac/screen-type3.png | Bin 90555 -> 0 bytes .../www/res/screen/bada-wac/screen-type4.png | Bin 222148 -> 0 bytes .../www/res/screen/bada-wac/screen-type5.png | Bin 107580 -> 0 bytes .../www/res/screen/bada/screen-portrait.png | Bin 222148 -> 0 bytes .../www/res/screen/blackberry/screen-225.png | Bin 16776 -> 0 bytes .../res/screen/blackberry10/splash-1280x768.png | Bin 60771 -> 0 bytes .../res/screen/blackberry10/splash-720x720.png | Bin 50431 -> 0 bytes .../res/screen/blackberry10/splash-768x1280.png | Bin 57145 -> 0 bytes .../res/screen/ios/screen-ipad-landscape-2x.png | Bin 1534088 -> 0 bytes .../res/screen/ios/screen-ipad-landscape.png | Bin 407370 -> 0 bytes .../res/screen/ios/screen-ipad-portrait-2x.png | Bin 1610434 -> 0 bytes .../www/res/screen/ios/screen-ipad-portrait.png | Bin 422441 -> 0 bytes .../screen/ios/screen-iphone-landscape-2x.png | Bin 339639 -> 0 bytes .../res/screen/ios/screen-iphone-landscape.png | Bin 92301 -> 0 bytes .../screen/ios/screen-iphone-portrait-2x.png | Bin 350593 -> 0 bytes .../ios/screen-iphone-portrait-568h-2x.png | Bin 34225 -> 0 bytes .../res/screen/ios/screen-iphone-portrait.png | Bin 93897 -> 0 bytes .../project/www/res/screen/tizen/README.md | 3 - .../project/www/res/screen/webos/screen-64.png | Bin 5463 -> 0 bytes .../screen/windows-phone/screen-portrait.jpg | Bin 22066 -> 0 bytes .../master/bin/templates/project/www/spec.html | 68 - .../bin/templates/project/www/spec/helper.js | 33 - .../bin/templates/project/www/spec/index.js | 67 - .../www/spec/lib/jasmine-1.2.0/MIT.LICENSE | 20 - .../www/spec/lib/jasmine-1.2.0/jasmine-html.js | 616 ----- .../www/spec/lib/jasmine-1.2.0/jasmine.css | 81 - .../www/spec/lib/jasmine-1.2.0/jasmine.js | 2529 ------------------ cordova/master/cordova-lib/cordova.js | 1525 ----------- cordova/master/package.json | 26 - package.json | 26 + 153 files changed, 5638 insertions(+), 5699 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cordova-browser/blob/6effec38/.gitignore ---------------------------------------------------------------------- diff --git a/.gitignore b/.gitignore index 03724a7..9b18e14 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,4 @@ -cordova/master/node_modules +node_modules/ npm-debug.log temp .DS_Store http://git-wip-us.apache.org/repos/asf/cordova-browser/blob/6effec38/VERSION ---------------------------------------------------------------------- diff --git a/VERSION b/VERSION new file mode 100644 index 0000000..79d94e6 --- /dev/null +++ b/VERSION @@ -0,0 +1 @@ +MASTER http://git-wip-us.apache.org/repos/asf/cordova-browser/blob/6effec38/bin/create ---------------------------------------------------------------------- diff --git a/bin/create b/bin/create old mode 100644 new mode 100755 index e69de29..5b59ad8 --- a/bin/create +++ b/bin/create @@ -0,0 +1,35 @@ +#!/usr/bin/env node + +/* + 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 path = require('path'); +var create = require('./lib/create'); +var args = process.argv; + +// Support basic help commands +if(args.length < 3 || (args[2] == '--help' || args[2] == '/?' || args[2] == '-h' || + args[2] == 'help' || args[2] == '-help' || args[2] == '/help')) { + console.log('Usage: ' + path.relative(process.cwd(), path.join(__dirname, 'create')) + ' <path_to_new_project> <package_name> <project_name>'); + console.log(' <path_to_new_project>: Path to your new Cordova Browser project'); + console.log(' <package_name>: Package name, following reverse-domain style convention'); + console.log(' <project_name>: Project name'); + process.exit(1); +} else { + create.createProject(args[2], args[3], args[4], args[5]); +} http://git-wip-us.apache.org/repos/asf/cordova-browser/blob/6effec38/bin/lib/check_reqs.js ---------------------------------------------------------------------- diff --git a/bin/lib/check_reqs.js b/bin/lib/check_reqs.js new file mode 100644 index 0000000..583ad0f --- /dev/null +++ b/bin/lib/check_reqs.js @@ -0,0 +1,26 @@ +#!/usr/bin/env node + +/* +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. +*/ + +//add methods as we determine what are the requirements + +module.exports.run = function() { + return true; +} http://git-wip-us.apache.org/repos/asf/cordova-browser/blob/6effec38/bin/lib/create.js ---------------------------------------------------------------------- diff --git a/bin/lib/create.js b/bin/lib/create.js new file mode 100644 index 0000000..df271f6 --- /dev/null +++ b/bin/lib/create.js @@ -0,0 +1,82 @@ +#!/usr/bin/env node + +/* + * 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 fs = require('fs'), + shjs = require('shelljs'), + args = process.argv, + path = require('path'), + ROOT = path.join(__dirname, '..', '..'), + check_reqs = require('./check_reqs'); + + +exports.createProject = function(project_path,package_name,project_name){ + var VERSION = fs.readFileSync(path.join(ROOT, 'VERSION'), 'utf-8'); + + // Set default values for path, package and name + project_path = typeof project_path !== 'undefined' ? project_path : "CordovaExample"; + package_name = typeof package_name !== 'undefined' ? package_name : 'org.apache.cordova.example'; + project_name = typeof project_name !== 'undefined' ? project_name : 'CordovaExample'; + + // Check if project already exists + if (fs.existsSync(project_path)) { + console.error('Project already exists! Delete and recreate'); + process.exit(2); + } + + // Check that requirements are met and proper targets are installed + if (!check_reqs.run()) { + console.error('Please make sure you meet the software requirements in order to build a browser cordova project'); + process.exit(2); + } + + console.log('Creating Browser project'); + console.log('Project Path '+ path.relative(process.cwd(),project_path)); + console.log('Package Name '+ package_name); + console.log('Project Name '+ project_name); + + //copy template directory + shjs.cp('-r', path.join(ROOT, 'bin', 'templates', 'project', 'www'), project_path); + + //create cordova/lib if it does not exist yet + if (!fs.existsSync(path.join(project_path,'cordova', 'lib'))) { + shjs.mkdir('-p', path.join(project_path,'cordova', 'lib')); + } + + //copy required node_modules + shjs.cp('-r', path.join(ROOT, 'node_modules'), path.join(project_path,'cordova')); + + //copy check_reqs file + shjs.cp( path.join(ROOT, 'bin', 'lib', 'check_reqs.js'), path.join(project_path,'cordova', 'lib')); + + //copy cordova js file + shjs.cp('-r', path.join(ROOT, 'cordova-lib', 'cordova.js'), path.join(project_path,'www')); + + //copy cordova directory + shjs.cp('-r', path.join(ROOT, 'bin', 'templates', 'project', 'cordova'), project_path); + [ + 'run', + 'build', + 'clean', + 'version', + ].forEach(function(f) { + shjs.chmod(755, path.join(project_path, 'cordova', f)); + }); +} http://git-wip-us.apache.org/repos/asf/cordova-browser/blob/6effec38/bin/templates/project/cordova/build ---------------------------------------------------------------------- diff --git a/bin/templates/project/cordova/build b/bin/templates/project/cordova/build new file mode 100755 index 0000000..64b68f4 --- /dev/null +++ b/bin/templates/project/cordova/build @@ -0,0 +1,33 @@ +#!/usr/bin/env node + +/* + 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 build = require('./lib/build'), + args = process.argv; + +// provide help +if ( args[2] == '--help' || args[2] == '/?' || args[2] == '-h' || args[2] == '/h' || + args[2] == 'help' || args[2] == '-help' || args[2] == '/help') { + build.help(); + process.exit(0); +} else { + build.buildProject(); +} http://git-wip-us.apache.org/repos/asf/cordova-browser/blob/6effec38/bin/templates/project/cordova/build.bat ---------------------------------------------------------------------- diff --git a/bin/templates/project/cordova/build.bat b/bin/templates/project/cordova/build.bat new file mode 100644 index 0000000..02641bc --- /dev/null +++ b/bin/templates/project/cordova/build.bat @@ -0,0 +1,26 @@ +:: 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. + +@ECHO OFF +SET script_path="%~dp0build" +IF EXIST %script_path% ( + node %script_path% %* +) ELSE ( + ECHO. + ECHO ERROR: Could not find 'build' script in 'cordova' folder, aborting...>&2 + EXIT /B 1 +) http://git-wip-us.apache.org/repos/asf/cordova-browser/blob/6effec38/bin/templates/project/cordova/clean ---------------------------------------------------------------------- diff --git a/bin/templates/project/cordova/clean b/bin/templates/project/cordova/clean new file mode 100644 index 0000000..da21bc7 --- /dev/null +++ b/bin/templates/project/cordova/clean @@ -0,0 +1,37 @@ +#!/usr/bin/env node + +/* + 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 path = require('path'), + clean = require('./lib/clean'), + reqs = require('./lib/check_reqs'), + args = process.argv; + +// Support basic help commands +if ( args.length > 2 + || args[2] == '--help' || args[2] == '/?' || args[2] == '-h' || + args[2] == 'help' || args[2] == '-help' || args[2] == '/help') { + console.log('Usage: ' + path.relative(process.cwd(), path.join(__dirname, 'clean')) ); + process.exit(0); +} else { + clean.cleanProject(); +} + http://git-wip-us.apache.org/repos/asf/cordova-browser/blob/6effec38/bin/templates/project/cordova/defaults.xml ---------------------------------------------------------------------- diff --git a/bin/templates/project/cordova/defaults.xml b/bin/templates/project/cordova/defaults.xml new file mode 100644 index 0000000..a7b31c0 --- /dev/null +++ b/bin/templates/project/cordova/defaults.xml @@ -0,0 +1,22 @@ +<?xml version='1.0' encoding='utf-8'?> +<!-- + 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. +--> +<widget id="io.cordova.hellocordova" version="0.0.1" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0"> + +</widget> http://git-wip-us.apache.org/repos/asf/cordova-browser/blob/6effec38/bin/templates/project/cordova/lib/build.js ---------------------------------------------------------------------- diff --git a/bin/templates/project/cordova/lib/build.js b/bin/templates/project/cordova/lib/build.js new file mode 100644 index 0000000..e46178c --- /dev/null +++ b/bin/templates/project/cordova/lib/build.js @@ -0,0 +1,63 @@ +#!/usr/bin/env node + +/* + * 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 path = require('path'), + fs = require('fs'), + clean = require('./clean'), + shjs = require('shelljs'), + zip = require('adm-zip'), + check_reqs = require('./check_reqs'), + platformWwwDir = path.join('platforms', 'browser', 'www'), + platformBuildDir = path.join('platforms', 'browser', 'build'), + packageFile = path.join(platformBuildDir, 'package.zip'); + +/** + * buildProject + * Creates a zip file int platform/build folder + */ +exports.buildProject = function(){ + + // Check that requirements are (stil) met + if (!check_reqs.run()) { + console.error('Please make sure you meet the software requirements in order to build a browser cordova project'); + process.exit(2); + } + + clean.cleanProject(); // remove old build result + + if (!fs.existsSync(platformBuildDir)) { + fs.mkdirSync(platformBuildDir); + } + + // add the project to a zipfile + var zipFile = zip(); + zipFile.addLocalFolder(platformWwwDir, '.'); + zipFile.writeZip(packageFile); + + console.log('Browser packaged app built in '+ packageFile); + + process.exit(0); +}; + +module.exports.help = function() { + console.log('Usage: cordova build browser'); + console.log('Build will create the packaged app in \''+platformBuildDir+'\'.'); +}; http://git-wip-us.apache.org/repos/asf/cordova-browser/blob/6effec38/bin/templates/project/cordova/lib/clean.js ---------------------------------------------------------------------- diff --git a/bin/templates/project/cordova/lib/clean.js b/bin/templates/project/cordova/lib/clean.js new file mode 100644 index 0000000..78c75b6 --- /dev/null +++ b/bin/templates/project/cordova/lib/clean.js @@ -0,0 +1,48 @@ +#!/usr/bin/env node + +/* + * 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 fs = require('fs'), + shjs = require('shelljs'), + path = require('path'), + check_reqs = require('./check_reqs'), + platformBuildDir = path.join('platforms', 'browser', 'build'); + +exports.cleanProject = function(){ + + // Check that requirements are (stil) met + if (!check_reqs.run()) { + console.error('Please make sure you meet the software requirements in order to clean an browser cordova project'); + process.exit(2); + } + + console.log('Cleaning Browser project'); + try { + if (fs.existsSync(platformBuildDir)) { + shjs.rm('-r', platformBuildDir); + } + } + catch(err) { + console.log('could not remove '+platformBuildDir+' : '+err.message); + } + + +} + http://git-wip-us.apache.org/repos/asf/cordova-browser/blob/6effec38/bin/templates/project/cordova/run ---------------------------------------------------------------------- diff --git a/bin/templates/project/cordova/run b/bin/templates/project/cordova/run new file mode 100755 index 0000000..d844828 --- /dev/null +++ b/bin/templates/project/cordova/run @@ -0,0 +1,27 @@ +#!/usr/bin/env node + +/* + 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 shell = require('shelljs'), + spawn = require('child_process').spawn, + open = require('open'), + project = 'file://' + shell.pwd() + '/platforms/browser/www/index.html'; + +spawn('open', ['-a', 'Google\ Chrome', '--args', '--disable-web-security', project]); http://git-wip-us.apache.org/repos/asf/cordova-browser/blob/6effec38/bin/templates/project/cordova/version ---------------------------------------------------------------------- diff --git a/bin/templates/project/cordova/version b/bin/templates/project/cordova/version new file mode 100755 index 0000000..f935529 --- /dev/null +++ b/bin/templates/project/cordova/version @@ -0,0 +1,25 @@ +#!/usr/bin/env node + +/* + 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. +*/ + +// Coho updates this line: +var VERSION = "3.5.0"; + +console.log(VERSION); http://git-wip-us.apache.org/repos/asf/cordova-browser/blob/6effec38/bin/templates/project/cordova/version.bat ---------------------------------------------------------------------- diff --git a/bin/templates/project/cordova/version.bat b/bin/templates/project/cordova/version.bat new file mode 100644 index 0000000..3610c17 --- /dev/null +++ b/bin/templates/project/cordova/version.bat @@ -0,0 +1,26 @@ +:: 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. + +@ECHO OFF +SET script_path="%~dp0version" +IF EXIST %script_path% ( + node %script_path% %* +) ELSE ( + ECHO. + ECHO ERROR: Could not find 'version' script in 'cordova' folder, aborting...>&2 + EXIT /B 1 +) http://git-wip-us.apache.org/repos/asf/cordova-browser/blob/6effec38/bin/templates/project/foo ---------------------------------------------------------------------- diff --git a/bin/templates/project/foo b/bin/templates/project/foo new file mode 100644 index 0000000..257cc56 --- /dev/null +++ b/bin/templates/project/foo @@ -0,0 +1 @@ +foo http://git-wip-us.apache.org/repos/asf/cordova-browser/blob/6effec38/bin/templates/project/www/css/index.css ---------------------------------------------------------------------- diff --git a/bin/templates/project/www/css/index.css b/bin/templates/project/www/css/index.css new file mode 100644 index 0000000..51daa79 --- /dev/null +++ b/bin/templates/project/www/css/index.css @@ -0,0 +1,115 @@ +/* + * 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; +} http://git-wip-us.apache.org/repos/asf/cordova-browser/blob/6effec38/bin/templates/project/www/img/logo.png ---------------------------------------------------------------------- diff --git a/bin/templates/project/www/img/logo.png b/bin/templates/project/www/img/logo.png new file mode 100644 index 0000000..9519e7d Binary files /dev/null and b/bin/templates/project/www/img/logo.png differ http://git-wip-us.apache.org/repos/asf/cordova-browser/blob/6effec38/bin/templates/project/www/index.html ---------------------------------------------------------------------- diff --git a/bin/templates/project/www/index.html b/bin/templates/project/www/index.html new file mode 100644 index 0000000..bde5741 --- /dev/null +++ b/bin/templates/project/www/index.html @@ -0,0 +1,43 @@ +<!DOCTYPE html> +<!-- + 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. +--> +<html> + <head> + <meta charset="utf-8" /> + <meta name="format-detection" content="telephone=no" /> + <!-- WARNING: for iOS 7, remove the width=device-width and height=device-height attributes. See https://issues.apache.org/jira/browse/CB-4323 --> + <meta name="viewport" content="user-scalable=no, initial-scale=1, maximum-scale=1, minimum-scale=1, width=device-width, height=device-height, target-densitydpi=device-dpi" /> + <link rel="stylesheet" type="text/css" href="css/index.css" /> + <title>Hello World</title> + </head> + <body> + <div class="app"> + <h1>Apache Cordova</h1> + <div id="deviceready" class="blink"> + <p class="event listening">Connecting to Device</p> + <p class="event received">Device is Ready</p> + </div> + </div> + <script type="text/javascript" src="cordova.js"></script> + <script type="text/javascript" src="js/index.js"></script> + <script type="text/javascript"> + app.initialize(); + </script> + </body> +</html> http://git-wip-us.apache.org/repos/asf/cordova-browser/blob/6effec38/bin/templates/project/www/js/index.js ---------------------------------------------------------------------- diff --git a/bin/templates/project/www/js/index.js b/bin/templates/project/www/js/index.js new file mode 100644 index 0000000..31d9064 --- /dev/null +++ b/bin/templates/project/www/js/index.js @@ -0,0 +1,49 @@ +/* + * 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 app = { + // Application Constructor + initialize: function() { + this.bindEvents(); + }, + // Bind Event Listeners + // + // Bind any events that are required on startup. Common events are: + // 'load', 'deviceready', 'offline', and 'online'. + bindEvents: function() { + document.addEventListener('deviceready', this.onDeviceReady, false); + }, + // deviceready Event Handler + // + // The scope of 'this' is the event. In order to call the 'receivedEvent' + // function, we must explicity call 'app.receivedEvent(...);' + onDeviceReady: function() { + app.receivedEvent('deviceready'); + }, + // Update DOM on a Received Event + receivedEvent: function(id) { + var parentElement = document.getElementById(id); + var listeningElement = parentElement.querySelector('.listening'); + var receivedElement = parentElement.querySelector('.received'); + + listeningElement.setAttribute('style', 'display:none;'); + receivedElement.setAttribute('style', 'display:block;'); + + console.log('Received Event: ' + id); + } +}; http://git-wip-us.apache.org/repos/asf/cordova-browser/blob/6effec38/bin/templates/project/www/manifest.webapp ---------------------------------------------------------------------- diff --git a/bin/templates/project/www/manifest.webapp b/bin/templates/project/www/manifest.webapp new file mode 100644 index 0000000..f24deb8 --- /dev/null +++ b/bin/templates/project/www/manifest.webapp @@ -0,0 +1,10 @@ +{ + "name": "My App", + "description": "Description of your app", + "launch_path": "/index.html", + "icons": { + "128": "/img/logo.png" + }, + "default_locale": "en", + "type": "privileged" +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/cordova-browser/blob/6effec38/bin/templates/project/www/res/icon/android/icon-36-ldpi.png ---------------------------------------------------------------------- diff --git a/bin/templates/project/www/res/icon/android/icon-36-ldpi.png b/bin/templates/project/www/res/icon/android/icon-36-ldpi.png new file mode 100644 index 0000000..cd5032a Binary files /dev/null and b/bin/templates/project/www/res/icon/android/icon-36-ldpi.png differ http://git-wip-us.apache.org/repos/asf/cordova-browser/blob/6effec38/bin/templates/project/www/res/icon/android/icon-48-mdpi.png ---------------------------------------------------------------------- diff --git a/bin/templates/project/www/res/icon/android/icon-48-mdpi.png b/bin/templates/project/www/res/icon/android/icon-48-mdpi.png new file mode 100644 index 0000000..e79c606 Binary files /dev/null and b/bin/templates/project/www/res/icon/android/icon-48-mdpi.png differ http://git-wip-us.apache.org/repos/asf/cordova-browser/blob/6effec38/bin/templates/project/www/res/icon/android/icon-72-hdpi.png ---------------------------------------------------------------------- diff --git a/bin/templates/project/www/res/icon/android/icon-72-hdpi.png b/bin/templates/project/www/res/icon/android/icon-72-hdpi.png new file mode 100644 index 0000000..4d27634 Binary files /dev/null and b/bin/templates/project/www/res/icon/android/icon-72-hdpi.png differ http://git-wip-us.apache.org/repos/asf/cordova-browser/blob/6effec38/bin/templates/project/www/res/icon/android/icon-96-xhdpi.png ---------------------------------------------------------------------- diff --git a/bin/templates/project/www/res/icon/android/icon-96-xhdpi.png b/bin/templates/project/www/res/icon/android/icon-96-xhdpi.png new file mode 100644 index 0000000..ec7ffbf Binary files /dev/null and b/bin/templates/project/www/res/icon/android/icon-96-xhdpi.png differ http://git-wip-us.apache.org/repos/asf/cordova-browser/blob/6effec38/bin/templates/project/www/res/icon/bada-wac/icon-48-type5.png ---------------------------------------------------------------------- diff --git a/bin/templates/project/www/res/icon/bada-wac/icon-48-type5.png b/bin/templates/project/www/res/icon/bada-wac/icon-48-type5.png new file mode 100644 index 0000000..8ad8bac Binary files /dev/null and b/bin/templates/project/www/res/icon/bada-wac/icon-48-type5.png differ http://git-wip-us.apache.org/repos/asf/cordova-browser/blob/6effec38/bin/templates/project/www/res/icon/bada-wac/icon-50-type3.png ---------------------------------------------------------------------- diff --git a/bin/templates/project/www/res/icon/bada-wac/icon-50-type3.png b/bin/templates/project/www/res/icon/bada-wac/icon-50-type3.png new file mode 100644 index 0000000..c6ddf84 Binary files /dev/null and b/bin/templates/project/www/res/icon/bada-wac/icon-50-type3.png differ http://git-wip-us.apache.org/repos/asf/cordova-browser/blob/6effec38/bin/templates/project/www/res/icon/bada-wac/icon-80-type4.png ---------------------------------------------------------------------- diff --git a/bin/templates/project/www/res/icon/bada-wac/icon-80-type4.png b/bin/templates/project/www/res/icon/bada-wac/icon-80-type4.png new file mode 100644 index 0000000..f86a27a Binary files /dev/null and b/bin/templates/project/www/res/icon/bada-wac/icon-80-type4.png differ http://git-wip-us.apache.org/repos/asf/cordova-browser/blob/6effec38/bin/templates/project/www/res/icon/bada/icon-128.png ---------------------------------------------------------------------- diff --git a/bin/templates/project/www/res/icon/bada/icon-128.png b/bin/templates/project/www/res/icon/bada/icon-128.png new file mode 100644 index 0000000..3516df3 Binary files /dev/null and b/bin/templates/project/www/res/icon/bada/icon-128.png differ http://git-wip-us.apache.org/repos/asf/cordova-browser/blob/6effec38/bin/templates/project/www/res/icon/blackberry/icon-80.png ---------------------------------------------------------------------- diff --git a/bin/templates/project/www/res/icon/blackberry/icon-80.png b/bin/templates/project/www/res/icon/blackberry/icon-80.png new file mode 100644 index 0000000..f86a27a Binary files /dev/null and b/bin/templates/project/www/res/icon/blackberry/icon-80.png differ http://git-wip-us.apache.org/repos/asf/cordova-browser/blob/6effec38/bin/templates/project/www/res/icon/blackberry10/icon-80.png ---------------------------------------------------------------------- diff --git a/bin/templates/project/www/res/icon/blackberry10/icon-80.png b/bin/templates/project/www/res/icon/blackberry10/icon-80.png new file mode 100644 index 0000000..f86a27a Binary files /dev/null and b/bin/templates/project/www/res/icon/blackberry10/icon-80.png differ http://git-wip-us.apache.org/repos/asf/cordova-browser/blob/6effec38/bin/templates/project/www/res/icon/ios/icon-57-2x.png ---------------------------------------------------------------------- diff --git a/bin/templates/project/www/res/icon/ios/icon-57-2x.png b/bin/templates/project/www/res/icon/ios/icon-57-2x.png new file mode 100644 index 0000000..efd9c37 Binary files /dev/null and b/bin/templates/project/www/res/icon/ios/icon-57-2x.png differ http://git-wip-us.apache.org/repos/asf/cordova-browser/blob/6effec38/bin/templates/project/www/res/icon/ios/icon-57.png ---------------------------------------------------------------------- diff --git a/bin/templates/project/www/res/icon/ios/icon-57.png b/bin/templates/project/www/res/icon/ios/icon-57.png new file mode 100644 index 0000000..c795fc4 Binary files /dev/null and b/bin/templates/project/www/res/icon/ios/icon-57.png differ http://git-wip-us.apache.org/repos/asf/cordova-browser/blob/6effec38/bin/templates/project/www/res/icon/ios/icon-72-2x.png ---------------------------------------------------------------------- diff --git a/bin/templates/project/www/res/icon/ios/icon-72-2x.png b/bin/templates/project/www/res/icon/ios/icon-72-2x.png new file mode 100644 index 0000000..dd819da Binary files /dev/null and b/bin/templates/project/www/res/icon/ios/icon-72-2x.png differ http://git-wip-us.apache.org/repos/asf/cordova-browser/blob/6effec38/bin/templates/project/www/res/icon/ios/icon-72.png ---------------------------------------------------------------------- diff --git a/bin/templates/project/www/res/icon/ios/icon-72.png b/bin/templates/project/www/res/icon/ios/icon-72.png new file mode 100644 index 0000000..b1cfde7 Binary files /dev/null and b/bin/templates/project/www/res/icon/ios/icon-72.png differ http://git-wip-us.apache.org/repos/asf/cordova-browser/blob/6effec38/bin/templates/project/www/res/icon/tizen/icon-128.png ---------------------------------------------------------------------- diff --git a/bin/templates/project/www/res/icon/tizen/icon-128.png b/bin/templates/project/www/res/icon/tizen/icon-128.png new file mode 100644 index 0000000..3516df3 Binary files /dev/null and b/bin/templates/project/www/res/icon/tizen/icon-128.png differ http://git-wip-us.apache.org/repos/asf/cordova-browser/blob/6effec38/bin/templates/project/www/res/icon/webos/icon-64.png ---------------------------------------------------------------------- diff --git a/bin/templates/project/www/res/icon/webos/icon-64.png b/bin/templates/project/www/res/icon/webos/icon-64.png new file mode 100644 index 0000000..03b3849 Binary files /dev/null and b/bin/templates/project/www/res/icon/webos/icon-64.png differ http://git-wip-us.apache.org/repos/asf/cordova-browser/blob/6effec38/bin/templates/project/www/res/icon/windows-phone/icon-173-tile.png ---------------------------------------------------------------------- diff --git a/bin/templates/project/www/res/icon/windows-phone/icon-173-tile.png b/bin/templates/project/www/res/icon/windows-phone/icon-173-tile.png new file mode 100644 index 0000000..4f15e20 Binary files /dev/null and b/bin/templates/project/www/res/icon/windows-phone/icon-173-tile.png differ http://git-wip-us.apache.org/repos/asf/cordova-browser/blob/6effec38/bin/templates/project/www/res/icon/windows-phone/icon-48.png ---------------------------------------------------------------------- diff --git a/bin/templates/project/www/res/icon/windows-phone/icon-48.png b/bin/templates/project/www/res/icon/windows-phone/icon-48.png new file mode 100644 index 0000000..8ad8bac Binary files /dev/null and b/bin/templates/project/www/res/icon/windows-phone/icon-48.png differ http://git-wip-us.apache.org/repos/asf/cordova-browser/blob/6effec38/bin/templates/project/www/res/icon/windows-phone/icon-62-tile.png ---------------------------------------------------------------------- diff --git a/bin/templates/project/www/res/icon/windows-phone/icon-62-tile.png b/bin/templates/project/www/res/icon/windows-phone/icon-62-tile.png new file mode 100644 index 0000000..aab6061 Binary files /dev/null and b/bin/templates/project/www/res/icon/windows-phone/icon-62-tile.png differ http://git-wip-us.apache.org/repos/asf/cordova-browser/blob/6effec38/bin/templates/project/www/res/screen/android/screen-hdpi-landscape.png ---------------------------------------------------------------------- diff --git a/bin/templates/project/www/res/screen/android/screen-hdpi-landscape.png b/bin/templates/project/www/res/screen/android/screen-hdpi-landscape.png new file mode 100644 index 0000000..a61e2b1 Binary files /dev/null and b/bin/templates/project/www/res/screen/android/screen-hdpi-landscape.png differ http://git-wip-us.apache.org/repos/asf/cordova-browser/blob/6effec38/bin/templates/project/www/res/screen/android/screen-hdpi-portrait.png ---------------------------------------------------------------------- diff --git a/bin/templates/project/www/res/screen/android/screen-hdpi-portrait.png b/bin/templates/project/www/res/screen/android/screen-hdpi-portrait.png new file mode 100644 index 0000000..5d6a28a Binary files /dev/null and b/bin/templates/project/www/res/screen/android/screen-hdpi-portrait.png differ http://git-wip-us.apache.org/repos/asf/cordova-browser/blob/6effec38/bin/templates/project/www/res/screen/android/screen-ldpi-landscape.png ---------------------------------------------------------------------- diff --git a/bin/templates/project/www/res/screen/android/screen-ldpi-landscape.png b/bin/templates/project/www/res/screen/android/screen-ldpi-landscape.png new file mode 100644 index 0000000..f3934cd Binary files /dev/null and b/bin/templates/project/www/res/screen/android/screen-ldpi-landscape.png differ http://git-wip-us.apache.org/repos/asf/cordova-browser/blob/6effec38/bin/templates/project/www/res/screen/android/screen-ldpi-portrait.png ---------------------------------------------------------------------- diff --git a/bin/templates/project/www/res/screen/android/screen-ldpi-portrait.png b/bin/templates/project/www/res/screen/android/screen-ldpi-portrait.png new file mode 100644 index 0000000..65ad163 Binary files /dev/null and b/bin/templates/project/www/res/screen/android/screen-ldpi-portrait.png differ http://git-wip-us.apache.org/repos/asf/cordova-browser/blob/6effec38/bin/templates/project/www/res/screen/android/screen-mdpi-landscape.png ---------------------------------------------------------------------- diff --git a/bin/templates/project/www/res/screen/android/screen-mdpi-landscape.png b/bin/templates/project/www/res/screen/android/screen-mdpi-landscape.png new file mode 100644 index 0000000..a1b697c Binary files /dev/null and b/bin/templates/project/www/res/screen/android/screen-mdpi-landscape.png differ http://git-wip-us.apache.org/repos/asf/cordova-browser/blob/6effec38/bin/templates/project/www/res/screen/android/screen-mdpi-portrait.png ---------------------------------------------------------------------- diff --git a/bin/templates/project/www/res/screen/android/screen-mdpi-portrait.png b/bin/templates/project/www/res/screen/android/screen-mdpi-portrait.png new file mode 100644 index 0000000..ea15693 Binary files /dev/null and b/bin/templates/project/www/res/screen/android/screen-mdpi-portrait.png differ http://git-wip-us.apache.org/repos/asf/cordova-browser/blob/6effec38/bin/templates/project/www/res/screen/android/screen-xhdpi-landscape.png ---------------------------------------------------------------------- diff --git a/bin/templates/project/www/res/screen/android/screen-xhdpi-landscape.png b/bin/templates/project/www/res/screen/android/screen-xhdpi-landscape.png new file mode 100644 index 0000000..79f2f09 Binary files /dev/null and b/bin/templates/project/www/res/screen/android/screen-xhdpi-landscape.png differ http://git-wip-us.apache.org/repos/asf/cordova-browser/blob/6effec38/bin/templates/project/www/res/screen/android/screen-xhdpi-portrait.png ---------------------------------------------------------------------- diff --git a/bin/templates/project/www/res/screen/android/screen-xhdpi-portrait.png b/bin/templates/project/www/res/screen/android/screen-xhdpi-portrait.png new file mode 100644 index 0000000..c2e8042 Binary files /dev/null and b/bin/templates/project/www/res/screen/android/screen-xhdpi-portrait.png differ http://git-wip-us.apache.org/repos/asf/cordova-browser/blob/6effec38/bin/templates/project/www/res/screen/bada-wac/screen-type3.png ---------------------------------------------------------------------- diff --git a/bin/templates/project/www/res/screen/bada-wac/screen-type3.png b/bin/templates/project/www/res/screen/bada-wac/screen-type3.png new file mode 100755 index 0000000..ea15693 Binary files /dev/null and b/bin/templates/project/www/res/screen/bada-wac/screen-type3.png differ http://git-wip-us.apache.org/repos/asf/cordova-browser/blob/6effec38/bin/templates/project/www/res/screen/bada-wac/screen-type4.png ---------------------------------------------------------------------- diff --git a/bin/templates/project/www/res/screen/bada-wac/screen-type4.png b/bin/templates/project/www/res/screen/bada-wac/screen-type4.png new file mode 100755 index 0000000..5d6a28a Binary files /dev/null and b/bin/templates/project/www/res/screen/bada-wac/screen-type4.png differ http://git-wip-us.apache.org/repos/asf/cordova-browser/blob/6effec38/bin/templates/project/www/res/screen/bada-wac/screen-type5.png ---------------------------------------------------------------------- diff --git a/bin/templates/project/www/res/screen/bada-wac/screen-type5.png b/bin/templates/project/www/res/screen/bada-wac/screen-type5.png new file mode 100755 index 0000000..bd64f76 Binary files /dev/null and b/bin/templates/project/www/res/screen/bada-wac/screen-type5.png differ http://git-wip-us.apache.org/repos/asf/cordova-browser/blob/6effec38/bin/templates/project/www/res/screen/bada/screen-portrait.png ---------------------------------------------------------------------- diff --git a/bin/templates/project/www/res/screen/bada/screen-portrait.png b/bin/templates/project/www/res/screen/bada/screen-portrait.png new file mode 100644 index 0000000..5d6a28a Binary files /dev/null and b/bin/templates/project/www/res/screen/bada/screen-portrait.png differ http://git-wip-us.apache.org/repos/asf/cordova-browser/blob/6effec38/bin/templates/project/www/res/screen/blackberry/screen-225.png ---------------------------------------------------------------------- diff --git a/bin/templates/project/www/res/screen/blackberry/screen-225.png b/bin/templates/project/www/res/screen/blackberry/screen-225.png new file mode 100644 index 0000000..29873e9 Binary files /dev/null and b/bin/templates/project/www/res/screen/blackberry/screen-225.png differ http://git-wip-us.apache.org/repos/asf/cordova-browser/blob/6effec38/bin/templates/project/www/res/screen/blackberry10/splash-1280x768.png ---------------------------------------------------------------------- diff --git a/bin/templates/project/www/res/screen/blackberry10/splash-1280x768.png b/bin/templates/project/www/res/screen/blackberry10/splash-1280x768.png new file mode 100644 index 0000000..5f4bca9 Binary files /dev/null and b/bin/templates/project/www/res/screen/blackberry10/splash-1280x768.png differ http://git-wip-us.apache.org/repos/asf/cordova-browser/blob/6effec38/bin/templates/project/www/res/screen/blackberry10/splash-720x720.png ---------------------------------------------------------------------- diff --git a/bin/templates/project/www/res/screen/blackberry10/splash-720x720.png b/bin/templates/project/www/res/screen/blackberry10/splash-720x720.png new file mode 100644 index 0000000..fe1756f Binary files /dev/null and b/bin/templates/project/www/res/screen/blackberry10/splash-720x720.png differ http://git-wip-us.apache.org/repos/asf/cordova-browser/blob/6effec38/bin/templates/project/www/res/screen/blackberry10/splash-768x1280.png ---------------------------------------------------------------------- diff --git a/bin/templates/project/www/res/screen/blackberry10/splash-768x1280.png b/bin/templates/project/www/res/screen/blackberry10/splash-768x1280.png new file mode 100644 index 0000000..0fb9c1b Binary files /dev/null and b/bin/templates/project/www/res/screen/blackberry10/splash-768x1280.png differ http://git-wip-us.apache.org/repos/asf/cordova-browser/blob/6effec38/bin/templates/project/www/res/screen/ios/screen-ipad-landscape-2x.png ---------------------------------------------------------------------- diff --git a/bin/templates/project/www/res/screen/ios/screen-ipad-landscape-2x.png b/bin/templates/project/www/res/screen/ios/screen-ipad-landscape-2x.png new file mode 100644 index 0000000..95c542d Binary files /dev/null and b/bin/templates/project/www/res/screen/ios/screen-ipad-landscape-2x.png differ http://git-wip-us.apache.org/repos/asf/cordova-browser/blob/6effec38/bin/templates/project/www/res/screen/ios/screen-ipad-landscape.png ---------------------------------------------------------------------- diff --git a/bin/templates/project/www/res/screen/ios/screen-ipad-landscape.png b/bin/templates/project/www/res/screen/ios/screen-ipad-landscape.png new file mode 100644 index 0000000..04be5ac Binary files /dev/null and b/bin/templates/project/www/res/screen/ios/screen-ipad-landscape.png differ http://git-wip-us.apache.org/repos/asf/cordova-browser/blob/6effec38/bin/templates/project/www/res/screen/ios/screen-ipad-portrait-2x.png ---------------------------------------------------------------------- diff --git a/bin/templates/project/www/res/screen/ios/screen-ipad-portrait-2x.png b/bin/templates/project/www/res/screen/ios/screen-ipad-portrait-2x.png new file mode 100644 index 0000000..aae1862 Binary files /dev/null and b/bin/templates/project/www/res/screen/ios/screen-ipad-portrait-2x.png differ http://git-wip-us.apache.org/repos/asf/cordova-browser/blob/6effec38/bin/templates/project/www/res/screen/ios/screen-ipad-portrait.png ---------------------------------------------------------------------- diff --git a/bin/templates/project/www/res/screen/ios/screen-ipad-portrait.png b/bin/templates/project/www/res/screen/ios/screen-ipad-portrait.png new file mode 100644 index 0000000..41e839d Binary files /dev/null and b/bin/templates/project/www/res/screen/ios/screen-ipad-portrait.png differ http://git-wip-us.apache.org/repos/asf/cordova-browser/blob/6effec38/bin/templates/project/www/res/screen/ios/screen-iphone-landscape-2x.png ---------------------------------------------------------------------- diff --git a/bin/templates/project/www/res/screen/ios/screen-iphone-landscape-2x.png b/bin/templates/project/www/res/screen/ios/screen-iphone-landscape-2x.png new file mode 100644 index 0000000..0165669 Binary files /dev/null and b/bin/templates/project/www/res/screen/ios/screen-iphone-landscape-2x.png differ http://git-wip-us.apache.org/repos/asf/cordova-browser/blob/6effec38/bin/templates/project/www/res/screen/ios/screen-iphone-landscape.png ---------------------------------------------------------------------- diff --git a/bin/templates/project/www/res/screen/ios/screen-iphone-landscape.png b/bin/templates/project/www/res/screen/ios/screen-iphone-landscape.png new file mode 100644 index 0000000..d154883 Binary files /dev/null and b/bin/templates/project/www/res/screen/ios/screen-iphone-landscape.png differ http://git-wip-us.apache.org/repos/asf/cordova-browser/blob/6effec38/bin/templates/project/www/res/screen/ios/screen-iphone-portrait-2x.png ---------------------------------------------------------------------- diff --git a/bin/templates/project/www/res/screen/ios/screen-iphone-portrait-2x.png b/bin/templates/project/www/res/screen/ios/screen-iphone-portrait-2x.png new file mode 100644 index 0000000..bd24886 Binary files /dev/null and b/bin/templates/project/www/res/screen/ios/screen-iphone-portrait-2x.png differ http://git-wip-us.apache.org/repos/asf/cordova-browser/blob/6effec38/bin/templates/project/www/res/screen/ios/screen-iphone-portrait-568h-2x.png ---------------------------------------------------------------------- diff --git a/bin/templates/project/www/res/screen/ios/screen-iphone-portrait-568h-2x.png b/bin/templates/project/www/res/screen/ios/screen-iphone-portrait-568h-2x.png new file mode 100644 index 0000000..10ed683 Binary files /dev/null and b/bin/templates/project/www/res/screen/ios/screen-iphone-portrait-568h-2x.png differ http://git-wip-us.apache.org/repos/asf/cordova-browser/blob/6effec38/bin/templates/project/www/res/screen/ios/screen-iphone-portrait.png ---------------------------------------------------------------------- diff --git a/bin/templates/project/www/res/screen/ios/screen-iphone-portrait.png b/bin/templates/project/www/res/screen/ios/screen-iphone-portrait.png new file mode 100644 index 0000000..6fcba56 Binary files /dev/null and b/bin/templates/project/www/res/screen/ios/screen-iphone-portrait.png differ http://git-wip-us.apache.org/repos/asf/cordova-browser/blob/6effec38/bin/templates/project/www/res/screen/tizen/README.md ---------------------------------------------------------------------- diff --git a/bin/templates/project/www/res/screen/tizen/README.md b/bin/templates/project/www/res/screen/tizen/README.md new file mode 100644 index 0000000..3a0d6fe --- /dev/null +++ b/bin/templates/project/www/res/screen/tizen/README.md @@ -0,0 +1,3 @@ +# Tizen Splash Screen + +Splash screens are unsupported on the Tizen platform. http://git-wip-us.apache.org/repos/asf/cordova-browser/blob/6effec38/bin/templates/project/www/res/screen/webos/screen-64.png ---------------------------------------------------------------------- diff --git a/bin/templates/project/www/res/screen/webos/screen-64.png b/bin/templates/project/www/res/screen/webos/screen-64.png new file mode 100644 index 0000000..03b3849 Binary files /dev/null and b/bin/templates/project/www/res/screen/webos/screen-64.png differ http://git-wip-us.apache.org/repos/asf/cordova-browser/blob/6effec38/bin/templates/project/www/res/screen/windows-phone/screen-portrait.jpg ---------------------------------------------------------------------- diff --git a/bin/templates/project/www/res/screen/windows-phone/screen-portrait.jpg b/bin/templates/project/www/res/screen/windows-phone/screen-portrait.jpg new file mode 100644 index 0000000..479d3e4 Binary files /dev/null and b/bin/templates/project/www/res/screen/windows-phone/screen-portrait.jpg differ http://git-wip-us.apache.org/repos/asf/cordova-browser/blob/6effec38/bin/templates/project/www/spec.html ---------------------------------------------------------------------- diff --git a/bin/templates/project/www/spec.html b/bin/templates/project/www/spec.html new file mode 100644 index 0000000..71f00de --- /dev/null +++ b/bin/templates/project/www/spec.html @@ -0,0 +1,68 @@ +<!DOCTYPE html> +<!-- + 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. +--> +<html> + <head> + <title>Jasmine Spec Runner</title> + + <!-- jasmine source --> + <link rel="shortcut icon" type="image/png" href="spec/lib/jasmine-1.2.0/jasmine_favicon.png"> + <link rel="stylesheet" type="text/css" href="spec/lib/jasmine-1.2.0/jasmine.css"> + <script type="text/javascript" src="spec/lib/jasmine-1.2.0/jasmine.js"></script> + <script type="text/javascript" src="spec/lib/jasmine-1.2.0/jasmine-html.js"></script> + + <!-- include source files here... --> + <script type="text/javascript" src="js/index.js"></script> + + <!-- include spec files here... --> + <script type="text/javascript" src="spec/helper.js"></script> + <script type="text/javascript" src="spec/index.js"></script> + + <script type="text/javascript"> + (function() { + var jasmineEnv = jasmine.getEnv(); + jasmineEnv.updateInterval = 1000; + + var htmlReporter = new jasmine.HtmlReporter(); + + jasmineEnv.addReporter(htmlReporter); + + jasmineEnv.specFilter = function(spec) { + return htmlReporter.specFilter(spec); + }; + + var currentWindowOnload = window.onload; + + window.onload = function() { + if (currentWindowOnload) { + currentWindowOnload(); + } + execJasmine(); + }; + + function execJasmine() { + jasmineEnv.execute(); + } + })(); + </script> + </head> + <body> + <div id="stage" style="display:none;"></div> + </body> +</html> http://git-wip-us.apache.org/repos/asf/cordova-browser/blob/6effec38/bin/templates/project/www/spec/helper.js ---------------------------------------------------------------------- diff --git a/bin/templates/project/www/spec/helper.js b/bin/templates/project/www/spec/helper.js new file mode 100644 index 0000000..929f776 --- /dev/null +++ b/bin/templates/project/www/spec/helper.js @@ -0,0 +1,33 @@ +/* + * 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. + */ +afterEach(function() { + document.getElementById('stage').innerHTML = ''; +}); + +var helper = { + trigger: function(obj, name) { + var e = document.createEvent('Event'); + e.initEvent(name, true, true); + obj.dispatchEvent(e); + }, + getComputedStyle: function(querySelector, property) { + var element = document.querySelector(querySelector); + return window.getComputedStyle(element).getPropertyValue(property); + } +}; http://git-wip-us.apache.org/repos/asf/cordova-browser/blob/6effec38/bin/templates/project/www/spec/index.js ---------------------------------------------------------------------- diff --git a/bin/templates/project/www/spec/index.js b/bin/templates/project/www/spec/index.js new file mode 100644 index 0000000..20f8be5 --- /dev/null +++ b/bin/templates/project/www/spec/index.js @@ -0,0 +1,67 @@ +/* + * 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('app', function() { + describe('initialize', function() { + it('should bind deviceready', function() { + runs(function() { + spyOn(app, 'onDeviceReady'); + app.initialize(); + helper.trigger(window.document, 'deviceready'); + }); + + waitsFor(function() { + return (app.onDeviceReady.calls.length > 0); + }, 'onDeviceReady should be called once', 500); + + runs(function() { + expect(app.onDeviceReady).toHaveBeenCalled(); + }); + }); + }); + + describe('onDeviceReady', function() { + it('should report that it fired', function() { + spyOn(app, 'receivedEvent'); + app.onDeviceReady(); + expect(app.receivedEvent).toHaveBeenCalledWith('deviceready'); + }); + }); + + describe('receivedEvent', function() { + beforeEach(function() { + var el = document.getElementById('stage'); + el.innerHTML = ['<div id="deviceready">', + ' <p class="event listening">Listening</p>', + ' <p class="event received">Received</p>', + '</div>'].join('\n'); + }); + + it('should hide the listening element', function() { + app.receivedEvent('deviceready'); + var displayStyle = helper.getComputedStyle('#deviceready .listening', 'display'); + expect(displayStyle).toEqual('none'); + }); + + it('should show the received element', function() { + app.receivedEvent('deviceready'); + var displayStyle = helper.getComputedStyle('#deviceready .received', 'display'); + expect(displayStyle).toEqual('block'); + }); + }); +}); http://git-wip-us.apache.org/repos/asf/cordova-browser/blob/6effec38/bin/templates/project/www/spec/lib/jasmine-1.2.0/MIT.LICENSE ---------------------------------------------------------------------- diff --git a/bin/templates/project/www/spec/lib/jasmine-1.2.0/MIT.LICENSE b/bin/templates/project/www/spec/lib/jasmine-1.2.0/MIT.LICENSE new file mode 100644 index 0000000..7c435ba --- /dev/null +++ b/bin/templates/project/www/spec/lib/jasmine-1.2.0/MIT.LICENSE @@ -0,0 +1,20 @@ +Copyright (c) 2008-2011 Pivotal Labs + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.