summaryrefslogtreecommitdiff
path: root/lib/scripts
diff options
context:
space:
mode:
Diffstat (limited to 'lib/scripts')
-rw-r--r--lib/scripts/hotkeys.js6
-rw-r--r--lib/scripts/linkwiz.js9
-rw-r--r--lib/scripts/media.js9
-rw-r--r--lib/scripts/script.js1
4 files changed, 13 insertions, 12 deletions
diff --git a/lib/scripts/hotkeys.js b/lib/scripts/hotkeys.js
index 356b691ea..ad608b227 100644
--- a/lib/scripts/hotkeys.js
+++ b/lib/scripts/hotkeys.js
@@ -208,7 +208,7 @@ function Hotkeys() {
/**
* @property isMac
*/
- this.isMac = (navigator.userAgent.indexOf('Mac') != -1);
+ this.isMac = is_macos;
/**
* Apply function cb on each element of o in the namespace of s
@@ -272,9 +272,7 @@ function Hotkeys() {
}
t.each(t.shortcuts, function(o) {
- if (t.isMac && o.ctrl != e.metaKey)
- return;
- else if (!t.isMac && o.ctrl != e.ctrlKey)
+ if (o.ctrl != e.ctrlKey)
return;
if (o.alt != e.altKey)
diff --git a/lib/scripts/linkwiz.js b/lib/scripts/linkwiz.js
index 225868592..e4e92cdd2 100644
--- a/lib/scripts/linkwiz.js
+++ b/lib/scripts/linkwiz.js
@@ -201,6 +201,13 @@ var linkwiz = {
if(sel.start == 0 && sel.end == 0) sel = linkwiz.selection;
var stxt = sel.getText();
+
+ // don't include trailing space in selection
+ if(stxt.charAt(stxt.length - 1) == ' '){
+ sel.end--;
+ stxt = sel.getText();
+ }
+
if(!stxt && !DOKU_UHC) stxt=title;
// prepend colon inside namespaces for non namespace pages
@@ -218,6 +225,8 @@ var linkwiz = {
pasteText(sel,link,{startofs: so, endofs: eo});
linkwiz.hide();
+ // reset the entry to the parent namespace and remove : at the beginning
+ linkwiz.entry.value = linkwiz.entry.value.replace(/(^:)?[^:]*$/, '');
},
/**
diff --git a/lib/scripts/media.js b/lib/scripts/media.js
index 95b1ab69e..c8ddfa40a 100644
--- a/lib/scripts/media.js
+++ b/lib/scripts/media.js
@@ -1,5 +1,5 @@
/**
- * JavaScript functionalitiy for the media management popup
+ * JavaScript functionality for the media management popup
*
* @author Andreas Gohr <andi@splitbrain.org>
*/
@@ -469,13 +469,6 @@ var media_manager = {
media_manager.popup.appendChild(btnp);
btnp.setAttribute('class','btnlbl');
- var cls = document.createElement('input');
- cls.type = 'button';
- cls.setAttribute('class','button');
- cls.value = LANG['mediaclose'];
- btnp.appendChild(cls);
- addEvent(cls,'click',function(event){ return media_manager.closePopup(event,this); });
-
var btn = document.createElement('input');
btn.type = 'button';
btn.id = 'media__sendbtn';
diff --git a/lib/scripts/script.js b/lib/scripts/script.js
index 57917aeb5..c79c9b683 100644
--- a/lib/scripts/script.js
+++ b/lib/scripts/script.js
@@ -537,3 +537,4 @@ addInitEvent(function(){
});
}
});
+