Adding `Easy Switch Between Utopian and Steem Posts` to Utopian Moderator Chrome Extension

in #utopian-io6 years ago (edited)

Utopian Moderator & Supervisor

Utopian Moderator & Supervisor is the FIRST chrome extension that is intended to help the Utopian Moderators & Supervisors in moderating work.

New Feature

As promised earlier, I am adding a very useful feature to the version 0.0.2: Allow Easy switch between Utopian and SteemIt posts.

Configuration

Adding a Dropdown menu to allow user select the prefered 'steem' sites i.e. steemit.com or busy.org (more can be added in the future)
image.png

Now, as you are moderating utopian posts, you can easily switch between Utopian to the preferred steem sites by Alt+S short cut. For example, utopian.io -> busy.org and busy.org -> utopian.io

How to do?

In Chrome Extension, you need to inject the scripts to the page, which is a bit tricky. The commits are: here

Add this to manifest.json

  "content_scripts": [{
      "matches": ["<all_urls>"],
      "js":[
          "js/jquery-3.2.1.min.js",
          "js/content.js"
      ],
      "run_at":"document_start"
  }],

The logic code:

$(function() {
    let id;
    let website;

    // load settings 
    chrome.storage.sync.get('utopian_settings', function(data) {
        if (data && data.utopian_settings) {
            let utopian = data.utopian_settings;
            if (utopian["steemit_id"]) {
                id = utopian["steemit_id"].trim();
            }
            if (utopian["steemit_website"]) {
                website = utopian["steemit_website"].trim();
            }
        }
    });

    // use steemit.com if not set
    website = website || "steemit.com";

    // short cut Alt + S to switch between utopian and steemit
    $(document).keydown(function(e) {
        if(e.key.toLowerCase() == "s" && e.altKey) {
            var url = document.location.href;
            if (url.includes("utopian.io")) {               
                document.location.href = url.replace("utopian.io", website);
            } else if (url.includes("steemit.com")) {
                document.location.href = url.replace("steemit.com", "utopian.io");
            } else if (url.includes("busy.org")) {
                document.location.href = url.replace("busy.org", "utopian.io");
            }       
        }
    });
})();

Roadmap

I am adding the following features in the next coming versions:

  1. Show More statistics for a given category.
  2. Show Personal Moderating statistics

Contributing

Github: https://github.com/DoctorLai/utopian-moderator

  1. Fork it!
  2. Create your feature branch: git checkout -b my-new-feature
  3. Commit your changes: git commit -am 'Add some feature'
  4. Push to the branch: git push origin my-new-feature
  5. Submit a pull request.

Install now at Chrome Webstore: https://chrome.google.com/webstore/detail/utopian-moderator-supervi/dcjdbldgiiboblbaconadffdaicicebc



Posted on Utopian.io - Rewarding Open Source Contributors

Sort:  

虽然用不到,友情支持一下,哈哈

Thank you for the contribution. It has been approved.

Please try to put in more work into one contribution.

You can contact us on Discord.
[utopian-moderator]

thank you, will do. :)

Hey @justyy I am @utopian-io. I have just upvoted you!

Achievements

  • WOW WOW WOW People loved what you did here. GREAT JOB!
  • Seems like you contribute quite often. AMAZING!

Community-Driven Witness!

I am the first and only Steem Community-Driven Witness. Participate on Discord. Lets GROW TOGETHER!

mooncryption-utopian-witness-gif

Up-vote this comment to grow my power and help Open Source contributions like this one. Want to chat? Join me on Discord https://discord.gg/Pc8HG9x

Upvoted ☝ Have a great day!

Coin Marketplace

STEEM 0.20
TRX 0.14
JST 0.030
BTC 64294.06
ETH 3427.66
USDT 1.00
SBD 2.59