Skip to content
This repository has been archived by the owner on Oct 15, 2020. It is now read-only.

Commit

Permalink
https://github.com/NanoMeow/QuickReports/issues/852
Browse files Browse the repository at this point in the history
  • Loading branch information
jspenguin2017 committed Apr 6, 2019
1 parent cce5ad7 commit 5b139bc
Show file tree
Hide file tree
Showing 2 changed files with 71 additions and 3 deletions.
32 changes: 32 additions & 0 deletions NanoFilters/NanoResources.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,38 @@ nano-tiny-noopvast-2.0 text/xml
nano-tiny-noopvast-3.0 text/xml
<VAST version="3.0"></VAST>

nano-assign-variable-onready.js application/javascript
(function() {
var chain = '{{1}}';
var value = '{{2}}';
if ( chain === '' || chain === '{{1}}' ) {
return;
}
if ( value === 'null' ) {
value = null;
} else if ( value === 'true' ) {
value = true;
} else if ( value === 'false' ) {
value = false;
} else {
return;
}
var assign = function() {
var parent = window;
chain = chain.split('.');
for ( var i = 0; i < chain.length - 1; i++ ) {
parent = parent[chain[i]];
}
parent[chain[chain.length - 1]] = value;
};
if ( document.readyState === 'interactive' ||
document.readyState === 'complete' ) {
assign();
} else {
addEventListener('DOMContentLoaded', assign);
}
})();

nano-vvvvid-it.js application/javascript
(function() {
// Based on KAADIVVVV
Expand Down
42 changes: 39 additions & 3 deletions NanoFiltersSource/NanoResources.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,42 @@ nano-tiny-noopvast-3.0 text/xml
<VAST version="3.0"></VAST>


# Assign a variable when the document gets ready, 2 required arguments.
# chain - The property chain.
# value - The value to assign, must be 'null', 'true', or 'false'.
nano-assign-variable-onready.js application/javascript
(function() {
var chain = '{{1}}';
var value = '{{2}}';
if ( chain === '' || chain === '{{1}}' ) {
return;
}
if ( value === 'null' ) {
value = null;
} else if ( value === 'true' ) {
value = true;
} else if ( value === 'false' ) {
value = false;
} else {
return;
}
var assign = function() {
var parent = window;
chain = chain.split('.');
for ( var i = 0; i < chain.length - 1; i++ ) {
parent = parent[chain[i]];
}
parent[chain[chain.length - 1]] = value;
};
if ( document.readyState === 'interactive' ||
document.readyState === 'complete' ) {
assign();
} else {
addEventListener('DOMContentLoaded', assign);
}
})();


# ---------------------------------------------------------------------------- #

# Specific resources
Expand Down Expand Up @@ -193,7 +229,7 @@ nano-hijack-script-create.js application/javascript
})();


# Remove elements when the documents gets ready, 1 required argument.
# Remove elements when the document gets ready, 1 required argument.
# selector - The selector for elements to remove, must be a plain CSS selector,
# pseudo-selectors are not supported.
nano-remove-elements-onready.js application/javascript
Expand Down Expand Up @@ -243,7 +279,7 @@ nano-make-bait-element.js application/javascript
# filter lists


# Click elements when the documents gets ready, 1 required argument.
# Click elements when the document gets ready, 1 required argument.
# selector - The selector for elements to remove, must be a plain CSS selector,
# pseudo-selectors are not supported.
nanop-click-elements-onready.js application/javascript
Expand Down Expand Up @@ -271,7 +307,7 @@ nanop-click-elements-onready.js application/javascript
})();


# Click elements when the documents gets loaded, 1 required argument.
# Click elements when the document gets loaded, 1 required argument.
# selector - The selector for elements to remove, must be a plain CSS selector,
# pseudo-selectors are not supported.
nanop-click-elements-onload.js application/javascript
Expand Down

0 comments on commit 5b139bc

Please sign in to comment.