]> source.dussan.org Git - nextcloud-server.git/commitdiff
fix pathes in contacts
authorGeorg Ehrke <dev@georgswebsite.de>
Tue, 24 Apr 2012 19:33:34 +0000 (21:33 +0200)
committerGeorg Ehrke <dev@georgswebsite.de>
Tue, 24 Apr 2012 19:33:34 +0000 (21:33 +0200)
apps/contacts/css/contacts.css
apps/contacts/js/contacts.js
core/js/js.js
core/templates/layout.user.php

index 4c5242f607f370e552a52c73b54f685cd4db4f12..15f98cffbfb8cbf0f3be84d2891d8152251fe040 100644 (file)
@@ -11,7 +11,7 @@
 #actionbar { height: 30px; width: 60px; position: fixed; right: 0px; top: 4em; margin: 0 0 0 0; padding: 0 0 0 0; z-index: 1000; }
 #contacts_deletecard {position:absolute;top:15px;right:25px;}
 #contacts_downloadcard {position:absolute;top:15px;right:50px;}
-#contacts_propertymenu_button { position:absolute;top:15px;right:150px; background:url('core/img/actions/add.svg') no-repeat center;    }
+#contacts_propertymenu_button { position:absolute;top:15px;right:150px;}
 #contacts_propertymenu { background-color: #fff; position:absolute;top:40px;right:150px; overflow:hidden; text-overflow:ellipsis; /*border: thin solid #1d2d44;*/  -moz-box-shadow:0 0 10px #000; -webkit-box-shadow:0 0 10px #000; box-shadow:0 0 10px #000; -moz-border-radius:0.5em; -webkit-border-radius:0.5em; border-radius:0.5em; -moz-border-radius:0.5em; -webkit-border-radius:0.5em; border-radius:0.5em; }
 #contacts_propertymenu li { display: block; font-weight: bold; height: 20px; width: 100px; }
 #contacts_propertymenu li a { padding: 3px; display: block }
@@ -34,20 +34,12 @@ dl.form { width: 100%; float: left; clear: right; margin: 0; padding: 0; }
 #address.form dt { min-width: 5em; }
 #address.form dl { min-width: 10em; }
 
-.loading { background: url('core/img/loading.gif') no-repeat center !important; /*cursor: progress; */ cursor: wait; }
-.ui-autocomplete-loading { background: url('core/img/loading.gif') right center no-repeat; }
+.loading {/*cursor: progress; */ cursor: wait; }
 .float { float: left; }
 .listactions { height: 1em; width:60px; float: left; clear: right; }
 .add,.edit,.delete,.mail, .globe, .upload, .cloud { cursor: pointer; width: 20px; height: 20px; margin: 0; float: left; position:relative; opacity: 0.1; }
 .add:hover,.edit:hover,.delete:hover,.mail:hover, .globe:hover, .upload:hover, .cloud:hover { opacity: 1.0 }
-.add { background:url('core/img/actions/add.svg') no-repeat center; clear: both; }
-.delete { background:url('core/img/actions/delete.svg') no-repeat center; }
-.edit { background:url('core/img/actions/rename.svg') no-repeat center; }
-.mail { background:url('core/img/actions/mail.svg') no-repeat center; }
-.upload { background:url('core/img/actions/upload.svg') no-repeat center; }
-.cloud { background:url('core/img/places/picture.svg') no-repeat center; }
-/*.globe { background:url('../img/globe.svg') no-repeat center; }*/
-.globe { background:url('core/img/actions/public.svg') no-repeat center; }
+
 .transparent{ opacity: 0.6; }
 #edit_name_dialog { padding:0; }
 #edit_name_dialog > input { width: 15em; }
@@ -59,11 +51,11 @@ dl.form { width: 100%; float: left; clear: right; margin: 0; padding: 0; }
 #identityprops { /*position: absolute; top: 2.5em; left: 0px;*/ }
 /*#contact_photo { max-width: 250px; }*/
 #contact_identity { min-width: 30em; }
-.contactsection { position: relative; float: left; /*max-width: 40em;*/ padding: 0.5em; height: auto: border: thin solid lightgray;/* -webkit-border-radius: 0.5em; -moz-border-radius: 0.5em; border-radius: 0.5em; background-color: #f8f8f8;*/ }
+.contactsection { position: relative; float: left; /*max-width: 40em;*/ padding: 0.5em; height: auto; border: thin solid lightgray;/* -webkit-border-radius: 0.5em; -moz-border-radius: 0.5em; border-radius: 0.5em; background-color: #f8f8f8;*/ }
 
 .contactpart legend { width:auto; padding:.3em; border:1px solid #ddd; font-weight:bold; cursor:pointer; background:#f8f8f8; color:#555; text-shadow:#fff 0 1px 0; -moz-box-shadow:0 1px 1px #fff, 0 1px 1px #fff inset; -webkit-box-shadow:0 1px 1px #fff, 0 1px 1px #fff inset; -moz-border-radius:.5em; -webkit-border-radius:.5em; border-radius:.5em; }
 #cropbox { margin: auto; }
-#contacts_details_photo { border-radius: 0.5em; border: thin solid #bbb; margin: 0.3em; background: url(core/img/loading.gif) no-repeat center center; display: block; -moz-box-shadow: 0 1px 3px #777; -webkit-box-shadow: 0 1px 3px #777; box-shadow: 0 1px 3px #777; }
+#contacts_details_photo { border-radius: 0.5em; border: thin solid #bbb; margin: 0.3em; display: block; -moz-box-shadow: 0 1px 3px #777; -webkit-box-shadow: 0 1px 3px #777; box-shadow: 0 1px 3px #777; }
 #contacts_details_photo:hover { background: #fff; cursor: default; }
 #phototools { position:absolute; margin: 5px 0 0 10px; width:auto; height:22px; padding:0px; background-color:#fff; list-style-type:none; border-radius: 0.5em; -moz-box-shadow: 0 1px 3px #777; -webkit-box-shadow: 0 1px 3px #777; box-shadow: 0 1px 3px #777; }
 #phototools li { display: inline; }
index f03ae1e46d62a134eb75aa00705cebe0d4a666ff..f684576b7870b6270c6e883bdb2df251db684878 100644 (file)
@@ -289,12 +289,12 @@ Contacts={
                                        if (jsondata.status == 'success'){
                                                $('#rightcontent').data('id',jsondata.data.id);
                                                var id = jsondata.data.id;
-                                               $.getJSON('ajax/contactdetails.php',{'id':id},function(jsondata){
+                                               $.getJSON(OC.filePath('contacts', 'ajax', 'contactdetails.php'),{'id':id},function(jsondata){
                                                        if(jsondata.status == 'success'){
                                                                Contacts.UI.loadHandlers();
                                                                Contacts.UI.Card.loadContact(jsondata.data);
                                                                $('#leftcontent .active').removeClass('active');
-                                                               var item = '<li data-id="'+jsondata.data.id+'" class="active"><a href="index.php?id='+jsondata.data.id+'"  style="background: url(thumbnail.php?id='+jsondata.data.id+') no-repeat scroll 0% 0% transparent;">'+Contacts.UI.Card.fn+'</a></li>';
+                                                               var item = '<li data-id="'+jsondata.data.id+'" class="active"><a href="index.php?id='+jsondata.data.id+'"  style="background: url('+OC.filePath('contacts', '', 'thumbnail.php')+'?id='+jsondata.data.id+') no-repeat scroll 0% 0% transparent;">'+Contacts.UI.Card.fn+'</a></li>';
                                                                var added = false;
                                                                $('#leftcontent ul li').each(function(){
                                                                        if ($(this).text().toLowerCase() > Contacts.UI.Card.fn.toLowerCase()) {
@@ -335,7 +335,7 @@ Contacts={
                                $('#contacts_deletecard').tipsy('hide');
                                OC.dialogs.confirm(t('contacts', 'Are you sure you want to delete this contact?'), t('contacts', 'Warning'), function(answer) {
                                        if(answer == true) {
-                                               $.getJSON('ajax/deletecard.php',{'id':Contacts.UI.Card.id},function(jsondata){
+                                               $.getJSON(OC.filePath('contacts', 'ajax', 'deletecard.php'),{'id':Contacts.UI.Card.id},function(jsondata){
                                                        if(jsondata.status == 'success'){
                                                                var newid = '';
                                                                var curlistitem = $('#leftcontent [data-id="'+jsondata.data.id+'"]');
@@ -357,7 +357,7 @@ Contacts={
                                                                        Contacts.UI.Card.update(newid);
                                                                } else {
                                                                        // load intro page
-                                                                       $.getJSON('ajax/loadintro.php',{},function(jsondata){
+                                                                       $.getJSON(OC.filePath('contacts', 'ajax', 'loadintro.php'),{},function(jsondata){
                                                                                if(jsondata.status == 'success'){
                                                                                        id = '';
                                                                                        $('#rightcontent').data('id','');
@@ -616,7 +616,7 @@ Contacts={
                                        q = q + '&checksum=' + checksum;
                                        console.log('Saving: ' + q);
                                        $(obj).attr('disabled', 'disabled');
-                                       $.post('ajax/saveproperty.php',q,function(jsondata){
+                                       $.post(OC.filePath('contacts', 'ajax', 'saveproperty.php'),q,function(jsondata){
                                                if(jsondata.status == 'success'){
                                                        container.data('checksum', jsondata.data.checksum);
                                                        Contacts.UI.Card.savePropertyInternal(name, fields, checksum, jsondata.data.checksum);
@@ -634,7 +634,7 @@ Contacts={
                                } else { // add
                                        console.log('Adding: ' + q);
                                        $(obj).attr('disabled', 'disabled');
-                                       $.post('ajax/addproperty.php',q,function(jsondata){
+                                       $.post(OC.filePath('contacts', 'ajax', 'addproperty.php'),q,function(jsondata){
                                                if(jsondata.status == 'success'){
                                                        container.data('checksum', jsondata.data.checksum);
                                                        // TODO: savePropertyInternal doesn't know about new fields
@@ -704,7 +704,7 @@ Contacts={
                                var checksum = Contacts.UI.checksumFor(obj);
                                console.log('deleteProperty, id: ' + this.id + ', checksum: ' + checksum);
                                if(checksum) {
-                                       $.getJSON('ajax/deleteproperty.php',{'id': this.id, 'checksum': checksum },function(jsondata){
+                                       $.getJSON(OC.filePath('contacts', 'ajax', 'deleteproperty.php'),{'id': this.id, 'checksum': checksum },function(jsondata){
                                                if(jsondata.status == 'success'){
                                                        if(type == 'list') {
                                                                Contacts.UI.propertyContainerFor(obj).remove();
@@ -1124,7 +1124,7 @@ Contacts={
                        },
                        cloudPhotoSelected:function(path){
                                console.log('cloudPhotoSelected: ' + path);
-                               $.getJSON('ajax/oc_photo.php',{'path':path,'id':Contacts.UI.Card.id},function(jsondata){
+                               $.getJSON(OC.filePath('contacts', 'ajax', 'oc_photo.php'),{'path':path,'id':Contacts.UI.Card.id},function(jsondata){
                                        if(jsondata.status == 'success'){
                                                //alert(jsondata.data.page);
                                                Contacts.UI.Card.editPhoto(jsondata.data.id, jsondata.data.tmp)
@@ -1137,7 +1137,7 @@ Contacts={
                        },
                        loadPhoto:function(force){
                                //if(this.data.PHOTO||force==true) {
-                                       $.getJSON('ajax/loadphoto.php',{'id':this.id},function(jsondata){
+                                       $.getJSON(OC.filePath('contact', 'ajax', 'loadphoto.php'),{'id':this.id},function(jsondata){
                                                if(jsondata.status == 'success'){
                                                        //alert(jsondata.data.page);
                                                        $('#contacts_details_photo_wrapper').data('checksum', jsondata.data.checksum);
@@ -1157,7 +1157,7 @@ Contacts={
                                }*/
                        },
                        editCurrentPhoto:function(){
-                               $.getJSON('ajax/currentphoto.php',{'id':this.id},function(jsondata){
+                               $.getJSON(OC.filePath('contacts', 'ajax', 'currentphoto.php'),{'id':this.id},function(jsondata){
                                        if(jsondata.status == 'success'){
                                                //alert(jsondata.data.page);
                                                Contacts.UI.Card.editPhoto(jsondata.data.id, jsondata.data.tmp)
@@ -1170,7 +1170,7 @@ Contacts={
                        },
                        editPhoto:function(id, tmp_path){
                                //alert('editPhoto: ' + tmp_path);
-                               $.getJSON('ajax/cropphoto.php',{'tmp_path':tmp_path,'id':this.id},function(jsondata){
+                               $.getJSON(OC.filePath('contacts', 'ajax', 'cropphoto.php'),{'tmp_path':tmp_path,'id':this.id},function(jsondata){
                                        if(jsondata.status == 'success'){
                                                //alert(jsondata.data.page);
                                                $('#edit_photo_dialog_img').html(jsondata.data.page);
@@ -1378,7 +1378,7 @@ Contacts={
                        // Reload the contacts list.
                        update:function(){
                                console.log('Contacts.update, start');
-                               $.getJSON('ajax/contacts.php',{},function(jsondata){
+                               $.getJSON(OC.filePath('contacts', 'ajax', 'contacts.php'),{},function(jsondata){
                                        if(jsondata.status == 'success'){
                                                $('#contacts').html(jsondata.data.page);
                                                Contacts.UI.Card.update();
@@ -1394,12 +1394,12 @@ Contacts={
                        lazyupdate:function(){
                                $('#contacts li').live('inview', function(){
                                        if (!$(this).find('a').attr('style')) {
-                                               $(this).find('a').css('background','url(thumbnail.php?id='+$(this).data('id')+') no-repeat');
+                                               $(this).find('a').css('background','url('+OC.filePath('contacts', '', 'thumbnail.php')+'?id='+$(this).data('id')+') no-repeat');
                                        }
                                });
                        },
                        refreshThumbnail:function(id){
-                               $('#contacts [data-id="'+id+'"]').find('a').css('background','url(thumbnail.php?id='+id+'&refresh=1'+Math.random()+') no-repeat');
+                               $('#contacts [data-id="'+id+'"]').find('a').css('background','url('+OC.filePath('contacts', '', 'thumbnail.php')+'?id='+id+'&refresh=1'+Math.random()+') no-repeat');
                        }
                }
        }
@@ -1431,7 +1431,7 @@ $(document).ready(function(){
                if(oldid != 0){
                        $('#leftcontent li[data-id="'+oldid+'"]').removeClass('active');
                }
-               $.getJSON('ajax/contactdetails.php',{'id':id},function(jsondata){
+               $.getJSON(OC.filePath('contacts', 'ajax', 'contactsdetails.php'),{'id':id},function(jsondata){
                        if(jsondata.status == 'success'){
                                Contacts.UI.Card.loadContact(jsondata.data);
                        }
@@ -1454,7 +1454,7 @@ $(document).ready(function(){
                                // whole part of element is visible
                                if (!$(this).find('a').attr('style')) {
                                        //alert($(this).data('id') + ' has background: ' + $(this).attr('style'));
-                                       $(this).find('a').css('background','url(thumbnail.php?id='+$(this).data('id')+') no-repeat');
+                                       $(this).find('a').css('background','url('+OC.filePath('contacts', '', 'thumbnail.php')+'?id='+$(this).data('id')+') no-repeat');
                                }/* else {
                                        alert($(this).data('id') + ' has style ' + $(this).attr('style').match('url'));
                                }*/
@@ -1574,7 +1574,7 @@ $(document).ready(function(){
                };
                // Start loading indicator.
                //$('#contacts_details_photo_progress').show()();
-               xhr.open("POST", 'ajax/uploadphoto.php?id='+Contacts.UI.Card.id+'&imagefile='+encodeURIComponent(file.name), true);
+               xhr.open("POST", OC.filePath('contacts', 'ajax', 'uploadphoto.php')+'?id='+Contacts.UI.Card.id+'&imagefile='+encodeURIComponent(file.name), true);
                xhr.setRequestHeader('Cache-Control', 'no-cache');
                xhr.setRequestHeader('X-Requested-With', 'XMLHttpRequest');
                xhr.setRequestHeader('X_FILE_NAME', encodeURIComponent(file.name));
@@ -1604,3 +1604,18 @@ $(document).ready(function(){
                $('#contacts_propertymenu').hide();
        });
 });
+$(document).ready(function() {
+       $('.add').css('background', 'url('+OC.filePath('core', 'img/actions', 'add.svg')+') no-repeat center');
+       $('.delete').css('background', 'url('+OC.filePath('core', 'img/actions', 'delete.svg')+') no-repeat center');
+       $('.edit').css('background', 'url('+OC.filePath('core', 'img/actions', 'rename.svg')+') no-repeat center');
+       $('.mail').css('background', 'url('+OC.filePath('core', 'img/actions', 'mail.svg')+') no-repeat center');
+       $('.upload').css('background', 'url('+OC.filePath('core', 'img/actions', 'upload.svg')+') no-repeat center');
+       $('.cloud').css('background', 'url('+OC.filePath('core', 'img/actions', 'picture.svg')+') no-repeat center');
+       /*$('.globe').css('background', 'url('+OC.filePath('core', 'img/actions', 'globe.svg')+') no-repeat center');*/
+       $('.globe').css('background', 'url('+OC.filePath('core', 'img/actions', 'public.svg')+') no-repeat center');
+       $('#contacts_propertymenu_button').css('background', 'url('+OC.filePath('core', 'img/actions', 'add.svg')+' no-repeat center');
+       $('.loading').css('background', 'url('+OC.filePath('core', 'img', 'loading.gif')+' no-repeat center !important');
+       $('.ui-autocomplete-loading').css('background', 'url('+OC.filePath('core', 'img', 'loading.gif')+' right center no-repeat');
+       $('#contacts_details_photo').css('background', 'url('+OC.filePath('core', 'img', 'loading.gif')+' no-repeat center center');
+       $('#contacts_propertymenu_button').css('background', 'url('+OC.filePath('core', 'img/actions', 'add.svg')+') no-repeat center');
+});
\ No newline at end of file
index b44821855095181cda8798c14f5e457c122bdbe9..25de7c13b74b0656a4f5d327fc76fcf7b20fcb80 100644 (file)
@@ -31,6 +31,7 @@ t.cache={};
 
 OC={
        webroot:oc_webroot,
+       appswebroot:oc_appswebroot,
        currentUser:(typeof oc_current_user!=='undefined')?oc_current_user:false,
        coreApps:['admin','log','search','settings','core','3rdparty'],
        /**
@@ -54,6 +55,14 @@ OC={
                var link=OC.webroot;
                if(file.substring(file.length-3) == 'php' && !isCore){
                        link+='/?app=' + app + '&getfile=' + encodeURI(type + '/' + file);
+               }else if(file.substring(file.length-3) != 'php' && !isCore){
+                       link=OC.appswebroot;
+                       link+='apps/';
+                       link+=app;
+                       if(type){
+                               link+=type+'/';
+                       }
+                       link+=file;     
                }else{
                        link+='/';
                        app+='/';
index 61eb0de9f421f36428a5001de7858069a5f829d1..a5431ab6ab349ac6739d2e0e7a1173e0df1e3b00 100644 (file)
@@ -9,6 +9,7 @@
                <?php endforeach; ?>
                <script type="text/javascript">
                        var oc_webroot = '<?php echo OC::$WEBROOT; ?>';
+                       var oc_appswebroot = '<?php echo OC::$APPSWEBROOT; ?>;'
                        var oc_current_user = '<?php echo OC_User::getUser() ?>';
                </script>
                <?php foreach($_['jsfiles'] as $jsfile): ?>