Skip to content
Snippets Groups Projects
Commit f4c9d4c0 authored by Bart Visscher's avatar Bart Visscher
Browse files

Merge pull request #1682 from owncloud/fix-ie8-master

Fix ie8 master
parents ae172ce7 022993c0
No related branches found
No related tags found
No related merge requests found
...@@ -19,12 +19,11 @@ ...@@ -19,12 +19,11 @@
$(/blur$/.test(eventName) ? window : document).on(eventName, function (event) { $(/blur$/.test(eventName) ? window : document).on(eventName, function (event) {
var type = event.type, var type = event.type,
originalEvent = event.originalEvent, originalEvent = event.originalEvent;
toElement = originalEvent.toElement;
// If it’s a `{focusin,focusout}` event (IE), `fromElement` and `toElement` should both be `null` or `undefined`; // If it’s a `{focusin,focusout}` event (IE), `fromElement` and `toElement` should both be `null` or `undefined`;
// else, the page visibility hasn’t changed, but the user just clicked somewhere in the doc. // else, the page visibility hasn’t changed, but the user just clicked somewhere in the doc.
// In IE9, we need to check the `relatedTarget` property instead. // In IE9, we need to check the `relatedTarget` property instead.
if (!/^focus./.test(type) || (toElement == undefined && originalEvent.fromElement == undefined && originalEvent.relatedTarget == undefined)) { if (!/^focus./.test(type) || originalEvent == undefined || (originalEvent.toElement == undefined && originalEvent.fromElement == undefined && originalEvent.relatedTarget == undefined)) {
$event.trigger((property && document[property] || /^(?:blur|focusout)$/.test(type) ? 'hide' : 'show') + '.visibility'); $event.trigger((property && document[property] || /^(?:blur|focusout)$/.test(type) ? 'hide' : 'show') + '.visibility');
} }
}); });
......
//https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Function/bind
if (!Function.prototype.bind) {
Function.prototype.bind = function (oThis) {
if (typeof this !== "function") {
// closest thing possible to the ECMAScript 5 internal IsCallable function
throw new TypeError("Function.prototype.bind - what is trying to be bound is not callable");
}
var aArgs = Array.prototype.slice.call(arguments, 1),
fToBind = this,
fNOP = function () {},
fBound = function () {
return fToBind.apply(this instanceof fNOP && oThis
? this
: oThis,
aArgs.concat(Array.prototype.slice.call(arguments)));
};
fNOP.prototype = this.prototype;
fBound.prototype = new fNOP();
return fBound;
};
}
//https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/String/Trim
if(!String.prototype.trim) {
String.prototype.trim = function () {
return this.replace(/^\s+|\s+$/g,'');
};
}
\ No newline at end of file
...@@ -87,9 +87,11 @@ OC.EventSource.prototype={ ...@@ -87,9 +87,11 @@ OC.EventSource.prototype={
useFallBack:false, useFallBack:false,
fallBackCallBack:function(type,data){ fallBackCallBack:function(type,data){
if(type){ if(type){
if (typeof this.listeners['done'] != 'undefined') {
for(var i=0;i<this.listeners[type].length;i++){ for(var i=0;i<this.listeners[type].length;i++){
this.listeners[type][i](data); this.listeners[type][i](data);
} }
}
}else{ }else{
for(var i=0;i<this.typelessListeners.length;i++){ for(var i=0;i<this.typelessListeners.length;i++){
this.typelessListeners[i](data); this.typelessListeners[i](data);
...@@ -117,6 +119,8 @@ OC.EventSource.prototype={ ...@@ -117,6 +119,8 @@ OC.EventSource.prototype={
} }
}, },
close:function(){ close:function(){
if (typeof this.source !='undefined') {
this.source.close(); this.source.close();
} }
} }
}
...@@ -278,6 +278,7 @@ class OC { ...@@ -278,6 +278,7 @@ class OC {
OC_Util::addScript("jquery-showpassword"); OC_Util::addScript("jquery-showpassword");
OC_Util::addScript("jquery.infieldlabel"); OC_Util::addScript("jquery.infieldlabel");
OC_Util::addScript("jquery-tipsy"); OC_Util::addScript("jquery-tipsy");
OC_Util::addScript("compatibility");
OC_Util::addScript("oc-dialogs"); OC_Util::addScript("oc-dialogs");
OC_Util::addScript("js"); OC_Util::addScript("js");
OC_Util::addScript("eventsource"); OC_Util::addScript("eventsource");
......
...@@ -92,11 +92,12 @@ var UserList = { ...@@ -92,11 +92,12 @@ var UserList = {
UserList.applyMultiplySelect(subadminSelect); UserList.applyMultiplySelect(subadminSelect);
} }
if (tr.find('td.remove img').length == 0 && OC.currentUser != username) { if (tr.find('td.remove img').length == 0 && OC.currentUser != username) {
var rm_img = $('<img>', { var rm_img = $('<img class="svg action">').attr({
class: 'svg action',
src: OC.imagePath('core', 'actions/delete') src: OC.imagePath('core', 'actions/delete')
}); });
var rm_link = $('<a>', { class: 'action delete', href: '#', 'original-title': t('settings', 'Delete')}).append(rm_img); var rm_link = $('<a class="action delete">')
.attr({ href: '#', 'original-title': t('settings', 'Delete')})
.append(rm_img);
tr.find('td.remove').append(rm_link); tr.find('td.remove').append(rm_link);
} else if (OC.currentUser == username) { } else if (OC.currentUser == username) {
tr.find('td.remove a').remove(); tr.find('td.remove a').remove();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment