Quck hack: Add 'memo' field (Source included)
![]() ![]() |
This is a quick hack to add a memo field to each listing. Hopefully you can make it prettier than I can :) First add "makeMemoHandler(ps[i]);" after the line "ps[i].style.display = visible ? 'block' : 'none';". Next, add this code outside of the main functions: function makeMemoHandler(ad_p) {
ad_id = ad_id.replace(".html", ""); //remove trailing .html
function memo_make_edit(e) {
function saveMemo(spanPlace, inputNode) {
|
![]() ![]() |
Thank you, will review and add soon :) |
![]() ![]() |
Great idea but it is too memory consuming and has too many event handlers. Also, there is no garbage collection on the GM_setValue items. What happens when the ad is expired from Craigslist? The now inaccessible memos are useless and will continue to build up and waste memory. This should use GM_listValues() to run through the memos, compare to a list of active ads, and then GM_deleteValue() to remove the stale entries. I'm working on an efficient memo handler for Craigslist and will post a note here when it's available. |
![]() ![]() |
Update: Incorporating CBWhiz's code above, I have now added a memo management tool for viewing/deleting the memo fields. I've uploaded and renamed the script to "Craigslist Manager" here: http://userscripts.org/scripts/show/97793 I still need to reduce the event handlers, but the script seems to work reasonably fast the way it is. If I get around to it, I'll post an update to Craigslist Manager. |

