')
+ .addClass( 'arrow left' )
+ .addClass( feedback.vertical )
+ .addClass( feedback.horizontal )
+ .appendTo( this );
+ }
+ }
+ });
+ });
+}
+
+
+/*
+JQueryModalBox
+*/
+$(window).resize(function() {
+ $(".ui-dialog-content").dialog("option", "position", ['center', 'center']);
+});
+
+
+// Transform div in Dialog box
+function initModalBoxes(modals){
+
+ $(modals.modal_list).each(function() {
+
+ var buttons_list = {};
+
+ if (this.mode == 'standard'){
+ buttons_list[modals.label_save] = function(){$(this).find('form').submit();};
+ buttons_list[modals.label_cancel] = function(){$(this).dialog('close');};
+ } else if (this.mode == 'close-only'){
+ buttons_list[modals.label_ok] = function(){$(this).dialog('close');};
+ }
+
+ $(this.target).dialog({
+ resizable: false,
+ autoOpen: false,
+ height: 'auto',
+ width: 'auto',
+ position: ['center', 'center'],
+ modal: true,
+ hide: {
+ effect: "fade",
+ duration: 500
+ },
+ buttons: buttons_list,
+ });
+
+ setUpModalBox(this.source, this.target);
+ });
+}
+
+
+// Bind links on Dialog box
+function setUpModalBox(source, target) {
+ $(source).each(function() {
+ $(this).on('click', function() {
+ var title = $(this).html();
+ $.get($(this).attr('href'), function(data){
+ $(target).html(data);
+ $(target).dialog('option', 'title', title);
+ $(target).dialog('open');
+ });
+ return false;
+ });
+ });
+}
diff --git a/assets/javascripts/plugins/bootstrap_alert.js b/assets/javascripts/plugins/bootstrap_alert.js
new file mode 100644
index 0000000..66fb0be
--- /dev/null
+++ b/assets/javascripts/plugins/bootstrap_alert.js
@@ -0,0 +1,99 @@
+/* ==========================================================
+ * bootstrap-alert.js v2.3.2
+ * http://getbootstrap.com/2.3.2/javascript.html#alerts
+ * ==========================================================
+ * Copyright 2013 Twitter, Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ========================================================== */
+
+
+!function ($) {
+
+ "use strict"; // jshint ;_;
+
+
+ /* ALERT CLASS DEFINITION
+ * ====================== */
+
+ var dismiss = '[data-dismiss="alert"]'
+ , Alert = function (el) {
+ $(el).on('click', dismiss, this.close)
+ }
+
+ Alert.prototype.close = function (e) {
+ var $this = $(this)
+ , selector = $this.attr('data-target')
+ , $parent
+
+ if (!selector) {
+ selector = $this.attr('href')
+ selector = selector && selector.replace(/.*(?=#[^\s]*$)/, '') //strip for ie7
+ }
+
+ $parent = $(selector)
+
+ e && e.preventDefault()
+
+ $parent.length || ($parent = $this.hasClass('alert') ? $this : $this.parent())
+
+ $parent.trigger(e = $.Event('close'))
+
+ if (e.isDefaultPrevented()) return
+
+ $parent.removeClass('in')
+
+ function removeElement() {
+ $parent
+ .trigger('closed')
+ .remove()
+ }
+
+ $.support.transition && $parent.hasClass('fade') ?
+ $parent.on($.support.transition.end, removeElement) :
+ removeElement()
+ }
+
+
+ /* ALERT PLUGIN DEFINITION
+ * ======================= */
+
+ var old = $.fn.alert
+
+ $.fn.alert = function (option) {
+ return this.each(function () {
+ var $this = $(this)
+ , data = $this.data('alert')
+ if (!data) $this.data('alert', (data = new Alert(this)))
+ if (typeof option == 'string') data[option].call($this)
+ })
+ }
+
+ $.fn.alert.Constructor = Alert
+
+
+ /* ALERT NO CONFLICT
+ * ================= */
+
+ $.fn.alert.noConflict = function () {
+ $.fn.alert = old
+ return this
+ }
+
+
+ /* ALERT DATA-API
+ * ============== */
+
+ $(document).on('click.alert.data-api', dismiss, Alert.prototype.close)
+
+}(window.jQuery);
diff --git a/assets/javascripts/plugins/bootstrap_switch.js b/assets/javascripts/plugins/bootstrap_switch.js
new file mode 100644
index 0000000..9334f12
--- /dev/null
+++ b/assets/javascripts/plugins/bootstrap_switch.js
@@ -0,0 +1,14 @@
+/*! ============================================================
+ * bootstrapSwitch v1.8 by Larentis Mattia @SpiritualGuru
+ * http://www.larentis.eu/
+ *
+ * Enhanced for radiobuttons by Stein, Peter @BdMdesigN
+ * http://www.bdmdesign.org/
+ *
+ * Project site:
+ * http://www.larentis.eu/switch/
+ * ============================================================
+ * Licensed under the Apache License, Version 2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * ============================================================ */
+!function($){"use strict";$.fn['bootstrapSwitch']=function(method){var inputSelector='input[type!="hidden"]';var methods={init:function(){return this.each(function(){var $element=$(this),$div,$switchLeft,$switchRight,$label,$form=$element.closest('form'),myClasses="",classes=$element.attr('class'),color,moving,onLabel="ON",offLabel="OFF",icon=false,textLabel=false;$.each(['switch-mini','switch-small','switch-large'],function(i,el){if(classes.indexOf(el)>=0)myClasses=el});$element.addClass('has-switch');if($element.data('on')!==undefined)color="switch-"+$element.data('on');if($element.data('on-label')!==undefined)onLabel=$element.data('on-label');if($element.data('off-label')!==undefined)offLabel=$element.data('off-label');if($element.data('label-icon')!==undefined)icon=$element.data('label-icon');if($element.data('text-label')!==undefined)textLabel=$element.data('text-label');$switchLeft=$('
').addClass("switch-left").addClass(myClasses).addClass(color).html(onLabel);color='';if($element.data('off')!==undefined)color="switch-"+$element.data('off');$switchRight=$('').addClass("switch-right").addClass(myClasses).addClass(color).html(offLabel);$label=$('