About of AntLike button

AntLike button, is the jQuery like button plug-in of AntProduction.


Have a question about AntLike button ? Please use GitHub Issue.

Documentation of AntLike button

AntLike button, is a button with 2 states: like and unlike and a counter which counts the number of "like". The original state is unlike. When user click on AntLike button for the first time, the state become "like" and the counter is incremented. If the user click again the original state is restored and the counter is drecemented.


String.js is required: download

Fields Description
HtmlContent [html] The basic template Html to display the AntLike button.
like [json] Like is a json object that contains description of "like" state. It's compounded by :
  • image: the relative path of directory of the like icon of AntLike button
  • alt: the label of alt parameter of the like icon of AntLike button
  • title: the label of the tooltip of the like icon of AntLike button
unlike [json] Unlike is a json object that contains description of "unlike" state. It's compounded by :
  • image: the relative path of directory of the unlike icon of AntLike button
  • alt: the label of alt parameter of the unlike icon unlike of AntLike button
  • title: the label of the tooltip of the unlike icon of AntLike button
events [json] Events is a json object that contains description of events. 2 events are availiables :
    OnClick
  • url: the url of method called by Ajax request with Post method. If null, value by default, Ajax requests are disabled otherwise they are activated.
  • async: boolean to define if the Ajax request is asynchronous or not
  • action: method to manage click event

    OnLoad
  • enabled: boolean to define if this event is activated.
  • url: the url of method called by Ajax request with Post method. If null, value by default, Ajax requests are disabled otherwise they are activated.
  • action: method to manage load event
nbLikes [integer] the current value of AntLike button counter
readOnly [boolean] Is the parameter to disable events of AntLike button.
style [string] Is the parameter to define the CSS style of the AntLike button.
    Available styles are :
  • basic (blue style)
  • red-grey
  • green
userLike [boolean] the current state of AntLike button

Triggers of AntLike button

Trigger Parameters
update
Trigger to update current state and value of AntLike button
likeVm [json object] Json object compounded like this:
  • userLike: boolean to define the state of AntLike button
  • nbLikes: integer to define the value of the counter of AntLike button

usage:
$(this).trigger('AntLike.update', { "userLike": true, "nbLikes": 12 });

Samples of AntColorPicker

Basic sample of AntLike button. Try it
Sample of AntLike button based on Ajax Post requests for loading and updating. Try it
Sample of paired AntLike button. Try it