1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556 |
- <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
- "http://www.w3.org/TR/html4/loose.dtd">
- <html>
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
- <style>
- html,body{
- height:100%;
- width:100%;
- padding:0;
- margin:0;
- }
- #preview{
- width:100%;
- height:100%;
- padding:0;
- margin:0;
- }
- #preview *{font-family:sans-serif;font-size:16px;}
- </style>
- <script type="text/javascript" src="../internal.js"></script>
- <script src="../../ueditor.parse.js"></script>
- <title></title>
- </head>
- <body class="view">
- <div id="preview" style="margin:8px">
- </div>
- </body>
- <script>
- var content = editor.getContent();
-
- //前导符号转换 此处用正则会出现异常,无法完全转换成功,暂时使用此方法进行处理
- var data_part = content.split("../../");
- if(data_part.length>0){
- content="";
- for(var i = 0;i<data_part.length;i++){
- if(i!=data_part.length-1){
- content+=data_part[i]+"../../../";
- }else{
- content+=data_part[i];
- }
- }
- }
-
-
- document.getElementById('preview').innerHTML = content;
- uParse('#preview',{
- rootPath : '../../',
- chartContainerHeight:500
- })
- dialog.oncancel = function(){
- document.getElementById('preview').innerHTML = '';
- }
- </script>
- </html>
|