Skip to content

MaanooAk/Qs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

38 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Qs

A light JavaScript function library

Functions | Files | Usage | Qs.min.js raw

Functions

Names

Selectors
  q          Query
  qi         Query by Id
  qa         Query All
  qs         Query in Sub element
  qas        Query All in Sub element

For each 
  ff         For each call Function
  qaff       Query All For each call Function
  qasff      Query All in Sub element For each call Function
  fif        For each Integer from 0 call Function

Classes 
  cls        add and remove CLaSses
  qacls      Query All For each add and remove CLaSses
  qascls     Query All in Sub element For each add and remove CLaSses

Requests 
  r          Request 
  rp         Request Post
  rg         Request Get
  rgr        Request Get Raw link

Other
  cloneTemplate
  elementFromHtml
  onEnter
  onScrollNearEnd

Documentation

See the API or go to Documentation wiki page.

Notes

  • In the query functions the the CSS selectors are be used, eg. q("#side > img"), qa(".item") and qaff(".item.hidden", function(i) {...}).
  • The params parameters in the request functions are objects, eg. {name:"maanoo", color:"red"}, {json:"", count:"12"} and {} (they will be stringified into name=maanoo&color=red, json&count=12 and empty string).
  • In the callback functions the text variable contains the response text and the code variable the response code.

Files

File Description
Qs.js The library
Qs.min.js The library compressed with Closure Compiler (Compress now)
parts/Qs.?.js The library split into independent sub-libraries

Usage

Put the Qs.min.js in the project folder and add the following tag to the header of the html page

<script src="Qs.min.js"></script>

For faster loading you can paste the content of the Qs.min.js inside a script tag

<script type="application/javascript">
<!-- paste here -->
</script>

Development

The files inside parts/ should be edited.

For the creation of Qs.js and Qs.min.js:

make

For the creation of API.md:

make docgen

For windows users the make win should be used.

Dependencies

About

A light JavaScript function library

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published