Coder Social home page Coder Social logo

masterodin / salr-redux Goto Github PK

View Code? Open in Web Editor NEW
17.0 5.0 14.0 3.54 MB

Firefox and Chrome extension adds and extends features and functionality for Somethingawful.com

License: Other

HTML 15.77% CSS 9.17% JavaScript 73.89% TypeScript 1.17%
extension-chrome extension-firefox somethingawful

salr-redux's Introduction

Something Awful Last Read Redux Extension for Chrome and Firefox Quantum

This is a port of the SALR extension for Firefox to Google Chrome and Firefox Quantum. It adds a number of improvements to the Something Awful Forums.

Installation

To install, download the latest version from the Google Chrome Web Store or addons.mozilla.org for Firefox. Updates will be delivered automatically per your browser settings.

Alternatively, this can be added to chrome manually by downloading /extension/ and using the unpack option within the extensions page under Developer Mode. (Not Recommended for casual users, as updates will not be pushed automatically.)

Bug Reporting

If you run into any issues using this extension, please report them in the appropriate SA Thread.

Development

All work on SALR Redux happens in this repository. The master branch will contain the base code for the latest release on the chrome web store. The "dev" branch will generally contain my in-progress work and is as such not recommended for people to use ever. However, if people want to contribute, looking towards that branch might be best. If a critical bug comes out during work on the next dev release, I may just apply the patch directly to the master and then push that to the "dev" branch. All changes are recorded in the Changelog.

License

Copyright (c) 2009-2013 Scott Ferguson
Copyright (c) 2013-2016 Matthew Peveler
All rights reserved.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

  • Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
  • Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
  • Neither the name of the software nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE AUTHORS ''AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

salr-redux's People

Contributors

astral-sa avatar dbjorge avatar dependabot[bot] avatar eckankar avatar loneboco avatar lpmi-13 avatar masterodin avatar nelsonjchen avatar nskillen avatar onoj avatar recycleddan avatar rohaq avatar scottferg avatar sirjoekcb avatar slyons avatar stoatally avatar tubbo avatar wmbest2 avatar xevz avatar zephster avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

salr-redux's Issues

Fix weird styling issues in YOSPOS

Seems like the custom CSS on the YOSPOS forum messes with stuff like the Page Navigator making it look ugly and stuff. Should probably custom CSS the page-navigator better.

Customize hotkeys

Allow people to customize the hotkeys for things. This should not be that hard.

I guess have two lists:

  1. common hotkeys for page navigation
  2. hotkeys for quick-reply specific

Allow modifier independently for both.

This could also be applied to the modifier to mouse gestures.

Display a better message for double posts

Right now it says "Warning! Possible Quote/Edit mixup." on previewing a potential double post. Should say something like "Do you mean to double post?" or something instead.

Ignore multiple bookmark stars

Implement way to ignore more than 1 stars (theoretically all three!) to allow better star usage in bookmark management in combination to SALR.

Page Navigator Blue Wrong

Change the Page Navigator color to use the same color as the forums as that blue got phased out a while ago.

Imgur Upload Broken

Imgur API in the quick reply doesn't work as expected. Currently doesn't do anything.

Improve user notes

Should allow for coloring of user's posts in addition to the actual text.

In addition, should add a place where all of the user notes that have been created can be viewed/edited/etc.

Save settings to cloud

Apparently you can save the settings of an extension to the cloud. This should probably be implemented as that would be useful.

Mozilla addon validation issues

Hello,

Your add-on Something Awful Last Read Redux has been reviewed and one or more of of its versions have been disabled due to critical issues discovered.

Details:
This version did not pass the review because of the following issues:

  1. JQuery 1.* is no longer accepted. Please use JQuery 3.*
    We accept JQuery/JQuery-UI libraries downloaded from 'ajax.googleapis.com', 'jquery.com' or 'jqueryui.com'; and used without any modification (downloaded and not copy pasted). Minified versions are better. (file-name change does not matter)
    I'm sorry, but we cannot accept modified, re-configured or customized libraries.
    Please use non-custom versions of jquery-ui, as well as the stock version of jquery and others, that match the original checksums on the maintainer's website.
    e.g.:
    js/jquery/jquery.js

Fair enough, easy enough. We're moving away from jQuery in general so it's not a huge roadblock.

If we do want to upgrade to jQuery 3.0, we can use jQuery migrate in two steps:

  • 1. Migrate older jQuery code to jQuery 1.12.x, optionally with jquery-migrate v1.4.1. We're already at 1.10.1 so that shouldn't be a big deal at all.
  • 1.5. Do we need to update jQuery-UI too? We have v1.10.3, which is on the allowed list. Do we need to check into cross-compatibilities between jQuery and jQuery UI? Updated it to 1.11.4 locally; when I tried 1.12 it made our edit note dialog look funny so I settled on 1.11.4 for now in the interests of getting stuff out fast.
  • 2. Once that's stable, we can use jquery-migrate v3.0.1 to migrate to jQuery v3.

ref: https://github.com/jquery/jquery-migrate/

  1. Add-on contains duplicate/hidden/unused/unnecessary files or folders. These complicate the review process and may contain sensitive information about the system you created the XPI on. Such files may also create cause for rejection. Please correct your packaging process so that these files aren't included.
    e.g.:
    images/emoticons/createJsonList.py
    js/jquery/colorpicker.old.js

Easy enough. Probably not worth disabling the extension over, though?

  • Probably just move createJsonList out of extension dir if it's build-related
  • colorpicker.old.js isn't referenced by anything and is just a duplicate of colorpicker.js, should be safe to just remove?
  1. Remote resources (eg images, fonts, CSS, etc) can be used for tracking (it will be allowed if the resource is from the same domain as the page the user is on). Please include them in the addon. e.g.:
    settings.html#L5-7, 71, 81, 101, 332, 379

Please fix them and submit again. Thank you.

The settings page uses the site's own CSS to style some of the highlighting preview options. How dare SA be able to "track" SA members who are changing their settings.

Easy enough to move a few of the images used in the preview into the extension, but jeez. Again, this probably wasn't worth disabling the addon over.

  • Stylesheets: already fixed in 5a504c6
  • Images

Please note the following for the next update:

  1. Unsafe assignment to innerHTML
    Due to both security and performance concerns, this may not be set using dynamic values which have not been adequately sanitized. This can lead to security issues or fairly serious performance degradation. e.g:
    js/salr.js - line: 1352, 1362, 1907
  1. This version contains obfuscated, minified, concatenated or otherwise machine-generated code. Please provide the original sources, together with instructions on how to generate the final XPI. Source code must be provided as an archive and uploaded using the source code upload field, which can be done during submission or on the version page in the developer hub.

Please read through the instructions at https://developer.mozilla.org/en-US/Add-ons/Source_Code_Submission.
More Information: https://blog.mozilla.org/addons/2016/04/05/improved-review-time-with-links-to-sources/

Established libraries (eg: JQuery, bootstrap) do not require the inclusion of their sources.
Please use non-custom versions of jquery-ui, as well as the stock version of jquery and others, that match the original checksums on the maintainer's website.

Yeah, I knew about this one and it was on the to-do list. Quick Reply seems to have some minified code from the forums JS - I have the original forums JS in my repo, so I can work on replacing it with the original JS + check what modifications have been made to it in SALR Redux via git blame or so. This is probably the one legitimate complaint because minified code could be doing anything and it's not fair to ask reviewers to try to understand it.

  • Replace modified minified paste handling code with modified original forums JS - fixed in b105562

Version(s) affected and disabled:
2.1.8.12, 2.1.8.13a1, 2.1.8.13a2, 2.1.8.13a3, 2.1.8.13a4, 2.1.8.13a5, 2.1.8.13a6, 2.1.8.13a7, 2.1.8.13a8

Reviewer:
erosman

You can resolve this by addressing the issues raised in the reviewer's notes and uploading a new version at https://addons.mozilla.org/en-US/developers/addon/salr-redux/versions

So we shall.

Explain Hotkeys in settings.html

Right now, there doesn't seem to be an obvious place to see what the hotkeys are in SALR. Might want to add section to settings.html that explains it.

Minimize/Maximize setting sections

Give user ability to minimize/maximize setting sections as needed. This would allow easier setting navigation as more settings (especially ones that would potentially take a lot of room like #15 might).

Migrate local extension storage from localStorage to chrome.storage.local

Motivations:

First, since content scripts can access chrome.storage directly, we can simplify the initial loading of the add-on - we'd no longer have to do an explicit round-trip message from content -> background -> content just to get our settings. Setting saves also wouldn't require posting a message up to the background script.

Next, we can store many settings directly without having to serialize them ourselves. Objects may still need to be serialized.

Further, we can have onChanged listeners for chrome.storage - I remember seeing at least one comment in the code where the author wished they had a change event to simplify something they were trying to do.

Lastly, localStorage is in danger of being cleared by clearing browser history/private browsing/browser space issues. A couple of Firefox users who clear their browsing history on exit have already noted that their SALR settings are being erased. storage.local has a limit of 5MB but, if we need to, this limit can be removed with the unlimitedStorage permission, so we wouldn't be in danger of either hitting the limit or having data erased.

Bonus: "It's asynchronous with bulk read and write operations, and therefore faster than the blocking and serial localStorage API."

Prep work:

Since we'd have to migrate pretty much all of the preferences anyway, now's a good time to discuss any changes in how we name some preferences. For example, I'd like to suggest we rename the preferences so an individual service isn't named in the preference (SOAP/SAARS comes to mind). That way, if such a service goes down, we don't have to change a bunch of references and add a bunch of separate preference-renaming migration logic each time. Instead, we could just alter what the preference does+its text. So for example the aforementioned one would instead reference avatar history lookups.

Another thing to check and perhaps modify in the transition is if some preference names match their current behavior - for example, enableMouseMenu originally seems to have controlled whether the context menu was displayed during gesture navigation, but now controls whether the alt toggle key is used to show the context menu or the gestures - I wouldn't really guess that from the preference name.

Final thoughts:

I'd be happy to work on this eventually after finishing the avatar/user BGs feature, and perhaps after doing some more work to help reduce the number of times we iterate through every post. This issue probably requires a good bit of discussion and looking into some of the settings, so it's more of a medium-to-long-term goal.

References:

https://developer.mozilla.org/en-US/Add-ons/WebExtensions/API/storage
https://developer.chrome.com/extensions/storage

Hide user avatars cleanup

Try and make hiding user avatars better.

Potential settings:

  • Show User Custom Title
    • Show User Avatar
    • Show User Custom Text
    • Show User Gang Tags

These settings should apply to all pages that these show up on (including new reply page).

Display indicator on Quick Reply

When editing or quoting a post, should display a scroll (or something) as the post is loaded (such as on a slow internet connection) so the user knows something is happening and isn't just waiting indefinitely.

Quick Reply Preview Quotations

Since SA started using the "post" field as part of the [quote] tag, it would seem that this has caused the display to be a bit messed up in the "Quick Preview" part of the Quick Reply/Quote/Edit box. Fixing this would be good.

Split up settings

Split up settings (such as "Put Threads with unread posts first") that work in multiple areas of the forum. Allow for user to pick what areas the setting applies to (so for example, only work in usercp.php, but not the forumdisplay.php pages)

Highlight Thread Count Broken

"Highlight thread counts in yellow if you've posted there before" is broken. Not sure if the database functions don't work well or what atm, but on commit 162861f, deved the entries of the table and I got a bunch of null responses back. More testing required to figure out what exactly is wrong. Note: Thread_ID should be being passed correctly.

friend list slowdown

SALR slows down horribly when with friend highlighting on. This should not happen, and it NEEDS to be addressed.

Test all hotkeys

Make sure all hotkeys work. Especially test the one that goes forward/back a page as it might be broken if "Show Three Pages" setting is on?

Hide threads based on icon

what it says in the title. Get a list of all the icons, show them in the settings page, ask users to pick ones not to show. Easy!

Allow offline use of User Notes

Have users select setting for if user notes uses chrome sync or just local. Should potentially help for people that it doesn't work for whatever reason instead of trying to figure out why it doesn't (because it looks like it 100% should).

Fix Quick Reply closing interactions

Currently, when closing the quick reply box, if you have open a live preview or a sidebar, the interactions get a bit screwy (such that if you hit the checkbox again after reopening the quick reply, the live preview will open when checkbox isn't checked and close when it is. Sidebar requires two clicks to open actual sidebar desired as it has to close an already open one?).

Fix this!

Imgur Link broken

quote="Schizophrenic Orb"

This is a forums bug, but it can be easily fixed with SALR probably.

When someone posts an image from imgur, if the image url ends with certain letters (I believe s, l, 
and m at least, there might be others), the forums remove the last letter, breaking the image url.  
It creates a timg (which points to the correct url) and the timg is also a link to the image (with 
a now incorrect url).  When SALR automatically expands timg'd images, it points to the broken 
url instead of the correct timg url.

An example [http://forums.somethingawful.com/showthread.php?action=showpost&postid=424010719&
forumid=167]is here[/url].

Is it possible to make it so SALR notices the discrepancy between the timg and the url, and display 
the correct, non-broken image?

Allow easy copying of settings

Make it so there's a dev page where I can copy/paste someone's settings and have it applied to my copy of SALR. This would help in testing of bugs.

Update jQuery to newest version

Change extension/js/jquery.js to version 1.7.2 or something instead of 1.4.2. This will allow for some features to be fixed as jQuery will no longer throw a security issue within Chrome (and allow me to make sure it it manifest_version: 2 compliant throughout).

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.