-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathbee.js
More file actions
65 lines (45 loc) · 1.25 KB
/
bee.js
File metadata and controls
65 lines (45 loc) · 1.25 KB
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
( function($, Bee, undefined ) {
Bee.init = function() {
$.ajax({ url: '/bee/token', success: Bee.create});
};
Bee.create = function(token) {
BeePlugin.create(token, Bee.config(), Bee.on_create);
};
Bee.on_save = function(jsonFile, htmlFile) {
};
Bee.on_save_as_template = function(jsonFile) {
};
Bee.on_auto_save = function(jsonFile) {
};
Bee.on_send = function(htmlFile) {
};
Bee.on_error = function(errorMessages) {
console.log('onError ', errorMessages);
};
Bee.on_create = function(bee) {
$.ajax({ url: $('#bee-plugin-container').data('template'), success: Bee.on_load_template});
window.bee = bee;
};
Bee.on_load_template = function(template) {
window.bee.start(JSON.parse(template));
},
Bee.config = function() {
return {
uid: 'RailsExampleApp',
container: 'bee-plugin-container',
autosave: false,
language: 'en-US',
preventClose: false,
specialLinks: [{
type: 'unsubscribe',
label: 'SpecialLink.Unsubscribe',
link: 'http://[unsubscribe]/'
}],
onSave: Bee.on_save,
onSaveAsTemplate: Bee.on_save_as_template,
onAutoSave: Bee.on_auto_save,
onSend: Bee.on_send,
onError: Bee.on_error
}
};
}(jQuery, window.Bee = window.Bee || {}));