Skip to content

Commit 19da06e

Browse files
committed
refactor: cleanup typos
1 parent 8338a9c commit 19da06e

14 files changed

+55
-55
lines changed

framework/cordova.gradle

+1-1
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ def doGetConfigPreference(name, defaultValue) {
150150
}
151151

152152
def doApplyCordovaConfigCustomization() {
153-
// Apply user overide properties that comes from the "--gradleArg=-P" parameters
153+
// Apply user override properties that comes from the "--gradleArg=-P" parameters
154154
if (project.hasProperty('cdvMinSdkVersion')) {
155155
cordovaConfig.MIN_SDK_VERSION = Integer.parseInt('' + cdvMinSdkVersion)
156156
}

framework/src/org/apache/cordova/CallbackMap.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ public synchronized int registerCallback(CordovaPlugin receiver, int requestCode
5454
* obtained from registerCallback()
5555
*
5656
* @param mappedId The request code obtained from registerCallback()
57-
* @return The CordovaPlugin and orignal request code that correspond to the
57+
* @return The CordovaPlugin and original request code that correspond to the
5858
* given mappedCode
5959
*/
6060
public synchronized Pair<CordovaPlugin, Integer> getAndRemoveCallback(int mappedId) {

framework/src/org/apache/cordova/Config.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ Licensed to the Apache Software Foundation (ASF) under one
2323

2424
import android.app.Activity;
2525

26-
@Deprecated // Use AllowList, CordovaPrefences, etc. directly.
26+
@Deprecated // Use AllowList, CordovaPreferences, etc. directly.
2727
public class Config {
2828
private static final String TAG = "Config";
2929

@@ -54,7 +54,7 @@ public static String getStartUrl() {
5454
}
5555

5656
public static String getErrorUrl() {
57-
return parser.getPreferences().getString("errorurl", null);
57+
return parser.getPreferences().getString("ErrorUrl", null);
5858
}
5959

6060
public static List<PluginEntry> getPluginEntries() {

framework/src/org/apache/cordova/CordovaActivity.java

+5-5
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ Licensed to the Apache Software Foundation (ASF) under one
7878
public class CordovaActivity extends AppCompatActivity {
7979
public static final String TAG = "CordovaActivity";
8080

81-
// The webview for our app
81+
// The WebView for our app
8282
protected CordovaWebView appView;
8383

8484
private static final int ACTIVITY_STARTING = 0;
@@ -112,7 +112,7 @@ public void onCreate(Bundle savedInstanceState) {
112112
// need to activate preferences before super.onCreate to avoid "requestFeature() must be called before adding content" exception
113113
loadConfig();
114114

115-
String logLevel = preferences.getString("loglevel", "ERROR");
115+
String logLevel = preferences.getString("LogLevel", "ERROR");
116116
LOG.setLogLevel(logLevel);
117117

118118
LOG.i(TAG, "Apache Cordova native platform version " + CordovaWebView.CORDOVA_VERSION + " is starting");
@@ -206,7 +206,7 @@ protected void createViews() {
206206
/**
207207
* Construct the default web view object.
208208
* <p/>
209-
* Override this to customize the webview that is used.
209+
* Override this to customize the WebView that is used.
210210
*/
211211
protected CordovaWebView makeWebView() {
212212
return new CordovaWebViewImpl(makeWebViewEngine());
@@ -227,7 +227,7 @@ public Object onMessage(String id, Object data) {
227227
}
228228

229229
/**
230-
* Load the url into the webview.
230+
* Load the url into the WebView.
231231
*/
232232
public void loadUrl(String url) {
233233
if (appView == null) {
@@ -250,7 +250,7 @@ protected void onPause() {
250250

251251
if (this.appView != null) {
252252
// CB-9382 If there is an activity that started for result and main activity is waiting for callback
253-
// result, we shoudn't stop WebView Javascript timers, as activity for result might be using them
253+
// result, we shouldn't stop WebView Javascript timers, as activity for result might be using them
254254
boolean keepRunning = this.keepRunning || this.cordovaInterface.activityResultCallback != null;
255255
this.appView.handlePause(keepRunning);
256256
}

framework/src/org/apache/cordova/CordovaPlugin.java

+4-4
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,7 @@ public Boolean shouldAllowRequest(String url) {
244244

245245
/**
246246
* Hook for blocking navigation by the Cordova WebView. This applies both to top-level and
247-
* iframe navigations.
247+
* iframe navigation.
248248
*
249249
* This will be called when the WebView's needs to know whether to navigate
250250
* to a new page. Return false to block the navigation: if any plugin
@@ -282,7 +282,7 @@ public Boolean shouldOpenExternalUrl(String url) {
282282
/**
283283
* Allows plugins to handle a link being clicked. Return true here to cancel the navigation.
284284
*
285-
* @param url The URL that is trying to be loaded in the Cordova webview.
285+
* @param url The URL that is trying to be loaded in the Cordova WebView.
286286
* @return true to prevent the URL from loading. Default is false.
287287
*/
288288
public boolean onOverrideUrlLoading(String url) {
@@ -439,11 +439,11 @@ public CordovaPluginPathHandler getPathHandler() {
439439
}
440440

441441
/**
442-
* Called when the WebView's render process has exited. Can be used to collect information regarding the crash for crashlytics or optionally attempt to gracefully handle/recover the crashed webview by recreating it.
442+
* Called when the WebView's render process has exited. Can be used to collect information regarding the crash for crashlytics or optionally attempt to gracefully handle/recover the crashed WebView by recreating it.
443443
*
444444
* See <a href="https://developer.android.com/reference/android/webkit/WebViewClient#onRenderProcessGone(android.webkit.WebView,%20android.webkit.RenderProcessGoneDetail)">WebViewClient#onRenderProcessGone</a>
445445
*
446-
* Note: A plugin must not attempt to recover a webview that it does not own/manage.
446+
* Note: A plugin must not attempt to recover a WebView that it does not own/manage.
447447
*
448448
* @return true if the host application handled the situation that process has exited,
449449
* otherwise, application will crash if render process crashed, or be killed

framework/src/org/apache/cordova/CordovaWebView.java

+3-3
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ Licensed to the Apache Software Foundation (ASF) under one
2525
import android.webkit.WebChromeClient.CustomViewCallback;
2626

2727
/**
28-
* Main interface for interacting with a Cordova webview - implemented by CordovaWebViewImpl.
28+
* Main interface for interacting with a Cordova WebView - implemented by CordovaWebViewImpl.
2929
* This is an interface so that it can be easily mocked in tests.
3030
* Methods may be added to this interface without a major version bump, as plugins & embedders
3131
* are not expected to implement it.
@@ -92,12 +92,12 @@ public interface CordovaWebView {
9292
void sendJavascript(String statememt);
9393

9494
/**
95-
* Load the specified URL in the Cordova webview or a new browser instance.
95+
* Load the specified URL in the Cordova WebView or a new browser instance.
9696
*
9797
* NOTE: If openExternal is false, only allow listed URLs can be loaded.
9898
*
9999
* @param url The url to load.
100-
* @param openExternal Load url in browser instead of Cordova webview.
100+
* @param openExternal Load url in browser instead of Cordova WebView.
101101
* @param clearHistory Clear the history stack, so new page becomes top of history
102102
* @param params Parameters for new app
103103
*/

framework/src/org/apache/cordova/CordovaWebViewEngine.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ void init(CordovaWebView parentWebView, CordovaInterface cordova, Client client,
5959
/** Clean up all resources associated with the WebView. */
6060
void destroy();
6161

62-
/** Add the evaulate Javascript method **/
62+
/** Add the evaluate Javascript method **/
6363
void evaluateJavascript(String js, ValueCallback<String> callback);
6464

6565
/**

framework/src/org/apache/cordova/CordovaWebViewImpl.java

+9-9
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ Licensed to the Apache Software Foundation (ASF) under one
4343
import java.util.Set;
4444

4545
/**
46-
* Main class for interacting with a Cordova webview. Manages plugins, events, and a CordovaWebViewEngine.
46+
* Main class for interacting with a Cordova WebView. Manages plugins, events, and a CordovaWebViewEngine.
4747
* Class uses two-phase initialization. You must call init() before calling any other methods.
4848
*/
4949
public class CordovaWebViewImpl implements CordovaWebView {
@@ -75,13 +75,13 @@ public class CordovaWebViewImpl implements CordovaWebView {
7575
private final Set<Integer> boundKeyCodes = new HashSet<>();
7676

7777
public static CordovaWebViewEngine createEngine(Context context, CordovaPreferences preferences) {
78-
String className = preferences.getString("webview", SystemWebViewEngine.class.getCanonicalName());
78+
String className = preferences.getString("WebView", SystemWebViewEngine.class.getCanonicalName());
7979
try {
8080
Class<?> webViewClass = Class.forName(className);
8181
Constructor<?> constructor = webViewClass.getConstructor(Context.class, CordovaPreferences.class);
8282
return (CordovaWebViewEngine) constructor.newInstance(context, preferences);
8383
} catch (Exception e) {
84-
throw new RuntimeException("Failed to create webview. ", e);
84+
throw new RuntimeException("Failed to create WebView. ", e);
8585
}
8686
}
8787

@@ -152,7 +152,7 @@ public void loadUrlIntoView(final String url, boolean recreatePlugins) {
152152
stopLoading();
153153
LOG.e(TAG, "CordovaWebView: TIMEOUT ERROR!");
154154

155-
// Handle other errors by passing them to the webview in JS
155+
// Handle other errors by passing them to the WebView in JS
156156
JSONObject data = new JSONObject();
157157
try {
158158
data.put("errorCode", -6);
@@ -213,7 +213,7 @@ public void showWebPage(String url, boolean openExternal, boolean clearHistory,
213213
engine.clearHistory();
214214
}
215215

216-
// If loading into our webview
216+
// If loading into our WebView
217217
if (!openExternal) {
218218
// Make sure url is in allow list
219219
if (pluginManager.shouldAllowNavigation(url)) {
@@ -222,7 +222,7 @@ public void showWebPage(String url, boolean openExternal, boolean clearHistory,
222222
loadUrlIntoView(url, true);
223223
return;
224224
} else {
225-
LOG.w(TAG, "showWebPage: Refusing to load URL into webview since it is not in the <allow-navigation> allow list. URL=" + url);
225+
LOG.w(TAG, "showWebPage: Refusing to load URL into WebView since it is not in the <allow-navigation> allow list. URL=" + url);
226226
return;
227227
}
228228
}
@@ -481,7 +481,7 @@ public void handlePause(boolean keepRunning) {
481481

482482
// If app doesn't want to run in background
483483
if (!keepRunning) {
484-
// Pause JavaScript timers. This affects all webviews within the app!
484+
// Pause JavaScript timers. This affects all WebViews within the app!
485485
engine.setPaused(true);
486486
}
487487
}
@@ -491,7 +491,7 @@ public void handleResume(boolean keepRunning) {
491491
return;
492492
}
493493

494-
// Resume JavaScript timers. This affects all webviews within the app!
494+
// Resume JavaScript timers. This affects all WebViews within the app!
495495
engine.setPaused(false);
496496
this.pluginManager.onResume(keepRunning);
497497

@@ -531,7 +531,7 @@ public void handleDestroy() {
531531
// We should use a blank data: url instead so it's more obvious
532532
this.loadUrl("about:blank");
533533

534-
// TODO: Should not destroy webview until after about:blank is done loading.
534+
// TODO: Should not destroy WebView until after about:blank is done loading.
535535
engine.destroy();
536536
hideCustomView();
537537
}

framework/src/org/apache/cordova/CoreAndroid.java

+5-5
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ public void pluginInitialize() {
6767
* Executes the request and returns PluginResult.
6868
*
6969
* @param action The action to execute.
70-
* @param args JSONArry of arguments for the plugin.
70+
* @param args JSONArray of arguments for the plugin.
7171
* @param callbackContext The callback context from which we were invoked.
7272
*
7373
* @return A PluginResult object with a status and message.
@@ -82,9 +82,9 @@ public boolean execute(String action, JSONArray args, CallbackContext callbackCo
8282
this.clearCache();
8383
}
8484
else if (action.equals("show")) {
85-
// This gets called from JavaScript onCordovaReady to show the webview.
85+
// This gets called from JavaScript onCordovaReady to show the WebView.
8686
// I recommend we change the name of the Message as spinner/stop is not
87-
// indicative of what this actually does (shows the webview).
87+
// indicative of what this actually does (shows the WebView).
8888
cordova.getActivity().runOnUiThread(() -> webView.getPluginManager().postMessage("spinner", "stop"));
8989
}
9090
else if (action.equals("loadUrl")) {
@@ -143,7 +143,7 @@ public void clearCache() {
143143
}
144144

145145
/**
146-
* Load the url into the webview.
146+
* Load the url into the WebView.
147147
*
148148
* @param url
149149
* @param props Properties that can be passed in to the Cordova activity (i.e. loadingDialog, wait, ...)
@@ -273,7 +273,7 @@ public void exitApp() {
273273
private void initTelephonyReceiver() {
274274
IntentFilter intentFilter = new IntentFilter();
275275
intentFilter.addAction(TelephonyManager.ACTION_PHONE_STATE_CHANGED);
276-
//final CordovaInterface mycordova = this.cordova;
276+
//final CordovaInterface myCordova = this.cordova;
277277
this.telephonyReceiver = new BroadcastReceiver() {
278278

279279
@Override

framework/src/org/apache/cordova/NativeToJsMessageQueue.java

+3-3
Original file line numberDiff line numberDiff line change
@@ -491,9 +491,9 @@ void buildJsMessage(StringBuilder sb) {
491491
case PluginResult.MESSAGE_TYPE_MULTIPART:
492492
int size = pluginResult.getMultipartMessagesSize();
493493
for (int i=0; i<size; i++) {
494-
PluginResult subresult = pluginResult.getMultipartMessage(i);
495-
JsMessage submessage = new JsMessage(subresult, jsPayloadOrCallbackId);
496-
submessage.buildJsMessage(sb);
494+
PluginResult subResult = pluginResult.getMultipartMessage(i);
495+
JsMessage subMessage = new JsMessage(subResult, jsPayloadOrCallbackId);
496+
subMessage.buildJsMessage(sb);
497497
if (i < (size-1)) {
498498
sb.append(",");
499499
}

framework/src/org/apache/cordova/PluginManager.java

+7-7
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ public void setPluginEntries(Collection<PluginEntry> pluginEntries) {
8686
}
8787

8888
/**
89-
* Init when loading a new HTML page into webview.
89+
* Init when loading a new HTML page into WebView.
9090
*/
9191
public void init() {
9292
LOG.d(TAG, "init()");
@@ -388,7 +388,7 @@ private String getLaunchUrlPrefix() {
388388
}
389389

390390
/**
391-
* Called when the webview is going to request an external resource.
391+
* Called when the WebView is going to request an external resource.
392392
*
393393
* This delegates to the installed plugins, and returns true/false for the
394394
* first plugin to provide a non-null result. If no plugins respond, then
@@ -420,15 +420,15 @@ public boolean shouldAllowRequest(String url) {
420420
return true;
421421
}
422422
if (url.startsWith("file://")) {
423-
//This directory on WebKit/Blink based webviews contains SQLite databases!
423+
//This directory on WebKit/Blink based WebViews contains SQLite databases!
424424
//DON'T CHANGE THIS UNLESS YOU KNOW WHAT YOU'RE DOING!
425425
return !url.contains("/app_webview/");
426426
}
427427
return false;
428428
}
429429

430430
/**
431-
* Called when the webview is going to change the URL of the loaded content.
431+
* Called when the WebView is going to change the URL of the loaded content.
432432
*
433433
* This delegates to the installed plugins, and returns true/false for the
434434
* first plugin to provide a non-null result. If no plugins respond, then
@@ -457,7 +457,7 @@ public boolean shouldAllowNavigation(String url) {
457457

458458

459459
/**
460-
* Called when the webview is requesting the exec() bridge be enabled.
460+
* Called when the WebView is requesting the exec() bridge be enabled.
461461
*/
462462
public boolean shouldAllowBridgeAccess(String url) {
463463
synchronized (this.entryMap) {
@@ -477,7 +477,7 @@ public boolean shouldAllowBridgeAccess(String url) {
477477
}
478478

479479
/**
480-
* Called when the webview is going not going to navigate, but may launch
480+
* Called when the WebView is going not going to navigate, but may launch
481481
* an Intent for an URL.
482482
*
483483
* This delegates to the installed plugins, and returns true/false for the
@@ -506,7 +506,7 @@ public Boolean shouldOpenExternalUrl(String url) {
506506
}
507507

508508
/**
509-
* Called when the URL of the webview changes.
509+
* Called when the URL of the WebView changes.
510510
*
511511
* @param url The URL that is being changed to.
512512
* @return Return false to allow the URL to load, return true to prevent the URL from loading.

framework/src/org/apache/cordova/engine/SystemWebChromeClient.java

+3-3
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ Licensed to the Apache Software Foundation (ASF) under one
5959
*/
6060
public class SystemWebChromeClient extends WebChromeClient {
6161

62-
private static final int FILECHOOSER_RESULTCODE = 5173;
62+
private static final int FILE_CHOOSER_RESULT_CODE = 5173;
6363
private static final String LOG_TAG = "SystemWebChromeClient";
6464
private final long MAX_QUOTA = 100 * 1024 * 1024;
6565
protected final SystemWebViewEngine parentEngine;
@@ -197,7 +197,7 @@ public View getVideoLoadingProgressView() {
197197
RelativeLayout.LayoutParams layoutParams = new RelativeLayout.LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT);
198198
layoutParams.addRule(RelativeLayout.CENTER_IN_PARENT);
199199
layout.setLayoutParams(layoutParams);
200-
// the proress bar
200+
// the progress bar
201201
ProgressBar bar = new ProgressBar(parentEngine.getView().getContext());
202202
LinearLayout.LayoutParams barLayoutParams = new LinearLayout.LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT);
203203
barLayoutParams.gravity = Gravity.CENTER;
@@ -294,7 +294,7 @@ public void onActivityResult(int requestCode, int resultCode, Intent intent) {
294294
}
295295
filePathsCallback.onReceiveValue(result);
296296
}
297-
}, chooserIntent, FILECHOOSER_RESULTCODE);
297+
}, chooserIntent, FILE_CHOOSER_RESULT_CODE);
298298
} catch (ActivityNotFoundException e) {
299299
LOG.w(LOG_TAG, "No activity found to handle file chooser intent.", e);
300300
filePathsCallback.onReceiveValue(null);

framework/src/org/apache/cordova/engine/SystemWebViewClient.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ public void onReceivedClientCertRequest (WebView view, ClientCertRequest request
199199
* one time for the main frame. This also means that onPageStarted will not be called when the contents of an
200200
* embedded frame changes, i.e. clicking a link whose target is an iframe.
201201
*
202-
* @param view The webview initiating the callback.
202+
* @param view The WebView initiating the callback.
203203
* @param url The url of the page.
204204
*/
205205
@Override
@@ -216,7 +216,7 @@ public void onPageStarted(WebView view, String url, Bitmap favicon) {
216216
* This method is called only for main frame. When onPageFinished() is called, the rendering picture may not be updated yet.
217217
*
218218
*
219-
* @param view The webview initiating the callback.
219+
* @param view The WebView initiating the callback.
220220
* @param url The url of the page.
221221
*/
222222
@Override

0 commit comments

Comments
 (0)