Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki

This commit is contained in:
Jacques Distler 2009-12-10 16:59:23 -06:00
commit 619f2f1793
2 changed files with 1813 additions and 1223 deletions

View file

@ -53,8 +53,44 @@ function mactionWorkarounds() {
}); });
} }
function updateSize(elt) {
// adjust to the size of the user's browser area.
var parentheight = document.viewport.getHeight() - $('pageName').getHeight()
- $('editFormButtons').getHeight() - $('hidebutton').getHeight();
var parentwidth = Math.min( document.viewport.getWidth(), elt.parentNode.getWidth() ) - 10 ;
var f = $('MarkupHelp');
if (f.visible()) {parentwidth = parentwidth - f.getWidth()}
elt.writeAttribute({'cols': Math.floor(parentwidth/10), 'rows': Math.floor(parentheight/20)} );
elt.setStyle({Width: parentwidth, Height: parentheight});
}
function resizeableTextarea() {
//make the textarea resize to fit available space
var f = $('MarkupHelp');
if (f) {
var hidebutton = new Element('input', {id:'hidebutton', type: 'button', value: 'Hide markup help'});
f.insert({before: hidebutton});
}
$$('textarea#content').each( function(textarea) {
Event.observe(hidebutton, 'click', function(){
if (f.visible()) {
f.hide();
hidebutton.writeAttribute({value: 'Show markup help'});
updateSize(textarea)
} else {
f.show();
hidebutton.writeAttribute({value: 'Hide markup help'});
updateSize(textarea)
}
});
Event.observe(window, 'resize', function(){ updateSize(textarea) });
updateSize(textarea);
});
}
window.onload = function (){ window.onload = function (){
extractBlockquoteCitations(); extractBlockquoteCitations();
fixRunIn(); fixRunIn();
mactionWorkarounds(); mactionWorkarounds();
resizeableTextarea();
}; };

File diff suppressed because it is too large Load diff