From 6a51819af7381e2fd7e64de41683ee6331ecca06 Mon Sep 17 00:00:00 2001 From: Ludovic CHEVALIER Date: Fri, 14 Mar 2014 14:18:53 +0100 Subject: [PATCH] [SPIP] ~v3.0.15 --> v3.0.16 --- www/CHANGELOG.txt | 27 + www/config/ecran_securite.php | 9 +- www/ecrire/action/editer_rubrique.php | 32 +- www/ecrire/inc/editer.php | 53 +- www/ecrire/inc/filtres_ecrire.php | 3 +- www/ecrire/inc_version.php | 2 +- www/ecrire/maj/svn10000.php | 4 + www/ecrire/paquet.xml | 2 +- www/ecrire/public/debusquer.php | 46 +- www/ecrire/public/quete.php | 2 +- .../fsource_csstidy__class.csstidy.php.html | 1038 ----------- ...e_csstidy__class.csstidy_optimise.php.html | 851 --------- ...urce_csstidy__class.csstidy_print.php.html | 402 ----- .../fsource_csstidy__data.inc.php.html | 521 ------ .../lib/csstidy/Docs/classtrees_csstidy.html | 62 - .../csstidy/_class_csstidy_optimise_php.html | 97 -- .../Docs/csstidy/_class_csstidy_php.html | 130 -- .../csstidy/_class_csstidy_print_php.html | 97 -- .../csstidy/Docs/csstidy/_data_inc_php.html | 483 ----- .../lib/csstidy/Docs/csstidy/csstidy.html | 1550 ----------------- .../Docs/csstidy/csstidy_optimise.html | 705 -------- .../csstidy/Docs/csstidy/csstidy_print.html | 617 ------- .../lib/csstidy/Docs/elementindex.html | 386 ---- .../csstidy/Docs/elementindex_csstidy.html | 405 ----- .../compresseur/lib/csstidy/Docs/errors.html | 51 - .../compresseur/lib/csstidy/Docs/index.html | 68 - .../lib/csstidy/Docs/li_csstidy.html | 68 - .../lib/csstidy/Docs/media/background.png | Bin 238 -> 0 bytes .../lib/csstidy/Docs/media/empty.png | Bin 206 -> 0 bytes .../lib/csstidy/Docs/media/style.css | 197 --- .../lib/csstidy/Docs/todolist.html | 77 - .../compresseur/lib/csstidy/README | 8 +- .../compresseur/lib/csstidy/class.csstidy.php | 326 ++-- .../lib/csstidy/class.csstidy_ctype.php | 45 - .../lib/csstidy/class.csstidy_optimise.php | 198 ++- .../lib/csstidy/class.csstidy_print.php | 60 +- .../compresseur/lib/csstidy/cssparse.css | 118 -- .../compresseur/lib/csstidy/cssparsed.css | 29 - .../compresseur/lib/csstidy/data.inc.php | 1048 ++++++----- .../compresseur/lib/csstidy/template.tpl | 10 - .../compresseur/lib/csstidy/template1.tpl | 12 - .../compresseur/lib/csstidy/template2.tpl | 5 - .../compresseur/lib/csstidy/template3.tpl | 1 - www/plugins-dist/compresseur/paquet.xml | 2 +- www/plugins-dist/forum/forum_autoriser.php | 10 + www/plugins-dist/forum/paquet.xml | 2 +- .../prive/objets/liste/participer_forum.html | 4 +- .../objets/liste/participer_forum_thread.html | 8 +- .../squelettes/inclure/discuter_forum.html | 11 +- www/plugins-dist/medias/modeles/image.html | 9 +- www/plugins-dist/medias/paquet.xml | 2 +- .../inc-destinataires-message.html | 4 +- .../organiseur/prive/rss/messages.html | 2 +- .../porte_plume/tests/all_tests.php | 8 +- .../tests/barre_outil_markitup.php | 122 +- .../porte_plume/tests/lanceur_spip.php | 21 +- .../textwheel/engine/textwheel.php | 15 +- www/plugins-dist/textwheel/paquet.xml | 2 +- .../formulaires/editer_url_objet.php | 4 +- www/plugins-dist/urls_etendues/paquet.xml | 2 +- .../formulaires/ecrire_auteur.php | 5 +- www/svn.revision | 12 +- 62 files changed, 1110 insertions(+), 8980 deletions(-) delete mode 100644 www/plugins-dist/compresseur/lib/csstidy/Docs/__filesource/fsource_csstidy__class.csstidy.php.html delete mode 100644 www/plugins-dist/compresseur/lib/csstidy/Docs/__filesource/fsource_csstidy__class.csstidy_optimise.php.html delete mode 100644 www/plugins-dist/compresseur/lib/csstidy/Docs/__filesource/fsource_csstidy__class.csstidy_print.php.html delete mode 100644 www/plugins-dist/compresseur/lib/csstidy/Docs/__filesource/fsource_csstidy__data.inc.php.html delete mode 100644 www/plugins-dist/compresseur/lib/csstidy/Docs/classtrees_csstidy.html delete mode 100644 www/plugins-dist/compresseur/lib/csstidy/Docs/csstidy/_class_csstidy_optimise_php.html delete mode 100644 www/plugins-dist/compresseur/lib/csstidy/Docs/csstidy/_class_csstidy_php.html delete mode 100644 www/plugins-dist/compresseur/lib/csstidy/Docs/csstidy/_class_csstidy_print_php.html delete mode 100644 www/plugins-dist/compresseur/lib/csstidy/Docs/csstidy/_data_inc_php.html delete mode 100644 www/plugins-dist/compresseur/lib/csstidy/Docs/csstidy/csstidy.html delete mode 100644 www/plugins-dist/compresseur/lib/csstidy/Docs/csstidy/csstidy_optimise.html delete mode 100644 www/plugins-dist/compresseur/lib/csstidy/Docs/csstidy/csstidy_print.html delete mode 100644 www/plugins-dist/compresseur/lib/csstidy/Docs/elementindex.html delete mode 100644 www/plugins-dist/compresseur/lib/csstidy/Docs/elementindex_csstidy.html delete mode 100644 www/plugins-dist/compresseur/lib/csstidy/Docs/errors.html delete mode 100644 www/plugins-dist/compresseur/lib/csstidy/Docs/index.html delete mode 100644 www/plugins-dist/compresseur/lib/csstidy/Docs/li_csstidy.html delete mode 100644 www/plugins-dist/compresseur/lib/csstidy/Docs/media/background.png delete mode 100644 www/plugins-dist/compresseur/lib/csstidy/Docs/media/empty.png delete mode 100644 www/plugins-dist/compresseur/lib/csstidy/Docs/media/style.css delete mode 100644 www/plugins-dist/compresseur/lib/csstidy/Docs/todolist.html delete mode 100644 www/plugins-dist/compresseur/lib/csstidy/class.csstidy_ctype.php delete mode 100644 www/plugins-dist/compresseur/lib/csstidy/cssparse.css delete mode 100644 www/plugins-dist/compresseur/lib/csstidy/cssparsed.css delete mode 100644 www/plugins-dist/compresseur/lib/csstidy/template.tpl delete mode 100644 www/plugins-dist/compresseur/lib/csstidy/template1.tpl delete mode 100644 www/plugins-dist/compresseur/lib/csstidy/template2.tpl delete mode 100644 www/plugins-dist/compresseur/lib/csstidy/template3.tpl diff --git a/www/CHANGELOG.txt b/www/CHANGELOG.txt index 1b7b1508..7fab8dd8 100644 --- a/www/CHANGELOG.txt +++ b/www/CHANGELOG.txt @@ -1,3 +1,30 @@ + +SPIP-Core spip-3.0.15 -> spip-3.0.16 13 mars 2014 +------------------------------------------------------------- +r21232 | cedric | (sam. 22 févr. 2014) | Ferme #3143 : pipelines pre_edition et post_edition dans rubrique_instituer +r21236 | cedric | (dim. 23 févr. 2014) | Report de r21211 : Depuis r14416 les tests simpletest ne fonctionnaient plus car ne récupéraient plus le tableau des erreurs du debusqueur. On permet d'obtenir ces informations (et d'effacer le tableau) via un 3e argument. +r21237 | denisb | (lun. 24 févr. 2014) | ecrire/inc_version.php : "Vingt fois sur le métier remettez votre ouvrage ; Polissez-le sans cesse et le repolissez : Ajoutez quelques fois et souvent effacez. " +r21238 | denisb | (lun. 24 févr. 2014) | ecrire/paquet.xml : vingt-et-un ! (voir commit précédent). +r21241 | cedric | (mar. 04 mars 2014) | Ferme #3176 : quand == == on reste sur le cas par defaut de == (severo) +r21243 | cedric | (mer. 05 mars 2014) | une securite qui evite de perdre des donnees dans le cas idiot ou la table _liens n'est pas creee +r21246 | cedric | (ven. 07 mars 2014) | Un echappement manquant dans une requete SQL, c'est mal (Philippe Baumgart et al) +r21253 | cedric | (sam. 08 mars 2014) | la fonction titre_automatique fait appel à la fonction surchargeable titrer_contenu qui calcul un titre pour un contenu donné.La fonction titrer_contenu peut recevoir le contenu sous forme de tableau, ou utiliser les valeurs du POST +r21258 | cedric | (jeu. 13 mars 2014) | Report de http://zone.spip.org/trac/spip-zone/changeset/81334 : v 1.1.9 : on est plus radical avec les tentatives d'injection par connect : aucune chance que ce soit une demande licite, on bloque donc le hit, cela evite de generer des cache compile foireux + +SPIP-plugins-dist spip-3.0.15 -> spip-3.0.16 13 mars 2014 +------------------------------------------------------------- +r80997 | cedric | (dim. 23 févr. 2014)| Report de r80808 : Mise à jour du lanceur de simpletest +r80998 | cedric | (dim. 23 févr. 2014)| Report de r80752 : Adaptation des tests à la nouvelle version de SimpleTest (et notices php en moins) +r81069 | cy_altern | (mer. 26 févr. 2014)| report 81067 +r81101 | cy_altern | (jeu. 27 févr. 2014)| un GET sans SET: la variable name est dans ENV +r81208 | cedric | (mer. 05 mars 2014) | Report de http://core.spip.org/projects/spip/repository/revisions/21242 : ne pas injecter un largeur="0" et hauteur="0" si c'est une image (distante) dont on ne connait pas les dimensions.(laisser faire le navigateur) +r81254 | cedric | (ven. 07 mars 2014) | bugfix : lorsque le type d'URL était fixé par la globale et non par la meta, le formulaire d'edition ne fonctionnait pas bien (il ne chargeait pas le bon module) +r81266 | b_b | (ven. 07 mars 2014) | report plus que tardif de r65147 qui fixait http://core.spip.org/issues/2827 (vraiment limiter le sujet à 3 caractères min) +r81273 | eric | (sam. 08 mars 2014) | Ajout d'une autorisation générique participer aux forums privés pour un objet quelconque. Cette autorisation permet d'afficher ou non les boutons "poster un message" ou "répondre au message".Par défaut, cette autorisation est toujours vraie.Tout objet peut la surcharger. +r81321 | cedric | (jeu. 13 mars 2014) | Report de r81300 : reparer le if_stri automatique sur les if_str ayant des lettres +r81322 | cedric | (jeu. 13 mars 2014) | Report de r81320 : complement de r81300 : il faut initialiser la regle avant de la rejeter sur le critere if_str/if_stri car il peuvent etre optimise par l'initialisation (un if_str sur une chaine case sensitive est automatiquement transforme en if_stri) +r81332 | cedric | (jeu. 13 mars 2014) | Upgrade de la librairie CSSTidy en v1.5.2 + SPIP-Core spip-3.0.14 -> spip-3.0.15 21 février 2014 ------------------------------------------------------------- diff --git a/www/config/ecran_securite.php b/www/config/ecran_securite.php index 7e6ec1c5..36b00446 100644 --- a/www/config/ecran_securite.php +++ b/www/config/ecran_securite.php @@ -5,7 +5,7 @@ * ------------------ */ -define('_ECRAN_SECURITE', '1.1.8'); // 2013-08-29 +define('_ECRAN_SECURITE', '1.1.9'); // 2014-03-13 /* * Documentation : http://www.spip.net/fr_article4200.html @@ -254,13 +254,12 @@ if (isset($_REQUEST['connect']) AND // cas qui permettent de sortir d'un commentaire PHP (strpos($_REQUEST['connect'], "?")!==false + OR strpos($_REQUEST['connect'], "<")!==false OR strpos($_REQUEST['connect'], ">")!==false OR strpos($_REQUEST['connect'], "\n")!==false OR strpos($_REQUEST['connect'], "\r")!==false) ) { - $_REQUEST['connect'] = str_replace(array("?", ">", "\r", "\n"), "", $_REQUEST['connect']); - if (isset($_GET['connect'])) $_GET['connect'] = $_REQUEST['connect']; - if (isset($_POST['connect'])) $_POST['connect'] = $_REQUEST['connect']; + $ecran_securite_raison = "malformed connect argument"; } /* @@ -317,4 +316,4 @@ if ( } -?> +?> \ No newline at end of file diff --git a/www/ecrire/action/editer_rubrique.php b/www/ecrire/action/editer_rubrique.php index e5713dfa..2c6ed642 100644 --- a/www/ecrire/action/editer_rubrique.php +++ b/www/ecrire/action/editer_rubrique.php @@ -226,9 +226,26 @@ function rubrique_instituer($id_rubrique, $c) { } } elseif (editer_rubrique_breves($id_rubrique, $id_parent, $c)) { + + $champs = array('id_parent' => $id_parent); $statut_ancien = $s['statut']; - sql_updateq('spip_rubriques', array('id_parent' => $id_parent), "id_rubrique=$id_rubrique"); + // Envoyer aux plugins + $champs = pipeline('pre_edition', + array( + 'args' => array( + 'table' => 'spip_rubriques', + 'id_objet' => $id_rubrique, + 'action'=>'instituer', + 'statut_ancien' => $statut_ancien, + ), + 'data' => $champs + ) + ); + + if (!count($champs)) return ''; + + sql_updateq('spip_rubriques', $champs, "id_rubrique=$id_rubrique"); propager_les_secteurs(); @@ -241,6 +258,19 @@ function rubrique_instituer($id_rubrique, $c) { effacer_meta("date_calcul_rubriques"); calculer_langues_rubriques(); + + // Pipeline + pipeline('post_edition', + array( + 'args' => array( + 'table' => 'spip_rubriques', + 'id_objet' => $id_rubrique, + 'action'=>'instituer', + 'statut_ancien' => $statut_ancien, + ), + 'data' => $champs + ) + ); } } } diff --git a/www/ecrire/inc/editer.php b/www/ecrire/inc/editer.php index 80093e19..af084e4d 100644 --- a/www/ecrire/inc/editer.php +++ b/www/ecrire/inc/editer.php @@ -219,28 +219,51 @@ function editer_texte_recolle($texte, $att_text) } /** - * Determiner un titre automatique si non renseigne, + * auto-renseigner le titre si il n'existe pas + * + * @param $champ_titre + * @param $champs_contenu + * @param int $longueur + */ +function titre_automatique($champ_titre,$champs_contenu,$longueur=null){ + if (!_request($champ_titre)){ + $titrer_contenu = charger_fonction('titrer_contenu','inc'); + if (!is_null($longueur)) + $t = $titrer_contenu($champs_contenu,null,$longueur); + else + $t = $titrer_contenu($champs_contenu); + if ($t) + set_request($champ_titre,$t); + } +} + +/** + * Determiner un titre automatique, * a partir des champs textes de contenu * - * @param string $champ_titre - * nom du champ titre * @param array $champs_contenu * liste des champs contenu textuels + * @param array|null $c + * tableau qui contient les valeurs des champs de contenu + * si null on utilise les valeurs du POST * @param int $longueur - * @return void + * longueur de coupe + * @return string */ -function titre_automatique($champ_titre,$champs_contenu,$longueur=50){ - // auto-renseigner le titre si il n'existe pas - if (!_request($champ_titre)){ - foreach($champs_contenu as $c){ - if ($t = _request($c)) - break; - } - if ($t){ - include_spip('inc/texte_mini'); - set_request($champ_titre,couper($t,$longueur,"...")); - } +function inc_titrer_contenu_dist($champs_contenu, $c=null, $longueur=50){ + // trouver un champ texte non vide + $t = ""; + foreach($champs_contenu as $champ){ + if ($t = _request($champ,$c)) + break; } + + if ($t){ + include_spip('inc/texte_mini'); + $t = couper($t,$longueur,"..."); + } + + return $t; } // Produit la liste des md5 d'un tableau de donnees, sous forme diff --git a/www/ecrire/inc/filtres_ecrire.php b/www/ecrire/inc/filtres_ecrire.php index 2ad7d6ec..b4b8e130 100644 --- a/www/ecrire/inc/filtres_ecrire.php +++ b/www/ecrire/inc/filtres_ecrire.php @@ -493,7 +493,8 @@ function afficher_plus_info($lien, $titre="+", $titre_lien="") { function lister_objets_lies($objet_source,$objet,$id_objet,$objet_lien){ include_spip('action/editer_liens'); $l = array(); - if ($objet_lien==$objet){ + // quand $objet == $objet_lien == $objet_source on reste sur le cas par defaut de $objet_lien == $objet_source + if ($objet_lien==$objet AND $objet_lien!==$objet_source){ $res = objet_trouver_liens(array($objet=>$id_objet),array($objet_source=>'*')); } else{ diff --git a/www/ecrire/inc_version.php b/www/ecrire/inc_version.php index c3f13976..869d6fc9 100644 --- a/www/ecrire/inc_version.php +++ b/www/ecrire/inc_version.php @@ -290,7 +290,7 @@ $liste_des_authentifications = array( // pour specifier les versions de SPIP necessaires // il faut s'en tenir a un nombre de decimales fixe // ex : 2.0.0, 2.0.0-dev, 2.0.0-beta, 2.0.0-beta2 -$spip_version_branche = "3.0.15"; +$spip_version_branche = "3.0.16"; // version des signatures de fonctions PHP // (= numero SVN de leur derniere modif cassant la compatibilite et/ou necessitant un recalcul des squelettes) $spip_version_code = 17873; diff --git a/www/ecrire/maj/svn10000.php b/www/ecrire/maj/svn10000.php index b48580a5..abe37f21 100644 --- a/www/ecrire/maj/svn10000.php +++ b/www/ecrire/maj/svn10000.php @@ -301,6 +301,10 @@ function maj_liens($pivot,$l='') { if (!$desc = $trouver_table($ancienne_table)) return; + // securite pour ne pas perdre de donnees + if (!$trouver_table($liens)) + return; + $champs = $desc['field']; if (isset($champs['maj'])) unset($champs['maj']); if (isset($champs[$primary])) unset($champs[$primary]); diff --git a/www/ecrire/paquet.xml b/www/ecrire/paquet.xml index e4871e23..3e049e10 100644 --- a/www/ecrire/paquet.xml +++ b/www/ecrire/paquet.xml @@ -1,7 +1,7 @@ erreur) -// et volontaires (var_mode et var_profile) -// Si pas d'autorisation, les erreurs ne sont pas affichees -// (mais seront dans les logs) -// Si l'erreur vient de SPIP, en parler sur spip@rezo.net - -function public_debusquer_dist($message = '', $lieu = ''){ + +/** + * Point d'entrée pour les erreurs de compilation + * + * Point d'entrée pour les appels involontaires ($message non vide => erreur) + * et volontaires (var_mode et var_profile) + * + * Si pas d'autorisation, les erreurs ne sont pas affichées + * (mais seront dans les logs) + * + * Si l'erreur vient de SPIP, en parler sur `spip@rezo.net` + * + * @param bool|string|array $message + * - Message d'erreur (string|array) + * - false pour retourner le texte des messages d'erreurs + * - vide pour afficher les messages d'erreurs + * @param string|Contexte $lieu + * Contexte : lieu d'origine de l'erreur + * @param array $opt + * Options pour debug ou tests unitaires + * - 'erreurs' = 'get' : Retourne le tableau des erreurs + * - 'erreurs' = 'reset' : Efface le tableau des erreurs + * @return null|string + * - string si $message à false. +**/ +function public_debusquer_dist($message = '', $lieu = '', $opt = array()){ global $visiteur_session; global $debug_objets; static $tableau_des_erreurs = array(); + // Pour des tests unitaires, pouvoir récupérer les erreurs générées + if (isset($opt['erreurs'])) { + if ($opt['erreurs'] == 'get') { + return $tableau_des_erreurs; + } + if ($opt['erreurs'] == 'reset') { + $tableau_des_erreurs = array(); + return true; + } + } + // Erreur ou appel final ? if ($message){ $message = debusquer_compose_message($message); diff --git a/www/ecrire/public/quete.php b/www/ecrire/public/quete.php index fcac3468..5283ab5a 100644 --- a/www/ecrire/public/quete.php +++ b/www/ecrire/public/quete.php @@ -392,7 +392,7 @@ function calcul_exposer ($id, $prim, $reference, $parent, $type, $connect='') { $exposer[$m][$type][$principal] = true; if ($type == 'id_mot'){ if (!$parent) { - $parent = sql_getfetsel('id_groupe','spip_mots',"id_mot=" . $principal, '','','','',$connect); + $parent = sql_getfetsel('id_groupe','spip_mots',"id_mot=" . intval($principal), '','','','',$connect); } if ($parent) $exposer[$m]['id_groupe'][$parent] = true; diff --git a/www/plugins-dist/compresseur/lib/csstidy/Docs/__filesource/fsource_csstidy__class.csstidy.php.html b/www/plugins-dist/compresseur/lib/csstidy/Docs/__filesource/fsource_csstidy__class.csstidy.php.html deleted file mode 100644 index be1898f8..00000000 --- a/www/plugins-dist/compresseur/lib/csstidy/Docs/__filesource/fsource_csstidy__class.csstidy.php.html +++ /dev/null @@ -1,1038 +0,0 @@ - - -File Source for class.csstidy.php - - - - - - - - - - - - - -
csstidy
- [ class tree: csstidy ] - [ index: csstidy ] - [ all elements ] -
- - - - - - -
-
- -

Source for file class.csstidy.php

-

Documentation is available at class.csstidy.php

-
-
  1. <?php
  2. -
  3. /**
  4. -
  5. * CSSTidy - CSS Parser and Optimiser
  6. -
  7. *
  8. -
  9. * CSS Parser class
  10. -
  11. *
  12. -
  13. * This file is part of CSSTidy.
  14. -
  15. *
  16. -
  17. * CSSTidy is free software; you can redistribute it and/or modify
  18. -
  19. * it under the terms of the GNU General Public License as published by
  20. -
  21. * the Free Software Foundation; either version 2 of the License, or
  22. -
  23. * (at your option) any later version.
  24. -
  25. *
  26. -
  27. * CSSTidy is distributed in the hope that it will be useful,
  28. -
  29. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  30. -
  31. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  32. -
  33. * GNU General Public License for more details.
  34. -
  35. *
  36. -
  37. * You should have received a copy of the GNU General Public License
  38. -
  39. * along with CSSTidy; if not, write to the Free Software
  40. -
  41. * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  42. -
  43. *
  44. -
  45. * @license http://opensource.org/licenses/gpl-license.php GNU Public License
  46. -
  47. * @package csstidy
  48. -
  49. * @author Florian Schmitz (floele at gmail dot com) 2005-2006
  50. -
  51. */
  52. -
  53.  
  54. -
  55. /**
  56. -
  57. * Various CSS data needed for correct optimisations etc.
  58. -
  59. *
  60. -
  61. * @version 1.2
  62. -
  63. */
  64. -
  65. require('data.inc.php');
  66. -
  67.  
  68. -
  69. /**
  70. -
  71. * Contains a class for printing CSS code
  72. -
  73. *
  74. -
  75. * @version 1.0
  76. -
  77. */
  78. -
  79. require('class.csstidy_print.php');
  80. -
  81.  
  82. -
  83. /**
  84. -
  85. * Contains a class for optimising CSS code
  86. -
  87. *
  88. -
  89. * @version 1.0
  90. -
  91. */
  92. -
  93. require('class.csstidy_optimise.php');
  94. -
  95.  
  96. -
  97. /**
  98. -
  99. * CSS Parser class
  100. -
  101. *
  102. -
  103. * This class represents a CSS parser which reads CSS code and saves it in an array.
  104. -
  105. * In opposite to most other CSS parsers, it does not use regular expressions and
  106. -
  107. * thus has full CSS2 support and a higher reliability.
  108. -
  109. * Additional to that it applies some optimisations and fixes to the CSS code.
  110. -
  111. * An online version should be available here: http://cdburnerxp.se/cssparse/css_optimiser.php
  112. -
  113. * @package csstidy
  114. -
  115. * @author Florian Schmitz (floele at gmail dot com) 2005-2006
  116. -
  117. * @version 1.2
  118. -
  119. */
  120. -
  121. class csstidy {
  122. -
  123.  
  124. -
  125. /**
  126. -
  127. * Saves the parsed CSS
  128. -
  129. * @var array
  130. -
  131. * @access public
  132. -
  133. */
  134. -
  135. var $css = array();
  136. -
  137.  
  138. -
  139. /**
  140. -
  141. * Saves the parsed CSS (raw)
  142. -
  143. * @var array
  144. -
  145. * @access private
  146. -
  147. */
  148. -
  149. var $tokens = array();
  150. -
  151.  
  152. -
  153. /**
  154. -
  155. * Printer class
  156. -
  157. * @see csstidy_print
  158. -
  159. * @var object
  160. -
  161. * @access public
  162. -
  163. */
  164. -
  165. var $print;
  166. -
  167.  
  168. -
  169. /**
  170. -
  171. * Optimiser class
  172. -
  173. * @see csstidy_optimise
  174. -
  175. * @var object
  176. -
  177. * @access private
  178. -
  179. */
  180. -
  181. var $optimise;
  182. -
  183.  
  184. -
  185. /**
  186. -
  187. * Saves the CSS charset (@charset)
  188. -
  189. * @var string
  190. -
  191. * @access private
  192. -
  193. */
  194. -
  195. var $charset = '';
  196. -
  197.  
  198. -
  199. /**
  200. -
  201. * Saves all @import URLs
  202. -
  203. * @var array
  204. -
  205. * @access private
  206. -
  207. */
  208. -
  209. var $import = array();
  210. -
  211.  
  212. -
  213. /**
  214. -
  215. * Saves the namespace
  216. -
  217. * @var string
  218. -
  219. * @access private
  220. -
  221. */
  222. -
  223. var $namespace = '';
  224. -
  225.  
  226. -
  227. /**
  228. -
  229. * Contains the version of csstidy
  230. -
  231. * @var string
  232. -
  233. * @access private
  234. -
  235. */
  236. -
  237. var $version = '1.2';
  238. -
  239.  
  240. -
  241. /**
  242. -
  243. * Stores the settings
  244. -
  245. * @var array
  246. -
  247. * @access private
  248. -
  249. */
  250. -
  251. var $settings = array();
  252. -
  253.  
  254. -
  255. /**
  256. -
  257. * Saves the parser-status.
  258. -
  259. *
  260. -
  261. * Possible values:
  262. -
  263. * - is = in selector
  264. -
  265. * - ip = in property
  266. -
  267. * - iv = in value
  268. -
  269. * - instr = in string (started at " or ' or ( )
  270. -
  271. * - ic = in comment (ignore everything)
  272. -
  273. * - at = in @-block
  274. -
  275. *
  276. -
  277. * @var string
  278. -
  279. * @access private
  280. -
  281. */
  282. -
  283. var $status = 'is';
  284. -
  285.  
  286. -
  287.  
  288. -
  289. /**
  290. -
  291. * Saves the current at rule (@media)
  292. -
  293. * @var string
  294. -
  295. * @access private
  296. -
  297. */
  298. -
  299. var $at = '';
  300. -
  301.  
  302. -
  303. /**
  304. -
  305. * Saves the current selector
  306. -
  307. * @var string
  308. -
  309. * @access private
  310. -
  311. */
  312. -
  313. var $selector = '';
  314. -
  315.  
  316. -
  317. /**
  318. -
  319. * Saves the current property
  320. -
  321. * @var string
  322. -
  323. * @access private
  324. -
  325. */
  326. -
  327. var $property = '';
  328. -
  329.  
  330. -
  331. /**
  332. -
  333. * Saves the position of , in selectors
  334. -
  335. * @var array
  336. -
  337. * @access private
  338. -
  339. */
  340. -
  341. var $sel_separate = array();
  342. -
  343.  
  344. -
  345. /**
  346. -
  347. * Saves the current value
  348. -
  349. * @var string
  350. -
  351. * @access private
  352. -
  353. */
  354. -
  355. var $value = '';
  356. -
  357.  
  358. -
  359. /**
  360. -
  361. * Saves the current sub-value
  362. -
  363. *
  364. -
  365. * Example for a subvalue:
  366. -
  367. * background:url(foo.png) red no-repeat;
  368. -
  369. * "url(foo.png)", "red", and "no-repeat" are subvalues,
  370. -
  371. * seperated by whitespace
  372. -
  373. * @var string
  374. -
  375. * @access private
  376. -
  377. */
  378. -
  379. var $sub_value = '';
  380. -
  381.  
  382. -
  383. /**
  384. -
  385. * Array which saves all subvalues for a property.
  386. -
  387. * @var array
  388. -
  389. * @see sub_value
  390. -
  391. * @access private
  392. -
  393. */
  394. -
  395. var $sub_value_arr = array();
  396. -
  397.  
  398. -
  399. /**
  400. -
  401. * Saves the char which opened the last string
  402. -
  403. * @var string
  404. -
  405. * @access private
  406. -
  407. */
  408. -
  409. var $str_char = '';
  410. -
  411.  
  412. -
  413. /**
  414. -
  415. * Status from which the parser switched to ic or instr
  416. -
  417. * @var string
  418. -
  419. * @access private
  420. -
  421. */
  422. -
  423. var $from = '';
  424. -
  425.  
  426. -
  427. /**
  428. -
  429. * Variable needed to manage string-in-strings, for example url("foo.png")
  430. -
  431. * @var string
  432. -
  433. * @access private
  434. -
  435. */
  436. -
  437. var $str_in_str = false;
  438. -
  439.  
  440. -
  441. /**
  442. -
  443. * =true if in invalid at-rule
  444. -
  445. * @var bool
  446. -
  447. * @access private
  448. -
  449. */
  450. -
  451. var $invalid_at = false;
  452. -
  453.  
  454. -
  455. /**
  456. -
  457. * =true if something has been added to the current selector
  458. -
  459. * @var bool
  460. -
  461. * @access private
  462. -
  463. */
  464. -
  465. var $added = false;
  466. -
  467.  
  468. -
  469. /**
  470. -
  471. * Array which saves the message log
  472. -
  473. * @var array
  474. -
  475. * @access private
  476. -
  477. */
  478. -
  479. var $log = array();
  480. -
  481.  
  482. -
  483. /**
  484. -
  485. * Saves the line number
  486. -
  487. * @var integer
  488. -
  489. * @access private
  490. -
  491. */
  492. -
  493. var $line = 1;
  494. -
  495.  
  496. -
  497. /**
  498. -
  499. * Loads standard template and sets default settings
  500. -
  501. * @access private
  502. -
  503. * @version 1.2
  504. -
  505. */
  506. -
  507. function csstidy()
  508. -
  509. {
  510. -
  511. $this->settings['remove_bslash'] = true;
  512. -
  513. $this->settings['compress_colors'] = true;
  514. -
  515. $this->settings['compress_font-weight'] = true;
  516. -
  517. $this->settings['lowercase_s'] = false;
  518. -
  519. $this->settings['optimise_shorthands'] = 1;
  520. -
  521. $this->settings['remove_last_;'] = false;
  522. -
  523. $this->settings['case_properties'] = 1;
  524. -
  525. $this->settings['sort_properties'] = false;
  526. -
  527. $this->settings['sort_selectors'] = false;
  528. -
  529. $this->settings['merge_selectors'] = 2;
  530. -
  531. $this->settings['discard_invalid_properties'] = false;
  532. -
  533. $this->settings['css_level'] = 'CSS2.1';
  534. -
  535. $this->settings['preserve_css'] = false;
  536. -
  537. $this->settings['timestamp'] = false;
  538. -
  539.  
  540. -
  541. $this->load_template('default');
  542. -
  543. $this->print = new csstidy_print($this);
  544. -
  545. $this->optimise = new csstidy_optimise($this);
  546. -
  547. }
  548. -
  549.  
  550. -
  551. /**
  552. -
  553. * Get the value of a setting.
  554. -
  555. * @param string $setting
  556. -
  557. * @access public
  558. -
  559. * @return mixed
  560. -
  561. * @version 1.0
  562. -
  563. */
  564. -
  565. function get_cfg($setting)
  566. -
  567. {
  568. -
  569. if(isset($this->settings[$setting]))
  570. -
  571. {
  572. -
  573. return $this->settings[$setting];
  574. -
  575. }
  576. -
  577. return false;
  578. -
  579. }
  580. -
  581.  
  582. -
  583. /**
  584. -
  585. * Set the value of a setting.
  586. -
  587. * @param string $setting
  588. -
  589. * @param mixed $value
  590. -
  591. * @access public
  592. -
  593. * @return bool
  594. -
  595. * @version 1.0
  596. -
  597. */
  598. -
  599. function set_cfg($setting,$value)
  600. -
  601. {
  602. -
  603. if(isset($this->settings[$setting]) && $value !== '')
  604. -
  605. {
  606. -
  607. $this->settings[$setting] = $value;
  608. -
  609. return true;
  610. -
  611. }
  612. -
  613. return false;
  614. -
  615. }
  616. -
  617.  
  618. -
  619. /**
  620. -
  621. * Adds a token to $this->tokens
  622. -
  623. * @param mixed $type
  624. -
  625. * @param string $data
  626. -
  627. * @param bool $do add a token even if preserve_css is off
  628. -
  629. * @access private
  630. -
  631. * @version 1.0
  632. -
  633. */
  634. -
  635. function _add_token($type, $data, $do = false) {
  636. -
  637. if($this->get_cfg('preserve_css') || $do) {
  638. -
  639. $this->tokens[] = array($type, ($type == COMMENT) ? $data : trim($data));
  640. -
  641. }
  642. -
  643. }
  644. -
  645. -
  646. /**
  647. -
  648. * Add a message to the message log
  649. -
  650. * @param string $message
  651. -
  652. * @param string $type
  653. -
  654. * @param integer $line
  655. -
  656. * @access private
  657. -
  658. * @version 1.0
  659. -
  660. */
  661. -
  662. function log($message,$type,$line = -1)
  663. -
  664. {
  665. -
  666. if($line === -1)
  667. -
  668. {
  669. -
  670. $line = $this->line;
  671. -
  672. }
  673. -
  674. $line = intval($line);
  675. -
  676. $add = array('m' => $message, 't' => $type);
  677. -
  678. if(!isset($this->log[$line]) || !in_array($add,$this->log[$line]))
  679. -
  680. {
  681. -
  682. $this->log[$line][] = $add;
  683. -
  684. }
  685. -
  686. }
  687. -
  688.  
  689. -
  690. /**
  691. -
  692. * Parse unicode notations and find a replacement character
  693. -
  694. * @param string $string
  695. -
  696. * @param integer $i
  697. -
  698. * @access private
  699. -
  700. * @return string
  701. -
  702. * @version 1.2
  703. -
  704. */
  705. -
  706. function _unicode(&$string, &$i)
  707. -
  708. {
  709. -
  710. ++$i;
  711. -
  712. $add = '';
  713. -
  714. $tokens =& $GLOBALS['csstidy']['tokens'];
  715. -
  716. $replaced = false;
  717. -
  718. -
  719. while($i < strlen($string) && (ctype_xdigit($string{$i}) || ctype_space($string{$i})) && strlen($add) < 6)
  720. -
  721. {
  722. -
  723. $add .= $string{$i};
  724. -
  725.  
  726. -
  727. if(ctype_space($string{$i})) {
  728. -
  729. break;
  730. -
  731. }
  732. -
  733. $i++;
  734. -
  735. }
  736. -
  737.  
  738. -
  739. if(hexdec($add) > 47 && hexdec($add) < 58 || hexdec($add) > 64 && hexdec($add) < 91 || hexdec($add) > 96 && hexdec($add) < 123)
  740. -
  741. {
  742. -
  743. $this->log('Replaced unicode notation: Changed \\'. $add .' to ' . chr(hexdec($add)),'Information');
  744. -
  745. $add = chr(hexdec($add));
  746. -
  747. $replaced = true;
  748. -
  749. }
  750. -
  751. else {
  752. -
  753. $add = trim('\\'.$add);
  754. -
  755. }
  756. -
  757.  
  758. -
  759. if(@ctype_xdigit($string{$i+1}) && ctype_space($string{$i})
  760. -
  761. && !$replaced || !ctype_space($string{$i})) {
  762. -
  763. $i--;
  764. -
  765. }
  766. -
  767. -
  768. if($add != '\\' || !$this->get_cfg('remove_bslash') || strpos($tokens, $string{$i+1}) !== false) {
  769. -
  770. return $add;
  771. -
  772. }
  773. -
  774. -
  775. if($add == '\\') {
  776. -
  777. $this->log('Removed unnecessary backslash','Information');
  778. -
  779. }
  780. -
  781. return '';
  782. -
  783. }
  784. -
  785.  
  786. -
  787. /**
  788. -
  789. * Loads a new template
  790. -
  791. * @param string $content either filename (if $from_file == true), content of a template file, "high_compression", "highest_compression", "low_compression", or "default"
  792. -
  793. * @param bool $from_file uses $content as filename if true
  794. -
  795. * @access public
  796. -
  797. * @version 1.1
  798. -
  799. * @see http://csstidy.sourceforge.net/templates.php
  800. -
  801. */
  802. -
  803. function load_template($content, $from_file=true)
  804. -
  805. {
  806. -
  807. $predefined_templates =& $GLOBALS['csstidy']['predefined_templates'];
  808. -
  809. if($content == 'high_compression' || $content == 'default' || $content == 'highest_compression' || $content == 'low_compression')
  810. -
  811. {
  812. -
  813. $this->template = $predefined_templates[$content];
  814. -
  815. return;
  816. -
  817. }
  818. -
  819. -
  820. if($from_file)
  821. -
  822. {
  823. -
  824. $content = strip_tags(file_get_contents($content),'<span>');
  825. -
  826. }
  827. -
  828. $content = str_replace("\r\n","\n",$content); // Unify newlines (because the output also only uses \n)
  829. -
  830. $template = explode('|',$content);
  831. -
  832.  
  833. -
  834. for ($i = 0; $i < count($template); $i++ )
  835. -
  836. {
  837. -
  838. $this->template[$i] = $template[$i];
  839. -
  840. }
  841. -
  842. }
  843. -
  844.  
  845. -
  846. /**
  847. -
  848. * Starts parsing from URL
  849. -
  850. * @param string $url
  851. -
  852. * @access public
  853. -
  854. * @version 1.0
  855. -
  856. */
  857. -
  858. function parse_from_url($url)
  859. -
  860. {
  861. -
  862. return $this->parse(@file_get_contents($url));
  863. -
  864. }
  865. -
  866.  
  867. -
  868. /**
  869. -
  870. * Checks if there is a token at the current position
  871. -
  872. * @param string $string
  873. -
  874. * @param integer $i
  875. -
  876. * @access public
  877. -
  878. * @version 1.11
  879. -
  880. */
  881. -
  882. function is_token(&$string, $i)
  883. -
  884. {
  885. -
  886. $tokens =& $GLOBALS['csstidy']['tokens'];
  887. -
  888. return (strpos($tokens, $string{$i}) !== false && !csstidy::escaped($string,$i));
  889. -
  890. }
  891. -
  892.  
  893. -
  894.  
  895. -
  896. /**
  897. -
  898. * Parses CSS in $string. The code is saved as array in $this->css
  899. -
  900. * @param string $string the CSS code
  901. -
  902. * @access public
  903. -
  904. * @return bool
  905. -
  906. * @version 1.1
  907. -
  908. */
  909. -
  910. function parse($string) {
  911. -
  912. // PHP bug? Settings need to be refreshed in PHP4
  913. -
  914. $this->print = new csstidy_print($this);
  915. -
  916. $this->optimise = new csstidy_optimise($this);
  917. -
  918. -
  919. $all_properties =& $GLOBALS['csstidy']['all_properties'];
  920. -
  921. $at_rules =& $GLOBALS['csstidy']['at_rules'];
  922. -
  923.  
  924. -
  925. $this->css = array();
  926. -
  927. $this->print->input_css = $string;
  928. -
  929. $string = str_replace("\r\n","\n",$string) . ' ';
  930. -
  931. $cur_comment = '';
  932. -
  933. -
  934. for ($i = 0, $size = strlen($string); $i < $size; $i++ )
  935. -
  936. {
  937. -
  938. if($string{$i} == "\n" || $string{$i} == "\r")
  939. -
  940. {
  941. -
  942. ++$this->line;
  943. -
  944. }
  945. -
  946. -
  947. switch($this->status)
  948. -
  949. {
  950. -
  951. /* Case in at-block */
  952. -
  953. case 'at':
  954. -
  955. if(csstidy::is_token($string,$i))
  956. -
  957. {
  958. -
  959. if($string{$i} == '/' && @$string{$i+1} == '*')
  960. -
  961. {
  962. -
  963. $this->status = 'ic'; ++$i;
  964. -
  965. $this->from = 'at';
  966. -
  967. }
  968. -
  969. elseif($string{$i} == '{')
  970. -
  971. {
  972. -
  973. $this->status = 'is';
  974. -
  975. $this->_add_token(AT_START, $this->at);
  976. -
  977. }
  978. -
  979. elseif($string{$i} == ',')
  980. -
  981. {
  982. -
  983. $this->at = trim($this->at).',';
  984. -
  985. }
  986. -
  987. elseif($string{$i} == '\\')
  988. -
  989. {
  990. -
  991. $this->at .= $this->_unicode($string,$i);
  992. -
  993. }
  994. -
  995. }
  996. -
  997. else
  998. -
  999. {
  1000. -
  1001. $lastpos = strlen($this->at)-1;
  1002. -
  1003. if(!( (ctype_space($this->at{$lastpos}) || csstidy::is_token($this->at,$lastpos) && $this->at{$lastpos} == ',') && ctype_space($string{$i})))
  1004. -
  1005. {
  1006. -
  1007. $this->at .= $string{$i};
  1008. -
  1009. }
  1010. -
  1011. }
  1012. -
  1013. break;
  1014. -
  1015. -
  1016. /* Case in-selector */
  1017. -
  1018. case 'is':
  1019. -
  1020. if(csstidy::is_token($string,$i))
  1021. -
  1022. {
  1023. -
  1024. if($string{$i} == '/' && @$string{$i+1} == '*' && trim($this->selector) == '')
  1025. -
  1026. {
  1027. -
  1028. $this->status = 'ic'; ++$i;
  1029. -
  1030. $this->from = 'is';
  1031. -
  1032. }
  1033. -
  1034. elseif($string{$i} == '@' && trim($this->selector) == '')
  1035. -
  1036. {
  1037. -
  1038. // Check for at-rule
  1039. -
  1040. $this->invalid_at = true;
  1041. -
  1042. foreach($at_rules as $name => $type)
  1043. -
  1044. {
  1045. -
  1046. if(!strcasecmp(substr($string,$i+1,strlen($name)),$name))
  1047. -
  1048. {
  1049. -
  1050. ($type == 'at') ? $this->at = '@'.$name : $this->selector = '@'.$name;
  1051. -
  1052. $this->status = $type;
  1053. -
  1054. $i += strlen($name);
  1055. -
  1056. $this->invalid_at = false;
  1057. -
  1058. }
  1059. -
  1060. }
  1061. -
  1062. -
  1063. if($this->invalid_at)
  1064. -
  1065. {
  1066. -
  1067. $this->selector = '@';
  1068. -
  1069. $invalid_at_name = '';
  1070. -
  1071. for($j = $i+1; $j < $size; ++$j)
  1072. -
  1073. {
  1074. -
  1075. if(!ctype_alpha($string{$j}))
  1076. -
  1077. {
  1078. -
  1079. break;
  1080. -
  1081. }
  1082. -
  1083. $invalid_at_name .= $string{$j};
  1084. -
  1085. }
  1086. -
  1087. $this->log('Invalid @-rule: '.$invalid_at_name.' (removed)','Warning');
  1088. -
  1089. }
  1090. -
  1091. }
  1092. -
  1093. elseif(($string{$i} == '"' || $string{$i} == "'"))
  1094. -
  1095. {
  1096. -
  1097. $this->selector .= $string{$i};
  1098. -
  1099. $this->status = 'instr';
  1100. -
  1101. $this->str_char = $string{$i};
  1102. -
  1103. $this->from = 'is';
  1104. -
  1105. }
  1106. -
  1107. elseif($this->invalid_at && $string{$i} == ';')
  1108. -
  1109. {
  1110. -
  1111. $this->invalid_at = false;
  1112. -
  1113. $this->status = 'is';
  1114. -
  1115. }
  1116. -
  1117. elseif($string{$i} == '{')
  1118. -
  1119. {
  1120. -
  1121. $this->status = 'ip';
  1122. -
  1123. $this->_add_token(SEL_START, $this->selector);
  1124. -
  1125. $this->added = false;
  1126. -
  1127. }
  1128. -
  1129. elseif($string{$i} == '}')
  1130. -
  1131. {
  1132. -
  1133. $this->_add_token(AT_END, $this->at);
  1134. -
  1135. $this->at = '';
  1136. -
  1137. $this->selector = '';
  1138. -
  1139. $this->sel_separate = array();
  1140. -
  1141. }
  1142. -
  1143. elseif($string{$i} == ',')
  1144. -
  1145. {
  1146. -
  1147. $this->selector = trim($this->selector).',';
  1148. -
  1149. $this->sel_separate[] = strlen($this->selector);
  1150. -
  1151. }
  1152. -
  1153. elseif($string{$i} == '\\')
  1154. -
  1155. {
  1156. -
  1157. $this->selector .= $this->_unicode($string,$i);
  1158. -
  1159. }
  1160. -
  1161. else $this->selector .= $string{$i};
  1162. -
  1163. }
  1164. -
  1165. else
  1166. -
  1167. {
  1168. -
  1169. $lastpos = strlen($this->selector)-1;
  1170. -
  1171. if($lastpos == -1 || !( (ctype_space($this->selector{$lastpos}) || csstidy::is_token($this->selector,$lastpos) && $this->selector{$lastpos} == ',') && ctype_space($string{$i})))
  1172. -
  1173. {
  1174. -
  1175. $this->selector .= $string{$i};
  1176. -
  1177. }
  1178. -
  1179. }
  1180. -
  1181. break;
  1182. -
  1183. -
  1184. /* Case in-property */
  1185. -
  1186. case 'ip':
  1187. -
  1188. if(csstidy::is_token($string,$i))
  1189. -
  1190. {
  1191. -
  1192. if(($string{$i} == ':' || $string{$i} == '=') && $this->property != '')
  1193. -
  1194. {
  1195. -
  1196. $this->status = 'iv';
  1197. -
  1198. if(csstidy::property_is_valid($this->property) || !$this->get_cfg('discard_invalid_properties')) {
  1199. -
  1200. $this->_add_token(PROPERTY, $this->property);
  1201. -
  1202. }
  1203. -
  1204. }
  1205. -
  1206. elseif($string{$i} == '/' && @$string{$i+1} == '*' && $this->property == '')
  1207. -
  1208. {
  1209. -
  1210. $this->status = 'ic'; ++$i;
  1211. -
  1212. $this->from = 'ip';
  1213. -
  1214. }
  1215. -
  1216. elseif($string{$i} == '}')
  1217. -
  1218. {
  1219. -
  1220. $this->explode_selectors();
  1221. -
  1222. $this->status = 'is';
  1223. -
  1224. $this->invalid_at = false;
  1225. -
  1226. $this->_add_token(SEL_END, $this->selector);
  1227. -
  1228. $this->selector = '';
  1229. -
  1230. $this->property = '';
  1231. -
  1232. }
  1233. -
  1234. elseif($string{$i} == ';')
  1235. -
  1236. {
  1237. -
  1238. $this->property = '';
  1239. -
  1240. }
  1241. -
  1242. elseif($string{$i} == '\\')
  1243. -
  1244. {
  1245. -
  1246. $this->property .= $this->_unicode($string,$i);
  1247. -
  1248. }
  1249. -
  1250. }
  1251. -
  1252. elseif(!ctype_space($string{$i}))
  1253. -
  1254. {
  1255. -
  1256. $this->property .= $string{$i};
  1257. -
  1258. }
  1259. -
  1260. break;
  1261. -
  1262. -
  1263. /* Case in-value */
  1264. -
  1265. case 'iv':
  1266. -
  1267. $pn = (($string{$i} == "\n" || $string{$i} == "\r") && $this->property_is_next($string,$i+1) || $i == strlen($string)-1);
  1268. -
  1269. if(csstidy::is_token($string,$i) || $pn)
  1270. -
  1271. {
  1272. -
  1273. if($string{$i} == '/' && @$string{$i+1} == '*')
  1274. -
  1275. {
  1276. -
  1277. $this->status = 'ic'; ++$i;
  1278. -
  1279. $this->from = 'iv';
  1280. -
  1281. }
  1282. -
  1283. elseif(($string{$i} == '"' || $string{$i} == "'" || $string{$i} == '('))
  1284. -
  1285. {
  1286. -
  1287. $this->sub_value .= $string{$i};
  1288. -
  1289. $this->str_char = ($string{$i} == '(') ? ')' : $string{$i};
  1290. -
  1291. $this->status = 'instr';
  1292. -
  1293. $this->from = 'iv';
  1294. -
  1295. }
  1296. -
  1297. elseif($string{$i} == ',')
  1298. -
  1299. {
  1300. -
  1301. $this->sub_value = trim($this->sub_value).',';
  1302. -
  1303. }
  1304. -
  1305. elseif($string{$i} == '\\')
  1306. -
  1307. {
  1308. -
  1309. $this->sub_value .= $this->_unicode($string,$i);
  1310. -
  1311. }
  1312. -
  1313. elseif($string{$i} == ';' || $pn)
  1314. -
  1315. {
  1316. -
  1317. if($this->selector{0} == '@' && isset($at_rules[substr($this->selector,1)]) && $at_rules[substr($this->selector,1)] == 'iv')
  1318. -
  1319. {
  1320. -
  1321. $this->sub_value_arr[] = trim($this->sub_value);
  1322. -
  1323. -
  1324. $this->status = 'is';
  1325. -
  1326. -
  1327. switch($this->selector)
  1328. -
  1329. {
  1330. -
  1331. case '@charset': $this->charset = $this->sub_value_arr[0]; break;
  1332. -
  1333. case '@namespace': $this->namespace = implode(' ',$this->sub_value_arr); break;
  1334. -
  1335. case '@import': $this->import[] = implode(' ',$this->sub_value_arr); break;
  1336. -
  1337. }
  1338. -
  1339. -
  1340. $this->sub_value_arr = array();
  1341. -
  1342. $this->sub_value = '';
  1343. -
  1344. $this->selector = '';
  1345. -
  1346. $this->sel_separate = array();
  1347. -
  1348. }
  1349. -
  1350. else
  1351. -
  1352. {
  1353. -
  1354. $this->status = 'ip';
  1355. -
  1356. }
  1357. -
  1358. }
  1359. -
  1360. elseif($string{$i} != '}')
  1361. -
  1362. {
  1363. -
  1364. $this->sub_value .= $string{$i};
  1365. -
  1366. }
  1367. -
  1368. if(($string{$i} == '}' || $string{$i} == ';' || $pn) && !empty($this->selector))
  1369. -
  1370. {
  1371. -
  1372. if($this->at == '')
  1373. -
  1374. {
  1375. -
  1376. $this->at = DEFAULT_AT;
  1377. -
  1378. }
  1379. -
  1380. -
  1381. // case settings
  1382. -
  1383. if($this->get_cfg('lowercase_s'))
  1384. -
  1385. {
  1386. -
  1387. $this->selector = strtolower($this->selector);
  1388. -
  1389. }
  1390. -
  1391. $this->property = strtolower($this->property);
  1392. -
  1393. -
  1394. $this->optimise->subvalue();
  1395. -
  1396. if($this->sub_value != '') {
  1397. -
  1398. $this->sub_value_arr[] = $this->sub_value;
  1399. -
  1400. $this->sub_value = '';
  1401. -
  1402. }
  1403. -
  1404. -
  1405. $this->value = implode(' ',$this->sub_value_arr);
  1406. -
  1407.  
  1408. -
  1409. $this->selector = trim($this->selector);
  1410. -
  1411. -
  1412. $this->optimise->value();
  1413. -
  1414. -
  1415. $valid = csstidy::property_is_valid($this->property);
  1416. -
  1417. if((!$this->invalid_at || $this->get_cfg('preserve_css')) && (!$this->get_cfg('discard_invalid_properties') || $valid))
  1418. -
  1419. {
  1420. -
  1421. $this->css_add_property($this->at,$this->selector,$this->property,$this->value);
  1422. -
  1423. $this->_add_token(VALUE, $this->value);
  1424. -
  1425. $this->optimise->shorthands();
  1426. -
  1427. }
  1428. -
  1429. if(!$valid)
  1430. -
  1431. {
  1432. -
  1433. if($this->get_cfg('discard_invalid_properties'))
  1434. -
  1435. {
  1436. -
  1437. $this->log('Removed invalid property: '.$this->property,'Warning');
  1438. -
  1439. }
  1440. -
  1441. else
  1442. -
  1443. {
  1444. -
  1445. $this->log('Invalid property in '.strtoupper($this->get_cfg('css_level')).': '.$this->property,'Warning');
  1446. -
  1447. }
  1448. -
  1449. }
  1450. -
  1451. -
  1452. $this->property = '';
  1453. -
  1454. $this->sub_value_arr = array();
  1455. -
  1456. $this->value = '';
  1457. -
  1458. }
  1459. -
  1460. if($string{$i} == '}')
  1461. -
  1462. {
  1463. -
  1464. $this->explode_selectors();
  1465. -
  1466. $this->_add_token(SEL_END, $this->selector);
  1467. -
  1468. $this->status = 'is';
  1469. -
  1470. $this->invalid_at = false;
  1471. -
  1472. $this->selector = '';
  1473. -
  1474. }
  1475. -
  1476. }
  1477. -
  1478. elseif(!$pn)
  1479. -
  1480. {
  1481. -
  1482. $this->sub_value .= $string{$i};
  1483. -
  1484.  
  1485. -
  1486. if(ctype_space($string{$i}))
  1487. -
  1488. {
  1489. -
  1490. $this->optimise->subvalue();
  1491. -
  1492. if($this->sub_value != '') {
  1493. -
  1494. $this->sub_value_arr[] = $this->sub_value;
  1495. -
  1496. $this->sub_value = '';
  1497. -
  1498. }
  1499. -
  1500. }
  1501. -
  1502. }
  1503. -
  1504. break;
  1505. -
  1506. -
  1507. /* Case in string */
  1508. -
  1509. case 'instr':
  1510. -
  1511. if($this->str_char == ')' && $string{$i} == '"' && !$this->str_in_str && !csstidy::escaped($string,$i))
  1512. -
  1513. {
  1514. -
  1515. $this->str_in_str = true;
  1516. -
  1517. }
  1518. -
  1519. elseif($this->str_char == ')' && $string{$i} == '"' && $this->str_in_str && !csstidy::escaped($string,$i))
  1520. -
  1521. {
  1522. -
  1523. $this->str_in_str = false;
  1524. -
  1525. }
  1526. -
  1527. if($string{$i} == $this->str_char && !csstidy::escaped($string,$i) && !$this->str_in_str)
  1528. -
  1529. {
  1530. -
  1531. $this->status = $this->from;
  1532. -
  1533. }
  1534. -
  1535. $temp_add = $string{$i};
  1536. -
  1537. // ...and no not-escaped backslash at the previous position
  1538. -
  1539. if( ($string{$i} == "\n" || $string{$i} == "\r") && !($string{$i-1} == '\\' && !csstidy::escaped($string,$i-1)) )
  1540. -
  1541. {
  1542. -
  1543. $temp_add = "\\A ";
  1544. -
  1545. $this->log('Fixed incorrect newline in string','Warning');
  1546. -
  1547. }
  1548. -
  1549. if($this->from == 'iv')
  1550. -
  1551. {
  1552. -
  1553. $this->sub_value .= $temp_add;
  1554. -
  1555. }
  1556. -
  1557. elseif($this->from == 'is')
  1558. -
  1559. {
  1560. -
  1561. $this->selector .= $temp_add;
  1562. -
  1563. }
  1564. -
  1565. break;
  1566. -
  1567. -
  1568. /* Case in-comment */
  1569. -
  1570. case 'ic':
  1571. -
  1572. if($string{$i} == '*' && $string{$i+1} == '/')
  1573. -
  1574. {
  1575. -
  1576. $this->status = $this->from;
  1577. -
  1578. $i++;
  1579. -
  1580. $this->_add_token(COMMENT, $cur_comment);
  1581. -
  1582. $cur_comment = '';
  1583. -
  1584. }
  1585. -
  1586. else
  1587. -
  1588. {
  1589. -
  1590. $cur_comment .= $string{$i};
  1591. -
  1592. }
  1593. -
  1594. break;
  1595. -
  1596. }
  1597. -
  1598. }
  1599. -
  1600.  
  1601. -
  1602. $this->optimise->postparse();
  1603. -
  1604.  
  1605. -
  1606. $this->print->_reset();
  1607. -
  1608.  
  1609. -
  1610. return !(empty($this->css) && empty($this->import) && empty($this->charset) && empty($this->tokens) && empty($this->namespace));
  1611. -
  1612. }
  1613. -
  1614.  
  1615. -
  1616. /**
  1617. -
  1618. * Explodes selectors
  1619. -
  1620. * @access private
  1621. -
  1622. * @version 1.0
  1623. -
  1624. */
  1625. -
  1626. function explode_selectors()
  1627. -
  1628. {
  1629. -
  1630. // Explode multiple selectors
  1631. -
  1632. if($this->get_cfg('merge_selectors') == 1)
  1633. -
  1634. {
  1635. -
  1636. $new_sels = array();
  1637. -
  1638. $lastpos = 0;
  1639. -
  1640. $this->sel_separate[] = strlen($this->selector);
  1641. -
  1642. foreach($this->sel_separate as $num => $pos)
  1643. -
  1644. {
  1645. -
  1646. if($num == count($this->sel_separate)-1) {
  1647. -
  1648. $pos += 1;
  1649. -
  1650. }
  1651. -
  1652. -
  1653. $new_sels[] = substr($this->selector,$lastpos,$pos-$lastpos-1);
  1654. -
  1655. $lastpos = $pos;
  1656. -
  1657. }
  1658. -
  1659. -
  1660. if(count($new_sels) > 1)
  1661. -
  1662. {
  1663. -
  1664. foreach($new_sels as $selector)
  1665. -
  1666. {
  1667. -
  1668. $this->merge_css_blocks($this->at,$selector,$this->css[$this->at][$this->selector]);
  1669. -
  1670. }
  1671. -
  1672. unset($this->css[$this->at][$this->selector]);
  1673. -
  1674. }
  1675. -
  1676. }
  1677. -
  1678. $this->sel_separate = array();
  1679. -
  1680. }
  1681. -
  1682.  
  1683. -
  1684. /**
  1685. -
  1686. * Checks if a character is escaped (and returns true if it is)
  1687. -
  1688. * @param string $string
  1689. -
  1690. * @param integer $pos
  1691. -
  1692. * @access public
  1693. -
  1694. * @return bool
  1695. -
  1696. * @version 1.02
  1697. -
  1698. */
  1699. -
  1700. function escaped(&$string,$pos)
  1701. -
  1702. {
  1703. -
  1704. return !(@($string{$pos-1} != '\\') || csstidy::escaped($string,$pos-1));
  1705. -
  1706. }
  1707. -
  1708.  
  1709. -
  1710. /**
  1711. -
  1712. * Adds a property with value to the existing CSS code
  1713. -
  1714. * @param string $media
  1715. -
  1716. * @param string $selector
  1717. -
  1718. * @param string $property
  1719. -
  1720. * @param string $new_val
  1721. -
  1722. * @access private
  1723. -
  1724. * @version 1.2
  1725. -
  1726. */
  1727. -
  1728. function css_add_property($media,$selector,$property,$new_val)
  1729. -
  1730. {
  1731. -
  1732. if($this->get_cfg('preserve_css') || trim($new_val) == '') {
  1733. -
  1734. return;
  1735. -
  1736. }
  1737. -
  1738.  
  1739. -
  1740. $this->added = true;
  1741. -
  1742. if(isset($this->css[$media][$selector][$property]))
  1743. -
  1744. {
  1745. -
  1746. if((csstidy::is_important($this->css[$media][$selector][$property]) && csstidy::is_important($new_val)) || !csstidy::is_important($this->css[$media][$selector][$property]))
  1747. -
  1748. {
  1749. -
  1750. unset($this->css[$media][$selector][$property]);
  1751. -
  1752. $this->css[$media][$selector][$property] = trim($new_val);
  1753. -
  1754. }
  1755. -
  1756. }
  1757. -
  1758. else
  1759. -
  1760. {
  1761. -
  1762. $this->css[$media][$selector][$property] = trim($new_val);
  1763. -
  1764. }
  1765. -
  1766. }
  1767. -
  1768.  
  1769. -
  1770. /**
  1771. -
  1772. * Adds CSS to an existing media/selector
  1773. -
  1774. * @param string $media
  1775. -
  1776. * @param string $selector
  1777. -
  1778. * @param array $css_add
  1779. -
  1780. * @access private
  1781. -
  1782. * @version 1.1
  1783. -
  1784. */
  1785. -
  1786. function merge_css_blocks($media,$selector,$css_add)
  1787. -
  1788. {
  1789. -
  1790. foreach($css_add as $property => $value)
  1791. -
  1792. {
  1793. -
  1794. $this->css_add_property($media,$selector,$property,$value,false);
  1795. -
  1796. }
  1797. -
  1798. }
  1799. -
  1800.  
  1801. -
  1802. /**
  1803. -
  1804. * Checks if $value is !important.
  1805. -
  1806. * @param string $value
  1807. -
  1808. * @return bool
  1809. -
  1810. * @access public
  1811. -
  1812. * @version 1.0
  1813. -
  1814. */
  1815. -
  1816. function is_important(&$value)
  1817. -
  1818. {
  1819. -
  1820. return (!strcasecmp(substr(str_replace($GLOBALS['csstidy']['whitespace'],'',$value),-10,10),'!important'));
  1821. -
  1822. }
  1823. -
  1824.  
  1825. -
  1826. /**
  1827. -
  1828. * Returns a value without !important
  1829. -
  1830. * @param string $value
  1831. -
  1832. * @return string
  1833. -
  1834. * @access public
  1835. -
  1836. * @version 1.0
  1837. -
  1838. */
  1839. -
  1840. function gvw_important($value)
  1841. -
  1842. {
  1843. -
  1844. if(csstidy::is_important($value))
  1845. -
  1846. {
  1847. -
  1848. $value = trim($value);
  1849. -
  1850. $value = substr($value,0,-9);
  1851. -
  1852. $value = trim($value);
  1853. -
  1854. $value = substr($value,0,-1);
  1855. -
  1856. $value = trim($value);
  1857. -
  1858. return $value;
  1859. -
  1860. }
  1861. -
  1862. return $value;
  1863. -
  1864. }
  1865. -
  1866.  
  1867. -
  1868. /**
  1869. -
  1870. * Checks if the next word in a string from pos is a CSS property
  1871. -
  1872. * @param string $istring
  1873. -
  1874. * @param integer $pos
  1875. -
  1876. * @return bool
  1877. -
  1878. * @access private
  1879. -
  1880. * @version 1.2
  1881. -
  1882. */
  1883. -
  1884. function property_is_next($istring, $pos)
  1885. -
  1886. {
  1887. -
  1888. $all_properties =& $GLOBALS['csstidy']['all_properties'];
  1889. -
  1890. $istring = substr($istring,$pos,strlen($istring)-$pos);
  1891. -
  1892. $pos = strpos($istring,':');
  1893. -
  1894. if($pos === false)
  1895. -
  1896. {
  1897. -
  1898. return false;
  1899. -
  1900. }
  1901. -
  1902. $istring = strtolower(trim(substr($istring,0,$pos)));
  1903. -
  1904. if(isset($all_properties[$istring]))
  1905. -
  1906. {
  1907. -
  1908. $this->log('Added semicolon to the end of declaration','Warning');
  1909. -
  1910. return true;
  1911. -
  1912. }
  1913. -
  1914. return false;
  1915. -
  1916. }
  1917. -
  1918.  
  1919. -
  1920. /**
  1921. -
  1922. * Checks if a property is valid
  1923. -
  1924. * @param string $property
  1925. -
  1926. * @return bool;
  1927. -
  1928. * @access public
  1929. -
  1930. * @version 1.0
  1931. -
  1932. */
  1933. -
  1934. function property_is_valid($property) {
  1935. -
  1936. $all_properties =& $GLOBALS['csstidy']['all_properties'];
  1937. -
  1938. return (isset($all_properties[$property]) && strpos($all_properties[$property],strtoupper($this->get_cfg('css_level'))) !== false );
  1939. -
  1940. }
  1941. -
  1942.  
  1943. -
  1944. }
  1945. -
  1946. ?>
  1947. -
-
-
-
- Documentation generated on Mon, 15 May 2006 22:55:14 +0200 by phpDocumentor 1.3.0RC3 -
-
-
- - - \ No newline at end of file diff --git a/www/plugins-dist/compresseur/lib/csstidy/Docs/__filesource/fsource_csstidy__class.csstidy_optimise.php.html b/www/plugins-dist/compresseur/lib/csstidy/Docs/__filesource/fsource_csstidy__class.csstidy_optimise.php.html deleted file mode 100644 index f13419ce..00000000 --- a/www/plugins-dist/compresseur/lib/csstidy/Docs/__filesource/fsource_csstidy__class.csstidy_optimise.php.html +++ /dev/null @@ -1,851 +0,0 @@ - - -File Source for class.csstidy_optimise.php - - - - - - - - - - - - - -
csstidy
- [ class tree: csstidy ] - [ index: csstidy ] - [ all elements ] -
- - - - - - -
-
- -

Source for file class.csstidy_optimise.php

-

Documentation is available at class.csstidy_optimise.php

-
-
  1. <?php
  2. -
  3. /**
  4. -
  5. * CSSTidy - CSS Parser and Optimiser
  6. -
  7. *
  8. -
  9. * CSS Optimising Class
  10. -
  11. * This class optimises CSS data generated by csstidy.
  12. -
  13. *
  14. -
  15. * This file is part of CSSTidy.
  16. -
  17. *
  18. -
  19. * CSSTidy is free software; you can redistribute it and/or modify
  20. -
  21. * it under the terms of the GNU General Public License as published by
  22. -
  23. * the Free Software Foundation; either version 2 of the License, or
  24. -
  25. * (at your option) any later version.
  26. -
  27. *
  28. -
  29. * CSSTidy is distributed in the hope that it will be useful,
  30. -
  31. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  32. -
  33. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  34. -
  35. * GNU General Public License for more details.
  36. -
  37. *
  38. -
  39. * You should have received a copy of the GNU General Public License
  40. -
  41. * along with CSSTidy; if not, write to the Free Software
  42. -
  43. * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  44. -
  45. *
  46. -
  47. * @license http://opensource.org/licenses/gpl-license.php GNU Public License
  48. -
  49. * @package csstidy
  50. -
  51. * @author Florian Schmitz (floele at gmail dot com) 2005-2006
  52. -
  53. */
  54. -
  55. -
  56. /**
  57. -
  58. * CSS Optimising Class
  59. -
  60. *
  61. -
  62. * This class optimises CSS data generated by csstidy.
  63. -
  64. *
  65. -
  66. * @package csstidy
  67. -
  68. * @author Florian Schmitz (floele at gmail dot com) 2005-2006
  69. -
  70. * @version 1.0
  71. -
  72. */
  73. -
  74. -
  75. class csstidy_optimise
  76. -
  77. {
  78. -
  79. /**
  80. -
  81. * Constructor
  82. -
  83. * @param array $css contains the class csstidy
  84. -
  85. * @access private
  86. -
  87. * @version 1.0
  88. -
  89. */
  90. -
  91. function csstidy_optimise(&$css)
  92. -
  93. {
  94. -
  95. $this->parser =& $css;
  96. -
  97. $this->css =& $css->css;
  98. -
  99. $this->sub_value =& $css->sub_value;
  100. -
  101. $this->at =& $css->at;
  102. -
  103. $this->selector =& $css->selector;
  104. -
  105. $this->property =& $css->property;
  106. -
  107. $this->value =& $css->value;
  108. -
  109. }
  110. -
  111.  
  112. -
  113. /**
  114. -
  115. * Optimises $css after parsing
  116. -
  117. * @access public
  118. -
  119. * @version 1.0
  120. -
  121. */
  122. -
  123. function postparse()
  124. -
  125. {
  126. -
  127. if ($this->parser->get_cfg('preserve_css')) {
  128. -
  129. return;
  130. -
  131. }
  132. -
  133. -
  134. if ($this->parser->get_cfg('merge_selectors') == 2)
  135. -
  136. {
  137. -
  138. foreach ($this->css as $medium => $value)
  139. -
  140. {
  141. -
  142. $this->merge_selectors($this->css[$medium]);
  143. -
  144. }
  145. -
  146. }
  147. -
  148.  
  149. -
  150. if ($this->parser->get_cfg('optimise_shorthands') > 0)
  151. -
  152. {
  153. -
  154. foreach ($this->css as $medium => $value)
  155. -
  156. {
  157. -
  158. foreach ($value as $selector => $value1)
  159. -
  160. {
  161. -
  162. $this->css[$medium][$selector] = csstidy_optimise::merge_4value_shorthands($this->css[$medium][$selector]);
  163. -
  164. -
  165. if ($this->parser->get_cfg('optimise_shorthands') < 2) {
  166. -
  167. continue;
  168. -
  169. }
  170. -
  171. -
  172. $this->css[$medium][$selector] = csstidy_optimise::merge_bg($this->css[$medium][$selector]);
  173. -
  174. if (empty($this->css[$medium][$selector])) {
  175. -
  176. unset($this->css[$medium][$selector]);
  177. -
  178. }
  179. -
  180. }
  181. -
  182. }
  183. -
  184. }
  185. -
  186. }
  187. -
  188.  
  189. -
  190. /**
  191. -
  192. * Optimises values
  193. -
  194. * @access public
  195. -
  196. * @version 1.0
  197. -
  198. */
  199. -
  200. function value()
  201. -
  202. {
  203. -
  204. $shorthands =& $GLOBALS['csstidy']['shorthands'];
  205. -
  206. -
  207. // optimise shorthand properties
  208. -
  209. if(isset($shorthands[$this->property]))
  210. -
  211. {
  212. -
  213. $temp = csstidy_optimise::shorthand($this->value); // FIXME - move
  214. -
  215. if($temp != $this->value)
  216. -
  217. {
  218. -
  219. $this->parser->log('Optimised shorthand notation ('.$this->property.'): Changed "'.$this->value.'" to "'.$temp.'"','Information');
  220. -
  221. }
  222. -
  223. $this->value = $temp;
  224. -
  225. }
  226. -
  227. -
  228. // Remove whitespace at ! important
  229. -
  230. if($this->value != $this->compress_important($this->value))
  231. -
  232. {
  233. -
  234. $this->parser->log('Optimised !important','Information');
  235. -
  236. }
  237. -
  238. }
  239. -
  240. -
  241. /**
  242. -
  243. * Optimises shorthands
  244. -
  245. * @access public
  246. -
  247. * @version 1.0
  248. -
  249. */
  250. -
  251. function shorthands()
  252. -
  253. {
  254. -
  255. $shorthands =& $GLOBALS['csstidy']['shorthands'];
  256. -
  257. -
  258. if(!$this->parser->get_cfg('optimise_shorthands') || $this->parser->get_cfg('preserve_css')) {
  259. -
  260. return;
  261. -
  262. }
  263. -
  264. -
  265. if($this->property == 'background' && $this->parser->get_cfg('optimise_shorthands') > 1)
  266. -
  267. {
  268. -
  269. unset($this->css[$this->at][$this->selector]['background']);
  270. -
  271. $this->parser->merge_css_blocks($this->at,$this->selector,csstidy_optimise::dissolve_short_bg($this->value));
  272. -
  273. }
  274. -
  275. if(isset($shorthands[$this->property]))
  276. -
  277. {
  278. -
  279. $this->parser->merge_css_blocks($this->at,$this->selector,csstidy_optimise::dissolve_4value_shorthands($this->property,$this->value));
  280. -
  281. if(is_array($shorthands[$this->property]))
  282. -
  283. {
  284. -
  285. unset($this->css[$this->at][$this->selector][$this->property]);
  286. -
  287. }
  288. -
  289. }
  290. -
  291. }
  292. -
  293. -
  294. /**
  295. -
  296. * Optimises a sub-value
  297. -
  298. * @access public
  299. -
  300. * @version 1.0
  301. -
  302. */
  303. -
  304. function subvalue()
  305. -
  306. {
  307. -
  308. $replace_colors =& $GLOBALS['csstidy']['replace_colors'];
  309. -
  310.  
  311. -
  312. $this->sub_value = trim($this->sub_value);
  313. -
  314. if($this->sub_value == '') // caution : '0'
  315. -
  316. {
  317. -
  318. return;
  319. -
  320. }
  321. -
  322. -
  323. // Compress font-weight
  324. -
  325. if($this->property == 'font-weight' && $this->parser->get_cfg('compress_font-weight'))
  326. -
  327. {
  328. -
  329. $important = '';
  330. -
  331. if(csstidy::is_important($this->sub_value))
  332. -
  333. {
  334. -
  335. $important = ' !important';
  336. -
  337. $this->sub_value = csstidy::gvw_important($this->sub_value);
  338. -
  339. }
  340. -
  341. if($this->sub_value == 'bold')
  342. -
  343. {
  344. -
  345. $this->sub_value = '700'.$important;
  346. -
  347. $this->parser->log('Optimised font-weight: Changed "bold" to "700"','Information');
  348. -
  349. }
  350. -
  351. else if($this->sub_value == 'normal')
  352. -
  353. {
  354. -
  355. $this->sub_value = '400'.$important;
  356. -
  357. $this->parser->log('Optimised font-weight: Changed "normal" to "400"','Information');
  358. -
  359. }
  360. -
  361. }
  362. -
  363. -
  364. $temp = $this->compress_numbers($this->sub_value);
  365. -
  366. if($temp != $this->sub_value)
  367. -
  368. {
  369. -
  370. if(strlen($temp) > strlen($this->sub_value)) {
  371. -
  372. $this->parser->log('Fixed invalid number: Changed "'.$this->sub_value.'" to "'.$temp.'"','Warning');
  373. -
  374. } else {
  375. -
  376. $this->parser->log('Optimised number: Changed "'.$this->sub_value.'" to "'.$temp.'"','Information');
  377. -
  378. }
  379. -
  380. $this->sub_value = $temp;
  381. -
  382. }
  383. -
  384. if($this->parser->get_cfg('compress_colors'))
  385. -
  386. {
  387. -
  388. $temp = $this->cut_color($this->sub_value);
  389. -
  390. if($temp !== $this->sub_value)
  391. -
  392. {
  393. -
  394. if(isset($replace_colors[$this->sub_value])) {
  395. -
  396. $this->parser->log('Fixed invalid color name: Changed "'.$this->sub_value.'" to "'.$temp.'"','Warning');
  397. -
  398. } else {
  399. -
  400. $this->parser->log('Optimised color: Changed "'.$this->sub_value.'" to "'.$temp.'"','Information');
  401. -
  402. }
  403. -
  404. $this->sub_value = $temp;
  405. -
  406. }
  407. -
  408. }
  409. -
  410. }
  411. -
  412. -
  413. /**
  414. -
  415. * Compresses shorthand values. Example: margin:1px 1px 1px 1px -> margin:1px
  416. -
  417. * @param string $value
  418. -
  419. * @access public
  420. -
  421. * @return string
  422. -
  423. * @version 1.0
  424. -
  425. */
  426. -
  427. function shorthand($value)
  428. -
  429. {
  430. -
  431. $important = '';
  432. -
  433. if(csstidy::is_important($value))
  434. -
  435. {
  436. -
  437. $values = csstidy::gvw_important($value);
  438. -
  439. $important = ' !important';
  440. -
  441. }
  442. -
  443. else $values = $value;
  444. -
  445. -
  446. $values = explode(' ',$values);
  447. -
  448. switch(count($values))
  449. -
  450. {
  451. -
  452. case 4:
  453. -
  454. if($values[0] == $values[1] && $values[0] == $values[2] && $values[0] == $values[3])
  455. -
  456. {
  457. -
  458. return $values[0].$important;
  459. -
  460. }
  461. -
  462. elseif($values[1] == $values[3] && $values[0] == $values[2])
  463. -
  464. {
  465. -
  466. return $values[0].' '.$values[1].$important;
  467. -
  468. }
  469. -
  470. elseif($values[1] == $values[3])
  471. -
  472. {
  473. -
  474. return $values[0].' '.$values[1].' '.$values[2].$important;
  475. -
  476. }
  477. -
  478. break;
  479. -
  480. -
  481. case 3:
  482. -
  483. if($values[0] == $values[1] && $values[0] == $values[2])
  484. -
  485. {
  486. -
  487. return $values[0].$important;
  488. -
  489. }
  490. -
  491. elseif($values[0] == $values[2])
  492. -
  493. {
  494. -
  495. return $values[0].' '.$values[1].$important;
  496. -
  497. }
  498. -
  499. break;
  500. -
  501. -
  502. case 2:
  503. -
  504. if($values[0] == $values[1])
  505. -
  506. {
  507. -
  508. return $values[0].$important;
  509. -
  510. }
  511. -
  512. break;
  513. -
  514. }
  515. -
  516. -
  517. return $value;
  518. -
  519. }
  520. -
  521.  
  522. -
  523. /**
  524. -
  525. * Removes unnecessary whitespace in ! important
  526. -
  527. * @param string $string
  528. -
  529. * @return string
  530. -
  531. * @access public
  532. -
  533. * @version 1.1
  534. -
  535. */
  536. -
  537. function compress_important(&$string)
  538. -
  539. {
  540. -
  541. if(csstidy::is_important($string))
  542. -
  543. {
  544. -
  545. $string = csstidy::gvw_important($string) . ' !important';
  546. -
  547. }
  548. -
  549. return $string;
  550. -
  551. }
  552. -
  553.  
  554. -
  555. /**
  556. -
  557. * Color compression function. Converts all rgb() values to #-values and uses the short-form if possible. Also replaces 4 color names by #-values.
  558. -
  559. * @param string $color
  560. -
  561. * @return string
  562. -
  563. * @version 1.1
  564. -
  565. */
  566. -
  567. function cut_color($color)
  568. -
  569. {
  570. -
  571. $replace_colors =& $GLOBALS['csstidy']['replace_colors'];
  572. -
  573. -
  574. // rgb(0,0,0) -> #000000 (or #000 in this case later)
  575. -
  576. if(strtolower(substr($color,0,4)) == 'rgb(')
  577. -
  578. {
  579. -
  580. $color_tmp = substr($color,4,strlen($color)-5);
  581. -
  582. $color_tmp = explode(',',$color_tmp);
  583. -
  584. for ( $i = 0; $i < count($color_tmp); $i++ )
  585. -
  586. {
  587. -
  588. $color_tmp[$i] = trim ($color_tmp[$i]);
  589. -
  590. if(substr($color_tmp[$i],-1) == '%')
  591. -
  592. {
  593. -
  594. $color_tmp[$i] = round((255*$color_tmp[$i])/100);
  595. -
  596. }
  597. -
  598. if($color_tmp[$i]>255) $color_tmp[$i] = 255;
  599. -
  600. }
  601. -
  602. $color = '#';
  603. -
  604. for ($i = 0; $i < 3; $i++ )
  605. -
  606. {
  607. -
  608. if($color_tmp[$i]<16) {
  609. -
  610. $color .= '0' . dechex($color_tmp[$i]);
  611. -
  612. } else {
  613. -
  614. $color .= dechex($color_tmp[$i]);
  615. -
  616. }
  617. -
  618. }
  619. -
  620. }
  621. -
  622. -
  623. // Fix bad color names
  624. -
  625. if(isset($replace_colors[strtolower($color)]))
  626. -
  627. {
  628. -
  629. $color = $replace_colors[strtolower($color)];
  630. -
  631. }
  632. -
  633. -
  634. // #aabbcc -> #abc
  635. -
  636. if(strlen($color) == 7)
  637. -
  638. {
  639. -
  640. $color_temp = strtolower($color);
  641. -
  642. if($color_temp{0} == '#' && $color_temp{1} == $color_temp{2} && $color_temp{3} == $color_temp{4} && $color_temp{5} == $color_temp{6})
  643. -
  644. {
  645. -
  646. $color = '#'.$color{1}.$color{3}.$color{5};
  647. -
  648. }
  649. -
  650. }
  651. -
  652. -
  653. switch(strtolower($color))
  654. -
  655. {
  656. -
  657. /* color name -> hex code */
  658. -
  659. case 'black': return '#000';
  660. -
  661. case 'fuchsia': return '#F0F';
  662. -
  663. case 'white': return '#FFF';
  664. -
  665. case 'yellow': return '#FF0';
  666. -
  667. -
  668. /* hex code -> color name */
  669. -
  670. case '#800000': return 'maroon';
  671. -
  672. case '#ffa500': return 'orange';
  673. -
  674. case '#808000': return 'olive';
  675. -
  676. case '#800080': return 'purple';
  677. -
  678. case '#008000': return 'green';
  679. -
  680. case '#000080': return 'navy';
  681. -
  682. case '#008080': return 'teal';
  683. -
  684. case '#c0c0c0': return 'silver';
  685. -
  686. case '#808080': return 'gray';
  687. -
  688. case '#f00': return 'red';
  689. -
  690. }
  691. -
  692.  
  693. -
  694. return $color;
  695. -
  696. }
  697. -
  698. -
  699. /**
  700. -
  701. * Compresses numbers (ie. 1.0 becomes 1 or 1.100 becomes 1.1 )
  702. -
  703. * @param string $subvalue
  704. -
  705. * @return string
  706. -
  707. * @version 1.2
  708. -
  709. */
  710. -
  711. function compress_numbers($subvalue)
  712. -
  713. {
  714. -
  715. $units =& $GLOBALS['csstidy']['units'];
  716. -
  717. $number_values =& $GLOBALS['csstidy']['number_values'];
  718. -
  719. $color_values =& $GLOBALS['csstidy']['color_values'];
  720. -
  721.  
  722. -
  723. // for font:1em/1em sans-serif...;
  724. -
  725. if($this->property == 'font')
  726. -
  727. {
  728. -
  729. $temp = explode('/',$subvalue);
  730. -
  731. }
  732. -
  733. else
  734. -
  735. {
  736. -
  737. $temp = array($subvalue);
  738. -
  739. }
  740. -
  741. for ($l = 0; $l < count($temp); $l++)
  742. -
  743. {
  744. -
  745. // continue if no numeric value
  746. -
  747. if (!(strlen($temp[$l]) > 0 && ( is_numeric($temp[$l]{0}) || $temp[$l]{0} == '+' || $temp[$l]{0} == '-' ) ))
  748. -
  749. {
  750. -
  751. continue;
  752. -
  753. }
  754. -
  755.  
  756. -
  757. // Fix bad colors
  758. -
  759. if (in_array($this->property, $color_values))
  760. -
  761. {
  762. -
  763. $temp[$l] = '#'.$temp[$l];
  764. -
  765. }
  766. -
  767. -
  768. if (floatval($temp[$l]) == 0)
  769. -
  770. {
  771. -
  772. $temp[$l] = '0';
  773. -
  774. }
  775. -
  776. else
  777. -
  778. {
  779. -
  780. $unit_found = FALSE;
  781. -
  782. for ($m = 0, $size_4 = count($units); $m < $size_4; $m++)
  783. -
  784. {
  785. -
  786. if (strpos(strtolower($temp[$l]),$units[$m]) !== FALSE)
  787. -
  788. {
  789. -
  790. $temp[$l] = floatval($temp[$l]).$units[$m];
  791. -
  792. $unit_found = TRUE;
  793. -
  794. break;
  795. -
  796. }
  797. -
  798. }
  799. -
  800. if (!$unit_found && !in_array($this->property,$number_values,TRUE))
  801. -
  802. {
  803. -
  804. $temp[$l] = floatval($temp[$l]).'px';
  805. -
  806. }
  807. -
  808. else if (!$unit_found)
  809. -
  810. {
  811. -
  812. $temp[$l] = floatval($temp[$l]);
  813. -
  814. }
  815. -
  816. }
  817. -
  818. }
  819. -
  820.  
  821. -
  822. return ((count($temp) > 1) ? $temp[0].'/'.$temp[1] : $temp[0]);
  823. -
  824. }
  825. -
  826.  
  827. -
  828. /**
  829. -
  830. * Merges selectors with same properties. Example: a{color:red} b{color:red} -> a,b{color:red}
  831. -
  832. * Very basic and has at least one bug. Hopefully there is a replacement soon.
  833. -
  834. * @param array $array
  835. -
  836. * @return array
  837. -
  838. * @access public
  839. -
  840. * @version 1.2
  841. -
  842. */
  843. -
  844. function merge_selectors(&$array)
  845. -
  846. {
  847. -
  848. $css = $array;
  849. -
  850. foreach($css as $key => $value)
  851. -
  852. {
  853. -
  854. if(!isset($css[$key]))
  855. -
  856. {
  857. -
  858. continue;
  859. -
  860. }
  861. -
  862. $newsel = '';
  863. -
  864. -
  865. // Check if properties also exist in another selector
  866. -
  867. $keys = array();
  868. -
  869. // PHP bug (?) without $css = $array; here
  870. -
  871. foreach($css as $selector => $vali)
  872. -
  873. {
  874. -
  875. if($selector == $key)
  876. -
  877. {
  878. -
  879. continue;
  880. -
  881. }
  882. -
  883. -
  884. if($css[$key] === $vali)
  885. -
  886. {
  887. -
  888. $keys[] = $selector;
  889. -
  890. }
  891. -
  892. }
  893. -
  894.  
  895. -
  896. if(!empty($keys))
  897. -
  898. {
  899. -
  900. $newsel = $key;
  901. -
  902. unset($css[$key]);
  903. -
  904. foreach($keys as $selector)
  905. -
  906. {
  907. -
  908. unset($css[$selector]);
  909. -
  910. $newsel .= ','.$selector;
  911. -
  912. }
  913. -
  914. $css[$newsel] = $value;
  915. -
  916. }
  917. -
  918. }
  919. -
  920. $array = $css;
  921. -
  922. }
  923. -
  924.  
  925. -
  926. /**
  927. -
  928. * Dissolves properties like padding:10px 10px 10px to padding-top:10px;padding-bottom:10px;...
  929. -
  930. * @param string $property
  931. -
  932. * @param string $value
  933. -
  934. * @return array
  935. -
  936. * @version 1.0
  937. -
  938. * @see merge_4value_shorthands()
  939. -
  940. */
  941. -
  942. function dissolve_4value_shorthands($property,$value)
  943. -
  944. {
  945. -
  946. $shorthands =& $GLOBALS['csstidy']['shorthands'];
  947. -
  948. if(!is_array($shorthands[$property]))
  949. -
  950. {
  951. -
  952. $return[$property] = $value;
  953. -
  954. return $return;
  955. -
  956. }
  957. -
  958. -
  959. $important = '';
  960. -
  961. if(csstidy::is_important($value))
  962. -
  963. {
  964. -
  965. $value = csstidy::gvw_important($value);
  966. -
  967. $important = ' !important';
  968. -
  969. }
  970. -
  971. $values = explode(' ',$value);
  972. -
  973.  
  974. -
  975.  
  976. -
  977. $return = array();
  978. -
  979. if(count($values) == 4)
  980. -
  981. {
  982. -
  983. for($i=0;$i<4;$i++)
  984. -
  985. {
  986. -
  987. $return[$shorthands[$property][$i]] = $values[$i].$important;
  988. -
  989. }
  990. -
  991. }
  992. -
  993. elseif(count($values) == 3)
  994. -
  995. {
  996. -
  997. $return[$shorthands[$property][0]] = $values[0].$important;
  998. -
  999. $return[$shorthands[$property][1]] = $values[1].$important;
  1000. -
  1001. $return[$shorthands[$property][3]] = $values[1].$important;
  1002. -
  1003. $return[$shorthands[$property][2]] = $values[2].$important;
  1004. -
  1005. }
  1006. -
  1007. elseif(count($values) == 2)
  1008. -
  1009. {
  1010. -
  1011. for($i=0;$i<4;$i++)
  1012. -
  1013. {
  1014. -
  1015. $return[$shorthands[$property][$i]] = (($i % 2 != 0)) ? $values[1].$important : $values[0].$important;
  1016. -
  1017. }
  1018. -
  1019. }
  1020. -
  1021. else
  1022. -
  1023. {
  1024. -
  1025. for($i=0;$i<4;$i++)
  1026. -
  1027. {
  1028. -
  1029. $return[$shorthands[$property][$i]] = $values[0].$important;
  1030. -
  1031. }
  1032. -
  1033. }
  1034. -
  1035. -
  1036. return $return;
  1037. -
  1038. }
  1039. -
  1040.  
  1041. -
  1042. /**
  1043. -
  1044. * Explodes a string as explode() does, however, not if $sep is escaped or within a string.
  1045. -
  1046. * @param string $sep seperator
  1047. -
  1048. * @param string $string
  1049. -
  1050. * @return array
  1051. -
  1052. * @version 1.0
  1053. -
  1054. */
  1055. -
  1056. function explode_ws($sep,$string)
  1057. -
  1058. {
  1059. -
  1060. $status = 'st';
  1061. -
  1062. $to = '';
  1063. -
  1064. -
  1065. $output = array();
  1066. -
  1067. $num = 0;
  1068. -
  1069. for($i = 0, $len = strlen($string);$i < $len; $i++)
  1070. -
  1071. {
  1072. -
  1073. switch($status)
  1074. -
  1075. {
  1076. -
  1077. case 'st':
  1078. -
  1079. if($string{$i} == $sep && !csstidy::escaped($string,$i))
  1080. -
  1081. {
  1082. -
  1083. ++$num;
  1084. -
  1085. }
  1086. -
  1087. elseif($string{$i} == '"' || $string{$i} == '\'' || $string{$i} == '(' && !csstidy::escaped($string,$i))
  1088. -
  1089. {
  1090. -
  1091. $status = 'str';
  1092. -
  1093. $to = ($string{$i} == '(') ? ')' : $string{$i};
  1094. -
  1095. (isset($output[$num])) ? $output[$num] .= $string{$i} : $output[$num] = $string{$i};
  1096. -
  1097. }
  1098. -
  1099. else
  1100. -
  1101. {
  1102. -
  1103. (isset($output[$num])) ? $output[$num] .= $string{$i} : $output[$num] = $string{$i};
  1104. -
  1105. }
  1106. -
  1107. break;
  1108. -
  1109. -
  1110. case 'str':
  1111. -
  1112. if($string{$i} == $to && !csstidy::escaped($string,$i))
  1113. -
  1114. {
  1115. -
  1116. $status = 'st';
  1117. -
  1118. }
  1119. -
  1120. (isset($output[$num])) ? $output[$num] .= $string{$i} : $output[$num] = $string{$i};
  1121. -
  1122. break;
  1123. -
  1124. }
  1125. -
  1126. }
  1127. -
  1128. -
  1129. if(isset($output[0]))
  1130. -
  1131. {
  1132. -
  1133. return $output;
  1134. -
  1135. }
  1136. -
  1137. else
  1138. -
  1139. {
  1140. -
  1141. return array($output);
  1142. -
  1143. }
  1144. -
  1145. }
  1146. -
  1147.  
  1148. -
  1149. /**
  1150. -
  1151. * Merges Shorthand properties again, the opposite of dissolve_4value_shorthands()
  1152. -
  1153. * @param array $array
  1154. -
  1155. * @return array
  1156. -
  1157. * @version 1.2
  1158. -
  1159. * @see dissolve_4value_shorthands()
  1160. -
  1161. */
  1162. -
  1163. function merge_4value_shorthands($array)
  1164. -
  1165. {
  1166. -
  1167. $return = $array;
  1168. -
  1169. $shorthands =& $GLOBALS['csstidy']['shorthands'];
  1170. -
  1171. -
  1172. foreach($shorthands as $key => $value)
  1173. -
  1174. {
  1175. -
  1176. if(isset($array[$value[0]]) && isset($array[$value[1]])
  1177. -
  1178. && isset($array[$value[2]]) && isset($array[$value[3]]) && $value !== 0)
  1179. -
  1180. {
  1181. -
  1182. $return[$key] = '';
  1183. -
  1184. -
  1185. $important = '';
  1186. -
  1187. for($i = 0; $i < 4; $i++)
  1188. -
  1189. {
  1190. -
  1191. $val = $array[$value[$i]];
  1192. -
  1193. if(csstidy::is_important($val))
  1194. -
  1195. {
  1196. -
  1197. $important = '!important';
  1198. -
  1199. $return[$key] .= csstidy::gvw_important($val).' ';
  1200. -
  1201. }
  1202. -
  1203. else
  1204. -
  1205. {
  1206. -
  1207. $return[$key] .= $val.' ';
  1208. -
  1209. }
  1210. -
  1211. unset($return[$value[$i]]);
  1212. -
  1213. }
  1214. -
  1215. $return[$key] = csstidy_optimise::shorthand(trim($return[$key].$important));
  1216. -
  1217. }
  1218. -
  1219. }
  1220. -
  1221. return $return;
  1222. -
  1223. }
  1224. -
  1225.  
  1226. -
  1227. /**
  1228. -
  1229. * Dissolve background property
  1230. -
  1231. * @param string $str_value
  1232. -
  1233. * @return array
  1234. -
  1235. * @version 1.0
  1236. -
  1237. * @see merge_bg()
  1238. -
  1239. * @todo full CSS 3 compliance
  1240. -
  1241. */
  1242. -
  1243. function dissolve_short_bg($str_value)
  1244. -
  1245. {
  1246. -
  1247. $background_prop_default =& $GLOBALS['csstidy']['background_prop_default'];
  1248. -
  1249. $repeat = array('repeat','repeat-x','repeat-y','no-repeat','space');
  1250. -
  1251. $attachment = array('scroll','fixed','local');
  1252. -
  1253. $clip = array('border','padding');
  1254. -
  1255. $origin = array('border','padding','content');
  1256. -
  1257. $pos = array('top','center','bottom','left','right');
  1258. -
  1259. $important = '';
  1260. -
  1261. $return = array('background-image' => NULL,'background-size' => NULL,'background-repeat' => NULL,'background-position' => NULL,'background-attachment'=>NULL,'background-clip' => NULL,'background-origin' => NULL,'background-color' => NULL);
  1262. -
  1263. -
  1264. if(csstidy::is_important($str_value))
  1265. -
  1266. {
  1267. -
  1268. $important = ' !important';
  1269. -
  1270. $str_value = csstidy::gvw_important($str_value);
  1271. -
  1272. }
  1273. -
  1274. -
  1275. $str_value = csstidy_optimise::explode_ws(',',$str_value);
  1276. -
  1277. for($i = 0; $i < count($str_value); $i++)
  1278. -
  1279. {
  1280. -
  1281. $have['clip'] = FALSE; $have['pos'] = FALSE;
  1282. -
  1283. $have['color'] = FALSE; $have['bg'] = FALSE;
  1284. -
  1285. -
  1286. $str_value[$i] = csstidy_optimise::explode_ws(' ',trim($str_value[$i]));
  1287. -
  1288. -
  1289. for($j = 0; $j < count($str_value[$i]); $j++)
  1290. -
  1291. {
  1292. -
  1293. if($have['bg'] === FALSE && (substr($str_value[$i][$j],0,4) == 'url(' || $str_value[$i][$j] === 'none'))
  1294. -
  1295. {
  1296. -
  1297. $return['background-image'] .= $str_value[$i][$j].',';
  1298. -
  1299. $have['bg'] = TRUE;
  1300. -
  1301. }
  1302. -
  1303. elseif(in_array($str_value[$i][$j],$repeat,TRUE))
  1304. -
  1305. {
  1306. -
  1307. $return['background-repeat'] .= $str_value[$i][$j].',';
  1308. -
  1309. }
  1310. -
  1311. elseif(in_array($str_value[$i][$j],$attachment,TRUE))
  1312. -
  1313. {
  1314. -
  1315. $return['background-attachment'] .= $str_value[$i][$j].',';
  1316. -
  1317. }
  1318. -
  1319. elseif(in_array($str_value[$i][$j],$clip,TRUE) && !$have['clip'])
  1320. -
  1321. {
  1322. -
  1323. $return['background-clip'] .= $str_value[$i][$j].',';
  1324. -
  1325. $have['clip'] = TRUE;
  1326. -
  1327. }
  1328. -
  1329. elseif(in_array($str_value[$i][$j],$origin,TRUE))
  1330. -
  1331. {
  1332. -
  1333. $return['background-origin'] .= $str_value[$i][$j].',';
  1334. -
  1335. }
  1336. -
  1337. elseif($str_value[$i][$j]{0} == '(')
  1338. -
  1339. {
  1340. -
  1341. $return['background-size'] .= substr($str_value[$i][$j],1,-1).',';
  1342. -
  1343. }
  1344. -
  1345. elseif(in_array($str_value[$i][$j],$pos,TRUE) || is_numeric($str_value[$i][$j]{0}) || $str_value[$i][$j]{0} === NULL)
  1346. -
  1347. {
  1348. -
  1349. $return['background-position'] .= $str_value[$i][$j];
  1350. -
  1351. if(!$have['pos']) $return['background-position'] .= ' '; else $return['background-position'].= ',';
  1352. -
  1353. $have['pos'] = TRUE;
  1354. -
  1355. }
  1356. -
  1357. elseif(!$have['color'])
  1358. -
  1359. {
  1360. -
  1361. $return['background-color'] .= $str_value[$i][$j].',';
  1362. -
  1363. $have['color'] = TRUE;
  1364. -
  1365. }
  1366. -
  1367. }
  1368. -
  1369. }
  1370. -
  1371. -
  1372. foreach($background_prop_default as $bg_prop => $default_value)
  1373. -
  1374. {
  1375. -
  1376. if($return[$bg_prop] !== NULL)
  1377. -
  1378. {
  1379. -
  1380. $return[$bg_prop] = substr($return[$bg_prop],0,-1).$important;
  1381. -
  1382. }
  1383. -
  1384. else $return[$bg_prop] = $default_value.$important;
  1385. -
  1386. }
  1387. -
  1388. return $return;
  1389. -
  1390. }
  1391. -
  1392.  
  1393. -
  1394. /**
  1395. -
  1396. * Merges all background properties
  1397. -
  1398. * @param array $input_css
  1399. -
  1400. * @return array
  1401. -
  1402. * @version 1.0
  1403. -
  1404. * @see dissolve_short_bg()
  1405. -
  1406. * @todo full CSS 3 compliance
  1407. -
  1408. */
  1409. -
  1410. function merge_bg($input_css)
  1411. -
  1412. {
  1413. -
  1414. $background_prop_default =& $GLOBALS['csstidy']['background_prop_default'];
  1415. -
  1416. // Max number of background images. CSS3 not yet fully implemented
  1417. -
  1418. $number_of_values = @max(count(csstidy_optimise::explode_ws(',',$input_css['background-image'])),count(csstidy_optimise::explode_ws(',',$input_css['background-color'])),1);
  1419. -
  1420. // Array with background images to check if BG image exists
  1421. -
  1422. $bg_img_array = @csstidy_optimise::explode_ws(',',csstidy::gvw_important($input_css['background-image']));
  1423. -
  1424. $new_bg_value = '';
  1425. -
  1426. $important = '';
  1427. -
  1428. -
  1429. for($i = 0; $i < $number_of_values; $i++)
  1430. -
  1431. {
  1432. -
  1433. foreach($background_prop_default as $bg_property => $default_value)
  1434. -
  1435. {
  1436. -
  1437. // Skip if property does not exist
  1438. -
  1439. if(!isset($input_css[$bg_property]))
  1440. -
  1441. {
  1442. -
  1443. continue;
  1444. -
  1445. }
  1446. -
  1447. -
  1448. $cur_value = $input_css[$bg_property];
  1449. -
  1450. -
  1451. // Skip some properties if there is no background image
  1452. -
  1453. if((!isset($bg_img_array[$i]) || $bg_img_array[$i] === 'none')
  1454. -
  1455. && ($bg_property === 'background-size' || $bg_property === 'background-position'
  1456. -
  1457. || $bg_property === 'background-attachment' || $bg_property === 'background-repeat'))
  1458. -
  1459. {
  1460. -
  1461. continue;
  1462. -
  1463. }
  1464. -
  1465. -
  1466. // Remove !important
  1467. -
  1468. if(csstidy::is_important($cur_value))
  1469. -
  1470. {
  1471. -
  1472. $important = ' !important';
  1473. -
  1474. $cur_value = csstidy::gvw_important($cur_value);
  1475. -
  1476. }
  1477. -
  1478. -
  1479. // Do not add default values
  1480. -
  1481. if($cur_value === $default_value)
  1482. -
  1483. {
  1484. -
  1485. continue;
  1486. -
  1487. }
  1488. -
  1489. -
  1490. $temp = csstidy_optimise::explode_ws(',',$cur_value);
  1491. -
  1492.  
  1493. -
  1494. if(isset($temp[$i]))
  1495. -
  1496. {
  1497. -
  1498. if($bg_property == 'background-size')
  1499. -
  1500. {
  1501. -
  1502. $new_bg_value .= '('.$temp[$i].') ';
  1503. -
  1504. }
  1505. -
  1506. else
  1507. -
  1508. {
  1509. -
  1510. $new_bg_value .= $temp[$i].' ';
  1511. -
  1512. }
  1513. -
  1514. }
  1515. -
  1516. }
  1517. -
  1518. -
  1519. $new_bg_value = trim($new_bg_value);
  1520. -
  1521. if($i != $number_of_values-1) $new_bg_value .= ',';
  1522. -
  1523. }
  1524. -
  1525. -
  1526. // Delete all background-properties
  1527. -
  1528. foreach($background_prop_default as $bg_property => $default_value)
  1529. -
  1530. {
  1531. -
  1532. unset($input_css[$bg_property]);
  1533. -
  1534. }
  1535. -
  1536. -
  1537. // Add new background property
  1538. -
  1539. if($new_bg_value !== '') $input_css['background'] = $new_bg_value.$important;
  1540. -
  1541. -
  1542. return $input_css;
  1543. -
  1544. }
  1545. -
  1546. }
  1547. -
  1548. ?>
  1549. -
-
-
-
- Documentation generated on Mon, 15 May 2006 22:55:34 +0200 by phpDocumentor 1.3.0RC3 -
-
-
- - - \ No newline at end of file diff --git a/www/plugins-dist/compresseur/lib/csstidy/Docs/__filesource/fsource_csstidy__class.csstidy_print.php.html b/www/plugins-dist/compresseur/lib/csstidy/Docs/__filesource/fsource_csstidy__class.csstidy_print.php.html deleted file mode 100644 index f49644e4..00000000 --- a/www/plugins-dist/compresseur/lib/csstidy/Docs/__filesource/fsource_csstidy__class.csstidy_print.php.html +++ /dev/null @@ -1,402 +0,0 @@ - - -File Source for class.csstidy_print.php - - - - - - - - - - - - - -
csstidy
- [ class tree: csstidy ] - [ index: csstidy ] - [ all elements ] -
- - - - - - -
-
- -

Source for file class.csstidy_print.php

-

Documentation is available at class.csstidy_print.php

-
-
  1. <?php
  2. -
  3. /**
  4. -
  5. * CSSTidy - CSS Parser and Optimiser
  6. -
  7. *
  8. -
  9. * CSS Printing class
  10. -
  11. * This class prints CSS data generated by csstidy.
  12. -
  13. *
  14. -
  15. * This file is part of CSSTidy.
  16. -
  17. *
  18. -
  19. * CSSTidy is free software; you can redistribute it and/or modify
  20. -
  21. * it under the terms of the GNU General Public License as published by
  22. -
  23. * the Free Software Foundation; either version 2 of the License, or
  24. -
  25. * (at your option) any later version.
  26. -
  27. *
  28. -
  29. * CSSTidy is distributed in the hope that it will be useful,
  30. -
  31. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  32. -
  33. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  34. -
  35. * GNU General Public License for more details.
  36. -
  37. *
  38. -
  39. * You should have received a copy of the GNU General Public License
  40. -
  41. * along with CSSTidy; if not, write to the Free Software
  42. -
  43. * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  44. -
  45. *
  46. -
  47. * @license http://opensource.org/licenses/gpl-license.php GNU Public License
  48. -
  49. * @package csstidy
  50. -
  51. * @author Florian Schmitz (floele at gmail dot com) 2005-2006
  52. -
  53. */
  54. -
  55. -
  56. /**
  57. -
  58. * CSS Printing class
  59. -
  60. *
  61. -
  62. * This class prints CSS data generated by csstidy.
  63. -
  64. *
  65. -
  66. * @package csstidy
  67. -
  68. * @author Florian Schmitz (floele at gmail dot com) 2005-2006
  69. -
  70. * @version 1.0
  71. -
  72. */
  73. -
  74. -
  75. class csstidy_print
  76. -
  77. {
  78. -
  79. /**
  80. -
  81. * Saves the input CSS string
  82. -
  83. * @var string
  84. -
  85. * @access private
  86. -
  87. */
  88. -
  89. var $input_css = '';
  90. -
  91.  
  92. -
  93. /**
  94. -
  95. * Saves the formatted CSS string
  96. -
  97. * @var string
  98. -
  99. * @access public
  100. -
  101. */
  102. -
  103. var $output_css = '';
  104. -
  105.  
  106. -
  107. /**
  108. -
  109. * Saves the formatted CSS string (plain text)
  110. -
  111. * @var string
  112. -
  113. * @access public
  114. -
  115. */
  116. -
  117. var $output_css_plain = '';
  118. -
  119.  
  120. -
  121. /**
  122. -
  123. * Constructor
  124. -
  125. * @param array $css contains the class csstidy
  126. -
  127. * @access private
  128. -
  129. * @version 1.0
  130. -
  131. */
  132. -
  133. function csstidy_print(&$css)
  134. -
  135. {
  136. -
  137. $this->parser =& $css;
  138. -
  139. $this->css =& $css->css;
  140. -
  141. $this->template =& $css->template;
  142. -
  143. $this->tokens =& $css->tokens;
  144. -
  145. $this->charset =& $css->charset;
  146. -
  147. $this->import =& $css->import;
  148. -
  149. $this->namespace =& $css->namespace;
  150. -
  151. }
  152. -
  153.  
  154. -
  155. /**
  156. -
  157. * Resets output_css and output_css_plain (new css code)
  158. -
  159. * @access private
  160. -
  161. * @version 1.0
  162. -
  163. */
  164. -
  165. function _reset()
  166. -
  167. {
  168. -
  169. $this->output_css = '';
  170. -
  171. $this->output_css_plain = '';
  172. -
  173. }
  174. -
  175.  
  176. -
  177. /**
  178. -
  179. * Returns the CSS code as plain text
  180. -
  181. * @return string
  182. -
  183. * @access public
  184. -
  185. * @version 1.0
  186. -
  187. */
  188. -
  189. function plain()
  190. -
  191. {
  192. -
  193. $this->_print(true);
  194. -
  195. return $this->output_css_plain;
  196. -
  197. }
  198. -
  199.  
  200. -
  201. /**
  202. -
  203. * Returns the formatted CSS code
  204. -
  205. * @return string
  206. -
  207. * @access public
  208. -
  209. * @version 1.0
  210. -
  211. */
  212. -
  213. function formatted()
  214. -
  215. {
  216. -
  217. $this->_print(false);
  218. -
  219. return $this->output_css;
  220. -
  221. }
  222. -
  223. -
  224. /**
  225. -
  226. * Returns the formatted CSS Code and saves it into $this->output_css and $this->output_css_plain
  227. -
  228. * @param bool $plain plain text or not
  229. -
  230. * @access private
  231. -
  232. * @version 2.0
  233. -
  234. */
  235. -
  236. function _print($plain = false)
  237. -
  238. {
  239. -
  240. if ($this->output_css && $this->output_css_plain) {
  241. -
  242. return;
  243. -
  244. }
  245. -
  246. -
  247. $output = '';
  248. -
  249. if (!$this->parser->get_cfg('preserve_css')) {
  250. -
  251. $this->_convert_raw_css();
  252. -
  253. }
  254. -
  255.  
  256. -
  257. $template =& $this->template;
  258. -
  259.  
  260. -
  261. if ($plain) {
  262. -
  263. $template = array_map('strip_tags', $template);
  264. -
  265. }
  266. -
  267. -
  268. if ($this->parser->get_cfg('timestamp')) {
  269. -
  270. array_unshift($this->tokens, array(COMMENT, ' CSSTidy ' . $this->parser->version . ': ' . date('r') . ' '));
  271. -
  272. }
  273. -
  274. -
  275. if (!empty($this->charset)) {
  276. -
  277. $output .= $template[0].'@charset '.$template[5].$this->charset.$template[6];
  278. -
  279. }
  280. -
  281. -
  282. if (!empty($this->import)) {
  283. -
  284. for ($i = 0, $size = count($this->import); $i < $size; $i ++) {
  285. -
  286. $output .= $template[0].'@import '.$template[5].$this->import[$i].$template[6];
  287. -
  288. }
  289. -
  290. }
  291. -
  292. -
  293. if (!empty($this->namespace)) {
  294. -
  295. $output .= $template[0].'@namespace '.$template[5].$this->namespace.$template[6];
  296. -
  297. }
  298. -
  299. -
  300. $output .= $template[13];
  301. -
  302. $in_at_out = '';
  303. -
  304. $out =& $output;
  305. -
  306. -
  307. foreach ($this->tokens as $key => $token)
  308. -
  309. {
  310. -
  311. switch ($token[0])
  312. -
  313. {
  314. -
  315. case AT_START:
  316. -
  317. $out .= $template[0].$this->_htmlsp($token[1], $plain).$template[1];
  318. -
  319. $out =& $in_at_out;
  320. -
  321. break;
  322. -
  323. -
  324. case SEL_START:
  325. -
  326. if($this->parser->get_cfg('lowercase_s')) $token[1] = strtolower($token[1]);
  327. -
  328. $out .= ($token[1]{0} !== '@') ? $template[2].$this->_htmlsp($token[1], $plain) : $template[0].$this->_htmlsp($token[1], $plain);
  329. -
  330. $out .= $template[3];
  331. -
  332. break;
  333. -
  334. -
  335. case PROPERTY:
  336. -
  337. if($this->parser->get_cfg('case_properties') == 2) $token[1] = strtoupper($token[1]);
  338. -
  339. if($this->parser->get_cfg('case_properties') == 1) $token[1] = strtolower($token[1]);
  340. -
  341. $out .= $template[4] . $this->_htmlsp($token[1], $plain) . ':' . $template[5];
  342. -
  343. break;
  344. -
  345. -
  346. case VALUE:
  347. -
  348. $out .= $this->_htmlsp($token[1], $plain);
  349. -
  350. if($this->_seeknocomment($key, 1) == SEL_END && $this->parser->get_cfg('remove_last_;')) {
  351. -
  352. $out .= str_replace(';', '', $template[6]);
  353. -
  354. } else {
  355. -
  356. $out .= $template[6];
  357. -
  358. }
  359. -
  360. break;
  361. -
  362. -
  363. case SEL_END:
  364. -
  365. $out .= $template[7];
  366. -
  367. if($this->_seeknocomment($key, 1) != AT_END) $out .= $template[8];
  368. -
  369. break;
  370. -
  371. -
  372. case AT_END:
  373. -
  374. $out =& $output;
  375. -
  376. $out .= $template[10] . str_replace("\n", "\n" . $template[10], $in_at_out);
  377. -
  378. $in_at_out = '';
  379. -
  380. $out .= $template[9];
  381. -
  382. break;
  383. -
  384.  
  385. -
  386. case COMMENT:
  387. -
  388. $out .= $template[11] . '/*' . $this->_htmlsp($token[1], $plain) . '*/' . $template[12];
  389. -
  390. break;
  391. -
  392. }
  393. -
  394. }
  395. -
  396.  
  397. -
  398. $output = trim($output);
  399. -
  400. -
  401. if (!$plain) {
  402. -
  403. $this->output_css = $output;
  404. -
  405. $this->_print(true);
  406. -
  407. } else {
  408. -
  409. $this->output_css_plain = $output;
  410. -
  411. }
  412. -
  413. }
  414. -
  415. -
  416. /**
  417. -
  418. * Gets the next token type which is $move away from $key, excluding comments
  419. -
  420. * @param integer $key current position
  421. -
  422. * @param integer $move move this far
  423. -
  424. * @return mixed a token type
  425. -
  426. * @access private
  427. -
  428. * @version 1.0
  429. -
  430. */
  431. -
  432. function _seeknocomment($key, $move) {
  433. -
  434. $go = ($move > 0) ? 1 : -1;
  435. -
  436. for ($i = $key + 1; abs($key-$i)-1 < abs($move); $i += $go) {
  437. -
  438. if (!isset($this->tokens[$i])) {
  439. -
  440. return;
  441. -
  442. }
  443. -
  444. if ($this->tokens[$i][0] == COMMENT) {
  445. -
  446. $move += 1;
  447. -
  448. continue;
  449. -
  450. }
  451. -
  452. return $this->tokens[$i][0];
  453. -
  454. }
  455. -
  456. }
  457. -
  458. -
  459. /**
  460. -
  461. * Converts $this->css array to a raw array ($this->tokens)
  462. -
  463. * @access private
  464. -
  465. * @version 1.0
  466. -
  467. */
  468. -
  469. function _convert_raw_css()
  470. -
  471. {
  472. -
  473. $this->tokens = array();
  474. -
  475. ksort($this->css);
  476. -
  477. -
  478. foreach ($this->css as $medium => $val)
  479. -
  480. {
  481. -
  482. if ($this->parser->get_cfg('sort_selectors')) ksort($val);
  483. -
  484. if ($medium != DEFAULT_AT) {
  485. -
  486. $this->parser->_add_token(AT_START, $medium, true);
  487. -
  488. }
  489. -
  490. -
  491. foreach ($val as $selector => $vali)
  492. -
  493. {
  494. -
  495. if ($this->parser->get_cfg('sort_properties')) ksort($vali);
  496. -
  497. $this->parser->_add_token(SEL_START, $selector, true);
  498. -
  499. -
  500. foreach ($vali as $property => $valj)
  501. -
  502. {
  503. -
  504. $this->parser->_add_token(PROPERTY, $property, true);
  505. -
  506. $this->parser->_add_token(VALUE, $valj, true);
  507. -
  508. }
  509. -
  510. -
  511. $this->parser->_add_token(SEL_END, $selector, true);
  512. -
  513. }
  514. -
  515. -
  516. if ($medium != DEFAULT_AT) {
  517. -
  518. $this->parser->_add_token(AT_END, $medium, true);
  519. -
  520. }
  521. -
  522. }
  523. -
  524. }
  525. -
  526. -
  527. /**
  528. -
  529. * Same as htmlspecialchars, only that chars are not replaced if $plain !== true. This makes print_code() cleaner.
  530. -
  531. * @param string $string
  532. -
  533. * @param bool $plain
  534. -
  535. * @return string
  536. -
  537. * @see csstidy_print::_print()
  538. -
  539. * @access private
  540. -
  541. * @version 1.0
  542. -
  543. */
  544. -
  545. function _htmlsp($string, $plain)
  546. -
  547. {
  548. -
  549. if (!$plain) {
  550. -
  551. return htmlspecialchars($string);
  552. -
  553. }
  554. -
  555. return $string;
  556. -
  557. }
  558. -
  559. -
  560. /**
  561. -
  562. * Get compression ratio
  563. -
  564. * @access public
  565. -
  566. * @return float
  567. -
  568. * @version 1.2
  569. -
  570. */
  571. -
  572. function get_ratio()
  573. -
  574. {
  575. -
  576. if (!$this->output_css_plain) {
  577. -
  578. $this->formatted();
  579. -
  580. }
  581. -
  582. return round((strlen($this->input_css) - strlen($this->output_css_plain)) / strlen($this->input_css), 3) * 100;
  583. -
  584. }
  585. -
  586.  
  587. -
  588. /**
  589. -
  590. * Get difference between the old and new code in bytes and prints the code if necessary.
  591. -
  592. * @access public
  593. -
  594. * @return string
  595. -
  596. * @version 1.1
  597. -
  598. */
  599. -
  600. function get_diff()
  601. -
  602. {
  603. -
  604. if (!$this->output_css_plain) {
  605. -
  606. $this->formatted();
  607. -
  608. }
  609. -
  610. -
  611. $diff = strlen($this->output_css_plain) - strlen($this->input_css);
  612. -
  613. -
  614. if ($diff > 0) {
  615. -
  616. return '+' . $diff;
  617. -
  618. } elseif ($diff == 0) {
  619. -
  620. return '+-' . $diff;
  621. -
  622. }
  623. -
  624. -
  625. return $diff;
  626. -
  627. }
  628. -
  629.  
  630. -
  631. /**
  632. -
  633. * Get the size of either input or output CSS in KB
  634. -
  635. * @param string $loc default is "output"
  636. -
  637. * @access public
  638. -
  639. * @return integer
  640. -
  641. * @version 1.0
  642. -
  643. */
  644. -
  645. function size($loc = 'output')
  646. -
  647. {
  648. -
  649. if ($loc == 'output' && !$this->output_css) {
  650. -
  651. $this->formatted();
  652. -
  653. }
  654. -
  655. -
  656. if ($loc == 'input') {
  657. -
  658. return (strlen($this->input_css) / 1000);
  659. -
  660. } else {
  661. -
  662. return (strlen($this->output_css_plain) / 1000);
  663. -
  664. }
  665. -
  666. }
  667. -
  668. }
  669. -
  670. ?>
  671. -
-
-
-
- Documentation generated on Mon, 15 May 2006 22:55:42 +0200 by phpDocumentor 1.3.0RC3 -
-
-
- - - \ No newline at end of file diff --git a/www/plugins-dist/compresseur/lib/csstidy/Docs/__filesource/fsource_csstidy__data.inc.php.html b/www/plugins-dist/compresseur/lib/csstidy/Docs/__filesource/fsource_csstidy__data.inc.php.html deleted file mode 100644 index 5c62d6c4..00000000 --- a/www/plugins-dist/compresseur/lib/csstidy/Docs/__filesource/fsource_csstidy__data.inc.php.html +++ /dev/null @@ -1,521 +0,0 @@ - - -File Source for data.inc.php - - - - - - - - - - - - - -
csstidy
- [ class tree: csstidy ] - [ index: csstidy ] - [ all elements ] -
- - - - - - -
-
- -

Source for file data.inc.php

-

Documentation is available at data.inc.php

-
-
  1. <?php
  2. -
  3. /**
  4. -
  5. * Various CSS Data for CSSTidy
  6. -
  7. *
  8. -
  9. * This file is part of CSSTidy.
  10. -
  11. *
  12. -
  13. * CSSTidy is free software; you can redistribute it and/or modify
  14. -
  15. * it under the terms of the GNU General Public License as published by
  16. -
  17. * the Free Software Foundation; either version 2 of the License, or
  18. -
  19. * (at your option) any later version.
  20. -
  21. *
  22. -
  23. * CSSTidy is distributed in the hope that it will be useful,
  24. -
  25. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  26. -
  27. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  28. -
  29. * GNU General Public License for more details.
  30. -
  31. *
  32. -
  33. * You should have received a copy of the GNU General Public License
  34. -
  35. * along with CSSTidy; if not, write to the Free Software
  36. -
  37. * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  38. -
  39. *
  40. -
  41. * @license http://opensource.org/licenses/gpl-license.php GNU Public License
  42. -
  43. * @package csstidy
  44. -
  45. * @author Florian Schmitz (floele at gmail dot com) 2005
  46. -
  47. */
  48. -
  49.  
  50. -
  51. define('AT_START', 1);
  52. -
  53. define('AT_END', 2);
  54. -
  55. define('SEL_START', 3);
  56. -
  57. define('SEL_END', 4);
  58. -
  59. define('PROPERTY', 5);
  60. -
  61. define('VALUE', 6);
  62. -
  63. define('COMMENT', 7);
  64. -
  65. define('DEFAULT_AT', 41);
  66. -
  67.  
  68. -
  69. /**
  70. -
  71. * All whitespace allowed in CSS
  72. -
  73. *
  74. -
  75. * @global array $GLOBALS['csstidy']['whitespace']
  76. -
  77. * @version 1.0
  78. -
  79. */
  80. -
  81. $GLOBALS['csstidy']['whitespace'] = array(' ',"\n","\t","\r","\x0B");
  82. -
  83.  
  84. -
  85. /**
  86. -
  87. * All CSS tokens used by csstidy
  88. -
  89. *
  90. -
  91. * @global string $GLOBALS['csstidy']['tokens']
  92. -
  93. * @version 1.0
  94. -
  95. */
  96. -
  97. $GLOBALS['csstidy']['tokens'] = '/@}{;:=\'"(,\\!$%&)*+.<>?[]^`|~';
  98. -
  99.  
  100. -
  101. /**
  102. -
  103. * All CSS units (CSS 3 units included)
  104. -
  105. *
  106. -
  107. * @see compress_numbers()
  108. -
  109. * @global array $GLOBALS['csstidy']['units']
  110. -
  111. * @version 1.0
  112. -
  113. */
  114. -
  115. $GLOBALS['csstidy']['units'] = array('in','cm','mm','pt','pc','px','rem','em','%','ex','gd','vw','vh','vm','deg','grad','rad','ms','s','khz','hz');
  116. -
  117.  
  118. -
  119. /**
  120. -
  121. * Available at-rules
  122. -
  123. *
  124. -
  125. * @global array $GLOBALS['csstidy']['at_rules']
  126. -
  127. * @version 1.0
  128. -
  129. */
  130. -
  131. $GLOBALS['csstidy']['at_rules'] = array('page' => 'is','font-face' => 'is','charset' => 'iv', 'import' => 'iv','namespace' => 'iv','media' => 'at');
  132. -
  133.  
  134. -
  135. /**
  136. -
  137. * Properties that allow <number> as value
  138. -
  139. *
  140. -
  141. * @todo CSS3 properties
  142. -
  143. * @see compress_numbers();
  144. -
  145. * @global array $GLOBALS['csstidy']['number_values']
  146. -
  147. * @version 1.2
  148. -
  149. */
  150. -
  151. $GLOBALS['csstidy']['number_values'] = array('line-height','pitch-range','richness','speech-rate','stress','volume','font','font-weight','z-index','counter-increment','counter-reset','orphans','widows');
  152. -
  153.  
  154. -
  155. /**
  156. -
  157. * Properties that allow <color> as value
  158. -
  159. *
  160. -
  161. * @todo CSS3 properties
  162. -
  163. * @see compress_numbers();
  164. -
  165. * @global array $GLOBALS['csstidy']['color_values']
  166. -
  167. * @version 1.0
  168. -
  169. */
  170. -
  171. $GLOBALS['csstidy']['color_values'] = array();
  172. -
  173. $GLOBALS['csstidy']['color_values'][] = 'background-color';
  174. -
  175. $GLOBALS['csstidy']['color_values'][] = 'border-color';
  176. -
  177. $GLOBALS['csstidy']['color_values'][] = 'border-top-color';
  178. -
  179. $GLOBALS['csstidy']['color_values'][] = 'border-right-color';
  180. -
  181. $GLOBALS['csstidy']['color_values'][] = 'border-bottom-color';
  182. -
  183. $GLOBALS['csstidy']['color_values'][] = 'border-left-color';
  184. -
  185. $GLOBALS['csstidy']['color_values'][] = 'color';
  186. -
  187. $GLOBALS['csstidy']['color_values'][] = 'outline-color';
  188. -
  189.  
  190. -
  191.  
  192. -
  193. /**
  194. -
  195. * Default values for the background properties
  196. -
  197. *
  198. -
  199. * @todo Possibly property names will change during CSS3 development
  200. -
  201. * @global array $GLOBALS['csstidy']['background_prop_default']
  202. -
  203. * @see dissolve_short_bg()
  204. -
  205. * @see merge_bg()
  206. -
  207. * @version 1.0
  208. -
  209. */
  210. -
  211. $GLOBALS['csstidy']['background_prop_default'] = array();
  212. -
  213. $GLOBALS['csstidy']['background_prop_default']['background-image'] = 'none';
  214. -
  215. $GLOBALS['csstidy']['background_prop_default']['background-size'] = 'auto';
  216. -
  217. $GLOBALS['csstidy']['background_prop_default']['background-repeat'] = 'repeat';
  218. -
  219. $GLOBALS['csstidy']['background_prop_default']['background-position'] = '0 0';
  220. -
  221. $GLOBALS['csstidy']['background_prop_default']['background-attachment'] = 'scroll';
  222. -
  223. $GLOBALS['csstidy']['background_prop_default']['background-clip'] = 'border';
  224. -
  225. $GLOBALS['csstidy']['background_prop_default']['background-origin'] = 'padding';
  226. -
  227. $GLOBALS['csstidy']['background_prop_default']['background-color'] = 'transparent';
  228. -
  229.  
  230. -
  231. /**
  232. -
  233. * A list of non-W3C color names which get replaced by their hex-codes
  234. -
  235. *
  236. -
  237. * @global array $GLOBALS['csstidy']['replace_colors']
  238. -
  239. * @see cut_color()
  240. -
  241. * @version 1.0
  242. -
  243. */
  244. -
  245. $GLOBALS['csstidy']['replace_colors'] = array();
  246. -
  247. $GLOBALS['csstidy']['replace_colors']['aliceblue'] = '#F0F8FF';
  248. -
  249. $GLOBALS['csstidy']['replace_colors']['antiquewhite'] = '#FAEBD7';
  250. -
  251. $GLOBALS['csstidy']['replace_colors']['aquamarine'] = '#7FFFD4';
  252. -
  253. $GLOBALS['csstidy']['replace_colors']['azure'] = '#F0FFFF';
  254. -
  255. $GLOBALS['csstidy']['replace_colors']['beige'] = '#F5F5DC';
  256. -
  257. $GLOBALS['csstidy']['replace_colors']['bisque'] = '#FFE4C4';
  258. -
  259. $GLOBALS['csstidy']['replace_colors']['blanchedalmond'] = '#FFEBCD';
  260. -
  261. $GLOBALS['csstidy']['replace_colors']['blueviolet'] = '#8A2BE2';
  262. -
  263. $GLOBALS['csstidy']['replace_colors']['brown'] = '#A52A2A';
  264. -
  265. $GLOBALS['csstidy']['replace_colors']['burlywood'] = '#DEB887';
  266. -
  267. $GLOBALS['csstidy']['replace_colors']['cadetblue'] = '#5F9EA0';
  268. -
  269. $GLOBALS['csstidy']['replace_colors']['chartreuse'] = '#7FFF00';
  270. -
  271. $GLOBALS['csstidy']['replace_colors']['chocolate'] = '#D2691E';
  272. -
  273. $GLOBALS['csstidy']['replace_colors']['coral'] = '#FF7F50';
  274. -
  275. $GLOBALS['csstidy']['replace_colors']['cornflowerblue'] = '#6495ED';
  276. -
  277. $GLOBALS['csstidy']['replace_colors']['cornsilk'] = '#FFF8DC';
  278. -
  279. $GLOBALS['csstidy']['replace_colors']['crimson'] = '#DC143C';
  280. -
  281. $GLOBALS['csstidy']['replace_colors']['cyan'] = '#00FFFF';
  282. -
  283. $GLOBALS['csstidy']['replace_colors']['darkblue'] = '#00008B';
  284. -
  285. $GLOBALS['csstidy']['replace_colors']['darkcyan'] = '#008B8B';
  286. -
  287. $GLOBALS['csstidy']['replace_colors']['darkgoldenrod'] = '#B8860B';
  288. -
  289. $GLOBALS['csstidy']['replace_colors']['darkgray'] = '#A9A9A9';
  290. -
  291. $GLOBALS['csstidy']['replace_colors']['darkgreen'] = '#006400';
  292. -
  293. $GLOBALS['csstidy']['replace_colors']['darkkhaki'] = '#BDB76B';
  294. -
  295. $GLOBALS['csstidy']['replace_colors']['darkmagenta'] = '#8B008B';
  296. -
  297. $GLOBALS['csstidy']['replace_colors']['darkolivegreen'] = '#556B2F';
  298. -
  299. $GLOBALS['csstidy']['replace_colors']['darkorange'] = '#FF8C00';
  300. -
  301. $GLOBALS['csstidy']['replace_colors']['darkorchid'] = '#9932CC';
  302. -
  303. $GLOBALS['csstidy']['replace_colors']['darkred'] = '#8B0000';
  304. -
  305. $GLOBALS['csstidy']['replace_colors']['darksalmon'] = '#E9967A';
  306. -
  307. $GLOBALS['csstidy']['replace_colors']['darkseagreen'] = '#8FBC8F';
  308. -
  309. $GLOBALS['csstidy']['replace_colors']['darkslateblue'] = '#483D8B';
  310. -
  311. $GLOBALS['csstidy']['replace_colors']['darkslategray'] = '#2F4F4F';
  312. -
  313. $GLOBALS['csstidy']['replace_colors']['darkturquoise'] = '#00CED1';
  314. -
  315. $GLOBALS['csstidy']['replace_colors']['darkviolet'] = '#9400D3';
  316. -
  317. $GLOBALS['csstidy']['replace_colors']['deeppink'] = '#FF1493';
  318. -
  319. $GLOBALS['csstidy']['replace_colors']['deepskyblue'] = '#00BFFF';
  320. -
  321. $GLOBALS['csstidy']['replace_colors']['dimgray'] = '#696969';
  322. -
  323. $GLOBALS['csstidy']['replace_colors']['dodgerblue'] = '#1E90FF';
  324. -
  325. $GLOBALS['csstidy']['replace_colors']['feldspar'] = '#D19275';
  326. -
  327. $GLOBALS['csstidy']['replace_colors']['firebrick'] = '#B22222';
  328. -
  329. $GLOBALS['csstidy']['replace_colors']['floralwhite'] = '#FFFAF0';
  330. -
  331. $GLOBALS['csstidy']['replace_colors']['forestgreen'] = '#228B22';
  332. -
  333. $GLOBALS['csstidy']['replace_colors']['gainsboro'] = '#DCDCDC';
  334. -
  335. $GLOBALS['csstidy']['replace_colors']['ghostwhite'] = '#F8F8FF';
  336. -
  337. $GLOBALS['csstidy']['replace_colors']['gold'] = '#FFD700';
  338. -
  339. $GLOBALS['csstidy']['replace_colors']['goldenrod'] = '#DAA520';
  340. -
  341. $GLOBALS['csstidy']['replace_colors']['greenyellow'] = '#ADFF2F';
  342. -
  343. $GLOBALS['csstidy']['replace_colors']['honeydew'] = '#F0FFF0';
  344. -
  345. $GLOBALS['csstidy']['replace_colors']['hotpink'] = '#FF69B4';
  346. -
  347. $GLOBALS['csstidy']['replace_colors']['indianred'] = '#CD5C5C';
  348. -
  349. $GLOBALS['csstidy']['replace_colors']['indigo'] = '#4B0082';
  350. -
  351. $GLOBALS['csstidy']['replace_colors']['ivory'] = '#FFFFF0';
  352. -
  353. $GLOBALS['csstidy']['replace_colors']['khaki'] = '#F0E68C';
  354. -
  355. $GLOBALS['csstidy']['replace_colors']['lavender'] = '#E6E6FA';
  356. -
  357. $GLOBALS['csstidy']['replace_colors']['lavenderblush'] = '#FFF0F5';
  358. -
  359. $GLOBALS['csstidy']['replace_colors']['lawngreen'] = '#7CFC00';
  360. -
  361. $GLOBALS['csstidy']['replace_colors']['lemonchiffon'] = '#FFFACD';
  362. -
  363. $GLOBALS['csstidy']['replace_colors']['lightblue'] = '#ADD8E6';
  364. -
  365. $GLOBALS['csstidy']['replace_colors']['lightcoral'] = '#F08080';
  366. -
  367. $GLOBALS['csstidy']['replace_colors']['lightcyan'] = '#E0FFFF';
  368. -
  369. $GLOBALS['csstidy']['replace_colors']['lightgoldenrodyellow'] = '#FAFAD2';
  370. -
  371. $GLOBALS['csstidy']['replace_colors']['lightgrey'] = '#D3D3D3';
  372. -
  373. $GLOBALS['csstidy']['replace_colors']['lightgreen'] = '#90EE90';
  374. -
  375. $GLOBALS['csstidy']['replace_colors']['lightpink'] = '#FFB6C1';
  376. -
  377. $GLOBALS['csstidy']['replace_colors']['lightsalmon'] = '#FFA07A';
  378. -
  379. $GLOBALS['csstidy']['replace_colors']['lightseagreen'] = '#20B2AA';
  380. -
  381. $GLOBALS['csstidy']['replace_colors']['lightskyblue'] = '#87CEFA';
  382. -
  383. $GLOBALS['csstidy']['replace_colors']['lightslateblue'] = '#8470FF';
  384. -
  385. $GLOBALS['csstidy']['replace_colors']['lightslategray'] = '#778899';
  386. -
  387. $GLOBALS['csstidy']['replace_colors']['lightsteelblue'] = '#B0C4DE';
  388. -
  389. $GLOBALS['csstidy']['replace_colors']['lightyellow'] = '#FFFFE0';
  390. -
  391. $GLOBALS['csstidy']['replace_colors']['limegreen'] = '#32CD32';
  392. -
  393. $GLOBALS['csstidy']['replace_colors']['linen'] = '#FAF0E6';
  394. -
  395. $GLOBALS['csstidy']['replace_colors']['magenta'] = '#FF00FF';
  396. -
  397. $GLOBALS['csstidy']['replace_colors']['mediumaquamarine'] = '#66CDAA';
  398. -
  399. $GLOBALS['csstidy']['replace_colors']['mediumblue'] = '#0000CD';
  400. -
  401. $GLOBALS['csstidy']['replace_colors']['mediumorchid'] = '#BA55D3';
  402. -
  403. $GLOBALS['csstidy']['replace_colors']['mediumpurple'] = '#9370D8';
  404. -
  405. $GLOBALS['csstidy']['replace_colors']['mediumseagreen'] = '#3CB371';
  406. -
  407. $GLOBALS['csstidy']['replace_colors']['mediumslateblue'] = '#7B68EE';
  408. -
  409. $GLOBALS['csstidy']['replace_colors']['mediumspringgreen'] = '#00FA9A';
  410. -
  411. $GLOBALS['csstidy']['replace_colors']['mediumturquoise'] = '#48D1CC';
  412. -
  413. $GLOBALS['csstidy']['replace_colors']['mediumvioletred'] = '#C71585';
  414. -
  415. $GLOBALS['csstidy']['replace_colors']['midnightblue'] = '#191970';
  416. -
  417. $GLOBALS['csstidy']['replace_colors']['mintcream'] = '#F5FFFA';
  418. -
  419. $GLOBALS['csstidy']['replace_colors']['mistyrose'] = '#FFE4E1';
  420. -
  421. $GLOBALS['csstidy']['replace_colors']['moccasin'] = '#FFE4B5';
  422. -
  423. $GLOBALS['csstidy']['replace_colors']['navajowhite'] = '#FFDEAD';
  424. -
  425. $GLOBALS['csstidy']['replace_colors']['oldlace'] = '#FDF5E6';
  426. -
  427. $GLOBALS['csstidy']['replace_colors']['olivedrab'] = '#6B8E23';
  428. -
  429. $GLOBALS['csstidy']['replace_colors']['orangered'] = '#FF4500';
  430. -
  431. $GLOBALS['csstidy']['replace_colors']['orchid'] = '#DA70D6';
  432. -
  433. $GLOBALS['csstidy']['replace_colors']['palegoldenrod'] = '#EEE8AA';
  434. -
  435. $GLOBALS['csstidy']['replace_colors']['palegreen'] = '#98FB98';
  436. -
  437. $GLOBALS['csstidy']['replace_colors']['paleturquoise'] = '#AFEEEE';
  438. -
  439. $GLOBALS['csstidy']['replace_colors']['palevioletred'] = '#D87093';
  440. -
  441. $GLOBALS['csstidy']['replace_colors']['papayawhip'] = '#FFEFD5';
  442. -
  443. $GLOBALS['csstidy']['replace_colors']['peachpuff'] = '#FFDAB9';
  444. -
  445. $GLOBALS['csstidy']['replace_colors']['peru'] = '#CD853F';
  446. -
  447. $GLOBALS['csstidy']['replace_colors']['pink'] = '#FFC0CB';
  448. -
  449. $GLOBALS['csstidy']['replace_colors']['plum'] = '#DDA0DD';
  450. -
  451. $GLOBALS['csstidy']['replace_colors']['powderblue'] = '#B0E0E6';
  452. -
  453. $GLOBALS['csstidy']['replace_colors']['rosybrown'] = '#BC8F8F';
  454. -
  455. $GLOBALS['csstidy']['replace_colors']['royalblue'] = '#4169E1';
  456. -
  457. $GLOBALS['csstidy']['replace_colors']['saddlebrown'] = '#8B4513';
  458. -
  459. $GLOBALS['csstidy']['replace_colors']['salmon'] = '#FA8072';
  460. -
  461. $GLOBALS['csstidy']['replace_colors']['sandybrown'] = '#F4A460';
  462. -
  463. $GLOBALS['csstidy']['replace_colors']['seagreen'] = '#2E8B57';
  464. -
  465. $GLOBALS['csstidy']['replace_colors']['seashell'] = '#FFF5EE';
  466. -
  467. $GLOBALS['csstidy']['replace_colors']['sienna'] = '#A0522D';
  468. -
  469. $GLOBALS['csstidy']['replace_colors']['skyblue'] = '#87CEEB';
  470. -
  471. $GLOBALS['csstidy']['replace_colors']['slateblue'] = '#6A5ACD';
  472. -
  473. $GLOBALS['csstidy']['replace_colors']['slategray'] = '#708090';
  474. -
  475. $GLOBALS['csstidy']['replace_colors']['snow'] = '#FFFAFA';
  476. -
  477. $GLOBALS['csstidy']['replace_colors']['springgreen'] = '#00FF7F';
  478. -
  479. $GLOBALS['csstidy']['replace_colors']['steelblue'] = '#4682B4';
  480. -
  481. $GLOBALS['csstidy']['replace_colors']['tan'] = '#D2B48C';
  482. -
  483. $GLOBALS['csstidy']['replace_colors']['thistle'] = '#D8BFD8';
  484. -
  485. $GLOBALS['csstidy']['replace_colors']['tomato'] = '#FF6347';
  486. -
  487. $GLOBALS['csstidy']['replace_colors']['turquoise'] = '#40E0D0';
  488. -
  489. $GLOBALS['csstidy']['replace_colors']['violet'] = '#EE82EE';
  490. -
  491. $GLOBALS['csstidy']['replace_colors']['violetred'] = '#D02090';
  492. -
  493. $GLOBALS['csstidy']['replace_colors']['wheat'] = '#F5DEB3';
  494. -
  495. $GLOBALS['csstidy']['replace_colors']['whitesmoke'] = '#F5F5F5';
  496. -
  497. $GLOBALS['csstidy']['replace_colors']['yellowgreen'] = '#9ACD32';
  498. -
  499.  
  500. -
  501.  
  502. -
  503. /**
  504. -
  505. * A list of all shorthand properties that are devided into four properties and/or have four subvalues
  506. -
  507. *
  508. -
  509. * @global array $GLOBALS['csstidy']['shorthands']
  510. -
  511. * @todo Are there new ones in CSS3?
  512. -
  513. * @see dissolve_4value_shorthands()
  514. -
  515. * @see merge_4value_shorthands()
  516. -
  517. * @version 1.0
  518. -
  519. */
  520. -
  521. $GLOBALS['csstidy']['shorthands'] = array();
  522. -
  523. $GLOBALS['csstidy']['shorthands']['border-color'] = array('border-top-color','border-right-color','border-bottom-color','border-left-color');
  524. -
  525. $GLOBALS['csstidy']['shorthands']['border-style'] = array('border-top-style','border-right-style','border-bottom-style','border-left-style');
  526. -
  527. $GLOBALS['csstidy']['shorthands']['border-width'] = array('border-top-width','border-right-width','border-bottom-width','border-left-width');
  528. -
  529. $GLOBALS['csstidy']['shorthands']['margin'] = array('margin-top','margin-right','margin-bottom','margin-left');
  530. -
  531. $GLOBALS['csstidy']['shorthands']['padding'] = array('padding-top','padding-right','padding-bottom','padding-left');
  532. -
  533. $GLOBALS['csstidy']['shorthands']['-moz-border-radius'] = 0;
  534. -
  535.  
  536. -
  537. /**
  538. -
  539. * All CSS Properties. Needed for csstidy::property_is_next()
  540. -
  541. *
  542. -
  543. * @global array $GLOBALS['csstidy']['all_properties']
  544. -
  545. * @todo Add CSS3 properties
  546. -
  547. * @version 1.0
  548. -
  549. * @see csstidy::property_is_next()
  550. -
  551. */
  552. -
  553. $GLOBALS['csstidy']['all_properties'] = array();
  554. -
  555. $GLOBALS['csstidy']['all_properties']['background'] = 'CSS1.0,CSS2.0,CSS2.1';
  556. -
  557. $GLOBALS['csstidy']['all_properties']['background-color'] = 'CSS1.0,CSS2.0,CSS2.1';
  558. -
  559. $GLOBALS['csstidy']['all_properties']['background-image'] = 'CSS1.0,CSS2.0,CSS2.1';
  560. -
  561. $GLOBALS['csstidy']['all_properties']['background-repeat'] = 'CSS1.0,CSS2.0,CSS2.1';
  562. -
  563. $GLOBALS['csstidy']['all_properties']['background-attachment'] = 'CSS1.0,CSS2.0,CSS2.1';
  564. -
  565. $GLOBALS['csstidy']['all_properties']['background-position'] = 'CSS1.0,CSS2.0,CSS2.1';
  566. -
  567. $GLOBALS['csstidy']['all_properties']['border'] = 'CSS1.0,CSS2.0,CSS2.1';
  568. -
  569. $GLOBALS['csstidy']['all_properties']['border-top'] = 'CSS1.0,CSS2.0,CSS2.1';
  570. -
  571. $GLOBALS['csstidy']['all_properties']['border-right'] = 'CSS1.0,CSS2.0,CSS2.1';
  572. -
  573. $GLOBALS['csstidy']['all_properties']['border-bottom'] = 'CSS1.0,CSS2.0,CSS2.1';
  574. -
  575. $GLOBALS['csstidy']['all_properties']['border-left'] = 'CSS1.0,CSS2.0,CSS2.1';
  576. -
  577. $GLOBALS['csstidy']['all_properties']['border-color'] = 'CSS1.0,CSS2.0,CSS2.1';
  578. -
  579. $GLOBALS['csstidy']['all_properties']['border-top-color'] = 'CSS2.0,CSS2.1';
  580. -
  581. $GLOBALS['csstidy']['all_properties']['border-bottom-color'] = 'CSS2.0,CSS2.1';
  582. -
  583. $GLOBALS['csstidy']['all_properties']['border-left-color'] = 'CSS2.0,CSS2.1';
  584. -
  585. $GLOBALS['csstidy']['all_properties']['border-right-color'] = 'CSS2.0,CSS2.1';
  586. -
  587. $GLOBALS['csstidy']['all_properties']['border-style'] = 'CSS1.0,CSS2.0,CSS2.1';
  588. -
  589. $GLOBALS['csstidy']['all_properties']['border-top-style'] = 'CSS2.0,CSS2.1';
  590. -
  591. $GLOBALS['csstidy']['all_properties']['border-right-style'] = 'CSS2.0,CSS2.1';
  592. -
  593. $GLOBALS['csstidy']['all_properties']['border-left-style'] = 'CSS2.0,CSS2.1';
  594. -
  595. $GLOBALS['csstidy']['all_properties']['border-bottom-style'] = 'CSS2.0,CSS2.1';
  596. -
  597. $GLOBALS['csstidy']['all_properties']['border-width'] = 'CSS1.0,CSS2.0,CSS2.1';
  598. -
  599. $GLOBALS['csstidy']['all_properties']['border-top-width'] = 'CSS1.0,CSS2.0,CSS2.1';
  600. -
  601. $GLOBALS['csstidy']['all_properties']['border-right-width'] = 'CSS1.0,CSS2.0,CSS2.1';
  602. -
  603. $GLOBALS['csstidy']['all_properties']['border-left-width'] = 'CSS1.0,CSS2.0,CSS2.1';
  604. -
  605. $GLOBALS['csstidy']['all_properties']['border-bottom-width'] = 'CSS1.0,CSS2.0,CSS2.1';
  606. -
  607. $GLOBALS['csstidy']['all_properties']['border-collapse'] = 'CSS2.0,CSS2.1';
  608. -
  609. $GLOBALS['csstidy']['all_properties']['border-spacing'] = 'CSS2.0,CSS2.1';
  610. -
  611. $GLOBALS['csstidy']['all_properties']['bottom'] = 'CSS2.0,CSS2.1';
  612. -
  613. $GLOBALS['csstidy']['all_properties']['caption-side'] = 'CSS2.0,CSS2.1';
  614. -
  615. $GLOBALS['csstidy']['all_properties']['content'] = 'CSS2.0,CSS2.1';
  616. -
  617. $GLOBALS['csstidy']['all_properties']['clear'] = 'CSS1.0,CSS2.0,CSS2.1';
  618. -
  619. $GLOBALS['csstidy']['all_properties']['clip'] = 'CSS1.0,CSS2.0,CSS2.1';
  620. -
  621. $GLOBALS['csstidy']['all_properties']['color'] = 'CSS1.0,CSS2.0,CSS2.1';
  622. -
  623. $GLOBALS['csstidy']['all_properties']['counter-reset'] = 'CSS2.0,CSS2.1';
  624. -
  625. $GLOBALS['csstidy']['all_properties']['counter-increment'] = 'CSS2.0,CSS2.1';
  626. -
  627. $GLOBALS['csstidy']['all_properties']['cursor'] = 'CSS2.0,CSS2.1';
  628. -
  629. $GLOBALS['csstidy']['all_properties']['empty-cells'] = 'CSS2.0,CSS2.1';
  630. -
  631. $GLOBALS['csstidy']['all_properties']['display'] = 'CSS1.0,CSS2.0,CSS2.1';
  632. -
  633. $GLOBALS['csstidy']['all_properties']['direction'] = 'CSS2.0,CSS2.1';
  634. -
  635. $GLOBALS['csstidy']['all_properties']['float'] = 'CSS1.0,CSS2.0,CSS2.1';
  636. -
  637. $GLOBALS['csstidy']['all_properties']['font'] = 'CSS1.0,CSS2.0,CSS2.1';
  638. -
  639. $GLOBALS['csstidy']['all_properties']['font-family'] = 'CSS1.0,CSS2.0,CSS2.1';
  640. -
  641. $GLOBALS['csstidy']['all_properties']['font-style'] = 'CSS1.0,CSS2.0,CSS2.1';
  642. -
  643. $GLOBALS['csstidy']['all_properties']['font-variant'] = 'CSS1.0,CSS2.0,CSS2.1';
  644. -
  645. $GLOBALS['csstidy']['all_properties']['font-weight'] = 'CSS1.0,CSS2.0,CSS2.1';
  646. -
  647. $GLOBALS['csstidy']['all_properties']['font-stretch'] = 'CSS2.0';
  648. -
  649. $GLOBALS['csstidy']['all_properties']['font-size-adjust'] = 'CSS2.0';
  650. -
  651. $GLOBALS['csstidy']['all_properties']['font-size'] = 'CSS1.0,CSS2.0,CSS2.1';
  652. -
  653. $GLOBALS['csstidy']['all_properties']['height'] = 'CSS1.0,CSS2.0,CSS2.1';
  654. -
  655. $GLOBALS['csstidy']['all_properties']['left'] = 'CSS1.0,CSS2.0,CSS2.1';
  656. -
  657. $GLOBALS['csstidy']['all_properties']['line-height'] = 'CSS1.0,CSS2.0,CSS2.1';
  658. -
  659. $GLOBALS['csstidy']['all_properties']['list-style'] = 'CSS1.0,CSS2.0,CSS2.1';
  660. -
  661. $GLOBALS['csstidy']['all_properties']['list-style-type'] = 'CSS1.0,CSS2.0,CSS2.1';
  662. -
  663. $GLOBALS['csstidy']['all_properties']['list-style-image'] = 'CSS1.0,CSS2.0,CSS2.1';
  664. -
  665. $GLOBALS['csstidy']['all_properties']['list-style-position'] = 'CSS1.0,CSS2.0,CSS2.1';
  666. -
  667. $GLOBALS['csstidy']['all_properties']['margin'] = 'CSS1.0,CSS2.0,CSS2.1';
  668. -
  669. $GLOBALS['csstidy']['all_properties']['margin-top'] = 'CSS1.0,CSS2.0,CSS2.1';
  670. -
  671. $GLOBALS['csstidy']['all_properties']['margin-right'] = 'CSS1.0,CSS2.0,CSS2.1';
  672. -
  673. $GLOBALS['csstidy']['all_properties']['margin-bottom'] = 'CSS1.0,CSS2.0,CSS2.1';
  674. -
  675. $GLOBALS['csstidy']['all_properties']['margin-left'] = 'CSS1.0,CSS2.0,CSS2.1';
  676. -
  677. $GLOBALS['csstidy']['all_properties']['marks'] = 'CSS1.0,CSS2.0';
  678. -
  679. $GLOBALS['csstidy']['all_properties']['marker-offset'] = 'CSS2.0';
  680. -
  681. $GLOBALS['csstidy']['all_properties']['max-height'] = 'CSS2.0,CSS2.1';
  682. -
  683. $GLOBALS['csstidy']['all_properties']['max-width'] = 'CSS2.0,CSS2.1';
  684. -
  685. $GLOBALS['csstidy']['all_properties']['min-height'] = 'CSS2.0,CSS2.1';
  686. -
  687. $GLOBALS['csstidy']['all_properties']['min-width'] = 'CSS2.0,CSS2.1';
  688. -
  689. $GLOBALS['csstidy']['all_properties']['overflow'] = 'CSS1.0,CSS2.0,CSS2.1';
  690. -
  691. $GLOBALS['csstidy']['all_properties']['orphans'] = 'CSS2.0,CSS2.1';
  692. -
  693. $GLOBALS['csstidy']['all_properties']['outline'] = 'CSS2.0,CSS2.1';
  694. -
  695. $GLOBALS['csstidy']['all_properties']['outline-width'] = 'CSS2.0,CSS2.1';
  696. -
  697. $GLOBALS['csstidy']['all_properties']['outline-style'] = 'CSS2.0,CSS2.1';
  698. -
  699. $GLOBALS['csstidy']['all_properties']['outline-color'] = 'CSS2.0,CSS2.1';
  700. -
  701. $GLOBALS['csstidy']['all_properties']['padding'] = 'CSS1.0,CSS2.0,CSS2.1';
  702. -
  703. $GLOBALS['csstidy']['all_properties']['padding-top'] = 'CSS1.0,CSS2.0,CSS2.1';
  704. -
  705. $GLOBALS['csstidy']['all_properties']['padding-right'] = 'CSS1.0,CSS2.0,CSS2.1';
  706. -
  707. $GLOBALS['csstidy']['all_properties']['padding-bottom'] = 'CSS1.0,CSS2.0,CSS2.1';
  708. -
  709. $GLOBALS['csstidy']['all_properties']['padding-left'] = 'CSS1.0,CSS2.0,CSS2.1';
  710. -
  711. $GLOBALS['csstidy']['all_properties']['page-break-before'] = 'CSS1.0,CSS2.0,CSS2.1';
  712. -
  713. $GLOBALS['csstidy']['all_properties']['page-break-after'] = 'CSS1.0,CSS2.0,CSS2.1';
  714. -
  715. $GLOBALS['csstidy']['all_properties']['page-break-inside'] = 'CSS2.0,CSS2.1';
  716. -
  717. $GLOBALS['csstidy']['all_properties']['page'] = 'CSS2.0';
  718. -
  719. $GLOBALS['csstidy']['all_properties']['position'] = 'CSS1.0,CSS2.0,CSS2.1';
  720. -
  721. $GLOBALS['csstidy']['all_properties']['quotes'] = 'CSS2.0,CSS2.1';
  722. -
  723. $GLOBALS['csstidy']['all_properties']['right'] = 'CSS2.0,CSS2.1';
  724. -
  725. $GLOBALS['csstidy']['all_properties']['size'] = 'CSS1.0,CSS2.0';
  726. -
  727. $GLOBALS['csstidy']['all_properties']['speak-header'] = 'CSS2.0,CSS2.1';
  728. -
  729. $GLOBALS['csstidy']['all_properties']['table-layout'] = 'CSS2.0,CSS2.1';
  730. -
  731. $GLOBALS['csstidy']['all_properties']['top'] = 'CSS1.0,CSS2.0,CSS2.1';
  732. -
  733. $GLOBALS['csstidy']['all_properties']['text-indent'] = 'CSS1.0,CSS2.0,CSS2.1';
  734. -
  735. $GLOBALS['csstidy']['all_properties']['text-align'] = 'CSS1.0,CSS2.0,CSS2.1';
  736. -
  737. $GLOBALS['csstidy']['all_properties']['text-decoration'] = 'CSS1.0,CSS2.0,CSS2.1';
  738. -
  739. $GLOBALS['csstidy']['all_properties']['text-shadow'] = 'CSS2.0';
  740. -
  741. $GLOBALS['csstidy']['all_properties']['letter-spacing'] = 'CSS1.0,CSS2.0,CSS2.1';
  742. -
  743. $GLOBALS['csstidy']['all_properties']['word-spacing'] = 'CSS1.0,CSS2.0,CSS2.1';
  744. -
  745. $GLOBALS['csstidy']['all_properties']['text-transform'] = 'CSS1.0,CSS2.0,CSS2.1';
  746. -
  747. $GLOBALS['csstidy']['all_properties']['white-space'] = 'CSS1.0,CSS2.0,CSS2.1';
  748. -
  749. $GLOBALS['csstidy']['all_properties']['unicode-bidi'] = 'CSS2.0,CSS2.1';
  750. -
  751. $GLOBALS['csstidy']['all_properties']['vertical-align'] = 'CSS1.0,CSS2.0,CSS2.1';
  752. -
  753. $GLOBALS['csstidy']['all_properties']['visibility'] = 'CSS1.0,CSS2.0,CSS2.1';
  754. -
  755. $GLOBALS['csstidy']['all_properties']['width'] = 'CSS1.0,CSS2.0,CSS2.1';
  756. -
  757. $GLOBALS['csstidy']['all_properties']['widows'] = 'CSS2.0,CSS2.1';
  758. -
  759. $GLOBALS['csstidy']['all_properties']['z-index'] = 'CSS1.0,CSS2.0,CSS2.1';
  760. -
  761. /* Speech */
  762. -
  763. $GLOBALS['csstidy']['all_properties']['volume'] = 'CSS2.0,CSS2.1';
  764. -
  765. $GLOBALS['csstidy']['all_properties']['speak'] = 'CSS2.0,CSS2.1';
  766. -
  767. $GLOBALS['csstidy']['all_properties']['pause'] = 'CSS2.0,CSS2.1';
  768. -
  769. $GLOBALS['csstidy']['all_properties']['pause-before'] = 'CSS2.0,CSS2.1';
  770. -
  771. $GLOBALS['csstidy']['all_properties']['pause-after'] = 'CSS2.0,CSS2.1';
  772. -
  773. $GLOBALS['csstidy']['all_properties']['cue'] = 'CSS2.0,CSS2.1';
  774. -
  775. $GLOBALS['csstidy']['all_properties']['cue-before'] = 'CSS2.0,CSS2.1';
  776. -
  777. $GLOBALS['csstidy']['all_properties']['cue-after'] = 'CSS2.0,CSS2.1';
  778. -
  779. $GLOBALS['csstidy']['all_properties']['play-during'] = 'CSS2.0,CSS2.1';
  780. -
  781. $GLOBALS['csstidy']['all_properties']['azimuth'] = 'CSS2.0,CSS2.1';
  782. -
  783. $GLOBALS['csstidy']['all_properties']['elevation'] = 'CSS2.0,CSS2.1';
  784. -
  785. $GLOBALS['csstidy']['all_properties']['speech-rate'] = 'CSS2.0,CSS2.1';
  786. -
  787. $GLOBALS['csstidy']['all_properties']['voice-family'] = 'CSS2.0,CSS2.1';
  788. -
  789. $GLOBALS['csstidy']['all_properties']['pitch'] = 'CSS2.0,CSS2.1';
  790. -
  791. $GLOBALS['csstidy']['all_properties']['pitch-range'] = 'CSS2.0,CSS2.1';
  792. -
  793. $GLOBALS['csstidy']['all_properties']['stress'] = 'CSS2.0,CSS2.1';
  794. -
  795. $GLOBALS['csstidy']['all_properties']['richness'] = 'CSS2.0,CSS2.1';
  796. -
  797. $GLOBALS['csstidy']['all_properties']['speak-punctuation'] = 'CSS2.0,CSS2.1';
  798. -
  799. $GLOBALS['csstidy']['all_properties']['speak-numeral'] = 'CSS2.0,CSS2.1';
  800. -
  801.  
  802. -
  803. /**
  804. -
  805. * An array containing all predefined templates.
  806. -
  807. *
  808. -
  809. * @global array $GLOBALS['csstidy']['predefined_templates']
  810. -
  811. * @version 1.0
  812. -
  813. * @see csstidy::load_template()
  814. -
  815. */
  816. -
  817. $GLOBALS['csstidy']['predefined_templates']['default'][] = '<span class="at">'; //string before @rule
  818. -
  819. $GLOBALS['csstidy']['predefined_templates']['default'][] = '</span> <span class="format">{</span>'."\n"; //bracket after @-rule
  820. -
  821. $GLOBALS['csstidy']['predefined_templates']['default'][] = '<span class="selector">'; //string before selector
  822. -
  823. $GLOBALS['csstidy']['predefined_templates']['default'][] = '</span> <span class="format">{</span>'."\n"; //bracket after selector
  824. -
  825. $GLOBALS['csstidy']['predefined_templates']['default'][] = '<span class="property">'; //string before property
  826. -
  827. $GLOBALS['csstidy']['predefined_templates']['default'][] = '</span><span class="value">'; //string after property+before value
  828. -
  829. $GLOBALS['csstidy']['predefined_templates']['default'][] = '</span><span class="format">;</span>'."\n"; //string after value
  830. -
  831. $GLOBALS['csstidy']['predefined_templates']['default'][] = '<span class="format">}</span>'; //closing bracket - selector
  832. -
  833. $GLOBALS['csstidy']['predefined_templates']['default'][] = "\n\n"; //space between blocks {...}
  834. -
  835. $GLOBALS['csstidy']['predefined_templates']['default'][] = "\n".'<span class="format">}</span>'. "\n\n"; //closing bracket @-rule
  836. -
  837. $GLOBALS['csstidy']['predefined_templates']['default'][] = ''; //indent in @-rule
  838. -
  839. $GLOBALS['csstidy']['predefined_templates']['default'][] = '<span class="comment">'; // before comment
  840. -
  841. $GLOBALS['csstidy']['predefined_templates']['default'][] = '</span>'."\n"; // after comment
  842. -
  843. $GLOBALS['csstidy']['predefined_templates']['default'][] = "\n"; // after last line @-rule
  844. -
  845.  
  846. -
  847. $GLOBALS['csstidy']['predefined_templates']['high_compression'][] = '<span class="at">';
  848. -
  849. $GLOBALS['csstidy']['predefined_templates']['high_compression'][] = '</span> <span class="format">{</span>'."\n";
  850. -
  851. $GLOBALS['csstidy']['predefined_templates']['high_compression'][] = '<span class="selector">';
  852. -
  853. $GLOBALS['csstidy']['predefined_templates']['high_compression'][] = '</span><span class="format">{</span>';
  854. -
  855. $GLOBALS['csstidy']['predefined_templates']['high_compression'][] = '<span class="property">';
  856. -
  857. $GLOBALS['csstidy']['predefined_templates']['high_compression'][] = '</span><span class="value">';
  858. -
  859. $GLOBALS['csstidy']['predefined_templates']['high_compression'][] = '</span><span class="format">;</span>';
  860. -
  861. $GLOBALS['csstidy']['predefined_templates']['high_compression'][] = '<span class="format">}</span>';
  862. -
  863. $GLOBALS['csstidy']['predefined_templates']['high_compression'][] = "\n";
  864. -
  865. $GLOBALS['csstidy']['predefined_templates']['high_compression'][] = "\n". '<span class="format">}'."\n".'</span>';
  866. -
  867. $GLOBALS['csstidy']['predefined_templates']['high_compression'][] = '';
  868. -
  869. $GLOBALS['csstidy']['predefined_templates']['high_compression'][] = '<span class="comment">'; // before comment
  870. -
  871. $GLOBALS['csstidy']['predefined_templates']['high_compression'][] = '</span>'; // after comment
  872. -
  873. $GLOBALS['csstidy']['predefined_templates']['high_compression'][] = "\n";
  874. -
  875.  
  876. -
  877. $GLOBALS['csstidy']['predefined_templates']['highest_compression'][] = '<span class="at">';
  878. -
  879. $GLOBALS['csstidy']['predefined_templates']['highest_compression'][] = '</span><span class="format">{</span>';
  880. -
  881. $GLOBALS['csstidy']['predefined_templates']['highest_compression'][] = '<span class="selector">';
  882. -
  883. $GLOBALS['csstidy']['predefined_templates']['highest_compression'][] = '</span><span class="format">{</span>';
  884. -
  885. $GLOBALS['csstidy']['predefined_templates']['highest_compression'][] = '<span class="property">';
  886. -
  887. $GLOBALS['csstidy']['predefined_templates']['highest_compression'][] = '</span><span class="value">';
  888. -
  889. $GLOBALS['csstidy']['predefined_templates']['highest_compression'][] = '</span><span class="format">;</span>';
  890. -
  891. $GLOBALS['csstidy']['predefined_templates']['highest_compression'][] = '<span class="format">}</span>';
  892. -
  893. $GLOBALS['csstidy']['predefined_templates']['highest_compression'][] = '';
  894. -
  895. $GLOBALS['csstidy']['predefined_templates']['highest_compression'][] = '<span class="format">}</span>';
  896. -
  897. $GLOBALS['csstidy']['predefined_templates']['highest_compression'][] = '';
  898. -
  899. $GLOBALS['csstidy']['predefined_templates']['highest_compression'][] = '<span class="comment">'; // before comment
  900. -
  901. $GLOBALS['csstidy']['predefined_templates']['highest_compression'][] = '</span>'; // after comment
  902. -
  903. $GLOBALS['csstidy']['predefined_templates']['highest_compression'][] = '';
  904. -
  905.  
  906. -
  907. $GLOBALS['csstidy']['predefined_templates']['low_compression'][] = '<span class="at">';
  908. -
  909. $GLOBALS['csstidy']['predefined_templates']['low_compression'][] = '</span> <span class="format">{</span>'."\n";
  910. -
  911. $GLOBALS['csstidy']['predefined_templates']['low_compression'][] = '<span class="selector">';
  912. -
  913. $GLOBALS['csstidy']['predefined_templates']['low_compression'][] = '</span>'."\n".'<span class="format">{</span>'."\n";
  914. -
  915. $GLOBALS['csstidy']['predefined_templates']['low_compression'][] = ' <span class="property">';
  916. -
  917. $GLOBALS['csstidy']['predefined_templates']['low_compression'][] = '</span><span class="value">';
  918. -
  919. $GLOBALS['csstidy']['predefined_templates']['low_compression'][] = '</span><span class="format">;</span>'."\n";
  920. -
  921. $GLOBALS['csstidy']['predefined_templates']['low_compression'][] = '<span class="format">}</span>';
  922. -
  923. $GLOBALS['csstidy']['predefined_templates']['low_compression'][] = "\n\n";
  924. -
  925. $GLOBALS['csstidy']['predefined_templates']['low_compression'][] = "\n".'<span class="format">}</span>'."\n\n";
  926. -
  927. $GLOBALS['csstidy']['predefined_templates']['low_compression'][] = ' ';
  928. -
  929. $GLOBALS['csstidy']['predefined_templates']['low_compression'][] = '<span class="comment">'; // before comment
  930. -
  931. $GLOBALS['csstidy']['predefined_templates']['low_compression'][] = '</span>'."\n"; // after comment
  932. -
  933. $GLOBALS['csstidy']['predefined_templates']['low_compression'][] = "\n";
  934. -
  935.  
  936. -
  937. ?>
  938. -
-
-
-
- Documentation generated on Mon, 15 May 2006 22:56:01 +0200 by phpDocumentor 1.3.0RC3 -
-
-
- - - \ No newline at end of file diff --git a/www/plugins-dist/compresseur/lib/csstidy/Docs/classtrees_csstidy.html b/www/plugins-dist/compresseur/lib/csstidy/Docs/classtrees_csstidy.html deleted file mode 100644 index a8717496..00000000 --- a/www/plugins-dist/compresseur/lib/csstidy/Docs/classtrees_csstidy.html +++ /dev/null @@ -1,62 +0,0 @@ - - -Class Trees for Package csstidy - - - - - - - - - - - - - -
csstidy
- [ class tree: csstidy ] - [ index: csstidy ] - [ all elements ] -
- - - - - - -
-
- -

Class Trees for Package csstidy

-
-
Root class csstidy

- - -
-
Root class csstidy_optimise

- - -
-
Root class csstidy_print

- - -
-
- Documentation generated on Mon, 15 May 2006 22:54:54 +0200 by phpDocumentor 1.3.0RC3 -
-
-
- - - \ No newline at end of file diff --git a/www/plugins-dist/compresseur/lib/csstidy/Docs/csstidy/_class_csstidy_optimise_php.html b/www/plugins-dist/compresseur/lib/csstidy/Docs/csstidy/_class_csstidy_optimise_php.html deleted file mode 100644 index f755d0c4..00000000 --- a/www/plugins-dist/compresseur/lib/csstidy/Docs/csstidy/_class_csstidy_optimise_php.html +++ /dev/null @@ -1,97 +0,0 @@ - - -Docs for page class.csstidy_optimise.php - - - - - - - - - - - - - -
csstidy
- [ class tree: csstidy ] - [ index: csstidy ] - [ all elements ] -
- - - - - - -
-
- -

Procedural File: class.csstidy_optimise.php

-Source Location: /class.csstidy_optimise.php

- -
-
- -
-

Classes:

-
csstidy_optimise
-
CSS Optimising Class
-


- -

Page Details:

-CSSTidy - CSS Parser and Optimiser

CSS Optimising Class This class optimises CSS data generated by csstidy.

This file is part of CSSTidy.

CSSTidy is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

CSSTidy is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with CSSTidy; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA




-

Tags:

-
- - - - - - - - - - -
filesource:  Source Code for this file
author:  Florian Schmitz (floele at gmail dot com) 2005-2006
license:  GNU Public License
-
-

-

-

-
- -
-
- Documentation generated on Mon, 15 May 2006 22:55:16 +0200 by phpDocumentor 1.3.0RC3 -
-
-
- - - \ No newline at end of file diff --git a/www/plugins-dist/compresseur/lib/csstidy/Docs/csstidy/_class_csstidy_php.html b/www/plugins-dist/compresseur/lib/csstidy/Docs/csstidy/_class_csstidy_php.html deleted file mode 100644 index 775f327d..00000000 --- a/www/plugins-dist/compresseur/lib/csstidy/Docs/csstidy/_class_csstidy_php.html +++ /dev/null @@ -1,130 +0,0 @@ - - -Docs for page class.csstidy.php - - - - - - - - - - - - - -
csstidy
- [ class tree: csstidy ] - [ index: csstidy ] - [ all elements ] -
- - - - - - -
-
- -

Procedural File: class.csstidy.php

-Source Location: /class.csstidy.php

- -
-
- -
-

Classes:

-
csstidy
-
CSS Parser class
-


- -

Page Details:

-CSSTidy - CSS Parser and Optimiser

CSS Parser class

This file is part of CSSTidy.

CSSTidy is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

CSSTidy is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with CSSTidy; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA




-

Tags:

-
- - - - - - - - - - -
filesource:  Source Code for this file
author:  Florian Schmitz (floele at gmail dot com) 2005-2006
license:  GNU Public License
-
-

-

Includes:

-
-require('data.inc.php') [line 33]
-Various CSS data needed for correct optimisations etc.



-

Tags:

-
- - - - -
version:  1.2
-
-require('class.csstidy_print.php') [line 40]
-Contains a class for printing CSS code



-

Tags:

-
- - - - -
version:  1.0
-
-require('class.csstidy_optimise.php') [line 47]
-Contains a class for optimising CSS code



-

Tags:

-
- - - - -
version:  1.0
-
-
-

-

-
- -
-
- Documentation generated on Mon, 15 May 2006 22:54:54 +0200 by phpDocumentor 1.3.0RC3 -
-
-
- - - \ No newline at end of file diff --git a/www/plugins-dist/compresseur/lib/csstidy/Docs/csstidy/_class_csstidy_print_php.html b/www/plugins-dist/compresseur/lib/csstidy/Docs/csstidy/_class_csstidy_print_php.html deleted file mode 100644 index d0062b26..00000000 --- a/www/plugins-dist/compresseur/lib/csstidy/Docs/csstidy/_class_csstidy_print_php.html +++ /dev/null @@ -1,97 +0,0 @@ - - -Docs for page class.csstidy_print.php - - - - - - - - - - - - - -
csstidy
- [ class tree: csstidy ] - [ index: csstidy ] - [ all elements ] -
- - - - - - -
-
- -

Procedural File: class.csstidy_print.php

-Source Location: /class.csstidy_print.php

- -
-
- -
-

Classes:

-
csstidy_print
-
CSS Printing class
-


- -

Page Details:

-CSSTidy - CSS Parser and Optimiser

CSS Printing class This class prints CSS data generated by csstidy.

This file is part of CSSTidy.

CSSTidy is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

CSSTidy is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with CSSTidy; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA




-

Tags:

-
- - - - - - - - - - -
filesource:  Source Code for this file
author:  Florian Schmitz (floele at gmail dot com) 2005-2006
license:  GNU Public License
-
-

-

-

-
- -
-
- Documentation generated on Mon, 15 May 2006 22:55:35 +0200 by phpDocumentor 1.3.0RC3 -
-
-
- - - \ No newline at end of file diff --git a/www/plugins-dist/compresseur/lib/csstidy/Docs/csstidy/_data_inc_php.html b/www/plugins-dist/compresseur/lib/csstidy/Docs/csstidy/_data_inc_php.html deleted file mode 100644 index a95e0c82..00000000 --- a/www/plugins-dist/compresseur/lib/csstidy/Docs/csstidy/_data_inc_php.html +++ /dev/null @@ -1,483 +0,0 @@ - - -Docs for page data.inc.php - - - - - - - - - - - - - -
csstidy
- [ class tree: csstidy ] - [ index: csstidy ] - [ all elements ] -
- - - - - - -
-
- -

Procedural File: data.inc.php

-Source Location: /data.inc.php

- -
-
- - -

Page Details:

-Various CSS Data for CSSTidy

This file is part of CSSTidy.

CSSTidy is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

CSSTidy is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with CSSTidy; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA




-

Tags:

-
- - - - - - - - - - -
filesource:  Source Code for this file
author:  Florian Schmitz (floele at gmail dot com) 2005
license:  GNU Public License
-
-

-

-
- -

array $GLOBALS['csstidy']['all_properties'] [line 277]

-
- All CSS Properties. Needed for csstidy::property_is_next()



-

Tags:

-
- - - - - - - - - - -
see:  csstidy::property_is_next()
version:  1.0
todo:  Add CSS3 properties
-
- - - - - - -
Default value:  array()
-


-
[ Top ]


-
- -

array $GLOBALS['csstidy']['at_rules'] [line 66]

-
- Available at-rules



-

Tags:

-
- - - - -
version:  1.0
-
- - - - - - -
Default value:  array('page' => 'is','font-face' => 'is','charset' => 'iv', 'import' => 'iv','namespace' => 'iv','media' => 'at')
-


-
[ Top ]


-
- -

array $GLOBALS['csstidy']['background_prop_default'] [line 106]

-
- Default values for the background properties



-

Tags:

-
- - - - - - - - - - - - - -
version:  1.0
see:  merge_bg()
see:  dissolve_short_bg()
todo:  Possibly property names will change during CSS3 development
-
- - - - - - -
Default value:  array()
-


-
[ Top ]


-
- -

array $GLOBALS['csstidy']['color_values'] [line 86]

-
- Properties that allow <color> as value



-

Tags:

-
- - - - - - - - - - -
version:  1.0
see:  compress_numbers();
todo:  CSS3 properties
-
- - - - - - -
Default value:  array()
-


-
[ Top ]


-
- -

array $GLOBALS['csstidy']['number_values'] [line 76]

-
- Properties that allow <number> as value



-

Tags:

-
- - - - - - - - - - -
version:  1.2
see:  compress_numbers();
todo:  CSS3 properties
-
- - - - - - -
Default value:  array('line-height','pitch-range','richness','speech-rate','stress','volume','font','font-weight','z-index','counter-increment','counter-reset','orphans','widows')
-


-
[ Top ]


-
- -

array $GLOBALS['csstidy']['predefined_templates'] [line 409]

-
- An array containing all predefined templates.



-

Tags:

-
- - - - - - - -
see:  csstidy::load_template()
version:  1.0
-
- - - - - - -
Default value:  '<span class="at">'
-


-
[ Top ]


-
- -

array $GLOBALS['csstidy']['replace_colors'] [line 123]

-
- A list of non-W3C color names which get replaced by their hex-codes



-

Tags:

-
- - - - - - - -
version:  1.0
see:  cut_color()
-
- - - - - - -
Default value:  array()
-


-
[ Top ]


-
- -

array $GLOBALS['csstidy']['shorthands'] [line 261]

-
- A list of all shorthand properties that are devided into four properties and/or have four subvalues



-

Tags:

-
- - - - - - - - - - - - - -
version:  1.0
see:  merge_4value_shorthands()
see:  dissolve_4value_shorthands()
todo:  Are there new ones in CSS3?
-
- - - - - - -
Default value:  array()
-


-
[ Top ]


-
- -

string $GLOBALS['csstidy']['tokens'] [line 49]

-
- All CSS tokens used by csstidy



-

Tags:

-
- - - - -
version:  1.0
-
- - - - - - -
Default value:  '/@}{;:=\'"(,\\!$%&)*+.<>?[]^`|~'
-


-
[ Top ]


-
- -

array $GLOBALS['csstidy']['units'] [line 58]

-
- All CSS units (CSS 3 units included)



-

Tags:

-
- - - - - - - -
version:  1.0
see:  compress_numbers()
-
- - - - - - -
Default value:  array('in','cm','mm','pt','pc','px','rem','em','%','ex','gd','vw','vh','vm','deg','grad','rad','ms','s','khz','hz')
-


-
[ Top ]


-
- -

array $GLOBALS['csstidy']['whitespace'] [line 41]

-
- All whitespace allowed in CSS



-

Tags:

-
- - - - -
version:  1.0
-
- - - - - - -
Default value:  array(' ',"\n","\t","\r","\x0B")
-


-
[ Top ]


-

-
- -

AT_END [line 27]

-
-
-
- AT_END = 2 -
-
- -
-
-
[ Top ]


-
- -

AT_START [line 26]

-
-
-
- AT_START = 1 -
-
- -
-
-
[ Top ]


-
- -

COMMENT [line 32]

-
-
-
- COMMENT = 7 -
-
- -
-
-
[ Top ]


-
- -

DEFAULT_AT [line 33]

-
-
-
- DEFAULT_AT = 41 -
-
- -
-
-
[ Top ]


-
- -

PROPERTY [line 30]

-
-
-
- PROPERTY = 5 -
-
- -
-
-
[ Top ]


-
- -

SEL_END [line 29]

-
-
-
- SEL_END = 4 -
-
- -
-
-
[ Top ]


-
- -

SEL_START [line 28]

-
-
-
- SEL_START = 3 -
-
- -
-
-
[ Top ]


-
- -

VALUE [line 31]

-
-
-
- VALUE = 6 -
-
- -
-
-
[ Top ]


-
- -
-
- Documentation generated on Mon, 15 May 2006 22:55:43 +0200 by phpDocumentor 1.3.0RC3 -
-
-
- - - \ No newline at end of file diff --git a/www/plugins-dist/compresseur/lib/csstidy/Docs/csstidy/csstidy.html b/www/plugins-dist/compresseur/lib/csstidy/Docs/csstidy/csstidy.html deleted file mode 100644 index e3f92e73..00000000 --- a/www/plugins-dist/compresseur/lib/csstidy/Docs/csstidy/csstidy.html +++ /dev/null @@ -1,1550 +0,0 @@ - - -Docs For Class csstidy - - - - - - - - - - - - - -
csstidy
- [ class tree: csstidy ] - [ index: csstidy ] - [ all elements ] -
- - - - - - -
-
- -

Class: csstidy

-Source Location: /class.csstidy.php

- - - - - - - - - - -
- -

Class Overview

-

-
CSS Parser class


-

Author(s):

-
    -
  • Florian Schmitz (floele at gmail dot com) 2005-2006
  • -
- - - - - - -

Version:

-
    -
  • 1.2
  • -
- - -
-

Variables

- -
-

Methods

- -
-
- - - - - - - - -
-
- - -

Class Details

-
-[line 61]
-CSS Parser class

This class represents a CSS parser which reads CSS code and saves it in an array. In opposite to most other CSS parsers, it does not use regular expressions and thus has full CSS2 support and a higher reliability. Additional to that it applies some optimisations and fixes to the CSS code. An online version should be available here: http://cdburnerxp.se/cssparse/css_optimiser.php




-

Tags:

-
- - - - - - - -
version:  1.2
author:  Florian Schmitz (floele at gmail dot com) 2005-2006
-
-


-
[ Top ]

- -
- -

Class Variables

-
- -

-

$added =  false

-

[line 233]

- =true if something has been added to the current selector



-

Tags:

-
- - - - -
access:  private
-
- -
-
- - - - - -
Type:  bool
-


-
[ Top ]

- -

-

$at =  ''

-

[line 150]

- Saves the current at rule (@media)



-

Tags:

-
- - - - -
access:  private
-
- -
-
- - - - - -
Type:  string
-


-
[ Top ]

- -

-

$charset =  ''

-

[line 98]

- Saves the CSS charset (@charset)



-

Tags:

-
- - - - -
access:  private
-
- -
-
- - - - - -
Type:  string
-


-
[ Top ]

- -

-

$css = array()

-

[line 68]

- Saves the parsed CSS



-

Tags:

-
- - - - -
access:  public
-
- -
-
- - - - - -
Type:  array
-


-
[ Top ]

- -

-

$from =  ''

-

[line 212]

- Status from which the parser switched to ic or instr



-

Tags:

-
- - - - -
access:  private
-
- -
-
- - - - - -
Type:  string
-


-
[ Top ]

- -

-

$import = array()

-

[line 105]

- Saves all @import URLs



-

Tags:

-
- - - - -
access:  private
-
- -
-
- - - - - -
Type:  array
-


-
[ Top ]

- -

-

$invalid_at =  false

-

[line 226]

- =true if in invalid at-rule



-

Tags:

-
- - - - -
access:  private
-
- -
-
- - - - - -
Type:  bool
-


-
[ Top ]

- -

-

$line =  1

-

[line 247]

- Saves the line number



-

Tags:

-
- - - - -
access:  private
-
- -
-
- - - - - -
Type:  integer
-


-
[ Top ]

- -

-

$log = array()

-

[line 240]

- Array which saves the message log



-

Tags:

-
- - - - -
access:  private
-
- -
-
- - - - - -
Type:  array
-


-
[ Top ]

- -

-

$namespace =  ''

-

[line 112]

- Saves the namespace



-

Tags:

-
- - - - -
access:  private
-
- -
-
- - - - - -
Type:  string
-


-
[ Top ]

- -

-

$optimise =

-

[line 91]

- Optimiser class



-

Tags:

-
- - - - - - - -
access:  private
see:  csstidy_optimise
-
- -
-
- - - - - -
Type:  object
-


-
[ Top ]

- -

-

$print =

-

[line 83]

- Printer class



-

Tags:

-
- - - - - - - -
access:  public
see:  csstidy_print
-
- -
-
- - - - - -
Type:  object
-


-
[ Top ]

- -

-

$property =  ''

-

[line 164]

- Saves the current property



-

Tags:

-
- - - - -
access:  private
-
- -
-
- - - - - -
Type:  string
-


-
[ Top ]

- -

-

$selector =  ''

-

[line 157]

- Saves the current selector



-

Tags:

-
- - - - -
access:  private
-
- -
-
- - - - - -
Type:  string
-


-
[ Top ]

- -

-

$sel_separate = array()

-

[line 171]

- Saves the position of , in selectors



-

Tags:

-
- - - - -
access:  private
-
- -
-
- - - - - -
Type:  array
-


-
[ Top ]

- -

-

$settings = array()

-

[line 126]

- Stores the settings



-

Tags:

-
- - - - -
access:  private
-
- -
-
- - - - - -
Type:  array
-


-
[ Top ]

- -

-

$status =  'is'

-

[line 142]

- Saves the parser-status.

Possible values:

  • is = in selector
  • ip = in property
  • iv = in value
  • instr = in string (started at " or ' or ( )
  • ic = in comment (ignore everything)
  • at = in @-block




-

Tags:

-
- - - - -
access:  private
-
- -
-
- - - - - -
Type:  string
-


-
[ Top ]

- -

-

$str_char =  ''

-

[line 205]

- Saves the char which opened the last string



-

Tags:

-
- - - - -
access:  private
-
- -
-
- - - - - -
Type:  string
-


-
[ Top ]

- -

-

$str_in_str =  false

-

[line 219]

- Variable needed to manage string-in-strings, for example url("foo.png")



-

Tags:

-
- - - - -
access:  private
-
- -
-
- - - - - -
Type:  string
-


-
[ Top ]

- -

-

$sub_value =  ''

-

[line 190]

- Saves the current sub-value

Example for a subvalue: background:url(foo.png) red no-repeat; "url(foo.png)", "red", and "no-repeat" are subvalues, seperated by whitespace




-

Tags:

-
- - - - -
access:  private
-
- -
-
- - - - - -
Type:  string
-


-
[ Top ]

- -

-

$sub_value_arr = array()

-

[line 198]

- Array which saves all subvalues for a property.



-

Tags:

-
- - - - - - - -
access:  private
see:  csstidy::$sub_value
-
- -
-
- - - - - -
Type:  array
-


-
[ Top ]

- -

-

$tokens = array()

-

[line 75]

- Saves the parsed CSS (raw)



-

Tags:

-
- - - - -
access:  private
-
- -
-
- - - - - -
Type:  array
-


-
[ Top ]

- -

-

$value =  ''

-

[line 178]

- Saves the current value



-

Tags:

-
- - - - -
access:  private
-
- -
-
- - - - - -
Type:  string
-


-
[ Top ]

- -

-

$version =  '1.2'

-

[line 119]

- Contains the version of csstidy



-

Tags:

-
- - - - -
access:  private
-
- -
-
- - - - - -
Type:  string
-


-
[ Top ]

-

- -
- -

Class Methods

-
-
- -

constructor csstidy [line 254]

-
-
-
- csstidy csstidy( -) -
-

- - Loads standard template and sets default settings



-

Tags:

-
- - - - - - - -
version:  1.2
access:  private
-
-

- - -
[ Top ]
-
-
- -

method css_add_property [line 877]

-
-
-
- void css_add_property( -string -$media, string -$selector, string -$property, string -$new_val) -
-

- - Adds a property with value to the existing CSS code



-

Tags:

-
- - - - - - - -
version:  1.2
access:  private
-
-

- - -

Parameters:

-
- - - - - - - - - - - - - - - - - - - - - -
string  $media  
string  $selector  
string  $property  
string  $new_val  
-

-
[ Top ]
-
-
- -

method escaped [line 863]

-
-
-
- bool escaped( -string -&$string, integer -$pos) -
-

- - Checks if a character is escaped (and returns true if it is)



-

Tags:

-
- - - - - - - -
version:  1.02
access:  public
-
-

- - -

Parameters:

-
- - - - - - - - - - - -
string  $string  
integer  $pos  
-

-
[ Top ]
-
-
- -

method explode_selectors [line 825]

-
-
-
- void explode_selectors( -) -
-

- - Explodes selectors



-

Tags:

-
- - - - - - - -
version:  1.0
access:  private
-
-

- - -
[ Top ]
-
-
- -

method get_cfg [line 283]

-
-
-
- mixed get_cfg( -string -$setting) -
-

- - Get the value of a setting.



-

Tags:

-
- - - - - - - -
version:  1.0
access:  public
-
-

- - -

Parameters:

-
- - - - - - -
string  $setting  
-

-
[ Top ]
-
-
- -

method gvw_important [line 933]

-
-
-
- string gvw_important( -string -$value) -
-

- - Returns a value without !important



-

Tags:

-
- - - - - - - -
version:  1.0
access:  public
-
-

- - -

Parameters:

-
- - - - - - -
string  $value  
-

-
[ Top ]
-
-
- -

method is_important [line 921]

-
-
-
- bool is_important( -string -&$value) -
-

- - Checks if $value is !important.



-

Tags:

-
- - - - - - - -
version:  1.0
access:  public
-
-

- - -

Parameters:

-
- - - - - - -
string  $value  
-

-
[ Top ]
-
-
- -

method is_token [line 444]

-
-
-
- void is_token( -string -&$string, integer -$i) -
-

- - Checks if there is a token at the current position



-

Tags:

-
- - - - - - - -
version:  1.11
access:  public
-
-

- - -

Parameters:

-
- - - - - - - - - - - -
string  $string  
integer  $i  
-

-
[ Top ]
-
-
- -

method load_template [line 404]

-
-
-
- void load_template( -string -$content, [bool -$from_file = true]) -
-

- - Loads a new template



-

Tags:

-
- - - - - - - - - - -
see:  http://csstidy.sourceforge.net/templates.php
version:  1.1
access:  public
-
-

- - -

Parameters:

-
- - - - - - - - - - - -
string  $content  either filename (if $from_file == true), content of a template file, "high_compression", "highest_compression", "low_compression", or "default"
bool  $from_file  uses $content as filename if true
-

-
[ Top ]
-
-
- -

method log [line 332]

-
-
-
- void log( -string -$message, string -$type, [integer -$line = -1]) -
-

- - Add a message to the message log



-

Tags:

-
- - - - - - - -
version:  1.0
access:  private
-
-

- - -

Parameters:

-
- - - - - - - - - - - - - - - - -
string  $message  
string  $type  
integer  $line  
-

-
[ Top ]
-
-
- -

method merge_css_blocks [line 906]

-
-
-
- void merge_css_blocks( -string -$media, string -$selector, array -$css_add) -
-

- - Adds CSS to an existing media/selector



-

Tags:

-
- - - - - - - -
version:  1.1
access:  private
-
-

- - -

Parameters:

-
- - - - - - - - - - - - - - - - -
string  $media  
string  $selector  
array  $css_add  
-

-
[ Top ]
-
-
- -

method parse [line 458]

-
-
-
- bool parse( -string -$string) -
-

- - Parses CSS in $string. The code is saved as array in $this->css



-

Tags:

-
- - - - - - - -
version:  1.1
access:  public
-
-

- - -

Parameters:

-
- - - - - - -
string  $string  the CSS code
-

-
[ Top ]
-
-
- -

method parse_from_url [line 432]

-
-
-
- void parse_from_url( -string -$url) -
-

- - Starts parsing from URL



-

Tags:

-
- - - - - - - -
version:  1.0
access:  public
-
-

- - -

Parameters:

-
- - - - - - -
string  $url  
-

-
[ Top ]
-
-
- -

method property_is_next [line 955]

-
-
-
- bool property_is_next( -string -$istring, integer -$pos) -
-

- - Checks if the next word in a string from pos is a CSS property



-

Tags:

-
- - - - - - - -
version:  1.2
access:  private
-
-

- - -

Parameters:

-
- - - - - - - - - - - -
string  $istring  
integer  $pos  
-

-
[ Top ]
-
-
- -

method property_is_valid [line 980]

-
-
-
- bool; property_is_valid( -string -$property) -
-

- - Checks if a property is valid



-

Tags:

-
- - - - - - - -
version:  1.0
access:  public
-
-

- - -

Parameters:

-
- - - - - - -
string  $property  
-

-
[ Top ]
-
-
- -

method set_cfg [line 300]

-
-
-
- bool set_cfg( -string -$setting, mixed -$value) -
-

- - Set the value of a setting.



-

Tags:

-
- - - - - - - -
version:  1.0
access:  public
-
-

- - -

Parameters:

-
- - - - - - - - - - - -
string  $setting  
mixed  $value  
-

-
[ Top ]
-
-
- -

method _add_token [line 318]

-
-
-
- void _add_token( -mixed -$type, string -$data, [bool -$do = false]) -
-

- - Adds a token to $this->tokens



-

Tags:

-
- - - - - - - -
version:  1.0
access:  private
-
-

- - -

Parameters:

-
- - - - - - - - - - - - - - - - -
mixed  $type  
string  $data  
bool  $do  add a token even if preserve_css is off
-

-
[ Top ]
-
-
- -

method _unicode [line 354]

-
-
-
- string _unicode( -string -&$string, integer -&$i) -
-

- - Parse unicode notations and find a replacement character



-

Tags:

-
- - - - - - - -
version:  1.2
access:  private
-
-

- - -

Parameters:

-
- - - - - - - - - - - -
string  $string  
integer  $i  
-

-
[ Top ]
-
-

- - -
-
- Documentation generated on Mon, 15 May 2006 22:55:14 +0200 by phpDocumentor 1.3.0RC3 -
-
-
- - - \ No newline at end of file diff --git a/www/plugins-dist/compresseur/lib/csstidy/Docs/csstidy/csstidy_optimise.html b/www/plugins-dist/compresseur/lib/csstidy/Docs/csstidy/csstidy_optimise.html deleted file mode 100644 index 3f72a2f4..00000000 --- a/www/plugins-dist/compresseur/lib/csstidy/Docs/csstidy/csstidy_optimise.html +++ /dev/null @@ -1,705 +0,0 @@ - - -Docs For Class csstidy_optimise - - - - - - - - - - - - - -
csstidy
- [ class tree: csstidy ] - [ index: csstidy ] - [ all elements ] -
- - - - - - -
-
- -

Class: csstidy_optimise

-Source Location: /class.csstidy_optimise.php

- - - - - - - - - -
- -

Class Overview

-

-
CSS Optimising Class


-

Author(s):

-
    -
  • Florian Schmitz (floele at gmail dot com) 2005-2006
  • -
- - - - - - -

Version:

-
    -
  • 1.0
  • -
- - -
-

Methods

- -
-
- - - - - - - - -
-
- - -

Class Details

-
-[line 39]
-CSS Optimising Class

This class optimises CSS data generated by csstidy.




-

Tags:

-
- - - - - - - -
version:  1.0
author:  Florian Schmitz (floele at gmail dot com) 2005-2006
-
-


-
[ Top ]

- - -
- -

Class Methods

-
-
- -

constructor csstidy_optimise [line 47]

-
-
-
- csstidy_optimise csstidy_optimise( -array -&$css) -
-

- - Constructor



-

Tags:

-
- - - - - - - -
version:  1.0
access:  private
-
-

- - -

Parameters:

-
- - - - - - -
array  $css  contains the class csstidy
-

-
[ Top ]
-
-
- -

method compress_important [line 278]

-
-
-
- string compress_important( -string -&$string) -
-

- - Removes unnecessary whitespace in ! important



-

Tags:

-
- - - - - - - -
version:  1.1
access:  public
-
-

- - -

Parameters:

-
- - - - - - -
string  $string  
-

-
[ Top ]
-
-
- -

method compress_numbers [line 368]

-
-
-
- string compress_numbers( -string -$subvalue) -
-

- - Compresses numbers (ie. 1.0 becomes 1 or 1.100 becomes 1.1 )



-

Tags:

-
- - - - -
version:  1.2
-
-

- - -

Parameters:

-
- - - - - - -
string  $subvalue  
-

-
[ Top ]
-
-
- -

method cut_color [line 293]

-
-
-
- string cut_color( -string -$color) -
-

- - Color compression function. Converts all rgb() values to #-values and uses the short-form if possible. Also replaces 4 color names by #-values.



-

Tags:

-
- - - - -
version:  1.1
-
-

- - -

Parameters:

-
- - - - - - -
string  $color  
-

-
[ Top ]
-
-
- -

method dissolve_4value_shorthands [line 485]

-
-
-
- array dissolve_4value_shorthands( -string -$property, string -$value) -
-

- - Dissolves properties like padding:10px 10px 10px to padding-top:10px;padding-bottom:10px;...



-

Tags:

-
- - - - - - - -
see:  csstidy_optimise::merge_4value_shorthands()
version:  1.0
-
-

- - -

Parameters:

-
- - - - - - - - - - - -
string  $property  
string  $value  
-

-
[ Top ]
-
-
- -

method dissolve_short_bg [line 639]

-
-
-
- array dissolve_short_bg( -string -$str_value) -
-

- - Dissolve background property



-

Tags:

-
- - - - - - - - - - -
todo:  full CSS 3 compliance
see:  csstidy_optimise::merge_bg()
version:  1.0
-
-

- - -

Parameters:

-
- - - - - - -
string  $str_value  
-

-
[ Top ]
-
-
- -

method explode_ws [line 543]

-
-
-
- array explode_ws( -string -$sep, string -$string) -
-

- - Explodes a string as explode() does, however, not if $sep is escaped or within a string.



-

Tags:

-
- - - - -
version:  1.0
-
-

- - -

Parameters:

-
- - - - - - - - - - - -
string  $sep  seperator
string  $string  
-

-
[ Top ]
-
-
- -

method merge_4value_shorthands [line 598]

-
-
-
- array merge_4value_shorthands( -array -$array) -
-

- - Merges Shorthand properties again, the opposite of dissolve_4value_shorthands()



-

Tags:

-
- - - - - - - -
see:  csstidy_optimise::dissolve_4value_shorthands()
version:  1.2
-
-

- - -

Parameters:

-
- - - - - - -
array  $array  
-

-
[ Top ]
-
-
- -

method merge_bg [line 725]

-
-
-
- array merge_bg( -array -$input_css) -
-

- - Merges all background properties



-

Tags:

-
- - - - - - - - - - -
todo:  full CSS 3 compliance
see:  csstidy_optimise::dissolve_short_bg()
version:  1.0
-
-

- - -

Parameters:

-
- - - - - - -
array  $input_css  
-

-
[ Top ]
-
-
- -

method merge_selectors [line 435]

-
-
-
- array merge_selectors( -array -&$array) -
-

- - Merges selectors with same properties. Example: a{color:red} b{color:red} -> a,b{color:red} Very basic and has at least one bug. Hopefully there is a replacement soon.



-

Tags:

-
- - - - - - - -
version:  1.2
access:  public
-
-

- - -

Parameters:

-
- - - - - - -
array  $array  
-

-
[ Top ]
-
-
- -

method postparse [line 63]

-
-
-
- void postparse( -) -
-

- - Optimises $css after parsing



-

Tags:

-
- - - - - - - -
version:  1.0
access:  public
-
-

- - -
[ Top ]
-
-
- -

method shorthand [line 221]

-
-
-
- string shorthand( -string -$value) -
-

- - Compresses shorthand values. Example: margin:1px 1px 1px 1px -> margin:1px



-

Tags:

-
- - - - - - - -
version:  1.0
access:  public
-
-

- - -

Parameters:

-
- - - - - - -
string  $value  
-

-
[ Top ]
-
-
- -

method shorthands [line 130]

-
-
-
- void shorthands( -) -
-

- - Optimises shorthands



-

Tags:

-
- - - - - - - -
version:  1.0
access:  public
-
-

- - -
[ Top ]
-
-
- -

method subvalue [line 158]

-
-
-
- void subvalue( -) -
-

- - Optimises a sub-value



-

Tags:

-
- - - - - - - -
version:  1.0
access:  public
-
-

- - -
[ Top ]
-
-
- -

method value [line 103]

-
-
-
- void value( -) -
-

- - Optimises values



-

Tags:

-
- - - - - - - -
version:  1.0
access:  public
-
-

- - -
[ Top ]
-
-

- - -
-
- Documentation generated on Mon, 15 May 2006 22:55:34 +0200 by phpDocumentor 1.3.0RC3 -
-
-
- - - \ No newline at end of file diff --git a/www/plugins-dist/compresseur/lib/csstidy/Docs/csstidy/csstidy_print.html b/www/plugins-dist/compresseur/lib/csstidy/Docs/csstidy/csstidy_print.html deleted file mode 100644 index 665301fe..00000000 --- a/www/plugins-dist/compresseur/lib/csstidy/Docs/csstidy/csstidy_print.html +++ /dev/null @@ -1,617 +0,0 @@ - - -Docs For Class csstidy_print - - - - - - - - - - - - - -
csstidy
- [ class tree: csstidy ] - [ index: csstidy ] - [ all elements ] -
- - - - - - -
-
- -

Class: csstidy_print

-Source Location: /class.csstidy_print.php

- - - - - - - - - - -
- -

Class Overview

-

-
CSS Printing class


-

Author(s):

-
    -
  • Florian Schmitz (floele at gmail dot com) 2005-2006
  • -
- - - - - - -

Version:

-
    -
  • 1.0
  • -
- - -
-

Variables

- -
-

Methods

- -
-
- - - - - - - - -
-
- - -

Class Details

-
-[line 39]
-CSS Printing class

This class prints CSS data generated by csstidy.




-

Tags:

-
- - - - - - - -
version:  1.0
author:  Florian Schmitz (floele at gmail dot com) 2005-2006
-
-


-
[ Top ]

- -
- -

Class Variables

-
- -

-

$input_css =  ''

-

[line 46]

- Saves the input CSS string



-

Tags:

-
- - - - -
access:  private
-
- -
-
- - - - - -
Type:  string
-


-
[ Top ]

- -

-

$output_css =  ''

-

[line 53]

- Saves the formatted CSS string



-

Tags:

-
- - - - -
access:  public
-
- -
-
- - - - - -
Type:  string
-


-
[ Top ]

- -

-

$output_css_plain =  ''

-

[line 60]

- Saves the formatted CSS string (plain text)



-

Tags:

-
- - - - -
access:  public
-
- -
-
- - - - - -
Type:  string
-


-
[ Top ]

-

- -
- -

Class Methods

-
-
- -

constructor csstidy_print [line 68]

-
-
-
- csstidy_print csstidy_print( -array -&$css) -
-

- - Constructor



-

Tags:

-
- - - - - - - -
version:  1.0
access:  private
-
-

- - -

Parameters:

-
- - - - - - -
array  $css  contains the class csstidy
-

-
[ Top ]
-
-
- -

method formatted [line 108]

-
-
-
- string formatted( -) -
-

- - Returns the formatted CSS code



-

Tags:

-
- - - - - - - -
version:  1.0
access:  public
-
-

- - -
[ Top ]
-
-
- -

method get_diff [line 313]

-
-
-
- string get_diff( -) -
-

- - Get difference between the old and new code in bytes and prints the code if necessary.



-

Tags:

-
- - - - - - - -
version:  1.1
access:  public
-
-

- - -
[ Top ]
-
-
- -

method get_ratio [line 299]

-
-
-
- float get_ratio( -) -
-

- - Get compression ratio



-

Tags:

-
- - - - - - - -
version:  1.2
access:  public
-
-

- - -
[ Top ]
-
-
- -

method plain [line 96]

-
-
-
- string plain( -) -
-

- - Returns the CSS code as plain text



-

Tags:

-
- - - - - - - -
version:  1.0
access:  public
-
-

- - -
[ Top ]
-
-
- -

method size [line 337]

-
-
-
- integer size( -[string -$loc = 'output']) -
-

- - Get the size of either input or output CSS in KB



-

Tags:

-
- - - - - - - -
version:  1.0
access:  public
-
-

- - -

Parameters:

-
- - - - - - -
string  $loc  default is "output"
-

-
[ Top ]
-
-
- -

method _convert_raw_css [line 244]

-
-
-
- void _convert_raw_css( -) -
-

- - Converts $this->css array to a raw array ($this->tokens)



-

Tags:

-
- - - - - - - -
version:  1.0
access:  private
-
-

- - -
[ Top ]
-
-
- -

method _htmlsp [line 285]

-
-
-
- string _htmlsp( -string -$string, bool -$plain) -
-

- - Same as htmlspecialchars, only that chars are not replaced if $plain !== true. This makes print_code() cleaner.



-

Tags:

-
- - - - - - - - - - -
version:  1.0
access:  private
see:  csstidy_print::_print()
-
-

- - -

Parameters:

-
- - - - - - - - - - - -
string  $string  
bool  $plain  
-

-
[ Top ]
-
-
- -

method _print [line 120]

-
-
-
- void _print( -[bool -$plain = false]) -
-

- - Returns the formatted CSS Code and saves it into $this->output_css and $this->output_css_plain



-

Tags:

-
- - - - - - - -
version:  2.0
access:  private
-
-

- - -

Parameters:

-
- - - - - - -
bool  $plain  plain text or not
-

-
[ Top ]
-
-
- -

method _reset [line 84]

-
-
-
- void _reset( -) -
-

- - Resets output_css and output_css_plain (new css code)



-

Tags:

-
- - - - - - - -
version:  1.0
access:  private
-
-

- - -
[ Top ]
-
-
- -

method _seeknocomment [line 225]

-
-
-
- mixed _seeknocomment( -integer -$key, integer -$move) -
-

- - Gets the next token type which is $move away from $key, excluding comments



-

Tags:

-
- - - - - - - - - - -
return:  a token type
version:  1.0
access:  private
-
-

- - -

Parameters:

-
- - - - - - - - - - - -
integer  $key  current position
integer  $move  move this far
-

-
[ Top ]
-
-

- - -
-
- Documentation generated on Mon, 15 May 2006 22:55:42 +0200 by phpDocumentor 1.3.0RC3 -
-
-
- - - \ No newline at end of file diff --git a/www/plugins-dist/compresseur/lib/csstidy/Docs/elementindex.html b/www/plugins-dist/compresseur/lib/csstidy/Docs/elementindex.html deleted file mode 100644 index a4720e04..00000000 --- a/www/plugins-dist/compresseur/lib/csstidy/Docs/elementindex.html +++ /dev/null @@ -1,386 +0,0 @@ - - -Element Index - - - - - - - - - - - - - -
csstidy
- [ class tree: csstidy ] - [ index: csstidy ] - [ all elements ] -
- - - - - - -
-
- - -

Index of all elements

- [ a ] - [ c ] - [ d ] - [ e ] - [ f ] - [ g ] - [ i ] - [ l ] - [ m ] - [ n ] - [ o ] - [ ] - [ s ] - [ t ] - [ v ] - -
- -
-

a

-
-
$added
-
in file class.csstidy.php, variable csstidy::$added
    =true if something has been added to the current selector
-
$at
-
in file class.csstidy.php, variable csstidy::$at
    Saves the current at rule (@media)
-
AT_END
-
in file data.inc.php, constant AT_END
-
AT_START
-
in file data.inc.php, constant AT_START
-
-
- top
-
- -
-

c

-
-
$charset
-
in file class.csstidy.php, variable csstidy::$charset
    Saves the CSS charset (@charset)
-
$css
-
in file class.csstidy.php, variable csstidy::$css
    Saves the parsed CSS
-
class.csstidy_optimise.php
-
procedural page class.csstidy_optimise.php
-
class.csstidy.php
-
procedural page class.csstidy.php
-
class.csstidy_print.php
-
procedural page class.csstidy_print.php
-
COMMENT
-
in file data.inc.php, constant COMMENT
-
compress_important
-
in file class.csstidy_optimise.php, method csstidy_optimise::compress_important()
    Removes unnecessary whitespace in ! important
-
compress_numbers
-
in file class.csstidy_optimise.php, method csstidy_optimise::compress_numbers()
    Compresses numbers (ie. 1.0 becomes 1 or 1.100 becomes 1.1 )
-
csstidy
-
in file class.csstidy.php, method csstidy::csstidy()
    Loads standard template and sets default settings
-
csstidy
-
in file class.csstidy.php, class csstidy
    CSS Parser class
-
csstidy_optimise
-
in file class.csstidy_optimise.php, class csstidy_optimise
    CSS Optimising Class
-
csstidy_optimise
-
in file class.csstidy_optimise.php, method csstidy_optimise::csstidy_optimise()
    Constructor
-
csstidy_print
-
in file class.csstidy_print.php, method csstidy_print::csstidy_print()
    Constructor
-
csstidy_print
-
in file class.csstidy_print.php, class csstidy_print
    CSS Printing class
-
css_add_property
-
in file class.csstidy.php, method csstidy::css_add_property()
    Adds a property with value to the existing CSS code
-
cut_color
-
in file class.csstidy_optimise.php, method csstidy_optimise::cut_color()
    Color compression function. Converts all rgb() values to #-values and uses the short-form if possible. Also replaces 4 color names by #-values.
-
-
- top
-
- -
-

d

-
-
data.inc.php
-
procedural page data.inc.php
-
DEFAULT_AT
-
in file data.inc.php, constant DEFAULT_AT
-
dissolve_4value_shorthands
-
in file class.csstidy_optimise.php, method csstidy_optimise::dissolve_4value_shorthands()
    Dissolves properties like padding:10px 10px 10px to padding-top:10px;padding-bottom:10px;...
-
dissolve_short_bg
-
in file class.csstidy_optimise.php, method csstidy_optimise::dissolve_short_bg()
    Dissolve background property
-
-
- top
-
- -
-

e

-
-
escaped
-
in file class.csstidy.php, method csstidy::escaped()
    Checks if a character is escaped (and returns true if it is)
-
explode_selectors
-
in file class.csstidy.php, method csstidy::explode_selectors()
    Explodes selectors
-
explode_ws
-
in file class.csstidy_optimise.php, method csstidy_optimise::explode_ws()
    Explodes a string as explode() does, however, not if $sep is escaped or within a string.
-
-
- top
-
- -
-

f

-
-
$from
-
in file class.csstidy.php, variable csstidy::$from
    Status from which the parser switched to ic or instr
-
formatted
-
in file class.csstidy_print.php, method csstidy_print::formatted()
    Returns the formatted CSS code
-
-
- top
-
- -
-

g

-
-
$GLOBALS['csstidy']['all_properties']
-
in file data.inc.php, global variable $GLOBALS['csstidy']['all_properties']
    All CSS Properties. Needed for csstidy::property_is_next()
-
$GLOBALS['csstidy']['at_rules']
-
in file data.inc.php, global variable $GLOBALS['csstidy']['at_rules']
    Available at-rules
-
$GLOBALS['csstidy']['background_prop_default']
-
in file data.inc.php, global variable $GLOBALS['csstidy']['background_prop_default']
    Default values for the background properties
-
$GLOBALS['csstidy']['color_values']
-
in file data.inc.php, global variable $GLOBALS['csstidy']['color_values']
    Properties that allow <color> as value
-
$GLOBALS['csstidy']['number_values']
-
in file data.inc.php, global variable $GLOBALS['csstidy']['number_values']
    Properties that allow <number> as value
-
$GLOBALS['csstidy']['predefined_templates']
-
in file data.inc.php, global variable $GLOBALS['csstidy']['predefined_templates']
    An array containing all predefined templates.
-
$GLOBALS['csstidy']['replace_colors']
-
in file data.inc.php, global variable $GLOBALS['csstidy']['replace_colors']
    A list of non-W3C color names which get replaced by their hex-codes
-
$GLOBALS['csstidy']['shorthands']
-
in file data.inc.php, global variable $GLOBALS['csstidy']['shorthands']
    A list of all shorthand properties that are devided into four properties and/or have four subvalues
-
$GLOBALS['csstidy']['tokens']
-
in file data.inc.php, global variable $GLOBALS['csstidy']['tokens']
    All CSS tokens used by csstidy
-
$GLOBALS['csstidy']['units']
-
in file data.inc.php, global variable $GLOBALS['csstidy']['units']
    All CSS units (CSS 3 units included)
-
$GLOBALS['csstidy']['whitespace']
-
in file data.inc.php, global variable $GLOBALS['csstidy']['whitespace']
    All whitespace allowed in CSS
-
get_cfg
-
in file class.csstidy.php, method csstidy::get_cfg()
    Get the value of a setting.
-
get_diff
-
in file class.csstidy_print.php, method csstidy_print::get_diff()
    Get difference between the old and new code in bytes and prints the code if necessary.
-
get_ratio
-
in file class.csstidy_print.php, method csstidy_print::get_ratio()
    Get compression ratio
-
gvw_important
-
in file class.csstidy.php, method csstidy::gvw_important()
    Returns a value without !important
-
-
- top
-
- -
-

i

-
-
$import
-
in file class.csstidy.php, variable csstidy::$import
    Saves all @import URLs
-
$input_css
-
in file class.csstidy_print.php, variable csstidy_print::$input_css
    Saves the input CSS string
-
$invalid_at
-
in file class.csstidy.php, variable csstidy::$invalid_at
    =true if in invalid at-rule
-
is_important
-
in file class.csstidy.php, method csstidy::is_important()
    Checks if $value is !important.
-
is_token
-
in file class.csstidy.php, method csstidy::is_token()
    Checks if there is a token at the current position
-
-
- top
-
- -
-

l

-
-
$line
-
in file class.csstidy.php, variable csstidy::$line
    Saves the line number
-
$log
-
in file class.csstidy.php, variable csstidy::$log
    Array which saves the message log
-
load_template
-
in file class.csstidy.php, method csstidy::load_template()
    Loads a new template
-
log
-
in file class.csstidy.php, method csstidy::log()
    Add a message to the message log
-
-
- top
-
- -
-

m

-
-
merge_4value_shorthands
-
in file class.csstidy_optimise.php, method csstidy_optimise::merge_4value_shorthands()
    Merges Shorthand properties again, the opposite of dissolve_4value_shorthands()
-
merge_bg
-
in file class.csstidy_optimise.php, method csstidy_optimise::merge_bg()
    Merges all background properties
-
merge_css_blocks
-
in file class.csstidy.php, method csstidy::merge_css_blocks()
    Adds CSS to an existing media/selector
-
merge_selectors
-
in file class.csstidy_optimise.php, method csstidy_optimise::merge_selectors()
    Merges selectors with same properties. Example: a{color:red} b{color:red} -> a,b{color:red} Very basic and has at least one bug. Hopefully there is a replacement soon.
-
-
- top
-
- -
-

n

-
-
$namespace
-
in file class.csstidy.php, variable csstidy::$namespace
    Saves the namespace
-
-
- top
-
- -
-

o

-
-
$optimise
-
in file class.csstidy.php, variable csstidy::$optimise
    Optimiser class
-
$output_css
-
in file class.csstidy_print.php, variable csstidy_print::$output_css
    Saves the formatted CSS string
-
$output_css_plain
-
in file class.csstidy_print.php, variable csstidy_print::$output_css_plain
    Saves the formatted CSS string (plain text)
-
-
- top
-
- -
-

p

-
-
$print
-
in file class.csstidy.php, variable csstidy::$print
    Printer class
-
$property
-
in file class.csstidy.php, variable csstidy::$property
    Saves the current property
-
parse
-
in file class.csstidy.php, method csstidy::parse()
    Parses CSS in $string. The code is saved as array in $this->css
-
parse_from_url
-
in file class.csstidy.php, method csstidy::parse_from_url()
    Starts parsing from URL
-
plain
-
in file class.csstidy_print.php, method csstidy_print::plain()
    Returns the CSS code as plain text
-
postparse
-
in file class.csstidy_optimise.php, method csstidy_optimise::postparse()
    Optimises $css after parsing
-
PROPERTY
-
in file data.inc.php, constant PROPERTY
-
property_is_next
-
in file class.csstidy.php, method csstidy::property_is_next()
    Checks if the next word in a string from pos is a CSS property
-
property_is_valid
-
in file class.csstidy.php, method csstidy::property_is_valid()
    Checks if a property is valid
-
-
- top
-
- -
-

s

-
-
$selector
-
in file class.csstidy.php, variable csstidy::$selector
    Saves the current selector
-
$sel_separate
-
in file class.csstidy.php, variable csstidy::$sel_separate
    Saves the position of , in selectors
-
$settings
-
in file class.csstidy.php, variable csstidy::$settings
    Stores the settings
-
$status
-
in file class.csstidy.php, variable csstidy::$status
    Saves the parser-status.
-
$str_char
-
in file class.csstidy.php, variable csstidy::$str_char
    Saves the char which opened the last string
-
$str_in_str
-
in file class.csstidy.php, variable csstidy::$str_in_str
    Variable needed to manage string-in-strings, for example url("foo.png")
-
$sub_value
-
in file class.csstidy.php, variable csstidy::$sub_value
    Saves the current sub-value
-
$sub_value_arr
-
in file class.csstidy.php, variable csstidy::$sub_value_arr
    Array which saves all subvalues for a property.
-
SEL_END
-
in file data.inc.php, constant SEL_END
-
SEL_START
-
in file data.inc.php, constant SEL_START
-
set_cfg
-
in file class.csstidy.php, method csstidy::set_cfg()
    Set the value of a setting.
-
shorthand
-
in file class.csstidy_optimise.php, method csstidy_optimise::shorthand()
    Compresses shorthand values. Example: margin:1px 1px 1px 1px -> margin:1px
-
shorthands
-
in file class.csstidy_optimise.php, method csstidy_optimise::shorthands()
    Optimises shorthands
-
size
-
in file class.csstidy_print.php, method csstidy_print::size()
    Get the size of either input or output CSS in KB
-
subvalue
-
in file class.csstidy_optimise.php, method csstidy_optimise::subvalue()
    Optimises a sub-value
-
-
- top
-
- -
-

t

-
-
$tokens
-
in file class.csstidy.php, variable csstidy::$tokens
    Saves the parsed CSS (raw)
-
-
- top
-
- -
-

v

-
-
$value
-
in file class.csstidy.php, variable csstidy::$value
    Saves the current value
-
$version
-
in file class.csstidy.php, variable csstidy::$version
    Contains the version of csstidy
-
VALUE
-
in file data.inc.php, constant VALUE
-
value
-
in file class.csstidy_optimise.php, method csstidy_optimise::value()
    Optimises values
-
-
- top
-
- -
-

_

-
-
_add_token
-
in file class.csstidy.php, method csstidy::_add_token()
    Adds a token to $this->tokens
-
_convert_raw_css
-
in file class.csstidy_print.php, method csstidy_print::_convert_raw_css()
    Converts $this->css array to a raw array ($this->tokens)
-
_htmlsp
-
in file class.csstidy_print.php, method csstidy_print::_htmlsp()
    Same as htmlspecialchars, only that chars are not replaced if $plain !== true. This makes print_code() cleaner.
-
_print
-
in file class.csstidy_print.php, method csstidy_print::_print()
    Returns the formatted CSS Code and saves it into $this->output_css and $this->output_css_plain
-
_reset
-
in file class.csstidy_print.php, method csstidy_print::_reset()
    Resets output_css and output_css_plain (new css code)
-
_seeknocomment
-
in file class.csstidy_print.php, method csstidy_print::_seeknocomment()
    Gets the next token type which is $move away from $key, excluding comments
-
_unicode
-
in file class.csstidy.php, method csstidy::_unicode()
    Parse unicode notations and find a replacement character
-
-
- top
-
-
- Documentation generated on Mon, 15 May 2006 22:54:53 +0200 by phpDocumentor 1.3.0RC3 -
-
-
- - - \ No newline at end of file diff --git a/www/plugins-dist/compresseur/lib/csstidy/Docs/elementindex_csstidy.html b/www/plugins-dist/compresseur/lib/csstidy/Docs/elementindex_csstidy.html deleted file mode 100644 index 4afe24b2..00000000 --- a/www/plugins-dist/compresseur/lib/csstidy/Docs/elementindex_csstidy.html +++ /dev/null @@ -1,405 +0,0 @@ - - -Package csstidy Element Index - - - - - - - - - - - - - -
csstidy
- [ class tree: csstidy ] - [ index: csstidy ] - [ all elements ] -
- - - - - - -
-
- - -

Element index for package csstidy

- [ a ] - [ c ] - [ d ] - [ e ] - [ f ] - [ g ] - [ i ] - [ l ] - [ m ] - [ n ] - [ o ] - [ p ] - [ s ] - [ t ] - [ v ] - [ _ ] - -
- -
-

_

-
-
_add_token
-
in file class.csstidy.php, method csstidy::_add_token()
    Adds a token to $this->tokens
-
_convert_raw_css
-
in file class.csstidy_print.php, method csstidy_print::_convert_raw_css()
    Converts $this->css array to a raw array ($this->tokens)
-
_htmlsp
-
in file class.csstidy_print.php, method csstidy_print::_htmlsp()
    Same as htmlspecialchars, only that chars are not replaced if $plain !== true. This makes print_code() cleaner.
-
_print
-
in file class.csstidy_print.php, method csstidy_print::_print()
    Returns the formatted CSS Code and saves it into $this->output_css and $this->output_css_plain
-
_reset
-
in file class.csstidy_print.php, method csstidy_print::_reset()
    Resets output_css and output_css_plain (new css code)
-
_seeknocomment
-
in file class.csstidy_print.php, method csstidy_print::_seeknocomment()
    Gets the next token type which is $move away from $key, excluding comments
-
_unicode
-
in file class.csstidy.php, method csstidy::_unicode()
    Parse unicode notations and find a replacement character
-
-
- top
-
- -
-

a

-
-
$added
-
in file class.csstidy.php, variable csstidy::$added
    =true if something has been added to the current selector
-
$at
-
in file class.csstidy.php, variable csstidy::$at
    Saves the current at rule (@media)
-
AT_END
-
in file data.inc.php, constant AT_END
-
AT_START
-
in file data.inc.php, constant AT_START
-
-
- top
-
- -
-

c

-
-
$charset
-
in file class.csstidy.php, variable csstidy::$charset
    Saves the CSS charset (@charset)
-
$css
-
in file class.csstidy.php, variable csstidy::$css
    Saves the parsed CSS
-
class.csstidy_optimise.php
-
procedural page class.csstidy_optimise.php
-
class.csstidy.php
-
procedural page class.csstidy.php
-
class.csstidy_print.php
-
procedural page class.csstidy_print.php
-
COMMENT
-
in file data.inc.php, constant COMMENT
-
compress_important
-
in file class.csstidy_optimise.php, method csstidy_optimise::compress_important()
    Removes unnecessary whitespace in ! important
-
compress_numbers
-
in file class.csstidy_optimise.php, method csstidy_optimise::compress_numbers()
    Compresses numbers (ie. 1.0 becomes 1 or 1.100 becomes 1.1 )
-
csstidy
-
in file class.csstidy.php, method csstidy::csstidy()
    Loads standard template and sets default settings
-
csstidy
-
in file class.csstidy.php, class csstidy
    CSS Parser class
-
csstidy_optimise
-
in file class.csstidy_optimise.php, class csstidy_optimise
    CSS Optimising Class
-
csstidy_optimise
-
in file class.csstidy_optimise.php, method csstidy_optimise::csstidy_optimise()
    Constructor
-
csstidy_print
-
in file class.csstidy_print.php, method csstidy_print::csstidy_print()
    Constructor
-
csstidy_print
-
in file class.csstidy_print.php, class csstidy_print
    CSS Printing class
-
css_add_property
-
in file class.csstidy.php, method csstidy::css_add_property()
    Adds a property with value to the existing CSS code
-
cut_color
-
in file class.csstidy_optimise.php, method csstidy_optimise::cut_color()
    Color compression function. Converts all rgb() values to #-values and uses the short-form if possible. Also replaces 4 color names by #-values.
-
-
- top
-
- -
-

d

-
-
data.inc.php
-
procedural page data.inc.php
-
DEFAULT_AT
-
in file data.inc.php, constant DEFAULT_AT
-
dissolve_4value_shorthands
-
in file class.csstidy_optimise.php, method csstidy_optimise::dissolve_4value_shorthands()
    Dissolves properties like padding:10px 10px 10px to padding-top:10px;padding-bottom:10px;...
-
dissolve_short_bg
-
in file class.csstidy_optimise.php, method csstidy_optimise::dissolve_short_bg()
    Dissolve background property
-
-
- top
-
- -
-

e

-
-
escaped
-
in file class.csstidy.php, method csstidy::escaped()
    Checks if a character is escaped (and returns true if it is)
-
explode_selectors
-
in file class.csstidy.php, method csstidy::explode_selectors()
    Explodes selectors
-
explode_ws
-
in file class.csstidy_optimise.php, method csstidy_optimise::explode_ws()
    Explodes a string as explode() does, however, not if $sep is escaped or within a string.
-
-
- top
-
- -
-

f

-
-
$from
-
in file class.csstidy.php, variable csstidy::$from
    Status from which the parser switched to ic or instr
-
formatted
-
in file class.csstidy_print.php, method csstidy_print::formatted()
    Returns the formatted CSS code
-
-
- top
-
- -
-

g

-
-
$GLOBALS['csstidy']['all_properties']
-
in file data.inc.php, global variable $GLOBALS['csstidy']['all_properties']
    All CSS Properties. Needed for csstidy::property_is_next()
-
$GLOBALS['csstidy']['at_rules']
-
in file data.inc.php, global variable $GLOBALS['csstidy']['at_rules']
    Available at-rules
-
$GLOBALS['csstidy']['background_prop_default']
-
in file data.inc.php, global variable $GLOBALS['csstidy']['background_prop_default']
    Default values for the background properties
-
$GLOBALS['csstidy']['color_values']
-
in file data.inc.php, global variable $GLOBALS['csstidy']['color_values']
    Properties that allow <color> as value
-
$GLOBALS['csstidy']['number_values']
-
in file data.inc.php, global variable $GLOBALS['csstidy']['number_values']
    Properties that allow <number> as value
-
$GLOBALS['csstidy']['predefined_templates']
-
in file data.inc.php, global variable $GLOBALS['csstidy']['predefined_templates']
    An array containing all predefined templates.
-
$GLOBALS['csstidy']['replace_colors']
-
in file data.inc.php, global variable $GLOBALS['csstidy']['replace_colors']
    A list of non-W3C color names which get replaced by their hex-codes
-
$GLOBALS['csstidy']['shorthands']
-
in file data.inc.php, global variable $GLOBALS['csstidy']['shorthands']
    A list of all shorthand properties that are devided into four properties and/or have four subvalues
-
$GLOBALS['csstidy']['tokens']
-
in file data.inc.php, global variable $GLOBALS['csstidy']['tokens']
    All CSS tokens used by csstidy
-
$GLOBALS['csstidy']['units']
-
in file data.inc.php, global variable $GLOBALS['csstidy']['units']
    All CSS units (CSS 3 units included)
-
$GLOBALS['csstidy']['whitespace']
-
in file data.inc.php, global variable $GLOBALS['csstidy']['whitespace']
    All whitespace allowed in CSS
-
get_cfg
-
in file class.csstidy.php, method csstidy::get_cfg()
    Get the value of a setting.
-
get_diff
-
in file class.csstidy_print.php, method csstidy_print::get_diff()
    Get difference between the old and new code in bytes and prints the code if necessary.
-
get_ratio
-
in file class.csstidy_print.php, method csstidy_print::get_ratio()
    Get compression ratio
-
gvw_important
-
in file class.csstidy.php, method csstidy::gvw_important()
    Returns a value without !important
-
-
- top
-
- -
-

i

-
-
$import
-
in file class.csstidy.php, variable csstidy::$import
    Saves all @import URLs
-
$input_css
-
in file class.csstidy_print.php, variable csstidy_print::$input_css
    Saves the input CSS string
-
$invalid_at
-
in file class.csstidy.php, variable csstidy::$invalid_at
    =true if in invalid at-rule
-
is_important
-
in file class.csstidy.php, method csstidy::is_important()
    Checks if $value is !important.
-
is_token
-
in file class.csstidy.php, method csstidy::is_token()
    Checks if there is a token at the current position
-
-
- top
-
- -
-

l

-
-
$line
-
in file class.csstidy.php, variable csstidy::$line
    Saves the line number
-
$log
-
in file class.csstidy.php, variable csstidy::$log
    Array which saves the message log
-
load_template
-
in file class.csstidy.php, method csstidy::load_template()
    Loads a new template
-
log
-
in file class.csstidy.php, method csstidy::log()
    Add a message to the message log
-
-
- top
-
- -
-

m

-
-
merge_4value_shorthands
-
in file class.csstidy_optimise.php, method csstidy_optimise::merge_4value_shorthands()
    Merges Shorthand properties again, the opposite of dissolve_4value_shorthands()
-
merge_bg
-
in file class.csstidy_optimise.php, method csstidy_optimise::merge_bg()
    Merges all background properties
-
merge_css_blocks
-
in file class.csstidy.php, method csstidy::merge_css_blocks()
    Adds CSS to an existing media/selector
-
merge_selectors
-
in file class.csstidy_optimise.php, method csstidy_optimise::merge_selectors()
    Merges selectors with same properties. Example: a{color:red} b{color:red} -> a,b{color:red} Very basic and has at least one bug. Hopefully there is a replacement soon.
-
-
- top
-
- -
-

n

-
-
$namespace
-
in file class.csstidy.php, variable csstidy::$namespace
    Saves the namespace
-
-
- top
-
- -
-

o

-
-
$optimise
-
in file class.csstidy.php, variable csstidy::$optimise
    Optimiser class
-
$output_css
-
in file class.csstidy_print.php, variable csstidy_print::$output_css
    Saves the formatted CSS string
-
$output_css_plain
-
in file class.csstidy_print.php, variable csstidy_print::$output_css_plain
    Saves the formatted CSS string (plain text)
-
-
- top
-
- -
-

p

-
-
$print
-
in file class.csstidy.php, variable csstidy::$print
    Printer class
-
$property
-
in file class.csstidy.php, variable csstidy::$property
    Saves the current property
-
parse
-
in file class.csstidy.php, method csstidy::parse()
    Parses CSS in $string. The code is saved as array in $this->css
-
parse_from_url
-
in file class.csstidy.php, method csstidy::parse_from_url()
    Starts parsing from URL
-
plain
-
in file class.csstidy_print.php, method csstidy_print::plain()
    Returns the CSS code as plain text
-
postparse
-
in file class.csstidy_optimise.php, method csstidy_optimise::postparse()
    Optimises $css after parsing
-
PROPERTY
-
in file data.inc.php, constant PROPERTY
-
property_is_next
-
in file class.csstidy.php, method csstidy::property_is_next()
    Checks if the next word in a string from pos is a CSS property
-
property_is_valid
-
in file class.csstidy.php, method csstidy::property_is_valid()
    Checks if a property is valid
-
-
- top
-
- -
-

s

-
-
$selector
-
in file class.csstidy.php, variable csstidy::$selector
    Saves the current selector
-
$sel_separate
-
in file class.csstidy.php, variable csstidy::$sel_separate
    Saves the position of , in selectors
-
$settings
-
in file class.csstidy.php, variable csstidy::$settings
    Stores the settings
-
$status
-
in file class.csstidy.php, variable csstidy::$status
    Saves the parser-status.
-
$str_char
-
in file class.csstidy.php, variable csstidy::$str_char
    Saves the char which opened the last string
-
$str_in_str
-
in file class.csstidy.php, variable csstidy::$str_in_str
    Variable needed to manage string-in-strings, for example url("foo.png")
-
$sub_value
-
in file class.csstidy.php, variable csstidy::$sub_value
    Saves the current sub-value
-
$sub_value_arr
-
in file class.csstidy.php, variable csstidy::$sub_value_arr
    Array which saves all subvalues for a property.
-
SEL_END
-
in file data.inc.php, constant SEL_END
-
SEL_START
-
in file data.inc.php, constant SEL_START
-
set_cfg
-
in file class.csstidy.php, method csstidy::set_cfg()
    Set the value of a setting.
-
shorthand
-
in file class.csstidy_optimise.php, method csstidy_optimise::shorthand()
    Compresses shorthand values. Example: margin:1px 1px 1px 1px -> margin:1px
-
shorthands
-
in file class.csstidy_optimise.php, method csstidy_optimise::shorthands()
    Optimises shorthands
-
size
-
in file class.csstidy_print.php, method csstidy_print::size()
    Get the size of either input or output CSS in KB
-
subvalue
-
in file class.csstidy_optimise.php, method csstidy_optimise::subvalue()
    Optimises a sub-value
-
-
- top
-
- -
-

t

-
-
$tokens
-
in file class.csstidy.php, variable csstidy::$tokens
    Saves the parsed CSS (raw)
-
-
- top
-
- -
-

v

-
-
$value
-
in file class.csstidy.php, variable csstidy::$value
    Saves the current value
-
$version
-
in file class.csstidy.php, variable csstidy::$version
    Contains the version of csstidy
-
VALUE
-
in file data.inc.php, constant VALUE
-
value
-
in file class.csstidy_optimise.php, method csstidy_optimise::value()
    Optimises values
-
-
- top
-
-
- Documentation generated on Mon, 15 May 2006 22:54:53 +0200 by phpDocumentor 1.3.0RC3 -
-
-
- - - \ No newline at end of file diff --git a/www/plugins-dist/compresseur/lib/csstidy/Docs/errors.html b/www/plugins-dist/compresseur/lib/csstidy/Docs/errors.html deleted file mode 100644 index 1e6fc99e..00000000 --- a/www/plugins-dist/compresseur/lib/csstidy/Docs/errors.html +++ /dev/null @@ -1,51 +0,0 @@ - - -phpDocumentor Parser Errors and Warnings - - - - - - - - - - - - - -
csstidy
- [ class tree: csstidy ] - [ index: csstidy ] - [ all elements ] -
- - - - - - -
-
- -Post-parsing
- -

data.inc.php

-

Warnings:


-Warning on line 25 - Page-level DocBlock precedes "define AT_START", use another DocBlock to document the source element
-
-
- Documentation generated on Mon, 15 May 2006 22:56:01 +0200 by phpDocumentor 1.3.0RC3 -
-
-
- - - \ No newline at end of file diff --git a/www/plugins-dist/compresseur/lib/csstidy/Docs/index.html b/www/plugins-dist/compresseur/lib/csstidy/Docs/index.html deleted file mode 100644 index c355d441..00000000 --- a/www/plugins-dist/compresseur/lib/csstidy/Docs/index.html +++ /dev/null @@ -1,68 +0,0 @@ - - -CSSTidy Documentation - - - - - - - - - - - - - -
csstidy
- [ class tree: csstidy ] - [ index: csstidy ] - [ all elements ] -
- - - - - - -
-
- -

CSSTidy Documentation

-Welcome to csstidy!
-
-This documentation was generated by phpDocumentor v1.3.0RC3
-
-
- Documentation generated on Mon, 15 May 2006 22:54:54 +0200 by phpDocumentor 1.3.0RC3 -
-
-
- - - \ No newline at end of file diff --git a/www/plugins-dist/compresseur/lib/csstidy/Docs/li_csstidy.html b/www/plugins-dist/compresseur/lib/csstidy/Docs/li_csstidy.html deleted file mode 100644 index 76fbaf7b..00000000 --- a/www/plugins-dist/compresseur/lib/csstidy/Docs/li_csstidy.html +++ /dev/null @@ -1,68 +0,0 @@ - - -CSSTidy Documentation - - - - - - - - - - - - - -
csstidy
- [ class tree: csstidy ] - [ index: csstidy ] - [ all elements ] -
- - - - - - -
-
- -

CSSTidy Documentation

-Welcome to csstidy!
-
-This documentation was generated by phpDocumentor v1.3.0RC3
-
-
- Documentation generated on Mon, 15 May 2006 22:54:53 +0200 by phpDocumentor 1.3.0RC3 -
-
-
- - - \ No newline at end of file diff --git a/www/plugins-dist/compresseur/lib/csstidy/Docs/media/background.png b/www/plugins-dist/compresseur/lib/csstidy/Docs/media/background.png deleted file mode 100644 index d6f36f6068d30005864e49d371606d39dbac3be6..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 238 zcmeAS@N?(olHy`uVBq!ia0vp^CxKXmgBeH)?09($NNJb2MwB=gr6!hS=I1GdWag$a zl;L41_usi$G7`mY9E|l(K3^3(}Yz5wYCnP1)Tp+R!$e1@pO+j=b55= cOIuv|iyatv1txKu0`)U^y85}Sb4q9e01EU+A^-pY diff --git a/www/plugins-dist/compresseur/lib/csstidy/Docs/media/empty.png b/www/plugins-dist/compresseur/lib/csstidy/Docs/media/empty.png deleted file mode 100644 index a9f29bb161a7b1efd9cc85043bc235e1a5060780..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 206 zcmeAS@N?(olHy`uVBq!ia0vp^j3CUx3?wy9o9qTs+9j?LCC){ui6xo&c?uz!xv320 z`3gqn3VHcu3PuJ7Mhb>zR)*$Q#>NWT28IR({)IOifZEtgJbhi+FL6ur3u;#0rMq>1fPyUPj=qiz3>*8o|0J>k`OE=6A+G=b|6hJY`UH^6SQ6wH o%;50sMjDXA<>}%WQgJIe0mx=zV0@~64`c#^r>mdKI;Vst04^Iepa1{> diff --git a/www/plugins-dist/compresseur/lib/csstidy/Docs/media/style.css b/www/plugins-dist/compresseur/lib/csstidy/Docs/media/style.css deleted file mode 100644 index 9419ca62..00000000 --- a/www/plugins-dist/compresseur/lib/csstidy/Docs/media/style.css +++ /dev/null @@ -1,197 +0,0 @@ -.php { - padding: 1em; -} -/* This will not be executed by IE, so now we have a fix! */ -*[class="php-src"], *[class="php"], *[class="listing"] { - line-height: 0px; -} - -body -{ - color: #000000; - background-color: #ffffff; - background-image: url("background.png"); - background-repeat: repeat-y; - font-family: tahoma, verdana, arial, sans-serif; - font-size: 10pt; - margin: 0; - padding: 0; -} - -a -{ - color: #000099; - background-color: transparent; - text-decoration: none; -} - -a:hover -{ - text-decoration: underline; -} - -a.menu -{ - color: #ffffff; - background-color: transparent; -} - -td -{ - font-size: 10pt; -} - -td.header_top -{ - color: #ffffff; - background-color: #9999cc; - font-size: 16pt; - font-weight: bold; - text-align: right; - padding: 10px; -} - -td.header_line -{ - color: #ffffff; - background-color: #333366; -} - -td.header_menu -{ - color: #ffffff; - background-color: #666699; - font-size: 8pt; - text-align: right; - padding: 2px; - padding-right: 5px; -} - -td.menu -{ - padding: 2px; - padding-left: 5px; -} - -td.code_border -{ - color: #000000; - background-color: #c0c0c0; -} - -td.code -{ - color: #000000; - background-color: #f0f0f0; -} - -td.type -{ - font-style: italic; -} - -div.credit -{ - font-size: 8pt; - text-align: center; -} - -div.package -{ - padding-left: 5px; -} - -div.tags -{ - padding-left: 15px; -} - -div.function -{ - padding-left: 15px; -} - -div.top -{ - font-size: 8pt; -} - -div.warning -{ - color: #ff0000; - background-color: transparent; -} - -div.description -{ - padding-left: 15px; -} - -hr -{ - height: 1px; - border-style: solid; - border-color: #c0c0c0; - margin-top: 10px; - margin-bottom: 10px; -} - -span.smalllinenumber -{ - font-size: 8pt; -} - -ul { - margin-left: 0px; - padding-left: 8px; -} -/* Syntax highlighting */ - -.src-code { background-color: #f5f5f5; border: 1px solid #ccc9a4; padding: 0px; margin : 0px} -/*.src-code pre { }*/ - -.src-comm { color: green; } -.src-id { } -.src-inc { color: #0000FF; } -.src-key { color: #0000FF; } -.src-num { color: #CC0000; } -.src-str { color: #66cccc; } -.src-sym { font-weight: bold; } -.src-var { } - -.src-php { font-weight: bold; } - -.src-doc { color: #009999 } -.src-doc-close-template { color: #0000FF } -.src-doc-coretag { color: #0099FF; font-weight: bold } -.src-doc-inlinetag { color: #0099FF } -.src-doc-internal { color: #6699cc } -.src-doc-tag { color: #0080CC } -.src-doc-template { color: #0000FF } -.src-doc-type { font-style: italic } -.src-doc-var { font-style: italic } - -.tute-tag { color: #009999 } -.tute-attribute-name { color: #0000FF } -.tute-attribute-value { color: #0099FF } -.tute-entity { font-weight: bold; } -.tute-comment { font-style: italic } -.tute-inline-tag { color: #636311; font-weight: bold } - -/* tutorial */ - -.authors { } -.author { font-style: italic; font-weight: bold } -.author-blurb { margin: .5em 0em .5em 2em; font-size: 85%; font-weight: normal; font-style: normal } -.example { border: 1px dashed #999999; background-color: #EEEEEE; padding: .5em; } -.listing { border: 1px dashed #999999; background-color: #EEEEEE; padding: .5em; white-space: nowrap; } -.release-info { font-size: 85%; font-style: italic; margin: 1em 0em } -.ref-title-box { } -.ref-title { } -.ref-purpose { font-style: italic; color: #666666 } -.ref-synopsis { } -.title { font-weight: bold; margin: 1em 0em 0em 0em; padding: .25em; border: 2px solid #999999; background-color: #9999CC } -.cmd-synopsis { margin: 1em 0em } -.cmd-title { font-weight: bold } -.toc { margin-left: 2em; padding-left: 0em } - diff --git a/www/plugins-dist/compresseur/lib/csstidy/Docs/todolist.html b/www/plugins-dist/compresseur/lib/csstidy/Docs/todolist.html deleted file mode 100644 index 2c02a787..00000000 --- a/www/plugins-dist/compresseur/lib/csstidy/Docs/todolist.html +++ /dev/null @@ -1,77 +0,0 @@ - - -Todo List - - - - - - - - - - - - - -
csstidy
- [ class tree: csstidy ] - [ index: csstidy ] - [ all elements ] -
- - - - - - -
-
- -

Todo List

-

csstidy

-

$GLOBALS['csstidy']['all_properties']

-
    -
  • Add CSS3 properties
  • -
-

$GLOBALS['csstidy']['background_prop_default']

-
    -
  • Possibly property names will change during CSS3 development
  • -
-

$GLOBALS['csstidy']['color_values']

-
    -
  • CSS3 properties
  • -
-

$GLOBALS['csstidy']['number_values']

-
    -
  • CSS3 properties
  • -
-

$GLOBALS['csstidy']['shorthands']

-
    -
  • Are there new ones in CSS3?
  • -
-

csstidy_optimise::dissolve_short_bg()

-
    -
  • full CSS 3 compliance
  • -
-

csstidy_optimise::merge_bg()

-
    -
  • full CSS 3 compliance
  • -
-
-
- Documentation generated on Mon, 15 May 2006 22:56:01 +0200 by phpDocumentor 1.3.0RC3 -
-
-
- - - \ No newline at end of file diff --git a/www/plugins-dist/compresseur/lib/csstidy/README b/www/plugins-dist/compresseur/lib/csstidy/README index 17cf0f7d..9c904999 100644 --- a/www/plugins-dist/compresseur/lib/csstidy/README +++ b/www/plugins-dist/compresseur/lib/csstidy/README @@ -2,13 +2,17 @@ CSSTidy --- CSSTidy is a CSS minifier -Since the original project (http://csstidy.sourceforge.net/index.php) has been suspended -here is the import of https://csstidy.svn.sourceforge.net/svnroot/csstidy on 2010-11-14 + +v1.5.2 + is PHP 5.4+ compliant, removes use of GLOBALS, fixes some bugs, integrates CSS3 units + and now available on https://packagist.org/packages/cerdic/css-tidy v1.4 is the new version coming from master branch (corresponds to the initial trunk of svn repository) after beeing stabilized v1.3 branch corresponds to the last stable relase published by the author. It integrates some bugfixes and a 1.3.1 version has been taged +Since the original project (http://csstidy.sourceforge.net/index.php) has been suspended +here is the import of https://csstidy.svn.sourceforge.net/svnroot/csstidy on 2010-11-14 Only PHP version is here maintained diff --git a/www/plugins-dist/compresseur/lib/csstidy/class.csstidy.php b/www/plugins-dist/compresseur/lib/csstidy/class.csstidy.php index 8cfd7e6a..29b84790 100644 --- a/www/plugins-dist/compresseur/lib/csstidy/class.csstidy.php +++ b/www/plugins-dist/compresseur/lib/csstidy/class.csstidy.php @@ -29,20 +29,41 @@ * @author Nikolay Matsievsky (speed at webo dot name) 2009-2010 * @author Cedric Morin (cedric at yterium dot com) 2010-2012 * @author Christopher Finke (cfinke at gmail.com) 2012 + * @author Mark Scherer (remove $GLOBALS once and for all + PHP5.4 comp) 2012 */ + /** * Defines ctype functions if required - * + * @todo make them methods of csstidy class * @version 1.0 */ -require_once('class.csstidy_ctype.php'); +if (!function_exists('ctype_space')) { + /* ctype_space Check for whitespace character(s) */ + function ctype_space($text) { + return!preg_match("/[^\s\r\n\t\f]/", $text); + } + +} +if (!function_exists('ctype_alpha')) { + /* ctype_alpha Check for alphabetic character(s) */ + function ctype_alpha($text) { + return preg_match("/[a-zA-Z]/", $text); + } + +} /** - * Various CSS data needed for correct optimisations etc. - * - * @version 1.3 + * Defines constants + * @todo //TODO: make them class constants of csstidy */ -require('data.inc.php'); +define('AT_START', 1); +define('AT_END', 2); +define('SEL_START', 3); +define('SEL_END', 4); +define('PROPERTY', 5); +define('VALUE', 6); +define('COMMENT', 7); +define('DEFAULT_AT', 41); /** * Contains a class for printing CSS code @@ -61,7 +82,6 @@ require('class.csstidy_optimise.php'); /** * CSS Parser class * - * This class represents a CSS parser which reads CSS code and saves it in an array. * In opposite to most other CSS parsers, it does not use regular expressions and * thus has full CSS2 support and a higher reliability. @@ -69,7 +89,7 @@ require('class.csstidy_optimise.php'); * An online version should be available here: http://cdburnerxp.se/cssparse/css_optimiser.php * @package csstidy * @author Florian Schmitz (floele at gmail dot com) 2005-2006 - * @version 1.4.0 + * @version 1.5.2 */ class csstidy { @@ -78,57 +98,57 @@ class csstidy { * @var array * @access public */ - var $css = array(); + public $css = array(); /** * Saves the parsed CSS (raw) * @var array * @access private */ - var $tokens = array(); + public $tokens = array(); /** * Printer class * @see csstidy_print * @var object * @access public */ - var $print; + public $print; /** * Optimiser class * @see csstidy_optimise * @var object * @access private */ - var $optimise; + public $optimise; /** * Saves the CSS charset (@charset) * @var string * @access private */ - var $charset = ''; + public $charset = ''; /** * Saves all @import URLs * @var array * @access private */ - var $import = array(); + public $import = array(); /** * Saves the namespace * @var string * @access private */ - var $namespace = ''; + public $namespace = ''; /** * Contains the version of csstidy * @var string * @access private */ - var $version = '1.3'; + public $version = '1.5.2'; /** * Stores the settings * @var array * @access private */ - var $settings = array(); + public $settings = array(); /** * Saves the parser-status. * @@ -143,44 +163,44 @@ class csstidy { * @var string * @access private */ - var $status = 'is'; + public $status = 'is'; /** * Saves the current at rule (@media) * @var string * @access private */ - var $at = ''; + public $at = ''; /** * Saves the at rule for next selector (during @font-face or other @) * @var string * @access private */ - var $next_selector_at = ''; + public $next_selector_at = ''; /** * Saves the current selector * @var string * @access private */ - var $selector = ''; + public $selector = ''; /** * Saves the current property * @var string * @access private */ - var $property = ''; + public $property = ''; /** * Saves the position of , in selectors * @var array * @access private */ - var $sel_separate = array(); + public $sel_separate = array(); /** * Saves the current value * @var string * @access private */ - var $value = ''; + public $value = ''; /** * Saves the current sub-value * @@ -191,78 +211,89 @@ class csstidy { * @var string * @access private */ - var $sub_value = ''; + public $sub_value = ''; /** * Array which saves all subvalues for a property. * @var array * @see sub_value * @access private */ - var $sub_value_arr = array(); + public $sub_value_arr = array(); /** * Saves the stack of characters that opened the current strings * @var array * @access private */ - var $str_char = array(); - var $cur_string = array(); + public $str_char = array(); + public $cur_string = array(); /** * Status from which the parser switched to ic or instr * @var array * @access private */ - var $from = array(); + public $from = array(); /** /** * =true if in invalid at-rule * @var bool * @access private */ - var $invalid_at = false; + public $invalid_at = false; /** * =true if something has been added to the current selector * @var bool * @access private */ - var $added = false; + public $added = false; /** * Array which saves the message log * @var array * @access private */ - var $log = array(); + public $log = array(); /** * Saves the line number * @var integer * @access private */ - var $line = 1; + public $line = 1; /** * Marks if we need to leave quotes for a string * @var array * @access private */ - var $quoted_string = array(); + public $quoted_string = array(); /** * List of tokens * @var string */ - var $tokens_list = ""; + public $tokens_list = ""; + + /** + * Various CSS Data for CSSTidy + * @var array + */ + public $data = array(); + /** * Loads standard template and sets default settings * @access private * @version 1.3 */ - function csstidy() { + public function __construct() { + $data = array(); + include('data.inc.php'); + $this->data = $data; + $this->settings['remove_bslash'] = true; $this->settings['compress_colors'] = true; $this->settings['compress_font-weight'] = true; $this->settings['lowercase_s'] = false; /* - 1 common shorthands optimization - 2 + font property optimization - 3 + background property optimization + 1 common shorthands optimization + 2 + font property optimization + 3 + background property optimization */ $this->settings['optimise_shorthands'] = 1; $this->settings['remove_last_;'] = true; @@ -273,9 +304,9 @@ class csstidy { */ $this->settings['sort_properties'] = false; /* - 1, 3, 5, etc -- enable sorting selectors inside @media: a{}b{}c{} - 2, 5, 8, etc -- enable sorting selectors inside one CSS declaration: a,b,c{} - preserve order by default cause it can break functionnality + 1, 3, 5, etc -- enable sorting selectors inside @media: a{}b{}c{} + 2, 5, 8, etc -- enable sorting selectors inside one CSS declaration: a,b,c{} + preserve order by default cause it can break functionnality */ $this->settings['sort_selectors'] = 0; /* is dangeroues to be used: CSS is broken sometimes */ @@ -290,7 +321,7 @@ class csstidy { $this->set_cfg('template','default'); // call load_template $this->optimise = new csstidy_optimise($this); - $this->tokens_list = & $GLOBALS['csstidy']['tokens']; + $this->tokens_list = & $this->data['csstidy']['tokens']; } /** @@ -300,7 +331,7 @@ class csstidy { * @return mixed * @version 1.0 */ - function get_cfg($setting) { + public function get_cfg($setting) { if (isset($this->settings[$setting])) { return $this->settings[$setting]; } @@ -313,7 +344,7 @@ class csstidy { * @access private * @version 1.4 */ - function _load_template($template) { + public function _load_template($template) { switch ($template) { case 'default': $this->load_template('default'); @@ -345,7 +376,7 @@ class csstidy { * @return bool * @version 1.0 */ - function set_cfg($setting, $value=null) { + public function set_cfg($setting, $value=null) { if (is_array($setting) && $value === null) { foreach ($setting as $setprop => $setval) { $this->settings[$setprop] = $setval; @@ -354,7 +385,7 @@ class csstidy { $this->_load_template($this->settings['template']); } return true; - } else if (isset($this->settings[$setting]) && $value !== '') { + } elseif (isset($this->settings[$setting]) && $value !== '') { $this->settings[$setting] = $value; if ($setting === 'template') { $this->_load_template($this->settings['template']); @@ -372,7 +403,7 @@ class csstidy { * @access private * @version 1.0 */ - function _add_token($type, $data, $do = false) { + public function _add_token($type, $data, $do = false) { if ($this->get_cfg('preserve_css') || $do) { $this->tokens[] = array($type, ($type == COMMENT) ? $data : trim($data)); } @@ -386,7 +417,7 @@ class csstidy { * @access private * @version 1.0 */ - function log($message, $type, $line = -1) { + public function log($message, $type, $line = -1) { if ($line === -1) { $line = $this->line; } @@ -405,7 +436,7 @@ class csstidy { * @return string * @version 1.2 */ - function _unicode(&$string, &$i) { + public function _unicode(&$string, &$i) { ++$i; $add = ''; $replaced = false; @@ -452,7 +483,7 @@ class csstidy { * @access public * @version 1.4 */ - function write_page($filename, $doctype='xhtml1.1', $externalcss=true, $title='', $lang='en') { + public function write_page($filename, $doctype='xhtml1.1', $externalcss=true, $title='', $lang='en') { $this->write($filename, true); } @@ -468,7 +499,7 @@ class csstidy { * @access public * @version 1.4 */ - function write($filename, $formatted=false, $doctype='xhtml1.1', $externalcss=true, $title='', $lang='en', $pre_code=true) { + public function write($filename, $formatted=false, $doctype='xhtml1.1', $externalcss=true, $title='', $lang='en', $pre_code=true) { $filename .= ( $formatted) ? '.xhtml' : '.css'; if (!is_dir('temp')) { @@ -497,8 +528,8 @@ class csstidy { * @version 1.1 * @see http://csstidy.sourceforge.net/templates.php */ - function load_template($content, $from_file=true) { - $predefined_templates = & $GLOBALS['csstidy']['predefined_templates']; + public function load_template($content, $from_file=true) { + $predefined_templates = & $this->data['csstidy']['predefined_templates']; if ($content === 'high_compression' || $content === 'default' || $content === 'highest_compression' || $content === 'low_compression') { $this->template = $predefined_templates[$content]; return; @@ -522,7 +553,7 @@ class csstidy { * @access public * @version 1.0 */ - function parse_from_url($url) { + public function parse_from_url($url) { return $this->parse(@file_get_contents($url)); } @@ -533,8 +564,8 @@ class csstidy { * @access public * @version 1.11 */ - function is_token(&$string, $i) { - return (strpos($this->tokens_list, $string{$i}) !== false && !csstidy::escaped($string, $i)); + public function is_token(&$string, $i) { + return (strpos($this->tokens_list, $string{$i}) !== false && !$this->escaped($string, $i)); } /** @@ -544,7 +575,7 @@ class csstidy { * @return bool * @version 1.1 */ - function parse($string) { + public function parse($string) { // Temporarily set locale to en_US in order to handle floats properly $old = @setlocale(LC_ALL, 0); @setlocale(LC_ALL, 'C'); @@ -553,9 +584,9 @@ class csstidy { $this->print = new csstidy_print($this); $this->optimise = new csstidy_optimise($this); - $all_properties = & $GLOBALS['csstidy']['all_properties']; - $at_rules = & $GLOBALS['csstidy']['at_rules']; - $quoted_string_properties = & $GLOBALS['csstidy']['quoted_string_properties']; + $all_properties = & $this->data['csstidy']['all_properties']; + $at_rules = & $this->data['csstidy']['at_rules']; + $quoted_string_properties = & $this->data['csstidy']['quoted_string_properties']; $this->css = array(); $this->print->input_css = $string; @@ -570,7 +601,7 @@ class csstidy { switch ($this->status) { /* Case in at-block */ case 'at': - if (csstidy::is_token($string, $i)) { + if ($this->is_token($string, $i)) { if ($string{$i} === '/' && @$string{$i + 1} === '*') { $this->status = 'ic'; ++$i; @@ -590,7 +621,7 @@ class csstidy { } } else { $lastpos = strlen($this->at) - 1; - if (!( (ctype_space($this->at{$lastpos}) || csstidy::is_token($this->at, $lastpos) && $this->at{$lastpos} === ',') && ctype_space($string{$i}))) { + if (!( (ctype_space($this->at{$lastpos}) || $this->is_token($this->at, $lastpos) && $this->at{$lastpos} === ',') && ctype_space($string{$i}))) { $this->at .= $string{$i}; } } @@ -598,7 +629,7 @@ class csstidy { /* Case in-selector */ case 'is': - if (csstidy::is_token($string, $i)) { + if ($this->is_token($string, $i)) { if ($string{$i} === '/' && @$string{$i + 1} === '*' && trim($this->selector) == '') { $this->status = 'ic'; ++$i; @@ -609,10 +640,10 @@ class csstidy { foreach ($at_rules as $name => $type) { if (!strcasecmp(substr($string, $i + 1, strlen($name)), $name)) { ($type === 'at') ? $this->at = '@' . $name : $this->selector = '@' . $name; - if ($type === "atis"){ + if ($type === 'atis') { $this->next_selector_at = ($this->next_selector_at?$this->next_selector_at:($this->at?$this->at:DEFAULT_AT)); $this->at = $this->css_new_media_section(' '); - $type = "is"; + $type = 'is'; } $this->status = $type; $i += strlen($name); @@ -637,17 +668,17 @@ class csstidy { $this->str_char[] = $string{$i}; $this->from[] = 'is'; /* fixing CSS3 attribute selectors, i.e. a[href$=".mp3" */ - $this->quoted_string[] = ($string{$i - 1} == '=' ); + $this->quoted_string[] = ($string{$i - 1} === '=' ); } elseif ($this->invalid_at && $string{$i} === ';') { $this->invalid_at = false; $this->status = 'is'; - if($this->next_selector_at){ + if ($this->next_selector_at) { $this->at = $this->css_new_media_section($this->next_selector_at); $this->next_selector_at = ''; } } elseif ($string{$i} === '{') { $this->status = 'ip'; - if($this->at == '') { + if ($this->at == '') { $this->at = $this->css_new_media_section(DEFAULT_AT); } $this->selector = $this->css_new_selector($this->at,$this->selector); @@ -670,7 +701,7 @@ class csstidy { } } else { $lastpos = strlen($this->selector) - 1; - if ($lastpos == -1 || !( (ctype_space($this->selector{$lastpos}) || csstidy::is_token($this->selector, $lastpos) && $this->selector{$lastpos} === ',') && ctype_space($string{$i}))) { + if ($lastpos == -1 || !( (ctype_space($this->selector{$lastpos}) || $this->is_token($this->selector, $lastpos) && $this->selector{$lastpos} === ',') && ctype_space($string{$i}))) { $this->selector .= $string{$i}; } } @@ -678,10 +709,10 @@ class csstidy { /* Case in-property */ case 'ip': - if (csstidy::is_token($string, $i)) { + if ($this->is_token($string, $i)) { if (($string{$i} === ':' || $string{$i} === '=') && $this->property != '') { $this->status = 'iv'; - if (!$this->get_cfg('discard_invalid_properties') || csstidy::property_is_valid($this->property)) { + if (!$this->get_cfg('discard_invalid_properties') || $this->property_is_valid($this->property)) { $this->property = $this->css_new_property($this->at,$this->selector,$this->property); $this->_add_token(PROPERTY, $this->property); } @@ -696,7 +727,7 @@ class csstidy { $this->_add_token(SEL_END, $this->selector); $this->selector = ''; $this->property = ''; - if($this->next_selector_at){ + if ($this->next_selector_at) { $this->at = $this->css_new_media_section($this->next_selector_at); $this->next_selector_at = ''; } @@ -707,12 +738,11 @@ class csstidy { } // else this is dumb IE a hack, keep it // including // - elseif (($this->property=='' AND !ctype_space($string{$i})) - OR ($this->property=='/' OR $string{$i}=="/")) { + elseif (($this->property === '' && !ctype_space($string{$i})) + || ($this->property === '/' || $string{$i} === '/')) { $this->property .= $string{$i}; } - } - elseif (!ctype_space($string{$i})) { + } elseif (!ctype_space($string{$i})) { $this->property .= $string{$i}; } break; @@ -720,7 +750,7 @@ class csstidy { /* Case in-value */ case 'iv': $pn = (($string{$i} === "\n" || $string{$i} === "\r") && $this->property_is_next($string, $i + 1) || $i == strlen($string) - 1); - if (csstidy::is_token($string, $i) || $pn) { + if ($this->is_token($string, $i) || $pn) { if ($string{$i} === '/' && @$string{$i + 1} === '*') { $this->status = 'ic'; ++$i; @@ -762,7 +792,7 @@ class csstidy { $this->sub_value .= $string{$i}; } if (($string{$i} === '}' || $string{$i} === ';' || $pn) && !empty($this->selector)) { - if($this->at == ''){ + if ($this->at == '') { $this->at = $this->css_new_media_section(DEFAULT_AT); } @@ -779,19 +809,19 @@ class csstidy { } $this->value = ''; - while(count($this->sub_value_arr)){ + while (count($this->sub_value_arr)) { $sub = array_shift($this->sub_value_arr); - if (strstr($this->selector, "font-face")){ + if (strstr($this->selector, 'font-face')) { $sub = $this->quote_font_format($sub); } if ($sub != '') - $this->value .= ((!strlen($this->value) OR substr($this->value,-1,1)==',')?'':' ').$sub; + $this->value .= ((!strlen($this->value) || substr($this->value,-1,1) === ',')?'':' ').$sub; } $this->optimise->value(); - $valid = csstidy::property_is_valid($this->property); + $valid = $this->property_is_valid($this->property); if ((!$this->invalid_at || $this->get_cfg('preserve_css')) && (!$this->get_cfg('discard_invalid_properties') || $valid)) { $this->css_add_property($this->at, $this->selector, $this->property, $this->value); $this->_add_token(VALUE, $this->value); @@ -815,7 +845,7 @@ class csstidy { $this->status = 'is'; $this->invalid_at = false; $this->selector = ''; - if($this->next_selector_at){ + if ($this->next_selector_at) { $this->at = $this->css_new_media_section($this->next_selector_at); $this->next_selector_at = ''; } @@ -840,27 +870,27 @@ class csstidy { $_quoted_string = $this->quoted_string[count($this->quoted_string)-1]; $temp_add = $string{$i}; - // Add another string to the stack. Strings can't be nested inside of quotes, only parentheses, but + // Add another string to the stack. Strings can't be nested inside of quotes, only parentheses, but // parentheticals can be nested more than once. - if ($_str_char === ")" && ($string{$i} === "(" || $string{$i} === '"' || $string{$i} === '\'') && !csstidy::escaped($string, $i)) { + if ($_str_char === ")" && ($string{$i} === "(" || $string{$i} === '"' || $string{$i} === '\'') && !$this->escaped($string, $i)) { $this->cur_string[] = $string{$i}; - $this->str_char[] = $string{$i} == "(" ? ")" : $string{$i}; + $this->str_char[] = $string{$i} === '(' ? ')' : $string{$i}; $this->from[] = 'instr'; - $this->quoted_string[] = ($_str_char === ")" AND $string{$i} !== "(" AND trim($_cur_string)=="(")?$_quoted_string:!($string{$i} === "("); + $this->quoted_string[] = ($_str_char === ')' && $string{$i} !== '(' && trim($_cur_string)==='(')?$_quoted_string:!($string{$i} === '('); continue; } - if ($_str_char !== ")" && ($string{$i} === "\n" || $string{$i} === "\r") && !($string{$i - 1} === '\\' && !csstidy::escaped($string, $i - 1))) { + if ($_str_char !== ")" && ($string{$i} === "\n" || $string{$i} === "\r") && !($string{$i - 1} === '\\' && !$this->escaped($string, $i - 1))) { $temp_add = "\\A"; $this->log('Fixed incorrect newline in string', 'Warning'); } $_cur_string .= $temp_add; - if ($string{$i} === $_str_char && !csstidy::escaped($string, $i)) { + if ($string{$i} === $_str_char && !$this->escaped($string, $i)) { $this->status = array_pop($this->from); - if (!preg_match('|[' . implode('', $GLOBALS['csstidy']['whitespace']) . ']|uis', $_cur_string) && $this->property !== 'content') { + if (!preg_match('|[' . implode('', $this->data['csstidy']['whitespace']) . ']|uis', $_cur_string) && $this->property !== 'content') { if (!$_quoted_string) { if ($_str_char !== ')') { // Convert properties like @@ -882,18 +912,18 @@ class csstidy { array_pop($this->quoted_string); array_pop($this->str_char); - if ($_str_char === ")") { - $_cur_string = "(" . trim(substr($_cur_string, 1, -1)) . ")"; + if ($_str_char === ')') { + $_cur_string = '(' . trim(substr($_cur_string, 1, -1)) . ')'; } if ($this->status === 'iv') { - if (!$_quoted_string){ - if (strpos($_cur_string,',')!==false) + if (!$_quoted_string) { + if (strpos($_cur_string,',') !== false) // we can on only remove space next to ',' - $_cur_string = implode(',',array_map('trim',explode(',',$_cur_string))); + $_cur_string = implode(',', array_map('trim', explode(',',$_cur_string))); // and multiple spaces (too expensive) - if (strpos($_cur_string,' ')!==false) - $_cur_string = preg_replace(",\s+,"," ",$_cur_string); + if (strpos($_cur_string, ' ') !== false) + $_cur_string = preg_replace(",\s+,", ' ', $_cur_string); } $this->sub_value .= $_cur_string; } elseif ($this->status === 'is') { @@ -901,8 +931,7 @@ class csstidy { } elseif ($this->status === 'instr') { $this->cur_string[count($this->cur_string)-1] .= $_cur_string; } - } - else { + } else { $this->cur_string[count($this->cur_string)-1] = $_cur_string; } break; @@ -937,16 +966,15 @@ class csstidy { * @param $value * @return string */ - function quote_font_format($value){ - if (strncmp($value,'format',6)==0) { - $p = strrpos($value,")"); + public function quote_font_format($value) { + if (strncmp($value,'format',6) == 0) { + $p = strpos($value,')',7); $end = substr($value,$p); - $format_strings = csstidy::parse_string_list(substr($value, 7, $p-7)); + $format_strings = $this->parse_string_list(substr($value, 7, $p-7)); if (!$format_strings) { - $value = ""; - } - else { - $value = "format("; + $value = ''; + } else { + $value = 'format('; foreach ($format_strings as $format_string) { $value .= '"' . str_replace('"', '\\"', $format_string) . '",'; @@ -963,7 +991,7 @@ class csstidy { * @access private * @version 1.0 */ - function explode_selectors() { + public function explode_selectors() { // Explode multiple selectors if ($this->get_cfg('merge_selectors') === 1) { $new_sels = array(); @@ -1011,14 +1039,14 @@ class csstidy { * @access private * @version 1.2 */ - function css_add_property($media, $selector, $property, $new_val) { + public function css_add_property($media, $selector, $property, $new_val) { if ($this->get_cfg('preserve_css') || trim($new_val) == '') { return; } $this->added = true; if (isset($this->css[$media][$selector][$property])) { - if ((csstidy::is_important($this->css[$media][$selector][$property]) && csstidy::is_important($new_val)) || !csstidy::is_important($this->css[$media][$selector][$property])) { + if (($this->is_important($this->css[$media][$selector][$property]) && $this->is_important($new_val)) || !$this->is_important($this->css[$media][$selector][$property])) { $this->css[$media][$selector][$property] = trim($new_val); } } else { @@ -1035,26 +1063,26 @@ class csstidy { * @param string $media * @return string */ - function css_new_media_section($media){ - if($this->get_cfg('preserve_css')) { + public function css_new_media_section($media) { + if ($this->get_cfg('preserve_css')) { return $media; } // if the last @media is the same as this // keep it - if (!$this->css OR !is_array($this->css) OR empty($this->css)){ + if (!$this->css || !is_array($this->css) || empty($this->css)) { return $media; } end($this->css); list($at,) = each($this->css); - if ($at == $media){ + if ($at == $media) { return $media; } while (isset($this->css[$media])) if (is_numeric($media)) $media++; else - $media .= " "; + $media .= ' '; return $media; } @@ -1071,28 +1099,28 @@ class csstidy { * @param string $selector * @return string */ - function css_new_selector($media,$selector){ - if($this->get_cfg('preserve_css')) { + public function css_new_selector($media,$selector) { + if ($this->get_cfg('preserve_css')) { return $selector; } $selector = trim($selector); - if (strncmp($selector,"@font-face",10)!=0){ + if (strncmp($selector,'@font-face',10)!=0) { if ($this->settings['merge_selectors'] != false) return $selector; - if (!$this->css OR !isset($this->css[$media]) OR !$this->css[$media]) + if (!$this->css || !isset($this->css[$media]) || !$this->css[$media]) return $selector; // if last is the same, keep it end($this->css[$media]); list($sel,) = each($this->css[$media]); - if ($sel == $selector){ + if ($sel == $selector) { return $selector; } } while (isset($this->css[$media][$selector])) - $selector .= " "; + $selector .= ' '; return $selector; } @@ -1106,15 +1134,15 @@ class csstidy { * @param string $property * @return string */ - function css_new_property($media, $selector, $property){ - if($this->get_cfg('preserve_css')) { + public function css_new_property($media, $selector, $property) { + if ($this->get_cfg('preserve_css')) { return $property; } - if (!$this->css OR !isset($this->css[$media][$selector]) OR !$this->css[$media][$selector]) + if (!$this->css || !isset($this->css[$media][$selector]) || !$this->css[$media][$selector]) return $property; while (isset($this->css[$media][$selector][$property])) - $property .= " "; + $property .= ' '; return $property; } @@ -1127,7 +1155,7 @@ class csstidy { * @access private * @version 1.1 */ - function merge_css_blocks($media, $selector, $css_add) { + public function merge_css_blocks($media, $selector, $css_add) { foreach ($css_add as $property => $value) { $this->css_add_property($media, $selector, $property, $value, false); } @@ -1140,10 +1168,10 @@ class csstidy { * @access public * @version 1.0 */ - static function is_important(&$value) { + public function is_important(&$value) { return ( - strpos($value,"!")!==false // quick test - AND !strcasecmp(substr(str_replace($GLOBALS['csstidy']['whitespace'], '', $value), -10, 10), '!important')); + strpos($value, '!') !== false // quick test + AND !strcasecmp(substr(str_replace($this->data['csstidy']['whitespace'], '', $value), -10, 10), '!important')); } /** @@ -1153,8 +1181,8 @@ class csstidy { * @access public * @version 1.0 */ - static function gvw_important($value) { - if (csstidy::is_important($value)) { + public function gvw_important($value) { + if ($this->is_important($value)) { $value = trim($value); $value = substr($value, 0, -9); $value = trim($value); @@ -1173,8 +1201,8 @@ class csstidy { * @access private * @version 1.2 */ - function property_is_next($istring, $pos) { - $all_properties = & $GLOBALS['csstidy']['all_properties']; + public function property_is_next($istring, $pos) { + $all_properties = & $this->data['csstidy']['all_properties']; $istring = substr($istring, $pos, strlen($istring) - $pos); $pos = strpos($istring, ':'); if ($pos === false) { @@ -1195,9 +1223,9 @@ class csstidy { * @access public * @version 1.0 */ - function property_is_valid($property) { - if (in_array(trim($property), $GLOBALS['csstidy']['multiple_properties'])) $property = trim($property); - $all_properties = & $GLOBALS['csstidy']['all_properties']; + public function property_is_valid($property) { + if (in_array(trim($property), $this->data['csstidy']['multiple_properties'])) $property = trim($property); + $all_properties = & $this->data['csstidy']['all_properties']; return (isset($all_properties[$property]) && strpos($all_properties[$property], strtoupper($this->get_cfg('css_level'))) !== false ); } @@ -1216,7 +1244,7 @@ class csstidy { * @return array */ - function parse_string_list($value) { + public function parse_string_list($value) { $value = trim($value); // Case: empty @@ -1225,30 +1253,26 @@ class csstidy { $strings = array(); $in_str = false; - $current_string = ""; + $current_string = ''; for ($i = 0, $_len = strlen($value); $i < $_len; $i++) { - if (($value{$i} == "," || $value{$i} === " ") && $in_str === true) { + if (($value{$i} === ',' || $value{$i} === ' ') && $in_str === true) { $in_str = false; $strings[] = $current_string; - $current_string = ""; - } - else if ($value{$i} == '"' || $value{$i} == "'"){ + $current_string = ''; + } elseif ($value{$i} === '"' || $value{$i} === "'") { if ($in_str === $value{$i}) { $strings[] = $current_string; $in_str = false; - $current_string = ""; + $current_string = ''; continue; - } - else if (!$in_str) { + } elseif (!$in_str) { $in_str = $value{$i}; } - } - else { - if ($in_str){ + } else { + if ($in_str) { $current_string .= $value{$i}; - } - else { + } else { if (!preg_match("/[\s,]/", $value{$i})) { $in_str = true; $current_string = $value{$i}; diff --git a/www/plugins-dist/compresseur/lib/csstidy/class.csstidy_ctype.php b/www/plugins-dist/compresseur/lib/csstidy/class.csstidy_ctype.php deleted file mode 100644 index 7960956e..00000000 --- a/www/plugins-dist/compresseur/lib/csstidy/class.csstidy_ctype.php +++ /dev/null @@ -1,45 +0,0 @@ -. * @@ -42,14 +42,20 @@ */ class csstidy_optimise { + /** + * csstidy object + * @var object + */ + public $parser; + /** * Constructor * @param array $css contains the class csstidy * @access private * @version 1.0 */ - function csstidy_optimise(&$css) { - $this->parser = & $css; + public function __construct($css) { + $this->parser = $css; $this->css = & $css->css; $this->sub_value = & $css->sub_value; $this->at = & $css->at; @@ -63,7 +69,7 @@ class csstidy_optimise { * @access public * @version 1.0 */ - function postparse() { + public function postparse() { if ($this->parser->get_cfg('preserve_css')) { return; } @@ -83,19 +89,19 @@ class csstidy_optimise { if ($this->parser->get_cfg('optimise_shorthands') > 0) { foreach ($this->css as $medium => $value) { foreach ($value as $selector => $value1) { - $this->css[$medium][$selector] = csstidy_optimise::merge_4value_shorthands($this->css[$medium][$selector]); + $this->css[$medium][$selector] = $this->merge_4value_shorthands($this->css[$medium][$selector]); if ($this->parser->get_cfg('optimise_shorthands') < 2) { continue; } - $this->css[$medium][$selector] = csstidy_optimise::merge_font($this->css[$medium][$selector]); + $this->css[$medium][$selector] = $this->merge_font($this->css[$medium][$selector]); if ($this->parser->get_cfg('optimise_shorthands') < 3) { continue; } - $this->css[$medium][$selector] = csstidy_optimise::merge_bg($this->css[$medium][$selector]); + $this->css[$medium][$selector] = $this->merge_bg($this->css[$medium][$selector]); if (empty($this->css[$medium][$selector])) { unset($this->css[$medium][$selector]); } @@ -109,12 +115,12 @@ class csstidy_optimise { * @access public * @version 1.0 */ - function value() { - $shorthands = & $GLOBALS['csstidy']['shorthands']; + public function value() { + $shorthands = & $this->parser->data['csstidy']['shorthands']; // optimise shorthand properties if (isset($shorthands[$this->property])) { - $temp = csstidy_optimise::shorthand($this->value); // FIXME - move + $temp = $this->shorthand($this->value); // FIXME - move if ($temp != $this->value) { $this->parser->log('Optimised shorthand notation (' . $this->property . '): Changed "' . $this->value . '" to "' . $temp . '"', 'Information'); } @@ -132,8 +138,8 @@ class csstidy_optimise { * @access public * @version 1.0 */ - function shorthands() { - $shorthands = & $GLOBALS['csstidy']['shorthands']; + public function shorthands() { + $shorthands = & $this->parser->data['csstidy']['shorthands']; if (!$this->parser->get_cfg('optimise_shorthands') || $this->parser->get_cfg('preserve_css')) { return; @@ -141,14 +147,14 @@ class csstidy_optimise { if ($this->property === 'font' && $this->parser->get_cfg('optimise_shorthands') > 1) { $this->css[$this->at][$this->selector]['font']=''; - $this->parser->merge_css_blocks($this->at, $this->selector, csstidy_optimise::dissolve_short_font($this->value)); + $this->parser->merge_css_blocks($this->at, $this->selector, $this->dissolve_short_font($this->value)); } if ($this->property === 'background' && $this->parser->get_cfg('optimise_shorthands') > 2) { $this->css[$this->at][$this->selector]['background']=''; - $this->parser->merge_css_blocks($this->at, $this->selector, csstidy_optimise::dissolve_short_bg($this->value)); + $this->parser->merge_css_blocks($this->at, $this->selector, $this->dissolve_short_bg($this->value)); } if (isset($shorthands[$this->property])) { - $this->parser->merge_css_blocks($this->at, $this->selector, csstidy_optimise::dissolve_4value_shorthands($this->property, $this->value)); + $this->parser->merge_css_blocks($this->at, $this->selector, $this->dissolve_4value_shorthands($this->property, $this->value)); if (is_array($shorthands[$this->property])) { $this->css[$this->at][$this->selector][$this->property] = ''; } @@ -160,8 +166,8 @@ class csstidy_optimise { * @access public * @version 1.0 */ - function subvalue() { - $replace_colors = & $GLOBALS['csstidy']['replace_colors']; + public function subvalue() { + $replace_colors = & $this->parser->data['csstidy']['replace_colors']; $this->sub_value = trim($this->sub_value); if ($this->sub_value == '') { // caution : '0' @@ -169,17 +175,17 @@ class csstidy_optimise { } $important = ''; - if (csstidy::is_important($this->sub_value)) { + if ($this->parser->is_important($this->sub_value)) { $important = '!important'; } - $this->sub_value = csstidy::gvw_important($this->sub_value); + $this->sub_value = $this->parser->gvw_important($this->sub_value); // Compress font-weight if ($this->property === 'font-weight' && $this->parser->get_cfg('compress_font-weight')) { if ($this->sub_value === 'bold') { $this->sub_value = '700'; $this->parser->log('Optimised font-weight: Changed "bold" to "700"', 'Information'); - } else if ($this->sub_value === 'normal') { + } elseif ($this->sub_value === 'normal') { $this->sub_value = '400'; $this->parser->log('Optimised font-weight: Changed "normal" to "400"', 'Information'); } @@ -215,10 +221,10 @@ class csstidy_optimise { * @return string * @version 1.0 */ - function shorthand($value) { + public function shorthand($value) { $important = ''; - if (csstidy::is_important($value)) { - $values = csstidy::gvw_important($value); + if ($this->parser->is_important($value)) { + $values = $this->parser->gvw_important($value); $important = '!important'; } else @@ -261,9 +267,9 @@ class csstidy_optimise { * @access public * @version 1.1 */ - function compress_important(&$string) { - if (csstidy::is_important($string)) { - $string = csstidy::gvw_important($string) . '!important'; + public function compress_important(&$string) { + if ($this->parser->is_important($string)) { + $string = $this->parser->gvw_important($string) . '!important'; } return $string; } @@ -274,28 +280,28 @@ class csstidy_optimise { * @return string * @version 1.1 */ - function cut_color($color) { - $replace_colors = & $GLOBALS['csstidy']['replace_colors']; + public function cut_color($color) { + $replace_colors = & $this->parser->data['csstidy']['replace_colors']; // if it's a string, don't touch ! - if (strncmp($color,"'",1)==0 OR strncmp($color,'"',1)==0) + if (strncmp($color, "'", 1) == 0 || strncmp($color, '"', 1) == 0) return $color; /* expressions complexes de type gradient */ - if (strpos($color,"(")!==false AND strncmp($color,'rgb(',4)!=0){ + if (strpos($color, '(') !== false && strncmp($color, 'rgb(' ,4) != 0) { // on ne touche pas aux couleurs dans les expression ms, c'est trop sensible - if (stripos($color,"progid:")!==false) + if (stripos($color, 'progid:') !== false) return $color; - preg_match_all(",rgb\([^)]+\),i",$color,$matches,PREG_SET_ORDER); - if (count($matches)){ - foreach ($matches as $m){ - $color = str_replace($m[0],$this->cut_color($m[0]),$color); + preg_match_all(",rgb\([^)]+\),i", $color, $matches, PREG_SET_ORDER); + if (count($matches)) { + foreach ($matches as $m) { + $color = str_replace($m[0], $this->cut_color($m[0]), $color); } } - preg_match_all(",#[0-9a-f]{6}(?=[^0-9a-f]),i",$color,$matches,PREG_SET_ORDER); - if (count($matches)){ - foreach ($matches as $m){ - $color = str_replace($m[0],$this->cut_color($m[0]),$color); + preg_match_all(",#[0-9a-f]{6}(?=[^0-9a-f]),i", $color, $matches, PREG_SET_ORDER); + if (count($matches)) { + foreach ($matches as $m) { + $color = str_replace($m[0],$this->cut_color($m[0]), $color); } } return $color; @@ -365,9 +371,9 @@ class csstidy_optimise { * @return string * @version 1.2 */ - function compress_numbers($subvalue) { - $unit_values = & $GLOBALS['csstidy']['unit_values']; - $color_values = & $GLOBALS['csstidy']['color_values']; + public function compress_numbers($subvalue) { + $unit_values = & $this->parser->data['csstidy']['unit_values']; + $color_values = & $this->parser->data['csstidy']['color_values']; // for font:1em/1em sans-serif...; if ($this->property === 'font') { @@ -375,6 +381,7 @@ class csstidy_optimise { } else { $temp = array($subvalue); } + for ($l = 0; $l < count($temp); $l++) { // if we are not dealing with a number at this point, do not optimise anything $number = $this->AnalyseCssNumber($temp[$l]); @@ -408,13 +415,13 @@ class csstidy_optimise { * @param string $string * @return array ('unit' if unit is found or '' if no unit exists, number value) or false if no number */ - function AnalyseCssNumber($string) { + public function AnalyseCssNumber($string) { // most simple checks first if (strlen($string) == 0 || ctype_alpha($string{0})) { return false; } - $units = & $GLOBALS['csstidy']['units']; + $units = & $this->parser->data['csstidy']['units']; $return = array(0, ''); $return[0] = floatval($string); @@ -453,7 +460,7 @@ class csstidy_optimise { * @access public * @version 1.2 */ - function merge_selectors(&$array) { + public function merge_selectors(&$array) { $css = $array; foreach ($css as $key => $value) { if (!isset($css[$key])) { @@ -494,7 +501,7 @@ class csstidy_optimise { * regular expression * @version 1.4 */ - function discard_invalid_selectors(&$array) { + public function discard_invalid_selectors(&$array) { $invalid = array('+' => true, '~' => true, ',' => true, '>' => true); foreach ($array as $selector => $decls) { $ok = true; @@ -521,16 +528,16 @@ class csstidy_optimise { * @version 1.0 * @see merge_4value_shorthands() */ - function dissolve_4value_shorthands($property, $value) { - $shorthands = & $GLOBALS['csstidy']['shorthands']; + public function dissolve_4value_shorthands($property, $value) { + $shorthands = & $this->parser->data['csstidy']['shorthands']; if (!is_array($shorthands[$property])) { $return[$property] = $value; return $return; } $important = ''; - if (csstidy::is_important($value)) { - $value = csstidy::gvw_important($value); + if ($this->parser->is_important($value)) { + $value = $this->parser->gvw_important($value); $important = '!important'; } $values = explode(' ', $value); @@ -566,7 +573,7 @@ class csstidy_optimise { * @return array * @version 1.0 */ - function explode_ws($sep, $string) { + public function explode_ws($sep, $string) { $status = 'st'; $to = ''; @@ -575,9 +582,9 @@ class csstidy_optimise { for ($i = 0, $len = strlen($string); $i < $len; $i++) { switch ($status) { case 'st': - if ($string{$i} == $sep && !csstidy::escaped($string, $i)) { + if ($string{$i} == $sep && !$this->parser->escaped($string, $i)) { ++$num; - } elseif ($string{$i} === '"' || $string{$i} === '\'' || $string{$i} === '(' && !csstidy::escaped($string, $i)) { + } elseif ($string{$i} === '"' || $string{$i} === '\'' || $string{$i} === '(' && !$this->parser->escaped($string, $i)) { $status = 'str'; $to = ($string{$i} === '(') ? ')' : $string{$i}; (isset($output[$num])) ? $output[$num] .= $string{$i} : $output[$num] = $string{$i}; @@ -587,7 +594,7 @@ class csstidy_optimise { break; case 'str': - if ($string{$i} == $to && !csstidy::escaped($string, $i)) { + if ($string{$i} == $to && !$this->parser->escaped($string, $i)) { $status = 'st'; } (isset($output[$num])) ? $output[$num] .= $string{$i} : $output[$num] = $string{$i}; @@ -609,9 +616,9 @@ class csstidy_optimise { * @version 1.2 * @see dissolve_4value_shorthands() */ - function merge_4value_shorthands($array) { + public function merge_4value_shorthands($array) { $return = $array; - $shorthands = & $GLOBALS['csstidy']['shorthands']; + $shorthands = & $this->parser->data['csstidy']['shorthands']; foreach ($shorthands as $key => $value) { if (isset($array[$value[0]]) && isset($array[$value[1]]) @@ -621,15 +628,15 @@ class csstidy_optimise { $important = ''; for ($i = 0; $i < 4; $i++) { $val = $array[$value[$i]]; - if (csstidy::is_important($val)) { + if ($this->parser->is_important($val)) { $important = '!important'; - $return[$key] .= csstidy::gvw_important($val) . ' '; + $return[$key] .= $this->parser->gvw_important($val) . ' '; } else { $return[$key] .= $val . ' '; } unset($return[$value[$i]]); } - $return[$key] = csstidy_optimise::shorthand(trim($return[$key] . $important)); + $return[$key] = $this->shorthand(trim($return[$key] . $important)); } } return $return; @@ -643,12 +650,12 @@ class csstidy_optimise { * @see merge_bg() * @todo full CSS 3 compliance */ - function dissolve_short_bg($str_value) { + public function dissolve_short_bg($str_value) { // don't try to explose background gradient ! - if (stripos($str_value, "gradient(")!==FALSE) + if (stripos($str_value, 'gradient(')!== false) return array('background'=>$str_value); - - $background_prop_default = & $GLOBALS['csstidy']['background_prop_default']; + + $background_prop_default = & $this->parser->data['csstidy']['background_prop_default']; $repeat = array('repeat', 'repeat-x', 'repeat-y', 'no-repeat', 'space'); $attachment = array('scroll', 'fixed', 'local'); $clip = array('border', 'padding'); @@ -657,12 +664,12 @@ class csstidy_optimise { $important = ''; $return = array('background-image' => null, 'background-size' => null, 'background-repeat' => null, 'background-position' => null, 'background-attachment' => null, 'background-clip' => null, 'background-origin' => null, 'background-color' => null); - if (csstidy::is_important($str_value)) { + if ($this->parser->is_important($str_value)) { $important = ' !important'; - $str_value = csstidy::gvw_important($str_value); + $str_value = $this->parser->gvw_important($str_value); } - $str_value = csstidy_optimise::explode_ws(',', $str_value); + $str_value = $this->explode_ws(',', $str_value); for ($i = 0; $i < count($str_value); $i++) { $have['clip'] = false; $have['pos'] = false; @@ -672,7 +679,7 @@ class csstidy_optimise { if (is_array($str_value[$i])) { $str_value[$i] = $str_value[$i][0]; } - $str_value[$i] = csstidy_optimise::explode_ws(' ', trim($str_value[$i])); + $str_value[$i] = $this->explode_ws(' ', trim($str_value[$i])); for ($j = 0; $j < count($str_value[$i]); $j++) { if ($have['bg'] === false && (substr($str_value[$i][$j], 0, 4) === 'url(' || $str_value[$i][$j] === 'none')) { @@ -695,8 +702,7 @@ class csstidy_optimise { $return['background-position'] .= ' '; else $return['background-position'].= ','; $have['pos'] = true; - } - elseif (!$have['color']) { + } elseif (!$have['color']) { $return['background-color'] .= $str_value[$i][$j] . ','; $have['color'] = true; } @@ -721,19 +727,19 @@ class csstidy_optimise { * @see dissolve_short_bg() * @todo full CSS 3 compliance */ - function merge_bg($input_css) { - $background_prop_default = & $GLOBALS['csstidy']['background_prop_default']; + public function merge_bg($input_css) { + $background_prop_default = & $this->parser->data['csstidy']['background_prop_default']; // Max number of background images. CSS3 not yet fully implemented - $number_of_values = @max(count(csstidy_optimise::explode_ws(',', $input_css['background-image'])), count(csstidy_optimise::explode_ws(',', $input_css['background-color'])), 1); + $number_of_values = @max(count($this->explode_ws(',', $input_css['background-image'])), count($this->explode_ws(',', $input_css['background-color'])), 1); // Array with background images to check if BG image exists - $bg_img_array = @csstidy_optimise::explode_ws(',', csstidy::gvw_important($input_css['background-image'])); + $bg_img_array = @$this->explode_ws(',', $this->parser->gvw_important($input_css['background-image'])); $new_bg_value = ''; $important = ''; // if background properties is here and not empty, don't try anything - if (isset($input_css['background']) AND $input_css['background']) + if (isset($input_css['background']) && $input_css['background']) return $input_css; - + for ($i = 0; $i < $number_of_values; $i++) { foreach ($background_prop_default as $bg_property => $default_value) { // Skip if property does not exist @@ -743,7 +749,7 @@ class csstidy_optimise { $cur_value = $input_css[$bg_property]; // skip all optimisation if gradient() somewhere - if (stripos($cur_value, "gradient(")!==FALSE) + if (stripos($cur_value, 'gradient(') !== false) return $input_css; // Skip some properties if there is no background image @@ -754,9 +760,9 @@ class csstidy_optimise { } // Remove !important - if (csstidy::is_important($cur_value)) { + if ($this->parser->is_important($cur_value)) { $important = ' !important'; - $cur_value = csstidy::gvw_important($cur_value); + $cur_value = $this->parser->gvw_important($cur_value); } // Do not add default values @@ -764,7 +770,7 @@ class csstidy_optimise { continue; } - $temp = csstidy_optimise::explode_ws(',', $cur_value); + $temp = $this->explode_ws(',', $cur_value); if (isset($temp[$i])) { if ($bg_property === 'background-size') { @@ -801,17 +807,17 @@ class csstidy_optimise { * @version 1.3 * @see merge_font() */ - function dissolve_short_font($str_value) { - $font_prop_default = & $GLOBALS['csstidy']['font_prop_default']; + public function dissolve_short_font($str_value) { + $font_prop_default = & $this->parser->data['csstidy']['font_prop_default']; $font_weight = array('normal', 'bold', 'bolder', 'lighter', 100, 200, 300, 400, 500, 600, 700, 800, 900); $font_variant = array('normal', 'small-caps'); $font_style = array('normal', 'italic', 'oblique'); $important = ''; $return = array('font-style' => null, 'font-variant' => null, 'font-weight' => null, 'font-size' => null, 'line-height' => null, 'font-family' => null); - if (csstidy::is_important($str_value)) { + if ($this->parser->is_important($str_value)) { $important = '!important'; - $str_value = csstidy::gvw_important($str_value); + $str_value = $this->parser->gvw_important($str_value); } $have['style'] = false; @@ -822,9 +828,9 @@ class csstidy_optimise { $multiwords = false; // Workaround with multiple font-family - $str_value = csstidy_optimise::explode_ws(',', trim($str_value)); + $str_value = $this->explode_ws(',', trim($str_value)); - $str_value[0] = csstidy_optimise::explode_ws(' ', trim($str_value[0])); + $str_value[0] = $this->explode_ws(' ', trim($str_value[0])); for ($j = 0; $j < count($str_value[0]); $j++) { if ($have['weight'] === false && in_array($str_value[0][$j], $font_weight)) { @@ -837,7 +843,7 @@ class csstidy_optimise { $return['font-style'] = $str_value[0][$j]; $have['style'] = true; } elseif ($have['size'] === false && (is_numeric($str_value[0][$j]{0}) || $str_value[0][$j]{0} === null || $str_value[0][$j]{0} === '.')) { - $size = csstidy_optimise::explode_ws('/', trim($str_value[0][$j])); + $size = $this->explode_ws('/', trim($str_value[0][$j])); $return['font-size'] = $size[0]; if (isset($size[1])) { $return['line-height'] = $size[1]; @@ -888,27 +894,27 @@ class csstidy_optimise { * @version 1.3 * @see dissolve_short_font() */ - function merge_font($input_css) { - $font_prop_default = & $GLOBALS['csstidy']['font_prop_default']; + public function merge_font($input_css) { + $font_prop_default = & $this->parser->data['csstidy']['font_prop_default']; $new_font_value = ''; $important = ''; // Skip if not font-family and font-size set if (isset($input_css['font-family']) && isset($input_css['font-size'])) { // fix several words in font-family - add quotes if (isset($input_css['font-family'])) { - $families = explode(",", $input_css['font-family']); + $families = explode(',', $input_css['font-family']); $result_families = array(); foreach ($families as $family) { $family = trim($family); $len = strlen($family); - if (strpos($family, " ") && - !(($family{0} == '"' && $family{$len - 1} == '"') || - ($family{0} == "'" && $family{$len - 1} == "'"))) { + if (strpos($family, ' ') && + !(($family{0} === '"' && $family{$len - 1} === '"') || + ($family{0} === "'" && $family{$len - 1} === "'"))) { $family = '"' . $family . '"'; } $result_families[] = $family; } - $input_css['font-family'] = implode(",", $result_families); + $input_css['font-family'] = implode(',', $result_families); } foreach ($font_prop_default as $font_property => $default_value) { @@ -925,9 +931,9 @@ class csstidy_optimise { } // Remove !important - if (csstidy::is_important($cur_value)) { + if ($this->parser->is_important($cur_value)) { $important = '!important'; - $cur_value = csstidy::gvw_important($cur_value); + $cur_value = $this->parser->gvw_important($cur_value); } $new_font_value .= $cur_value; @@ -940,7 +946,7 @@ class csstidy_optimise { // Delete all font-properties foreach ($font_prop_default as $font_property => $default_value) { - if ($font_property!=='font' OR !$new_font_value) + if ($font_property !== 'font' || !$new_font_value) unset($input_css[$font_property]); } diff --git a/www/plugins-dist/compresseur/lib/csstidy/class.csstidy_print.php b/www/plugins-dist/compresseur/lib/csstidy/class.csstidy_print.php index 9897fbd1..48aa8974 100644 --- a/www/plugins-dist/compresseur/lib/csstidy/class.csstidy_print.php +++ b/www/plugins-dist/compresseur/lib/csstidy/class.csstidy_print.php @@ -19,7 +19,7 @@ * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. - * + * * You should have received a copy of the GNU Lesser General Public License * along with this program. If not, see . * @@ -41,24 +41,30 @@ */ class csstidy_print { + /** + * csstidy object + * @var object + */ + public $parser; + /** * Saves the input CSS string * @var string * @access private */ - var $input_css = ''; + public $input_css = ''; /** * Saves the formatted CSS string * @var string * @access public */ - var $output_css = ''; + public $output_css = ''; /** * Saves the formatted CSS string (plain text) * @var string * @access public */ - var $output_css_plain = ''; + public $output_css_plain = ''; /** * Constructor @@ -66,8 +72,8 @@ class csstidy_print { * @access private * @version 1.0 */ - function csstidy_print(&$css) { - $this->parser = & $css; + public function __construct($css) { + $this->parser = $css; $this->css = & $css->css; $this->template = & $css->template; $this->tokens = & $css->tokens; @@ -81,7 +87,7 @@ class csstidy_print { * @access private * @version 1.0 */ - function _reset() { + public function _reset() { $this->output_css = ''; $this->output_css_plain = ''; } @@ -93,7 +99,7 @@ class csstidy_print { * @access public * @version 1.0 */ - function plain($default_media='') { + public function plain($default_media='') { $this->_print(true, $default_media); return $this->output_css_plain; } @@ -105,7 +111,7 @@ class csstidy_print { * @access public * @version 1.0 */ - function formatted($default_media='') { + public function formatted($default_media='') { $this->_print(false, $default_media); return $this->output_css; } @@ -120,9 +126,12 @@ class csstidy_print { * @access public * @version 1.4 */ - function formatted_page($doctype='xhtml1.1', $externalcss=true, $title='', $lang='en') { + public function formatted_page($doctype='html5', $externalcss=true, $title='', $lang='en') { switch ($doctype) { - case 'xhtml1.0strict': + case 'html5': + $doctype_output = ''; + break; + case 'xhtml1.0strict': $doctype_output = ''; break; @@ -147,7 +156,6 @@ class csstidy_print { $output .= "\n"; } else { $output .= "\n" . ' '; -// } } $output .= "\n\n"; $output .= $this->formatted(); @@ -162,7 +170,7 @@ class csstidy_print { * @access private * @version 2.0 */ - function _print($plain = false, $default_media='') { + public function _print($plain = false, $default_media='') { if ($this->output_css && $this->output_css_plain) { return; } @@ -278,7 +286,7 @@ class csstidy_print { * @access private * @version 1.0 */ - function _seeknocomment($key, $move) { + public function _seeknocomment($key, $move) { $go = ($move > 0) ? 1 : -1; for ($i = $key + 1; abs($key - $i) - 1 < abs($move); $i += $go) { if (!isset($this->tokens[$i])) { @@ -298,7 +306,7 @@ class csstidy_print { * @access private * @version 1.0 */ - function _convert_raw_css($default_media='') { + public function _convert_raw_css($default_media='') { $this->tokens = array(); $sort_selectors = $this->parser->get_cfg('sort_selectors'); $sort_properties = $this->parser->get_cfg('sort_properties'); @@ -308,14 +316,13 @@ class csstidy_print { ksort($val); if (intval($medium) < DEFAULT_AT) { // un medium vide (contenant @font-face ou autre @) ne produit aucun conteneur - if (strlen(trim($medium))){ + if (strlen(trim($medium))) { $this->parser->_add_token(AT_START, $medium, true); } - } - elseif ($default_media) { + } elseif ($default_media) { $this->parser->_add_token(AT_START, $default_media, true); } - + foreach ($val as $selector => $vali) { if ($sort_properties) ksort($vali); @@ -328,7 +335,7 @@ class csstidy_print { '-' => array() // IE6 hacks ); foreach ($vali as $property => $valj) { - if (strncmp($property,"//",2)!==0){ + if (strncmp($property,"//",2)!==0) { $matches = array(); if ($sort_properties && preg_match('/^(\*|_|\/|-)(?!(ms|moz|o\b|xv|atsc|wap|khtml|webkit|ah|hp|ro|rim|tc)-)/', $property, $matches)) { $invalid[$matches[1]][$property] = $valj; @@ -349,11 +356,10 @@ class csstidy_print { if (intval($medium) < DEFAULT_AT) { // un medium vide (contenant @font-face ou autre @) ne produit aucun conteneur - if (strlen(trim($medium))){ + if (strlen(trim($medium))) { $this->parser->_add_token(AT_END, $medium, true); } - } - elseif ($default_media) { + } elseif ($default_media) { $this->parser->_add_token(AT_END, $default_media, true); } } @@ -368,7 +374,7 @@ class csstidy_print { * @access private * @version 1.0 */ - function _htmlsp($string, $plain) { + public function _htmlsp($string, $plain) { if (!$plain) { return htmlspecialchars($string, ENT_QUOTES, 'utf-8'); } @@ -381,7 +387,7 @@ class csstidy_print { * @return float * @version 1.2 */ - function get_ratio() { + public function get_ratio() { if (!$this->output_css_plain) { $this->formatted(); } @@ -394,7 +400,7 @@ class csstidy_print { * @return string * @version 1.1 */ - function get_diff() { + public function get_diff() { if (!$this->output_css_plain) { $this->formatted(); } @@ -417,7 +423,7 @@ class csstidy_print { * @return integer * @version 1.0 */ - function size($loc = 'output') { + public function size($loc = 'output') { if ($loc === 'output' && !$this->output_css) { $this->formatted(); } diff --git a/www/plugins-dist/compresseur/lib/csstidy/cssparse.css b/www/plugins-dist/compresseur/lib/csstidy/cssparse.css deleted file mode 100644 index 38fc40b4..00000000 --- a/www/plugins-dist/compresseur/lib/csstidy/cssparse.css +++ /dev/null @@ -1,118 +0,0 @@ -@import url("cssparsed.css"); - -html, body { -font:0.8em Verdana,Helvetica,sans-serif; -background:#F8F8F6; -} - -code { -font-size:1.2em; -} - -div#rightcol { -padding-left:32em; -} - -fieldset { -display:block; -margin:0.5em 0; -padding:1em; -border:solid #7284AB 2px; -} -fieldset.code_output { -display:inline; -} - -h1 { -font-size:2em; -} - -small { -font-size:0.7em; -} - -fieldset#field_input { -float:left; -margin:0 0.5em 1em 0; -} - -fieldset#options,fieldset#code_layout { -width:31em; -} - -input#submit { -clear:both; -display:block; -margin:1em; -} - -select { -margin:2px 0 0; -} - -label.block { -display:block; -} - -legend { -background:#c4E1C3; -padding:2px 4px; -border:dashed 1px; -} - -textarea#css_text { -width:27em; -height:370px; -display:block; -margin-right:1em; -} - -.help { -cursor:help; -} - -p.important { -border:solid 1px red; -font-weight:bold; -padding:1em; -background:white; -} - -p { -margin:1em 0; -} - -dl { -padding-left:0.5em; -} - -dt { -font-weight:bold; -margin:0; -float:left; -clear:both; -height:1.5em; -} - -dd { -margin:0 0 0 4em; -height:1.5em; -} - -fieldset#messages { -background:white; -padding:0 0 0 1em; -} - -fieldset#messages div { -height:10em; -overflow:auto; -} - -dd.Warning { -color:orange; -} - -dd.Information { -color:green; -} \ No newline at end of file diff --git a/www/plugins-dist/compresseur/lib/csstidy/cssparsed.css b/www/plugins-dist/compresseur/lib/csstidy/cssparsed.css deleted file mode 100644 index ca28b9bd..00000000 --- a/www/plugins-dist/compresseur/lib/csstidy/cssparsed.css +++ /dev/null @@ -1,29 +0,0 @@ -code#copytext { - white-space: pre; - font-family: Verdana; -} - -.at { -color:darkblue; -} - -.format { -color:gray; -} - -.property { -color:green; -} - -.selector { -color:blue; -} - -.value { -color:red; -left: 500px; -} - -.comment { -color:orange; -} \ No newline at end of file diff --git a/www/plugins-dist/compresseur/lib/csstidy/data.inc.php b/www/plugins-dist/compresseur/lib/csstidy/data.inc.php index 9ec79412..ec1322ed 100644 --- a/www/plugins-dist/compresseur/lib/csstidy/data.inc.php +++ b/www/plugins-dist/compresseur/lib/csstidy/data.inc.php @@ -1,5 +1,4 @@ ?[]^`|~'; +$data['csstidy']['tokens'] = '/@}{;:=\'"(,\\!$%&)*+.<>?[]^`|~'; /** * All CSS units (CSS 3 units included) * * @see compress_numbers() - * @global array $GLOBALS['csstidy']['units'] + * @global array $data['csstidy']['units'] * @version 1.0 */ -$GLOBALS['csstidy']['units'] = array('in','cm','mm','pt','pc','px','rem','em','%','ex','gd','vw','vh','vm','deg','grad','rad','ms','s','khz','hz'); +$data['csstidy']['units'] = array('in','cm','mm','pt','pc','px','rem','em','%','ex','gd','vw','vh','vm','deg','grad','rad','turn','ms','s','khz','hz','ch','vmin','vmax','dpi','dpcm','dppx'); /** * Available at-rules * - * @global array $GLOBALS['csstidy']['at_rules'] + * @global array $data['csstidy']['at_rules'] * @version 1.1 */ -$GLOBALS['csstidy']['at_rules'] = array('page' => 'is','font-face' => 'atis','charset' => 'iv', 'import' => 'iv','namespace' => 'iv','media' => 'at','keyframes' => 'at'); +$data['csstidy']['at_rules'] = array('page' => 'is','font-face' => 'atis','charset' => 'iv', 'import' => 'iv','namespace' => 'iv','media' => 'at','keyframes' => 'at','-moz-keyframes' => 'at','-o-keyframes' => 'at','-webkit-keyframes' => 'at','-ms-keyframes' => 'at'); /** * Properties that need a value with unit * * @todo CSS3 properties * @see compress_numbers(); - * @global array $GLOBALS['csstidy']['unit_values'] + * @global array $data['csstidy']['unit_values'] * @version 1.2 */ -$GLOBALS['csstidy']['unit_values'] = array ('background', 'background-position', 'background-size', 'border', 'border-top', 'border-right', 'border-bottom', 'border-left', 'border-width', - 'border-top-width', 'border-right-width', 'border-left-width', 'border-bottom-width', 'bottom', 'border-spacing', 'column-gap', 'column-width', +$data['csstidy']['unit_values'] = array ('background', 'background-position', 'background-size', 'border', 'border-top', 'border-right', 'border-bottom', 'border-left', 'border-width', + 'border-top-width', 'border-right-width', 'border-left-width', 'border-bottom-width', 'bottom', 'border-spacing', 'column-gap', 'column-width', 'font-size', 'height', 'left', 'margin', 'margin-top', 'margin-right', 'margin-bottom', 'margin-left', 'max-height', - 'max-width', 'min-height', 'min-width', 'outline', 'outline-width', 'padding', 'padding-top', 'padding-right', + 'max-width', 'min-height', 'min-width', 'outline', 'outline-width', 'padding', 'padding-top', 'padding-right', 'padding-bottom', 'padding-left', 'perspective', 'right', 'top', 'text-indent', 'letter-spacing', 'word-spacing', 'width'); /** @@ -86,571 +76,571 @@ $GLOBALS['csstidy']['unit_values'] = array ('background', 'background-position', * * @todo CSS3 properties * @see compress_numbers(); - * @global array $GLOBALS['csstidy']['color_values'] + * @global array $data['csstidy']['color_values'] * @version 1.0 */ -$GLOBALS['csstidy']['color_values'] = array(); -$GLOBALS['csstidy']['color_values'][] = 'background-color'; -$GLOBALS['csstidy']['color_values'][] = 'border-color'; -$GLOBALS['csstidy']['color_values'][] = 'border-top-color'; -$GLOBALS['csstidy']['color_values'][] = 'border-right-color'; -$GLOBALS['csstidy']['color_values'][] = 'border-bottom-color'; -$GLOBALS['csstidy']['color_values'][] = 'border-left-color'; -$GLOBALS['csstidy']['color_values'][] = 'color'; -$GLOBALS['csstidy']['color_values'][] = 'outline-color'; -$GLOBALS['csstidy']['color_values'][] = 'column-rule-color'; +$data['csstidy']['color_values'] = array(); +$data['csstidy']['color_values'][] = 'background-color'; +$data['csstidy']['color_values'][] = 'border-color'; +$data['csstidy']['color_values'][] = 'border-top-color'; +$data['csstidy']['color_values'][] = 'border-right-color'; +$data['csstidy']['color_values'][] = 'border-bottom-color'; +$data['csstidy']['color_values'][] = 'border-left-color'; +$data['csstidy']['color_values'][] = 'color'; +$data['csstidy']['color_values'][] = 'outline-color'; +$data['csstidy']['color_values'][] = 'column-rule-color'; /** * Default values for the background properties * * @todo Possibly property names will change during CSS3 development - * @global array $GLOBALS['csstidy']['background_prop_default'] + * @global array $data['csstidy']['background_prop_default'] * @see dissolve_short_bg() * @see merge_bg() * @version 1.0 */ -$GLOBALS['csstidy']['background_prop_default'] = array(); -$GLOBALS['csstidy']['background_prop_default']['background-image'] = 'none'; -$GLOBALS['csstidy']['background_prop_default']['background-size'] = 'auto'; -$GLOBALS['csstidy']['background_prop_default']['background-repeat'] = 'repeat'; -$GLOBALS['csstidy']['background_prop_default']['background-position'] = '0 0'; -$GLOBALS['csstidy']['background_prop_default']['background-attachment'] = 'scroll'; -$GLOBALS['csstidy']['background_prop_default']['background-clip'] = 'border'; -$GLOBALS['csstidy']['background_prop_default']['background-origin'] = 'padding'; -$GLOBALS['csstidy']['background_prop_default']['background-color'] = 'transparent'; +$data['csstidy']['background_prop_default'] = array(); +$data['csstidy']['background_prop_default']['background-image'] = 'none'; +$data['csstidy']['background_prop_default']['background-size'] = 'auto'; +$data['csstidy']['background_prop_default']['background-repeat'] = 'repeat'; +$data['csstidy']['background_prop_default']['background-position'] = '0 0'; +$data['csstidy']['background_prop_default']['background-attachment'] = 'scroll'; +$data['csstidy']['background_prop_default']['background-clip'] = 'border'; +$data['csstidy']['background_prop_default']['background-origin'] = 'padding'; +$data['csstidy']['background_prop_default']['background-color'] = 'transparent'; /** * Default values for the font properties * - * @global array $GLOBALS['csstidy']['font_prop_default'] + * @global array $data['csstidy']['font_prop_default'] * @see merge_fonts() * @version 1.3 */ -$GLOBALS['csstidy']['font_prop_default'] = array(); -$GLOBALS['csstidy']['font_prop_default']['font-style'] = 'normal'; -$GLOBALS['csstidy']['font_prop_default']['font-variant'] = 'normal'; -$GLOBALS['csstidy']['font_prop_default']['font-weight'] = 'normal'; -$GLOBALS['csstidy']['font_prop_default']['font-size'] = ''; -$GLOBALS['csstidy']['font_prop_default']['line-height'] = ''; -$GLOBALS['csstidy']['font_prop_default']['font-family'] = ''; +$data['csstidy']['font_prop_default'] = array(); +$data['csstidy']['font_prop_default']['font-style'] = 'normal'; +$data['csstidy']['font_prop_default']['font-variant'] = 'normal'; +$data['csstidy']['font_prop_default']['font-weight'] = 'normal'; +$data['csstidy']['font_prop_default']['font-size'] = ''; +$data['csstidy']['font_prop_default']['line-height'] = ''; +$data['csstidy']['font_prop_default']['font-family'] = ''; /** * A list of non-W3C color names which get replaced by their hex-codes * - * @global array $GLOBALS['csstidy']['replace_colors'] + * @global array $data['csstidy']['replace_colors'] * @see cut_color() * @version 1.0 */ -$GLOBALS['csstidy']['replace_colors'] = array(); -$GLOBALS['csstidy']['replace_colors']['aliceblue'] = '#f0f8ff'; -$GLOBALS['csstidy']['replace_colors']['antiquewhite'] = '#faebd7'; -$GLOBALS['csstidy']['replace_colors']['aquamarine'] = '#7fffd4'; -$GLOBALS['csstidy']['replace_colors']['azure'] = '#f0ffff'; -$GLOBALS['csstidy']['replace_colors']['beige'] = '#f5f5dc'; -$GLOBALS['csstidy']['replace_colors']['bisque'] = '#ffe4c4'; -$GLOBALS['csstidy']['replace_colors']['blanchedalmond'] = '#ffebcd'; -$GLOBALS['csstidy']['replace_colors']['blueviolet'] = '#8a2be2'; -$GLOBALS['csstidy']['replace_colors']['brown'] = '#a52a2a'; -$GLOBALS['csstidy']['replace_colors']['burlywood'] = '#deb887'; -$GLOBALS['csstidy']['replace_colors']['cadetblue'] = '#5f9ea0'; -$GLOBALS['csstidy']['replace_colors']['chartreuse'] = '#7fff00'; -$GLOBALS['csstidy']['replace_colors']['chocolate'] = '#d2691e'; -$GLOBALS['csstidy']['replace_colors']['coral'] = '#ff7f50'; -$GLOBALS['csstidy']['replace_colors']['cornflowerblue'] = '#6495ed'; -$GLOBALS['csstidy']['replace_colors']['cornsilk'] = '#fff8dc'; -$GLOBALS['csstidy']['replace_colors']['crimson'] = '#dc143c'; -$GLOBALS['csstidy']['replace_colors']['cyan'] = '#00ffff'; -$GLOBALS['csstidy']['replace_colors']['darkblue'] = '#00008b'; -$GLOBALS['csstidy']['replace_colors']['darkcyan'] = '#008b8b'; -$GLOBALS['csstidy']['replace_colors']['darkgoldenrod'] = '#b8860b'; -$GLOBALS['csstidy']['replace_colors']['darkgray'] = '#a9a9a9'; -$GLOBALS['csstidy']['replace_colors']['darkgreen'] = '#006400'; -$GLOBALS['csstidy']['replace_colors']['darkkhaki'] = '#bdb76b'; -$GLOBALS['csstidy']['replace_colors']['darkmagenta'] = '#8b008b'; -$GLOBALS['csstidy']['replace_colors']['darkolivegreen'] = '#556b2f'; -$GLOBALS['csstidy']['replace_colors']['darkorange'] = '#ff8c00'; -$GLOBALS['csstidy']['replace_colors']['darkorchid'] = '#9932cc'; -$GLOBALS['csstidy']['replace_colors']['darkred'] = '#8b0000'; -$GLOBALS['csstidy']['replace_colors']['darksalmon'] = '#e9967a'; -$GLOBALS['csstidy']['replace_colors']['darkseagreen'] = '#8fbc8f'; -$GLOBALS['csstidy']['replace_colors']['darkslateblue'] = '#483d8b'; -$GLOBALS['csstidy']['replace_colors']['darkslategray'] = '#2f4f4f'; -$GLOBALS['csstidy']['replace_colors']['darkturquoise'] = '#00ced1'; -$GLOBALS['csstidy']['replace_colors']['darkviolet'] = '#9400d3'; -$GLOBALS['csstidy']['replace_colors']['deeppink'] = '#ff1493'; -$GLOBALS['csstidy']['replace_colors']['deepskyblue'] = '#00bfff'; -$GLOBALS['csstidy']['replace_colors']['dimgray'] = '#696969'; -$GLOBALS['csstidy']['replace_colors']['dodgerblue'] = '#1e90ff'; -$GLOBALS['csstidy']['replace_colors']['feldspar'] = '#d19275'; -$GLOBALS['csstidy']['replace_colors']['firebrick'] = '#b22222'; -$GLOBALS['csstidy']['replace_colors']['floralwhite'] = '#fffaf0'; -$GLOBALS['csstidy']['replace_colors']['forestgreen'] = '#228b22'; -$GLOBALS['csstidy']['replace_colors']['gainsboro'] = '#dcdcdc'; -$GLOBALS['csstidy']['replace_colors']['ghostwhite'] = '#f8f8ff'; -$GLOBALS['csstidy']['replace_colors']['gold'] = '#ffd700'; -$GLOBALS['csstidy']['replace_colors']['goldenrod'] = '#daa520'; -$GLOBALS['csstidy']['replace_colors']['greenyellow'] = '#adff2f'; -$GLOBALS['csstidy']['replace_colors']['honeydew'] = '#f0fff0'; -$GLOBALS['csstidy']['replace_colors']['hotpink'] = '#ff69b4'; -$GLOBALS['csstidy']['replace_colors']['indianred'] = '#cd5c5c'; -$GLOBALS['csstidy']['replace_colors']['indigo'] = '#4b0082'; -$GLOBALS['csstidy']['replace_colors']['ivory'] = '#fffff0'; -$GLOBALS['csstidy']['replace_colors']['khaki'] = '#f0e68c'; -$GLOBALS['csstidy']['replace_colors']['lavender'] = '#e6e6fa'; -$GLOBALS['csstidy']['replace_colors']['lavenderblush'] = '#fff0f5'; -$GLOBALS['csstidy']['replace_colors']['lawngreen'] = '#7cfc00'; -$GLOBALS['csstidy']['replace_colors']['lemonchiffon'] = '#fffacd'; -$GLOBALS['csstidy']['replace_colors']['lightblue'] = '#add8e6'; -$GLOBALS['csstidy']['replace_colors']['lightcoral'] = '#f08080'; -$GLOBALS['csstidy']['replace_colors']['lightcyan'] = '#e0ffff'; -$GLOBALS['csstidy']['replace_colors']['lightgoldenrodyellow'] = '#fafad2'; -$GLOBALS['csstidy']['replace_colors']['lightgrey'] = '#d3d3d3'; -$GLOBALS['csstidy']['replace_colors']['lightgreen'] = '#90ee90'; -$GLOBALS['csstidy']['replace_colors']['lightpink'] = '#ffb6c1'; -$GLOBALS['csstidy']['replace_colors']['lightsalmon'] = '#ffa07a'; -$GLOBALS['csstidy']['replace_colors']['lightseagreen'] = '#20b2aa'; -$GLOBALS['csstidy']['replace_colors']['lightskyblue'] = '#87cefa'; -$GLOBALS['csstidy']['replace_colors']['lightslateblue'] = '#8470ff'; -$GLOBALS['csstidy']['replace_colors']['lightslategray'] = '#778899'; -$GLOBALS['csstidy']['replace_colors']['lightsteelblue'] = '#b0c4de'; -$GLOBALS['csstidy']['replace_colors']['lightyellow'] = '#ffffe0'; -$GLOBALS['csstidy']['replace_colors']['limegreen'] = '#32cd32'; -$GLOBALS['csstidy']['replace_colors']['linen'] = '#faf0e6'; -$GLOBALS['csstidy']['replace_colors']['magenta'] = '#ff00ff'; -$GLOBALS['csstidy']['replace_colors']['mediumaquamarine'] = '#66cdaa'; -$GLOBALS['csstidy']['replace_colors']['mediumblue'] = '#0000cd'; -$GLOBALS['csstidy']['replace_colors']['mediumorchid'] = '#ba55d3'; -$GLOBALS['csstidy']['replace_colors']['mediumpurple'] = '#9370d8'; -$GLOBALS['csstidy']['replace_colors']['mediumseagreen'] = '#3cb371'; -$GLOBALS['csstidy']['replace_colors']['mediumslateblue'] = '#7b68ee'; -$GLOBALS['csstidy']['replace_colors']['mediumspringgreen'] = '#00fa9a'; -$GLOBALS['csstidy']['replace_colors']['mediumturquoise'] = '#48d1cc'; -$GLOBALS['csstidy']['replace_colors']['mediumvioletred'] = '#c71585'; -$GLOBALS['csstidy']['replace_colors']['midnightblue'] = '#191970'; -$GLOBALS['csstidy']['replace_colors']['mintcream'] = '#f5fffa'; -$GLOBALS['csstidy']['replace_colors']['mistyrose'] = '#ffe4e1'; -$GLOBALS['csstidy']['replace_colors']['moccasin'] = '#ffe4b5'; -$GLOBALS['csstidy']['replace_colors']['navajowhite'] = '#ffdead'; -$GLOBALS['csstidy']['replace_colors']['oldlace'] = '#fdf5e6'; -$GLOBALS['csstidy']['replace_colors']['olivedrab'] = '#6b8e23'; -$GLOBALS['csstidy']['replace_colors']['orangered'] = '#ff4500'; -$GLOBALS['csstidy']['replace_colors']['orchid'] = '#da70d6'; -$GLOBALS['csstidy']['replace_colors']['palegoldenrod'] = '#eee8aa'; -$GLOBALS['csstidy']['replace_colors']['palegreen'] = '#98fb98'; -$GLOBALS['csstidy']['replace_colors']['paleturquoise'] = '#afeeee'; -$GLOBALS['csstidy']['replace_colors']['palevioletred'] = '#d87093'; -$GLOBALS['csstidy']['replace_colors']['papayawhip'] = '#ffefd5'; -$GLOBALS['csstidy']['replace_colors']['peachpuff'] = '#ffdab9'; -$GLOBALS['csstidy']['replace_colors']['peru'] = '#cd853f'; -$GLOBALS['csstidy']['replace_colors']['pink'] = '#ffc0cb'; -$GLOBALS['csstidy']['replace_colors']['plum'] = '#dda0dd'; -$GLOBALS['csstidy']['replace_colors']['powderblue'] = '#b0e0e6'; -$GLOBALS['csstidy']['replace_colors']['rosybrown'] = '#bc8f8f'; -$GLOBALS['csstidy']['replace_colors']['royalblue'] = '#4169e1'; -$GLOBALS['csstidy']['replace_colors']['saddlebrown'] = '#8b4513'; -$GLOBALS['csstidy']['replace_colors']['salmon'] = '#fa8072'; -$GLOBALS['csstidy']['replace_colors']['sandybrown'] = '#f4a460'; -$GLOBALS['csstidy']['replace_colors']['seagreen'] = '#2e8b57'; -$GLOBALS['csstidy']['replace_colors']['seashell'] = '#fff5ee'; -$GLOBALS['csstidy']['replace_colors']['sienna'] = '#a0522d'; -$GLOBALS['csstidy']['replace_colors']['skyblue'] = '#87ceeb'; -$GLOBALS['csstidy']['replace_colors']['slateblue'] = '#6a5acd'; -$GLOBALS['csstidy']['replace_colors']['slategray'] = '#708090'; -$GLOBALS['csstidy']['replace_colors']['snow'] = '#fffafa'; -$GLOBALS['csstidy']['replace_colors']['springgreen'] = '#00ff7f'; -$GLOBALS['csstidy']['replace_colors']['steelblue'] = '#4682b4'; -$GLOBALS['csstidy']['replace_colors']['tan'] = '#d2b48c'; -$GLOBALS['csstidy']['replace_colors']['thistle'] = '#d8bfd8'; -$GLOBALS['csstidy']['replace_colors']['tomato'] = '#ff6347'; -$GLOBALS['csstidy']['replace_colors']['turquoise'] = '#40e0d0'; -$GLOBALS['csstidy']['replace_colors']['violet'] = '#ee82ee'; -$GLOBALS['csstidy']['replace_colors']['violetred'] = '#d02090'; -$GLOBALS['csstidy']['replace_colors']['wheat'] = '#f5deb3'; -$GLOBALS['csstidy']['replace_colors']['whitesmoke'] = '#f5f5f5'; -$GLOBALS['csstidy']['replace_colors']['yellowgreen'] = '#9acd32'; +$data['csstidy']['replace_colors'] = array(); +$data['csstidy']['replace_colors']['aliceblue'] = '#f0f8ff'; +$data['csstidy']['replace_colors']['antiquewhite'] = '#faebd7'; +$data['csstidy']['replace_colors']['aquamarine'] = '#7fffd4'; +$data['csstidy']['replace_colors']['azure'] = '#f0ffff'; +$data['csstidy']['replace_colors']['beige'] = '#f5f5dc'; +$data['csstidy']['replace_colors']['bisque'] = '#ffe4c4'; +$data['csstidy']['replace_colors']['blanchedalmond'] = '#ffebcd'; +$data['csstidy']['replace_colors']['blueviolet'] = '#8a2be2'; +$data['csstidy']['replace_colors']['brown'] = '#a52a2a'; +$data['csstidy']['replace_colors']['burlywood'] = '#deb887'; +$data['csstidy']['replace_colors']['cadetblue'] = '#5f9ea0'; +$data['csstidy']['replace_colors']['chartreuse'] = '#7fff00'; +$data['csstidy']['replace_colors']['chocolate'] = '#d2691e'; +$data['csstidy']['replace_colors']['coral'] = '#ff7f50'; +$data['csstidy']['replace_colors']['cornflowerblue'] = '#6495ed'; +$data['csstidy']['replace_colors']['cornsilk'] = '#fff8dc'; +$data['csstidy']['replace_colors']['crimson'] = '#dc143c'; +$data['csstidy']['replace_colors']['cyan'] = '#00ffff'; +$data['csstidy']['replace_colors']['darkblue'] = '#00008b'; +$data['csstidy']['replace_colors']['darkcyan'] = '#008b8b'; +$data['csstidy']['replace_colors']['darkgoldenrod'] = '#b8860b'; +$data['csstidy']['replace_colors']['darkgray'] = '#a9a9a9'; +$data['csstidy']['replace_colors']['darkgreen'] = '#006400'; +$data['csstidy']['replace_colors']['darkkhaki'] = '#bdb76b'; +$data['csstidy']['replace_colors']['darkmagenta'] = '#8b008b'; +$data['csstidy']['replace_colors']['darkolivegreen'] = '#556b2f'; +$data['csstidy']['replace_colors']['darkorange'] = '#ff8c00'; +$data['csstidy']['replace_colors']['darkorchid'] = '#9932cc'; +$data['csstidy']['replace_colors']['darkred'] = '#8b0000'; +$data['csstidy']['replace_colors']['darksalmon'] = '#e9967a'; +$data['csstidy']['replace_colors']['darkseagreen'] = '#8fbc8f'; +$data['csstidy']['replace_colors']['darkslateblue'] = '#483d8b'; +$data['csstidy']['replace_colors']['darkslategray'] = '#2f4f4f'; +$data['csstidy']['replace_colors']['darkturquoise'] = '#00ced1'; +$data['csstidy']['replace_colors']['darkviolet'] = '#9400d3'; +$data['csstidy']['replace_colors']['deeppink'] = '#ff1493'; +$data['csstidy']['replace_colors']['deepskyblue'] = '#00bfff'; +$data['csstidy']['replace_colors']['dimgray'] = '#696969'; +$data['csstidy']['replace_colors']['dodgerblue'] = '#1e90ff'; +$data['csstidy']['replace_colors']['feldspar'] = '#d19275'; +$data['csstidy']['replace_colors']['firebrick'] = '#b22222'; +$data['csstidy']['replace_colors']['floralwhite'] = '#fffaf0'; +$data['csstidy']['replace_colors']['forestgreen'] = '#228b22'; +$data['csstidy']['replace_colors']['gainsboro'] = '#dcdcdc'; +$data['csstidy']['replace_colors']['ghostwhite'] = '#f8f8ff'; +$data['csstidy']['replace_colors']['gold'] = '#ffd700'; +$data['csstidy']['replace_colors']['goldenrod'] = '#daa520'; +$data['csstidy']['replace_colors']['greenyellow'] = '#adff2f'; +$data['csstidy']['replace_colors']['honeydew'] = '#f0fff0'; +$data['csstidy']['replace_colors']['hotpink'] = '#ff69b4'; +$data['csstidy']['replace_colors']['indianred'] = '#cd5c5c'; +$data['csstidy']['replace_colors']['indigo'] = '#4b0082'; +$data['csstidy']['replace_colors']['ivory'] = '#fffff0'; +$data['csstidy']['replace_colors']['khaki'] = '#f0e68c'; +$data['csstidy']['replace_colors']['lavender'] = '#e6e6fa'; +$data['csstidy']['replace_colors']['lavenderblush'] = '#fff0f5'; +$data['csstidy']['replace_colors']['lawngreen'] = '#7cfc00'; +$data['csstidy']['replace_colors']['lemonchiffon'] = '#fffacd'; +$data['csstidy']['replace_colors']['lightblue'] = '#add8e6'; +$data['csstidy']['replace_colors']['lightcoral'] = '#f08080'; +$data['csstidy']['replace_colors']['lightcyan'] = '#e0ffff'; +$data['csstidy']['replace_colors']['lightgoldenrodyellow'] = '#fafad2'; +$data['csstidy']['replace_colors']['lightgrey'] = '#d3d3d3'; +$data['csstidy']['replace_colors']['lightgreen'] = '#90ee90'; +$data['csstidy']['replace_colors']['lightpink'] = '#ffb6c1'; +$data['csstidy']['replace_colors']['lightsalmon'] = '#ffa07a'; +$data['csstidy']['replace_colors']['lightseagreen'] = '#20b2aa'; +$data['csstidy']['replace_colors']['lightskyblue'] = '#87cefa'; +$data['csstidy']['replace_colors']['lightslateblue'] = '#8470ff'; +$data['csstidy']['replace_colors']['lightslategray'] = '#778899'; +$data['csstidy']['replace_colors']['lightsteelblue'] = '#b0c4de'; +$data['csstidy']['replace_colors']['lightyellow'] = '#ffffe0'; +$data['csstidy']['replace_colors']['limegreen'] = '#32cd32'; +$data['csstidy']['replace_colors']['linen'] = '#faf0e6'; +$data['csstidy']['replace_colors']['magenta'] = '#ff00ff'; +$data['csstidy']['replace_colors']['mediumaquamarine'] = '#66cdaa'; +$data['csstidy']['replace_colors']['mediumblue'] = '#0000cd'; +$data['csstidy']['replace_colors']['mediumorchid'] = '#ba55d3'; +$data['csstidy']['replace_colors']['mediumpurple'] = '#9370d8'; +$data['csstidy']['replace_colors']['mediumseagreen'] = '#3cb371'; +$data['csstidy']['replace_colors']['mediumslateblue'] = '#7b68ee'; +$data['csstidy']['replace_colors']['mediumspringgreen'] = '#00fa9a'; +$data['csstidy']['replace_colors']['mediumturquoise'] = '#48d1cc'; +$data['csstidy']['replace_colors']['mediumvioletred'] = '#c71585'; +$data['csstidy']['replace_colors']['midnightblue'] = '#191970'; +$data['csstidy']['replace_colors']['mintcream'] = '#f5fffa'; +$data['csstidy']['replace_colors']['mistyrose'] = '#ffe4e1'; +$data['csstidy']['replace_colors']['moccasin'] = '#ffe4b5'; +$data['csstidy']['replace_colors']['navajowhite'] = '#ffdead'; +$data['csstidy']['replace_colors']['oldlace'] = '#fdf5e6'; +$data['csstidy']['replace_colors']['olivedrab'] = '#6b8e23'; +$data['csstidy']['replace_colors']['orangered'] = '#ff4500'; +$data['csstidy']['replace_colors']['orchid'] = '#da70d6'; +$data['csstidy']['replace_colors']['palegoldenrod'] = '#eee8aa'; +$data['csstidy']['replace_colors']['palegreen'] = '#98fb98'; +$data['csstidy']['replace_colors']['paleturquoise'] = '#afeeee'; +$data['csstidy']['replace_colors']['palevioletred'] = '#d87093'; +$data['csstidy']['replace_colors']['papayawhip'] = '#ffefd5'; +$data['csstidy']['replace_colors']['peachpuff'] = '#ffdab9'; +$data['csstidy']['replace_colors']['peru'] = '#cd853f'; +$data['csstidy']['replace_colors']['pink'] = '#ffc0cb'; +$data['csstidy']['replace_colors']['plum'] = '#dda0dd'; +$data['csstidy']['replace_colors']['powderblue'] = '#b0e0e6'; +$data['csstidy']['replace_colors']['rosybrown'] = '#bc8f8f'; +$data['csstidy']['replace_colors']['royalblue'] = '#4169e1'; +$data['csstidy']['replace_colors']['saddlebrown'] = '#8b4513'; +$data['csstidy']['replace_colors']['salmon'] = '#fa8072'; +$data['csstidy']['replace_colors']['sandybrown'] = '#f4a460'; +$data['csstidy']['replace_colors']['seagreen'] = '#2e8b57'; +$data['csstidy']['replace_colors']['seashell'] = '#fff5ee'; +$data['csstidy']['replace_colors']['sienna'] = '#a0522d'; +$data['csstidy']['replace_colors']['skyblue'] = '#87ceeb'; +$data['csstidy']['replace_colors']['slateblue'] = '#6a5acd'; +$data['csstidy']['replace_colors']['slategray'] = '#708090'; +$data['csstidy']['replace_colors']['snow'] = '#fffafa'; +$data['csstidy']['replace_colors']['springgreen'] = '#00ff7f'; +$data['csstidy']['replace_colors']['steelblue'] = '#4682b4'; +$data['csstidy']['replace_colors']['tan'] = '#d2b48c'; +$data['csstidy']['replace_colors']['thistle'] = '#d8bfd8'; +$data['csstidy']['replace_colors']['tomato'] = '#ff6347'; +$data['csstidy']['replace_colors']['turquoise'] = '#40e0d0'; +$data['csstidy']['replace_colors']['violet'] = '#ee82ee'; +$data['csstidy']['replace_colors']['violetred'] = '#d02090'; +$data['csstidy']['replace_colors']['wheat'] = '#f5deb3'; +$data['csstidy']['replace_colors']['whitesmoke'] = '#f5f5f5'; +$data['csstidy']['replace_colors']['yellowgreen'] = '#9acd32'; /** * A list of all shorthand properties that are devided into four properties and/or have four subvalues * - * @global array $GLOBALS['csstidy']['shorthands'] + * @global array $data['csstidy']['shorthands'] * @todo Are there new ones in CSS3? * @see dissolve_4value_shorthands() * @see merge_4value_shorthands() * @version 1.0 */ -$GLOBALS['csstidy']['shorthands'] = array(); -$GLOBALS['csstidy']['shorthands']['border-color'] = array('border-top-color','border-right-color','border-bottom-color','border-left-color'); -$GLOBALS['csstidy']['shorthands']['border-style'] = array('border-top-style','border-right-style','border-bottom-style','border-left-style'); -$GLOBALS['csstidy']['shorthands']['border-width'] = array('border-top-width','border-right-width','border-bottom-width','border-left-width'); -$GLOBALS['csstidy']['shorthands']['margin'] = array('margin-top','margin-right','margin-bottom','margin-left'); -$GLOBALS['csstidy']['shorthands']['padding'] = array('padding-top','padding-right','padding-bottom','padding-left'); -$GLOBALS['csstidy']['shorthands']['-moz-border-radius'] = 0; +$data['csstidy']['shorthands'] = array(); +$data['csstidy']['shorthands']['border-color'] = array('border-top-color','border-right-color','border-bottom-color','border-left-color'); +$data['csstidy']['shorthands']['border-style'] = array('border-top-style','border-right-style','border-bottom-style','border-left-style'); +$data['csstidy']['shorthands']['border-width'] = array('border-top-width','border-right-width','border-bottom-width','border-left-width'); +$data['csstidy']['shorthands']['margin'] = array('margin-top','margin-right','margin-bottom','margin-left'); +$data['csstidy']['shorthands']['padding'] = array('padding-top','padding-right','padding-bottom','padding-left'); +$data['csstidy']['shorthands']['-moz-border-radius'] = 0; /** * All CSS Properties. Needed for csstidy::property_is_next() * - * @global array $GLOBALS['csstidy']['all_properties'] + * @global array $data['csstidy']['all_properties'] * @version 1.1 * @see csstidy::property_is_next() */ -$GLOBALS['csstidy']['all_properties']['alignment-adjust'] = 'CSS3.0'; -$GLOBALS['csstidy']['all_properties']['alignment-baseline'] = 'CSS3.0'; -$GLOBALS['csstidy']['all_properties']['animation'] = 'CSS3.0'; -$GLOBALS['csstidy']['all_properties']['animation-delay'] = 'CSS3.0'; -$GLOBALS['csstidy']['all_properties']['animation-direction'] = 'CSS3.0'; -$GLOBALS['csstidy']['all_properties']['animation-duration'] = 'CSS3.0'; -$GLOBALS['csstidy']['all_properties']['animation-iteration-count'] = 'CSS3.0'; -$GLOBALS['csstidy']['all_properties']['animation-name'] = 'CSS3.0'; -$GLOBALS['csstidy']['all_properties']['animation-play-state'] = 'CSS3.0'; -$GLOBALS['csstidy']['all_properties']['animation-timing-function'] = 'CSS3.0'; -$GLOBALS['csstidy']['all_properties']['appearance'] = 'CSS3.0'; -$GLOBALS['csstidy']['all_properties']['azimuth'] = 'CSS2.0,CSS2.1,CSS3.0'; -$GLOBALS['csstidy']['all_properties']['backface-visibility'] = 'CSS3.0'; -$GLOBALS['csstidy']['all_properties']['background'] = 'CSS1.0,CSS2.0,CSS2.1,CSS3.0'; -$GLOBALS['csstidy']['all_properties']['background-attachment'] = 'CSS1.0,CSS2.0,CSS2.1,CSS3.0'; -$GLOBALS['csstidy']['all_properties']['background-clip'] = 'CSS3.0'; -$GLOBALS['csstidy']['all_properties']['background-color'] = 'CSS1.0,CSS2.0,CSS2.1,CSS3.0'; -$GLOBALS['csstidy']['all_properties']['background-image'] = 'CSS1.0,CSS2.0,CSS2.1,CSS3.0'; -$GLOBALS['csstidy']['all_properties']['background-origin'] = 'CSS3.0'; -$GLOBALS['csstidy']['all_properties']['background-position'] = 'CSS1.0,CSS2.0,CSS2.1,CSS3.0'; -$GLOBALS['csstidy']['all_properties']['background-repeat'] = 'CSS1.0,CSS2.0,CSS2.1,CSS3.0'; -$GLOBALS['csstidy']['all_properties']['background-size'] = 'CSS3.0'; -$GLOBALS['csstidy']['all_properties']['baseline-shift'] = 'CSS3.0'; -$GLOBALS['csstidy']['all_properties']['binding'] = 'CSS3.0'; -$GLOBALS['csstidy']['all_properties']['bleed'] = 'CSS3.0'; -$GLOBALS['csstidy']['all_properties']['bookmark-label'] = 'CSS3.0'; -$GLOBALS['csstidy']['all_properties']['bookmark-level'] = 'CSS3.0'; -$GLOBALS['csstidy']['all_properties']['bookmark-state'] = 'CSS3.0'; -$GLOBALS['csstidy']['all_properties']['bookmark-target'] = 'CSS3.0'; -$GLOBALS['csstidy']['all_properties']['border'] = 'CSS1.0,CSS2.0,CSS2.1,CSS3.0'; -$GLOBALS['csstidy']['all_properties']['border-bottom'] = 'CSS1.0,CSS2.0,CSS2.1,CSS3.0'; -$GLOBALS['csstidy']['all_properties']['border-bottom-color'] = 'CSS2.0,CSS2.1,CSS3.0'; -$GLOBALS['csstidy']['all_properties']['border-bottom-left-radius'] = 'CSS3.0'; -$GLOBALS['csstidy']['all_properties']['border-bottom-right-radius'] = 'CSS3.0'; -$GLOBALS['csstidy']['all_properties']['border-bottom-style'] = 'CSS2.0,CSS2.1,CSS3.0'; -$GLOBALS['csstidy']['all_properties']['border-bottom-width'] = 'CSS1.0,CSS2.0,CSS2.1,CSS3.0'; -$GLOBALS['csstidy']['all_properties']['border-collapse'] = 'CSS2.0,CSS2.1,CSS3.0'; -$GLOBALS['csstidy']['all_properties']['border-color'] = 'CSS1.0,CSS2.0,CSS2.1,CSS3.0'; -$GLOBALS['csstidy']['all_properties']['border-image'] = 'CSS3.0'; -$GLOBALS['csstidy']['all_properties']['border-image-outset'] = 'CSS3.0'; -$GLOBALS['csstidy']['all_properties']['border-image-repeat'] = 'CSS3.0'; -$GLOBALS['csstidy']['all_properties']['border-image-slice'] = 'CSS3.0'; -$GLOBALS['csstidy']['all_properties']['border-image-source'] = 'CSS3.0'; -$GLOBALS['csstidy']['all_properties']['border-image-width'] = 'CSS3.0'; -$GLOBALS['csstidy']['all_properties']['border-left'] = 'CSS1.0,CSS2.0,CSS2.1,CSS3.0'; -$GLOBALS['csstidy']['all_properties']['border-left-color'] = 'CSS2.0,CSS2.1,CSS3.0'; -$GLOBALS['csstidy']['all_properties']['border-left-style'] = 'CSS2.0,CSS2.1,CSS3.0'; -$GLOBALS['csstidy']['all_properties']['border-left-width'] = 'CSS1.0,CSS2.0,CSS2.1,CSS3.0'; -$GLOBALS['csstidy']['all_properties']['border-radius'] = 'CSS3.0'; -$GLOBALS['csstidy']['all_properties']['border-right'] = 'CSS1.0,CSS2.0,CSS2.1,CSS3.0'; -$GLOBALS['csstidy']['all_properties']['border-right-color'] = 'CSS2.0,CSS2.1,CSS3.0'; -$GLOBALS['csstidy']['all_properties']['border-right-style'] = 'CSS2.0,CSS2.1,CSS3.0'; -$GLOBALS['csstidy']['all_properties']['border-right-width'] = 'CSS1.0,CSS2.0,CSS2.1,CSS3.0'; -$GLOBALS['csstidy']['all_properties']['border-spacing'] = 'CSS2.0,CSS2.1,CSS3.0'; -$GLOBALS['csstidy']['all_properties']['border-style'] = 'CSS1.0,CSS2.0,CSS2.1,CSS3.0'; -$GLOBALS['csstidy']['all_properties']['border-top'] = 'CSS1.0,CSS2.0,CSS2.1,CSS3.0'; -$GLOBALS['csstidy']['all_properties']['border-top-color'] = 'CSS2.0,CSS2.1,CSS3.0'; -$GLOBALS['csstidy']['all_properties']['border-top-left-radius'] = 'CSS3.0'; -$GLOBALS['csstidy']['all_properties']['border-top-right-radius'] = 'CSS3.0'; -$GLOBALS['csstidy']['all_properties']['border-top-style'] = 'CSS2.0,CSS2.1,CSS3.0'; -$GLOBALS['csstidy']['all_properties']['border-top-width'] = 'CSS1.0,CSS2.0,CSS2.1,CSS3.0'; -$GLOBALS['csstidy']['all_properties']['border-width'] = 'CSS1.0,CSS2.0,CSS2.1,CSS3.0'; -$GLOBALS['csstidy']['all_properties']['bottom'] = 'CSS2.0,CSS2.1,CSS3.0'; -$GLOBALS['csstidy']['all_properties']['box-decoration-break'] = 'CSS3.0'; -$GLOBALS['csstidy']['all_properties']['box-shadow'] = 'CSS3.0'; -$GLOBALS['csstidy']['all_properties']['box-sizing'] = 'CSS3.0'; -$GLOBALS['csstidy']['all_properties']['break-after'] = 'CSS3.0'; -$GLOBALS['csstidy']['all_properties']['break-before'] = 'CSS3.0'; -$GLOBALS['csstidy']['all_properties']['break-inside'] = 'CSS3.0'; -$GLOBALS['csstidy']['all_properties']['caption-side'] = 'CSS2.0,CSS2.1,CSS3.0'; -$GLOBALS['csstidy']['all_properties']['clear'] = 'CSS1.0,CSS2.0,CSS2.1,CSS3.0'; -$GLOBALS['csstidy']['all_properties']['clip'] = 'CSS2.0,CSS2.1,CSS3.0'; -$GLOBALS['csstidy']['all_properties']['color'] = 'CSS1.0,CSS2.0,CSS2.1,CSS3.0'; -$GLOBALS['csstidy']['all_properties']['color-profile'] = 'CSS3.0'; -$GLOBALS['csstidy']['all_properties']['column-count'] = 'CSS3.0'; -$GLOBALS['csstidy']['all_properties']['column-fill'] = 'CSS3.0'; -$GLOBALS['csstidy']['all_properties']['column-gap'] = 'CSS3.0'; -$GLOBALS['csstidy']['all_properties']['column-rule'] = 'CSS3.0'; -$GLOBALS['csstidy']['all_properties']['column-rule-color'] = 'CSS3.0'; -$GLOBALS['csstidy']['all_properties']['column-rule-style'] = 'CSS3.0'; -$GLOBALS['csstidy']['all_properties']['column-rule-width'] = 'CSS3.0'; -$GLOBALS['csstidy']['all_properties']['column-span'] = 'CSS3.0'; -$GLOBALS['csstidy']['all_properties']['column-width'] = 'CSS3.0'; -$GLOBALS['csstidy']['all_properties']['columns'] = 'CSS3.0'; -$GLOBALS['csstidy']['all_properties']['content'] = 'CSS2.0,CSS2.1,CSS3.0'; -$GLOBALS['csstidy']['all_properties']['counter-increment'] = 'CSS2.0,CSS2.1,CSS3.0'; -$GLOBALS['csstidy']['all_properties']['counter-reset'] = 'CSS2.0,CSS2.1,CSS3.0'; -$GLOBALS['csstidy']['all_properties']['crop'] = 'CSS3.0'; -$GLOBALS['csstidy']['all_properties']['cue'] = 'CSS2.0,CSS2.1,CSS3.0'; -$GLOBALS['csstidy']['all_properties']['cue-after'] = 'CSS2.0,CSS2.1,CSS3.0'; -$GLOBALS['csstidy']['all_properties']['cue-before'] = 'CSS2.0,CSS2.1,CSS3.0'; -$GLOBALS['csstidy']['all_properties']['cursor'] = 'CSS2.0,CSS2.1,CSS3.0'; -$GLOBALS['csstidy']['all_properties']['direction'] = 'CSS2.0,CSS2.1,CSS3.0'; -$GLOBALS['csstidy']['all_properties']['display'] = 'CSS1.0,CSS2.0,CSS2.1,CSS3.0'; -$GLOBALS['csstidy']['all_properties']['dominant-baseline'] = 'CSS3.0'; -$GLOBALS['csstidy']['all_properties']['drop-initial-after-adjust'] = 'CSS3.0'; -$GLOBALS['csstidy']['all_properties']['drop-initial-after-align'] = 'CSS3.0'; -$GLOBALS['csstidy']['all_properties']['drop-initial-before-adjust'] = 'CSS3.0'; -$GLOBALS['csstidy']['all_properties']['drop-initial-before-align'] = 'CSS3.0'; -$GLOBALS['csstidy']['all_properties']['drop-initial-size'] = 'CSS3.0'; -$GLOBALS['csstidy']['all_properties']['drop-initial-value'] = 'CSS3.0'; -$GLOBALS['csstidy']['all_properties']['elevation'] = 'CSS2.0,CSS2.1,CSS3.0'; -$GLOBALS['csstidy']['all_properties']['empty-cells'] = 'CSS2.0,CSS2.1,CSS3.0'; -$GLOBALS['csstidy']['all_properties']['fit'] = 'CSS3.0'; -$GLOBALS['csstidy']['all_properties']['fit-position'] = 'CSS3.0'; -$GLOBALS['csstidy']['all_properties']['flex-align'] = 'CSS3.0'; -$GLOBALS['csstidy']['all_properties']['flex-flow'] = 'CSS3.0'; -$GLOBALS['csstidy']['all_properties']['flex-line-pack'] = 'CSS3.0'; -$GLOBALS['csstidy']['all_properties']['flex-order'] = 'CSS3.0'; -$GLOBALS['csstidy']['all_properties']['flex-pack'] = 'CSS3.0'; -$GLOBALS['csstidy']['all_properties']['float'] = 'CSS1.0,CSS2.0,CSS2.1,CSS3.0'; -$GLOBALS['csstidy']['all_properties']['float-offset'] = 'CSS3.0'; -$GLOBALS['csstidy']['all_properties']['font'] = 'CSS1.0,CSS2.0,CSS2.1,CSS3.0'; -$GLOBALS['csstidy']['all_properties']['font-family'] = 'CSS1.0,CSS2.0,CSS2.1,CSS3.0'; -$GLOBALS['csstidy']['all_properties']['font-size'] = 'CSS1.0,CSS2.0,CSS2.1,CSS3.0'; -$GLOBALS['csstidy']['all_properties']['font-size-adjust'] = 'CSS2.0,CSS3.0'; -$GLOBALS['csstidy']['all_properties']['font-stretch'] = 'CSS2.0,CSS3.0'; -$GLOBALS['csstidy']['all_properties']['font-style'] = 'CSS1.0,CSS2.0,CSS2.1,CSS3.0'; -$GLOBALS['csstidy']['all_properties']['font-variant'] = 'CSS1.0,CSS2.0,CSS2.1,CSS3.0'; -$GLOBALS['csstidy']['all_properties']['font-weight'] = 'CSS1.0,CSS2.0,CSS2.1,CSS3.0'; -$GLOBALS['csstidy']['all_properties']['grid-columns'] = 'CSS3.0'; -$GLOBALS['csstidy']['all_properties']['grid-rows'] = 'CSS3.0'; -$GLOBALS['csstidy']['all_properties']['hanging-punctuation'] = 'CSS3.0'; -$GLOBALS['csstidy']['all_properties']['height'] = 'CSS1.0,CSS2.0,CSS2.1,CSS3.0'; -$GLOBALS['csstidy']['all_properties']['hyphenate-after'] = 'CSS3.0'; -$GLOBALS['csstidy']['all_properties']['hyphenate-before'] = 'CSS3.0'; -$GLOBALS['csstidy']['all_properties']['hyphenate-character'] = 'CSS3.0'; -$GLOBALS['csstidy']['all_properties']['hyphenate-lines'] = 'CSS3.0'; -$GLOBALS['csstidy']['all_properties']['hyphenate-resource'] = 'CSS3.0'; -$GLOBALS['csstidy']['all_properties']['hyphens'] = 'CSS3.0'; -$GLOBALS['csstidy']['all_properties']['icon'] = 'CSS3.0'; -$GLOBALS['csstidy']['all_properties']['image-orientation'] = 'CSS3.0'; -$GLOBALS['csstidy']['all_properties']['image-rendering'] = 'CSS3.0'; -$GLOBALS['csstidy']['all_properties']['image-resolution'] = 'CSS3.0'; -$GLOBALS['csstidy']['all_properties']['inline-box-align'] = 'CSS3.0'; -$GLOBALS['csstidy']['all_properties']['left'] = 'CSS2.0,CSS2.1,CSS3.0'; -$GLOBALS['csstidy']['all_properties']['letter-spacing'] = 'CSS1.0,CSS2.0,CSS2.1,CSS3.0'; -$GLOBALS['csstidy']['all_properties']['line-break'] = 'CSS3.0'; -$GLOBALS['csstidy']['all_properties']['line-height'] = 'CSS1.0,CSS2.0,CSS2.1,CSS3.0'; -$GLOBALS['csstidy']['all_properties']['line-stacking'] = 'CSS3.0'; -$GLOBALS['csstidy']['all_properties']['line-stacking-ruby'] = 'CSS3.0'; -$GLOBALS['csstidy']['all_properties']['line-stacking-shift'] = 'CSS3.0'; -$GLOBALS['csstidy']['all_properties']['line-stacking-strategy'] = 'CSS3.0'; -$GLOBALS['csstidy']['all_properties']['list-style'] = 'CSS1.0,CSS2.0,CSS2.1,CSS3.0'; -$GLOBALS['csstidy']['all_properties']['list-style-image'] = 'CSS1.0,CSS2.0,CSS2.1,CSS3.0'; -$GLOBALS['csstidy']['all_properties']['list-style-position'] = 'CSS1.0,CSS2.0,CSS2.1,CSS3.0'; -$GLOBALS['csstidy']['all_properties']['list-style-type'] = 'CSS1.0,CSS2.0,CSS2.1,CSS3.0'; -$GLOBALS['csstidy']['all_properties']['margin'] = 'CSS1.0,CSS2.0,CSS2.1,CSS3.0'; -$GLOBALS['csstidy']['all_properties']['margin-bottom'] = 'CSS1.0,CSS2.0,CSS2.1,CSS3.0'; -$GLOBALS['csstidy']['all_properties']['margin-left'] = 'CSS1.0,CSS2.0,CSS2.1,CSS3.0'; -$GLOBALS['csstidy']['all_properties']['margin-right'] = 'CSS1.0,CSS2.0,CSS2.1,CSS3.0'; -$GLOBALS['csstidy']['all_properties']['margin-top'] = 'CSS1.0,CSS2.0,CSS2.1,CSS3.0'; -$GLOBALS['csstidy']['all_properties']['marker-offset'] = 'CSS2.0,CSS3.0'; -$GLOBALS['csstidy']['all_properties']['marks'] = 'CSS2.0,CSS3.0'; -$GLOBALS['csstidy']['all_properties']['marquee-direction'] = 'CSS3.0'; -$GLOBALS['csstidy']['all_properties']['marquee-loop'] = 'CSS3.0'; -$GLOBALS['csstidy']['all_properties']['marquee-play-count'] = 'CSS3.0'; -$GLOBALS['csstidy']['all_properties']['marquee-speed'] = 'CSS3.0'; -$GLOBALS['csstidy']['all_properties']['marquee-style'] = 'CSS3.0'; -$GLOBALS['csstidy']['all_properties']['max-height'] = 'CSS2.0,CSS2.1,CSS3.0'; -$GLOBALS['csstidy']['all_properties']['max-width'] = 'CSS2.0,CSS2.1,CSS3.0'; -$GLOBALS['csstidy']['all_properties']['min-height'] = 'CSS2.0,CSS2.1,CSS3.0'; -$GLOBALS['csstidy']['all_properties']['min-width'] = 'CSS2.0,CSS2.1,CSS3.0'; -$GLOBALS['csstidy']['all_properties']['move-to'] = 'CSS3.0'; -$GLOBALS['csstidy']['all_properties']['nav-down'] = 'CSS3.0'; -$GLOBALS['csstidy']['all_properties']['nav-index'] = 'CSS3.0'; -$GLOBALS['csstidy']['all_properties']['nav-left'] = 'CSS3.0'; -$GLOBALS['csstidy']['all_properties']['nav-right'] = 'CSS3.0'; -$GLOBALS['csstidy']['all_properties']['nav-up'] = 'CSS3.0'; -$GLOBALS['csstidy']['all_properties']['opacity'] = 'CSS3.0'; -$GLOBALS['csstidy']['all_properties']['orphans'] = 'CSS2.0,CSS2.1,CSS3.0'; -$GLOBALS['csstidy']['all_properties']['outline'] = 'CSS2.0,CSS2.1,CSS3.0'; -$GLOBALS['csstidy']['all_properties']['outline-color'] = 'CSS2.0,CSS2.1,CSS3.0'; -$GLOBALS['csstidy']['all_properties']['outline-offset'] = 'CSS3.0'; -$GLOBALS['csstidy']['all_properties']['outline-style'] = 'CSS2.0,CSS2.1,CSS3.0'; -$GLOBALS['csstidy']['all_properties']['outline-width'] = 'CSS2.0,CSS2.1,CSS3.0'; -$GLOBALS['csstidy']['all_properties']['overflow'] = 'CSS2.0,CSS2.1,CSS3.0'; -$GLOBALS['csstidy']['all_properties']['overflow-style'] = 'CSS3.0'; -$GLOBALS['csstidy']['all_properties']['overflow-wrap'] = 'CSS3.0'; -$GLOBALS['csstidy']['all_properties']['overflow-x'] = 'CSS3.0'; -$GLOBALS['csstidy']['all_properties']['overflow-y'] = 'CSS3.0'; -$GLOBALS['csstidy']['all_properties']['padding'] = 'CSS1.0,CSS2.0,CSS2.1,CSS3.0'; -$GLOBALS['csstidy']['all_properties']['padding-bottom'] = 'CSS1.0,CSS2.0,CSS2.1,CSS3.0'; -$GLOBALS['csstidy']['all_properties']['padding-left'] = 'CSS1.0,CSS2.0,CSS2.1,CSS3.0'; -$GLOBALS['csstidy']['all_properties']['padding-right'] = 'CSS1.0,CSS2.0,CSS2.1,CSS3.0'; -$GLOBALS['csstidy']['all_properties']['padding-top'] = 'CSS1.0,CSS2.0,CSS2.1,CSS3.0'; -$GLOBALS['csstidy']['all_properties']['page'] = 'CSS2.0,CSS3.0'; -$GLOBALS['csstidy']['all_properties']['page-break-after'] = 'CSS2.0,CSS2.1,CSS3.0'; -$GLOBALS['csstidy']['all_properties']['page-break-before'] = 'CSS2.0,CSS2.1,CSS3.0'; -$GLOBALS['csstidy']['all_properties']['page-break-inside'] = 'CSS2.0,CSS2.1,CSS3.0'; -$GLOBALS['csstidy']['all_properties']['page-policy'] = 'CSS3.0'; -$GLOBALS['csstidy']['all_properties']['pause'] = 'CSS2.0,CSS2.1,CSS3.0'; -$GLOBALS['csstidy']['all_properties']['pause-after'] = 'CSS2.0,CSS2.1,CSS3.0'; -$GLOBALS['csstidy']['all_properties']['pause-before'] = 'CSS2.0,CSS2.1,CSS3.0'; -$GLOBALS['csstidy']['all_properties']['perspective'] = 'CSS3.0'; -$GLOBALS['csstidy']['all_properties']['perspective-origin'] = 'CSS3.0'; -$GLOBALS['csstidy']['all_properties']['phonemes'] = 'CSS3.0'; -$GLOBALS['csstidy']['all_properties']['pitch'] = 'CSS2.0,CSS2.1,CSS3.0'; -$GLOBALS['csstidy']['all_properties']['pitch-range'] = 'CSS2.0,CSS2.1,CSS3.0'; -$GLOBALS['csstidy']['all_properties']['play-during'] = 'CSS2.0,CSS2.1,CSS3.0'; -$GLOBALS['csstidy']['all_properties']['position'] = 'CSS2.0,CSS2.1,CSS3.0'; -$GLOBALS['csstidy']['all_properties']['presentation-level'] = 'CSS3.0'; -$GLOBALS['csstidy']['all_properties']['punctuation-trim'] = 'CSS3.0'; -$GLOBALS['csstidy']['all_properties']['quotes'] = 'CSS2.0,CSS2.1,CSS3.0'; -$GLOBALS['csstidy']['all_properties']['rendering-intent'] = 'CSS3.0'; -$GLOBALS['csstidy']['all_properties']['resize'] = 'CSS3.0'; -$GLOBALS['csstidy']['all_properties']['rest'] = 'CSS3.0'; -$GLOBALS['csstidy']['all_properties']['rest-after'] = 'CSS3.0'; -$GLOBALS['csstidy']['all_properties']['rest-before'] = 'CSS3.0'; -$GLOBALS['csstidy']['all_properties']['richness'] = 'CSS2.0,CSS2.1,CSS3.0'; -$GLOBALS['csstidy']['all_properties']['right'] = 'CSS2.0,CSS2.1,CSS3.0'; -$GLOBALS['csstidy']['all_properties']['rotation'] = 'CSS3.0'; -$GLOBALS['csstidy']['all_properties']['rotation-point'] = 'CSS3.0'; -$GLOBALS['csstidy']['all_properties']['ruby-align'] = 'CSS3.0'; -$GLOBALS['csstidy']['all_properties']['ruby-overhang'] = 'CSS3.0'; -$GLOBALS['csstidy']['all_properties']['ruby-position'] = 'CSS3.0'; -$GLOBALS['csstidy']['all_properties']['ruby-span'] = 'CSS3.0'; -$GLOBALS['csstidy']['all_properties']['size'] = 'CSS2.0,CSS3.0'; -$GLOBALS['csstidy']['all_properties']['speak'] = 'CSS2.0,CSS2.1,CSS3.0'; -$GLOBALS['csstidy']['all_properties']['speak-header'] = 'CSS2.0,CSS2.1,CSS3.0'; -$GLOBALS['csstidy']['all_properties']['speak-numeral'] = 'CSS2.0,CSS2.1,CSS3.0'; -$GLOBALS['csstidy']['all_properties']['speak-punctuation'] = 'CSS2.0,CSS2.1,CSS3.0'; -$GLOBALS['csstidy']['all_properties']['speech-rate'] = 'CSS2.0,CSS2.1,CSS3.0'; -$GLOBALS['csstidy']['all_properties']['src'] = 'CSS3.0'; -$GLOBALS['csstidy']['all_properties']['stress'] = 'CSS2.0,CSS2.1,CSS3.0'; -$GLOBALS['csstidy']['all_properties']['string-set'] = 'CSS3.0'; -$GLOBALS['csstidy']['all_properties']['tab-size'] = 'CSS3.0'; -$GLOBALS['csstidy']['all_properties']['table-layout'] = 'CSS2.0,CSS2.1,CSS3.0'; -$GLOBALS['csstidy']['all_properties']['target'] = 'CSS3.0'; -$GLOBALS['csstidy']['all_properties']['target-name'] = 'CSS3.0'; -$GLOBALS['csstidy']['all_properties']['target-new'] = 'CSS3.0'; -$GLOBALS['csstidy']['all_properties']['target-position'] = 'CSS3.0'; -$GLOBALS['csstidy']['all_properties']['text-align'] = 'CSS1.0,CSS2.0,CSS2.1,CSS3.0'; -$GLOBALS['csstidy']['all_properties']['text-align-last'] = 'CSS3.0'; -$GLOBALS['csstidy']['all_properties']['text-decoration'] = 'CSS1.0,CSS2.0,CSS2.1,CSS3.0'; -$GLOBALS['csstidy']['all_properties']['text-decoration-color'] = 'CSS3.0'; -$GLOBALS['csstidy']['all_properties']['text-decoration-line'] = 'CSS3.0'; -$GLOBALS['csstidy']['all_properties']['text-decoration-skip'] = 'CSS3.0'; -$GLOBALS['csstidy']['all_properties']['text-decoration-style'] = 'CSS3.0'; -$GLOBALS['csstidy']['all_properties']['text-emphasis'] = 'CSS3.0'; -$GLOBALS['csstidy']['all_properties']['text-emphasis-color'] = 'CSS3.0'; -$GLOBALS['csstidy']['all_properties']['text-emphasis-position'] = 'CSS3.0'; -$GLOBALS['csstidy']['all_properties']['text-emphasis-style'] = 'CSS3.0'; -$GLOBALS['csstidy']['all_properties']['text-height'] = 'CSS3.0'; -$GLOBALS['csstidy']['all_properties']['text-indent'] = 'CSS1.0,CSS2.0,CSS2.1,CSS3.0'; -$GLOBALS['csstidy']['all_properties']['text-justify'] = 'CSS3.0'; -$GLOBALS['csstidy']['all_properties']['text-outline'] = 'CSS3.0'; -$GLOBALS['csstidy']['all_properties']['text-shadow'] = 'CSS2.0,CSS3.0'; -$GLOBALS['csstidy']['all_properties']['text-space-collapse'] = 'CSS3.0'; -$GLOBALS['csstidy']['all_properties']['text-transform'] = 'CSS1.0,CSS2.0,CSS2.1,CSS3.0'; -$GLOBALS['csstidy']['all_properties']['text-underline-position'] = 'CSS3.0'; -$GLOBALS['csstidy']['all_properties']['text-wrap'] = 'CSS3.0'; -$GLOBALS['csstidy']['all_properties']['top'] = 'CSS2.0,CSS2.1,CSS3.0'; -$GLOBALS['csstidy']['all_properties']['transform'] = 'CSS3.0'; -$GLOBALS['csstidy']['all_properties']['transform-origin'] = 'CSS3.0'; -$GLOBALS['csstidy']['all_properties']['transform-style'] = 'CSS3.0'; -$GLOBALS['csstidy']['all_properties']['transition'] = 'CSS3.0'; -$GLOBALS['csstidy']['all_properties']['transition-delay'] = 'CSS3.0'; -$GLOBALS['csstidy']['all_properties']['transition-duration'] = 'CSS3.0'; -$GLOBALS['csstidy']['all_properties']['transition-property'] = 'CSS3.0'; -$GLOBALS['csstidy']['all_properties']['transition-timing-function'] = 'CSS3.0'; -$GLOBALS['csstidy']['all_properties']['unicode-bidi'] = 'CSS2.0,CSS2.1,CSS3.0'; -$GLOBALS['csstidy']['all_properties']['vertical-align'] = 'CSS1.0,CSS2.0,CSS2.1,CSS3.0'; -$GLOBALS['csstidy']['all_properties']['visibility'] = 'CSS2.0,CSS2.1,CSS3.0'; -$GLOBALS['csstidy']['all_properties']['voice-balance'] = 'CSS3.0'; -$GLOBALS['csstidy']['all_properties']['voice-duration'] = 'CSS3.0'; -$GLOBALS['csstidy']['all_properties']['voice-family'] = 'CSS2.0,CSS2.1,CSS3.0'; -$GLOBALS['csstidy']['all_properties']['voice-pitch'] = 'CSS3.0'; -$GLOBALS['csstidy']['all_properties']['voice-pitch-range'] = 'CSS3.0'; -$GLOBALS['csstidy']['all_properties']['voice-rate'] = 'CSS3.0'; -$GLOBALS['csstidy']['all_properties']['voice-stress'] = 'CSS3.0'; -$GLOBALS['csstidy']['all_properties']['voice-volume'] = 'CSS3.0'; -$GLOBALS['csstidy']['all_properties']['volume'] = 'CSS2.0,CSS2.1,CSS3.0'; -$GLOBALS['csstidy']['all_properties']['white-space'] = 'CSS1.0,CSS2.0,CSS2.1,CSS3.0'; -$GLOBALS['csstidy']['all_properties']['widows'] = 'CSS2.0,CSS2.1,CSS3.0'; -$GLOBALS['csstidy']['all_properties']['width'] = 'CSS1.0,CSS2.0,CSS2.1,CSS3.0'; -$GLOBALS['csstidy']['all_properties']['word-break'] = 'CSS3.0'; -$GLOBALS['csstidy']['all_properties']['word-spacing'] = 'CSS1.0,CSS2.0,CSS2.1,CSS3.0'; -$GLOBALS['csstidy']['all_properties']['word-wrap'] = 'CSS3.0'; -$GLOBALS['csstidy']['all_properties']['z-index'] = 'CSS2.0,CSS2.1,CSS3.0'; +$data['csstidy']['all_properties']['alignment-adjust'] = 'CSS3.0'; +$data['csstidy']['all_properties']['alignment-baseline'] = 'CSS3.0'; +$data['csstidy']['all_properties']['animation'] = 'CSS3.0'; +$data['csstidy']['all_properties']['animation-delay'] = 'CSS3.0'; +$data['csstidy']['all_properties']['animation-direction'] = 'CSS3.0'; +$data['csstidy']['all_properties']['animation-duration'] = 'CSS3.0'; +$data['csstidy']['all_properties']['animation-iteration-count'] = 'CSS3.0'; +$data['csstidy']['all_properties']['animation-name'] = 'CSS3.0'; +$data['csstidy']['all_properties']['animation-play-state'] = 'CSS3.0'; +$data['csstidy']['all_properties']['animation-timing-function'] = 'CSS3.0'; +$data['csstidy']['all_properties']['appearance'] = 'CSS3.0'; +$data['csstidy']['all_properties']['azimuth'] = 'CSS2.0,CSS2.1,CSS3.0'; +$data['csstidy']['all_properties']['backface-visibility'] = 'CSS3.0'; +$data['csstidy']['all_properties']['background'] = 'CSS1.0,CSS2.0,CSS2.1,CSS3.0'; +$data['csstidy']['all_properties']['background-attachment'] = 'CSS1.0,CSS2.0,CSS2.1,CSS3.0'; +$data['csstidy']['all_properties']['background-clip'] = 'CSS3.0'; +$data['csstidy']['all_properties']['background-color'] = 'CSS1.0,CSS2.0,CSS2.1,CSS3.0'; +$data['csstidy']['all_properties']['background-image'] = 'CSS1.0,CSS2.0,CSS2.1,CSS3.0'; +$data['csstidy']['all_properties']['background-origin'] = 'CSS3.0'; +$data['csstidy']['all_properties']['background-position'] = 'CSS1.0,CSS2.0,CSS2.1,CSS3.0'; +$data['csstidy']['all_properties']['background-repeat'] = 'CSS1.0,CSS2.0,CSS2.1,CSS3.0'; +$data['csstidy']['all_properties']['background-size'] = 'CSS3.0'; +$data['csstidy']['all_properties']['baseline-shift'] = 'CSS3.0'; +$data['csstidy']['all_properties']['binding'] = 'CSS3.0'; +$data['csstidy']['all_properties']['bleed'] = 'CSS3.0'; +$data['csstidy']['all_properties']['bookmark-label'] = 'CSS3.0'; +$data['csstidy']['all_properties']['bookmark-level'] = 'CSS3.0'; +$data['csstidy']['all_properties']['bookmark-state'] = 'CSS3.0'; +$data['csstidy']['all_properties']['bookmark-target'] = 'CSS3.0'; +$data['csstidy']['all_properties']['border'] = 'CSS1.0,CSS2.0,CSS2.1,CSS3.0'; +$data['csstidy']['all_properties']['border-bottom'] = 'CSS1.0,CSS2.0,CSS2.1,CSS3.0'; +$data['csstidy']['all_properties']['border-bottom-color'] = 'CSS2.0,CSS2.1,CSS3.0'; +$data['csstidy']['all_properties']['border-bottom-left-radius'] = 'CSS3.0'; +$data['csstidy']['all_properties']['border-bottom-right-radius'] = 'CSS3.0'; +$data['csstidy']['all_properties']['border-bottom-style'] = 'CSS2.0,CSS2.1,CSS3.0'; +$data['csstidy']['all_properties']['border-bottom-width'] = 'CSS1.0,CSS2.0,CSS2.1,CSS3.0'; +$data['csstidy']['all_properties']['border-collapse'] = 'CSS2.0,CSS2.1,CSS3.0'; +$data['csstidy']['all_properties']['border-color'] = 'CSS1.0,CSS2.0,CSS2.1,CSS3.0'; +$data['csstidy']['all_properties']['border-image'] = 'CSS3.0'; +$data['csstidy']['all_properties']['border-image-outset'] = 'CSS3.0'; +$data['csstidy']['all_properties']['border-image-repeat'] = 'CSS3.0'; +$data['csstidy']['all_properties']['border-image-slice'] = 'CSS3.0'; +$data['csstidy']['all_properties']['border-image-source'] = 'CSS3.0'; +$data['csstidy']['all_properties']['border-image-width'] = 'CSS3.0'; +$data['csstidy']['all_properties']['border-left'] = 'CSS1.0,CSS2.0,CSS2.1,CSS3.0'; +$data['csstidy']['all_properties']['border-left-color'] = 'CSS2.0,CSS2.1,CSS3.0'; +$data['csstidy']['all_properties']['border-left-style'] = 'CSS2.0,CSS2.1,CSS3.0'; +$data['csstidy']['all_properties']['border-left-width'] = 'CSS1.0,CSS2.0,CSS2.1,CSS3.0'; +$data['csstidy']['all_properties']['border-radius'] = 'CSS3.0'; +$data['csstidy']['all_properties']['border-right'] = 'CSS1.0,CSS2.0,CSS2.1,CSS3.0'; +$data['csstidy']['all_properties']['border-right-color'] = 'CSS2.0,CSS2.1,CSS3.0'; +$data['csstidy']['all_properties']['border-right-style'] = 'CSS2.0,CSS2.1,CSS3.0'; +$data['csstidy']['all_properties']['border-right-width'] = 'CSS1.0,CSS2.0,CSS2.1,CSS3.0'; +$data['csstidy']['all_properties']['border-spacing'] = 'CSS2.0,CSS2.1,CSS3.0'; +$data['csstidy']['all_properties']['border-style'] = 'CSS1.0,CSS2.0,CSS2.1,CSS3.0'; +$data['csstidy']['all_properties']['border-top'] = 'CSS1.0,CSS2.0,CSS2.1,CSS3.0'; +$data['csstidy']['all_properties']['border-top-color'] = 'CSS2.0,CSS2.1,CSS3.0'; +$data['csstidy']['all_properties']['border-top-left-radius'] = 'CSS3.0'; +$data['csstidy']['all_properties']['border-top-right-radius'] = 'CSS3.0'; +$data['csstidy']['all_properties']['border-top-style'] = 'CSS2.0,CSS2.1,CSS3.0'; +$data['csstidy']['all_properties']['border-top-width'] = 'CSS1.0,CSS2.0,CSS2.1,CSS3.0'; +$data['csstidy']['all_properties']['border-width'] = 'CSS1.0,CSS2.0,CSS2.1,CSS3.0'; +$data['csstidy']['all_properties']['bottom'] = 'CSS2.0,CSS2.1,CSS3.0'; +$data['csstidy']['all_properties']['box-decoration-break'] = 'CSS3.0'; +$data['csstidy']['all_properties']['box-shadow'] = 'CSS3.0'; +$data['csstidy']['all_properties']['box-sizing'] = 'CSS3.0'; +$data['csstidy']['all_properties']['break-after'] = 'CSS3.0'; +$data['csstidy']['all_properties']['break-before'] = 'CSS3.0'; +$data['csstidy']['all_properties']['break-inside'] = 'CSS3.0'; +$data['csstidy']['all_properties']['caption-side'] = 'CSS2.0,CSS2.1,CSS3.0'; +$data['csstidy']['all_properties']['clear'] = 'CSS1.0,CSS2.0,CSS2.1,CSS3.0'; +$data['csstidy']['all_properties']['clip'] = 'CSS2.0,CSS2.1,CSS3.0'; +$data['csstidy']['all_properties']['color'] = 'CSS1.0,CSS2.0,CSS2.1,CSS3.0'; +$data['csstidy']['all_properties']['color-profile'] = 'CSS3.0'; +$data['csstidy']['all_properties']['column-count'] = 'CSS3.0'; +$data['csstidy']['all_properties']['column-fill'] = 'CSS3.0'; +$data['csstidy']['all_properties']['column-gap'] = 'CSS3.0'; +$data['csstidy']['all_properties']['column-rule'] = 'CSS3.0'; +$data['csstidy']['all_properties']['column-rule-color'] = 'CSS3.0'; +$data['csstidy']['all_properties']['column-rule-style'] = 'CSS3.0'; +$data['csstidy']['all_properties']['column-rule-width'] = 'CSS3.0'; +$data['csstidy']['all_properties']['column-span'] = 'CSS3.0'; +$data['csstidy']['all_properties']['column-width'] = 'CSS3.0'; +$data['csstidy']['all_properties']['columns'] = 'CSS3.0'; +$data['csstidy']['all_properties']['content'] = 'CSS2.0,CSS2.1,CSS3.0'; +$data['csstidy']['all_properties']['counter-increment'] = 'CSS2.0,CSS2.1,CSS3.0'; +$data['csstidy']['all_properties']['counter-reset'] = 'CSS2.0,CSS2.1,CSS3.0'; +$data['csstidy']['all_properties']['crop'] = 'CSS3.0'; +$data['csstidy']['all_properties']['cue'] = 'CSS2.0,CSS2.1,CSS3.0'; +$data['csstidy']['all_properties']['cue-after'] = 'CSS2.0,CSS2.1,CSS3.0'; +$data['csstidy']['all_properties']['cue-before'] = 'CSS2.0,CSS2.1,CSS3.0'; +$data['csstidy']['all_properties']['cursor'] = 'CSS2.0,CSS2.1,CSS3.0'; +$data['csstidy']['all_properties']['direction'] = 'CSS2.0,CSS2.1,CSS3.0'; +$data['csstidy']['all_properties']['display'] = 'CSS1.0,CSS2.0,CSS2.1,CSS3.0'; +$data['csstidy']['all_properties']['dominant-baseline'] = 'CSS3.0'; +$data['csstidy']['all_properties']['drop-initial-after-adjust'] = 'CSS3.0'; +$data['csstidy']['all_properties']['drop-initial-after-align'] = 'CSS3.0'; +$data['csstidy']['all_properties']['drop-initial-before-adjust'] = 'CSS3.0'; +$data['csstidy']['all_properties']['drop-initial-before-align'] = 'CSS3.0'; +$data['csstidy']['all_properties']['drop-initial-size'] = 'CSS3.0'; +$data['csstidy']['all_properties']['drop-initial-value'] = 'CSS3.0'; +$data['csstidy']['all_properties']['elevation'] = 'CSS2.0,CSS2.1,CSS3.0'; +$data['csstidy']['all_properties']['empty-cells'] = 'CSS2.0,CSS2.1,CSS3.0'; +$data['csstidy']['all_properties']['fit'] = 'CSS3.0'; +$data['csstidy']['all_properties']['fit-position'] = 'CSS3.0'; +$data['csstidy']['all_properties']['flex-align'] = 'CSS3.0'; +$data['csstidy']['all_properties']['flex-flow'] = 'CSS3.0'; +$data['csstidy']['all_properties']['flex-line-pack'] = 'CSS3.0'; +$data['csstidy']['all_properties']['flex-order'] = 'CSS3.0'; +$data['csstidy']['all_properties']['flex-pack'] = 'CSS3.0'; +$data['csstidy']['all_properties']['float'] = 'CSS1.0,CSS2.0,CSS2.1,CSS3.0'; +$data['csstidy']['all_properties']['float-offset'] = 'CSS3.0'; +$data['csstidy']['all_properties']['font'] = 'CSS1.0,CSS2.0,CSS2.1,CSS3.0'; +$data['csstidy']['all_properties']['font-family'] = 'CSS1.0,CSS2.0,CSS2.1,CSS3.0'; +$data['csstidy']['all_properties']['font-size'] = 'CSS1.0,CSS2.0,CSS2.1,CSS3.0'; +$data['csstidy']['all_properties']['font-size-adjust'] = 'CSS2.0,CSS3.0'; +$data['csstidy']['all_properties']['font-stretch'] = 'CSS2.0,CSS3.0'; +$data['csstidy']['all_properties']['font-style'] = 'CSS1.0,CSS2.0,CSS2.1,CSS3.0'; +$data['csstidy']['all_properties']['font-variant'] = 'CSS1.0,CSS2.0,CSS2.1,CSS3.0'; +$data['csstidy']['all_properties']['font-weight'] = 'CSS1.0,CSS2.0,CSS2.1,CSS3.0'; +$data['csstidy']['all_properties']['grid-columns'] = 'CSS3.0'; +$data['csstidy']['all_properties']['grid-rows'] = 'CSS3.0'; +$data['csstidy']['all_properties']['hanging-punctuation'] = 'CSS3.0'; +$data['csstidy']['all_properties']['height'] = 'CSS1.0,CSS2.0,CSS2.1,CSS3.0'; +$data['csstidy']['all_properties']['hyphenate-after'] = 'CSS3.0'; +$data['csstidy']['all_properties']['hyphenate-before'] = 'CSS3.0'; +$data['csstidy']['all_properties']['hyphenate-character'] = 'CSS3.0'; +$data['csstidy']['all_properties']['hyphenate-lines'] = 'CSS3.0'; +$data['csstidy']['all_properties']['hyphenate-resource'] = 'CSS3.0'; +$data['csstidy']['all_properties']['hyphens'] = 'CSS3.0'; +$data['csstidy']['all_properties']['icon'] = 'CSS3.0'; +$data['csstidy']['all_properties']['image-orientation'] = 'CSS3.0'; +$data['csstidy']['all_properties']['image-rendering'] = 'CSS3.0'; +$data['csstidy']['all_properties']['image-resolution'] = 'CSS3.0'; +$data['csstidy']['all_properties']['inline-box-align'] = 'CSS3.0'; +$data['csstidy']['all_properties']['left'] = 'CSS2.0,CSS2.1,CSS3.0'; +$data['csstidy']['all_properties']['letter-spacing'] = 'CSS1.0,CSS2.0,CSS2.1,CSS3.0'; +$data['csstidy']['all_properties']['line-break'] = 'CSS3.0'; +$data['csstidy']['all_properties']['line-height'] = 'CSS1.0,CSS2.0,CSS2.1,CSS3.0'; +$data['csstidy']['all_properties']['line-stacking'] = 'CSS3.0'; +$data['csstidy']['all_properties']['line-stacking-ruby'] = 'CSS3.0'; +$data['csstidy']['all_properties']['line-stacking-shift'] = 'CSS3.0'; +$data['csstidy']['all_properties']['line-stacking-strategy'] = 'CSS3.0'; +$data['csstidy']['all_properties']['list-style'] = 'CSS1.0,CSS2.0,CSS2.1,CSS3.0'; +$data['csstidy']['all_properties']['list-style-image'] = 'CSS1.0,CSS2.0,CSS2.1,CSS3.0'; +$data['csstidy']['all_properties']['list-style-position'] = 'CSS1.0,CSS2.0,CSS2.1,CSS3.0'; +$data['csstidy']['all_properties']['list-style-type'] = 'CSS1.0,CSS2.0,CSS2.1,CSS3.0'; +$data['csstidy']['all_properties']['margin'] = 'CSS1.0,CSS2.0,CSS2.1,CSS3.0'; +$data['csstidy']['all_properties']['margin-bottom'] = 'CSS1.0,CSS2.0,CSS2.1,CSS3.0'; +$data['csstidy']['all_properties']['margin-left'] = 'CSS1.0,CSS2.0,CSS2.1,CSS3.0'; +$data['csstidy']['all_properties']['margin-right'] = 'CSS1.0,CSS2.0,CSS2.1,CSS3.0'; +$data['csstidy']['all_properties']['margin-top'] = 'CSS1.0,CSS2.0,CSS2.1,CSS3.0'; +$data['csstidy']['all_properties']['marker-offset'] = 'CSS2.0,CSS3.0'; +$data['csstidy']['all_properties']['marks'] = 'CSS2.0,CSS3.0'; +$data['csstidy']['all_properties']['marquee-direction'] = 'CSS3.0'; +$data['csstidy']['all_properties']['marquee-loop'] = 'CSS3.0'; +$data['csstidy']['all_properties']['marquee-play-count'] = 'CSS3.0'; +$data['csstidy']['all_properties']['marquee-speed'] = 'CSS3.0'; +$data['csstidy']['all_properties']['marquee-style'] = 'CSS3.0'; +$data['csstidy']['all_properties']['max-height'] = 'CSS2.0,CSS2.1,CSS3.0'; +$data['csstidy']['all_properties']['max-width'] = 'CSS2.0,CSS2.1,CSS3.0'; +$data['csstidy']['all_properties']['min-height'] = 'CSS2.0,CSS2.1,CSS3.0'; +$data['csstidy']['all_properties']['min-width'] = 'CSS2.0,CSS2.1,CSS3.0'; +$data['csstidy']['all_properties']['move-to'] = 'CSS3.0'; +$data['csstidy']['all_properties']['nav-down'] = 'CSS3.0'; +$data['csstidy']['all_properties']['nav-index'] = 'CSS3.0'; +$data['csstidy']['all_properties']['nav-left'] = 'CSS3.0'; +$data['csstidy']['all_properties']['nav-right'] = 'CSS3.0'; +$data['csstidy']['all_properties']['nav-up'] = 'CSS3.0'; +$data['csstidy']['all_properties']['opacity'] = 'CSS3.0'; +$data['csstidy']['all_properties']['orphans'] = 'CSS2.0,CSS2.1,CSS3.0'; +$data['csstidy']['all_properties']['outline'] = 'CSS2.0,CSS2.1,CSS3.0'; +$data['csstidy']['all_properties']['outline-color'] = 'CSS2.0,CSS2.1,CSS3.0'; +$data['csstidy']['all_properties']['outline-offset'] = 'CSS3.0'; +$data['csstidy']['all_properties']['outline-style'] = 'CSS2.0,CSS2.1,CSS3.0'; +$data['csstidy']['all_properties']['outline-width'] = 'CSS2.0,CSS2.1,CSS3.0'; +$data['csstidy']['all_properties']['overflow'] = 'CSS2.0,CSS2.1,CSS3.0'; +$data['csstidy']['all_properties']['overflow-style'] = 'CSS3.0'; +$data['csstidy']['all_properties']['overflow-wrap'] = 'CSS3.0'; +$data['csstidy']['all_properties']['overflow-x'] = 'CSS3.0'; +$data['csstidy']['all_properties']['overflow-y'] = 'CSS3.0'; +$data['csstidy']['all_properties']['padding'] = 'CSS1.0,CSS2.0,CSS2.1,CSS3.0'; +$data['csstidy']['all_properties']['padding-bottom'] = 'CSS1.0,CSS2.0,CSS2.1,CSS3.0'; +$data['csstidy']['all_properties']['padding-left'] = 'CSS1.0,CSS2.0,CSS2.1,CSS3.0'; +$data['csstidy']['all_properties']['padding-right'] = 'CSS1.0,CSS2.0,CSS2.1,CSS3.0'; +$data['csstidy']['all_properties']['padding-top'] = 'CSS1.0,CSS2.0,CSS2.1,CSS3.0'; +$data['csstidy']['all_properties']['page'] = 'CSS2.0,CSS3.0'; +$data['csstidy']['all_properties']['page-break-after'] = 'CSS2.0,CSS2.1,CSS3.0'; +$data['csstidy']['all_properties']['page-break-before'] = 'CSS2.0,CSS2.1,CSS3.0'; +$data['csstidy']['all_properties']['page-break-inside'] = 'CSS2.0,CSS2.1,CSS3.0'; +$data['csstidy']['all_properties']['page-policy'] = 'CSS3.0'; +$data['csstidy']['all_properties']['pause'] = 'CSS2.0,CSS2.1,CSS3.0'; +$data['csstidy']['all_properties']['pause-after'] = 'CSS2.0,CSS2.1,CSS3.0'; +$data['csstidy']['all_properties']['pause-before'] = 'CSS2.0,CSS2.1,CSS3.0'; +$data['csstidy']['all_properties']['perspective'] = 'CSS3.0'; +$data['csstidy']['all_properties']['perspective-origin'] = 'CSS3.0'; +$data['csstidy']['all_properties']['phonemes'] = 'CSS3.0'; +$data['csstidy']['all_properties']['pitch'] = 'CSS2.0,CSS2.1,CSS3.0'; +$data['csstidy']['all_properties']['pitch-range'] = 'CSS2.0,CSS2.1,CSS3.0'; +$data['csstidy']['all_properties']['play-during'] = 'CSS2.0,CSS2.1,CSS3.0'; +$data['csstidy']['all_properties']['position'] = 'CSS2.0,CSS2.1,CSS3.0'; +$data['csstidy']['all_properties']['presentation-level'] = 'CSS3.0'; +$data['csstidy']['all_properties']['punctuation-trim'] = 'CSS3.0'; +$data['csstidy']['all_properties']['quotes'] = 'CSS2.0,CSS2.1,CSS3.0'; +$data['csstidy']['all_properties']['rendering-intent'] = 'CSS3.0'; +$data['csstidy']['all_properties']['resize'] = 'CSS3.0'; +$data['csstidy']['all_properties']['rest'] = 'CSS3.0'; +$data['csstidy']['all_properties']['rest-after'] = 'CSS3.0'; +$data['csstidy']['all_properties']['rest-before'] = 'CSS3.0'; +$data['csstidy']['all_properties']['richness'] = 'CSS2.0,CSS2.1,CSS3.0'; +$data['csstidy']['all_properties']['right'] = 'CSS2.0,CSS2.1,CSS3.0'; +$data['csstidy']['all_properties']['rotation'] = 'CSS3.0'; +$data['csstidy']['all_properties']['rotation-point'] = 'CSS3.0'; +$data['csstidy']['all_properties']['ruby-align'] = 'CSS3.0'; +$data['csstidy']['all_properties']['ruby-overhang'] = 'CSS3.0'; +$data['csstidy']['all_properties']['ruby-position'] = 'CSS3.0'; +$data['csstidy']['all_properties']['ruby-span'] = 'CSS3.0'; +$data['csstidy']['all_properties']['size'] = 'CSS2.0,CSS3.0'; +$data['csstidy']['all_properties']['speak'] = 'CSS2.0,CSS2.1,CSS3.0'; +$data['csstidy']['all_properties']['speak-header'] = 'CSS2.0,CSS2.1,CSS3.0'; +$data['csstidy']['all_properties']['speak-numeral'] = 'CSS2.0,CSS2.1,CSS3.0'; +$data['csstidy']['all_properties']['speak-punctuation'] = 'CSS2.0,CSS2.1,CSS3.0'; +$data['csstidy']['all_properties']['speech-rate'] = 'CSS2.0,CSS2.1,CSS3.0'; +$data['csstidy']['all_properties']['src'] = 'CSS3.0'; +$data['csstidy']['all_properties']['stress'] = 'CSS2.0,CSS2.1,CSS3.0'; +$data['csstidy']['all_properties']['string-set'] = 'CSS3.0'; +$data['csstidy']['all_properties']['tab-size'] = 'CSS3.0'; +$data['csstidy']['all_properties']['table-layout'] = 'CSS2.0,CSS2.1,CSS3.0'; +$data['csstidy']['all_properties']['target'] = 'CSS3.0'; +$data['csstidy']['all_properties']['target-name'] = 'CSS3.0'; +$data['csstidy']['all_properties']['target-new'] = 'CSS3.0'; +$data['csstidy']['all_properties']['target-position'] = 'CSS3.0'; +$data['csstidy']['all_properties']['text-align'] = 'CSS1.0,CSS2.0,CSS2.1,CSS3.0'; +$data['csstidy']['all_properties']['text-align-last'] = 'CSS3.0'; +$data['csstidy']['all_properties']['text-decoration'] = 'CSS1.0,CSS2.0,CSS2.1,CSS3.0'; +$data['csstidy']['all_properties']['text-decoration-color'] = 'CSS3.0'; +$data['csstidy']['all_properties']['text-decoration-line'] = 'CSS3.0'; +$data['csstidy']['all_properties']['text-decoration-skip'] = 'CSS3.0'; +$data['csstidy']['all_properties']['text-decoration-style'] = 'CSS3.0'; +$data['csstidy']['all_properties']['text-emphasis'] = 'CSS3.0'; +$data['csstidy']['all_properties']['text-emphasis-color'] = 'CSS3.0'; +$data['csstidy']['all_properties']['text-emphasis-position'] = 'CSS3.0'; +$data['csstidy']['all_properties']['text-emphasis-style'] = 'CSS3.0'; +$data['csstidy']['all_properties']['text-height'] = 'CSS3.0'; +$data['csstidy']['all_properties']['text-indent'] = 'CSS1.0,CSS2.0,CSS2.1,CSS3.0'; +$data['csstidy']['all_properties']['text-justify'] = 'CSS3.0'; +$data['csstidy']['all_properties']['text-outline'] = 'CSS3.0'; +$data['csstidy']['all_properties']['text-shadow'] = 'CSS2.0,CSS3.0'; +$data['csstidy']['all_properties']['text-space-collapse'] = 'CSS3.0'; +$data['csstidy']['all_properties']['text-transform'] = 'CSS1.0,CSS2.0,CSS2.1,CSS3.0'; +$data['csstidy']['all_properties']['text-underline-position'] = 'CSS3.0'; +$data['csstidy']['all_properties']['text-wrap'] = 'CSS3.0'; +$data['csstidy']['all_properties']['top'] = 'CSS2.0,CSS2.1,CSS3.0'; +$data['csstidy']['all_properties']['transform'] = 'CSS3.0'; +$data['csstidy']['all_properties']['transform-origin'] = 'CSS3.0'; +$data['csstidy']['all_properties']['transform-style'] = 'CSS3.0'; +$data['csstidy']['all_properties']['transition'] = 'CSS3.0'; +$data['csstidy']['all_properties']['transition-delay'] = 'CSS3.0'; +$data['csstidy']['all_properties']['transition-duration'] = 'CSS3.0'; +$data['csstidy']['all_properties']['transition-property'] = 'CSS3.0'; +$data['csstidy']['all_properties']['transition-timing-function'] = 'CSS3.0'; +$data['csstidy']['all_properties']['unicode-bidi'] = 'CSS2.0,CSS2.1,CSS3.0'; +$data['csstidy']['all_properties']['vertical-align'] = 'CSS1.0,CSS2.0,CSS2.1,CSS3.0'; +$data['csstidy']['all_properties']['visibility'] = 'CSS2.0,CSS2.1,CSS3.0'; +$data['csstidy']['all_properties']['voice-balance'] = 'CSS3.0'; +$data['csstidy']['all_properties']['voice-duration'] = 'CSS3.0'; +$data['csstidy']['all_properties']['voice-family'] = 'CSS2.0,CSS2.1,CSS3.0'; +$data['csstidy']['all_properties']['voice-pitch'] = 'CSS3.0'; +$data['csstidy']['all_properties']['voice-pitch-range'] = 'CSS3.0'; +$data['csstidy']['all_properties']['voice-rate'] = 'CSS3.0'; +$data['csstidy']['all_properties']['voice-stress'] = 'CSS3.0'; +$data['csstidy']['all_properties']['voice-volume'] = 'CSS3.0'; +$data['csstidy']['all_properties']['volume'] = 'CSS2.0,CSS2.1,CSS3.0'; +$data['csstidy']['all_properties']['white-space'] = 'CSS1.0,CSS2.0,CSS2.1,CSS3.0'; +$data['csstidy']['all_properties']['widows'] = 'CSS2.0,CSS2.1,CSS3.0'; +$data['csstidy']['all_properties']['width'] = 'CSS1.0,CSS2.0,CSS2.1,CSS3.0'; +$data['csstidy']['all_properties']['word-break'] = 'CSS3.0'; +$data['csstidy']['all_properties']['word-spacing'] = 'CSS1.0,CSS2.0,CSS2.1,CSS3.0'; +$data['csstidy']['all_properties']['word-wrap'] = 'CSS3.0'; +$data['csstidy']['all_properties']['z-index'] = 'CSS2.0,CSS2.1,CSS3.0'; /** * An array containing all properties that can accept a quoted string as a value. * - * @global array $GLOBALS['csstidy']['quoted_string_properties'] + * @global array $data['csstidy']['quoted_string_properties'] */ -$GLOBALS['csstidy']['quoted_string_properties'] = array('content', 'font-family', 'quotes'); +$data['csstidy']['quoted_string_properties'] = array('content', 'font-family', 'quotes'); /** * An array containing all properties that can be defined multiple times without being overwritten. * - * @global array $GLOBALS['csstidy']['quoted_string_properties'] + * @global array $data['csstidy']['quoted_string_properties'] */ -$GLOBALS['csstidy']['multiple_properties'] = array('background', 'background-image'); +$data['csstidy']['multiple_properties'] = array('background', 'background-image'); /** * An array containing all predefined templates. * - * @global array $GLOBALS['csstidy']['predefined_templates'] + * @global array $data['csstidy']['predefined_templates'] * @version 1.0 * @see csstidy::load_template() */ -$GLOBALS['csstidy']['predefined_templates']['default'][] = ''; //string before @rule -$GLOBALS['csstidy']['predefined_templates']['default'][] = ' {'."\n"; //bracket after @-rule -$GLOBALS['csstidy']['predefined_templates']['default'][] = ''; //string before selector -$GLOBALS['csstidy']['predefined_templates']['default'][] = ' {'."\n"; //bracket after selector -$GLOBALS['csstidy']['predefined_templates']['default'][] = ''; //string before property -$GLOBALS['csstidy']['predefined_templates']['default'][] = ''; //string after property+before value -$GLOBALS['csstidy']['predefined_templates']['default'][] = ';'."\n"; //string after value -$GLOBALS['csstidy']['predefined_templates']['default'][] = '}'; //closing bracket - selector -$GLOBALS['csstidy']['predefined_templates']['default'][] = "\n\n"; //space between blocks {...} -$GLOBALS['csstidy']['predefined_templates']['default'][] = "\n".'}'. "\n\n"; //closing bracket @-rule -$GLOBALS['csstidy']['predefined_templates']['default'][] = ''; //indent in @-rule -$GLOBALS['csstidy']['predefined_templates']['default'][] = ''; // before comment -$GLOBALS['csstidy']['predefined_templates']['default'][] = ''."\n"; // after comment -$GLOBALS['csstidy']['predefined_templates']['default'][] = "\n"; // after each line @-rule +$data['csstidy']['predefined_templates']['default'][] = ''; //string before @rule +$data['csstidy']['predefined_templates']['default'][] = ' {'."\n"; //bracket after @-rule +$data['csstidy']['predefined_templates']['default'][] = ''; //string before selector +$data['csstidy']['predefined_templates']['default'][] = ' {'."\n"; //bracket after selector +$data['csstidy']['predefined_templates']['default'][] = ''; //string before property +$data['csstidy']['predefined_templates']['default'][] = ''; //string after property+before value +$data['csstidy']['predefined_templates']['default'][] = ';'."\n"; //string after value +$data['csstidy']['predefined_templates']['default'][] = '}'; //closing bracket - selector +$data['csstidy']['predefined_templates']['default'][] = "\n\n"; //space between blocks {...} +$data['csstidy']['predefined_templates']['default'][] = "\n".'}'. "\n\n"; //closing bracket @-rule +$data['csstidy']['predefined_templates']['default'][] = ''; //indent in @-rule +$data['csstidy']['predefined_templates']['default'][] = ''; // before comment +$data['csstidy']['predefined_templates']['default'][] = ''."\n"; // after comment +$data['csstidy']['predefined_templates']['default'][] = "\n"; // after each line @-rule -$GLOBALS['csstidy']['predefined_templates']['high_compression'][] = ''; -$GLOBALS['csstidy']['predefined_templates']['high_compression'][] = ' {'."\n"; -$GLOBALS['csstidy']['predefined_templates']['high_compression'][] = ''; -$GLOBALS['csstidy']['predefined_templates']['high_compression'][] = '{'; -$GLOBALS['csstidy']['predefined_templates']['high_compression'][] = ''; -$GLOBALS['csstidy']['predefined_templates']['high_compression'][] = ''; -$GLOBALS['csstidy']['predefined_templates']['high_compression'][] = ';'; -$GLOBALS['csstidy']['predefined_templates']['high_compression'][] = '}'; -$GLOBALS['csstidy']['predefined_templates']['high_compression'][] = "\n"; -$GLOBALS['csstidy']['predefined_templates']['high_compression'][] = "\n". '}'."\n".''; -$GLOBALS['csstidy']['predefined_templates']['high_compression'][] = ''; -$GLOBALS['csstidy']['predefined_templates']['high_compression'][] = ''; // before comment -$GLOBALS['csstidy']['predefined_templates']['high_compression'][] = ''; // after comment -$GLOBALS['csstidy']['predefined_templates']['high_compression'][] = "\n"; +$data['csstidy']['predefined_templates']['high_compression'][] = ''; +$data['csstidy']['predefined_templates']['high_compression'][] = ' {'."\n"; +$data['csstidy']['predefined_templates']['high_compression'][] = ''; +$data['csstidy']['predefined_templates']['high_compression'][] = '{'; +$data['csstidy']['predefined_templates']['high_compression'][] = ''; +$data['csstidy']['predefined_templates']['high_compression'][] = ''; +$data['csstidy']['predefined_templates']['high_compression'][] = ';'; +$data['csstidy']['predefined_templates']['high_compression'][] = '}'; +$data['csstidy']['predefined_templates']['high_compression'][] = "\n"; +$data['csstidy']['predefined_templates']['high_compression'][] = "\n". '}'."\n".''; +$data['csstidy']['predefined_templates']['high_compression'][] = ''; +$data['csstidy']['predefined_templates']['high_compression'][] = ''; // before comment +$data['csstidy']['predefined_templates']['high_compression'][] = ''; // after comment +$data['csstidy']['predefined_templates']['high_compression'][] = "\n"; -$GLOBALS['csstidy']['predefined_templates']['highest_compression'][] = ''; -$GLOBALS['csstidy']['predefined_templates']['highest_compression'][] = '{'; -$GLOBALS['csstidy']['predefined_templates']['highest_compression'][] = ''; -$GLOBALS['csstidy']['predefined_templates']['highest_compression'][] = '{'; -$GLOBALS['csstidy']['predefined_templates']['highest_compression'][] = ''; -$GLOBALS['csstidy']['predefined_templates']['highest_compression'][] = ''; -$GLOBALS['csstidy']['predefined_templates']['highest_compression'][] = ';'; -$GLOBALS['csstidy']['predefined_templates']['highest_compression'][] = '}'; -$GLOBALS['csstidy']['predefined_templates']['highest_compression'][] = ''; -$GLOBALS['csstidy']['predefined_templates']['highest_compression'][] = '}'; -$GLOBALS['csstidy']['predefined_templates']['highest_compression'][] = ''; -$GLOBALS['csstidy']['predefined_templates']['highest_compression'][] = ''; // before comment -$GLOBALS['csstidy']['predefined_templates']['highest_compression'][] = ''; // after comment -$GLOBALS['csstidy']['predefined_templates']['highest_compression'][] = ''; +$data['csstidy']['predefined_templates']['highest_compression'][] = ''; +$data['csstidy']['predefined_templates']['highest_compression'][] = '{'; +$data['csstidy']['predefined_templates']['highest_compression'][] = ''; +$data['csstidy']['predefined_templates']['highest_compression'][] = '{'; +$data['csstidy']['predefined_templates']['highest_compression'][] = ''; +$data['csstidy']['predefined_templates']['highest_compression'][] = ''; +$data['csstidy']['predefined_templates']['highest_compression'][] = ';'; +$data['csstidy']['predefined_templates']['highest_compression'][] = '}'; +$data['csstidy']['predefined_templates']['highest_compression'][] = ''; +$data['csstidy']['predefined_templates']['highest_compression'][] = '}'; +$data['csstidy']['predefined_templates']['highest_compression'][] = ''; +$data['csstidy']['predefined_templates']['highest_compression'][] = ''; // before comment +$data['csstidy']['predefined_templates']['highest_compression'][] = ''; // after comment +$data['csstidy']['predefined_templates']['highest_compression'][] = ''; -$GLOBALS['csstidy']['predefined_templates']['low_compression'][] = ''; -$GLOBALS['csstidy']['predefined_templates']['low_compression'][] = ' {'."\n"; -$GLOBALS['csstidy']['predefined_templates']['low_compression'][] = ''; -$GLOBALS['csstidy']['predefined_templates']['low_compression'][] = ''."\n".'{'."\n"; -$GLOBALS['csstidy']['predefined_templates']['low_compression'][] = ' '; -$GLOBALS['csstidy']['predefined_templates']['low_compression'][] = ''; -$GLOBALS['csstidy']['predefined_templates']['low_compression'][] = ';'."\n"; -$GLOBALS['csstidy']['predefined_templates']['low_compression'][] = '}'; -$GLOBALS['csstidy']['predefined_templates']['low_compression'][] = "\n\n"; -$GLOBALS['csstidy']['predefined_templates']['low_compression'][] = "\n".'}'."\n\n"; -$GLOBALS['csstidy']['predefined_templates']['low_compression'][] = ' '; -$GLOBALS['csstidy']['predefined_templates']['low_compression'][] = ''; // before comment -$GLOBALS['csstidy']['predefined_templates']['low_compression'][] = ''."\n"; // after comment -$GLOBALS['csstidy']['predefined_templates']['low_compression'][] = "\n"; +$data['csstidy']['predefined_templates']['low_compression'][] = ''; +$data['csstidy']['predefined_templates']['low_compression'][] = ' {'."\n"; +$data['csstidy']['predefined_templates']['low_compression'][] = ''; +$data['csstidy']['predefined_templates']['low_compression'][] = ''."\n".'{'."\n"; +$data['csstidy']['predefined_templates']['low_compression'][] = ' '; +$data['csstidy']['predefined_templates']['low_compression'][] = ''; +$data['csstidy']['predefined_templates']['low_compression'][] = ';'."\n"; +$data['csstidy']['predefined_templates']['low_compression'][] = '}'; +$data['csstidy']['predefined_templates']['low_compression'][] = "\n\n"; +$data['csstidy']['predefined_templates']['low_compression'][] = "\n".'}'."\n\n"; +$data['csstidy']['predefined_templates']['low_compression'][] = ' '; +$data['csstidy']['predefined_templates']['low_compression'][] = ''; // before comment +$data['csstidy']['predefined_templates']['low_compression'][] = ''."\n"; // after comment +$data['csstidy']['predefined_templates']['low_compression'][] = "\n"; diff --git a/www/plugins-dist/compresseur/lib/csstidy/template.tpl b/www/plugins-dist/compresseur/lib/csstidy/template.tpl deleted file mode 100644 index 731985ee..00000000 --- a/www/plugins-dist/compresseur/lib/csstidy/template.tpl +++ /dev/null @@ -1,10 +0,0 @@ -| { -|| { -|||; -|}| - -| -} - -||| -| diff --git a/www/plugins-dist/compresseur/lib/csstidy/template1.tpl b/www/plugins-dist/compresseur/lib/csstidy/template1.tpl deleted file mode 100644 index 2f6cd4d0..00000000 --- a/www/plugins-dist/compresseur/lib/csstidy/template1.tpl +++ /dev/null @@ -1,12 +0,0 @@ -| { -|| -{ -| ||; -|}| - -| - -} - -| || -| diff --git a/www/plugins-dist/compresseur/lib/csstidy/template2.tpl b/www/plugins-dist/compresseur/lib/csstidy/template2.tpl deleted file mode 100644 index dc2903c6..00000000 --- a/www/plugins-dist/compresseur/lib/csstidy/template2.tpl +++ /dev/null @@ -1,5 +0,0 @@ -| { -||{|||;|}| -| -} -|||| diff --git a/www/plugins-dist/compresseur/lib/csstidy/template3.tpl b/www/plugins-dist/compresseur/lib/csstidy/template3.tpl deleted file mode 100644 index ac752c9f..00000000 --- a/www/plugins-dist/compresseur/lib/csstidy/template3.tpl +++ /dev/null @@ -1 +0,0 @@ -|{||{|||;|}||}|||| \ No newline at end of file diff --git a/www/plugins-dist/compresseur/paquet.xml b/www/plugins-dist/compresseur/paquet.xml index 3bb9d721..81b16c87 100644 --- a/www/plugins-dist/compresseur/paquet.xml +++ b/www/plugins-dist/compresseur/paquet.xml @@ -1,7 +1,7 @@ diff --git a/www/plugins-dist/forum/paquet.xml b/www/plugins-dist/forum/paquet.xml index fbbf4b03..84473332 100644 --- a/www/plugins-dist/forum/paquet.xml +++ b/www/plugins-dist/forum/paquet.xml @@ -1,7 +1,7 @@ [(#ENV{repondre,'oui'}|=={non}|non) - [

<:forum:repondre_message:>

] + [(#AUTORISER{participerforumprive,#OBJET,#ID_OBJET}|oui) + [

<:forum:repondre_message:>

] + ] ] diff --git a/www/plugins-dist/forum/prive/objets/liste/participer_forum_thread.html b/www/plugins-dist/forum/prive/objets/liste/participer_forum_thread.html index d46870aa..80185a42 100644 --- a/www/plugins-dist/forum/prive/objets/liste/participer_forum_thread.html +++ b/www/plugins-dist/forum/prive/objets/liste/participer_forum_thread.html @@ -39,7 +39,9 @@ la premiere fois qu'un message est poste (cf. inc/invalideur). ] })] - [

<:forum:repondre_message:>

] + [(#AUTORISER{participerforumprive,#OBJET,#ID_OBJET}|oui) + [

<:forum:repondre_message:>

] + ] @@ -73,7 +75,9 @@ la premiere fois qu'un message est poste (cf. inc/invalideur). ] - [

<:forum:repondre_message:>

] + [(#AUTORISER{participerforumprive,#OBJET,#ID_OBJET}|oui) + [

<:forum:repondre_message:>

] + ] diff --git a/www/plugins-dist/forum/prive/squelettes/inclure/discuter_forum.html b/www/plugins-dist/forum/prive/squelettes/inclure/discuter_forum.html index 3e56b716..852f980f 100644 --- a/www/plugins-dist/forum/prive/squelettes/inclure/discuter_forum.html +++ b/www/plugins-dist/forum/prive/squelettes/inclure/discuter_forum.html @@ -1,9 +1,10 @@ [(#ENV{repondre}|oui) [(#INCLURE{fond=prive/repondre_forum, env})] ][(#ENV{repondre}|non) - -[(#SELF|parametre_url{repondre,new}|icone{<:forum:icone_poster_message:>,#STATUT|=={privadm}|?{forum-interne-24.png,forum-interne-24.png},#LANG_RIGHT,'',ajax}) -
-] -[(#INCLURE{fond=prive/objets/liste/participer_forum_thread, env})] + [(#AUTORISER{participerforumprive,#ENV{objet},#ENV{id_objet}}|oui) + [(#SELF|parametre_url{repondre,new}|icone{<:forum:icone_poster_message:>,#STATUT|=={privadm}|?{forum-interne-24.png,forum-interne-24.png},#LANG_RIGHT,'',ajax}) +
+ ] + ] + [(#INCLURE{fond=prive/objets/liste/participer_forum_thread, env})] ] \ No newline at end of file diff --git a/www/plugins-dist/medias/modeles/image.html b/www/plugins-dist/medias/modeles/image.html index 4d7183f9..2cd9ba70 100644 --- a/www/plugins-dist/medias/modeles/image.html +++ b/www/plugins-dist/medias/modeles/image.html @@ -6,10 +6,11 @@ [ ][(#TITRE|attribut_html)][(#ENV{lien}|?{})] + class="(#ENV{lien_class})"]>][(#TITRE|attribut_html)][(#ENV{lien}|?{})] ][ (#REM) Cas : on est appele ici avec emb=' ' : on veut la legende diff --git a/www/plugins-dist/medias/paquet.xml b/www/plugins-dist/medias/paquet.xml index 5c864857..3a78e07c 100644 --- a/www/plugins-dist/medias/paquet.xml +++ b/www/plugins-dist/medias/paquet.xml @@ -1,7 +1,7 @@ - - \ No newline at end of file + + diff --git a/www/plugins-dist/organiseur/prive/rss/messages.html b/www/plugins-dist/organiseur/prive/rss/messages.html index a910c0cf..a080da92 100644 --- a/www/plugins-dist/organiseur/prive/rss/messages.html +++ b/www/plugins-dist/organiseur/prive/rss/messages.html @@ -8,7 +8,7 @@ if ([(#ID_AUTEUR|securiser_acces{#ENV{cle},rss, #ENV{op}, #ENV{args}}|?{1,0})]) [(#URL_ECRIRE{messages}|url_absolue|texte_backend)] #LANG - diff --git a/www/plugins-dist/porte_plume/tests/all_tests.php b/www/plugins-dist/porte_plume/tests/all_tests.php index 31ce28f7..4e1fda57 100644 --- a/www/plugins-dist/porte_plume/tests/all_tests.php +++ b/www/plugins-dist/porte_plume/tests/all_tests.php @@ -2,11 +2,11 @@ require_once('lanceur_spip.php'); class AllTests_barre_outil_markitup extends SpipTestSuite { - function AllTests_barre_outil_markitup() { - $this->SpipTestSuite('Barre MarkitUp'); + function AllTests_barre_outil_markitup() { + $this->SpipTestSuite('Barre MarkitUp'); $this->addDir(__FILE__); - #$this->addFile(find_in_path('tests/barre_outil_markitup.php')); - } + #$this->addFile(find_in_path('tests/barre_outil_markitup.php')); + } } ?> diff --git a/www/plugins-dist/porte_plume/tests/barre_outil_markitup.php b/www/plugins-dist/porte_plume/tests/barre_outil_markitup.php index f11d4650..7b4c231d 100644 --- a/www/plugins-dist/porte_plume/tests/barre_outil_markitup.php +++ b/www/plugins-dist/porte_plume/tests/barre_outil_markitup.php @@ -7,16 +7,17 @@ require_once('lanceur_spip.php'); class Test_barre_outil_markitup extends SpipTest{ - + var $baseParamsBarre = array(); var $baseParamsBarreEtendue = array(); - - function Test_barre_outil_markitup() { - $this->SpipTest("Test de la classe Barre_outils"); + function __construct() { + + parent::__construct("Test de la classe Barre_outils"); // instancier une barre d'outil include_spip('porte_plume_fonctions'); + $this->baseParamsBarre = array( 'nameSpace' => 'spip', 'markupSet' => array( @@ -68,17 +69,18 @@ class Test_barre_outil_markitup extends SpipTest{ ); $this->baseParamsBarreEtendue = $p; } - + // avant chaque appel de fonction test function setUp() { - } - // apres chaque appel de fonction test - function tearDown() { - - } + } + + // apres chaque appel de fonction test + function tearDown() { + + } + - function testInitialisationBarre(){ // parametres inseres a leur bonne place $b = new Barre_outils($this->baseParamsBarre); @@ -86,7 +88,7 @@ class Test_barre_outil_markitup extends SpipTest{ $this->assertEqual('header1', $b->markupSet[0]['id']); $this->assertEqual(7, count($b->markupSet[0])); } - + function testInitialisationBarreEtendue(){ // parametres inseres a leur bonne place, // meme quand il y a des sous-menu d'icones @@ -97,18 +99,23 @@ class Test_barre_outil_markitup extends SpipTest{ $this->assertEqual('couleurs', $b->markupSet[1]['id']); $this->assertEqual(3, count($b->markupSet[1]['dropMenu'])); } - + function testOptionsIncorrectesNonIncluses(){ $p = $this->baseParamsBarre; $p['fausseVariable'] = "je ne dois pas m'installer"; $p['markupSet'][0]['fauxParam'] = "je ne dois pas m'installer"; $b = new Barre_outils($p); - $this->assertEqual('spip',$b->nameSpace); - $this->assertNull($b->fausseVariable); - $this->assertNull($b->markupSet[0]['fauxParam']); + $this->assertEqual('spip', $b->nameSpace); + + $this->expectError(new PatternExpectation("/Undefined property: Barre_outils::\\\$fausseVariable/i")); + $b->fausseVariable; + + $this->expectError(new PatternExpectation("/Undefined index: fauxParam/i")); + $b->markupSet[0]['fauxParam']; + $this->assertEqual(7, count($b->markupSet[0])); } - + function testRecuperationDeParametreAvecGet(){ // trouver des id de premier niveau $p = $this->baseParamsBarre; @@ -120,40 +127,40 @@ class Test_barre_outil_markitup extends SpipTest{ $b = new Barre_outils($p); $this->assertEqual($b->get('header1'), $p['markupSet'][0]); $this->assertEqual($b->get('couleurs'), $p['markupSet'][1]); - $this->assertEqual($b->get('couleur_jaune'), $p['markupSet'][1]['dropMenu'][0]); - $this->assertEqual($b->get('couleur_orange'), $p['markupSet'][1]['dropMenu'][1]); + $this->assertEqual($b->get('couleur_jaune'), $p['markupSet'][1]['dropMenu'][0]); + $this->assertEqual($b->get('couleur_orange'), $p['markupSet'][1]['dropMenu'][1]); $this->assertEqual($b->get('couleur_rouge'), $p['markupSet'][1]['dropMenu'][2]); - + // ne pas trouver d'id inconnu $this->assertFalse($b->get('je_nexiste_pas')); } - + function testModificationDeParametresAvecSet(){ $p = $this->baseParamsBarre; $b = new Barre_outils($p); $p['markupSet'][0]['name'] = 'New'; $r = $p['markupSet'][0]; $x = $b->set('header1', array("name"=>"New")); - + $this->assertEqual($r, $x); // set retourne la chaine modifiee complete $this->assertEqual($r, $b->get('header1')); - + // on ne peut ajouter de mauvais parametres $x = $b->set('header1', array("Je Suis Pas Bon"=>"No no no")); $this->assertEqual($r, $x); // set retourne la chaine modifiee complete $this->assertEqual($r, $b->get('header1')); } - + function testAjoutDeParametresApres(){ $b = new Barre_outils($this->baseParamsBarre); $p = $this->baseParamsBarreEtendue; - + // ajoutons la couleur apres $b->ajouterApres('header1',$p['markupSet'][1]); $this->assertEqual(2, count($b->markupSet)); // 2 boutons de premier niveau maintenant $this->assertEqual($b->get('couleurs'), $p['markupSet'][1]); // get renvoie bien le bon ajout $this->assertEqual($b->markupSet[1], $p['markupSet'][1]); // et l'ajout est au bon endroit - + // ajoutons une couleur dans l'ajout $coul = $p['markupSet'][1]['dropMenu'][0]; $coul['id'] = 'couleur_violette'; @@ -161,7 +168,7 @@ class Test_barre_outil_markitup extends SpipTest{ $this->assertEqual(4, count($b->markupSet[1]['dropMenu'])); // sous boutons $this->assertEqual($b->get('couleur_violette'), $coul); $this->assertEqual($b->markupSet[1]['dropMenu'][2], $coul); // insertion au bon endroit - + // ajoutons un header2 encore apres $p['markupSet'][0]['id'] = 'header2'; $b->ajouterApres('couleurs',$p['markupSet'][0]); @@ -169,17 +176,17 @@ class Test_barre_outil_markitup extends SpipTest{ $this->assertEqual($b->get('header2'), $p['markupSet'][0]); $this->assertEqual($b->markupSet[2], $p['markupSet'][0]); } - + function testAjoutDeParametresAvant(){ $b = new Barre_outils($this->baseParamsBarre); $p = $this->baseParamsBarreEtendue; - + // ajoutons la couleur apres $b->ajouterAvant('header1',$p['markupSet'][1]); $this->assertEqual(2, count($b->markupSet)); // 2 boutons de premier niveau maintenant $this->assertEqual($b->get('couleurs'), $p['markupSet'][1]); // get renvoie bien le bon ajout $this->assertEqual($b->markupSet[0], $p['markupSet'][1]); // et l'ajout est au bon endroit - + // ajoutons une couleur dans l'ajout $coul = $p['markupSet'][1]['dropMenu'][0]; $coul['id'] = 'couleur_violette'; @@ -187,7 +194,7 @@ class Test_barre_outil_markitup extends SpipTest{ $this->assertEqual(4, count($b->markupSet[0]['dropMenu'])); // sous boutons $this->assertEqual($b->get('couleur_violette'), $coul); $this->assertEqual($b->markupSet[0]['dropMenu'][1], $coul); // insertion au bon endroit - + // ajoutons un header2 avant le 1 $p['markupSet'][0]['id'] = 'header2'; $b->ajouterAvant('header1',$p['markupSet'][0]); @@ -195,7 +202,7 @@ class Test_barre_outil_markitup extends SpipTest{ $this->assertEqual($b->get('header2'), $p['markupSet'][0]); $this->assertEqual($b->markupSet[1], $p['markupSet'][0]); } - + function testAfficherEtCacher(){ $b = new Barre_outils($this->baseParamsBarre); $b->cacher('header1'); @@ -203,47 +210,47 @@ class Test_barre_outil_markitup extends SpipTest{ $b->afficher('header1'); $this->assertTrue($b->markupSet[0]['display']); } - + function testAfficherEtCacherTout(){ $b = new Barre_outils($this->baseParamsBarreEtendue); $b->cacherTout(); $this->assertFalse($b->markupSet[0]['display']); $this->assertFalse($b->markupSet[1]['dropMenu'][0]['display']); - + $b->afficherTout(); $this->assertTrue($b->markupSet[0]['display']); $this->assertTrue($b->markupSet[1]['dropMenu'][0]['display']); } - + function testAfficherEtCacherPlusieursBoutons(){ $b = new Barre_outils($this->baseParamsBarreEtendue); $b->cacher(array('header1','couleur_jaune')); $this->assertFalse($b->markupSet[0]['display']); $this->assertFalse($b->markupSet[1]['dropMenu'][0]['display']); $this->assertTrue($b->markupSet[1]['dropMenu'][1]['display']); - + $b->cacherTout(); $b->afficher(array('header1','couleur_jaune')); $this->assertTrue($b->markupSet[0]['display']); $this->assertTrue($b->markupSet[1]['dropMenu'][0]['display']); $this->assertFalse($b->markupSet[1]['dropMenu'][1]['display']); } - + function testSetAvecIdVideNeDoitRienModifier(){ $b = new Barre_outils($this->baseParamsBarreEtendue); $b->set(array(),array('display'=>false)); $this->assertTrue($b->markupSet[0]['display']); - $this->assertTrue($b->markupSet[1]['dropMenu'][0]['display']); + $this->assertTrue($b->markupSet[1]['dropMenu'][0]['display']); } - + function testSetAvecIdArrayDoitModifTousLesIds(){ $b = new Barre_outils($this->baseParamsBarreEtendue); - $b->set(array('header1','couleur_jaune'),array('display'=>false)); + $b->set(array('header1','couleur_jaune'),array('display'=>false)); $this->assertFalse($b->markupSet[0]['display']); $this->assertFalse($b->markupSet[1]['dropMenu'][0]['display']); - $this->assertTrue($b->markupSet[1]['dropMenu'][1]['display']); - } - + $this->assertTrue($b->markupSet[1]['dropMenu'][1]['display']); + } + function testCreerJson(){ $b = new Barre_outils($this->baseParamsBarre); $b->ajouterApres('header1', array( @@ -258,7 +265,7 @@ class Test_barre_outil_markitup extends SpipTest{ $this->assertPattern(',\[{"name":",',$json); $this->assertNoPattern(',eacute;,',$json); } - + function testBoutonsDUneLangue(){ $b = new Barre_outils($this->baseParamsBarre); $ico2 = $ico1 = array( @@ -276,7 +283,7 @@ class Test_barre_outil_markitup extends SpipTest{ $b->ajouterApres('ico_fr1', $ico2); $this->assertEqual($ico1, $b->get('ico_fr1')); $this->assertEqual($ico2, $b->get('ico_fr2')); - + // verifier que ces nouveaux array() // ne posent pas de problemes dans les recursions $b->cacherTout(); @@ -286,13 +293,13 @@ class Test_barre_outil_markitup extends SpipTest{ $b->cacherTout(); $b->afficher(array('ico_fr1','ico_fr2')); $this->assertTrue($b->markupSet[1]['display']); - + // la langue est bien transmise au json $json = $b->creer_json(); $this->assertPattern(',"lang":\[,', $json); } - - + + function testFonctionsJavacriptDansParametreNeDoitPasEtreEntreguillemetsDansJson(){ $b = new Barre_outils($this->baseParamsBarre); $clean = array( @@ -308,24 +315,25 @@ class Test_barre_outil_markitup extends SpipTest{ // pas de :"function(... ..." $this->assertPattern('/:function\(/',$json); } - + function testParametreFunctionsDansJson(){ $b = new Barre_outils($this->baseParamsBarre); $b->functions = "function dido(){}"; $json = $b->creer_json(); // function n'est plus dans la barre - $this->assertFalse($b->functions); + $this->expectError(new PatternExpectation("/Undefined property: Barre_outils::\\\$functions/i")); + $b->functions; // mais uniquement en fin du fichier json - $this->assertPattern('/function dido\(/', $json); + $this->assertPattern('/function dido\(/', $json); } - + function testAjouterFonctions(){ $b = new Barre_outils($this->baseParamsBarre); $b->ajouterFonction("function dido(){}"); - $this->assertPattern('/function dido\(/', $b->functions); + $this->assertPattern('/function dido\(/', $b->functions); } - - /* + + /* function squeletteTest(){ $sq = new SqueletteTest("SimpleTest"); $sq->addInsertHead(); @@ -338,11 +346,11 @@ class Test_barre_outil_markitup extends SpipTest{ "); return $sq; } - + function testPresenceBarreOutilPublique(){ include_spip('simpletest/browser'); include_spip('simpletest/web_tester'); - + $sq = $this->squeletteTest(); $browser = &new SimpleBrowser(); diff --git a/www/plugins-dist/porte_plume/tests/lanceur_spip.php b/www/plugins-dist/porte_plume/tests/lanceur_spip.php index be4c3d8d..f7ebd483 100644 --- a/www/plugins-dist/porte_plume/tests/lanceur_spip.php +++ b/www/plugins-dist/porte_plume/tests/lanceur_spip.php @@ -1,26 +1,11 @@ Echec : SPIP ne peut pas etre demarre automatiquement pour le test.
- Vous utilisez certainement un lien symbolique dans votre repertoire plugins."); -} -include_spip('inc/tests'); -if (!class_exists('SpipTestSuite')) { - die("Echec : le plugin pour les tests unitaires avec SimpleTest ne semble pas actif."); -} -?> +demarrer_simpletest(); diff --git a/www/plugins-dist/textwheel/engine/textwheel.php b/www/plugins-dist/textwheel/engine/textwheel.php index aba6e857..b473407b 100644 --- a/www/plugins-dist/textwheel/engine/textwheel.php +++ b/www/plugins-dist/textwheel/engine/textwheel.php @@ -164,7 +164,7 @@ class TextWheel { } # optimization: strpos or stripos? - if (isset($rule->strpos)) { + if (isset($rule->if_str)) { if (strtolower($rule->if_str) !== strtoupper($rule->if_str)) { $rule->if_stri = $rule->if_str; unset($rule->if_str); @@ -253,18 +253,19 @@ class TextWheel { if (isset($rule->if_chars) AND (strpbrk($t, $rule->if_chars) === false)) return; - if (isset($rule->if_str) AND strpos($t, $rule->if_str) === false) - return; - - if (isset($rule->if_stri) AND stripos($t, $rule->if_str) === false) - return; - if (isset($rule->if_match) AND !preg_match($rule->if_match, $t)) return; + // init rule before testing if_str / if_stri as they are optimized by initRule if (!isset($rule->func_replace)) $this->initRule($rule); + if (isset($rule->if_str) AND strpos($t, $rule->if_str) === false) + return; + + if (isset($rule->if_stri) AND stripos($t, $rule->if_stri) === false) + return; + $func = $rule->func_replace; TextWheel::$func($rule->match,$rule->replace,$t,$count); } diff --git a/www/plugins-dist/textwheel/paquet.xml b/www/plugins-dist/textwheel/paquet.xml index 72234da9..35eac21c 100644 --- a/www/plugins-dist/textwheel/paquet.xml +++ b/www/plugins-dist/textwheel/paquet.xml @@ -1,7 +1,7 @@ 2) @@ -70,7 +70,7 @@ function formulaires_editer_url_objet_traiter($type,$id){ // les urls manuelles sont toujours permanentes $set = array('url' => _request('url'), 'type' => $type, 'id_objet' => $id, 'perma'=>1); - $type_urls = $GLOBALS['meta']['type_urls']; + $type_urls = (isset($GLOBALS['type_urls'])?$GLOBALS['type_urls']:$GLOBALS['meta']['type_urls']); if (include_spip("urls/$type_urls") AND function_exists($renseigner_url = "renseigner_url_$type_urls") AND $r = $renseigner_url($type,$id) diff --git a/www/plugins-dist/urls_etendues/paquet.xml b/www/plugins-dist/urls_etendues/paquet.xml index 32388b4b..fa4f7f35 100644 --- a/www/plugins-dist/urls_etendues/paquet.xml +++ b/www/plugins-dist/urls_etendues/paquet.xml @@ -1,7 +1,7 @@ 3)) + if (!$sujet=_request('sujet_message_auteur')) + $erreurs['sujet_message_auteur'] = _T("info_obligatoire"); + elseif(!(strlen($sujet)>3)) $erreurs['sujet_message_auteur'] = _T('forum:forum_attention_trois_caracteres'); if (!$texte=_request('texte_message_auteur')) diff --git a/www/svn.revision b/www/svn.revision index 7f2d6642..7fc18427 100644 --- a/www/svn.revision +++ b/www/svn.revision @@ -1,10 +1,10 @@ -Origine: svn://trac.rezo.net/spip/tags/spip-3.0.15 -Revision: 21231 -Dernier commit: 2014-02-21 16:36:00 +0100 +Origine: svn://trac.rezo.net/spip/tags/spip-3.0.16 +Revision: 21266 +Dernier commit: 2014-03-13 15:30:55 +0100 -svn://trac.rezo.net/spip/tags/spip-3.0.15 -21231 -2014-02-21 16:36:00 +0100 +svn://trac.rezo.net/spip/tags/spip-3.0.16 +21266 +2014-03-13 15:30:55 +0100 \ No newline at end of file -- 2.20.1