From dd2ef1c12c0c922d3f04617698acc7414ec65ab3 Mon Sep 17 00:00:00 2001 From: Patrick Mueller Date: Fri, 28 Oct 2011 12:32:09 -0400 Subject: [PATCH] final changes for 1.6.0 --- weinre.build/build.properties | 4 +- weinre.build/build.xml | 3 +- weinre.doc/ChangeLog.body.html | 60 +++++++++++++++++++ .../weinre/target/ExceptionalCallbacks.coffee | 8 +-- .../modules/weinre/target/Target.coffee | 2 +- .../modules/weinre/target/Timeline.coffee | 35 +++++------ 6 files changed, 85 insertions(+), 27 deletions(-) diff --git a/weinre.build/build.properties b/weinre.build/build.properties index 1f3fdbf..66e4d91 100644 --- a/weinre.build/build.properties +++ b/weinre.build/build.properties @@ -1,14 +1,14 @@ # --- # weinre is available under *either* the terms of the modified BSD license *or* the # MIT License (2008). See http://opensource.org/licenses/alphabetical for full text. -# +# # Copyright (c) 2010, 2011 IBM Corporation # --- #----------------------------------------------------------- # weinre version #----------------------------------------------------------- -WEINRE_VERSION: 1.5.0 +WEINRE_VERSION: 1.6.0 #----------------------------------------------------------- # some common locations used in the ant scripts diff --git a/weinre.build/build.xml b/weinre.build/build.xml index e445f61..7e72ae8 100644 --- a/weinre.build/build.xml +++ b/weinre.build/build.xml @@ -57,6 +57,7 @@ + +

2011/10/28 - version 1.6.0

+ +
    + +
  • The Network panel has been added to weinre, which will display information +for any XHRs that you issue. + +

  • Error handling for some built-in callbacks has been added. The support +is very similar to what's provided in the +log-callback-error project, +though the implementation is different. + +

  • The element highlighter has been modified to show brighter colors. +The colors also now more closely match the Web Inspector colors. +Currently, there are some artifacts in the corners in some cases, but it's not +clear to me this is a huge problem - in fact, maybe it's a feachur. ~shrug~ +As part of this clean up, I've made the element highlighter pluggable. If you +think you can do better, it should be pretty straight-forward to code up a +new one. Bring it on. + +

  • The JavaScript code for weinre has been converted from the "scoop" DSL +format to CoffeeScript. You no longer have a valid excuse for not hacking the +code. + +

  • The "Test Drive" page of the doc has been removed and replaced with +the new "User Interface" page. + +

  • weinre now adds an "error" listener to window. For JavaScript engines +that support "window onerror", you will now see a message logged to the console +when an error occurs anywhere in your JavaScript code. Unfortunately, just +as support for "window onerror" is becoming available in JavaScript, the browsers +are neutering it's support. Depending on your browser, you may or may not +see these errors reported, and even if you do, they may not give you any +useful information. Thanks to Ryan Seddon for supplying the following +backgrounder links for your enjoyment: + +

    + +
+ +

issues resolved: +

+

2011/07/22 - version 1.5.0

diff --git a/weinre.web/modules/weinre/target/ExceptionalCallbacks.coffee b/weinre.web/modules/weinre/target/ExceptionalCallbacks.coffee index 8d88e5d..0ab94ee 100644 --- a/weinre.web/modules/weinre/target/ExceptionalCallbacks.coffee +++ b/weinre.web/modules/weinre/target/ExceptionalCallbacks.coffee @@ -52,12 +52,12 @@ instrumentedCallback = (code, callSite) -> try return code.apply(this, arguments) catch e - console.log "exception in callback: #{e}" - console.log " callsite: #{callSite}" + console.error "exception in callback: #{e}" + console.error " callsite: #{callSite}" if e.stack - console.log "stack at time of exception:" - console.log e.stack + console.error "stack at time of exception:" + console.error e.stack throw e diff --git a/weinre.web/modules/weinre/target/Target.coffee b/weinre.web/modules/weinre/target/Target.coffee index df91a94..2a843e0 100644 --- a/weinre.web/modules/weinre/target/Target.coffee +++ b/weinre.web/modules/weinre/target/Target.coffee @@ -164,7 +164,7 @@ module.exports = class Target lineno = event.lineno or "[unknown lineno]" message = event.message or "[unknown message]" - console.log "error occurred: #{filename}:#{lineno}: #{message}" + console.error "error occurred: #{filename}:#{lineno}: #{message}" #--------------------------------------------------------------------------- cb_webSocketOpened: () -> diff --git a/weinre.web/modules/weinre/target/Timeline.coffee b/weinre.web/modules/weinre/target/Timeline.coffee index b44ead3..f50922c 100644 --- a/weinre.web/modules/weinre/target/Timeline.coffee +++ b/weinre.web/modules/weinre/target/Timeline.coffee @@ -138,33 +138,30 @@ module.exports = class Timeline @addRecord_XHRReadyStateChange: (method, url, id, xhr) -> return unless Timeline.isRunning() + record = {} + record.startTime = Date.now() + record.category = name: "loading" + if xhr.readyState == XMLHttpRequest.OPENED - record = - type: TimelineRecordType.ResourceSendRequest - category: name: "loading" - startTime: Date.now() - data: - identifier: id - url: url - requestMethod: method + record.type = TimelineRecordType.ResourceSendRequest + record.data = + identifier: id + url: url + requestMethod: method else if xhr.readyState == XMLHttpRequest.DONE - record = - type: TimelineRecordType.ResourceReceiveResponse - category: name: "loading" - startTime: Date.now() - data: - identifier: id - statusCode: xhr.status - mimeType: xhr.getResponseHeader("Content-Type") - expectedContentLength: xhr.getResponseHeader("Content-Length") - url: url + record.type = TimelineRecordType.ResourceReceiveResponse + record.data = + identifier: id + statusCode: xhr.status + mimeType: xhr.getResponseHeader("Content-Type") + expectedContentLength: xhr.getResponseHeader("Content-Length") + url: url else return Weinre.wi.TimelineNotify.addRecordToTimeline record - #--------------------------------------------------------------------------- @installGlobalListeners: -> if applicationCache