Manager.js
Topics: What is it?Why should i use it?How do I use it?ImportingUsageInstancesShort CutsBasic ModulesTable of Modules Compatibility Demo
What is it?
Manager.js is a javascript library that lets you use some modules that I thought are usefull for web developers.
This means Manager.js is an important Module to use in your projectsWhy should i use it?
It is simple to work with It has a localStorage Manager It has a cookie manager It has a module manager And a lot more usefull modules
How do I use it?
As i've told you before, Manager.js has a lot of modules, so it must have been simple to use, that's why i Made it soo easy to use it
Importing
<script src="/path/to/manager.js" type="application/javascript"></script>
Usage
Manager.module();
Instances
var ANYWORD = Manager("MODULE");
Replace "MODULE" by te module you want, and "ANYWORD" by anyword you want
var instance = new Manager(); // will be an object
The above code must be used if you are having trubles with the word Manager and also $.m
Short Cuts
var lsm = new $.m.LSM("new"); // ...
Basic Modules
LSM/Local Storage Manager. visit LSM GitHub or LSM modulenew Manager.LSM("name");Time manager
new Manager.TM();require scripts
Manager.require("/path/to/script.js");extend functions to make them global
Manager.extends(function,"functionName");
Table of Modules
Here i present you the table of modules/properties
| Module/ Property |
Type | Module Init | Use |
| LSM | function,Constructor | new Manager.LSM(name,options) | Managing localStorage,sessionStorage 7 cookies |
| TM | function,Constructor | new Manager.TM(options) | Managing Date() and time functions |
| sortTable | function,Function | Manager.sortTable(table,method) | Sorting Tables |
| sortList | function,Function | Manager.sortList(list,method) | Sorting Lists |
| filter | function,Constructor | new Manager.filter(inpt,element,options) | Filtering elements like: div,li,td,tr |
| OBJM | function,Constructor | new Manager.OBJM(name) | Managing Object Controllers |
| http | function,Constructor | new Manager.http() | Managing Ajax/XMLHttpRequest |
| scrollDetection | function,Function | Manager.scrollDetection(el,options) | Detecting scroll direction |
| pickRandom | function,Function | Manager.pickRandom(words) | Picking a random word from words |
| randFrom | function,Function | Manager.randFrom(min,max) | Picking a random interval from 2 numbers, min & max |
| browserWindow | function,Constructor | new Manager.browserWindow(onpageshow,onpagehide) | Managing the window,onpageshow,onpagehide |
| claculator | function,Constructor | new Manager.claculator(args) | Calculating numbers |
| ifrCtrl | function,Constructor | new Manager.ifrCtrl(element) | Controlling iframes |
| component | function,Constructor | new Manager.component(element) | Managing & Creating elements |
| browser | object,Constructor | Manager.browser.prop | Getting the browser info |
| on | function,Function | Manager.on(el).event | Event Handler for manager |
| fetch | function,Function | Manager.fetch(url,functions,options) | Fetches data as json,xml,text... |
| animate | function,Function | Manager.animate(element,keyframes,count,time) | Css Animations from a javascript object |
| asLongAs | function,Function | Manager.asLongAs(condition) | While loop |
| extends | function,Function | Manager.extends(module,name,isUpdate) | Importing/defining function to Manager |
| extendsFunction | function,Function | Manager.extendsFunction(module,fun,isUpdate) | Importing/defining function from strings to Manager |
| eval | function,Function | Manager.eval(functions) | Run A Function from String |
| exec | function,Function | Manager.exec(module,args) | Executes A module |
| unExtend | function,Function | Manager.unExtend(module) | Removes a module |
| exportModule | function,Function | Manager.exportModule(module) | Exporting imported modules |
| define | function,Function | Manager.define(name,dependencies,module,options) | Importing/defining function to Manager with dependencies |
| defineIn | function,Function | Manager.defineIn([name,module],module2) | Importing/defining function to An Object with/without dependencies |
| require | function,Function | Manager.require(file,options) | Importing scripts |
| requireJSON | function,Function | Manager.requireJSON(json,prop) | Importing Objects from JSON files |
| getScript | function,Function | Manager.getScript(file) | Get a module from a well formatted manager/javascript file |
| fn | function,Constructor | new Manager.fn(element).prop(args) | Jquery Init |
A javascript library to manage Localstorage,Date,Cookies,Ajax/JQuery Ajax,Object Manager, it includes some of the amazing javasript apis i thought are usefull,
one of the main usefull apis is localstoragenew Manager.LSM("name")the 2nd one is DateTime manager
var TimeManager = new Manager.TM(); // simplifying TimeManagerThe other one is the javascript manager though i didn't mention it before,
console.log(TimeManager.time.fullyear);
Manager.require("/path/to/script.js",{ // included/imported
as: "name", extends: true, }); function hello(){ alert("Hello World!"); } Manager.extends(hello,"hello"); // Manager.extends(function,"functionName");
Manager.define("sayHello",["hello","LSM"],function(helloText){ Manager.hello(); // we extended this before
console.log(helloText); },{ //Required stuff
caseIns: false, // case Insensitive
}); Manager.exec('sayHello',"hii"); // function then arguments
Compatibility
Manager.js is compatible with almost everywhere. but it currently needs Jquery as a main executor,Demo
here is a demo at this repo, open it and be sure to open the DevTools, also you can visit the Demo here,