Add a panel for basic mathematical constructions

RESOLVED FIXED in seamonkey2.40

Status

RESOLVED FIXED
4 years ago
3 years ago

People

(Reporter: fredw, Assigned: fredw)

Tracking

(Blocks: 1 bug)

Trunk
seamonkey2.40
Dependency tree / graph

SeaMonkey Tracking Flags

(seamonkey2.40 fixed)

Details

Attachments

(2 attachments, 2 obsolete attachments)

(Assignee)

Description

4 years ago
Follow-up of bug 1077291. We should add another panel to enter basic mathematical constructions like "\frac{}{}", "\sqrt{}", etc

Comment 1

4 years ago
Is the product and component correct? Should it be SeaMonkey and Composer?
Flags: needinfo?(fred.wang)
(Assignee)

Comment 2

4 years ago
Yes, sorry.
Component: MathML → Composer
Flags: needinfo?(fred.wang)
Product: Core → SeaMonkey
(Assignee)

Comment 3

4 years ago
Created attachment 8536006 [details] [diff] [review]
Patch V1

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)

Updated

4 years ago
Blocks: 1113572

Comment 4

4 years ago
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+
(Assignee)

Updated

4 years ago
Blocks: 78128
Depends on: 986839
(Assignee)

Comment 5

4 years ago
Created attachment 8560882 [details] [diff] [review]
Patch V2

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)
(Assignee)

Comment 6

4 years ago
@neil: any update on this?

Comment 7

3 years ago
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+
(Assignee)

Comment 8

3 years ago
Created attachment 8657066 [details] [diff] [review]
Patch V3

Thanks, that indeed seems to solve the undo/redo issue.
Attachment #8560882 - Attachment is obsolete: true
Attachment #8657066 - Flags: review?(neil)

Updated

3 years ago
Attachment #8657066 - Flags: review?(neil) → review+
(Assignee)

Updated

3 years ago
Keywords: checkin-needed

Comment 9

3 years ago
http://hg.mozilla.org/comm-central/rev/bb21f194420c
Status: NEW → RESOLVED
Last Resolved: 3 years ago
status-seamonkey2.40: --- → fixed
Keywords: checkin-needed
Resolution: --- → FIXED
Target Milestone: --- → seamonkey2.40

Comment 10

3 years ago
Created attachment 8714913 [details]
screenshot insert LaTeX math

We are talking about the 2 most left new TABs?
(Assignee)

Comment 11

3 years ago
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.