This repository has been archived on 2024-12-01. You can view files and clone it, but cannot push or open issues or pull requests.
factuges_web/www/themes/factuges/assets/scripts/ui-general.js
david e93adbdd4e - Importación inicial
- Registro, activación y entrada de usuarios


git-svn-id: https://192.168.0.254/svn/Rodax.factuges_web/trunk@2 e455b18d-f7fe-5245-9c43-e2c35af70a32
2013-06-13 16:04:48 +00:00

147 lines
5.7 KiB
JavaScript

var UIGeneral = function () {
var handlePulsate = function () {
if (!jQuery().pulsate) {
return;
}
if (App.isIE8() == true) {
return; // pulsate plugin does not support IE8 and below
}
if (jQuery().pulsate) {
jQuery('#pulsate-regular').pulsate({
color: "#bf1c56"
});
jQuery('#pulsate-once').click(function () {
$(this).pulsate({
color: "#399bc3",
repeat: false
});
});
jQuery('#pulsate-hover').pulsate({
color: "#5ebf5e",
repeat: false,
onHover: true
});
jQuery('#pulsate-crazy').click(function () {
$(this).pulsate({
color: "#fdbe41",
reach: 50,
repeat: 10,
speed: 100,
glow: true
});
});
}
}
var handleGritterNotifications = function () {
if (!jQuery.gritter) {
return;
}
$('#gritter-sticky').click(function () {
var unique_id = $.gritter.add({
// (string | mandatory) the heading of the notification
title: 'This is a sticky notice!',
// (string | mandatory) the text inside the notification
text: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vivamus eget tincidunt velit. Cum sociis natoque penatibus et <a href="#" style="color:#ccc">magnis dis parturient</a> montes, nascetur ridiculus mus.',
// (string | optional) the image to display on the left
image: './assets/img/avatar1.jpg',
// (bool | optional) if you want it to fade out on its own or just sit there
sticky: true,
// (int | optional) the time you want it to be alive for before fading out
time: '',
// (string | optional) the class name you want to apply to that specific message
class_name: 'my-sticky-class'
});
return false;
});
$('#gritter-regular').click(function () {
$.gritter.add({
// (string | mandatory) the heading of the notification
title: 'This is a regular notice!',
// (string | mandatory) the text inside the notification
text: 'This will fade out after a certain amount of time. Vivamus eget tincidunt velit. Cum sociis natoque penatibus et <a href="#" style="color:#ccc">magnis dis parturient</a> montes, nascetur ridiculus mus.',
// (string | optional) the image to display on the left
image: './assets/img/avatar1.jpg',
// (bool | optional) if you want it to fade out on its own or just sit there
sticky: false,
// (int | optional) the time you want it to be alive for before fading out
time: ''
});
return false;
});
$('#gritter-max').click(function () {
$.gritter.add({
// (string | mandatory) the heading of the notification
title: 'This is a notice with a max of 3 on screen at one time!',
// (string | mandatory) the text inside the notification
text: 'This will fade out after a certain amount of time. Vivamus eget tincidunt velit. Cum sociis natoque penatibus et <a href="#" style="color:#ccc">magnis dis parturient</a> montes, nascetur ridiculus mus.',
// (string | optional) the image to display on the left
image: './assets/img/avatar1.jpg',
// (bool | optional) if you want it to fade out on its own or just sit there
sticky: false,
// (function) before the gritter notice is opened
before_open: function () {
if ($('.gritter-item-wrapper').length == 3) {
// Returning false prevents a new gritter from opening
return false;
}
}
});
return false;
});
$('#gritter-without-image').click(function () {
$.gritter.add({
// (string | mandatory) the heading of the notification
title: 'This is a notice without an image!',
// (string | mandatory) the text inside the notification
text: 'This will fade out after a certain amount of time. Vivamus eget tincidunt velit. Cum sociis natoque penatibus et <a href="#" style="color:#ccc">magnis dis parturient</a> montes, nascetur ridiculus mus.'
});
return false;
});
$('#gritter-light').click(function () {
$.gritter.add({
// (string | mandatory) the heading of the notification
title: 'This is a light notification',
// (string | mandatory) the text inside the notification
text: 'Just add a "gritter-light" class_name to your $.gritter.add or globally to $.gritter.options.class_name',
class_name: 'gritter-light'
});
return false;
});
$("#gritter-remove-all").click(function () {
$.gritter.removeAll();
return false;
});
}
return {
//main function to initiate the module
init: function () {
handlePulsate();
handleGritterNotifications();
}
};
}();