From e998131935bdfd9df2997d80701afa5abbc82ea9 Mon Sep 17 00:00:00 2001 From: jensp Date: Sun, 11 Oct 2015 09:30:02 +0000 Subject: [PATCH] Added a checkbox to the Xinha link dialog to make external links open in a new tab/window git-svn-id: https://svn.libreccm.org/ccm/trunk@3684 8810af33-2d31-482b-a856-94f89814c4df --- .../assets/xinha/plugins/OpenCCM/lang/de.js | 3 +- .../assets/xinha/plugins/OpenCCM/lang/en.js | 3 +- .../xinha/plugins/OpenCCM/links/links.html | 296 +++++++++--------- .../xinha/plugins/OpenCCM/links/links.js | 15 +- 4 files changed, 167 insertions(+), 150 deletions(-) diff --git a/ccm-cms/web/assets/xinha/plugins/OpenCCM/lang/de.js b/ccm-cms/web/assets/xinha/plugins/OpenCCM/lang/de.js index 4345bd1fa..9cb0965a5 100644 --- a/ccm-cms/web/assets/xinha/plugins/OpenCCM/lang/de.js +++ b/ccm-cms/web/assets/xinha/plugins/OpenCCM/lang/de.js @@ -17,5 +17,6 @@ "Dimension" : "Dimensionen", "Width:" : "Breite:", "Height:" : "Höhe:", - "Preview" : "Vorschau" + "Preview" : "Vorschau", + "New tab/window": "In neuem Tab/Fenster öffnen:" } diff --git a/ccm-cms/web/assets/xinha/plugins/OpenCCM/lang/en.js b/ccm-cms/web/assets/xinha/plugins/OpenCCM/lang/en.js index eb9c0ca21..fff5ab75f 100644 --- a/ccm-cms/web/assets/xinha/plugins/OpenCCM/lang/en.js +++ b/ccm-cms/web/assets/xinha/plugins/OpenCCM/lang/en.js @@ -17,5 +17,6 @@ "Dimension" : "Dimension", "Width:" : "Width:", "Height:" : "Height:", - "Preview" : "Preview" + "Preview" : "Preview", + "New tab/window:": "Open in new tab/window:" } diff --git a/ccm-cms/web/assets/xinha/plugins/OpenCCM/links/links.html b/ccm-cms/web/assets/xinha/plugins/OpenCCM/links/links.html index c729b6bac..bd30b0708 100644 --- a/ccm-cms/web/assets/xinha/plugins/OpenCCM/links/links.html +++ b/ccm-cms/web/assets/xinha/plugins/OpenCCM/links/links.html @@ -1,155 +1,161 @@

- Insert/Modify Link + Insert/Modify Link

-
-
- -
- -
-
-
- - - - -
- - - - -
- -
-
- - - - -
- -
-
+
+
+ +
+ +
+
+
+ + + + +
+ + + + +
+ +
+
+ + + + +
+ +
+ +
+ +
+
- - - - -
- - - + + + + +
+ + + +
-
diff --git a/ccm-cms/web/assets/xinha/plugins/OpenCCM/links/links.js b/ccm-cms/web/assets/xinha/plugins/OpenCCM/links/links.js index fad19ad6a..e3e5265f1 100644 --- a/ccm-cms/web/assets/xinha/plugins/OpenCCM/links/links.js +++ b/ccm-cms/web/assets/xinha/plugins/OpenCCM/links/links.js @@ -20,7 +20,8 @@ OpenCCM.prototype.showLinkDialog = function(link) type: 'internal', ci_name: '', ci_href: '', - href: '' + href: '', + target: '' }; if (link && link.tagName.toLowerCase() == 'a') @@ -46,6 +47,10 @@ OpenCCM.prototype.showLinkDialog = function(link) data.type = 'external'; data.href = href; } + + if (link.target === "_blank") { + data.newWindow = "on"; + } } @@ -97,9 +102,10 @@ OpenCCM.prototype.linkApply = function() href: '', alt: '', title: '', - class: '' + class: '', + target: '' }; - + // Read needed form values switch (values.type) { @@ -116,6 +122,9 @@ OpenCCM.prototype.linkApply = function() linkAttr.href = values.href; linkAttr.title = values.title; linkAttr.class = "linkExternal"; + if (values.newWindow === "on") { + linkAttr.target = "_blank"; + } // Make absolute url