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

switch polymer to bower

This commit is contained in:
Luke Pulverenti 2015-06-19 12:36:51 -04:00
parent b9598ffaa1
commit 8f6cbe8de2
348 changed files with 40895 additions and 310 deletions

View file

@ -1,15 +1,65 @@
(function () {
function onClosed() {
$(this).remove();
}
function show(options) {
// items
// positionTo
// showCancel
require(['paperbuttonstyle'], function() {
// items
// positionTo
// showCancel
// title
var id = 'dlg' + new Date().getTime();
var html = '';
html += '<paper-dialog id="' + id + '" entry-animation="scale-up-animation" exit-animation="fade-out-animation">';
if (options.title) {
html += '<h2>';
html += options.title;
html += '</h2>';
}
html += '<paper-dialog-scrollable>';
for (var i = 0, length = options.items.length; i < length; i++) {
var option = options.items[i];
html += '<paper-button class="block blue ripple btnOption" data-id="' + option.id + '" style="margin:0;">' + option.name + '</paper-button>';
}
html += '</paper-dialog-scrollable>';
if (options.showCancel) {
html += '<div class="buttons">';
html += '<paper-button dialog-dismiss>' + Globalize.translate('ButtonCancel') + '</paper-button>';
html += '</div>';
}
html += '</paper-dialog>';
$(html).appendTo(document.body);
setTimeout(function () {
var dlg = document.getElementById(id);
dlg.open();
// Has to be assigned a z-index after the call to .open()
$(dlg).css('z-index', '999999').on('iron-overlay-closed', onClosed);
$('.btnOption', dlg).on('click', function () {
if (options.callback) {
options.callback(this.getAttribute('data-id'));
}
dlg.close();
});
}, 100);
});
}
window.ActionSheet = {
window.ActionSheetElement = {
show: show
};
})();

View file

@ -353,6 +353,8 @@
$('.currentDate', page).html(text);
}
var dateOptions = [];
function setDateRange(page, guideInfo) {
var today = new Date();
@ -370,28 +372,23 @@
start = new Date(Math.max(today, start));
var html = '';
dateOptions = [];
while (start <= end) {
html += '<option value="' + start.getTime() + '">' + LibraryBrowser.getFutureDateText(start) + '</option>';
dateOptions.push({
name: LibraryBrowser.getFutureDateText(start),
id: start.getTime()
});
start.setDate(start.getDate() + 1);
start.setHours(0, 0, 0, 0);
}
var elem = $('#selectDate', page).html(html).selectmenu('refresh');
if (currentDate) {
elem.val(currentDate.getTime()).selectmenu('refresh');
}
var val = elem.val();
var date = new Date();
if (val) {
date.setTime(parseInt(val));
if (currentDate) {
date.setTime(currentDate.getTime());
}
changeDate(page, date);
@ -425,6 +422,25 @@
});
}
function selectDate(page) {
require(['actionsheet'], function() {
ActionSheetElement.show({
items: dateOptions,
showCancel: true,
title: Globalize.translate('HeaderSelectDate'),
callback: function (id) {
var date = new Date();
date.setTime(parseInt(id));
changeDate(page, date);
}
});
});
}
$(document).on('pageinitdepends', "#liveTvGuidePage", function () {
var page = this;
@ -434,19 +450,6 @@
onProgramGridScroll(page, this);
});
$('#selectDate', page).on('change', function () {
var date = new Date();
date.setTime(parseInt(this.value));
$('#popupConfig', page).popup('close');
setTimeout(function () {
changeDate(page, date);
}, 300);
});
if ($.browser.mobile) {
$('.tvGuide', page).addClass('mobileGuide');
} else {
@ -478,6 +481,11 @@
reloadPage(page);
});
$('.btnSelectDate', page).on('click', function () {
selectDate(page);
});
}).on('pagebeforeshowready', "#liveTvGuidePage", function () {
var page = this;

View file

@ -163,8 +163,6 @@
$('#chkThemeSong', page).checked(query.HasThemeSong == true).checkboxradio('refresh');
$('#chkThemeVideo', page).checked(query.HasThemeVideo == true).checkboxradio('refresh');
$('.alphabetPicker', page).alphaValue(query.NameStartsWithOrGreater);
$('#selectPageSize', page).val(query.Limit).selectmenu('refresh');
}
@ -223,20 +221,6 @@
reloadItems(page);
});
$('.alphabetPicker', this).on('alphaselect', function (e, character) {
query.NameStartsWithOrGreater = character;
query.StartIndex = 0;
reloadItems(page);
}).on('alphaclear', function (e) {
query.NameStartsWithOrGreater = '';
reloadItems(page);
});
$('#selectView', this).on('change', function () {
view = this.value;

View file

@ -2042,14 +2042,19 @@ var AppInfo = {};
define("connectservice", ["thirdparty/apiclient/connectservice"]);
define("paperbuttonstyle", [], function () {
Dashboard.importCss('thirdparty/paper-button/paper-button-style.css');
Dashboard.importCss('thirdparty/paper-button-style.css');
return {};
});
define("jqmicons", [], function () {
Dashboard.importCss('thirdparty/jquerymobile-1.4.5/jquery.mobile.custom.icons.css');
return {};
});
define("actionsheet", ["scripts/actionsheet"]);
if (Dashboard.isRunningInCordova() && $.browser.safari) {
define("actionsheet", ["thirdparty/cordova/ios/actionsheet"]);
} else {
define("actionsheet", ["scripts/actionsheet"]);
}
//requirejs(['http://viblast.com/player/free-version/qy2fdwajo1/viblast.js']);