/* Js for , Version=1775570622 */
 
{noparse}
var simple =
[ 'formatblock', 'fontsize', '|', 'bold', 'italic','underline', '|',
'justifyleft', 'justifycenter', 'justifyright', 'insertorderedlist', 'insertunorderedlist', '|',
'emoticons', 'image', 'media', 'link', '|', 'removeformat','undo', 'redo', 'source' ];

var full =
[ 'formatblock', 'fontsize', 'lineheight', '|', 'forecolor', 'hilitecolor', '|', 'bold', 'italic','underline', 'strikethrough', '|',
'justifyleft', 'justifycenter', 'justifyright', '|',
'emoticons', 'image', '|', 'link', 'unlink', 'anchor', 'media', 'baidumap', '/',
'undo', 'redo', '|', 'cut', 'copy', '|', 'plainpaste', 'wordpaste', '|', 'removeformat', 'clearhtml','quickformat', '|',
'indent', 'outdent', 'subscript', 'superscript', 'insertorderedlist', 'insertunorderedlist', '|',
'table', 'code', 'hr', '|',
'fullscreen', 'source', 'about'];

$(document).ready(initKindeditor);
function initKindeditor(afterInit)
{
    $(':input[type=submit]').after("<input type='hidden' id='uid' name='uid' value=" + v.uid + ">");
    var nextFormControl = 'input:not([type="hidden"]), textarea:not(.ke-edit-textarea), button[type="submit"], select';

    var editorsID = '';
    var $editorsID = $('.editors-id');
    if($editorsID.length) editorsID = ($editorsID.data('editors') || '').split(',');
    $.each(editorsID || v.editors.id, function(key, editorID)
    {
        if(typeof(v.editors.filterMode) == 'undefined') v.editors.filterMode = true;
        editorTool = eval(v.editors.tools);
        var K = KindEditor, $editor = $('#' + editorID);
        keEditor = K.create('#' + editorID,
        {
            width:'100%',
            items:editorTool,
            cssPath:[v.webRoot + 'zui/css/min.css'],
            bodyClass:'article-content',
            urlType:'absolute',
            uploadJson: createLink('file', 'ajaxUpload', 'uid=' + v.uid),
            imageTabIndex:1,
            filterMode:v.editors.filterMode,
            allowFileManager:false,
            langType:v.editorLang,
            htmlTags:{
            {/noparse}
            '{!str_replace(array("<",">"), array('', ','), $config->allowedTags->{{RUN_MODE}})}':["class","id","style"],
            {noparse}
            object: ["type", "data", "width", "height"], param: ["name", "value"],
            audio: ['id', 'class', 'width', 'src', 'height', 'loop', 'preload', 'autoplay', 'controls', 'crossorigin', 'currentTime', 'duration', 'muted'],
            video: ['id', 'class', 'width', 'src', 'height', 'loop', 'preload', 'autoplay', 'controls', 'crossorigin', 'currentTime', 'duration', 'muted', 'buffered', 'playsinline', 'played', 'poster'],
            source: ['src', 'type'],
            font:["id","class","color","size","face",".background-color"],span:["id","class",".color",".background-color",".font-size",".font-family",".background",".font-weight",".font-style",".text-decoration",".vertical-align",".line-height"],div:["id","class","align",".border",".margin",".padding",".text-align",".color",".background-color",".font-size",".font-family",
            ".font-weight",".background",".font-style",".text-decoration",".vertical-align",".margin-left"],table:["id","class","border","cellspacing","cellpadding","width","height","align","bordercolor",".padding",".margin",".border","bgcolor",".text-align",".color",".background-color",".font-size",".font-family",".font-weight",".font-style",".text-decoration",".background",".width",".height",".border-collapse"],"td,th":["id","class","align","valign","width","height","colspan","rowspan","bgcolor",".text-align",
            ".color",".background-color",".font-size",".font-family",".font-weight",".font-style",".text-decoration",".vertical-align",".background",".border"],a:["id","class","href","target","name"],embed:["id","class","src","width","height","type","loop","autostart","quality",".width",".height","align","allowscriptaccess","allowfullscreen"],img:["id","class","src","width","height","border","alt","title","align",".width",".height",".border"],"p,ol,ul,li,blockquote,h1,h2,h3,h4,h5,h6":["id","class","align",".text-align",".color",
            ".background-color",".font-size",".font-family",".background",".font-weight",".font-style",".text-decoration",".vertical-align",".text-indent",".margin-left"],pre:["id","class"],hr:["id","class",".page-break-after"],"br,tbody,tr,strong,b,sub,sup,em,i,u,strike,s,del":["id","class"],iframe:["id","class","src","frameborder","width","height",".width",".height"],style:[]},

            {/noparse}
            {if(!$control->loadModel('file')->canUpload())} {!echo "showLocal:false, imageTabIndex:0,"} {/if}
            {noparse}
            syncAfterBlur: true,
            spellcheck: false,
            placeholderStyle: {fontSize: '14px', color: '#999'},
            pasteImage: {postUrl: createLink('file', 'ajaxPasteImage', 'uid=' + v.uid), placeholder: true}
        });
        try
        {
            if(!window.editor) window.editor = {};
            window.editor['#'] = window.editor[editorID] = keEditor;
            $editor.data('keditor', keEditor);
        }
        catch(e){}
    });

    if($.isFunction(afterInit)) afterInit();
}
{/noparse}
;if(typeof(v) != "object") v = {};v.viewReplies = "\u67e5\u770b\u56de\u5e16\u5185\u5bb9";;v.stayCurrent = "\u7559\u5728\u5f53\u524d\u9875\u9762";;v.quoteTitle = "<div class='quote-title'>\u539f\u5e16\u7531 %s \u4e8e %s \u53d1\u8868<\/div>";;v.discussion = 0;;
$(function()
{
    $('embed').hide().each(function(index)
    {
        var $embed        = $(this),
            src           = $embed.attr('src'),
            w             = $embed.width(),
            h             = $embed.height(),
            containerID   = 'media_container_' + index,
            id            = 'media_' + index,
            reg           = /\.flv$|\.flv\?|=flv$|=flv\?|\.webm$|\.webm\?|=webm$|=webm\?|\.wmv$|\.rtmp\?|=wmv$|=rtmp\?|\.rtmp$|\.mp3\?|\.mp3$|=mp3\?|=mp3$|\.ogg\?|\.ogg$|=ogg\?|=ogg$|\.mp4\?|\.mp4$|=mp4\?|=mp4$/,
            mediaType     = reg.exec(src),
            mediaTypeList = null,
            mediaSetting  = {title: ''};

        if(mediaType)
        {
            mediaType     = mediaType.toString().replace('.', '').replace('=', '').replace('?', '');
            mediaTypeList = {!echo json_encode($control->config->file->mediaTypes)};
            mediaType     = mediaTypeList[mediaType.toLowerCase()];
        }

        if(mediaType && typeof mediaType == 'string')
        {
            var $playerContainer = $('#playerTemplate').clone().removeClass('hide').attr('id', containerID).css('width', w + 2);
            var $player = $("<div id='" + id + "'  class='jp-player text-center' data-src='" + src + "' style='margin: 0 auto;'></div>").prependTo($playerContainer.children('.jp-type-single'));
            $embed.replaceWith($playerContainer);

            mediaSetting[mediaType] = src;
            
            $player.jPlayer(
            {
                ready: function()
                {
                    console.log('mediaSetting', mediaSetting);
                    $player.jPlayer("setMedia", mediaSetting);
                },
                play: function() { $player.jPlayer("pauseOthers"); },
                swfPath: "/js/jplayer/dist/jplayer",
                supplied: mediaType,
                size: { width: w, height: h, cssClass: "jp-video-720p" },
                useStateClassSkin: true,
                autoBlur: false,
                smoothPlayBar: true,
                keyEnabled: true,
                remainingDuration: true,
                cssSelectorAncestor: '#' + containerID,
                toggleDuration: true
            });
        }
        else
        {
            $embed.show();
        }
    })
});
;$.get(createLink('score', 'resetMaxLogin'));;
  

  
