Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

themitosan/TMS.js

Open more actions menu

Repository files navigation


TMS.js
license build_status

Created by TheMitoSan, this is a simple plugin for managing css and HTML stuff without jQuery.

Setup

[TS] - It's deadly simple!

  • Download TMS.ts file and put it among your source files
  • Use a simple import to carry what you will need.
    Example: import * as TMS from './TMS.js';
  • Smile: you are a great person!

Here is a preview of how to use some commands:

TMS.css(domId, cssChanges)

Apply CSS style on a DOM Element.

TMS.css('myDiv', {'width': '1920px', height: '1080px'});

TMS.focus(domId)

Gives focus to a specific DOM Element.

TMS.focus('myButton');

TMS.scrollCenter(domId)

This function will focus a DOM Element inside a scrollable list, making it centered.

TMS.scrollCenter('betrayDiv');

TMS.addClass(domId, className)

This will append a specified CSS class to a DOM Element.

TMS.addClass('myDiv', 'fixWidth');

TMS.removeClass(domId, className)

This will remove some specific class from a DOM Element.

TMS.removeClass('myDiv', 'fixWidth');

Context

You can also provide other contexts for all available functions. This allows you to manipulate data from other windows (like nwjs nw.Window.open function).

Example:

/*
	Using TMS.js context with TS
*/

// Import module and create context variable
import * as TMS from './TMS';
var context:Document;

// Open window
nw.Window.open('project/somePage.html', {}, function(data:any){
	context = data.window.document;
});

// Set div CSS data from new opened window by providing context
TMS.css('someDivInsideNewWindow', { 'width': '100%', height: '20px' }, context);

External scripts / plugins used on this project:

Many Thanks To:

About

This is a simple plugin for managing CSS and HTML suff without jQuery.

Topics

Resources

License

Stars

Watchers

Forks

Morty Proxy This is a proxified and sanitized view of the page, visit original site.