ACP: added tagsinput to other fields that are "comma separated"

v1.18.x
psychobunny 8 years ago
parent bb146e049c
commit 62f445ad7f

@ -102,6 +102,7 @@ define('admin/settings', ['uploader'], function (uploader) {
});
handleUploads();
setupTagsInput();
$('#clear-sitemap-cache').off('click').on('click', function () {
socket.emit('admin.settings.clearSitemapCache', function () {
@ -142,6 +143,13 @@ define('admin/settings', ['uploader'], function (uploader) {
});
}
function setupTagsInput() {
$('[data-field-type="tagsinput"]').tagsinput({
confirmKeys: [13, 44],
trimValue: true,
});
}
Settings.remove = function (key) {
socket.emit('admin.config.remove', key);
};

@ -17,11 +17,6 @@ define('admin/settings/general', ['admin/settings'], function () {
$('button[data-action="removeOgImage"]').on('click', function () {
$('input[data-field="removeOgImage"]').val('');
});
$('[data-field-type="tagsinput"]').tagsinput({
confirmKeys: [13, 44],
trimValue: true,
});
};
return Module;

@ -43,7 +43,7 @@
<p class="help-block">
[[admin/settings/group:default-cover-help]]
</p>
<input type="text" class="form-control input-lg" id="groups:defaultCovers" data-field="groups:defaultCovers" value="{config.relative_path}/assets/images/cover-default.png" placeholder="https://example.com/group1.png, https://example.com/group2.png" /><br />
<input type="text" class="form-control input-lg" id="groups:defaultCovers" data-field="groups:defaultCovers" data-field-type="tagsinput" value="{config.relative_path}/assets/images/cover-default.png" placeholder="https://example.com/group1.png, https://example.com/group2.png" /><br />
</form>
</div>
</div>

@ -50,7 +50,7 @@
<div class="form-group">
<label for="allowedFileExtensions">[[admin/settings/uploads:allowed-file-extensions]]</label>
<input type="text" class="form-control" value="" data-field="allowedFileExtensions" />
<input type="text" class="form-control" value="" data-field="allowedFileExtensions" data-field-type="tagsinput" />
<p class="help-block">
[[admin/settings/uploads:allowed-file-extensions-help]]
</p>
@ -131,7 +131,7 @@
<p class="help-block">
[[admin/settings/uploads:default-covers-help]]
</p>
<input type="text" class="form-control input-lg" id="profile:defaultCovers" data-field="profile:defaultCovers" value="{config.relative_path}/assets/images/cover-default.png" placeholder="https://example.com/group1.png, https://example.com/group2.png" />
<input type="text" class="form-control input-lg" id="profile:defaultCovers" data-field="profile:defaultCovers" data-field-type="tagsinput" value="{config.relative_path}/assets/images/cover-default.png" placeholder="https://example.com/group1.png, https://example.com/group2.png" />
</form>
</div>
</div>

Loading…
Cancel
Save