Pastemark: Don't Repeat Yourself

    Probably, many of us have to regularly type texts of the same type: reports, notifications, and the like. And at some point it starts to tire out a lot. As you probably guessed, in this topic I want to present to the public an owl a solution to this problem.

    Do not repeat yourself

    This problem begs a simple solution: instead of typing text many times, you need to make a template once, and then substitute it every time.
    Pastemark is a simple service for the production of bookmarklets that substitute the prepared text in the field you need. From this, by the way, the only limitation of the field of applicability follows - a web browser.

    How it works?

    In the process of creating a bookmarklet, you will need to ask three things: the name of the future bookmarklet, the text for the substitution, and the way to identify the target form field. I will dwell on the last point in more detail.

    You have three ways to set the target field:
    • By id of the element. The most successful option, because due to the uniqueness of the id on the page, the template will be inserted exactly in the field you need.
    • By field name. This option is slightly worse, because in principle there can be more than one field with the same name. In this case, the text will be inserted into all such fields. However, this does not happen so often, so the option is quite applicable.
    • By click. A backup option in case the site developers managed to make the field well, completely unremarkable. You will have to click on the desired field each time you paste, but this is still better than printing the entire text.

    At first glance, the task setting process seems rather troublesome, and for a person with html who is not familiar and is an insurmountable obstacle at all. But in this case, I have a solution.

    Auto tuning

    I wrote another bookmarklet, proudly titled “Pastemark fast!”, Which helps you get through the entire setup process as quickly as possible. It’s nowhere to use it:
    1. Bookmark it yourself
    2. Go to landing page
    3. Activate bookmarklet
    4. Click on the target field
    5. The Pastemark website opens with pre-selected settings, where you can adjust them
    6. Generate a bookmarklet and add it to your bookmarks

    What is the advantage?

    • Your blanks are always at hand - in bookmarks
    • You can use the Pastemark service regardless of your OS. I even tested it on my iPhone and it worked.
    • Your blanks are always with you, on any device. With the help of bookmark synchronization services like Xmarks, you will get your workpieces at least on your own phone.

    What's under the hood?

    The site itself is made exclusively on HTML, CSS and JavaScript - in principle, it does not need anything server. To simplify life when creating a site, I used the JQuery and Blueprint CSS Framework. Moreover, the curious can freely familiarize themselves with the code of all scripts and make sure that they do not threaten your privacy ;-)

    In my opinion, the bookmarklet generation method used on the site deserves some more attention. Its main advantages are that it allows, firstly, writing code in a convenient form, without wasting effort on reformatting to javascript-URL, as well as parameterizing them. I described this method in detail on my blog .

    Where to go?

    At the moment, Pastemark meets all my needs. I have already fixed all the bugs I noticed myself. Therefore, I want to listen to your wishes and criticism and take it into account as much as I can.

    PS I won’t know what blog to publish this to, so I will rely on your advice.

    UPD I decided to transfer it to the GTD blog. I find nothing more suitable.

    Also popular now: