Closed studgeek closed 10 years ago
I added a couple more commits: The main one Updates the answer parsing code to handle the new question style (that has no their_answer). Fixes answerText, score, weight. I also refactored some duplicated code.
One thing that needs to be fixed with my code is I am using unscoped keys for localStorage. I had not realized it was shared with page for content scripts. It probably needs to be prefixed.
Yes, all stored data should be properties on localStorage.okcp. I also use, .okcpRecentProfiles, or .okcpSettings (which I actually haven't been using)
On Tue, Jun 17, 2014 at 5:46 PM, David Rees notifications@github.com wrote:
One thing that needs to be fixed with my code is I am using unscoped keys for localStorage. I had not realized it was shared with page for content scripts. It probably needs to be prefixed.
— Reply to this email directly or view it on GitHub https://github.com/benjaffe/chrome-okc-plugin/pull/89#issuecomment-46383974 .
Ben Jaffe • Developer, Instructor, GeekSpeak, KUSP 510.545.2365 • benjaffe.me • Github https://github.com/benjaffe/ •
@studgeek , for adding keys, check out the util I wrote for it -- https://github.com/benjaffe/chrome-okc-plugin/blob/master/plugin/storage.js
_OKCP.storage('messages') // getter
_OKCP.storage('messages', myVar) // setter
Agreed on everything, good suggestions (and consistency is always important). Will also move it to using its own on/off flag rather than devMode as you suggested elsewhere. I will post comment once I have applied the suggested changes.
Sweet, thanks David -- you rock!
On Fri, Jun 20, 2014 at 7:05 PM, David Rees notifications@github.com wrote:
Agreed on everything, good suggestions (and consistency is always important). Will also move it to using its own on/off flag rather than devMode as you suggested elsewhere. I will post comment once I have applied the suggested changes.
— Reply to this email directly or view it on GitHub https://github.com/benjaffe/chrome-okc-plugin/pull/89#issuecomment-46741850 .
Ben Jaffe • Developer, Instructor, GeekSpeak, KUSP 510.545.2365 • benjaffe.me • Github https://github.com/benjaffe/ •
Ok, I think I have all the suggested changes in there. Plus a few more tweaks. FYI, I rebased it to clean up commit history a bit.
@studgeek , Can you update the wiki to describe how users suggest questions? I already have a page you can modify. Also, I'm having trouble getting the buttons to show up, even though;
localStorage.okcpDevMode === "true" //true
I should see the buttons on the questions pages right? I'm not seeing them either on other users' questions pages, or my own. Any ideas?
Sorry I didn't see your comment until now.
I have updated the wiki with the updated instructions.
And suggest mode is working for me in the master branch. Once I run localStorage.setItem("okcpSuggestMode", true)
I see the Suggest Question buttons:
And the JSON at the bottom
Actually, I found a small bug. The Clear Questions button was not visible.
Pull request #104 makes the Clear Questions button visible. I updated the wiki with that info.
Cool! Yeah, I was just missing localStorage.okcpSuggestQuestions . Awesome, thank you! It'll be published within an hour.
The original suggestQuestions code generates a "weight" array, but I don't see it used in the questions files. Is weight no longer used and should I take it out of suggestQuestions?
It's definitely used for some questions. I didn't integrate it fully in suggest questions because I figured it'd be confusing to most users. I was manually adding the weight when adding the question into the plugin. Sorry for the quick response... On mobile and on the go!
Sent from my phone, so excuse the brevity. On Jan 18, 2015 1:25 PM, "David Rees" notifications@github.com wrote:
The original suggestQuestions code generates a "weight" array, but I don't see it used in the questions files. Is weight no longer used and should I take it out of suggestQuestions?
— Reply to this email directly or view it on GitHub https://github.com/benjaffe/chrome-okc-plugin/pull/89#issuecomment-70426770 .
First rough draft at making suggestions persistent (suggestion #88). Its rough and needs cleanup, but shows the idea.
It makes the following changes:
Work still to do: