jQuery Plugin To Handle Pasting & Parsing of URLs and Text - Paste

File Size: 5.75 KB
Views Total: 701
Last Update:
Publish Date:
Official Website: Go to website
License: MIT
   
jQuery Plugin To Handle Pasting & Parsing of URLs and Text - Paste

Paste is a tiny jQuery plugin that handles pasting & parsing of URLs and text on your webpage and converts them into JavaScript objects.

How to use it:

1. Add jQuery library and the jQuery paste plugin to your web page.

<script src="jquery.min.js"></script>
<script src="src/jquery.paste.js"></script>

2. Create a clipboard on your web page.

<div id="container-paste"
     title="Try pasting a url">
     <span class="paste-status"></span>
</div>

3. Style the clipboard.

#container-paste {
  position: fixed;
  bottom: 30px;
  left: 30px;
  color: white;
  background-color: rgba(10,10,10,.5);
  padding: 6px;
  border-radius: 10px;
}

#container-paste.failed { background-color: rgba(200,10,10,.5); }

4. Initialize the plugin.

$("#container-paste").paste();

5. Default plugin options.

status: "Paste",
processing: "<i class='fa fa-cog fa-spin'></i>", // font awesome 4
processingclass: "",
callback: function() {}; // callback

Change log:

2015-08-24

  • Added ability to override paste.fail message & delay

 


This awesome jQuery plugin is developed by atomicinfotech. For more Advanced Usages, please check the demo page or visit the official website.