Revision 8053 of "Користувач:RLuts/common.js" on ukwikivoyage// для експериментальної сторінки створення маршрутів
$( document ).ready(function() {
//створення форм після завантаження
if(mw.config.get('wgPageName') == 'Користувач:RLuts/testforms') {
$("#expjsforms").append('<input id="commonscat" value="Категорія Вікісховища"/> <input id="newform" type=button value="Додати населений пункт" />');
}
});
$('#newform').click(function() { $('#expjsforms').append('<div class="area"><input class="vilname" value="Введіть назву населеного пункту"/><span class="delbut">Видалити x</span><textarea class="vilinput" rows="10" cols="45" name="text">Введіть короткий опис місцевості</textarea></div>');
});
$(".delbut").live('click', function() {
$(this).parent().remove();
});
desc($('.vilname'),'Введіть назву населеного пункту');
desc($('.vilinput'),'Введіть короткий опис місцевості');
desc($('#commonscat'),'Категорія Вікісховища');
function desc(elem,text) {
elem.live('focus', text, function(e) {
if($(this).val() === e.data) {
$(this).val('');
$(this).css('color', '#000');
}
});
elem.live('blur', text, function(e) {
if($(this).val() === '') {
$(this).val(e.data);
$(this).css('color', '#ccc');
}
});
}
////////////////////////////
function fetchIT(d, y) {
mw.log( 'fetched' );
this.suggestions( 'suggestions', ['Lorem ipsum dolor sit amet', 'consectetur adipisici elit', 'sed eiusmod tempor incidunt ut labore et dolore magna aliqua']);
}
$( '#commonscat' ).suggestions( 'fetch', fetchIT );All content in the above text box is licensed under the Creative Commons Attribution-ShareAlike license Version 4 and was originally sourced from https://uk.wikivoyage.org/w/index.php?oldid=8053.
![]() ![]() This site is not affiliated with or endorsed in any way by the Wikimedia Foundation or any of its affiliates. In fact, we fucking despise them.
|