Skip to content

Commit

Permalink
Remove log message not necessary (#16)
Browse files Browse the repository at this point in the history
  • Loading branch information
dab246 authored Jul 12, 2023
1 parent 6ff1827 commit 8366fa0
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 12 deletions.
1 change: 0 additions & 1 deletion lib/src/widgets/html_editor_widget_mobile.dart
Original file line number Diff line number Diff line change
Expand Up @@ -429,7 +429,6 @@ class _HtmlEditorWidgetMobileState extends State<HtmlEditorWidget> {
foreColor = document.queryCommandValue('foreColor');
backColor = document.queryCommandValue('hiliteColor');
if (!backColor) {
console.log("Browser not support queryCommandValue('hiliteColor')");
backColor = document.queryCommandValue('backColor');
}
fontName = document.queryCommandValue('fontName');
Expand Down
8 changes: 0 additions & 8 deletions lib/src/widgets/html_editor_widget_web.dart
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,6 @@ class _HtmlEditorWidgetWebState extends State<HtmlEditorWidget> {
window.parent.addEventListener('message', handleMessage, false);
document.onselectionchange = onSelectionChange;
console.log('done');
function handleMessage(e) {
if (e && e.data && e.data.includes("toIframe:")) {
Expand Down Expand Up @@ -321,12 +320,10 @@ class _HtmlEditorWidgetWebState extends State<HtmlEditorWidget> {
if (commandType === "hiliteColor") {
if (data["argument"] === null) {
if (!document.execCommand("hiliteColor", false)) {
console.log("Browser not support document.execCommand('hiliteColor')");
document.execCommand("backColor", false);
}
} else {
if (!document.execCommand("hiliteColor", false, data["argument"])) {
console.log("Browser not support document.execCommand('hiliteColor')");
document.execCommand("backColor", false, data["argument"]);
}
}
Expand All @@ -341,7 +338,6 @@ class _HtmlEditorWidgetWebState extends State<HtmlEditorWidget> {
if (data["type"].includes("execSummernoteAPI")) {
var nameAPI = data["nameAPI"];
var value = data["value"];
console.log("nameAPI: " + nameAPI + " | value: " + value);
if (value === null) {
\$('#summernote-2').summernote(nameAPI);
} else {
Expand Down Expand Up @@ -370,7 +366,6 @@ class _HtmlEditorWidgetWebState extends State<HtmlEditorWidget> {
var texto;
var count = 0;
var value = data["case"];
console.log(value);
var nodes = selected.nodes();
for (var i=0; i< nodes.length; ++i) {
if (nodes[i].nodeName == "#text") {
Expand Down Expand Up @@ -480,16 +475,13 @@ class _HtmlEditorWidgetWebState extends State<HtmlEditorWidget> {
foreColor = document.queryCommandValue('foreColor');
backColor = document.queryCommandValue('hiliteColor')
if (!backColor) {
console.log("Browser not support queryCommandValue('hiliteColor')");
backColor = document.queryCommandValue('backColor');
}
fontName = document.queryCommandValue('fontName');
}
const browserName = getBrowserName();
console.log('browserName: ' + browserName)
if (browserName === "Firefox") {
backColor = \$(focusNode.parentNode).css('background-color');
console.log('backColor-Firefox: ' + backColor);
}
var message = {
'view': "$createdViewId",
Expand Down
8 changes: 6 additions & 2 deletions lib/src/widgets/toolbar_widget.dart
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,9 @@ class ToolbarWidgetState extends State<ToolbarWidget> {
/// Updates the toolbar from the JS handler on mobile and the onMessage
/// listener on web
void updateToolbar(Map<String, dynamic> json) {
debugPrint('ToolbarWidget::updateToolbar::json: $json');
if (kDebugMode) {
print('ToolbarWidget::updateToolbar::json: $json');
}
//get parent element
String parentElem = json['style'] ?? '';
//get font name
Expand Down Expand Up @@ -175,7 +177,9 @@ class ToolbarWidgetState extends State<ToolbarWidget> {
_fontNameSelectedItem = 'sans-serif';
});
}
debugPrint('ToolbarWidget::updateToolbar::colorList: $colorList');
if (kDebugMode) {
print('ToolbarWidget::updateToolbar::colorList: $colorList');
}
//update the fore/back selected color if necessary
final foregroundColor = colorList[0];
if (foregroundColor != null && foregroundColor.isNotEmpty) {
Expand Down
1 change: 0 additions & 1 deletion lib/utils/javascript_utils.dart
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ class JavascriptUtils {
static const String jsHandleUpdateBodyDirection = '''
const nodeEditor = document.getElementsByClassName('note-editable')[0];
const currentDirection = data['direction'];
console.log('currentDirection: ' + currentDirection);
nodeEditor.style.direction = currentDirection.toString();
''';

Expand Down

0 comments on commit 8366fa0

Please sign in to comment.