Large

Simplepedia

By Grant Stavely Last update Jul 16, 2010 — Installed 21,600 times.

My revised version

in
Subscribe to My revised version 10 posts, 2 voices



auscompgeek User
OperaWindows

I've posted a revised version of Simplepedia on pastebin. Nothing exciting but will help Greasekit and Opera users.

http://aucg.pastebin.com/cUeU2cHb

Changes:
- Enclosed all of Simplepedia in an unnamed function
- Now doesn't execute on Google
- Now doesn't execute GM_getValue() or GM_setValue() if the site isn't a wiki

The following versions are BETA versions, they have NOT been tested.
1.1 has been tested on Opera, and works.
1.0: http://aucg.pastebin.com/3m9tgimF

Changes:
- Automatically detect non-Gecko browsers and act accordingly
- Attempt GM_getValue() and GM_setValue() before checking for wikis only on Gecko browsers
- Store prefs in an object
- Removed extraneous whitespace in CSS
- Squashed a few pref bugs
- Add new prefs: newColor (new article links), stubColor (stub article links)
- Other various changes which I can't remember

1.1: http://aucg.pastebin.com/g6n4nSKC

Changes:
- Split the version number and compare each individually, instead of
stripping dots out of the version in the update check
- Embed the favicon into the script instead of fetching it from a server

 
Grant Stavely Script's Author
SafariMacintosh

Too cool. Smart rearrangement too. Given the include http://* settings, any reduction in execution is a major bonus.

 
Grant Stavely Script's Author
SafariMacintosh

Where were you seeing it run on google?

 
auscompgeek User
FirefoxWindows

Once, I saw it run on Google where Wikipedia had a search result quite a while ago... don't think it happens any more. Execute would have been a better word... Changing that now. :-)

 
auscompgeek User
FirefoxWindows

Just looking over the code again, I see that the favicon is being fetched from your server. It would probably be better if the icon was base64 encoded and put directly in the script. What? You don't have a base64 encoder? Here's one: http://www.opinionatedgeek.com/dotnet/tools/Bas...

 
Grant Stavely Script's Author
SafariMacintosh

I need to quit tweaking the next version and release it - already have base64'd a better version of the icon in it.

        // Add a new favicon if it is wikipedia
        if (url.match(/http:\/\/?(\w*\.|)wikipedia\.org\//i)) {
                var favicon = document.createElement('link');
                favicon.setAttribute('type', 'image/x-icon');
                favicon.setAttribute('rel', 'shortcut icon');
                favicon.setAttribute('href', 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAALpJREFUeNrEU1ENhTAMHDjAwiw8C7PwLGABLWhAAlhAwpAwJAyaXJdbs7z3wQdNmjVlbe96o8s5uyfWu4f2fgOHHUQJbx/p04xcpJxHTtxLrSLYcH7ocqAib3IHvDTYfxRxXgcslkIFDVQkTjhnXFeqodTSO+A9KP+J9uCpaRnOKiwEM1DuQPHX0K0oKE+GHY0aiVA1EYgS5+2DUUYnDv8QiK20zLGhfbK19iVujbhoXskH617/Gy8BBgDHv1uI+O2cEwAAAABJRU5ErkJggg%3D%3D');
                var head = document.getElementsByTagName('head')[0];
                head.appendChild(favicon);
        }

If I set up a github repository, could we use that to collaborate?

 
Grant Stavely Script's Author
SafariMacintosh

It's also only a matter of futzing with photoshop to include base64 representations of the alphabet, so that we can apply the first letter of the parent domain to any site. Fismapedia would get an F, and so on.

Or we could make base64 representations of the major languages offered by wikipedia - ~30 should cover most users at first, and offer that as the favicon.

 
auscompgeek User
FirefoxWindows

Yes, please set up a github repository. :)

Err, isn't that favicon the same as the one on your server, or did you use optipng on that?

Hmm... could we make the Simplepedia style selectable in the View -> Page Style menu, but selected by default? I wonder... but of course, that would take a bit of work...

 
auscompgeek User
MozillaWindows

Looks like my rearrangement influenced Grant: http://grantstavely.com/simplepedia/devpedia.us...

Umm... you couldn't use a different function name for "addStyle(section,useCSS)"?

I recommend you use my version for now, who knows what bugs Grant could accidentally add to the development version....

 
Grant Stavely Script's Author
SafariMacintosh

Yup, the dev version is a mess right now, avoid it.

School and work are both crazy right now and I haven't had time to get bak to this project.

Cross
Presentational HTML allowed.
Use <code> for inline code and <pre> for code blocks. Use &lt; and &gt; for literal < and >.
We help break paragraphs and link your links.
or cancel