Skip to content
Snippets Groups Projects
Commit e5eff6a9 authored by Gabriel Engel's avatar Gabriel Engel
Browse files

Removed sample chatops package

parent 5d83bbdc
No related branches found
No related tags found
No related merge requests found
Showing
with 0 additions and 198 deletions
...@@ -140,7 +140,6 @@ rocketchat:version ...@@ -140,7 +140,6 @@ rocketchat:version
rocketchat:videobridge rocketchat:videobridge
rocketchat:webrtc rocketchat:webrtc
rocketchat:wordpress rocketchat:wordpress
#rocketchat:chatops
konecty:change-case konecty:change-case
konecty:delayed-task konecty:delayed-task
......
/* globals GoogleMaps */
Meteor.startup(function() {
console.log('startup hooked');
return GoogleMaps.load();
});
Meteor.startup(() =>
Tracker.autorun(function() {
if (RocketChat.TabBar) {
if (RocketChat.settings && RocketChat.settings.get('Chatops_Enabled')) {
RocketChat.TabBar.addButton({
groups: ['channel', 'group', 'direct'],
id: 'chatops-button2',
i18nTitle: 'rocketchat-chatops:Chatops_Title',
icon: 'hubot',
template: 'chatops-dynamicUI',
order: 4
});
RocketChat.TabBar.addButton({
groups: ['channel', 'group', 'direct'],
id: 'chatops-button3',
i18nTitle: 'rocketchat-chatops:Chatops_Title',
icon: 'inbox',
template: 'chatops_droneflight',
width: 675,
order: 5
});
} else {
RocketChat.TabBar.removeButton('chatops-button2');
RocketChat.TabBar.removeButton('chatops-button3');
}
}
})
);
<template name="chatops">
<div class="control">
<div class="header">
<h2>{{_ "Chatops_Title"}}</h2>
</div>
</div>
{{_ "Loading..."}}
</template>
Template.chatops.helpers;
<template name="chatops_codemirror">
<div class="control">
<button class="more"><span class="icon-code" title="{{#if flex3Opened}}{{_ 'Close'}}{{/if}}"></span></button>
<form class="search-form" role="form">
<div class="input-line search">
<input type="text" id="room-search" class="search" placeholder="{{tQuickSearch}}" autocomplete="off" />
<i class="icon-search secondary-font-color"></i>
</div>
</form>
</div>
<div class="content">
{{> CodeMirror id="flyineditor" name="flyineditor" options=editorOptions code=editorCode }}
<div class="codeEditor">
<button class='button'><span> {{_ "Save"}}</span></button>
<button class='button'><span> {{_ "Commit"}}</span></button>
<button class='button'><span> {{_ "Cancel"}}</span></button>
</div>
</div>
</template>
Template.chatops_codemirror.helpers({
editorOptions() {
return {lineNumbers: true, mode:'javascript'};
},
editorCode() {
return '# This is a full featured, syntax highlighted editor\n# BOTs can fetch, edit, commit, and save source code\n#\n\nvar express = require("express");\nvar app = express();\n// respond with \"hello world\" when a GET request is made to the homepage \ +\napp.get("/", function(req, res) {\nres.send("hello world");\n});';
}
});
<template name="chatops_droneflight">
<div class="control">
<div> <b>Drone 1:</b> mission <b>A3</b> waypoint <b>7</b> <span class="red">fuel 30%</span> </div>
<div> <b>Drone 2:</b> mission <b>A7</b> waypoint <b>2</b> <span class="green">fuel 100%</span> </div>
</div>
<div class="content">
<div class="map-container">
{{> googleMap name="flightMap" options=flightMapOptions }}
</div>
<div class="droneFlight">
<button class='button'><span> {{_ "Return to base"}}</span></button>
<button class='button'><span> {{_ "Cancel"}}</span></button>
</div>
</div>
</template>
/* globals GoogleMaps google*/
Template.chatops_droneflight.helpers({
flightMapOptions() {
if (GoogleMaps.loaded()) {
console.log('helper run');
return {center: new google.maps.LatLng(35.6609285, -78.8456125), zoom: 17};
}
}
});
Template.chatops_droneflight.onCreated(() =>
GoogleMaps.ready('flightMap', function(map) {
console.log('ready');
const redicon = { path: google.maps.SymbolPath.CIRCLE, fillColor: 'red', fillOpacity: 0.8, strokeColor: 'gold', strokeWeight: 2, scale: 10};
const greenicon = {path: google.maps.SymbolPath.CIRCLE, fillColor: 'green', fillOpacity: 0.8, strokeColor: 'gold', strokeWeight: 2, scale: 10};
const marker = new google.maps.Marker({position: new google.maps.LatLng(35.661848, -78.843165), icon: redicon, map: map.instance});
marker.setLabel('1');
const marker2 = new google.maps.Marker({position: new google.maps.LatLng(35.660537, -78.846959), icon: greenicon, map: map.instance});
return marker2.setLabel('2');
})
);
<template name="chatops-dynamicUI">
<div class="control">
<h3>Bot Controlled UI</h3>
<div>
UI is dynamically generated based on DSL message from BOT. DSL also specifies command sent back.
</div>
</div>
<div class="control">
<div class="botgen" style="margin-bottom: 10px;">
<input type="text" id="gistbutton" class="search" placeholder="Gist Id or Url" autocomplete="off" />
</div>
<div class="botgen" style="margin-bottom: 10px;">
<button class='button'><span> {{_ "Get Gist"}}</span></button>
</div>
<div class="botgen" style="margin-bottom: 10px;">
<button class='button'><span> {{_ "Show history"}}</span></button>
</div>
<div class="botgen" style="margin-bottom: 10px;">
<button class='button'><span> {{_ "Blame"}}</span></button>
</div>
</div>
</template>
.map-container {
width: 670px;
max-width: 100%;
height: 500px;
padding: 5px;
}
.red {
color: red;
}
.green {
color: green;
}
Package.describe({
name: 'rocketchat:chatops',
version: '0.0.1',
summary: 'Chatops Panel',
git: ''
});
Package.onUse(function(api) {
api.use([
'ecmascript',
'rocketchat:lib',
'dburles:google-maps@1.1.5'
]);
api.use('templating', 'client');
api.addFiles([
'client/startup.js',
'client/tabBar.js',
'client/views/chatops.html',
'client/views/chatops.js',
'client/views/codemirror.html',
'client/views/codemirror.js',
'client/views/droneflight.html',
'client/views/droneflight.js',
'client/views/dynamicUI.html',
'client/views/stylesheets/chatops.css'
], 'client');
api.addFiles([
'server/settings.js'
], 'server');
});
Meteor.startup(function() {
RocketChat.settings.addGroup('Chatops');
RocketChat.settings.add('Chatops_Enabled', false, { type: 'boolean', group: 'Chatops', public: true });
return RocketChat.settings.add('Chatops_Username', false, { type: 'string', group: 'Chatops', public: true });
});
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment