$("#document").ready(function(){ $("#hutcms_cpopen").click(function(){ if ($("#hutcms_control").html() == "") { $("#hutcms_control").load("http://shbp.welcometouhc.com/ajax/controller/get_panel",function(){ $("#hutcms_control").slideDown('slow'); }); } else { hutcms_reset_cp(); } }); $("#hutcms_cpwrapper a").tooltip({showURL:false}); $("#hutcms_add_content").dialog({modal: true,width:300,position:'center',autoOpen:false}); $("#hutcms_add_content_button").click(function(){ $("#hutcms_add_content").dialog("open"); }); $(".hutcms_wedit_delete").click(function(){ if (confirm("Content Block will be removed - are you sure?")) { window.location = $(this).attr('wid'); } }); $("body").append("
"); $("#timeralert").dialog({modal: true,width:500,position:'top',autoOpen:false}); }); function hutcms_reset_cp() { $("#hutcms_control").slideUp('slow',function(){ $("#hutcms_control").empty(); }); } function check_session() { $.getJSON('/ajax/sessiontimer/check',function(data){ if (data.alert == 'Show') { $("#timeralert").dialog('open'); loadalert(); } }); timercheck = setTimeout('check_session()',20000); } var alertloader = ''; function loadalert() { $("#timeralert").load('/ajax/sessiontimer/alertscreen', function() { if ($("#timeralert").html() == "Session restored.") { clearTimeout(alertloader); $("#timeralert").dialog('close'); check_session(); } }); alertloader = setTimeout('loadalert()',1000); clearTimeout(timercheck); } function resetTimer(){ clearTimeout(alertloader); $.get('/ajax/sessiontimer/resettimer'); $("#timeralert").dialog('close'); check_session(); } // this is to minimize the pain of the TinyMCE upgrade var tinyMCE; $(document).ready(function() { if (typeof tinyMCE == "undefined") tinyMCE = new t_fakeTinyMCE(); }); function t_fakeTinyMCE() {} t_fakeTinyMCE.prototype.triggerSave = function() { try { if (typeof tinyMCE != "undefined") // tinymce.moxiecode.com/punbb/viewtopic.php?pid=22373#p22373 // for (instanceIndex in tinyMCE.instances) // if (tinyMCE.isInstance(tinyMCE.instances[instanceIndex])) // tinyMCE.removeInstance(tinyMCE.instances[instanceIndex]); // tinymce.moxiecode.com/punbb/viewtopic.php?pid=41536#p41536 for (editorId in tinyMCE.editors) tinyMCE.execCommand('mceRemoveControl', false, editorId); } catch(err) {} } // used in modules' mod_edit files function hutcms_open_dialog(title, url) { $("#record") .dialog("destroy") .remove(); $("body").append("
"); $("#record") .dialog({ modal: true, width: 850, position: "top", autoOpen: false, beforeclose: function(event, ui) { try { if (typeof tinyMCE != "undefined") // tinymce.moxiecode.com/punbb/viewtopic.php?pid=22373#p22373 // for (instanceIndex in tinyMCE.instances) // if (tinyMCE.isInstance(tinyMCE.instances[instanceIndex])) // tinyMCE.removeInstance(tinyMCE.instances[instanceIndex]); // tinymce.moxiecode.com/punbb/viewtopic.php?pid=41536#p41536 for (editorId in tinyMCE.editors) tinyMCE.execCommand('mceRemoveControl', false, editorId); } catch(err) {} } }) .load(url) .dialog("open"); return false; }