Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

jquery-scopelinktags

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

jquery-scopelinktags - npm Package Compare versions

Comparing version 0.9.1 to 0.10.0

demo/custom-link-tag-selector.html

2

package.json
{
"name": "jquery-scopelinktags",
"version": "0.9.1",
"version": "0.10.0",
"description": "A jQuery plugin that scopes the CSS rules of <link> tags",

@@ -5,0 +5,0 @@ "main": "./src/jquery.scopeLinkTags.js",

@@ -26,2 +26,10 @@ jQuery ScopeLinkTags plugin

### styleTagSelector
Type: [String](http://api.jquery.com/Types/#String) (Default: `'style'`)
Can be used to change the selector used to find the `<style>` tags.
### cssLinkSelector
Type: [String](http://api.jquery.com/Types/#String) (Default: `'link[type="text/css"]'`)
Can be used to change the selector used to find the `<link>` tags.
### cssRuleRegex

@@ -28,0 +36,0 @@ Type: [Regex](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp)

@@ -107,2 +107,7 @@ ;(function ($, window, document, undefined) {

var selectorDefaults = {
styleTagSelector: 'style',
cssLinkSelector: 'link[type="text/css"]' // [rel='stylesheet' ]
};
$.fn[pluginName] = function (options) {

@@ -112,7 +117,11 @@ var result,

var STYLE_TAG_SELECTOR = 'style';
var CSS_LINK_SELECTOR = 'link[type="text/css"]'; // [rel='stylesheet' ]
var selectorOptions = $.extend({}, selectorDefaults, options);
var $filteredStyleElements = this.filter(STYLE_TAG_SELECTOR);
var $filteredLinkElements = this.filter(CSS_LINK_SELECTOR);
var $filteredLinkElements = this.filter(selectorOptions.cssLinkSelector);
var $filteredStyleElements = this.filter(selectorOptions.styleTagSelector);
var allCssTagSelector = [
selectorOptions.cssLinkSelector,
selectorOptions.styleTagSelector
].join(', ');

@@ -123,3 +132,3 @@ var $links = $filteredLinkElements.length ?

$filteredStyleElements :
this.find(CSS_LINK_SELECTOR + ', ' + STYLE_TAG_SELECTOR);
this.find(allCssTagSelector);

@@ -129,3 +138,3 @@ $links.each(function () {

var instance = $.data(this, pluginName);
if (!instance && $this.is(CSS_LINK_SELECTOR)) {
if (!instance && $this.is(allCssTagSelector)) {
instance = new Plugin(this, options);

@@ -132,0 +141,0 @@

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc