aboutsummaryrefslogtreecommitdiffstats
path: root/core/js
diff options
context:
space:
mode:
Diffstat (limited to 'core/js')
-rw-r--r--core/js/compatibility.js16
-rw-r--r--core/js/config.php6
-rw-r--r--core/js/octemplate.js2
3 files changed, 19 insertions, 5 deletions
diff --git a/core/js/compatibility.js b/core/js/compatibility.js
index cc37949409d..b690803ca77 100644
--- a/core/js/compatibility.js
+++ b/core/js/compatibility.js
@@ -133,4 +133,18 @@ if(!String.prototype.trim) {
String.prototype.trim = function () {
return this.replace(/^\s+|\s+$/g,'');
};
-} \ No newline at end of file
+}
+
+// Older Firefoxes doesn't support outerHTML
+// From http://stackoverflow.com/questions/1700870/how-do-i-do-outerhtml-in-firefox#answer-3819589
+function outerHTML(node){
+ // In newer browsers use the internal property otherwise build a wrapper.
+ return node.outerHTML || (
+ function(n){
+ var div = document.createElement('div'), h;
+ div.appendChild( n.cloneNode(true) );
+ h = div.innerHTML;
+ div = null;
+ return h;
+ })(node);
+}
diff --git a/core/js/config.php b/core/js/config.php
index 0aaa4482287..48bea6ae542 100644
--- a/core/js/config.php
+++ b/core/js/config.php
@@ -26,8 +26,8 @@ $array = array(
"oc_debug" => (defined('DEBUG') && DEBUG) ? 'true' : 'false',
"oc_webroot" => "\"".OC::$WEBROOT."\"",
"oc_appswebroots" => str_replace('\\/', '/', json_encode($apps_paths)), // Ugly unescape slashes waiting for better solution
- "oc_current_user" => "\"".OC_User::getUser(). "\"",
- "oc_requesttoken" => "\"".OC_Util::callRegister(). "\"",
+ "oc_current_user" => "document.head.getAttribute('data-user')",
+ "oc_requesttoken" => "document.head.getAttribute('data-requesttoken')",
"datepickerFormatDate" => json_encode($l->l('jsdate', 'jsdate')),
"dayNames" => json_encode(
array(
@@ -62,4 +62,4 @@ $array = array(
// Echo it
foreach ($array as $setting => $value) {
echo("var ". $setting ."=".$value.";\n");
-}
+} \ No newline at end of file
diff --git a/core/js/octemplate.js b/core/js/octemplate.js
index a5d56852a57..e032506c0b1 100644
--- a/core/js/octemplate.js
+++ b/core/js/octemplate.js
@@ -72,7 +72,7 @@
},
// From stackoverflow.com/questions/1408289/best-way-to-do-variable-interpolation-in-javascript
_build: function(o){
- var data = this.elem.attr('type') === 'text/template' ? this.elem.html() : this.elem.get(0).outerHTML;
+ var data = this.elem.attr('type') === 'text/template' ? this.elem.html() : outerHTML(this.elem.get(0));
try {
return data.replace(/{([^{}]*)}/g,
function (a, b) {