SHARE
TWEET

Untitled

a guest May 22nd, 2019 51 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <script>
  2.     var isMerging=!1,maxTagAttachments=5,mediaString="",mediaString_="",input=document.querySelector("input[name=media-attachments]"),tagify=new Tagify(input,{delimiters:"|",autocomplete:!1,transformTag:function(i){var a=i.match("(video|audio|photo|doc|wall)-?[0-9]*_[0-9]*");return-1!==i.indexOf(",")||a&&(i=a[0]),i}});function handleTagClick(i){if(isMerging)if(mediaString_=i.detail.data.value,mediaString!==mediaString_){if((mediaString.match(/,/g)||[]).length+(mediaString_.match(/,/g)||[]).length<maxTagAttachments-1){var a="";for(var e in tagify.value){var t=tagify.value[e].value;t!==mediaString&&t!==mediaString_&&(a+=t+"|")}a+=mediaString+","+mediaString_,tagify.removeAllTags(),tagify.addTags(a),mediaString_=mediaString="",isMerging=!1}}else mediaString_="";else mediaString=i.detail.data.value,isMerging=!0}tagify.on("click",handleTagClick);
  3. </script>
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top