Skip to content

Commit

Permalink
Merge pull request #802 from RocketChat/rename-external
Browse files Browse the repository at this point in the history
Rename external
  • Loading branch information
engelgabriel committed Sep 14, 2015
2 parents 2ddbb0b + 22b4763 commit 21621cb
Show file tree
Hide file tree
Showing 46 changed files with 51 additions and 50 deletions.
2 changes: 1 addition & 1 deletion .meteor/packages
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ rocketchat:slashcommands-join
rocketchat:slashcommands-leave
rocketchat:statistics
rocketchat:webrtc
#rocketchat:external
#rocketchat:livechat
#rocketchat:hubot
#rocketchat:irc

Expand Down
4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@ before_install:
- "curl https://install.meteor.com | /bin/sh"

script:
- meteor add rocketchat:external
- meteor add rocketchat:livechat
- meteor add rocketchat:hubot
- meteor build --server demo.rocket.chat ./
- meteor build --server demo.rocket.chat ./
2 changes: 1 addition & 1 deletion build.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/bash
source ./build-info.sh
export METEOR_SETTINGS=$(cat settings.json)
meteor add rocketchat:external
meteor add rocketchat:livechat
meteor add rocketchat:hubot
meteor build --server https://demo.rocket.chat --directory /var/www/rocket.chat
cd /var/www/rocket.chat/bundle/programs/server
Expand Down

This file was deleted.

16 changes: 0 additions & 16 deletions packages/rocketchat-external/plugin/build.sh

This file was deleted.

1 change: 1 addition & 0 deletions packages/rocketchat-lib/server/sendMessage.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ RocketChat.sendMessage = (user, message, room, options) ->
Meteor.defer ->

if not room.t? or room.t is 'd'

###
Update the other subscriptions
###
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ class @ChatMessages
else
#Run to allow local encryption
# Meteor.call 'onClientBeforeSendMessage', {}
Meteor.call 'sendMessageExternal', msgObject, (error, result) ->
Meteor.call 'sendMessageLivechat', msgObject, (error, result) ->
if error
ChatMessage.update msgObject._id, { $set: { error: true } }
showError error.reason
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Meteor.methods
sendMessageExternal: (message) ->
sendMessageLivechat: (message) ->
if s.trim(message.msg) isnt ''

message.ts = new Date(Date.now() + TimeSync.serverOffset())
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FlowRouter.route '/external',
FlowRouter.route '/livechat',
name: 'index'

triggersEnter: [
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
@visitorId = new ReactiveVar null

Meteor.startup ->
if not localStorage.getItem('rocketChatLivechat')?
localStorage.setItem('rocketChatLivechat', Random.id())

visitorId.set localStorage.getItem('rocketChatLivechat')
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ input:focus {
box-shadow: 0 0 0;
}

.external-room {
.livechat-room {
position: fixed;
top: 0;
bottom: 0;
Expand Down Expand Up @@ -321,7 +321,7 @@ input:focus {
}

@media all and(max-height: 200px) {
.external-room {
.livechat-room {
.title {
height: 100%;
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<template name="room">
<div class="external-room">
<div class="livechat-room">
<div class="title">
<h1>Rocket.Chat</h1>
</div>
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
WebApp = Package.webapp.WebApp
Autoupdate = Package.autoupdate.Autoupdate

WebApp.connectHandlers.use '/external/', (req, res, next) ->
WebApp.connectHandlers.use '/livechat/', (req, res, next) ->
res.setHeader 'content-type', 'html'

head = Assets.getText('public/head.html')

html = """
<html>
<head>
<link rel="stylesheet" type="text/css" class="__meteor-css__" href="/packages/rocketchat_external/public/external.css?_dc=#{Autoupdate.autoupdateVersion}">
<link rel="stylesheet" type="text/css" class="__meteor-css__" href="/packages/rocketchat_livechat/public/livechat.css?_dc=#{Autoupdate.autoupdateVersion}">
<script type="text/javascript">
__meteor_runtime_config__ = {
"meteorRelease": "METEOR@1.1.0.2",
Expand All @@ -20,7 +20,7 @@ WebApp.connectHandlers.use '/external/', (req, res, next) ->
"autoupdateVersionCordova": "#{Autoupdate.autoupdateVersionCordova}"
};
</script>
<script type="text/javascript" src="/packages/rocketchat_external/public/external.js?_dc=#{Autoupdate.autoupdateVersion}"></script>
<script type="text/javascript" src="/packages/rocketchat_livechat/public/livechat.js?_dc=#{Autoupdate.autoupdateVersion}"></script>
#{head}
</head>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ Meteor.methods
pass: pass
}

sendMessageExternal: (message) ->
console.log 'sendMessageExternal ->',arguments
sendMessageLivechat: (message) ->
console.log 'sendMessageLivechat ->',arguments

check message.rid, String
check message.token, String
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
Package.describe({
name: 'rocketchat:external',
name: 'rocketchat:livechat',
version: '0.0.1',
summary: 'External for Rocket.Chat'
summary: 'Livechat plugin for Rocket.Chat'
});

Package.registerBuildPlugin({
name: "builExternal",
name: "builLivechat",
use: [],
sources: [
'plugin/build-external.js'
'plugin/build-livechat.js'
],
npmDependencies: {
"shelljs": "0.5.1"
Expand All @@ -20,12 +20,12 @@ Package.onUse(function(api) {

api.use(['coffeescript', 'webapp', 'autoupdate'], 'server');

api.addFiles('external.coffee', 'server');
api.addFiles('livechat.coffee', 'server');
api.addFiles('methods.coffee', 'server');
api.addFiles('publications.coffee', 'server');

api.addFiles('rocket-external.js', 'client', {isAsset: true});
api.addFiles('public/external.css', 'client', {isAsset: true});
api.addFiles('public/external.js', 'client', {isAsset: true});
api.addFiles('rocket-livechat.js', 'client', {isAsset: true});
api.addFiles('public/livechat.css', 'client', {isAsset: true});
api.addFiles('public/livechat.js', 'client', {isAsset: true});
api.addFiles('public/head.html', 'server', {isAsset: true});
});
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ var path = Npm.require('path');
var shell = Npm.require('shelljs');

var curPath = path.resolve('.')
var packagePath = path.join(path.resolve('.'), 'packages', 'rocketchat-external');
var packagePath = path.join(path.resolve('.'), 'packages', 'rocketchat-livechat');
var pluginPath = path.join(packagePath, 'plugin');

shell.exec('sh '+pluginPath+'/build.sh');
shell.exec('sh '+pluginPath+'/build.sh');
16 changes: 16 additions & 0 deletions packages/rocketchat-livechat/plugin/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
cd packages/rocketchat-livechat/app
meteor build .meteor/build/ --directory

mkdir -p ../public

rm -f ../public/livechat.css
rm -f ../public/livechat.js
rm -f ../public/head.html

cp .meteor/build/bundle/programs/web.browser/*.css ../public/livechat.css
cp .meteor/build/bundle/programs/web.browser/*.js ../public/livechat.js
cp .meteor/build/bundle/programs/web.browser/head.html ../public/head.html

# echo "body {background-color: red;}" > livechat.css

rm -rf .meteor/build/
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
// var h = d.getElementsByTagName(s)[0],
// j = d.createElement(s);
// j.async = true;
// j.src = 'rocket-external.js';
// j.src = 'rocket-livechat.js';
// h.parentNode.insertBefore(j, h);
// })(window, document, 'script', 'initRocket', 'http://localhost:5000/external');
// })(window, document, 'script', 'initRocket', 'http://localhost:5000/livechat');
// </script>

;(function(w) {
Expand Down

0 comments on commit 21621cb

Please sign in to comment.