Skip to content

Commit

Permalink
Init repository
Browse files Browse the repository at this point in the history
  • Loading branch information
Nicolas committed Apr 19, 2014
0 parents commit 7b9db0e
Show file tree
Hide file tree
Showing 40 changed files with 5,623 additions and 0 deletions.
Binary file added assets/fonts/FontAwesome.otf
Binary file not shown.
Binary file added assets/fonts/fontawesome-webfont.eot
Binary file not shown.
414 changes: 414 additions & 0 deletions assets/fonts/fontawesome-webfont.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/fonts/fontawesome-webfont.ttf
Binary file not shown.
Binary file added assets/fonts/fontawesome-webfont.woff
Binary file not shown.
Binary file added assets/images/warning.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
125 changes: 125 additions & 0 deletions assets/javascripts/bootstrap.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,125 @@
/*
BootstrapSwitch
*/
function setBootstrapSwitch() {
$('.bootstrap-switch').each(function(index, element) {
installBootstrapSwitch(element);
});
}

function installBootstrapSwitch(element) {
$(element).bootstrapSwitch();
$(element).on('switch-change', function (e, data) {
var element = $(data.el);
var value = data.value;
element.val(value);
});
}


/*
BootstrapAlert
*/
function setBootstrapAlert(){
$('.alert').each(function(index, element){
$(element).alert();
});
}

function addAlertMessage(object){
$(object.target)
.append(
$('<div>')
.attr('class', 'alert fade in ' + object.type)
.html(object.message)
.prepend(
$('<button>')
.attr('class', 'close')
.attr('type', 'button')
.attr('data-dismiss', 'alert')
.html('&times;')
)
)

setBootstrapAlert();
}


/*
BootstrapTooltips
*/
function setBootstrapToolTips(){
$('.tooltips').each(function(index, element) {
$(element).tooltip({
position: {
my: "left+15 left",
at: "right center",
using: function( position, feedback ) {
$(this).css(position);
$('<div>')
.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;
});
});
}
99 changes: 99 additions & 0 deletions assets/javascripts/plugins/bootstrap_alert.js
Original file line number Diff line number Diff line change
@@ -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);
14 changes: 14 additions & 0 deletions assets/javascripts/plugins/bootstrap_switch.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 7b9db0e

Please sign in to comment.