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

update text

This commit is contained in:
Luke Pulverenti 2016-05-12 15:21:43 -04:00
parent 3af73d4fde
commit 98b0114719
47 changed files with 166 additions and 1977 deletions

View file

@ -75,7 +75,10 @@
html += "<div>";
html += "<span class='storeItemReviewText'>";
html += new Date(review.timestamp).toDateString();
html += " " + RatingHelpers.getStoreRatingHtml(review.rating, review.id, review.name, true);
if (review.rating) {
html += '<iron-icon icon="star" style="color:#666;height:20px;width:20px;min-height:20px;min-width:20px;margin-right:.25em;"></iron-icon>';
html += review.rating.toFixed(1);
}
html += " " + review.title;
html += "</span>";
if (review.review) {
@ -133,8 +136,12 @@
RegistrationServices.renderPluginInfo(page, pkg, pluginSecurityInfo);
//Ratings and Reviews
var ratingHtml = RatingHelpers.getStoreRatingHtml(pkg.avgRating, pkg.id, pkg.name);
ratingHtml += "<span class='storeReviewCount'>";
var ratingHtml = '';
if (pkg.avgRating) {
ratingHtml += '<iron-icon icon="star" style="color:#666;height:20px;width:20px;min-height:20px;min-width:20px;margin-right:.25em;"></iron-icon>';
ratingHtml += pkg.avgRating.toFixed(1);
}
ratingHtml += "<span>";
ratingHtml += " " + Globalize.translate('ValueReviewCount').replace('{0}', pkg.totalRatings);
ratingHtml += "</span>";

View file

@ -212,28 +212,24 @@
function loadHomeTab(page, tabContent) {
if (libraryBrowser.needsRefresh(tabContent)) {
if (window.ApiClient) {
var userId = Dashboard.getCurrentUserId();
Dashboard.showLoadingMsg();
if (window.ApiClient) {
var userId = Dashboard.getCurrentUserId();
Dashboard.showLoadingMsg();
getDisplayPreferences('home', userId).then(function (result) {
getDisplayPreferences('home', userId).then(function (result) {
Dashboard.getCurrentUser().then(function (user) {
Dashboard.getCurrentUser().then(function (user) {
loadSections(tabContent, user, result).then(function () {
if (!AppInfo.isNativeApp) {
showWelcomeIfNeeded(page, result);
}
Dashboard.hideLoadingMsg();
libraryBrowser.setLastRefreshed(tabContent);
});
loadSections(tabContent, user, result).then(function () {
if (!AppInfo.isNativeApp) {
showWelcomeIfNeeded(page, result);
}
Dashboard.hideLoadingMsg();
});
});
}
});
}
}

View file

@ -1319,7 +1319,7 @@
IncludeItemTypes: "MusicVideo",
Recursive: true,
Fields: "DateCreated,SyncInfo,CanDelete",
AlbumNames: item.Name
Albums: item.Name
}).then(function (result) {
if (result.Items.length) {

View file

@ -217,7 +217,6 @@
bubbles: true
}));
libraryBrowser.setLastRefreshed(view);
Dashboard.hideLoadingMsg();
});
}

View file

@ -146,44 +146,6 @@
});
},
needsRefresh: function (elem) {
var last = parseInt(elem.getAttribute('data-lastrefresh') || '0');
if (!last) {
return true;
}
//if (NavHelper.isBack()) {
// console.log('Not refreshing data because IsBack=true');
// return false;
//}
var now = new Date().getTime();
var cacheDuration;
if (AppInfo.isNativeApp) {
cacheDuration = 300000;
} else if (browserInfo.ipad || browserInfo.iphone || browserInfo.android) {
cacheDuration = 10000;
} else {
cacheDuration = 30000;
}
if ((now - last) < cacheDuration) {
console.log('Not refreshing data due to age');
return false;
}
return true;
},
setLastRefreshed: function (elem) {
elem.setAttribute('data-lastrefresh', new Date().getTime());
elem.classList.add('hasrefreshtime');
},
allowSwipe: function (target) {
function allowSwipeOn(elem) {

View file

@ -794,6 +794,10 @@
var btnCast = context.querySelector('.btnCast');
if (!btnCast) {
return;
}
var info = MediaController.getPlayerInfo();
if (info.isLocalPlayer) {

View file

@ -111,16 +111,12 @@
renderChannels(page, result);
Dashboard.hideLoadingMsg();
LibraryBrowser.setLastRefreshed(page);
});
}
window.LiveTvPage.renderChannelsTab = function (page, tabContent) {
if (LibraryBrowser.needsRefresh(tabContent)) {
reloadItems(tabContent);
}
reloadItems(tabContent);
};
});

View file

@ -108,16 +108,12 @@
require(['paper-fab', 'paper-item-body', 'paper-icon-item'], function () {
renderTimers(page, result.Items);
});
LibraryBrowser.setLastRefreshed(page);
});
}
window.LiveTvPage.renderSeriesTimersTab = function (page, tabContent) {
if (LibraryBrowser.needsRefresh(tabContent)) {
reload(tabContent);
}
reload(tabContent);
};
});

View file

@ -37,7 +37,6 @@
}).then(function (result) {
renderItems(page, result.Items, 'activeProgramItems', 'play');
libraryBrowser.setLastRefreshed(page);
Dashboard.hideLoadingMsg();
});
}
@ -137,9 +136,7 @@
function renderSuggestedTab(page, tabContent) {
if (libraryBrowser.needsRefresh(tabContent)) {
reload(tabContent);
}
reload(tabContent);
}
function loadTab(page, index) {

View file

@ -245,8 +245,6 @@
LibraryBrowser.saveQueryValues(getSavedQueryKey(context), query);
LibraryBrowser.setLastRefreshed(context);
Dashboard.hideLoadingMsg();
});
}

View file

@ -127,7 +127,6 @@
});
LibraryBrowser.saveQueryValues(getSavedQueryKey(page), query);
LibraryBrowser.setLastRefreshed(page);
Dashboard.hideLoadingMsg();
});
}
@ -184,9 +183,7 @@
window.MusicPage.renderAlbumArtistsTab = function (page, tabContent) {
if (LibraryBrowser.needsRefresh(tabContent)) {
reloadItems(tabContent);
}
reloadItems(tabContent);
};
});

View file

@ -180,7 +180,6 @@
});
LibraryBrowser.saveQueryValues(getSavedQueryKey(page), query);
LibraryBrowser.setLastRefreshed(page);
Dashboard.hideLoadingMsg();
});
}
@ -245,9 +244,7 @@
window.MusicPage.renderAlbumsTab = function (page, tabContent) {
if (LibraryBrowser.needsRefresh(tabContent)) {
reloadItems(tabContent);
}
reloadItems(tabContent);
};
});

View file

@ -127,7 +127,6 @@
});
LibraryBrowser.saveQueryValues(getSavedQueryKey(page), query);
LibraryBrowser.setLastRefreshed(page);
Dashboard.hideLoadingMsg();
});
}
@ -184,9 +183,7 @@
window.MusicPage.renderArtistsTab = function (page, tabContent) {
if (LibraryBrowser.needsRefresh(tabContent)) {
reloadItems(tabContent);
}
reloadItems(tabContent);
};
});

View file

@ -91,7 +91,6 @@
});
LibraryBrowser.saveQueryValues(getSavedQueryKey(), query);
LibraryBrowser.setLastRefreshed(page);
Dashboard.hideLoadingMsg();
});
}
@ -102,9 +101,7 @@
window.MusicPage.renderFoldersTab = function (page, tabContent) {
if (LibraryBrowser.needsRefresh(tabContent)) {
reloadItems(tabContent);
}
reloadItems(tabContent);
};
});

View file

@ -125,9 +125,7 @@
window.MusicPage.renderGenresTab = function (page, tabContent) {
if (LibraryBrowser.needsRefresh(tabContent)) {
reloadItems(tabContent);
}
reloadItems(tabContent);
};
});

View file

@ -49,8 +49,6 @@
ImageLoader.lazyChildren(elem);
Dashboard.hideLoadingMsg();
libraryBrowser.setLastRefreshed(page);
});
}
@ -203,19 +201,17 @@
var parentId = LibraryMenu.getTopParentId();
if (libraryBrowser.needsRefresh(tabContent)) {
console.log('loadSuggestionsTab');
loadLatest(tabContent, parentId);
loadPlaylists(tabContent, parentId);
loadRecentlyPlayed(tabContent, parentId);
loadFrequentlyPlayed(tabContent, parentId);
console.log('loadSuggestionsTab');
loadLatest(tabContent, parentId);
loadPlaylists(tabContent, parentId);
loadRecentlyPlayed(tabContent, parentId);
loadFrequentlyPlayed(tabContent, parentId);
require(['components/favoriteitems'], function (favoriteItems) {
require(['components/favoriteitems'], function (favoriteItems) {
favoriteItems.render(tabContent, Dashboard.getCurrentUserId(), parentId, ['favoriteArtists', 'favoriteAlbums', 'favoriteSongs']);
favoriteItems.render(tabContent, Dashboard.getCurrentUserId(), parentId, ['favoriteArtists', 'favoriteAlbums', 'favoriteSongs']);
});
}
});
}
function loadTab(page, index) {

View file

@ -35,9 +35,7 @@
});
}
function populateList(options) {
requirejs(['scripts/ratingdialog'], function () {
populateListInternal(options);
});
populateListInternal(options);
}
function populateListInternal(options) {
@ -207,13 +205,18 @@
html += "</div>";
if (!plugin.isExternal) {
html += "<div class='cardText packageReviewText'>";
html += plugin.price > 0 ? "$" + plugin.price.toFixed(2) : Globalize.translate('LabelFree');
html += RatingHelpers.getStoreRatingHtml(plugin.avgRating, plugin.id, plugin.name, true);
html += "<div class='cardText' style='display:flex;align-items:center;'>";
html += "<span class='storeReviewCount'>";
html += " " + Globalize.translate('LabelNumberReviews').replace("{0}", plugin.totalRatings);
html += "</span>";
if (plugin.avgRating) {
html += '<iron-icon icon="star" style="color:#666;height:20px;width:20px;min-height:20px;min-width:20px;margin-right:.25em;"></iron-icon>';
html += plugin.avgRating.toFixed(1);
}
if (plugin.totalRatings) {
html += "<div style='margin-left:.5em;'>";
html += " " + Globalize.translate('LabelNumberReviews').replace("{0}", plugin.totalRatings);
}
html += "</div>";
html += "</div>";
}

View file

@ -109,30 +109,6 @@
});
}
});
},
getStoreRatingHtml: function (rating, id, name, noLinks) {
var html = "<div style='margin-left: 5px; margin-right: 5px; display: inline-block; vertical-align:middle;'>";
if (!rating) rating = 0;
for (var i = 1; i <= 5; i++) {
var title = noLinks ? rating + " stars" : "Rate " + i + (i > 1 ? " stars" : " star");
html += noLinks ? "" : "<a href='#' data-id=" + id + " data-name='" + name + "' data-rating=" + i + " onclick='RatingHelpers.ratePackage(this);return false;' >";
if (rating <= i - 1) {
html += "<div class='storeStarRating emptyStarRating' title='" + title + "'></div>";
} else if (rating < i) {
html += "<div class='storeStarRating halfStarRating' title='" + title + "'></div>";
} else {
html += "<div class='storeStarRating' title='" + title + "'></div>";
}
html += noLinks ? "" : "</a>";
}
html += "</div>";
return html;
}
};

View file

@ -161,8 +161,6 @@
query.StartIndex -= query.Limit;
reloadItems(parentItem);
});
libraryBrowser.setLastRefreshed(view);
Dashboard.hideLoadingMsg();
});
}
@ -174,13 +172,11 @@
ApiClient.getItem(Dashboard.getCurrentUserId(), params.parentId).then(function (parent) {
LibraryMenu.setTitle(parent.Name);
if (libraryBrowser.needsRefresh(view)) {
reloadItems(parent);
}
reloadItems(parent);
});
}
else if (libraryBrowser.needsRefresh(view)) {
else {
reloadItems();
}
});

View file

@ -1797,7 +1797,7 @@ var AppInfo = {};
if (navigator.webkitPersistentStorage) {
paths.imageFetcher = embyWebComponentsBowerPath + "/images/persistentimagefetcher";
//paths.imageFetcher = embyWebComponentsBowerPath + "/images/basicimagefetcher";
paths.imageFetcher = embyWebComponentsBowerPath + "/images/basicimagefetcher";
} else if (Dashboard.isRunningInCordova()) {
paths.imageFetcher = 'cordova/imagestore';
} else {
@ -1926,8 +1926,6 @@ var AppInfo = {};
define("jstree", [bowerPath + "/jstree/dist/jstree", "css!thirdparty/jstree/themes/default/style.min.css"]);
define('jqm', ['thirdparty/jquerymobile-1.4.5/jquery.mobile.custom.js']);
define("jqmbase", ['css!thirdparty/jquerymobile-1.4.5/jquery.mobile.custom.theme.css']);
define("jqmicons", ['jqmbase', 'css!thirdparty/jquerymobile-1.4.5/jquery.mobile.custom.icons.css']);
define("jqmtable", ['jqmbase', "thirdparty/jquerymobile-1.4.5/jqm.table", 'css!thirdparty/jquerymobile-1.4.5/jqm.table.css']);
@ -2266,12 +2264,31 @@ var AppInfo = {};
window.Globalize = globalize;
loadCoreDictionary(globalize).then(onGlobalizeInit);
Promise.all([loadCoreDictionary(globalize), loadSharedComponentsDictionary(globalize)]).then(onGlobalizeInit);
});
});
});
}
function loadSharedComponentsDictionary(globalize) {
var baseUrl = 'bower_components/emby-webcomponents/strings/';
var languages = ['en-US'];
var translations = languages.map(function (i) {
return {
lang: i,
path: baseUrl + i + '.json'
};
});
globalize.loadStrings({
name: 'sharedcomponents',
translations: translations
});
}
function loadCoreDictionary(globalize) {
var baseUrl = 'strings/';

View file

@ -160,9 +160,7 @@
window.MusicPage.renderSongsTab = function (page, tabContent) {
if (LibraryBrowser.needsRefresh(tabContent)) {
reloadItems(tabContent);
}
reloadItems(tabContent);
};
});