(function(define, require, requireNative, requireAsync, exports, conso ترجمة - (function(define, require, requireNative, requireAsync, exports, conso السلوفاكية كيف أقول

(function(define, require, requireN

(function(define, require, requireNative, requireAsync, exports, console, privates,$Array, $Function, $JSON, $Object, $RegExp, $String, $Error) {'use strict';// Copyright 2014 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

var exceptionHandler = require('uncaught_exception_handler');
var eventNatives = requireNative('event_natives');
var logging = requireNative('logging');
var schemaRegistry = requireNative('schema_registry');
var sendRequest = require('sendRequest').sendRequest;
var utils = require('utils');
var validate = require('schemaUtils').validate;

// Schemas for the rule-style functions on the events API that
// only need to be generated occasionally, so populate them lazily.
var ruleFunctionSchemas = {
// These values are set lazily:
// addRules: {},
// getRules: {},
// removeRules: {}
};

// This function ensures that |ruleFunctionSchemas| is populated.
function ensureRuleSchemasLoaded() {
if (ruleFunctionSchemas.addRules)
return;
var eventsSchema = schemaRegistry.GetSchema("events");
var eventType = utils.lookup(eventsSchema.types, 'id', 'events.Event');

ruleFunctionSchemas.addRules =
utils.lookup(eventType.functions, 'name', 'addRules');
ruleFunctionSchemas.getRules =
utils.lookup(eventType.functions, 'name', 'getRules');
ruleFunctionSchemas.removeRules =
utils.lookup(eventType.functions, 'name', 'removeRules');
}

// A map of event names to the event object that is registered to that name.
var attachedNamedEvents = {};

// A map of functions that massage event arguments before they are dispatched.
// Key is event name, value is function.
var eventArgumentMassagers = {};

// An attachment strategy for events that aren't attached to the browser.
// This applies to events with the "unmanaged" option and events without
// names.
var NullAttachmentStrategy = function(event) {
this.event_ = event;
};
NullAttachmentStrategy.prototype.onAddedListener =
function(listener) {
};
NullAttachmentStrategy.prototype.onRemovedListener =
function(listener) {
};
NullAttachmentStrategy.prototype.detach = function(manual) {
};
NullAttachmentStrategy.prototype.getListenersByIDs = function(ids) {
// |ids| is for filtered events only.
return this.event_.listeners;
};

// Handles adding/removing/dispatching listeners for unfiltered events.
var UnfilteredAttachmentStrategy = function(event) {
this.event_ = event;
};

UnfilteredAttachmentStrategy.prototype.onAddedListener =
function(listener) {
// Only attach / detach on the first / last listener removed.
if (this.event_.listeners.length == 0)
eventNatives.AttachEvent(this.event_.eventName);
};

UnfilteredAttachmentStrategy.prototype.onRemovedListener =
function(listener) {
if (this.event_.listeners.length == 0)
this.detach(true);
};

UnfilteredAttachmentStrategy.prototype.detach = function(manual) {
eventNatives.DetachEvent(this.event_.eventName, manual);
};

UnfilteredAttachmentStrategy.prototype.getListenersByIDs = function(ids) {
// |ids| is for filtered events only.
return this.event_.listeners;
};

var FilteredAttachmentStrategy = function(event) {
this.event_ = event;
this.listenerMap_ = {};
};

FilteredAttachmentStrategy.idToEventMap = {};

FilteredAttachmentStrategy.prototype.onAddedListener = function(listener) {
var id = eventNatives.AttachFilteredEvent(this.event_.eventName,
listener.filters || {});
if (id == -1)
throw new Error("Can't add listener");
listener.id = id;
this.listenerMap_[id] = listener;
FilteredAttachmentStrategy.idToEventMap[id] = this.event_;
};

FilteredAttachmentStrategy.prototype.onRemovedListener = function(listener) {
this.detachListener(listener, true);
};

FilteredAttachmentStrategy.prototype.detachListener =
function(listener, manual) {
if (listener.id == undefined)
throw new Error("listener.id undefined - '" + listener + "'");
var id = listener.id;
delete this.listenerMap_[id];
delete FilteredAttachmentStrategy.idToEventMap[id];
eventNatives.DetachFilteredEvent(id, manual);
};

FilteredAttachmentStrategy.prototype.detach = function(manual) {
for (var i in this.listenerMap_)
this.detachListener(this.listenerMap_[i], manual);
};

FilteredAttachmentStrategy.prototype.getListenersByIDs = function(ids) {
var result = [];
for (var i = 0; i < ids.length; i++)
$Array.push(result, this.listenerMap_[ids[i]]);
return result;
};

function parseEventOptions(opt_eventOptions) {
function merge(dest, src) {
for (var k in src) {
if (!$Object.hasOwnProperty(dest, k)) {
dest[k] = src[k];
}
}
}

var options = opt_eventOptions || {};
merge(options, {
// Event supports adding listeners with filters ("filtered events"), for
// example as used in the webNavigation API.
//
// event.addListener(listener, [filter1, filter2]);
supportsFilters: false,

// Events supports vanilla events. Most APIs use these.
//
// event.addListener(listener);
supportsListeners: true,

// Event supports adding rules ("declarative events") rather than
// listeners, for example as used in the declarativeWebRequest API.
//
// event.addRules([rule1, rule2]);
supportsRules: false,

// Event is unmanaged in that the browser has no knowledge of its
// existence; it's never invoked, doesn't keep the renderer alive, and
// the bindings system has no knowledge of it.
//
// Both events created by user code (new chrome.Event()) and messaging
// events are unmanaged, though in the latter case the browser *does*
// interact indirectly with them via IPCs written by hand.
unmanaged: false,
});
return options;
};

// Event object. If opt_eventName is provided, this object represents
// the unique instance of that named event, and dispatching an event
// with that name will route through this object's listeners. Note that
// opt_eventName is required for events that support rules.
//
// Example:
// var Event = require('event_bindings').Event;
// chrome.tabs.onChanged = new Event("tab-changed");
// chrome.tabs.onChanged.addListener(function(data) { alert(data); });
// Event.dispatch("tab-changed", "hi");
// will result in an alert dialog that says 'hi'.
//
// If opt_eventOptions exists, it is a dictionary that contains the boolean
// entries "supportsListeners" and "supportsRules".
// If opt_webViewInstanceId exists, it is an integer uniquely identifying a
// tag within the embedder. If it does not exist, then this is an
// extension event rather than a event.
var EventImpl = function(opt_eventName, opt_argSchemas, opt_eventOptions,
opt_webViewInstanceId) {
this.eventName = opt_eventName;
this.argSchemas = opt_argSchemas;
this.listeners = [];
this.eventOptions = parseEventOptions(opt_eventOptions);
this.webViewInstanceId = opt_webViewInstanceId || 0;

if (!this.eventName) {
if (this.eventOptions.supportsRules)
throw new Error("Events that support rules require an event name.");
// Events without names cannot be managed by the browser by definition
// (the browser has no way of identifying them).
this.eventOptions.unmanaged = true;
}

// Track whether the event has been destroyed to help track down the cause
// of http://crbug.com/258526.
// This variable will eventually hold the stack trace of the destroy call.
// TODO(kalman): Delete this and replace with more sound logic that catches
// when events are used without being *attached*.
this.destroyed = null;

if (this.eventOptions.unmanaged)
this.attachmentStrategy = new NullAttachmentStrategy(this);
else if (this.eventOptions.supportsFilters)
this.attachmentStrategy = new FilteredAttachmentStrategy(this);
else
this.attachmentStrategy = new UnfilteredAttachmentStrategy(this);
};

// callback is a function(args, dispatch). args are the args we receive from
// dispatchEvent(), and dispatch is a function(args) that dispatches args to
// its listeners.
function registerArgumentMassager(name, callback) {
if (eventArgumentMassagers[name])
throw new Error("Massager already registered for event: " + name);
eventArgumentMassagers[name] = callback;
}

// Dispatches a named event with the given argument array. The args array is
// the list of arguments that will be sent to the event callback.
function dispatchEvent(name, args, filteringInfo) {
var listenerIDs = [];

if (filteringInfo)
listenerIDs = eventNatives.MatchAgainstEventFilter(name, filteringInfo);

var event = attachedNamedEvents[name];
if (!event)
return;

var dispatchArgs = function(args) {
var result = event.dispatch_(args, listenerIDs);
if (result)
logging.DCHECK(!result.validationErrors, result.validationErrors);
return result;
};

if (eventArgumentMassagers[name])
eventArgumentMassagers[name](args, dispatchArgs);
else
dispatchArgs(args);
}

// Registers a callback to be called when this event is dispatched.
EventImpl.prototype.addListener = function(cb, filters) {
if (!this.eventOptions.supportsListeners)
throw new Error("This event does not support listeners.");
if (this.eventOptions.maxListeners &&
this.getListenerCount_() >= this.eventOptions.maxListeners) {
throw new Error("Too many listeners for " + this.eventName);
}
if (filters) {
if (!th
0/5000
من: -
إلى: -
النتائج (السلوفاكية) 1: [نسخ]
نسخ!
(funkcia (definovať, vyžadujú, requireNative, requireAsync, vývoz, konzoly, privátov, $Array, $Function, $JSON, $Object, $RegExp, $String, $Error) {"použitie prísnych"; / / Copyright 2014 chróm autorov. Všetky práva vyhradené.Používanie tohto zdrojového kódu sa riadi štýle BSD licenciou, ktorá môže byťnájsť v súbore licencie. var exceptionHandler = require('uncaught_exception_handler'); var eventNatives = requireNative('event_natives'); zapisovanie var = requireNative('logging'); var schemaRegistry = requireNative('schema_registry'); var sendRequest = require('sendRequest').sendRequest; var utils = require('utils'); overenie var = require('schemaUtils').validate; Schémy pre pravidlo-štýl funkcie udalosti API, Stačí byť generované občas, tak naplniť ich lenivo. var ruleFunctionSchemas = {} Tieto hodnoty sú stanovené lenivo: addRules: {} getRules: {} removeRules: {} }; Táto funkcia zabezpečuje, že | ruleFunctionSchemas | je obývaná. {Funkcia ensureRuleSchemasLoaded() Ak (ruleFunctionSchemas.addRules) návrat; var eventsSchema = schemaRegistry.GetSchema("events"); var eventType = utils.lookup (eventsSchema.types, "id", "udalosti. Akcie "); ruleFunctionSchemas.addRules = utils.Lookup (eventType.functions, "meno", "addRules"); ruleFunctionSchemas.getRules = utils.Lookup (eventType.functions, "meno", "getRules"); ruleFunctionSchemas.removeRules = utils.Lookup (eventType.functions, "meno", "removeRules"); } Mapa názvy udalostí udalosti objektu, ktorý je registrovaný na to meno. var attachedNamedEvents = {}; Mapa funkcie, ktoré masáž argumenty akcie pred ich odoslania. Kľúčom je názov podujatia, je hodnota funkcie. var eventArgumentMassagers = {}; Upevnenie stratégie pre udalosti, ktoré nie sú pripojené do prehliadača. Toto sa vzťahuje na udalosti "nespravované" možnosť a udalosti bez názvy. var NullAttachmentStrategy = {function(event)} this.event_ = akcie; }; NullAttachmentStrategy.prototype.onAddedListener = {function(Listener)} }; NullAttachmentStrategy.prototype.onRemovedListener = {function(Listener)} }; NullAttachmentStrategy.prototype.detach = {function(manual)} }; NullAttachmentStrategy.prototype.getListenersByIDs = {function(ids)} | ID | je len na urèené filtrované. návrat this.event_.listeners; }; Spracováva pridať/odstrániť/dispečing poslucháčov nefiltrovaných udalostí. var UnfilteredAttachmentStrategy = {function(event)} this.event_ = akcie; }; UnfilteredAttachmentStrategy.prototype.onAddedListener = {function(Listener)} Len pripojiť / odpojiť prvý / posledný poslucháčov odstránené. Ak (this.event_.listeners.length == 0) eventNatives.AttachEvent(this.event_.eventName); }; UnfilteredAttachmentStrategy.prototype.onRemovedListener = {function(Listener)} Ak (this.event_.listeners.length == 0) this.detach(true); }; UnfilteredAttachmentStrategy.prototype.detach = {function(manual)} eventNatives.DetachEvent (this.event_.eventName, ručné); }; UnfilteredAttachmentStrategy.prototype.getListenersByIDs = {function(ids)} | ID | je len na urèené filtrované. návrat this.event_.listeners; }; var FilteredAttachmentStrategy = {function(event)} this.event_ = akcie; this.listenerMap_ = {}; }; FilteredAttachmentStrategy.idToEventMap = {}; FilteredAttachmentStrategy.prototype.onAddedListener = {function(listener)} var id = eventNatives.AttachFilteredEvent (this.event_.eventName, Listener.filters || {}); Ak (id == -1) hodiť nový chyba ("nemožno pridať poslucháč"); Listener.ID = id; this.listenerMap_[id] = poslucháčov; FilteredAttachmentStrategy.idToEventMap[id] = this.event_; }; FilteredAttachmentStrategy.prototype.onRemovedListener = {function(listener)} this.detachListener (poslucháč, pravdivý); }; FilteredAttachmentStrategy.prototype.detachListener = {Funkcia (poslucháč, manuál) Ak (listener.id == nedefinované) hodiť nový chyba ("listener.id, neurčený -" "+ poslucháčov +" ""); var id = listener.id; odstrániť this.listenerMap_[id]; odstrániť FilteredAttachmentStrategy.idToEventMap[id]; eventNatives.DetachFilteredEvent (id, manuálny); }; FilteredAttachmentStrategy.prototype.detach = {function(manual)} pre (var v this.listenerMap_) this.detachListener (this.listenerMap_ [i], manuálny); }; FilteredAttachmentStrategy.prototype.getListenersByIDs = {function(ids)} var výsledok = []; pre (var i = 0; ja < ids.length; i ++) $Array.push (výsledok, this.listenerMap_[ids[i]]); return result; }; function parseEventOptions(opt_eventOptions) { function merge(dest, src) { for (var k in src) { if (!$Object.hasOwnProperty(dest, k)) { dest[k] = src[k]; } } } var options = opt_eventOptions || {}; merge(options, { // Event supports adding listeners with filters ("filtered events"), for // example as used in the webNavigation API. // // event.addListener(listener, [filter1, filter2]); supportsFilters: false, // Events supports vanilla events. Most APIs use these. // // event.addListener(listener); supportsListeners: true, // Event supports adding rules ("declarative events") rather than // listeners, for example as used in the declarativeWebRequest API. // // event.addRules([rule1, rule2]); supportsRules: false, // Event is unmanaged in that the browser has no knowledge of its // existence; it's never invoked, doesn't keep the renderer alive, and // the bindings system has no knowledge of it. // // Both events created by user code (new chrome.Event()) and messaging // events are unmanaged, though in the latter case the browser *does* // interact indirectly with them via IPCs written by hand. unmanaged: false, }); return options; }; // Event object. If opt_eventName is provided, this object represents // the unique instance of that named event, and dispatching an event // with that name will route through this object's listeners. Note that // opt_eventName is required for events that support rules. // // Example: // var Event = require('event_bindings').Event; // chrome.tabs.onChanged = new Event("tab-changed"); // chrome.tabs.onChanged.addListener(function(data) { alert(data); }); // Event.dispatch("tab-changed", "hi"); // will result in an alert dialog that says 'hi'. // // If opt_eventOptions exists, it is a dictionary that contains the boolean // entries "supportsListeners" and "supportsRules". // If opt_webViewInstanceId exists, it is an integer uniquely identifying a // tag within the embedder. If it does not exist, then this is an // extension event rather than a event. var EventImpl = function(opt_eventName, opt_argSchemas, opt_eventOptions, opt_webViewInstanceId) { this.eventName = opt_eventName; this.argSchemas = opt_argSchemas; this.listeners = []; this.eventOptions = parseEventOptions(opt_eventOptions); this.webViewInstanceId = opt_webViewInstanceId || 0; if (!this.eventName) { if (this.eventOptions.supportsRules) throw new Error("Events that support rules require an event name."); // Events without names cannot be managed by the browser by definition // (the browser has no way of identifying them). this.eventOptions.unmanaged = true; } // Track whether the event has been destroyed to help track down the cause // of http://crbug.com/258526. // This variable will eventually hold the stack trace of the destroy call. // TODO(kalman): Delete this and replace with more sound logic that catches // when events are used without being *attached*. this.destroyed = null; if (this.eventOptions.unmanaged) this.attachmentStrategy = new NullAttachmentStrategy(this); else if (this.eventOptions.supportsFilters) this.attachmentStrategy = new FilteredAttachmentStrategy(this); else this.attachmentStrategy = new UnfilteredAttachmentStrategy(this); }; // callback is a function(args, dispatch). args are the args we receive from // dispatchEvent(), and dispatch is a function(args) that dispatches args to // its listeners. function registerArgumentMassager(name, callback) { if (eventArgumentMassagers[name]) throw new Error("Massager already registered for event: " + name); eventArgumentMassagers[name] = callback; } // Dispatches a named event with the given argument array. The args array is // the list of arguments that will be sent to the event callback. function dispatchEvent(name, args, filteringInfo) { var listenerIDs = []; if (filteringInfo) listenerIDs = eventNatives.MatchAgainstEventFilter(name, filteringInfo); var event = attachedNamedEvents[name]; if (!event) return; var dispatchArgs = function(args) { var result = event.dispatch_(args, listenerIDs); if (result) logging.DCHECK(!result.validationErrors, result.validationErrors); return result; }; if (eventArgumentMassagers[name]) eventArgumentMassagers[name](args, dispatchArgs); else dispatchArgs(args); } // Registers a callback to be called when this event is dispatched. EventImpl.prototype.addListener = function(cb, filters) { if (!this.eventOptions.supportsListeners) throw new Error("This event does not support listeners."); if (this.eventOptions.maxListeners && this.getListenerCount_() >= this.eventOptions.maxListeners) { throw new Error("Too many listeners for " + this.eventName); } if (filters) { if (!th
يجري ترجمتها، يرجى الانتظار ..
النتائج (السلوفاكية) 2:[نسخ]
نسخ!
(Function (definovať, vyžadujú, requireNative , requireAsync, vývoz, konzola, vojini, $ Array, $ funkcie, $ JSON, $ Object, $ regexp, $ String, $ Chyba) { "use strict"; // Copyright 2014 Chromium že .. Autori Výstavy Všetky práva vyhradené
// Použitie tohto zdrojového kódu sa riadi vBulletin BSD štýl licencie adresárov To možno
// nájdené v licenčnom súbore.

var = ExceptionHandler require ( 'Uncaught_exception_handler');
var = EventNatives RequireNative ( "Event_natives" ),
ťažba var = RequireNative ( "logging");
var SchemaRegistry = RequireNative ( "Schema_registry ');
var poslatdotaz = require (' poslatdotaz ') poslatdotaz ;.
var utils = require (' utils ');
var validate = require (' . SchemaUtils ") overiť;

// schémy pre funkcie pravidlo štýle sa rozkladá na rozhraní API udalostí, ktoré
len musia byť generované Občas //, tak lenivo naplniť ich.
var RuleFunctionSchemas = {
// Tieto hodnoty sú na nastavené lenivo:
// AddRules: } {,
// GetRules: {}
// RemoveRules: {}
};

// Táto funkcia zaisťuje, že | RuleFunctionSchemas | je naplnená.
fungovať EnsureRuleSchemasLoaded () {
if (RuleFunctionSchemas.addRules)
return;
var EventsSchema SchemaRegistry.GetSchema = ( "udalosti");
var = eventType Utils.lookup (EventsSchema.types, "id", "Events.Event ');

RuleFunctionSchemas.addRules =
Utils.lookup (EventType.functions,' name ',' AddRules");
RuleFunctionSchemas. = GetRules
Utils.lookup (EventType.functions, 'name', 'GetRules');
RuleFunctionSchemas.removeRules =
Utils.lookup (EventType.functions, 'name', 'RemoveRules');
}

// mapy názvov na akciu to je objekt udalosti, aby registrovaný, že názov.
var AttachedNamedEvents = {};

// mapa masážnou funkciou, ktoré argumenty udalostí sú On predtým, ako seš . odoslané
// Key je názov akcie, je z funkcie hodnoty.
var EventArgumentMassagers = {};

// stratégia pre uchytenie udalostí, ktoré nie sú pripojené opatrenia sú On . do prehliadača
// To platí na udalosti s možnosťou "neudržiavaných" a akcií bez
// mien.
var NullAttachmentStrategy = function (event) {
This.event_ = udalosti;
};
NullAttachmentStrategy. = Prototype.onAddedListener
funkcie (poslucháča) {
};
NullAttachmentStrategy.prototype.onRemovedListener =
function (poslucháča) {
};
NullAttachmentStrategy.prototype.detach = function (manuálny) {
};
NullAttachmentStrategy.prototype.getListenersByIDs = function (IDS) {
// | ID | Pre filtrovaných udalosťou je len.
Návrate This.event_.listeners;
};

// Kľučky pridanie / odobratie / dispečing poslucháča nefiltrovaných udalosti.
Var UnfilteredAttachmentStrategy = function (event) {
This.event_ = udalosti;
};

UnfilteredAttachmentStrategy.prototype.onAddedListener =
funkcia (poslucháča) {
// pripojiť pomocou Až / odpojiť na prvom / poslednom poslucháča odstrániť.
if (== This.event_.listeners.length = Funkcia (poslucháč) { if (This.event_.listeners.length == 0) This.detach (true); }; UnfilteredAttachmentStrategy.prototype.detach = function (manuálny) { EventNatives.DetachEvent (This.event_.eventName, manuálny ); }; UnfilteredAttachmentStrategy.prototype.getListenersByIDs = function (IDS) { //. | ID | filtrovaný iba udalosti vrátiť This.event_.listeners; }; var FilteredAttachmentStrategy = function (event) { This.event_ = udalosť; toto = {} .listenerMap_; }; FilteredAttachmentStrategy.idToEventMap = {}; FilteredAttachmentStrategy.prototype.onAddedListener = function (poslucháča) { var id = EventNatives.AttachFilteredEvent (This.event_.eventName, Listener.filters || {}); if ( == -1 id) throw new na Error ( "nedá : pridať poslucháča"); Listener.id = id; This.listenerMap_ [id] = poslucháč; FilteredAttachmentStrategy.idToEventMap [id] = This.event_; }; FilteredAttachmentStrategy.prototype = function .onRemovedListener (poslucháča) { This.detachListener (poslucháč, true); }; FilteredAttachmentStrategy.prototype.detachListener = function (poslucháča, manuálny) { if (== Listener.id nedefinovaný) throw new na Error ( "Listener.id nedefinovaný - ' "+ poslucháč +"' "); var id = Listener.id; odstránenie This.listenerMap_ [id]; odstránenie FilteredAttachmentStrategy.idToEventMap [id]; EventNatives.DetachFilteredEvent (id, manuálny); }; FilteredAttachmentStrategy.prototype.detach funkcie = (manuálny) { for (var i v This.listenerMap_) This.detachListener (This.listenerMap_ [i], manuálne); }; FilteredAttachmentStrategy.prototype.getListenersByIDs = funkcia (IDS) { var result = []; o ( var i = 0; i <ids.length; ++ I) $ Array.push (výsledok, This.listenerMap_ [ID: [i]]); return výsledok; }; funkcie ParseEventOptions (Opt_eventOptions) { funkcie merge (dest, src) { for (var kv src) { if (! Object.hasOwnProperty $ (dest, k)) { dest [k] = src [k]; } } } možnosti var = Opt_eventOptions || } {; Merge (možnosti { // akcie podporuje pridanie poslucháča s filtrami ( "filtrovanej akcia"), pre // napríklad z použité farby : . Rovnako ako v WebNavigation API // // Event.addListener (poslucháč [filtr1, filtr2]) ; SupportsFilters: falošné, // Events podporuje vanilkový udalosti. Väčšina z nich používa tieto API. // // Event.addListener (poslucháč); SupportsListeners: true, // podporuje Event pridaním pravidlá ( "deklaratívny udalosti") skôr než // poslucháča, farba : ako príklad zo použité pre v DeclarativeWebRequest API. // // Event.addRules ([pravidlo1, Rule2]); SupportsRules: falošné, // prípade, že je neriadený v prehliadači nepozná svoje // existencie; nikdy to je vyvolaná, nie je KEEP nemá renderer nažive a // systém viazania nemá žiadne vedomosti o tom. // // Obe akcie by vBulletin bol vytvorený pomocou užívateľského kódu (nový Chrome.Event ()) a posielanie správ // udalosti sú na neriadený, aj keď v tejto druhej * prípad prehliadač * // nepriamo komunikovať s nimi preč cez IPC napísal vBulletin rúk. neriadený: false, }); možnosti návratu; }; // objekt udalosti. Za predpokladu, Opt_eventName je -Li tento objekt reprezentuje // jedinečná inštancia pomenované tejto udalosti, a dispečing udalosť // s týmto názvom bude smerovať cez poslucháči tohto objektu. Že poznámka pre akcie, ktoré podporujú pravidlá je potrebné // Opt_eventName. // // Príklad: // var udalosti = . Require ( '') Event_bindings udalosti; // Chrome.tabs.onChanged = new Event ( "tab-zmenil") ; // Chrome.tabs.onChanged.addListener (function (dáta) {alert (dáta);}); // Event.dispatch ( "tab-zmenený", "hi"); // bude mať za následok dialógu upozornili, že hovorí "ahoj". // // Ak sa Opt_eventOptions existuje, je to slovník, ktorý obsahuje boolean // položky to "SupportsListeners" a "SupportsRules". // Ak existuje Opt_webViewInstanceId, to je celé číslo jednoznačne identifikujúce // z tagu v rámci prostriedky pre začlenenie. Nezáleží , ak existujú, potom sa jedná o udalosť predlžovací // skôr ako udalosti. Var EventImpl = function (Opt_eventName, Opt_argSchemas, Opt_eventOptions, Opt_webViewInstanceId) { This.eventName = Opt_eventName; This.argSchemas = Opt_argSchemas; This.listeners = [ ]; This.eventOptions = ParseEventOptions (Opt_eventOptions); This.webViewInstanceId = Opt_webViewInstanceId || 0; -Li {(This.eventName!) If (This.eventOptions.supportsRules) throw new na Error ( "Udalosti, ktoré podporujú vládne vyžadujú názov udalosti."); // Akcia bez mien nemôžu byť riadené vBulletin prehliadač podľa definície phpBB // (prehliadač nemá žiadnu možnosť ich identifikácie). This.eventOptions.unmanaged = true; } // sledovať, či udalosť bola zničená na pomoc návštevy vystopovať príčinu . // of Http://crbug.com/258526 // nakoniec premenná bude držať zásobníka stopu na zničiť hovoru. // TODO (Kalman): odstrániť a nahradiť to s viacerými zvukovou logikou, že úlovky do // prípade, že udalosti sú na of používa, bez toho by bol pripojené dojednania . * This.destroyed = null; if ( This.eventOptions.unmanaged) This.attachmentStrategy = new NullAttachmentStrategy (this); else if (This.eventOptions.supportsFilters) This.attachmentStrategy = new FilteredAttachmentStrategy (this); inde This.attachmentStrategy = new UnfilteredAttachmentStrategy (this); }; // callback je funkcia (args, expedície ). sú na args args sme 'som Príjem z // dispatchEvent (), a expedíciu je funkcia (args), ktorá odošle na args k // svojim poslucháčom. fungovať RegisterArgumentMassager (meno, spätné volanie) { if (EventArgumentMassagers [názov]) throw new na Error ( " už registrovaný pre masážny strojček na akciu: "+ názov); EventArgumentMassagers [name] = o spätné volanie; } // odošle pomenované udalosti s daným argumentu poľa. Args poľa je // zoznam argumentov, ktoré budú zaslané na akciu je spätné volanie. Funkcia dispatchEvent (názov, args, FilteringInfo) { var ListenerIDs = []; if (FilteringInfo) ListenerIDs = EventNatives.MatchAgainstEventFilter (meno, FilteringInfo); AttachedNamedEvents event = var [name], (! event), ak return; var DispatchArgs = function (args) { var result = Event.dispatch_ (args, ListenerIDs), if (výsledok) ! Logging.DCHECK (Result.validationErrors, výsledok. ValidationErrors); return výsledok; }; je -Li (EventArgumentMassagers [názov]) EventArgumentMassagers [name] (args, DispatchArgs); inde DispatchArgs (args); } // Registruje na spätné volanie byť Called kedy je odoslaná táto udalosť. EventImpl.prototype. = function addListener (cb, filtre) { (! This.eventOptions.supportsListeners), ak hodiť nový na chyby ( "táto udalosť nepodporuje poslucháča."), na if (This.eventOptions.maxListeners && This.getListenerCount_ ()> = toto. EventOptions.maxListeners) { throw new na Error ( "Príliš : veľa poslucháčov na" + This.eventName); } na if (filtre) { o if (TH!
































































































































































































يجري ترجمتها، يرجى الانتظار ..
 
لغات أخرى
دعم الترجمة أداة: الآيسلندية, الأذرية, الأردية, الأفريقانية, الألبانية, الألمانية, الأمهرية, الأوديا (الأوريا), الأوزبكية, الأوكرانية, الأويغورية, الأيرلندية, الإسبانية, الإستونية, الإنجليزية, الإندونيسية, الإيطالية, الإيغبو, الارمنية, الاسبرانتو, الاسكتلندية الغالية, الباسكية, الباشتوية, البرتغالية, البلغارية, البنجابية, البنغالية, البورمية, البوسنية, البولندية, البيلاروسية, التاميلية, التايلاندية, التتارية, التركمانية, التركية, التشيكية, التعرّف التلقائي على اللغة, التيلوجو, الجاليكية, الجاوية, الجورجية, الخؤوصا, الخميرية, الدانماركية, الروسية, الرومانية, الزولوية, الساموانية, الساندينيزية, السلوفاكية, السلوفينية, السندية, السنهالية, السواحيلية, السويدية, السيبيوانية, السيسوتو, الشونا, الصربية, الصومالية, الصينية, الطاجيكي, العبرية, العربية, الغوجراتية, الفارسية, الفرنسية, الفريزية, الفلبينية, الفنلندية, الفيتنامية, القطلونية, القيرغيزية, الكازاكي, الكانادا, الكردية, الكرواتية, الكشف التلقائي, الكورسيكي, الكورية, الكينيارواندية, اللاتفية, اللاتينية, اللاوو, اللغة الكريولية الهايتية, اللوكسمبورغية, الليتوانية, المالايالامية, المالطيّة, الماورية, المدغشقرية, المقدونية, الملايو, المنغولية, المهراتية, النرويجية, النيبالية, الهمونجية, الهندية, الهنغارية, الهوسا, الهولندية, الويلزية, اليورباية, اليونانية, الييدية, تشيتشوا, كلينجون, لغة هاواي, ياباني, لغة الترجمة.

Copyright ©2024 I Love Translation. All reserved.

E-mail: