X-Git-Url: http://git.shiar.net/minimedit.git/blobdiff_plain/61170ad9e7bd42ea74fed5d5fe5b7227e28a0cc2..6bf2e9ba6bd29e744d0e205dc9cb88fa15a3f575:/edit.js?ds=sidebyside diff --git a/edit.js b/edit.js index 0db4374..164cc1e 100644 --- a/edit.js +++ b/edit.js @@ -56,6 +56,10 @@ CKEDITOR.on('instanceCreated', function (event) { ['Bold', 'Italic', 'Underline', 'Strike', 'RemoveFormat', '-', 'Anchor', 'Link'], ['HorizontalRule', 'Table', 'Image'], ]; + config.toolbarCanCollapse = true; + config.floatSpacePreferRight = true; + config.floatSpaceDockedOffsetY = 0; + config.startupFocus = true; config.disableObjectResizing = true; document.execCommand('enableObjectResizing', false, false); // workaround in inline mode; ff bug? @@ -75,7 +79,7 @@ CKEDITOR.on('instanceCreated', function (event) { CKEDITOR.disableAutoInline = true; // add edit link to menu -var pagebody = document.getElementsByClassName('article')[0]; +var pagebody = document.getElementsByClassName('static')[0]; if (pagebody) { var editlink = document.createElement('a'); editlink.style.cursor = 'pointer'; @@ -91,11 +95,13 @@ if (pagebody) { } else { CKEDITOR.inline(pagebody); - pagebody.focus(); } document.body.className = toggled ? '' : 'edit'; return false; }; + if (window.location.hash == '#edit') { + editlink.onclick(); + } document.querySelector('header ul').appendChild(editlink); }