Allow pre-filling of manifest URL box

This commit is contained in:
Gregory Koberger 2012-05-17 00:24:06 -07:00
Родитель f802e8c358
Коммит 00cce0574f
4 изменённых файлов: 33 добавлений и 2 удалений

Просмотреть файл

@ -2,6 +2,12 @@ $(document).ready(function() {
// Edit Add-on
$("#edit-addon").exists(initEditAddon);
// Save manifest if passed in
var params = z.getVars();
if('manifest' in params && z.capabilities.sessionStorage) {
window.sessionStorage['manifest_url'] = params['manifest'];
}
//Ownership
$("#author_list").exists(function() {
initAuthorFields();
@ -47,8 +53,9 @@ $(document).ready(function() {
$('#upload-addon').addonUploader(opt);
}
if($('#upload-webapp-url').exists()) {
$('#upload-webapp-url').bind("keyup change paste blur", function(e) {
var $webapp_url = $('#upload-webapp-url');
if($webapp_url.exists()) {
$webapp_url.bind("keyup change paste blur", function(e) {
var $this = $(this),
$button = $('#validate_app'),
// Ensure it's at least "protocol://host/something".
@ -172,6 +179,12 @@ $(document).ready(function() {
}
}
}
if(z.capabilities.sessionStorage && window.sessionStorage['manifest_url'] && !$webapp_url.val()) {
$webapp_url.val(window.sessionStorage['manifest_url']);
$webapp_url.trigger('change');
$('#validate_app').trigger('click');
}
}
$('.invisible-upload a').click(_pd);
@ -1113,3 +1126,4 @@ function initInAppConfig($dom) {
setProtocol();
}

Просмотреть файл

@ -5,6 +5,7 @@ z.capabilities = {
'console': window.console && (typeof window.console.log == 'function'),
'replaceState': typeof history.replaceState === 'function',
'localStorage': false,
'sessionStorage': false,
'webApps': !!(navigator.mozApps && navigator.mozApps.install),
'app_runtime': !!(
navigator.mozApps &&
@ -20,3 +21,10 @@ try {
}
} catch (e) {
}
try {
if ('sessionStorage' in window && window['sessionStorage'] !== null) {
z.capabilities.sessionStorage = true;
}
} catch (e) {
}

Просмотреть файл

@ -5,6 +5,7 @@ z.capabilities = {
'console': window.console && (typeof window.console.log == 'function'),
'replaceState': typeof history.replaceState === 'function',
'localStorage': false,
'sessionStorage': false,
'webApps': !!(navigator.mozApps && navigator.mozApps.install),
'app_runtime': !!(
navigator.mozApps &&
@ -21,3 +22,10 @@ try {
}
} catch (e) {
}
try {
if ('sessionStorage' in window && window['sessionStorage'] !== null) {
z.capabilities.sessionStorage = true;
}
} catch (e) {
}

Просмотреть файл

@ -129,6 +129,7 @@ JS = {
'js/lib/jquery.cookie.js',
'js/zamboni/storage.js',
'js/zamboni/tabs.js',
'js/impala/serializers.js',
# jQuery UI.
'js/lib/jquery-ui/jquery.ui.core.js',