Explorar o código

fix some bugs

star7th %!s(int64=8) %!d(string=hai) anos
pai
achega
722c40edae
Modificáronse 3 ficheiros con 13 adicións e 3 borrados
  1. 1 1
      Application/Home/View/Page/index.html
  2. 11 1
      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=12"></script>
+ <script src="__PUBLIC__/js/page/index.js?a=abcede"></script>

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

@@ -17,10 +17,20 @@ $(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 ){
+                window.top.location.href = target_url;
+                return false;
+            }
+            
+          });
+
     });
+    
     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.1",
+    "version":"v1.3.2",
     "license": "Apache-2.0",
     "authors": [
         {