Closed Bug 352990 Opened 18 years ago Closed 18 years ago

Improve domi's Evaluate JavaScript

Categories

(Other Applications :: DOM Inspector, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED
mozilla1.9alpha

People

(Reporter: jason.barnabe, Assigned: jason.barnabe)

References

Details

Attachments

(2 files, 3 obsolete files)

Switch the evaluate dialog to a real dialog instead of window class="dialog". Brings correct cross-platform button arrangement, less code, and other goodness. "Inspect in new window" is confusing - unless you return a value nothing gets inspected anywhere. Also, if you uncheck it and you return a value, does that mean don't inspect it, or does it mean inspect it somewhere else? Switch to: Inspect return in (o) Existing window ( ) New window If the expression has an error, the user isn't informed. Alert any error that happens in the expression and don't close the dialog. If the expression changes the current subject, the change isn't reflected in the viewer. Make it so that if the expression doesn't return a value, assume it was a change to the subject and refresh the viewer.
Attached patch patch v1 (obsolete) — Splinter Review
cvs diff didn't include the stylesheets I added. I'll include them separately.
Attachment #238843 - Flags: superreview?(neil)
Attachment #238843 - Flags: review?(timeless)
Attached file added stylesheet, v1 (obsolete) —
This goes in extensions/inspector/resources/skin/classic/viewers/jsObject/evaluateDialog.css and extensions/inspector/resources/skin/modern/viewers/jsObject/evaluateDialog.css
Assignee: dom-inspector → jason_barnabe
Status: NEW → ASSIGNED
Comment on attachment 238843 [details] [diff] [review] patch v1 >+function execute() Could you please JavaDoc this function? :) Also, I'd like a screenshot of the new behavior, if you would please. On the CSS stylesheet, it may be prudent to add a MPL/LGPL/GPL boilerplate to the beginning of it.
Comment on attachment 238843 [details] [diff] [review] patch v1 >RCS file: /cvsroot/mozilla/extensions/inspector/resources/content/viewers/jsObject/jsObjectViewer.js,v >+ } else >+ // the expression is likely to have changed the subject, so reload it. >+ this.subject = this.subject; please brace multiline else blocks.
Attachment #238843 - Flags: review?(timeless) → review+
Comment on attachment 238844 [details] added stylesheet, v1 If you're adding a width solely to make the description wrap then I have no objection to inline style on the document element but the width must be in font-relative units (currently em, until some layout peer should bother to sort out our width unit story, sigh).
Attached patch patch v2 (obsolete) — Splinter Review
The width was there before, but let's fix it anyway.
Attachment #238843 - Attachment is obsolete: true
Attachment #238844 - Attachment is obsolete: true
Attachment #238921 - Flags: superreview?(neil)
Attachment #238921 - Flags: review+
Attachment #238843 - Flags: superreview?(neil)
Comment on attachment 238921 [details] [diff] [review] patch v2 >+ skin/classic/inspector/viewers/jsObject/evaluateDialog.css (resources/skin/classic/viewers/jsObject/evaluateDialog.css) >+ skin/modern/inspector/viewers/jsObject/evaluateDialog.css (resources/skin/modern/viewers/jsObject/evaluateDialog.css) Not used. >+ // alert the user of an error in their expression, and don't close >+ alert(ex); Use the prompt service... >+ buttons="accept,cancel" Nit: that's the default >+ ondialogaccept="return execute()" Nit: ; >+ style="width: 30em"> Nit: ; >+ <textbox id="txfExprInput" value=""/> I know you only reindented but value="" is the default. >+ // the expression is likely to have changed the subject, so reload it. >+ this.subject = this.subject; I'd prefer a separate menuitem to do this. >+<!ENTITY evaluateDialog.title "Evaluate Expression"> >+<!ENTITY jsEval.desc "Enter a JavaScript expression. The variable &quot;target&quot; is the property that is currently selected."> > <!ENTITY jsExecute.label "Execute"> >-<!ENTITY jsCancel.label "Cancel"> >+<!ENTITY inspectReturn.label "Inspect return in"> >+<!ENTITY inspectReturnNew.label "New window"> >+<!ENTITY inspectReturnExisting.label "Existing window"> Aren't you supposed to do something about these new entites in other locales?
(In reply to comment #8) > >+ this.subject = this.subject; > I'd prefer a separate menuitem to do this. A separate menuitem? Like, an entry on the context menu that says "Refresh"? I don't see that being very useful. I wonder if there's some sort of event handler we could put on the object (assuming it's a node of some kind) that would tell us if it changed. > Aren't you supposed to do something about these new entites in other locales? No, when adding new strings, all we're supposed to do is make sure the locales missing bits aren't in the makefile. http://groups.google.com/group/mozilla.dev.l10n/browse_frm/thread/50e5d03b7ea29dd7/d357ca5b80e90545?lnk=st&q=&rnum=2&hl=en#d357ca5b80e90545
(In reply to comment #9) >an entry on the context menu that says "Refresh"? I >don't see that being very useful. Well, I don't think refreshing based on the lack of a result is useful either.
Comment on attachment 238921 [details] [diff] [review] patch v2 >+ } else >+ // the expression is likely to have changed the subject, so reload it. >+ this.subject = this.subject; I'd like this removed anyway. sr- as per previous comments.
Attachment #238921 - Flags: superreview?(neil) → superreview-
Attached patch patch v3Splinter Review
Updated to comments.
Attachment #238921 - Attachment is obsolete: true
Attachment #239296 - Flags: superreview?(neil)
Attachment #239296 - Flags: review+
Attachment #239296 - Flags: superreview?(neil) → superreview+
Whiteboard: [checkin needed]
extensions/inspector/resources/locale/ru/viewers/jsObject.dtd 1.2 extensions/inspector/resources/content/viewers/jsObject/evalExprDialog.js 1.6 extensions/inspector/resources/content/viewers/jsObject/evalExprDialog.xul 1.5 extensions/inspector/resources/locale/en-US/viewers/jsObject.dtd 1.4 <and other locale files>
Status: ASSIGNED → RESOLVED
Closed: 18 years ago
Resolution: --- → FIXED
Whiteboard: [checkin needed]
Target Milestone: --- → mozilla1.9alpha
QA Contact: timeless → dom-inspector
Depends on: 391955
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: