Another Textarea Tweak and a Ruby 1.9 Fix
This commit is contained in:
parent
60a233a917
commit
a58bee7437
|
@ -1,5 +1,8 @@
|
||||||
#coding: utf-8
|
#coding: utf-8
|
||||||
# Contains all the methods for finding and replacing wiki words
|
# Contains all the methods for finding and replacing wiki words
|
||||||
|
|
||||||
|
require 'stringsupport'
|
||||||
|
|
||||||
module WikiWords
|
module WikiWords
|
||||||
# In order of appearance: Latin, greek, cyrillic, armenian
|
# In order of appearance: Latin, greek, cyrillic, armenian
|
||||||
I18N_HIGHER_CASE_LETTERS =
|
I18N_HIGHER_CASE_LETTERS =
|
||||||
|
@ -18,7 +21,7 @@ module WikiWords
|
||||||
CAMEL_CASED_WORD_BORDER = /([a-z#{I18N_LOWER_CASE_LETTERS}])([A-Z#{I18N_HIGHER_CASE_LETTERS}])/u
|
CAMEL_CASED_WORD_BORDER = /([a-z#{I18N_LOWER_CASE_LETTERS}])([A-Z#{I18N_HIGHER_CASE_LETTERS}])/u
|
||||||
|
|
||||||
def self.separate(wiki_word)
|
def self.separate(wiki_word)
|
||||||
wiki_word.gsub(CAMEL_CASED_WORD_BORDER, '\1 \2')
|
wiki_word.dup.as_utf8.gsub(CAMEL_CASED_WORD_BORDER, '\1 \2')
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
|
@ -57,13 +57,12 @@ function updateSize(elt, w, h) {
|
||||||
// adjust to the size of the user's browser area.
|
// adjust to the size of the user's browser area.
|
||||||
// w and h are the original, unadjusted, width and height per row/column
|
// w and h are the original, unadjusted, width and height per row/column
|
||||||
var parentheight = document.viewport.getHeight() - $('pageName').getHeight()
|
var parentheight = document.viewport.getHeight() - $('pageName').getHeight()
|
||||||
- $('editFormButtons').getHeight() - $('hidebutton').getHeight();
|
- $('editFormButtons').getHeight() - $('hidebutton').getHeight();
|
||||||
var parentwidth = $('Content').getWidth();
|
var parentwidth = $('Content').getWidth();
|
||||||
var f = $('MarkupHelp');
|
var f = $('MarkupHelp');
|
||||||
if (f.visible()) {parentwidth = parentwidth - f.getWidth() - 20}
|
if (f.visible()) { parentwidth = parentwidth - f.getWidth() - 20 }
|
||||||
var newcols = Math.floor(parentwidth/w) - 1;
|
elt.writeAttribute({'cols': Math.floor(parentwidth/w) - 1,
|
||||||
var newrows = Math.floor(parentheight/h - 3);
|
'rows': Math.floor(parentheight/h) - 6 });
|
||||||
elt.writeAttribute({'cols': newcols, 'rows': newrows });
|
|
||||||
elt.setStyle({Width: parentwidth, Height: parentheight});
|
elt.setStyle({Width: parentwidth, Height: parentheight});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -71,7 +70,7 @@ function resizeableTextarea() {
|
||||||
//make the textarea resize to fit available space
|
//make the textarea resize to fit available space
|
||||||
var f = $('MarkupHelp');
|
var f = $('MarkupHelp');
|
||||||
if (f) {
|
if (f) {
|
||||||
var hidebutton = new Element('input', {id:'hidebutton', type: 'button', value: 'Hide markup help'});
|
var hidebutton = new Element('input', {id:'hidebutton', type:'button', value: 'Hide markup help'});
|
||||||
f.insert({before: hidebutton});
|
f.insert({before: hidebutton});
|
||||||
}
|
}
|
||||||
$$('textarea#content').each( function(textarea) {
|
$$('textarea#content').each( function(textarea) {
|
||||||
|
|
Loading…
Reference in a new issue