Issue #636 - rename seamless* to tile*

This commit is contained in:
Julian Descottes 2017-06-05 19:59:12 +02:00
parent 5d2ca7e70c
commit d3a37c74e9
3 changed files with 24 additions and 26 deletions

View File

@ -43,14 +43,11 @@
vertical-align: middle; vertical-align: middle;
} }
.layer-opacity-input { .layer-opacity-input,
.tile-mask-opacity-input {
width: 100px; width: 100px;
} }
.seamless-opacity-input {
width: 75px;
}
.settings-opacity-text { .settings-opacity-text {
height: 31px; height: 31px;
display: inline-block; display: inline-block;

View File

@ -9,39 +9,39 @@
pskl.utils.inherit(ns.TileApplicationController, pskl.controller.settings.AbstractSettingController); pskl.utils.inherit(ns.TileApplicationController, pskl.controller.settings.AbstractSettingController);
ns.TileApplicationController.prototype.init = function () { ns.TileApplicationController.prototype.init = function () {
// Seamless mode // Tile mode
var seamlessMode = pskl.UserSettings.get(pskl.UserSettings.SEAMLESS_MODE); var tileMode = pskl.UserSettings.get(pskl.UserSettings.SEAMLESS_MODE);
var seamlessModeCheckbox = document.querySelector('.seamless-mode-checkbox'); var tileModeCheckbox = document.querySelector('.tile-mode-checkbox');
if (seamlessMode) { if (tileMode) {
seamlessModeCheckbox.setAttribute('checked', seamlessMode); tileModeCheckbox.setAttribute('checked', tileMode);
} }
this.addEventListener(seamlessModeCheckbox, 'change', this.onSeamlessModeChange_); this.addEventListener(tileModeCheckbox, 'change', this.onTileModeChange_);
// Seamless mask opacity // Tile mask opacity
var seamlessOpacityInput = document.querySelector('.seamless-opacity-input'); var tileMaskOpacityInput = document.querySelector('.tile-mask-opacity-input');
seamlessOpacityInput.value = pskl.UserSettings.get(pskl.UserSettings.SEAMLESS_OPACITY); tileMaskOpacityInput.value = pskl.UserSettings.get(pskl.UserSettings.SEAMLESS_OPACITY);
this.addEventListener(seamlessOpacityInput, 'change', this.onSeamlessOpacityChange_); this.addEventListener(tileMaskOpacityInput, 'change', this.onTileMaskOpacityChange_);
this.addEventListener(seamlessOpacityInput, 'input', this.onSeamlessOpacityChange_); this.addEventListener(tileMaskOpacityInput, 'input', this.onTileMaskOpacityChange_);
this.updateSeamlessOpacityText_(seamlessOpacityInput.value); this.updateTileMaskOpacityText_(tileMaskOpacityInput.value);
}; };
ns.TileApplicationController.prototype.onSeamlessModeChange_ = function (evt) { ns.TileApplicationController.prototype.onTileModeChange_ = function (evt) {
pskl.UserSettings.set(pskl.UserSettings.SEAMLESS_MODE, evt.currentTarget.checked); pskl.UserSettings.set(pskl.UserSettings.SEAMLESS_MODE, evt.currentTarget.checked);
}; };
ns.TileApplicationController.prototype.onSeamlessOpacityChange_ = function (evt) { ns.TileApplicationController.prototype.onTileMaskOpacityChange_ = function (evt) {
var target = evt.target; var target = evt.target;
var opacity = parseFloat(target.value); var opacity = parseFloat(target.value);
if (!isNaN(opacity)) { if (!isNaN(opacity)) {
pskl.UserSettings.set(pskl.UserSettings.SEAMLESS_OPACITY, opacity); pskl.UserSettings.set(pskl.UserSettings.SEAMLESS_OPACITY, opacity);
this.updateSeamlessOpacityText_(opacity); this.updateTileMaskOpacityText_(opacity);
} else { } else {
target.value = pskl.UserSettings.get(pskl.UserSettings.SEAMLESS_OPACITY); target.value = pskl.UserSettings.get(pskl.UserSettings.SEAMLESS_OPACITY);
} }
}; };
ns.TileApplicationController.prototype.updateSeamlessOpacityText_ = function (opacity) { ns.TileApplicationController.prototype.updateTileMaskOpacityText_ = function (opacity) {
var seamlessOpacityText = document.querySelector('.seamless-opacity-text'); var seamlessOpacityText = document.querySelector('.tile-mask-opacity-text');
seamlessOpacityText.innerHTML = (opacity * 1).toFixed(2); seamlessOpacityText.innerHTML = (opacity * 1).toFixed(2);
}; };
})(); })();

View File

@ -3,14 +3,15 @@
<div class="settings-item"> <div class="settings-item">
<label> <label>
Enable tile mode Enable tile mode
<input type="checkbox" value="1" class="seamless-mode-checkbox" name="seamless-mode-checkbox"/> <input type="checkbox" value="1" class="tile-mode-checkbox" name="tile-mode-checkbox"/>
</label> </label>
</div> </div>
<div class="settings-item"> <div class="settings-item">
<label>Tiles opacity</label> <label>Mask opacity</label>
<input type="range" class="settings-opacity-input seamless-opacity-input" name="seamless-opacity" min="0" max="0.5" step="0.01"/> <input type="range" min="0" max="0.5" step="0.01"
<span class="settings-opacity-text seamless-opacity-text"></span> class="settings-opacity-input tile-mask-opacity-input" name="tile-mask-opacity"/>
<span class="settings-opacity-text tile-mask-opacity-text"></span>
</div> </div>
</div> </div>
</script> </script>