0.0.1616773350 • Published 3 years ago

launchlet v0.0.1616773350

Weekly downloads
166
License
-
Repository
github
Last release
3 years ago

Launchlet package

The Launchlet package can be added to your own project as a module to quickly present a 'Jump to' functionality.

Setup

https://unpkg.com/launchlet/__compiled/launchlet.js https://unpkg.com/launchlet/__compiled/launchlet.css

npm install launchlet
<link rel="stylesheet" href="https://launchlet.dev/launchlet.css" />
<script src="https://launchlet.dev/launchlet.js"></script>

Usage

Commit Mode

Launchlet.LCHSingletonCreate({
  LCHOptionRecipes: [{
    LCHRecipeName: 'Alfa',
    LCHRecipeCallback () {
      alert('Alfa');
    },
  }],
  LCHOptionMode: Launchlet.LCHModeCommit,
});

Preview Mode

Launchlet.LCHSingletonCreate({
  LCHOptionRecipes: [{
    LCHRecipeName: 'Bravo',
    LCHRecipeCallback () {
      console.log('Bravo');
    },
  }, {
    LCHRecipeName: 'Charlie',
    LCHRecipeCallback () {
      console.log('Charlie');
    },
  }],
  LCHOptionMode: Launchlet.LCHModePreview,
});

Pipe Mode

Launchlet.LCHSingletonCreate({
  LCHOptionRecipes: [{
    LCHRecipeName: 'Delta',
    LCHRecipeCallback () {
      alert('Delta');
    },
  }],
  LCHOptionMode: Launchlet.LCHModePipe,
});

If you have keyboard shortcuts on the page

Ignore keydown events if Launchlet is active:

window.addEventListener('keydown', function (event) {
  if (Launchlet.LCHSingletonExists()) {
    return;
  }

  // ...
});

API

Launchlet.LCHSingletonCreate

Creates a singleton instance of the launcher. Destroys existing instance if there is one. Takes an optional configuration object.

Options

  • LCHOptionRecipes (array) – []

    • Recipe objects
  • LCHOptionMode (identifier) – Launchlet.LCHModeCommit

    • Launchlet.LCHModeCommit
    • Launchlet.LCHModePreview
    • Launchlet.LCHModePipe
  • LCHOptionIncludePageRecipes (boolean) – false

  • LCHOptionRunAutomaticRecipes (boolean) – false

  • LCHOptionCompletionHandler (function) – undefined

  • LCHOptionLanguage (string) – 'en'

    • 'en'
    • 'fr'
    • 'es'
    • 'pt'

Launchlet.LCHSingletonExists

Returns true if there is a singleton instance of the launcher.

Launchlet.LCHSingletonDestroy

Destroys a singleton instance of the launcher.

Launchlet.LCHTasksRun

Runs each Task that matches the current URL unless LCHRecipeIsExcluded returns true.

0.0.1616773305

3 years ago

0.0.1616773350

3 years ago

0.0.1610555331

3 years ago

0.0.1610555398

3 years ago

0.0.1603033033

4 years ago

0.0.1603026678

4 years ago

0.0.1603026619

4 years ago

0.0.1594739754

4 years ago

0.0.1594739352

4 years ago

0.0.1594739253

4 years ago

0.0.1593353842

4 years ago

0.0.1593353957

4 years ago

0.0.1593350485

4 years ago

0.0.1571583499

5 years ago

0.0.1571583436

5 years ago

0.0.1570635053

5 years ago

0.0.1570634975

5 years ago

0.0.1569015017

5 years ago

0.0.1567345698

5 years ago

0.0.1566866699

5 years ago

0.0.1566865456

5 years ago

0.0.1566864490

5 years ago

0.0.1566864389

5 years ago

0.0.1566830707

5 years ago

0.0.1566829923

5 years ago

0.0.1565801343

5 years ago

0.0.1565221330

5 years ago

0.0.1564777414

5 years ago

0.0.1564423086

5 years ago

0.0.1564415989

5 years ago

0.0.1564415673

5 years ago

0.0.1564331349

5 years ago

0.0.1564330903

5 years ago

0.0.1564330421

5 years ago

0.0.1564329887

5 years ago

0.0.1564254543

5 years ago

0.0.1564241620

5 years ago

0.0.1564238114

5 years ago

0.0.1564237940

5 years ago

0.0.1564237508

5 years ago

0.0.1564237450

5 years ago

0.0.1564236814

5 years ago

0.0.1564236263

5 years ago