mirror of
https://github.com/Codeux-Software/Textual.git
synced 2026-06-16 13:24:32 +00:00
Core JavaScript improvements
Almost the entire core.js file has been rewritten to provide greater documentation. app.channelIsJoined() has been deprecated in favor of app.channelIsActive(). app.channelIsActive() will return a value for a regular channel or private message, so it makes more sense to use "active" over "joined" Why don't I add app.privateMessageIsActive() instead? Because app.channelIsActive() can kill two birds with one stone. app.channelMemberCount() now throws a JavaScript exception when used outside a channel.
This commit is contained in:
@@ -370,19 +370,26 @@ app.serverIsConnected = function(callbackFunction)
|
||||
}
|
||||
};
|
||||
|
||||
app.channelIsJoined = function(callbackFunction)
|
||||
app.channelIsActive = function(callbackFunction)
|
||||
{
|
||||
var promiseIndex = appInternal.makePromise(callbackFunction);
|
||||
|
||||
var dataValue = {"promiseIndex" : promiseIndex};
|
||||
|
||||
if (app.isWebKit2()) {
|
||||
window.webkit.messageHandlers.channelIsJoined.postMessage(dataValue);
|
||||
window.webkit.messageHandlers.channelIsActive.postMessage(dataValue);
|
||||
} else {
|
||||
TextualScriptSink.channelIsJoined(dataValue);
|
||||
TextualScriptSink.channelIsActive(dataValue);
|
||||
}
|
||||
};
|
||||
|
||||
app.channelIsJoined = function(callbackFunction)
|
||||
{
|
||||
console.warn("app.channelIsJoined() is deprecated. Use app.channelIsActive() instead.");
|
||||
|
||||
app.channelIsActive(callbackFunction);
|
||||
};
|
||||
|
||||
app.channelName = function(callbackFunction)
|
||||
{
|
||||
var promiseIndex = appInternal.makePromise(callbackFunction);
|
||||
|
||||
Reference in New Issue
Block a user