From e998da06d1950b5c85205e035a86e7175819a05c Mon Sep 17 00:00:00 2001 From: Jörn Friedrich Dreyer Date: Tue, 18 Dec 2012 21:38:01 +0100 Subject: fix broken console.log in ie8 --- core/js/js.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'core/js/js.js') diff --git a/core/js/js.js b/core/js/js.js index 7d967321d93..503684b8747 100644 --- a/core/js/js.js +++ b/core/js/js.js @@ -13,7 +13,13 @@ if (oc_debug !== true) { console[methods[i]] = function () { }; } } - +/** + * fix broken console log in ie8 + */ +if (typeof console === "undefined" || typeof console.log === "undefined") { + console = {}; + console.log = function() {}; +} /** * translate a string * @param app the id of the app for which to translate the string -- cgit v1.2.3 From 5b07e722cbee3582fd461c83f5978001d94da7f8 Mon Sep 17 00:00:00 2001 From: Jörn Friedrich Dreyer Date: Wed, 2 Jan 2013 12:21:30 +0100 Subject: combine ie8 fix with debug check --- core/js/js.js | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) (limited to 'core/js/js.js') diff --git a/core/js/js.js b/core/js/js.js index 503684b8747..610950995db 100644 --- a/core/js/js.js +++ b/core/js/js.js @@ -3,30 +3,24 @@ * Add * define('DEBUG', true); * To the end of config/config.php to enable debug mode. + * The undefined checks fix the broken ie8 console */ -if (oc_debug !== true) { +if (oc_debug !== true || typeof console === "undefined" || typeof console.log === "undefined") { if (!window.console) { window.console = {}; } var methods = ['log', 'debug', 'warn', 'info', 'error', 'assert']; for (var i = 0; i < methods.length; i++) { - console[methods[i]] = function () { }; + console[methods[i]] = function () { }; } } -/** - * fix broken console log in ie8 - */ -if (typeof console === "undefined" || typeof console.log === "undefined") { - console = {}; - console.log = function() {}; -} + /** * translate a string * @param app the id of the app for which to translate the string * @param text the string to translate * @return string */ - function t(app,text, vars){ if( !( t.cache[app] )){ $.ajax(OC.filePath('core','ajax','translations.php'),{ -- cgit v1.2.3 From fe4f056a2334f8e6d77c2327eccf9cf3ebc54965 Mon Sep 17 00:00:00 2001 From: Jörn Friedrich Dreyer Date: Wed, 2 Jan 2013 17:04:11 +0100 Subject: use jQuery.parseJSON fallback for IE6/7/8 --- core/js/js.js | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'core/js/js.js') diff --git a/core/js/js.js b/core/js/js.js index 7d967321d93..5a24ba19c0c 100644 --- a/core/js/js.js +++ b/core/js/js.js @@ -343,8 +343,15 @@ if(typeof localStorage !=='undefined' && localStorage !== null){ 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)); + var item = localStorage.getItem(OC.localStorage.namespace+name); + if(item===null) { + return null; + } else if (typeof JSON === 'undefined') { + //fallback to jquery for IE6/7/8 + return $.parseJSON(item); + } else { + return JSON.parse(item); + } } }; }else{ -- cgit v1.2.3 From 3bb7ee521f38e1ab1fc7cd160dc3d0ae77f0433e Mon Sep 17 00:00:00 2001 From: Jörn Friedrich Dreyer Date: Mon, 7 Jan 2013 12:23:29 +0100 Subject: attach max upload tipsy to div instead of a to fix tooltip not showing due to new z-index --- apps/files/js/files.js | 4 ++++ apps/files/templates/index.php | 6 +++--- core/js/js.js | 2 +- 3 files changed, 8 insertions(+), 4 deletions(-) (limited to 'core/js/js.js') diff --git a/apps/files/js/files.js b/apps/files/js/files.js index 6d19a341e9e..038660e6e49 100644 --- a/apps/files/js/files.js +++ b/apps/files/js/files.js @@ -322,6 +322,7 @@ $(document).ready(function() { if ($.assocArraySize(uploadingFiles[dirName]) == 0) { delete uploadingFiles[dirName]; } + //TODO update file upload size limit var uploadtext = $('tr').filterAttr('data-type', 'dir').filterAttr('data-file', dirName).find('.uploadtext') var currentUploads = parseInt(uploadtext.attr('currentUploads')); @@ -375,6 +376,7 @@ $(document).ready(function() { if(size==t('files','Pending')){ $('tr').filterAttr('data-file',file.name).find('td.filesize').text(file.size); } + //TODO update file upload size limit FileList.loadingDone(file.name, file.id); } else { Files.cancelUpload(this.files[0].name); @@ -407,8 +409,10 @@ $(document).ready(function() { if(size==t('files','Pending')){ $('tr').filterAttr('data-file',file.name).find('td.filesize').text(file.size); } + //TODO update file upload size limit FileList.loadingDone(file.name, file.id); } else { + //TODO Files.cancelUpload(/*where do we get the filename*/); $('#notification').text(t('files', response.data.message)); $('#notification').fadeIn(); $('#fileList > tr').not('[data-mime]').fadeOut(); diff --git a/apps/files/templates/index.php b/apps/files/templates/index.php index 3bcb865ccdb..2e0772443f2 100644 --- a/apps/files/templates/index.php +++ b/apps/files/templates/index.php @@ -14,7 +14,8 @@ data-type='web'>

t('From link');?>

-
+
- +
diff --git a/core/js/js.js b/core/js/js.js index 9f3e8f92100..95889ac8a27 100644 --- a/core/js/js.js +++ b/core/js/js.js @@ -622,7 +622,7 @@ $(document).ready(function(){ $('.jp-controls .jp-previous').tipsy({gravity:'nw', fade:true, live:true}); $('.jp-controls .jp-next').tipsy({gravity:'n', fade:true, live:true}); $('.password .action').tipsy({gravity:'se', fade:true, live:true}); - $('#upload a').tipsy({gravity:'w', fade:true}); + $('#upload').tipsy({gravity:'w', fade:true}); $('.selectedActions a').tipsy({gravity:'s', fade:true, live:true}); $('a.delete').tipsy({gravity: 'e', fade:true, live:true}); $('a.action').tipsy({gravity:'s', fade:true, live:true}); -- cgit v1.2.3