0.0.6 • Published 5 years ago

@uak2020/jquery-utilities v0.0.6

Weekly downloads
294
License
MIT
Repository
github
Last release
5 years ago

jquery-utilities

GitHub npm version Build Status Coverage Status Maintainability Test Coverage

istanbul (nyc) coverage report

StatementsBranchesFunctionsLines
StatementsBranchesFunctionsLines

About

A set of tools based on jQuery

  • Tool 1 - jQuery AJAX Manager

Installation

npm install @uak2020/jquery-utilities

Usage

Tool 1 Usage - jQuery AJAX Manager

var { JqAjaxGetManager, UserInteraction, JsHelper } = require('@uak2020/jquery-utilities');

var userInteraction = new UserInteraction();
var jsHelper = new JsHelper();
var ajaxGetMgr = new JqAjaxGetManager();
ajaxGetMgr.userInteraction = userInteraction;
ajaxGetMgr.jsHelper = jsHelper;
ajaxGetMgr.performAjaxGet(
    'http://localhost:5000/test',
    {
        successMessage: 'page loaded',
        successCallback: function (result, url, textStatus) {
            userInteraction.logit(result);
        }
    },
    {
        failureMessage: 'page load error',
        failureCallback: function (textStatus, errorThrown) {
            userInteraction.logerror(errorThrown);
        }
    }
);

Points to note:

  • successMessage and failureMessage can be omitted
  • successMessage and failureMessage if provided as above, then browser alerts will be shown
  • one must set "userInteraction" field/property of JqAjaxManager object as done above like: ajaxMgr.userInteraction = userInteraction;
  • one must set "jsHelper" field/property of JqAjaxManager object as done above like: ajaxMgr.jsHelper = jsHelper;

Tests

yarn test

Contributing

In lieu of a formal style guide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality. Lint and test your code.

0.0.6

5 years ago

0.0.5

5 years ago

0.0.4

5 years ago

0.0.3

5 years ago

0.0.1

5 years ago