123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125 |
- <!DOCTYPE html>
- <html lang="en">
- <head>
- <meta charset="UTF-8">
- <title>测试页面</title>
- <meta name="description" content="">
- <meta name="keywords" content="">
- <!--include header base-->
- <meta name="author" content="Roobo:F2E">
- <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
- <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
- <!-- Set render engine for 360 browser -->
- <meta name="renderer" content="webkit">
- <!-- Add to homescreen for Chrome on Android -->
- <meta name="mobile-web-app-capable" content="yes">
- <!--<link rel="icon" type="image/png" sizes="192x192" href="img/favicon/android-icon-192x192.png">-->
- <!-- Add to homescreen for Safari on iOS -->
- <meta name="apple-mobile-web-app-capable" content="yes">
- <meta name="apple-mobile-web-app-status-bar-style" content="black">
- <!--<link href="../css/css.css" rel="stylesheet" type="text/css">-->
- <script src="../js/config/base_config.js"></script>
- <script type="text/javascript" src="../untils/jquery-1.4.4.min.js"></script>
- <script type="text/javascript" src="../untils/xheditor-1.1.14-zh-cn.min.js"></script>
- <script type="text/javascript">
- $(document).ready(function(){
- // if(window.top != window.self)
- // window.top.location.href = location.href;
- formRefresh();
- //初始化xhEditor编辑器插件
- $('#scontext').xheditor({
- tools: 'simple',
- skin: 'default',
- html5Upload: false,
- upMultiple: 5,
- upImgUrl: baseConfig.URL.imageHost + "test/img",
- upImgExt: "jpg,jpeg,gif,bmp,png",
- upMediaUrl: baseConfig.URL.imageHost + "test/img",
- upMediaExt: "flv,avi"
- });
- });
- function formRefresh(){
- $.ajax( {
- url: baseConfig.URL.ininXHeditor,
- dataType: 'json',
- type: 'post',
- data:$("#testForm").serialize(),
- success : function(data,textStatus) {
- console.log(data);
- if(data.status=="SUCCESS"){
- $("#scontext").val(data.editorContext);
- $("#info_id").val(data.info.id);
- $("#title").val(data.info.title);
- }
- },
- error : function() {
- alert("404");
- }
- });
- }
- function htmltoWord(){
- $("#testForm").attr("action",baseConfig.URL.htmlToWord);
- $('#testForm').submit();
- }
- function fileExport(){
- $("#testForm").attr("action",baseConfig.URL.exportFile);
- $('#testForm').submit();
- //
- // $.ajax( {
- // url: baseConfig.URL.exportFile,
- // dataType: 'json',
- // type: 'post',
- // data:$("#testForm").serialize(),
- // success : function(data,textStatus) {
- // console.log(data);
- // },
- // error : function() {
- // alert("404");
- // }
- // });
- }
- function formSubmit(){
- $("#scontext").val($("#scontext").val());
- alert($("#scontext").val());
- $("#testForm").attr("action",baseConfig.URL.saveXHeditor);
- $('#testForm').submit();
- }
- function callback(objStatus){
- alert(objStatus);
- }
- </script>
- </head>
- <body >
- <iframe name="hidden_frameFile" id="hidden_frameFile" style="display:none"></iframe>
- <form name="testForm" id="testForm" action="/test/save" method="post" target="hidden_frameFile" >
- <input name="baseUrl" id="baseUrl" type="hidden">
- <input name="prv_url" id="prv_url" type="hidden">
- id :<input name="id" id="info_id" >
- <br>title:<input name="title" id="title" >
- <br>html:<textarea id="scontext" name="scontext" rows="25" style="width:80%; border: 1px solid"></textarea>
- </form>
- <a href="#" onclick="formRefresh()">刷新</a>
- <br><a href="#" onclick="formSubmit()">保存</a>
- <br><a href="#" onclick="htmltoWord()">转成word导出</a>
- <br><input type="button" onclick="fileExport()" value="导出"/>
- </body>
- </html>
|