view release on metacpan or search on metacpan
lib/Alice/HTTP/WebSocket.pm view on Meta::CPAN
my ($handle, @args) = @_;
Protocol::WebSocket::Frame->new(
version => $handle->{ws_version},
buffer => (join "", @args),
)->to_bytes;
}
sub anyevent_read_type {
my ($handle, $cb) = @_;
$handle->{ws_frame} ||= Protocol::WebSocket::Frame->new(
version => $handle->{ws_version}
);
return sub {
my $frame = $_[0]->{ws_frame};
$frame->append(delete $_[0]{rbuf});
while (defined(my $message = $frame->next)) {
if ($frame->is_close) {
$_[0]->push_write(
Protocol::WebSocket::Frame->new(
type => 'close',
version => $_[0]->{ws_version},
)
);
return;
}
elsif ($frame->is_ping) {
$_[0]->push_write(
Protocol::WebSocket::Frame->new(
type => 'ping',
version => $_[0]->{ws_version},
)
);
return;
}
$cb->($_[0], $message);
share/static/alice-dark.css view on Meta::CPAN
letter-spacing: 0;
border-right: 1px solid #aaa;
border-bottom: 1px solid #aaa; }
sup.external a:hover {
background-color: #D1D3D3; }
sup.external a:after {
content: " â¸"; }
div.oembed iframe {
min-height: 250px;
font-size: 0.8em;
border: none;
margin: 0;
padding: 0; }
li.message div.msg > span {
white-space: pre-wrap; }
li.fold + li div.msg {
share/static/alice-default.css view on Meta::CPAN
letter-spacing: 0;
border-right: 1px solid #aaa;
border-bottom: 1px solid #aaa; }
sup.external a:hover {
background-color: #D1D3D3; }
sup.external a:after {
content: " â¸"; }
div.oembed iframe {
min-height: 250px;
font-size: 0.8em;
border: none;
margin: 0;
padding: 0; }
li.message div.msg > span {
white-space: pre-wrap; }
li.fold + li div.msg {
share/static/alice-solarized.css view on Meta::CPAN
letter-spacing: 0;
border-right: 1px solid #aaa;
border-bottom: 1px solid #aaa; }
sup.external a:hover {
background-color: #D1D3D3; }
sup.external a:after {
content: " â¸"; }
div.oembed iframe {
min-height: 250px;
font-size: 0.8em;
border: none;
margin: 0;
padding: 0; }
li.message div.msg > span {
white-space: pre-wrap; }
li.fold + li div.msg {
share/static/alice.js view on Meta::CPAN
/* Prototype JavaScript framework, version 1.7
* (c) 2005-2010 Sam Stephenson
*
* Prototype is freely distributable under the terms of an MIT-style license.
* For details, see the Prototype web site: http://www.prototypejs.org/
*
*--------------------------------------------------------------------------*/
var Prototype = {
Version: '1.7',
share/static/alice.js view on Meta::CPAN
style: function(element, value) {
element.style.cssText = value ? value : '';
}
}
};
Element._attributeTranslations.has = {};
$w('colSpan rowSpan vAlign dateTime accessKey tabIndex ' +
'encType maxLength readOnly longDesc frameBorder').each(function(attr) {
Element._attributeTranslations.write.names[attr.toLowerCase()] = attr;
Element._attributeTranslations.has[attr.toLowerCase()] = attr;
});
(function(v) {
Object.extend(v, {
href: v._getAttr2,
src: v._getAttr2,
type: v._getAttr,
action: v._getAttrNode,
share/static/alice.js view on Meta::CPAN
if (timePos >= this.startOn) {
if (timePos >= this.finishOn) {
this.render(1.0);
this.cancel();
this.event('beforeFinish');
if (this.finish) this.finish();
this.event('afterFinish');
return;
}
var pos = (timePos - this.startOn) / this.totalTime,
frame = (pos * this.totalFrames).round();
if (frame > this.currentFrame) {
this.render(pos);
this.currentFrame = frame;
}
}
},
cancel: function() {
if (!this.options.sync)
Effect.Queues.get(Object.isString(this.options.queue) ?
'global' : this.options.queue.scope).remove(this);
this.state = 'finished';
},
event: function(eventName) {
share/static/alice.js view on Meta::CPAN
p = m[5] ? str_repeat(c, x) : '';
o.push(s + (m[4] ? a + p : p + a));
}
else {
throw('Huh ?!');
}
f = f.substring(m[0].length);
}
return o.join('');
}
/* WysiHat - WYSIWYG JavaScript framework, version 0.2.1
* (c) 2008-2010 Joshua Peek
*
* WysiHat is freely distributable under the terms of an MIT-style license.
*--------------------------------------------------------------------------*/
var WysiHat = {};
WysiHat.Editor = {
attach: function(textarea) {
var editArea;
share/static/alice.js view on Meta::CPAN
Object.extend(editArea, WysiHat.Commands);
textarea.insert({before: editArea});
textarea.hide();
return editArea;
}
};
WysiHat.BrowserFeatures = (function() {
function createTmpIframe(callback) {
var frame, frameDocument;
frame = new Element('iframe');
frame.setStyle({
position: 'absolute',
left: '-1000px'
});
frame.onFrameLoaded(function() {
if (typeof frame.contentDocument !== 'undefined') {
frameDocument = frame.contentDocument;
} else if (typeof frame.contentWindow !== 'undefined' && typeof frame.contentWindow.document !== 'undefined') {
frameDocument = frame.contentWindow.document;
}
frameDocument.designMode = 'on';
callback(frameDocument);
frame.remove();
});
$(document.body).insert(frame);
}
var features = {};
function detectParagraphType(document) {
document.body.innerHTML = '';
document.execCommand('insertparagraph', false, null);
var tagName;
element = document.body.childNodes[0];
share/static/alice.js view on Meta::CPAN
var tagName;
element = document.body.childNodes[0];
if (element && element.tagName)
tagName = element.tagName.toLowerCase();
features.indentInsertsBlockquote = (tagName == 'blockquote');
}
features.run = function run() {
if (features.finished) return;
createTmpIframe(function(document) {
detectParagraphType(document);
detectIndentType(document);
features.finished = true;
});
}
return features;
})();
/* IE Selection and Range classes
share/static/alice.js view on Meta::CPAN
element = $(element);
var loaded, contentLoadedHandler;
loaded = false;
function fireFrameLoaded() {
if (loaded) return;
loaded = true;
if (contentLoadedHandler) contentLoadedHandler.stop();
element.fire('frame:loaded');
}
if (window.addEventListener) {
contentLoadedHandler = document.on("DOMFrameContentLoaded", function(event) {
if (element == event.element())
fireFrameLoaded();
});
}
element.on('load', function() {
var frameDocument;
if (typeof element.contentDocument !== 'undefined') {
frameDocument = element.contentDocument;
} else if (typeof element.contentWindow !== 'undefined' && typeof element.contentWindow.document !== 'undefined') {
frameDocument = element.contentWindow.document;
}
onReadyStateComplete(frameDocument, fireFrameLoaded);
});
return element;
}
function onFrameLoaded(element, callback) {
element.on('frame:loaded', callback);
element.observeFrameContentLoaded();
}
Element.addMethods({
observeFrameContentLoaded: observeFrameContentLoaded,
onFrameLoaded: onFrameLoaded
});
})();
document.on("dom:loaded", function() {
if ('selection' in document && 'onselectionchange' in document) {