summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMathew Winstone2013-03-15 16:22:58 (GMT)
committerMathew Winstone2013-03-15 16:22:58 (GMT)
commitd155bc16cf0e35c7149d10ac9fddafa728b05d39 (patch)
treefbd0737b7a84ffd8c4488b935be1bc838068b7e7
parent8d32054e838e9e42888044252a63d97ae3ef1d0a (diff)
Added base library definition
-rw-r--r--README.txt4
-rw-r--r--garlic.info3
-rw-r--r--garlic.module46
3 files changed, 53 insertions, 0 deletions
diff --git a/README.txt b/README.txt
new file mode 100644
index 0000000..4c749c0
--- /dev/null
+++ b/README.txt
@@ -0,0 +1,4 @@
+Garlic.js
+=========
+
+Adds the garlic.js library to Drupal. Garlic lets you use your browser's local storage to save the state of a webform between page loads and accidental window closing. \ No newline at end of file
diff --git a/garlic.info b/garlic.info
index f17b7f2..81581d9 100644
--- a/garlic.info
+++ b/garlic.info
@@ -1 +1,4 @@
name = Garlic
+description = Adds the garlic.js library and allows you to add it to selected entity forms
+
+dependencies[] = libraries (2.x) \ No newline at end of file
diff --git a/garlic.module b/garlic.module
new file mode 100644
index 0000000..cc60cfb
--- /dev/null
+++ b/garlic.module
@@ -0,0 +1,46 @@
+<?php
+
+/**
+ * @file
+ * Adds the garlic.js library to Drupal and enable basic toggling on entities
+ */
+
+/**
+ * Implements hook_libraries_info().
+ */
+function garlic_libraries_info() {
+ // Garlic
+ $libraries['garlic'] = array(
+ 'name' => "Garlic.js",
+ 'vendor url' => 'http://garlicjs.org/',
+ 'download url' => 'http://garlicjs.org/',
+ 'path' => 'garlic',
+ 'version arguments' => array(
+ 'file' => 'dist/garlic.min.js',
+ 'pattern' => '/(\d+\.\d+\.\d+)/',
+ 'lines' => 1,
+ ),
+ 'files' => array(
+ 'js' => array(
+ 'dist/garlic.min.js'
+ )
+ ),
+ 'variants' => array(
+ 'minified' => array(
+ 'files' => array(
+ 'js' => array(
+ 'dist/garlic.min.js'
+ ),
+ ),
+ ),
+ 'source' => array(
+ 'files' => array(
+ 'js' => array(
+ 'garlic.js'
+ ),
+ ),
+ ),
+ ),
+ );
+ return $libraries;
+}