kanji koohii FORUM
Help! Greasemonkey ate my "learned" button! - Printable Version

+- kanji koohii FORUM (http://forum.koohii.com)
+-- Forum: Learning Japanese (http://forum.koohii.com/forum-4.html)
+--- Forum: General discussion (http://forum.koohii.com/forum-8.html)
+--- Thread: Help! Greasemonkey ate my "learned" button! (/thread-572.html)



Help! Greasemonkey ate my "learned" button! - Hyland1 - 2007-06-04

I've been using the greasemonkey scripts (Copy Story, Links, Change Font, Line breaks, Change Keyword) since they first came out without any problem. Well, change font never worked on my mac, but that I can deal with. Just now, when I went to the study section, my learned button was gone! I guessed the problem was greasemonkey (random guess、なんとなく)and when I shut off the monkey and reloaded, sure enough the learned button was back. And of course, the button was gone again as soon as reloaded greasemonkey. As I am changing all of my cards to Japanese, I can't really study here without the greasemonkey scripts. Any help greatly appreciated.


Help! Greasemonkey ate my "learned" button! - ファブリス - 2007-06-04

woelpad will probably update the Study area scripts soon.

Sorry for the trouble. I had to change the structure of the page a bit in the last update.
For woelpad's info: I moved the "Learned" button inside the white frame so that when the user clicks to edit the story, the button temporarily disappears. So it shouldn't be possible to have both "Update" and "Learned" appearing at the same time.


Help! Greasemonkey ate my "learned" button! - Kieron - 2007-06-04

I think you just need to disable Line Breaks for now. I have all of the other ones you mention running, and the Learned button is right where it belongs.


Help! Greasemonkey ate my "learned" button! - Hyland1 - 2007-06-04

Hey. I took Kieron's advice and disabled line breaks. When I popped over to the study section all my words had reverted to English, ie no substitute keywords. I checked in the greasemonkey settings and substitute keywords was gone, I have no idea why. I recognize human error is the likely culprit, but I would say with 95% certainty that I never touched it, its too important to me. I panicked and went to download the script again. Result? Error: already installed. Again, thanks for all the help so far, anymore help also appreciated.


Help! Greasemonkey ate my "learned" button! - Terhorst - 2007-06-04

Hyland1 Wrote:Hey. I took Kieron's advice and disabled line breaks. When I popped over to the study section all my words had reverted to English, ie no substitute keywords. I checked in the greasemonkey settings and substitute keywords was gone, I have no idea why. [...] I panicked and went to download the script again. Result? Error: already installed.
I've had this problem before.

This is a bug in the latest GreaseMonkey. When you uninstall a script, the script immediately before it will also be uninstalled (in this case, it sounds like your substitute keywords script was the victim!). Unfortunately, the script file will still exist on disk, blocking you from installing it again (which is why you got that error).

Here's how I fixed it (I'm assuming you're working on Windows; if not, let me know):

Open the file explorer and go to:
C:\Documents and Settings\

In that folder, you will see the user name you use to log into the machine. If there are many and you are not sure which one is yours, you may have to try looking in more than one. I'll use mine in this example (i.e. Daniel Terhorst).

Change directories into that folder.
(we are now at C:\Documents and Settings\Daniel Terhorst)

Inside is another folder that we're interested in (Application Data), but it's normally hidden. One way to get around this is to add the following to the end of the location in the location bar and press Enter: \Application Data
(The more advanced way is to modify your folder's settings to display hidden folders. If you need help with that, I can walk you through it.)

(we are now at C:\Documents and Settings\Daniel Terhorst\Application Data)

Go to: Mozilla, then Firefox, then Profiles
(we are now at C:\Documents and Settings\Daniel Terhorst\Application Data\Mozilla\Firefox\Profiles\)

You will see one or more folders with random names. If you only see one, great =) If not, you may have to look in more than one. The one you want will probably have .default on the end.

Change directories into that folder (in my case, 45b0bvur.default)
(we are now at C:\Documents and Settings\Daniel Terhorst\Application Data\Mozilla\Firefox\Profiles\45b0bvur.default)

Look in the gm_scripts directory
(we are now at C:\Documents and Settings\Daniel Terhorst\Application Data\Mozilla\Firefox\Profiles\45b0bvur.default\gm_scripts\)

I think the file you are looking for is called kanjikoohiisubstitutekeywords.user.js. Just delete it (or rename it to add a ~ or something random at the end), then try installing the script like you usually do.

Just let me know if you have any questions =)

-- Daniel


Help! Greasemonkey ate my "learned" button! - Hyland1 - 2007-06-04

Daniel-
Thank you for taking the time to reply. I am in the office so I can't make an attempt to fix the problem right now, but I will as soon as I get home and truly appreciate your help. One thing, I am on a mac. How will that change the process?
Thanks again- Ryan


Help! Greasemonkey ate my "learned" button! - Terhorst - 2007-06-04

I don't have a Mac, but Google tells me it might be down in ~/Library/Application Support/Firefox/Profiles

If that exists, you can skip down to the line that starts with, "You will see one or more folders with random names."

Please let me know if that helps =D

-- Daniel

(My Linux friends can try looking down in ~/.mozilla/firefox/ or similar)


Help! Greasemonkey ate my "learned" button! - Hyland1 - 2007-06-05

Kieron and Daniel-
It worked! Thank you both, you saved me quite a bit of anxiety and hassle. If your ever in Nagoya first beer is on me.


Help! Greasemonkey ate my "learned" button! - woelpad - 2007-06-05

The fix is simple enough, but I don't have the latest version of the Line breaks script. It's on Ricardo's site, which seems to be temporarily unavailable. Ricardo, when you read this, simply replace
Code:
document.getElementById('storyview')
with
Code:
document.getElementById('sv-textarea')
I'll copy it through to userscripts.org the moment I can get to your script.

Hyland1, there's a difference between disabling and uninstalling a script. You could have saved yourself some trouble if you had simply unchecked the Enable checkbox. But then we wouldn't have heard about Daniel's workaround either.

Note that your data is not stored inside your script, but in Firefox's prefs.js file, as was already described here, which BTW describes an alternative way to get to the Firefox data folder. Your data will still be there after uninstalling a script (or reinstalling it), unless you also selected the checkbox next to the Uninstall button. If you want a backup, it's this prefs.js file you need to copy to a safe place. Caveat: Don't open the original prefs.js in an editor or lock it in any other way while Firefox is running.

Next up: Adapt the Clear-Restore script, because these buttons don't line up properly with the Learned button.


Help! Greasemonkey ate my "learned" button! - Terhorst - 2007-06-05

Hyland1 Wrote:Kieron and Daniel-
It worked! Thank you both, you saved me quite a bit of anxiety and hassle. If your ever in Nagoya first beer is on me.
Great! Good to hear ^_^

-- Daniel


Help! Greasemonkey ate my "learned" button! - woelpad - 2007-06-07

I updated the Line Breaks script and put it on userscripts.org, but totally messed up when first downloading Ricardo's script and trying to delete the old script, probably due to the bug Daniel mentioned. If you already have the script, it's probably safer to directly edit the file as described in my previous post. Open the 'Manage your scripts' panel, select this script, push the Edit button, choose an editor if needed, apply the code change and save the file. Or navigate to the gm_scripts folder as Daniel explained and edit the file from there.


Help! Greasemonkey ate my "learned" button! - Ricardo - 2007-06-09

woelpad Wrote:The fix is simple enough, but I don't have the latest version of the Line breaks script. It's on Ricardo's site, which seems to be temporarily unavailable. Ricardo, when you read this, simply replace
Code:
document.getElementById('storyview')
with
Code:
document.getElementById('sv-textarea')
Done! Thanks for the heads-up! :-)
P.S.: did the same with the "Copy Story" script, now both are working fine.
P.P.S.: hmm... "Copy Story" isn't inserting the symbols for bold/italics (*/#) in my new installation (Linux, Firefox 1.5.0.12, Greasemonkey 0.7.20070607.0)


Help! Greasemonkey ate my "learned" button! - woelpad - 2007-06-13

Another script affected by the storyview reorg is Add Story Links. Same fix as with Line Breaks.

Copy Story didn't need this particular fix, but Fabrice also changed the tag names for bold and italic to em and strong, hence the disappearance of the *'s and #'s. Fixed. If you want to do it by hand, replace
Code:
case 'i':
[...]
case 'b':
with
Code:
case 'em':
[...]
case 'strong':
Note: Order sometimes matters. In particular, if you download Line Breaks after Add Story Links, no links will appear inside the story box. Luckily you can change the order of the scripts easily in Greasemonkey's manage panel, simply by drag and drop.