From c0b370f6cf8bf2ec3f4af921fc9f6935238ca41d Mon Sep 17 00:00:00 2001 From: Bart Visscher Date: Thu, 7 Feb 2013 08:11:18 +0100 Subject: Define the variables that are expected to exist but won't be set in setup --- core/js/js.js | 3 +++ 1 file changed, 3 insertions(+) (limited to 'core/js') diff --git a/core/js/js.js b/core/js/js.js index 6b0c289850c..80914e954e5 100644 --- a/core/js/js.js +++ b/core/js/js.js @@ -5,6 +5,9 @@ * To the end of config/config.php to enable debug mode. * The undefined checks fix the broken ie8 console */ +var oc_debug; +var oc_webroot; +var oc_requesttoken; if (oc_debug !== true || typeof console === "undefined" || typeof console.log === "undefined") { if (!window.console) { window.console = {}; -- cgit v1.2.3 From 458ba4b55c38999a1eecb0163b167ba97365a403 Mon Sep 17 00:00:00 2001 From: Bart Visscher Date: Thu, 7 Feb 2013 08:12:09 +0100 Subject: Fix disabling setup form on submit --- core/js/setup.js | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'core/js') diff --git a/core/js/setup.js b/core/js/setup.js index 9aded6591ca..2656cac2f45 100644 --- a/core/js/setup.js +++ b/core/js/setup.js @@ -52,12 +52,10 @@ $(document).ready(function() { // Save form parameters var post = $(this).serializeArray(); - // FIXME: This lines are breaking the installation // Disable inputs - // $(':submit', this).attr('disabled','disabled').val('Finishing …'); - // $('input', this).addClass('ui-state-disabled').attr('disabled','disabled'); - // $('#selectDbType').button('disable'); - // $('label.ui-button', this).addClass('ui-state-disabled').attr('aria-disabled', 'true').button('disable'); + $(':submit', this).attr('disabled','disabled').val('Finishing …'); + $('input', this).addClass('ui-state-disabled').attr('disabled','disabled'); + $('#selectDbType').buttonset('disable'); // Create the form var form = $('
'); -- cgit v1.2.3 From a82d18d2f8e13edab296daaf2bda917381e78810 Mon Sep 17 00:00:00 2001 From: Bart Visscher Date: Thu, 7 Feb 2013 21:13:57 +0100 Subject: Fill oc_webroot with the expected value --- core/js/js.js | 1 + 1 file changed, 1 insertion(+) (limited to 'core/js') diff --git a/core/js/js.js b/core/js/js.js index 80914e954e5..c137f734d91 100644 --- a/core/js/js.js +++ b/core/js/js.js @@ -8,6 +8,7 @@ var oc_debug; var oc_webroot; var oc_requesttoken; +oc_webroot = oc_webroot || location.pathname.substr(0, location.pathname.lastIndexOf('/')); if (oc_debug !== true || typeof console === "undefined" || typeof console.log === "undefined") { if (!window.console) { window.console = {}; -- cgit v1.2.3 From 43ffb5945ce6713a19a3548ec575251e3f9a5aee Mon Sep 17 00:00:00 2001 From: Jörn Friedrich Dreyer Date: Fri, 8 Feb 2013 11:05:56 +0100 Subject: attach handlers to document instead of filelist, minor whitespace cleanups --- core/js/share.js | 131 ++++++++++++++++++++++++++++++------------------------- 1 file changed, 71 insertions(+), 60 deletions(-) (limited to 'core/js') diff --git a/core/js/share.js b/core/js/share.js index 6ad4130690d..58cb787b6d1 100644 --- a/core/js/share.js +++ b/core/js/share.js @@ -185,10 +185,10 @@ OC.Share={ html += ''; html += ''; html += ''; - html += ''; - html += ''; - html += ''; - html += ''; + html += ''; } html += '
'; html += ''; @@ -373,18 +373,18 @@ OC.Share={ $('#linkPassText').attr('placeholder', t('core', 'Password protected')); } $('#expiration').show(); - $('#emailPrivateLink #email').show(); - $('#emailPrivateLink #emailButton').show(); + $('#emailPrivateLink #email').show(); + $('#emailPrivateLink #emailButton').show(); }, hideLink:function() { $('#linkText').hide('blind'); $('#showPassword').hide(); $('#showPassword+label').hide(); $('#linkPass').hide(); - $('#emailPrivateLink #email').hide(); - $('#emailPrivateLink #emailButton').hide(); - }, - dirname:function(path) { + $('#emailPrivateLink #email').hide(); + $('#emailPrivateLink #emailButton').hide(); + }, + dirname:function(path) { return path.replace(/\\/g,'/').replace(/\/[^\/]*$/, ''); }, showExpirationDate:function(date) { @@ -401,16 +401,16 @@ OC.Share={ $(document).ready(function() { if(typeof monthNames != 'undefined'){ - $.datepicker.setDefaults({ - monthNames: monthNames, - monthNamesShort: $.map(monthNames, function(v) { return v.slice(0,3)+'.'; }), - dayNames: dayNames, - dayNamesMin: $.map(dayNames, function(v) { return v.slice(0,2); }), - dayNamesShort: $.map(dayNames, function(v) { return v.slice(0,3)+'.'; }), - firstDay: firstDay - }); - } - $('#fileList').on('click', 'a.share', function(event) { + $.datepicker.setDefaults({ + monthNames: monthNames, + monthNamesShort: $.map(monthNames, function(v) { return v.slice(0,3)+'.'; }), + dayNames: dayNames, + dayNamesMin: $.map(dayNames, function(v) { return v.slice(0,2); }), + dayNamesShort: $.map(dayNames, function(v) { return v.slice(0,3)+'.'; }), + firstDay: firstDay + }); + } + $(document).on('click', 'a.share', function(event) { event.stopPropagation(); if ($(this).data('item-type') !== undefined && $(this).data('item') !== undefined) { var itemType = $(this).data('item-type'); @@ -444,12 +444,12 @@ $(document).ready(function() { } }); - $('#fileList').on('mouseenter', '#dropdown #shareWithList li', function(event) { + $(document).on('mouseenter', '#dropdown #shareWithList li', function(event) { // Show permissions and unshare button $(':hidden', this).filter(':not(.cruds)').show(); }); - $('#fileList').on('mouseleave', '#dropdown #shareWithList li', function(event) { + $(document).on('mouseleave', '#dropdown #shareWithList li', function(event) { // Hide permissions and unshare button if (!$('.cruds', this).is(':visible')) { $('a', this).hide(); @@ -462,11 +462,11 @@ $(document).ready(function() { } }); - $('#fileList').on('click', '#dropdown .showCruds', function() { + $(document).on('click', '#dropdown .showCruds', function() { $(this).parent().find('.cruds').toggle(); }); - $('#fileList').on('click', '#dropdown .unshare', function() { + $(document).on('click', '#dropdown .unshare', function() { var li = $(this).parent(); var itemType = $('#dropdown').data('item-type'); var itemSource = $('#dropdown').data('item-source'); @@ -483,7 +483,7 @@ $(document).ready(function() { }); }); - $('#fileList').on('change', '#dropdown .permissions', function() { + $(document).on('change', '#dropdown .permissions', function() { if ($(this).attr('name') == 'edit') { var li = $(this).parent().parent() var checkboxes = $('.permissions', li); @@ -496,10 +496,17 @@ $(document).ready(function() { var li = $(this).parent().parent().parent(); var checkboxes = $('.permissions', li); // Uncheck Edit if Create, Update, and Delete are not checked - if (!$(this).is(':checked') && !$(checkboxes).filter('input[name="create"]').is(':checked') && !$(checkboxes).filter('input[name="update"]').is(':checked') && !$(checkboxes).filter('input[name="delete"]').is(':checked')) { + if (!$(this).is(':checked') + && !$(checkboxes).filter('input[name="create"]').is(':checked') + && !$(checkboxes).filter('input[name="update"]').is(':checked') + && !$(checkboxes).filter('input[name="delete"]').is(':checked')) + { $(checkboxes).filter('input[name="edit"]').attr('checked', false); // Check Edit if Create, Update, or Delete is checked - } else if (($(this).attr('name') == 'create' || $(this).attr('name') == 'update' || $(this).attr('name') == 'delete')) { + } else if (($(this).attr('name') == 'create' + || $(this).attr('name') == 'update' + || $(this).attr('name') == 'delete')) + { $(checkboxes).filter('input[name="edit"]').attr('checked', true); } } @@ -507,10 +514,14 @@ $(document).ready(function() { $(checkboxes).filter(':not(input[name="edit"])').filter(':checked').each(function(index, checkbox) { permissions |= $(checkbox).data('permissions'); }); - OC.Share.setPermissions($('#dropdown').data('item-type'), $('#dropdown').data('item-source'), $(li).data('share-type'), $(li).data('share-with'), permissions); + OC.Share.setPermissions($('#dropdown').data('item-type'), + $('#dropdown').data('item-source'), + $(li).data('share-type'), + $(li).data('share-with'), + permissions); }); - $('#fileList').on('change', '#dropdown #linkCheckbox', function() { + $(document).on('change', '#dropdown #linkCheckbox', function() { var itemType = $('#dropdown').data('item-type'); var itemSource = $('#dropdown').data('item-source'); if (this.checked) { @@ -532,12 +543,12 @@ $(document).ready(function() { } }); - $('#fileList').on('click', '#dropdown #linkText', function() { + $(document).on('click', '#dropdown #linkText', function() { $(this).focus(); $(this).select(); }); - $('#fileList').on('click', '#dropdown #showPassword', function() { + $(document).on('click', '#dropdown #showPassword', function() { $('#linkPass').toggle('blind'); if (!$('#showPassword').is(':checked') ) { var itemType = $('#dropdown').data('item-type'); @@ -548,7 +559,7 @@ $(document).ready(function() { } }); - $('#fileList').on('focusout keyup', '#dropdown #linkPassText', function(event) { + $(document).on('focusout keyup', '#dropdown #linkPassText', function(event) { if ( $('#linkPassText').val() != '' && (event.type == 'focusout' || event.keyCode == 13) ) { var itemType = $('#dropdown').data('item-type'); var itemSource = $('#dropdown').data('item-source'); @@ -560,7 +571,7 @@ $(document).ready(function() { } }); - $('#fileList').on('click', '#dropdown #expirationCheckbox', function() { + $(document).on('click', '#dropdown #expirationCheckbox', function() { if (this.checked) { OC.Share.showExpirationDate(''); } else { @@ -575,7 +586,7 @@ $(document).ready(function() { } }); - $('#fileList').on('change', '#dropdown #expirationDate', function() { + $(document).on('change', '#dropdown #expirationDate', function() { var itemType = $('#dropdown').data('item-type'); var itemSource = $('#dropdown').data('item-source'); $.post(OC.filePath('core', 'ajax', 'share.php'), { action: 'setExpirationDate', itemType: itemType, itemSource: itemSource, date: $(this).val() }, function(result) { @@ -586,33 +597,33 @@ $(document).ready(function() { }); - $('#fileList').on('submit', '#dropdown #emailPrivateLink', function(event) { - event.preventDefault(); - var link = $('#linkText').val(); - var itemType = $('#dropdown').data('item-type'); - var itemSource = $('#dropdown').data('item-source'); - var file = $('tr').filterAttr('data-id', String(itemSource)).data('file'); - var email = $('#email').val(); - if (email != '') { - $('#email').attr('disabled', "disabled"); - $('#email').val(t('core', 'Sending ...')); - $('#emailButton').attr('disabled', "disabled"); + $(document).on('submit', '#dropdown #emailPrivateLink', function(event) { + event.preventDefault(); + var link = $('#linkText').val(); + var itemType = $('#dropdown').data('item-type'); + var itemSource = $('#dropdown').data('item-source'); + var file = $('tr').filterAttr('data-id', String(itemSource)).data('file'); + var email = $('#email').val(); + if (email != '') { + $('#email').attr('disabled', "disabled"); + $('#email').val(t('core', 'Sending ...')); + $('#emailButton').attr('disabled', "disabled"); - $.post(OC.filePath('core', 'ajax', 'share.php'), { action: 'email', toaddress: email, link: link, itemType: itemType, itemSource: itemSource, file: file}, - function(result) { - $('#email').attr('disabled', "false"); - $('#emailButton').attr('disabled', "false"); - if (result && result.status == 'success') { - $('#email').css('font-weight', 'bold'); - $('#email').animate({ fontWeight: 'normal' }, 2000, function() { - $(this).val(''); - }).val(t('core','Email sent')); - } else { - OC.dialogs.alert(result.data.message, t('core', 'Error while sharing')); - } - }); - } - }); + $.post(OC.filePath('core', 'ajax', 'share.php'), { action: 'email', toaddress: email, link: link, itemType: itemType, itemSource: itemSource, file: file}, + function(result) { + $('#email').attr('disabled', "false"); + $('#emailButton').attr('disabled', "false"); + if (result && result.status == 'success') { + $('#email').css('font-weight', 'bold'); + $('#email').animate({ fontWeight: 'normal' }, 2000, function() { + $(this).val(''); + }).val(t('core','Email sent')); + } else { + OC.dialogs.alert(result.data.message, t('core', 'Error while sharing')); + } + }); + } + }); }); -- cgit v1.2.3 From b356b7065f406cd2e18ed7bb9842e292f888c8e4 Mon Sep 17 00:00:00 2001 From: raghunayyar Date: Fri, 8 Feb 2013 16:38:28 +0530 Subject: Password Toggle Works on Installation as well. --- core/css/styles.css | 1 + core/js/js.js | 3 ++- core/templates/installation.php | 8 ++++---- 3 files changed, 7 insertions(+), 5 deletions(-) (limited to 'core/js') diff --git a/core/css/styles.css b/core/css/styles.css index cefab2d49ff..961c7fb7f3a 100644 --- a/core/css/styles.css +++ b/core/css/styles.css @@ -155,6 +155,7 @@ input[type="submit"].enabled { background:#66f866; border:1px solid #5e5; -moz-b } #adminpass-icon, #password-icon { top:1.1em; } input[name="password-clone"] { padding-left:1.8em; width:11.7em !important; } +input[name="adminpass-clone"] { padding-left:1.8em; width:11.7em !important; } /* Nicely grouping input field sets */ .grouptop input { diff --git a/core/js/js.js b/core/js/js.js index c137f734d91..4a1f8571cc7 100644 --- a/core/js/js.js +++ b/core/js/js.js @@ -626,7 +626,8 @@ $(document).ready(function(){ }); // 'show password' checkbox - $('#password').showPassword(); + $('#password').showPassword(); + $('#adminpass').showPassword(); $('#pass2').showPassword(); //use infield labels diff --git a/core/templates/installation.php b/core/templates/installation.php index f3d232b637e..19395b80efe 100644 --- a/core/templates/installation.php +++ b/core/templates/installation.php @@ -34,13 +34,13 @@
t( 'Create an admin account' ); ?> -

- +

+ - +

- + -- cgit v1.2.3 From d5f98a82aa5d1bee7971cb4c811b86083ce60ed6 Mon Sep 17 00:00:00 2001 From: Bart Visscher Date: Fri, 8 Feb 2013 18:44:52 +0100 Subject: fix-oc_webroot --- core/js/js.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'core/js') diff --git a/core/js/js.js b/core/js/js.js index c137f734d91..5f1870eb6ce 100644 --- a/core/js/js.js +++ b/core/js/js.js @@ -8,7 +8,9 @@ var oc_debug; var oc_webroot; var oc_requesttoken; -oc_webroot = oc_webroot || location.pathname.substr(0, location.pathname.lastIndexOf('/')); +if (typeof oc_webroot === "undefined") { + oc_webroot = location.pathname.substr(0, location.pathname.lastIndexOf('/')); +} if (oc_debug !== true || typeof console === "undefined" || typeof console.log === "undefined") { if (!window.console) { window.console = {}; -- cgit v1.2.3 From 45ed0c601003b1f2ebd9e5bb301080b37d43080e Mon Sep 17 00:00:00 2001 From: Björn Schießle Date: Mon, 11 Feb 2013 15:37:01 +0100 Subject: if you add/remove more than one user from the share dialog replacing 'Share' with 'Shared' will lead to a string with more and more trailing 'd's --- core/js/share.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'core/js') diff --git a/core/js/share.js b/core/js/share.js index 58cb787b6d1..6d1c3954044 100644 --- a/core/js/share.js +++ b/core/js/share.js @@ -26,7 +26,7 @@ OC.Share={ var action = $(file).find('.fileactions .action').filterAttr('data-action', 'Share'); action.find('img').attr('src', image); action.addClass('permanent'); - action.html(action.html().replace(t('core', 'Share'), t('core', 'Shared'))); + action.html(t('core', 'Shared')); } var dir = $('#dir').val(); if (dir.length > 1) { @@ -40,7 +40,7 @@ OC.Share={ if (img.attr('src') != OC.imagePath('core', 'actions/public')) { img.attr('src', image); action.addClass('permanent'); - action.html(action.html().replace(t('core', 'Share'), t('core', 'Shared'))); + action.html(t('core', 'Shared')); } } last = path; @@ -87,10 +87,10 @@ OC.Share={ action.find('img').attr('src', image); if (shares) { action.addClass('permanent'); - action.html(action.html().replace(t('core', 'Share'), t('core', 'Shared'))); + action.html(t('core', 'Shared')); } else { action.removeClass('permanent'); - action.html(action.html().replace(t('core', 'Shared'), t('core', 'Share'))); + action.html(t('core', 'Share')); } } if (shares) { -- cgit v1.2.3