- Use JSDoc for code documentation for following reasons:
JSDoc
parses code-tree, which means smart code analysis, internal linking and less comments verbosity in code,JSDoc
is extensible via JS plugins,JSDoc
presentation is customizable via templates,- Existing code uses
JSDoc
format mostly;
- Use either
JSDoc
or jsdoc-to-markdown to generate documentation HTML/md,- In case of
jsdoc-to-markdown
we will need to set up code linking (it is included byJSDoc
by default but not byjsdoc-to-markdown
);
- In case of
- Create
JSDoc
plugin for handling Cordova-specific tags likesupported-platforms
,quirks
(orwindows-quirks
,android-quirks
, ...), etc., - Investigate possibility: Link to quirks/examples (similar to tutorial tag) instead of inlining to reduce noise in
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* | |
* 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 | |
* |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// file: F:/coho/cordova-windows/cordova-js-src/confighelper.js | |
define("cordova/confighelper", function(require, exports, module) { | |
// config.xml wrapper (non-node ConfigParser analogue) | |
var config, doc; | |
var utils = require("cordova/utils"); | |
var isPhone = (cordova.platformId == 'windows') && WinJS.Utilities.isPhone; | |
var isWin10UWP = navigator.appVersion.indexOf('MSAppHost/3.0') !== -1; | |
var manifestFilePath = isWin10UWP ? "/package.windows10.appxmanifest" : (isPhone ? "/package.phone.appxmanifest" : "/package.windows.appxmanifest"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(get-content config.xml) | foreach-object { | |
$wordToFind='windows-target-version' | |
$containsWord=$_ -match $wordToFind | |
If($containsWord -contains $true) { | |
$_ -replace '(<preference name=\"windows-target-version\" value=\")([^\"]+)(\" \/><\/widget>)', '${1}10.0${3}' | |
} Else { | |
$_ -replace '<\/widget>', '<preference name="windows-target-version" value="10.0" /></widget>' | |
} | |
} | set-content config.xml |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
adb logcat | Select-String (adb shell ps | findstr io.cordova.hellocordova).Split("", [System.StringSplitOptions]::RemoveEmptyEntries)[1] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
webView.addEventListener("MSWebViewScriptNotify", scriptNotify); | |
... | |
function scriptNotify(e) { | |
console.log('scriptNotify e: ' + e.value); | |
var opts = JSON.parse(e.value); | |
var callbackId = opts.callbackId; | |
var exec = cordova.require('cordova/exec'); | |
function success(result, callbackOptions) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Create project, add platforms and plugin, copy www contents from template, run different platforms: | |
cdv create test | |
cd test | |
cdv platform add windows | |
cdv platform add wp8 | |
cdv plugin add "..\cordova-plugin-globalization" | |
rmdir /s /q www | |
echo d | xcopy /e /v ..\template\www www | |
cdv run windows | |
cdv run wp8 |
To create mobilespec from scratch use these commands (as Administrator):
Note: There should not be any spaces in the root path!
git clone https://github.com/apache/cordova-mobile-spec
cd cordova-mobile-spec\createmobilespec\
npm install
cd ..\..
git clone https://git-wip-us.apache.org/repos/asf/cordova-coho.git
cd cordova-coho\
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cordova.define("org.apache.cordova.battery-status.Battery", function(require, exports, module) { /* | |
* | |
* 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 | |
* |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cordova.define("org.apache.cordova.battery-status.Battery", function (require, exports, module) { /* | |
* | |
* 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 | |
* |
NewerOlder