marshung/js-lib

Javascript extension library

Installs: 29

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 1

Forks: 0

Open Issues: 2

Language:JavaScript

Type:js-lib

0.2.2 2019-03-16 16:36 UTC

This package is auto-updated.

Last update: 2024-10-20 02:14:10 UTC


README

Mars's Javascript Library Packages

Latest Stable Version Total Downloads Latest Unstable Version License

Outline

Installation

Composer Install

Download and Copy

Manually download the specified js library and copy it into the path

General installation

$ composer require marshung/js-lib

Custom path installation

  1. Edit the local composer.json, and add following code:
{
    "require": {
        "oomphinc/composer-installers-extender": "^1.1",
    },
    "extra": {
    "installer-types": ["js-lib"],
    "installer-paths": {
      "path/{$vendor}/{$name}/": ["type:js-lib"]
    }
  }
}
  1. Run composer install
$ composer require marshung/js-lib
  • See: composer-installers-extender
  • Available variable:{$vendor}, {$name}, {$type}
  • Judgment method:
    1. By name ["marshung/js-lib"]
    2. By type ["type:js-lib"]

Dependency

Popover Button

  • jquery-1.12
  • bootstrap 3.3

Usage

Popover Button init

HTML Code

<script src="src/popoverButton.js"></script>

Javascript Code

var options = {
    title : '是否刪除?',
    schema : [ {
      value : 'yes',
      text : '是',
      style : 'btn-primary'
    }, {
      value : 'no',
      text : '否',
      style : 'btn-danger'
    }, {
      value : 'note',
      text : '說明',
      style : 'btn-default'
    } ],
    callback : function(value, data, parameter) {
      console.log(value, data)
    }
  };

$app = app.Popover Button($('.selector'), options);

Popover Button destroy

Javascript Code

$app.destroy();