Closed Bug 1098150 Opened 9 years ago Closed 9 years ago

Add a panel for basic mathematical constructions

Categories

(SeaMonkey :: Composer, defect)

defect
Not set
normal

Tracking

(seamonkey2.40 fixed)

RESOLVED FIXED
seamonkey2.40
Tracking Status
seamonkey2.40 --- fixed

People

(Reporter: fredw, Assigned: fredw)

References

(Blocks 1 open bug)

Details

Attachments

(2 files, 2 obsolete files)

Follow-up of bug 1077291. We should add another panel to enter basic mathematical constructions like "\frac{}{}", "\sqrt{}", etc
Is the product and component correct? Should it be SeaMonkey and Composer?
Flags: needinfo?(fred.wang)
Yes, sorry.
Component: MathML → Composer
Flags: needinfo?(fred.wang)
Product: Core → SeaMonkey
Attached patch Patch V1 (obsolete) — Splinter Review
Here is a first patch showing the idea. I'm not exactly sure about the important constructions we want to present and how we will organize them (it's possible that we want several tabs).
Assignee: nobody → fred.wang
Attachment #8536006 - Flags: feedback?(neil)
Blocks: 1113572
Comment on attachment 8536006 [details] [diff] [review]
Patch V1

I don't think the table ones work in the same tab as the others.

You might want to select the result of applying a unary function  e.g. applying the boxed effect and then the slashed effect to the result.
Attachment #8536006 - Flags: feedback?(neil) → feedback+
Blocks: 78128
Depends on: 986839
Attached patch Patch V2 (obsolete) — Splinter Review
This addresses the two previous remarks.

There is one minor problem with the custom insertion code of insertLaTeXCommand: Undo/Redo does not work well. I tried a beginTransaction/endTransaction on input.editor but that did not help.
Attachment #8536006 - Attachment is obsolete: true
Attachment #8560882 - Flags: feedback?(neil)
@neil: any update on this?
Comment on attachment 8560882 [details] [diff] [review]
Patch V2

I probably got snowed under a flurry of requests or something, and it's just taken me far too long to work through them and think about catching up on some of my older requests. Sorry about that.

>+  // For a single math symbol, just use the insertText command.
>+  if (aButton.label) {
>+    gDialog.input.editor.QueryInterface(Components.interfaces.nsIPlaintextEditor).insertText(aButton.label);
>+    return;
>+  }
...

(In reply to Frédéric Wang from comment #5)
> There is one minor problem with the custom insertion code of
> insertLaTeXCommand: Undo/Redo does not work well. I tried a
> beginTransaction/endTransaction on input.editor but that did not help.
...

>+  // Update the input text and selection.
>+  gDialog.input.value =
>+    gDialog.input.value.substring(0, selectionStart) + latex +
>+    gDialog.input.value.substring(selectionEnd);
If you insertText(latex) instead (as per the first snippet) then that should just work.

>+  gDialog.input.selectionStart = selectionStart + latexNewStart;
>+  gDialog.input.selectionEnd = selectionStart + latexNewEnd;
Prefer .setSelectionRange()
Attachment #8560882 - Flags: feedback?(neil) → feedback+
Attached patch Patch V3Splinter Review
Thanks, that indeed seems to solve the undo/redo issue.
Attachment #8560882 - Attachment is obsolete: true
Attachment #8657066 - Flags: review?(neil)
Attachment #8657066 - Flags: review?(neil) → review+
Keywords: checkin-needed
http://hg.mozilla.org/comm-central/rev/bb21f194420c
Status: NEW → RESOLVED
Closed: 9 years ago
Keywords: checkin-needed
Resolution: --- → FIXED
Target Milestone: --- → seamonkey2.40
We are talking about the 2 most left new TABs?
Yes, these tabs insert "complex" LaTeX constructions while the others insert only a single unicode character.
You need to log in before you can comment on or make changes to this bug.