Add new default style.

This commit is contained in:
Oleg Sh
2026-01-07 19:55:04 +01:00
parent a139fbe6ec
commit dee5d4c4ea
19 changed files with 777 additions and 297 deletions

View File

@@ -3,31 +3,31 @@
*/
function CommonBackgroundStyle()
function BaseBackgroundStyle()
{
this.commonColor = '#ffffff';
this.commonOpacity = 1.0;
this.image = null;
this.image = null;
}
CommonBackgroundStyle.prototype.Clear = function ()
BaseBackgroundStyle.prototype.Clear = function ()
{
delete this.commonColor;
delete this.commonOpacity;
delete this.image;
}
CommonBackgroundStyle.prototype.ShouldLoad = function (field)
BaseBackgroundStyle.prototype.ShouldLoad = function (field)
{
return true;
}
CommonBackgroundStyle.prototype.saveToJson = function (field)
BaseBackgroundStyle.prototype.saveToJson = function (field)
{
return JSON.stringify({commonColor: this.commonColor, commonOpacity: this.commonOpacity, image: this.image != null ? this.image.src : null});
}
CommonBackgroundStyle.prototype.loadFromJson = function (json, callbackOnLoaded)
BaseBackgroundStyle.prototype.loadFromJson = function (json, callbackOnLoaded)
{
this.commonColor = json["commonColor"];
this.commonOpacity = json["commonOpacity"];
@@ -41,17 +41,6 @@ CommonBackgroundStyle.prototype.loadFromJson = function (json, callbackOnLoaded)
}
}
PrintBackgroundStyle.prototype = Object.create(CommonBackgroundStyle.prototype);
function PrintBackgroundStyle()
{
CommonBackgroundStyle.apply(this, arguments);
this.commonColor = '#ffffff';
this.commonOpacity = 1.0;
this.image = null;
}
function BaseBackgroundDrawer(context)
{
this.context = context;