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

continue jquery removal

This commit is contained in:
Luke Pulverenti 2016-06-14 16:59:30 -04:00
parent c5fa5d10b5
commit c4c34ba314
5 changed files with 117 additions and 29 deletions

View file

@ -190,15 +190,38 @@
infos.push(getTheaterInfo);
}
if (!AppInfo.enableAppLayouts && browserInfo.mobile) {
infos.push(getUpgradeMobileLayoutsInfo);
}
appSettings.set(cacheKey, new Date().getTime());
return infos[getRandomInt(0, 1)]();
return infos[getRandomInt(0, infos.length - 1)]();
});
}
function getCard(img, target) {
function getCard(img, target, shape) {
return '<div class="card backdropCard"><div class="cardBox"><div class="cardScalable"><div class="cardPadder"></div><a class="cardContent" href="' + target + '" target="_blank"><div class="cardImage lazy" data-src="' + img + '"></div></a></div></div></div>';
shape = shape || 'backdropCard';
var html = '<div class="card ' + shape + '"><div class="cardBox"><div class="cardScalable"><div class="cardPadder"></div>';
if (target) {
html += '<a class="cardContent" href="' + target + '" target="_blank">';
} else {
html += '<div class="cardContent">';
}
html += '<div class="cardImage lazy" data-src="' + img + '"></div>';
if (target) {
html += '</a>';
} else {
html += '</div>';
}
html += '</div></div></div>';
return html;
}
function getTheaterInfo() {
@ -225,13 +248,32 @@
html += '<div>';
html += '<h1>Try Emby Premiere<button is="paper-icon-button-light" style="margin-left:1em;" onclick="this.parentNode.parentNode.remove();"><iron-icon icon="close"></iron-icon></button></h1>';
var cardTarget = AppInfo.isNativeApp ? '' : 'https://emby.media/premiere';
var learnMoreText = AppInfo.isNativeApp ? '' : '<a href="https://emby.media/premiere" target="_blank">Learn more</a>';
html += '<p>Design beautiful Cover Art, enjoy free access to Emby apps, and more. ' + learnMoreText + '</p>';
html += '<div class="itemsContainer">';
html += getCard('https://raw.githubusercontent.com/MediaBrowser/Emby.Resources/master/apps/theater1.png', 'https://emby.media/premiere');
html += getCard('https://raw.githubusercontent.com/MediaBrowser/Emby.Resources/master/apps/theater2.png', 'https://emby.media/premiere');
html += getCard('https://raw.githubusercontent.com/MediaBrowser/Emby.Resources/master/apps/theater3.png', 'https://emby.media/premiere');
html += getCard('https://raw.githubusercontent.com/MediaBrowser/Emby.Resources/master/apps/theater1.png', cardTarget);
html += getCard('https://raw.githubusercontent.com/MediaBrowser/Emby.Resources/master/apps/theater2.png', cardTarget);
html += getCard('https://raw.githubusercontent.com/MediaBrowser/Emby.Resources/master/apps/theater3.png', cardTarget);
html += '</div>';
html += '<br/>';
html += '</div>';
return html;
}
function getUpgradeMobileLayoutsInfo() {
var html = '';
html += '<div>';
html += '<h1>Unlock Improved Layouts with Emby Premiere<button is="paper-icon-button-light" style="margin-left:1em;" onclick="this.parentNode.parentNode.remove();"><iron-icon icon="close"></iron-icon></button></h1>';
var cardTarget = AppInfo.isNativeApp ? '' : 'https://emby.media/premiere';
var learnMoreText = AppInfo.isNativeApp ? '' : '<a href="https://emby.media/premiere" target="_blank">Learn more</a>';
html += '<p>Combined horizontal and vertical swiping, better detail layouts, and more. ' + learnMoreText + '</p>';
html += '<div class="itemsContainer">';
html += getCard('https://raw.githubusercontent.com/MediaBrowser/Emby.Resources/master/apps/ms1.png', cardTarget, 'portraitCard');
html += getCard('https://raw.githubusercontent.com/MediaBrowser/Emby.Resources/master/apps/ms2.png', cardTarget, 'portraitCard');
html += '</div>';
html += '<br/>';
html += '</div>';