diff --git a/_config.php b/_config.php
index b7a52ea..6b270a5 100644
--- a/_config.php
+++ b/_config.php
@@ -1,11 +1,3 @@
- *
- * Font Awesome Icon Picker Bootstrap plugin by http://mjolnic.com/fontawesome-iconpicker/
- */
-// define fontawesomeiconpicker dir so that the installation doesn't need a fixed directory name
-if(!defined('FONTAWESOMEICONPICKER_DIR')){
- define('FONTAWESOMEICONPICKER_DIR', basename(__DIR__));
-}
\ No newline at end of file
+
+define('FONT_AWESOME_DIR', ltrim(Director::makeRelative(realpath(__DIR__)), DIRECTORY_SEPARATOR));
diff --git a/_config/config.yml b/_config/config.yml
index 9e3c4ef..c9806f6 100644
--- a/_config/config.yml
+++ b/_config/config.yml
@@ -1,14 +1,6 @@
---
Name: font-awesome
-After:
- - 'framework/*'
- - 'cms/*'
---
-
-SiteConfig:
- extensions:
- - FASettings
-
ContentController:
extensions:
- - FAInjector
\ No newline at end of file
+ - FontAwesomeControllerExtension
diff --git a/code/extensions/FAInjector.php b/code/extensions/FAInjector.php
deleted file mode 100644
index 46b16de..0000000
--- a/code/extensions/FAInjector.php
+++ /dev/null
@@ -1,21 +0,0 @@
-UseThemeCSS) {
- return;
- }
-
- if (SiteConfig::current_site_config()->UseCDN) {
- Requirements::css("//maxcdn.bootstrapcdn.com/font-awesome/4.3.0/css/font-awesome.min.css");
- } else {
- Requirements::css("font-awesome/css/lib/font-awesome.min.css");
- }
-
- }
-}
\ No newline at end of file
diff --git a/code/extensions/FASettings.php b/code/extensions/FASettings.php
deleted file mode 100644
index f041fab..0000000
--- a/code/extensions/FASettings.php
+++ /dev/null
@@ -1,37 +0,0 @@
- 'boolean(1)',
- 'UseThemeCSS' => 'boolean(1)',
- );
-
- private static $defaults = array(
- 'UseCDN' => false,
- 'UseThemeCSS' => false,
- );
-
- public function updateCMSFields(FieldList $fields)
- {
- $fields->addFieldsToTab('Root.FontAwesome', array(
-
- OptionsetField::create('UseThemeCSS', 'Theme dir font-awesome.css?')
- ->setDescription('You may want to use font-awesome.css from your theme directory')
- ->setSource(array(
- true => 'Yes',
- false => 'No'
- )),
-
- OptionsetField::create('UseCDN', 'CDN for loading frontend assets?')
- ->setDescription('Depending on hosting, your viewers may or may not get better performance using a CDN')
- ->setSource(array(
- true => 'Yes',
- false => 'No'
- ))
- ));
- }
-}
\ No newline at end of file
diff --git a/code/extensions/FontAwesomeControllerExtension.php b/code/extensions/FontAwesomeControllerExtension.php
new file mode 100644
index 0000000..8db28d5
--- /dev/null
+++ b/code/extensions/FontAwesomeControllerExtension.php
@@ -0,0 +1,15 @@
+addExtraClass('form-control icp icp-auto');
- Requirements::css('font-awesome/css/lib/bootstrap.min.css');
- Requirements::css('font-awesome/css/lib/font-awesome.min.css');
- Requirements::css('font-awesome/code/vendor/fontawesome-iconpicker-1.0.0/dist/css/fontawesome-iconpicker.min.css');
- Requirements::css('font-awesome/css/font-awesome-module.css');
+ //Libraries
+ Requirements::css(FONT_AWESOME_DIR . '/css/lib/bootstrap.min.css');
+ Requirements::css(FONT_AWESOME_DIR . '/css/lib/font-awesome.min.css');
+ Requirements::css(FONT_AWESOME_DIR . '/css/lib/font-awesome-iconpicker.min.css');
+ Requirements::javascript(FONT_AWESOME_DIR . '/js/lib/font-awesome-iconpicker.min.js');
+
+ // Module
+ Requirements::css(FONT_AWESOME_DIR . '/css/font-awesome-module.css');
+ Requirements::javascript(FONT_AWESOME_DIR . '/js/font-awesome-module.js');
Requirements::set_force_js_to_bottom(true);
- Requirements::javascript('font-awesome/code/vendor/fontawesome-iconpicker-1.0.0/dist/js/fontawesome-iconpicker.min.js');
- Requirements::javascript('font-awesome/js/font-awesome-module.js');
return parent::Field($properties);
}
@@ -41,13 +44,14 @@ class FontAwesomeField extends TextField
*/
public function validate($validator)
{
- if(!empty ($this->value) && !preg_match('/^fa-[a-z]+/', $this->value))
- {
+ if (!empty ($this->value) && !preg_match('/^fa-[a-z]+/', $this->value)) {
$validator->validationError(
$this->name, 'Please enter a valid Font Awesome font name format.', 'validation', false
);
+
return false;
}
+
return true;
}
}
diff --git a/code/vendor/fontawesome-iconpicker-1.0.0/.gitignore b/code/vendor/fontawesome-iconpicker-1.0.0/.gitignore
deleted file mode 100644
index a2e8fff..0000000
--- a/code/vendor/fontawesome-iconpicker-1.0.0/.gitignore
+++ /dev/null
@@ -1,12 +0,0 @@
-*~
-.DS_Store
-.DS_Store*
-ehthumbs.db
-Thumbs.db
-*.log
-/ignore/
-/ignored/
-/node_modules/
-/nbproject/
-static_server.js
-*.php
\ No newline at end of file
diff --git a/code/vendor/fontawesome-iconpicker-1.0.0/.travis.yml b/code/vendor/fontawesome-iconpicker-1.0.0/.travis.yml
deleted file mode 100644
index a06142a..0000000
--- a/code/vendor/fontawesome-iconpicker-1.0.0/.travis.yml
+++ /dev/null
@@ -1,7 +0,0 @@
-language: node_js
-node_js:
- - "0.10"
-before_script:
- - npm install -g grunt-cli
-
-script: grunt --verbose --force
\ No newline at end of file
diff --git a/code/vendor/fontawesome-iconpicker-1.0.0/Gruntfile.js b/code/vendor/fontawesome-iconpicker-1.0.0/Gruntfile.js
deleted file mode 100644
index d0c3765..0000000
--- a/code/vendor/fontawesome-iconpicker-1.0.0/Gruntfile.js
+++ /dev/null
@@ -1,97 +0,0 @@
-'use strict';
-module.exports = function(grunt) {
- grunt.initConfig({
- less: {
- dist: {
- options: {
- compile: true,
- compress: false
- },
- files: {
- 'dist/css/fontawesome-iconpicker.css': [
- 'src/less/iconpicker.less'
- ]
- }
- },
- distMin: {
- options: {
- compile: true,
- compress: true
- },
- files: {
- 'dist/css/fontawesome-iconpicker.min.css': [
- 'src/less/iconpicker.less'
- ]
- }
- }
- },
- jsbeautifier: {
- files: ['Gruntfile.js', 'src/js/*.js']
- },
- uglify: {
- distMin: {
- options: {
- compress: true,
- beautify: false
- },
- files: {
- 'dist/js/fontawesome-iconpicker.min.js': [
- 'src/js/jquery.ui.pos.js',
- 'src/js/iconpicker.js'
- ]
- }
- },
- dist: {
- options: {
- compress: false,
- beautify: true
- },
- files: {
- 'dist/js/fontawesome-iconpicker.js': [
- 'src/js/jquery.ui.pos.js',
- 'src/js/iconpicker.js'
- ]
- }
- }
- },
- watch: {
- less: {
- files: [
- 'src/less/*.less'
- ],
- tasks: ['less']
- },
- js: {
- files: [
- 'src/js/*.js'
- ],
- tasks: ['uglify']
- }
- },
- clean: {
- dist: [
- 'dist/css',
- 'dist/js/*.js'
- ]
- }
- });
-
- // Load tasks
- grunt.loadNpmTasks('grunt-contrib-clean');
- grunt.loadNpmTasks('grunt-contrib-uglify');
- grunt.loadNpmTasks('grunt-contrib-watch');
- grunt.loadNpmTasks('grunt-contrib-less');
- grunt.loadNpmTasks('grunt-jsbeautifier');
-
- // Register tasks
- grunt.registerTask('default', [
- 'clean',
- 'less',
- 'jsbeautifier',
- 'uglify'
- ]);
- grunt.registerTask('dev', [
- 'watch'
- ]);
-
-};
diff --git a/code/vendor/fontawesome-iconpicker-1.0.0/LICENSE b/code/vendor/fontawesome-iconpicker-1.0.0/LICENSE
deleted file mode 100644
index e92cb35..0000000
--- a/code/vendor/fontawesome-iconpicker-1.0.0/LICENSE
+++ /dev/null
@@ -1,21 +0,0 @@
-The MIT License (MIT)
-
-Copyright (c) 2014 Javier Aguilar @mjolnic
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in all
-copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
-SOFTWARE.
\ No newline at end of file
diff --git a/code/vendor/fontawesome-iconpicker-1.0.0/README.md b/code/vendor/fontawesome-iconpicker-1.0.0/README.md
deleted file mode 100644
index b5079f7..0000000
--- a/code/vendor/fontawesome-iconpicker-1.0.0/README.md
+++ /dev/null
@@ -1,124 +0,0 @@
-fontawesome-iconpicker
-========================
-
-Font Awesome Icon Picker is a fully customizable plugin for Twitter Bootstrap,
-with a powerful base API, based on [bootstrap-popover-picker](http://mjolnic.github.io/bootstrap-popover-picker/)
-
-You can use Font Awesome or another font icon set of your choice (icons options and items are customizable)
-
-[View demos](http://mjolnic.github.io/fontawesome-iconpicker/)
-
-## Instantiation
-
-You can call the plugin in several ways:
-
-```javascript
-// Create instance if not exists (returns a jQuery object)
-$('.my').iconpicker();
-$('.my').iconpicker({ /*options*/ }); // you can also specify options via data-* attributes
-
-// For the first matched element, access to a plugin property value
-$('.my').data('iconpicker').iconpickerProperty;
-
-// For the first matched element, call a plugin instance method with the given args
-$('.my').data('iconpicker').iconpickerMethod('methodArg1', 'methodArg2' /* , other args */);
-
-// Call and apply a plugin method to EACH matched element.
-$.iconpicker.batch('.my', 'iconpickerMethod', 'methodArg1', 'methodArg2' /* , other args */); ->
-```
-
-## Triggered Events
-
-All of them exposes the plugin instance through event.iconpickerInstance
-
-In order of call:
-
-* iconpickerCreate
-* iconpickerCreated
-* iconpickerShow
-* iconpickerShown
-* iconpickerSelect (also exposes event.iconpickerItem and event.iconpickerValue)
-* iconpickerUpdate
-* iconpickerInvalid (also exposes event.iconpickerValue)
-* iconpickerSetValue (also exposes event.iconpickerValue)
-* iconpickerSetSourceValue (also exposes event.iconpickerValue)
-* iconpickerUpdated
-* iconpickerSelected (also exposes event.iconpickerItem and event.iconpickerValue)
-* iconpickerHide
-* iconpickerHidden
-* iconpickerDestroy
-* iconpickerDestroyed
-
-## Popover placement extensions
-
-This plugin comes with more placement options than the original Bootstrap Popover.
-Here are all the possibilities in detail:
-
- 1 2 3 4 5
- G 6
- F 7
- E 8
- D C B A 9
-
- 0. inline (no placement, display as inline-block)
- 1. topLeftCorner
- 2. topLeft
- 3. top (center)
- 4. topRight
- 5. topRightCorner
- 6. rightTop
- 7. right (center)
- 8. rightBottom
- 9. bottomRightCorner
- A. bottomRight
- B. bottom (center)
- C. bottomLeft
- D. bottomLeftCorner
- E. leftBottom
- F. left (center)
- G. leftTop
-
-
-## Available options
-
-```javascript
-var opts = {
- title: false, // Popover title (optional) only if specified in the template
- selected: false, // use this value as the current item and ignore the original
- defaultValue: false, // use this value as the current item if input or element value is empty
- placement: 'bottom', // (has some issues with auto and CSS). auto, top, bottom, left, right
- collision: 'none', // If true, the popover will be repositioned to another position when collapses with the window borders
- animation: true, // fade in/out on show/hide ?
- //hide iconpicker automatically when a value is picked. it is ignored if mustAccept is not false and the accept button is visible
- hideOnSelect: false,
- showFooter: false,
- searchInFooter: false, // If true, the search will be added to the footer instead of the title
- mustAccept: false, // only applicable when there's an iconpicker-btn-accept button in the popover footer
- selectedCustomClass: 'bg-primary', // Appends this class when to the selected item
- icons: [], // list of icons (declared at the bottom of this script for maintainability)
- iconBaseClass: 'fa', // you can customize class prefix and base name, so you can use other icon fonts like the default Bootstrap's
- iconComponentBaseClass: 'fa fa-fw',
- iconClassPrefix: 'fa-',
- input: 'input', // children input selector
- container: false, // Appends the popover to a specific element. If not set, the selected element or element parent is used
- component: '.input-group-addon', // children component jQuery selector or object, relative to the container element
- // Plugin templates:
- templates: {
- popover: '
',
- footer: '',
- buttons: 'Cancel ' +
- ' Accept ',
- search: ' ',
- iconpicker: '',
- iconpickerItem: '
',
- }
-};
-```
-
-## TO-DO
-- [x] Support other icon fonts
-- [x] Fix: input marked as error when it is empty
-- [ ] Ability to use the user input as the filter instead of the popover input
-- [ ] Fix bottomRight position when using component mode (maybe the popover needs to be
-appended in other element, or use another 'to' in position plugin?)
\ No newline at end of file
diff --git a/code/vendor/fontawesome-iconpicker-1.0.0/bower.json b/code/vendor/fontawesome-iconpicker-1.0.0/bower.json
deleted file mode 100644
index f846bd0..0000000
--- a/code/vendor/fontawesome-iconpicker-1.0.0/bower.json
+++ /dev/null
@@ -1,15 +0,0 @@
-{
- "name": "fontawesome-iconpicker",
- "version": "1.0.0",
- "dependencies": {
- "jquery": "^1.10",
- "bootstrap": "^3"
- },
- "ignore": [
- "\\.*",
- "/src",
- "index.html",
- "/package.json",
- "/Gruntfile.js"
- ]
-}
diff --git a/code/vendor/fontawesome-iconpicker-1.0.0/dist/css/fontawesome-iconpicker.css b/code/vendor/fontawesome-iconpicker-1.0.0/dist/css/fontawesome-iconpicker.css
deleted file mode 100644
index 96377ad..0000000
--- a/code/vendor/fontawesome-iconpicker-1.0.0/dist/css/fontawesome-iconpicker.css
+++ /dev/null
@@ -1,326 +0,0 @@
-/*!
- * Font Awesome Icon Picker
- * http://mjolnic.github.io/fontawesome-iconpicker/
- *
- * Originally written by (c) 2014 Javier Aguilar @mjolnic
- * Licensed under the MIT License
- * https://github.com/mjolnic/fontawesome-iconpicker/blob/master/LICENSE
- *
- */
-/*
- * Font Awesome Icon Picker
- * http://mjolnic.github.io/fontawesome-iconpicker/
- *
- * Originally written by (c) 2014 Javier Aguilar @mjolnic
- * Licensed under the MIT License
- * https://github.com/mjolnic/fontawesome-iconpicker/blob/master/LICENSE
- *
- */
-/*
- * Font Awesome Icon Picker
- * http://mjolnic.github.io/fontawesome-iconpicker/
- *
- * Originally written by (c) 2014 Javier Aguilar @mjolnic
- * Licensed under the MIT License
- * https://github.com/mjolnic/fontawesome-iconpicker/blob/master/LICENSE
- *
- */
-.iconpicker-popover.popover {
- position: absolute;
- top: 0;
- left: 0;
- display: none;
- max-width: none;
- padding: 1px;
- text-align: left;
- width: 242px;
- background: #f7f7f7;
-}
-.iconpicker-popover.popover.top,
-.iconpicker-popover.popover.topLeftCorner,
-.iconpicker-popover.popover.topLeft,
-.iconpicker-popover.popover.topRight,
-.iconpicker-popover.popover.topRightCorner {
- margin-top: -10px;
-}
-.iconpicker-popover.popover.right,
-.iconpicker-popover.popover.rightTop,
-.iconpicker-popover.popover.rightBottom {
- margin-left: 10px;
-}
-.iconpicker-popover.popover.bottom,
-.iconpicker-popover.popover.bottomRightCorner,
-.iconpicker-popover.popover.bottomRight,
-.iconpicker-popover.popover.bottomLeft,
-.iconpicker-popover.popover.bottomLeftCorner {
- margin-top: 10px;
-}
-.iconpicker-popover.popover.left,
-.iconpicker-popover.popover.leftBottom,
-.iconpicker-popover.popover.leftTop {
- margin-left: -10px;
-}
-.iconpicker-popover.popover.inline {
- margin: 0 0 14px 0;
- position: relative;
- display: inline-block;
- opacity: 1;
- top: auto;
- left: auto;
- bottom: auto;
- right: auto;
- max-width: 100%;
- box-shadow: none;
- z-index: auto;
- vertical-align: top;
-}
-.iconpicker-popover.popover.inline > .arrow {
- display: none;
-}
-.dropdown-menu .iconpicker-popover.inline {
- margin: 0;
- border: none;
-}
-.dropdown-menu.iconpicker-container {
- padding: 0;
-}
-.iconpicker-popover.popover .popover-title {
- padding: 14px;
- font-size: 14px;
- line-height: 16px;
- border-bottom: 1px solid #ebebeb;
- background-color: #f7f7f7;
-}
-.iconpicker-popover.popover .popover-title input[type=search].iconpicker-search {
- margin: 0 0 2px 0;
-}
-.iconpicker-popover.popover .popover-title-text ~ input[type=search].iconpicker-search {
- margin-top: 14px;
-}
-.iconpicker-popover.popover .popover-content {
- padding: 0px;
- text-align: center;
-}
-.iconpicker-popover .popover-footer {
- float: none;
- clear: both;
- padding: 14px;
- text-align: right;
- margin: 0;
- border-top: 1px solid #ebebeb;
- background-color: #f7f7f7;
-}
-.iconpicker-popover .popover-footer:before,
-.iconpicker-popover .popover-footer:after {
- content: " ";
- display: table;
-}
-.iconpicker-popover .popover-footer:after {
- clear: both;
-}
-.iconpicker-popover .popover-footer .iconpicker-btn {
- margin-left: 10px;
-}
-.iconpicker-popover .popover-footer input[type=search].iconpicker-search {
- /*width:auto;
- float:left;*/
- margin-bottom: 14px;
-}
-.iconpicker-popover.popover > .arrow,
-.iconpicker-popover.popover > .arrow:after {
- position: absolute;
- display: block;
- width: 0;
- height: 0;
- border-color: transparent;
- border-style: solid;
-}
-.iconpicker-popover.popover > .arrow {
- border-width: 11px;
-}
-.iconpicker-popover.popover > .arrow:after {
- border-width: 10px;
- content: "";
-}
-.iconpicker-popover.popover.top > .arrow,
-.iconpicker-popover.popover.topLeft > .arrow,
-.iconpicker-popover.popover.topRight > .arrow {
- left: 50%;
- margin-left: -11px;
- border-bottom-width: 0;
- border-top-color: #999999;
- border-top-color: rgba(0, 0, 0, 0.25);
- bottom: -11px;
-}
-.iconpicker-popover.popover.top > .arrow:after,
-.iconpicker-popover.popover.topLeft > .arrow:after,
-.iconpicker-popover.popover.topRight > .arrow:after {
- content: " ";
- bottom: 1px;
- margin-left: -10px;
- border-bottom-width: 0;
- border-top-color: #ffffff;
-}
-.iconpicker-popover.popover.topLeft > .arrow {
- left: 14px;
- margin-left: 0;
-}
-.iconpicker-popover.popover.topRight > .arrow {
- left: auto;
- right: 14px;
- margin-left: 0;
-}
-.iconpicker-popover.popover.right > .arrow,
-.iconpicker-popover.popover.rightTop > .arrow,
-.iconpicker-popover.popover.rightBottom > .arrow {
- top: 50%;
- left: -11px;
- margin-top: -11px;
- border-left-width: 0;
- border-right-color: #999999;
- border-right-color: rgba(0, 0, 0, 0.25);
-}
-.iconpicker-popover.popover.right > .arrow:after,
-.iconpicker-popover.popover.rightTop > .arrow:after,
-.iconpicker-popover.popover.rightBottom > .arrow:after {
- content: " ";
- left: 1px;
- bottom: -10px;
- border-left-width: 0;
- border-right-color: #ffffff;
-}
-.iconpicker-popover.popover.rightTop > .arrow {
- top: auto;
- bottom: 14px;
- margin-top: 0;
-}
-.iconpicker-popover.popover.rightBottom > .arrow {
- top: 14px;
- margin-top: 0;
-}
-.iconpicker-popover.popover.bottom > .arrow,
-.iconpicker-popover.popover.bottomRight > .arrow,
-.iconpicker-popover.popover.bottomLeft > .arrow {
- left: 50%;
- margin-left: -11px;
- border-top-width: 0;
- border-bottom-color: #999999;
- border-bottom-color: rgba(0, 0, 0, 0.25);
- top: -11px;
-}
-.iconpicker-popover.popover.bottom > .arrow:after,
-.iconpicker-popover.popover.bottomRight > .arrow:after,
-.iconpicker-popover.popover.bottomLeft > .arrow:after {
- content: " ";
- top: 1px;
- margin-left: -10px;
- border-top-width: 0;
- border-bottom-color: #ffffff;
-}
-.iconpicker-popover.popover.bottomLeft > .arrow {
- left: 14px;
- margin-left: 0;
-}
-.iconpicker-popover.popover.bottomRight > .arrow {
- left: auto;
- right: 14px;
- margin-left: 0;
-}
-.iconpicker-popover.popover.left > .arrow,
-.iconpicker-popover.popover.leftBottom > .arrow,
-.iconpicker-popover.popover.leftTop > .arrow {
- top: 50%;
- right: -11px;
- margin-top: -11px;
- border-right-width: 0;
- border-left-color: #999999;
- border-left-color: rgba(0, 0, 0, 0.25);
-}
-.iconpicker-popover.popover.left > .arrow:after,
-.iconpicker-popover.popover.leftBottom > .arrow:after,
-.iconpicker-popover.popover.leftTop > .arrow:after {
- content: " ";
- right: 1px;
- border-right-width: 0;
- border-left-color: #ffffff;
- bottom: -10px;
-}
-.iconpicker-popover.popover.leftBottom > .arrow {
- top: 14px;
- margin-top: 0;
-}
-.iconpicker-popover.popover.leftTop > .arrow {
- top: auto;
- bottom: 14px;
- margin-top: 0;
-}
-.iconpicker {
- position: relative;
- text-align: left;
- text-shadow: none;
- line-height: 0;
- display: block;
- margin: 0;
- overflow: hidden;
-}
-.iconpicker * {
- -webkit-box-sizing: content-box;
- -moz-box-sizing: content-box;
- box-sizing: content-box;
- position: relative;
-}
-.iconpicker:before,
-.iconpicker:after {
- content: " ";
- display: table;
-}
-.iconpicker:after {
- clear: both;
-}
-.iconpicker .iconpicker-items {
- position: relative;
- clear: both;
- float: none;
- padding: 14px 0 0 14px;
- background: #fff;
- margin: 0;
- overflow: hidden;
- overflow-y: auto;
- min-height: 55px;
- max-height: 275px;
-}
-.iconpicker .iconpicker-items:before,
-.iconpicker .iconpicker-items:after {
- content: " ";
- display: table;
-}
-.iconpicker .iconpicker-items:after {
- clear: both;
-}
-.iconpicker .iconpicker-item {
- float: left;
- width: 14px;
- height: 14px;
- padding: 14px;
- margin: 0 14px 14px 0;
- text-align: center;
- cursor: pointer;
- border-radius: 3px;
- font-size: 14px;
- box-shadow: 0 0 0 1px #dddddd;
- /*&:nth-child(4n+4) {
- margin-right: 0;
- }
- &:nth-last-child(-n+4) {
- margin-bottom: 0;
- }*/
-}
-.iconpicker .iconpicker-item:hover:not(.iconpicker-selected) {
- background-color: #eeeeee;
-}
-.iconpicker .iconpicker-item.iconpicker-selected {
- box-shadow: none;
-}
-.iconpicker-component {
- cursor: pointer;
-}
diff --git a/code/vendor/fontawesome-iconpicker-1.0.0/dist/fonts/FontAwesome.otf b/code/vendor/fontawesome-iconpicker-1.0.0/dist/fonts/FontAwesome.otf
deleted file mode 100644
index f7936cc..0000000
Binary files a/code/vendor/fontawesome-iconpicker-1.0.0/dist/fonts/FontAwesome.otf and /dev/null differ
diff --git a/code/vendor/fontawesome-iconpicker-1.0.0/dist/fonts/fontawesome-webfont.eot b/code/vendor/fontawesome-iconpicker-1.0.0/dist/fonts/fontawesome-webfont.eot
deleted file mode 100644
index 33b2bb8..0000000
Binary files a/code/vendor/fontawesome-iconpicker-1.0.0/dist/fonts/fontawesome-webfont.eot and /dev/null differ
diff --git a/code/vendor/fontawesome-iconpicker-1.0.0/dist/fonts/fontawesome-webfont.svg b/code/vendor/fontawesome-iconpicker-1.0.0/dist/fonts/fontawesome-webfont.svg
deleted file mode 100644
index 1ee89d4..0000000
--- a/code/vendor/fontawesome-iconpicker-1.0.0/dist/fonts/fontawesome-webfont.svg
+++ /dev/null
@@ -1,565 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/code/vendor/fontawesome-iconpicker-1.0.0/dist/fonts/fontawesome-webfont.ttf b/code/vendor/fontawesome-iconpicker-1.0.0/dist/fonts/fontawesome-webfont.ttf
deleted file mode 100644
index ed9372f..0000000
Binary files a/code/vendor/fontawesome-iconpicker-1.0.0/dist/fonts/fontawesome-webfont.ttf and /dev/null differ
diff --git a/code/vendor/fontawesome-iconpicker-1.0.0/dist/fonts/fontawesome-webfont.woff b/code/vendor/fontawesome-iconpicker-1.0.0/dist/fonts/fontawesome-webfont.woff
deleted file mode 100644
index 8b280b9..0000000
Binary files a/code/vendor/fontawesome-iconpicker-1.0.0/dist/fonts/fontawesome-webfont.woff and /dev/null differ
diff --git a/code/vendor/fontawesome-iconpicker-1.0.0/dist/fonts/fontawesome-webfont.woff2 b/code/vendor/fontawesome-iconpicker-1.0.0/dist/fonts/fontawesome-webfont.woff2
deleted file mode 100644
index 3311d58..0000000
Binary files a/code/vendor/fontawesome-iconpicker-1.0.0/dist/fonts/fontawesome-webfont.woff2 and /dev/null differ
diff --git a/code/vendor/fontawesome-iconpicker-1.0.0/dist/js/fontawesome-iconpicker.js b/code/vendor/fontawesome-iconpicker-1.0.0/dist/js/fontawesome-iconpicker.js
deleted file mode 100644
index 75ade13..0000000
--- a/code/vendor/fontawesome-iconpicker-1.0.0/dist/js/fontawesome-iconpicker.js
+++ /dev/null
@@ -1,990 +0,0 @@
-(function(a, b) {
- a.ui = a.ui || {};
- var c, d = Math.max, e = Math.abs, f = Math.round, g = /left|center|right/, h = /top|center|bottom/, i = /[\+\-]\d+(\.[\d]+)?%?/, j = /^\w+/, k = /%$/, l = a.fn.pos;
- function m(a, b, c) {
- return [ parseFloat(a[0]) * (k.test(a[0]) ? b / 100 : 1), parseFloat(a[1]) * (k.test(a[1]) ? c / 100 : 1) ];
- }
- function n(b, c) {
- return parseInt(a.css(b, c), 10) || 0;
- }
- function o(b) {
- var c = b[0];
- if (c.nodeType === 9) {
- return {
- width: b.width(),
- height: b.height(),
- offset: {
- top: 0,
- left: 0
- }
- };
- }
- if (a.isWindow(c)) {
- return {
- width: b.width(),
- height: b.height(),
- offset: {
- top: b.scrollTop(),
- left: b.scrollLeft()
- }
- };
- }
- if (c.preventDefault) {
- return {
- width: 0,
- height: 0,
- offset: {
- top: c.pageY,
- left: c.pageX
- }
- };
- }
- return {
- width: b.outerWidth(),
- height: b.outerHeight(),
- offset: b.offset()
- };
- }
- a.pos = {
- scrollbarWidth: function() {
- if (c !== b) {
- return c;
- }
- var d, e, f = a(""), g = f.children()[0];
- a("body").append(f);
- d = g.offsetWidth;
- f.css("overflow", "scroll");
- e = g.offsetWidth;
- if (d === e) {
- e = f[0].clientWidth;
- }
- f.remove();
- return c = d - e;
- },
- getScrollInfo: function(b) {
- var c = b.isWindow || b.isDocument ? "" : b.element.css("overflow-x"), d = b.isWindow || b.isDocument ? "" : b.element.css("overflow-y"), e = c === "scroll" || c === "auto" && b.width < b.element[0].scrollWidth, f = d === "scroll" || d === "auto" && b.height < b.element[0].scrollHeight;
- return {
- width: f ? a.pos.scrollbarWidth() : 0,
- height: e ? a.pos.scrollbarWidth() : 0
- };
- },
- getWithinInfo: function(b) {
- var c = a(b || window), d = a.isWindow(c[0]), e = !!c[0] && c[0].nodeType === 9;
- return {
- element: c,
- isWindow: d,
- isDocument: e,
- offset: c.offset() || {
- left: 0,
- top: 0
- },
- scrollLeft: c.scrollLeft(),
- scrollTop: c.scrollTop(),
- width: d ? c.width() : c.outerWidth(),
- height: d ? c.height() : c.outerHeight()
- };
- }
- };
- a.fn.pos = function(b) {
- if (!b || !b.of) {
- return l.apply(this, arguments);
- }
- b = a.extend({}, b);
- var c, k, p, q, r, s, t = a(b.of), u = a.pos.getWithinInfo(b.within), v = a.pos.getScrollInfo(u), w = (b.collision || "flip").split(" "), x = {};
- s = o(t);
- if (t[0].preventDefault) {
- b.at = "left top";
- }
- k = s.width;
- p = s.height;
- q = s.offset;
- r = a.extend({}, q);
- a.each([ "my", "at" ], function() {
- var a = (b[this] || "").split(" "), c, d;
- if (a.length === 1) {
- a = g.test(a[0]) ? a.concat([ "center" ]) : h.test(a[0]) ? [ "center" ].concat(a) : [ "center", "center" ];
- }
- a[0] = g.test(a[0]) ? a[0] : "center";
- a[1] = h.test(a[1]) ? a[1] : "center";
- c = i.exec(a[0]);
- d = i.exec(a[1]);
- x[this] = [ c ? c[0] : 0, d ? d[0] : 0 ];
- b[this] = [ j.exec(a[0])[0], j.exec(a[1])[0] ];
- });
- if (w.length === 1) {
- w[1] = w[0];
- }
- if (b.at[0] === "right") {
- r.left += k;
- } else if (b.at[0] === "center") {
- r.left += k / 2;
- }
- if (b.at[1] === "bottom") {
- r.top += p;
- } else if (b.at[1] === "center") {
- r.top += p / 2;
- }
- c = m(x.at, k, p);
- r.left += c[0];
- r.top += c[1];
- return this.each(function() {
- var g, h, i = a(this), j = i.outerWidth(), l = i.outerHeight(), o = n(this, "marginLeft"), s = n(this, "marginTop"), y = j + o + n(this, "marginRight") + v.width, z = l + s + n(this, "marginBottom") + v.height, A = a.extend({}, r), B = m(x.my, i.outerWidth(), i.outerHeight());
- if (b.my[0] === "right") {
- A.left -= j;
- } else if (b.my[0] === "center") {
- A.left -= j / 2;
- }
- if (b.my[1] === "bottom") {
- A.top -= l;
- } else if (b.my[1] === "center") {
- A.top -= l / 2;
- }
- A.left += B[0];
- A.top += B[1];
- if (!a.support.offsetFractions) {
- A.left = f(A.left);
- A.top = f(A.top);
- }
- g = {
- marginLeft: o,
- marginTop: s
- };
- a.each([ "left", "top" ], function(d, e) {
- if (a.ui.pos[w[d]]) {
- a.ui.pos[w[d]][e](A, {
- targetWidth: k,
- targetHeight: p,
- elemWidth: j,
- elemHeight: l,
- collisionPosition: g,
- collisionWidth: y,
- collisionHeight: z,
- offset: [ c[0] + B[0], c[1] + B[1] ],
- my: b.my,
- at: b.at,
- within: u,
- elem: i
- });
- }
- });
- if (b.using) {
- h = function(a) {
- var c = q.left - A.left, f = c + k - j, g = q.top - A.top, h = g + p - l, m = {
- target: {
- element: t,
- left: q.left,
- top: q.top,
- width: k,
- height: p
- },
- element: {
- element: i,
- left: A.left,
- top: A.top,
- width: j,
- height: l
- },
- horizontal: f < 0 ? "left" : c > 0 ? "right" : "center",
- vertical: h < 0 ? "top" : g > 0 ? "bottom" : "middle"
- };
- if (k < j && e(c + f) < k) {
- m.horizontal = "center";
- }
- if (p < l && e(g + h) < p) {
- m.vertical = "middle";
- }
- if (d(e(c), e(f)) > d(e(g), e(h))) {
- m.important = "horizontal";
- } else {
- m.important = "vertical";
- }
- b.using.call(this, a, m);
- };
- }
- i.offset(a.extend(A, {
- using: h
- }));
- });
- };
- a.ui.pos = {
- _trigger: function(a, b, c, d) {
- if (b.elem) {
- b.elem.trigger({
- type: c,
- position: a,
- positionData: b,
- triggered: d
- });
- }
- },
- fit: {
- left: function(b, c) {
- a.ui.pos._trigger(b, c, "posCollide", "fitLeft");
- var e = c.within, f = e.isWindow ? e.scrollLeft : e.offset.left, g = e.width, h = b.left - c.collisionPosition.marginLeft, i = f - h, j = h + c.collisionWidth - g - f, k;
- if (c.collisionWidth > g) {
- if (i > 0 && j <= 0) {
- k = b.left + i + c.collisionWidth - g - f;
- b.left += i - k;
- } else if (j > 0 && i <= 0) {
- b.left = f;
- } else {
- if (i > j) {
- b.left = f + g - c.collisionWidth;
- } else {
- b.left = f;
- }
- }
- } else if (i > 0) {
- b.left += i;
- } else if (j > 0) {
- b.left -= j;
- } else {
- b.left = d(b.left - h, b.left);
- }
- a.ui.pos._trigger(b, c, "posCollided", "fitLeft");
- },
- top: function(b, c) {
- a.ui.pos._trigger(b, c, "posCollide", "fitTop");
- var e = c.within, f = e.isWindow ? e.scrollTop : e.offset.top, g = c.within.height, h = b.top - c.collisionPosition.marginTop, i = f - h, j = h + c.collisionHeight - g - f, k;
- if (c.collisionHeight > g) {
- if (i > 0 && j <= 0) {
- k = b.top + i + c.collisionHeight - g - f;
- b.top += i - k;
- } else if (j > 0 && i <= 0) {
- b.top = f;
- } else {
- if (i > j) {
- b.top = f + g - c.collisionHeight;
- } else {
- b.top = f;
- }
- }
- } else if (i > 0) {
- b.top += i;
- } else if (j > 0) {
- b.top -= j;
- } else {
- b.top = d(b.top - h, b.top);
- }
- a.ui.pos._trigger(b, c, "posCollided", "fitTop");
- }
- },
- flip: {
- left: function(b, c) {
- a.ui.pos._trigger(b, c, "posCollide", "flipLeft");
- var d = c.within, f = d.offset.left + d.scrollLeft, g = d.width, h = d.isWindow ? d.scrollLeft : d.offset.left, i = b.left - c.collisionPosition.marginLeft, j = i - h, k = i + c.collisionWidth - g - h, l = c.my[0] === "left" ? -c.elemWidth : c.my[0] === "right" ? c.elemWidth : 0, m = c.at[0] === "left" ? c.targetWidth : c.at[0] === "right" ? -c.targetWidth : 0, n = -2 * c.offset[0], o, p;
- if (j < 0) {
- o = b.left + l + m + n + c.collisionWidth - g - f;
- if (o < 0 || o < e(j)) {
- b.left += l + m + n;
- }
- } else if (k > 0) {
- p = b.left - c.collisionPosition.marginLeft + l + m + n - h;
- if (p > 0 || e(p) < k) {
- b.left += l + m + n;
- }
- }
- a.ui.pos._trigger(b, c, "posCollided", "flipLeft");
- },
- top: function(b, c) {
- a.ui.pos._trigger(b, c, "posCollide", "flipTop");
- var d = c.within, f = d.offset.top + d.scrollTop, g = d.height, h = d.isWindow ? d.scrollTop : d.offset.top, i = b.top - c.collisionPosition.marginTop, j = i - h, k = i + c.collisionHeight - g - h, l = c.my[1] === "top", m = l ? -c.elemHeight : c.my[1] === "bottom" ? c.elemHeight : 0, n = c.at[1] === "top" ? c.targetHeight : c.at[1] === "bottom" ? -c.targetHeight : 0, o = -2 * c.offset[1], p, q;
- if (j < 0) {
- q = b.top + m + n + o + c.collisionHeight - g - f;
- if (b.top + m + n + o > j && (q < 0 || q < e(j))) {
- b.top += m + n + o;
- }
- } else if (k > 0) {
- p = b.top - c.collisionPosition.marginTop + m + n + o - h;
- if (b.top + m + n + o > k && (p > 0 || e(p) < k)) {
- b.top += m + n + o;
- }
- }
- a.ui.pos._trigger(b, c, "posCollided", "flipTop");
- }
- },
- flipfit: {
- left: function() {
- a.ui.pos.flip.left.apply(this, arguments);
- a.ui.pos.fit.left.apply(this, arguments);
- },
- top: function() {
- a.ui.pos.flip.top.apply(this, arguments);
- a.ui.pos.fit.top.apply(this, arguments);
- }
- }
- };
- (function() {
- var b, c, d, e, f, g = document.getElementsByTagName("body")[0], h = document.createElement("div");
- b = document.createElement(g ? "div" : "body");
- d = {
- visibility: "hidden",
- width: 0,
- height: 0,
- border: 0,
- margin: 0,
- background: "none"
- };
- if (g) {
- a.extend(d, {
- position: "absolute",
- left: "-1000px",
- top: "-1000px"
- });
- }
- for (f in d) {
- b.style[f] = d[f];
- }
- b.appendChild(h);
- c = g || document.documentElement;
- c.insertBefore(b, c.firstChild);
- h.style.cssText = "position: absolute; left: 10.7432222px;";
- e = a(h).offset().left;
- a.support.offsetFractions = e > 10 && e < 11;
- b.innerHTML = "";
- c.removeChild(b);
- })();
-})(jQuery);
-
-(function(a) {
- "use strict";
- if (typeof define === "function" && define.amd) {
- define([ "jquery" ], a);
- } else if (window.jQuery && !window.jQuery.fn.iconpicker) {
- a(window.jQuery);
- }
-})(function(a) {
- "use strict";
- var b = {
- isEmpty: function(a) {
- return a === false || a === "" || a === null || a === undefined;
- },
- isEmptyObject: function(a) {
- return this.isEmpty(a) === true || a.length === 0;
- },
- isElement: function(b) {
- return a(b).length > 0;
- },
- isString: function(a) {
- return typeof a === "string" || a instanceof String;
- },
- isArray: function(b) {
- return a.isArray(b);
- },
- inArray: function(b, c) {
- return a.inArray(b, c) !== -1;
- },
- throwError: function(a) {
- throw "Font Awesome Icon Picker Exception: " + a;
- }
- };
- var c = function(d, e) {
- this._id = c._idCounter++;
- this.element = a(d).addClass("iconpicker-element");
- this._trigger("iconpickerCreate");
- this.options = a.extend({}, c.defaultOptions, this.element.data(), e);
- this.options.templates = a.extend({}, c.defaultOptions.templates, this.options.templates);
- this.options.originalPlacement = this.options.placement;
- this.container = b.isElement(this.options.container) ? a(this.options.container) : false;
- if (this.container === false) {
- this.container = this.element.is("input") ? this.element.parent() : this.element;
- }
- if (this.container.addClass("iconpicker-container").is(".dropdown-menu")) {
- this.options.placement = "inline";
- }
- this.input = this.element.is("input") ? this.element.addClass("iconpicker-input") : false;
- if (this.input === false) {
- this.input = this.container.find(this.options.input);
- }
- this.component = this.container.find(this.options.component).addClass("iconpicker-component");
- if (this.component.length === 0) {
- this.component = false;
- } else {
- this.component.find("i").addClass(this.options.iconComponentBaseClass);
- }
- this._createPopover();
- this._createIconpicker();
- if (this.getAcceptButton().length === 0) {
- this.options.mustAccept = false;
- }
- if (this.container.is(".input-group")) {
- this.container.parent().append(this.popover);
- } else {
- this.container.append(this.popover);
- }
- this._bindElementEvents();
- this._bindWindowEvents();
- this.update(this.options.selected);
- if (this.isInline()) {
- this.show();
- }
- this._trigger("iconpickerCreated");
- };
- c._idCounter = 0;
- c.defaultOptions = {
- title: false,
- selected: false,
- defaultValue: false,
- placement: "bottom",
- collision: "none",
- animation: true,
- hideOnSelect: false,
- showFooter: false,
- searchInFooter: false,
- mustAccept: false,
- selectedCustomClass: "bg-primary",
- icons: [],
- iconBaseClass: "fa",
- iconComponentBaseClass: "fa fa-fw",
- iconClassPrefix: "fa-",
- input: "input",
- component: ".input-group-addon",
- container: false,
- templates: {
- popover: '',
- footer: '',
- buttons: 'Cancel ' + ' Accept ',
- search: ' ',
- iconpicker: '',
- iconpickerItem: '
'
- }
- };
- c.batch = function(b, c) {
- var d = Array.prototype.slice.call(arguments, 2);
- return a(b).each(function() {
- var b = a(this).data("iconpicker");
- if (!!b) {
- b[c].apply(b, d);
- }
- });
- };
- c.prototype = {
- constructor: c,
- options: {},
- _id: 0,
- _trigger: function(b, c) {
- c = c || {};
- this.element.trigger(a.extend({
- type: b,
- iconpickerInstance: this
- }, c));
- },
- _createPopover: function() {
- this.popover = a(this.options.templates.popover);
- var c = this.popover.find(".popover-title");
- if (!!this.options.title) {
- c.append(a('' + this.options.title + "
"));
- }
- if (!this.options.searchInFooter && !b.isEmpty(this.options.templates.buttons)) {
- c.append(this.options.templates.search);
- } else if (!this.options.title) {
- c.remove();
- }
- if (this.options.showFooter && !b.isEmpty(this.options.templates.footer)) {
- var d = a(this.options.templates.footer);
- if (!b.isEmpty(this.options.templates.search) && this.options.searchInFooter) {
- d.append(a(this.options.templates.search));
- }
- if (!b.isEmpty(this.options.templates.buttons)) {
- d.append(a(this.options.templates.buttons));
- }
- this.popover.append(d);
- }
- if (this.options.animation === true) {
- this.popover.addClass("fade");
- }
- return this.popover;
- },
- _createIconpicker: function() {
- var b = this;
- this.iconpicker = a(this.options.templates.iconpicker);
- var c = function(c) {
- var d = a(this);
- if (d.is("." + b.options.iconBaseClass)) {
- d = d.parent();
- }
- b._trigger("iconpickerSelect", {
- iconpickerItem: d,
- iconpickerValue: b.iconpickerValue
- });
- if (b.options.mustAccept === false) {
- b.update(d.data("iconpickerValue"));
- b._trigger("iconpickerSelected", {
- iconpickerItem: this,
- iconpickerValue: b.iconpickerValue
- });
- } else {
- b.update(d.data("iconpickerValue"), true);
- }
- if (b.options.hideOnSelect && b.options.mustAccept === false) {
- b.hide();
- }
- };
- for (var d in this.options.icons) {
- var e = a(this.options.templates.iconpickerItem);
- e.find("i").addClass(b.options.iconBaseClass + " " + this.options.iconClassPrefix + this.options.icons[d]);
- e.data("iconpickerValue", this.options.icons[d]).on("click.iconpicker", c);
- this.iconpicker.find(".iconpicker-items").append(e.attr("title", "." + this.getValue(this.options.icons[d])));
- }
- this.popover.find(".popover-content").append(this.iconpicker);
- return this.iconpicker;
- },
- _isEventInsideIconpicker: function(b) {
- var c = a(b.target);
- if ((!c.hasClass("iconpicker-element") || c.hasClass("iconpicker-element") && !c.is(this.element)) && c.parents(".iconpicker-popover").length === 0) {
- return false;
- }
- return true;
- },
- _bindElementEvents: function() {
- var c = this;
- this.getSearchInput().on("keyup", function() {
- c.filter(a(this).val().toLowerCase());
- });
- this.getAcceptButton().on("click.iconpicker", function() {
- var a = c.iconpicker.find(".iconpicker-selected").get(0);
- c.update(c.iconpickerValue);
- c._trigger("iconpickerSelected", {
- iconpickerItem: a,
- iconpickerValue: c.iconpickerValue
- });
- if (!c.isInline()) {
- c.hide();
- }
- });
- this.getCancelButton().on("click.iconpicker", function() {
- if (!c.isInline()) {
- c.hide();
- }
- });
- this.element.on("focus.iconpicker", function(a) {
- c.show();
- a.stopPropagation();
- });
- if (this.hasComponent()) {
- this.component.on("click.iconpicker", function() {
- c.toggle();
- });
- }
- if (this.hasInput()) {
- this.input.on("keyup.iconpicker", function(a) {
- if (!b.inArray(a.keyCode, [ 38, 40, 37, 39, 16, 17, 18, 9, 8, 91, 93, 20, 46, 186, 190, 46, 78, 188, 44, 86 ])) {
- c.update();
- } else {
- c._updateFormGroupStatus(c.getValid(this.value) !== false);
- }
- });
- }
- },
- _bindWindowEvents: function() {
- var b = a(window.document);
- var c = this;
- var d = ".iconpicker.inst" + this._id;
- a(window).on("resize.iconpicker" + d + " orientationchange.iconpicker" + d, function(a) {
- if (c.popover.hasClass("in")) {
- c.updatePlacement();
- }
- });
- if (!c.isInline()) {
- b.on("mouseup" + d, function(a) {
- if (!c._isEventInsideIconpicker(a) && !c.isInline()) {
- c.hide();
- }
- a.stopPropagation();
- a.preventDefault();
- return false;
- });
- }
- return false;
- },
- _unbindElementEvents: function() {
- this.popover.off(".iconpicker");
- this.element.off(".iconpicker");
- if (this.hasInput()) {
- this.input.off(".iconpicker");
- }
- if (this.hasComponent()) {
- this.component.off(".iconpicker");
- }
- if (this.hasContainer()) {
- this.container.off(".iconpicker");
- }
- },
- _unbindWindowEvents: function() {
- a(window).off(".iconpicker.inst" + this._id);
- a(window.document).off(".iconpicker.inst" + this._id);
- },
- updatePlacement: function(b, c) {
- b = b || this.options.placement;
- this.options.placement = b;
- c = c || this.options.collision;
- c = c === true ? "flip" : c;
- var d = {
- at: "right bottom",
- my: "right top",
- of: this.hasInput() ? this.input : this.container,
- collision: c === true ? "flip" : c,
- within: window
- };
- this.popover.removeClass("inline topLeftCorner topLeft top topRight topRightCorner " + "rightTop right rightBottom bottomRight bottomRightCorner " + "bottom bottomLeft bottomLeftCorner leftBottom left leftTop");
- if (typeof b === "object") {
- return this.popover.pos(a.extend({}, d, b));
- }
- switch (b) {
- case "inline":
- {
- d = false;
- }
- break;
-
- case "topLeftCorner":
- {
- d.my = "right bottom";
- d.at = "left top";
- }
- break;
-
- case "topLeft":
- {
- d.my = "left bottom";
- d.at = "left top";
- }
- break;
-
- case "top":
- {
- d.my = "center bottom";
- d.at = "center top";
- }
- break;
-
- case "topRight":
- {
- d.my = "right bottom";
- d.at = "right top";
- }
- break;
-
- case "topRightCorner":
- {
- d.my = "left bottom";
- d.at = "right top";
- }
- break;
-
- case "rightTop":
- {
- d.my = "left bottom";
- d.at = "right center";
- }
- break;
-
- case "right":
- {
- d.my = "left center";
- d.at = "right center";
- }
- break;
-
- case "rightBottom":
- {
- d.my = "left top";
- d.at = "right center";
- }
- break;
-
- case "bottomRightCorner":
- {
- d.my = "left top";
- d.at = "right bottom";
- }
- break;
-
- case "bottomRight":
- {
- d.my = "right top";
- d.at = "right bottom";
- }
- break;
-
- case "bottom":
- {
- d.my = "center top";
- d.at = "center bottom";
- }
- break;
-
- case "bottomLeft":
- {
- d.my = "left top";
- d.at = "left bottom";
- }
- break;
-
- case "bottomLeftCorner":
- {
- d.my = "right top";
- d.at = "left bottom";
- }
- break;
-
- case "leftBottom":
- {
- d.my = "right top";
- d.at = "left center";
- }
- break;
-
- case "left":
- {
- d.my = "right center";
- d.at = "left center";
- }
- break;
-
- case "leftTop":
- {
- d.my = "right bottom";
- d.at = "left center";
- }
- break;
-
- default:
- {
- return false;
- }
- break;
- }
- this.popover.css({
- display: this.options.placement === "inline" ? "" : "block"
- });
- if (d !== false) {
- this.popover.pos(d).css("maxWidth", a(window).width() - this.container.offset().left - 5);
- } else {
- this.popover.css({
- top: "auto",
- right: "auto",
- bottom: "auto",
- left: "auto",
- maxWidth: "none"
- });
- }
- this.popover.addClass(this.options.placement);
- return true;
- },
- _updateComponents: function() {
- this.iconpicker.find(".iconpicker-item.iconpicker-selected").removeClass("iconpicker-selected " + this.options.selectedCustomClass);
- this.iconpicker.find("." + this.options.iconBaseClass + "." + this.options.iconClassPrefix + this.iconpickerValue).parent().addClass("iconpicker-selected " + this.options.selectedCustomClass);
- if (this.hasComponent()) {
- var a = this.component.find("i");
- if (a.length > 0) {
- a.attr("class", this.options.iconComponentBaseClass + " " + this.getValue());
- } else {
- this.component.html(this.getValueHtml());
- }
- }
- },
- _updateFormGroupStatus: function(a) {
- if (this.hasInput()) {
- if (a !== false) {
- this.input.parents(".form-group:first").removeClass("has-error");
- } else {
- this.input.parents(".form-group:first").addClass("has-error");
- }
- return true;
- }
- return false;
- },
- getValid: function(c) {
- if (!b.isString(c)) {
- c = "";
- }
- var d = c === "";
- c = a.trim(c.replace(this.options.iconClassPrefix, ""));
- if (b.inArray(c, this.options.icons) || d) {
- return c;
- }
- return false;
- },
- setValue: function(a) {
- var b = this.getValid(a);
- if (b !== false) {
- this.iconpickerValue = b;
- this._trigger("iconpickerSetValue", {
- iconpickerValue: b
- });
- return this.iconpickerValue;
- } else {
- this._trigger("iconpickerInvalid", {
- iconpickerValue: a
- });
- return false;
- }
- },
- getValue: function(a) {
- return this.options.iconClassPrefix + (a ? a : this.iconpickerValue);
- },
- getValueHtml: function() {
- return ' ';
- },
- setSourceValue: function(a) {
- a = this.setValue(a);
- if (a !== false && a !== "") {
- if (this.hasInput()) {
- this.input.val(this.getValue());
- } else {
- this.element.data("iconpickerValue", this.getValue());
- }
- this._trigger("iconpickerSetSourceValue", {
- iconpickerValue: a
- });
- }
- return a;
- },
- getSourceValue: function(a) {
- a = a || this.options.defaultValue;
- var b = a;
- if (this.hasInput()) {
- b = this.input.val();
- } else {
- b = this.element.data("iconpickerValue");
- }
- if (b === undefined || b === "" || b === null || b === false) {
- b = a;
- }
- return b;
- },
- hasInput: function() {
- return this.input !== false;
- },
- hasComponent: function() {
- return this.component !== false;
- },
- hasContainer: function() {
- return this.container !== false;
- },
- getAcceptButton: function() {
- return this.popover.find(".iconpicker-btn-accept");
- },
- getCancelButton: function() {
- return this.popover.find(".iconpicker-btn-cancel");
- },
- getSearchInput: function() {
- return this.popover.find(".iconpicker-search");
- },
- filter: function(c) {
- if (b.isEmpty(c)) {
- this.iconpicker.find(".iconpicker-item").show();
- return a(false);
- } else {
- var d = [];
- this.iconpicker.find(".iconpicker-item").each(function() {
- var b = a(this);
- var e = b.attr("title").toLowerCase();
- var f = false;
- try {
- f = new RegExp(c, "g");
- } catch (g) {
- f = false;
- }
- if (f !== false && e.match(f)) {
- d.push(b);
- b.show();
- } else {
- b.hide();
- }
- });
- return d;
- }
- },
- show: function() {
- if (this.popover.hasClass("in")) {
- return false;
- }
- a.iconpicker.batch(a(".iconpicker-popover.in:not(.inline)").not(this.popover), "hide");
- this._trigger("iconpickerShow");
- this.updatePlacement();
- this.popover.addClass("in");
- setTimeout(a.proxy(function() {
- this.popover.css("display", this.isInline() ? "" : "block");
- this._trigger("iconpickerShown");
- }, this), this.options.animation ? 300 : 1);
- },
- hide: function() {
- if (!this.popover.hasClass("in")) {
- return false;
- }
- this._trigger("iconpickerHide");
- this.popover.removeClass("in");
- setTimeout(a.proxy(function() {
- this.popover.css("display", "none");
- this.getSearchInput().val("");
- this.filter("");
- this._trigger("iconpickerHidden");
- }, this), this.options.animation ? 300 : 1);
- },
- toggle: function() {
- if (this.popover.is(":visible")) {
- this.hide();
- } else {
- this.show(true);
- }
- },
- update: function(a, b) {
- a = a ? a : this.getSourceValue(this.iconpickerValue);
- this._trigger("iconpickerUpdate");
- if (b === true) {
- a = this.setValue(a);
- } else {
- a = this.setSourceValue(a);
- this._updateFormGroupStatus(a !== false);
- }
- if (a !== false) {
- this._updateComponents();
- }
- this._trigger("iconpickerUpdated");
- return a;
- },
- destroy: function() {
- this._trigger("iconpickerDestroy");
- this.element.removeData("iconpicker").removeData("iconpickerValue").removeClass("iconpicker-element");
- this._unbindElementEvents();
- this._unbindWindowEvents();
- a(this.popover).remove();
- this._trigger("iconpickerDestroyed");
- },
- disable: function() {
- if (this.hasInput()) {
- this.input.prop("disabled", true);
- return true;
- }
- return false;
- },
- enable: function() {
- if (this.hasInput()) {
- this.input.prop("disabled", false);
- return true;
- }
- return false;
- },
- isDisabled: function() {
- if (this.hasInput()) {
- return this.input.prop("disabled") === true;
- }
- return false;
- },
- isInline: function() {
- return this.options.placement === "inline" || this.popover.hasClass("inline");
- }
- };
- a.iconpicker = c;
- a.fn.iconpicker = function(b) {
- return this.each(function() {
- var d = a(this);
- if (!d.data("iconpicker")) {
- d.data("iconpicker", new c(this, typeof b === "object" ? b : {}));
- }
- });
- };
- c.defaultOptions.icons = [ "adjust", "adn", "align-center", "align-justify", "align-left", "align-right", "ambulance", "anchor", "android", "angle-double-down", "angle-double-left", "angle-double-right", "angle-double-up", "angle-down", "angle-left", "angle-right", "angle-up", "apple", "archive", "arrow-circle-down", "arrow-circle-left", "arrow-circle-o-down", "arrow-circle-o-left", "arrow-circle-o-right", "arrow-circle-o-up", "arrow-circle-right", "arrow-circle-up", "arrow-down", "arrow-left", "arrow-right", "arrow-up", "arrows", "arrows-alt", "arrows-h", "arrows-v", "asterisk", "automobile", "backward", "ban", "bank", "bar-chart-o", "barcode", "bars", "beer", "behance", "behance-square", "bell", "bell-o", "bitbucket", "bitbucket-square", "bitcoin", "bold", "bolt", "bomb", "book", "bookmark", "bookmark-o", "briefcase", "btc", "bug", "building", "building-o", "bullhorn", "bullseye", "cab", "calendar", "calendar-o", "camera", "camera-retro", "car", "caret-down", "caret-left", "caret-right", "caret-square-o-down", "caret-square-o-left", "caret-square-o-right", "caret-square-o-up", "caret-up", "certificate", "chain", "chain-broken", "check", "check-circle", "check-circle-o", "check-square", "check-square-o", "chevron-circle-down", "chevron-circle-left", "chevron-circle-right", "chevron-circle-up", "chevron-down", "chevron-left", "chevron-right", "chevron-up", "child", "circle", "circle-o", "circle-o-notch", "circle-thin", "clipboard", "clock-o", "cloud", "cloud-download", "cloud-upload", "cny", "code", "code-fork", "codepen", "coffee", "cog", "cogs", "columns", "comment", "comment-o", "comments", "comments-o", "compass", "compress", "copy", "credit-card", "crop", "crosshairs", "css3", "cube", "cubes", "cut", "cutlery", "dashboard", "database", "dedent", "delicious", "desktop", "deviantart", "digg", "dollar", "dot-circle-o", "download", "dribbble", "dropbox", "drupal", "edit", "eject", "ellipsis-h", "ellipsis-v", "empire", "envelope", "envelope-o", "envelope-square", "eraser", "eur", "euro", "exchange", "exclamation", "exclamation-circle", "exclamation-triangle", "expand", "external-link", "external-link-square", "eye", "eye-slash", "facebook", "facebook-square", "fast-backward", "fast-forward", "fax", "female", "fighter-jet", "file", "file-archive-o", "file-audio-o", "file-code-o", "file-excel-o", "file-image-o", "file-movie-o", "file-o", "file-pdf-o", "file-photo-o", "file-picture-o", "file-powerpoint-o", "file-sound-o", "file-text", "file-text-o", "file-video-o", "file-word-o", "file-zip-o", "files-o", "film", "filter", "fire", "fire-extinguisher", "flag", "flag-checkered", "flag-o", "flash", "flask", "flickr", "floppy-o", "folder", "folder-o", "folder-open", "folder-open-o", "font", "forward", "foursquare", "frown-o", "gamepad", "gavel", "gbp", "ge", "gear", "gears", "gift", "git", "git-square", "github", "github-alt", "github-square", "gittip", "glass", "globe", "google", "google-plus", "google-plus-square", "graduation-cap", "group", "h-square", "hacker-news", "hand-o-down", "hand-o-left", "hand-o-right", "hand-o-up", "hdd-o", "header", "headphones", "heart", "heart-o", "history", "home", "hospital-o", "html5", "image", "inbox", "indent", "info", "info-circle", "inr", "instagram", "institution", "italic", "joomla", "jpy", "jsfiddle", "key", "keyboard-o", "krw", "language", "laptop", "leaf", "legal", "lemon-o", "level-down", "level-up", "life-bouy", "life-ring", "life-saver", "lightbulb-o", "link", "linkedin", "linkedin-square", "linux", "list", "list-alt", "list-ol", "list-ul", "location-arrow", "lock", "long-arrow-down", "long-arrow-left", "long-arrow-right", "long-arrow-up", "magic", "magnet", "mail-forward", "mail-reply", "mail-reply-all", "male", "map-marker", "maxcdn", "medkit", "meh-o", "microphone", "microphone-slash", "minus", "minus-circle", "minus-square", "minus-square-o", "mobile", "mobile-phone", "money", "moon-o", "mortar-board", "music", "navicon", "openid", "outdent", "pagelines", "paper-plane", "paper-plane-o", "paperclip", "paragraph", "paste", "pause", "paw", "pencil", "pencil-square", "pencil-square-o", "phone", "phone-square", "photo", "picture-o", "pied-piper", "pied-piper-alt", "pied-piper-square", "pinterest", "pinterest-square", "plane", "play", "play-circle", "play-circle-o", "plus", "plus-circle", "plus-square", "plus-square-o", "power-off", "print", "puzzle-piece", "qq", "qrcode", "question", "question-circle", "quote-left", "quote-right", "ra", "random", "rebel", "recycle", "reddit", "reddit-square", "refresh", "renren", "reorder", "repeat", "reply", "reply-all", "retweet", "rmb", "road", "rocket", "rotate-left", "rotate-right", "rouble", "rss", "rss-square", "rub", "ruble", "rupee", "save", "scissors", "search", "search-minus", "search-plus", "send", "send-o", "share", "share-alt", "share-alt-square", "share-square", "share-square-o", "shield", "shopping-cart", "sign-in", "sign-out", "signal", "sitemap", "skype", "slack", "sliders", "smile-o", "sort", "sort-alpha-asc", "sort-alpha-desc", "sort-amount-asc", "sort-amount-desc", "sort-asc", "sort-desc", "sort-down", "sort-numeric-asc", "sort-numeric-desc", "sort-up", "soundcloud", "space-shuttle", "spinner", "spoon", "spotify", "square", "square-o", "stack-exchange", "stack-overflow", "star", "star-half", "star-half-empty", "star-half-full", "star-half-o", "star-o", "steam", "steam-square", "step-backward", "step-forward", "stethoscope", "stop", "strikethrough", "stumbleupon", "stumbleupon-circle", "subscript", "suitcase", "sun-o", "superscript", "support", "table", "tablet", "tachometer", "tag", "tags", "tasks", "taxi", "tencent-weibo", "terminal", "text-height", "text-width", "th", "th-large", "th-list", "thumb-tack", "thumbs-down", "thumbs-o-down", "thumbs-o-up", "thumbs-up", "ticket", "times", "times-circle", "times-circle-o", "tint", "toggle-down", "toggle-left", "toggle-right", "toggle-up", "trash-o", "tree", "trello", "trophy", "truck", "try", "tumblr", "tumblr-square", "turkish-lira", "twitter", "twitter-square", "umbrella", "underline", "undo", "university", "unlink", "unlock", "unlock-alt", "unsorted", "upload", "usd", "user", "user-md", "users", "video-camera", "vimeo-square", "vine", "vk", "volume-down", "volume-off", "volume-up", "warning", "wechat", "weibo", "weixin", "wheelchair", "windows", "won", "wordpress", "wrench", "xing", "xing-square", "yahoo", "yen", "youtube", "youtube-play", "youtube-square" ];
-});
\ No newline at end of file
diff --git a/code/vendor/fontawesome-iconpicker-1.0.0/index.html b/code/vendor/fontawesome-iconpicker-1.0.0/index.html
deleted file mode 100644
index ec4a786..0000000
--- a/code/vendor/fontawesome-iconpicker-1.0.0/index.html
+++ /dev/null
@@ -1,256 +0,0 @@
-
-
-
-
- Font Awesome Icon Picker plugin for Bootstrap
-
-
-
-
-
-
-
-
-
-
-
-
- Font Awesome Icon Picker is a fully customizable plugin for Twitter Bootstrap,
- with a powerful base API, based on
- Bootstrap Popover Picker
-
-
-
-You can use Font Awesome or another font icon set of your choice (icon options and items are customizable).
-
-
-
-
Demos
-
-
-
-
-
-
-
-
- Default
-
-
-
-
-
- Inline mode, without input:
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/code/vendor/fontawesome-iconpicker-1.0.0/package.json b/code/vendor/fontawesome-iconpicker-1.0.0/package.json
deleted file mode 100644
index 95a8b3e..0000000
--- a/code/vendor/fontawesome-iconpicker-1.0.0/package.json
+++ /dev/null
@@ -1,35 +0,0 @@
-{
- "name": "fontawesome-iconpicker",
- "version": "1.0.0",
- "description": "Font Awesome Icon Picker plugin template for Twitter Bootstrap",
- "homepage": "http://mjolnic.github.io/fontawesome-iconpicker/",
- "repository": {
- "type": "git",
- "url": "git@github.com:mjolnic/fontawesome-iconpicker.git"
- },
- "bugs": {
- "url": "https://github.com/mjolnic/fontawesome-iconpicker/issues"
- },
- "keywords": [
- "bootstrap",
- "fontawesome",
- "iconpicker",
- "popover",
- "picker"
- ],
- "author": "Javier Aguilar @mjolnic",
- "licenses": [{
- "type": "MIT",
- "url": "https://github.com/mjolnic/fontawesome-iconpicker/blob/master/LICENSE"
- }],
- "devDependencies": {
- "grunt": "~0.4.5",
- "grunt-contrib-clean": "~0.5.0",
- "grunt-contrib-jshint": "~0.10.0",
- "grunt-contrib-less": "~0.11.2",
- "grunt-contrib-uglify": "~0.5.0",
- "grunt-contrib-concat": "~0.4.0",
- "grunt-jsbeautifier": "~0.2.7",
- "grunt-contrib-watch": "~0.6.1"
- }
-}
\ No newline at end of file
diff --git a/code/vendor/fontawesome-iconpicker-1.0.0/src/js/iconpicker.js b/code/vendor/fontawesome-iconpicker-1.0.0/src/js/iconpicker.js
deleted file mode 100644
index e6040c7..0000000
--- a/code/vendor/fontawesome-iconpicker-1.0.0/src/js/iconpicker.js
+++ /dev/null
@@ -1,872 +0,0 @@
-/*!
- * Font Awesome Icon Picker
- * http://mjolnic.github.io/fontawesome-iconpicker/
- *
- * Originally written by (c) 2014 Javier Aguilar @mjolnic
- * Licensed under the MIT License
- * https://github.com/mjolnic/fontawesome-iconpicker/blob/master/LICENSE
- *
- */
-
-(function(factory) {
- "use strict";
- if (typeof define === 'function' && define.amd) {
- define(['jquery'], factory);
- } else if (window.jQuery && !window.jQuery.fn.iconpicker) {
- factory(window.jQuery);
- }
-}
-(function($) {
- 'use strict';
-
- var _helpers = {
- isEmpty: function(val) {
- return ((val === false) || (val === '') || (val === null) || (val === undefined));
- },
- isEmptyObject: function(val) {
- return (this.isEmpty(val) === true) || (val.length === 0);
- },
- isElement: function(selector) {
- return ($(selector).length > 0);
- },
- isString: function(val) {
- return ((typeof val === 'string') || (val instanceof String));
- },
- isArray: function(val) {
- return $.isArray(val);
- },
- inArray: function(val, arr) {
- return ($.inArray(val, arr) !== -1);
- },
- throwError: function(text) {
- throw "Font Awesome Icon Picker Exception: " + text;
- }
- };
-
- var Iconpicker = function(element, options) {
- this._id = Iconpicker._idCounter++;
- this.element = $(element).addClass('iconpicker-element');
- this._trigger('iconpickerCreate');
- this.options = $.extend({}, Iconpicker.defaultOptions, this.element.data(), options);
- this.options.templates = $.extend({}, Iconpicker.defaultOptions.templates, this.options.templates);
- this.options.originalPlacement = this.options.placement;
-
- // Iconpicker container element
- this.container = (_helpers.isElement(this.options.container) ? $(this.options.container) : false);
- if (this.container === false) {
- this.container = (this.element.is('input') ? this.element.parent() : this.element);
- }
- if (this.container.addClass('iconpicker-container').is('.dropdown-menu')) {
- this.options.placement = 'inline';
- }
-
- // Is the element an input? Should we search inside for any input?
- this.input = (this.element.is('input') ? this.element.addClass('iconpicker-input') : false);
- if (this.input === false) {
- this.input = (this.container.find(this.options.input));
- }
-
- // Plugin as component ?
- this.component = this.container.find(this.options.component).addClass('iconpicker-component');
- if (this.component.length === 0) {
- this.component = false;
- }else{
- this.component.find('i').addClass(this.options.iconComponentBaseClass);
- }
-
- // Create popover and iconpicker HTML
- this._createPopover();
- this._createIconpicker();
-
- if (this.getAcceptButton().length === 0) {
- // disable this because we don't have accept buttons
- this.options.mustAccept = false;
- }
-
- // Avoid CSS issues with input-group-addon(s)
- if (this.container.is('.input-group')) {
- this.container.parent().append(this.popover);
- } else {
- this.container.append(this.popover);
- }
-
- // Bind events
- this._bindElementEvents();
- this._bindWindowEvents();
-
- // Refresh everything
- this.update(this.options.selected);
-
- if (this.isInline()) {
- this.show();
- }
-
- this._trigger('iconpickerCreated');
- };
-
- // Instance identifier counter
- Iconpicker._idCounter = 0;
-
- Iconpicker.defaultOptions = {
- title: false, // Popover title (optional) only if specified in the template
- selected: false, // use this value as the current item and ignore the original
- defaultValue: false, // use this value as the current item if input or element item is empty
- placement: 'bottom', // (has some issues with auto and CSS). auto, top, bottom, left, right
- collision: 'none', // If true, the popover will be repositioned to another position when collapses with the window borders
- animation: true,
- //hide iconpicker automatically when a value is picked. it is ignored if mustAccept is not false and the accept button is visible
- hideOnSelect: false,
- showFooter: false,
- searchInFooter: false, // If true, the search will be added to the footer instead of the title
- mustAccept: false, // only applicable when there's an iconpicker-btn-accept button in the popover footer
- selectedCustomClass: 'bg-primary', // Appends this class when to the selected item
- icons: [], // list of icons (declared at the bottom of this script for maintainability)
- iconBaseClass: 'fa',
- iconComponentBaseClass: 'fa fa-fw',
- iconClassPrefix: 'fa-',
- input: 'input', // children input selector
- component: '.input-group-addon', // children component jQuery selector or object, relative to the parent element
- container: false, // Appends the popover to a specific element. If true, appends to the jQuery element.
- // Plugin templates:
- templates: {
- popover: '',
- footer: '',
- buttons: 'Cancel ' +
- ' Accept ',
- search: ' ',
- iconpicker: '',
- iconpickerItem: '
'
- }
- };
-
- Iconpicker.batch = function(selector, method) {
- var args = Array.prototype.slice.call(arguments, 2);
- return $(selector).each(function() {
- var $inst = $(this).data('iconpicker');
- if (!!$inst) {
- $inst[method].apply($inst, args);
- }
- });
- };
-
- Iconpicker.prototype = {
- constructor: Iconpicker,
- options: {},
- _id: 0, // instance identifier for bind/unbind events
- _trigger: function(name, opts) {
- //triggers an event bound to the element
- opts = opts || {};
- this.element.trigger($.extend({
- type: name,
- iconpickerInstance: this
- }, opts));
- //console.log(name + ' triggered for instance #' + this._id);
- },
- _createPopover: function() {
- this.popover = $(this.options.templates.popover);
-
- // title (header)
- var _title = this.popover.find('.popover-title');
- if (!!this.options.title) {
- _title.append($('' + this.options.title + '
'));
- }
- if (!this.options.searchInFooter && !_helpers.isEmpty(this.options.templates.buttons)) {
- _title.append(this.options.templates.search);
- } else if (!this.options.title) {
- _title.remove();
- }
-
- // footer
- if (this.options.showFooter && !_helpers.isEmpty(this.options.templates.footer)) {
- var _footer = $(this.options.templates.footer);
- if (!_helpers.isEmpty(this.options.templates.search) && this.options.searchInFooter) {
- _footer.append($(this.options.templates.search));
- }
- if (!_helpers.isEmpty(this.options.templates.buttons)) {
- _footer.append($(this.options.templates.buttons));
- }
- this.popover.append(_footer);
- }
-
- if (this.options.animation === true) {
- this.popover.addClass('fade');
- }
-
- return this.popover;
- },
- _createIconpicker: function() {
- var _self = this;
- this.iconpicker = $(this.options.templates.iconpicker);
-
- var itemClickFn = function(e) {
- var $this = $(this);
- if ($this.is('.' + _self.options.iconBaseClass)) {
- $this = $this.parent();
- }
-
- _self._trigger('iconpickerSelect', {
- iconpickerItem: $this,
- iconpickerValue: _self.iconpickerValue
- });
-
- if (_self.options.mustAccept === false) {
- _self.update($this.data('iconpickerValue'));
- _self._trigger('iconpickerSelected', {
- iconpickerItem: this,
- iconpickerValue: _self.iconpickerValue
- });
- } else {
- _self.update($this.data('iconpickerValue'), true);
- }
-
- if (_self.options.hideOnSelect && (_self.options.mustAccept === false)) {
- // only hide when the accept button is not present
- _self.hide();
- }
- };
-
- for (var i in this.options.icons) {
- var itemElement = $(this.options.templates.iconpickerItem);
- itemElement.find('i')
- .addClass(_self.options.iconBaseClass + " " +
- this.options.iconClassPrefix + this.options.icons[i]);
- itemElement.data('iconpickerValue', this.options.icons[i])
- .on('click.iconpicker', itemClickFn);
- this.iconpicker.find('.iconpicker-items').append(itemElement
- .attr('title', '.' + this.getValue(this.options.icons[i])));
- }
-
- this.popover.find('.popover-content').append(this.iconpicker);
-
- return this.iconpicker;
- },
- _isEventInsideIconpicker: function(e) {
- var _t = $(e.target);
- if ((!_t.hasClass('iconpicker-element') ||
- (_t.hasClass('iconpicker-element') && !_t.is(this.element))) &&
- (_t.parents('.iconpicker-popover').length === 0)) {
- return false;
- }
- return true;
- },
- _bindElementEvents: function() {
- var _self = this;
-
- this.getSearchInput().on('keyup', function() {
- _self.filter($(this).val().toLowerCase());
- });
-
- this.getAcceptButton().on('click.iconpicker', function() {
- var _picked = _self.iconpicker.find('.iconpicker-selected').get(0);
-
- _self.update(_self.iconpickerValue);
-
- _self._trigger('iconpickerSelected', {
- iconpickerItem: _picked,
- iconpickerValue: _self.iconpickerValue
- });
- if (!_self.isInline()) {
- _self.hide();
- }
- });
- this.getCancelButton().on('click.iconpicker', function() {
- if (!_self.isInline()) {
- _self.hide();
- }
- });
-
- this.element.on('focus.iconpicker', function(e) {
- _self.show();
- e.stopPropagation();
- });
-
- if (this.hasComponent()) {
- this.component.on('click.iconpicker', function() {
- _self.toggle();
- });
- }
-
- if (this.hasInput()) {
- // Bind input keyup event
- this.input.on('keyup.iconpicker', function(e) {
- if (!_helpers.inArray(e.keyCode, [38, 40, 37, 39, 16, 17, 18, 9, 8, 91, 93, 20, 46, 186, 190, 46, 78, 188, 44, 86])) {
- _self.update();
- } else {
- _self._updateFormGroupStatus(_self.getValid(this.value) !== false);
- }
- //_self.hide();
- });
- }
-
- },
- _bindWindowEvents: function() {
- var $doc = $(window.document);
- var _self = this;
-
- // Add a namespace to the document events so they can be identified
- // later for every instance separately
- var _eventNs = '.iconpicker.inst' + this._id;
-
- $(window).on('resize.iconpicker' + _eventNs + ' orientationchange.iconpicker' + _eventNs, function(e) {
- // reposition popover
- if (_self.popover.hasClass('in')) {
- _self.updatePlacement();
- }
- });
-
- if (!_self.isInline()) {
- $doc.on('mouseup' + _eventNs, function(e) {
- if (!_self._isEventInsideIconpicker(e) && !_self.isInline()) {
- _self.hide();
- }
- e.stopPropagation();
- e.preventDefault();
- return false;
- });
- }
-
- return false;
- },
- _unbindElementEvents: function() {
- this.popover.off('.iconpicker');
- this.element.off('.iconpicker');
-
- if (this.hasInput()) {
- this.input.off('.iconpicker');
- }
-
- if (this.hasComponent()) {
- this.component.off('.iconpicker');
- }
-
- if (this.hasContainer()) {
- this.container.off('.iconpicker');
- }
- },
- _unbindWindowEvents: function() {
- // destroy window and window.document bound events
- $(window).off('.iconpicker.inst' + this._id);
- $(window.document).off('.iconpicker.inst' + this._id);
- },
- updatePlacement: function(placement, collision) {
- placement = placement || this.options.placement;
- this.options.placement = placement; // set new placement
- collision = collision || this.options.collision;
- collision = (collision === true ? 'flip' : collision);
-
- var _pos = {
- // at: Defines which position (or side) on container element to align the
- // popover element against: "horizontal vertical" alignment.
- at: "right bottom",
- // my: Defines which position (or side) on the popover being positioned to align
- // with the container element: "horizontal vertical" alignment
- my: "right top",
- // of: Which element to position against.
- of: this.hasInput() ? this.input : this.container,
- // collision: When the positioned element overflows the window (or within element)
- // in some direction, move it to an alternative position.
- collision: (collision === true ? 'flip' : collision),
- // within: Element to position within, affecting collision detection.
- within: window
- };
-
- // remove previous classes
- this.popover.removeClass('inline topLeftCorner topLeft top topRight topRightCorner ' +
- 'rightTop right rightBottom bottomRight bottomRightCorner ' +
- 'bottom bottomLeft bottomLeftCorner leftBottom left leftTop');
-
- if (typeof placement === 'object') {
- // custom position ?
- return this.popover.pos($.extend({}, _pos, placement));
- }
-
- switch (placement) {
- case 'inline':
- {
- _pos = false;
- }
- break;
- case 'topLeftCorner':
- {
- _pos.my = 'right bottom';
- _pos.at = 'left top';
- }
- break;
-
- case 'topLeft':
- {
- _pos.my = 'left bottom';
- _pos.at = 'left top';
- }
- break;
-
- case 'top':
- {
- _pos.my = 'center bottom';
- _pos.at = 'center top';
- }
- break;
-
- case 'topRight':
- {
- _pos.my = 'right bottom';
- _pos.at = 'right top';
- }
- break;
-
- case 'topRightCorner':
- {
- _pos.my = 'left bottom';
- _pos.at = 'right top';
- }
- break;
-
- case 'rightTop':
- {
- _pos.my = 'left bottom';
- _pos.at = 'right center';
- }
- break;
-
- case 'right':
- {
- _pos.my = 'left center';
- _pos.at = 'right center';
- }
- break;
-
- case 'rightBottom':
- {
- _pos.my = 'left top';
- _pos.at = 'right center';
- }
- break;
-
- case 'bottomRightCorner':
- {
- _pos.my = 'left top';
- _pos.at = 'right bottom';
- }
- break;
-
- case 'bottomRight':
- {
- _pos.my = 'right top';
- _pos.at = 'right bottom';
- }
- break;
- case 'bottom':
- {
- _pos.my = 'center top';
- _pos.at = 'center bottom';
- }
- break;
-
- case 'bottomLeft':
- {
- _pos.my = 'left top';
- _pos.at = 'left bottom';
- }
- break;
-
- case 'bottomLeftCorner':
- {
- _pos.my = 'right top';
- _pos.at = 'left bottom';
- }
- break;
-
- case 'leftBottom':
- {
- _pos.my = 'right top';
- _pos.at = 'left center';
- }
- break;
-
- case 'left':
- {
- _pos.my = 'right center';
- _pos.at = 'left center';
- }
- break;
-
- case 'leftTop':
- {
- _pos.my = 'right bottom';
- _pos.at = 'left center';
- }
- break;
-
- default:
- {
- return false;
- }
- break;
-
- }
-
- this.popover.css({
- 'display': (this.options.placement === 'inline') ? '' : 'block'
- });
-
- if (_pos !== false) {
- this.popover.pos(_pos).css('maxWidth', $(window).width() - this.container.offset().left - 5);
- } else {
- //reset position
- this.popover.css({
- 'top': 'auto',
- 'right': 'auto',
- 'bottom': 'auto',
- 'left': 'auto',
- 'maxWidth': 'none'
- });
- }
- this.popover.addClass(this.options.placement);
-
- return true;
- },
- _updateComponents: function() {
- // Update selected item
- this.iconpicker.find('.iconpicker-item.iconpicker-selected')
- .removeClass('iconpicker-selected ' + this.options.selectedCustomClass);
-
- this.iconpicker.find('.' + this.options.iconBaseClass + '.' +
- this.options.iconClassPrefix + this.iconpickerValue).parent()
- .addClass('iconpicker-selected ' + this.options.selectedCustomClass);
-
- // Update component item
- if (this.hasComponent()) {
- var icn = this.component.find('i');
- if (icn.length > 0) {
- icn.attr('class', this.options.iconComponentBaseClass + ' ' + this.getValue());
- } else {
- this.component.html(this.getValueHtml());
- }
- }
-
- },
- _updateFormGroupStatus: function(isValid) {
- if (this.hasInput()) {
- if (isValid !== false) {
- // Remove form-group error class if any
- this.input.parents('.form-group:first').removeClass('has-error');
- } else {
- this.input.parents('.form-group:first').addClass('has-error');
- }
- return true;
- }
- return false;
- },
- getValid: function(val) {
- // here we must validate the value (you may change this validation
- // to suit your needs
- if (!_helpers.isString(val)) {
- val = '';
- }
-
- var isEmpty = (val==='');
-
- // trimmed and sanitized string without the icon class prefix
- val = $.trim(val.replace(this.options.iconClassPrefix, ''));
-
- if (_helpers.inArray(val, this.options.icons) || isEmpty) {
- return val;
- }
- return false;
- },
- /**
- * Sets the internal item value and updates everything, excepting the input or element.
- * For doing so, call setSourceValue() or update() instead
- */
- setValue: function(val) {
- // sanitize first
- var _val = this.getValid(val);
- if (_val !== false) {
- this.iconpickerValue = _val;
- this._trigger('iconpickerSetValue', {
- iconpickerValue: _val
- });
- return this.iconpickerValue;
- } else {
- this._trigger('iconpickerInvalid', {
- iconpickerValue: val
- });
- return false;
- }
- },
- /**
- * Returns the formatted item value
- * @returns string
- */
- getValue: function(val) {
- return this.options.iconClassPrefix + (val ? val : this.iconpickerValue);
- },
- getValueHtml: function() {
- return ' ';
- },
- /**
- * Calls setValue and if it's a valid item value, sets the input or element value
- */
- setSourceValue: function(val) {
- val = this.setValue(val);
- if ((val !== false) && (val !== '')) {
- if (this.hasInput()) {
- this.input.val(this.getValue());
- } else {
- this.element.data('iconpickerValue', this.getValue());
- }
- this._trigger('iconpickerSetSourceValue', {
- iconpickerValue: val
- });
- }
- return val;
- },
- /**
- * Returns the input or element item value, without formatting, or defaultValue
- * if it's empty string, undefined, false or null
- * @param {type} defaultValue
- * @returns string|mixed
- */
- getSourceValue: function(defaultValue) {
- // returns the input or element value, as string
- defaultValue = defaultValue || this.options.defaultValue;
- var val = defaultValue;
-
- if (this.hasInput()) {
- val = this.input.val();
- } else {
- val = this.element.data('iconpickerValue');
- }
- if ((val === undefined) || (val === '') || (val === null) || (val === false)) {
- // if not defined or empty, return default
- val = defaultValue;
- }
- return val;
- },
- hasInput: function() {
- return (this.input !== false);
- },
- hasComponent: function() {
- return (this.component !== false);
- },
- hasContainer: function() {
- return (this.container !== false);
- },
- getAcceptButton: function() {
- return this.popover.find('.iconpicker-btn-accept');
- },
- getCancelButton: function() {
- return this.popover.find('.iconpicker-btn-cancel');
- },
- getSearchInput: function() {
- return this.popover.find('.iconpicker-search');
- },
- filter: function(filterText) {
- if (_helpers.isEmpty(filterText)) {
- this.iconpicker.find('.iconpicker-item').show();
- return $(false);
- } else {
- var found = [];
- this.iconpicker.find('.iconpicker-item').each(function() {
- var $this = $(this);
- var text = $this.attr('title').toLowerCase();
- var regex = false;
- try {
- regex = new RegExp(filterText, 'g');
- } catch (e) {
- regex = false;
- }
- if ((regex !== false) && text.match(regex)) {
- found.push($this);
- $this.show();
- } else {
- $this.hide();
- }
- });
- return found;
- }
- },
- show: function() {
- if (this.popover.hasClass('in')) {
- return false;
- }
- // hide other non-inline pickers
- $.iconpicker.batch($('.iconpicker-popover.in:not(.inline)').not(this.popover), 'hide');
-
- this._trigger('iconpickerShow');
- this.updatePlacement();
- this.popover.addClass('in');
- setTimeout($.proxy(function() {
- this.popover.css('display', this.isInline() ? '' : 'block');
- this._trigger('iconpickerShown');
- }, this), this.options.animation ? 300 : 1); // animation duration
- },
- hide: function() {
- if (!this.popover.hasClass('in')) {
- return false;
- }
- this._trigger('iconpickerHide');
- this.popover.removeClass('in');
- setTimeout($.proxy(function() {
- this.popover.css('display', 'none');
- this.getSearchInput().val('');
- this.filter(''); // clear filter
- this._trigger('iconpickerHidden');
- }, this), this.options.animation ? 300 : 1);
- },
- toggle: function() {
- if (this.popover.is(":visible")) {
- this.hide();
- } else {
- this.show(true);
- }
- },
- update: function(val, updateOnlyInternal) {
- val = (val ? val : this.getSourceValue(this.iconpickerValue));
- // reads the input or element value again and tries to update the plugin
- // fallback to the current selected item value
- this._trigger('iconpickerUpdate');
-
- if (updateOnlyInternal === true) {
- val = this.setValue(val);
- } else {
- val = this.setSourceValue(val);
- this._updateFormGroupStatus(val !== false);
- }
-
- if (val !== false) {
- this._updateComponents();
- }
-
- this._trigger('iconpickerUpdated');
- return val;
- },
- destroy: function() {
- this._trigger('iconpickerDestroy');
-
- // unbinds events and resets everything to the initial state,
- // including component mode
- this.element.removeData('iconpicker').removeData('iconpickerValue').removeClass('iconpicker-element');
-
- this._unbindElementEvents();
- this._unbindWindowEvents();
-
- $(this.popover).remove();
-
- this._trigger('iconpickerDestroyed');
- },
- disable: function() {
- if (this.hasInput()) {
- this.input.prop('disabled', true);
- return true;
- }
- return false;
- },
- enable: function() {
- if (this.hasInput()) {
- this.input.prop('disabled', false);
- return true;
- }
- return false;
- },
- isDisabled: function() {
- if (this.hasInput()) {
- return (this.input.prop('disabled') === true);
- }
- return false;
- },
- isInline: function() {
- return (this.options.placement === 'inline') || (this.popover.hasClass('inline'));
- }
- };
-
- $.iconpicker = Iconpicker;
-
- // jQuery plugin
- $.fn.iconpicker = function(options) {
- return this.each(function() {
- var $this = $(this);
- if (!$this.data('iconpicker')) {
- // create plugin instance (only if not exists) and expose the entire instance API
- $this.data('iconpicker', new Iconpicker(this, ((typeof options === 'object') ? options : {})));
- }
- });
- };
-
- // List of all Font Awesome icons without class prefix
- Iconpicker.defaultOptions.icons = [
- 'adjust', 'adn', 'align-center', 'align-justify', 'align-left', 'align-right', 'ambulance',
- 'anchor', 'android', 'angle-double-down', 'angle-double-left', 'angle-double-right', 'angle-double-up',
- 'angle-down', 'angle-left', 'angle-right', 'angle-up', 'apple', 'archive', 'arrow-circle-down',
- 'arrow-circle-left', 'arrow-circle-o-down', 'arrow-circle-o-left', 'arrow-circle-o-right',
- 'arrow-circle-o-up', 'arrow-circle-right', 'arrow-circle-up', 'arrow-down', 'arrow-left',
- 'arrow-right', 'arrow-up', 'arrows', 'arrows-alt', 'arrows-h', 'arrows-v', 'asterisk',
- 'automobile', 'backward', 'ban', 'bank', 'bar-chart-o', 'barcode', 'bars', 'beer',
- 'behance', 'behance-square', 'bell', 'bell-o', 'bitbucket', 'bitbucket-square', 'bitcoin',
- 'bold', 'bolt', 'bomb', 'book', 'bookmark', 'bookmark-o', 'briefcase', 'btc',
- 'bug', 'building', 'building-o', 'bullhorn', 'bullseye', 'cab', 'calendar', 'calendar-o',
- 'camera', 'camera-retro', 'car', 'caret-down', 'caret-left', 'caret-right',
- 'caret-square-o-down', 'caret-square-o-left', 'caret-square-o-right', 'caret-square-o-up',
- 'caret-up', 'certificate', 'chain', 'chain-broken', 'check', 'check-circle', 'check-circle-o',
- 'check-square', 'check-square-o', 'chevron-circle-down', 'chevron-circle-left',
- 'chevron-circle-right', 'chevron-circle-up', 'chevron-down', 'chevron-left',
- 'chevron-right', 'chevron-up', 'child', 'circle', 'circle-o', 'circle-o-notch',
- 'circle-thin', 'clipboard', 'clock-o', 'cloud', 'cloud-download', 'cloud-upload',
- 'cny', 'code', 'code-fork', 'codepen', 'coffee', 'cog', 'cogs', 'columns',
- 'comment', 'comment-o', 'comments', 'comments-o', 'compass', 'compress', 'copy',
- 'credit-card', 'crop', 'crosshairs', 'css3', 'cube', 'cubes', 'cut', 'cutlery',
- 'dashboard', 'database', 'dedent', 'delicious', 'desktop', 'deviantart', 'digg',
- 'dollar', 'dot-circle-o', 'download', 'dribbble', 'dropbox', 'drupal', 'edit', 'eject',
- 'ellipsis-h', 'ellipsis-v', 'empire', 'envelope', 'envelope-o', 'envelope-square',
- 'eraser', 'eur', 'euro', 'exchange', 'exclamation', 'exclamation-circle',
- 'exclamation-triangle', 'expand', 'external-link', 'external-link-square', 'eye',
- 'eye-slash', 'facebook', 'facebook-square', 'fast-backward', 'fast-forward', 'fax',
- 'female', 'fighter-jet', 'file', 'file-archive-o', 'file-audio-o', 'file-code-o',
- 'file-excel-o', 'file-image-o', 'file-movie-o', 'file-o', 'file-pdf-o', 'file-photo-o',
- 'file-picture-o', 'file-powerpoint-o', 'file-sound-o', 'file-text', 'file-text-o',
- 'file-video-o', 'file-word-o', 'file-zip-o', 'files-o', 'film', 'filter', 'fire',
- 'fire-extinguisher', 'flag', 'flag-checkered', 'flag-o', 'flash', 'flask', 'flickr',
- 'floppy-o', 'folder', 'folder-o', 'folder-open', 'folder-open-o', 'font', 'forward',
- 'foursquare', 'frown-o', 'gamepad', 'gavel', 'gbp', 'ge', 'gear', 'gears', 'gift',
- 'git', 'git-square', 'github', 'github-alt', 'github-square', 'gittip', 'glass', 'globe',
- 'google', 'google-plus', 'google-plus-square', 'graduation-cap', 'group', 'h-square', 'hacker-news',
- 'hand-o-down', 'hand-o-left', 'hand-o-right', 'hand-o-up', 'hdd-o', 'header', 'headphones',
- 'heart', 'heart-o', 'history', 'home', 'hospital-o', 'html5', 'image', 'inbox', 'indent',
- 'info', 'info-circle', 'inr', 'instagram', 'institution', 'italic', 'joomla', 'jpy',
- 'jsfiddle', 'key', 'keyboard-o', 'krw', 'language', 'laptop', 'leaf', 'legal', 'lemon-o',
- 'level-down', 'level-up', 'life-bouy', 'life-ring', 'life-saver', 'lightbulb-o', 'link',
- 'linkedin', 'linkedin-square', 'linux', 'list', 'list-alt', 'list-ol', 'list-ul', 'location-arrow',
- 'lock', 'long-arrow-down', 'long-arrow-left', 'long-arrow-right', 'long-arrow-up', 'magic',
- 'magnet', 'mail-forward', 'mail-reply', 'mail-reply-all', 'male', 'map-marker', 'maxcdn',
- 'medkit', 'meh-o', 'microphone', 'microphone-slash', 'minus', 'minus-circle', 'minus-square',
- 'minus-square-o', 'mobile', 'mobile-phone', 'money', 'moon-o', 'mortar-board', 'music',
- 'navicon', 'openid', 'outdent', 'pagelines', 'paper-plane', 'paper-plane-o', 'paperclip',
- 'paragraph', 'paste', 'pause', 'paw', 'pencil', 'pencil-square', 'pencil-square-o', 'phone',
- 'phone-square', 'photo', 'picture-o', 'pied-piper', 'pied-piper-alt', 'pied-piper-square',
- 'pinterest', 'pinterest-square', 'plane', 'play', 'play-circle', 'play-circle-o', 'plus',
- 'plus-circle', 'plus-square', 'plus-square-o', 'power-off', 'print', 'puzzle-piece', 'qq',
- 'qrcode', 'question', 'question-circle', 'quote-left', 'quote-right', 'ra', 'random',
- 'rebel', 'recycle', 'reddit', 'reddit-square', 'refresh', 'renren', 'reorder', 'repeat',
- 'reply', 'reply-all', 'retweet', 'rmb', 'road', 'rocket', 'rotate-left', 'rotate-right',
- 'rouble', 'rss', 'rss-square', 'rub', 'ruble', 'rupee', 'save', 'scissors', 'search',
- 'search-minus', 'search-plus', 'send', 'send-o', 'share', 'share-alt', 'share-alt-square',
- 'share-square', 'share-square-o', 'shield', 'shopping-cart', 'sign-in', 'sign-out', 'signal',
- 'sitemap', 'skype', 'slack', 'sliders', 'smile-o', 'sort', 'sort-alpha-asc', 'sort-alpha-desc',
- 'sort-amount-asc', 'sort-amount-desc', 'sort-asc', 'sort-desc', 'sort-down', 'sort-numeric-asc',
- 'sort-numeric-desc', 'sort-up', 'soundcloud', 'space-shuttle', 'spinner', 'spoon', 'spotify',
- 'square', 'square-o', 'stack-exchange', 'stack-overflow', 'star', 'star-half', 'star-half-empty',
- 'star-half-full', 'star-half-o', 'star-o', 'steam', 'steam-square', 'step-backward', 'step-forward',
- 'stethoscope', 'stop', 'strikethrough', 'stumbleupon', 'stumbleupon-circle', 'subscript',
- 'suitcase', 'sun-o', 'superscript', 'support', 'table', 'tablet', 'tachometer', 'tag',
- 'tags', 'tasks', 'taxi', 'tencent-weibo', 'terminal', 'text-height', 'text-width', 'th',
- 'th-large', 'th-list', 'thumb-tack', 'thumbs-down', 'thumbs-o-down', 'thumbs-o-up', 'thumbs-up',
- 'ticket', 'times', 'times-circle', 'times-circle-o', 'tint', 'toggle-down', 'toggle-left',
- 'toggle-right', 'toggle-up', 'trash-o', 'tree', 'trello', 'trophy', 'truck', 'try', 'tumblr',
- 'tumblr-square', 'turkish-lira', 'twitter', 'twitter-square', 'umbrella', 'underline', 'undo',
- 'university', 'unlink', 'unlock', 'unlock-alt', 'unsorted', 'upload', 'usd', 'user', 'user-md',
- 'users', 'video-camera', 'vimeo-square', 'vine', 'vk', 'volume-down', 'volume-off', 'volume-up',
- 'warning', 'wechat', 'weibo', 'weixin', 'wheelchair', 'windows', 'won', 'wordpress', 'wrench',
- 'xing', 'xing-square', 'yahoo', 'yen', 'youtube', 'youtube-play', 'youtube-square'
- ];
-}));
diff --git a/code/vendor/fontawesome-iconpicker-1.0.0/src/js/jquery.ui.pos.js b/code/vendor/fontawesome-iconpicker-1.0.0/src/js/jquery.ui.pos.js
deleted file mode 100644
index 54ff373..0000000
--- a/code/vendor/fontawesome-iconpicker-1.0.0/src/js/jquery.ui.pos.js
+++ /dev/null
@@ -1,532 +0,0 @@
-/*!
- * .pos() plugin based on jQuery UI Position 1.10.4, renamed to avoid
- * problems with jQuery native .position(), and added some triggers when position
- * collapses
- *
- * http://jqueryui.com
- *
- * Copyright 2014 jQuery Foundation and other contributors
- * Released under the MIT license.
- * http://jquery.org/license
- *
- * http://api.jqueryui.com/position/
- */
-(function($, undefined) {
-
- $.ui = $.ui || {};
-
- var cachedScrollbarWidth,
- max = Math.max,
- abs = Math.abs,
- round = Math.round,
- rhorizontal = /left|center|right/,
- rvertical = /top|center|bottom/,
- roffset = /[\+\-]\d+(\.[\d]+)?%?/,
- rposition = /^\w+/,
- rpercent = /%$/,
- _position = $.fn.pos;
-
- function getOffsets(offsets, width, height) {
- return [
- parseFloat(offsets[0]) * (rpercent.test(offsets[0]) ? width / 100 : 1),
- parseFloat(offsets[1]) * (rpercent.test(offsets[1]) ? height / 100 : 1)
- ];
- }
-
- function parseCss(element, property) {
- return parseInt($.css(element, property), 10) || 0;
- }
-
- function getDimensions(elem) {
- var raw = elem[0];
- if (raw.nodeType === 9) {
- return {
- width: elem.width(),
- height: elem.height(),
- offset: {
- top: 0,
- left: 0
- }
- };
- }
- if ($.isWindow(raw)) {
- return {
- width: elem.width(),
- height: elem.height(),
- offset: {
- top: elem.scrollTop(),
- left: elem.scrollLeft()
- }
- };
- }
- if (raw.preventDefault) {
- return {
- width: 0,
- height: 0,
- offset: {
- top: raw.pageY,
- left: raw.pageX
- }
- };
- }
- return {
- width: elem.outerWidth(),
- height: elem.outerHeight(),
- offset: elem.offset()
- };
- }
-
- $.pos = {
- scrollbarWidth: function() {
- if (cachedScrollbarWidth !== undefined) {
- return cachedScrollbarWidth;
- }
- var w1, w2,
- div = $(""),
- innerDiv = div.children()[0];
-
- $("body").append(div);
- w1 = innerDiv.offsetWidth;
- div.css("overflow", "scroll");
-
- w2 = innerDiv.offsetWidth;
-
- if (w1 === w2) {
- w2 = div[0].clientWidth;
- }
-
- div.remove();
-
- return (cachedScrollbarWidth = w1 - w2);
- },
- getScrollInfo: function(within) {
- var overflowX = within.isWindow || within.isDocument ? "" :
- within.element.css("overflow-x"),
- overflowY = within.isWindow || within.isDocument ? "" :
- within.element.css("overflow-y"),
- hasOverflowX = overflowX === "scroll" ||
- (overflowX === "auto" && within.width < within.element[0].scrollWidth),
- hasOverflowY = overflowY === "scroll" ||
- (overflowY === "auto" && within.height < within.element[0].scrollHeight);
- return {
- width: hasOverflowY ? $.pos.scrollbarWidth() : 0,
- height: hasOverflowX ? $.pos.scrollbarWidth() : 0
- };
- },
- getWithinInfo: function(element) {
- var withinElement = $(element || window),
- isWindow = $.isWindow(withinElement[0]),
- isDocument = !!withinElement[0] && withinElement[0].nodeType === 9;
- return {
- element: withinElement,
- isWindow: isWindow,
- isDocument: isDocument,
- offset: withinElement.offset() || {
- left: 0,
- top: 0
- },
- scrollLeft: withinElement.scrollLeft(),
- scrollTop: withinElement.scrollTop(),
- width: isWindow ? withinElement.width() : withinElement.outerWidth(),
- height: isWindow ? withinElement.height() : withinElement.outerHeight()
- };
- }
- };
-
- $.fn.pos = function(options) {
- if (!options || !options.of) {
- return _position.apply(this, arguments);
- }
-
- // make a copy, we don't want to modify arguments
- options = $.extend({}, options);
-
- var atOffset, targetWidth, targetHeight, targetOffset, basePosition, dimensions,
- target = $(options.of),
- within = $.pos.getWithinInfo(options.within),
- scrollInfo = $.pos.getScrollInfo(within),
- collision = (options.collision || "flip").split(" "),
- offsets = {};
-
- dimensions = getDimensions(target);
- if (target[0].preventDefault) {
- // force left top to allow flipping
- options.at = "left top";
- }
- targetWidth = dimensions.width;
- targetHeight = dimensions.height;
- targetOffset = dimensions.offset;
- // clone to reuse original targetOffset later
- basePosition = $.extend({}, targetOffset);
-
- // force my and at to have valid horizontal and vertical positions
- // if a value is missing or invalid, it will be converted to center
- $.each(["my", "at"], function() {
- var pos = (options[this] || "").split(" "),
- horizontalOffset,
- verticalOffset;
-
- if (pos.length === 1) {
- pos = rhorizontal.test(pos[0]) ?
- pos.concat(["center"]) :
- rvertical.test(pos[0]) ? ["center"].concat(pos) : ["center", "center"];
- }
- pos[0] = rhorizontal.test(pos[0]) ? pos[0] : "center";
- pos[1] = rvertical.test(pos[1]) ? pos[1] : "center";
-
- // calculate offsets
- horizontalOffset = roffset.exec(pos[0]);
- verticalOffset = roffset.exec(pos[1]);
- offsets[this] = [
- horizontalOffset ? horizontalOffset[0] : 0,
- verticalOffset ? verticalOffset[0] : 0
- ];
-
- // reduce to just the positions without the offsets
- options[this] = [
- rposition.exec(pos[0])[0],
- rposition.exec(pos[1])[0]
- ];
- });
-
- // normalize collision option
- if (collision.length === 1) {
- collision[1] = collision[0];
- }
-
- if (options.at[0] === "right") {
- basePosition.left += targetWidth;
- } else if (options.at[0] === "center") {
- basePosition.left += targetWidth / 2;
- }
-
- if (options.at[1] === "bottom") {
- basePosition.top += targetHeight;
- } else if (options.at[1] === "center") {
- basePosition.top += targetHeight / 2;
- }
-
- atOffset = getOffsets(offsets.at, targetWidth, targetHeight);
- basePosition.left += atOffset[0];
- basePosition.top += atOffset[1];
-
- return this.each(function() {
- var collisionPosition, using,
- elem = $(this),
- elemWidth = elem.outerWidth(),
- elemHeight = elem.outerHeight(),
- marginLeft = parseCss(this, "marginLeft"),
- marginTop = parseCss(this, "marginTop"),
- collisionWidth = elemWidth + marginLeft + parseCss(this, "marginRight") + scrollInfo.width,
- collisionHeight = elemHeight + marginTop + parseCss(this, "marginBottom") + scrollInfo.height,
- position = $.extend({}, basePosition),
- myOffset = getOffsets(offsets.my, elem.outerWidth(), elem.outerHeight());
-
- if (options.my[0] === "right") {
- position.left -= elemWidth;
- } else if (options.my[0] === "center") {
- position.left -= elemWidth / 2;
- }
-
- if (options.my[1] === "bottom") {
- position.top -= elemHeight;
- } else if (options.my[1] === "center") {
- position.top -= elemHeight / 2;
- }
-
- position.left += myOffset[0];
- position.top += myOffset[1];
-
- // if the browser doesn't support fractions, then round for consistent results
- if (!$.support.offsetFractions) {
- position.left = round(position.left);
- position.top = round(position.top);
- }
-
- collisionPosition = {
- marginLeft: marginLeft,
- marginTop: marginTop
- };
-
- $.each(["left", "top"], function(i, dir) {
- if ($.ui.pos[collision[i]]) {
- $.ui.pos[collision[i]][dir](position, {
- targetWidth: targetWidth,
- targetHeight: targetHeight,
- elemWidth: elemWidth,
- elemHeight: elemHeight,
- collisionPosition: collisionPosition,
- collisionWidth: collisionWidth,
- collisionHeight: collisionHeight,
- offset: [atOffset[0] + myOffset[0], atOffset[1] + myOffset[1]],
- my: options.my,
- at: options.at,
- within: within,
- elem: elem
- });
- }
- });
-
- if (options.using) {
- // adds feedback as second argument to using callback, if present
- using = function(props) {
- var left = targetOffset.left - position.left,
- right = left + targetWidth - elemWidth,
- top = targetOffset.top - position.top,
- bottom = top + targetHeight - elemHeight,
- feedback = {
- target: {
- element: target,
- left: targetOffset.left,
- top: targetOffset.top,
- width: targetWidth,
- height: targetHeight
- },
- element: {
- element: elem,
- left: position.left,
- top: position.top,
- width: elemWidth,
- height: elemHeight
- },
- horizontal: right < 0 ? "left" : left > 0 ? "right" : "center",
- vertical: bottom < 0 ? "top" : top > 0 ? "bottom" : "middle"
- };
- if (targetWidth < elemWidth && abs(left + right) < targetWidth) {
- feedback.horizontal = "center";
- }
- if (targetHeight < elemHeight && abs(top + bottom) < targetHeight) {
- feedback.vertical = "middle";
- }
- if (max(abs(left), abs(right)) > max(abs(top), abs(bottom))) {
- feedback.important = "horizontal";
- } else {
- feedback.important = "vertical";
- }
- options.using.call(this, props, feedback);
- };
- }
-
- elem.offset($.extend(position, {
- using: using
- }));
- });
- };
-
- $.ui.pos = {
- _trigger: function(position, data, name, triggered) {
- if (data.elem) {
- data.elem.trigger({
- 'type': name,
- 'position': position,
- 'positionData': data,
- 'triggered': triggered
- });
- }
- },
- fit: {
- left: function(position, data) {
- $.ui.pos._trigger(position, data, 'posCollide', 'fitLeft');
- var within = data.within,
- withinOffset = within.isWindow ? within.scrollLeft : within.offset.left,
- outerWidth = within.width,
- collisionPosLeft = position.left - data.collisionPosition.marginLeft,
- overLeft = withinOffset - collisionPosLeft,
- overRight = collisionPosLeft + data.collisionWidth - outerWidth - withinOffset,
- newOverRight;
-
- // element is wider than within
- if (data.collisionWidth > outerWidth) {
- // element is initially over the left side of within
- if (overLeft > 0 && overRight <= 0) {
- newOverRight = position.left + overLeft + data.collisionWidth - outerWidth - withinOffset;
- position.left += overLeft - newOverRight;
- // element is initially over right side of within
- } else if (overRight > 0 && overLeft <= 0) {
- position.left = withinOffset;
- // element is initially over both left and right sides of within
- } else {
- if (overLeft > overRight) {
- position.left = withinOffset + outerWidth - data.collisionWidth;
- } else {
- position.left = withinOffset;
- }
- }
- // too far left -> align with left edge
- } else if (overLeft > 0) {
- position.left += overLeft;
- // too far right -> align with right edge
- } else if (overRight > 0) {
- position.left -= overRight;
- // adjust based on position and margin
- } else {
- position.left = max(position.left - collisionPosLeft, position.left);
- }
- $.ui.pos._trigger(position, data, 'posCollided', 'fitLeft');
- },
- top: function(position, data) {
- $.ui.pos._trigger(position, data, 'posCollide', 'fitTop');
- var within = data.within,
- withinOffset = within.isWindow ? within.scrollTop : within.offset.top,
- outerHeight = data.within.height,
- collisionPosTop = position.top - data.collisionPosition.marginTop,
- overTop = withinOffset - collisionPosTop,
- overBottom = collisionPosTop + data.collisionHeight - outerHeight - withinOffset,
- newOverBottom;
-
- // element is taller than within
- if (data.collisionHeight > outerHeight) {
- // element is initially over the top of within
- if (overTop > 0 && overBottom <= 0) {
- newOverBottom = position.top + overTop + data.collisionHeight - outerHeight - withinOffset;
- position.top += overTop - newOverBottom;
- // element is initially over bottom of within
- } else if (overBottom > 0 && overTop <= 0) {
- position.top = withinOffset;
- // element is initially over both top and bottom of within
- } else {
- if (overTop > overBottom) {
- position.top = withinOffset + outerHeight - data.collisionHeight;
- } else {
- position.top = withinOffset;
- }
- }
- // too far up -> align with top
- } else if (overTop > 0) {
- position.top += overTop;
- // too far down -> align with bottom edge
- } else if (overBottom > 0) {
- position.top -= overBottom;
- // adjust based on position and margin
- } else {
- position.top = max(position.top - collisionPosTop, position.top);
- }
- $.ui.pos._trigger(position, data, 'posCollided', 'fitTop');
- }
- },
- flip: {
- left: function(position, data) {
- $.ui.pos._trigger(position, data, 'posCollide', 'flipLeft');
- var within = data.within,
- withinOffset = within.offset.left + within.scrollLeft,
- outerWidth = within.width,
- offsetLeft = within.isWindow ? within.scrollLeft : within.offset.left,
- collisionPosLeft = position.left - data.collisionPosition.marginLeft,
- overLeft = collisionPosLeft - offsetLeft,
- overRight = collisionPosLeft + data.collisionWidth - outerWidth - offsetLeft,
- myOffset = data.my[0] === "left" ?
- -data.elemWidth :
- data.my[0] === "right" ?
- data.elemWidth :
- 0,
- atOffset = data.at[0] === "left" ?
- data.targetWidth :
- data.at[0] === "right" ?
- -data.targetWidth :
- 0,
- offset = -2 * data.offset[0],
- newOverRight,
- newOverLeft;
-
- if (overLeft < 0) {
- newOverRight = position.left + myOffset + atOffset + offset + data.collisionWidth - outerWidth - withinOffset;
- if (newOverRight < 0 || newOverRight < abs(overLeft)) {
- position.left += myOffset + atOffset + offset;
- }
- } else if (overRight > 0) {
- newOverLeft = position.left - data.collisionPosition.marginLeft + myOffset + atOffset + offset - offsetLeft;
- if (newOverLeft > 0 || abs(newOverLeft) < overRight) {
- position.left += myOffset + atOffset + offset;
- }
- }
- $.ui.pos._trigger(position, data, 'posCollided', 'flipLeft');
- },
- top: function(position, data) {
- $.ui.pos._trigger(position, data, 'posCollide', 'flipTop');
- var within = data.within,
- withinOffset = within.offset.top + within.scrollTop,
- outerHeight = within.height,
- offsetTop = within.isWindow ? within.scrollTop : within.offset.top,
- collisionPosTop = position.top - data.collisionPosition.marginTop,
- overTop = collisionPosTop - offsetTop,
- overBottom = collisionPosTop + data.collisionHeight - outerHeight - offsetTop,
- top = data.my[1] === "top",
- myOffset = top ?
- -data.elemHeight :
- data.my[1] === "bottom" ?
- data.elemHeight :
- 0,
- atOffset = data.at[1] === "top" ?
- data.targetHeight :
- data.at[1] === "bottom" ?
- -data.targetHeight :
- 0,
- offset = -2 * data.offset[1],
- newOverTop,
- newOverBottom;
- if (overTop < 0) {
- newOverBottom = position.top + myOffset + atOffset + offset + data.collisionHeight - outerHeight - withinOffset;
- if ((position.top + myOffset + atOffset + offset) > overTop && (newOverBottom < 0 || newOverBottom < abs(overTop))) {
- position.top += myOffset + atOffset + offset;
- }
- } else if (overBottom > 0) {
- newOverTop = position.top - data.collisionPosition.marginTop + myOffset + atOffset + offset - offsetTop;
- if ((position.top + myOffset + atOffset + offset) > overBottom && (newOverTop > 0 || abs(newOverTop) < overBottom)) {
- position.top += myOffset + atOffset + offset;
- }
- }
- $.ui.pos._trigger(position, data, 'posCollided', 'flipTop');
- }
- },
- flipfit: {
- left: function() {
- $.ui.pos.flip.left.apply(this, arguments);
- $.ui.pos.fit.left.apply(this, arguments);
- },
- top: function() {
- $.ui.pos.flip.top.apply(this, arguments);
- $.ui.pos.fit.top.apply(this, arguments);
- }
- }
- };
-
- // fraction support test
- (function() {
- var testElement, testElementParent, testElementStyle, offsetLeft, i,
- body = document.getElementsByTagName("body")[0],
- div = document.createElement("div");
-
- //Create a "fake body" for testing based on method used in jQuery.support
- testElement = document.createElement(body ? "div" : "body");
- testElementStyle = {
- visibility: "hidden",
- width: 0,
- height: 0,
- border: 0,
- margin: 0,
- background: "none"
- };
- if (body) {
- $.extend(testElementStyle, {
- position: "absolute",
- left: "-1000px",
- top: "-1000px"
- });
- }
- for (i in testElementStyle) {
- testElement.style[i] = testElementStyle[i];
- }
- testElement.appendChild(div);
- testElementParent = body || document.documentElement;
- testElementParent.insertBefore(testElement, testElementParent.firstChild);
-
- div.style.cssText = "position: absolute; left: 10.7432222px;";
-
- offsetLeft = $(div).offset().left;
- $.support.offsetFractions = offsetLeft > 10 && offsetLeft < 11;
-
- testElement.innerHTML = "";
- testElementParent.removeChild(testElement);
- })();
-
-}(jQuery));
diff --git a/code/vendor/fontawesome-iconpicker-1.0.0/src/less/iconpicker.less b/code/vendor/fontawesome-iconpicker-1.0.0/src/less/iconpicker.less
deleted file mode 100644
index 31948ac..0000000
--- a/code/vendor/fontawesome-iconpicker-1.0.0/src/less/iconpicker.less
+++ /dev/null
@@ -1,75 +0,0 @@
-/*!
- * Font Awesome Icon Picker
- * http://mjolnic.github.io/fontawesome-iconpicker/
- *
- * Originally written by (c) 2014 Javier Aguilar @mjolnic
- * Licensed under the MIT License
- * https://github.com/mjolnic/fontawesome-iconpicker/blob/master/LICENSE
- *
- */
-@import 'variables.less';
-@import 'popovers.less';
-
-.iconpicker{
- *{
- -webkit-box-sizing: content-box;
- -moz-box-sizing: content-box;
- box-sizing: content-box;
- position: relative;
- }
- position: relative;
- .clearfix();
- text-align:left;
- text-shadow:none;
- line-height:0;
- display:block;
- margin:0;
- overflow:hidden;
-
- .iconpicker-items{
- position: relative;
- .clearfix();
- clear:both;
- float:none;
- padding:@base_spacing 0 0 @base_spacing;
- background:#fff;
- //margin:0 -@base_spacing -@base_spacing 0;
- //width:@picker_width - (@base_spacing*2);
- margin:0;
- overflow:hidden;
- overflow-y: auto;
- min-height: @row_outer_height;
- max-height: @row_outer_height * @num_rows;
-
- }
-
- .iconpicker-item{
- float:left;
- width:@item_size;
- height:@item_size;
- padding: @base_spacing;
- margin:0 @base_spacing @base_spacing 0;
- text-align:center;
- cursor:pointer;
- border-radius:3px;
- font-size:@item_size;
- .outer-border();
- &:hover:not(.iconpicker-selected){
- background-color:@hover_bg;
- }
- &.iconpicker-selected{
- box-shadow: none;
- }
- /*&:nth-child(4n+4) {
- margin-right: 0;
- }
- &:nth-last-child(-n+4) {
- margin-bottom: 0;
- }*/
- //box-shadow:0;
- }
-}
-
-.iconpicker-component{
- cursor:pointer;
-}
\ No newline at end of file
diff --git a/code/vendor/fontawesome-iconpicker-1.0.0/src/less/popovers.less b/code/vendor/fontawesome-iconpicker-1.0.0/src/less/popovers.less
deleted file mode 100644
index 55db2fa..0000000
--- a/code/vendor/fontawesome-iconpicker-1.0.0/src/less/popovers.less
+++ /dev/null
@@ -1,236 +0,0 @@
-/*
- * Font Awesome Icon Picker
- * http://mjolnic.github.io/fontawesome-iconpicker/
- *
- * Originally written by (c) 2014 Javier Aguilar @mjolnic
- * Licensed under the MIT License
- * https://github.com/mjolnic/fontawesome-iconpicker/blob/master/LICENSE
- *
- */
-
-//
-// Popovers
-// --------------------------------------------------
-
-
-.iconpicker-popover.popover {
- position: absolute;
- top: 0;
- left: 0;
- display: none;
- max-width: none;
- padding: 1px;
- text-align: left;
- width: @picker_width + @num_cols;
- background:@popover-title-bg;
-
- // Offset the popover to account for the popover arrow
- &.top, &.topLeftCorner, &.topLeft, &.topRight, &.topRightCorner { margin-top: -@popover-arrow-width; }
- &.right, &.rightTop, &.rightBottom { margin-left: @popover-arrow-width; }
- &.bottom, &.bottomRightCorner, &.bottomRight, &.bottomLeft, &.bottomLeftCorner { margin-top: @popover-arrow-width; }
- &.left, &.leftBottom, &.leftTop { margin-left: -@popover-arrow-width; }
-
- &.inline{
- > .arrow{
- display:none;
- }
- margin: 0 0 @base_spacing 0;
- position: relative;
- display:inline-block;
- opacity:1;
- top:auto;
- left:auto;
- bottom:auto;
- right:auto;
- max-width: 100%;
- box-shadow: none;
- z-index:auto;
- vertical-align: top;
- }
-}
-
-.dropdown-menu .iconpicker-popover.inline{
- margin:0;
- border:none;
-}
-
-.dropdown-menu.iconpicker-container{
- padding:0;
-}
-
-.iconpicker-popover.popover .popover-title {
- //padding: 8px 14px;
- //border-radius: 5px 5px 0 0;
- padding:@base_spacing;
- font-size:@title_size;
- line-height:@title_size + 2px;
- border-bottom:1px solid darken(@popover-title-bg, 5%);
- background-color: @popover-title-bg;
-
- input[type=search].iconpicker-search{
- margin: 0 0 2px 0;
- }
-}
-.iconpicker-popover.popover .popover-title-text ~ input[type=search].iconpicker-search{
- margin-top: @base_spacing;
-}
-
-.iconpicker-popover.popover .popover-content {
- //padding: 9px 14px;
- padding:0px;
- text-align: center;
- //overflow:hidden;
-}
-
-.iconpicker-popover .popover-footer{
- .clearfix();
- float:none;
- clear:both;
- padding:@base_spacing;
- text-align:right;
- margin:0;
- border-top:1px solid darken(@popover-title-bg, 5%);
- background-color: @popover-title-bg;
- .iconpicker-btn{
- margin-left: 10px;
- }
- input[type=search].iconpicker-search{
- /*width:auto;
- float:left;*/
- margin-bottom: @base_spacing;
- }
-}
-
-// Arrows
-//
-// .arrow is outer, .arrow:after is inner
-
-.iconpicker-popover.popover > .arrow {
- &,
- &:after {
- position: absolute;
- display: block;
- width: 0;
- height: 0;
- border-color: transparent;
- border-style: solid;
- }
-}
-.iconpicker-popover.popover > .arrow {
- border-width: @popover-arrow-outer-width;
-}
-.iconpicker-popover.popover > .arrow:after {
- border-width: @popover-arrow-width;
- content: "";
-}
-
-.iconpicker-popover.popover {
- &.top, &.topLeft, &.topRight{
- > .arrow {
- left: 50%;
- margin-left: -@popover-arrow-outer-width;
- border-bottom-width: 0;
- border-top-color: @popover-arrow-outer-fallback-color; // IE8 fallback
- border-top-color: @popover-arrow-outer-color;
- bottom: -@popover-arrow-outer-width;
- &:after {
- content: " ";
- bottom: 1px;
- margin-left: -@popover-arrow-width;
- border-bottom-width: 0;
- border-top-color: @popover-arrow-color;
- }
- }
- }
- &.topLeft > .arrow{
- left:@base_spacing;
- margin-left:0;
- }
- &.topRight > .arrow{
- left:auto;
- right:@base_spacing;
- margin-left:0;
- }
- &.right, &.rightTop, &.rightBottom{
- > .arrow {
- top: 50%;
- left: -@popover-arrow-outer-width;
- margin-top: -@popover-arrow-outer-width;
- border-left-width: 0;
- border-right-color: @popover-arrow-outer-fallback-color; // IE8 fallback
- border-right-color: @popover-arrow-outer-color;
- &:after {
- content: " ";
- left: 1px;
- bottom: -@popover-arrow-width;
- border-left-width: 0;
- border-right-color: @popover-arrow-color;
- }
- }
- }
-
- &.rightTop > .arrow{
- top:auto;
- bottom:@base_spacing;
- margin-top:0;
- }
- &.rightBottom > .arrow{
- top:@base_spacing;
- margin-top:0;
- }
-
- &.bottom, &.bottomRight, &.bottomLeft{
- > .arrow {
- left: 50%;
- margin-left: -@popover-arrow-outer-width;
- border-top-width: 0;
- border-bottom-color: @popover-arrow-outer-fallback-color; // IE8 fallback
- border-bottom-color: @popover-arrow-outer-color;
- top: -@popover-arrow-outer-width;
- &:after {
- content: " ";
- top: 1px;
- margin-left: -@popover-arrow-width;
- border-top-width: 0;
- border-bottom-color: @popover-arrow-color;
- }
- }
- }
- &.bottomLeft > .arrow{
- left:@base_spacing;
- margin-left:0;
- }
- &.bottomRight > .arrow{
- left:auto;
- right:@base_spacing;
- margin-left:0;
- }
-
- &.left, &.leftBottom, &.leftTop{
- > .arrow {
- top: 50%;
- right: -@popover-arrow-outer-width;
- margin-top: -@popover-arrow-outer-width;
- border-right-width: 0;
- border-left-color: @popover-arrow-outer-fallback-color; // IE8 fallback
- border-left-color: @popover-arrow-outer-color;
- &:after {
- content: " ";
- right: 1px;
- border-right-width: 0;
- border-left-color: @popover-arrow-color;
- bottom: -@popover-arrow-width;
- }
- }
- }
-
- &.leftBottom > .arrow{
- top:@base_spacing;
- margin-top:0;
- }
- &.leftTop > .arrow{
- top:auto;
- bottom:@base_spacing;
- margin-top:0;
- }
-}
diff --git a/code/vendor/fontawesome-iconpicker-1.0.0/src/less/variables.less b/code/vendor/fontawesome-iconpicker-1.0.0/src/less/variables.less
deleted file mode 100644
index 8730056..0000000
--- a/code/vendor/fontawesome-iconpicker-1.0.0/src/less/variables.less
+++ /dev/null
@@ -1,113 +0,0 @@
-/*
- * Font Awesome Icon Picker
- * http://mjolnic.github.io/fontawesome-iconpicker/
- *
- * Originally written by (c) 2014 Javier Aguilar @mjolnic
- * Licensed under the MIT License
- * https://github.com/mjolnic/fontawesome-iconpicker/blob/master/LICENSE
- *
- */
-
-// Iconpicker variables:
-@item_size:14px;
-@hover_bg:#eee;
-@num_cols: 4;
-@num_rows: 5;
-@base_spacing: 14px;
-@picker_width: (@item_size * @num_cols) + (@num_cols * @base_spacing * (@num_cols - 1)) + @base_spacing;
-@row_outer_height: (@item_size + (@base_spacing * 3)) - 1px;
-@title_size: (@base_spacing + @item_size) / 2;
-@border_color: #ddd;
-
-//== Popovers
-//
-//##
-
-//** Popover body background color
-@popover-bg: #fff;
-//** Popover maximum width
-@popover-max-width: 276px;
-//** Popover border color
-@popover-border-color: rgba(0,0,0,.2);
-//** Popover fallback border color
-@popover-fallback-border-color: #ccc;
-
-//** Popover title background color
-@popover-title-bg: darken(@popover-bg, 3%);
-
-//** Popover arrow width
-@popover-arrow-width: 10px;
-//** Popover arrow color
-@popover-arrow-color: #fff;
-
-//** Popover outer arrow width
-@popover-arrow-outer-width: (@popover-arrow-width + 1);
-//** Popover outer arrow color
-@popover-arrow-outer-color: fadein(@popover-border-color, 5%);
-//** Popover outer arrow fallback color
-@popover-arrow-outer-fallback-color: darken(@popover-fallback-border-color, 20%);
-
-
-// Clearfix
-//
-// For modern browsers
-// 1. The space content is one way to avoid an Opera bug when the
-// contenteditable attribute is included anywhere else in the document.
-// Otherwise it causes space to appear at the top and bottom of elements
-// that are clearfixed.
-// 2. The use of `table` rather than `block` is only necessary if using
-// `:before` to contain the top-margins of child elements.
-//
-// Source: http://nicolasgallagher.com/micro-clearfix-hack/
-
-.clearfix() {
- &:before,
- &:after {
- content: " "; // 1
- display: table; // 2
- }
- &:after {
- clear: both;
- }
-}
-
-.outer-border(){
- box-shadow: 0 0 0 1px @border_color;
-}
-
-
-//
-// Other Bootstrap Variables:
-// --------------------------------------------------
-
-
-//== Colors
-//
-//## Gray and brand colors for use across Bootstrap.
-
-@gray-darker: lighten(#000, 13.5%); // #222
-@gray-dark: lighten(#000, 20%); // #333
-@gray: lighten(#000, 33.5%); // #555
-@gray-light: lighten(#000, 60%); // #999
-@gray-lighter: lighten(#000, 93.5%); // #eee
-
-@brand-primary: #428bca;
-@brand-success: #5cb85c;
-@brand-info: #5bc0de;
-@brand-warning: #f0ad4e;
-@brand-danger: #d9534f;
-
-
-//== Scaffolding
-//
-// ## Settings for some of the most global styles.
-
-//** Background color for ``.
-@body-bg: #fff;
-//** Global text color on ``.
-@text-color: @gray-dark;
-
-//** Global textual link color.
-@link-color: @brand-primary;
-//** Link hover color set via `darken()` function.
-@link-hover-color: darken(@link-color, 15%);
diff --git a/code/vendor/fontawesome-iconpicker-1.0.0/dist/css/fontawesome-iconpicker.min.css b/css/lib/font-awesome-iconpicker.min.css
similarity index 100%
rename from code/vendor/fontawesome-iconpicker-1.0.0/dist/css/fontawesome-iconpicker.min.css
rename to css/lib/font-awesome-iconpicker.min.css
diff --git a/css/lib/font-awesome.min.css b/css/lib/font-awesome.min.css
index ead7556..bafa96a 100644
--- a/css/lib/font-awesome.min.css
+++ b/css/lib/font-awesome.min.css
@@ -4,12 +4,12 @@
*/
@font-face {
font-family: 'FontAwesome';
- src: url('../../../font-awesome/fonts/fontawesome-webfont.eot?v=4.3.0');
- src: url('../../../font-awesome/fonts/fontawesome-webfont.eot?#iefix&v=4.3.0') format('embedded-opentype'),
- url('../../../font-awesome/fonts/fontawesome-webfont.woff2?v=4.3.0') format('woff2'),
- url('../../../font-awesome/fonts/fontawesome-webfont.woff?v=4.3.0') format('woff'),
- url('../../../font-awesome/fonts/fontawesome-webfont.ttf?v=4.3.0') format('truetype'),
- url('../../../font-awesome/fonts/fontawesome-webfont.svg?v=4.3.0#fontawesomeregular') format('svg');
+ src: url('../../fonts/fontawesome-webfont.eot?v=4.3.0');
+ src: url('../../fonts/fontawesome-webfont.eot?#iefix&v=4.3.0') format('embedded-opentype'),
+ url('../../fonts/fontawesome-webfont.woff2?v=4.3.0') format('woff2'),
+ url('../../fonts/fontawesome-webfont.woff?v=4.3.0') format('woff'),
+ url('../../fonts/fontawesome-webfont.ttf?v=4.3.0') format('truetype'),
+ url('../../fonts/fontawesome-webfont.svg?v=4.3.0#fontawesomeregular') format('svg');
font-weight: normal;
font-style: normal
}
@@ -2268,4 +2268,4 @@
.fa-medium:before {
content: "\f23a"
-}
\ No newline at end of file
+}
diff --git a/images/screens/font-awesome-filter.png b/images/screens/font-awesome-filter.png
new file mode 100644
index 0000000..5091799
Binary files /dev/null and b/images/screens/font-awesome-filter.png differ
diff --git a/images/screens/font-awesome-icons.png b/images/screens/font-awesome-icons.png
new file mode 100644
index 0000000..6b0292f
Binary files /dev/null and b/images/screens/font-awesome-icons.png differ
diff --git a/code/vendor/fontawesome-iconpicker-1.0.0/dist/js/fontawesome-iconpicker.min.js b/js/lib/font-awesome-iconpicker.min.js
similarity index 100%
rename from code/vendor/fontawesome-iconpicker-1.0.0/dist/js/fontawesome-iconpicker.min.js
rename to js/lib/font-awesome-iconpicker.min.js
diff --git a/readme.md b/readme.md
index 319b71e..24faa4a 100644
--- a/readme.md
+++ b/readme.md
@@ -1,14 +1,9 @@
-## Pillaged
-Shamefully pillaged from https://github.com/thisisbd/silverstripe-fontawesome-iconpickerfield and further modified/extended to better suit our environment and preferred coding style.
-
## Synopsis
-A simple form field for selecting font-awesome classes in the CMS.
+Provides a field to easily pick font-awesome icons
## Features
-* The latest version of font-awesome
-* Easy to integrate into any project
-* Option to use CDN for loading assets (Defaults to use local)
-* Injects font-awesome.css into the frontend (Can disable in settings)
+* Easily pick icons to be used anywhere in the frontend
+* Can filter on icon name
## Installation
@@ -18,31 +13,40 @@ Make sure you're not double loading the css/fonts with a theme.
Ideally composer will be used to install this module.
```composer require "moe/font-awesome:@stable"```
+## Screen shots
+
+### Font awesome icon view
+![Font awesome icon]( "Colour swabs")
+---------------------------------------
+### Filter view
+![Filter]( "Colour filter")
+
## Usage
A basic working example, and the following to any class you want the field on;
```php
+ private static $db = array(
+ 'Icon' => 'Varchar(255)',
+ );
-private static $db = array(
- 'Icon' => 'Varchar',
-);
-
-public function getCMSFields()
+ public function getCMSFields()
{
$fields = parent::getCMSFields();
- $fields->addFieldsToTab('Root.ButtonDetails', array(
- FontAwesomeField::create("Icon", "Font Awesome icon"),
+ $fields->addFieldsToTab('Root.Main', array(
+ FontAwesomeField::create("Icon", "Font Awesome icon")
));
return $fields;
}
```
-Then simple include in the template
+Then simple include in the template where you want the icon placed
```html
-
+
```
-Alternatively you can just use the font family via CSS.
+The controller extension should make sure you've got access to the icons so you don't need to double up the CSS file.
+## Libraries used/modified
+* Font Awesome Icon Picker