-
Notifications
You must be signed in to change notification settings - Fork 24
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Opening this so I can steal your ideas =P #77
base: release
Are you sure you want to change the base?
Conversation
NOTE: I no longer consider "Squadron 42" a package.
`pagesize` now seems to be fixed to `10`
HangarXPLOR.$bulkUI.addClass(HangarXPLOR._feature.Summary); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You removed the BulkXPLOR hooks! :'(
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was awhile ago; I don't remember why; feel free to undo
@@ -14,6 +14,13 @@ Current features include: | |||
* See the melt value of each item in your hangar | |||
* Correct the name of upgraded ships for easier searching | |||
|
|||
TODO:(pv) | |||
* Add note field for each item (so that I can mention specific plans for specific item(s)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Glad I'm not the only one that had this idea
* Add ability to re-order the list on-demand and persist the order | ||
* May be able to just use `$.cookie('HangarXPLOR.Type', value)` type of logic |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also had this idea - I approve
@@ -15,7 +15,7 @@ HangarXPLOR._callbacks = HangarXPLOR._callbacks || {}; | |||
'AOPOA': 'Aopoa', | |||
'ARGO': 'Argo', | |||
'BANU': 'Banu', | |||
'CNOU': 'Consolidated', | |||
'CNOU': 'Consolidated Outland', | |||
'CRSD': 'Crusader', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But it's soooo looooong.
I should probably import this though...
This pull request introduces 1 alert when merging fdd168e into 03fe460 - view on LGTM.com new alerts:
|
HangarXPLOR.GetDownloadItems = function() { | ||
var $target = $(HangarXPLOR._selected.length > 0 ? HangarXPLOR._selected : HangarXPLOR._filtered); | ||
// console.log('GetDownloadItems $target', JSON.stringify($target)); | ||
return $target.map(function() { | ||
var $pledge = this; | ||
var pledge = {}; | ||
pledge.name = $('.js-pledge-name', $pledge).val(); | ||
pledge.id = $('.js-pledge-id', $pledge).val(); | ||
pledge.cost = $('.js-pledge-value', $pledge).val(); | ||
pledge.lti = $('.title:contains(Lifetime Insurance)', $pledge).length > 0; | ||
pledge.date = $('.date-col:first', $pledge).text().replace(/created:\s+/gi, '').trim(); | ||
pledge.warbond = pledge.name.toLowerCase().indexOf('warbond') > -1; | ||
var item = {}; | ||
item.id = $pledge.pledgeId; | ||
item.cost = $pledge.meltValue; | ||
item.lti = $pledge.hasLTI; | ||
item.date = $('.date-col:first', $pledge).text().replace(/created:\s+/gi, '').trim(); | ||
item.warbond = $pledge.isWarbond; | ||
item.giftable = $pledge.isGiftable; | ||
item.pledge = $pledge.displayName; | ||
item.package = $pledge.isPackage ? 1 : 0; | ||
|
||
return $('.kind:contains(Ship)', this).parent().map(function() { | ||
var $ship = this; | ||
var ship = {}; | ||
ship.manufacturer = $('.liner span', $ship).text(); | ||
ship.manufacturer = _manufacturerShortMap[ship.manufacturer] || ship.manufacturer; | ||
ship.name = $('.title', $ship).text(); | ||
ship.name = ship.name.replace(/^\s*(?:Aegis|Anvil|Banu|Drake|Esperia|Kruger|MISC|Origin|RSI|Tumbril|Vanduul|Xi'an)[^a-z0-9]+/gi, ''); | ||
ship.name = ship.name.replace(/^\s*(?:Aegis|Anvil|Banu|Drake|Esperia|Kruger|MISC|Origin|RSI|Tumbril|Vanduul|Xi'an)[^a-z0-9]+/gi, ''); | ||
ship.lti = pledge.lti; | ||
ship.warbond = pledge.warbond; | ||
ship.package_id = pledge.id; | ||
ship.pledge = pledge.name; | ||
ship.pledge_date = pledge.date; | ||
ship.cost = pledge.cost; | ||
return ship; | ||
}).get() | ||
}).sort(function(a, b) { return a.manufacturer == b.manufacturer ? (a.name < b.name ? -2 : 2) : (a.manufacturer < b.manufacturer ? -1 : 1); }).get(); | ||
if (this.isUpgrade) { | ||
// console.log('GetDownloadItems $pledge', JSON.stringify($pledge)); | ||
var parts = /^(.+?) - (.+?)( - .+)? \(\d+\)$/m.exec(item.pledge) | ||
// console.log('GetDownloadItems parts', JSON.stringify(parts)); | ||
item.type = parts[1]; | ||
item.manufacturer = 'N/A'; | ||
item.name = parts[2]; | ||
return item; | ||
} else { | ||
return $('.kind:contains(Ship)', this).parent().map(function() { | ||
var $ship = this; | ||
// console.log('GetDownloadItems $ship', JSON.stringify($ship)); | ||
var ship = Object.assign({}, item); | ||
item.cost = 0; // Don't report cost for remaining ships in this Package/Combo | ||
item.package = 0; // Don't report package for remaining ships in this Package/Combo | ||
ship.type = 'Ship'; | ||
ship.manufacturer = $('.liner span', $ship).text(); | ||
ship.manufacturer = _manufacturerShortMap[ship.manufacturer] || ship.manufacturer; | ||
ship.name = $('.title', $ship).text(); | ||
ship.name = HangarXPLOR.CleanShipName(ship.name); | ||
ship.name = ship.name.replace(/^\s*(?:Aegis|Anvil|Banu|Drake|Esperia|Kruger|MISC|Origin|RSI|Tumbril|Vanduul|Xi'an)[^a-z0-9]+/gi, ''); | ||
return ship; | ||
}) | ||
// Sort any inner ships by manufacturer and then name | ||
.sort(function(a, b) { | ||
if (a.manufacturer < b.manufacturer) { | ||
return -1 | ||
} | ||
if (a.manufacturer > b.manufacturer) { | ||
return 1 | ||
} | ||
if (a.name < b.name) { | ||
return -1 | ||
} | ||
if (a.name > b.name) { | ||
return 1 | ||
} | ||
return 0; | ||
}) | ||
.get() | ||
} | ||
}) | ||
.get(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd have to run locally to see the impact of this I think
return [ | ||
'"' + item.pledge + '"', | ||
'"' + item.type + '"', | ||
'"' + item.manufacturer + '"', | ||
'"' + item.name + '"', | ||
item.id, | ||
item.cost, | ||
'"' + item.date + '"', | ||
item.lti, | ||
item.warbond, | ||
item.package, | ||
item.giftable | ||
] | ||
.join(',') | ||
}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Much easier to read
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Even nicer if I had used template literals
function OverrideMarginsAndPaddings() { | ||
var temp; | ||
|
||
temp = $('#contentbody'); | ||
temp.css('padding-bottom', '15px'); | ||
|
||
temp = $('#contentbody > div'); | ||
temp.css('padding-left', '15px'); | ||
temp.css('padding-right', '15px'); | ||
temp.css('max-width', 'none'); | ||
|
||
temp = $('#billing > div.content.clearfix > div.sidenav'); | ||
temp.css('width', '330px'); | ||
|
||
temp = $('#billing > div.content.clearfix > div.inner-content'); | ||
temp.css('padding-left', '330px'); | ||
|
||
temp = $('#billing > div.content.clearfix > div.sidenav > ul > li.active > a > span.bg'); | ||
temp.css('width', '275px'); | ||
|
||
temp = $('#billing'); | ||
temp.css('padding', '15px'); | ||
temp.css('padding-top', '30px'); | ||
|
||
temp = $('#billing > div.content.clearfix'); | ||
temp.css('padding-top', '15px'); | ||
temp.css('padding-bottom', '15px'); | ||
|
||
temp = $('#billing .inner-content .top > .separator'); | ||
temp.css('margin-top', '10px'); | ||
temp.css('margin-bottom', '10px'); | ||
|
||
temp = $('#billing .content h3'); | ||
temp.css('margin-top', '10px'); | ||
temp.css('margin-bottom', '10px'); | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oooh - I'll have to peek at these improvements...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It might be undesirable, but it makes much better use of my 21:9 monitor
{ Value: 'All', Text: 'All Types', Class: 'first', Selected: HangarXPLOR._type == 'All' }, | ||
{ Value: 'HasShip', Text: 'All Ships', Selected: HangarXPLOR._type == 'HasShip' }, | ||
{ Value: 'HasShipOrIsUpgradeOrIsAddOn', Text: 'All Ships & Upgrades & Add Ons', Selected: HangarXPLOR._type == 'HasShipOrIsUpgradeOrIsAddOn' }, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I had these at one stage, but the list got very long...
I'm thinking about making it configurable similar to the ribbon bars in office.
HangarXPLOR._type = value; HangarXPLOR.SaveSettings(); | ||
HangarXPLOR.Render(); | ||
HangarXPLOR.RefreshPager(); | ||
/* HangarXPLOR.ResetBulkUI(); */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I should clean this up
HangarXPLOR._sort = value; HangarXPLOR.SaveSettings(); | ||
HangarXPLOR.Render(); | ||
HangarXPLOR.RefreshPager(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also needs this cleaning
pledgeName = pledgeName.replace(/Discount Pack/i, 'Pack'); | ||
pledgeName = pledgeName.replace(/Tumbril Cyclone LTI Presale/i, 'Tumbril Cyclone - LTI'); | ||
pledgeName = pledgeName.replace(/^(Aegis Dynamics Idris Corvette|Aegis Dynamics Retaliator Heavy Bomber|Anvil Gladiator Bomber|Banu Merchantman|Captured Vanduul Fighter|Drake Interplanetary Caterpillar|Idris Corvette|MISC Freelancer|MISC Starfarer Tanker|ORIGIN M50 Interceptor|RSI Aurora LN|RSI Aurora LX|RSI Constellation|ORIGIN 350R Racer|Xi'An Scout - +Khartu)( - LTI)?$/i, 'Standalone Ship - $1$2'); | ||
pledgeName = pledgeName.replace(/^(Digital )?(Advanced Hunter|Arbiter|Bounty Hunter|Colonel|Cutlass|Freelancer|Mercenary|Pirate|Rear Admiral|Scout|Specter|Weekend Warrior)( - LTI)?$/i, 'Package - $1$2$3'); | ||
pledgeName = pledgeName.replace(" ", " ").trim(); | ||
// TODO: Add pre-processing for Reliant Variants Here if required | ||
|
||
// Package - Mustang Omega : AMD Edition | ||
// 1 Year Imperator Reward - 15% Coupon: SSSSSSSSSS | ||
// Greycat PTV | ||
|
||
return pledgeName; | ||
} | ||
|
||
HangarXPLOR.CleanShipName = function(shipName) | ||
{ | ||
shipName = shipName.replace('Origin 600i Exploration Module', 'Origin 600i'); | ||
shipName = shipName.replace('M50 Interceptor', 'M50'); | ||
shipName = shipName.replace('M50', 'M50 Interceptor'); | ||
shipName = shipName.replace('Hornet F7C', 'F7C Hornet'); | ||
return shipName; | ||
} | ||
|
||
HangarXPLOR.CleanComboShips = function(comboShips, debug) | ||
{ | ||
comboShips.each(function (index, value) { | ||
if (debug) { | ||
console.log('CleanComboShips comboShips[' + index + ']=', value); | ||
} | ||
var comboShip = $(this) | ||
if (debug) { | ||
console.log('CleanComboShips comboShip BEFORE', comboShip); | ||
} | ||
var comboShipName = comboShip.text(); | ||
if (debug) { | ||
console.log('CleanComboShips comboShipName BEFORE', comboShipName); | ||
} | ||
comboShipName = HangarXPLOR.CleanComboShipName(comboShipName); | ||
if (debug) { | ||
console.log('CleanComboShips comboShipName AFTER', comboShipName); | ||
} | ||
comboShip[0].textContent = comboShipName; | ||
if (debug) { | ||
console.log('CleanComboShips comboShip AFTER', comboShip); | ||
} | ||
}) | ||
} | ||
|
||
HangarXPLOR.CleanComboShipName = function(comboShipName) | ||
{ | ||
comboShipName = comboShipName.replace('Tumbril Cyclone-TR', 'Tumbril Cyclone TR'); | ||
return comboShipName; | ||
} | ||
|
||
// Apply a pre-defined filter to a list of items | ||
HangarXPLOR.ProcessItem = function() | ||
{ | ||
// Pre-cache raw markup | ||
if (HangarXPLOR._fromCache != true) HangarXPLOR._raw.push(this.outerHTML); | ||
|
||
// Preprocess Tumbril Cyclone | ||
$('.without-images .title:contains(Tumbril Cyclone)', this).each(function() { | ||
var $tumbril = $(this); | ||
var name = $tumbril.text().trim(); | ||
if (name == "Tumbril Cyclone") name = "Tumbril Cyclone-RN"; | ||
|
||
if (name != "Tumbril Cyclone-AA" && | ||
name != "Tumbril Cyclone-TR" && | ||
name != "Tumbril Cyclone-RN" && | ||
name != "Tumbril Cyclone-RC") return; | ||
|
||
var $block = $tumbril.closest('.content-block1'); | ||
var $images = $('.with-images', $block); | ||
if ($images.length == 0) { | ||
$block.prepend($('<div />').addClass('also-contains').text("Also Contains")); | ||
$block.prepend($images = $('<div />').addClass('with-images')); | ||
} | ||
|
||
var cyclone = { | ||
"Tumbril Cyclone-RN": "/media/ao2p3pw2e7k94r/subscribers_vault_thumbnail/Tumbril-Buggy-Piece-01-Showroom-V009.jpg", | ||
"Tumbril Cyclone-TR": "/media/cmq3rwpo5ghpvr/subscribers_vault_thumbnail/Tumbril-Buggy-Piece-04-Desert-V012.jpg", | ||
"Tumbril Cyclone-RC": "/media/w3vw5498xb25mr/subscribers_vault_thumbnail/Tumbril-Buggy-Piece-05-Rocky-Beach-Sport-Fin.jpg", | ||
"Tumbril Cyclone-AA": "/media/n6535dpiwv2pgr/subscribers_vault_thumbnail/Tumbril-Buggy-Piece-06-Lagoon-V011.jpg", | ||
}; | ||
|
||
var $item = $('<div />').addClass('item').append( | ||
$('<div />').addClass('image').css({ 'background-image': 'url("' + cyclone[name] + '")' }), | ||
$('<div />').addClass('text').append( | ||
$('<div />').addClass('title').text(name), | ||
$('<div />').addClass('kind').text("Ship"), | ||
$('<div />').addClass('liner').append("Tumbril (", $('<span />').text("TMBL"), ")") | ||
) | ||
); | ||
$images.prepend($item); | ||
$tumbril.parent().remove(); | ||
// Preprocessing Begin | ||
// Tumbril Cyclone | ||
$('.without-images .title:contains(Tumbril Cyclone)', this).each(function(index, value) { | ||
//console.log('ProcessItem PreProcessTumbrilCyclone index=' + index + ', value=', value); | ||
HangarXPLOR.PreProcessTumbrilCyclone($(this)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not a bad idea to convert different chunks of the cleaning code into discrete functions
I don' understand what you mean in the subject description of this issue, @peter-dolkens. Obviously @paulpv does but even after his input I don't understand it better. Do you mean we should submit progress in forked branches here, or just ideas/wishlists? Please explain. |
@Petosiris I think @peter-dolkens just wants a branch in his repo where he can work out of and pick and choose which of my changes he might want to take or improve upon. |
@paulpv - I see, you got yourself a private project issue thread! ;) |
@Petosiris HangarXPLOR is actually getting a major refactor/rewrite. @paulpv had considerable changes in his fork, which I thought were worth reviewing while I work on https://github.com/dolkensp/HangarXPLOR/compare/v2 Am working together with a few other developers in the SC community to consolidate on a more unified naming scheme that will allow for greater interoperability between our different platforms (e.g. FleetView) |
Sounds good, @peter-dolkens! |
This pull request introduces 1 alert when merging b7e445a into d9c5c6c - view on LGTM.com new alerts:
|
This pull request introduces 1 alert when merging a72cca8 into d9c5c6c - view on LGTM.com new alerts:
|
@peter-dolkens You may also want to check out https://github.com/paulpv/HangarXPLOR/tree/buyback where I am finally getting around to experimenting with mutating the Buy Back Pledges items. It definitely is not thought out very far, but so far it functions to do what I mostly want it to do; hide pledges that I know I will never want to buyback. The current version does not persist any settings in this area, so if you refresh the page you start over. But it is a start. |
50c5844
to
c393ed9
Compare
@peter-dolkens With IAE 2952 here, I opened this up again and see you have made nice progress on your new I don't mind keeping my fork's Is this PR useful anymore or should it be close? And, to be blunt, I am nowadays mostly using Thank you for all of your hard work! My in-game name(s) are o7 |
Wow, that looks pretty neat.
Wasn't quite what I was going for when I built HangarXPLOR (I figured people would trust a full app less), but by making it into a full fledged app, it's opened up far more options which weren't realistic when it was purely enhancing your hangar.
Looks really neat!
Peter Dolkens
… On 18 Nov 2022, at 18:41, Paul Peavyhouse ***@***.***> wrote:
CCU Game
|
No description provided.