@ -18,37 +18,35 @@ border-top: 1px solid #ccc;
< / style >
< div class = "row-fluid" >
< div class = "span2" >
<?php echo $nav_view ; ?>
<?php include 'nav.php' ; ?>
< / div >
< div class = "span10 " style = "padding-right:20px;" >
< legend > 编辑运势信息< / legend >
< form action = "" method = "POST" class = "form-inline" role = "form" >
< legend > 编辑运势信息 - <?php echo $current_zodiac ?> </ legend >
< form action = " <?php echo site_url ( 'zodiac/fortune_save' ) ?> " method = "POST" class = "form-inline" role = "form" name = "zodiac_edit" id = "zodiac_edit" >
< input type = "hidden" name = "sx" value = " <?php echo $current_zodiac ?> " >
< div class = "form-group" >
< label class = "sr-only" for = "" > 幸运数字< / label >
< input type = " email " class = "form-control" id = "" name = "lucky_num" placeholder = "2, 3" >
< input type = " text " class = "form-control" id = "" name = "lucky_num" placeholder = "2, 3" value = " <?php echo $zodiac_fortune -> LNY_LuckyNumber ?> " >
< / div >
< div class = "form-group" >
< label class = "sr-only" for = "" > 幸运色< / label >
< input type = " email " class = "form-control" id = "" name = "lucky_color" placeholder = "blue, gold, green" >
< input type = " text " class = "form-control" id = "" name = "lucky_color" placeholder = "blue, gold, green" value = " <?php echo $zodiac_fortune -> LNY_LuckyColor ?> " >
< / div >
< div class = "form-group" >
< label class = "sr-only" for = "" > 幸运花< / label >
< input type = " email " class = "form-control" id = "" name = "lucky_flo" placeholder = "tulip, sacred lily" >
< input type = " text " class = "form-control" id = "" name = "lucky_flo" placeholder = "tulip, sacred lily" value = " <?php echo $zodiac_fortune -> LNY_LuckyFlower ?> " >
< / div >
< div class = "form-group" >
< input type = "hidden" name = "theyearfortune" id = "theyearfortune" >
< label class = "sr-only" for = "" > 运势< / label >
< div id = "toolbar-container" >
< div id = "editor-toolbar" >
< div id = "code-btn" class = "w-e-menu code-menu" data-i = 1 style = "z-index:10001;" >
< i class = "w-e-icon-terminal" > < i >
< / i > < / i > < / div >
< / div >
<!-- view -->
< div id = "editor" >
< div >
< h2 > Fortune in 2017 — Great Effort Will Be Rewarded< / h2 >
The lucky star will not help Goats increase their fortunes in 2017. You’ ll need to expend great effort in order to be rewarded. It’ ll be a year of < strong > learning and study< / strong > for Goats. You are recommended to learn new skills — skills sure to help in your future development.< strong > Business people, 2017 will be a good year for you< / strong > if you are planning to expand your markets. You will take business trips frequently in order to expand.You will have a chance to make a fortune. But you are recommended < strong > not to set foot in unfamiliar fields< / strong > and you should weigh things up very carefully before you decide to invest.You will have an opportunity to make < strong > unexpected gains< / strong > on foreign stocks and shares, or foreign currencies. But you’ ll have to consider your own situation carefully, along with fluctuations in economics and exchange rates.
< / div >
<!-- custom toolbar -->
<?php include 'editor_toolbar.php' ; ?>
<!-- view screen -->
< div id = "editor" style = "z-index: 1;" >
<!-- <div> -->
<?php echo $zodiac_fortune -> TheYearFortune ?>
<!-- </div> -->
< / div >
<!-- code screen -->
< div id = "code-screen" class = "none" > < / div >
@ -57,14 +55,34 @@ border-top: 1px solid #ccc;
< div class = "form-group" >
< / div >
< div >
< button type = "submit" class = "btn btn-primary" > 提交< / button >
< input type = "buttn" class = "btn btn-primary" onclick = "zodiac_sub()" value = "提交" >
< / div >
< / form >
< / div >
< / div >
<!-- 模态框( Modal) -->
< div class = "modal fade" id = "myModal" tabindex = "-1" role = "dialog" aria-labelledby = "myModalLabel" aria-hidden = "true" >
< div class = "modal-dialog" >
< div class = "modal-content" >
< div class = "modal-header" >
< button type = "button" class = "close" data-dismiss = "modal" aria-hidden = "true" > × < / button >
< h4 class = "modal-title" id = "myModalLabel" > 模态框( Modal) 标题< / h4 >
< / div >
< div class = "modal-body" > 按下 ESC 按钮退出。< / div >
< div class = "modal-footer" >
< button type = "button" class = "btn btn-default" data-dismiss = "modal" > 关闭< / button >
< button type = "button" class = "btn btn-primary" > 提交更改< / button >
< / div >
< / div > <!-- /.modal - content -->
< / div > <!-- /.modal - dialog -->
< / div >
<!-- /.modal -->
< script src = "/js/ace-editor-src/ace.js" > < / script >
< script src = "/js/ace-editor-src/ext-language_tools.js" > < / script >
< script src = "/js/ace-editor-src/ext-beautify.js" > < / script >
< script type = "text/javascript" >
< script defer type= "text/javascript" >
var E = window.wangEditor
// E(菜单, 编辑区)
var editor = new E('#editor-toolbar', '#editor')
@ -81,15 +99,9 @@ editor.customConfig.menus = [
'redo'
]
editor.create()
// 获取使用到的元素
var toolbarContaner = document.getElementById('toolbar-container')
var editorText = document.getElementById('editor-text')
var cover = document.getElementById('cover')
// var container = document.getElementById('container')
// turn code
function doCodeScreen() {
// alert(editor.txt.html());
code_editor.setValue(editor.txt.html());
$(".w-e-menu").hide();
$(".code-menu").show();
@ -117,6 +129,25 @@ codebtn.addEventListener('click', function () {
}
}, false)
function zodiac_sub() {
if (isCodeScreen == true) {
$("#theyearfortune").val(code_editor.getValue());
} else {
$("#theyearfortune").val(editor.txt.html());
}
$('#zodiac_edit').ajaxSubmit({
success:function() {
alert("提交成功")
},
error: function() {
alert("失败,请重试")
},
dataType: 'json',
timeout: 30000
});
return false;
}
// code >>
ace.require("ace/ext/language_tools");
var code_editor = ace.edit("code-screen");