Beginner
31 сообщениий
Мужчина
|
В общем мне нужно что бы вот в этом скрипте Code (function(){ // Copyright ucodes.ru © 2010 // by Bogggdan // 04.12.2010 var addB = _uButton(null,'b',{text: 'Добавить картинки', content: 'onclick="FaddField()"', style: 1});$('#message').parent().parent().parent().after('<tr><td class="manTdSep" colspan="2" height="10"><hr class="manHr"></td></tr><tr id="imgsLoad"><td class="manTd1"> </td><td class="manTd2">' + addB + '</td></tr>');})(); function FaddField(){var _i = $("<input/>").attr("type", "text").addClass("loadInpt").css("width", "90%").attr("id", "loadInpt");$("#imgsLoad .manTd1").html(_uButton(null,'b',{text: ' + ', content: 'onclick="addField()"', style: 1}));$("#imgsLoad .manTd2").html(_i);$(_i).after('<img src="http://ucodes.ru/upload/icons/load.gif" border="0" alt="" id="sttimg" style="display: none" align="absmiddle">');_i.focus();};function addField(){var af = $(".aFi").size(), tr = af>0?$(".aFi:last"):$("#imgsLoad"), _i = $("<input/>").attr("type", "text").addClass("loadInpt").css("width", "90%").attr("id", "loadInpt"+af);$(tr).after('<tr class="aFi"><td class="manTd1"> </td><td class="manTd2" id="ff' + af + '"> </td></tr>');$("#ff" + af).html(_i);$(_i).after('<img src="http://ucodes.ru/upload/icons/load.gif" border="0" alt="" style="display: none" id="sttimg' + af + '" align="absmiddle">');_i.focus();} $(".loadInpt").live("change", function(){var v = $(this).val(), n = $(this).attr("id").match(/\d+$/) || "", inp = $(this); if (v.length == 0) {$(".loadInpt").attr("readonly", false);$("img#sttimg" + n).fadeOut("slow");return;} if (v && /^(http|ftp|https)\:\/\/\S+$/.test(v)){ $(".loadInpt").attr("readonly", true); $("img#sttimg" + n).attr("src", "http://ucodes.ru/upload/icons/load.gif").fadeIn("slow"); $.post("/photo", { ocat: 1, uphoto1: v, org: 1, a: 14} , function(data){ var d = $(data).text(), url = $("<div/>").html(d).find("a:first").attr("href"); if (url) { $.get(url, function(re){ $("#message")[0].value = " " + re.split("||")[1] + " \n\n" + $("#message")[0].value; $(inp).val(re.split("||")[1]); $("img#sttimg" + n).attr("src", "http://ucodes.ru/upload/icons/ok.png").fadeIn("slow"); $(".loadInpt").attr("readonly", false);return; }); } else if (d.indexOf("не найден") != -1) { _uWnd.alert('<br>Адрес картинки неверный', 'Error', {tm: 2000, w: 175, h: 95}); $("img#sttimg" + n).attr("src", "http://ucodes.ru/upload/icons/error.png").fadeIn("slow"); setTimeout(function(){$("img#sttimg" + n).fadeOut("slow"); }, 2000);$(".loadInpt").attr("readonly", false);return; } else if (!url){ $("img#sttimg" + n).attr("src", "http://ucodes.ru/upload/icons/error.png").fadeIn("slow"); setTimeout(function(){$("img#sttimg" + n).fadeOut("slow"); }, 2000);$(".loadInpt").attr("readonly", false);alert('Error\n\nОбновите страницу и попробуйте снова. Если не получится, обратитесь к администрации.');return; } }); } else { _uWnd.alert('<br>Проверьте правильность адреса картинки', 'Error', {tm: 2000, w: 175, h: 95}); $("img#sttimg" + n).attr("src", "http://ucodes.ru/upload/icons/error.png").fadeIn("slow"); setTimeout(function(){$("img#sttimg" + n).fadeOut("slow"); }, 2000);}}); я хочу чтобы когда вставляется ссылка из первого поля,именно первое поле что бы вставлялся с текстом [spoiler=мой текст]
также пробовал ставить к "[c]" + re.split но после каждая ссылка ставилась со споилером нужно что бы все ссылки были в споилере
ну должно быть так
также посмотрел что первое поле имеет id loadInpt и каждое новое поле имеет свой номер id loadInpt0 loadInpt1 loadInpt2 loadInpt3 и тд
можно попробовать что бы в поле с id loadInpt автоматически вставлялся текст spoiler=Скриншоты
|
|
|
|
|
|