paintplus: vendor the app source and rename from EditmaskwithAI
Bring the full EditmaskwithAI application into the repo under paintplus/ (429 files) so the service is self-contained — the installer copies the vendored source to ~/docker/paintplus/src instead of cloning at runtime. Rename to PaintPlus (service + branding; app logic untouched): - services/editmaskwithai.sh -> services/paintplus.sh (register_service paintplus, install_paintplus, ~/docker/paintplus, Caddy paintplus:8000, Authelia option preserved) - container names -> paintplus across docker-compose*.yml; dev network -> paintplus-network - browser <title> -> "PaintPlus - AI Image Editor"; README heading -> PaintPlus with upstream provenance note - README utilities table: editmaskwithai -> paintplus Backend/frontend code (help strings referencing the old container name, the ai_photo_edit.db filename) is intentionally left as-is to avoid touching application logic. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Nb2vJ8W7bHKx1JXVvpCraH
This commit is contained in:
@@ -0,0 +1,71 @@
|
||||
import app from './../../../app.js';
|
||||
import config from './../../../config.js';
|
||||
import Dialog_class from './../../../libs/popup.js';
|
||||
import Base_layers_class from './../../../core/base-layers.js';
|
||||
import Helper_class from './../../../libs/helpers.js';
|
||||
|
||||
class Effects_common_class {
|
||||
|
||||
constructor() {
|
||||
this.POP = new Dialog_class();
|
||||
this.Base_layers = new Base_layers_class();
|
||||
this.Helper = new Helper_class();
|
||||
this.params = null;
|
||||
}
|
||||
|
||||
show_dialog(type, params, filter_id) {
|
||||
var _this = this;
|
||||
var title = this.Helper.ucfirst(type);
|
||||
title = title.replace(/-/g, ' ');
|
||||
|
||||
var preview_padding = 0;
|
||||
if(typeof this.preview_padding != "undefined"){
|
||||
preview_padding = this.preview_padding;
|
||||
}
|
||||
|
||||
var settings = {
|
||||
title: title,
|
||||
preview: true,
|
||||
preview_padding: preview_padding,
|
||||
effects: true,
|
||||
params: params,
|
||||
on_change: function (params, canvas_preview, w, h) {
|
||||
_this.params = params;
|
||||
canvas_preview.filter = _this.preview(params, type);
|
||||
canvas_preview.drawImage(this.layer_active_small,
|
||||
preview_padding, preview_padding,
|
||||
_this.POP.width_mini - preview_padding * 2, _this.POP.height_mini - preview_padding * 2
|
||||
);
|
||||
},
|
||||
on_finish: function (params) {
|
||||
_this.params = params;
|
||||
_this.save(params, type, filter_id);
|
||||
},
|
||||
};
|
||||
this.Base_layers.disable_filter(filter_id);
|
||||
this.POP.show(settings);
|
||||
this.Base_layers.disable_filter(null);
|
||||
}
|
||||
|
||||
save(params, type, filter_id) {
|
||||
return app.State.do_action(
|
||||
new app.Actions.Add_layer_filter_action(null, type, params, filter_id)
|
||||
);
|
||||
}
|
||||
|
||||
preview(params, type) {
|
||||
if(type == 'shadow'){
|
||||
type = 'drop-shadow';
|
||||
}
|
||||
|
||||
var value = this.convert_value(params.value, params, 'preview');
|
||||
return type + "(" + value + ")";
|
||||
}
|
||||
|
||||
convert_value(value, params) {
|
||||
return value;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
export default Effects_common_class;
|
||||
Reference in New Issue
Block a user