diff options
author | Thomas Müller <thomas.mueller@tmit.eu> | 2013-07-12 09:43:04 +0200 |
---|---|---|
committer | Thomas Müller <thomas.mueller@tmit.eu> | 2013-07-12 09:43:04 +0200 |
commit | 24b4806af4a9b485b4b9a772809d118e91c6d97f (patch) | |
tree | df5664782eefd384bd6ed3dc363a25575da89202 /core/js/js.js | |
parent | 8793acfb4e751cfdb464d259de45249cec5d6398 (diff) | |
parent | 3abe68176ff09ca579ff9e5f15872fb5cab8ff4d (diff) | |
download | nextcloud-server-24b4806af4a9b485b4b9a772809d118e91c6d97f.tar.gz nextcloud-server-24b4806af4a9b485b4b9a772809d118e91c6d97f.zip |
Merge branch 'master' into googledrive
Diffstat (limited to 'core/js/js.js')
-rw-r--r-- | core/js/js.js | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/core/js/js.js b/core/js/js.js index 3cb4d3dd151..5158b66d73a 100644 --- a/core/js/js.js +++ b/core/js/js.js @@ -7,7 +7,10 @@ */ var oc_debug; var oc_webroot; -var oc_requesttoken; + +var oc_current_user = document.getElementsByTagName('head')[0].getAttribute('data-user'); +var oc_requesttoken = document.getElementsByTagName('head')[0].getAttribute('data-requesttoken'); + if (typeof oc_webroot === "undefined") { oc_webroot = location.pathname.substr(0, location.pathname.lastIndexOf('/')); } @@ -223,8 +226,12 @@ var OC={ var path=OC.filePath(app,'css',style+'.css'); if(OC.addStyle.loaded.indexOf(path)===-1){ OC.addStyle.loaded.push(path); - style=$('<link rel="stylesheet" type="text/css" href="'+path+'"/>'); - $('head').append(style); + if (document.createStyleSheet) { + document.createStyleSheet(path); + } else { + style=$('<link rel="stylesheet" type="text/css" href="'+path+'"/>'); + $('head').append(style); + } } }, basename: function(path) { @@ -349,10 +356,10 @@ OC.Notification={ }, show: function(text) { if(($('#notification').filter('span.undo').length == 1) || OC.Notification.isHidden()){ - $('#notification').html(text); + $('#notification').text(text); $('#notification').fadeIn().css("display","inline"); }else{ - OC.Notification.queuedNotifications.push($(text).html()); + OC.Notification.queuedNotifications.push($('<div/>').text(text).html()); } }, isHidden: function() { |