Anole 1.2.0 ― Chrome Productivity Extension Updated With Lorem Ipsum Generator

in #utopian-io5 years ago (edited)

Anole is an open source productivity extension for Google Chrome and compatible browsers. The central idea of Anole is to make it easier to copy and generate specially formatted text. As a developer this is something I have to do frequently.

For example, I often need to convert task-names-in-a-web-task-manager to kebab-case for naming of git branches by convention. In my own coding I've found Anole to be a real time saver. Before creating Anole I spent precious time here and there visiting different websites for different formatting tasks outside my web based IDE.

I needed one website/tool for formatting Title Start Case, another for snake_case and so on. Even if I could have gone to a single tool for each different situation this was a distraction to have to leave the browser tab in which I was writing code or creating a post.

All this time, distraction, and context switching added up to sink several minutes of time daily. Anole is a simple tool for accessing all such tranformations in one place, without leaving what you're working on.

Repository

https://github.com/tdreid/anole

New in Version 1.2.0

anole-options-menu-image

The latest addition to Anole is a built in Lorem ipsum text generator. Lorem ipsum refers to dummy text used as a placeholder when doing technical work in order to account for the placement of text that is not available at design time.

Lorem ipsum has been a typesetting standard practice since the 16th century. And wide use by designers, developers, and typesetters continues today. Before adding this to Anole I spent time out of every day browsing in a separate tab to https://www.lipsum.com/ generating text and pasting it back. Anole now handles this without leaving the tab.

As with Anole's other features you are able to decide whether to include the Lorem ipsum text generator in the browser context menu.

In addition, since different situations call for different size blocks of dummy text, you can decide how much text is generated and whether to specify this as number of words or characters.

anole-screenshot-5.png

Here's an example generated using the settings shown.

Lorem ipsum dolor sit amet, consectetur adipiscing elit ut aliquam. 
Purus sit amet luctus venenatis.

When the Generate Lorem ipsum context menu is selected the text is immediately placed on the clipboard and can pasted into any editable location―even in another application apart from the browser.

The Code

All of the changes related to the new Lorem ipsum feature in Anole 1.2.0 are organized into a single pull request:

Add lorem ipsum generator Pull Request #20.

The crux of the change involved adding the new fieldset to the extension's options menu so users can control the text generator.


           <fieldset>
                <legend>Dummy  Text</legend>
                <label>
                    <input type="checkbox" id="Generate Lorem ipsum" value="Generate Lorem ipsum">
                    Generate Lorem ipsum
                </label>
                <label>
                    <input type="number" id="dummy-text-size" value="445" min="1" max="5000">
                    Size
                </label>
                <label>
                    <select id="dummy-text-unit">
                        <option value="w">Words</option>
                        <option value="c">Characters</option>
                    </select>
                    Unit
                </label>

And this next JavaScript code actually generates the dummy text. I used fast-lorem-ipsum for this. But I wasn't fully satisfied with library's default punctuation. I decided to randomize the use of commas and periods for a more likely appearance. This in turn required a little extra work to ensure sentences were capitalized.


      clip.value = loremText(dt.size, dt.unit)
        .replace(/,\s/gm, c => (random() === 0 ? ', ' : '. '))
        .split('. ')
        .map(s => capitalize(s.trim()))
        .join('. ');

GitHub Account

https://github.com/tdreid
@tdre on the Steem Blockchain

Sort:  

Although I probably won't have a need for an extension like this myself, I still think it could be a very useful extension for others (evidently true from your own experience). I really love how programmers are always looking for small ways to save time, haha.

As for the code, there's really not much to say since there wasn't that much added in this update, and what was added looks good to me. So, since I'm curious, I'll leave you with a question instead: do you have any further plans for Anole?


Your contribution has been evaluated according to Utopian policies and guidelines, as well as a predefined set of questions pertaining to the category.

To view those questions and the relevant answers related to your post, click here.


Need help? Chat with us on Discord.

[utopian-moderator]

Thank you for your review, @amosbastian! Keep up the good work!

Hi @tdre!

Your post was upvoted by @steem-ua, new Steem dApp, using UserAuthority for algorithmic post curation!
Your post is eligible for our upvote, thanks to our collaboration with @utopian-io!
Feel free to join our @steem-ua Discord server

Hey, @tdre!

Thanks for contributing on Utopian.
We’re already looking forward to your next contribution!

Get higher incentives and support Utopian.io!
Simply set @utopian.pay as a 5% (or higher) payout beneficiary on your contribution post (via SteemPlus or Steeditor).

Want to chat? Join us on Discord https://discord.gg/h52nFrV.

Vote for Utopian Witness!

Congratulations @tdre! You have completed the following achievement on the Steem blockchain and have been rewarded with new badge(s) :

You received more than 1000 as payout for your posts. Your next target is to reach a total payout of 2000

Click here to view your Board
If you no longer want to receive notifications, reply to this comment with the word STOP

Vote for @Steemitboard as a witness and get one more award and increased upvotes!

Coin Marketplace

STEEM 0.35
TRX 0.12
JST 0.040
BTC 70887.21
ETH 3581.98
USDT 1.00
SBD 4.75