<?php
/*
Template Name: 投稿模板
*/
ceo_tougao_admin();
?>
<?php
wp_enqueue_style('tougaocss',get_template_directory_uri().'/static/css/tougao.css');
get_header();
wp_enqueue_script('tougaojs',get_template_directory_uri().'/static/js/tougao.js');
?>
<?php if ( _ceo('ceo_tougao') == true): ?>
<section class="ceo-page-bg ceo-inline ceo-overflow-hidden ceo-flex ceo-flex-middle ceo-flex-center ceo-cat-category">

    <img src="<?php echo _ceo('tougao_bg'); ?>">

	<div class="ceo-overlay-primary ceo-position-cover"></div>
	<div class="ceo-overlay ceo-position-center ceo-text-center ceo-light">
		<h3 class="ceo-position-relative ceo-light ceo-margin-remove"><?php the_title(); ?></h3>
		<?php echo _ceo('tougao_title'); ?>
	</div>
</section>
<style>
.wrap {
    margin-top: -50px;
}
@media (max-width: 1239px) {
    .wrap {
        margin-top:-30px
    }
}
</style>
<?php endif; ?>
<?php if(_ceo('ceo_bolang') == true ): ?>
<div class="ceo-meihua-boo">
	<svg class="ceo-meihua-boo-waves" viewBox="0 24 150 28" preserveAspectRatio="none" shape-rendering="auto">
		<defs>
			<path id="gentle-wave" d="M-160 44c30 0 58-18 88-18s 58 18 88 18 58-18 88-18 58 18 88 18 v44h-352z" />
		</defs>
		<g class="ceo-meihua-boo-parallax">
			<use xlink:href="#gentle-wave" x="48" y="0" fill="rgba(255,255,255,0.7" />
			<use xlink:href="#gentle-wave" x="48" y="3" fill="rgba(255,255,255,0.5)" />
			<use xlink:href="#gentle-wave" x="48" y="5" fill="rgba(255,255,255,0.3)" />
			<use xlink:href="#gentle-wave" x="48" y="7" fill="#fff" />
		</g>
	</svg>
</div>
<?php endif; ?>
<section class="ceo-container">

    <div id='wrap'>
        <div class="wrap container">
            <form method='post' class='post-form' id='j-form'>
                <?php wp_nonce_field('update_post_tougao','update_post_tougao') ?>
                <input type='hidden' name='ID' value>
                <div class=post-form-main>
                    <div class="pf-item clearfix">
                        <div class="pf-item-label col-sm-2"><label for=post-title>标题</label></div>
                        <div class="pf-item-input col-sm-22"><input type=text class=form-control maxlength=200 id=post-title name=post-title placeholder=在此输入标题 value autocomplete=off>
                        </div>
                    </div>
                    <div class="pf-item clearfix">
                        <div class="pf-item-label col-sm-2"><label for=post-content>摘要</label></div>
                        <div class="pf-item-input col-sm-22"><textarea id=post-excerpt name=post-excerpt class=form-control rows=3 placeholder=摘要可选填></textarea></div>
                    </div>

                    <?php ceo_tougao_shop(); ?>

                    <div class="pf-item clearfix">
                        <div class="pf-item-label col-sm-2"><label for=post-content>正文</label></div>
                        <div class="pf-item-input col-sm-22">
                            <div id=wp-post-content-wrap class="wp-core-ui wp-editor-wrap tmce-active">
                                <?php
                                wp_enqueue_media();


                                wp_editor('','post-content',array(
                                    'quicktags' => false
                                ));
                                ?>
                            </div>
                        </div>

                    </div>

                    <div class="ceo-tougao-sx">
                        <div class="pf-item clearfix">
                            <div class="postmeta-class">
                                <div class="inside">
                                    <div class="csf csf-metabox csf-theme-dark">
                                        <div class="csf-wrapper csf-show-all">
                                            <div class="csf-content">
                                                <div class="csf-sections">
                                                    <div id="csf-section-ceo_post_opts_1" class="csf-section csf-onload">
                                                        <div class="csf-field csf-field-text ceo-tougao-ys">
                                                            <div class="csf-title ceo-tougao-shux"><h4>演示</h4></div>
                                                            <div class="csf-fieldset ceo-tougao-yss"><input type="text"
                                                                                             class="form-control"
                                                                                             name="ceo_post_opts[down_demourl]"
                                                                                             value=""
                                                                                             data-depend-id="down_demourl">
                                                                <p class="csf-text-desc">
                                                                    填写演示地址（请以http://或https://开头）</p>
                                                            </div>
                                                            <div class="clear"></div>
                                                        </div>
                                                        <div class="csf-field csf-field-repeater ceo-tougao-ys">
                                                            <div class="csf-title ceo-tougao-shux"><h4>属性</h4></div>
                                                            <div class="csf-fieldset ceo-tougao-yss">
                                                                <!--item end-->
                                                                <div class="csf-repeater-wrapper csf-data-wrapper ui-sortable"
                                                                     data-unique-id="ceo_post_opts"
                                                                     data-field-id="[down_info]" data-max="0" data-min="0">
                                                                </div>
                                                                <a href="javascript:void(0)"
                                                                   class="button button-primary csf-repeater-add"><i
                                                                            class="fa fa-plus-circle"></i></a>
                                                                <p class="csf-text-desc">
                                                                    温馨提示：标题填写：评分，描述内容填写：1-5数字，即可显示★星星评分图标</p></div>
                                                            <div class="clear"></div>
                                                        </div>
                                                    </div>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>

                        <div class="pf-item clearfix">
                            <div class="postmeta-class">
                                <div id="csf-section-ceo_post_tese_1" class="csf-section csf-onload" style="">
                                    <div class="csf-field csf-field-radio ceo-tougao-ysz">
                                        <div class="csf-title ceo-tougao-shux"><h4>标签</h4></div>
                                        <div class="csf-fieldset ceo-tougao-yss">
                                            <ul class="csf--inline-list">
                                                <li><label><input type="radio" name="ceo_post_tese[ceo-tese-tag]"
                                                                  value="buxuanze" data-depend-id="ceo-tese-tag"
                                                                  checked=""> 不选择</label></li>
                                                <li><label><input type="radio" name="ceo_post_tese[ceo-tese-tag]"
                                                                  value="remen" data-depend-id="ceo-tese-tag">
                                                        热门</label></li>
                                                <li><label><input type="radio" name="ceo_post_tese[ceo-tese-tag]"
                                                                  value="dujia" data-depend-id="ceo-tese-tag">
                                                        独家</label></li>
                                                <li><label><input type="radio" name="ceo_post_tese[ceo-tese-tag]"
                                                                  value="zuixin" data-depend-id="ceo-tese-tag">
                                                        最新</label></li>
                                                <li><label><input type="radio" name="ceo_post_tese[ceo-tese-tag]"
                                                                  value="tuijian" data-depend-id="ceo-tese-tag"> 推荐</label>
                                                </li>
                                                <li><label><input type="radio" name="ceo_post_tese[ceo-tese-tag]"
                                                                  value="jingpin" data-depend-id="ceo-tese-tag"> 精品</label>
                                                </li>
                                            </ul>
                                            <p class="csf-text-desc">文章标题前显示特色标签</p></div>
                                        <div class="clear"></div>
                                    </div>
                                    <div class="csf-field csf-field-radio ceo-tougao-ysz">
                                        <div class="csf-title ceo-tougao-shux"><h4>商标</h4></div>
                                        <div class="csf-fieldset ceo-tougao-yss">
                                            <ul class="csf--inline-list">
                                                <li><label><input type="radio" name="ceo_post_tese[ceo-shang-tag]"
                                                                  value="no_shang" data-depend-id="ceo-shang-tag"
                                                                  checked=""> 不显示</label></li>
                                                <li><label><input type="radio" name="ceo_post_tese[ceo-shang-tag]"
                                                                  value="yes_shang" data-depend-id="ceo-shang-tag">
                                                        显示</label></li>
                                            </ul>
                                            <p class="csf-text-desc">文章标题前显示“商”图标</p></div>
                                        <div class="clear"></div>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>

                    <div class="pf-item clearfix">
                    </div>


                </div>
                <div class=post-form-sidebar>
                    <div class=pf-submit-wrap>
                        <button type=submit class="tougao_btn btn-primary btn-block btn-lg pf-submit">提交发布</button>
                    </div>
                    <div class=pf-side-item>
                        <div class=pf-side-label><h3>分类</h3></div>
                        <div class=pf-side-input>
                            <select multiple=multiple size=5 id=post-category name=post-category[] class=form-control>
                                <?php ceo_tougao_cat(); ?>
                            </select>
                            <p class="pf-notice">小提示：按住键盘Ctrl键+鼠标左键可多选分类</p>
                        </div>
                    </div>
                    <div class=pf-side-item>
                        <div class=pf-side-label><h3>标签</h3></div>
                        <div class=pf-side-input>
                            <ul id=tag-container></ul>
                            <p class=pf-notice>即文章关键词，使用回车换行键确定，可选填</p></div>
                    </div>
                    <div class=pf-side-item>
                        <div class=pf-side-label><h3>缩略图</h3></div>
                        <div class=pf-side-input>
                            <div id=j-thumb-wrap class=thumb-wrap></div>
                            <a class="thumb-selector j-thumb" href=javascript:;>设置缩略图片</a>
                            <p class=pf-notice>文章缩略图会显示在文章列表，建议设置一下缩略图</p></div>
                        <input type=hidden name=_thumbnail_id id=_thumbnail_id value></div>
                </div>
            </form>
        </div>
        <script>var postTags = [];</script>
    </div>
</section>
<div class="clear" style="both:clear"></div>
<style>
    .csf-shortcode-button{
        display: none !important;
    }
</style>
<script>
    $(function () {
        jQuery("#start_down2").on("click",function(){
            jQuery(".tougao-item-erphpdown").show();
        });

        jQuery("#start_see2, #start_see1").on("click",function(){
            jQuery(".tougao-item-erphpdown").hide();
            jQuery(".tougao-item-erphpdown-see").show();
        });

        jQuery("#start_down1").on("click",function(){
            jQuery(".tougao-item-erphpdown").hide();
        });
    })
</script>
<?php
wp_enqueue_style('csfcss', get_template_directory_uri() . '/inc/codestar-framework/assets/css/csf.min.css');
?>



<?php
if(false){
    echo '<script>
    (function($) {
        $.fn.pasteImageReader = function() {

        }
    }(jQuery));
</script>';

}
if(is_plugin_active('imgspider/index.php')){
    if(defined('WB_CORE_ASSETS_LOAD') && class_exists('WB_Core_Asset_Load')){
        WB_Core_Asset_Load::load('post-01');
    }else{
        wp_enqueue_style('wbp-admin-style-imgspy',IMGSPY_URI.'assets/wbp_admin_imgspy.css', array(), IMGSPY_VERSION);
    }

    wp_register_script( 'wbs-imgspy-inline-js', false, null, false );
    wp_enqueue_script( 'wbs-imgspy-inline-js' );

    $ajax_nonce = wp_create_nonce('wp_ajax_wb_imgspider');
    $imgspider_ver = get_option('wb_imgspider_ver',0);
//    $config_url = admin_url('options-general.php?page=imgspider_pack#/extension');
    $config_url = admin_url('403.php');

    wp_add_inline_script('wbs-imgspy-inline-js','var imgspy_cnf='.json_encode(WB_IMGSPY_Conf::opt()).',wb_ajaxurl=\''.admin_url('admin-ajax.php').'\',imgspider_ver='.$imgspider_ver.',_wb_imgspider_ajax_nonce=\''.$ajax_nonce.'\',imgspider_pro_url=\''.$config_url.'\';','before');
}

?>


<style>
    @media (min-width: 1240px) {
        .container {
            width: auto;
        }
    }
    .csf-section{
        display: block !important;
    }
</style>
<?php get_footer(); ?>

