Adding wiki link for cards.
This commit is contained in:
@@ -500,6 +500,8 @@ var GempLotrDeckBuildingUI = Class.extend({
|
|||||||
this.infoDialog.html("");
|
this.infoDialog.html("");
|
||||||
this.infoDialog.html("<div style='scroll: auto'></div>");
|
this.infoDialog.html("<div style='scroll: auto'></div>");
|
||||||
this.infoDialog.append(createFullCardDiv(card.imageUrl, card.foil, card.horizontal, card.isPack()));
|
this.infoDialog.append(createFullCardDiv(card.imageUrl, card.foil, card.horizontal, card.isPack()));
|
||||||
|
if (!card.isPack())
|
||||||
|
this.infoDialog.append("<div><a href='" + card.getWikiLink() + "' target='_blank'>Wiki</a></div>");
|
||||||
var windowWidth = $(window).width();
|
var windowWidth = $(window).width();
|
||||||
var windowHeight = $(window).height();
|
var windowHeight = $(window).height();
|
||||||
|
|
||||||
|
|||||||
@@ -205,7 +205,7 @@ var Card = Class.extend({
|
|||||||
return false;
|
return false;
|
||||||
},
|
},
|
||||||
|
|
||||||
getUrlByBlueprintId: function(blueprintId) {
|
getUrlByBlueprintId: function(blueprintId, ignoreErrata) {
|
||||||
if (fixedImages[blueprintId] != null)
|
if (fixedImages[blueprintId] != null)
|
||||||
return fixedImages[blueprintId];
|
return fixedImages[blueprintId];
|
||||||
|
|
||||||
@@ -217,7 +217,7 @@ var Card = Class.extend({
|
|||||||
var cardNo = parseInt(blueprintId.substr(separator + 1));
|
var cardNo = parseInt(blueprintId.substr(separator + 1));
|
||||||
|
|
||||||
var errata = this.getErrata(setNo, cardNo);
|
var errata = this.getErrata(setNo, cardNo);
|
||||||
if (errata != null)
|
if (errata != null && (ignoreErrata === undefined || !ignoreErrata))
|
||||||
return errata;
|
return errata;
|
||||||
|
|
||||||
var mainLocation = this.getMainLocation(setNo, cardNo);
|
var mainLocation = this.getMainLocation(setNo, cardNo);
|
||||||
@@ -232,6 +232,11 @@ var Card = Class.extend({
|
|||||||
return mainLocation + "LOTR" + cardStr + (this.isTengwar() ? "T" : "") + ".jpg";
|
return mainLocation + "LOTR" + cardStr + (this.isTengwar() ? "T" : "") + ".jpg";
|
||||||
},
|
},
|
||||||
|
|
||||||
|
getWikiLink: function() {
|
||||||
|
var imageUrl = this.getUrlByBlueprintId(this.blueprintId, true);
|
||||||
|
return imageUrl.substr(0, imageUrl.length - 3) + "html";
|
||||||
|
},
|
||||||
|
|
||||||
formatSetNo: function(setNo) {
|
formatSetNo: function(setNo) {
|
||||||
var setNoStr;
|
var setNoStr;
|
||||||
if (setNo < 10)
|
if (setNo < 10)
|
||||||
|
|||||||
@@ -183,6 +183,8 @@ var GempLotrMerchantUI = Class.extend({
|
|||||||
this.infoDialog.html("");
|
this.infoDialog.html("");
|
||||||
this.infoDialog.html("<div style='scroll: auto'></div>");
|
this.infoDialog.html("<div style='scroll: auto'></div>");
|
||||||
this.infoDialog.append(createFullCardDiv(card.imageUrl, card.foil, card.horizontal, card.isPack()));
|
this.infoDialog.append(createFullCardDiv(card.imageUrl, card.foil, card.horizontal, card.isPack()));
|
||||||
|
if (!card.isPack())
|
||||||
|
this.infoDialog.append("<div><a href='" + card.getWikiLink() + "' target='_blank'>Wiki</a></div>");
|
||||||
var windowWidth = $(window).width();
|
var windowWidth = $(window).width();
|
||||||
var windowHeight = $(window).height();
|
var windowHeight = $(window).height();
|
||||||
|
|
||||||
@@ -296,6 +298,8 @@ var GempLotrMerchantUI = Class.extend({
|
|||||||
this.questionDialog.html("<div style='scroll: auto'></div>");
|
this.questionDialog.html("<div style='scroll: auto'></div>");
|
||||||
var floatCardDiv = $("<div style='float: left;'></div>");
|
var floatCardDiv = $("<div style='float: left;'></div>");
|
||||||
floatCardDiv.append(createFullCardDiv(card.imageUrl, card.foil, card.horizontal, card.isPack()));
|
floatCardDiv.append(createFullCardDiv(card.imageUrl, card.foil, card.horizontal, card.isPack()));
|
||||||
|
if (!card.isPack())
|
||||||
|
floatCardDiv.append("<div><a href='" + card.getWikiLink() + "' target='_blank'>Wiki</a></div>");
|
||||||
this.questionDialog.append(floatCardDiv);
|
this.questionDialog.append(floatCardDiv);
|
||||||
var questionDiv = $("<div id='cardEffects'>" + text + "</div>");
|
var questionDiv = $("<div id='cardEffects'>" + text + "</div>");
|
||||||
questionDiv.append("<br/>");
|
questionDiv.append("<br/>");
|
||||||
|
|||||||
Reference in New Issue
Block a user