Bladeren bron

项目内链接

star7th 8 jaren geleden
bovenliggende
commit
d9fa1042f1
3 gewijzigde bestanden met toevoegingen van 5 en 5 verwijderingen
  1. 1 1
      Application/Home/View/Page/index.html
  2. 3 3
      Public/js/page/index.js
  3. 1 1
      composer.json

+ 1 - 1
Application/Home/View/Page/index.html

@@ -18,4 +18,4 @@
  <script src="__PUBLIC__/editor.md/lib/sequence-diagram.min.js"></script>
  <script src="__PUBLIC__/editor.md/lib/jquery.flowchart.min.js"></script>
  <script src="__PUBLIC__/editor.md/editormd.min.js"></script>
- <script src="__PUBLIC__/js/page/index.js?a=abcede"></script>
+ <script src="__PUBLIC__/js/page/index.js?a=abcedefgh"></script>

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

@@ -17,12 +17,12 @@ $(function(){
         $(this).prop('outerHTML', '<div style="width: 100%;overflow-x: auto;">'+$(this).prop('outerHTML')+'</div>');
     });
 
-      //不含本机域名的超链接都在新窗口打开
+      //不是本项目的超链接都在新窗口打开
     $('a[href^="http"]').each(function() {
           $(this).attr('target', '_blank');
           $(this).click(function(){
             var target_url = $(this).attr("href") ;
-            if (target_url.indexOf(window.location.host) > -1 ){
+            if (target_url.indexOf(window.top.location.host + window.top.location.pathname) > -1 ){
                 window.top.location.href = target_url;
                 return false;
             }
@@ -30,7 +30,7 @@ $(function(){
           });
 
     });
-    
+
     if (!isMobile()) {
       $("th").css("min-width","77px");
     };

+ 1 - 1
composer.json

@@ -5,7 +5,7 @@
     "description": "ShowDoc is a tool greatly applicable for an IT team to share documents online",
     "keywords": ["showdoc","documents","Api"],
     "homepage": "https://github.com/star7th/showdoc",
-    "version":"v1.3.3",
+    "version":"v1.3.4",
     "license": "Apache-2.0",
     "authors": [
         {