-
Notifications
You must be signed in to change notification settings - Fork 12
/
Copy pathng2-summernote.js
250 lines (250 loc) · 27.8 KB
/
ng2-summernote.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
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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
"use strict";
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
return c > 3 && r && Object.defineProperty(target, key, r), r;
};
var __metadata = (this && this.__metadata) || function (k, v) {
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
};
var __param = (this && this.__param) || function (paramIndex, decorator) {
return function (target, key) { decorator(target, key, paramIndex); }
};
var core_1 = require('@angular/core');
var forms_1 = require('@angular/forms');
var http_1 = require('@angular/http');
require('rxjs/add/operator/toPromise');
var Ng2Summernote = (function () {
function Ng2Summernote(_elementRef, _zone, _http) {
this._elementRef = _elementRef;
this._zone = _zone;
this._http = _http;
/** Uploaded images server folder */
this.uploadFolder = "";
this.change = new core_1.EventEmitter();
}
Object.defineProperty(Ng2Summernote.prototype, "value", {
get: function () { return this._value; },
set: function (v) {
if (v !== this._value) {
this._value = v;
this._onChangeCallback(v);
}
},
enumerable: true,
configurable: true
});
;
Ng2Summernote.prototype.ngAfterViewInit = function () { };
/**
* Value update process
*/
Ng2Summernote.prototype.updateValue = function (value) {
var _this = this;
this._zone.run(function () {
_this._value = value;
_this.onChange(value);
_this._onTouchedCallback();
_this.change.emit(value);
});
};
Ng2Summernote.prototype.ngOnDestroy = function () { };
Ng2Summernote.prototype._imageUpload = function (dataUpload) {
var _this = this;
if (dataUpload.editable) {
var data = new FormData();
data.append("file", dataUpload.files[0]);
data.append("action", "upload");
data.append("image", "resizeNoThumb");
data.append("folder", this.uploadFolder);
$.post({
data: data,
type: "POST",
url: this.hostUpload,
cache: false,
contentType: false,
processData: false,
success: function (uploadedImg) {
var insertImg = $('<img style="width: 100%;" src="' + uploadedImg.data[0].fileName + '" />');
$(_this._elementRef.nativeElement).find('.summernote').summernote('insertNode', insertImg[0]);
console.log("Uploaded image: " + uploadedImg.data[0]);
},
error: function (err) { _this._errHandle(err); }
});
}
};
Ng2Summernote.prototype._mediaDelete = function (fileUrl) {
var data = JSON.stringify({
action: "del",
file: fileUrl
});
var headers = new http_1.Headers({
'Accept': '*/*',
'Content-Type': 'application/json'
});
var options = new http_1.RequestOptions({ headers: headers });
return this._http.post(this.hostUpload, data, options)
.toPromise()
.then(function (response) { return response; })
.catch(function (err) { return Promise.reject(err.message || err); });
};
/**
* Set logical varibles from text input values
*
* @param any variable, logic varible for setting
* @param boolean defaultValue, this value will be set if variable is not set
*
* @return boolean variable, finally setted variable value
*/
Ng2Summernote.prototype._setLogicVars = function (variable, defaultVal) {
variable = typeof variable !== 'undefined' ? true : false;
if (!variable && defaultVal)
variable = defaultVal;
return variable;
};
/**
* Hanle error in console
*/
Ng2Summernote.prototype._errHandle = function (err) {
console.error("Error");
console.log(err);
};
/**
* Implements ControlValueAccessor
*/
Ng2Summernote.prototype.writeValue = function (value) {
var _this = this;
if (typeof value === 'string' || value) {
this._value = value;
this.height = Number(this.height);
this.editable = this._setLogicVars(this.editable, true);
this.lang = $.summernote.lang[this.lang] ? this.lang : 'en-US';
this._config = this.config || {
height: this.height || 200,
minHeight: Number(this.minHeight) || this.height || 200,
maxHeight: Number(this.maxHeight) || this.height || 500,
placeholder: this.placeholder || 'Text...',
focus: this._setLogicVars(this.focus, false),
airMode: this._setLogicVars(this.airMode, false),
dialogsInBody: this._setLogicVars(this.dialogsInBody, false),
editable: this.editable,
lang: this.lang,
disableResizeEditor: this._setLogicVars(this.disableResizeEditor, false)
};
this._config.callbacks = {
onChange: function (evt) {
_this.updateValue(evt);
},
onInit: function (evt) { }
};
if (typeof this.serverImgUp !== 'undefined') {
this._config.callbacks.onImageUpload = function (files) {
_this._imageUpload({ files: files, editable: _this.editable });
};
this._config.callbacks.onMediaDelete = function (target) {
var fileUrl;
var attributes = target[0].attributes;
for (var i = 0; i < attributes.length; i++) {
if (attributes[i].name == "src") {
fileUrl = attributes[i].value;
}
}
_this._mediaDelete(fileUrl)
.then(function (resp) { console.log(resp.json().data); })
.catch(function (err) { _this._errHandle(err); });
};
}
$(this._elementRef.nativeElement).find('.summernote').summernote(this._config);
$(this._elementRef.nativeElement).find('.summernote').summernote('code', value);
}
};
Ng2Summernote.prototype.onChange = function (_) { };
Ng2Summernote.prototype.onTouched = function () { };
Ng2Summernote.prototype.registerOnChange = function (fn) { this.onChange = fn; };
Ng2Summernote.prototype.registerOnTouched = function (fn) { this.onTouched = fn; };
Ng2Summernote.prototype._onChangeCallback = function (_) { };
Ng2Summernote.prototype._onTouchedCallback = function () { };
__decorate([
core_1.Input(),
__metadata('design:type', Number)
], Ng2Summernote.prototype, "height", void 0);
__decorate([
core_1.Input(),
__metadata('design:type', Number)
], Ng2Summernote.prototype, "minHeight", void 0);
__decorate([
core_1.Input(),
__metadata('design:type', Number)
], Ng2Summernote.prototype, "maxHeight", void 0);
__decorate([
core_1.Input(),
__metadata('design:type', String)
], Ng2Summernote.prototype, "placeholder", void 0);
__decorate([
core_1.Input(),
__metadata('design:type', Boolean)
], Ng2Summernote.prototype, "focus", void 0);
__decorate([
core_1.Input(),
__metadata('design:type', Boolean)
], Ng2Summernote.prototype, "airMode", void 0);
__decorate([
core_1.Input(),
__metadata('design:type', String)
], Ng2Summernote.prototype, "dialogsInBody", void 0);
__decorate([
core_1.Input(),
__metadata('design:type', Boolean)
], Ng2Summernote.prototype, "editable", void 0);
__decorate([
core_1.Input(),
__metadata('design:type', String)
], Ng2Summernote.prototype, "lang", void 0);
__decorate([
core_1.Input(),
__metadata('design:type', String)
], Ng2Summernote.prototype, "disableResizeEditor", void 0);
__decorate([
core_1.Input(),
__metadata('design:type', Boolean)
], Ng2Summernote.prototype, "serverImgUp", void 0);
__decorate([
core_1.Input(),
__metadata('design:type', Object)
], Ng2Summernote.prototype, "config", void 0);
__decorate([
core_1.Input(),
__metadata('design:type', String)
], Ng2Summernote.prototype, "hostUpload", void 0);
__decorate([
core_1.Input(),
__metadata('design:type', String)
], Ng2Summernote.prototype, "uploadFolder", void 0);
__decorate([
core_1.Output(),
__metadata('design:type', Object)
], Ng2Summernote.prototype, "change", void 0);
__decorate([
core_1.Input(),
__metadata('design:type', Object)
], Ng2Summernote.prototype, "value", null);
Ng2Summernote = __decorate([
core_1.Component({
selector: 'ng2-summernote',
providers: [
{
provide: forms_1.NG_VALUE_ACCESSOR,
useExisting: core_1.forwardRef(function () { return Ng2Summernote; }),
multi: true
}
],
template: "<div class=\"summernote\"></div>",
}),
__param(0, core_1.Inject(core_1.ElementRef)),
__metadata('design:paramtypes', [core_1.ElementRef, core_1.NgZone, http_1.Http])
], Ng2Summernote);
return Ng2Summernote;
}());
exports.Ng2Summernote = Ng2Summernote;
//# sourceMappingURL=data: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ZXJcIiwgdGhpcy51cGxvYWRGb2xkZXIpO1xyXG4gICAgICAgICAgICAkLnBvc3Qoe1xyXG4gICAgICAgICAgICAgICAgZGF0YTogZGF0YSxcclxuICAgICAgICAgICAgICAgIHR5cGU6IFwiUE9TVFwiLFxyXG4gICAgICAgICAgICAgICAgdXJsOiB0aGlzLmhvc3RVcGxvYWQsXHJcbiAgICAgICAgICAgICAgICBjYWNoZTogZmFsc2UsXHJcbiAgICAgICAgICAgICAgICBjb250ZW50VHlwZTogZmFsc2UsXHJcbiAgICAgICAgICAgICAgICBwcm9jZXNzRGF0YTogZmFsc2UsXHJcbiAgICAgICAgICAgICAgICBzdWNjZXNzOiAodXBsb2FkZWRJbWc6IGFueSkgPT4ge1xyXG4gICAgICAgICAgICAgICAgICAgIGxldCBpbnNlcnRJbWcgPSAkKCc8aW1nIHN0eWxlPVwid2lkdGg6IDEwMCU7XCIgc3JjPVwiJyArIHVwbG9hZGVkSW1nLmRhdGFbMF0uZmlsZU5hbWUgKyAnXCIgLz4nKTtcclxuICAgICAgICAgICAgICAgICAgICAkKHRoaXMuX2VsZW1lbnRSZWYubmF0aXZlRWxlbWVudCkuZmluZCgnLnN1bW1lcm5vdGUnKS5zdW1tZXJub3RlKCdpbnNlcnROb2RlJywgaW5zZXJ0SW1nWzBdKTtcclxuICAgICAgICAgICAgICAgICAgICBjb25zb2xlLmxvZyhcIlVwbG9hZGVkIGltYWdlOiBcIiArIHVwbG9hZGVkSW1nLmRhdGFbMF0pO1xyXG4gICAgICAgICAgICAgICAgfSxcclxuICAgICAgICAgICAgICAgIGVycm9yOiAoZXJyOiBhbnkpID0+IHsgdGhpcy5fZXJySGFuZGxlKGVycikgfVxyXG4gICAgICAgICAgICB9KTtcclxuICAgICAgICB9XHJcbiAgICB9XHJcblxyXG4gICAgcHJpdmF0ZSBfbWVkaWFEZWxldGUoZmlsZVVybDogc3RyaW5nKSB7XHJcbiAgICAgICAgbGV0IGRhdGE6IGFueSA9IEpTT04uc3RyaW5naWZ5KHtcclxuICAgICAgICAgICAgYWN0aW9uOiBcImRlbFwiLFxyXG4gICAgICAgICAgICBmaWxlOiBmaWxlVXJsXHJcbiAgICAgICAgfSk7XHJcblxyXG4gICAgICAgIGxldCBoZWFkZXJzID0gbmV3IEhlYWRlcnMoe1xyXG4gICAgICAgICAgICAnQWNjZXB0JzogJyovKicsXHJcbiAgICAgICAgICAgICdDb250ZW50LVR5cGUnOiAnYXBwbGljYXRpb24vanNvbidcclxuICAgICAgICB9KTtcclxuICAgICAgICBsZXQgb3B0aW9ucyA9IG5ldyBSZXF1ZXN0T3B0aW9ucyh7aGVhZGVyczogaGVhZGVyc30pO1xyXG4gICAgICAgIFxyXG4gICAgICAgIHJldHVybiB0aGlzLl9odHRwLnBvc3QodGhpcy5ob3N0VXBsb2FkLCBkYXRhLCBvcHRpb25zKVxyXG4gICAgICAgICAgICAgICAgLnRvUHJvbWlzZSgpXHJcbiAgICAgICAgICAgICAgICAudGhlbigocmVzcG9uc2U6IGFueSkgPT4gcmVzcG9uc2UpXHJcbiAgICAgICAgICAgICAgICAuY2F0Y2goKGVycjogYW55KSA9PiBQcm9taXNlLnJlamVjdChlcnIubWVzc2FnZSB8fCBlcnIpKTtcclxuICAgIH1cclxuXHJcbiAgICAvKipcclxuICAgICAqIFNldCBsb2dpY2FsIHZhcmlibGVzIGZyb20gdGV4dCBpbnB1dCB2YWx1ZXNcclxuICAgICAqIFxyXG4gICAgICogQHBhcmFtIGFueSB2YXJpYWJsZSwgbG9naWMgdmFyaWJsZSBmb3Igc2V0dGluZ1xyXG4gICAgICogQHBhcmFtIGJvb2xlYW4gZGVmYXVsdFZhbHVlLCB0aGlzIHZhbHVlIHdpbGwgYmUgc2V0IGlmIHZhcmlhYmxlIGlzIG5vdCBzZXRcclxuICAgICAqIFxyXG4gICAgICogQHJldHVybiBib29sZWFuIHZhcmlhYmxlLCBmaW5hbGx5IHNldHRlZCB2YXJpYWJsZSB2YWx1ZVxyXG4gICAgICovXHJcbiA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uICAgICAgICAgICAgICAgIGhlaWdodDogdGhpcy5oZWlnaHQgfHwgMjAwLFxyXG4gICAgICAgICAgICAgICAgbWluSGVpZ2h0OiBOdW1iZXIodGhpcy5taW5IZWlnaHQpIHx8IHRoaXMuaGVpZ2h0IHx8IDIwMCxcclxuICAgICAgICAgICAgICAgIG1heEhlaWdodDogTnVtYmVyKHRoaXMubWF4SGVpZ2h0KSB8fCB0aGlzLmhlaWdodCB8fCA1MDAsXHJcbiAgICAgICAgICAgICAgICBwbGFjZWhvbGRlcjogdGhpcy5wbGFjZWhvbGRlciB8fCAnVGV4dC4uLicsXHJcbiAgICAgICAgICAgICAgICBmb2N1czogdGhpcy5fc2V0TG9naWNWYXJzKHRoaXMuZm9jdXMsIGZhbHNlKSxcclxuICAgICAgICAgICAgICAgIGFpck1vZGU6IHRoaXMuX3NldExvZ2ljVmFycyh0aGlzLmFpck1vZGUsIGZhbHNlKSxcclxuICAgICAgICAgICAgICAgIGRpYWxvZ3NJbkJvZHk6IHRoaXMuX3NldExvZ2ljVmFycyh0aGlzLmRpYWxvZ3NJbkJvZHksIGZhbHNlKSxcclxuICAgICAgICAgICAgICAgIGVkaXRhYmxlOiB0aGlzLmVkaXRhYmxlLFxyXG4gICAgICAgICAgICAgICAgbGFuZzogdGhpcy5sYW5nLFxyXG4gICAgICAgICAgICAgICAgZGlzYWJsZVJlc2l6ZUVkaXRvcjogdGhpcy5fc2V0TG9naWNWYXJzKHRoaXMuZGlzYWJsZVJlc2l6ZUVkaXRvciwgZmFsc2UpXHJcbiAgICAgICAgICAgIH07XHJcbiAgICAgICAgICAgIFxyXG4gICAgICAgICAgICB0aGlzLl9jb25maWcuY2FsbGJhY2tzID0ge1xyXG4gICAgICAgICAgICAgICAgb25DaGFuZ2U6IChldnQ6IGFueSkgPT4ge1xyXG4gICAgICAgICAgICAgICAgICAgIHRoaXMudXBkYXRlVmFsdWUoZXZ0KTtcclxuICAgICAgICAgICAgICAgIH0sXHJcbiAgICAgICAgICAgICAgICBvbkluaXQ6IChldnQ6IGFueSkgPT4ge31cclxuICAgICAgICAgICAgfTtcclxuXHJcbiAgICAgICAgICAgIGlmICh0eXBlb2YgdGhpcy5zZXJ2ZXJJbWdVcCAhPT0gJ3VuZGVmaW5lZCcpIHtcclxuICAgICAgICAgICAgICAgIHRoaXMuX2NvbmZpZy5jYWxsYmFja3Mub25JbWFnZVVwbG9hZCA9IChmaWxlczogc3RyaW5nKSA9PiB7XHJcbiAgICAgICAgICAgICAgICAgICAgdGhpcy5faW1hZ2VVcGxvYWQoe2ZpbGVzOiBmaWxlcywgZWRpdGFibGU6IHRoaXMuZWRpdGFibGV9KTtcclxuICAgICAgICAgICAgICAgIH07XHJcbiAgICAgICAgICAgICAgICB0aGlzLl9jb25maWcuY2FsbGJhY2tzLm9uTWVkaWFEZWxldGUgPSAodGFyZ2V0OiBbYW55XSkgPT4ge1xyXG4gICAgICAgICAgICAgICAgICAgIGxldCBmaWxlVXJsOiBzdHJpbmc7XHJcbiAgICAgICAgICAgICAgICAgICAgbGV0IGF0dHJpYnV0ZXM6IGFueSA9IHRhcmdldFswXS5hdHRyaWJ1dGVzO1xyXG4gICAgICAgICAgICAgICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgYXR0cmlidXRlcy5sZW5ndGg7IGkrKykge1xyXG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoYXR0cmlidXRlc1tpXS5uYW1lID09IFwic3JjXCIpIHtcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZpbGVVcmwgPSBhdHRyaWJ1dGVzW2ldLnZhbHVlO1xyXG4gICAgICAgICAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgICAgICAgIHRoaXMuX21lZGlhRGVsZXRlKGZpbGVVcmwpXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIC50aGVuKChyZXNwOiBhbnkpID0+IHsgY29uc29sZS5sb2cocmVzcC5qc29uKCkuZGF0YSkgfSlcclxuICAgICAgICAgICAgICAgICAgICAgICAgLmNhdGNoKChlcnI6IGFueSkgPT4geyB0aGlzLl9lcnJIYW5kbGUoZXJyKSB9KTtcclxuICAgICAgICAgICAgICAgIH07XHJcbiAgICAgICAgICAgIH1cclxuXHJcbiAgICAgICAgICAgICQodGhpcy5fZWxlbWVudFJlZi5uYXRpdmVFbGVtZW50KS5maW5kKCcuc3VtbWVybm90ZScpLnN1bW1lcm5vdGUodGhpcy5fY29uZmlnKTtcclxuICAgICAgICAgICAgJCh0aGlzLl9lbGVtZW50UmVmLm5hdGl2ZUVsZW1lbnQpLmZpbmQoJy5zdW1tZXJub3RlJykuc3VtbWVybm90ZSgnY29kZScsIHZhbHVlKTtcclxuICAgICAgICB9XHJcbiAgICB9XHJcbiAgICBvbkNoYW5nZSAoXzogYW55KSB7fVxyXG4gICAgb25Ub3VjaGVkICgpIHt9XHJcbiAgICByZWdpc3Rlck9uQ2hhbmdlIChmbjogYW55KSB7IHRoaXMub25DaGFuZ2UgPSBmbjsgfVxyXG4gICAgcmVnaXN0ZXJPblRvdWNoZWQgKGZuOiBhbnkpIHsgdGhpcy5vblRvdWNoZWQgPSBmbjsgfVxyXG4gICAgX29uQ2hhbmdlQ2FsbGJhY2sgKF86IGFueSkge31cclxuICAgIF9vblRvdWNoZWRDYWxsYmFjayAoKSB7fVxyXG59XHJcbiJdfQ==