AutoTagger v1.0

This plugin will analyse the text of a form field, run it through the Yahoo Term Extraction Web Service and provides a list of signifiant words or phrases as tags.



Details

Author
Adrian Statescu
Current version
v1.0
GitHub
thinkphp/AutoTagger
Downloads
1629
Category
Utilities
Tags
Report
GitHub Issues

Releases


Dependencies

  • core/1.3: *
  • more/1.3.0.1: Request.JSONP

How to use

First you must to include the JS files in the head of your HTML document.

    #HTML
    <script type="text/javascript" src="mootools-core.js"></script>
    <script type="text/javascript" src="Request.JSONP.js"></script>
    <script type="text/javascript" src="AutoTagger.js"></script>

In your JS.

   #JS
   (function($){
      window.addEvent('domready',function() {
         $('bt').addEvent('click',function() {
           new AutoTagger('context',{
               onComplete: function(tags) {
                  $('context').setStyle('opacity','1.0').removeClass('loading');                    
                  $('tags').set('value', tags);
               },
               onRequest: function(scriptSrc, scriptEl) {
                  $('context').setStyle('opacity','0.5').addClass('loading'); 
                  if(window.console) {console.log('make a request!'); }
               }
           }).send(); 
         });
      });
   })(document.id);

In your HTML.

   #HTML
   <div class="yui-g">
    <label for="context">Your message:</label>
    <textarea id="context">
      Mathematical analysis, which mathematicians refer to simply as analysis, has its beginnings in the rigorous formulation of infinitesimal calculus. It is a branch of pure mathematics that includes the theories of differentiation, integration and measure, limits, infinite series,[1] and analytic functions. These theories are often studied in the context of real numbers, complex numbers, and real and complex functions. However, they can also be defined and studied in any space of mathematical objects that has a definition of nearness (a topological space) or, more specifically, distance (a metric space).
    </textarea>
    <button id="bt">Get</button>
    <label for="tags">Tags:</label><input type="text" id="tags" />
    </div>

Notes:

You can view in action:

Requirements:

  • MooTools Core 1.3
  • MooTools More (Request.JSONP)

Discuss

A note on comments here: These comments are moderated. No comments will show up until they are approved. Comments that are not productive (i.e. inflammatory, rude, etc) will not be approved.

Found a bug in this plugin? Please report it this repository's Github Issues.

blog comments powered by Disqus