Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

applied patch + mods [Michael Grosse]

  • Loading branch information...
commit 7510fc9a45c14d99b74904b77537353828818b9a 1 parent 41c8b1d
Dr Nic Williams authored
4 History.txt
View
@@ -1,3 +1,7 @@
+== 0.6.3 2008-03-03
+
+* Remove some innerHTML calls as an IE6 fix [Michael Grosser]
+
== 0.6.2 2008-02-24
* Renamed DrNicTest with JsUnitTest
2  Rakefile
View
@@ -12,7 +12,7 @@ require 'rake/packagetask'
$:.unshift File.dirname(__FILE__) + "/lib"
-APP_VERSION = '0.6.2'
+APP_VERSION = '0.6.3'
APP_NAME = 'jsunittest'
RUBYFORGE_PROJECT = 'drnicjavascript'
APP_FILE_NAME= "#{APP_NAME}.js"
18 src/logger.js
View
@@ -6,14 +6,26 @@ JsUnitTest.Unit.Logger = function(element) {
JsUnitTest.Unit.Logger.prototype.start = function(testName) {
if (!this.element) return;
var tbody = this.element.getElementsByTagName('tbody')[0];
- tbody.innerHTML = tbody.innerHTML + '<tr><td>' + testName + '</td><td></td><td></td></tr>';
+
+ var tr = document.createElement('tr');
+ var td;
+
+ //testname
+ td = document.createElement('td');
+ td.appendChild(document.createTextNode(testName));
+ tr.appendChild(td)
+
+ tr.appendChild(document.createElement('td'));//status
+ tr.appendChild(document.createElement('td'));//message
+
+ tbody.appendChild(tr);
};
JsUnitTest.Unit.Logger.prototype.setStatus = function(status) {
var logline = this.getLastLogLine();
logline.className = status;
var statusCell = logline.getElementsByTagName('td')[1];
- statusCell.innerHTML = status;
+ statusCell.appendChild(document.createTextNode(status));
};
JsUnitTest.Unit.Logger.prototype.finish = function(status, summary) {
@@ -25,6 +37,8 @@ JsUnitTest.Unit.Logger.prototype.finish = function(status, summary) {
JsUnitTest.Unit.Logger.prototype.message = function(message) {
if (!this.element) return;
var cell = this.getMessageCell();
+
+ // cell.appendChild(document.createTextNode(this._toHTML(message)));
cell.innerHTML = this._toHTML(message);
};
10 src/prototype/event.js
View
@@ -10,7 +10,7 @@ JsUnitTest.Event.addEvent = function(element, type, handler) {
element.addEventListener(type, handler, false);
} else {
// assign each event handler a unique ID
- if (!handler.$$guid) handler.$$guid = addEvent.guid++;
+ if (!handler.$$guid) handler.$$guid = DrNicTest.Event.addEvent.guid++;
// create a hash table of event types for the element
if (!element.events) element.events = {};
// create a hash table of event handlers for each element/event pair
@@ -25,7 +25,7 @@ JsUnitTest.Event.addEvent = function(element, type, handler) {
// store the event handler in the hash table
handlers[handler.$$guid] = handler;
// assign a global event handler to do all the work
- element["on" + type] = handleEvent;
+ element["on" + type] = this.handleEvent;
}
};
// a counter used to create unique IDs
@@ -45,7 +45,7 @@ JsUnitTest.Event.removeEvent = function(element, type, handler) {
JsUnitTest.Event.handleEvent = function(event) {
var returnValue = true;
// grab the event object (IE uses a global event object)
- event = event || fixEvent(((this.ownerDocument || this.document || this).parentWindow || window).event);
+ event = event || DrNicTest.Event.fixEvent(((this.ownerDocument || this.document || this).parentWindow || window).event);
// get a reference to the hash table of event handlers
var handlers = this.events[event.type];
// execute each event handler
@@ -60,8 +60,8 @@ JsUnitTest.Event.handleEvent = function(event) {
JsUnitTest.Event.fixEvent = function(event) {
// add W3C standard event methods
- event.preventDefault = fixEvent.preventDefault;
- event.stopPropagation = fixEvent.stopPropagation;
+ event.preventDefault = this.fixEvent.preventDefault;
+ event.stopPropagation = this.fixEvent.stopPropagation;
return event;
};
JsUnitTest.Event.fixEvent.preventDefault = function() {
Please sign in to comment.
Something went wrong with that request. Please try again.