diff options
author | Adrian Lang <mail@adrianlang.de> | 2010-10-07 09:44:02 +0200 |
---|---|---|
committer | Adrian Lang <mail@adrianlang.de> | 2010-10-07 09:44:02 +0200 |
commit | d9c8ae6b7379d7b64d4817dbd5cca276b45a9dd5 (patch) | |
tree | 39c26d5412170ca4fa176962e60e9962dc643667 /lib/scripts | |
parent | 2c053ed58376c6709596ab48fc40dceb90d4e89d (diff) | |
parent | 85dd53ceb1c2d9a7abe01b5ec50d155dcb142c59 (diff) | |
download | rpg-d9c8ae6b7379d7b64d4817dbd5cca276b45a9dd5.tar.gz rpg-d9c8ae6b7379d7b64d4817dbd5cca276b45a9dd5.tar.bz2 |
Merge branch 'master' into stable
Diffstat (limited to 'lib/scripts')
-rw-r--r-- | lib/scripts/hotkeys.js | 6 | ||||
-rw-r--r-- | lib/scripts/linkwiz.js | 9 | ||||
-rw-r--r-- | lib/scripts/media.js | 9 | ||||
-rw-r--r-- | lib/scripts/script.js | 1 |
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(){ }); } }); + |