dgikiller / mojolicious-plugin-jquery

DEPRECATED A simple Mojolicious plugin to include latest JQuery in your website
Other
1 stars 1 forks source link

NAME

Mojolicious::Plugin::JQuery - Mojolicious + http://jquery.com/ DEPRECATED

VERSION

3.11001

DESCRIPTION

Mojolicious::Plugin::JQuery push http://jquery.com/ JavaScript files into your project.

This is done using Mojolicious::Plugin::AssetPack.

This module will be DEPRECATED.

Use Mojolicious::Plugin::AssetPack directly instead.

SYNOPSIS

Mojolicious::Lite

use Mojolicious::Lite;
plugin "JQuery";
get "/" => "index";
app->start;

Mojolicious

sub startup {
  my $self = shift;

  $self->plugin("JQuery");
}

Template

<!doctype html>
<html>
  <head>
    <meta charset="utf-8">
  <title>class demo</title>
  <style>
    div, span {
        width: 120px;
        height: 40px;
        float: left;
        padding: 10px;
        margin: 10px;
        background-color: #EEEEEE;
  }
  </style>
      %= asset "jquery.js"
  </head>
  <body>
      <div class="notMe">div class="notMe"</div>
<div class="myClass">div class="myClass"</div>
<span class="myClass">span class="myClass"</span>
<script>
  $( ".myClass" ).css( "border", "3px solid red" );
</script>
  </body>
</html>

STATIC FILE STRUCTURE

Following the list of the static files of this project. All js are uncompressed for developing.

js/jquery-3.1.1.js
js/jquery-migrate-1.4.1.js

Versions installed

This module ship the following version of JQuery and JQuery Migrate:

jquery-3.1.1.js
jquery-migrate-1.4.1.js

METHODS

asset_path

$path = Mojolicious::Plugin::JQuery->asset_path();
$path = $self->asset_path();

Returns the base path to the assets bundled with this module.

register

$app->plugin(
  JQuery => {
    migrate => $bool, # default false
    jquery_1 => $bool # default false (prevent migrate inclusion)
  },
);

Default values:

find_files

@files = Mojolicious::Plugin::JQuery->find_files($dir,$type);
@files = $self->find_files($dir,$type);

Search a given file type in all directories of the array.

Required parameters:

CREDITS

JQuery is an opensource project with a lot of contributors, thank you.

Thanks even to jhthorsen because this plugin is widely based on his Bootstrap3 plugin.

LICENSE

JQuery is licensed under MIT

This code is licensed under Artistic License version 2.0.

AUTHOR

Ferro - ferro@cpan.org