Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Restore IE8 functionality for Isis #12943

Merged
merged 1 commit into from Nov 19, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 3 additions & 0 deletions administrator/templates/isis/component.php
Expand Up @@ -20,6 +20,9 @@
// Add JavaScript Frameworks
JHtml::_('bootstrap.framework');

// Add filter polyfill for IE8
JHtml::_('behavior.polyfill', array('filter'), 'lte IE 9');

// Add template js
JHtml::_('script', 'template.js', array('version' => 'auto', 'relative' => true));

Expand Down
3 changes: 3 additions & 0 deletions administrator/templates/isis/index.php
Expand Up @@ -27,6 +27,9 @@
// Add JavaScript Frameworks
JHtml::_('bootstrap.framework');

// Add filter polyfill for IE8
JHtml::_('behavior.polyfill', array('filter'), 'lte IE 9');

// Add template js
JHtml::_('script', 'template.js', array('version' => 'auto', 'relative' => true));

Expand Down
25 changes: 25 additions & 0 deletions media/media/js/mediafield.js
Expand Up @@ -9,6 +9,31 @@
;(function($){
'use strict';

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;
};
}

$.fieldMedia = function(container, options){
// Merge options with defaults
this.options = $.extend({}, $.fieldMedia.defaults, options);
Expand Down
2 changes: 1 addition & 1 deletion media/media/js/mediafield.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 3 additions & 2 deletions media/system/js/permissions-uncompressed.js
Expand Up @@ -74,8 +74,9 @@ function sendPermissions(event) {
{
icon.setAttribute('class', 'icon-save');

jQuery(event.target).parents().next('td').find('span')
.removeClass().addClass(response.data.class)
jQuery(event.target).parents().next("td").find("span")
.removeClass()
.addClass(response['data']['class'])
.html(response.data.text);
}
}
Expand Down
2 changes: 1 addition & 1 deletion media/system/js/permissions.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

45 changes: 45 additions & 0 deletions media/system/js/polyfill.filter-uncompressed.js
@@ -0,0 +1,45 @@
/* Polyfill service v3.14.0
* For detailed credits and licence information see https://github.com/financial-times/polyfill-service.
*
* UA detected: ie/8.0.0
* Features requested: Array.prototype.filter
*
* - Array.prototype.filter, License: CC0 */

(function(undefined) {
if (!('filter' in Array.prototype)) {

// Array.prototype.filter
Array.prototype.filter = function filter(callback) {
if (this === undefined || this === null) {
throw new TypeError(this + ' is not an object');
}

if (!(callback instanceof Function)) {
throw new TypeError(callback + ' is not a function');
}

var
object = Object(this),
scope = arguments[1],
arraylike = object instanceof String ? object.split('') : object,
length = Math.max(Math.min(arraylike.length, 9007199254740991), 0) || 0,
index = -1,
result = [],
element;

while (++index < length) {
element = arraylike[index];

if (index in arraylike && callback.call(scope, element, index, object)) {
result.push(element);
}
}

return result;
};

}

})
.call('object' === typeof window && window || 'object' === typeof self && self || 'object' === typeof global && global || {});
1 change: 1 addition & 0 deletions media/system/js/polyfill.filter.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.