fix hooks, and ios resources
This commit is contained in:
Родитель
fc76b8b15d
Коммит
48fd56f02f
106
config.xml
106
config.xml
|
@ -13,66 +13,66 @@
|
|||
<allow-intent href="geo:*" />
|
||||
<platform name="android">
|
||||
<allow-intent href="market:*" />
|
||||
<icon src="resources\android\icon\drawable-ldpi-icon.png" density="ldpi" />
|
||||
<icon src="resources\android\icon\drawable-mdpi-icon.png" density="mdpi" />
|
||||
<icon src="resources\android\icon\drawable-hdpi-icon.png" density="hdpi" />
|
||||
<icon src="resources\android\icon\drawable-xhdpi-icon.png" density="xhdpi" />
|
||||
<icon src="resources\android\icon\drawable-xxhdpi-icon.png" density="xxhdpi" />
|
||||
<icon src="resources\android\icon\drawable-xxxhdpi-icon.png" density="xxxhdpi" />
|
||||
<splash src="resources\android\splash\drawable-land-ldpi-screen.png" density="land-ldpi" />
|
||||
<splash src="resources\android\splash\drawable-land-mdpi-screen.png" density="land-mdpi" />
|
||||
<splash src="resources\android\splash\drawable-land-hdpi-screen.png" density="land-hdpi" />
|
||||
<splash src="resources\android\splash\drawable-land-xhdpi-screen.png" density="land-xhdpi" />
|
||||
<splash src="resources\android\splash\drawable-land-xxhdpi-screen.png" density="land-xxhdpi" />
|
||||
<splash src="resources\android\splash\drawable-land-xxxhdpi-screen.png" density="land-xxxhdpi" />
|
||||
<splash src="resources\android\splash\drawable-port-ldpi-screen.png" density="port-ldpi" />
|
||||
<splash src="resources\android\splash\drawable-port-mdpi-screen.png" density="port-mdpi" />
|
||||
<splash src="resources\android\splash\drawable-port-hdpi-screen.png" density="port-hdpi" />
|
||||
<splash src="resources\android\splash\drawable-port-xhdpi-screen.png" density="port-xhdpi" />
|
||||
<splash src="resources\android\splash\drawable-port-xxhdpi-screen.png" density="port-xxhdpi" />
|
||||
<splash src="resources\android\splash\drawable-port-xxxhdpi-screen.png" density="port-xxxhdpi" />
|
||||
<icon src="resources/android/icon/drawable-ldpi-icon.png" density="ldpi" />
|
||||
<icon src="resources/android/icon/drawable-mdpi-icon.png" density="mdpi" />
|
||||
<icon src="resources/android/icon/drawable-hdpi-icon.png" density="hdpi" />
|
||||
<icon src="resources/android/icon/drawable-xhdpi-icon.png" density="xhdpi" />
|
||||
<icon src="resources/android/icon/drawable-xxhdpi-icon.png" density="xxhdpi" />
|
||||
<icon src="resources/android/icon/drawable-xxxhdpi-icon.png" density="xxxhdpi" />
|
||||
<splash src="resources/android/splash/drawable-land-ldpi-screen.png" density="land-ldpi" />
|
||||
<splash src="resources/android/splash/drawable-land-mdpi-screen.png" density="land-mdpi" />
|
||||
<splash src="resources/android/splash/drawable-land-hdpi-screen.png" density="land-hdpi" />
|
||||
<splash src="resources/android/splash/drawable-land-xhdpi-screen.png" density="land-xhdpi" />
|
||||
<splash src="resources/android/splash/drawable-land-xxhdpi-screen.png" density="land-xxhdpi" />
|
||||
<splash src="resources/android/splash/drawable-land-xxxhdpi-screen.png" density="land-xxxhdpi" />
|
||||
<splash src="resources/android/splash/drawable-port-ldpi-screen.png" density="port-ldpi" />
|
||||
<splash src="resources/android/splash/drawable-port-mdpi-screen.png" density="port-mdpi" />
|
||||
<splash src="resources/android/splash/drawable-port-hdpi-screen.png" density="port-hdpi" />
|
||||
<splash src="resources/android/splash/drawable-port-xhdpi-screen.png" density="port-xhdpi" />
|
||||
<splash src="resources/android/splash/drawable-port-xxhdpi-screen.png" density="port-xxhdpi" />
|
||||
<splash src="resources/android/splash/drawable-port-xxxhdpi-screen.png" density="port-xxxhdpi" />
|
||||
</platform>
|
||||
<platform name="ios">
|
||||
<allow-intent href="itms:*" />
|
||||
<allow-intent href="itms-apps:*" />
|
||||
<icon src="resources\ios\icon\icon.png" width="57" height="57" />
|
||||
<icon src="resources\ios\icon\icon@2x.png" width="114" height="114" />
|
||||
<icon src="resources\ios\icon\icon-40.png" width="40" height="40" />
|
||||
<icon src="resources\ios\icon\icon-40@2x.png" width="80" height="80" />
|
||||
<icon src="resources\ios\icon\icon-40@3x.png" width="120" height="120" />
|
||||
<icon src="resources\ios\icon\icon-50.png" width="50" height="50" />
|
||||
<icon src="resources\ios\icon\icon-50@2x.png" width="100" height="100" />
|
||||
<icon src="resources\ios\icon\icon-60.png" width="60" height="60" />
|
||||
<icon src="resources\ios\icon\icon-60@2x.png" width="120" height="120" />
|
||||
<icon src="resources\ios\icon\icon-60@3x.png" width="180" height="180" />
|
||||
<icon src="resources\ios\icon\icon-72.png" width="72" height="72" />
|
||||
<icon src="resources\ios\icon\icon-72@2x.png" width="144" height="144" />
|
||||
<icon src="resources\ios\icon\icon-76.png" width="76" height="76" />
|
||||
<icon src="resources\ios\icon\icon-76@2x.png" width="152" height="152" />
|
||||
<icon src="resources\ios\icon\icon-83.5@2x.png" width="167" height="167" />
|
||||
<icon src="resources\ios\icon\icon-small.png" width="29" height="29" />
|
||||
<icon src="resources\ios\icon\icon-small@2x.png" width="58" height="58" />
|
||||
<icon src="resources\ios\icon\icon-small@3x.png" width="87" height="87" />
|
||||
<splash src="resources\ios\splash\Default-568h@2x~iphone.png" width="640" height="1136" />
|
||||
<splash src="resources\ios\splash\Default-667h.png" width="750" height="1334" />
|
||||
<splash src="resources\ios\splash\Default-736h.png" width="1242" height="2208" />
|
||||
<splash src="resources\ios\splash\Default-Landscape-736h.png" width="2208" height="1242" />
|
||||
<splash src="resources\ios\splash\Default-Landscape@2x~ipad.png" width="2048" height="1536" />
|
||||
<splash src="resources\ios\splash\Default-Landscape~ipad.png" width="1024" height="768" />
|
||||
<splash src="resources\ios\splash\Default-Portrait@2x~ipad.png" width="1536" height="2048" />
|
||||
<splash src="resources\ios\splash\Default-Portrait~ipad.png" width="768" height="1024" />
|
||||
<splash src="resources\ios\splash\Default@2x~iphone.png" width="640" height="960" />
|
||||
<splash src="resources\ios\splash\Default~iphone.png" width="320" height="480" />
|
||||
<icon src="resources/ios/icon/icon.png" width="57" height="57" />
|
||||
<icon src="resources/ios/icon/icon@2x.png" width="114" height="114" />
|
||||
<icon src="resources/ios/icon/icon-40.png" width="40" height="40" />
|
||||
<icon src="resources/ios/icon/icon-40@2x.png" width="80" height="80" />
|
||||
<icon src="resources/ios/icon/icon-40@3x.png" width="120" height="120" />
|
||||
<icon src="resources/ios/icon/icon-50.png" width="50" height="50" />
|
||||
<icon src="resources/ios/icon/icon-50@2x.png" width="100" height="100" />
|
||||
<icon src="resources/ios/icon/icon-60.png" width="60" height="60" />
|
||||
<icon src="resources/ios/icon/icon-60@2x.png" width="120" height="120" />
|
||||
<icon src="resources/ios/icon/icon-60@3x.png" width="180" height="180" />
|
||||
<icon src="resources/ios/icon/icon-72.png" width="72" height="72" />
|
||||
<icon src="resources/ios/icon/icon-72@2x.png" width="144" height="144" />
|
||||
<icon src="resources/ios/icon/icon-76.png" width="76" height="76" />
|
||||
<icon src="resources/ios/icon/icon-76@2x.png" width="152" height="152" />
|
||||
<icon src="resources/ios/icon/icon-83.5@2x.png" width="167" height="167" />
|
||||
<icon src="resources/ios/icon/icon-small.png" width="29" height="29" />
|
||||
<icon src="resources/ios/icon/icon-small@2x.png" width="58" height="58" />
|
||||
<icon src="resources/ios/icon/icon-small@3x.png" width="87" height="87" />
|
||||
<splash src="resources/ios/splash/Default-568h@2x~iphone.png" width="640" height="1136" />
|
||||
<splash src="resources/ios/splash/Default-667h.png" width="750" height="1334" />
|
||||
<splash src="resources/ios/splash/Default-736h.png" width="1242" height="2208" />
|
||||
<splash src="resources/ios/splash/Default-Landscape-736h.png" width="2208" height="1242" />
|
||||
<splash src="resources/ios/splash/Default-Landscape@2x~ipad.png" width="2048" height="1536" />
|
||||
<splash src="resources/ios/splash/Default-Landscape~ipad.png" width="1024" height="768" />
|
||||
<splash src="resources/ios/splash/Default-Portrait@2x~ipad.png" width="1536" height="2048" />
|
||||
<splash src="resources/ios/splash/Default-Portrait~ipad.png" width="768" height="1024" />
|
||||
<splash src="resources/ios/splash/Default@2x~iphone.png" width="640" height="960" />
|
||||
<splash src="resources/ios/splash/Default~iphone.png" width="320" height="480" />
|
||||
</platform>
|
||||
<platform name="windows">
|
||||
<preference name="SplashScreenBackgroundColor" value="#ffffff" />
|
||||
<splash src="resources\windows\splash\Splash620x300.scale-100.png" width="620" height="300" />
|
||||
<icon src="resources\windows\icon\logo150x150.scale-100.png" width="150" height="150" />
|
||||
<icon src="resources\windows\icon\logo310x310.scale-100.png" width="310" height="310" />
|
||||
<icon src="resources\windows\icon\logo44x44.scale-100.png" width="44" height="44" />
|
||||
<icon src="resources\windows\icon\logo50x50.scale-100.png" width="50" height="50" />
|
||||
<icon src="resources\windows\icon\logo71x71.scale-100.png" width="71" height="71" />
|
||||
<icon src="resources\windows\icon\wide310x150.scale-100.png" width="310" height="150" />
|
||||
<splash src="resources/windows/splash/Splash620x300.scale-100.png" width="620" height="300" />
|
||||
<icon src="resources/windows/icon/logo150x150.scale-100.png" width="150" height="150" />
|
||||
<icon src="resources/windows/icon/logo310x310.scale-100.png" width="310" height="310" />
|
||||
<icon src="resources/windows/icon/logo44x44.scale-100.png" width="44" height="44" />
|
||||
<icon src="resources/windows/icon/logo50x50.scale-100.png" width="50" height="50" />
|
||||
<icon src="resources/windows/icon/logo71x71.scale-100.png" width="71" height="71" />
|
||||
<icon src="resources/windows/icon/wide310x150.scale-100.png" width="310" height="150" />
|
||||
</platform>
|
||||
<preference name="webviewbounce" value="false" />
|
||||
<preference name="UIWebViewBounce" value="false" />
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/// <binding BeforeBuild='build' ProjectOpened='watch' />
|
||||
/// <binding ProjectOpened='watch' />
|
||||
var gulp = require('gulp'),
|
||||
gulpWatch = require('gulp-watch'),
|
||||
del = require('del'),
|
||||
|
|
|
@ -1,94 +1 @@
|
|||
#!/usr/bin/env node
|
||||
|
||||
// Add Platform Class
|
||||
// v1.0
|
||||
// Automatically adds the platform class to the body tag
|
||||
// after the `prepare` command. By placing the platform CSS classes
|
||||
// directly in the HTML built for the platform, it speeds up
|
||||
// rendering the correct layout/style for the specific platform
|
||||
// instead of waiting for the JS to figure out the correct classes.
|
||||
|
||||
var fs = require('fs');
|
||||
var path = require('path');
|
||||
|
||||
var rootdir = process.argv[2];
|
||||
|
||||
function addPlatformBodyTag(indexPath, platform) {
|
||||
// add the platform class to the body tag
|
||||
try {
|
||||
var platformClass = 'platform-' + platform;
|
||||
var cordovaClass = 'platform-cordova platform-webview';
|
||||
|
||||
var html = fs.readFileSync(indexPath, 'utf8');
|
||||
|
||||
var bodyTag = findBodyTag(html);
|
||||
if(!bodyTag) return; // no opening body tag, something's wrong
|
||||
|
||||
if(bodyTag.indexOf(platformClass) > -1) return; // already added
|
||||
|
||||
var newBodyTag = bodyTag;
|
||||
|
||||
var classAttr = findClassAttr(bodyTag);
|
||||
if(classAttr) {
|
||||
// body tag has existing class attribute, add the classname
|
||||
var endingQuote = classAttr.substring(classAttr.length-1);
|
||||
var newClassAttr = classAttr.substring(0, classAttr.length-1);
|
||||
newClassAttr += ' ' + platformClass + ' ' + cordovaClass + endingQuote;
|
||||
newBodyTag = bodyTag.replace(classAttr, newClassAttr);
|
||||
|
||||
} else {
|
||||
// add class attribute to the body tag
|
||||
newBodyTag = bodyTag.replace('>', ' class="' + platformClass + ' ' + cordovaClass + '">');
|
||||
}
|
||||
|
||||
html = html.replace(bodyTag, newBodyTag);
|
||||
|
||||
fs.writeFileSync(indexPath, html, 'utf8');
|
||||
|
||||
process.stdout.write('add to body class: ' + platformClass + '\n');
|
||||
} catch(e) {
|
||||
process.stdout.write(e);
|
||||
}
|
||||
}
|
||||
|
||||
function findBodyTag(html) {
|
||||
// get the body tag
|
||||
try{
|
||||
return html.match(/<body(?=[\s>])(.*?)>/gi)[0];
|
||||
}catch(e){}
|
||||
}
|
||||
|
||||
function findClassAttr(bodyTag) {
|
||||
// get the body tag's class attribute
|
||||
try{
|
||||
return bodyTag.match(/ class=["|'](.*?)["|']/gi)[0];
|
||||
}catch(e){}
|
||||
}
|
||||
|
||||
if (rootdir) {
|
||||
|
||||
// go through each of the platform directories that have been prepared
|
||||
var platforms = (process.env.CORDOVA_PLATFORMS ? process.env.CORDOVA_PLATFORMS.split(',') : []);
|
||||
|
||||
for(var x=0; x<platforms.length; x++) {
|
||||
// open up the index.html file at the www root
|
||||
try {
|
||||
var platform = platforms[x].trim().toLowerCase();
|
||||
var indexPath;
|
||||
|
||||
if(platform == 'android') {
|
||||
indexPath = path.join('platforms', platform, 'assets', 'www', 'index.html');
|
||||
} else {
|
||||
indexPath = path.join('platforms', platform, 'www', 'index.html');
|
||||
}
|
||||
|
||||
if(fs.existsSync(indexPath)) {
|
||||
addPlatformBodyTag(indexPath, platform);
|
||||
}
|
||||
|
||||
} catch(e) {
|
||||
process.stdout.write(e);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
#!/usr/bin/env node
// Add Platform Class
// v1.0
// Automatically adds the platform class to the body tag
// after the `prepare` command. By placing the platform CSS classes
// directly in the HTML built for the platform, it speeds up
// rendering the correct layout/style for the specific platform
// instead of waiting for the JS to figure out the correct classes.
var fs = require('fs');
var path = require('path');
var rootdir = process.argv[2];
function addPlatformBodyTag(indexPath, platform) {
// add the platform class to the body tag
try {
var platformClass = 'platform-' + platform;
var cordovaClass = 'platform-cordova platform-webview';
var html = fs.readFileSync(indexPath, 'utf8');
var bodyTag = findBodyTag(html);
if(!bodyTag) return; // no opening body tag, something's wrong
if(bodyTag.indexOf(platformClass) > -1) return; // already added
var newBodyTag = bodyTag;
var classAttr = findClassAttr(bodyTag);
if(classAttr) {
// body tag has existing class attribute, add the classname
var endingQuote = classAttr.substring(classAttr.length-1);
var newClassAttr = classAttr.substring(0, classAttr.length-1);
newClassAttr += ' ' + platformClass + ' ' + cordovaClass + endingQuote;
newBodyTag = bodyTag.replace(classAttr, newClassAttr);
} else {
// add class attribute to the body tag
newBodyTag = bodyTag.replace('>', ' class="' + platformClass + ' ' + cordovaClass + '">');
}
html = html.replace(bodyTag, newBodyTag);
fs.writeFileSync(indexPath, html, 'utf8');
process.stdout.write('add to body class: ' + platformClass + '\n');
} catch(e) {
process.stdout.write(e);
}
}
function findBodyTag(html) {
// get the body tag
try{
return html.match(/<body(?=[\s>])(.*?)>/gi)[0];
}catch(e){}
}
function findClassAttr(bodyTag) {
// get the body tag's class attribute
try{
return bodyTag.match(/ class=["|'](.*?)["|']/gi)[0];
}catch(e){}
}
if (rootdir) {
// go through each of the platform directories that have been prepared
var platforms = (process.env.CORDOVA_PLATFORMS ? process.env.CORDOVA_PLATFORMS.split(',') : []);
for(var x=0; x<platforms.length; x++) {
// open up the index.html file at the www root
try {
var platform = platforms[x].trim().toLowerCase();
var indexPath;
if(platform == 'android') {
indexPath = path.join('platforms', platform, 'assets', 'www', 'index.html');
} else {
indexPath = path.join('platforms', platform, 'www', 'index.html');
}
if(fs.existsSync(indexPath)) {
addPlatformBodyTag(indexPath, platform);
}
} catch(e) {
process.stdout.write(e);
}
}
}
|
|
@ -1,4 +1,4 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup Label="ProjectConfigurations">
|
||||
<ProjectConfiguration Include="Debug|Android">
|
||||
|
@ -61,5 +61,5 @@
|
|||
<!-- Installs (if necessary) the supporting Nodejs module -->
|
||||
<Exec Command=""$(MDAVsixDir)"\packages\vs-tac\install "$(NodeJsDir)" "$(MDAVsixDir)"\packages\vs-tac" />
|
||||
</Target>
|
||||
<Import Project="_apacheCordovaProjectSourceItems.Targets" Condition="Exists('_apacheCordovaProjectSourceItems.Targets')" />
|
||||
<Import Project="_projectSourceItems.Targets" Condition="Exists('_projectSourceItems.Targets')" />
|
||||
</Project>
|
Загрузка…
Ссылка в новой задаче