Skip to content

Commit

Permalink
Revert back to bundled oracle.json
Browse files Browse the repository at this point in the history
Turns out fetching is too complicated.

In addition, add missing sets to prices.json and rework dailymtg
injection.
  • Loading branch information
dmorgan81 committed Sep 29, 2014
1 parent 3ae927b commit 60eac2b
Show file tree
Hide file tree
Showing 7 changed files with 23 additions and 18 deletions.
7 changes: 2 additions & 5 deletions manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"name" : "Scry",
"description" : "Rollover popups for Magic: the Gathering sites",
"homepage_url" : "http://spitemare.github.io/scry/",
"version" : "3.6.7",
"version" : "3.8.0",
"icons" : {
"16" : "img/icon-16.png",
"48" : "img/icon-48.png",
Expand Down Expand Up @@ -80,10 +80,7 @@
},
{
"matches" : [
"*://*.wizards.com/magic/magazine/*",
"*://*.wizards.com/Magic/Magazine/*",
"*://*.wizards.com/magic/Magazine/*",
"*://*.wizards.com/Magic/magazine/*"
"*://magic.wizards.com/en/articles/*"
],
"css" : [
"css/scry.css"
Expand Down
2 changes: 1 addition & 1 deletion oracle.json

Large diffs are not rendered by default.

5 changes: 5 additions & 0 deletions prices.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
"M12" : "Magic 2012 (M12)",
"M13" : "Magic 2013 (M13)",
"M14" : "Magic 2014 (M14)",
"M15" : "Magic 2015 (M15)",
"ARN" : "Arabian Nights",
"ATQ" : "Antiquities",
"LEG" : "Legends",
Expand Down Expand Up @@ -80,6 +81,7 @@
"THS" : "Theros",
"BNG" : "Born of the Gods",
"JOU" : "Journey Into Nyx",
"KTK" : "Khans of Tarkir",
"CMD" : "Commander",
"C13" : "Commander 2013",
"MMA" : "Modern Masters",
Expand All @@ -101,12 +103,15 @@
"DDJ" : "Duel Decks: Izzet vs. Golgari",
"DDK" : "Duel Decks: Sorin vs. Tibalt",
"DDL" : "Duel Decks: Heroes vs. Monsters",
"DDM" : "Duel Decks: Jace vs Vraska",
"DDN" : "Duel Decks: Speed vs Cunning",
"DRB" : "From the Vault: Dragons",
"V09" : "From the Vault: Exiled",
"V10" : "From the Vault: Relics",
"V11" : "From the Vault: Legends",
"V12" : "From the Vault: Realms",
"V13" : "From the Vault: Twenty",
"V14" : "From the Vault: Annihilation",
"H09" : "Premium Deck Series: Slivers",
"PD2" : "Premium Deck Series: Fire and Lightning",
"PD3" : "Premium Deck Series: Graveborn",
Expand Down
2 changes: 1 addition & 1 deletion src/oracle.coffee
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
splitRegex = /(.*?)\s?\/\/?\s?(.*)/
dbVersion = 10
dbVersion = 12

getQueryName = (s) ->
return s.replace(/Æ/gi, 'AE').replace(/[^\s\w]/gi, '').toUpperCase()
Expand Down
2 changes: 1 addition & 1 deletion src/prices.coffee
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
databaseVersion = 5
databaseVersion = 8
partnerKey = 'TEST'
pricesUrl = (name, set) -> "http://partner.tcgplayer.com/x/phl.asmx/p?pk=#{partnerKey}&p=#{name}&s=#{set}"
vendorUrl = (name, set) -> "http://partner.tcgplayer.com/x/pv.asmx/p?pk=#{partnerKey}&v=8&p=#{name}&s=#{set}"
Expand Down
2 changes: 1 addition & 1 deletion src/scry.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ oracle = (query) ->
query.type = 'oracle'
chrome.runtime.sendMessage query, (card) ->
if (card) then dfd.resolve card
else dfd reject
else dfd.reject
).promise()

show = (e) ->
Expand Down
21 changes: 12 additions & 9 deletions src/site/dailymtg.coffee
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
$('#content').scry({
query : ->
return $(this).attr('keyvalue').replace /_|\[/g, (m) -> return if m == '_' then ' ' else "'"
selector : 'a.nodec'
}).find('a.nodec').removeAttr 'onmouseover'

$('#content').scry {
query : -> return $(this).find('img.magic-card').attr('alt')
selector : 'div.revealer'
$('.content').scry {
selector : 'a.autocard-link'
}

observer = new MutationObserver (records) ->
for record in records
do (record) =>
return unless record.addedNodes
$(record.addedNodes).filter('.qtip').remove()

observer.observe $('body')[0], { childList : true }


0 comments on commit 60eac2b

Please sign in to comment.