Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

attempt to make changes to use the emote effects from the updated emotes package #1

Open
wants to merge 17 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
17 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 35 additions & 0 deletions docs/app-bundle.js

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions docs/app-bundle.js.map

Large diffs are not rendered by default.

5 changes: 5 additions & 0 deletions docs/bootstrap-theme.min.css

Large diffs are not rendered by default.

5 changes: 5 additions & 0 deletions docs/bootstrap.min.css

Large diffs are not rendered by default.

Binary file added docs/favicon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/fonts/glyphicons-halflings-regular.eot
Binary file not shown.
229 changes: 229 additions & 0 deletions docs/fonts/glyphicons-halflings-regular.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/fonts/glyphicons-halflings-regular.ttf
Binary file not shown.
Binary file added docs/fonts/glyphicons-halflings-regular.woff
Binary file not shown.
16 changes: 16 additions & 0 deletions docs/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<!DOCTYPE html>
<html>
<head>
<meta charset='utf-8'>
<meta http-equiv='X-UA-Compatible' content='IE=edge,chrome=1'>
<title>BerryTube</title>
<meta name='description' content=''>
<meta name='viewport' content='user-scalable=no width=device-width, initial-scale=1.0 maximum-scale=1.0'>
<link rel="stylesheet" href="https://fonts.googleapis.com/icon?family=Material+Icons">
</head>
<body>
<div id="app"></div>
<script src="native.js"></script>
<script src="app-bundle.js"></script>
</body>
</html>
Empty file added docs/main.css
Empty file.
196 changes: 196 additions & 0 deletions docs/main.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,196 @@
var app = require('app'); // Module to control application life.
var BrowserWindow = require('browser-window'); // Module to create native browser window.
var shell = require('shell');
var Menu = require('menu');



// Report crashes to our server.
require('crash-reporter').start();

// Keep a global reference of the window object, if you don't, the window will
// be closed automatically when the javascript object is GCed.
var mainWindow, tcWindow = null;

// Quit when all windows are closed.
app.on('window-all-closed', function() {
app.quit();
});

// This method will be called when atom-shell has done everything
// initialization and ready for creating browser windows.
app.on('ready', function() {
var template = [{
label: 'BerryTube',
submenu: [
{
label: 'About BerryTube',
selector: 'orderFrontStandardAboutPanel:'
},
{
type: 'separator'
},
{
label: 'Services',
submenu: []
},
{
type: 'separator'
},
{
label: 'Hide Atom Shell',
accelerator: 'Command+H',
selector: 'hide:'
},
{
label: 'Hide Others',
accelerator: 'Command+Shift+H',
selector: 'hideOtherApplications:'
},
{
label: 'Show All',
selector: 'unhideAllApplications:'
},
{
type: 'separator'
},
{
label: 'Quit',
accelerator: 'Command+Q',
click: function() { app.quit(); }
},
]
},
{
label: 'Edit',
submenu: [
{
label: 'Undo',
accelerator: 'Command+Z',
selector: 'undo:'
},
{
label: 'Redo',
accelerator: 'Shift+Command+Z',
selector: 'redo:'
},
{
type: 'separator'
},
{
label: 'Cut',
accelerator: 'Command+X',
selector: 'cut:'
},
{
label: 'Copy',
accelerator: 'Command+C',
selector: 'copy:'
},
{
label: 'Paste',
accelerator: 'Command+V',
selector: 'paste:'
},
{
label: 'Select All',
accelerator: 'Command+A',
selector: 'selectAll:'
},
]
},
{
label: 'View',
submenu: [
{
label: 'Reload',
accelerator: 'Command+R',
click: function() { BrowserWindow.getFocusedWindow().reloadIgnoringCache(); }
},
{
label: 'Toggle DevTools',
accelerator: 'Alt+Command+I',
click: function() { BrowserWindow.getFocusedWindow().toggleDevTools(); }
},
]
},
{
label: 'Window',
submenu: [
{
label: 'Minimize',
accelerator: 'Command+M',
selector: 'performMiniaturize:'
},
{
label: 'Close',
accelerator: 'Command+W',
selector: 'performClose:'
}
]
}];

var menu = Menu.buildFromTemplate(template);

Menu.setApplicationMenu(menu); // Must be called within app.on('ready', function(){ ... });


// Create the browser window.
mainWindow = new BrowserWindow({
width: 960,
height: 800,
center: true,
frame: false,
"auto-hide-menu-bar": true
});

mainWindow.webContents.on('new-window', function(e, url) {
console.log("NEW WINDOW", e, url)
e.preventDefault();
shell.openExternal(url);
});

// and load the index.html of the app.
mainWindow.loadUrl('file://' + __dirname + '/index.html');
// mainWindow.loadUrl("http://localhost:8080/");
// mainWindow.loadUrl("http://bt-desktop.cidersqueezy.com/");


mainWindow.on('blur', function(e) {
mainWindow.webContents.send('blur');
});

mainWindow.on('focus', function(e) {
mainWindow.webContents.send('focus');
});

// Emitted when the window is closed.
mainWindow.on('closed', function() {
// Dereference the window object, usually you would store windows
// in an array if your app supports multi windows, this is the time
// when you should delete the corresponding element.
mainWindow = null;
});


// tcWindow = new BrowserWindow({
// width: 960,
// height: 590,
// 'web-preferences':{
// 'plugins': true
// },
// frame: false,
// "auto-hide-menu-bar": true
// });
// tcWindow.webContents.on('new-window', function(e, url) {
// e.preventDefault();
// });
// tcWindow.webContents.on('did-finish-load', function(e, url) {
// tcWindow.webContents.insertCSS("#left_block, html, body, #tinychat, #tinychat_sub, #wrapper, #page, #container, #room, #chat {width: 100% !important; height: 100% !important; box-sizing: border-box; margin: 0; padding: 0 !important;} #iframe_ad, #header, #room_header, #share-bar, #footer {display: none;} body {width: calc(100% + 282px) !important; overflow: hidden; left: -8px; position: relative; top: -12px; height: calc(100% + 93px) !important; } body:after {content: ''; position: absolute; top: 0; left: 240px; height: 54px; width: calc(100% - 576px); -webkit-app-region: drag; cursor: move;}");
// });
// tcWindow.loadUrl("http://tinychat.com/berrytube");
// tcWindow.on('closed', function() {
// tcWindow = null;
// });

});
25 changes: 25 additions & 0 deletions docs/native.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
if(window.require) {
window.ipc = require("ipc")
window.nativeApp = require("remote").require("app")
var spellchecker = require("remote").require("spellchecker")

require("web-frame").setSpellCheckProvider("en-US", false, {
spellCheck: function(text) {
console.log("Spellcheck", text)
return !spellchecker.isMisspelled(text)
}
})

// var remote = require('remote');
// var Menu = remote.require('menu');
// var MenuItem = remote.require('menu-item');

// var menu = new Menu();

// window.addEventListener('contextmenu', function (e) {
// e.preventDefault();
// menu.popup(remote.getCurrentWindow());
// }, false);
//
//
}
71 changes: 71 additions & 0 deletions docs/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
{
"name": "coffee-react-quickstart",
"description": "Quickstart for creating React.js web applications",
"version": "0.0.1",
"author": "Kyle Mathews <[email protected]>",
"bugs": "https://github.com/KyleAMathews/coffee-react-quickstart/issues",
"dependencies": {
"apng-canvas": "git+https://[email protected]/CiderSqueezy/apng-canvas.git",
"babel-core": "^5.8.29",
"babel-loader": "^5.3.2",
"cjsx-loader": "^1.3.1",
"classnames": "^2.2.0",
"coffee-loader": "^0.7.2",
"coffee-react-transform": "^2.4.1",
"coffee-script": "^1.9.3",
"css-loader": "^0.9.0",
"emotes": "git+https://github.com/jamesmanning/emotes.git",
"eslint": "^1.7.3",
"event-emitter": "^0.3.4",
"express": "^4.12.4",
"gulp": "^3.9.0",
"gulp-compass": "^2.1.0",
"gulp-load-plugins": "^0.8.1",
"gulp-rename": "^1.2.2",
"gulp-shell": "^0.2.11",
"gulp-size": "^1.2.3",
"gulp-util": "^3.0.6",
"highlight.js": "^8.6.0",
"jquery": "^2.1.4",
"map-stream": "0.0.5",
"node-libs-browser": "~0.5.2",
"node-sass": "^3.0.0",
"react": "^0.14.1",
"react-dom": "^0.14.1",
"react-hot-loader": "^1.3.0",
"react-timeago": "^2.2.1",
"sass-loader": "^1.0.0",
"socket.io-client": "~0.9.10",
"spellchecker": "^3.1.3",
"striptags": "^2.0.4",
"style-loader": "^0.8.2",
"superagent": "^1.4.0",
"superagent-jsonp": "0.0.6",
"touch": "0.0.3",
"underscore": "~1.7.0",
"webpack": "~1.10.1",
"webpack-dev-server": "~1.10.1"
},
"homepage": "https://github.com/KyleAMathews/coffee-react-quickstart",
"keywords": [
"react",
"react-tools",
"quickstart",
"coffeescript",
"cjsx"
],
"license": "MIT",
"main": "main.js",
"repository": "[email protected]:KyleAMathews/coffee-react-quickstart.git",
"scripts": {
"start": "./node_modules/.bin/gulp watch",
"build": "./node_modules/.bin/gulp build",
"test": "jest"
},
"devDependencies": {
"electron-prebuilt": "~0.34.3",
"electron-rebuild": "~1.0.1",
"eslint-plugin-react": "^3.6.3",
"gulp-atom-shell": "~0.10.0"
}
}
Binary file added docs/sounds/drink.wav
Binary file not shown.
Binary file added docs/sounds/notify.wav
Binary file not shown.
Binary file added docs/sounds/ohmy.wav
Binary file not shown.
33 changes: 33 additions & 0 deletions docs/squeezychat-bundle.js

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions docs/squeezychat-bundle.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,12 @@
"jquery": "^2.1.4",
"map-stream": "0.0.5",
"node-libs-browser": "~0.5.2",
"node-sass": "^2.0.1",
"node-sass": "^3.0.0",
"react": "^0.14.1",
"react-dom": "^0.14.1",
"react-hot-loader": "^1.3.0",
"react-timeago": "^2.2.1",
"sass-loader": "^0.4.2",
"sass-loader": "^1.0.0",
"socket.io-client": "~0.9.10",
"spellchecker": "^3.1.3",
"striptags": "^2.0.4",
Expand Down
22 changes: 22 additions & 0 deletions src/scripts/berrymotes.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,11 @@ let Bem = ee({
}
})
map = new EmoteMap(rawEmotes)
this.map = map
this.emit("update")
})
},
map,
applyEmotesToStr: function(str){ return str},
findEmote: function(emoteId){
return map && map.findEmote(emoteId)
Expand Down Expand Up @@ -157,4 +159,24 @@ let Bem = ee({

Bem.dataRefresh()

// copied from http://berrymotes.com/berrymotes.berrytube.js?_=1451435285149
// included to support -invert and -i emote flags
if (document.body.style.webkitFilter !== undefined) {
const invertScript = document.createElement('script');
invertScript.type = 'text/javascript';
invertScript.src = 'http://berrymotes.com/assets/berrymotes.webkit.invert.js';
document.body.appendChild(invertScript);
} else {
const invertScript = document.createElement('script');
invertScript.type = 'text/javascript';
invertScript.src = 'http://berrymotes.com/assets/berrymotes.invertfilter.js';
document.body.appendChild(invertScript);
}

const berrymoteCoreCss = document.createElement('link')
berrymoteCoreCss.setAttribute('rel', 'stylesheet')
berrymoteCoreCss.setAttribute('type', 'text/css')
berrymoteCoreCss.setAttribute('href', 'http://berrymotes.com/assets/berrymotes.core.css')
document.getElementsByTagName("head")[0].appendChild(berrymoteCoreCss)

module.exports = Bem
Loading