Icontem

jQuery Annex: General purpose functions missing in jQuery

Recommend this page to a friend!
  Info   View files View files (34)   DownloadInstall with Composer Download .zip   Reputation   Support forum   Blog    
Last Updated Ratings Unique User Downloads Download Rankings
2017-07-25 (23 days ago) RSS 2.0 feedNot enough user ratingsTotal: 442 All time: 67 This week: 7Up
Version License JavaScript version Categories
jquery-annex 39GNU General Publi...1.6jQuery, Utilities and Tools
Description Author

This package provides general purpose functions missing in jQuery library.

It extends the jQuery object, jQuery enabled objects and selectors to provide many additional features useful for different purposes like:

- creating jQuery-enabled DOM-elements on the fly
- checking if a variable exists, is set and if it has a certain type
- checking if an object all has given variables set
- complex replacing or truncating of strings
- (re)scheduling timed invocations of callback functions
- reloading the current page or redirecting the browser to a new URL with complex parameter sets
- setting or getting the current URL anchor or cookie values
- extracting CSS property values for code or template use
- deselecting any content in a page or make a dom element unselectable
- measuring hidden elements
- etc.

Name: Sebastian Schlapkohl <contact>
Classes: 1 package by
Country: Germany Germany
Age: 34
All time rank: 543 in Germany Germany
Week rank: 16 Up2 in Germany Germany Up

Details

jQuery Annex

Written by: Sebastian Schlapkohl eMail: jqueryannex@ifschleife.de Sites: github, ifschleife

What is this?

Annex is a jQuery-core-expanding collection of "nice to have" methods you'll need more often than not. The basic idea was (and is) to streamline most vanilla-js leftovers every javascript dev still has to deal with (like timeouts) and provide methods for those things as well as the stuff everyone searches for in jQuery at least once, but which aren't there (yet).

An example? Load a stylesheet the same way you'd load a script with getScript().

Another example? Flexible, centrally disablable console logging with check if the console is available.

Some more? Polling. A real isNaN. Pythonic string formatting. Precise long running timers. Method throttling. History manipulation. Image preloading. Webfont display callback. Sane date objects. And so on and so forth ...

Generally speaking: everytime i need some general missing functionality, semantically fitting with the jQuery core, I implement a generic solution. If something gets absorbed by the core it will be removed.

Annex should always fit the current jQuery version. Changes may be breaking but are documented in the commits. The fitting jQuery version is always included in the uncompressed file's header doc.

How do I include and use this?

Easy as pie. Just include it after jQuery and you're good to go.

<script src="jquery-x.xx.x.min.js"></script>
<script src="jquery.annex.min.js"></script>

If you need some pointers about the possibilities, in the "/doc"-folder an expansive documentation (open index.html), where each method also includes examples.

And if I want to load this as a module?

Just use it the same as you would with jQuery. Define it as a package in your paths/maps and require it. jQuery, of course, is an automatic dependency.

Is this any good, why should I use this?

Everytime I have to do a one pager or smaller project without this helper lib I'm frustrated about the fact, that I, again, have to deal with all those already solved problems and bloat by code with those typical, ugly javascript weirdnesses.

This just lets you streamline everyday jQuery code and make things generally more friendly, for the price of 25kb.

In bigger projects, I'd recommend a solid framework like angular or backbone and maybe add underscore, here jQuery, if used at all, is mostly included for it's selector engine. So a jQuery addition seems a little pointless.

So in summary: Annex is a good addition for small to medium projects with a heavy focus on jQuery.

What's this validation plugin stuff?

A while ago I wrote HtmlForm, which is a form definition framework for PHP5. One result of this project was complex javascript form validation. When I moved away from server-side code to the client I suddenly needed form validation without the PHP context and decided to move the javascript validation part into an Annex-plugin.

This little piece of code is the result.

You can do quite advanced stuff with this plugin and I already used this for quite complex, bigger projects with knockout for example, but the API is still a little strange and convoluted for my taste, which is a result of the original validation structure of HtmlForm.

Nonetheless, this is quite mighty and the example implementation in plugin-validation-example will give you a good idea about the general workings.

By the way: this is a form validator, not an object or schema validator. If you don't have an actual form to validate, do yourself a favour and use SchemaInspector.

  Files folder image Files  
File Role Description
Files folder imagedist (4 files)
Files folder imagedoc (2 files, 3 directories)
Files folder imageexamples (2 files, 1 directory)
Files folder imagesrc (2 files)
Accessible without login Plain text file .editorconfig Data Auxiliary data
Accessible without login Plain text file .jshintrc Data Auxiliary data
Accessible without login Plain text file bower.json Data Auxiliary data
Accessible without login Plain text file gulpfile.js Aux. Auxiliary script
Accessible without login Plain text file jsdoc-conf.json Data Auxiliary data
Accessible without login Plain text file package.json Data Auxiliary data
Accessible without login Plain text file readme.md Data Auxiliary data

  Files folder image Files  /  dist  
File Role Description
  Plain text file jquery.annex.js Class Class source
  Plain text file jquery.annex.js.map Class Class source
  Accessible without login Plain text file jquery.annex.validation-plugin.js Example Example script
  Accessible without login Plain text file jquery.annex.validation-plugin.js.map Example Example script

  Files folder image Files  /  doc  
File Role Description
Files folder imagefonts (6 files)
Files folder imagescripts (1 file, 1 directory)
Files folder imagestyles (3 files)
  Accessible without login HTML file index.html Doc. Documentation
  Accessible without login HTML file jquery.annex.js.html Doc. Documentation

  Files folder image Files  /  doc  /  fonts  
File Role Description
  Accessible without login Plain text file OpenSans-Bold-webfont.svg Data Auxiliary data
  Accessible without login Plain text file OpenSans-BoldItalic-webfont.svg Data Auxiliary data
  Accessible without login Plain text file OpenSans-Italic-webfont.svg Data Auxiliary data
  Accessible without login Plain text file OpenSans-Light-webfont.svg Data Auxiliary data
  Accessible without login Plain text file OpenSans-LightItalic-webfont.svg Data Auxiliary data
  Accessible without login Plain text file OpenSans-Regular-webfont.svg Data Auxiliary data

  Files folder image Files  /  doc  /  scripts  
File Role Description
Files folder imageprettify (3 files)
  Accessible without login Plain text file linenumber.js Aux. Auxiliary script

  Files folder image Files  /  doc  /  scripts  /  prettify  
File Role Description
  Accessible without login Plain text file Apache-License-2.0.txt Doc. Documentation
  Accessible without login Plain text file lang-css.js Aux. Auxiliary script
  Accessible without login Plain text file prettify.js Example Example script

  Files folder image Files  /  doc  /  styles  
File Role Description
  Accessible without login Plain text file jsdoc-default.css Data Auxiliary data
  Accessible without login Plain text file prettify-jsdoc.css Data Auxiliary data
  Accessible without login Plain text file prettify-tomorrow.css Data Auxiliary data

  Files folder image Files  /  examples  
File Role Description
Files folder imagelib (4 files)
  Accessible without login HTML file index.html Doc. Documentation
  Accessible without login HTML file plugin-validation-example.html Doc. Documentation

  Files folder image Files  /  examples  /  lib  
File Role Description
  Plain text file jquery-1.12.4.min.js Class Class source
  Accessible without login Plain text file jquery-1.12.4.min.map Data Auxiliary data
  Plain text file jquery.annex.js Class Class source
  Accessible without login Plain text file jquery.annex.validation-plugin.js Example Example script

  Files folder image Files  /  src  
File Role Description
  Plain text file jquery.annex.js Class Class source
  Accessible without login Plain text file jquery.annex.validation-plugin.js Example Example script

 Version Control Unique User Downloads Download Rankings  
 100%
Total:442
This week:0
All time:67
This week:7Up