Skip to content
Snippets Groups Projects
Commit 29268149 authored by Aaron Ogle's avatar Aaron Ogle
Browse files

Moved chatops panels over from old style

parent 886544b2
No related branches found
No related tags found
No related merge requests found
......@@ -87,3 +87,4 @@ underscorestring:underscore.string
yasaricli:slugify
yasinuslu:blaze-meta
rocketchat:authorization
perak:codemirror
......@@ -88,6 +88,7 @@ observe-sequence@1.0.6
ordered-dict@1.0.3
pauli:accounts-linkedin@1.1.2
pauli:linkedin@1.1.2
perak:codemirror@1.2.7
percolate:migrations@0.8.6
percolate:synced-cron@1.2.2
qnub:emojione@0.0.3
......
Meteor.startup ->
RocketChat.callbacks.add 'enter-room', ->
if Meteor.user()?.services?.github?.id or Meteor.user()?.services?.gitlab?.id
console.log 'Adding chatops to tabbar'
RocketChat.TabBar.addButton
id: 'chatops-button'
i18nTitle: 'rocketchat-chatops:Chatops_Title'
icon: 'icon-code'
template: 'chatops'
order: 4
#if Meteor.user()?.services?.github?.id or Meteor.user()?.services?.gitlab?.id
console.log 'Adding chatops to tabbar'
# RocketChat.TabBar.addButton
# id: 'chatops-button'
# i18nTitle: 'rocketchat-chatops:Chatops_Title'
# icon: 'icon-code'
# template: 'chatops'
# order: 4
console.log 'Adding chatops to tabbar'
RocketChat.TabBar.addButton
id: 'chatops-button2'
i18nTitle: 'rocketchat-chatops:Chatops_Title'
icon: 'icon-cube'
template: 'chatops-dynamicUI'
order: 4
console.log 'Adding chatops to tabbar'
RocketChat.TabBar.addButton
id: 'chatops-button3'
i18nTitle: 'rocketchat-chatops:Chatops_Title'
icon: 'icon-code'
template: 'chatops_codemirror'
order: 5
, RocketChat.callbacks.priority.MEDIUM, 'enter-room-tabbar-chatops'
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_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"></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 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>
......@@ -30,6 +30,9 @@ Package.onUse(function(api) {
'client/tabBar.coffee',
'client/views/chatops.html',
'client/views/chatops.coffee',
'client/views/codemirror.html',
'client/views/codemirror.coffee',
'client/views/dynamicUI.html',
'client/views/stylesheets/chatops.css',
], 'client');
......
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