Merge pull request #1229 from owncloud/from_live_to_on
replace live() with on() in core js
This commit is contained in:
commit
04b97a1906
|
@ -309,7 +309,7 @@ var FileList={
|
||||||
|
|
||||||
$(document).ready(function(){
|
$(document).ready(function(){
|
||||||
$('#notification').hide();
|
$('#notification').hide();
|
||||||
$('#notification .undo').live('click', function(){
|
$('#notification').on('click', '.undo', function(){
|
||||||
if (FileList.deleteFiles) {
|
if (FileList.deleteFiles) {
|
||||||
$.each(FileList.deleteFiles,function(index,file){
|
$.each(FileList.deleteFiles,function(index,file){
|
||||||
$('tr').filterAttr('data-file',file).show();
|
$('tr').filterAttr('data-file',file).show();
|
||||||
|
@ -335,16 +335,16 @@ $(document).ready(function(){
|
||||||
FileList.lastAction = null;
|
FileList.lastAction = null;
|
||||||
OC.Notification.hide();
|
OC.Notification.hide();
|
||||||
});
|
});
|
||||||
$('#notification .replace').live('click', function() {
|
$('#notification').on('click', '.replace', function() {
|
||||||
OC.Notification.hide(function() {
|
OC.Notification.hide(function() {
|
||||||
FileList.replace($('#notification').data('oldName'), $('#notification').data('newName'), $('#notification').data('isNewFile'));
|
FileList.replace($('#notification').data('oldName'), $('#notification').data('newName'), $('#notification').data('isNewFile'));
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
$('#notification .suggest').live('click', function() {
|
$('#notification').on('click', '.suggest', function() {
|
||||||
$('tr').filterAttr('data-file', $('#notification').data('oldName')).show();
|
$('tr').filterAttr('data-file', $('#notification').data('oldName')).show();
|
||||||
OC.Notification.hide();
|
OC.Notification.hide();
|
||||||
});
|
});
|
||||||
$('#notification .cancel').live('click', function() {
|
$('#notification').on('click', '.cancel', function() {
|
||||||
if ($('#notification').data('isNewFile')) {
|
if ($('#notification').data('isNewFile')) {
|
||||||
FileList.deleteCanceled = false;
|
FileList.deleteCanceled = false;
|
||||||
FileList.deleteFiles = [$('#notification').data('oldName')];
|
FileList.deleteFiles = [$('#notification').data('oldName')];
|
||||||
|
|
|
@ -110,7 +110,7 @@ $(document).ready(function() {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Triggers invisible file input
|
// Triggers invisible file input
|
||||||
$('#upload a').live('click', function() {
|
$('#upload a').on('click', function() {
|
||||||
$(this).parent().children('#file_upload_start').trigger('click');
|
$(this).parent().children('#file_upload_start').trigger('click');
|
||||||
return false;
|
return false;
|
||||||
});
|
});
|
||||||
|
@ -123,7 +123,7 @@ $(document).ready(function() {
|
||||||
var lastChecked;
|
var lastChecked;
|
||||||
|
|
||||||
// Sets the file link behaviour :
|
// Sets the file link behaviour :
|
||||||
$('td.filename a').live('click',function(event) {
|
$('#fileList').on('click','td.filename a',function(event) {
|
||||||
if (event.ctrlKey || event.shiftKey) {
|
if (event.ctrlKey || event.shiftKey) {
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
if (event.shiftKey) {
|
if (event.shiftKey) {
|
||||||
|
@ -189,7 +189,7 @@ $(document).ready(function() {
|
||||||
procesSelection();
|
procesSelection();
|
||||||
});
|
});
|
||||||
|
|
||||||
$('td.filename input:checkbox').live('change',function(event) {
|
$('#fileList').on('change', 'td.filename input:checkbox',function(event) {
|
||||||
if (event.shiftKey) {
|
if (event.shiftKey) {
|
||||||
var last = $(lastChecked).parent().parent().prevAll().length;
|
var last = $(lastChecked).parent().parent().prevAll().length;
|
||||||
var first = $(this).parent().parent().prevAll().length;
|
var first = $(this).parent().parent().prevAll().length;
|
||||||
|
|
|
@ -36,7 +36,7 @@ $(document).ready(function() {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
$('#externalStorage tbody tr input').live('keyup', function() {
|
$('#externalStorage tbody').on('keyup', 'tr input', function() {
|
||||||
var tr = $(this).parent().parent();
|
var tr = $(this).parent().parent();
|
||||||
if ($(tr).hasClass('\\\\OC\\\\Files\\\\Storage\\\\Dropbox') && $(tr).find('[data-parameter="configured"]').val() != 'true') {
|
if ($(tr).hasClass('\\\\OC\\\\Files\\\\Storage\\\\Dropbox') && $(tr).find('[data-parameter="configured"]').val() != 'true') {
|
||||||
var config = $(tr).find('.configuration');
|
var config = $(tr).find('.configuration');
|
||||||
|
@ -52,7 +52,7 @@ $(document).ready(function() {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
$('.dropbox').live('click', function(event) {
|
$('.dropbox').on('click', function(event) {
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
var app_key = $(this).parent().find('[data-parameter="app_key"]').val();
|
var app_key = $(this).parent().find('[data-parameter="app_key"]').val();
|
||||||
var app_secret = $(this).parent().find('[data-parameter="app_secret"]').val();
|
var app_secret = $(this).parent().find('[data-parameter="app_secret"]').val();
|
||||||
|
|
|
@ -33,8 +33,7 @@ $(document).ready(function() {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
$('#externalStorage tbody tr').live('change', function() {
|
$('#externalStorage tbody').on('change', 'tr', function() {
|
||||||
console.log('hello');
|
|
||||||
if ($(this).hasClass('\\\\OC\\\\Files\\\\Storage\\\\Google') && $(this).find('[data-parameter="configured"]').val() != 'true') {
|
if ($(this).hasClass('\\\\OC\\\\Files\\\\Storage\\\\Google') && $(this).find('[data-parameter="configured"]').val() != 'true') {
|
||||||
if ($(this).find('.mountPoint input').val() != '') {
|
if ($(this).find('.mountPoint input').val() != '') {
|
||||||
if ($(this).find('.google').length == 0) {
|
if ($(this).find('.google').length == 0) {
|
||||||
|
@ -44,7 +43,7 @@ $(document).ready(function() {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
$('#externalStorage tbody tr .mountPoint input').live('keyup', function() {
|
$('#externalStorage tbody').on('keyup', 'tr .mountPoint input', function() {
|
||||||
var tr = $(this).parent().parent();
|
var tr = $(this).parent().parent();
|
||||||
if ($(tr).hasClass('\\\\OC\\\\Files\\\\Storage\\\\Google') && $(tr).find('[data-parameter="configured"]').val() != 'true' && $(tr).find('.google').length > 0) {
|
if ($(tr).hasClass('\\\\OC\\\\Files\\\\Storage\\\\Google') && $(tr).find('[data-parameter="configured"]').val() != 'true' && $(tr).find('.google').length > 0) {
|
||||||
if ($(this).val() != '') {
|
if ($(this).val() != '') {
|
||||||
|
@ -55,7 +54,7 @@ $(document).ready(function() {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
$('.google').live('click', function(event) {
|
$('.google').on('click', function(event) {
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
var tr = $(this).parent().parent();
|
var tr = $(this).parent().parent();
|
||||||
var configured = $(this).parent().find('[data-parameter="configured"]');
|
var configured = $(this).parent().find('[data-parameter="configured"]');
|
||||||
|
|
|
@ -71,7 +71,7 @@ OC.MountConfig={
|
||||||
$(document).ready(function() {
|
$(document).ready(function() {
|
||||||
$('.chzn-select').chosen();
|
$('.chzn-select').chosen();
|
||||||
|
|
||||||
$('#selectBackend').live('change', function() {
|
$('#selectBackend').on('change', function() {
|
||||||
var tr = $(this).parent().parent();
|
var tr = $(this).parent().parent();
|
||||||
$('#externalStorage tbody').append($(tr).clone());
|
$('#externalStorage tbody').append($(tr).clone());
|
||||||
$('#externalStorage tbody tr').last().find('.mountPoint input').val('');
|
$('#externalStorage tbody tr').last().find('.mountPoint input').val('');
|
||||||
|
@ -135,11 +135,11 @@ $(document).ready(function() {
|
||||||
return defaultMountPoint+append;
|
return defaultMountPoint+append;
|
||||||
}
|
}
|
||||||
|
|
||||||
$('#externalStorage td').live('change', function() {
|
$('#externalStorage').on('change', 'td', function() {
|
||||||
OC.MountConfig.saveStorage($(this).parent());
|
OC.MountConfig.saveStorage($(this).parent());
|
||||||
});
|
});
|
||||||
|
|
||||||
$('td.remove>img').live('click', function() {
|
$('td.remove>img').on('click', function() {
|
||||||
var tr = $(this).parent().parent();
|
var tr = $(this).parent().parent();
|
||||||
var mountPoint = $(tr).find('.mountPoint input').val();
|
var mountPoint = $(tr).find('.mountPoint input').val();
|
||||||
if ( ! mountPoint) {
|
if ( ! mountPoint) {
|
||||||
|
|
|
@ -50,7 +50,7 @@ var OCCategories= {
|
||||||
$('#category_dialog').remove();
|
$('#category_dialog').remove();
|
||||||
},
|
},
|
||||||
open : function(event, ui) {
|
open : function(event, ui) {
|
||||||
$('#category_addinput').live('input',function() {
|
$('#category_addinput').on('input',function() {
|
||||||
if($(this).val().length > 0) {
|
if($(this).val().length > 0) {
|
||||||
$('#category_addbutton').removeAttr('disabled');
|
$('#category_addbutton').removeAttr('disabled');
|
||||||
}
|
}
|
||||||
|
@ -61,7 +61,7 @@ var OCCategories= {
|
||||||
$('#category_addbutton').attr('disabled', 'disabled');
|
$('#category_addbutton').attr('disabled', 'disabled');
|
||||||
return false;
|
return false;
|
||||||
});
|
});
|
||||||
$('#category_addbutton').live('click',function(e) {
|
$('#category_addbutton').on('click',function(e) {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
if($('#category_addinput').val().length > 0) {
|
if($('#category_addinput').val().length > 0) {
|
||||||
OCCategories.add($('#category_addinput').val());
|
OCCategories.add($('#category_addinput').val());
|
||||||
|
|
|
@ -410,7 +410,7 @@ $(document).ready(function() {
|
||||||
firstDay: firstDay
|
firstDay: firstDay
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
$('a.share').live('click', function(event) {
|
$('#fileList').on('click', 'a.share', function(event) {
|
||||||
event.stopPropagation();
|
event.stopPropagation();
|
||||||
if ($(this).data('item-type') !== undefined && $(this).data('item') !== undefined) {
|
if ($(this).data('item-type') !== undefined && $(this).data('item') !== undefined) {
|
||||||
var itemType = $(this).data('item-type');
|
var itemType = $(this).data('item-type');
|
||||||
|
@ -444,12 +444,12 @@ $(document).ready(function() {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
$('#shareWithList li').live('mouseenter', function(event) {
|
$('#fileList').on('mouseenter', '#dropdown #shareWithList li', function(event) {
|
||||||
// Show permissions and unshare button
|
// Show permissions and unshare button
|
||||||
$(':hidden', this).filter(':not(.cruds)').show();
|
$(':hidden', this).filter(':not(.cruds)').show();
|
||||||
});
|
});
|
||||||
|
|
||||||
$('#shareWithList li').live('mouseleave', function(event) {
|
$('#fileList').on('mouseleave', '#dropdown #shareWithList li', function(event) {
|
||||||
// Hide permissions and unshare button
|
// Hide permissions and unshare button
|
||||||
if (!$('.cruds', this).is(':visible')) {
|
if (!$('.cruds', this).is(':visible')) {
|
||||||
$('a', this).hide();
|
$('a', this).hide();
|
||||||
|
@ -462,11 +462,11 @@ $(document).ready(function() {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
$('.showCruds').live('click', function() {
|
$('#fileList').on('click', '#dropdown .showCruds', function() {
|
||||||
$(this).parent().find('.cruds').toggle();
|
$(this).parent().find('.cruds').toggle();
|
||||||
});
|
});
|
||||||
|
|
||||||
$('.unshare').live('click', function() {
|
$('#fileList').on('click', '#dropdown .unshare', function() {
|
||||||
var li = $(this).parent();
|
var li = $(this).parent();
|
||||||
var itemType = $('#dropdown').data('item-type');
|
var itemType = $('#dropdown').data('item-type');
|
||||||
var itemSource = $('#dropdown').data('item-source');
|
var itemSource = $('#dropdown').data('item-source');
|
||||||
|
@ -483,7 +483,7 @@ $(document).ready(function() {
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
$('.permissions').live('change', function() {
|
$('#fileList').on('change', '#dropdown .permissions', function() {
|
||||||
if ($(this).attr('name') == 'edit') {
|
if ($(this).attr('name') == 'edit') {
|
||||||
var li = $(this).parent().parent()
|
var li = $(this).parent().parent()
|
||||||
var checkboxes = $('.permissions', li);
|
var checkboxes = $('.permissions', li);
|
||||||
|
@ -510,7 +510,7 @@ $(document).ready(function() {
|
||||||
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);
|
||||||
});
|
});
|
||||||
|
|
||||||
$('#linkCheckbox').live('change', function() {
|
$('#fileList').on('change', '#dropdown #linkCheckbox', function() {
|
||||||
var itemType = $('#dropdown').data('item-type');
|
var itemType = $('#dropdown').data('item-type');
|
||||||
var itemSource = $('#dropdown').data('item-source');
|
var itemSource = $('#dropdown').data('item-source');
|
||||||
if (this.checked) {
|
if (this.checked) {
|
||||||
|
@ -532,12 +532,12 @@ $(document).ready(function() {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
$('#linkText').live('click', function() {
|
$('#fileList').on('click', '#dropdown #linkText', function() {
|
||||||
$(this).focus();
|
$(this).focus();
|
||||||
$(this).select();
|
$(this).select();
|
||||||
});
|
});
|
||||||
|
|
||||||
$('#showPassword').live('click', function() {
|
$('#fileList').on('click', '#dropdown #showPassword', function() {
|
||||||
$('#linkPass').toggle('blind');
|
$('#linkPass').toggle('blind');
|
||||||
if (!$('#showPassword').is(':checked') ) {
|
if (!$('#showPassword').is(':checked') ) {
|
||||||
var itemType = $('#dropdown').data('item-type');
|
var itemType = $('#dropdown').data('item-type');
|
||||||
|
@ -548,7 +548,7 @@ $(document).ready(function() {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
$('#linkPassText').live('focusout keyup', function(event) {
|
$('#fileList').on('focusout keyup', '#dropdown #linkPassText', function(event) {
|
||||||
if ( $('#linkPassText').val() != '' && (event.type == 'focusout' || event.keyCode == 13) ) {
|
if ( $('#linkPassText').val() != '' && (event.type == 'focusout' || event.keyCode == 13) ) {
|
||||||
var itemType = $('#dropdown').data('item-type');
|
var itemType = $('#dropdown').data('item-type');
|
||||||
var itemSource = $('#dropdown').data('item-source');
|
var itemSource = $('#dropdown').data('item-source');
|
||||||
|
@ -560,7 +560,7 @@ $(document).ready(function() {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
$('#expirationCheckbox').live('click', function() {
|
$('#fileList').on('click', '#dropdown #expirationCheckbox', function() {
|
||||||
if (this.checked) {
|
if (this.checked) {
|
||||||
OC.Share.showExpirationDate('');
|
OC.Share.showExpirationDate('');
|
||||||
} else {
|
} else {
|
||||||
|
@ -575,7 +575,7 @@ $(document).ready(function() {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
$('#expirationDate').live('change', function() {
|
$('#fileList').on('change', '#dropdown #expirationDate', function() {
|
||||||
var itemType = $('#dropdown').data('item-type');
|
var itemType = $('#dropdown').data('item-type');
|
||||||
var itemSource = $('#dropdown').data('item-source');
|
var itemSource = $('#dropdown').data('item-source');
|
||||||
$.post(OC.filePath('core', 'ajax', 'share.php'), { action: 'setExpirationDate', itemType: itemType, itemSource: itemSource, date: $(this).val() }, function(result) {
|
$.post(OC.filePath('core', 'ajax', 'share.php'), { action: 'setExpirationDate', itemType: itemType, itemSource: itemSource, date: $(this).val() }, function(result) {
|
||||||
|
@ -586,7 +586,7 @@ $(document).ready(function() {
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
$('#emailPrivateLink').live('submit', function(event) {
|
$('#fileList').on('submit', '#dropdown #emailPrivateLink', function(event) {
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
var link = $('#linkText').val();
|
var link = $('#linkText').val();
|
||||||
var itemType = $('#dropdown').data('item-type');
|
var itemType = $('#dropdown').data('item-type');
|
||||||
|
|
|
@ -263,7 +263,7 @@ $(document).ready(function () {
|
||||||
UserList.applyMultiplySelect($(element));
|
UserList.applyMultiplySelect($(element));
|
||||||
});
|
});
|
||||||
|
|
||||||
$('td.remove>a').live('click', function (event) {
|
$('table').on('click', 'td.remove>a', function (event) {
|
||||||
var row = $(this).parent().parent();
|
var row = $(this).parent().parent();
|
||||||
var uid = $(row).attr('data-uid');
|
var uid = $(row).attr('data-uid');
|
||||||
$(row).hide();
|
$(row).hide();
|
||||||
|
@ -271,7 +271,7 @@ $(document).ready(function () {
|
||||||
UserList.do_delete(uid);
|
UserList.do_delete(uid);
|
||||||
});
|
});
|
||||||
|
|
||||||
$('td.password>img').live('click', function (event) {
|
$('table').on('click', 'td.password>img', function (event) {
|
||||||
event.stopPropagation();
|
event.stopPropagation();
|
||||||
var img = $(this);
|
var img = $(this);
|
||||||
var uid = img.parent().parent().attr('data-uid');
|
var uid = img.parent().parent().attr('data-uid');
|
||||||
|
@ -299,11 +299,11 @@ $(document).ready(function () {
|
||||||
img.css('display', '');
|
img.css('display', '');
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
$('td.password').live('click', function (event) {
|
$('table').on('click', 'td.password', function (event) {
|
||||||
$(this).children('img').click();
|
$(this).children('img').click();
|
||||||
});
|
});
|
||||||
|
|
||||||
$('td.displayName>img').live('click', function (event) {
|
$('table').on('click', 'td.displayName>img', function (event) {
|
||||||
event.stopPropagation();
|
event.stopPropagation();
|
||||||
var img = $(this);
|
var img = $(this);
|
||||||
var uid = img.parent().parent().attr('data-uid');
|
var uid = img.parent().parent().attr('data-uid');
|
||||||
|
@ -332,12 +332,12 @@ $(document).ready(function () {
|
||||||
img.css('display', '');
|
img.css('display', '');
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
$('td.displayName').live('click', function (event) {
|
$('table').on('click', 'td.displayName', function (event) {
|
||||||
$(this).children('img').click();
|
$(this).children('img').click();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
$('select.quota, select.quota-user').live('change', function () {
|
$('select.quota, select.quota-user').on('change', function () {
|
||||||
var select = $(this);
|
var select = $(this);
|
||||||
var uid = $(this).parent().parent().parent().attr('data-uid');
|
var uid = $(this).parent().parent().parent().attr('data-uid');
|
||||||
var quota = $(this).val();
|
var quota = $(this).val();
|
||||||
|
@ -356,7 +356,7 @@ $(document).ready(function () {
|
||||||
$(select).data('previous', $(select).val());
|
$(select).data('previous', $(select).val());
|
||||||
})
|
})
|
||||||
|
|
||||||
$('input.quota-other').live('change', function () {
|
$('input.quota-other').on('change', function () {
|
||||||
var uid = $(this).parent().parent().parent().attr('data-uid');
|
var uid = $(this).parent().parent().parent().attr('data-uid');
|
||||||
var quota = $(this).val();
|
var quota = $(this).val();
|
||||||
var select = $(this).prev();
|
var select = $(this).prev();
|
||||||
|
@ -392,7 +392,7 @@ $(document).ready(function () {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
$('input.quota-other').live('blur', function () {
|
$('input.quota-other').on('blur', function () {
|
||||||
$(this).change();
|
$(this).change();
|
||||||
})
|
})
|
||||||
|
|
||||||
|
@ -439,7 +439,7 @@ $(document).ready(function () {
|
||||||
});
|
});
|
||||||
// Handle undo notifications
|
// Handle undo notifications
|
||||||
OC.Notification.hide();
|
OC.Notification.hide();
|
||||||
$('#notification .undo').live('click', function () {
|
$('#notification').on('click', '.undo', function () {
|
||||||
if ($('#notification').data('deleteuser')) {
|
if ($('#notification').data('deleteuser')) {
|
||||||
$('tbody tr').filterAttr('data-uid', UserList.deleteUid).show();
|
$('tbody tr').filterAttr('data-uid', UserList.deleteUid).show();
|
||||||
UserList.deleteCanceled = true;
|
UserList.deleteCanceled = true;
|
||||||
|
|
Loading…
Reference in New Issue