RepoZilla Sources

master
Amir Torres 2014-10-30 18:21:09 -06:00
parent 25202c90e6
commit 7984b1d66b
8 changed files with 108 additions and 0 deletions

View File

@ -0,0 +1,12 @@
*{margin: 0;color: inherit;font-weight: inherit;letter-spacing: -.04em;text-decoration: none;transition: inherit;-moz-transition: inherit;-webkit-transition: inherit;}
html,body{font-size:18px;text-shadow: 1px 1px 1px #999;}
#nav{background:#F97C17;padding:16px;text-align:center;color:#000;text-shadow: 1px 1px 1px #CCC;}
#content{margin-top:30px;}
#form{text-align:center;margin:0 auto;}
#form select{width:80%;height:40px;font-size:100%;text-shadow: 1px 1px 1px #999;}
#form textarea{margin-top:20px;width:80%;height:100px;font-size:15px;text-shadow: 1px 1px 1px #999;}
#form button{margin-top:20px;font-size:100%;width:100px;height:40px;text-shadow: 1px 1px 1px #999;}
footer{text-align:center;}
footer #foot{margin:0 auto;}
#foot{text-align:Justify;margin-top:10px;padding-top:45px;font-size:70%;width:250px;}
.link{text-decoration:underline;}

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.1 KiB

4
content/js/jquery.js vendored 100644

File diff suppressed because one or more lines are too long

36
content/js/repo.js 100644
View File

@ -0,0 +1,36 @@
function install(){
var scop = document.getElementById('m').value;
var manifestUrl = document.getElementById('repo').value;
if(manifestUrl != ''){
switch(scop){
case 'host':
var request = window.navigator.mozApps.install(manifestUrl);
var msgints = 'Installation successful!';
break;
case 'pack':
var request = navigator.mozApps.installPackage(manifestUrl,opt.data || {});
var msgints = 'Installation in process!';
break;
}
request.onsuccess = function () {
alert(msgints);
};
request.onerror = function () {
alert('Install failed, error: ' + this.error.name + '\nRepo: ' + manifestUrl);
};
} else {
alert("Insert a url like:\nhttp://example.com/app/manifest.webapp");
}
}
$(document).ready(function(){
var plhd;
$("select[id=m]").change(function(){
var opt = $('select[id=m]').val();
if(opt == 'host'){
plhd = "http://example.com/app/manifest.webapp";
} else if(opt == 'pack'){
plhd = "http://example.com/app/package.webapp";
}
$("#repo").attr("placeholder", plhd);
});
});

40
index.html 100644
View File

@ -0,0 +1,40 @@
<!Doctype html><html>
<head>
<title>RepoZilla</title>
<meta name="viewport" content="width=device-width, user-scalable=no">
<script type="text/javascript" src="content/js/jquery.js"></script>
<script type="text/javascript" src="content/js/repo.js"></script>
<style type="text/css">@import url(content/css/main.css);</style>
<meta name='theme-color' content='#F97C17'>
</head>
<body>
<header>
<nav>
<div id="nav">RepoZilla</div>
</nav>
</header>
<div id="content">
<form id="form" action="javascript:install()">
<div>
<select id="m">
<option value="host">Hosted APP</option>
<option value="pack">Packaged APP</option>
</select>
</div>
<div>
<textarea id="repo" placeholder="http://example.com/app/manifest.webapp"></textarea>
</div>
<div>
<button type="submit" id="installapp">Install</button>
</div>
</form>
</div>
<footer>
<div id="foot">
To install a APP, you need have a correct manifest in json format. Look at the <a class="link" href="https://github.com/amirtorrez/example-manifest" target="blank">manifest examples</a> for more info.
<br><br>
This APP is a test release.<br>APP by <a class="link" href="http://twitter.com/amirtorrez" target="blank">@amirtorrez</a>
</div>
</footer>
</body>
</html>

16
manifest.webapp 100644
View File

@ -0,0 +1,16 @@
{
"version": "0.1.3",
"name": "RepoZilla",
"description": "APP installer",
"launch_path": "/index.html",
"icons": {
"32": "/content/img/icons/32.png",
"64": "/content/img/icons/64.png",
"128": "/content/img/icons/128.png"
},
"developer": {
"name": "@amirtorrez",
"url": "http://twitter.com/amirtorrez"
},
"installs_allowed_from": ["*"]
}