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

WYSIWYG Editor #9048

Closed
wants to merge 25 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
8571e95
Visual Editor : Included summernote
Akshay0701 Jun 19, 2021
f2d322c
Visual Editor: Initial Commit
david-allison Dec 27, 2020
cf96ceb
Visual Editor: Add to Note Editor
david-allison Dec 25, 2020
58dfe82
Visual Editor: Add Cloze
david-allison Dec 27, 2020
a091929
Visual Editor: Add "Remove Formatting"
david-allison Apr 10, 2020
8cdf3b1
Visual Editor: Insert Horizontal Rule & Bullets
david-allison Apr 10, 2020
f934a26
Visual Editor: Selection modes and image deletion
david-allison Dec 27, 2020
060b7f6
Visual Editor: Alignment buttons
david-allison Apr 11, 2020
ff42408
Extract asset reading to AssetReader
david-allison Dec 26, 2020
7b0c8d3
Visual Editor: Add "Edit HTML"
david-allison Apr 11, 2020
b2c939b
VisEd: Add image from Advanced Editor
david-allison Dec 27, 2020
439d645
Add audio recording from Advanced Editor
david-allison Dec 25, 2020
25ee12f
Add color pickers - fore and background
david-allison Apr 13, 2020
caa6932
VisEd: Add Image Resizing from CardViewer
david-allison Apr 15, 2020
2d2d395
Added: Discard Changes warning
david-allison Apr 19, 2020
7a01296
Visual Editor: Add Tooltips
david-allison Dec 27, 2020
6a4eb0d
Visual Editor: Implement Image "Cut"
david-allison Dec 27, 2020
2eea7c7
Handle Night Mode
david-allison Apr 18, 2020
3d090ac
Add MathJax support
david-allison Dec 27, 2020
fc13762
Convert Bundle to LargeObjectStorage
david-allison Apr 20, 2020
c9f5fb2
Visual Editor: Handle Activity destruction
david-allison Apr 20, 2020
87b0be3
Visual Editor: Undo and Redo
Akshay0701 Jun 20, 2021
0f6c034
Visual Editor: OnPaste Image event
Akshay0701 Jun 20, 2021
7993d00
Visual Editor: Custom Toolbar Buttons
Akshay0701 Jun 20, 2021
5b22a38
Visual Editor: Extracted toolbar code to VisualEditorToolbar
Akshay0701 Jun 20, 2021
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
1 change: 1 addition & 0 deletions AnkiDroid/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -261,6 +261,7 @@ dependencies {
compileOnly "com.google.auto.service:auto-service-annotations:1.0.1"
annotationProcessor "com.google.auto.service:auto-service:1.0.1"

implementation 'com.github.mrudultora:Colorpicker:1.2.0'
implementation 'androidx.activity:activity-ktx:1.4.0'
implementation 'androidx.annotation:annotation:1.3.0'
implementation 'androidx.appcompat:appcompat:1.4.0'
Expand Down
5 changes: 5 additions & 0 deletions AnkiDroid/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,11 @@
android:value="com.ichi2.anki.DeckPicker"
/>
</activity>
<activity android:name="com.ichi2.anki.multimediacard.activity.VisualEditorActivity"
android:exported="false"
android:label="@string/title_activity_visual_editor"
android:configChanges="keyboardHidden|orientation|locale|screenSize"
android:windowSoftInputMode="stateAlwaysHidden"/>
<activity
android:name=".ModelBrowser"
android:label="@string/model_browser_label"
Expand Down
6 changes: 6 additions & 0 deletions AnkiDroid/src/main/assets/summernote/bootstrap.min.css

Large diffs are not rendered by default.

7 changes: 7 additions & 0 deletions AnkiDroid/src/main/assets/summernote/bootstrap.min.js

Large diffs are not rendered by default.

149 changes: 149 additions & 0 deletions AnkiDroid/src/main/assets/summernote/editor.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,149 @@
var enable = function() {
$('#summernote').summernote('enable');
};

var disable = function() {
$('#summernote').summernote('disable');
};

var destroy = function() {
$('#summernote').summernote('destroy');
};

var clear = function() {
$('#summernote').summernote('reset');
};

var setFocus = function(){
$('#summernote').summernote('focus');
};

var setHtml = function(html) {
$('#summernote').summernote('code', html);
};

var setBold = function() {
$('#summernote').summernote('bold');
};

var setItalic = function() {
$('#summernote').summernote('italic');
};

var setUnderline = function() {
$('#summernote').summernote('underline');
};

var setStrikeThrough = function() {
$('#summernote').summernote('strikethrough');
};

var removeFormat = function() {
$('#summernote').summernote('removeFormat');
};

var setFontSize = function(size) {
$('#summernote').summernote('fontSize', size);
};

var setNormal = function() {
$('#summernote').summernote('formatPara');
};

var setHeading = function(heading) {
$('#summernote').summernote('formatH' + heading);
};

var setLineHeight = function(height) {
$('#summernote').summernote('lineHeight', height);
}

var setSuperscript = function() {
$('#summernote').summernote('superscript');
};

var setSubscript = function() {
$('#summernote').summernote('subscript');
};

var setTextForeColor = function(hexColor) {
if (!hexColor.startsWith('#')) {
hexColor = '#' + hexColor;
}
$('#summernote').summernote('foreColor', hexColor);
};

var setTextBackColor = function(hexColor) {
if (!hexColor.startsWith('#')) {
hexColor = '#' + hexColor;
}
$('#summernote').summernote('backColor', hexColor);
};

var setBlockCode = function() {
$('#summernote').summernote('formatBlock', 'pre');
};

var insertUnorderedList = function() {
$('#summernote').summernote('insertUnorderedList');
};

var insertOrderedList = function() {
$('#summernote').summernote('insertOrderedList');
};

var setBlockQuote = function() {
$('#summernote').summernote('formatBlock', 'blockquote');
};

var setAlignLeft = function() {
$('#summernote').summernote('justifyLeft');
};

var setAlignCenter = function() {
$('#summernote').summernote('justifyCenter');
};

var setAlignRight = function() {
$('#summernote').summernote('justifyRight');
};

var setAlignJustify = function() {
$('#summernote').summernote('justifyFull');
};

var insertHorizontalRule = function() {
$('#summernote').summernote('insertHorizontalRule');
};

var indent = function() {
$('#summernote').summernote('indent');
};

var outdent = function() {
$('#summernote').summernote('outdent');
};

var insertTable = function(dimen) {
$('#summernote').summernote('insertTable', dimen);
};

var insertLink = function(linkTitle, linkUrl) {
$('#summernote').summernote('createLink', {
text: linkTitle,
url: linkUrl,
isNewWindow: false
});
};

var unlink = function() {
$('#summernote').summernote('unlink');
};

var insertText = function(text) {
$('#summernote').summernote('insertText', text);
};

var editHtml = function() {
$('#summernote').summernote('codeview.toggle');
};
4 changes: 4 additions & 0 deletions AnkiDroid/src/main/assets/summernote/jquery-3.2.1.min.js

Large diffs are not rendered by default.

13 changes: 13 additions & 0 deletions AnkiDroid/src/main/assets/summernote/summernote.css

Large diffs are not rendered by default.

Binary file not shown.
Loading