Skip to content

Commit

Permalink
Merge ff782dd into 8425553
Browse files Browse the repository at this point in the history
  • Loading branch information
JZuidema committed Jul 19, 2019
2 parents 8425553 + ff782dd commit 2c6b9c6
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 36 deletions.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

30 changes: 1 addition & 29 deletions src/Kunstmaan/AdminBundle/Resources/ui/js/_slug-chooser.js
Expand Up @@ -16,50 +16,22 @@ kunstmaanbundles.slugChooser = (function(window, undefined) {

// Slug-Chooser
slugChooser = function($widget) {
var resetValue = $widget.data('reset'),
urlprefix = $widget.data('url-prefix');

// Setup url prefix
if(urlprefix.length == 0 || urlprefix.indexOf('/', urlprefix.length - 1) == -1) { //endwidth
urlprefix += '/';
}
var resetValue = $widget.data('reset');

// Elements
var $input = $widget.find('.js-slug-chooser__input'),
$preview = $widget.find('.js-slug-chooser__preview'),
$resetBtn = $widget.find('.js-slug-chooser__reset-btn');

// Update
$input.on('change', function() {
updateSlugPreview($input, $preview, urlprefix);
});
$input.on('keyup', function() {
updateSlugPreview($input, $preview, urlprefix);
});

// Reset Btn
$resetBtn.on('click', function() {
resetSlug($input, resetValue);
updateSlugPreview($input, $preview, urlprefix);
});

// Set initial value
updateSlugPreview($input, $preview, urlprefix);
};


resetSlug = function($input, resetValue) {
$input.val(resetValue);
};


updateSlugPreview = function($input, $preview, urlprefix) {
var inputValue = $input.val();

$preview.html('url: ' + urlprefix + inputValue);
};


return {
init: init
};
Expand Down
Expand Up @@ -41,6 +41,7 @@ kuma_node:
page_title:
label: Page title
info_text: Used as title inside the page.
current_url: Current url
status:
"will_be_publish_at.%date%.raw": This page will be published at %date%
"will_be_unpublish_at.%date%.raw": This page will be unpublished at %date%
Expand Down
Expand Up @@ -38,6 +38,7 @@ kuma_node:
page_title:
label: Pagina titel
info_text: Wordt gebruikt als titel op de pagina.
current_url: Huidige url
status:
"will_be_publish_at.%date%.raw": Deze pagina zal worden gepubliceerd op %date%
"will_be_unpublish_at.%date%.raw": Deze pagina wordt offline gezet op %date%
Expand Down

0 comments on commit 2c6b9c6

Please sign in to comment.