aboutsummaryrefslogtreecommitdiffstats
path: root/core/js/js.js
diff options
context:
space:
mode:
authorJan-Christoph Borchardt <hey@jancborchardt.net>2013-01-15 20:40:38 +0700
committerJan-Christoph Borchardt <hey@jancborchardt.net>2013-01-15 20:40:38 +0700
commit6182b1353bd53bb6bdc5b06248d9742e97d2e249 (patch)
treeb154b88d910c57d17b07ce482cbeb98cb791a106 /core/js/js.js
parent74b4fefda87feeaf51633ea7794ac498f7dce892 (diff)
parentbb9cc227c2583adc6b51a1f6d75a9fc8333836b9 (diff)
downloadnextcloud-server-6182b1353bd53bb6bdc5b06248d9742e97d2e249.tar.gz
nextcloud-server-6182b1353bd53bb6bdc5b06248d9742e97d2e249.zip
merge master into navigation
Diffstat (limited to 'core/js/js.js')
-rw-r--r--core/js/js.js19
1 files changed, 13 insertions, 6 deletions
diff --git a/core/js/js.js b/core/js/js.js
index e1f213972dc..5ba7d1eef5c 100644
--- a/core/js/js.js
+++ b/core/js/js.js
@@ -3,14 +3,15 @@
* 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 () { };
}
}
@@ -20,7 +21,6 @@ if (oc_debug !== true) {
* @param text the string to translate
* @return string
*/
-
function t(app,text, vars){
if( !( t.cache[app] )){
$.ajax(OC.filePath('core','ajax','translations.php'),{
@@ -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{
@@ -607,7 +614,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});