Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue #SB-9705 feat: Mathtext live preview in the editor side #30

Open
wants to merge 1 commit into
base: release-1.13.1
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion editor/mathtext.html
Original file line number Diff line number Diff line change
Expand Up @@ -148,19 +148,25 @@
<div class="actions math-footer">
<small ng-if="text_hint">Please switch to advanced tab to copy paste LaTeX</small>
<div class="ui two column grid">
<div class="ui nine wide column math-formula" ng-show="!advanceField">
<div class="ui nine wide column math-formula basic-input" ng-show="!advanceField">
<span id="math-field"></span>
<span id="latex"></span>
</div>

<div class="ui nine wide column math-formula" ng-show="advanceField">
<input id="advInput" type="textarea" class="latex-field" ng-model="latexValue" ng-click="getCursorPosition($event)">
<span class="preview" ng-click="latexToFormula('latex-preview',latexValue)"><i class="fa fa-eye"></i></span>
</div>

<div class="ui three wide column right aligned math-add-button-div">
<button class="ui basic primary button math-add-button" ng-click="addToStage(activeTab)" type="button">Add
</button>
</div>

<div class="ui twelve wide column" ng-show="advanceField">
<div class="preview-div" id="latex-preview">
</div>
</div>
</div>
</div>
</div>
Expand Down
29 changes: 27 additions & 2 deletions editor/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -175,10 +175,35 @@
}

.latex-field{
max-width: 100%;
min-width: 100%;
max-width: 90%;
min-width: 85%;
padding: 2px 10px;
border-radius: 3px;
min-height: 35px;
border: 1px solid rgb(128, 128, 128);
}

.preview{
width: 10%;
border: 1px solid;
padding: 8px 12px;
border-radius: 3px;
min-height: 35px;
border: 1px solid #2e9fd9;
color: #2e9fd9;
cursor: pointer;
}

.ui.grid>.column.math-formula{
padding-right: 0;
}

.preview-div{
min-height: 35px;
border: 1px solid rgb(128, 128, 128);
border-radius: 3px;
}

.ui.grid>.column.basic-input{
padding-right: 10px;
}