$(function() { toggleAcl($('[name=acl]').val(), 'doc'); setTimeout(function(){initPage(docType)}, 50); $('input[name="type"]').change(function() { var type = $(this).val(); if(type == 'text') { $('#contentBox').removeClass('hidden'); $('#urlBox').addClass('hidden'); } else if(type == 'url') { $('#contentBox').addClass('hidden'); $('#urlBox').removeClass('hidden'); } }); if(typeof(window.editor) != 'undefined') { window.editor['content'].addListener('ready', function() { $('div#content .edui-toolbar').append("
"); }); } }) function toggleHover(obj) { if($(obj).hasClass('edui-state-hover')) return $(obj).removeClass('edui-state-hover'); return $(obj).addClass('edui-state-hover'); } function toggleEditor(type) { if(type == 'html') { $('.contenthtml').removeClass('hidden'); $('.contentmarkdown').addClass('hidden'); } else if(type == 'markdown') { $('.contenthtml').addClass('hidden'); $('.contentmarkdown').removeClass('hidden'); } $('#contentType').val(type); } function initPage(type) { if(type == 'html' || type == 'markdown') { if(type == 'markdown') { $('#contentBox .contentmarkdown').removeClass('hidden'); $('#contentBox .contenthtml').addClass('hidden'); $('#contentBox #contentType').val(type); } } else if(type == 'url') { $('#contentBox').addClass('hidden'); $('#urlBox').removeClass('hidden'); } if(type == 'word' || type == 'ppt' || type == 'excel') { $('#contentBox').hide(); $('#urlBox').hide(); } }