-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Nicolas
committed
Apr 19, 2014
0 parents
commit 7b9db0e
Showing
40 changed files
with
5,623 additions
and
0 deletions.
There are no files selected for viewing
Binary file not shown.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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('×') | ||
) | ||
) | ||
|
||
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; | ||
}); | ||
}); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.