Sinatra Multi Screen
Description
Sinatra Plugin for Multi-Screen Application.
Installation
This entry records only its repository, not the path inside it, so there is no
exact command to give. Open the source below and copy the folder into
~/.claude/skills/, or the file into ~/.claude/agents/.
README
sinatra-multi-screen
Sinatra Plugin for Multi-Screen Application.
Installation
% gem install sinatra-multi-screen
Requirements
- Ruby 1.8.7+ or 1.9.2+
- Sinatra 1.3.0+
- EventMachine
- jQuery
- sinatra-comeio
Usage
Sinatra Setup
require 'sinatra'
require 'sinatra/cometio'
require 'sinatra/multi_screen'
run Sinatra::Application
">
">
Remote --(dispatch UI Event)--> TV
Remote Side
var io = new CometIO().connect();
var screen = new MultiScreen(io, {type: "remote", channel: "1"});
var tv = screen.tv;
io.on("connect", function(session){
tv.$("#btn").click(); // dispatch CLICK event on TV Side
};
tv.on("ui_event", function(data){ // UI Event echo back from TV
alert(data.event+' was dispatched on TV-side '+data.selector);
});
TV Side
var io = new CometIO().connect();
var screen = new MultiScreen(io, {type: "tv", channel: "1"});
var remote = screen.remote;
$(function(){
$("#btn").click(function(e){ // regist click event
alert("hello!!");
});
});
TV --(push event)--> Remote
TV Side
remote.push("change_color", {color: #FF0000"}); // push "change_color" event to Remote
Remote Side
tv.on("change_color", function(data){ // regist "change_color" event
$("body").css("background-color", data.color);
});
Remote --(push event)--> TV
Remote Side
tv.push("mode", "fullscreen"); // push "mode" to TV
TV Side
remote.on("mode", function(data){
console.log(data);
});
Events on Server
Sinatra Side
MultiScreen.on :connect do |client|
puts "new client #{client.inspect}"
Related Skills
Awesome Go
A curated list of awesome Go frameworks, libraries and software
Development next.js
| The React Framework | 138360 | 1503 | 1 |
Development sharing-skills
skill for guidance.
Development root-cause-tracing
Use when errors occur deep in execution and you need to trace back to find the original trigger.
Development Template Skill
Minimal skeleton for a new skill project structure.
Development Third-party Notices
THE FOLLOWING SETS FORTH ATTRIBUTION NOTICES FOR THIRD PARTY SOFTWARE THAT MAY BE CONTAINED IN PORTIONS OF THI
Development