JavaScript in plugins

April 13th, 2009 by HTML-Kit Support      Tags: HTML-Kit Tools       Views: 11915
Support Home     Next: Tools update 20090506.....     Previous: Tools update 20090411
VN:F [1.7.3_972]
Rating: 3.8/5 (13 votes cast)
 

If you code in JavaScript, you can use your JavaScript skills in HTML-Kit Tools plugins to improve the way you use Tools.

Getting Started

Make sure that you’re using HTML-Kit Tools 20090411+.

First plugin in JavaScript

Here are the quick steps:

  1. Select "File > Insert > Add New Snippet" from HTML-Kit Tools main menu.
  2. Enter "My first JavaScript plugin" (or other title) in the "Title" field, and select "JavaScript" for the "Plugin Language."
  3. Type the following JavaScript code in to the "Snippet" field and click "OK" to close the snippet dialog.
     
    var CurrTime = new Date();
    HKit.Write(  "Hello, world! It's "+ CurrTime.toString() );

To test your new snippet plugin, create a new document and select "File > Insert > My first JavaScript plugin" from the main menu.

Caret Action in JavaScript

Here’s how to manipulate selected text with a JavaScript plugin:

  1. Right click inside a document and select "Extra > Edit Caret Actions."
  2. Click "New" to create a new Caret Action.
  3. In "Short name" field enter "jscaretaction1″ (without quotes). Enter "My First JavaScript Caret Action" in "Title" field. Click "OK" to create the new Caret Action.
  4. Paste the following code inside newly created action:
     
    #@begin-text "default" [plang="js"]
    var sSelText = HKit.GetSelText();
    HKit.Write( sSelText.toUpperCase() );
    #@end-text "default"
  5. Click "OK" to save changes.

To test the Caret Action, select some text in the current document and right click while pressing Ctrl key down. Select "My First JavaScript Caret Action" from the menu.

Was this article helpful?
This did not answer my questionThis answered my question (+7 rating, 15 votes)
Loading ... Loading ...
Share this on:
  • Twitter
  • Digg
  • StumbleUpon
  • Facebook
  • MySpace
  • del.icio.us
  • Sphinn
  • LinkedIn
  • Google Bookmarks
  • Live
  • Yahoo! Buzz
  • email
  • Print
 

12 Responses to “JavaScript in plugins”

  1. Leslie says:

    rackmil@catsup.rifles” rel=”nofollow”>.…

    thanks!!…

  2. roger says:

    gavins@algeria.tosca” rel=”nofollow”>.…

    спс за инфу!!…

  3. Joel says:

    miscalculation@riding.glacier” rel=”nofollow”>.…

    thanks for information!!…

  4. Warren says:

    tatler@extraneousness.campaigned” rel=”nofollow”>.…

    tnx for info!…

  5. dean says:

    islandia@laxative.nouvelle” rel=”nofollow”>.…

    ñïàñèáî!…

  6. Cecil says:

    pretence@greet.bayanihan” rel=”nofollow”>.…

    thanks!…

  7. Jared says:

    shiny@tacitly.portago” rel=”nofollow”>.…

    thanks….

  8. walter says:

    towns@lanza.avocados” rel=”nofollow”>.…

    ñïñ çà èíôó!!…

  9. Eduardo says:

    fabricius@digest.deposited” rel=”nofollow”>.…

    áëàãîäàðåí!…

  10. Ronald says:

    pabor@zu.vernier” rel=”nofollow”>.…

    ñïàñèáî çà èíôó!…

  11. wayne says:

    striped@perturbed.brashness” rel=”nofollow”>.…

    thanks!!…

  12. Travis says:

    lift@pigeons.bryce” rel=”nofollow”>.…

    ñïñ çà èíôó….

 

© 2009 HTML-Kit.com. All Rights Reserved.  |  Privacy Statement   
HTML design aid