diff options
author | Michael Hamann <michael@content-space.de> | 2010-10-10 14:26:22 +0200 |
---|---|---|
committer | Michael Hamann <michael@content-space.de> | 2010-10-10 14:26:22 +0200 |
commit | 762b4c44c691f69d521413d7016314e7f547c102 (patch) | |
tree | 95ab294b1df2f8c7a5efb56762a0f284bec3754e /lib/scripts | |
parent | eae17177de8f3f3580af5ea66d126aee0f23227f (diff) | |
parent | 4ea48b361401e136dbfd3339af368ceeb5b27480 (diff) | |
download | rpg-762b4c44c691f69d521413d7016314e7f547c102.tar.gz rpg-762b4c44c691f69d521413d7016314e7f547c102.tar.bz2 |
Merge remote branch 'origin/master' into sitemap
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 |
3 files changed, 12 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'; |