mirror of
https://github.com/Pathduck/gallery3.git
synced 2026-09-18 20:25:42 -04:00
Merge pull request #211 from shadlaws/fix_2054
#2054 - Revise albums_form_add.js: update for new jQuery, refactor.
This commit is contained in:
@@ -1,23 +1,6 @@
|
||||
$("#g-add-album-form input[name=title]").change(
|
||||
function() {
|
||||
$("#g-add-album-form input[name=name]").attr(
|
||||
"value", $("#g-add-album-form input[name=title]").attr("value")
|
||||
.replace(/[\s\/]+/g, "-").replace(/\.+$/, ""));
|
||||
$("#g-add-album-form input[name=slug]").attr(
|
||||
"value", $("#g-add-album-form input[name=title]").attr("value")
|
||||
.replace(/[^A-Za-z0-9-_]+/g, "-")
|
||||
.replace(/^-+/, "")
|
||||
.replace(/-+$/, ""));
|
||||
});
|
||||
$("#g-add-album-form input[name=title]").keyup(
|
||||
function() {
|
||||
$("#g-add-album-form input[name=name]").attr(
|
||||
"value", $("#g-add-album-form input[name=title]").attr("value")
|
||||
.replace(/[\s\/]+/g, "-")
|
||||
.replace(/\.+$/, ""));
|
||||
$("#g-add-album-form input[name=slug]").attr(
|
||||
"value", $("#g-add-album-form input[name=title]").attr("value")
|
||||
.replace(/[^A-Za-z0-9-_]+/g, "-")
|
||||
.replace(/^-+/, "")
|
||||
.replace(/-+$/, ""));
|
||||
});
|
||||
$("#g-add-album-form input[name='title']").on("input keyup", function() {
|
||||
$("#g-add-album-form input[name='name']").val(
|
||||
$(this).val().replace(/[\s\/\\]+/g, "-").replace(/\.+$/, ""));
|
||||
$("#g-add-album-form input[name='slug']").val(
|
||||
$(this).val().replace(/[^A-Za-z0-9-_]+/g, "-").replace(/^-+/, "").replace(/-+$/, ""));
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user