Skip to content

Commit

Permalink
chore(all): prepare release 1.2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
EisenbergEffect committed Mar 23, 2017
1 parent 308e677 commit fca78f1
Show file tree
Hide file tree
Showing 11 changed files with 658 additions and 799 deletions.
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "aurelia-pal-browser",
"version": "1.1.0",
"version": "1.2.0",
"description": "The browser-specific implementation of Aurelia's platform abstraction layer.",
"keywords": [
"aurelia",
Expand Down
183 changes: 77 additions & 106 deletions dist/amd/aurelia-pal-browser.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,6 @@ define(['exports', 'aurelia-pal'], function (exports, _aureliaPal) {
value: true
});
exports._DOM = exports._FEATURE = exports._PLATFORM = undefined;
exports._ensureFunctionName = _ensureFunctionName;
exports._ensureClassList = _ensureClassList;
exports._ensurePerformance = _ensurePerformance;
exports._ensureCustomEvent = _ensureCustomEvent;
exports._ensureElementMatches = _ensureElementMatches;
exports._ensureHTMLTemplateElement = _ensureHTMLTemplateElement;
exports.initialize = initialize;

var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) {
Expand All @@ -35,8 +29,8 @@ define(['exports', 'aurelia-pal'], function (exports, _aureliaPal) {
}
};

function _ensureFunctionName() {
function test() {}
if (typeof FEATURE_NO_IE === 'undefined') {
var test = function test() {};

if (!test.name) {
Object.defineProperty(Function.prototype, 'name', {
Expand All @@ -50,7 +44,7 @@ define(['exports', 'aurelia-pal'], function (exports, _aureliaPal) {
}
}

function _ensureClassList() {
if (typeof FEATURE_NO_IE === 'undefined') {
if (!('classList' in document.createElement('_')) || document.createElementNS && !('classList' in document.createElementNS('http://www.w3.org/2000/svg', 'g'))) {
(function () {
var protoProp = 'prototype';
Expand Down Expand Up @@ -214,7 +208,7 @@ define(['exports', 'aurelia-pal'], function (exports, _aureliaPal) {
}
}

function _ensurePerformance() {
if (typeof FEATURE_NO_IE === 'undefined') {
// @license http://opensource.org/licenses/MIT
if ('performance' in window === false) {
window.performance = {};
Expand All @@ -237,7 +231,25 @@ define(['exports', 'aurelia-pal'], function (exports, _aureliaPal) {
_PLATFORM.performance = window.performance;
}

function _ensureCustomEvent() {
if (typeof FEATURE_NO_IE === 'undefined') {
(function () {
var con = window.console = window.console || {};
var nop = function nop() {};

if (!con.memory) con.memory = {};
('assert,clear,count,debug,dir,dirxml,error,exception,group,' + 'groupCollapsed,groupEnd,info,log,markTimeline,profile,profiles,profileEnd,' + 'show,table,time,timeEnd,timeline,timelineEnd,timeStamp,trace,warn').split(',').forEach(function (m) {
if (!con[m]) con[m] = nop;
});

if (_typeof(con.log) === 'object') {
'log,info,warn,error,assert,dir,clear,profile,profileEnd'.split(',').forEach(function (method) {
console[method] = this.bind(console[method], console);
}, Function.prototype.call);
}
})();
}

if (typeof FEATURE_NO_IE === 'undefined') {
if (!window.CustomEvent || typeof window.CustomEvent !== 'function') {
var _CustomEvent = function _CustomEvent(event, params) {
params = params || {
Expand All @@ -256,90 +268,78 @@ define(['exports', 'aurelia-pal'], function (exports, _aureliaPal) {
}
}

function _ensureElementMatches() {
if (Element && !Element.prototype.matches) {
var proto = Element.prototype;
proto.matches = proto.matchesSelector || proto.mozMatchesSelector || proto.msMatchesSelector || proto.oMatchesSelector || proto.webkitMatchesSelector;
}
if (Element && !Element.prototype.matches) {
var proto = Element.prototype;
proto.matches = proto.matchesSelector || proto.mozMatchesSelector || proto.msMatchesSelector || proto.oMatchesSelector || proto.webkitMatchesSelector;
}

var _FEATURE = exports._FEATURE = {};

_FEATURE.shadowDOM = function () {
return !!HTMLElement.prototype.attachShadow;
}();

_FEATURE.scopedCSS = function () {
return 'scoped' in document.createElement('style');
}();

_FEATURE.htmlTemplateElement = function () {
return 'content' in document.createElement('template');
}();

_FEATURE.mutationObserver = function () {
return !!(window.MutationObserver || window.WebKitMutationObserver);
}();

function _ensureHTMLTemplateElement() {
function isSVGTemplate(el) {
return el.tagName === 'template' && el.namespaceURI === 'http://www.w3.org/2000/svg';
var _FEATURE = exports._FEATURE = {
shadowDOM: !!HTMLElement.prototype.attachShadow,
scopedCSS: 'scoped' in document.createElement('style'),
htmlTemplateElement: 'content' in document.createElement('template'),
mutationObserver: !!(window.MutationObserver || window.WebKitMutationObserver),
ensureHTMLTemplateElement: function ensureHTMLTemplateElement(t) {
return t;
}
};

function fixSVGTemplateElement(el) {
var template = el.ownerDocument.createElement('template');
var attrs = el.attributes;
var length = attrs.length;
var attr = void 0;
if (typeof FEATURE_NO_IE === 'undefined') {
(function () {
var isSVGTemplate = function isSVGTemplate(el) {
return el.tagName === 'template' && el.namespaceURI === 'http://www.w3.org/2000/svg';
};

el.parentNode.insertBefore(template, el);
var fixSVGTemplateElement = function fixSVGTemplateElement(el) {
var template = el.ownerDocument.createElement('template');
var attrs = el.attributes;
var length = attrs.length;
var attr = void 0;

while (length-- > 0) {
attr = attrs[length];
template.setAttribute(attr.name, attr.value);
el.removeAttribute(attr.name);
}
el.parentNode.insertBefore(template, el);

el.parentNode.removeChild(el);
while (length-- > 0) {
attr = attrs[length];
template.setAttribute(attr.name, attr.value);
el.removeAttribute(attr.name);
}

return fixHTMLTemplateElement(template);
}
el.parentNode.removeChild(el);

function fixHTMLTemplateElement(template) {
var content = template.content = document.createDocumentFragment();
var child = void 0;
return fixHTMLTemplateElement(template);
};

while (child = template.firstChild) {
content.appendChild(child);
}
var fixHTMLTemplateElement = function fixHTMLTemplateElement(template) {
var content = template.content = document.createDocumentFragment();
var child = void 0;

return template;
}
while (child = template.firstChild) {
content.appendChild(child);
}

function fixHTMLTemplateElementRoot(template) {
var content = fixHTMLTemplateElement(template).content;
var childTemplates = content.querySelectorAll('template');
return template;
};

for (var i = 0, ii = childTemplates.length; i < ii; ++i) {
var child = childTemplates[i];
var fixHTMLTemplateElementRoot = function fixHTMLTemplateElementRoot(template) {
var content = fixHTMLTemplateElement(template).content;
var childTemplates = content.querySelectorAll('template');

if (isSVGTemplate(child)) {
fixSVGTemplateElement(child);
} else {
fixHTMLTemplateElement(child);
}
}
for (var i = 0, ii = childTemplates.length; i < ii; ++i) {
var child = childTemplates[i];

return template;
}
if (isSVGTemplate(child)) {
fixSVGTemplateElement(child);
} else {
fixHTMLTemplateElement(child);
}
}

if (_FEATURE.htmlTemplateElement) {
_FEATURE.ensureHTMLTemplateElement = function (template) {
return template;
};
} else {
_FEATURE.ensureHTMLTemplateElement = fixHTMLTemplateElementRoot;
}

if (!_FEATURE.htmlTemplateElement) {
_FEATURE.ensureHTMLTemplateElement = fixHTMLTemplateElementRoot;
}
})();
}

var shadowPoly = window.ShadowDOMPolyfill || null;
Expand Down Expand Up @@ -452,40 +452,11 @@ define(['exports', 'aurelia-pal'], function (exports, _aureliaPal) {
return;
}

_ensureCustomEvent();
_ensureFunctionName();
_ensureHTMLTemplateElement();
_ensureElementMatches();
_ensureClassList();
_ensurePerformance();

(0, _aureliaPal.initializePAL)(function (platform, feature, dom) {
Object.assign(platform, _PLATFORM);
Object.assign(feature, _FEATURE);
Object.assign(dom, _DOM);

(function (global) {
global.console = global.console || {};
var con = global.console;
var prop = void 0;
var method = void 0;
var empty = {};
var dummy = function dummy() {};
var properties = 'memory'.split(',');
var methods = ('assert,clear,count,debug,dir,dirxml,error,exception,group,' + 'groupCollapsed,groupEnd,info,log,markTimeline,profile,profiles,profileEnd,' + 'show,table,time,timeEnd,timeline,timelineEnd,timeStamp,trace,warn').split(',');
while (prop = properties.pop()) {
if (!con[prop]) con[prop] = empty;
}while (method = methods.pop()) {
if (!con[method]) con[method] = dummy;
}
})(platform.global);

if (platform.global.console && _typeof(console.log) === 'object') {
['log', 'info', 'warn', 'error', 'assert', 'dir', 'clear', 'profile', 'profileEnd'].forEach(function (method) {
console[method] = this.bind(console[method], console);
}, Function.prototype.call);
}

Object.defineProperty(dom, 'title', {
get: function get() {
return document.title;
Expand Down
9 changes: 9 additions & 0 deletions dist/aurelia-pal-browser.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,15 @@ import {
isInitialized
} from 'aurelia-pal';

// DOM polyfills
// Actually inlined by our build because of build/paths.js but `import "m"` is not properly removed!?
// import './console';
// import './custom-event';
// import './function-name';
// import './html-template-element';
// import './element-matches';
// import './class-list';
// import './performance';
/**
* Initializes the PAL with the Browser-targeted implementation.
*/
Expand Down
Loading

0 comments on commit fca78f1

Please sign in to comment.