Commit 3befcb75 authored by Martin's avatar Martin

Merge tag 'upstream/0.12.0.7' into debian/master

parents 5a94ac49 88cdf6bd
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from setuptools import setup, find_packages
setup(
name = 'TracWysiwyg',
version = '0.12.0.5',
description = 'TracWiki WYSIWYG Editor',
license = 'BSD',
url = 'http://trac-hacks.org/wiki/TracWysiwygPlugin',
author = 'Jun Omae',
author_email = 'omae@opengroove.com',
packages = find_packages(exclude=['*.tests*']),
package_data = {
'tracwysiwyg' : [ 'htdocs/*.js', 'htdocs/*.css', 'htdocs/*.png' ],
},
entry_points = {
'trac.plugins': [
'tracwysiwyg = tracwysiwyg',
],
def main():
kwargs = {
'name': 'TracWysiwyg',
'version': '0.12.0.7',
'description': 'TracWiki WYSIWYG Editor',
'license': 'BSD',
'url': 'https://trac-hacks.org/wiki/TracWysiwygPlugin',
'author': 'Jun Omae',
'author_email': 'omae@opengroove.com',
'packages': find_packages(exclude=['*.tests*']),
'package_data': {
'tracwysiwyg' : ['htdocs/*.js', 'htdocs/*.css', 'htdocs/*.png'],
},
'entry_points': {
'trac.plugins': [
'tracwysiwyg = tracwysiwyg',
],
}
}
)
setup(**kwargs)
if __name__ == '__main__':
from setuptools import setup, find_packages
main()
......@@ -254,21 +254,17 @@ prototype.createEditable = function(d, textarea, textareaResizable) {
var self = this;
var getStyle = TracWysiwyg.getStyle;
var dimension = getDimension(textarea);
if (!dimension.width || !dimension.height) {
if (!dimension.height) {
setTimeout(lazy, 100);
}
if (!dimension.width) {
dimension.width = parseInt(getStyle(textarea, "fontSize"), 10) * (textarea.cols || 10) * 0.5;
}
if (!dimension.height) {
dimension.height = parseInt(getStyle(textarea, "lineHeight"), 10) * (textarea.rows || 3);
}
var wrapper = d.createElement("div");
wrapper.innerHTML = '<iframe class="wysiwyg" '
+ 'src="javascript:\'\'" '
+ 'width="' + dimension.width + '" height="' + dimension.height + '" '
+ 'frameborder="0" marginwidth="0" marginheight="0">'
+ '</iframe>';
wrapper.innerHTML = jQuery.htmlFormat(''
+ '<iframe class="wysiwyg" src="javascript:\'\'" width="100%" '
+ 'height="$1" frameborder="0" marginwidth="0" marginheight="0">'
+ '</iframe>', dimension.height);
var frame = this.frame = wrapper.firstChild;
if (textareaResizable) {
......@@ -277,9 +273,6 @@ prototype.createEditable = function(d, textarea, textareaResizable) {
var contentDocument = null;
var grip = d.createElement("div");
grip.className = "trac-grip";
if (/^[0-9]+$/.exec(dimension.width)) {
grip.style.width = dimension.width + "px";
}
$(grip).bind("mousedown", beginDrag);
wrapper.appendChild(grip);
var resizable = d.createElement("div");
......@@ -337,15 +330,12 @@ prototype.createEditable = function(d, textarea, textareaResizable) {
function lazy() {
var dimension = getDimension(textarea);
if (dimension.width && dimension.height) {
self.frame.width = dimension.width;
if (dimension.height) {
self.frame.height = dimension.height;
if (textareaResizable) {
grip.style.width = /^[0-9]+$/.exec(dimension.width) ? dimension.width + "px" : dimension.width;
}
return;
}
setTimeout(lazy, 100);
else {
setTimeout(lazy, 100);
}
}
};
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment