diff --git a/static/mrdoc/mrdoc-docs.js b/static/mrdoc/mrdoc-docs.js index 03c2fb5..121a3da 100644 --- a/static/mrdoc/mrdoc-docs.js +++ b/static/mrdoc/mrdoc-docs.js @@ -341,3 +341,40 @@ textBecomeImg = function(text,fontsize,fontcolor){ ### 文档阅读页面JavaScript函数和变量定义 ### ######################################################## */ + + // URL参数解析 + function getQueryVariable(variable) + { + var query = window.location.search.substring(1); + var vars = query.split("&"); + for (var i=0;i"+key+"", + num = -1, + rStr = new RegExp(key, "ig"), + rHtml = new RegExp("\<.*?\>","ig"), //匹配html元素 + aHtml = sText.match(rHtml); //存放html元素的数组 + sText = sText.replace(rHtml, '{~}'); //替换html标签 + // sText = sText.replace(rStr,sKey); //替换key + sText = sText.replace(rStr,function(text){ + return ""+text+"" + }); //替换key + sText = sText.replace(/{~}/g,function(){ //恢复html标签 + num++; + return aHtml[num]; + }); + oDiv.innerHTML = sText; + }; + keyLight('doc-content',getQueryVariable("highlight")) \ No newline at end of file diff --git a/template/app_doc/docs_base.html b/template/app_doc/docs_base.html index 7c59017..46388e5 100644 --- a/template/app_doc/docs_base.html +++ b/template/app_doc/docs_base.html @@ -187,7 +187,7 @@
{% endif %} -
+
diff --git a/template/search/search.html b/template/search/search.html index 056006e..8d6b6e4 100644 --- a/template/search/search.html +++ b/template/search/search.html @@ -187,7 +187,7 @@

- {% highlight result.object.name with query %} + {% highlight result.object.name with query %}

{% highlight result.object.pre_content with query %}