From 5224b0cf97b22f03c115ab48cffada84ea2a2327 Mon Sep 17 00:00:00 2001 From: Fabian Jakobs Date: Fri, 10 Dec 2010 17:26:14 +0100 Subject: [PATCH] add python file to the demo --- editor.html | 41 ++++++++++++++++++++++------------------- lib/ace/scrollbar.js | 2 +- 2 files changed, 23 insertions(+), 20 deletions(-) diff --git a/editor.html b/editor.html index cb2919cb..81ceef48 100644 --- a/editor.html +++ b/editor.html @@ -87,6 +87,7 @@ + @@ -97,6 +98,7 @@ + @@ -136,8 +138,7 @@ font-family: Monaco, "Courier New", monospace; font-size: 12px; cursor: text; -} - +} + - +# If no arguments were given, print a helpful message +if len(sys.argv)==1: + print 'Usage: celsius temp1 temp2 ...' + sys.exit(0) - - -

Juhu Kinners

- - - +# Loop over the arguments +for i in sys.argv[1:]: + try: + fahrenheit=float(string.atoi(i)) + except string.atoi_error: + print repr(i), "not a numeric value" + else: + celsius=(fahrenheit-32)*5.0/9.0 + print '%i\260F = %i\260C' % (int(fahrenheit), int(celsius+.5)) + - + \ No newline at end of file diff --git a/lib/ace/scrollbar.js b/lib/ace/scrollbar.js index 8ff25a14..67411c15 100644 --- a/lib/ace/scrollbar.js +++ b/lib/ace/scrollbar.js @@ -62,7 +62,7 @@ var ScrollBar = function(parent) { oop.implement(this, EventEmitter); this.onScroll = function() { - this.$dispatchEvent("scroll", {data: this.element.scrollTop}); + this._dispatchEvent("scroll", {data: this.element.scrollTop}); }; this.getWidth = function() {