//select all the a tag with name equal to modal function module_diary(EID,vtype) { ////////////////// $.ajax({ url: '/modules/diary.php?event='+EID+'&vtype='+vtype, type: 'GET', dataType: 'html', timeout: 1000, error: function(){ }, success: function(html){ /////////////////////////////////////////////////////////// if(vtype != 1){ //Cancel the link behavior var id = "#boxes"; $("#module_diary").html(html); var maskHeight = $(document).height(); var maskWidth = $(window).width(); $('#mask').css({'width':maskWidth,'height':maskHeight}); $('#mask').fadeIn(); //Get the window height and width var winH = $(window).height(); var winW = $(window).width(); //Set the popup window to center $(id).css('top', winH/2-$(id).height()/2); $(id).css('left', winW/2-$(id).width()/2); //transition effect $(id).fadeIn(); $('#diary_lh').jScrollPane({showArrows:true}); $(".rdata").css("border-bottom", "1px solid #eee"); $(".rdata").hover(function(){ ///OVER $(this).css("background", "#fff5c5"); $(this).css("cursor", "pointer"); },function(){ ///OUT $(this).css("background", "transparent"); }); }else{ /////////////////////////////////////////////////////////// $("#diar_cont").html(html); } $(".rdata").click(function () { rightCALL($(this).attr('id')); }); /////////////////////////////////////////////////////////// } }); ////////////////// }; $(document).ready(function() { //if close button is clicked $('#boxes .closeb').click(function (e) { //Cancel the link behavior e.preventDefault(); $('#mask, #boxes').fadeOut(); }); $('#boxes .refreshb').click(function (e) { //Cancel the link behavior e.preventDefault(); module_diary(); }); //if mask is clicked $('#mask').click(function () { $(this).fadeOut(); $('#boxes').fadeOut(); $("#extcontrol").fadeOut(); $('#extsite').fadeOut(); }); $(document).keyup(function(e) { if(e.keyCode == 27) { $('#mask').fadeOut(); $('#extsite').fadeOut(); $("#extcontrol").fadeOut(); $('#boxes').fadeOut(); } }); }); function rightCALL(eid){ $.ajax({ url: '/modules/diaryevent.php?event='+eid, type: 'GET', dataType: 'html', timeout: 1000, error: function(){ }, success: function(html){ $('#diary_rh').css("background", ""); $('#diary_rh').html(html); $('#savediarystat').click(function (e) { e.preventDefault(); if($('#smsrem').length >0 ){ smsss = $('#smsrem').val()+""; }else{ smsss = "OFF"; } if($('#emailrem').length >0 ){ emailss = $('#emailrem').val()+""; }else{ emailss = "OFF"; } $.ajax({ url: '/modules/diaryupdate.php?event='+eid+'&sms='+smsss+'&email='+emailss, type: 'GET', dataType: 'html', timeout: 1000, error: function(){ }, success: function(html){ alert(html); } }); }); $('#removediaryevent').click(function (e) { e.preventDefault(); diary = confirm("Are you sure you want to delete this event?\n\nAll alerts will be cancelled.\n\n"); eventid = $(this).attr('title'); if(diary){ $.ajax({ url: '/modules/diaryupdate.php?event='+eventid+'&remove=do', type: 'GET', dataType: 'html', timeout: 1000, error: function(){ }, success: function(html){ module_diary(); } }); }else{ alert("saved") } }); } }); }