diff options
author | Bart Visscher <bartv@thisnet.nl> | 2012-05-04 17:04:11 +0200 |
---|---|---|
committer | Bart Visscher <bartv@thisnet.nl> | 2012-05-04 17:04:11 +0200 |
commit | 1e471562268ff62c59708b724c22930bc1d01d95 (patch) | |
tree | 5b5125ec41e865fa009d51b4293042f6572067f4 /core/js | |
parent | 71f9b1968e3d4decc4395db2a1555a872cbb2820 (diff) | |
parent | 07ff1e723ae4fa3a0297b168ef2262e01a0a5e50 (diff) | |
download | nextcloud-server-1e471562268ff62c59708b724c22930bc1d01d95.tar.gz nextcloud-server-1e471562268ff62c59708b724c22930bc1d01d95.zip |
Merge branch 'master' into tasks
Diffstat (limited to 'core/js')
-rw-r--r--[-rwxr-xr-x] | core/js/jquery-ui-1.8.16.custom.min.js | 0 | ||||
-rw-r--r--[-rwxr-xr-x] | core/js/jquery.infieldlabel.js | 0 | ||||
-rw-r--r--[-rwxr-xr-x] | core/js/jquery.infieldlabel.min.js | 0 | ||||
-rw-r--r-- | core/js/js.js | 57 | ||||
-rw-r--r-- | core/js/oc-dialogs.js | 8 |
5 files changed, 44 insertions, 21 deletions
diff --git a/core/js/jquery-ui-1.8.16.custom.min.js b/core/js/jquery-ui-1.8.16.custom.min.js index eefefa8579d..eefefa8579d 100755..100644 --- a/core/js/jquery-ui-1.8.16.custom.min.js +++ b/core/js/jquery-ui-1.8.16.custom.min.js diff --git a/core/js/jquery.infieldlabel.js b/core/js/jquery.infieldlabel.js index f6a67b66ce1..f6a67b66ce1 100755..100644 --- a/core/js/jquery.infieldlabel.js +++ b/core/js/jquery.infieldlabel.js diff --git a/core/js/jquery.infieldlabel.min.js b/core/js/jquery.infieldlabel.min.js index 8f0ab9f7c5e..8f0ab9f7c5e 100755..100644 --- a/core/js/jquery.infieldlabel.min.js +++ b/core/js/jquery.infieldlabel.min.js diff --git a/core/js/js.js b/core/js/js.js index 7e8ca6164c6..f697f2b8537 100644 --- a/core/js/js.js +++ b/core/js/js.js @@ -31,8 +31,9 @@ t.cache={}; OC={ webroot:oc_webroot, + appswebroot:oc_appswebroot, currentUser:(typeof oc_current_user!=='undefined')?oc_current_user:false, - coreApps:['files','admin','log','search','settings','core','3rdparty'], + coreApps:['admin','log','search','settings','core','3rdparty'], /** * get an absolute url to a file in an appen * @param app the id of the app the file belongs to @@ -51,16 +52,34 @@ OC={ */ filePath:function(app,type,file){ var isCore=OC.coreApps.indexOf(app)!=-1; - app+='/'; - var link=OC.webroot+'/'; - if(!isCore){ + var link=OC.webroot; + if((file.substring(file.length-3) == 'php' || file.substring(file.length-3) == 'css') && !isCore){ + link+='/?app=' + app + '&getfile='; + if(type){ + link+=encodeURI(type + '/'); + } + link+= file; + }else if(file.substring(file.length-3) != 'php' && !isCore){ + link=OC.appswebroot; + link+='/'; link+='apps/'; + link+=app+'/'; + if(type){ + link+=type+'/'; + } + link+=file; + }else{ + link+='/'; + app+='/'; + if(!isCore){ + link+='apps/'; + } + link+=app; + if(type){ + link+=type+'/'; + } + link+=file; } - link+=app; - if(type){ - link+=type+'/'; - } - link+=file; return link; }, /** @@ -69,10 +88,10 @@ OC={ * @param file the name of the image file * @return string * - * if no extention is given for the image, it will automatically decide between .png and .svg based on what the browser supports + * if no extension is given for the image, it will automatically decide between .png and .svg based on what the browser supports */ imagePath:function(app,file){ - if(file.indexOf('.')==-1){//if no extention is given, use png or svg depending on browser support + if(file.indexOf('.')==-1){//if no extension is given, use png or svg depending on browser support file+=(SVGSupport())?'.svg':'.png'; } return OC.filePath(app,'img',file); @@ -152,6 +171,7 @@ if(typeof localStorage !='undefined'){ return localStorage.setItem(OC.localStorage.namespace+name,JSON.stringify(item)); }, getItem:function(name){ + if(localStorage.getItem(OC.localStorage.namespace+name)==null){return null;} return JSON.parse(localStorage.getItem(OC.localStorage.namespace+name)); } }; @@ -297,7 +317,10 @@ function object(o) { * Fills height of window. (more precise than height: 100%;) */ function fillHeight(selector) { - var height = parseFloat($(window).height())-parseFloat(selector.css('top')); + if (selector.length == 0) { + return; + } + var height = parseFloat($(window).height())-selector.offset().top; selector.css('height', height + 'px'); if(selector.outerHeight() > selector.height()) selector.css('height', height-(selector.outerHeight()-selector.height()) + 'px'); @@ -307,8 +330,11 @@ function fillHeight(selector) { * Fills height and width of window. (more precise than height: 100%; or width: 100%;) */ function fillWindow(selector) { + if (selector.length == 0) { + return; + } fillHeight(selector); - var width = parseFloat($(window).width())-parseFloat(selector.css('left')); + var width = parseFloat($(window).width())-selector.offset().left; selector.css('width', width + 'px'); if(selector.outerWidth() > selector.width()) selector.css('width', width-(selector.outerWidth()-selector.width()) + 'px'); @@ -400,9 +426,6 @@ $(document).ready(function(){ $('#settings #expanddiv').click(function(event){ event.stopPropagation(); }); - $('#settings #expand').hover(function(){ - $('#settings #expand+span').fadeToggle(); - }); $(window).click(function(){//hide the settings menu when clicking oustide it if($('body').attr("id")=="body-user"){ $('#settings #expanddiv').slideUp(); @@ -415,7 +438,7 @@ $(document).ready(function(){ $('.password .action').tipsy({gravity:'se', fade:true, live:true}); $('.file_upload_button_wrapper').tipsy({gravity:'w', fade:true}); $('.selectedActions a').tipsy({gravity:'s', fade:true, live:true}); - $('a.delete').tipsy({gravity: 'se', fade:true, live:true}); + $('a.delete').tipsy({gravity: 'e', fade:true, live:true}); $('a.action').tipsy({gravity:'s', fade:true, live:true}); $('#headerSize').tipsy({gravity:'s', fade:true, live:true}); $('td.filesize').tipsy({gravity:'s', fade:true, live:true}); diff --git a/core/js/oc-dialogs.js b/core/js/oc-dialogs.js index a3aa1e8c149..f6870e62710 100644 --- a/core/js/oc-dialogs.js +++ b/core/js/oc-dialogs.js @@ -107,7 +107,7 @@ OCdialogs = { $(c_id + ' #dirtree').focus(function() { var t = $(this); t.data('oldval', t.val())}) .change({dcid: c_id}, OC.dialogs.handleTreeListSelect); $(c_id).ready(function(){ - $.getJSON(OC.webroot+'/files/ajax/rawlist.php', {mimetype: mimetype_filter} ,function(r){OC.dialogs.fillFilePicker(r, c_id, callback)}); + $.getJSON(OC.filePath('files', 'ajax', 'rawlist.php'), {mimetype: mimetype_filter} ,function(r){OC.dialogs.fillFilePicker(r, c_id, callback)}); }).data('multiselect', multiselect).data('mimetype',mimetype_filter); // build buttons var b = [ @@ -131,7 +131,7 @@ OCdialogs = { }, {text: t('dialogs', 'Cancel'), click: function(){$(c_id).dialog('close'); }} ]; - $(c_id).dialog({width: 4*$(document).width()/9, height: 400, modal: modal, buttons: b}); + $(c_id).dialog({width: ((4*$('body').width())/9), height: 400, modal: modal, buttons: b}); OCdialogs.dialogs_counter++; }, // guts, dont use, dont touch @@ -222,7 +222,7 @@ OCdialogs = { $(this).children().each(function(i, element) { if (skip_first) {skip_first = false; return; }path += '/'+$(element).text(); }); $(event.data.dcid).data('path', path); $(event.data.dcid + ' .filepicker_loader').css('visibility', 'visible'); - $.getJSON(OC.webroot+'/files/ajax/rawlist.php', {dir: path, mimetype: $(event.data.dcid).data('mimetype')}, function(r){OC.dialogs.fillFilePicker(r, event.data.dcid)}); + $.getJSON(OC.filePath('files', 'ajax', 'rawlist.php'), {dir: path, mimetype: $(event.data.dcid).data('mimetype')}, function(r){OC.dialogs.fillFilePicker(r, event.data.dcid)}); }, // this function is in early development state, please dont use it unlsess you know what you are doing handlePickerClick:function(element, name, dcid) { @@ -240,6 +240,6 @@ OCdialogs = { var newval = parseInt($(dcid + ' #dirtree option:last').val())+1; $(dcid + ' #dirtree').append('<option selected="selected" value="'+newval+'">'+name+'</option>'); $(dcid + ' .filepicker_loader').css('visibility', 'visible'); - $.getJSON(OC.webroot+'/files/ajax/rawlist.php', {dir: p, mimetype: $(dcid).data('mimetype')}, function(r){OC.dialogs.fillFilePicker(r, dcid)}); + $.getJSON(OC.filePath('files', 'ajax', 'rawlist.php'), {dir: p, mimetype: $(dcid).data('mimetype')}, function(r){OC.dialogs.fillFilePicker(r, dcid)}); } }; |