Browse Source

Merge pull request #96 from pscj/master

局部优化
star7th 9 years ago
parent
commit
588f0151c6

+ 19 - 0
Application/Common/Common/function.php

@@ -73,6 +73,22 @@ function output_word($data,$fileName=''){
         xmlns="http://www.w3.org/TR/REC-html40">
         <head><meta http-equiv=Content-Type content="text/html;  
         charset=utf-8">
+		<style type="text/css">
+			table  
+			{  
+				border-collapse: collapse;
+				border: none;  
+				width: 100%;  
+			}  
+			td  
+			{  
+				border: solid #CCC 1px;  
+			}  
+			.codestyle{
+				word-break: break-all;
+				background:silver;mso-highlight:silver;
+			}
+		</style>
         <meta name=ProgId content=Word.Document>
         <meta name=Generator content="Microsoft Word 11">
         <meta name=Originator content="Microsoft Word 11">
@@ -80,6 +96,9 @@ function output_word($data,$fileName=''){
         <body>'.$data.'</body></html>';
     
     $filepath = tmpfile();
+	$data = str_replace("<thead>\n<tr>","<thead><tr style='background-color: rgb(0, 136, 204); color: rgb(255, 255, 255);'>",$data);
+	$data = str_replace("<pre><code>","<table width='100%' class='codestyle'><pre><code>",$data);
+	$data = str_replace("</code></pre>","</code></pre></table>",$data);
     $len = strlen($data);
     fwrite($filepath, $data);
     header("Content-type: application/octet-stream");

+ 1 - 1
Public/js/item/show_single_page.js

@@ -78,7 +78,7 @@ $(function(){
 
     $("table thead tr").css({"background-color":"#08c","color":"#fff"});
     $("table tr").each(function(){
-    if($(this).find("td").eq(1).html()=="object")
+    if($(this).find("td").eq(1).html()=="object" || $(this).find("td").eq(1).html()=="array[object]")
     {
       $(this).css({"background-color":"#99CC99","color":"#000"});
     }

+ 1 - 1
Public/js/page/edit.js

@@ -286,7 +286,7 @@ function dump(arr,level) {
 		$(".editormd-preview-container table thead tr").css({"background-color":"#08c","color":"#fff"});
     $(".editormd-preview-container table tr").eq(0).css({"background-color":"#08c","color":"#fff"});
 		$(".editormd-preview-container table tr").each(function(){
-			if($(this).find("td").eq(1).html()=="object")
+			if($(this).find("td").eq(1).html()=="object" || $(this).find("td").eq(1).html()=="array[object]")
 			{
 				$(this).css({"background-color":"#99CC99","color":"#000"});
 			}

+ 1 - 1
Public/js/page/index.js

@@ -27,7 +27,7 @@ $(function(){
 
     $("table thead tr").css({"background-color":"#08c","color":"#fff"});
     $("table tr").each(function(){
-    if($(this).find("td").eq(1).html()=="object")
+    if($(this).find("td").eq(1).html()=="object" || $(this).find("td").eq(1).html()=="array[object]")
     {
       $(this).css({"background-color":"#99CC99","color":"#000"});
     }