You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by db...@apache.org on 2015/07/24 00:21:06 UTC
[62/75] docs commit: Moved tools to tools/ and added some tools for
new doc pipeline.
http://git-wip-us.apache.org/repos/asf/cordova-docs/blob/5f554950/spec/cordova/table_of_contents_spec.js
----------------------------------------------------------------------
diff --git a/spec/cordova/table_of_contents_spec.js b/spec/cordova/table_of_contents_spec.js
deleted file mode 100644
index f537b83..0000000
--- a/spec/cordova/table_of_contents_spec.js
+++ /dev/null
@@ -1,124 +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 assert = require("assert"),
- path = require('path'),
- fs = require('fs'),
- esrever = require('esrever'),
- cheerio = require('cheerio'),
- TableOfContents = require("../../lib/cordova/post/tableofcontents"),
- SpecHelpers = require("../spec_helpers");
-
- describe('TableOfContents', function () {
- var sut,
- 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)),
- 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)),
- result = sut.run(files.normal, dom),
- 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)),
- result = sut.run(files.normal, dom),
- 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)),
- result = sut.run(files.normal, dom),
- names = [],
- 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(),
- resultElement = result.shift(),
- resultElementHtml = resultElement.toString(),
- valueMatch = resultElementHtml.match(/value=\"([^\"]*)\"/);
- 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)),
- result = sut.run(files.normal, dom);
-
- 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)),
- 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)),
- result = sut.run(files.no_target, dom);
- assert.ok(null === result, "Find something when should not");
- });
- });
-}());
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/cordova-docs/blob/5f554950/spec/cordova/table_of_contents_spec/example.html
----------------------------------------------------------------------
diff --git a/spec/cordova/table_of_contents_spec/example.html b/spec/cordova/table_of_contents_spec/example.html
deleted file mode 100644
index 94db5fa..0000000
--- a/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>
http://git-wip-us.apache.org/repos/asf/cordova-docs/blob/5f554950/spec/cordova/table_of_contents_spec/example_no_source.html
----------------------------------------------------------------------
diff --git a/spec/cordova/table_of_contents_spec/example_no_source.html b/spec/cordova/table_of_contents_spec/example_no_source.html
deleted file mode 100644
index 4dab85c..0000000
--- a/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>
http://git-wip-us.apache.org/repos/asf/cordova-docs/blob/5f554950/spec/cordova/table_of_contents_spec/example_no_target.html
----------------------------------------------------------------------
diff --git a/spec/cordova/table_of_contents_spec/example_no_target.html b/spec/cordova/table_of_contents_spec/example_no_target.html
deleted file mode 100644
index f6d6179..0000000
--- a/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>
http://git-wip-us.apache.org/repos/asf/cordova-docs/blob/5f554950/spec/cordova/update_index_spec.js
----------------------------------------------------------------------
diff --git a/spec/cordova/update_index_spec.js b/spec/cordova/update_index_spec.js
deleted file mode 100644
index 5fee632..0000000
--- a/spec/cordova/update_index_spec.js
+++ /dev/null
@@ -1,77 +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 assert = require("assert"),
- path = require('path'),
- fs = require('fs'),
- cheerio = require('cheerio'),
- UpdateIndex = require("../../lib/cordova/post/updateindex"),
- SpecHelpers = require("../spec_helpers");
-
- describe('UpdateIndex', function () {
- var sut,
- 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 testing_file = files.normal,
- dom,
- initial_title,
- 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);
- assert.strictEqual(false, fs.existsSync(files.input));
- assert.strictEqual(true, fs.existsSync(files.output));
- });
- });
-}());
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/cordova-docs/blob/5f554950/spec/cordova/update_index_spec/index.md.html
----------------------------------------------------------------------
diff --git a/spec/cordova/update_index_spec/index.md.html b/spec/cordova/update_index_spec/index.md.html
deleted file mode 100644
index 5a81724..0000000
--- a/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="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>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/cordova-docs/blob/5f554950/spec/cordova/update_keyword_index_spec.js
----------------------------------------------------------------------
diff --git a/spec/cordova/update_keyword_index_spec.js b/spec/cordova/update_keyword_index_spec.js
deleted file mode 100644
index 6ff1061..0000000
--- a/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 */
-(function () {
- 'use strict';
- var assert = require("assert"),
- path = require('path'),
- fs = require('fs'),
- cheerio = require('cheerio'),
- UpdateKeywordIndex = require("../../lib/cordova/post/updatekeywordindex"),
- 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));
- });
- });
-}());
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/cordova-docs/blob/5f554950/spec/cordova/update_keyword_index_spec/_index.html
----------------------------------------------------------------------
diff --git a/spec/cordova/update_keyword_index_spec/_index.html b/spec/cordova/update_keyword_index_spec/_index.html
deleted file mode 100644
index ac5f59a..0000000
--- a/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>
http://git-wip-us.apache.org/repos/asf/cordova-docs/blob/5f554950/spec/cordova/yaml_front_matter_spec.js
----------------------------------------------------------------------
diff --git a/spec/cordova/yaml_front_matter_spec.js b/spec/cordova/yaml_front_matter_spec.js
deleted file mode 100644
index 1e9b359..0000000
--- a/spec/cordova/yaml_front_matter_spec.js
+++ /dev/null
@@ -1,67 +0,0 @@
-/*
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied. See the License for the
- specific language governing permissions and limitations
- under the License.
-*/
-/*jslint node: true */
-/*global describe, it, beforeEach, afterEach, after, before */
-(function () {
- 'use strict';
- var assert = require("assert"),
- path = require('path'),
- fs = require('fs'),
- cheerio = require('cheerio'),
- YamlFrontMatter = require("../../lib/cordova/pre/yamlfrontmatter"),
- 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"),
- data,
- 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);
- });
- });
-}());
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/cordova-docs/blob/5f554950/spec/cordova/yaml_front_matter_spec/has_yaml.md
----------------------------------------------------------------------
diff --git a/spec/cordova/yaml_front_matter_spec/has_yaml.md b/spec/cordova/yaml_front_matter_spec/has_yaml.md
deleted file mode 100644
index 6f3e750..0000000
--- a/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
http://git-wip-us.apache.org/repos/asf/cordova-docs/blob/5f554950/spec/cordova/yaml_front_matter_spec/no_yaml.md
----------------------------------------------------------------------
diff --git a/spec/cordova/yaml_front_matter_spec/no_yaml.md b/spec/cordova/yaml_front_matter_spec/no_yaml.md
deleted file mode 100644
index d8b5837..0000000
--- a/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
http://git-wip-us.apache.org/repos/asf/cordova-docs/blob/5f554950/spec/file_helpers_spec.js
----------------------------------------------------------------------
diff --git a/spec/file_helpers_spec.js b/spec/file_helpers_spec.js
deleted file mode 100644
index 5eceb42..0000000
--- a/spec/file_helpers_spec.js
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied. See the License for the
- specific language governing permissions and limitations
- under the License.
-*/
-/*jslint node: true*/
-/*global describe, it, beforeEach */
-(function () {
- 'use strict';
- var assert = require("assert"),
- path = require('path'),
- fs = require('fs'),
- FileHelpers = require("../lib/file_helpers");
-
- describe('FileHelpers', function () {
- it('should have a default input directory that exists', function () {
- assert.equal(true, fs.existsSync(FileHelpers.getDefaultInputDirectory()));
- });
- });
-}());
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/cordova-docs/blob/5f554950/spec/spec_helpers.js
----------------------------------------------------------------------
diff --git a/spec/spec_helpers.js b/spec/spec_helpers.js
deleted file mode 100644
index c61ae7a..0000000
--- a/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),
- source_directory = filename.replace(extension, ''),
- 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;
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/cordova-docs/blob/5f554950/tools/bin/count_files.py
----------------------------------------------------------------------
diff --git a/tools/bin/count_files.py b/tools/bin/count_files.py
new file mode 100755
index 0000000..cac89ea
--- /dev/null
+++ b/tools/bin/count_files.py
@@ -0,0 +1,21 @@
+import os
+import sys
+
+def main():
+ counts = {}
+
+ for root_path, dir_names, file_names in os.walk(sys.argv[1]):
+ for file_name in file_names:
+
+ name, extension = os.path.splitext(file_name)
+
+ if extension not in counts:
+ counts[extension] = 0
+
+ counts[extension] += 1
+
+ for extension, count in counts.items():
+ print "{0:>10} = {1:<30}".format(repr(extension), count)
+
+if __name__ == '__main__':
+ main()
http://git-wip-us.apache.org/repos/asf/cordova-docs/blob/5f554950/tools/bin/fix_license.py
----------------------------------------------------------------------
diff --git a/tools/bin/fix_license.py b/tools/bin/fix_license.py
new file mode 100644
index 0000000..5b31935
--- /dev/null
+++ b/tools/bin/fix_license.py
@@ -0,0 +1,134 @@
+# -*- coding: utf-8 -*-
+
+import os
+import sys
+import json
+import re
+import shutil
+
+from util import *
+
+# constants
+CONFIG_FILE_NAME = 'config.json'
+LICENSE_LINK = 'http://www.apache.org/licenses/LICENSE-2.0'
+
+HEADER = '''---
+license: >
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+---
+'''
+
+MAX_LICENSE_SIZE = 1600 # in chars
+
+def find_marker(text, markers, start=0):
+ for marker in markers:
+ try:
+ return marker, text.index(marker, start)
+ except ValueError as e:
+ continue
+ return None, 0
+
+def strip_license(text):
+
+ start_markers = [
+ '---',
+ '* * *',
+ ]
+
+ end_markers = [
+ '---',
+ '## under the License.',
+ '## unter der Lizenz.',
+ '## aux termes de la licence.',
+ '## bajo la licencia.',
+ '## con la licenza.',
+ '## ライセンス。',
+ '## 라이센스.',
+ '## na licencji.',
+ '## 根據許可證。',
+ '* * *',
+ ]
+
+ first_marker, first_index = find_marker(text, start_markers)
+
+ if first_marker is None:
+ return text
+
+ second_marker, second_index = find_marker(text, end_markers, first_index + len(first_marker))
+
+ if second_index == first_index:
+ return text
+
+ if second_marker is None:
+ return text
+
+ if second_index - first_index > MAX_LICENSE_SIZE:
+ return text
+
+ start = second_index + len(second_marker)
+ return text[start:]
+
+def fix_file(file_path):
+
+ content = ''
+ print file_path
+
+ with open(file_path, 'r') as target_file:
+ content = target_file.read()
+
+ content = strip_license(content)
+ content = HEADER + content
+
+ with open(file_path, 'w') as target_file:
+ target_file.write(content)
+
+ # check that the output contains exactly one license
+ if content.lower().count(LICENSE_LINK.lower()) != 1:
+ return False
+
+ return True
+
+def main():
+
+ base_path = sys.argv[1]
+ num_files = 0
+ bad_files = []
+
+ # walk the whole doc tree
+ for root_path, dir_names, file_names in os.walk(base_path):
+ for file_name in file_names:
+
+ if not file_name.endswith('.md'):
+ continue
+
+ file_path = os.path.join(root_path, file_name)
+ passed = fix_file(file_path)
+ num_files += 1
+
+ if not passed:
+ bad_files.append(file_path)
+
+ print 'processed', num_files, 'files'
+
+ if len(bad_files) > 0:
+ print 'bad merges'
+ for file_path in bad_files:
+ print '\033[31m' + file_path + '\033[m'
+
+if __name__ == '__main__':
+ main()
http://git-wip-us.apache.org/repos/asf/cordova-docs/blob/5f554950/tools/bin/fixyaml
----------------------------------------------------------------------
diff --git a/tools/bin/fixyaml b/tools/bin/fixyaml
new file mode 100644
index 0000000..c1a8876
--- /dev/null
+++ b/tools/bin/fixyaml
@@ -0,0 +1,65 @@
+#!/usr/bin/env node
+
+/*
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+*/
+/*jslint node:true, nomen: true */
+
+var yargs = require('yargs')
+ .count("verbose")
+ .alias('v', 'verbose')
+ .describe('verbose', 'Increase verbosity level of produced output')
+ .describe('source', 'Path to the documentation sources. Default: public')
+ .usage('Usage: $0 [-v] [lang] [version] [--edge]\n' + +
+ 'Fix the output which is produced by CrowdIn for MD files\n' +
+ '\n' +
+ ' <lang>: Language for which fix YAML header. If not specified then fixed for all languages.\n' +
+ ' <version>: Version for which fix YAML header. If not specified then fixed all versions.\n')
+ .usage('Usage: $0\n' +
+ 'Fix the output which is produced by CrowdIn for MD files');
+var argv = yargs.argv;
+
+if (argv.help) {
+ yargs.showHelp();
+ process.exit(1);
+}
+
+var language = null;
+var version = null;
+if (argv.edge) {
+ language = null;
+ version = "edge";
+} else {
+ var argumentsCount = argv._.length;
+ if (argumentsCount !== 0) {
+ if (argumentsCount === 2) {
+ language = argv._[0];
+ version = argv._[1];
+ } else {
+ var data = argv._[0];
+ if (data.length === 2) {
+ language = data;
+ } else {
+ version = data;
+ }
+ }
+ }
+}
+
+var validator = require('../lib/docs_validator');
+new validator().fixYamlHeader(argv.source, language, version, argv.verbose);
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/cordova-docs/blob/5f554950/tools/bin/fixyaml.bat
----------------------------------------------------------------------
diff --git a/tools/bin/fixyaml.bat b/tools/bin/fixyaml.bat
new file mode 100644
index 0000000..2c68254
--- /dev/null
+++ b/tools/bin/fixyaml.bat
@@ -0,0 +1,26 @@
+:: Licensed to the Apache Software Foundation (ASF) under one
+:: or more contributor license agreements. See the NOTICE file
+:: distributed with this work for additional information
+:: regarding copyright ownership. The ASF licenses this file
+:: to you under the Apache License, Version 2.0 (the
+:: "License"); you may not use this file except in compliance
+:: with the License. You may obtain a copy of the License at
+::
+:: http://www.apache.org/licenses/LICENSE-2.0
+::
+:: Unless required by applicable law or agreed to in writing,
+:: software distributed under the License is distributed on an
+:: "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+:: KIND, either express or implied. See the License for the
+:: specific language governing permissions and limitations
+:: under the License.
+
+@ECHO OFF
+SET script_path="%~dp0fixyaml"
+IF EXIST %script_path% (
+ node "%script_path%" %*
+) ELSE (
+ ECHO.
+ ECHO ERROR: Could not find 'fixyaml' script in 'bin' folder, aborting...>&2
+ EXIT /B 1
+)
\ No newline at end of file
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org