[go: nahoru, domu]

Skip to content

Commit

Permalink
Added notes and logging for some currently unused JS callbacks
Browse files Browse the repository at this point in the history
  • Loading branch information
aforcier committed Apr 10, 2015
1 parent abcf3e3 commit 83c3108
Showing 1 changed file with 25 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,22 +10,21 @@
public class JsCallbackHandler {
private static final String JS_CALLBACK_DELIMITER = "~";

private static final String CALLBACK_LOG = "callback-log";

private static final String CALLBACK_DOM_LOADED = "callback-dom-loaded";
private static final String CALLBACK_NEW_FIELD = "callback-new-field";

private static final String CALLBACK_SELECTION_STYLE = "callback-selection-style";
private static final String CALLBACK_INPUT = "callback-input";
private static final String CALLBACK_SELECTION_CHANGED = "callback-selection-changed";
private static final String CALLBACK_SELECTION_STYLE = "callback-selection-style";

private static final String CALLBACK_FOCUS_IN = "callback-focus-in";
private static final String CALLBACK_FOCUS_OUT = "callback-focus-out";

private static final String CALLBACK_IMAGE_REPLACED = "callback-image-replaced";
private static final String CALLBACK_IMAGE_TAP = "callback-image-tap";
private static final String CALLBACK_INPUT = "callback-input";
private static final String CALLBACK_LINK_TAP = "callback-link-tap";

private static final String CALLBACK_NEW_FIELD = "callback-new-field";
private static final String CALLBACK_LOG = "callback-log";

private final JsCallbackListener mJsCallbackListener;

Expand All @@ -47,12 +46,32 @@ public void executeCallback(String callbackId, String params) {
mJsCallbackListener.onSelectionStyleChanged(Utils.getChangeMapFromSets(mPreviousStyleSet, newStyleSet));
mPreviousStyleSet = newStyleSet;
break;
case CALLBACK_SELECTION_CHANGED:
// Called when changes are made to selection (includes moving the caret without selecting text)
// TODO: Possibly needed for handling WebView scrolling when caret moves (from iOS)
break;
case CALLBACK_INPUT:
// Called on key press
// TODO: Possibly needed for handling WebView scrolling when caret moves (from iOS)
break;
case CALLBACK_FOCUS_IN:
// TODO: Needed to handle displaying/graying the format bar when focus changes between the title and content
AppLog.d(AppLog.T.EDITOR, "Focus in callback received");
break;
case CALLBACK_FOCUS_OUT:
// TODO: Needed to handle displaying/graying the format bar when focus changes between the title and content
AppLog.d(AppLog.T.EDITOR, "Focus out callback received");
break;
case CALLBACK_NEW_FIELD:
// TODO: Used for logging/testing purposes on iOS
AppLog.d(AppLog.T.EDITOR, "New field created, " + params);
break;
case CALLBACK_LOG:
// Strip 'msg=' from beginning of string
AppLog.d(AppLog.T.EDITOR, callbackId + ": " + params.substring(4));
break;
default:
AppLog.d(AppLog.T.EDITOR, "unhandled callback: " + callbackId + ":" + params);
AppLog.d(AppLog.T.EDITOR, "Unhandled callback: " + callbackId + ":" + params);
}
}
}

0 comments on commit 83c3108

Please sign in to comment.