Security News
tea.xyz Spam Plagues npm and RubyGems Package Registries
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
fmjquery
Advanced tools
Readme
This repo contains some jQuery plugins that we might use at Fusionary. They are sparsely documented below.
All of the following require jQuery. Some require other things, as noted.
$.fn.accordiontabs(options)
Extends the tabs widget so that tabs will turn into accordion at a certain breakpoint.
options:
Same options as .tabs()
, plus:
breakpoint
: Number. Default undefined
isAccordion
: FunctionaccordionCollapsible
: BooleanisAccordionClass
: StringaccordionShow
: Object {effect: 'slideDown', duration: 200}
headingHtml
: FunctionRequires:
$.cachedAjax(url, options)
Same options as $.ajax()
Returns the jqXHR
Promise-like object
Requires:
import {serialize} from './url'
, so you don't have to do anything if you're using it with the rest of the repo and using Babel/Webpack/whateverModal plugin.
Usage
// Initialize
$('.foo').modal({
beforeOpen: function(data) {
data.content.empty().append('<div>hello world!</div>');
}
});
// Open
$('.foo').on('click', function() {
$('.foo').modal('open', otherOptions);
});
Styles
Default stylesheet is at css/jquery.modal.css. Note that if you change templates, the default styles may no longer work.
Default options:
settings = {
keepFocus: true,
templates: {
modal: '<div class="Modal" aria-live="polite"></div>',
content: '<div class="Modal-content"></div>',
closeDiv: '<div class="Modal-close"></div>',
closeBtn: '<button class="Modal-closeBtn Button Button--close">×</button>'
},
classes: {
modal: 'js-modal',
content: 'js-modalContent',
closeDiv: 'js-closeModalWrapper',
closeBtn: 'js-closeModal',
active: 'is-active'
},
// events
onInit: null,
beforeOpen: null,
// If show === false in the callback arg, it does not go through with the open:
beforeOpenAsync: null, // function(data, callback) { /* do something async */ callback(show); }
afterOpen: null,
beforeClose: null,
afterClose: null
};
Methods
init
: This is the default method. Creates the modal div and appends it to the body.open
: "Opens" the modal by adding the "is-active" class.close
: "Closes" the modal by removing the "is-active" class.destroy
: Removes the modal and its data & events.options
: Gets or sets options for the modal.$.fn.formField(options)
Widget-like plugin that allows for the "float-label" thing.
Default options:
settings = {
emptyClass: 'is-empty',
notEmptyClass: 'is-notEmpty',
focusClass: 'is-focused',
requiredClass: 'is-required',
containers: '.FormField--floatLabel',
inputs: '.FormField-input',
labels: '.FormField-label'
};
Methods:
init
: This is the default method.setFields
: e.g. $('form or formFieldContainer(s)').formField('setFields', options)
. This is helpful if .formField()
has already been called on the form and fields are injected later .destroy
: e.g. $('form or formFieldContainer(s)').formField('destroy')
options
Requires:
$.fn.imagesLoaded(function, context)
Executes a function when images have loaded.
Default context is first image if there are images in the collection, or current DOM element if no images in collection.
FAQs
Some jQuery plugins that we might use at Fusionary.
The npm package fmjquery receives a total of 4 weekly downloads. As such, fmjquery popularity was classified as not popular.
We found that fmjquery demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.
Security News
UnitedHealth Group disclosed that the ransomware attack on Change Healthcare compromised protected health information for millions in the U.S., with estimated costs to the company expected to reach $1 billion.