-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
0fb02a1
commit c60f82c
Showing
6 changed files
with
62 additions
and
49 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,12 @@ | ||
{ | ||
"name": "dueljs", | ||
"name": "duel", | ||
"version": "1.0.0", | ||
"homepage": "http://dueljs.studentivan.ru", | ||
"authors": [ | ||
"Maslov Ivan <[email protected]>" | ||
], | ||
"description": "JavaScript HTML5 Master/Slave Browser Tabs Helper", | ||
"main": "lib/duel.js", | ||
"main": "public/lib/duel.js", | ||
"keywords": [ | ||
"dueljs", | ||
"duel", | ||
|
@@ -15,7 +15,8 @@ | |
"window", | ||
"javascript", | ||
"onfocus", | ||
"broadcasting" | ||
"broadcasting", | ||
"document.hidden" | ||
], | ||
"license": "MIT", | ||
"ignore": [ | ||
|
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,14 @@ | ||
{ | ||
"name": "dueljs", | ||
"name": "duel", | ||
"version": "1.0.0", | ||
"description": "DuelJS - JavaScript HTML5 Master/Slave Browser Tabs Helper", | ||
"main": "lib/duel.js", | ||
"main": "public/lib/duel.js", | ||
"devDependencies": { | ||
|
||
"http-server": "^0.6.1" | ||
}, | ||
"scripts": { | ||
"test": "test" | ||
"pretest": "npm install", | ||
"test": "http-server -a localhost -p 8624 -o -c-1" | ||
}, | ||
"repository": { | ||
"type": "git", | ||
|
@@ -21,7 +22,8 @@ | |
"window", | ||
"javascript", | ||
"onfocus", | ||
"broadcasting" | ||
"broadcasting", | ||
"document.hidden" | ||
], | ||
"author": "Maslov Ivan <[email protected]>", | ||
"license": "MIT", | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
<!doctype html> | ||
<html> | ||
<head> | ||
<meta charset="utf-8"> | ||
<title>Duel page</title> | ||
<meta name="viewport" content="width=device-width, initial-scale=1"> | ||
<link rel="stylesheet" href="//yastatic.net/bootstrap/3.3.1/css/bootstrap.min.css"> | ||
<script type="text/javascript" src="lib/duel.min.js"></script> | ||
</head> | ||
<body> | ||
<div class="container-fluid"> | ||
<h2>Window <small id="wndID">...</small></h2> | ||
<div><a class="btn btn-default" href="index.html" target="_blank">Open new window</a> | ||
<button class="btn btn-default" onclick="channel.broadcast('demo_trigger', 'ya', duel.getWindowID())"> | ||
channel.broadcast('demo_trigger', 'ya', duel.getWindowID()) | ||
</button></div> | ||
<div style="margin-top: 10px; color: #777777"><em> | ||
Hint: open the developer console before broadcasting. | ||
</em></div> | ||
</div> | ||
<script type="text/javascript"> | ||
var channel = duel.channel('test'); | ||
document.title = 'Master ' + duel.getWindowID(); | ||
document.getElementById('wndID').innerHTML = (duel.getWindowID()).toString(); | ||
|
||
channel.on('demo_trigger', function (message, wndID) { | ||
console.info(wndID, (new Date), message); | ||
}); | ||
|
||
setInterval(function () { | ||
document.title = (window.isMaster() ? 'Master ' : 'Slave ') + duel.getWindowID(); | ||
}, 100); | ||
</script> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.