1
0
Fork 0
mirror of https://github.com/jellyfin/jellyfin-web synced 2025-03-30 19:56:21 +00:00

add requirejs

This commit is contained in:
Luke Pulverenti 2015-05-08 23:48:43 -04:00
parent 03ca18cf4f
commit 4e71751d0f
20 changed files with 379 additions and 520 deletions

View file

@ -1,7 +1,7 @@
/* Now playing bar */ /* Now playing bar */
.nowPlayingBar { .nowPlayingBar {
padding: 16px 0 16px 0; padding: 16px 0 16px 0;
border-top: 2px solid green; border-top: 1px solid #444;
text-align: center; text-align: center;
} }

View file

@ -624,7 +624,7 @@ h1 .imageLink {
} }
.footerOverBottomTabs { .footerOverBottomTabs {
bottom: 50px; bottom: 51px !important;
} }
.footerNotification { .footerNotification {

View file

@ -30,10 +30,6 @@
var messageNamespace = 'urn:x-cast:com.google.cast.mediabrowser.v3'; var messageNamespace = 'urn:x-cast:com.google.cast.mediabrowser.v3';
var cPlayer = {
deviceState: DEVICE_STATE.IDLE
};
var CastPlayer = function () { var CastPlayer = function () {
/* device variables */ /* device variables */
@ -531,7 +527,7 @@
}; };
// Create Cast Player // Create Cast Player
var castPlayer = new CastPlayer(); var castPlayer;
function chromecastPlayer() { function chromecastPlayer() {
@ -843,15 +839,27 @@
}; };
} }
MediaController.registerPlayer(new chromecastPlayer()); function initializeChromecast() {
$(MediaController).on('playerchange', function () { castPlayer = new CastPlayer();
if (MediaController.getPlayerInfo().name == PlayerName) { MediaController.registerPlayer(new chromecastPlayer());
if (castPlayer.deviceState != DEVICE_STATE.ACTIVE && castPlayer.isInitialized) {
castPlayer.launchApp(); $(MediaController).on('playerchange', function () {
if (MediaController.getPlayerInfo().name == PlayerName) {
if (castPlayer.deviceState != DEVICE_STATE.ACTIVE && castPlayer.isInitialized) {
castPlayer.launchApp();
}
} }
} });
}); }
if ($.browser.chrome) {
requirejs(["thirdparty/cast_sender"], function () {
initializeChromecast();
});
}
})(window, window.chrome, console); })(window, window.chrome, console);

View file

@ -1292,25 +1292,28 @@ $(document).on('pagebeforeshow', "#dashboardPage", DashboardPage.onPageShow)
function takeTour(page, userId) { function takeTour(page, userId) {
$.swipebox([ Dashboard.loadSwipebox().done(function () {
{ href: 'css/images/tour/dashboard/dashboard.png', title: Globalize.translate('DashboardTourDashboard') },
{ href: 'css/images/tour/dashboard/help.png', title: Globalize.translate('DashboardTourHelp') }, $.swipebox([
{ href: 'css/images/tour/dashboard/users.png', title: Globalize.translate('DashboardTourUsers') }, { href: 'css/images/tour/dashboard/dashboard.png', title: Globalize.translate('DashboardTourDashboard') },
{ href: 'css/images/tour/dashboard/sync.png', title: Globalize.translate('DashboardTourSync') }, { href: 'css/images/tour/dashboard/help.png', title: Globalize.translate('DashboardTourHelp') },
{ href: 'css/images/tour/dashboard/cinemamode.png', title: Globalize.translate('DashboardTourCinemaMode') }, { href: 'css/images/tour/dashboard/users.png', title: Globalize.translate('DashboardTourUsers') },
{ href: 'css/images/tour/dashboard/chapters.png', title: Globalize.translate('DashboardTourChapters') }, { href: 'css/images/tour/dashboard/sync.png', title: Globalize.translate('DashboardTourSync') },
{ href: 'css/images/tour/dashboard/subtitles.png', title: Globalize.translate('DashboardTourSubtitles') }, { href: 'css/images/tour/dashboard/cinemamode.png', title: Globalize.translate('DashboardTourCinemaMode') },
{ href: 'css/images/tour/dashboard/plugins.png', title: Globalize.translate('DashboardTourPlugins') }, { href: 'css/images/tour/dashboard/chapters.png', title: Globalize.translate('DashboardTourChapters') },
{ href: 'css/images/tour/dashboard/notifications.png', title: Globalize.translate('DashboardTourNotifications') }, { href: 'css/images/tour/dashboard/subtitles.png', title: Globalize.translate('DashboardTourSubtitles') },
{ href: 'css/images/tour/dashboard/scheduledtasks.png', title: Globalize.translate('DashboardTourScheduledTasks') }, { href: 'css/images/tour/dashboard/plugins.png', title: Globalize.translate('DashboardTourPlugins') },
{ href: 'css/images/tour/dashboard/mobile.png', title: Globalize.translate('DashboardTourMobile') }, { href: 'css/images/tour/dashboard/notifications.png', title: Globalize.translate('DashboardTourNotifications') },
{ href: 'css/images/tour/enjoy.jpg', title: Globalize.translate('MessageEnjoyYourStay') } { href: 'css/images/tour/dashboard/scheduledtasks.png', title: Globalize.translate('DashboardTourScheduledTasks') },
], { { href: 'css/images/tour/dashboard/mobile.png', title: Globalize.translate('DashboardTourMobile') },
afterClose: function () { { href: 'css/images/tour/enjoy.jpg', title: Globalize.translate('MessageEnjoyYourStay') }
dismissWelcome(page, userId); ], {
$('.welcomeMessage', page).hide(); afterClose: function () {
}, dismissWelcome(page, userId);
hideBarsDelay: 30000 $('.welcomeMessage', page).hide();
},
hideBarsDelay: 30000
});
}); });
} }

View file

@ -264,6 +264,13 @@
function initializeTree(page, currentUser, openItems, selectedId) { function initializeTree(page, currentUser, openItems, selectedId) {
MetadataEditor.loadJsTree().done(function () {
initializeTreeInternal(page, currentUser, openItems, selectedId);
});
}
function initializeTreeInternal(page, currentUser, openItems, selectedId) {
nodesToLoad = []; nodesToLoad = [];
selectedNodeId = null; selectedNodeId = null;
@ -355,8 +362,8 @@
if (selectedNodeId && node.children && node.children.indexOf(selectedNodeId) != -1) { if (selectedNodeId && node.children && node.children.indexOf(selectedNodeId) != -1) {
setTimeout(function() { setTimeout(function () {
scrollToNode($.mobile.activePage, selectedNodeId); scrollToNode($.mobile.activePage, selectedNodeId);
}, 500); }, 500);
} }
@ -473,8 +480,22 @@
return query; return query;
}; };
self.loadJsTree = function () {
var deferred = DeferredBuilder.Deferred();
require([
'thirdparty/jstree3.0.8/jstree.min',
'css!thirdparty/jstree3.0.8/themes/default/style.min'
], function () {
deferred.resolve();
});
return deferred.promise();
};
ensureInitialValues(); ensureInitialValues();
} }
})(jQuery, document, window); })(jQuery, document, window);

View file

@ -572,30 +572,33 @@
function takeTour(page, userId) { function takeTour(page, userId) {
$.swipebox([ Dashboard.loadSwipebox().done(function () {
{ href: 'css/images/tour/web/tourcontent.jpg', title: Globalize.translate('WebClientTourContent') },
{ href: 'css/images/tour/web/tourmovies.jpg', title: Globalize.translate('WebClientTourMovies') },
{ href: 'css/images/tour/web/tourmouseover.jpg', title: Globalize.translate('WebClientTourMouseOver') },
{ href: 'css/images/tour/web/tourtaphold.jpg', title: Globalize.translate('WebClientTourTapHold') },
{ href: 'css/images/tour/web/tourmysync.png', title: Globalize.translate('WebClientTourMySync') },
{ href: 'css/images/tour/web/toureditor.png', title: Globalize.translate('WebClientTourMetadataManager') },
{ href: 'css/images/tour/web/tourplaylist.png', title: Globalize.translate('WebClientTourPlaylists') },
{ href: 'css/images/tour/web/tourcollections.jpg', title: Globalize.translate('WebClientTourCollections') },
{ href: 'css/images/tour/web/tourusersettings1.png', title: Globalize.translate('WebClientTourUserPreferences1') },
{ href: 'css/images/tour/web/tourusersettings2.png', title: Globalize.translate('WebClientTourUserPreferences2') },
{ href: 'css/images/tour/web/tourusersettings3.png', title: Globalize.translate('WebClientTourUserPreferences3') },
{ href: 'css/images/tour/web/tourusersettings4.png', title: Globalize.translate('WebClientTourUserPreferences4') },
{ href: 'css/images/tour/web/tourmobile1.jpg', title: Globalize.translate('WebClientTourMobile1') },
{ href: 'css/images/tour/web/tourmobile2.png', title: Globalize.translate('WebClientTourMobile2') },
{ href: 'css/images/tour/enjoy.jpg', title: Globalize.translate('MessageEnjoyYourStay') }
], {
afterClose: function () {
dismissWelcome(page, userId);
$('.welcomeMessage', page).hide();
loadConfigureViewsWelcomeMessage(page, userId); $.swipebox([
}, { href: 'css/images/tour/web/tourcontent.jpg', title: Globalize.translate('WebClientTourContent') },
hideBarsDelay: 30000 { href: 'css/images/tour/web/tourmovies.jpg', title: Globalize.translate('WebClientTourMovies') },
{ href: 'css/images/tour/web/tourmouseover.jpg', title: Globalize.translate('WebClientTourMouseOver') },
{ href: 'css/images/tour/web/tourtaphold.jpg', title: Globalize.translate('WebClientTourTapHold') },
{ href: 'css/images/tour/web/tourmysync.png', title: Globalize.translate('WebClientTourMySync') },
{ href: 'css/images/tour/web/toureditor.png', title: Globalize.translate('WebClientTourMetadataManager') },
{ href: 'css/images/tour/web/tourplaylist.png', title: Globalize.translate('WebClientTourPlaylists') },
{ href: 'css/images/tour/web/tourcollections.jpg', title: Globalize.translate('WebClientTourCollections') },
{ href: 'css/images/tour/web/tourusersettings1.png', title: Globalize.translate('WebClientTourUserPreferences1') },
{ href: 'css/images/tour/web/tourusersettings2.png', title: Globalize.translate('WebClientTourUserPreferences2') },
{ href: 'css/images/tour/web/tourusersettings3.png', title: Globalize.translate('WebClientTourUserPreferences3') },
{ href: 'css/images/tour/web/tourusersettings4.png', title: Globalize.translate('WebClientTourUserPreferences4') },
{ href: 'css/images/tour/web/tourmobile1.jpg', title: Globalize.translate('WebClientTourMobile1') },
{ href: 'css/images/tour/web/tourmobile2.png', title: Globalize.translate('WebClientTourMobile2') },
{ href: 'css/images/tour/enjoy.jpg', title: Globalize.translate('MessageEnjoyYourStay') }
], {
afterClose: function () {
dismissWelcome(page, userId);
$('.welcomeMessage', page).hide();
loadConfigureViewsWelcomeMessage(page, userId);
},
hideBarsDelay: 30000
});
}); });
} }

View file

@ -196,9 +196,12 @@
index = Math.max(index || 0, 0); index = Math.max(index || 0, 0);
$.swipebox(slideshowItems, { Dashboard.loadSwipebox().done(function () {
initialIndexOnArray: index,
hideBarsDelay: 30000 $.swipebox(slideshowItems, {
initialIndexOnArray: index,
hideBarsDelay: 30000
});
}); });
} }

View file

@ -545,13 +545,18 @@
if (AppInfo.enableBottomTabs) { if (AppInfo.enableBottomTabs) {
$('.libraryViewNav', page).addClass('bottomLibraryViewNav'); $('.libraryViewNav', page).addClass('bottomLibraryViewNav');
$(page).addClass('noSecondaryNavPage'); $(page).addClass('noSecondaryNavPage');
$(function() {
$('.footer').addClass('footerOverBottomTabs');
});
} else { } else {
$('.libraryViewNav', page).each(function () { $('.libraryViewNav', page).each(function () {
initHeadRoom(this); initHeadRoom(this);
}); });
} }
}).on('pageshow', ".libraryPage", function () { }).on('pageshow', ".libraryPage", function () {
@ -574,10 +579,13 @@
return; return;
} }
// construct an instance of Headroom, passing the element requirejs(["thirdparty/headroom"], function () {
var headroom = new Headroom(elem);
// initialise // construct an instance of Headroom, passing the element
headroom.init(); var headroom = new Headroom(elem);
// initialise
headroom.init();
});
} }
function initializeApiClient(apiClient) { function initializeApiClient(apiClient) {

View file

@ -420,13 +420,16 @@
} }
if (AppInfo.enableHeadRoom) { if (AppInfo.enableHeadRoom) {
$('.tvGuideHeader', page).each(function () { requirejs(["thirdparty/headroom"], function () {
// construct an instance of Headroom, passing the element $('.tvGuideHeader', page).each(function () {
var headroom = new Headroom(this);
// initialise
headroom.init();
// construct an instance of Headroom, passing the element
var headroom = new Headroom(this);
// initialise
headroom.init();
});
}); });
} }

View file

@ -137,6 +137,10 @@
}; };
self.getPlayers = function() {
return players;
};
self.getTargets = function () { self.getTargets = function () {
var deferred = $.Deferred(); var deferred = $.Deferred();
@ -383,6 +387,37 @@
} }
} }
}; };
// TOOD: This doesn't really belong here
self.getNowPlayingNameHtml = function (nowPlayingItem) {
var topText = nowPlayingItem.Name;
if (nowPlayingItem.MediaType == 'Video') {
if (nowPlayingItem.IndexNumber != null) {
topText = nowPlayingItem.IndexNumber + " - " + topText;
}
if (nowPlayingItem.ParentIndexNumber != null) {
topText = nowPlayingItem.ParentIndexNumber + "." + topText;
}
}
var bottomText = '';
if (nowPlayingItem.Artists && nowPlayingItem.Artists.length) {
bottomText = topText;
topText = nowPlayingItem.Artists[0];
}
else if (nowPlayingItem.SeriesName || nowPlayingItem.Album) {
bottomText = topText;
topText = nowPlayingItem.SeriesName || nowPlayingItem.Album;
}
else if (nowPlayingItem.ProductionYear) {
bottomText = nowPlayingItem.ProductionYear;
}
return bottomText ? topText + '<br/>' + bottomText : topText;
};
} }
window.MediaController = new mediaController(); window.MediaController = new mediaController();

View file

@ -327,7 +327,7 @@
} }
var nowPlayingTextElement = $('.nowPlayingText', mediaControls); var nowPlayingTextElement = $('.nowPlayingText', mediaControls);
var nameHtml = self.getNowPlayingNameHtml(state); var nameHtml = MediaController.getNowPlayingNameHtml(state.NowPlayingItem);
if (nameHtml.indexOf('<br/>') != -1) { if (nameHtml.indexOf('<br/>') != -1) {
nowPlayingTextElement.addClass('nowPlayingDoubleText'); nowPlayingTextElement.addClass('nowPlayingDoubleText');
@ -976,31 +976,8 @@
return s.Type == 'Subtitle'; return s.Type == 'Subtitle';
}); });
// Get Video Poster (Code from librarybrowser.js) var posterCode = self.getPosterUrl(item);
var screenWidth = Math.max(screen.height, screen.width); posterCode = posterCode ? (' poster="' + posterCode + '"') : '';
var posterCode = '';
if (item.BackdropImageTags && item.BackdropImageTags.length) {
posterCode = ' poster="' + ApiClient.getScaledImageUrl(item.Id, {
type: "Backdrop",
index: 0,
maxWidth: screenWidth,
tag: item.BackdropImageTags[0]
}) + '"';
}
else if (item.ParentBackdropItemId && item.ParentBackdropImageTags && item.ParentBackdropImageTags.length) {
posterCode = ' poster="' + ApiClient.getScaledImageUrl(item.ParentBackdropItemId, {
type: 'Backdrop',
index: 0,
maxWidth: screenWidth,
tag: item.ParentBackdropImageTags[0]
}) + '"';
}
//======================================================================================> //======================================================================================>
// Create video player // Create video player

View file

@ -941,35 +941,32 @@
} }
self.getNowPlayingNameHtml = function (playerState) { self.getPosterUrl = function (item) {
var nowPlayingItem = playerState.NowPlayingItem; var screenWidth = Math.max(screen.height, screen.width);
var topText = nowPlayingItem.Name;
if (item.BackdropImageTags && item.BackdropImageTags.length) {
return ApiClient.getScaledImageUrl(item.Id, {
type: "Backdrop",
index: 0,
maxWidth: screenWidth,
tag: item.BackdropImageTags[0]
});
}
else if (item.ParentBackdropItemId && item.ParentBackdropImageTags && item.ParentBackdropImageTags.length) {
return ApiClient.getScaledImageUrl(item.ParentBackdropItemId, {
type: 'Backdrop',
index: 0,
maxWidth: screenWidth,
tag: item.ParentBackdropImageTags[0]
});
if (nowPlayingItem.MediaType == 'Video') {
if (nowPlayingItem.IndexNumber != null) {
topText = nowPlayingItem.IndexNumber + " - " + topText;
}
if (nowPlayingItem.ParentIndexNumber != null) {
topText = nowPlayingItem.ParentIndexNumber + "." + topText;
}
} }
var bottomText = ''; return null;
if (nowPlayingItem.Artists && nowPlayingItem.Artists.length) {
bottomText = topText;
topText = nowPlayingItem.Artists[0];
}
else if (nowPlayingItem.SeriesName || nowPlayingItem.Album) {
bottomText = topText;
topText = nowPlayingItem.SeriesName || nowPlayingItem.Album;
}
else if (nowPlayingItem.ProductionYear) {
bottomText = nowPlayingItem.ProductionYear;
}
return bottomText ? topText + '<br/>' + bottomText : topText;
}; };
self.displayContent = function (options) { self.displayContent = function (options) {
@ -1676,6 +1673,7 @@
this.src = audioUrl; this.src = audioUrl;
this.volume = initialVolume; this.volume = initialVolume;
this.poster = self.getPosterUrl(item);
this.play(); this.play();
}).on("volumechange.mediaplayerevent", function () { }).on("volumechange.mediaplayerevent", function () {

View file

@ -287,7 +287,7 @@
var currentImgUrl; var currentImgUrl;
function updateNowPlayingInfo(state) { function updateNowPlayingInfo(state) {
var nameHtml = MediaPlayer.getNowPlayingNameHtml(state) || ''; var nameHtml = MediaController.getNowPlayingNameHtml(state.NowPlayingItem) || '';
if (nameHtml.indexOf('<br/>') != -1) { if (nameHtml.indexOf('<br/>') != -1) {
nowPlayingTextElement.addClass('nowPlayingDoubleText'); nowPlayingTextElement.addClass('nowPlayingDoubleText');

View file

@ -521,7 +521,7 @@
var item = state.NowPlayingItem; var item = state.NowPlayingItem;
$('.itemName', page).html(item ? MediaPlayer.getNowPlayingNameHtml(state) : ''); $('.itemName', page).html(item ? MediaController.getNowPlayingNameHtml(item) : '');
var url; var url;

View file

@ -175,9 +175,12 @@
index = Math.max(index || 0, 0); index = Math.max(index || 0, 0);
$.swipebox(slideshowItems, { Dashboard.loadSwipebox().done(function() {
initialIndexOnArray: index,
hideBarsDelay: 30000 $.swipebox(slideshowItems, {
initialIndexOnArray: index,
hideBarsDelay: 30000
});
}); });
} }

View file

@ -1460,6 +1460,20 @@ var Dashboard = {
deviceName: deviceName, deviceName: deviceName,
deviceId: deviceId deviceId: deviceId
}; };
},
loadSwipebox: function() {
var deferred = DeferredBuilder.Deferred();
require([
'thirdparty/swipebox-master/js/jquery.swipebox.min',
'css!thirdparty/swipebox-master/css/swipebox.min'
], function () {
deferred.resolve();
});
return deferred.promise();
} }
}; };
@ -1583,12 +1597,16 @@ var AppInfo = {};
function initFastClick() { function initFastClick() {
FastClick.attach(document.body); requirejs(["thirdparty/fastclick"], function (FastClick) {
// Have to work around this issue of fast click breaking the panel dismiss FastClick.attach(document.body);
$(document.body).on('touchstart', '.ui-panel-dismiss', function () {
$(this).trigger('click'); // Have to work around this issue of fast click breaking the panel dismiss
$(document.body).on('touchstart', '.ui-panel-dismiss', function () {
$(this).trigger('click');
});
}); });
} }
function onReady() { function onReady() {
@ -1725,10 +1743,17 @@ var AppInfo = {};
var apiClient = ConnectionManager.currentApiClient(); var apiClient = ConnectionManager.currentApiClient();
// Close the connection gracefully when possible // Close the connection gracefully when possible
if (apiClient && apiClient.isWebSocketOpen() && !MediaPlayer.isPlaying()) { if (apiClient && apiClient.isWebSocketOpen()) {
console.log('Sending close web socket command'); var localActivePlayers = MediaController.getPlayers().filter(function (p) {
apiClient.closeWebSocket();
return p.isLocalPlayer && p.isPlaying();
});
if (!localActivePlayers.length) {
console.log('Sending close web socket command');
apiClient.closeWebSocket();
}
} }
}); });
@ -1741,6 +1766,19 @@ var AppInfo = {};
}); });
} }
requirejs.config({
map: {
'*': {
'css': 'thirdparty/requirecss' // or whatever the path to require-css is
}
}
});
// Required since jQuery is loaded before requireJs
define('jquery', [], function () {
return jQuery;
});
setAppInfo(); setAppInfo();
createConnectionManager(); createConnectionManager();

View file

@ -46,8 +46,13 @@
var val = store.getItem('enableThemeSongs-' + userId); var val = store.getItem('enableThemeSongs-' + userId);
var localAutoPlayers = MediaController.getPlayers().filter(function (p) {
return p.isLocalPlayer && p.canAutoPlayAudio();
});
// For bandwidth // For bandwidth
return val == '1' || (val != '0' && MediaPlayer.canAutoPlayAudio()); return val == '1' || (val != '0' && localAutoPlayers.length);
} }
function getPlayer() { function getPlayer() {

View file

@ -4,387 +4,4 @@
* License: MIT * License: MIT
*/ */
(function(window, document) { !function (a, b) { "use strict"; function c(a) { this.callback = a, this.ticking = !1 } function d(b) { return b && "undefined" != typeof a && (b === a || b.nodeType) } function e(a) { if (arguments.length <= 0) throw new Error("Missing arguments in extend function"); var b, c, f = a || {}; for (c = 1; c < arguments.length; c++) { var g = arguments[c] || {}; for (b in g) f[b] = "object" != typeof f[b] || d(f[b]) ? f[b] || g[b] : e(f[b], g[b]) } return f } function f(a) { return a === Object(a) ? a : { down: a, up: a } } function g(a, b) { b = e(b, g.options), this.lastKnownScrollY = 0, this.elem = a, this.debouncer = new c(this.update.bind(this)), this.tolerance = f(b.tolerance), this.classes = b.classes, this.offset = b.offset, this.scroller = b.scroller, this.initialised = !1, this.onPin = b.onPin, this.onUnpin = b.onUnpin, this.onTop = b.onTop, this.onNotTop = b.onNotTop } var h = { bind: !!function () { }.bind, classList: "classList" in b.documentElement, rAF: !!(a.requestAnimationFrame || a.webkitRequestAnimationFrame || a.mozRequestAnimationFrame) }; a.requestAnimationFrame = a.requestAnimationFrame || a.webkitRequestAnimationFrame || a.mozRequestAnimationFrame, c.prototype = { constructor: c, update: function () { this.callback && this.callback(), this.ticking = !1 }, requestTick: function () { this.ticking || (requestAnimationFrame(this.rafCallback || (this.rafCallback = this.update.bind(this))), this.ticking = !0) }, handleEvent: function () { this.requestTick() } }, g.prototype = { constructor: g, init: function () { return g.cutsTheMustard ? (this.elem.classList.add(this.classes.initial), setTimeout(this.attachEvent.bind(this), 100), this) : void 0 }, destroy: function () { var a = this.classes; this.initialised = !1, this.elem.classList.remove(a.unpinned, a.pinned, a.top, a.initial), this.scroller.removeEventListener("scroll", this.debouncer, !1) }, attachEvent: function () { this.initialised || (this.lastKnownScrollY = this.getScrollY(), this.initialised = !0, this.scroller.addEventListener("scroll", this.debouncer, !1), this.debouncer.handleEvent()) }, unpin: function () { var a = this.elem.classList, b = this.classes; (a.contains(b.pinned) || !a.contains(b.unpinned)) && (a.add(b.unpinned), a.remove(b.pinned), this.onUnpin && this.onUnpin.call(this)) }, pin: function () { var a = this.elem.classList, b = this.classes; a.contains(b.unpinned) && (a.remove(b.unpinned), a.add(b.pinned), this.onPin && this.onPin.call(this)) }, top: function () { var a = this.elem.classList, b = this.classes; a.contains(b.top) || (a.add(b.top), a.remove(b.notTop), this.onTop && this.onTop.call(this)) }, notTop: function () { var a = this.elem.classList, b = this.classes; a.contains(b.notTop) || (a.add(b.notTop), a.remove(b.top), this.onNotTop && this.onNotTop.call(this)) }, getScrollY: function () { return void 0 !== this.scroller.pageYOffset ? this.scroller.pageYOffset : void 0 !== this.scroller.scrollTop ? this.scroller.scrollTop : (b.documentElement || b.body.parentNode || b.body).scrollTop }, getViewportHeight: function () { return a.innerHeight || b.documentElement.clientHeight || b.body.clientHeight }, getDocumentHeight: function () { var a = b.body, c = b.documentElement; return Math.max(a.scrollHeight, c.scrollHeight, a.offsetHeight, c.offsetHeight, a.clientHeight, c.clientHeight) }, getElementHeight: function (a) { return Math.max(a.scrollHeight, a.offsetHeight, a.clientHeight) }, getScrollerHeight: function () { return this.scroller === a || this.scroller === b.body ? this.getDocumentHeight() : this.getElementHeight(this.scroller) }, isOutOfBounds: function (a) { var b = 0 > a, c = a + this.getViewportHeight() > this.getScrollerHeight(); return b || c }, toleranceExceeded: function (a, b) { return Math.abs(a - this.lastKnownScrollY) >= this.tolerance[b] }, shouldUnpin: function (a, b) { var c = a > this.lastKnownScrollY, d = a >= this.offset; return c && d && b }, shouldPin: function (a, b) { var c = a < this.lastKnownScrollY, d = a <= this.offset; return c && b || d }, update: function () { var a = this.getScrollY(), b = a > this.lastKnownScrollY ? "down" : "up", c = this.toleranceExceeded(a, b); this.isOutOfBounds(a) || (a <= this.offset ? this.top() : this.notTop(), this.shouldUnpin(a, c) ? this.unpin() : this.shouldPin(a, c) && this.pin(), this.lastKnownScrollY = a) } }, g.options = { tolerance: { up: 0, down: 0 }, offset: 0, scroller: a, classes: { pinned: "headroom--pinned", unpinned: "headroom--unpinned", top: "headroom--top", notTop: "headroom--not-top", initial: "headroom" } }, g.cutsTheMustard = "undefined" != typeof h && h.rAF && h.bind && h.classList, a.Headroom = g }(window, document);
'use strict';
/* exported features */
var features = {
bind : !!(function(){}.bind),
classList : 'classList' in document.documentElement,
rAF : !!(window.requestAnimationFrame || window.webkitRequestAnimationFrame || window.mozRequestAnimationFrame)
};
window.requestAnimationFrame = window.requestAnimationFrame || window.webkitRequestAnimationFrame || window.mozRequestAnimationFrame;
/**
* Handles debouncing of events via requestAnimationFrame
* @see http://www.html5rocks.com/en/tutorials/speed/animations/
* @param {Function} callback The callback to handle whichever event
*/
function Debouncer (callback) {
this.callback = callback;
this.ticking = false;
}
Debouncer.prototype = {
constructor : Debouncer,
/**
* dispatches the event to the supplied callback
* @private
*/
update : function() {
this.callback && this.callback();
this.ticking = false;
},
/**
* ensures events don't get stacked
* @private
*/
requestTick : function() {
if(!this.ticking) {
requestAnimationFrame(this.rafCallback || (this.rafCallback = this.update.bind(this)));
this.ticking = true;
}
},
/**
* Attach this as the event listeners
*/
handleEvent : function() {
this.requestTick();
}
};
/**
* Check if object is part of the DOM
* @constructor
* @param {Object} obj element to check
*/
function isDOMElement(obj) {
return obj && typeof window !== 'undefined' && (obj === window || obj.nodeType);
}
/**
* Helper function for extending objects
*/
function extend (object /*, objectN ... */) {
if(arguments.length <= 0) {
throw new Error('Missing arguments in extend function');
}
var result = object || {},
key,
i;
for (i = 1; i < arguments.length; i++) {
var replacement = arguments[i] || {};
for (key in replacement) {
// Recurse into object except if the object is a DOM element
if(typeof result[key] === 'object' && ! isDOMElement(result[key])) {
result[key] = extend(result[key], replacement[key]);
}
else {
result[key] = result[key] || replacement[key];
}
}
}
return result;
}
/**
* Helper function for normalizing tolerance option to object format
*/
function normalizeTolerance (t) {
return t === Object(t) ? t : { down : t, up : t };
}
/**
* UI enhancement for fixed headers.
* Hides header when scrolling down
* Shows header when scrolling up
* @constructor
* @param {DOMElement} elem the header element
* @param {Object} options options for the widget
*/
function Headroom (elem, options) {
options = extend(options, Headroom.options);
this.lastKnownScrollY = 0;
this.elem = elem;
this.debouncer = new Debouncer(this.update.bind(this));
this.tolerance = normalizeTolerance(options.tolerance);
this.classes = options.classes;
this.offset = options.offset;
this.scroller = options.scroller;
this.initialised = false;
this.onPin = options.onPin;
this.onUnpin = options.onUnpin;
this.onTop = options.onTop;
this.onNotTop = options.onNotTop;
}
Headroom.prototype = {
constructor : Headroom,
/**
* Initialises the widget
*/
init : function() {
if(!Headroom.cutsTheMustard) {
return;
}
this.elem.classList.add(this.classes.initial);
// defer event registration to handle browser
// potentially restoring previous scroll position
setTimeout(this.attachEvent.bind(this), 100);
return this;
},
/**
* Unattaches events and removes any classes that were added
*/
destroy : function() {
var classes = this.classes;
this.initialised = false;
this.elem.classList.remove(classes.unpinned, classes.pinned, classes.top, classes.initial);
this.scroller.removeEventListener('scroll', this.debouncer, false);
},
/**
* Attaches the scroll event
* @private
*/
attachEvent : function() {
if(!this.initialised){
this.lastKnownScrollY = this.getScrollY();
this.initialised = true;
this.scroller.addEventListener('scroll', this.debouncer, false);
this.debouncer.handleEvent();
}
},
/**
* Unpins the header if it's currently pinned
*/
unpin : function() {
var classList = this.elem.classList,
classes = this.classes;
if(classList.contains(classes.pinned) || !classList.contains(classes.unpinned)) {
classList.add(classes.unpinned);
classList.remove(classes.pinned);
this.onUnpin && this.onUnpin.call(this);
}
},
/**
* Pins the header if it's currently unpinned
*/
pin : function() {
var classList = this.elem.classList,
classes = this.classes;
if(classList.contains(classes.unpinned)) {
classList.remove(classes.unpinned);
classList.add(classes.pinned);
this.onPin && this.onPin.call(this);
}
},
/**
* Handles the top states
*/
top : function() {
var classList = this.elem.classList,
classes = this.classes;
if(!classList.contains(classes.top)) {
classList.add(classes.top);
classList.remove(classes.notTop);
this.onTop && this.onTop.call(this);
}
},
/**
* Handles the not top state
*/
notTop : function() {
var classList = this.elem.classList,
classes = this.classes;
if(!classList.contains(classes.notTop)) {
classList.add(classes.notTop);
classList.remove(classes.top);
this.onNotTop && this.onNotTop.call(this);
}
},
/**
* Gets the Y scroll position
* @see https://developer.mozilla.org/en-US/docs/Web/API/Window.scrollY
* @return {Number} pixels the page has scrolled along the Y-axis
*/
getScrollY : function() {
return (this.scroller.pageYOffset !== undefined)
? this.scroller.pageYOffset
: (this.scroller.scrollTop !== undefined)
? this.scroller.scrollTop
: (document.documentElement || document.body.parentNode || document.body).scrollTop;
},
/**
* Gets the height of the viewport
* @see http://andylangton.co.uk/blog/development/get-viewport-size-width-and-height-javascript
* @return {int} the height of the viewport in pixels
*/
getViewportHeight : function () {
return window.innerHeight
|| document.documentElement.clientHeight
|| document.body.clientHeight;
},
/**
* Gets the height of the document
* @see http://james.padolsey.com/javascript/get-document-height-cross-browser/
* @return {int} the height of the document in pixels
*/
getDocumentHeight : function () {
var body = document.body,
documentElement = document.documentElement;
return Math.max(
body.scrollHeight, documentElement.scrollHeight,
body.offsetHeight, documentElement.offsetHeight,
body.clientHeight, documentElement.clientHeight
);
},
/**
* Gets the height of the DOM element
* @param {Object} elm the element to calculate the height of which
* @return {int} the height of the element in pixels
*/
getElementHeight : function (elm) {
return Math.max(
elm.scrollHeight,
elm.offsetHeight,
elm.clientHeight
);
},
/**
* Gets the height of the scroller element
* @return {int} the height of the scroller element in pixels
*/
getScrollerHeight : function () {
return (this.scroller === window || this.scroller === document.body)
? this.getDocumentHeight()
: this.getElementHeight(this.scroller);
},
/**
* determines if the scroll position is outside of document boundaries
* @param {int} currentScrollY the current y scroll position
* @return {bool} true if out of bounds, false otherwise
*/
isOutOfBounds : function (currentScrollY) {
var pastTop = currentScrollY < 0,
pastBottom = currentScrollY + this.getViewportHeight() > this.getScrollerHeight();
return pastTop || pastBottom;
},
/**
* determines if the tolerance has been exceeded
* @param {int} currentScrollY the current scroll y position
* @return {bool} true if tolerance exceeded, false otherwise
*/
toleranceExceeded : function (currentScrollY, direction) {
return Math.abs(currentScrollY-this.lastKnownScrollY) >= this.tolerance[direction];
},
/**
* determine if it is appropriate to unpin
* @param {int} currentScrollY the current y scroll position
* @param {bool} toleranceExceeded has the tolerance been exceeded?
* @return {bool} true if should unpin, false otherwise
*/
shouldUnpin : function (currentScrollY, toleranceExceeded) {
var scrollingDown = currentScrollY > this.lastKnownScrollY,
pastOffset = currentScrollY >= this.offset;
return scrollingDown && pastOffset && toleranceExceeded;
},
/**
* determine if it is appropriate to pin
* @param {int} currentScrollY the current y scroll position
* @param {bool} toleranceExceeded has the tolerance been exceeded?
* @return {bool} true if should pin, false otherwise
*/
shouldPin : function (currentScrollY, toleranceExceeded) {
var scrollingUp = currentScrollY < this.lastKnownScrollY,
pastOffset = currentScrollY <= this.offset;
return (scrollingUp && toleranceExceeded) || pastOffset;
},
/**
* Handles updating the state of the widget
*/
update : function() {
var currentScrollY = this.getScrollY(),
scrollDirection = currentScrollY > this.lastKnownScrollY ? 'down' : 'up',
toleranceExceeded = this.toleranceExceeded(currentScrollY, scrollDirection);
if(this.isOutOfBounds(currentScrollY)) { // Ignore bouncy scrolling in OSX
return;
}
if (currentScrollY <= this.offset ) {
this.top();
} else {
this.notTop();
}
if(this.shouldUnpin(currentScrollY, toleranceExceeded)) {
this.unpin();
}
else if(this.shouldPin(currentScrollY, toleranceExceeded)) {
this.pin();
}
this.lastKnownScrollY = currentScrollY;
}
};
/**
* Default options
* @type {Object}
*/
Headroom.options = {
tolerance : {
up : 0,
down : 0
},
offset : 0,
scroller: window,
classes : {
pinned : 'headroom--pinned',
unpinned : 'headroom--unpinned',
top : 'headroom--top',
notTop : 'headroom--not-top',
initial : 'headroom'
}
};
Headroom.cutsTheMustard = typeof features !== 'undefined' && features.rAF && features.bind && features.classList;
window.Headroom = Headroom;
}(window, document));

136
dashboard-ui/thirdparty/require.js vendored Normal file
View file

@ -0,0 +1,136 @@
/*
RequireJS 2.1.17 Copyright (c) 2010-2015, The Dojo Foundation All Rights Reserved.
Available via the MIT or new BSD license.
see: http://github.com/jrburke/requirejs for details
*/
var requirejs, require, define;
(function (ba) {
function G(b) { return "[object Function]" === K.call(b) } function H(b) { return "[object Array]" === K.call(b) } function v(b, c) { if (b) { var d; for (d = 0; d < b.length && (!b[d] || !c(b[d], d, b)) ; d += 1); } } function T(b, c) { if (b) { var d; for (d = b.length - 1; -1 < d && (!b[d] || !c(b[d], d, b)) ; d -= 1); } } function t(b, c) { return fa.call(b, c) } function m(b, c) { return t(b, c) && b[c] } function B(b, c) { for (var d in b) if (t(b, d) && c(b[d], d)) break } function U(b, c, d, e) {
c && B(c, function (c, g) {
if (d || !t(b, g)) e && "object" === typeof c && c && !H(c) && !G(c) && !(c instanceof
RegExp) ? (b[g] || (b[g] = {}), U(b[g], c, d, e)) : b[g] = c
}); return b
} function u(b, c) { return function () { return c.apply(b, arguments) } } function ca(b) { throw b; } function da(b) { if (!b) return b; var c = ba; v(b.split("."), function (b) { c = c[b] }); return c } function C(b, c, d, e) { c = Error(c + "\nhttp://requirejs.org/docs/errors.html#" + b); c.requireType = b; c.requireModules = e; d && (c.originalError = d); return c } function ga(b) {
function c(a, k, b) {
var f, l, c, d, e, g, i, p, k = k && k.split("/"), h = j.map, n = h && h["*"]; if (a) {
a = a.split("/"); l = a.length - 1; j.nodeIdCompat &&
Q.test(a[l]) && (a[l] = a[l].replace(Q, "")); "." === a[0].charAt(0) && k && (l = k.slice(0, k.length - 1), a = l.concat(a)); l = a; for (c = 0; c < l.length; c++) if (d = l[c], "." === d) l.splice(c, 1), c -= 1; else if (".." === d && !(0 === c || 1 === c && ".." === l[2] || ".." === l[c - 1]) && 0 < c) l.splice(c - 1, 2), c -= 2; a = a.join("/")
} if (b && h && (k || n)) {
l = a.split("/"); c = l.length; a: for (; 0 < c; c -= 1) { e = l.slice(0, c).join("/"); if (k) for (d = k.length; 0 < d; d -= 1) if (b = m(h, k.slice(0, d).join("/"))) if (b = m(b, e)) { f = b; g = c; break a } !i && (n && m(n, e)) && (i = m(n, e), p = c) } !f && i && (f = i, g = p); f && (l.splice(0,
g, f), a = l.join("/"))
} return (f = m(j.pkgs, a)) ? f : a
} function d(a) { z && v(document.getElementsByTagName("script"), function (k) { if (k.getAttribute("data-requiremodule") === a && k.getAttribute("data-requirecontext") === i.contextName) return k.parentNode.removeChild(k), !0 }) } function e(a) { var k = m(j.paths, a); if (k && H(k) && 1 < k.length) return k.shift(), i.require.undef(a), i.makeRequire(null, { skipMap: !0 })([a]), !0 } function n(a) { var k, c = a ? a.indexOf("!") : -1; -1 < c && (k = a.substring(0, c), a = a.substring(c + 1, a.length)); return [k, a] } function p(a,
k, b, f) { var l, d, e = null, g = k ? k.name : null, j = a, p = !0, h = ""; a || (p = !1, a = "_@r" + (K += 1)); a = n(a); e = a[0]; a = a[1]; e && (e = c(e, g, f), d = m(r, e)); a && (e ? h = d && d.normalize ? d.normalize(a, function (a) { return c(a, g, f) }) : -1 === a.indexOf("!") ? c(a, g, f) : a : (h = c(a, g, f), a = n(h), e = a[0], h = a[1], b = !0, l = i.nameToUrl(h))); b = e && !d && !b ? "_unnormalized" + (O += 1) : ""; return { prefix: e, name: h, parentMap: k, unnormalized: !!b, url: l, originalName: j, isDefine: p, id: (e ? e + "!" + h : h) + b } } function s(a) { var k = a.id, b = m(h, k); b || (b = h[k] = new i.Module(a)); return b } function q(a,
k, b) { var f = a.id, c = m(h, f); if (t(r, f) && (!c || c.defineEmitComplete)) "defined" === k && b(r[f]); else if (c = s(a), c.error && "error" === k) b(c.error); else c.on(k, b) } function w(a, b) { var c = a.requireModules, f = !1; if (b) b(a); else if (v(c, function (b) { if (b = m(h, b)) b.error = a, b.events.error && (f = !0, b.emit("error", a)) }), !f) g.onError(a) } function x() { R.length && (ha.apply(A, [A.length, 0].concat(R)), R = []) } function y(a) { delete h[a]; delete V[a] } function F(a, b, c) {
var f = a.map.id; a.error ? a.emit("error", a.error) : (b[f] = !0, v(a.depMaps, function (f,
d) { var e = f.id, g = m(h, e); g && (!a.depMatched[d] && !c[e]) && (m(b, e) ? (a.defineDep(d, r[e]), a.check()) : F(g, b, c)) }), c[f] = !0)
} function D() {
var a, b, c = (a = 1E3 * j.waitSeconds) && i.startTime + a < (new Date).getTime(), f = [], l = [], g = !1, h = !0; if (!W) {
W = !0; B(V, function (a) { var i = a.map, j = i.id; if (a.enabled && (i.isDefine || l.push(a), !a.error)) if (!a.inited && c) e(j) ? g = b = !0 : (f.push(j), d(j)); else if (!a.inited && (a.fetched && i.isDefine) && (g = !0, !i.prefix)) return h = !1 }); if (c && f.length) return a = C("timeout", "Load timeout for modules: " + f, null,
f), a.contextName = i.contextName, w(a); h && v(l, function (a) { F(a, {}, {}) }); if ((!c || b) && g) if ((z || ea) && !X) X = setTimeout(function () { X = 0; D() }, 50); W = !1
}
} function E(a) { t(r, a[0]) || s(p(a[0], null, !0)).init(a[1], a[2]) } function I(a) { var a = a.currentTarget || a.srcElement, b = i.onScriptLoad; a.detachEvent && !Y ? a.detachEvent("onreadystatechange", b) : a.removeEventListener("load", b, !1); b = i.onScriptError; (!a.detachEvent || Y) && a.removeEventListener("error", b, !1); return { node: a, id: a && a.getAttribute("data-requiremodule") } } function J() {
var a;
for (x() ; A.length;) { a = A.shift(); if (null === a[0]) return w(C("mismatch", "Mismatched anonymous define() module: " + a[a.length - 1])); E(a) }
} var W, Z, i, L, X, j = { waitSeconds: 7, baseUrl: "./", paths: {}, bundles: {}, pkgs: {}, shim: {}, config: {} }, h = {}, V = {}, $ = {}, A = [], r = {}, S = {}, aa = {}, K = 1, O = 1; L = {
require: function (a) { return a.require ? a.require : a.require = i.makeRequire(a.map) }, exports: function (a) { a.usingExports = !0; if (a.map.isDefine) return a.exports ? r[a.map.id] = a.exports : a.exports = r[a.map.id] = {} }, module: function (a) {
return a.module ?
a.module : a.module = { id: a.map.id, uri: a.map.url, config: function () { return m(j.config, a.map.id) || {} }, exports: a.exports || (a.exports = {}) }
}
}; Z = function (a) { this.events = m($, a.id) || {}; this.map = a; this.shim = m(j.shim, a.id); this.depExports = []; this.depMaps = []; this.depMatched = []; this.pluginMaps = {}; this.depCount = 0 }; Z.prototype = {
init: function (a, b, c, f) {
f = f || {}; if (!this.inited) {
this.factory = b; if (c) this.on("error", c); else this.events.error && (c = u(this, function (a) { this.emit("error", a) })); this.depMaps = a && a.slice(0); this.errback =
c; this.inited = !0; this.ignore = f.ignore; f.enabled || this.enabled ? this.enable() : this.check()
}
}, defineDep: function (a, b) { this.depMatched[a] || (this.depMatched[a] = !0, this.depCount -= 1, this.depExports[a] = b) }, fetch: function () { if (!this.fetched) { this.fetched = !0; i.startTime = (new Date).getTime(); var a = this.map; if (this.shim) i.makeRequire(this.map, { enableBuildCallback: !0 })(this.shim.deps || [], u(this, function () { return a.prefix ? this.callPlugin() : this.load() })); else return a.prefix ? this.callPlugin() : this.load() } }, load: function () {
var a =
this.map.url; S[a] || (S[a] = !0, i.load(this.map.id, a))
}, check: function () {
if (this.enabled && !this.enabling) {
var a, b, c = this.map.id; b = this.depExports; var f = this.exports, l = this.factory; if (this.inited) if (this.error) this.emit("error", this.error); else {
if (!this.defining) {
this.defining = !0; if (1 > this.depCount && !this.defined) {
if (G(l)) {
if (this.events.error && this.map.isDefine || g.onError !== ca) try { f = i.execCb(c, l, b, f) } catch (d) { a = d } else f = i.execCb(c, l, b, f); this.map.isDefine && void 0 === f && ((b = this.module) ? f = b.exports : this.usingExports &&
(f = this.exports)); if (a) return a.requireMap = this.map, a.requireModules = this.map.isDefine ? [this.map.id] : null, a.requireType = this.map.isDefine ? "define" : "require", w(this.error = a)
} else f = l; this.exports = f; if (this.map.isDefine && !this.ignore && (r[c] = f, g.onResourceLoad)) g.onResourceLoad(i, this.map, this.depMaps); y(c); this.defined = !0
} this.defining = !1; this.defined && !this.defineEmitted && (this.defineEmitted = !0, this.emit("defined", this.exports), this.defineEmitComplete = !0)
}
} else this.fetch()
}
}, callPlugin: function () {
var a =
this.map, b = a.id, d = p(a.prefix); this.depMaps.push(d); q(d, "defined", u(this, function (f) {
var l, d; d = m(aa, this.map.id); var e = this.map.name, P = this.map.parentMap ? this.map.parentMap.name : null, n = i.makeRequire(a.parentMap, { enableBuildCallback: !0 }); if (this.map.unnormalized) {
if (f.normalize && (e = f.normalize(e, function (a) { return c(a, P, !0) }) || ""), f = p(a.prefix + "!" + e, this.map.parentMap), q(f, "defined", u(this, function (a) { this.init([], function () { return a }, null, { enabled: !0, ignore: !0 }) })), d = m(h, f.id)) {
this.depMaps.push(f);
if (this.events.error) d.on("error", u(this, function (a) { this.emit("error", a) })); d.enable()
}
} else d ? (this.map.url = i.nameToUrl(d), this.load()) : (l = u(this, function (a) { this.init([], function () { return a }, null, { enabled: !0 }) }), l.error = u(this, function (a) { this.inited = !0; this.error = a; a.requireModules = [b]; B(h, function (a) { 0 === a.map.id.indexOf(b + "_unnormalized") && y(a.map.id) }); w(a) }), l.fromText = u(this, function (f, c) {
var d = a.name, e = p(d), P = M; c && (f = c); P && (M = !1); s(e); t(j.config, b) && (j.config[d] = j.config[b]); try { g.exec(f) } catch (h) {
return w(C("fromtexteval",
"fromText eval for " + b + " failed: " + h, h, [b]))
} P && (M = !0); this.depMaps.push(e); i.completeLoad(d); n([d], l)
}), f.load(a.name, n, l, j))
})); i.enable(d, this); this.pluginMaps[d.id] = d
}, enable: function () {
V[this.map.id] = this; this.enabling = this.enabled = !0; v(this.depMaps, u(this, function (a, b) {
var c, f; if ("string" === typeof a) {
a = p(a, this.map.isDefine ? this.map : this.map.parentMap, !1, !this.skipMap); this.depMaps[b] = a; if (c = m(L, a.id)) { this.depExports[b] = c(this); return } this.depCount += 1; q(a, "defined", u(this, function (a) {
this.defineDep(b,
a); this.check()
})); this.errback ? q(a, "error", u(this, this.errback)) : this.events.error && q(a, "error", u(this, function (a) { this.emit("error", a) }))
} c = a.id; f = h[c]; !t(L, c) && (f && !f.enabled) && i.enable(a, this)
})); B(this.pluginMaps, u(this, function (a) { var b = m(h, a.id); b && !b.enabled && i.enable(a, this) })); this.enabling = !1; this.check()
}, on: function (a, b) { var c = this.events[a]; c || (c = this.events[a] = []); c.push(b) }, emit: function (a, b) { v(this.events[a], function (a) { a(b) }); "error" === a && delete this.events[a] }
}; i = {
config: j, contextName: b,
registry: h, defined: r, urlFetched: S, defQueue: A, Module: Z, makeModuleMap: p, nextTick: g.nextTick, onError: w, configure: function (a) {
a.baseUrl && "/" !== a.baseUrl.charAt(a.baseUrl.length - 1) && (a.baseUrl += "/"); var b = j.shim, c = { paths: !0, bundles: !0, config: !0, map: !0 }; B(a, function (a, b) { c[b] ? (j[b] || (j[b] = {}), U(j[b], a, !0, !0)) : j[b] = a }); a.bundles && B(a.bundles, function (a, b) { v(a, function (a) { a !== b && (aa[a] = b) }) }); a.shim && (B(a.shim, function (a, c) {
H(a) && (a = { deps: a }); if ((a.exports || a.init) && !a.exportsFn) a.exportsFn = i.makeShimExports(a);
b[c] = a
}), j.shim = b); a.packages && v(a.packages, function (a) { var b, a = "string" === typeof a ? { name: a } : a; b = a.name; a.location && (j.paths[b] = a.location); j.pkgs[b] = a.name + "/" + (a.main || "main").replace(ia, "").replace(Q, "") }); B(h, function (a, b) { !a.inited && !a.map.unnormalized && (a.map = p(b)) }); if (a.deps || a.callback) i.require(a.deps || [], a.callback)
}, makeShimExports: function (a) { return function () { var b; a.init && (b = a.init.apply(ba, arguments)); return b || a.exports && da(a.exports) } }, makeRequire: function (a, e) {
function j(c, d, m) {
var n,
q; e.enableBuildCallback && (d && G(d)) && (d.__requireJsBuild = !0); if ("string" === typeof c) { if (G(d)) return w(C("requireargs", "Invalid require call"), m); if (a && t(L, c)) return L[c](h[a.id]); if (g.get) return g.get(i, c, a, j); n = p(c, a, !1, !0); n = n.id; return !t(r, n) ? w(C("notloaded", 'Module name "' + n + '" has not been loaded yet for context: ' + b + (a ? "" : ". Use require([])"))) : r[n] } J(); i.nextTick(function () { J(); q = s(p(null, a)); q.skipMap = e.skipMap; q.init(c, d, m, { enabled: !0 }); D() }); return j
} e = e || {}; U(j, {
isBrowser: z, toUrl: function (b) {
var d,
e = b.lastIndexOf("."), k = b.split("/")[0]; if (-1 !== e && (!("." === k || ".." === k) || 1 < e)) d = b.substring(e, b.length), b = b.substring(0, e); return i.nameToUrl(c(b, a && a.id, !0), d, !0)
}, defined: function (b) { return t(r, p(b, a, !1, !0).id) }, specified: function (b) { b = p(b, a, !1, !0).id; return t(r, b) || t(h, b) }
}); a || (j.undef = function (b) { x(); var c = p(b, a, !0), e = m(h, b); d(b); delete r[b]; delete S[c.url]; delete $[b]; T(A, function (a, c) { a[0] === b && A.splice(c, 1) }); e && (e.events.defined && ($[b] = e.events), y(b)) }); return j
}, enable: function (a) {
m(h, a.id) &&
s(a).enable()
}, completeLoad: function (a) { var b, c, d = m(j.shim, a) || {}, g = d.exports; for (x() ; A.length;) { c = A.shift(); if (null === c[0]) { c[0] = a; if (b) break; b = !0 } else c[0] === a && (b = !0); E(c) } c = m(h, a); if (!b && !t(r, a) && c && !c.inited) { if (j.enforceDefine && (!g || !da(g))) return e(a) ? void 0 : w(C("nodefine", "No define call for " + a, null, [a])); E([a, d.deps || [], d.exportsFn]) } D() }, nameToUrl: function (a, b, c) {
var d, e, h; (d = m(j.pkgs, a)) && (a = d); if (d = m(aa, a)) return i.nameToUrl(d, b, c); if (g.jsExtRegExp.test(a)) d = a + (b || ""); else {
d = j.paths;
a = a.split("/"); for (e = a.length; 0 < e; e -= 1) if (h = a.slice(0, e).join("/"), h = m(d, h)) { H(h) && (h = h[0]); a.splice(0, e, h); break } d = a.join("/"); d += b || (/^data\:|\?/.test(d) || c ? "" : ".js"); d = ("/" === d.charAt(0) || d.match(/^[\w\+\.\-]+:/) ? "" : j.baseUrl) + d
} return j.urlArgs ? d + ((-1 === d.indexOf("?") ? "?" : "&") + j.urlArgs) : d
}, load: function (a, b) { g.load(i, a, b) }, execCb: function (a, b, c, d) { return b.apply(d, c) }, onScriptLoad: function (a) { if ("load" === a.type || ja.test((a.currentTarget || a.srcElement).readyState)) N = null, a = I(a), i.completeLoad(a.id) },
onScriptError: function (a) { var b = I(a); if (!e(b.id)) return w(C("scripterror", "Script error for: " + b.id, a, [b.id])) }
}; i.require = i.makeRequire(); return i
} var g, x, y, D, I, E, N, J, s, O, ka = /(\/\*([\s\S]*?)\*\/|([^:]|^)\/\/(.*)$)/mg, la = /[^.]\s*require\s*\(\s*["']([^'"\s]+)["']\s*\)/g, Q = /\.js$/, ia = /^\.\//; x = Object.prototype; var K = x.toString, fa = x.hasOwnProperty, ha = Array.prototype.splice, z = !!("undefined" !== typeof window && "undefined" !== typeof navigator && window.document), ea = !z && "undefined" !== typeof importScripts, ja =
z && "PLAYSTATION 3" === navigator.platform ? /^complete$/ : /^(complete|loaded)$/, Y = "undefined" !== typeof opera && "[object Opera]" === opera.toString(), F = {}, q = {}, R = [], M = !1; if ("undefined" === typeof define) {
if ("undefined" !== typeof requirejs) { if (G(requirejs)) return; q = requirejs; requirejs = void 0 } "undefined" !== typeof require && !G(require) && (q = require, require = void 0); g = requirejs = function (b, c, d, e) {
var n, p = "_"; !H(b) && "string" !== typeof b && (n = b, H(c) ? (b = c, c = d, d = e) : b = []); n && n.context && (p = n.context); (e = m(F, p)) || (e = F[p] = g.s.newContext(p));
n && e.configure(n); return e.require(b, c, d)
}; g.config = function (b) { return g(b) }; g.nextTick = "undefined" !== typeof setTimeout ? function (b) { setTimeout(b, 4) } : function (b) { b() }; require || (require = g); g.version = "2.1.17"; g.jsExtRegExp = /^\/|:|\?|\.js$/; g.isBrowser = z; x = g.s = { contexts: F, newContext: ga }; g({}); v(["toUrl", "undef", "defined", "specified"], function (b) { g[b] = function () { var c = F._; return c.require[b].apply(c, arguments) } }); if (z && (y = x.head = document.getElementsByTagName("head")[0], D = document.getElementsByTagName("base")[0])) y =
x.head = D.parentNode; g.onError = ca; g.createNode = function (b) { var c = b.xhtml ? document.createElementNS("http://www.w3.org/1999/xhtml", "html:script") : document.createElement("script"); c.type = b.scriptType || "text/javascript"; c.charset = "utf-8"; c.async = !0; return c }; g.load = function (b, c, d) {
var e = b && b.config || {}; if (z) return e = g.createNode(e, c, d), e.setAttribute("data-requirecontext", b.contextName), e.setAttribute("data-requiremodule", c), e.attachEvent && !(e.attachEvent.toString && 0 > e.attachEvent.toString().indexOf("[native code")) &&
!Y ? (M = !0, e.attachEvent("onreadystatechange", b.onScriptLoad)) : (e.addEventListener("load", b.onScriptLoad, !1), e.addEventListener("error", b.onScriptError, !1)), e.src = d, J = e, D ? y.insertBefore(e, D) : y.appendChild(e), J = null, e; if (ea) try { importScripts(d), b.completeLoad(c) } catch (m) { b.onError(C("importscripts", "importScripts failed for " + c + " at " + d, m, [c])) }
}; z && !q.skipDataMain && T(document.getElementsByTagName("script"), function (b) {
y || (y = b.parentNode); if (I = b.getAttribute("data-main")) return s = I, q.baseUrl || (E = s.split("/"),
s = E.pop(), O = E.length ? E.join("/") + "/" : "./", q.baseUrl = O), s = s.replace(Q, ""), g.jsExtRegExp.test(s) && (s = I), q.deps = q.deps ? q.deps.concat(s) : [s], !0
}); define = function (b, c, d) {
var e, g; "string" !== typeof b && (d = c, c = b, b = null); H(c) || (d = c, c = null); !c && G(d) && (c = [], d.length && (d.toString().replace(ka, "").replace(la, function (b, d) { c.push(d) }), c = (1 === d.length ? ["require"] : ["require", "exports", "module"]).concat(c))); if (M) {
if (!(e = J)) N && "interactive" === N.readyState || T(document.getElementsByTagName("script"), function (b) {
if ("interactive" ===
b.readyState) return N = b
}), e = N; e && (b || (b = e.getAttribute("data-requiremodule")), g = F[e.getAttribute("data-requirecontext")])
} (g ? g.defQueue : R).push([b, c, d])
}; define.amd = { jQuery: !0 }; g.exec = function (b) { return eval(b) }; g(q)
}
})(this);

1
dashboard-ui/thirdparty/requirecss.js vendored Normal file
View file

@ -0,0 +1 @@
define(function(){if("undefined"==typeof window)return{load:function(e,t,n){n()}};var e=document.getElementsByTagName("head")[0],t=window.navigator.userAgent.match(/Trident\/([^ ;]*)|AppleWebKit\/([^ ;]*)|Opera\/([^ ;]*)|rv\:([^ ;]*)(.*?)Gecko\/([^ ;]*)|MSIE\s([^ ;]*)|AndroidWebKit\/([^ ;]*)/)||0,n=!1,r=!0;t[1]||t[7]?n=parseInt(t[1])<6||parseInt(t[7])<=9:t[2]||t[8]?r=!1:t[4]&&(n=parseInt(t[4])<18);var o={};o.pluginBuilder="./css-builder";var a,i,s,l=function(){a=document.createElement("style"),e.appendChild(a),i=a.styleSheet||a.sheet},u=0,d=[],c=function(e){u++,32==u&&(l(),u=0),i.addImport(e),a.onload=function(){f()}},f=function(){s();var e=d.shift();return e?(s=e[1],void c(e[0])):void(s=null)},h=function(e,t){if(i&&i.addImport||l(),i&&i.addImport)s?d.push([e,t]):(c(e),s=t);else{a.textContent='@import "'+e+'";';var n=setInterval(function(){try{a.sheet.cssRules,clearInterval(n),t()}catch(e){}},10)}},p=function(t,n){var o=document.createElement("link");if(o.type="text/css",o.rel="stylesheet",r)o.onload=function(){o.onload=function(){},setTimeout(n,7)};else var a=setInterval(function(){for(var e=0;e<document.styleSheets.length;e++){var t=document.styleSheets[e];if(t.href==o.href)return clearInterval(a),n()}},10);o.href=t,e.appendChild(o)};return o.normalize=function(e,t){return".css"==e.substr(e.length-4,4)&&(e=e.substr(0,e.length-4)),t(e)},o.load=function(e,t,r){(n?h:p)(t.toUrl(e+".css"),r)},o});