-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathclient.js
39 lines (35 loc) · 1.28 KB
/
client.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
/**
* hive.js
* Copyright (C) 2013-2016 Marcel Klehr <[email protected]>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the Mozilla Public License version 2
* as published by the Mozilla Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the Mozilla Public License
* along with this program. If not, see <https://www.mozilla.org/en-US/MPL/2.0/>.
*/
var bindTextarea = require('gulf-textarea')
module.exports = setup
module.exports.consumes = ['editor']
module.exports.provides = []
function setup(plugin, imports, register) {
var editor = imports.editor
editor.registerEditor('Textarea', 'text/plain', 'Just a textarea, nothing more'
, function(el) {
var textarea = document.createElement('textarea')
textarea.setAttribute('id', 'content')
el.appendChild(textarea)
el.style['height'] = '100%'
textarea.style['height'] = '100%'
textarea.style['width'] = '100%'
textarea.style['border'] = '0'
return Promise.resolve(bindTextarea(textarea))
})
register()
}