Remove unused modules
diff --git a/tools/lib/cordova/jodoc.js b/tools/lib/cordova/jodoc.js
deleted file mode 100644
index 5baa1a4..0000000
--- a/tools/lib/cordova/jodoc.js
+++ /dev/null
@@ -1,130 +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.
-*/
-/* jslint node: true */
-/* global which, exec */
-var fs = require('fs-extra');
-var path = require('path');
-require('shelljs/global');
-
-var JoDoc = (function () {
- 'use strict';
-
- var JO_DOC_CLI = 'jodoc';
- var TEMPLATE_PATH = path.resolve(path.join(path.dirname(module.filename), '..', '..', 'template', 'docs'));
- var useLocalJoDoc = true;
-
- /**
- * Creates a new instance of JoDoc
- * @param inputDirectory Directory which contains files which has to be processed.
- * @param outputDirectory Directory to which store generated files.
- * @param options Options for the generation process.
- */
- function JoDoc (inputDirectory, outputDirectory, options) {
- this.input_directory = inputDirectory;
- this.output_directory = outputDirectory;
- this.options = options;
-
- this.template_directories = [ path.join(TEMPLATE_PATH, 'default') ];
- if (options.lang) {
- this.template_directories.push(path.join(TEMPLATE_PATH, options.lang));
- }
-
- this.check_dependencies();
- }
-
- JoDoc.prototype.check_dependencies = function () {
- if (!which('jodoc') && !useLocalJoDoc) {
- console.error('The jodoc script is not in your path');
- process.exit(1);
- }
-
- [this.input_directory, this.template_directories[0]].forEach(function (dir) {
- if (!fs.existsSync(dir)) {
- console.error('The directory ' + dir + ' has to be present');
- process.exit(1);
- }
-
- var stat = fs.lstatSync(dir);
- if (!stat.isDirectory()) {
- console.error('The path ' + dir + ' is not directory.');
- process.exit(1);
- }
- });
- };
-
- JoDoc.prototype.run = function () {
- var self = this;
- var currentDirectory = process.cwd();
- var nullDevice = '/dev/null';
- var templateFile = path.join(this.output_directory, 'index.html');
- var commandLine;
- var child;
- var executableName;
- // Copy HTML template assets
- this.template_directories.forEach(function (templateDir) {
- if (!fs.existsSync(templateDir)) {
- if (self.options.verbose > 0) {
- console.log('Template folder ' + templateDir + ' not exists, skipping');
- }
-
- return;
- }
-
- var stat = fs.lstatSync(templateDir);
- if (!stat.isDirectory()) {
- return;
- }
-
- fs.copySync(templateDir, self.output_directory);
- });
-
- process.chdir(this.input_directory);
-
- executableName = JO_DOC_CLI;
- if (useLocalJoDoc) {
- executableName = path.join(module.filename, '../../../node_modules/.bin/jodoc');
- }
-
- commandLine = executableName + ' --output "' + this.output_directory + '" --title "Cordova API Documentation" --template "' + templateFile + '" ./';
- if (self.options.verbose > 0) {
- console.log('Running joDoc-js with command line:');
- console.log(commandLine);
- }
-
- if (this.options.verbose < 2) {
- commandLine = commandLine + ' > ' + nullDevice + ' 2> ' + nullDevice;
- }
-
- if (this.options.verbose > 1) {
- console.info('Running jodoc from ' + this.input_directory + ' directory');
- console.info(commandLine);
- }
-
- child = exec(commandLine);
- if (child.code !== 0) {
- console.error('Error during execution of jodoc. Error code is: ' + child.code);
- process.exit(child.code);
- }
-
- process.chdir(currentDirectory);
- };
-
- return JoDoc;
-}());
-module.exports = JoDoc;
diff --git a/tools/lib/cordova/post/addtitle.js b/tools/lib/cordova/post/addtitle.js
deleted file mode 100644
index b9935d3..0000000
--- a/tools/lib/cordova/post/addtitle.js
+++ /dev/null
@@ -1,72 +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.
-*/
-/* jslint node: true */
-var path = require('path');
-
-/**
-* Preprocessor which updates top stripe with header or the page.
-*/
-var AddTitle = (function () {
- 'use strict';
-
- /**
- * Creates a new instance of FileMerger
- * @param options Options for the generation process.
- */
- function AddTitle (options) {
- this.options = options || { verbose: 0 };
- this.stage = 'Adding title';
- }
-
- AddTitle.prototype.run = function (file, $) {
- if (path.extname(file) !== '.html') {
- return;
- }
-
- if (this.options.verbose > 1) {
- console.log('Add title to file ' + file);
- }
-
- var title_source,
- title_target,
- title;
- title_source = $('#content > h1');
- if (title_source.length === 0) {
- return null;
- }
-
- title_source = $(title_source[0]);
- title_target = $('#subheader > h1');
- if (title_target.length === 0) {
- return null;
- }
-
- title_target = $(title_target[0]);
- if (this.options.verbose > 1) {
- console.log('Change title from ' + title_target.text() + ' to ' + title_source.text());
- }
-
- title = title_source.text();
- title_target.text(title);
- return title;
- };
-
- return AddTitle;
-}());
-module.exports = AddTitle;
diff --git a/tools/lib/cordova/post/index.js b/tools/lib/cordova/post/index.js
deleted file mode 100644
index fa02026..0000000
--- a/tools/lib/cordova/post/index.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.
-*/
-/* eslint-disable */
-var AddTitle = require('./addtitle');
-var UpdateIndex = require('./updateindex');
-var UpdateKeywordIndex = require('./updatekeywordindex');
-var TableOfContents = require('./tableofcontents');
-var VersionMenu = require('./versionmenu');
-var NavigationMenu = require('./navigationmenu');
-var Prettify = require('./prettify');
-var NoIndex = require('./noindex');
-var StepProcessor = require('./stepprocessor');
-module.exports = [ StepProcessor, /* AddTitle, */ UpdateIndex, UpdateKeywordIndex /*, TableOfContents, VersionMenu, NavigationMenu, Prettify, NoIndex */ ];
diff --git a/tools/lib/cordova/post/navigationmenu.js b/tools/lib/cordova/post/navigationmenu.js
deleted file mode 100644
index 380102f..0000000
--- a/tools/lib/cordova/post/navigationmenu.js
+++ /dev/null
@@ -1,120 +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.
-*/
-/* jslint node: true */
-var fs = require('fs-extra');
-var path = require('path');
-var cheerio = require('cheerio');
-var FileHelpers = require('../../file_helpers');
-
-/**
-* Preprocessor which updates top stripe with header or the page.
-*/
-var NavigationMenu = (function () {
- 'use strict';
-
- /**
- * Creates a new instance of FileMerger
- * @param options Options for the generation process.
- */
- function NavigationMenu (options) {
- this.options = options || { verbose: 0 };
- this.stage = 'Building navigation menu';
- this.sections = [];
-
- var filename = path.join(FileHelpers.getTmpDirectory(), 'jodoc', 'index.md.html');
- var $;
- var h1_set;
- var ul_set;
- var count;
- var i;
- var links;
- var appendLink;
- if (!fs.existsSync(filename)) {
- throw new Error('index.md.html was not generated in ' + FileHelpers.getTmpDirectory() + '/jodoc');
- }
- $ = cheerio.load(fs.readFileSync(filename));
- h1_set = $('#home > h1');
- ul_set = $('#home > ul');
- count = h1_set.length;
-
- function getAppender (links) {
- function appendLink (index, element) {
- links.push(element);
- }
-
- return appendLink;
- }
-
- for (i = 0; i < count; i += 1) {
- links = [];
- appendLink = getAppender(links);
-
- $('li > h2 > a', ul_set[i]).each(appendLink);
-
- this.sections.push({
- 'title': $(h1_set[i]).text(),
- 'links': links
- });
- }
- }
-
- NavigationMenu.prototype.run = function (file, $) {
- var i,
- section;
- if (path.extname(file) !== '.html') {
- return;
- }
-
- if (this.options.verbose > 1) {
- console.log('Appending file to nav menu ' + file);
- }
-
- for (i = 0; i < this.sections.length; i += 1) {
- section = this.sections[i];
- this.insertTitle(section.title, $);
- this.insertLinks(section.links, $);
- }
- };
-
- NavigationMenu.prototype.insertTitle = function (title, $) {
- var element = cheerio('<h1></h1>');
- element.text(title);
- $('#sidebar').first().append(element).append('\n');
- };
-
- NavigationMenu.prototype.insertLinks = function (links, $) {
- var ul = cheerio('<ul></ul>');
- var li;
- var i;
- var link;
-
- ul.append('\n');
- for (i = 0; i < links.length; i += 1) {
- link = links[i];
- li = cheerio('<li></li>');
- li.append(link);
- ul.append(li).append('\n');
- }
-
- $('#sidebar').first().append(ul).append('\n');
- };
-
- return NavigationMenu;
-}());
-module.exports = NavigationMenu;
diff --git a/tools/lib/cordova/post/noindex.js b/tools/lib/cordova/post/noindex.js
deleted file mode 100644
index 8027453..0000000
--- a/tools/lib/cordova/post/noindex.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.
-*/
-/* jslint node: true */
-var fs = require('fs-extra');
-var path = require('path');
-var cheerio = require('cheerio');
-var FileHelpers = require('../../file_helpers');
-
-/**
-* Preprocessor which adds meta tag robot=noindex, to all not latest versions of the docs.
-*/
-var NoIndex = (function () {
- 'use strict';
- var latestVersion = null;
-
- function getLatestIndex () {
- // skip if we have the latest version
- if (latestVersion !== null) {
- return latestVersion;
- }
-
- // collect all english versions because they are the most up-to-date
- var docs_path = FileHelpers.getDefaultInputDirectory();
- var versions = [];
- var lang_dir = path.join(docs_path, 'en');
- var version_dirs;
- var last;
-
- version_dirs = fs.readdirSync(lang_dir);
- version_dirs.forEach(function (version) {
- versions.push(version);
- });
-
- // sort the version list because Dir does not guarantee an order
- versions.sort().reverse();
-
- // we want the latest stable release
- // if dev is the most recent, remove it
- last = versions.shift();
- if (last === 'dev') {
- last = versions.shift();
- }
-
- // return the latest version
- latestVersion = last;
- return last;
- }
-
- function createNoIndexMeta () {
- var element = cheerio('<meta></meta>');
- element.attr('name', 'robots');
- element.attr('label', 'noindex');
- return element;
- }
-
- /**
- * Creates a new instance of FileMerger
- * @param options Options for the generation process.
- */
- function NoIndex (options) {
- latestVersion = getLatestIndex();
- this.options = options || { verbose: 0 };
- this.stage = 'Insert noindex';
- }
-
- NoIndex.prototype.run = function (file, $) {
- if (!file.match(/\.html$/)) {
- return null;
- }
-
- var version = this.options.version;
- var language = this.options.lang;
- var meta_tags;
- if (latestVersion === version && language === 'en') {
- if (this.options.verbose > 1) {
- console.log('File belongs to language ' + language + ' and version ' + version + ' which is assumed to be latest');
- }
-
- return;
- }
-
- meta_tags = $('head meta');
- meta_tags.append(createNoIndexMeta());
- };
-
- return NoIndex;
-}());
-module.exports = NoIndex;
diff --git a/tools/lib/cordova/post/prettify.js b/tools/lib/cordova/post/prettify.js
deleted file mode 100644
index a65033c..0000000
--- a/tools/lib/cordova/post/prettify.js
+++ /dev/null
@@ -1,54 +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.
-*/
-/* jslint node: true */
-var path = require('path');
-
-/**
-* Preprocessor which updates top stripe with header or the page.
-*/
-var Prettify = (function () {
- 'use strict';
-
- /**
- * Creates a new instance of FileMerger
- * @param options Options for the generation process.
- */
- function Prettify (options) {
- this.options = options || { verbose: 0 };
- this.stage = 'Prettify';
- }
-
- Prettify.prototype.run = function (file, $) {
- if (path.extname(file) !== '.html') {
- return;
- }
-
- if (this.options.verbose > 1) {
- console.log('Prettify file ' + file);
- }
-
- var element;
- element = $('#content pre');
- element.attr('class', 'prettyprint');
- return element;
- };
-
- return Prettify;
-}());
-module.exports = Prettify;
diff --git a/tools/lib/cordova/post/stepprocessor.js b/tools/lib/cordova/post/stepprocessor.js
deleted file mode 100644
index db01500..0000000
--- a/tools/lib/cordova/post/stepprocessor.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.
-*/
-/* jslint node: true */
-var fs = require('fs-extra');
-var path = require('path');
-var cheerio = require('cheerio');
-var AddTitle = require('./addtitle');
-var TableOfContents = require('./tableofcontents');
-var VersionMenu = require('./versionmenu');
-var NavigationMenu = require('./navigationmenu');
-var Prettify = require('./prettify');
-var NoIndex = require('./noindex');
-
-/**
-* Preprocessor which updates top stripe with header or the page.
-*/
-var StepProcessor = (function () {
- 'use strict';
-
- /**
- * Creates a new instance of StepProcessor
- * @param options Options for the generation process.
- */
- function StepProcessor (options) {
- var self = this;
- this.options = options || { verbose: 0, timing: -1 };
- this.stage = 'Step 1';
- this.processors = [AddTitle, TableOfContents, VersionMenu, NavigationMenu, Prettify, NoIndex].map(function (StepConstructor) {
- var stepObject;
- self.captureExecutionTime(' Substep init ' + StepConstructor, 2, function () {
- stepObject = new StepConstructor(self.options);
- });
- return stepObject;
- });
- }
-
- StepProcessor.prototype.run = function (file) {
- var self = this;
- var $;
- if (path.extname(file) !== '.html') {
- return;
- }
-
- $ = cheerio.load(fs.readFileSync(file));
- this.processors.forEach(function (stepObject) {
- self.captureExecutionTime(' Substep run: ' + stepObject.stage, 2, function () {
- stepObject.run(file, $);
- });
- });
- // Save all content to file
- fs.writeFileSync(file, $.html());
- };
-
- StepProcessor.prototype.captureExecutionTime = function (step_name, level, callback) {
- var startDate;
- var finishDate;
- var timingLevel = -1;
- var secondsPassed;
- if (this.options.timing) {
- if (this.options.timing === true) {
- timingLevel = 0;
- } else {
- timingLevel = this.options.timing;
- }
- }
-
- if (timingLevel >= level) {
- startDate = new Date();
- if (this.options.verbose > 0) {
- console.log(startDate, 'Start ' + step_name);
- }
- }
-
- callback.apply(this);
- if (timingLevel >= level) {
- finishDate = new Date();
- if (this.options.verbose > 0) {
- console.log(finishDate, 'Finish ' + step_name);
- }
-
- secondsPassed = (finishDate.valueOf() - startDate.valueOf()) / 1000;
- console.log(step_name + '. Total time: ', secondsPassed);
- }
- };
-
- return StepProcessor;
-}());
-module.exports = StepProcessor;
diff --git a/tools/lib/cordova/post/tableofcontents.js b/tools/lib/cordova/post/tableofcontents.js
deleted file mode 100644
index 46f3ce4..0000000
--- a/tools/lib/cordova/post/tableofcontents.js
+++ /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.
-*/
-/* jslint node: true */
-var path = require('path');
-var cheerio = require('cheerio');
-
-/**
-* Preprocessor which updates top stripe with header or the page.
-*/
-var TableOfContents = (function () {
- 'use strict';
-
- /**
- * Creates a new instance of TableOfContents
- * @param options Options for the generation process.
- */
- function TableOfContents (options) {
- this.options = options || { verbose: 0 };
- this.stage = 'Building TOC';
- }
-
- TableOfContents.prototype.run = function (file, doc) {
- var filenamePart = path.basename(file);
- var option_set = [];
- var current_h1 = '';
- var indentation = '\xa0\xa0\xa0\xa0\xa0\xa0';
- var select;
- var subheader;
- if (filenamePart === '_index.html' || filenamePart === 'index.html' || filenamePart === 'index.md.html') {
- return;
- }
-
- if (path.extname(file) !== '.html') {
- return;
- }
-
- doc('#content h1, #content h2').each(function (index, elementDom) {
- var element = cheerio(elementDom);
- var child = element.children().first();
- var option;
- var s;
- var anchorName;
- var anchor;
- if (elementDom.name === 'h1') {
- current_h1 = element.text();
- option = cheerio('<option></option');
- anchorName = child.attr('name');
- if (anchorName !== null && anchorName !== undefined) {
- anchorName = encodeURIComponent(anchorName);
- option.attr('value', anchorName.replace(/\s/g, '%20'));
- }
-
- option.text(element.text());
- option_set.push(option);
- } else {
- // Remove all leading and trailing non-word characters
- // Replace all inner non-word characters with an underscore
- // Replace all spaces since encodeURIComponent not produce correct URI
- s = element.text()
- .replace(/^\W+|\W+$/g, '')
- .replace(/\W+/g, '_').toLowerCase();
- option = cheerio('<option></option>');
- anchorName = current_h1 + '_' + s;
- anchorName = encodeURIComponent(anchorName);
- anchorName = anchorName.replace(/%2520/g, '%20');
- option.attr('value', anchorName);
- option.text(indentation + '- ' + element.text());
- option_set.push(option);
-
- anchor = cheerio('<a></a>');
- anchor.attr('name', anchorName);
- anchor.text(element.text());
- element.text('');
- element.append(anchor);
- }
- });
-
- // Return if one or less elements found (useless selection box)
- if (option_set.length <= 1) {
- return null;
- }
-
- // Add select menu to the subheader
- select = cheerio('<select></select>');
- option_set.forEach(function (optionGroup) {
- select.append(optionGroup);
- });
- subheader = doc('#subheader > small').first();
- if (subheader.length === 0) {
- return null;
- }
-
- subheader.append(select);
- return option_set;
- };
-
- return TableOfContents;
-}());
-module.exports = TableOfContents;
diff --git a/tools/lib/cordova/post/updateindex.js b/tools/lib/cordova/post/updateindex.js
deleted file mode 100644
index 26ddba7..0000000
--- a/tools/lib/cordova/post/updateindex.js
+++ /dev/null
@@ -1,65 +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.
-*/
-/* jslint node: true */
-var fs = require('fs-extra');
-var path = require('path');
-var cheerio = require('cheerio');
-
-/**
-* Preprocessor which updates top stripe with header or the page.
-*/
-var UpdateIndex = (function () {
- 'use strict';
- var header_title = 'Home';
-
- /**
- * Creates a new instance of FileMerger
- * @param options Options for the generation process.
- */
- function UpdateIndex (options) {
- this.options = options || { verbose: 0 };
- this.stage = 'Update index';
- this.header_title = header_title;
- }
-
- UpdateIndex.prototype.run = function (file) {
- if (path.basename(file) !== 'index.md.html') {
- return false;
- }
-
- if (this.options.verbose > 1) {
- console.info('Update index');
- }
-
- var $ = cheerio.load(fs.readFileSync(file));
- var title_target;
- title_target = $('#subheader > h1');
- if (title_target.length !== 0) {
- title_target = $(title_target[0]);
- title_target.text(header_title);
- }
-
- fs.writeFileSync(file, $.html());
- fs.renameSync(file, path.join(path.dirname(file), 'index.html'));
- return true;
- };
-
- return UpdateIndex;
-}());
-module.exports = UpdateIndex;
diff --git a/tools/lib/cordova/post/updatekeywordindex.js b/tools/lib/cordova/post/updatekeywordindex.js
deleted file mode 100644
index 3b4503b..0000000
--- a/tools/lib/cordova/post/updatekeywordindex.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.
-*/
-/* jslint node: true */
-var fs = require('fs-extra');
-var path = require('path');
-var cheerio = require('cheerio');
-
-/**
-* Preprocessor which updates top stripe with header or the page.
-*/
-var UpdateKeywordIndex = (function () {
- 'use strict';
- var header_title = 'Keyword Index';
- var content_title = 'Keyword Index';
-
- /**
- * Creates a new instance of FileMerger
- * @param options Options for the generation process.
- */
- function UpdateKeywordIndex (options) {
- this.options = options || { verbose: 0 };
- this.stage = 'Update keywork index';
- this.header_title = header_title;
- this.content_title = content_title;
- }
-
- UpdateKeywordIndex.prototype.run = function (file) {
- if (path.basename(file) !== '_index.html') {
- return false;
- }
-
- if (this.options.verbose > 1) {
- console.info('Update keyword index');
- }
-
- var $ = cheerio.load(fs.readFileSync(file));
- var element;
- var content;
- element = $('#subheader > h1');
- if (element.length !== 0) {
- element = $(element[0]);
- element.text(header_title);
- }
-
- element = $('#content > h1');
- if (element.length !== 0) {
- element = $(element[0]);
- element.text(content_title);
- }
-
- element = $('#content > hr');
- if (element.length !== 0) {
- element = $(element[0]);
- element.remove();
- }
-
- content = $.html();
- content = content.replace(/"index\.md\.html/g, '"index.html');
- fs.writeFileSync(file, content);
- };
-
- return UpdateKeywordIndex;
-}());
-module.exports = UpdateKeywordIndex;
diff --git a/tools/lib/cordova/post/versionmenu.js b/tools/lib/cordova/post/versionmenu.js
deleted file mode 100644
index 07d693e..0000000
--- a/tools/lib/cordova/post/versionmenu.js
+++ /dev/null
@@ -1,180 +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.
-*/
-/* jslint node: true */
-var fs = require('fs-extra');
-var path = require('path');
-var cheerio = require('cheerio');
-
-/**
-* Preprocessor which updates top stripe with header or the page.
-*/
-var VersionMenu = (function () {
- 'use strict';
- var languages = null;
- var versions = null;
-
- /**
- * Creates a new instance of FileMerger
- * @param options Options for the generation process.
- */
- function VersionMenu (options) {
- this.options = options || { verbose: 0 };
- this.stage = 'Populate version menu';
- if (languages === null) {
- languages = [];
- versions = {};
- this.buildVersionsData();
- }
-
- this.generatedMenu = this.generateMenu();
- this.generatedLanguageMenu = this.generateLanguageMenu();
- }
-
- VersionMenu.prototype.run = function (file, $) {
- if (path.extname(file) !== '.html') {
- return;
- }
-
- if (this.options.verbose > 1) {
- console.info('Building version menu for file ' + file);
- }
-
- var element,
- scriptTag,
- currentPageSettings;
-
- element = $('#header small select#language').first();
- this.generatedLanguageMenu.forEach(function (optionGroup) {
- element.append(optionGroup).append('\n');
- });
- element = $('head').first();
- currentPageSettings = {
- lang: this.options.lang,
- version: this.options.version
- };
- scriptTag = cheerio('<script></script>');
- scriptTag.text('var settings = ' + JSON.stringify(currentPageSettings) + ';');
- element.append(scriptTag);
- };
-
- VersionMenu.prototype.buildVersionsData = function () {
- var docs_path = path.resolve(path.join(module.filename, '..', '..', '..', '..', 'docs'));
- var lang_dirs;
- var lang_labels = [];
-
- lang_dirs = fs.readdirSync(docs_path);
- lang_dirs.forEach(function (lang) {
- versions[lang] = [];
- var lang_dir = path.join(docs_path, lang);
- var version_dirs;
- version_dirs = fs.readdirSync(lang_dir);
- version_dirs.forEach(function (version) {
- var configFile = path.join(lang_dir, version, 'config.json');
- var configData = JSON.parse(fs.readFileSync(configFile));
- versions[lang].push(version);
- lang_labels[lang] = configData.language;
- });
-
- languages.push({ lang: lang, label: lang_labels[lang] });
- });
- languages = languages.sort(function (a, b) {
- if (a.label === b.label) {
- return 0;
- }
-
- if (a.label > b.label) {
- return 1;
- }
-
- return -1;
- });
- };
-
- VersionMenu.prototype.generateMenu = function () {
- var result = [];
- var langGroup;
- var versionData;
- var versionOption;
- var lang;
- var versionIndex;
- var version;
- var mapper;
- var key;
-
- mapper = function (item) {
- return item;
- };
-
- for (key in languages) {
- if (languages.hasOwnProperty(key)) {
- lang = languages[key].lang;
- langGroup = cheerio('<optgroup></optgroup>');
- langGroup.append('\n');
- langGroup.attr('label', languages[key].label);
- langGroup.attr('value', lang);
-
- versionData = versions[lang].map(mapper).reverse();
- for (versionIndex = 0; versionIndex < versionData.length; versionIndex = versionIndex + 1) {
- version = versionData[versionIndex];
- versionOption = cheerio('<option></option>');
- if (this.options.version === version && this.options.lang === lang) {
- versionOption.attr('selected', 'selected');
- }
-
- versionOption.attr('value', version);
- versionOption.text(version);
- langGroup.append(versionOption).append('\n');
- }
-
- result.push(langGroup);
- }
- }
-
- return result;
- };
-
- VersionMenu.prototype.generateLanguageMenu = function () {
- var result = [];
- var langGroup;
- var lang;
- var mapper; // eslint-disable-line
- var key;
-
- mapper = function (item) {
- return item;
- };
-
- for (key in languages) {
- if (languages.hasOwnProperty(key)) {
- lang = languages[key].lang;
- langGroup = cheerio('<option></option>');
- langGroup.append('\n');
- langGroup.attr('label', languages[key].label);
- langGroup.attr('value', lang);
-
- result.push(langGroup);
- }
- }
-
- return result;
- };
-
- return VersionMenu;
-}());
-module.exports = VersionMenu;
diff --git a/tools/lib/cordova/pre/filemerger.js b/tools/lib/cordova/pre/filemerger.js
deleted file mode 100644
index b8f8a61..0000000
--- a/tools/lib/cordova/pre/filemerger.js
+++ /dev/null
@@ -1,109 +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.
-*/
-/* jslint node: true */
-var fs = require('fs-extra');
-var path = require('path');
-var FileHelpers = require('../../file_helpers');
-
-var FileMerger = (function () {
- 'use strict';
-
- var config = null;
-
- /**
- * Creates a new instance of FileMerger
- * @param options Options for the generation process.
- */
- function FileMerger (options) {
- this.options = options || { verbose: 0 };
- this.stage = 'Merge files';
-
- config = null;
- }
-
- FileMerger.prototype.run = function (file) {
- if (this.options.verbose > 1) {
- console.log('Merge file ' + file);
- }
-
- if (file.match(/\/guide\//)) {
- return null;
- }
-
- if (!fs.existsSync(file)) {
- return null;
- }
-
- this.filename = path.basename(file);
- this.directory = path.dirname(file);
-
- var filesToAppend;
- var cfg = this.config();
- var i;
- var filepath;
- if (!cfg.hasOwnProperty(this.filename)) {
- return null;
- }
-
- filesToAppend = cfg[this.filename];
- for (i = 0; i < filesToAppend.length; i += 1) {
- filepath = filesToAppend[i];
-
- // skip the file that we're merging into because it's listed in config.json
- if (path.basename(filepath) === this.filename) {
- if (this.options.verbose > 0) {
- console.log('Skipping ' + filesToAppend[i] + ' from ' + this.filename + ' section since it has same base name as file to merge');
- }
- } else {
- filepath = path.join(FileHelpers.getTmpDirectory(), 'docs', filepath);
- fs.appendFileSync(file, '\n\n---\n');
- if (!fs.existsSync(filepath)) {
- console.log('File ' + filepath + " is missing and thus don't merged with " + file);
- } else {
- fs.appendFileSync(file, fs.readFileSync(filepath, 'utf-8').trim());
- fs.removeSync(filepath);
- }
- }
- }
- };
-
- FileMerger.prototype.config = function () {
- if (config !== null) {
- return config;
- }
-
- var directory = this.directory;
- var file;
- var configJSON;
- while (config === null) {
- file = path.join(directory, 'config.json');
- if (fs.existsSync(file)) {
- configJSON = fs.readFileSync(file);
- config = JSON.parse(configJSON).merge;
- } else {
- directory = fs.dirname(directory);
- }
- }
-
- return config;
- };
-
- return FileMerger;
-}());
-module.exports = FileMerger;
diff --git a/tools/lib/cordova/pre/index.js b/tools/lib/cordova/pre/index.js
deleted file mode 100644
index 7a3c588..0000000
--- a/tools/lib/cordova/pre/index.js
+++ /dev/null
@@ -1,22 +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.
-*/
-/* jslint node: true */
-var FileMerger = require('./filemerger');
-var YamlFrontMatter = require('./yamlfrontmatter');
-module.exports = [YamlFrontMatter, FileMerger];
diff --git a/tools/lib/cordova/pre/yamlfrontmatter.js b/tools/lib/cordova/pre/yamlfrontmatter.js
deleted file mode 100644
index c75028d..0000000
--- a/tools/lib/cordova/pre/yamlfrontmatter.js
+++ /dev/null
@@ -1,66 +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.
-*/
-/* jslint node: true */
-var fs = require('fs-extra');
-var yaml = require('js-yaml');
-
-var YamlFrontMatter = (function () {
- 'use strict';
-
- /**
- * Creates a new instance of FileMerger
- * @param options Options for the generation process.
- */
- function YamlFrontMatter (options) {
- this.options = options || { verbose: 0 };
- this.stage = 'Starting YAML stripping';
- }
-
- YamlFrontMatter.prototype.run = function (file) {
- if (this.options.verbose > 1) {
- console.log('String YAML from file ' + file);
- }
-
- var content = fs.readFileSync(file, 'utf8');
- var yamlRegexStripper = /^(---\s*\n[\s\S]*?\n?)^(---\s*$\n?)/m;
- var match = yamlRegexStripper.exec(content);
- var yamlData;
- if (match === null) {
- return {};
- }
-
- try {
- yamlData = yaml.safeLoad(match[1]);
- } catch (yamle) {
- console.error('File: ' + file);
- if (this.options.verbose > 1) {
- console.error('YAML Exception during processing following content:\n' + content);
- }
-
- throw yamle;
- }
-
- content = content.substr(match[0].length);
- fs.writeFileSync(file, content);
- return yamlData;
- };
-
- return YamlFrontMatter;
-}());
-module.exports = YamlFrontMatter;
diff --git a/tools/lib/file_helpers.js b/tools/lib/file_helpers.js
deleted file mode 100644
index 8c92bf0..0000000
--- a/tools/lib/file_helpers.js
+++ /dev/null
@@ -1,58 +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.
-*/
-/* jslint node: true */
-var path = require('path');
-
-var FileHelpers = (function () {
- 'use strict';
-
- var FileHelpers = {};
-
- /**
- * Gets default directory for source files.
- */
- FileHelpers.getDefaultInputDirectory = function () {
- return path.join(FileHelpers.getRootDirectory(), 'docs');
- };
-
- /**
- * Gets default directory for final output.
- * @remarks Right now used non default folder, to not mix with Ruby implementation.
- */
- FileHelpers.getDefaultOutputDirectory = function () {
- return path.join(FileHelpers.getRootDirectory(), 'public');
- };
-
- /**
- * Gets temporary directory, where files will be processed.
- */
- FileHelpers.getTmpDirectory = function () {
- return path.join(FileHelpers.getRootDirectory(), 'tmp');
- };
-
- /**
- * Gets absolute path for the Cordova Docs root directory
- */
- FileHelpers.getRootDirectory = function () {
- return path.resolve(path.join(path.dirname(module.filename), '..'));
- };
-
- return FileHelpers;
-}());
-module.exports = FileHelpers;
diff --git a/tools/spec/.eslintrc.yaml b/tools/spec/.eslintrc.yaml
deleted file mode 100644
index 6afba65..0000000
--- a/tools/spec/.eslintrc.yaml
+++ /dev/null
@@ -1,2 +0,0 @@
-env:
- jasmine: true
\ No newline at end of file
diff --git a/tools/spec/cordova/add_title_spec.js b/tools/spec/cordova/add_title_spec.js
deleted file mode 100644
index 9d48e91..0000000
--- a/tools/spec/cordova/add_title_spec.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.
-*/
-/* jslint node: true */
-/* global describe, it, beforeEach, afterEach, after, before */
-(function () {
- 'use strict';
- var AddTitle = require('../../lib/cordova/post/addtitle');
- var assert = require('assert');
- var path = require('path');
- var fs = require('fs');
- var cheerio = require('cheerio');
- var SpecHelpers = require('../spec_helpers');
-
- describe('AddTitle', function () {
- var sut;
- var files;
-
- before(function (done) {
- var tmp_directory = SpecHelpers.create_tmp_directory_assets(module.filename);
- sut = new AddTitle();
- files = {
- 'normal': path.join(tmp_directory, 'example.html'),
- 'no_source': path.join(tmp_directory, 'example_no_source.html'),
- 'no_target': path.join(tmp_directory, 'example_no_target.html')
- };
- done();
- });
-
- after(function (done) {
- SpecHelpers.remove_tmp_directory();
- done();
- });
-
- it('should set the title', function () {
- var testing_file = files.normal;
- var dom = cheerio.load(fs.readFileSync(testing_file));
- var result = sut.run(testing_file, dom);
- assert.strictEqual('Accelerometer', result);
- assert.strictEqual('Accelerometer', dom('#subheader > h1').first().html());
- });
-
- it('should skip files with no source title', function () {
- var dom = cheerio.load(fs.readFileSync(files.no_source));
- var result = sut.run(files.no_source, dom);
- assert.strictEqual(null, result);
- });
-
- it('should skip files with no target title', function () {
- var dom = cheerio.load(fs.readFileSync(files.no_target));
- var result = sut.run(files.no_target, dom);
- assert.strictEqual(null, result);
- });
- });
-}());
diff --git a/tools/spec/cordova/add_title_spec/example.html b/tools/spec/cordova/add_title_spec/example.html
deleted file mode 100644
index 9918a71..0000000
--- a/tools/spec/cordova/add_title_spec/example.html
+++ /dev/null
@@ -1,547 +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.
--->
-
-<!DOCTYPE html>
-<html lang="en">
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
- <meta name="viewport" content="initial-scale=1.0, maximum-scale=1.0, user-scalable=no, width=device-width">
- <meta name="generator" content="joDoc">
- <link rel="stylesheet" type="text/css" href="index.css">
- <title>PhoneGap API Documentation</title>
- </head>
- <body>
-
- <div id="header">
- <h1>Phone<strong>Gap</strong> Documentation</h1>
- <small></small>
- </div>
- <div id="subheader">
- <h1>[ Object Title Goes Here ]</h1>
- <small>
- <select>
- <option>Quick Jump...</option>
- <option>Geolocation</option>
- <option>getCurrentPosition</option>
- <option> - Description</option>
- <option> - Quick Example</option>
- <option> - Full Example</option>
- <option> - iPhone Quirks</option>
- <option>watchPosition</option>
- <option> - Description</option>
- <option> - Quick Example</option>
- <option> - Full Example</option>
- <option> - iPhone Quirks</option>
- <option>clearWatch</option>
- <option> - Description</option>
- <option> - Quick Example</option>
- <option> - Full Example</option>
- <option> - iPhone Quirks</option>
- </select>
- </small>
- </div>
-
- <div id="sidebar">
- <div class="vertical_divider"></div>
- <h1>API Reference</h1>
- <ul>
- <li><a href="phonegap_accelerometer_accelerometer.md.html">Accelerometer</a></li>
- <li><a href="phonegap_camera_camera.md.html">Camera</a></li>
- <li><a href="phonegap_device_device.md.html">Device</a></li>
- <li><a href="phonegap_events_events.md.html">Events</a></li>
- <li><a href="phonegap_geolocation_geolocation.md.html">Geolocation</a></li>
- <li><a href="phonegap_notification_notification.md.html">Notification</a></li>
- </ul>
- </div>
-
- <div id="content">
- <h1><a name="Accelerometer">Accelerometer</a></h1>
-
-<blockquote>
- <p>Captures device motion in the x, y, and z direction.</p>
-</blockquote>
-
-<h2>Methods</h2>
-
-<ul>
-<li><a href="phonegap_accelerometer_accelerometer.md.html#accelerometer.getCurrentAcceleration">accelerometer.getCurrentAcceleration</a></li>
-<li><a href="phonegap_accelerometer_accelerometer.md.html#accelerometer.watchAcceleration">accelerometer.watchAcceleration</a></li>
-<li><a href="phonegap_accelerometer_accelerometer.md.html#accelerometer.clearWatch">accelerometer.clearWatch</a></li>
-</ul>
-
-<h2>Arguments</h2>
-
-<ul>
-<li><a href="phonegap_accelerometer_accelerometer.md.html#accelerometerSuccess">accelerometerSuccess</a></li>
-<li><a href="phonegap_accelerometer_accelerometer.md.html#accelerometerError">accelerometerError</a></li>
-<li><a href="phonegap_accelerometer_accelerometer.md.html#accelerometerOptions">accelerometerOptions</a></li>
-</ul>
-
-<h2>Objects (Read-Only)</h2>
-
-<ul>
-<li><a href="phonegap_accelerometer_accelerometer.md.html#Acceleration">Acceleration</a></li>
-</ul>
-
-<hr />
-
-<h1><a name="accelerometer.getCurrentAcceleration">accelerometer.getCurrentAcceleration</a></h1>
-
-<p>Get the current acceleration along the x, y, and z axis.</p>
-
-<pre><code>navigator.accelerometer.getCurrentAcceleration(<a href="phonegap_accelerometer_accelerometer.md.html#accelerometerSuccess">accelerometerSuccess</a>, <a href="phonegap_accelerometer_accelerometer.md.html#accelerometerError">accelerometerError</a>);
-</code></pre>
-
-<h2>Description</h2>
-
-<p>The accelerometer is a motion sensor that detects the change (delta) in movement relative to the current position. The accelerometer can detect 3D movement along the x, y, and z axis.</p>
-
-<p>The acceleration is returned using the <code><a href="phonegap_accelerometer_accelerometer.md.html#accelerometerSuccess">accelerometerSuccess</a></code> callback function.</p>
-
-<h2>Supported Platforms</h2>
-
-<ul>
-<li>iPhone</li>
-</ul>
-
-<h2>Quick Example</h2>
-
-<pre><code>function onSuccess(acceleration) {
- alert('<a href="phonegap_accelerometer_accelerometer.md.html#Acceleration">Acceleration</a> X: ' + acceleration.x + '\n' +
- '<a href="phonegap_accelerometer_accelerometer.md.html#Acceleration">Acceleration</a> Y: ' + acceleration.y + '\n' +
- '<a href="phonegap_accelerometer_accelerometer.md.html#Acceleration">Acceleration</a> Z: ' + acceleration.z + '\n';
-};
-
-function onError() {
- alert('onError!');
-};
-
-navigator.<a href="phonegap_accelerometer_accelerometer.md.html#accelerometer.getCurrentAcceleration">accelerometer.getCurrentAcceleration</a>(onSuccess, onError);
-</code></pre>
-
-<h2>Full Example</h2>
-
-<pre><code><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
- "http://www.w3.org/TR/html4/strict.dtd">
-<html>
- <head>
- <title><a href="phonegap_accelerometer_accelerometer.md.html#Acceleration">Acceleration</a> Example</title>
-
- <script type="text/javascript" charset="utf-8" src="phonegap.js"></script>
- <script type="text/javascript" charset="utf-8">
-
- // Wait for PhoneGap to load
- //
- function onLoad() {
- document.addEventListener("<a href="phonegap_events_events.md.html#deviceready">deviceready</a>", onDeviceReady, false);
- }
-
- // PhoneGap is ready
- //
- function onDeviceReady() {
- navigator.<a href="phonegap_accelerometer_accelerometer.md.html#accelerometer.getCurrentAcceleration">accelerometer.getCurrentAcceleration</a>(onSuccess, onError);
- }
-
- // onSuccess: Get a snapshot of the current acceleration
- //
- function onSuccess(acceleration) {
- alert('<a href="phonegap_accelerometer_accelerometer.md.html#Acceleration">Acceleration</a> X: ' + acceleration.x + '\n' +
- '<a href="phonegap_accelerometer_accelerometer.md.html#Acceleration">Acceleration</a> Y: ' + acceleration.y + '\n' +
- '<a href="phonegap_accelerometer_accelerometer.md.html#Acceleration">Acceleration</a> Z: ' + acceleration.z + '\n');
- }
-
- // onError: Failed to get the acceleration
- //
- function onError() {
- alert('onError!');
- }
-
- </script>
- </head>
- <body onload="onLoad()">
- <h1>Example</h1>
- <p>getCurrentAcceleration</p>
- </body>
-</html>
-</code></pre>
-
-<h2>iPhone Quirks</h2>
-
-<ul>
-<li>iPhone doesn't have the concept of getting the current acceleration at any given point.</li>
-<li>You must watch the acceleration and capture the data at given time intervals.</li>
-<li>Thus, the <code>getCurrentAcceleration</code> function will give you the last value reported from a phoneGap <code>watchAccelerometer</code> call.</li>
-</ul>
-
-<hr />
-
-<h1><a name="accelerometer.watchAcceleration">accelerometer.watchAcceleration</a></h1>
-
-<p>At a regular interval, get the acceleration along the x, y, and z axis.</p>
-
-<pre><code>var watchID = navigator.accelerometer.watchAcceleration(<a href="phonegap_accelerometer_accelerometer.md.html#accelerometerSuccess">accelerometerSuccess</a>,
- <a href="phonegap_accelerometer_accelerometer.md.html#accelerometerError">accelerometerError</a>,
- [<a href="phonegap_accelerometer_accelerometer.md.html#accelerometerOptions">accelerometerOptions</a>]);
-</code></pre>
-
-<h2>Description</h2>
-
-<p>The accelerometer is a motion sensor that detects the change (delta) in movement relative to the current position. The accelerometer can detect 3D movement along the x, y, and z axis.</p>
-
-<p>The <code><a href="phonegap_accelerometer_accelerometer.md.html#accelerometer.watchAcceleration">accelerometer.watchAcceleration</a></code> gets the device's current acceleration at a regular interval. Each time the <code><a href="phonegap_accelerometer_accelerometer.md.html#Acceleration">Acceleration</a></code> is retrieved, the <code><a href="phonegap_accelerometer_accelerometer.md.html#accelerometerSuccess">accelerometerSuccess</a></code> callback function is executed. Specify the interval in milliseconds via the <code>frequency</code> parameter in the <code>acceleratorOptions</code> object.</p>
-
-<p>The returned watch ID references references the accelerometer watch interval. The watch ID can be used with <code><a href="phonegap_accelerometer_accelerometer.md.html#accelerometer.clearWatch">accelerometer.clearWatch</a></code> to stop watching the accelerometer.</p>
-
-<h2>Supported Platforms</h2>
-
-<ul>
-<li>iPhone</li>
-</ul>
-
-<h2>Quick Example</h2>
-
-<pre><code>function onSuccess(acceleration) {
- alert('<a href="phonegap_accelerometer_accelerometer.md.html#Acceleration">Acceleration</a> X: ' + acceleration.x + '\n' +
- '<a href="phonegap_accelerometer_accelerometer.md.html#Acceleration">Acceleration</a> Y: ' + acceleration.y + '\n' +
- '<a href="phonegap_accelerometer_accelerometer.md.html#Acceleration">Acceleration</a> Z: ' + acceleration.z + '\n');
-};
-
-function onError() {
- alert('onError!');
-};
-
-var options = { frequency: 3000 }; // Update every 3 seconds
-
-var watchID = navigator.<a href="phonegap_accelerometer_accelerometer.md.html#accelerometer.watchAcceleration">accelerometer.watchAcceleration</a>(onSuccess, onError, options);
-</code></pre>
-
-<h2>Full Example</h2>
-
-<pre><code><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
- "http://www.w3.org/TR/html4/strict.dtd">
-<html>
- <head>
- <title><a href="phonegap_accelerometer_accelerometer.md.html#Acceleration">Acceleration</a> Example</title>
-
- <script type="text/javascript" charset="utf-8" src="phonegap.js"></script>
- <script type="text/javascript" charset="utf-8">
-
- // The watch id references the current `watchAcceleration`
- var watchID = null;
-
- // Wait for PhoneGap to load
- //
- function onLoad() {
- document.addEventListener("<a href="phonegap_events_events.md.html#deviceready">deviceready</a>", onDeviceReady, false);
- }
-
- // PhoneGap is ready
- //
- function onDeviceReady() {
- startWatch();
- }
-
- // Start watching the acceleration
- //
- function startWatch() {
-
- // Update acceleration every 3 seconds
- var options = { frequency: 3000 };
-
- watchID = navigator.<a href="phonegap_accelerometer_accelerometer.md.html#accelerometer.watchAcceleration">accelerometer.watchAcceleration</a>(onSuccess, onError, options);
- }
-
- // Stop watching the acceleration
- //
- function stopWatch() {
- if (watchID) {
- navigator.<a href="phonegap_accelerometer_accelerometer.md.html#accelerometer.clearWatch">accelerometer.clearWatch</a>(watchID);
- watchID = null;
- }
- }
-
- // onSuccess: Get a snapshot of the current acceleration
- //
- function onSuccess(acceleration) {
- var element = document.getElementById('accelerometer');
- element.innerHTML = '<a href="phonegap_accelerometer_accelerometer.md.html#Acceleration">Acceleration</a> X: ' + acceleration.x + '<br />' +
- '<a href="phonegap_accelerometer_accelerometer.md.html#Acceleration">Acceleration</a> Y: ' + acceleration.y + '<br />' +
- '<a href="phonegap_accelerometer_accelerometer.md.html#Acceleration">Acceleration</a> Z: ' + acceleration.z + '<br />';
- }
-
- // onError: Failed to get the acceleration
- //
- function onError() {
- alert('onError!');
- }
-
- </script>
- </head>
- <body onload="onLoad()">
- <div id="accelerometer">Waiting for accelerometer...</div>
- </body>
-</html>
-</code></pre>
-
-<h2> iPhone Quirks</h2>
-
-<ul>
-<li>At the interval requested, PhoneGap will call the success callback function and pass the accelerometer results.</li>
-<li>However, in requests to the device PhoneGap restricts the interval to minimum of every 40ms and a maximum of every 1000ms.
-<ul>
-<li>For example, if you request an interval of 3 seconds (3000ms), PhoneGap will request an interval of 1 second from the device but invoke the success callback at the requested interval of 3 seconds.</li>
-</ul></li>
-</ul>
-
-<hr />
-
-<h1><a name="accelerometer.clearWatch">accelerometer.clearWatch</a></h1>
-
-<p>Stop watching the <code><a href="phonegap_accelerometer_accelerometer.md.html#Acceleration">Acceleration</a></code> referenced by the watch ID parameter.</p>
-
-<pre><code>navigator.<a href="phonegap_accelerometer_accelerometer.md.html#accelerometer.clearWatch">accelerometer.clearWatch</a>(watchID);
-</code></pre>
-
-<ul>
-<li><strong>watchID</strong>: The ID returned by <code><a href="phonegap_accelerometer_accelerometer.md.html#accelerometer.watchAcceleration">accelerometer.watchAcceleration</a></code>.</li>
-</ul>
-
-<h2>Supported Platforms</h2>
-
-<ul>
-<li>iPhone</li>
-</ul>
-
-<h2>Quick Example</h2>
-
-<pre><code>var watchID = navigator.<a href="phonegap_accelerometer_accelerometer.md.html#accelerometer.watchAcceleration">accelerometer.watchAcceleration</a>(onSuccess, onError, options);
-
-// ... later on ...
-
-navigator.<a href="phonegap_accelerometer_accelerometer.md.html#accelerometer.clearWatch">accelerometer.clearWatch</a>(watchID);
-</code></pre>
-
-<h2>Full Example</h2>
-
-<pre><code><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
- "http://www.w3.org/TR/html4/strict.dtd">
-<html>
- <head>
- <title><a href="phonegap_accelerometer_accelerometer.md.html#Acceleration">Acceleration</a> Example</title>
-
- <script type="text/javascript" charset="utf-8" src="phonegap.js"></script>
- <script type="text/javascript" charset="utf-8">
-
- // The watch id references the current `watchAcceleration`
- var watchID = null;
-
- // Wait for PhoneGap to load
- //
- function onLoad() {
- document.addEventListener("<a href="phonegap_events_events.md.html#deviceready">deviceready</a>", onDeviceReady, false);
- }
-
- // PhoneGap is ready
- //
- function onDeviceReady() {
- startWatch();
- }
-
- // Start watching the acceleration
- //
- function startWatch() {
-
- // Update acceleration every 3 seconds
- var options = { frequency: 3000 };
-
- watchID = navigator.<a href="phonegap_accelerometer_accelerometer.md.html#accelerometer.watchAcceleration">accelerometer.watchAcceleration</a>(onSuccess, onError, options);
- }
-
- // Stop watching the acceleration
- //
- function stopWatch() {
- if (watchID) {
- navigator.<a href="phonegap_accelerometer_accelerometer.md.html#accelerometer.clearWatch">accelerometer.clearWatch</a>(watchID);
- watchID = null;
- }
- }
-
- // onSuccess: Get a snapshot of the current acceleration
- //
- function onSuccess(acceleration) {
- var element = document.getElementById('accelerometer');
- element.innerHTML = '<a href="phonegap_accelerometer_accelerometer.md.html#Acceleration">Acceleration</a> X: ' + acceleration.x + '<br />' +
- '<a href="phonegap_accelerometer_accelerometer.md.html#Acceleration">Acceleration</a> Y: ' + acceleration.y + '<br />' +
- '<a href="phonegap_accelerometer_accelerometer.md.html#Acceleration">Acceleration</a> Z: ' + acceleration.z + '<br />';
- }
-
- // onError: Failed to get the acceleration
- //
- function onError() {
- alert('onError!');
- }
-
- </script>
- </head>
- <body onload="onLoad()">
- <div id="accelerometer">Waiting for accelerometer...</div>
- <button onclick="stopWatch();">Stop Watching</button>
- </body>
-</html>
-</code></pre>
-
-<hr />
-
-<h1><a name="Acceleration">Acceleration</a></h1>
-
-<p>Contains <code><a href="phonegap_accelerometer_accelerometer.md.html#Accelerometer">Accelerometer</a></code> data captured at a specific point in time.</p>
-
-<h2>Properties</h2>
-
-<ul>
-<li><strong>x:</strong> Amount of motion on the x-axis. Range [0, 1] (<code>Number</code>)</li>
-<li><strong>y:</strong> Amount of motion on the y-axis. Range [0, 1] (<code>Number</code>)</li>
-<li><strong>z:</strong> Amount of motion on the z-axis. Range [0, 1] (<code>Number</code>)</li>
-<li><strong>timestamp:</strong> Creation timestamp in milliseconds. (<code>DOMTimeStamp</code>)</li>
-</ul>
-
-<h2>Description</h2>
-
-<p>This object is created and populated by PhoneGap, and returned by an <code><a href="phonegap_accelerometer_accelerometer.md.html#Accelerometer">Accelerometer</a></code> method.</p>
-
-<h2>Supported Platforms</h2>
-
-<ul>
-<li>Untested</li>
-</ul>
-
-<h2>Quick Example</h2>
-
-<pre><code>function onSuccess(acceleration) {
- alert('<a href="phonegap_accelerometer_accelerometer.md.html#Acceleration">Acceleration</a> X: ' + acceleration.x + '\n' +
- '<a href="phonegap_accelerometer_accelerometer.md.html#Acceleration">Acceleration</a> Y: ' + acceleration.y + '\n' +
- '<a href="phonegap_accelerometer_accelerometer.md.html#Acceleration">Acceleration</a> Z: ' + acceleration.z + '\n';
-};
-
-function onError() {
- alert('onError!');
-};
-
-navigator.<a href="phonegap_accelerometer_accelerometer.md.html#accelerometer.getCurrentAcceleration">accelerometer.getCurrentAcceleration</a>(onSuccess, onError);
-</code></pre>
-
-<h2>Full Example</h2>
-
-<pre><code><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
- "http://www.w3.org/TR/html4/strict.dtd">
-<html>
- <head>
- <title><a href="phonegap_accelerometer_accelerometer.md.html#Acceleration">Acceleration</a> Example</title>
-
- <script type="text/javascript" charset="utf-8" src="phonegap.js"></script>
- <script type="text/javascript" charset="utf-8">
-
- // Wait for PhoneGap to load
- //
- function onLoad() {
- document.addEventListener("<a href="phonegap_events_events.md.html#deviceready">deviceready</a>", onDeviceReady, false);
- }
-
- // PhoneGap is ready
- //
- function onDeviceReady() {
- navigator.<a href="phonegap_accelerometer_accelerometer.md.html#accelerometer.getCurrentAcceleration">accelerometer.getCurrentAcceleration</a>(onSuccess, onError);
- }
-
- // onSuccess: Get a snapshot of the current acceleration
- //
- function onSuccess() {
- alert('<a href="phonegap_accelerometer_accelerometer.md.html#Acceleration">Acceleration</a> X: ' + acceleration.x + '\n' +
- '<a href="phonegap_accelerometer_accelerometer.md.html#Acceleration">Acceleration</a> Y: ' + acceleration.y + '\n' +
- '<a href="phonegap_accelerometer_accelerometer.md.html#Acceleration">Acceleration</a> Z: ' + acceleration.z + '\n';
- }
-
- // onError: Failed to get the acceleration
- //
- function onError() {
- alert('onError!');
- }
-
- </script>
- </head>
- <body onload="onLoad()">
- <h1>Example</h1>
- <p>getCurrentAcceleration</p>
- </body>
-</html>
-</code></pre>
-
-<hr />
-
-<h1><a name="accelerometerSuccess">accelerometerSuccess</a></h1>
-
-<p>onSuccess callback function that provides the <a href="phonegap_accelerometer_accelerometer.md.html#Acceleration">Acceleration</a> information.</p>
-
-<pre><code>function(acceleration) {
- // Do something
-}
-</code></pre>
-
-<h2>Parameters</h2>
-
-<ul>
-<li><strong>acceleration:</strong> The acceleration at a single moment in time. (<a href="phonegap_accelerometer_accelerometer.md.html#Acceleration">Acceleration</a>)</li>
-</ul>
-
-<h2>Example</h2>
-
-<pre><code>function onSuccess(acceleration) {
- alert('<a href="phonegap_accelerometer_accelerometer.md.html#Acceleration">Acceleration</a> X: ' + acceleration.x + '\n' +
- '<a href="phonegap_accelerometer_accelerometer.md.html#Acceleration">Acceleration</a> Y: ' + acceleration.y + '\n' +
- '<a href="phonegap_accelerometer_accelerometer.md.html#Acceleration">Acceleration</a> Z: ' + acceleration.z + '\n';
-};
-</code></pre>
-
-<hr />
-
-<h1><a name="accelerometerError">accelerometerError</a></h1>
-
-<p>onError callback function for acceleration functions.</p>
-
-<pre><code>function() {
- // Handle the error
-}
-</code></pre>
-
-<hr />
-
-<h1><a name="accelerometerOptions">accelerometerOptions</a></h1>
-
-<p>An optional parameter to customize the retrieval of the accelerometer.</p>
-
-<h2>Options</h2>
-
-<ul>
-<li><strong>frequency:</strong> How often to retrieve the <code><a href="phonegap_accelerometer_accelerometer.md.html#Acceleration">Acceleration</a></code> in milliseconds. <em>(Number)</em> (Default: 10000)</li>
-</ul>
-
- </div>
-
- </body>
-</html>
\ No newline at end of file
diff --git a/tools/spec/cordova/add_title_spec/example_no_source.html b/tools/spec/cordova/add_title_spec/example_no_source.html
deleted file mode 100644
index 5b60058..0000000
--- a/tools/spec/cordova/add_title_spec/example_no_source.html
+++ /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.
--->
-
-<!DOCTYPE html>
-<html lang="en">
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
- <meta name="viewport" content="initial-scale=1.0, maximum-scale=1.0, user-scalable=no, width=device-width">
- <meta name="generator" content="joDoc">
- <link rel="stylesheet" type="text/css" href="index.css">
- <title>PhoneGap API Documentation</title>
- </head>
- <body>
- <div id="subheader">
- <h1>[ Object Title Goes Here ]</h1>
- </div>
- </body>
-</html>
\ No newline at end of file
diff --git a/tools/spec/cordova/add_title_spec/example_no_target.html b/tools/spec/cordova/add_title_spec/example_no_target.html
deleted file mode 100644
index 4610238..0000000
--- a/tools/spec/cordova/add_title_spec/example_no_target.html
+++ /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.
--->
-
-<!DOCTYPE html>
-<html lang="en">
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
- <meta name="viewport" content="initial-scale=1.0, maximum-scale=1.0, user-scalable=no, width=device-width">
- <meta name="generator" content="joDoc">
- <link rel="stylesheet" type="text/css" href="index.css">
- <title>PhoneGap API Documentation</title>
- </head>
- <body>
- <div id="content">
- <h1>Accelerometer</h1>
- </div>
- </body>
-</html>
\ No newline at end of file
diff --git a/tools/spec/cordova/prettify_spec.js b/tools/spec/cordova/prettify_spec.js
deleted file mode 100644
index 759a21d..0000000
--- a/tools/spec/cordova/prettify_spec.js
+++ /dev/null
@@ -1,60 +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.
-*/
-/* jslint node: true */
-/* global describe, it, beforeEach, afterEach, after, before */ // eslint-disable-line no-unused-vars
-(function () {
- 'use strict';
- var assert = require('assert');
- var path = require('path');
- var fs = require('fs');
- var cheerio = require('cheerio');
- var Prettify = require('../../lib/cordova/post/prettify');
- var SpecHelpers = require('../spec_helpers');
-
- describe('Prettify', function () {
- var sut;
- var files;
-
- beforeEach(function (done) {
- var tmp_directory = SpecHelpers.create_tmp_directory_assets(module.filename);
- sut = new Prettify();
- files = {
- 'normal': path.join(tmp_directory, 'example.html')
- };
- done();
- });
-
- afterEach(function (done) {
- SpecHelpers.remove_tmp_directory();
- done();
- });
-
- it('should find some code blocks', function () {
- var dom = cheerio.load(fs.readFileSync(files.normal));
- var code_tags = sut.run(files.normal, dom);
- assert.ok(code_tags.length > 0);
- });
-
- it('should add the prettyprint class to each code block', function () {
- var dom = cheerio.load(fs.readFileSync(files.normal));
- sut.run(files.normal, dom);
- assert.ok(dom('#content pre.prettyprint').length > 0);
- });
- });
-}());
diff --git a/tools/spec/cordova/prettify_spec/example.html b/tools/spec/cordova/prettify_spec/example.html
deleted file mode 100644
index a3098fd..0000000
--- a/tools/spec/cordova/prettify_spec/example.html
+++ /dev/null
@@ -1,547 +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.
--->
-
-<!DOCTYPE html>
-<html lang="en">
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
- <meta name="viewport" content="initial-scale=1.0, maximum-scale=1.0, user-scalable=no, width=device-width">
- <meta name="generator" content="joDoc">
- <link rel="stylesheet" type="text/css" href="index.css">
- <title>PhoneGap API Documentation</title>
- </head>
- <body>
-
- <div id="header">
- <h1>Phone<strong>Gap</strong> Documentation</h1>
- <small></small>
- </div>
- <div id="subheader">
- <h1>[ Object Title Goes Here ]</h1>
- <small>
- <select>
- <option>Quick Jump...</option>
- <option>Geolocation</option>
- <option>getCurrentPosition</option>
- <option> - Description</option>
- <option> - Quick Example</option>
- <option> - Full Example</option>
- <option> - iPhone Quirks</option>
- <option>watchPosition</option>
- <option> - Description</option>
- <option> - Quick Example</option>
- <option> - Full Example</option>
- <option> - iPhone Quirks</option>
- <option>clearWatch</option>
- <option> - Description</option>
- <option> - Quick Example</option>
- <option> - Full Example</option>
- <option> - iPhone Quirks</option>
- </select>
- </small>
- </div>
-
- <div id="sidebar">
- <div class="vertical_divider"></div>
- <h1>API Reference</h1>
- <ul>
- <li><a href="phonegap_accelerometer_accelerometer.md.html">Accelerometer</a></li>
- <li><a href="phonegap_camera_camera.md.html">Camera</a></li>
- <li><a href="phonegap_device_device.md.html">Device</a></li>
- <li><a href="phonegap_events_events.md.html">Events</a></li>
- <li><a href="phonegap_geolocation_geolocation.md.html">Geolocation</a></li>
- <li><a href="phonegap_notification_notification.md.html">Notification</a></li>
- </ul>
- </div>
-
- <div id="content">
- <h1><a name="Accelerometer">Accelerometer</a></h1>
-
-<blockquote>
- <p>Captures device motion in the x, y, and z direction.</p>
-</blockquote>
-
-<h2>Methods</h2>
-
-<ul>
-<li><a href="phonegap_accelerometer_accelerometer.md.html#accelerometer.getCurrentAcceleration">accelerometer.getCurrentAcceleration</a></li>
-<li><a href="phonegap_accelerometer_accelerometer.md.html#accelerometer.watchAcceleration">accelerometer.watchAcceleration</a></li>
-<li><a href="phonegap_accelerometer_accelerometer.md.html#accelerometer.clearWatch">accelerometer.clearWatch</a></li>
-</ul>
-
-<h2>Arguments</h2>
-
-<ul>
-<li><a href="phonegap_accelerometer_accelerometer.md.html#accelerometerSuccess">accelerometerSuccess</a></li>
-<li><a href="phonegap_accelerometer_accelerometer.md.html#accelerometerError">accelerometerError</a></li>
-<li><a href="phonegap_accelerometer_accelerometer.md.html#accelerometerOptions">accelerometerOptions</a></li>
-</ul>
-
-<h2>Objects (Read-Only)</h2>
-
-<ul>
-<li><a href="phonegap_accelerometer_accelerometer.md.html#Acceleration">Acceleration</a></li>
-</ul>
-
-<hr />
-
-<h1><a name="accelerometer.getCurrentAcceleration">accelerometer.getCurrentAcceleration</a></h1>
-
-<p>Get the current acceleration along the x, y, and z axis.</p>
-
-<pre><code>navigator.accelerometer.getCurrentAcceleration(<a href="phonegap_accelerometer_accelerometer.md.html#accelerometerSuccess">accelerometerSuccess</a>, <a href="phonegap_accelerometer_accelerometer.md.html#accelerometerError">accelerometerError</a>);
-</code></pre>
-
-<h2>Description</h2>
-
-<p>The accelerometer is a motion sensor that detects the change (delta) in movement relative to the current position. The accelerometer can detect 3D movement along the x, y, and z axis.</p>
-
-<p>The acceleration is returned using the <code><a href="phonegap_accelerometer_accelerometer.md.html#accelerometerSuccess">accelerometerSuccess</a></code> callback function.</p>
-
-<h2>Supported Platforms</h2>
-
-<ul>
-<li>iPhone</li>
-</ul>
-
-<h2>Quick Example</h2>
-
-<pre><code>function onSuccess(acceleration) {
- alert('<a href="phonegap_accelerometer_accelerometer.md.html#Acceleration">Acceleration</a> X: ' + acceleration.x + '\n' +
- '<a href="phonegap_accelerometer_accelerometer.md.html#Acceleration">Acceleration</a> Y: ' + acceleration.y + '\n' +
- '<a href="phonegap_accelerometer_accelerometer.md.html#Acceleration">Acceleration</a> Z: ' + acceleration.z + '\n';
-};
-
-function onError() {
- alert('onError!');
-};
-
-navigator.<a href="phonegap_accelerometer_accelerometer.md.html#accelerometer.getCurrentAcceleration">accelerometer.getCurrentAcceleration</a>(onSuccess, onError);
-</code></pre>
-
-<h2>Full Example</h2>
-
-<pre><code><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
- "http://www.w3.org/TR/html4/strict.dtd">
-<html>
- <head>
- <title><a href="phonegap_accelerometer_accelerometer.md.html#Acceleration">Acceleration</a> Example</title>
-
- <script type="text/javascript" charset="utf-8" src="phonegap.js"></script>
- <script type="text/javascript" charset="utf-8">
-
- // Wait for PhoneGap to load
- //
- function onLoad() {
- document.addEventListener("<a href="phonegap_events_events.md.html#deviceready">deviceready</a>", onDeviceReady, false);
- }
-
- // PhoneGap is ready
- //
- function onDeviceReady() {
- navigator.<a href="phonegap_accelerometer_accelerometer.md.html#accelerometer.getCurrentAcceleration">accelerometer.getCurrentAcceleration</a>(onSuccess, onError);
- }
-
- // onSuccess: Get a snapshot of the current acceleration
- //
- function onSuccess(acceleration) {
- alert('<a href="phonegap_accelerometer_accelerometer.md.html#Acceleration">Acceleration</a> X: ' + acceleration.x + '\n' +
- '<a href="phonegap_accelerometer_accelerometer.md.html#Acceleration">Acceleration</a> Y: ' + acceleration.y + '\n' +
- '<a href="phonegap_accelerometer_accelerometer.md.html#Acceleration">Acceleration</a> Z: ' + acceleration.z + '\n');
- }
-
- // onError: Failed to get the acceleration
- //
- function onError() {
- alert('onError!');
- }
-
- </script>
- </head>
- <body onload="onLoad()">
- <h1>Example</h1>
- <p>getCurrentAcceleration</p>
- </body>
-</html>
-</code></pre>
-
-<h2>iPhone Quirks</h2>
-
-<ul>
-<li>iPhone doesn't have the concept of getting the current acceleration at any given point.</li>
-<li>You must watch the acceleration and capture the data at given time intervals.</li>
-<li>Thus, the <code>getCurrentAcceleration</code> function will give you the last value reported from a phoneGap <code>watchAccelerometer</code> call.</li>
-</ul>
-
-<hr />
-
-<h1><a name="accelerometer.watchAcceleration">accelerometer.watchAcceleration</a></h1>
-
-<p>At a regular interval, get the acceleration along the x, y, and z axis.</p>
-
-<pre><code>var watchID = navigator.accelerometer.watchAcceleration(<a href="phonegap_accelerometer_accelerometer.md.html#accelerometerSuccess">accelerometerSuccess</a>,
- <a href="phonegap_accelerometer_accelerometer.md.html#accelerometerError">accelerometerError</a>,
- [<a href="phonegap_accelerometer_accelerometer.md.html#accelerometerOptions">accelerometerOptions</a>]);
-</code></pre>
-
-<h2>Description</h2>
-
-<p>The accelerometer is a motion sensor that detects the change (delta) in movement relative to the current position. The accelerometer can detect 3D movement along the x, y, and z axis.</p>
-
-<p>The <code><a href="phonegap_accelerometer_accelerometer.md.html#accelerometer.watchAcceleration">accelerometer.watchAcceleration</a></code> gets the device's current acceleration at a regular interval. Each time the <code><a href="phonegap_accelerometer_accelerometer.md.html#Acceleration">Acceleration</a></code> is retrieved, the <code><a href="phonegap_accelerometer_accelerometer.md.html#accelerometerSuccess">accelerometerSuccess</a></code> callback function is executed. Specify the interval in milliseconds via the <code>frequency</code> parameter in the <code>acceleratorOptions</code> object.</p>
-
-<p>The returned watch ID references references the accelerometer watch interval. The watch ID can be used with <code><a href="phonegap_accelerometer_accelerometer.md.html#accelerometer.clearWatch">accelerometer.clearWatch</a></code> to stop watching the accelerometer.</p>
-
-<h2>Supported Platforms</h2>
-
-<ul>
-<li>iPhone</li>
-</ul>
-
-<h2>Quick Example</h2>
-
-<pre><code>function onSuccess(acceleration) {
- alert('<a href="phonegap_accelerometer_accelerometer.md.html#Acceleration">Acceleration</a> X: ' + acceleration.x + '\n' +
- '<a href="phonegap_accelerometer_accelerometer.md.html#Acceleration">Acceleration</a> Y: ' + acceleration.y + '\n' +
- '<a href="phonegap_accelerometer_accelerometer.md.html#Acceleration">Acceleration</a> Z: ' + acceleration.z + '\n');
-};
-
-function onError() {
- alert('onError!');
-};
-
-var options = { frequency: 3000 }; // Update every 3 seconds
-
-var watchID = navigator.<a href="phonegap_accelerometer_accelerometer.md.html#accelerometer.watchAcceleration">accelerometer.watchAcceleration</a>(onSuccess, onError, options);
-</code></pre>
-
-<h2>Full Example</h2>
-
-<pre><code><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
- "http://www.w3.org/TR/html4/strict.dtd">
-<html>
- <head>
- <title><a href="phonegap_accelerometer_accelerometer.md.html#Acceleration">Acceleration</a> Example</title>
-
- <script type="text/javascript" charset="utf-8" src="phonegap.js"></script>
- <script type="text/javascript" charset="utf-8">
-
- // The watch id references the current `watchAcceleration`
- var watchID = null;
-
- // Wait for PhoneGap to load
- //
- function onLoad() {
- document.addEventListener("<a href="phonegap_events_events.md.html#deviceready">deviceready</a>", onDeviceReady, false);
- }
-
- // PhoneGap is ready
- //
- function onDeviceReady() {
- startWatch();
- }
-
- // Start watching the acceleration
- //
- function startWatch() {
-
- // Update acceleration every 3 seconds
- var options = { frequency: 3000 };
-
- watchID = navigator.<a href="phonegap_accelerometer_accelerometer.md.html#accelerometer.watchAcceleration">accelerometer.watchAcceleration</a>(onSuccess, onError, options);
- }
-
- // Stop watching the acceleration
- //
- function stopWatch() {
- if (watchID) {
- navigator.<a href="phonegap_accelerometer_accelerometer.md.html#accelerometer.clearWatch">accelerometer.clearWatch</a>(watchID);
- watchID = null;
- }
- }
-
- // onSuccess: Get a snapshot of the current acceleration
- //
- function onSuccess(acceleration) {
- var element = document.getElementById('accelerometer');
- element.innerHTML = '<a href="phonegap_accelerometer_accelerometer.md.html#Acceleration">Acceleration</a> X: ' + acceleration.x + '<br />' +
- '<a href="phonegap_accelerometer_accelerometer.md.html#Acceleration">Acceleration</a> Y: ' + acceleration.y + '<br />' +
- '<a href="phonegap_accelerometer_accelerometer.md.html#Acceleration">Acceleration</a> Z: ' + acceleration.z + '<br />';
- }
-
- // onError: Failed to get the acceleration
- //
- function onError() {
- alert('onError!');
- }
-
- </script>
- </head>
- <body onload="onLoad()">
- <div id="accelerometer">Waiting for accelerometer...</div>
- </body>
-</html>
-</code></pre>
-
-<h2> iPhone Quirks</h2>
-
-<ul>
-<li>At the interval requested, PhoneGap will call the success callback function and pass the accelerometer results.</li>
-<li>However, in requests to the device PhoneGap restricts the interval to minimum of every 40ms and a maximum of every 1000ms.
-<ul>
-<li>For example, if you request an interval of 3 seconds (3000ms), PhoneGap will request an interval of 1 second from the device but invoke the success callback at the requested interval of 3 seconds.</li>
-</ul></li>
-</ul>
-
-<hr />
-
-<h1><a name="accelerometer.clearWatch">accelerometer.clearWatch</a></h1>
-
-<p>Stop watching the <code><a href="phonegap_accelerometer_accelerometer.md.html#Acceleration">Acceleration</a></code> referenced by the watch ID parameter.</p>
-
-<pre><code>navigator.<a href="phonegap_accelerometer_accelerometer.md.html#accelerometer.clearWatch">accelerometer.clearWatch</a>(watchID);
-</code></pre>
-
-<ul>
-<li><strong>watchID</strong>: The ID returned by <code><a href="phonegap_accelerometer_accelerometer.md.html#accelerometer.watchAcceleration">accelerometer.watchAcceleration</a></code>.</li>
-</ul>
-
-<h2>Supported Platforms</h2>
-
-<ul>
-<li>iPhone</li>
-</ul>
-
-<h2>Quick Example</h2>
-
-<pre><code>var watchID = navigator.<a href="phonegap_accelerometer_accelerometer.md.html#accelerometer.watchAcceleration">accelerometer.watchAcceleration</a>(onSuccess, onError, options);
-
-// ... later on ...
-
-navigator.<a href="phonegap_accelerometer_accelerometer.md.html#accelerometer.clearWatch">accelerometer.clearWatch</a>(watchID);
-</code></pre>
-
-<h2>Full Example</h2>
-
-<pre><code><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
- "http://www.w3.org/TR/html4/strict.dtd">
-<html>
- <head>
- <title><a href="phonegap_accelerometer_accelerometer.md.html#Acceleration">Acceleration</a> Example</title>
-
- <script type="text/javascript" charset="utf-8" src="phonegap.js"></script>
- <script type="text/javascript" charset="utf-8">
-
- // The watch id references the current `watchAcceleration`
- var watchID = null;
-
- // Wait for PhoneGap to load
- //
- function onLoad() {
- document.addEventListener("<a href="phonegap_events_events.md.html#deviceready">deviceready</a>", onDeviceReady, false);
- }
-
- // PhoneGap is ready
- //
- function onDeviceReady() {
- startWatch();
- }
-
- // Start watching the acceleration
- //
- function startWatch() {
-
- // Update acceleration every 3 seconds
- var options = { frequency: 3000 };
-
- watchID = navigator.<a href="phonegap_accelerometer_accelerometer.md.html#accelerometer.watchAcceleration">accelerometer.watchAcceleration</a>(onSuccess, onError, options);
- }
-
- // Stop watching the acceleration
- //
- function stopWatch() {
- if (watchID) {
- navigator.<a href="phonegap_accelerometer_accelerometer.md.html#accelerometer.clearWatch">accelerometer.clearWatch</a>(watchID);
- watchID = null;
- }
- }
-
- // onSuccess: Get a snapshot of the current acceleration
- //
- function onSuccess(acceleration) {
- var element = document.getElementById('accelerometer');
- element.innerHTML = '<a href="phonegap_accelerometer_accelerometer.md.html#Acceleration">Acceleration</a> X: ' + acceleration.x + '<br />' +
- '<a href="phonegap_accelerometer_accelerometer.md.html#Acceleration">Acceleration</a> Y: ' + acceleration.y + '<br />' +
- '<a href="phonegap_accelerometer_accelerometer.md.html#Acceleration">Acceleration</a> Z: ' + acceleration.z + '<br />';
- }
-
- // onError: Failed to get the acceleration
- //
- function onError() {
- alert('onError!');
- }
-
- </script>
- </head>
- <body onload="onLoad()">
- <div id="accelerometer">Waiting for accelerometer...</div>
- <button onclick="stopWatch();">Stop Watching</button>
- </body>
-</html>
-</code></pre>
-
-<hr />
-
-<h1><a name="Acceleration">Acceleration</a></h1>
-
-<p>Contains <code><a href="phonegap_accelerometer_accelerometer.md.html#Accelerometer">Accelerometer</a></code> data captured at a specific point in time.</p>
-
-<h2>Properties</h2>
-
-<ul>
-<li><strong>x:</strong> Amount of motion on the x-axis. Range [0, 1] (<code>Number</code>)</li>
-<li><strong>y:</strong> Amount of motion on the y-axis. Range [0, 1] (<code>Number</code>)</li>
-<li><strong>z:</strong> Amount of motion on the z-axis. Range [0, 1] (<code>Number</code>)</li>
-<li><strong>timestamp:</strong> Creation timestamp in milliseconds. (<code>DOMTimeStamp</code>)</li>
-</ul>
-
-<h2>Description</h2>
-
-<p>This object is created and populated by PhoneGap, and returned by an <code><a href="phonegap_accelerometer_accelerometer.md.html#Accelerometer">Accelerometer</a></code> method.</p>
-
-<h2>Supported Platforms</h2>
-
-<ul>
-<li>Untested</li>
-</ul>
-
-<h2>Quick Example</h2>
-
-<pre><code>function onSuccess(acceleration) {
- alert('<a href="phonegap_accelerometer_accelerometer.md.html#Acceleration">Acceleration</a> X: ' + acceleration.x + '\n' +
- '<a href="phonegap_accelerometer_accelerometer.md.html#Acceleration">Acceleration</a> Y: ' + acceleration.y + '\n' +
- '<a href="phonegap_accelerometer_accelerometer.md.html#Acceleration">Acceleration</a> Z: ' + acceleration.z + '\n';
-};
-
-function onError() {
- alert('onError!');
-};
-
-navigator.<a href="phonegap_accelerometer_accelerometer.md.html#accelerometer.getCurrentAcceleration">accelerometer.getCurrentAcceleration</a>(onSuccess, onError);
-</code></pre>
-
-<h2>Full Example</h2>
-
-<pre><code><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
- "http://www.w3.org/TR/html4/strict.dtd">
-<html>
- <head>
- <title><a href="phonegap_accelerometer_accelerometer.md.html#Acceleration">Acceleration</a> Example</title>
-
- <script type="text/javascript" charset="utf-8" src="phonegap.js"></script>
- <script type="text/javascript" charset="utf-8">
-
- // Wait for PhoneGap to load
- //
- function onLoad() {
- document.addEventListener("<a href="phonegap_events_events.md.html#deviceready">deviceready</a>", onDeviceReady, false);
- }
-
- // PhoneGap is ready
- //
- function onDeviceReady() {
- navigator.<a href="phonegap_accelerometer_accelerometer.md.html#accelerometer.getCurrentAcceleration">accelerometer.getCurrentAcceleration</a>(onSuccess, onError);
- }
-
- // onSuccess: Get a snapshot of the current acceleration
- //
- function onSuccess() {
- alert('<a href="phonegap_accelerometer_accelerometer.md.html#Acceleration">Acceleration</a> X: ' + acceleration.x + '\n' +
- '<a href="phonegap_accelerometer_accelerometer.md.html#Acceleration">Acceleration</a> Y: ' + acceleration.y + '\n' +
- '<a href="phonegap_accelerometer_accelerometer.md.html#Acceleration">Acceleration</a> Z: ' + acceleration.z + '\n';
- }
-
- // onError: Failed to get the acceleration
- //
- function onError() {
- alert('onError!');
- }
-
- </script>
- </head>
- <body onload="onLoad()">
- <h1>Example</h1>
- <p>getCurrentAcceleration</p>
- </body>
-</html>
-</code></pre>
-
-<hr />
-
-<h1><a name="accelerometerSuccess">accelerometerSuccess</a></h1>
-
-<p>onSuccess callback function that provides the <a href="phonegap_accelerometer_accelerometer.md.html#Acceleration">Acceleration</a> information.</p>
-
-<pre><code>function(acceleration) {
- // Do something
-}
-</code></pre>
-
-<h2>Parameters</h2>
-
-<ul>
-<li><strong>acceleration:</strong> The acceleration at a single moment in time. (<a href="phonegap_accelerometer_accelerometer.md.html#Acceleration">Acceleration</a>)</li>
-</ul>
-
-<h2>Example</h2>
-
-<pre><code>function onSuccess(acceleration) {
- alert('<a href="phonegap_accelerometer_accelerometer.md.html#Acceleration">Acceleration</a> X: ' + acceleration.x + '\n' +
- '<a href="phonegap_accelerometer_accelerometer.md.html#Acceleration">Acceleration</a> Y: ' + acceleration.y + '\n' +
- '<a href="phonegap_accelerometer_accelerometer.md.html#Acceleration">Acceleration</a> Z: ' + acceleration.z + '\n';
-};
-</code></pre>
-
-<hr />
-
-<h1><a name="accelerometerError">accelerometerError</a></h1>
-
-<p>onError callback function for acceleration functions.</p>
-
-<pre><code>function() {
- // Handle the error
-}
-</code></pre>
-
-<hr />
-
-<h1><a name="accelerometerOptions">accelerometerOptions</a></h1>
-
-<p>An optional parameter to customize the retrieval of the accelerometer.</p>
-
-<h2>Options</h2>
-
-<ul>
-<li><strong>frequency:</strong> How often to retrieve the <code><a href="phonegap_accelerometer_accelerometer.md.html#Acceleration">Acceleration</a></code> in milliseconds. <em>(Number)</em> (Default: 10000)</li>
-</ul>
-
- </div>
-
- </body>
-</html>
\ No newline at end of file
diff --git a/tools/spec/cordova/table_of_contents_spec.js b/tools/spec/cordova/table_of_contents_spec.js
deleted file mode 100644
index 5635d78..0000000
--- a/tools/spec/cordova/table_of_contents_spec.js
+++ /dev/null
@@ -1,122 +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.
-*/
-/* jslint node: true */
-/* global describe, it, beforeEach, afterEach, after, before */ // eslint-disable-line no-unused-vars
-(function () {
- 'use strict';
- var assert = require('assert');
- var path = require('path');
- var fs = require('fs');
- var cheerio = require('cheerio');
- var TableOfContents = require('../../lib/cordova/post/tableofcontents');
- var SpecHelpers = require('../spec_helpers');
-
- describe('TableOfContents', function () {
- var sut;
- var files;
-
- beforeEach(function (done) {
- var tmp_directory = SpecHelpers.create_tmp_directory_assets(module.filename);
- sut = new TableOfContents();
- files = {
- 'normal': path.join(tmp_directory, 'example.html'),
- 'no_source': path.join(tmp_directory, 'example_no_source.html'),
- 'no_target': path.join(tmp_directory, 'example_no_target.html')
- };
- done();
- });
-
- afterEach(function (done) {
- SpecHelpers.remove_tmp_directory();
- done();
- });
-
- it('should find the table of content values', function () {
- var dom = cheerio.load(fs.readFileSync(files.normal));
- var result = sut.run(files.normal, dom);
- assert.strictEqual(32, result.length);
- });
-
- it('should find all <h1> elements', function () {
- var dom = cheerio.load(fs.readFileSync(files.normal));
- var result = sut.run(files.normal, dom);
- var headers = [];
-
- result.forEach(function (header, index) {
- var match = header.toString().match(/-/);
- if (match === null) {
- headers.push(header);
- }
- });
- assert.strictEqual(8, headers.length);
- });
-
- it('should find all <h2> elements', function () {
- var dom = cheerio.load(fs.readFileSync(files.normal));
- var result = sut.run(files.normal, dom);
- var headers = [];
-
- result.forEach(function (header, index) {
- var match = header.toString().match(/-/);
- if (match !== null) {
- // if nil != (header =~ /-/) and (header =~ /-/) > 0 }
- headers.push(header);
- }
- });
- assert.strictEqual(24, headers.length);
- });
-
- it('should ignore whitespace in the target name', function () {
- var dom = cheerio.load(fs.readFileSync(files.normal));
- var result = sut.run(files.normal, dom);
- var doc = dom;
-
- // result = result.reverse();
- // console.log(result[0]);
- assert.ok(doc('#content > h1, #content > h2').length > 0, 'Should found H1 and H2');
- doc('#content > h1, #content > h2').each(function (index, element) {
- var child = cheerio(element).children().first();
- var resultElement = result.shift();
- var resultElementHtml = resultElement.toString();
- var valueMatch = resultElementHtml.match(/value=\"([^\"]*)\"/); // eslint-disable-line no-useless-escape
- assert.ok(valueMatch !== null, "Could not find value in the resulting HTML '" + resultElementHtml + "' which should match to '" + child.attr('name') + "'");
- assert.strictEqual(valueMatch[1], child.attr('name'));
- });
- });
-
- it('should create a HTML select element', function () {
- var dom = cheerio.load(fs.readFileSync(files.normal));
- var result = sut.run(files.normal, dom); // eslint-disable-line no-unused-vars
-
- assert.ok(dom('#subheader > small > select').length > 0);
- });
-
- it('should skip files with no source title', function () {
- var dom = cheerio.load(fs.readFileSync(files.no_source));
- var result = sut.run(files.no_source, dom);
- assert.strictEqual(null, result);
- });
-
- it('should skip files with no target title', function () {
- var dom = cheerio.load(fs.readFileSync(files.no_target));
- var result = sut.run(files.no_target, dom);
- assert.ok(result === null, 'Find something when should not');
- });
- });
-}());
diff --git a/tools/spec/cordova/table_of_contents_spec/example.html b/tools/spec/cordova/table_of_contents_spec/example.html
deleted file mode 100644
index 94db5fa..0000000
--- a/tools/spec/cordova/table_of_contents_spec/example.html
+++ /dev/null
@@ -1,515 +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.
--->
-
-<!DOCTYPE html>
-<html lang="en">
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
-<meta name="viewport" content="initial-scale=1.0, maximum-scale=1.0, user-scalable=no, width=device-width">
-<meta name="generator" content="joDoc">
-<link rel="stylesheet" type="text/css" href="index.css">
-<title>PhoneGap API Documentation</title>
-</head>
-<body>
-
- <div id="header">
- <h1>Phone<strong>Gap</strong> Documentation</h1>
- <small></small>
- </div>
- <div id="subheader">
- <h1>Accelerometer</h1>
- <small>[ SELECT BOX PLACEHOLDER ]</small>
- </div>
-
- <div id="sidebar">
- <div class="vertical_divider"></div>
- <h1>API Reference</h1>
- <ul>
-<li><a href="phonegap_accelerometer_accelerometer.md.html">Accelerometer</a></li>
- <li><a href="phonegap_camera_camera.md.html">Camera</a></li>
- <li><a href="phonegap_device_device.md.html">Device</a></li>
- <li><a href="phonegap_events_events.md.html">Events</a></li>
- <li><a href="phonegap_geolocation_geolocation.md.html">Geolocation</a></li>
- <li><a href="phonegap_notification_notification.md.html">Notification</a></li>
- </ul>
-</div>
-
- <div id="content">
- <h1><a name="Accelerometer">Accelerometer</a></h1>
-
-<blockquote>
- <p>Captures device motion in the x, y, and z direction.</p>
-</blockquote>
-
-<h2>Methods</h2>
-
-<ul>
-<li><a href="phonegap_accelerometer_accelerometer.md.html#accelerometer.getCurrentAcceleration">accelerometer.getCurrentAcceleration</a></li>
-<li><a href="phonegap_accelerometer_accelerometer.md.html#accelerometer.watchAcceleration">accelerometer.watchAcceleration</a></li>
-<li><a href="phonegap_accelerometer_accelerometer.md.html#accelerometer.clearWatch">accelerometer.clearWatch</a></li>
-</ul>
-<h2>Arguments</h2>
-
-<ul>
-<li><a href="phonegap_accelerometer_accelerometer.md.html#accelerometerSuccess">accelerometerSuccess</a></li>
-<li><a href="phonegap_accelerometer_accelerometer.md.html#accelerometerError">accelerometerError</a></li>
-<li><a href="phonegap_accelerometer_accelerometer.md.html#accelerometerOptions">accelerometerOptions</a></li>
-</ul>
-<h2>Objects (Read-Only)</h2>
-
-<ul>
-<li><a href="phonegap_accelerometer_accelerometer.md.html#Acceleration">Acceleration</a></li>
-</ul>
-<hr>
-<h1><a name="accelerometer.getCurrentAcceleration">accelerometer.getCurrentAcceleration</a></h1>
-
-<p>Get the current acceleration along the x, y, and z axis.</p>
-
-<pre><code>navigator.accelerometer.getCurrentAcceleration(<a href="phonegap_accelerometer_accelerometer.md.html#accelerometerSuccess">accelerometerSuccess</a>, <a href="phonegap_accelerometer_accelerometer.md.html#accelerometerError">accelerometerError</a>);
-</code></pre>
-
-<h2>Description</h2>
-
-<p>The accelerometer is a motion sensor that detects the change (delta) in movement relative to the current position. The accelerometer can detect 3D movement along the x, y, and z axis.</p>
-
-<p>The acceleration is returned using the <code><a href="phonegap_accelerometer_accelerometer.md.html#accelerometerSuccess">accelerometerSuccess</a></code> callback function.</p>
-
-<h2>Supported Platforms</h2>
-
-<ul>
-<li>iPhone</li>
-</ul>
-<h2>Quick Example</h2>
-
-<pre><code>function onSuccess(acceleration) {
- alert('<a href="phonegap_accelerometer_accelerometer.md.html#Acceleration">Acceleration</a> X: ' + acceleration.x + '\n' +
- '<a href="phonegap_accelerometer_accelerometer.md.html#Acceleration">Acceleration</a> Y: ' + acceleration.y + '\n' +
- '<a href="phonegap_accelerometer_accelerometer.md.html#Acceleration">Acceleration</a> Z: ' + acceleration.z + '\n';
-};
-
-function onError() {
- alert('onError!');
-};
-
-navigator.<a href="phonegap_accelerometer_accelerometer.md.html#accelerometer.getCurrentAcceleration">accelerometer.getCurrentAcceleration</a>(onSuccess, onError);
-</code></pre>
-
-<h2>Full Example</h2>
-
-<pre><code><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
- "http://www.w3.org/TR/html4/strict.dtd">
-<html>
- <head>
- <title><a href="phonegap_accelerometer_accelerometer.md.html#Acceleration">Acceleration</a> Example</title>
-
- <script type="text/javascript" charset="utf-8" src="phonegap.js"></script>
- <script type="text/javascript" charset="utf-8">
-
- // Wait for PhoneGap to load
- //
- function onLoad() {
- document.addEventListener("<a href="phonegap_events_events.md.html#deviceready">deviceready</a>", onDeviceReady, false);
- }
-
- // PhoneGap is ready
- //
- function onDeviceReady() {
- navigator.<a href="phonegap_accelerometer_accelerometer.md.html#accelerometer.getCurrentAcceleration">accelerometer.getCurrentAcceleration</a>(onSuccess, onError);
- }
-
- // onSuccess: Get a snapshot of the current acceleration
- //
- function onSuccess(acceleration) {
- alert('<a href="phonegap_accelerometer_accelerometer.md.html#Acceleration">Acceleration</a> X: ' + acceleration.x + '\n' +
- '<a href="phonegap_accelerometer_accelerometer.md.html#Acceleration">Acceleration</a> Y: ' + acceleration.y + '\n' +
- '<a href="phonegap_accelerometer_accelerometer.md.html#Acceleration">Acceleration</a> Z: ' + acceleration.z + '\n');
- }
-
- // onError: Failed to get the acceleration
- //
- function onError() {
- alert('onError!');
- }
-
- </script>
- </head>
- <body onload="onLoad()">
- <h1>Example</h1>
- <p>getCurrentAcceleration</p>
- </body>
-</html>
-</code></pre>
-
-<h2>iPhone Quirks</h2>
-
-<ul>
-<li>iPhone doesn't have the concept of getting the current acceleration at any given point.</li>
-<li>You must watch the acceleration and capture the data at given time intervals.</li>
-<li>Thus, the <code>getCurrentAcceleration</code> function will give you the last value reported from a phoneGap <code>watchAccelerometer</code> call.</li>
-</ul>
-<hr>
-<h1><a name="accelerometer.watchAcceleration">accelerometer.watchAcceleration</a></h1>
-
-<p>At a regular interval, get the acceleration along the x, y, and z axis.</p>
-
-<pre><code>var watchID = navigator.accelerometer.watchAcceleration(<a href="phonegap_accelerometer_accelerometer.md.html#accelerometerSuccess">accelerometerSuccess</a>,
- <a href="phonegap_accelerometer_accelerometer.md.html#accelerometerError">accelerometerError</a>,
- [<a href="phonegap_accelerometer_accelerometer.md.html#accelerometerOptions">accelerometerOptions</a>]);
-</code></pre>
-
-<h2>Description</h2>
-
-<p>The accelerometer is a motion sensor that detects the change (delta) in movement relative to the current position. The accelerometer can detect 3D movement along the x, y, and z axis.</p>
-
-<p>The <code><a href="phonegap_accelerometer_accelerometer.md.html#accelerometer.watchAcceleration">accelerometer.watchAcceleration</a></code> gets the device's current acceleration at a regular interval. Each time the <code><a href="phonegap_accelerometer_accelerometer.md.html#Acceleration">Acceleration</a></code> is retrieved, the <code><a href="phonegap_accelerometer_accelerometer.md.html#accelerometerSuccess">accelerometerSuccess</a></code> callback function is executed. Specify the interval in milliseconds via the <code>frequency</code> parameter in the <code>acceleratorOptions</code> object.</p>
-
-<p>The returned watch ID references references the accelerometer watch interval. The watch ID can be used with <code><a href="phonegap_accelerometer_accelerometer.md.html#accelerometer.clearWatch">accelerometer.clearWatch</a></code> to stop watching the accelerometer.</p>
-
-<h2>Supported Platforms</h2>
-
-<ul>
-<li>iPhone</li>
-</ul>
-<h2>Quick Example</h2>
-
-<pre><code>function onSuccess(acceleration) {
- alert('<a href="phonegap_accelerometer_accelerometer.md.html#Acceleration">Acceleration</a> X: ' + acceleration.x + '\n' +
- '<a href="phonegap_accelerometer_accelerometer.md.html#Acceleration">Acceleration</a> Y: ' + acceleration.y + '\n' +
- '<a href="phonegap_accelerometer_accelerometer.md.html#Acceleration">Acceleration</a> Z: ' + acceleration.z + '\n');
-};
-
-function onError() {
- alert('onError!');
-};
-
-var options = { frequency: 3000 }; // Update every 3 seconds
-
-var watchID = navigator.<a href="phonegap_accelerometer_accelerometer.md.html#accelerometer.watchAcceleration">accelerometer.watchAcceleration</a>(onSuccess, onError, options);
-</code></pre>
-
-<h2>Full Example</h2>
-
-<pre><code><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
- "http://www.w3.org/TR/html4/strict.dtd">
-<html>
- <head>
- <title><a href="phonegap_accelerometer_accelerometer.md.html#Acceleration">Acceleration</a> Example</title>
-
- <script type="text/javascript" charset="utf-8" src="phonegap.js"></script>
- <script type="text/javascript" charset="utf-8">
-
- // The watch id references the current `watchAcceleration`
- var watchID = null;
-
- // Wait for PhoneGap to load
- //
- function onLoad() {
- document.addEventListener("<a href="phonegap_events_events.md.html#deviceready">deviceready</a>", onDeviceReady, false);
- }
-
- // PhoneGap is ready
- //
- function onDeviceReady() {
- startWatch();
- }
-
- // Start watching the acceleration
- //
- function startWatch() {
-
- // Update acceleration every 3 seconds
- var options = { frequency: 3000 };
-
- watchID = navigator.<a href="phonegap_accelerometer_accelerometer.md.html#accelerometer.watchAcceleration">accelerometer.watchAcceleration</a>(onSuccess, onError, options);
- }
-
- // Stop watching the acceleration
- //
- function stopWatch() {
- if (watchID) {
- navigator.<a href="phonegap_accelerometer_accelerometer.md.html#accelerometer.clearWatch">accelerometer.clearWatch</a>(watchID);
- watchID = null;
- }
- }
-
- // onSuccess: Get a snapshot of the current acceleration
- //
- function onSuccess(acceleration) {
- var element = document.getElementById('accelerometer');
- element.innerHTML = '<a href="phonegap_accelerometer_accelerometer.md.html#Acceleration">Acceleration</a> X: ' + acceleration.x + '<br />' +
- '<a href="phonegap_accelerometer_accelerometer.md.html#Acceleration">Acceleration</a> Y: ' + acceleration.y + '<br />' +
- '<a href="phonegap_accelerometer_accelerometer.md.html#Acceleration">Acceleration</a> Z: ' + acceleration.z + '<br />';
- }
-
- // onError: Failed to get the acceleration
- //
- function onError() {
- alert('onError!');
- }
-
- </script>
- </head>
- <body onload="onLoad()">
- <div id="accelerometer">Waiting for accelerometer...</div>
- </body>
-</html>
-</code></pre>
-
-<h2> iPhone Quirks</h2>
-
-<ul>
-<li>At the interval requested, PhoneGap will call the success callback function and pass the accelerometer results.</li>
-<li>However, in requests to the device PhoneGap restricts the interval to minimum of every 40ms and a maximum of every 1000ms.
-<ul>
-<li>For example, if you request an interval of 3 seconds (3000ms), PhoneGap will request an interval of 1 second from the device but invoke the success callback at the requested interval of 3 seconds.</li>
-</ul>
-</li>
-</ul>
-<hr>
-<h1><a name="accelerometer.clearWatch">accelerometer.clearWatch</a></h1>
-
-<p>Stop watching the <code><a href="phonegap_accelerometer_accelerometer.md.html#Acceleration">Acceleration</a></code> referenced by the watch ID parameter.</p>
-
-<pre><code>navigator.<a href="phonegap_accelerometer_accelerometer.md.html#accelerometer.clearWatch">accelerometer.clearWatch</a>(watchID);
-</code></pre>
-
-<ul>
-<li>
-<strong>watchID</strong>: The ID returned by <code><a href="phonegap_accelerometer_accelerometer.md.html#accelerometer.watchAcceleration">accelerometer.watchAcceleration</a></code>.</li>
-</ul>
-<h2>Supported Platforms</h2>
-
-<ul>
-<li>iPhone</li>
-</ul>
-<h2>Quick Example</h2>
-
-<pre><code>var watchID = navigator.<a href="phonegap_accelerometer_accelerometer.md.html#accelerometer.watchAcceleration">accelerometer.watchAcceleration</a>(onSuccess, onError, options);
-
-// ... later on ...
-
-navigator.<a href="phonegap_accelerometer_accelerometer.md.html#accelerometer.clearWatch">accelerometer.clearWatch</a>(watchID);
-</code></pre>
-
-<h2>Full Example</h2>
-
-<pre><code><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
- "http://www.w3.org/TR/html4/strict.dtd">
-<html>
- <head>
- <title><a href="phonegap_accelerometer_accelerometer.md.html#Acceleration">Acceleration</a> Example</title>
-
- <script type="text/javascript" charset="utf-8" src="phonegap.js"></script>
- <script type="text/javascript" charset="utf-8">
-
- // The watch id references the current `watchAcceleration`
- var watchID = null;
-
- // Wait for PhoneGap to load
- //
- function onLoad() {
- document.addEventListener("<a href="phonegap_events_events.md.html#deviceready">deviceready</a>", onDeviceReady, false);
- }
-
- // PhoneGap is ready
- //
- function onDeviceReady() {
- startWatch();
- }
-
- // Start watching the acceleration
- //
- function startWatch() {
-
- // Update acceleration every 3 seconds
- var options = { frequency: 3000 };
-
- watchID = navigator.<a href="phonegap_accelerometer_accelerometer.md.html#accelerometer.watchAcceleration">accelerometer.watchAcceleration</a>(onSuccess, onError, options);
- }
-
- // Stop watching the acceleration
- //
- function stopWatch() {
- if (watchID) {
- navigator.<a href="phonegap_accelerometer_accelerometer.md.html#accelerometer.clearWatch">accelerometer.clearWatch</a>(watchID);
- watchID = null;
- }
- }
-
- // onSuccess: Get a snapshot of the current acceleration
- //
- function onSuccess(acceleration) {
- var element = document.getElementById('accelerometer');
- element.innerHTML = '<a href="phonegap_accelerometer_accelerometer.md.html#Acceleration">Acceleration</a> X: ' + acceleration.x + '<br />' +
- '<a href="phonegap_accelerometer_accelerometer.md.html#Acceleration">Acceleration</a> Y: ' + acceleration.y + '<br />' +
- '<a href="phonegap_accelerometer_accelerometer.md.html#Acceleration">Acceleration</a> Z: ' + acceleration.z + '<br />';
- }
-
- // onError: Failed to get the acceleration
- //
- function onError() {
- alert('onError!');
- }
-
- </script>
- </head>
- <body onload="onLoad()">
- <div id="accelerometer">Waiting for accelerometer...</div>
- <button onclick="stopWatch();">Stop Watching</button>
- </body>
-</html>
-</code></pre>
-
-<hr>
-<h1><a name="Acceleration">Acceleration</a></h1>
-
-<p>Contains <code><a href="phonegap_accelerometer_accelerometer.md.html#Accelerometer">Accelerometer</a></code> data captured at a specific point in time.</p>
-
-<h2>Properties</h2>
-
-<ul>
-<li>
-<strong>x:</strong> Amount of motion on the x-axis. Range [0, 1] (<code>Number</code>)</li>
-<li>
-<strong>y:</strong> Amount of motion on the y-axis. Range [0, 1] (<code>Number</code>)</li>
-<li>
-<strong>z:</strong> Amount of motion on the z-axis. Range [0, 1] (<code>Number</code>)</li>
-<li>
-<strong>timestamp:</strong> Creation timestamp in milliseconds. (<code>DOMTimeStamp</code>)</li>
-</ul>
-<h2>Description</h2>
-
-<p>This object is created and populated by PhoneGap, and returned by an <code><a href="phonegap_accelerometer_accelerometer.md.html#Accelerometer">Accelerometer</a></code> method.</p>
-
-<h2>Supported Platforms</h2>
-
-<ul>
-<li>Untested</li>
-</ul>
-<h2>Quick Example</h2>
-
-<pre><code>function onSuccess(acceleration) {
- alert('<a href="phonegap_accelerometer_accelerometer.md.html#Acceleration">Acceleration</a> X: ' + acceleration.x + '\n' +
- '<a href="phonegap_accelerometer_accelerometer.md.html#Acceleration">Acceleration</a> Y: ' + acceleration.y + '\n' +
- '<a href="phonegap_accelerometer_accelerometer.md.html#Acceleration">Acceleration</a> Z: ' + acceleration.z + '\n';
-};
-
-function onError() {
- alert('onError!');
-};
-
-navigator.<a href="phonegap_accelerometer_accelerometer.md.html#accelerometer.getCurrentAcceleration">accelerometer.getCurrentAcceleration</a>(onSuccess, onError);
-</code></pre>
-
-<h2>Full Example</h2>
-
-<pre><code><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
- "http://www.w3.org/TR/html4/strict.dtd">
-<html>
- <head>
- <title><a href="phonegap_accelerometer_accelerometer.md.html#Acceleration">Acceleration</a> Example</title>
-
- <script type="text/javascript" charset="utf-8" src="phonegap.js"></script>
- <script type="text/javascript" charset="utf-8">
-
- // Wait for PhoneGap to load
- //
- function onLoad() {
- document.addEventListener("<a href="phonegap_events_events.md.html#deviceready">deviceready</a>", onDeviceReady, false);
- }
-
- // PhoneGap is ready
- //
- function onDeviceReady() {
- navigator.<a href="phonegap_accelerometer_accelerometer.md.html#accelerometer.getCurrentAcceleration">accelerometer.getCurrentAcceleration</a>(onSuccess, onError);
- }
-
- // onSuccess: Get a snapshot of the current acceleration
- //
- function onSuccess() {
- alert('<a href="phonegap_accelerometer_accelerometer.md.html#Acceleration">Acceleration</a> X: ' + acceleration.x + '\n' +
- '<a href="phonegap_accelerometer_accelerometer.md.html#Acceleration">Acceleration</a> Y: ' + acceleration.y + '\n' +
- '<a href="phonegap_accelerometer_accelerometer.md.html#Acceleration">Acceleration</a> Z: ' + acceleration.z + '\n';
- }
-
- // onError: Failed to get the acceleration
- //
- function onError() {
- alert('onError!');
- }
-
- </script>
- </head>
- <body onload="onLoad()">
- <h1>Example</h1>
- <p>getCurrentAcceleration</p>
- </body>
-</html>
-</code></pre>
-
-<hr>
-<h1><a name="accelerometerSuccess">accelerometerSuccess</a></h1>
-
-<p>onSuccess callback function that provides the <a href="phonegap_accelerometer_accelerometer.md.html#Acceleration">Acceleration</a> information.</p>
-
-<pre><code>function(acceleration) {
- // Do something
-}
-</code></pre>
-
-<h2>Parameters</h2>
-
-<ul>
-<li>
-<strong>acceleration:</strong> The acceleration at a single moment in time. (<a href="phonegap_accelerometer_accelerometer.md.html#Acceleration">Acceleration</a>)</li>
-</ul>
-<h2>Example</h2>
-
-<pre><code>function onSuccess(acceleration) {
- alert('<a href="phonegap_accelerometer_accelerometer.md.html#Acceleration">Acceleration</a> X: ' + acceleration.x + '\n' +
- '<a href="phonegap_accelerometer_accelerometer.md.html#Acceleration">Acceleration</a> Y: ' + acceleration.y + '\n' +
- '<a href="phonegap_accelerometer_accelerometer.md.html#Acceleration">Acceleration</a> Z: ' + acceleration.z + '\n';
-};
-</code></pre>
-
-<hr>
-<h1><a name="accelerometerError">accelerometerError</a></h1>
-
-<p>onError callback function for acceleration functions.</p>
-
-<pre><code>function() {
- // Handle the error
-}
-</code></pre>
-
-<hr>
-<h1><a name="accelerometerOptions">accelerometerOptions</a></h1>
-
-<p>An optional parameter to customize the retrieval of the accelerometer.</p>
-
-<h2>Options</h2>
-
-<ul>
-<li>
-<strong>frequency:</strong> How often to retrieve the <code><a href="phonegap_accelerometer_accelerometer.md.html#Acceleration">Acceleration</a></code> in milliseconds. <em>(Number)</em> (Default: 10000)</li>
-</ul>
-</div>
-
- </body>
-</html>
diff --git a/tools/spec/cordova/table_of_contents_spec/example_no_source.html b/tools/spec/cordova/table_of_contents_spec/example_no_source.html
deleted file mode 100644
index 4dab85c..0000000
--- a/tools/spec/cordova/table_of_contents_spec/example_no_source.html
+++ /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.
--->
-
-<!DOCTYPE html>
-<html lang="en">
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
-<meta name="viewport" content="initial-scale=1.0, maximum-scale=1.0, user-scalable=no, width=device-width">
-<meta name="generator" content="joDoc">
-<link rel="stylesheet" type="text/css" href="index.css">
-<title>PhoneGap API Documentation</title>
-</head>
-<body>
- <div id="header">
- <h1>Phone<strong>Gap</strong> Documentation</h1>
- <small></small>
- </div>
- <div id="subheader">
- <h1>Accelerometer</h1>
- <small></small>
- </div>
- <div id="content">
- <blockquote>
- <p>Captures device motion in the x, y, and z direction.</p>
- </blockquote>
- <ul>
- <li><a href="phonegap_accelerometer_accelerometer.md.html#accelerometer.getCurrentAcceleration">accelerometer.getCurrentAcceleration</a></li>
- <li><a href="phonegap_accelerometer_accelerometer.md.html#accelerometer.watchAcceleration">accelerometer.watchAcceleration</a></li>
- <li><a href="phonegap_accelerometer_accelerometer.md.html#accelerometer.clearWatch">accelerometer.clearWatch</a></li>
- </ul>
- </div>
- </body>
-</html>
diff --git a/tools/spec/cordova/table_of_contents_spec/example_no_target.html b/tools/spec/cordova/table_of_contents_spec/example_no_target.html
deleted file mode 100644
index f6d6179..0000000
--- a/tools/spec/cordova/table_of_contents_spec/example_no_target.html
+++ /dev/null
@@ -1,496 +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.
--->
-
-<!DOCTYPE html>
-<html lang="en">
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
-<meta name="viewport" content="initial-scale=1.0, maximum-scale=1.0, user-scalable=no, width=device-width">
-<meta name="generator" content="joDoc">
-<link rel="stylesheet" type="text/css" href="index.css">
-<title>PhoneGap API Documentation</title>
-</head>
-<body>
-
- <div id="header">
- <h1>Phone<strong>Gap</strong> Documentation</h1>
- <small></small>
- </div>
- <div id="subheader">
- <h1>Accelerometer</h1>
- </div>
- <div id="content">
- <h1><a name="Accelerometer">Accelerometer</a></h1>
-
- <blockquote>
- <p>Captures device motion in the x, y, and z direction.</p>
- </blockquote>
-
- <h2>Methods</h2>
-
- <ul>
- <li><a href="phonegap_accelerometer_accelerometer.md.html#accelerometer.getCurrentAcceleration">accelerometer.getCurrentAcceleration</a></li>
- <li><a href="phonegap_accelerometer_accelerometer.md.html#accelerometer.watchAcceleration">accelerometer.watchAcceleration</a></li>
- <li><a href="phonegap_accelerometer_accelerometer.md.html#accelerometer.clearWatch">accelerometer.clearWatch</a></li>
- </ul>
- <h2>Arguments</h2>
-
- <ul>
- <li><a href="phonegap_accelerometer_accelerometer.md.html#accelerometerSuccess">accelerometerSuccess</a></li>
- <li><a href="phonegap_accelerometer_accelerometer.md.html#accelerometerError">accelerometerError</a></li>
- <li><a href="phonegap_accelerometer_accelerometer.md.html#accelerometerOptions">accelerometerOptions</a></li>
- </ul>
- <h2>Objects (Read-Only)</h2>
-
- <ul>
- <li><a href="phonegap_accelerometer_accelerometer.md.html#Acceleration">Acceleration</a></li>
- </ul>
- <hr>
- <h1><a name="accelerometer.getCurrentAcceleration">accelerometer.getCurrentAcceleration</a></h1>
-
- <p>Get the current acceleration along the x, y, and z axis.</p>
-
- <pre><code>navigator.accelerometer.getCurrentAcceleration(<a href="phonegap_accelerometer_accelerometer.md.html#accelerometerSuccess">accelerometerSuccess</a>, <a href="phonegap_accelerometer_accelerometer.md.html#accelerometerError">accelerometerError</a>);
- </code></pre>
-
- <h2>Description</h2>
-
- <p>The accelerometer is a motion sensor that detects the change (delta) in movement relative to the current position. The accelerometer can detect 3D movement along the x, y, and z axis.</p>
-
- <p>The acceleration is returned using the <code><a href="phonegap_accelerometer_accelerometer.md.html#accelerometerSuccess">accelerometerSuccess</a></code> callback function.</p>
-
- <h2>Supported Platforms</h2>
-
- <ul>
- <li>iPhone</li>
- </ul>
- <h2>Quick Example</h2>
-
- <pre><code>function onSuccess(acceleration) {
- alert('<a href="phonegap_accelerometer_accelerometer.md.html#Acceleration">Acceleration</a> X: ' + acceleration.x + '\n' +
- '<a href="phonegap_accelerometer_accelerometer.md.html#Acceleration">Acceleration</a> Y: ' + acceleration.y + '\n' +
- '<a href="phonegap_accelerometer_accelerometer.md.html#Acceleration">Acceleration</a> Z: ' + acceleration.z + '\n';
- };
-
- function onError() {
- alert('onError!');
- };
-
- navigator.<a href="phonegap_accelerometer_accelerometer.md.html#accelerometer.getCurrentAcceleration">accelerometer.getCurrentAcceleration</a>(onSuccess, onError);
- </code></pre>
-
- <h2>Full Example</h2>
-
- <pre><code><!DOCTYPE html>
- <html>
- <head>
- <title><a href="phonegap_accelerometer_accelerometer.md.html#Acceleration">Acceleration</a> Example</title>
-
- <script type="text/javascript" charset="utf-8" src="phonegap.js"></script>
- <script type="text/javascript" charset="utf-8">
-
- // Wait for PhoneGap to load
- //
- function onLoad() {
- document.addEventListener("<a href="phonegap_events_events.md.html#deviceready">deviceready</a>", onDeviceReady, false);
- }
-
- // PhoneGap is ready
- //
- function onDeviceReady() {
- navigator.<a href="phonegap_accelerometer_accelerometer.md.html#accelerometer.getCurrentAcceleration">accelerometer.getCurrentAcceleration</a>(onSuccess, onError);
- }
-
- // onSuccess: Get a snapshot of the current acceleration
- //
- function onSuccess(acceleration) {
- alert('<a href="phonegap_accelerometer_accelerometer.md.html#Acceleration">Acceleration</a> X: ' + acceleration.x + '\n' +
- '<a href="phonegap_accelerometer_accelerometer.md.html#Acceleration">Acceleration</a> Y: ' + acceleration.y + '\n' +
- '<a href="phonegap_accelerometer_accelerometer.md.html#Acceleration">Acceleration</a> Z: ' + acceleration.z + '\n');
- }
-
- // onError: Failed to get the acceleration
- //
- function onError() {
- alert('onError!');
- }
-
- </script>
- </head>
- <body onload="onLoad()">
- <h1>Example</h1>
- <p>getCurrentAcceleration</p>
- </body>
- </html>
- </code></pre>
-
- <h2>iPhone Quirks</h2>
-
- <ul>
- <li>iPhone doesn't have the concept of getting the current acceleration at any given point.</li>
- <li>You must watch the acceleration and capture the data at given time intervals.</li>
- <li>Thus, the <code>getCurrentAcceleration</code> function will give you the last value reported from a phoneGap <code>watchAccelerometer</code> call.</li>
- </ul>
- <hr>
- <h1><a name="accelerometer.watchAcceleration">accelerometer.watchAcceleration</a></h1>
-
- <p>At a regular interval, get the acceleration along the x, y, and z axis.</p>
-
- <pre><code>var watchID = navigator.accelerometer.watchAcceleration(<a href="phonegap_accelerometer_accelerometer.md.html#accelerometerSuccess">accelerometerSuccess</a>,
- <a href="phonegap_accelerometer_accelerometer.md.html#accelerometerError">accelerometerError</a>,
- [<a href="phonegap_accelerometer_accelerometer.md.html#accelerometerOptions">accelerometerOptions</a>]);
- </code></pre>
-
- <h2>Description</h2>
-
- <p>The accelerometer is a motion sensor that detects the change (delta) in movement relative to the current position. The accelerometer can detect 3D movement along the x, y, and z axis.</p>
-
- <p>The <code><a href="phonegap_accelerometer_accelerometer.md.html#accelerometer.watchAcceleration">accelerometer.watchAcceleration</a></code> gets the device's current acceleration at a regular interval. Each time the <code><a href="phonegap_accelerometer_accelerometer.md.html#Acceleration">Acceleration</a></code> is retrieved, the <code><a href="phonegap_accelerometer_accelerometer.md.html#accelerometerSuccess">accelerometerSuccess</a></code> callback function is executed. Specify the interval in milliseconds via the <code>frequency</code> parameter in the <code>acceleratorOptions</code> object.</p>
-
- <p>The returned watch ID references references the accelerometer watch interval. The watch ID can be used with <code><a href="phonegap_accelerometer_accelerometer.md.html#accelerometer.clearWatch">accelerometer.clearWatch</a></code> to stop watching the accelerometer.</p>
-
- <h2>Supported Platforms</h2>
-
- <ul>
- <li>iPhone</li>
- </ul>
- <h2>Quick Example</h2>
-
- <pre><code>function onSuccess(acceleration) {
- alert('<a href="phonegap_accelerometer_accelerometer.md.html#Acceleration">Acceleration</a> X: ' + acceleration.x + '\n' +
- '<a href="phonegap_accelerometer_accelerometer.md.html#Acceleration">Acceleration</a> Y: ' + acceleration.y + '\n' +
- '<a href="phonegap_accelerometer_accelerometer.md.html#Acceleration">Acceleration</a> Z: ' + acceleration.z + '\n');
- };
-
- function onError() {
- alert('onError!');
- };
-
- var options = { frequency: 3000 }; // Update every 3 seconds
-
- var watchID = navigator.<a href="phonegap_accelerometer_accelerometer.md.html#accelerometer.watchAcceleration">accelerometer.watchAcceleration</a>(onSuccess, onError, options);
- </code></pre>
-
- <h2>Full Example</h2>
-
- <pre><code><!DOCTYPE html>
- <html>
- <head>
- <title><a href="phonegap_accelerometer_accelerometer.md.html#Acceleration">Acceleration</a> Example</title>
-
- <script type="text/javascript" charset="utf-8" src="phonegap.js"></script>
- <script type="text/javascript" charset="utf-8">
-
- // The watch id references the current `watchAcceleration`
- var watchID = null;
-
- // Wait for PhoneGap to load
- //
- function onLoad() {
- document.addEventListener("<a href="phonegap_events_events.md.html#deviceready">deviceready</a>", onDeviceReady, false);
- }
-
- // PhoneGap is ready
- //
- function onDeviceReady() {
- startWatch();
- }
-
- // Start watching the acceleration
- //
- function startWatch() {
-
- // Update acceleration every 3 seconds
- var options = { frequency: 3000 };
-
- watchID = navigator.<a href="phonegap_accelerometer_accelerometer.md.html#accelerometer.watchAcceleration">accelerometer.watchAcceleration</a>(onSuccess, onError, options);
- }
-
- // Stop watching the acceleration
- //
- function stopWatch() {
- if (watchID) {
- navigator.<a href="phonegap_accelerometer_accelerometer.md.html#accelerometer.clearWatch">accelerometer.clearWatch</a>(watchID);
- watchID = null;
- }
- }
-
- // onSuccess: Get a snapshot of the current acceleration
- //
- function onSuccess(acceleration) {
- var element = document.getElementById('accelerometer');
- element.innerHTML = '<a href="phonegap_accelerometer_accelerometer.md.html#Acceleration">Acceleration</a> X: ' + acceleration.x + '<br />' +
- '<a href="phonegap_accelerometer_accelerometer.md.html#Acceleration">Acceleration</a> Y: ' + acceleration.y + '<br />' +
- '<a href="phonegap_accelerometer_accelerometer.md.html#Acceleration">Acceleration</a> Z: ' + acceleration.z + '<br />';
- }
-
- // onError: Failed to get the acceleration
- //
- function onError() {
- alert('onError!');
- }
-
- </script>
- </head>
- <body onload="onLoad()">
- <div id="accelerometer">Waiting for accelerometer...</div>
- </body>
- </html>
- </code></pre>
-
- <h2> iPhone Quirks</h2>
-
- <ul>
- <li>At the interval requested, PhoneGap will call the success callback function and pass the accelerometer results.</li>
- <li>However, in requests to the device PhoneGap restricts the interval to minimum of every 40ms and a maximum of every 1000ms.
- <ul>
- <li>For example, if you request an interval of 3 seconds (3000ms), PhoneGap will request an interval of 1 second from the device but invoke the success callback at the requested interval of 3 seconds.</li>
- </ul>
- </li>
- </ul>
- <hr>
- <h1><a name="accelerometer.clearWatch">accelerometer.clearWatch</a></h1>
-
- <p>Stop watching the <code><a href="phonegap_accelerometer_accelerometer.md.html#Acceleration">Acceleration</a></code> referenced by the watch ID parameter.</p>
-
- <pre><code>navigator.<a href="phonegap_accelerometer_accelerometer.md.html#accelerometer.clearWatch">accelerometer.clearWatch</a>(watchID);
- </code></pre>
-
- <ul>
- <li>
- <strong>watchID</strong>: The ID returned by <code><a href="phonegap_accelerometer_accelerometer.md.html#accelerometer.watchAcceleration">accelerometer.watchAcceleration</a></code>.</li>
- </ul>
- <h2>Supported Platforms</h2>
-
- <ul>
- <li>iPhone</li>
- </ul>
- <h2>Quick Example</h2>
-
- <pre><code>var watchID = navigator.<a href="phonegap_accelerometer_accelerometer.md.html#accelerometer.watchAcceleration">accelerometer.watchAcceleration</a>(onSuccess, onError, options);
-
- // ... later on ...
-
- navigator.<a href="phonegap_accelerometer_accelerometer.md.html#accelerometer.clearWatch">accelerometer.clearWatch</a>(watchID);
- </code></pre>
-
- <h2>Full Example</h2>
-
- <pre><code><!DOCTYPE html>
- <html>
- <head>
- <title><a href="phonegap_accelerometer_accelerometer.md.html#Acceleration">Acceleration</a> Example</title>
-
- <script type="text/javascript" charset="utf-8" src="phonegap.js"></script>
- <script type="text/javascript" charset="utf-8">
-
- // The watch id references the current `watchAcceleration`
- var watchID = null;
-
- // Wait for PhoneGap to load
- //
- function onLoad() {
- document.addEventListener("<a href="phonegap_events_events.md.html#deviceready">deviceready</a>", onDeviceReady, false);
- }
-
- // PhoneGap is ready
- //
- function onDeviceReady() {
- startWatch();
- }
-
- // Start watching the acceleration
- //
- function startWatch() {
-
- // Update acceleration every 3 seconds
- var options = { frequency: 3000 };
-
- watchID = navigator.<a href="phonegap_accelerometer_accelerometer.md.html#accelerometer.watchAcceleration">accelerometer.watchAcceleration</a>(onSuccess, onError, options);
- }
-
- // Stop watching the acceleration
- //
- function stopWatch() {
- if (watchID) {
- navigator.<a href="phonegap_accelerometer_accelerometer.md.html#accelerometer.clearWatch">accelerometer.clearWatch</a>(watchID);
- watchID = null;
- }
- }
-
- // onSuccess: Get a snapshot of the current acceleration
- //
- function onSuccess(acceleration) {
- var element = document.getElementById('accelerometer');
- element.innerHTML = '<a href="phonegap_accelerometer_accelerometer.md.html#Acceleration">Acceleration</a> X: ' + acceleration.x + '<br />' +
- '<a href="phonegap_accelerometer_accelerometer.md.html#Acceleration">Acceleration</a> Y: ' + acceleration.y + '<br />' +
- '<a href="phonegap_accelerometer_accelerometer.md.html#Acceleration">Acceleration</a> Z: ' + acceleration.z + '<br />';
- }
-
- // onError: Failed to get the acceleration
- //
- function onError() {
- alert('onError!');
- }
-
- </script>
- </head>
- <body onload="onLoad()">
- <div id="accelerometer">Waiting for accelerometer...</div>
- <button onclick="stopWatch();">Stop Watching</button>
- </body>
- </html>
- </code></pre>
-
- <hr>
- <h1><a name="Acceleration">Acceleration</a></h1>
-
- <p>Contains <code><a href="phonegap_accelerometer_accelerometer.md.html#Accelerometer">Accelerometer</a></code> data captured at a specific point in time.</p>
-
- <h2>Properties</h2>
-
- <ul>
- <li>
- <strong>x:</strong> Amount of motion on the x-axis. Range [0, 1] (<code>Number</code>)</li>
- <li>
- <strong>y:</strong> Amount of motion on the y-axis. Range [0, 1] (<code>Number</code>)</li>
- <li>
- <strong>z:</strong> Amount of motion on the z-axis. Range [0, 1] (<code>Number</code>)</li>
- <li>
- <strong>timestamp:</strong> Creation timestamp in milliseconds. (<code>DOMTimeStamp</code>)</li>
- </ul>
- <h2>Description</h2>
-
- <p>This object is created and populated by PhoneGap, and returned by an <code><a href="phonegap_accelerometer_accelerometer.md.html#Accelerometer">Accelerometer</a></code> method.</p>
-
- <h2>Supported Platforms</h2>
-
- <ul>
- <li>Untested</li>
- </ul>
- <h2>Quick Example</h2>
-
- <pre><code>function onSuccess(acceleration) {
- alert('<a href="phonegap_accelerometer_accelerometer.md.html#Acceleration">Acceleration</a> X: ' + acceleration.x + '\n' +
- '<a href="phonegap_accelerometer_accelerometer.md.html#Acceleration">Acceleration</a> Y: ' + acceleration.y + '\n' +
- '<a href="phonegap_accelerometer_accelerometer.md.html#Acceleration">Acceleration</a> Z: ' + acceleration.z + '\n';
- };
-
- function onError() {
- alert('onError!');
- };
-
- navigator.<a href="phonegap_accelerometer_accelerometer.md.html#accelerometer.getCurrentAcceleration">accelerometer.getCurrentAcceleration</a>(onSuccess, onError);
- </code></pre>
-
- <h2>Full Example</h2>
-
- <pre><code><!DOCTYPE html>
- <html>
- <head>
- <title><a href="phonegap_accelerometer_accelerometer.md.html#Acceleration">Acceleration</a> Example</title>
-
- <script type="text/javascript" charset="utf-8" src="phonegap.js"></script>
- <script type="text/javascript" charset="utf-8">
-
- // Wait for PhoneGap to load
- //
- function onLoad() {
- document.addEventListener("<a href="phonegap_events_events.md.html#deviceready">deviceready</a>", onDeviceReady, false);
- }
-
- // PhoneGap is ready
- //
- function onDeviceReady() {
- navigator.<a href="phonegap_accelerometer_accelerometer.md.html#accelerometer.getCurrentAcceleration">accelerometer.getCurrentAcceleration</a>(onSuccess, onError);
- }
-
- // onSuccess: Get a snapshot of the current acceleration
- //
- function onSuccess() {
- alert('<a href="phonegap_accelerometer_accelerometer.md.html#Acceleration">Acceleration</a> X: ' + acceleration.x + '\n' +
- '<a href="phonegap_accelerometer_accelerometer.md.html#Acceleration">Acceleration</a> Y: ' + acceleration.y + '\n' +
- '<a href="phonegap_accelerometer_accelerometer.md.html#Acceleration">Acceleration</a> Z: ' + acceleration.z + '\n';
- }
-
- // onError: Failed to get the acceleration
- //
- function onError() {
- alert('onError!');
- }
-
- </script>
- </head>
- <body onload="onLoad()">
- <h1>Example</h1>
- <p>getCurrentAcceleration</p>
- </body>
- </html>
- </code></pre>
-
- <hr>
- <h1><a name="accelerometerSuccess">accelerometerSuccess</a></h1>
-
- <p>onSuccess callback function that provides the <a href="phonegap_accelerometer_accelerometer.md.html#Acceleration">Acceleration</a> information.</p>
-
- <pre><code>function(acceleration) {
- // Do something
- }
- </code></pre>
-
- <h2>Parameters</h2>
-
- <ul>
- <li>
- <strong>acceleration:</strong> The acceleration at a single moment in time. (<a href="phonegap_accelerometer_accelerometer.md.html#Acceleration">Acceleration</a>)</li>
- </ul>
- <h2>Example</h2>
-
- <pre><code>function onSuccess(acceleration) {
- alert('<a href="phonegap_accelerometer_accelerometer.md.html#Acceleration">Acceleration</a> X: ' + acceleration.x + '\n' +
- '<a href="phonegap_accelerometer_accelerometer.md.html#Acceleration">Acceleration</a> Y: ' + acceleration.y + '\n' +
- '<a href="phonegap_accelerometer_accelerometer.md.html#Acceleration">Acceleration</a> Z: ' + acceleration.z + '\n';
- };
- </code></pre>
-
- <hr>
- <h1><a name="accelerometerError">accelerometerError</a></h1>
-
- <p>onError callback function for acceleration functions.</p>
-
- <pre><code>function() {
- // Handle the error
- }
- </code></pre>
-
- <hr>
- <h1><a name="accelerometerOptions">accelerometerOptions</a></h1>
-
- <p>An optional parameter to customize the retrieval of the accelerometer.</p>
-
- <h2>Options</h2>
-
- <ul>
- <li>
- <strong>frequency:</strong> How often to retrieve the <code><a href="phonegap_accelerometer_accelerometer.md.html#Acceleration">Acceleration</a></code> in milliseconds. <em>(Number)</em> (Default: 10000)</li>
- </ul>
- </div>
-
- </body>
-</html>
diff --git a/tools/spec/cordova/update_index_spec.js b/tools/spec/cordova/update_index_spec.js
deleted file mode 100644
index a17be22..0000000
--- a/tools/spec/cordova/update_index_spec.js
+++ /dev/null
@@ -1,76 +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.
-*/
-/* jslint node: true */
-/* global describe, it, beforeEach, afterEach, after, before */ // eslint-disable-line no-unused-vars
-(function () {
- 'use strict';
- var assert = require('assert');
- var path = require('path');
- var fs = require('fs');
- var cheerio = require('cheerio');
- var UpdateIndex = require('../../lib/cordova/post/updateindex');
- var SpecHelpers = require('../spec_helpers');
-
- describe('UpdateIndex', function () {
- var sut;
- var files;
-
- beforeEach(function (done) {
- var tmp_directory = SpecHelpers.create_tmp_directory_assets(module.filename);
- sut = new UpdateIndex();
- files = {
- 'input': path.join(tmp_directory, 'index.md.html'),
- 'output': path.join(tmp_directory, 'index.html')
- };
- done();
- });
-
- afterEach(function (done) {
- SpecHelpers.remove_tmp_directory();
- done();
- });
-
- it('should skip all files but index.md.html', function () {
- assert.strictEqual(false, sut.run('index.md'));
- assert.strictEqual(false, sut.run('index.html'));
- assert.strictEqual(false, sut.run('_index.md.html'));
- });
-
- it('should rename the title', function () {
- var dom;
- var initial_title;
- var new_title;
- dom = cheerio.load(fs.readFileSync(files.input));
- initial_title = dom('#subheader > h1').first().html();
- assert.notStrictEqual(sut.header_title, initial_title);
- sut.run(files.input);
- dom = cheerio.load(fs.readFileSync(files.output));
- new_title = dom('#subheader > h1').first().html();
- assert.strictEqual(sut.header_title, new_title);
- });
-
- it('should rename the file', function () {
- assert.strictEqual(true, fs.existsSync(files.input));
- assert.strictEqual(false, fs.existsSync(files.output));
- var result = sut.run(files.input); // eslint-disable-line no-unused-vars
- assert.strictEqual(false, fs.existsSync(files.input));
- assert.strictEqual(true, fs.existsSync(files.output));
- });
- });
-}());
diff --git a/tools/spec/cordova/update_index_spec/index.md.html b/tools/spec/cordova/update_index_spec/index.md.html
deleted file mode 100644
index 3e025fc..0000000
--- a/tools/spec/cordova/update_index_spec/index.md.html
+++ /dev/null
@@ -1,112 +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.
--->
-
-<!DOCTYPE html>
-<html lang="en">
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
- <meta name="viewport" content="initial-scale=1.0, maximum-scale=1.0, user-scalable=no, width=device-width">
- <meta name="generator" content="joDoc">
- <link rel="stylesheet" type="text/css" href="index.css">
- <link rel="stylesheet" type="text/css" href="mobile.css" media="only screen and (max-device-width: 1024px)">
- <title>PhoneGap API Documentation</title>
- </head>
- <body>
-
- <div id="header">
- <h1><a href="index.html">Phone<strong>Gap</strong> Documentation</a></h1>
- <small></small>
- </div>
- <div id="subheader">
- <h1>Geolocation</h1>
- <small></small>
- </div>
-
- <div id="sidebar">
- <div class="vertical_divider"></div>
- <h1>API Reference</h1>
- <ul>
- <li><a href="phonegap_accelerometer_accelerometer.md.html">Accelerometer</a></li>
- <li><a href="phonegap_camera_camera.md.html">Camera</a></li>
- <li><a href="phonegap_media_capture.md.html">Capture</a></li>
- <li><a href="phonegap_device_device.md.html">Device</a></li>
- <li><a href="phonegap_events_events.md.html">Events</a></li>
- <li><a href="phonegap_file_file.md.html">File</a></li>
- <li><a href="phonegap_geolocation_geolocation.md.html">Geolocation</a></li>
- <li><a href="phonegap_media_media.md.html">Media</a></li>
- <li><a href="phonegap_notification_notification.md.html">Notification</a></li>
- <li><a href="phonegap_storage_storage.md.html">Storage</a></li>
- </ul>
- <h1></h1>
- <ul>
- <li><a href="_index.html">Keyword Index</a></li>
- </ul>
- </div>
-
- <div id="content">
- <div id="old-home">
- <h1><a name="API Reference">API Reference</a></h1>
- <ul>
- <li>
- <h2><a href="phonegap_accelerometer_accelerometer.md.html#Accelerometer">Accelerometer</a></h2>
- <span>Tap into the device's motion sensor.</span>
- </li>
- <li>
- <h2><a href="phonegap_camera_camera.md.html#Camera">Camera</a></h2>
- <span>Capture photo using the device's camera.</span>
- </li>
- <li>
- <h2><a href="phonegap_media_capture.md.html#Capture">Capture</a></h2>
- <span>Capture media using device applications.</span>
- </li>
- <li>
- <h2><a href="phonegap_device_device.md.html#Device">Device</a></h2>
- <span>Gather device specific information.</span>
- </li>
- <li>
- <h2><a href="phonegap_events_events.md.html#Events">Events</a></h2>
- <span>Hook into native events through JavaScript.</span>
- </li>
- <li>
- <h2><a href="phonegap_file_file.md.html#File">File</a></h2>
- <span>Hook into native file system through JavaScript.</span>
- </li>
- <li>
- <h2><a href="phonegap_geolocation_geolocation.md.html#Geolocation">Geolocation</a></h2>
- <span>Make your application location aware.</span>
- </li>
- <li>
- <h2><a href="phonegap_media_media.md.html#Media">Media</a></h2>
- <span>Record and play back audio.</span>
- </li>
- <li>
- <h2><a href="phonegap_notification_notification.md.html#Notification">Notification</a></h2>
- <span>Visual, audible, and tactile device notifications.</span>
- </li>
- <li>
- <h2><a href="phonegap_storage_storage.md.html#Storage">Storage</a></h2>
- <span>Hook into the native devices storage options.</span>
- </li>
- </ul>
-</div>
-
- </div>
-
- </body>
-</html>
diff --git a/tools/spec/cordova/update_keyword_index_spec.js b/tools/spec/cordova/update_keyword_index_spec.js
deleted file mode 100644
index 3bc5efd..0000000
--- a/tools/spec/cordova/update_keyword_index_spec.js
+++ /dev/null
@@ -1,96 +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.
-*/
-/* jslint node: true */
-/* global describe, it, beforeEach, afterEach, after, before */ // eslint-disable-line no-unused-vars
-(function () {
- 'use strict';
- var assert = require('assert');
- var path = require('path');
- var fs = require('fs');
- var cheerio = require('cheerio');
- var UpdateKeywordIndex = require('../../lib/cordova/post/updatekeywordindex');
- var SpecHelpers = require('../spec_helpers');
-
- describe('UpdateKeywordIndex', function () {
- var sut,
- file;
-
- beforeEach(function (done) {
- var tmp_directory = SpecHelpers.create_tmp_directory_assets(module.filename);
- sut = new UpdateKeywordIndex();
- file = path.join(tmp_directory, '_index.html');
- done();
- });
-
- afterEach(function (done) {
- SpecHelpers.remove_tmp_directory();
- done();
- });
-
- it('should skip all files but _index.html', function () {
- assert.strictEqual(false, sut.run('index.md'));
- assert.strictEqual(false, sut.run('index.html'));
- assert.strictEqual(false, sut.run('index.htm'));
- assert.strictEqual(false, sut.run('_index.htm'));
- assert.strictEqual(false, sut.run('index.md.html'));
- });
-
- it('should rename the title', function () {
- var dom,
- initial_title,
- new_title;
- dom = cheerio.load(fs.readFileSync(file));
- initial_title = dom('#subheader > h1').first().html();
- assert.notStrictEqual(sut.header_title, initial_title);
- sut.run(file);
- dom = cheerio.load(fs.readFileSync(file));
- new_title = dom('#subheader > h1').first().html();
- assert.strictEqual(sut.header_title, new_title);
- });
-
- it('should rename the h1', function () {
- var dom,
- initial_title,
- new_title;
- dom = cheerio.load(fs.readFileSync(file));
- initial_title = dom('#content > h1').first().html();
- assert.notStrictEqual(sut.content_title, initial_title);
- sut.run(file);
- dom = cheerio.load(fs.readFileSync(file));
- new_title = dom('#content > h1').first().html();
- assert.strictEqual(sut.content_title, new_title);
- });
-
- it('should remove the <hr/>', function () {
- var dom;
- dom = cheerio.load(fs.readFileSync(file));
- assert.notStrictEqual(0, dom('#content > hr').length);
- sut.run(file);
- dom = cheerio.load(fs.readFileSync(file));
- assert.strictEqual(0, dom('#content > hr').length);
- });
-
- it('should update references from index.md.html to index.html', function () {
- var fileToSearch = 'index.md.html';
- assert.notStrictEqual(-1, fs.readFileSync(file).toString().indexOf(fileToSearch));
- sut.run(file);
- assert.strictEqual(-1, fs.readFileSync(file).toString().indexOf(fileToSearch));
- });
- });
-}());
diff --git a/tools/spec/cordova/update_keyword_index_spec/_index.html b/tools/spec/cordova/update_keyword_index_spec/_index.html
deleted file mode 100644
index ac5f59a..0000000
--- a/tools/spec/cordova/update_keyword_index_spec/_index.html
+++ /dev/null
@@ -1,155 +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.
--->
-
-<!DOCTYPE html>
-<html lang="en">
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
-<meta name="viewport" content="initial-scale=1.0, maximum-scale=1.0, user-scalable=no, width=device-width">
-<meta name="generator" content="joDoc">
-<link rel="stylesheet" type="text/css" href="index.css">
-<title>PhoneGap API Documentation</title>
-</head>
-<body>
-
- <div id="header">
- <h1>Phone<strong>Gap</strong> Documentation</h1>
- <small></small>
- </div>
- <div id="subheader">
- <h1>Index</h1>
- <small>
- <select><option>Quick Jump...</option>
-<option>Geolocation</option>
-<option>getCurrentPosition</option>
-<option> - Description</option>
-<option> - Quick Example</option>
-<option> - Full Example</option>
-<option> - iPhone Quirks</option>
-<option>watchPosition</option>
-<option> - Description</option>
-<option> - Quick Example</option>
-<option> - Full Example</option>
-<option> - iPhone Quirks</option>
-<option>clearWatch</option>
-<option> - Description</option>
-<option> - Quick Example</option>
-<option> - Full Example</option>
-<option> - iPhone Quirks</option></select></small>
- </div>
-
- <div id="sidebar">
- <div class="vertical_divider"></div>
- <h1>API Reference</h1>
- <ul>
-<li><a href="phonegap_accelerometer_accelerometer.md.html">Accelerometer</a></li>
- <li><a href="phonegap_camera_camera.md.html">Camera</a></li>
- <li><a href="phonegap_media_capture.md.html">Capture</a></li>
- <li><a href="phonegap_device_device.md.html">Device</a></li>
- <li><a href="phonegap_events_events.md.html">Events</a></li>
- <li><a href="phonegap_geolocation_geolocation.md.html">Geolocation</a></li>
- <li><a href="phonegap_notification_notification.md.html">Notification</a></li>
- </ul>
-<h1></h1>
- <ul>
-<li><a href="_index.html">Keyword Index</a></li>
- </ul>
-</div>
-
- <div id="content">
-
-
-<hr>
-<h1>Index</h1>
-<div id="index">
-
-<h2>A</h2>
-
-<ul>
-<li><a href="introduction.md.html#About">About</a></li>
-<li><a href="phonegap_accelerometer_accelerometer.md.html#Acceleration">Acceleration</a></li>
-<li><a href="phonegap_accelerometer_accelerometer.md.html#Accelerometer">Accelerometer</a></li>
-<li><a href="phonegap_accelerometer_accelerometer.md.html#accelerometer.clearWatch">accelerometer.clearWatch</a></li>
-<li><a href="phonegap_accelerometer_accelerometer.md.html#accelerometer.getCurrentAcceleration">accelerometer.getCurrentAcceleration</a></li>
-<li><a href="phonegap_accelerometer_accelerometer.md.html#accelerometer.watchAcceleration">accelerometer.watchAcceleration</a></li>
-<li><a href="phonegap_accelerometer_accelerometer.md.html#accelerometerError">accelerometerError</a></li>
-<li><a href="phonegap_accelerometer_accelerometer.md.html#accelerometerOptions">accelerometerOptions</a></li>
-<li><a href="phonegap_accelerometer_accelerometer.md.html#accelerometerSuccess">accelerometerSuccess</a></li>
-<li><a href="introduction.md.html#Application%20Template">Application Template</a></li>
-<li><a href="index.md.html#API%20Reference">API Reference</a></li>
-</ul>
-<h2>C</h2>
-
-<ul>
-<li><a href="phonegap_camera_camera.md.html#Camera">Camera</a></li>
-<li><a href="phonegap_camera_camera.md.html#camera.getPicture">camera.getPicture</a></li>
-<li><a href="phonegap_camera_camera.md.html#cameraError">cameraError</a></li>
-<li><a href="phonegap_camera_camera.md.html#cameraOptions">cameraOptions</a></li>
-<li><a href="phonegap_camera_camera.md.html#cameraSuccess">cameraSuccess</a></li>
-<li><a href="phonegap_geolocation_geolocation.md.html#Coordinates">Coordinates</a></li>
-</ul>
-<h2>D</h2>
-
-<ul>
-<li><a href="phonegap_device_device.md.html#Device">Device</a></li>
-<li><a href="phonegap_device_device.md.html#device.name">device.name</a></li>
-<li><a href="phonegap_device_device.md.html#device.platform">device.platform</a></li>
-<li><a href="phonegap_device_device.md.html#device.uuid">device.uuid</a></li>
-<li><a href="phonegap_device_device.md.html#device.version">device.version</a></li>
-<li><a href="phonegap_events_events.md.html#deviceready">deviceready</a></li>
-</ul>
-<h2>E</h2>
-
-<ul>
-<li><a href="phonegap_events_events.md.html#Events">Events</a></li>
-</ul>
-<h2>G</h2>
-
-<ul>
-<li><a href="phonegap_geolocation_geolocation.md.html#Geolocation">Geolocation</a></li>
-<li><a href="phonegap_geolocation_geolocation.md.html#geolocation.clearWatch">geolocation.clearWatch</a></li>
-<li><a href="phonegap_geolocation_geolocation.md.html#geolocation.getCurrentPosition">geolocation.getCurrentPosition</a></li>
-<li><a href="phonegap_geolocation_geolocation.md.html#geolocation.watchPosition">geolocation.watchPosition</a></li>
-<li><a href="phonegap_geolocation_geolocation.md.html#geolocationError">geolocationError</a></li>
-<li><a href="phonegap_geolocation_geolocation.md.html#geolocationOptions">geolocationOptions</a></li>
-<li><a href="phonegap_geolocation_geolocation.md.html#geolocationSuccess">geolocationSuccess</a></li>
-<li><a href="introduction.md.html#Getting%20Started">Getting Started</a></li>
-</ul>
-<h2>N</h2>
-
-<h2>P</h2>
-
-<ul>
-<li><a href="introduction.md.html#PhoneGap%20API%20Documentation">PhoneGap API Documentation</a></li>
-<li><a href="phonegap_geolocation_geolocation.md.html#Position">Position</a></li>
-</ul>
-<h2>R</h2>
-
-<ul>
-<li><a href="phonegap_network_network.md.html#reachableCallback">reachableCallback</a></li>
-<li><a href="phonegap_network_network.md.html#reachableHostname">reachableHostname</a></li>
-<li><a href="phonegap_network_network.md.html#reachableOptions">reachableOptions</a></li>
-</ul>
-</div>
-
-
- </div>
-
- </body>
-</html>
diff --git a/tools/spec/cordova/yaml_front_matter_spec.js b/tools/spec/cordova/yaml_front_matter_spec.js
deleted file mode 100644
index b595e00..0000000
--- a/tools/spec/cordova/yaml_front_matter_spec.js
+++ /dev/null
@@ -1,66 +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.
-*/
-/* jslint node: true */
-/* global describe, it, beforeEach, afterEach, after, before */ // eslint-disable-line no-unused-vars
-(function () {
- 'use strict';
- var assert = require('assert');
- var path = require('path');
- var fs = require('fs');
- var YamlFrontMatter = require('../../lib/cordova/pre/yamlfrontmatter');
- var SpecHelpers = require('../spec_helpers');
-
- describe('YamlFrontMatter', function () {
- var sut,
- files;
-
- beforeEach(function (done) {
- var tmp_directory = SpecHelpers.create_tmp_directory_assets(module.filename);
- sut = new YamlFrontMatter();
- files = {
- 'yaml': path.join(tmp_directory, 'has_yaml.md'),
- 'no_yaml': path.join(tmp_directory, 'no_yaml.md')
- };
- done();
- });
-
- afterEach(function (done) {
- SpecHelpers.remove_tmp_directory();
- done();
- });
-
- it('should skip files with no YAML Front Matter', function () {
- var expected_data = fs.readFileSync(files.no_yaml, 'utf8');
- var data;
- var actual_data;
- data = sut.run(files.no_yaml);
- assert.deepEqual({}, data);
- actual_data = fs.readFileSync(files.no_yaml, 'utf8');
- assert.strictEqual(expected_data, actual_data);
- });
-
- it('should parse files with YAML Front Matter', function () {
- var data = sut.run(files.yaml);
- assert.deepEqual({
- 'platforms': 'Android, BlackBerry, iOS',
- 'type': 'Function'
- }, data);
- });
- });
-}());
diff --git a/tools/spec/cordova/yaml_front_matter_spec/has_yaml.md b/tools/spec/cordova/yaml_front_matter_spec/has_yaml.md
deleted file mode 100644
index 6f3e750..0000000
--- a/tools/spec/cordova/yaml_front_matter_spec/has_yaml.md
+++ /dev/null
@@ -1,13 +0,0 @@
----
-platforms: Android, BlackBerry, iOS
-type: Function
----
-
-
-
-
-
-PhoneGap
-========
-
-It's a fun place to be
\ No newline at end of file
diff --git a/tools/spec/cordova/yaml_front_matter_spec/no_yaml.md b/tools/spec/cordova/yaml_front_matter_spec/no_yaml.md
deleted file mode 100644
index d8b5837..0000000
--- a/tools/spec/cordova/yaml_front_matter_spec/no_yaml.md
+++ /dev/null
@@ -1,4 +0,0 @@
-PhoneGap II
-===========
-
-The return of the system admin.
\ No newline at end of file
diff --git a/tools/spec/file_helpers_spec.js b/tools/spec/file_helpers_spec.js
deleted file mode 100644
index 8772186..0000000
--- a/tools/spec/file_helpers_spec.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.
-*/
-/* jslint node: true */
-/* global describe, it, beforeEach */
-(function () {
- 'use strict';
- var assert = require('assert');
- var fs = require('fs');
- var FileHelpers = require('../lib/file_helpers');
-
- describe('FileHelpers', function () {
- xit('should have a default input directory that exists', function () {
- assert.equal(true, fs.existsSync(FileHelpers.getDefaultInputDirectory()));
- });
- });
-}());
diff --git a/tools/spec/spec_helpers.js b/tools/spec/spec_helpers.js
deleted file mode 100644
index 68de27b..0000000
--- a/tools/spec/spec_helpers.js
+++ /dev/null
@@ -1,100 +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.
-*/
-/* jslint node: true */
-var fs = require('fs-extra');
-var path = require('path');
-var FileHelpers = require('../lib/file_helpers');
-
-var SpecHelpers = (function () {
- 'use strict';
-
- /**
- * Creates a new instance of SpecHelpers
- * @param options Options for the generation process.
- */
- function SpecHelpers () {
- }
-
- SpecHelpers.create_tmp_directory_assets = function (reference_filename) {
- var directories;
- if (reference_filename === null || reference_filename === undefined) {
- directories = {
- source: SpecHelpers.docs_directory(),
- destination: SpecHelpers.tmp_docs_directory()
- };
- } else {
- directories = SpecHelpers.find_test_directories(reference_filename);
- }
-
- if (directories !== null) {
- fs.copySync(directories.source, directories.destination);
- }
-
- return directories.destination;
- };
-
- SpecHelpers.find_test_directories = function (filename) {
- var extension = path.extname(filename);
- var source_directory = filename.replace(extension, '');
- var destination_directory = path.join(SpecHelpers.tmp_directory(), path.basename(source_directory));
-
- if (!fs.existsSync(source_directory)) {
- console.warn('The directory ' + source_directory + ' not present');
- return null;
- }
-
- return {
- source: source_directory,
- destination: destination_directory
- };
- };
-
- SpecHelpers.tmp_public_directory = function () {
- return path.join(SpecHelpers.tmp_directory(), 'public');
- };
-
- SpecHelpers.docs_directory = function () {
- return FileHelpers.getDefaultInputDirectory();
- };
-
- SpecHelpers.tmp_docs_directory = function () {
- return path.join(SpecHelpers.tmp_directory(), 'docs');
- };
-
- /**
- * Gets temporary directory for running specs.
- */
- SpecHelpers.tmp_directory = function () {
- return path.resolve(path.join(SpecHelpers.root_directory(), '..', 'tmp_spec'));
- };
-
- /**
- * Root directory for the project.
- */
- SpecHelpers.root_directory = function () {
- return path.resolve(path.dirname(module.filename));
- };
-
- SpecHelpers.remove_tmp_directory = function () {
- fs.removeSync(SpecHelpers.tmp_directory());
- };
-
- return SpecHelpers;
-}());
-module.exports = SpecHelpers;