'; 5 | 6 | $('.chat-message button').click(function(){ 7 | var input = $(this).siblings('span').children('input[type=text]'); 8 | if(input.val() != ''){ 9 | add_message('You','img/demo/av1.jpg',input.val(),true); 10 | } 11 | }); 12 | 13 | $('.chat-message input').keypress(function(e){ 14 | if(e.which == 13) { 15 | if($(this).val() != ''){ 16 | add_message('You','img/demo/av1.jpg',$(this).val(),true); 17 | } 18 | } 19 | }); 20 | 21 | setTimeout(function(){ 22 | add_message('Linda','img/demo/av2.jpg','Hello Every one do u want to freindship with me?') 23 | },'1000'); 24 | setTimeout(function(){ 25 | add_message('Mark','img/demo/av3.jpg','Yuppi! why not sirji!!.') 26 | },'4000'); 27 | setTimeout(function(){ 28 | add_message('Linda','img/demo/av2.jpg','Thanks!!! See you soon than') 29 | },'8000'); 30 | setTimeout(function(){ 31 | add_message('Mark','img/demo/av3.jpg','ok Bye than!!!.') 32 | },'12000'); 33 | setTimeout(function(){ 34 | remove_user('Linda','Linda') 35 | },'16000'); 36 | var i = 0; 37 | function add_message(name,img,msg,clear) { 38 | i = i + 1; 39 | var inner = $('#chat-messages-inner'); 40 | var time = new Date(); 41 | var hours = time.getHours(); 42 | var minutes = time.getMinutes(); 43 | if(hours < 10) hours = '0' + hours; 44 | if(minutes < 10) minutes = '0' + minutes; 45 | var id = 'msg-'+i; 46 | var idname = name.replace(' ','-').toLowerCase(); 47 | inner.append('
'
48 | +''+name+' - '+hours+':'+minutes+''
49 | +''+msg+'
User '+name+' left the chat
'); 64 | $('#'+id).hide().fadeIn(800); 65 | } 66 | }); 67 | -------------------------------------------------------------------------------- /public/js/matrix.form_validation.js: -------------------------------------------------------------------------------- 1 | 2 | $(document).ready(function(){ 3 | 4 | $('input[type=checkbox],input[type=radio],input[type=file]').uniform(); 5 | 6 | $('select').select2(); 7 | 8 | // Form Validation 9 | $("#basic_validate").validate({ 10 | rules:{ 11 | required:{ 12 | required:true 13 | }, 14 | email:{ 15 | required:true, 16 | email: true 17 | }, 18 | date:{ 19 | required:true, 20 | date: true 21 | }, 22 | url:{ 23 | required:true, 24 | url: true 25 | } 26 | }, 27 | errorClass: "help-inline", 28 | errorElement: "span", 29 | highlight:function(element, errorClass, validClass) { 30 | $(element).parents('.control-group').addClass('error'); 31 | }, 32 | unhighlight: function(element, errorClass, validClass) { 33 | $(element).parents('.control-group').removeClass('error'); 34 | $(element).parents('.control-group').addClass('success'); 35 | } 36 | }); 37 | 38 | $("#number_validate").validate({ 39 | rules:{ 40 | min:{ 41 | required: true, 42 | min:10 43 | }, 44 | max:{ 45 | required:true, 46 | max:24 47 | }, 48 | number:{ 49 | required:true, 50 | number:true 51 | } 52 | }, 53 | errorClass: "help-inline", 54 | errorElement: "span", 55 | highlight:function(element, errorClass, validClass) { 56 | $(element).parents('.control-group').addClass('error'); 57 | }, 58 | unhighlight: function(element, errorClass, validClass) { 59 | $(element).parents('.control-group').removeClass('error'); 60 | $(element).parents('.control-group').addClass('success'); 61 | } 62 | }); 63 | 64 | $("#password_validate").validate({ 65 | rules:{ 66 | pwd:{ 67 | required: true, 68 | minlength:6, 69 | maxlength:20 70 | }, 71 | pwd2:{ 72 | required:true, 73 | minlength:6, 74 | maxlength:20, 75 | equalTo:"#pwd" 76 | } 77 | }, 78 | errorClass: "help-inline", 79 | errorElement: "span", 80 | highlight:function(element, errorClass, validClass) { 81 | $(element).parents('.control-group').addClass('error'); 82 | }, 83 | unhighlight: function(element, errorClass, validClass) { 84 | $(element).parents('.control-group').removeClass('error'); 85 | $(element).parents('.control-group').addClass('success'); 86 | } 87 | }); 88 | }); 89 | -------------------------------------------------------------------------------- /public/js/matrix.interface.js: -------------------------------------------------------------------------------- 1 | 2 | $(document).ready(function(){ 3 | 4 | // === jQuery Peity === // 5 | $.fn.peity.defaults.line = { 6 | strokeWidth: 1, 7 | delimeter: ",", 8 | height: 24, 9 | max: null, 10 | min: 0, 11 | width: 50 12 | }; 13 | $.fn.peity.defaults.bar = { 14 | delimeter: ",", 15 | height: 24, 16 | max: null, 17 | min: 0, 18 | width: 50 19 | }; 20 | $(".peity_line_good span").peity("line", { 21 | colour: "#B1FFA9", 22 | strokeColour: "#459D1C" 23 | }); 24 | $(".peity_line_bad span").peity("line", { 25 | colour: "#FFC4C7", 26 | strokeColour: "#BA1E20" 27 | }); 28 | $(".peity_line_neutral span").peity("line", { 29 | colour: "#CCCCCC", 30 | strokeColour: "#757575" 31 | }); 32 | $(".peity_bar_good span").peity("bar", { 33 | colour: "#459D1C" 34 | }); 35 | $(".peity_bar_bad span").peity("bar", { 36 | colour: "#BA1E20" 37 | }); 38 | $(".peity_bar_neutral span").peity("bar", { 39 | colour: "#757575" 40 | }); 41 | 42 | // === jQeury Gritter, a growl-like notifications === // 43 | $.gritter.add({ 44 | title: 'Important Unread messages', 45 | text: 'You have 12 unread messages.', 46 | image: 'img/demo/envelope.png', 47 | sticky: false 48 | }); 49 | $('#gritter-notify .normal').click(function(){ 50 | $.gritter.add({ 51 | title: 'Normal notification', 52 | text: 'This is a normal notification', 53 | sticky: false 54 | }); 55 | }); 56 | 57 | $('#gritter-notify .sticky').click(function(){ 58 | $.gritter.add({ 59 | title: 'Sticky notification', 60 | text: 'This is a sticky notification', 61 | sticky: true 62 | }); 63 | }); 64 | 65 | $('#gritter-notify .image').click(function(){ 66 | var imgsrc = $(this).attr('data-image'); 67 | $.gritter.add({ 68 | title: 'Important Unread messages', 69 | text: 'You have 12 unread messages.', 70 | image: imgsrc, 71 | sticky: false 72 | }); 73 | }); 74 | }); 75 | -------------------------------------------------------------------------------- /public/js/matrix.login.js: -------------------------------------------------------------------------------- 1 | 2 | $(document).ready(function(){ 3 | 4 | var login = $('#loginform'); 5 | var recover = $('#recoverform'); 6 | var speed = 400; 7 | 8 | $('#to-recover').click(function(){ 9 | 10 | $("#loginform").slideUp(); 11 | $("#recoverform").fadeIn(); 12 | }); 13 | $('#to-login').click(function(){ 14 | 15 | $("#recoverform").hide(); 16 | $("#loginform").fadeIn(); 17 | }); 18 | 19 | 20 | $('#to-login').click(function(){ 21 | 22 | }); 23 | 24 | if($.browser.msie == true && $.browser.version.slice(0,3) < 10) { 25 | $('input[placeholder]').each(function(){ 26 | 27 | var input = $(this); 28 | 29 | $(input).val(input.attr('placeholder')); 30 | 31 | $(input).focus(function(){ 32 | if (input.val() == input.attr('placeholder')) { 33 | input.val(''); 34 | } 35 | }); 36 | 37 | $(input).blur(function(){ 38 | if (input.val() == '' || input.val() == input.attr('placeholder')) { 39 | input.val(input.attr('placeholder')); 40 | } 41 | }); 42 | }); 43 | 44 | 45 | 46 | } 47 | }); -------------------------------------------------------------------------------- /public/js/matrix.popover.js: -------------------------------------------------------------------------------- 1 | 2 | $(function () 3 | { $("#example, #example2, #example3, #example4").popover(); 4 | }); 5 | 6 | 7 | !function( $ ) { 8 | "use strict" 9 | var Popover = function ( element, options ) { 10 | this.init('popover', element, options) 11 | } 12 | /* NOTE: POPOVER EXTENDS BOOTSTRAP-TOOLTIP.js 13 | ========================================== */ 14 | Popover.prototype = $.extend({}, $.fn.tooltip.Constructor.prototype, { 15 | constructor: Popover 16 | , setContent: function () { 17 | var $tip = this.tip() 18 | , title = this.getTitle() 19 | , content = this.getContent() 20 | $tip.find('.popover-title')[ $.type(title) == 'object' ? 'append' : 'html' ](title) 21 | $tip.find('.popover-content > *')[ $.type(content) == 'object' ? 'append' : 'html' ](content) 22 | $tip.removeClass('fade top bottom left right in') 23 | } 24 | , hasContent: function () { 25 | return this.getTitle() || this.getContent() 26 | } 27 | , getContent: function () { 28 | var content 29 | , $e = this.$element 30 | , o = this.options 31 | content = $e.attr('data-content') 32 | || (typeof o.content == 'function' ? o.content.call($e[0]) : o.content) 33 | content = content.toString().replace(/(^\s*|\s*$)/, "") 34 | return content 35 | } 36 | , tip: function() { 37 | if (!this.$tip) { 38 | this.$tip = $(this.options.template) 39 | } 40 | return this.$tip 41 | } 42 | }) 43 | /* POPOVER PLUGIN DEFINITION 44 | * ======================= */ 45 | $.fn.popover = function ( option ) { 46 | return this.each(function () { 47 | var $this = $(this) 48 | , data = $this.data('popover') 49 | , options = typeof option == 'object' && option 50 | if (!data) $this.data('popover', (data = new Popover(this, options))) 51 | if (typeof option == 'string') data[option]() 52 | }) 53 | } 54 | $.fn.popover.Constructor = Popover 55 | $.fn.popover.defaults = $.extend({} , $.fn.tooltip.defaults, { 56 | placement: 'right' 57 | , content: '' 58 | , template: '