gwt.material.design.client.JQueryMigrate Maven / Gradle / Ivy
/*
* #%L
* GwtMaterial
* %%
* Copyright (C) 2015 - 2020 GwtMaterialDesign
* %%
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* #L%
*/
package gwt.material.design.client;
import gwt.material.design.client.resources.JQueryMigrateDebugResources;
import gwt.material.design.client.resources.JQueryMigrateResources;
import jsinterop.annotations.*;
@JsType(isNative = true, name = "jQuery", namespace = JsPackage.GLOBAL)
public class JQueryMigrate {
/**
* This property is an array of string warning messages that have been generated by the code on the page, in the
* order they were generated. Messages appear in the array only once, even if the condition has occurred multiple
* times, unless jQuery.migrateReset() is called.
*/
@JsProperty
public static boolean migrateWarnings;
/**
* Set this property to true to prevent console warnings from being generated in the development version.
* The jQuery.migrateWarnings array is still maintained when this property is set, which allows programmatic
* inspection without console output.
*/
@JsProperty
public static boolean migrateMute;
/**
* Set this property to false if you want warnings but do not want stack traces to appear on the console.
*/
@JsProperty
public static boolean migrateTrace;
/**
* This string property indicates the version of Migrate in use.
*/
@JsProperty
public static boolean migrateVersion;
/**
* By default, Migrate only gives a specific warning once. If you set this property to false it will give a warning
* for every occurrence each time it happens. Note that this can generate a lot of output, for example when a warning
* occurs in a loop.
*/
@JsProperty
public static boolean migrateDeduplicateWarnings;
/**
* This method clears the jQuery.migrateWarnings array and "forgets" the list of messages that have been seen already.
*/
@JsMethod
public static native void migrateReset();
@JsOverlay
public static void load() {
load(false);
}
@JsOverlay
public static void load(boolean debug) {
if (debug) {
MaterialDesign.injectJs(JQueryMigrateDebugResources.INSTANCE.jQueryMigrate());
} else {
MaterialDesign.injectJs(JQueryMigrateResources.INSTANCE.jQueryMigrate());
}
}
}