Advertisement
Guest User

Masowe komenatarze - Steam

a guest
Jan 3rd, 2020
1,726
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
jQuery 2.24 KB | None | 0 0
  1. ToggleManageFriends();
  2. jQuery("#manage_friends").after('<div class="commentthread_entry"><div class="commentthread_entry_quotebox"><textarea rows="1" class="commentthread_textarea" id="comment_textarea" placeholder="Dodaj komantarz" style="overflow: hidden; height: 20px;"></textarea></div><div class="commentthread_entry_submitlink" style=""><a class="btn_grey_black btn_small_thin" href="javascript:CCommentThread.FormattingHelpPopup( \'Profile\' );"><span>Formatting help</span></a>   <span class="emoticon_container"><span class="emoticon_button small" id="emoticonbtn"></span></span><span class="btn_green_white_innerfade btn_small" id="comment_submit"><span>Dodaj komenatarz, do wybranych znajomych</span></span></div></div><div id="log"><span id="log_head"></span><span id="log_body"></span></div>');
  3. new CEmoticonPopup( $J('#emoticonbtn'), $J('#commentthread_Profile_0_textarea') );
  4. jQuery("#comment_submit").click(function() {
  5.   const total = jQuery(".selected").length;
  6.   const msg = jQuery("#comment_textarea").val();
  7.   if (total > 0 && msg.length > 0) {
  8.     jQuery("#log_head, #log_body").html("");
  9.     jQuery(".selected").each(function(i) {
  10.       let profileID = this.getAttribute("data-steamid");
  11.       (function(i, profileID) {
  12.         setTimeout(function() {
  13.           jQuery.post("//steamcommunity.com/comment/Profile/post/" + profileID + "/-1/", { comment: msg, count: 6, sessionid: g_sessionID }, function(response) {
  14.             if (response.success === false) {
  15.               jQuery("#log_body")[0].innerHTML += "<br>" + response.error;
  16.             } else {
  17.               jQuery("#log_body")[0].innerHTML += "<br>Dodano komentarz na profilu: <a href=http://steamcommunity.com/profiles/" + profileID + ">" + profileID + "</a>";
  18.             }
  19.           }).fail(function() {
  20.             jQuery("#log_body")[0].innerHTML += "<br>Nie dodano komentarzu na profilu: <a href=http://steamcommunity.com/profiles/" + profileID + ">" + profileID + "</a>";
  21.           }).always(function() {
  22.             jQuery("#log_head").html("<br><b>Dodawanie:" + (i+1) + " z " + total + " friends.<b>");
  23.           });
  24.         }, i * 6000);
  25.       })(i, profileID);
  26.     });
  27.   } else {
  28.     alert("Aby wysłać wiadomość, zaznacz przynajmniej jednego znajomego...");
  29.   }
  30. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement