Phonegap configuration

This commit is contained in:
Kload 2013-10-06 15:05:36 +02:00
parent dacfeb2224
commit 854c9defa6
5 changed files with 44 additions and 6 deletions

33
config.xml Normal file
View file

@ -0,0 +1,33 @@
<?xml version='1.0' encoding='utf-8'?>
<widget id="com.yunohost.admin" version="2.0.0 beta" xmlns="http://www.w3.org/ns/widgets" xmlns:gap="http://phonegap.com/ns/1.0">
<name>YunoHost</name>
<description>
YunoHost Administration
</description>
<author email="yunohost@yunohost.org" href="http://yunohost.org">
YunoHost team
</author>
<gap:platform name="ios" />
<gap:platform name="android" />
<gap:platform name="winphone" />
<icon src="icon.png" />
<feature name="http://api.phonegap.com/1.0/device" />
<preference name="phonegap-version" value="3.1.0" />
<preference name="permissions" value="none" />
<preference name="orientation" value="default" />
<preference name="target-device" value="universal" />
<preference name="fullscreen" value="false" />
<preference name="webviewbounce" value="true" />
<preference name="prerendered-icon" value="true" />
<preference name="stay-in-webview" value="false" />
<preference name="ios-statusbarstyle" value="black-opaque" />
<preference name="detect-data-types" value="true" />
<preference name="exit-on-suspend" value="false" />
<preference name="show-splash-screen-spinner" value="true" />
<preference name="auto-hide-splash-screen" value="true" />
<preference name="disable-cursor" value="false" />
<preference name="android-minSdkVersion" value="7" />
<preference name="android-installLocation" value="auto" />
<preference name="splash-screen-duration" value="2500"/>
<access origin="*" />
</widget>

BIN
icon.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 60 KiB

BIN
img/logo.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 60 KiB

View file

@ -2,8 +2,10 @@
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta charset="utf-8" />
<meta http-equiv="cache-control" content="no-cache" />
<meta name="viewport" content="width=device-width, user-scalable=no">
<meta name="format-detection" content="telephone=no" />
<meta name="viewport" content="user-scalable=no, width=device-width, height=device-height" />
<title>YunoHost admin</title>
<link href="css/bootstrap.min.css" rel="stylesheet" media="screen">
<link href="css/style.css" rel="stylesheet" media="screen">
@ -36,7 +38,10 @@
<script type="text/javascript" src="js/vendor/sammy.json.js"></script>
<script type="text/javascript" src="js/vendor/sammy.storage.js"></script>
<script type="text/javascript" src="js/vendor/bootstrap.min.js"></script>
<script type="text/javascript" src="phonegap.js"></script>
<script type="text/javascript" src="js/app.js"></script>
<script type="text/javascript">
app.initialize();
</script>
</body>
</html>

View file

@ -177,11 +177,11 @@ app = Sammy('#main', function (sam) {
// Check if te client is hosted on a yunohost node
domain = window.location.hostname
$.ajax({
url: 'http://'+ domain +':6767/api',
url: 'https://'+ domain +':6767/api',
timeout: 3000
})
.success(function() {
$.getJSON('http://'+ domain +':6767/installed', function(data) {
$.getJSON('https://'+ domain +':6767/installed', function(data) {
if (!data.installed) {
c.redirect('#/postinstall');
} else {
@ -195,7 +195,7 @@ app = Sammy('#main', function (sam) {
});
sam.post('#/login', function (c) {
store.set('url', 'http://'+ c.params['domain'] +':6767');
store.set('url', 'https://'+ c.params['domain'] +':6767');
store.set('user', 'admin');
store.set('password', btoa(c.params['password']));
c.api('/api', function(data) {
@ -247,7 +247,7 @@ app = Sammy('#main', function (sam) {
params['password'] = c.params['password']
store.set('url', 'http://'+ window.location.hostname +':6767');
store.set('url', 'https://'+ window.location.hostname +':6767');
store.set('user', 'admin');
store.set('password', btoa('yunohost'));
c.api('/postinstall', function(data) { // http://api.yunohost.org/#!/tools/tools_postinstall_post_0