Feature - Implemented Make stationary buttons stationary

Veracity

Developer
Staff member
Revision 13217 refactors the creation of the buttons.

Active fight - the skill buttons (and attack and script) as before
Active choice - only "auto"
Noncombat, completed fight, end of choice chain - only "again"

I love it.
 

Darzil

Developer
sorry for late return

I think the best solution is loading latest jQuery from the CDN (as we are now) and encourage script writers to use it, if they really don't want to I think it's their responsibility to ensure what they load doesn't break existing functionality.

However, am I right in thinking, from reading the last few posts that using 1.9.1 from the CDN breaks kol (not kolmafia) functionality?

if this is the case I suggest we leave KoL loading 1.3.1 and load 1.9.1 ourselves (maybe on every page, from the CDN, the overhead is neglegible) but we load it using noConflict() making it available through something like "kmjq = jQuery.noConflict( true );"

The clever bit is that by loading in this manner we return the global variables to 1.3.1 meaning anything KoL wrote will still work and anyone using "$" selectors will be using 1.3.1, we then encourage scriptwriters, and in any kolmafia generated code to use kmjq("selector") to use the current CDN loaded version.

It makes sense in my head, but i'm afraid explaining things isn't my strong point, the example here (at the bottom of the page) http://api.jquery.com/jQuery.noConflict/ will probably make it clearer, as we have seen in the past, my java isn't up to much, but will try to help as much as possible!

Or it other words, add $.noConflict(); to the last line of stationarybuttons.js to reset things back to as if 1.9.1 was never loaded, and as it was loaded immediately before, everything should work?

r13225 does this, and fixes right click menus without stopping the autosizing working.
 

xKiv

Active member
I actually tried just removing the 1.9.1 inclusion yesterday (from StationaryButtonsDecorator), and everything (autosizing + contextmenus) worked anyway for me.
 

Darzil

Developer
I actually tried just removing the 1.9.1 inclusion yesterday (from StationaryButtonsDecorator), and everything (autosizing + contextmenus) worked anyway for me.

That works in Firefox and Chrome, but not Internet Explorer, so leaving the fix as it is.
 

Veracity

Developer
Staff member
So is this Implemented now? It works great for me - especially in conjunction with my recent changes to not show skill buttons for choices or after the battle is over, which removes all the extra lines of buttons. Is there anybody for whom this does NOT work for - or for whom there is a bad side effect, as xKiv reported earlier?
 

lostcalpolydude

Developer
Staff member
As a user of KoL's CAB, nothing changed for me. I'm sure that was the intent, so this is just to say that nothing broke for that setup.
 

Veracity

Developer
Staff member
The new code (or the old code, for that matter) is never executed if you use KoL's CAB, so that is not surprising.
 

Bale

Minion
I'm gonna mark it implemented. If anyone thinks that there is more to do or improve, then they can open a new feature request to suggest how to make it better.
 

xKiv

Active member
That works in Firefox and Chrome, but not Internet Explorer, so leaving the fix as it is.

I will have to keep a local change then, since your version seems to refuse to work for me.
Or maybe I didn't get my caches cleared enough, even though I cleared firefox cache before *and* after telling mafia to "cache clear"? I should check again.
 

Veracity

Developer
Staff member
I will have to keep a local change then, since your version seems to refuse to work for me.
Or maybe I didn't get my caches cleared enough, even though I cleared firefox cache before *and* after telling mafia to "cache clear"? I should check again.
I did this with Firefox 25.0.1 (and 75 MB of cached stuff).

- I enabled KoLmafia stationary buttons
- I enabled KoL right-click context menu for autosell, closet, and use
- I got into a fight
--> KoLmafia stationary buttons were present. SUCCESS
--> the creature dropped something
- I right-clicked on the item
--> I saw Firefox's default right-click menu. FAILURE

- I disabled KoLmafia stationary buttons
- I got into a fight
--> KoLmafia stationary buttons were NOT present
--> the creature dropped something
- I right-clicked on the item
--> I saw KoL's right-click menu. SUCCESS

I closed the window and cleared Firefox's cache (25KB left, for some reason)

- I enabled KoLmafia stationary buttons
- I got into a fight
--> KoLmafia stationary buttons were present. SUCCESS
--> the creature dropped something
- I right-clicked on the item
--> I saw KoL's right-click menu. SUCCESS

KoLmafia's cache clear is irrelevent to this.
The browser's cache clear is everything.
 

xKiv

Active member
Started with ff 25.0.0 (which has been running for a week now, due to clickingbad.nullism.com).
Updated to current revision of mafia.
Went into fight with stationary buttons enabled (because that's the default) and kol-menu enabled (autosell, closet, use, DC, pulverize).
- stationary buttons are present (and resize properly)
- right clicking dropped items shows firefox menu (fail)

cleared cache, repeated, same result

didn't test with stationary buttons disabled

quit firefox, updated to 25.0.1, restarted, opened new relay browser, same result

rebuilt mafia with clean, restarted, still same result

(also, I started getting extra scrollbars)

http://127.0.0.1:60080/stationarybuttons.1.js is still returning content without the .noConflict() call.

debug trace on:
Code:
1385156053282: From Browser: GET /stationarybuttons.1.js HTTP/1.1
1385156053288: To Browser: HTTP/1.1 200 OK: /stationarybuttons.1.js

...
ok, how the f did those old stationarybutton.1.js and stationrybutton.1.css get to my .kolmafia/relay directory? (dated november 18)
deleted from there (without stopping mafia) ... http://127.0.0.1:60080/stationarybuttons.1.js now returns nothing, so I will try again after restarting mafia (on of these days I will let one of these "magia" typos slip through ... nothing like accidental truth)

New build, new restart, relay/stationarybutton.1* reappeared, but in the correct version, and relay browser is a success (except it still doesn't have keyboard focus, because that was stolen by the first button, which is in the stationary div, and therefore can't scroll _content without clickin or much tabbing)
 
Just a note for people who may be getting the same problem:

I've experienced the symptoms that the right click menu didn't show up anymore on dropped items, and also that the KoL keyboard shortcuts (1, 2, 3, etc.) to select choice adventure options stopped working. Also, the automatic refresh of adventures such as the Dreadsylvanian Skill Machine didn't work anymore either.

Using different (relay) browsers on different computers with cleared cache didn't help.

stationarybuttons.1.js in ~/.kolmafia/relay was dated November 19, 2013, 8:26 and 189 bytes. Replacing it by src/relay/stationarybuttons.1.js from KoLmafia's source (November 21, 18:14, 205 bytes) and then clearing the browser cache made the right-click menu and the keyboard shortcuts work again. I finished my Dread skills in the meantime, but I'd assume the auto-refresh of the Machine adventure works again as well.
 
Top