summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJörn Friedrich Dreyer <jfd@butonic.de>2013-01-18 22:38:44 +0100
committerJörn Friedrich Dreyer <jfd@butonic.de>2013-01-30 17:00:54 +0100
commit22812c5f0dc57b1598912cf51fd1e5b721519f2d (patch)
tree13b9599505b4cc974fe8249898476b91640f63d7
parent5761bd771f4142394a00083712b63e77f8976946 (diff)
downloadnextcloud-server-22812c5f0dc57b1598912cf51fd1e5b721519f2d.tar.gz
nextcloud-server-22812c5f0dc57b1598912cf51fd1e5b721519f2d.zip
replace live() with on() in core js
-rw-r--r--apps/files/js/filelist.js8
-rw-r--r--apps/files/js/files.js6
-rw-r--r--apps/files_external/js/dropbox.js4
-rw-r--r--apps/files_external/js/google.js6
-rw-r--r--apps/files_external/js/settings.js6
-rw-r--r--core/js/oc-vcategories.js4
-rw-r--r--core/js/share.js26
-rw-r--r--settings/js/users.js16
8 files changed, 38 insertions, 38 deletions
diff --git a/apps/files/js/filelist.js b/apps/files/js/filelist.js
index 04b7d92e2c3..57c281f2fdc 100644
--- a/apps/files/js/filelist.js
+++ b/apps/files/js/filelist.js
@@ -335,7 +335,7 @@ var FileList={
$(document).ready(function(){
$('#notification').hide();
- $('#notification .undo').live('click', function(){
+ $('#notification').on('click', '.undo', function(){
if (FileList.deleteFiles) {
$.each(FileList.deleteFiles,function(index,file){
$('tr').filterAttr('data-file',file).show();
@@ -361,16 +361,16 @@ $(document).ready(function(){
FileList.lastAction = null;
OC.Notification.hide();
});
- $('#notification .replace').live('click', function() {
+ $('#notification').on('click', '.replace', function() {
OC.Notification.hide(function() {
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();
OC.Notification.hide();
});
- $('#notification .cancel').live('click', function() {
+ $('#notification').on('click', '.cancel', function() {
if ($('#notification').data('isNewFile')) {
FileList.deleteCanceled = false;
FileList.deleteFiles = [$('#notification').data('oldName')];
diff --git a/apps/files/js/files.js b/apps/files/js/files.js
index c817d8431e2..9fd9b73a947 100644
--- a/apps/files/js/files.js
+++ b/apps/files/js/files.js
@@ -110,7 +110,7 @@ $(document).ready(function() {
}
// Triggers invisible file input
- $('#upload a').live('click', function() {
+ $('#upload a').on('click', function() {
$(this).parent().children('#file_upload_start').trigger('click');
return false;
});
@@ -118,7 +118,7 @@ $(document).ready(function() {
var lastChecked;
// Sets the file link behaviour :
- $('td.filename a').live('click',function(event) {
+ $('td.filename').on('click','a',function(event) {
if (event.ctrlKey || event.shiftKey) {
event.preventDefault();
if (event.shiftKey) {
@@ -184,7 +184,7 @@ $(document).ready(function() {
procesSelection();
});
- $('td.filename input:checkbox').live('change',function(event) {
+ $('#fileList').on('change', 'td.filename input:checkbox',function(event) {
if (event.shiftKey) {
var last = $(lastChecked).parent().parent().prevAll().length;
var first = $(this).parent().parent().prevAll().length;
diff --git a/apps/files_external/js/dropbox.js b/apps/files_external/js/dropbox.js
index c1e38640708..930d786c543 100644
--- a/apps/files_external/js/dropbox.js
+++ b/apps/files_external/js/dropbox.js
@@ -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();
if ($(tr).hasClass('OC_Filestorage_Dropbox') && $(tr).find('[data-parameter="configured"]').val() != 'true') {
var config = $(tr).find('.configuration');
@@ -52,7 +52,7 @@ $(document).ready(function() {
}
});
- $('.dropbox').live('click', function(event) {
+ $('.dropbox').on('click', function(event) {
event.preventDefault();
var app_key = $(this).parent().find('[data-parameter="app_key"]').val();
var app_secret = $(this).parent().find('[data-parameter="app_secret"]').val();
diff --git a/apps/files_external/js/google.js b/apps/files_external/js/google.js
index 0b3c314eb5d..d26dc7f0014 100644
--- a/apps/files_external/js/google.js
+++ b/apps/files_external/js/google.js
@@ -33,7 +33,7 @@ $(document).ready(function() {
}
});
- $('#externalStorage tbody tr').live('change', function() {
+ $('#externalStorage tbody').on('change', 'tr', function() {
if ($(this).hasClass('OC_Filestorage_Google') && $(this).find('[data-parameter="configured"]').val() != 'true') {
if ($(this).find('.mountPoint input').val() != '') {
if ($(this).find('.google').length == 0) {
@@ -43,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();
if ($(tr).hasClass('OC_Filestorage_Google') && $(tr).find('[data-parameter="configured"]').val() != 'true' && $(tr).find('.google').length > 0) {
if ($(this).val() != '') {
@@ -54,7 +54,7 @@ $(document).ready(function() {
}
});
- $('.google').live('click', function(event) {
+ $('.google').on('click', function(event) {
event.preventDefault();
var tr = $(this).parent().parent();
var configured = $(this).parent().find('[data-parameter="configured"]');
diff --git a/apps/files_external/js/settings.js b/apps/files_external/js/settings.js
index 0dc983ca8ad..75604ca4530 100644
--- a/apps/files_external/js/settings.js
+++ b/apps/files_external/js/settings.js
@@ -71,7 +71,7 @@ OC.MountConfig={
$(document).ready(function() {
$('.chzn-select').chosen();
- $('#selectBackend').live('change', function() {
+ $('#selectBackend').on('change', function() {
var tr = $(this).parent().parent();
$('#externalStorage tbody').append($(tr).clone());
$('#externalStorage tbody tr').last().find('.mountPoint input').val('');
@@ -135,11 +135,11 @@ $(document).ready(function() {
return defaultMountPoint+append;
}
- $('#externalStorage td').live('change', function() {
+ $('#externalStorage').on('change', 'td', function() {
OC.MountConfig.saveStorage($(this).parent());
});
- $('td.remove>img').live('click', function() {
+ $('td.remove>img').on('click', function() {
var tr = $(this).parent().parent();
var mountPoint = $(tr).find('.mountPoint input').val();
if ( ! mountPoint) {
diff --git a/core/js/oc-vcategories.js b/core/js/oc-vcategories.js
index 609703f2cc9..3e75767c49c 100644
--- a/core/js/oc-vcategories.js
+++ b/core/js/oc-vcategories.js
@@ -50,7 +50,7 @@ var OCCategories= {
$('#category_dialog').remove();
},
open : function(event, ui) {
- $('#category_addinput').live('input',function() {
+ $('#category_addinput').on('input',function() {
if($(this).val().length > 0) {
$('#category_addbutton').removeAttr('disabled');
}
@@ -61,7 +61,7 @@ var OCCategories= {
$('#category_addbutton').attr('disabled', 'disabled');
return false;
});
- $('#category_addbutton').live('click',function(e) {
+ $('#category_addbutton').on('click',function(e) {
e.preventDefault();
if($('#category_addinput').val().length > 0) {
OCCategories.add($('#category_addinput').val());
diff --git a/core/js/share.js b/core/js/share.js
index 0c45765bd8b..f42124d0e00 100644
--- a/core/js/share.js
+++ b/core/js/share.js
@@ -410,7 +410,7 @@ $(document).ready(function() {
firstDay: firstDay
});
}
- $('a.share').live('click', function(event) {
+ $('a.share').on('click', 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() {
}
});
- $('#shareWithList li').live('mouseenter', function(event) {
+ $('#shareWithList').on('mouseenter', 'li', function(event) {
// Show permissions and unshare button
$(':hidden', this).filter(':not(.cruds)').show();
});
- $('#shareWithList li').live('mouseleave', function(event) {
+ $('#shareWithList').on('mouseleave', 'li', function(event) {
// Hide permissions and unshare button
if (!$('.cruds', this).is(':visible')) {
$('a', this).hide();
@@ -462,11 +462,11 @@ $(document).ready(function() {
}
});
- $('.showCruds').live('click', function() {
+ $('.showCruds').on('click', function() {
$(this).parent().find('.cruds').toggle();
});
- $('.unshare').live('click', function() {
+ $('.unshare').on('click', function() {
var li = $(this).parent();
var itemType = $('#dropdown').data('item-type');
var itemSource = $('#dropdown').data('item-source');
@@ -483,7 +483,7 @@ $(document).ready(function() {
});
});
- $('.permissions').live('change', function() {
+ $('.permissions').on('change', function() {
if ($(this).attr('name') == 'edit') {
var li = $(this).parent().parent()
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);
});
- $('#linkCheckbox').live('change', function() {
+ $('#linkCheckbox').on('change', function() {
var itemType = $('#dropdown').data('item-type');
var itemSource = $('#dropdown').data('item-source');
if (this.checked) {
@@ -532,12 +532,12 @@ $(document).ready(function() {
}
});
- $('#linkText').live('click', function() {
+ $('#linkText').on('click', function() {
$(this).focus();
$(this).select();
});
- $('#showPassword').live('click', function() {
+ $('#showPassword').on('click', function() {
$('#linkPass').toggle('blind');
if (!$('#showPassword').is(':checked') ) {
var itemType = $('#dropdown').data('item-type');
@@ -548,7 +548,7 @@ $(document).ready(function() {
}
});
- $('#linkPassText').live('focusout keyup', function(event) {
+ $('#linkPassText').on('focusout keyup', 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 +560,7 @@ $(document).ready(function() {
}
});
- $('#expirationCheckbox').live('click', function() {
+ $('#expirationCheckbox').on('click', function() {
if (this.checked) {
OC.Share.showExpirationDate('');
} else {
@@ -575,7 +575,7 @@ $(document).ready(function() {
}
});
- $('#expirationDate').live('change', function() {
+ $('#expirationDate').on('change', 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,7 +586,7 @@ $(document).ready(function() {
});
- $('#emailPrivateLink').live('submit', function(event) {
+ $('#emailPrivateLink').on('submit', function(event) {
event.preventDefault();
var link = $('#linkText').val();
var itemType = $('#dropdown').data('item-type');
diff --git a/settings/js/users.js b/settings/js/users.js
index 424d00b51a7..0ee813f4cb3 100644
--- a/settings/js/users.js
+++ b/settings/js/users.js
@@ -262,7 +262,7 @@ $(document).ready(function () {
UserList.applyMultiplySelect($(element));
});
- $('td.remove>a').live('click', function (event) {
+ $('table').on('click', 'td.remove>a', function (event) {
var row = $(this).parent().parent();
var uid = $(row).attr('data-uid');
$(row).hide();
@@ -270,7 +270,7 @@ $(document).ready(function () {
UserList.do_delete(uid);
});
- $('td.password>img').live('click', function (event) {
+ $('table').on('click', 'td.password>img', function (event) {
event.stopPropagation();
var img = $(this);
var uid = img.parent().parent().attr('data-uid');
@@ -298,11 +298,11 @@ $(document).ready(function () {
img.css('display', '');
});
});
- $('td.password').live('click', function (event) {
+ $('table').on('click', 'td.password', function (event) {
$(this).children('img').click();
});
- $('td.displayName>img').live('click', function (event) {
+ $('table').on('click', 'td.displayName>img', function (event) {
event.stopPropagation();
var img = $(this);
var uid = img.parent().parent().attr('data-uid');
@@ -336,7 +336,7 @@ $(document).ready(function () {
});
- $('select.quota, select.quota-user').live('change', function () {
+ $('select.quota, select.quota-user').on('change', function () {
var select = $(this);
var uid = $(this).parent().parent().parent().attr('data-uid');
var quota = $(this).val();
@@ -355,7 +355,7 @@ $(document).ready(function () {
$(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 quota = $(this).val();
var select = $(this).prev();
@@ -391,7 +391,7 @@ $(document).ready(function () {
}
});
- $('input.quota-other').live('blur', function () {
+ $('input.quota-other').on('blur', function () {
$(this).change();
})
@@ -438,7 +438,7 @@ $(document).ready(function () {
});
// Handle undo notifications
OC.Notification.hide();
- $('#notification .undo').live('click', function () {
+ $('#notification').on('click', '.undo', function () {
if ($('#notification').data('deleteuser')) {
$('tbody tr').filterAttr('data-uid', UserList.deleteUid).show();
UserList.deleteCanceled = true;