]> source.dussan.org Git - nextcloud-server.git/commitdiff
Contacts: convert class attribute selectors to class selectors
authorBart Visscher <bartv@thisnet.nl>
Mon, 5 Mar 2012 21:02:44 +0000 (22:02 +0100)
committerBart Visscher <bartv@thisnet.nl>
Wed, 7 Mar 2012 20:46:41 +0000 (21:46 +0100)
apps/contacts/js/contacts.js

index d033e3f21cdfb3f8f5915cf021b7db7ae1f2b418..60ee8b9e56c7028ba2ac4c2672f0372bd77518c1 100644 (file)
@@ -68,7 +68,7 @@ Contacts={
                        return $(obj).parents('.propertycontainer').first().data('element');
                },
                showHideContactInfo:function() {
-                       var show = ($('#emaillist li[class*="propertycontainer"]').length > 0 || $('#phonelist li[class*="propertycontainer"]').length > 0 || $('#addressdisplay dl[class*="propertycontainer"]').length > 0);
+                       var show = ($('#emaillist li.propertycontainer').length > 0 || $('#phonelist li.propertycontainer').length > 0 || $('#addressdisplay dl.propertycontainer').length > 0);
                        console.log('showHideContactInfo: ' + show);
                        if(show) {
                                $('#contact_communication').show();
@@ -82,19 +82,19 @@ Contacts={
                        switch (type) {
                                case 'EMAIL':
                                        console.log('emails: '+$('#emaillist>li').length);
-                                       if($('#emaillist li[class*="propertycontainer"]').length == 0) {
+                                       if($('#emaillist li.propertycontainer').length == 0) {
                                                $('#emails').hide();
                                        }
                                        break;
                                case 'TEL':
                                        console.log('phones: '+$('#phonelist>li').length);
-                                       if($('#phonelist li[class*="propertycontainer"]').length == 0) {
+                                       if($('#phonelist li.propertycontainer').length == 0) {
                                                $('#phones').hide();
                                        }
                                        break;
                                case 'ADR':
                                        console.log('addresses: '+$('#addressdisplay>dl').length);
-                                       if($('#addressdisplay dl[class*="propertycontainer"]').length == 0) {
+                                       if($('#addressdisplay dl.propertycontainer').length == 0) {
                                                $('#addresses').hide();
                                        }
                                        break;
@@ -183,7 +183,7 @@ Contacts={
                                                dateFormat : 'dd-mm-yy'
                        });
                        // Style phone types
-                       $('#phonelist').find('select[class*="contacts_property"]').multiselect({
+                       $('#phonelist').find('select.contacts_property').multiselect({
                                                                                                        noneSelectedText: t('contacts', 'Select type'),
                                                                                                        header: false,
                                                                                                        selectedList: 4,
@@ -373,7 +373,7 @@ Contacts={
                        loadSingleProperties:function() {
                                var props = ['BDAY', 'NICKNAME', 'ORG'];
                                // Clear all elements
-                               $('#ident .propertycontainer[class*="propertycontainer"]').each(function(){
+                               $('#ident .propertycontainer').each(function(){
                                        if(props.indexOf($(this).data('element')) > -1) {
                                                $(this).data('checksum', '');
                                                $(this).find('input').val('');
@@ -518,8 +518,8 @@ Contacts={
                                var checksum = container.data('checksum');
                                var name = container.data('element');
                                console.log('saveProperty: ' + name);
-                               var fields = container.find('input[class*="contacts_property"],select[class*="contacts_property"]').serializeArray();
-                               var q = container.find('input[class*="contacts_property"],select[class*="contacts_property"]').serialize();
+                               var fields = container.find('input.contacts_property,select.contacts_property').serializeArray();
+                               var q = container.find('input.contacts_property,select.contacts_property').serialize();
                                if(q == '' || q == undefined) {
                                        console.log('Couldn\'t serialize elements.');
                                        Contacts.UI.loading(container, false);
@@ -708,7 +708,7 @@ Contacts={
                        },
                        loadAddresses:function(){
                                $('#addresses').hide();
-                               $('#addressdisplay dl[class*="propertycontainer"]').remove();
+                               $('#addressdisplay dl.propertycontainer').remove();
                                for(var adr in this.data.ADR) {
                                        $('#addressdisplay dl').first().clone().insertAfter($('#addressdisplay dl').last()).show();
                                        $('#addressdisplay dl').last().removeClass('template').addClass('propertycontainer');
@@ -920,15 +920,15 @@ Contacts={
                        },
                        addMail:function() {
                                //alert('addMail');
-                               $('#emaillist li[class*="template"]:first-child').clone().appendTo($('#emaillist')).show();
-                               $('#emaillist li[class*="template"]:last-child').removeClass('template').addClass('propertycontainer');
+                               $('#emaillist li.template:first-child').clone().appendTo($('#emaillist')).show();
+                               $('#emaillist li.template:last-child').removeClass('template').addClass('propertycontainer');
                                $('#emaillist li:last-child').find('input[type="email"]').focus();
                                Contacts.UI.loadListHandlers();
                                return false;
                        },
                        loadMails:function() {
                                $('#emails').hide();
-                               $('#emaillist li[class*="propertycontainer"]').remove();
+                               $('#emaillist li.propertycontainer').remove();
                                for(var mail in this.data.EMAIL) {
                                        this.addMail();
                                        //$('#emaillist li:first-child').clone().appendTo($('#emaillist')).show();
@@ -950,9 +950,9 @@ Contacts={
                                return false;
                        },
                        addPhone:function() {
-                               $('#phonelist li[class*="template"]:first-child').clone().appendTo($('#phonelist')); //.show();
-                               $('#phonelist li[class*="template"]:last-child').find('select').addClass('contacts_property');
-                               $('#phonelist li[class*="template"]:last-child').removeClass('template').addClass('propertycontainer');
+                               $('#phonelist li.template:first-child').clone().appendTo($('#phonelist')); //.show();
+                               $('#phonelist li.template:last-child').find('select').addClass('contacts_property');
+                               $('#phonelist li.template:last-child').removeClass('template').addClass('propertycontainer');
                                $('#phonelist li:last-child').find('input[type="text"]').focus();
                                Contacts.UI.loadListHandlers();
                                $('#phonelist li:last-child').find('select').multiselect({
@@ -966,7 +966,7 @@ Contacts={
                        },
                        loadPhones:function() {
                                $('#phones').hide();
-                               $('#phonelist li[class*="propertycontainer"]').remove();
+                               $('#phonelist li.propertycontainer').remove();
                                for(var phone in this.data.TEL) {
                                        this.addPhone();
                                        $('#phonelist li:last-child').find('select').multiselect('destroy');