MARIJuANA
— DIOS — NO — CREA — NADA — EN — VANO —
Linux instance-20230208-1745 6.8.0-1013-oracle #13~22.04.1-Ubuntu SMP Mon Sep 2 13:02:56 UTC 2024 x86_64
  SOFT : Apache/2.4.52 (Ubuntu) PHP : 8.1.2-1ubuntu2.19
/var/www/camara-morro-chapeu/public_html/transparencia/assets/filemanager/scripts/zeroclipboard/docs/api/
10.0.0.135

 
[ NAME ] [ SIZE ] [ PERM ] [ DATE ] [ ACT ]
+FILE +DIR
ZeroClipboard.Core.md 21.695 KB -rw-rw-r-- 2021-07-19 09:20 R E G D
ZeroClipboard.md 25.025 KB -rw-rw-r-- 2021-07-19 09:20 R E G D
REQUEST EXIT
# ZeroClipboard.Core API This documents details the **ZeroClipboard.Core** API, including various types of properties, methods, and events. **ZeroClipboard.Core** is primarily intended for use in wrapping ZeroClipboard in 3rd party plugins, e.g. [jquery.zeroclipboard](https://github.com/zeroclipboard/jquery.zeroclipboard). ## Static ### Static Properties #### `ZeroClipboard.version` _[`String`]_ The version of the ZeroClipboard library being used, e.g. `"2.0.0"`. ### Static Methods #### `ZeroClipboard.config(...)` ```js var config = ZeroClipboard.config(); ``` _[`Object`]_ Get a copy of the active configuration for ZeroClipboard. ```js var swfPath = ZeroClipboard.config("swfPath"); ``` _[`*`]_ Get a copy of the actively configured value for this configuration property for ZeroClipboard. ```js var config = ZeroClipboard.config({ forceHandCursor: true }); ``` _[`Object`]_ Set the active configuration for ZeroClipboard. Returns a copy of the updated active configuration. For complete details about what can be configured, see [**Configuration Options** below](#configuration-options). #### `ZeroClipboard.create()` _[`undefined`]_ Create the Flash bridge SWF object. #### `ZeroClipboard.destroy()` _[`undefined`]_ Emit the [`"destroy"`](#destroy) event, remove all event handlers, and destroy the Flash bridge. #### `ZeroClipboard.setData(...)` ```js ZeroClipboard.setData("text/plain", "Blah"); ``` _[`undefined`]_ Set the pending `data` of type `format` for clipboard injection. ```js ZeroClipboard.setData({ "text/plain": "Blah", "text/html": "Blah" }); ``` _[`undefined`]_ Set the pending `data` of various formats for clipboard injection. #### `ZeroClipboard.clearData(...)` ```js ZeroClipboard.clearData("text/plain"); ``` _[`undefined`]_ Clear the pending data of type `format` for clipboard injection. ```js ZeroClipboard.clearData(); ``` _[`undefined`]_ Clear the pending data of ALL formats for clipboard injection. #### `ZeroClipboard.getData(...)` ```js var text = ZeroClipboard.getData("text/plain"); ``` _[`String`]_ Get the pending data of type `format` for clipboard injection. ```js var dataObj = ZeroClipboard.getData(); ``` _[`Object`]_ Get a copy of the pending data of ALL formats for clipboard injection. #### `ZeroClipboard.focus(...)` #### `ZeroClipboard.activate(...)` ```js ZeroClipboard.focus(document.getElementById("d_clip_button")); ``` _[`undefined`]_ Focus/"activate" the provided element by moving the Flash SWF object in front of it. **NOTE:** The preferred method to use is `focus` but the alias `activate` is available for backward compatibility's sake. #### `ZeroClipboard.blur()` #### `ZeroClipboard.deactivate()` _[`undefined`]_ Blur/"deactivate" the currently focused/"activated" element, moving the Flash SWF object off the screen. **NOTE:** The preferred method to use is `blur` but the alias `deactivate` is available for backward compatibility's sake. #### `ZeroClipboard.activeElement()` ```js var el = document.getElementById("d_clip_button"); ZeroClipboard.focus(el); var activeEl = ZeroClipboard.activeElement(); // activeEl === el ``` _[`HTMLElement` or `null`]_ Return the currently "activated" element that the Flash SWF object is in front of it. #### `ZeroClipboard.state()` _[`Object`]_ Diagnostic method that describes the state of the browser, Flash Player, and ZeroClipboard. #### `ZeroClipboard.isFlashUnavailable()` _[`Boolean`]_ Indicates if Flash Player is **definitely** unusable (disabled, outdated, unavailable, or deactivated). _**IMPORTANT:**_ This method should be considered private. #### `ZeroClipboard.on(...)` ```js var listenerFn = function(e) { var ZeroClipboard = this; /* ... */ }; ZeroClipboard.on("ready", listenerFn); var listenerObj = { handleEvent: function(e) { var listenerObj = this; /* ... */ } }; ZeroClipboard.on("error", listenerObj); ``` _[`undefined`]_ Add a `listener` function/object for an `eventType`. ```js ZeroClipboard.on("ready error", function(e) { /* ... */ }); ``` _[`undefined`]_ Add a `listener` function/object for multiple `eventType`s. ```js ZeroClipboard.on({ "ready": function(e) { /* ... */ }, "error": function(e) { /* ... */ } }); ``` _[`undefined`]_ Add a set of `eventType` to `listener` function/object mappings. #### `ZeroClipboard.off(...)` ```js ZeroClipboard.off("ready", listenerFn); ZeroClipboard.off("error", listenerObj); ``` _[`undefined`]_ Remove a `listener` function/object for an `eventType`. ```js ZeroClipboard.off("ready error", listenerFn); ``` _[`undefined`]_ Remove a `listener` function/object for multiple `eventType`s. ```js ZeroClipboard.off({ "ready": readyListenerFn, "error": errorListenerFn }); ``` _[`undefined`]_ Remove a set of `eventType` to `listener` function/object mappings. ```js ZeroClipboard.off("ready"); ``` _[`undefined`]_ Remove ALL listener functions/objects for an `eventType`. ```js ZeroClipboard.off(); ``` _[`undefined`]_ Remove ALL listener functions/objects for ALL registered event types. #### `ZeroClipboard.emit(...)` ```js ZeroClipboard.emit("ready"); ZeroClipboard.emit({ type: "error", name: "flash-disabled" }); var pendingCopyData = ZeroClipboard.emit("copy"); ``` _[`undefined`, or a Flash-friendly data Object for the `"copy"` event]_ Dispatch an event to all registered listeners. The emission of some types of events will result in side effects. #### `ZeroClipboard.handlers()` ```js var listeners = ZeroClipboard.handlers("ready"); ``` _[`Array`]_ Retrieves a copy of the registered listener functions/objects for the given `eventType`. ```js var listeners = ZeroClipboard.handlers(); ``` _[`Object`]_ Retrieves a copy of the map of registered listener functions/objects for ALL event types. ### Static Events #### `"ready"` The `ready` event is fired when the Flash SWF completes loading and is ready for action. Please note that you need to set most configuration options [with [`ZeroClipboard.config(...)`](#zeroclipboardconfig)] before `ZeroClipboard.create()` is invoked. ```js ZeroClipboard.on("ready", function(e) { /* e = { type: "ready", message: "Flash communication is established", target: null, relatedTarget: null, currentTarget: flashSwfObjectRef, version: "11.2.202", timeStamp: Date.now() }; */ }); ``` #### `"beforecopy"` On `click`, the Flash object will fire off a `beforecopy` event. This event is generally only used for "UI prepartion" if you want to alter anything before the `copy` event fires. **IMPORTANT:** Handlers of this event are expected to operate synchronously if they intend to be finished before the "copy" event is triggered. ```js ZeroClipboard.on("beforecopy", function(e) { /* e = { type: "beforecopy", target: currentlyActivatedElementOrNull, relatedTarget: dataClipboardElementTargetOfCurrentlyActivatedElementOrNull, currentTarget: flashSwfObjectRef, timeStamp: Date.now() }; */ }); ``` #### `"copy"` On `click` (and after the `beforecopy` event), the Flash object will fire off a `copy` event. If the HTML object has `data-clipboard-text` or `data-clipboard-target`, then ZeroClipboard will take care of getting an initial set of data. It will then invoke any `copy` event handlers, in which you can call `event.clipboardData.setData` to set the text, which will complete the loop. **IMPORTANT:** If a handler of this event intends to modify the pending data for clipboard injection, it _MUST_ operate synchronously in order to maintain the temporarily elevated permissions granted by the user's `click` event. The most common "gotcha" for this restriction is if someone wants to make an asynchronous XMLHttpRequest in response to the `copy` event to get the data to inject — this won't work; make it a _synchronous_ XMLHttpRequest instead, or do the work in advance before the `copy` event is fired. ```js ZeroClipboard.on("copy", function(e) { /* e = { type: "copy", target: currentlyActivatedElementOrNull, relatedTarget: dataClipboardElementTargetOfCurrentlyActivatedElementOrNull, currentTarget: flashSwfObjectRef, timeStamp: Date.now(), clipboardData: { setData: ZeroClipboard.setData, clearData: ZeroClipboard.clearData } }; */ }); ``` #### `"aftercopy"` The `aftercopy` event is fired when the text is copied [or failed to copy] to the clipboard. ```js ZeroClipboard.on("aftercopy", function(e) { /* e = { type: "aftercopy", target: currentlyActivatedElementOrNull, relatedTarget: dataClipboardElementTargetOfCurrentlyActivatedElementOrNull, currentTarget: flashSwfObjectRef, timeStamp: Date.now(), success: { "text/plain": true, "text/html": true, "application/rtf": false }, data: { "text/plain": "Blah", "text/html": "Blah", "application/rtf": "{\\rtf1\\ansi\n{\\b Blah}}" } }; */ }); ``` #### `"destroy"` The `destroy` event is fired when `ZeroClipboard.destroy()` is invoked. **IMPORTANT:** Handlers of this event are expected to operate synchronously if they intend to be finished before the destruction is complete. ```js ZeroClipboard.on("destroy", function(e) { /* e = { type: "destroy", target: null, relatedTarget: null, currentTarget: flashSwfObjectRef, timeStamp: Date.now(), success: { "text/plain": true, "text/html": true, "application/rtf": false }, data: { "text/plain": "Blah", "text/html": "Blah", "application/rtf": "{\\rtf1\\ansi\n{\\b Blah}}" } }; */ }); ``` #### `"error"` The `error` event is fired under a number of conditions, which will be detailed as sub-sections below. Some consumers may not consider all `error` types to be critical, and thus ZeroClipboard does not take it upon itself to implode by calling `ZeroClipboard.destroy()` under error conditions. However, many consumers may want to do just that. ##### `error[name = "flash-disabled"]` This type of `error` event fires when Flash Player is either not installed or not enabled in the browser. ```js ZeroClipboard.on("error", function(e) { /* e = { type: "error", name: "flash-disabled", messsage: "Flash is disabled or not installed", target: null, relatedTarget: null, currentTarget: flashSwfObjectRef, timeStamp: Date.now(), minimumVersion: "11.0.0" }; */ }); ``` ##### `error[name = "flash-outdated"]` This type of `error` event fires when Flash Player is installed in the browser but the version is too old for ZeroClipboard. ZeroClipboard requires Flash Player 11.0.0 or above. ```js ZeroClipboard.on("error", function(e) { /* e = { type: "error", name: "flash-outdated", messsage: "Flash is too outdated to support ZeroClipboard", target: null, relatedTarget: null, currentTarget: flashSwfObjectRef, timeStamp: Date.now(), minimumVersion: "11.0.0", version: "10.3.183" }; */ }); ``` ##### `error[name = "flash-unavailable"]` This type of `error` event fires when the browser's installation of Flash Player cannot communicate bidirectionally with JavaScript. ```js ZeroClipboard.on("error", function(e) { /* e = { type: "error", name: "flash-unavailable", messsage: "Flash is unable to communicate bidirectionally with JavaScript", target: null, relatedTarget: null, currentTarget: flashSwfObjectRef, timeStamp: Date.now(), minimumVersion: "11.0.0", version: "11.2.202" }; */ }); ``` ##### `error[name = "flash-deactivated"]` This type of `error` event fires when the browser's installation of Flash Player is either too old for the browser [but _not_ too old for ZeroClipboard] or if Flash objects are configured as click-to-play and the user does not authorize it within `_globalConfig.flashLoadTimeout` milliseconds or does not authorize it at all. ```js ZeroClipboard.on("error", function(e) { /* e = { type: "error", name: "flash-deactivated", messsage: "Flash is too outdated for your browser and/or is configured as click-to-activate", target: null, relatedTarget: null, currentTarget: flashSwfObjectRef, timeStamp: Date.now(), minimumVersion: "11.0.0", version: "11.2.202" }; */ }); ``` ##### `error[name = "flash-overdue"]` This type of `error` event fires when the SWF loads successfully but takes longer than `_globalConfig.flashLoadTimeout` milliseconds to do so. This would likely be caused by one of the following situations: 1. Too short of a `_globalConfig.flashLoadTimeout` duration configured 2. Network latency 3. The user's installation of Flash is configured as click-to-play but then authorized by the user too late such that the SWF does not finish loading before the timeout period has expired (or it may have expired before they authorized it at all). The appropriate response to this event is left up to the consumer. For instance, if they chose to invoke `ZeroClipboard.destroy()` in response to the earlier `error[name = "flash-deactivated"]` event but then receive this `error[name = "flash-overdu