Head Cleaner - Version 1.4.0

Version Description

Download this release

Release Info

Developer wokamoto
Plugin Icon wp plugin Head Cleaner
Version 1.4.0
Comparing to
See all releases

Code changes from version 1.3.14 to 1.4.0

head-cleaner.php CHANGED
@@ -1,7 +1,7 @@
1
  <?php
2
  /*
3
  Plugin Name: Head Cleaner
4
- Version: 1.3.14
5
  Plugin URI: http://wppluginsj.sourceforge.jp/head-cleaner/
6
  Description: Cleaning tags from your WordPress header and footer.
7
  Author: wokamoto
@@ -12,7 +12,6 @@ Domain Path: /languages/
12
  License:
13
  Released under the GPL license
14
  http://www.gnu.org/copyleft/gpl.html
15
-
16
  Copyright 2009 - 2010 wokamoto (email : wokamoto1973@gmail.com)
17
 
18
  This program is free software; you can redistribute it and/or modify
@@ -38,24 +37,11 @@ Includes:
38
  Copyright (c) 2002 Douglas Crockford <douglas@crockford.com> (jsmin.c)
39
  Copyright (c) 2008 Ryan Grove <ryan@wonko.com> (PHP port)
40
  License http://opensource.org/licenses/mit-license.php MIT License
41
-
42
- CSSTidy - CSS Parser and Optimiser Ver.1.3
43
- @author Florian Schmitz (floele at gmail dot com) 2005-2006
44
- @license http://opensource.org/licenses/gpl-license.php GNU Public License
45
  */
46
 
47
- if (version_compare(phpversion(), "5.0.0", "<"))
48
- return false;
49
-
50
  //**************************************************************************************
51
  // Defines
52
  //**************************************************************************************
53
- if (!defined('HC_PRIORITY'))
54
- define('HC_PRIORITY', 10000);
55
- if (!defined('HC_ANALYZE_EXPIRED'))
56
- define('HC_ANALYZE_EXPIRED', 604800); // 60 * 60 * 24 * 7 [sec.]
57
- if (!defined('HC_XMLNS'))
58
- define('HC_XMLNS', 'http://www.w3.org/1999/xhtml');
59
  if (!defined('HC_CACHE_DIR'))
60
  define('HC_CACHE_DIR', 'cache/head-cleaner');
61
  if (!defined('HC_MAKE_GZ_FILE'))
@@ -80,7 +66,12 @@ if (!class_exists('wokController') || !class_exists('wokScriptManager'))
80
  //**************************************************************************************
81
  class HeadCleaner extends wokController {
82
  public $plugin_name = 'head-cleaner';
83
- public $plugin_ver = '1.3.14';
 
 
 
 
 
84
 
85
  // Deafault Options
86
  private $options_default = array(
@@ -92,13 +83,6 @@ class HeadCleaner extends wokController {
92
  'combined_js' => false ,
93
  'js_minify' => false ,
94
  'css_optimise' => false ,
95
- 'csstidy_option' => array(
96
- 'optimise_shorthands' => 1 ,
97
- 'compress_colors' => true ,
98
- 'compress_font_weight' => true ,
99
- 'remove_bslash' => true ,
100
- 'template' => 1 ,
101
- ) ,
102
  'default_media' => 'all' ,
103
  'debug_mode' => false ,
104
  'filters' => array('wp_head' => array(), 'wp_footer' => array()) ,
@@ -111,12 +95,7 @@ class HeadCleaner extends wokController {
111
  'canonical_tag' => true ,
112
  'gzip_on' => false ,
113
  'use_ajax_libs' => false ,
114
- );
115
- private $csstidy_template = array(
116
- 'low_compression' ,
117
- 'default' ,
118
- 'high_compression' ,
119
- 'highest_compression' ,
120
  );
121
 
122
  private $wp_url = '';
@@ -157,6 +136,7 @@ class HeadCleaner extends wokController {
157
  'wpSEO::exe_modify_content' => false ,
158
  );
159
 
 
160
 
161
  /**********************************************************
162
  * Constructor
@@ -233,7 +213,7 @@ class HeadCleaner extends wokController {
233
  $priority = $this->options_default['priority'];
234
  foreach ($wk_options['priority'] as $tag => $filters) {
235
  foreach ((array) $filters as $key => $val) {
236
- if ($val <= 0 || $val > HC_PRIORITY)
237
  $priority[$tag][$key] = $val;
238
  }
239
  }
@@ -248,7 +228,7 @@ class HeadCleaner extends wokController {
248
  $wk_options['filters'] = $filters;
249
  $wk_options['priority'] = $priority;
250
  $wk_options['head_js'] = $head_js;
251
- $wk_options['analyze_expired'] = time() + HC_ANALYZE_EXPIRED;
252
  }
253
 
254
  return $wk_options;
@@ -270,11 +250,6 @@ class HeadCleaner extends wokController {
270
  $this->options['js_minify'] = class_exists('JSMin') && $this->options['js_minify'];
271
  }
272
 
273
- // // CSSTidy - CSS Parser and Optimiser
274
- // if ($this->options['css_optimise'] && !class_exists('csstidy')) {
275
- // require($includes . 'csstidy-1.3/class.csstidy.php');
276
- // $this->options['css_optimise'] = class_exists('csstidy') && $this->options['css_optimise'];
277
- // }
278
  if ($this->options['css_optimise'] && !class_exists('Minify_CSS')) {
279
  require($includes . 'CSSMin.php');
280
  $this->options['css_optimise'] = class_exists('Minify_CSS') && $this->options['css_optimise'];
@@ -298,7 +273,6 @@ class HeadCleaner extends wokController {
298
  // plugin deactivation
299
  //**************************************************************************************
300
  public function deactivation(){
301
- // $this->_remove_cache_file();
302
  }
303
 
304
  //**************************************************************************************
@@ -322,7 +296,7 @@ class HeadCleaner extends wokController {
322
  if ( function_exists('rel_canonical') && !$this->options['canonical_tag'] )
323
  remove_action( 'wp_head', 'rel_canonical' );
324
 
325
- add_action('wp_head', array(&$this, 'end'), HC_PRIORITY);
326
  $this->_get_filters('wp_head');
327
  $this->_change_filters_priority('wp_head');
328
 
@@ -349,7 +323,7 @@ class HeadCleaner extends wokController {
349
  ob_start(array(&$this, 'footer_cleaner'));
350
  $this->mtime_start = microtime();
351
 
352
- add_action('wp_footer', array(&$this, 'end'), HC_PRIORITY);
353
  $this->_get_filters('wp_footer');
354
  $this->_change_filters_priority('wp_footer');
355
  }
@@ -361,6 +335,7 @@ class HeadCleaner extends wokController {
361
  private function ob_handler($content){
362
  foreach ( $this->ob_handlers as $ob_handler => $enable ) {
363
  if ( $enable ) {
 
364
  switch ($ob_handler) {
365
  case 'All_in_One_SEO_Pack::output_callback_for_title':
366
  global $aiosp;
@@ -376,7 +351,6 @@ class HeadCleaner extends wokController {
376
  default :
377
  break;
378
  }
379
- $this->ob_handlers[$ob_handler] = false;
380
  }
381
  }
382
 
@@ -398,7 +372,7 @@ class HeadCleaner extends wokController {
398
  if ( $this->options['filters'] != $this->filters || $this->options['head_js'] != $this->head_js ) {
399
  $this->options['filters'] = $this->filters;
400
  $this->options['head_js'] = $this->head_js;
401
- $this->options['analyze_expired'] = time() + HC_ANALYZE_EXPIRED;
402
  $this->updateOptions();
403
  }
404
  }
@@ -412,11 +386,6 @@ class HeadCleaner extends wokController {
412
  if (!function_exists('str_get_html'))
413
  return $buffer;
414
 
415
- // $transient_key = $this->option_name.'_'.md5($buffer);
416
- // $ret_val = get_transient($transient_key);
417
- // if ( $ret_val !== false )
418
- // return $ret_val;
419
-
420
  $head_txt = $buffer;
421
  $url = $this->_get_permalink();
422
 
@@ -495,7 +464,7 @@ class HeadCleaner extends wokController {
495
  if ( empty($html_tag) ) {
496
  if ( $doctype === 'xhtml' ) {
497
  // xhtml
498
- $xmlns = (defined('HC_XMLNS') ? HC_XMLNS : 'http://www.w3.org/1999/xhtml');
499
  $xml_lang = $this->lang;
500
  } else {
501
  // html
@@ -506,11 +475,21 @@ class HeadCleaner extends wokController {
506
  if (preg_match_all('/ +([^ ]*)=[\'"]([^\'"]*)[\'"]/', $html_tag, $matches, PREG_SET_ORDER)) {
507
  foreach ((array) $matches as $match) {
508
  switch ($match[1]){
509
- case 'xmlns': $xmlns = $match[2]; break;
510
- case 'xml:lang': $xml_lang = $match[2]; break;
511
- case 'lang': $lang = $match[2]; break;
512
- case 'dir': $dir = $match[2]; break;
513
- case 'lang': $lang = $match[2]; break;
 
 
 
 
 
 
 
 
 
 
514
  }
515
  }
516
  unset($match);
@@ -532,6 +511,7 @@ class HeadCleaner extends wokController {
532
  list($script_tag, $inline_js, $foot_js) = $this->_parse_script_tag($dom->find("script"));
533
  $noscript_tag = $this->_dom_to_html($dom->find("noscript"));
534
  $object_tag = $this->_dom_to_html($dom->find("object"));
 
535
 
536
  $dom->clear();
537
  unset($dom);
@@ -565,8 +545,8 @@ class HeadCleaner extends wokController {
565
  $this->_tag_trim($link_tag) .
566
  $this->_tag_trim($css_tag) .
567
  $this->_tag_trim($inline_css) .
568
- $this->_tag_trim(!$this->options['js_move_foot'] ? $script_tag : '') .
569
- $this->_tag_trim(!$this->options['js_move_foot'] ? $inline_js : '') .
570
  $this->_tag_trim($noscript_tag) .
571
  $this->_tag_trim($object_tag) ;
572
 
@@ -597,11 +577,10 @@ class HeadCleaner extends wokController {
597
 
598
  $this->org_len = strlen(bin2hex($buffer));
599
  $this->ret_len = strlen(bin2hex($ret_val));
600
- $this->process_time = $this->_microtime_diff($this->mtime_start);
601
  // $ret_val .= "<!-- {$this->process_time} seconds. {$this->ret_len} / {$this->org_len} (" . (int) (($this->org_len - $this->ret_len) / $this->org_len * 10000) / 100 . "% saving) -->\n";
602
 
603
- // set_transient($transient_key, $ret_val, $this->options['analyze_expired']);
604
-
605
  return $ret_val;
606
  }
607
 
@@ -674,6 +653,7 @@ class HeadCleaner extends wokController {
674
  $css_src = array();
675
  $wk_inline_css = array();
676
  $inline_css = '';
 
677
 
678
  // css file
679
  foreach ((array) $elements_linktag as $element) {
@@ -693,7 +673,10 @@ class HeadCleaner extends wokController {
693
  ? $this->options['default_media']
694
  : $media );
695
  $inner_css .= $this->_tag_trim($tag);
 
 
696
  $css_src[$media][] = $element->href;
 
697
  }
698
  }
699
  }
@@ -704,20 +687,7 @@ class HeadCleaner extends wokController {
704
  $media = trim( isset($element->media) ? $element->media : $this->options['default_media'] );
705
  $media = ( empty($media) || is_null($media) || $media === FALSE ? $this->options['default_media'] : $media );
706
  $wk_text = $this->_remove_comment($element->innertext, 'css');
707
- if ( preg_match_all('/@import[\s]+url[\s]*\([\s\'"]*([^\)\'"]*?)[\s\'"]*\);/i', $wk_text, $wk_matches, PREG_SET_ORDER) ) {
708
- foreach ($wk_matches as $val) {
709
- $wk_text = trim(str_replace( $val[0], '', $wk_text));
710
- $href = trim($val[1]);
711
- $tag = $this->_css_tag($href, $media);
712
- if (strpos( $href, $this->wp_url) === FALSE) {
713
- $css_tag .= $tag . "\n";
714
- } else {
715
- $inner_css .= $tag . "\n";
716
- $css_src[$media][] = $href;
717
- }
718
- }
719
- }
720
- unset($wk_matches);
721
  if ( !empty($wk_text) ) {
722
  if ( !isset($wk_inline_css[$media]) )
723
  $wk_inline_css[$media] = $this->_tag_trim($wk_text);
@@ -725,46 +695,46 @@ class HeadCleaner extends wokController {
725
  $wk_inline_css[$media] .= $this->_tag_trim($wk_text);
726
  }
727
  }
 
 
728
  if ($this->options['cache_enabled']) {
729
  if ($this->options['combined_css']) {
730
- $css_tag = $this->_tag_trim($css_tag);
731
- foreach ($css_src as $key => $val) {
732
- $inner_css = $this->_combined_css($val, trim(isset($wk_inline_css[$key]) ? $wk_inline_css[$key] : '' ), $key);
733
- $css_tag .=
734
- $this->_tag_trim($inner_css) .
735
- $this->_tag_trim($css_tag_with_id) .
736
- $this->_tag_trim($css_tag_with_title);
737
- if (isset($wk_inline_css[$key]))
738
- $wk_inline_css[$key] = '';
739
  }
740
  foreach ($wk_inline_css as $key => $val) {
741
  $val = trim($val);
742
  if (!empty($val)) {
743
- $inner_css = $this->_combined_css(array(), $val, $key);
744
- $css_tag .= $this->_tag_trim($inner_css);
745
  }
746
  }
747
 
748
  } else {
749
- $css_tag =
750
- $this->_tag_trim($css_tag) .
751
- $this->_tag_trim($inner_css) .
752
- $this->_tag_trim($css_tag_with_id) .
753
- $this->_tag_trim($css_tag_with_title);
 
 
 
 
 
 
 
 
754
  foreach ($wk_inline_css as $key => $val) {
755
  $val = trim($val);
756
  if (!empty($val)) {
757
- $inner_css = $this->_combined_inline_css(trim($val), $key);
758
- $inline_css .= $this->_tag_trim($inner_css);
759
  }
760
  }
761
  }
 
762
  } else {
763
- $css_tag =
764
- $this->_tag_trim($css_tag) .
765
- $this->_tag_trim($inner_css) .
766
- $this->_tag_trim($css_tag_with_id) .
767
- $this->_tag_trim($css_tag_with_title);
768
  foreach ($wk_inline_css as $key => $val) {
769
  $val = trim($val);
770
  if (!empty($val))
@@ -774,14 +744,22 @@ class HeadCleaner extends wokController {
774
  unset($wk_inline_css);
775
  unset($element);
776
 
 
 
 
 
 
 
777
  $css_tag = $this->_tag_trim($css_tag);
778
  $inline_css = $this->_tag_trim($inline_css);
779
 
 
 
780
  return array($css_tag, $inline_css);
781
  }
782
 
783
  //**************************************************************************************
784
- // parse scrip tag
785
  //**************************************************************************************
786
  private function _parse_script_tag($elements){
787
  $script_tag = '';
@@ -789,6 +767,7 @@ class HeadCleaner extends wokController {
789
  $foot_js = '';
790
  $js_src = array();
791
  $js_libs = array();
 
792
 
793
  foreach ((array) $elements as $element) {
794
  if (!isset($element->src)) {
@@ -826,6 +805,7 @@ class HeadCleaner extends wokController {
826
  } else {
827
  $inner_js .= $this->_tag_trim($element->outertext);
828
  $js_src[] = $element->src;
 
829
  }
830
  }
831
  }
@@ -846,25 +826,44 @@ class HeadCleaner extends wokController {
846
  unset($js_libs);
847
  }
848
 
 
849
  $inline_js = $this->_tag_trim($inline_js);
850
  if ($this->options['cache_enabled']) {
851
  if ($this->options['combined_js']) {
852
  $inner_js = $this->_combined_javascript($js_src, trim($inline_js));
853
- $script_tag = $this->_tag_trim($this->_tag_trim($script_tag) . $inner_js);
854
  $inline_js = '';
 
855
  } else {
856
- $script_tag = $this->_tag_trim($this->_tag_trim($script_tag) . $inner_js);
 
 
 
 
 
 
 
 
 
 
 
857
  $inline_js = $this->_combined_inline_javascript(trim($inline_js));
858
  }
 
859
  } else {
860
- $script_tag = $this->_tag_trim($this->_tag_trim($script_tag) . $inner_js);
861
  $inline_js = $this->_script_tag($inline_js, true);
862
  }
863
 
 
 
 
 
864
  $script_tag = $this->_tag_trim($script_tag);
865
  $inline_js = $this->_tag_trim($inline_js);
866
  $foot_js = $this->_tag_trim($foot_js);
867
 
 
 
 
868
  return array($script_tag, $inline_js, $foot_js);
869
  }
870
 
@@ -883,11 +882,6 @@ class HeadCleaner extends wokController {
883
  if (!function_exists('str_get_html'))
884
  return $buffer;
885
 
886
- // $transient_key = $this->option_name.'_'.md5($buffer);
887
- // $ret_val = get_transient($transient_key);
888
- // if ( $ret_val !== false )
889
- // return $ret_val;
890
-
891
  $ret_val = '';
892
  $script_tag = '';
893
  $inline_js = '';
@@ -905,6 +899,7 @@ class HeadCleaner extends wokController {
905
  // parse
906
  $inner_js = '';
907
  $js_src = array();
 
908
  $elements = (array) $dom->find("div#footer *");
909
  foreach ($elements as $element) {
910
  switch ($element->tag) {
@@ -919,6 +914,7 @@ class HeadCleaner extends wokController {
919
  } else {
920
  $inner_js .= $this->_tag_trim($element->outertext);
921
  $js_src[] = preg_replace('/\.gz$/i', '', $src);
 
922
  }
923
  }
924
  }
@@ -944,6 +940,18 @@ class HeadCleaner extends wokController {
944
  $script_tag .= $inner_js;
945
  $inline_js = '';
946
  } else {
 
 
 
 
 
 
 
 
 
 
 
 
947
  $script_tag .= $inner_js;
948
  $inline_js = $this->_combined_inline_javascript($inline_js);
949
  }
@@ -975,8 +983,7 @@ class HeadCleaner extends wokController {
975
 
976
  // $ret_val .= $this->_process_time();
977
 
978
- // set_transient($transient_key, $ret_val, $this->options['analyze_expired']);
979
-
980
  return $ret_val;
981
  }
982
 
@@ -1110,7 +1117,8 @@ class HeadCleaner extends wokController {
1110
  break;
1111
  }
1112
  }
1113
- unset($element); unset($elements);
 
1114
 
1115
  foreach ((array) $tags as $tag_type => $contents) {
1116
  switch($tag_type) {
@@ -1143,22 +1151,60 @@ class HeadCleaner extends wokController {
1143
  return $html;
1144
  }
1145
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1146
  //**************************************************************************************
1147
  // Get absolute url
1148
  //**************************************************************************************
1149
  private function _abs_url($path, $base_path = ''){
1150
  if (preg_match('/^https?:\/\//i', $base_path))
1151
  $base_path = str_replace($this->wp_url, ABSPATH, $base_path);
 
 
 
1152
 
1153
- $absolute_path = realpath($base_path . '/' . $path);
1154
- if ( $absolute_path === FALSE )
1155
- $absolute_path = $base_path . '/' . $path;
1156
-
1157
- $url = str_replace(ABSPATH, $this->wp_url, $absolute_path);
1158
- $url = str_replace('/./', '/', $url);
1159
- $url = preg_replace('/(\/[^\/]*\/)\.\.(\/[^\/]*\/)/', '$2', $url);
1160
 
1161
- return $url;
1162
  }
1163
 
1164
  private function _css_url_edit($content, $filename) {
@@ -1183,57 +1229,91 @@ class HeadCleaner extends wokController {
1183
  }
1184
 
1185
  //**************************************************************************************
1186
- // Read file
1187
  //**************************************************************************************
1188
- private function _file_read($filename) {
1189
- $content = false;
1190
- if (preg_match('/^https?:\/\//i', $filename)) {
1191
- if (function_exists('wp_remote_get')) {
1192
- $ret = wp_remote_get($filename);
1193
- if (is_array($ret) && isset($ret["body"]) && !empty($ret["body"]))
1194
- $content = $ret["body"];
1195
- }
1196
- if ($content === false)
1197
- $content = @file_get_contents($filename);
1198
-
1199
- } else {
1200
  $filename = realpath($filename);
1201
- if ($filename !== FALSE && file_exists($filename)) {
1202
- $handle = @fopen($filename, 'r');
1203
- $content = trim(@fread($handle, filesize($filename)));
1204
- @fclose($handle);
 
 
 
 
1205
  }
1206
  }
1207
-
1208
- $this->org_len += strlen(bin2hex($content));
1209
- return $content;
1210
  }
1211
 
1212
  //**************************************************************************************
1213
- // Read files
1214
  //**************************************************************************************
1215
- private function _files_read($files, $type = 'js') {
1216
- $text = '';
1217
- foreach ((array) $files as $filename) {
1218
- $content = trim($this->_file_read($filename));
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1219
  switch ($type) {
1220
  case 'css':
1221
  $content = $this->_css_url_edit($content, $filename);
 
 
 
 
 
 
 
1222
  break;
1223
 
1224
  case 'js':
1225
- // $content = 'try{'
1226
- // . trim($content . (substr($content, -1) !== ';' ? ';' : '')) . "\n"
1227
- // . ($this->options['debug_mode']
1228
- // ? '}catch(e){alert("error(' . basename($filename) . '): " + e.toString());}'
1229
- // : '}finally{};');
 
 
 
1230
  break;
1231
  }
 
 
 
 
 
 
 
 
 
 
 
 
1232
 
1233
- // $text .= "/***** ".str_replace(ABSPATH, $this->wp_url,$filename)." *****/\n" . $content . "\n\n";
1234
- $text .= $content . "\n\n";
 
 
 
 
 
 
1235
  }
1236
- unset($filename);
1237
  $text = $this->_tag_trim($text);
1238
 
1239
  return $text . (!empty($text) ? "\n" : '');
@@ -1344,8 +1424,8 @@ class HeadCleaner extends wokController {
1344
  if (!empty($src)) {
1345
  if ($prototype)
1346
  $src = $this->plugin_url . 'includes/js/jquery-1.2.6.min.js';
1347
- elseif (version_compare($ver, '1.4.2', '<='))
1348
- $src = $this->plugin_url . 'includes/js/jquery-1.4.2.min.js';
1349
 
1350
  if ($prototype || $mootools || strpos($src, $this->wp_url) === FALSE) {
1351
  $wk_outer_js .= $this->_script_tag($src);
@@ -1388,12 +1468,13 @@ class HeadCleaner extends wokController {
1388
  //**************************************************************************************
1389
  // Combined CSS
1390
  //**************************************************************************************
1391
- private function _combined_css($styles, $css = '', $media = 'all') {
1392
  $html = '';
1393
- $longfilename = ''; $files = array();
 
1394
 
1395
  if (empty($media))
1396
- $media = 'all';
1397
 
1398
  foreach ((array) $styles as $style) {
1399
  $src = trim(preg_replace('/(\.css|\.php)(\?[^\?]*)$/i', '$1', str_replace($this->wp_url, ABSPATH, $style)));
@@ -1402,25 +1483,22 @@ class HeadCleaner extends wokController {
1402
  $longfilename .= $filename . filemtime($src);
1403
  $files[] = $filename;
1404
  } else {
1405
- $html .= $this->_css_tag($style, $media);
1406
  }
1407
  }
1408
 
1409
  $md5_filename = md5($longfilename . $css);
1410
- $longfilename = 'css/' . $md5_filename . '.css';
1411
  $filename = $this->cache_path . $longfilename;
1412
  if (! file_exists($filename) ) {
1413
- if (count($files) > 0 && !empty($longfilename))
1414
- $css = $this->_files_read($files, 'css') . "\n\n" . $css;
1415
- $css = $this->_css_optimise($css); // Optimise CSS
 
1416
  if (!empty($css))
1417
  $this->_file_write($filename, $css, $this->options['gzip_on'] || HC_MAKE_GZ_FILE );
1418
  }
1419
-
1420
  $fileurl = $this->cache_url . $longfilename;
1421
- // $fileurl = $this->options['dynamic']
1422
- // ? $this->self_url . '?f=' . $md5_filename . '&amp;t=css'
1423
- // : $this->cache_url . $longfilename ;
1424
 
1425
  if (file_exists($filename))
1426
  $html .= $this->_css_tag($fileurl, $media);
@@ -1440,19 +1518,17 @@ class HeadCleaner extends wokController {
1440
 
1441
  $html = '';
1442
  $md5_filename = md5($css);
1443
- $longfilename = 'css/'. $md5_filename . '.css';
1444
 
1445
  // Optimise CSS
1446
- $css = $this->_css_optimise($css);
 
1447
 
1448
  $filename = $this->cache_path . $longfilename;
1449
  if (!file_exists($filename) && !empty($css))
1450
  $this->_file_write($filename, $css, $this->options['gzip_on'] || HC_MAKE_GZ_FILE);
1451
 
1452
  $fileurl = $this->cache_url . $longfilename;
1453
- // $fileurl = $this->options['dynamic']
1454
- // ? $this->self_url . '?f=' . $md5_filename . '&amp;t=css'
1455
- // : $this->cache_url . $longfilename ;
1456
 
1457
  if (file_exists($filename))
1458
  $html .= $this->_css_tag($fileurl, $media);
@@ -1465,7 +1541,8 @@ class HeadCleaner extends wokController {
1465
  //**************************************************************************************
1466
  private function _combined_javascript($javascripts, $script = '') {
1467
  $html = '';
1468
- $longfilename = ''; $files = array();
 
1469
 
1470
  foreach ((array) $javascripts as $javascript) {
1471
  $src = trim(preg_replace('/(\.js|\.php)(\?[^\?]*)$/i', '$1', str_replace($this->wp_url, ABSPATH, $javascript)));
@@ -1482,9 +1559,9 @@ class HeadCleaner extends wokController {
1482
  $longfilename = 'js/' . $md5_filename . '.js';
1483
  $filename = $this->cache_path . $longfilename;
1484
  if (! file_exists($filename) ) {
1485
- if (count($files) > 0 && !empty($longfilename))
1486
- $script = $this->_files_read($files, 'js') . "\n\n" . $script;
1487
- $script = $this->_js_minify($script); // Minified JavaScript
1488
  if (!empty($script))
1489
  $this->_file_write($filename, $script, $this->options['gzip_on'] || HC_MAKE_GZ_FILE);
1490
  }
@@ -1509,7 +1586,8 @@ class HeadCleaner extends wokController {
1509
  $longfilename = 'js/' . $md5_filename . '.js';
1510
 
1511
  // Minified JavaScript
1512
- $script = $this->_js_minify($script);
 
1513
 
1514
  $filename = $this->cache_path . $longfilename;
1515
  if (!file_exists($filename) && !empty($script) )
@@ -1546,12 +1624,6 @@ class HeadCleaner extends wokController {
1546
  array('', '', '', '', '') ,
1547
  $text)
1548
  );
1549
- // $text = 'try{'
1550
- // . $text . (substr($text, -1) !== ';' ? ';' : '') . "\n"
1551
- // . ($this->options['debug_mode']
1552
- // ? '}catch(e){alert("error: " + e.toString());}'
1553
- // : '}finally{};')
1554
- // ;
1555
  break;
1556
  }
1557
 
@@ -1562,10 +1634,12 @@ class HeadCleaner extends wokController {
1562
  // Get Newer version
1563
  //**************************************************************************************
1564
  private function _newer_version_src($js_libs, $limit_ver = '') {
1565
- $src = ''; $ver = '0.0';
 
1566
  foreach ((array) $js_libs as $key => $val) {
1567
  if ( version_compare( $key, $ver, '>') ) {
1568
- $src = $val; $ver = $key;
 
1569
  }
1570
  }
1571
 
@@ -1585,8 +1659,9 @@ class HeadCleaner extends wokController {
1585
  }
1586
  }
1587
  $js = trim($js);
 
1588
 
1589
- return $js . (!empty($js) ? "\n" : '');
1590
  }
1591
 
1592
  //**************************************************************************************
@@ -1594,11 +1669,12 @@ class HeadCleaner extends wokController {
1594
  //**************************************************************************************
1595
  private function _css_import($css) {
1596
  if (preg_match_all('/@import[ \t]*url[ \t]*\([\'"]?([^\)\'"]*)[\'"]?\);?/i', $css, $matches, PREG_SET_ORDER)) {
1597
- $search = array(); $replace = array();
 
1598
  foreach ((array) $matches as $match) {
1599
  $filename = str_replace($this->wp_url, ABSPATH, trim($match[1]));
1600
- $content = $this->_file_read(file_exists($filename) ? $filename : $match[1]);
1601
- $content = $this->_css_url_edit($content, $filename);
1602
  if ($this->options['css_optimise'])
1603
  $content = $this->_css_optimise($content, false);
1604
  if (preg_match('/@import[ \t]*url[ \t]*\([\'"]?[^\)\'"]*[\'"]?\);?/i', $content))
@@ -1607,7 +1683,9 @@ class HeadCleaner extends wokController {
1607
  $replace[] = $content;
1608
  }
1609
  $css = str_replace($search, $replace, $css);
1610
- unset($match); unset($search); unset($replace);
 
 
1611
  }
1612
  unset($matches);
1613
 
@@ -1617,26 +1695,96 @@ class HeadCleaner extends wokController {
1617
  private function _css_optimise($buffer, $merge = true) {
1618
  $css = $this->_tag_trim($buffer);
1619
 
1620
- if ($this->options['css_optimise']) {
1621
- if ( class_exists('Minify_CSS') ) {
1622
- $css = Minify_CSS::minify($css);
1623
- } else if ( class_exists('csstidy') ) {
1624
- $csstidy = new csstidy();
1625
- $csstidy->set_cfg('optimise_shorthands', $this->options['csstidy_option']['optimise_shorthands']);
1626
- $csstidy->set_cfg('compress_colors', $this->options['csstidy_option']['compress_colors']);
1627
- $csstidy->set_cfg('compress_font-weight', $this->options['csstidy_option']['compress_font_weight']);
1628
- $csstidy->set_cfg('remove_bslash', $this->options['csstidy_option']['remove_bslash']);
1629
- $csstidy->load_template($this->csstidy_template[$this->options['csstidy_option']['template']]);
1630
- $csstidy->parse($css);
1631
- $css = $csstidy->print->plain();
1632
- unset($csstidy);
1633
- }
1634
- }
1635
  if ( $merge )
1636
  $css = str_replace("\n\n", "\n", $this->_css_import($css));
1637
  $css = trim($css);
 
1638
 
1639
- return $css . (!empty($css) ? "\n" : '');
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1640
  }
1641
 
1642
  //**************************************************************************************
@@ -1715,7 +1863,7 @@ class HeadCleaner extends wokController {
1715
  if (!file_exists($filename)) {
1716
  return $this->_file_write($filename, $text, false);
1717
  } else {
1718
- $content = $this->_file_read($filename);
1719
  if ($content !== FALSE) {
1720
  if (strpos($content, '# BEGIN Head Cleaner') === FALSE && strpos($content, 'RewriteRule .+ %{REQUEST_URI}.gz') === FALSE) {
1721
  $text = $content . "\n" . $text;
@@ -1729,7 +1877,7 @@ class HeadCleaner extends wokController {
1729
  }
1730
  } else {
1731
  if ( file_exists($filename) ) {
1732
- $content = trim($this->_file_read($filename));
1733
  if ($content !== FALSE) {
1734
  $content = trim(preg_replace('/# BEGIN Head Cleaner.*# END Head Cleaner/ism', '', $content));
1735
  if ( $text === $content || $content === '') {
@@ -1752,6 +1900,8 @@ class HeadCleaner extends wokController {
1752
  //**************************************************************************************
1753
  public function admin_menu() {
1754
  $this->addOptionPage(__('Head Cleaner'), array($this, 'option_page'));
 
 
1755
  }
1756
 
1757
  public function plugin_setting_links($links, $file) {
@@ -1770,6 +1920,36 @@ class HeadCleaner extends wokController {
1770
  //**************************************************************************************
1771
  // Show Option Page
1772
  //**************************************************************************************
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1773
  private function _checkbox($id, $flag = '') {
1774
  if ( $flag === '' )
1775
  $flag = $this->options[$id];
@@ -1814,169 +1994,131 @@ class HeadCleaner extends wokController {
1814
  $out = '';
1815
 
1816
  // Add Options
1817
- $out .= "<div class=\"wrap\">\n";
1818
- $out .= "<form method=\"post\" id=\"update_options\" action=\"".$this->admin_action."\">\n";
1819
- $out .= "<h2>".__('Head Cleaner Options', $this->textdomain_name)."</h2><br />\n";
1820
  if ($this->wp25)
1821
  $out .= $this->makeNonceField("update_options", "_wpnonce_update_options", true, false);
1822
 
1823
- $out .= "<table class=\"optiontable form-table\" style=\"margin-top:0;\"><tbody>\n";
1824
 
1825
- $out .= "<tr>";
1826
- $out .= "<td>";
1827
  $out .= $this->_checkbox('cache_enabled');
1828
  $out .= __('CSS and JavaScript are cached on the server.', $this->textdomain_name);
1829
- $out .= "</td>";
1830
- $out .= "<td>";
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1831
  $out .= $this->_checkbox('js_move_foot');
1832
  $out .= __('Put JavaScripts at the Bottom.', $this->textdomain_name);
1833
- $out .= "</td>";
1834
- $out .= "<td>";
1835
- if ($this->options['cache_enabled']) {
1836
- $out .= $this->_checkbox('dynamic');
1837
- $out .= __('CSS and JS are dynamically generated.', $this->textdomain_name);
1838
- }
1839
- $out .= "</td>";
1840
- $out .= "</tr>\n";
1841
-
1842
- if ($this->options['cache_enabled']) {
1843
- $out .= "<tr>";
1844
- $out .= "<td>";
1845
- $out .= $this->_checkbox('combined_css');
1846
- $out .= __('Two or more CSS is combined.', $this->textdomain_name);
1847
- $out .= "</td>";
1848
- $out .= "<td>";
1849
- $out .= $this->_checkbox('css_optimise');
1850
- $out .= __('CSS is optimized.', $this->textdomain_name);
1851
- $out .= "</td>";
1852
- $out .= "<td>";
1853
- $out .= __('Default media attribute applied to CSS.', $this->textdomain_name);
1854
- $out .= "<input type=\"text\" name=\"default_media\" id=\"default_media\" value=\"{$this->options['default_media']}\" style=\"margin-left:0.5em;\" />";
1855
- $out .= "</td>";
1856
- $out .= "<td>";
1857
- $out .= "</tr>\n";
1858
-
1859
- $out .= "<tr>";
1860
- $out .= "<td>";
1861
- $out .= $this->_checkbox('combined_js');
1862
- $out .= __('Two or more JavaScript is combined.', $this->textdomain_name);
1863
- $out .= "</td>";
1864
- $out .= "<td>";
1865
- $out .= $this->_checkbox('js_minify');
1866
- $out .= __('JavaScript is minified.', $this->textdomain_name);
1867
- $out .= "</td>";
1868
- $out .= "<td>";
1869
- $out .= $this->_checkbox('foot_js');
1870
- $out .= __('Bottom JavaScript is combined, too.', $this->textdomain_name);
1871
- $out .= "</td>";
1872
- $out .= "</tr>\n";
1873
- }
1874
- $out .= "<tr>";
1875
- // $out .= "<td>";
1876
- // $out .= $this->_checkbox('gzip_on');
1877
- // $out .= __('gzip compress to CSS and JS.', $this->textdomain_name);
1878
- // $out .= "</td>";
1879
- $out .= "<td>";
1880
  $out .= $this->_checkbox('use_ajax_libs');
1881
  $out .= __('Use Google Ajax Libraries.', $this->textdomain_name);
1882
- $out .= "</td>";
1883
- $out .= "<td>";
1884
- $out .= $this->_checkbox('ie_conditional');
1885
- $out .= __('Remove IE Conditional Tag.', $this->textdomain_name);
1886
- $out .= "</td>";
1887
- $out .= "<td>";
1888
- $out .= "</td>";
1889
- $out .= "</tr>\n";
1890
 
1891
- $out .= "<tr>";
1892
- $out .= "<td>";
1893
  $out .= $this->_checkbox('xml_declaration');
1894
  $out .= __('Add XML Declaration.', $this->textdomain_name);
1895
- $out .= "</td>";
1896
- $out .= "<td>";
1897
  $out .= $this->_checkbox('canonical_tag');
1898
  $out .= __('Add canonical tag.', $this->textdomain_name);
1899
- $out .= "</td>";
1900
- $out .= "<td>";
1901
- $out .= "</td>";
1902
- $out .= "</tr>\n";
 
 
1903
 
1904
- $out .= "<tr>";
1905
- $out .= "<td>";
1906
  $out .= $this->_checkbox('rm_generator', isset($this->options['priority']['wp_head']['wp_generator']) && $this->options['priority']['wp_head']['wp_generator'] <= 0);
1907
  $out .= __('Remove generator tag.', $this->textdomain_name);
1908
- $out .= "</td>";
1909
- $out .= "<td>";
1910
  $out .= $this->_checkbox('rm_rsd_link', isset($this->options['priority']['wp_head']['rsd_link']) && $this->options['priority']['wp_head']['rsd_link'] <= 0);
1911
  $out .= __('Remove RSD link tag.', $this->textdomain_name);
1912
- $out .= "</td>";
1913
- $out .= "<td>";
1914
  $out .= $this->_checkbox('rm_manifest', isset($this->options['priority']['wp_head']['wlwmanifest_link']) && $this->options['priority']['wp_head']['wlwmanifest_link'] <= 0);
1915
  $out .= __('Remove wlwmanifest link tag.', $this->textdomain_name);
1916
- $out .= "</td>";
1917
- $out .= "</tr>\n";
1918
 
1919
- $out .= "<tr>";
1920
- $out .= "<td>";
1921
  $out .= $this->_checkbox('debug_mode');
1922
  $out .= __('Debug mode', $this->textdomain_name);
1923
- $out .= "</td>";
1924
- $out .= "<td>";
1925
- $out .= "</td>";
1926
- $out .= "<td>";
1927
- $out .= "</td>";
1928
- $out .= "</tr>\n";
1929
-
1930
- $out .= "</tbody></table>";
1931
-
1932
- // CSS Tidy Options
1933
- if ($this->options['css_optimise'] && class_exists('csstidy')) {
1934
- $out .= "<div style=\"margin-top:2em;\" id=\"csstidy_option\">\n";
1935
- $out .= "<h3>" . __('The CSS optimization settings', $this->textdomain_name) . "</h3>" ;
1936
-
1937
- $out .= __('Compression (code layout):', $this->textdomain_name) . '&nbsp;&nbsp;';
1938
- $out .= '<select name="template" id="template">';
1939
- $out .= '<option value="3"' . ($this->options['csstidy_option']['template']==3 ? ' selected="selected"' : '') . '>' . __('Highest (no readability, smallest size)', $this->textdomain_name) .'</option>';
1940
- $out .= '<option value="2"' . ($this->options['csstidy_option']['template']==2 ? ' selected="selected"' : '') . '>' . __('High (moderate readability, smaller size)', $this->textdomain_name) .')</option>';
1941
- $out .= '<option value="1"' . ($this->options['csstidy_option']['template']==1 ? ' selected="selected"' : '') . '>' . __('Standard (balance between readability and size)', $this->textdomain_name) .'</option>';
1942
- $out .= '<option value="0"' . ($this->options['csstidy_option']['template']==0 ? ' selected="selected"' : '') . '>' . __('Low (higher readability)', $this->textdomain_name) .'</option>';
1943
- $out .= '</select>';
1944
- $out .= '&nbsp;&nbsp;&nbsp;&nbsp;';
1945
- $out .= __('Optimise shorthands', $this->textdomain_name) . '&nbsp;&nbsp;';
1946
- $out .= '<select name="optimise_shorthands" id="optimise_shorthands">';
1947
- $out .= '<option value="2"' . ($this->options['csstidy_option']['optimise_shorthands']==2 ? ' selected="selected"' : '') . '>' . __('All optimisations', $this->textdomain_name) .')</option>';
1948
- $out .= '<option value="1"' . ($this->options['csstidy_option']['optimise_shorthands']==1 ? ' selected="selected"' : '') . '>' . __('Safe optimisations', $this->textdomain_name) .'</option>';
1949
- $out .= '<option value="0"' . ($this->options['csstidy_option']['optimise_shorthands']==0 ? ' selected="selected"' : '') . '>' . __("Don't optimise", $this->textdomain_name) .'</option>';
1950
- $out .= '</select>';
1951
- $out .= "<br />\n";
1952
-
1953
- $out .= $this->_checkbox('compress_colors', $this->options['csstidy_option']['compress_colors'] === true);
1954
- $out .= __('Compress colors', $this->textdomain_name);
1955
- $out .= '&nbsp;&nbsp;&nbsp;&nbsp;';
1956
- $out .= $this->_checkbox('compress_font_weight', $this->options['csstidy_option']['compress_font_weight'] === true);
1957
- $out .= __('Compress font-weight', $this->textdomain_name);
1958
- $out .= '&nbsp;&nbsp;&nbsp;&nbsp;';
1959
- $out .= $this->_checkbox('remove_bslash', $this->options['csstidy_option']['remove_bslash'] === true);
1960
- $out .= __('Remove unnecessary backslashes', $this->textdomain_name);
1961
- $out .= "<br />\n";
1962
-
1963
- $out .= "</div>\n";
1964
- }
1965
 
1966
  // Active Filters
1967
  $out .= "<div style=\"margin-top:2em;\" id=\"active_filters\">\n";
1968
- $out .= "<h3>" . __('Active Filters', $this->textdomain_name) . "</h3>" ;
1969
- $out .= "<table><tbody>\n";
1970
- $out .= "<tr>";
1971
- $out .= '<th style="padding:0 .5em;">' . __("Don't process!", $this->textdomain_name) . "</th>\n";
1972
- $out .= '<th style="padding:0 .5em;">' . __('Remove', $this->textdomain_name) . "</th>\n";
1973
- $out .= "<th>" . __('Head filters', $this->textdomain_name) . "</th>\n";
1974
  if ($this->options['debug_mode'])
1975
- $out .= "<th>" . __('Priority', $this->textdomain_name) . "</th>\n";
1976
- $out .= "</tr>\n";
1977
  $head_filters = array();
1978
  foreach ((array) $this->options['filters']['wp_head'] as $function_name => $priority) {
1979
- if ($priority < HC_PRIORITY) {
1980
  if (isset($this->options['priority']['wp_head'][$function_name]))
1981
  $priority = (int) $this->options['priority']['wp_head'][$function_name];
1982
  if (!isset($head_filters[$priority]))
@@ -1989,31 +2131,32 @@ class HeadCleaner extends wokController {
1989
  foreach ($head_filters as $priority => $filters) {
1990
  foreach ($filters as $function_name){
1991
  if ( ! preg_match('/^(' . implode('|', $this->default_head_filters) . ')$/i', $function_name)) {
1992
- $out .= "<tr>";
1993
- $out .= "<th><input type=\"checkbox\" name=\"head_filters[$i]\" value=\"$function_name\"".($priority > HC_PRIORITY ? " checked=\"true\"" : "")." /></th>";
1994
- $out .= "<th><input type=\"checkbox\" name=\"head_remove[$i]\" value=\"$function_name\"".($priority <= 0 ? " checked=\"true\"" : "")." /></th>";
1995
- $out .= "<td>$function_name</td>";
1996
  if ($this->options['debug_mode'])
1997
- $out .= "<td>( $priority )</td>";
1998
- $out .= "</tr>\n";
1999
  $i++;
2000
  }
2001
  }
2002
  }
2003
- unset($filters); unset($head_filters);
 
2004
 
2005
  if ($this->options['foot_js'] === true) {
2006
- $out .= "<tr><td colspan='3'>&nbsp;</td></tr>\n";
2007
- $out .= "<tr>";
2008
- $out .= '<th style="padding:0 .5em;">' . __("Don't process!", $this->textdomain_name) . "</th>\n";
2009
- $out .= '<th style="padding:0 .5em;">' . __('Remove', $this->textdomain_name) . "</th>\n";
2010
- $out .= "<th>" . __('Bottom filters', $this->textdomain_name) . "</th>\n";
2011
  if ($this->options['debug_mode'])
2012
- $out .= "<th>" . __('Priority', $this->textdomain_name) . "</th>\n";
2013
- $out .= "</tr>\n";
2014
  $footer_filters = array();
2015
  foreach ((array) $this->options['filters']['wp_footer'] as $function_name => $priority) {
2016
- if ($priority < HC_PRIORITY) {
2017
  if (isset($this->options['priority']['wp_footer'][$function_name]))
2018
  $priority = (int) $this->options['priority']['wp_footer'][$function_name];
2019
  if (!isset($footer_filters[$priority]))
@@ -2026,66 +2169,76 @@ class HeadCleaner extends wokController {
2026
  foreach ($footer_filters as $priority => $filters) {
2027
  foreach ($filters as $function_name){
2028
  if ( ! preg_match('/^(' . implode('|', $this->default_head_filters) . ')$/i', $function_name)) {
2029
- $out .= "<tr>";
2030
- $out .= "<th><input type=\"checkbox\" name=\"foot_filters[$i]\" value=\"$function_name\"".($priority > HC_PRIORITY ? " checked=\"true\"" : "")." /></th>";
2031
- $out .= "<th><input type=\"checkbox\" name=\"foot_remove[$i]\" value=\"$function_name\"".($priority <= 0 ? " checked=\"true\"" : "")." /></th>";
2032
- $out .= "<td>$function_name</td>";
2033
  if ($this->options['debug_mode'])
2034
- $out .= "<td>( $priority )</td>";
2035
- $out .= "</tr>\n";
2036
  $i++;
2037
  }
2038
  }
2039
  }
2040
- unset($filters); unset($footer_filters);
 
2041
  }
2042
- $out .= "</tbody></table>";
2043
- $out .= "</div>\n";
2044
 
2045
  // Active JavaScripts
2046
- $out .= "<div style=\"margin-top:2em;\" id=\"active_javascripts\">\n";
2047
- $out .= "<h3>" . __('Active JavaScripts', $this->textdomain_name) . "</h3>" ;
2048
- $out .= "<table><tbody>\n";
2049
- $out .= "<tr>";
2050
- $out .= '<th style="padding:0 .5em;">' . __('Move to footer', $this->textdomain_name) . "</th>\n";
2051
- $out .= '<th style="padding:0 .5em;">' . __('Remove', $this->textdomain_name) . "</th>\n";
2052
- $out .= "<th>" . __('JavaScripts', $this->textdomain_name) . "</th>\n";
2053
  foreach ($this->options['head_js'] as $javascript => $value) {
2054
  $remove = (array_search( $javascript, (array)$this->options["remove_js"] ) !== FALSE);
2055
- $out .= "<tr>";
2056
- $out .= "<th><input type=\"checkbox\" name=\"head_js[$i]\" value=\"$javascript\"".($value === FALSE ? " checked=\"true\"" : "")." /></th>";
2057
- $out .= "<th><input type=\"checkbox\" name=\"remove_js[$i]\" value=\"$javascript\"".($remove !== FALSE ? " checked=\"true\"" : "")." /></th>";
2058
- $out .= "<td>$javascript</td>";
2059
  $i++;
2060
  }
2061
- $out .= "</tbody></table>";
2062
- $out .= "</div>\n";
2063
 
2064
  // Add Update Button
2065
- $out .= "<p style=\"margin-top:1em\"><input type=\"submit\" name=\"options_update\" class=\"button-primary\" value=\"".__('Update Options', $this->textdomain_name)." &raquo;\" class=\"button\" /></p>";
2066
- $out .= "</form></div>\n";
 
 
2067
 
2068
  // Cache Delete
2069
- $out .= "<div class=\"wrap\" style=\"margin-top:2em;\">\n";
2070
- $out .= "<h2>" . __('Remove all cache files', $this->textdomain_name) . "</h2><br />\n";
2071
- $out .= "<form method=\"post\" id=\"remove_cache\" action=\"".$this->admin_action."\">\n";
2072
- if ($this->wp25) $out .= $this->makeNonceField("remove_cache", "_wpnonce_remove_cache", true, false);
2073
- $out .= "<p>" . __('All cache files are removed.', $this->textdomain_name) . "</p>";
2074
- $out .= "<input type=\"submit\" name=\"remove_cache\" class=\"button-primary\" value=\"".__('Remove All Cache Files', $this->textdomain_name)." &raquo;\" class=\"button\" />";
2075
- $out .= "</form></div>\n";
 
2076
 
2077
  // Options Delete
2078
- $out .= "<div class=\"wrap\" style=\"margin-top:2em;\">\n";
2079
- $out .= "<h2>" . __('Uninstall', $this->textdomain_name) . "</h2><br />\n";
2080
- $out .= "<form method=\"post\" id=\"delete_options\" action=\"".$this->admin_action."\">\n";
2081
- if ($this->wp25) $out .= $this->makeNonceField("delete_options", "_wpnonce_delete_options", true, false);
2082
- $out .= "<p>" . __('All the settings of &quot;Head Cleaner&quot; are deleted.', $this->textdomain_name) . "</p>";
2083
- $out .= "<input type=\"submit\" name=\"options_delete\" class=\"button-primary\" value=\"".__('Delete Options', $this->textdomain_name)." &raquo;\" class=\"button\" />";
2084
- $out .= "</form></div>\n";
 
2085
 
2086
  // Output
2087
- echo (!empty($this->note) ? "<div id=\"message\" class=\"updated fade\"><p>{$this->note}</p></div>\n" : '') . "\n";
2088
- echo ($this->error == 0 ? $out : '') . "\n";
 
 
 
 
 
2089
 
2090
  }
2091
 
@@ -2112,20 +2265,14 @@ class HeadCleaner extends wokController {
2112
  $this->options['js_move_foot'] = $this->_checkbox_val($recv_param, 'js_move_foot');
2113
  $this->options['cache_enabled'] = $this->_checkbox_val($recv_param, 'cache_enabled');
2114
  $this->options['combined_css'] = $this->_checkbox_val($recv_param, 'combined_css');
2115
- $this->options['combined_js'] = $this->_checkbox_val($recv_param, 'combined_js');
2116
- $this->options['js_minify'] = $this->_checkbox_val($recv_param, 'js_minify');
2117
  $this->options['css_optimise'] = $this->_checkbox_val($recv_param, 'css_optimise');
2118
  $this->options['default_media'] = trim($recv_param['default_media']);
 
 
 
2119
  $this->options['gzip_on'] = $this->_checkbox_val($recv_param, 'gzip_on');
2120
  $this->options['use_ajax_libs'] = $this->_checkbox_val($recv_param, 'use_ajax_libs');
2121
  $this->options['debug_mode'] = $this->_checkbox_val($recv_param, 'debug_mode');
2122
- $this->options['csstidy_option'] = array(
2123
- 'template' => (int) $recv_param['template'] ,
2124
- 'optimise_shorthands' => (int) $recv_param['optimise_shorthands'] ,
2125
- 'compress_colors' => $this->_checkbox_val($recv_param, 'compress_colors') ,
2126
- 'compress_font_weight' => $this->_checkbox_val($recv_param, 'compress_font_weight') ,
2127
- 'remove_bslash' => $this->_checkbox_val($recv_param, 'remove_bslash') ,
2128
- );
2129
 
2130
  $rm_generator = $this->_checkbox_val($recv_param, 'rm_generator');
2131
  $rm_rsd_link = $this->_checkbox_val($recv_param, 'rm_rsd_link');
@@ -2147,7 +2294,7 @@ class HeadCleaner extends wokController {
2147
  $tag = 'wp_head';
2148
  foreach ((array) $this->options['filters'][$tag] as $function_name => $priority) {
2149
  if (count($head_filters) > 0 && array_search($function_name, $head_filters) !== FALSE)
2150
- $this->options['priority'][$tag][$function_name] = HC_PRIORITY + 1;
2151
  elseif (count($head_remove) > 0 && array_search($function_name, $head_remove) !== FALSE)
2152
  $this->options['priority'][$tag][$function_name] = -1;
2153
  elseif (isset($this->options['priority'][$tag][$function_name]))
@@ -2162,7 +2309,7 @@ class HeadCleaner extends wokController {
2162
  $tag = 'wp_footer';
2163
  foreach ((array) $this->options['filters'][$tag] as $function_name => $priority) {
2164
  if (count($foot_filters) > 0 && array_search($function_name, $foot_filters) !== FALSE)
2165
- $this->options['priority'][$tag][$function_name] = HC_PRIORITY + 1;
2166
  elseif (count($foot_remove) > 0 && array_search($function_name, $foot_remove) !== FALSE)
2167
  $this->options['priority'][$tag][$function_name] = -1;
2168
  elseif (isset($this->options['priority'][$tag][$function_name]))
@@ -2196,7 +2343,6 @@ class HeadCleaner extends wokController {
2196
  // Get function name
2197
  //**************************************************************************************
2198
  private function _get_function_name($function) {
2199
- // return (is_set($function[0]) && is_set($function[1])
2200
  return (is_object($function[0])
2201
  ? (get_class($function[0]) !== FALSE ? get_class($function[0]) : $function[0]) . '::' . $function[1]
2202
  : $function );
@@ -2220,6 +2366,8 @@ class HeadCleaner extends wokController {
2220
  foreach ($active_filters as $priority => $filters) {
2221
  foreach ($filters as $filter) {
2222
  $function_name = $this->_get_function_name($filter['function']);
 
 
2223
  $this->filters[$tag][$function_name] = $priority;
2224
  }
2225
  }
@@ -2273,7 +2421,7 @@ class HeadCleaner extends wokController {
2273
  ? $this->options['priority'][$tag]
2274
  : array() );
2275
  foreach ($this->no_conflict as $function_name) {
2276
- $custom_priority[$function_name] = HC_PRIORITY + 1;
2277
  }
2278
  foreach ($active_filters as $priority => $filters) {
2279
  foreach ($filters as $filter) {
1
  <?php
2
  /*
3
  Plugin Name: Head Cleaner
4
+ Version: 1.4.0
5
  Plugin URI: http://wppluginsj.sourceforge.jp/head-cleaner/
6
  Description: Cleaning tags from your WordPress header and footer.
7
  Author: wokamoto
12
  License:
13
  Released under the GPL license
14
  http://www.gnu.org/copyleft/gpl.html
 
15
  Copyright 2009 - 2010 wokamoto (email : wokamoto1973@gmail.com)
16
 
17
  This program is free software; you can redistribute it and/or modify
37
  Copyright (c) 2002 Douglas Crockford <douglas@crockford.com> (jsmin.c)
38
  Copyright (c) 2008 Ryan Grove <ryan@wonko.com> (PHP port)
39
  License http://opensource.org/licenses/mit-license.php MIT License
 
 
 
 
40
  */
41
 
 
 
 
42
  //**************************************************************************************
43
  // Defines
44
  //**************************************************************************************
 
 
 
 
 
 
45
  if (!defined('HC_CACHE_DIR'))
46
  define('HC_CACHE_DIR', 'cache/head-cleaner');
47
  if (!defined('HC_MAKE_GZ_FILE'))
66
  //**************************************************************************************
67
  class HeadCleaner extends wokController {
68
  public $plugin_name = 'head-cleaner';
69
+ public $plugin_ver = '1.4.0';
70
+
71
+ const PRIORITY = 10000;
72
+ const ANALYZE_EXPIRED = 604800; // 60 * 60 * 24 * 7 [sec.]
73
+ const XMLNS = 'http://www.w3.org/1999/xhtml';
74
+ const IMG_BASE64_MAX_SIZE = 4096;
75
 
76
  // Deafault Options
77
  private $options_default = array(
83
  'combined_js' => false ,
84
  'js_minify' => false ,
85
  'css_optimise' => false ,
 
 
 
 
 
 
 
86
  'default_media' => 'all' ,
87
  'debug_mode' => false ,
88
  'filters' => array('wp_head' => array(), 'wp_footer' => array()) ,
95
  'canonical_tag' => true ,
96
  'gzip_on' => false ,
97
  'use_ajax_libs' => false ,
98
+ 'img_base64' => false ,
 
 
 
 
 
99
  );
100
 
101
  private $wp_url = '';
136
  'wpSEO::exe_modify_content' => false ,
137
  );
138
 
139
+ private $img_urls = array();
140
 
141
  /**********************************************************
142
  * Constructor
213
  $priority = $this->options_default['priority'];
214
  foreach ($wk_options['priority'] as $tag => $filters) {
215
  foreach ((array) $filters as $key => $val) {
216
+ if ($val <= 0 || $val > HeadCleaner::PRIORITY)
217
  $priority[$tag][$key] = $val;
218
  }
219
  }
228
  $wk_options['filters'] = $filters;
229
  $wk_options['priority'] = $priority;
230
  $wk_options['head_js'] = $head_js;
231
+ $wk_options['analyze_expired'] = time() + HeadCleaner::ANALYZE_EXPIRED;
232
  }
233
 
234
  return $wk_options;
250
  $this->options['js_minify'] = class_exists('JSMin') && $this->options['js_minify'];
251
  }
252
 
 
 
 
 
 
253
  if ($this->options['css_optimise'] && !class_exists('Minify_CSS')) {
254
  require($includes . 'CSSMin.php');
255
  $this->options['css_optimise'] = class_exists('Minify_CSS') && $this->options['css_optimise'];
273
  // plugin deactivation
274
  //**************************************************************************************
275
  public function deactivation(){
 
276
  }
277
 
278
  //**************************************************************************************
296
  if ( function_exists('rel_canonical') && !$this->options['canonical_tag'] )
297
  remove_action( 'wp_head', 'rel_canonical' );
298
 
299
+ add_action('wp_head', array(&$this, 'end'), HeadCleaner::PRIORITY);
300
  $this->_get_filters('wp_head');
301
  $this->_change_filters_priority('wp_head');
302
 
323
  ob_start(array(&$this, 'footer_cleaner'));
324
  $this->mtime_start = microtime();
325
 
326
+ add_action('wp_footer', array(&$this, 'end'), HeadCleaner::PRIORITY);
327
  $this->_get_filters('wp_footer');
328
  $this->_change_filters_priority('wp_footer');
329
  }
335
  private function ob_handler($content){
336
  foreach ( $this->ob_handlers as $ob_handler => $enable ) {
337
  if ( $enable ) {
338
+ $this->ob_handlers[$ob_handler] = false;
339
  switch ($ob_handler) {
340
  case 'All_in_One_SEO_Pack::output_callback_for_title':
341
  global $aiosp;
351
  default :
352
  break;
353
  }
 
354
  }
355
  }
356
 
372
  if ( $this->options['filters'] != $this->filters || $this->options['head_js'] != $this->head_js ) {
373
  $this->options['filters'] = $this->filters;
374
  $this->options['head_js'] = $this->head_js;
375
+ $this->options['analyze_expired'] = time() + HeadCleaner::ANALYZE_EXPIRED;
376
  $this->updateOptions();
377
  }
378
  }
386
  if (!function_exists('str_get_html'))
387
  return $buffer;
388
 
 
 
 
 
 
389
  $head_txt = $buffer;
390
  $url = $this->_get_permalink();
391
 
464
  if ( empty($html_tag) ) {
465
  if ( $doctype === 'xhtml' ) {
466
  // xhtml
467
+ $xmlns = HeadCleaner::XMLNS;
468
  $xml_lang = $this->lang;
469
  } else {
470
  // html
475
  if (preg_match_all('/ +([^ ]*)=[\'"]([^\'"]*)[\'"]/', $html_tag, $matches, PREG_SET_ORDER)) {
476
  foreach ((array) $matches as $match) {
477
  switch ($match[1]){
478
+ case 'xmlns':
479
+ $xmlns = $match[2];
480
+ break;
481
+ case 'xml:lang':
482
+ $xml_lang = $match[2];
483
+ break;
484
+ case 'lang':
485
+ $lang = $match[2];
486
+ break;
487
+ case 'dir':
488
+ $dir = $match[2];
489
+ break;
490
+ case 'lang':
491
+ $lang = $match[2];
492
+ break;
493
  }
494
  }
495
  unset($match);
511
  list($script_tag, $inline_js, $foot_js) = $this->_parse_script_tag($dom->find("script"));
512
  $noscript_tag = $this->_dom_to_html($dom->find("noscript"));
513
  $object_tag = $this->_dom_to_html($dom->find("object"));
514
+ $object_tag .= $this->_rdf_convert($dom->find("rdf:RDF"));
515
 
516
  $dom->clear();
517
  unset($dom);
545
  $this->_tag_trim($link_tag) .
546
  $this->_tag_trim($css_tag) .
547
  $this->_tag_trim($inline_css) .
548
+ (!$this->options['js_move_foot'] ? $this->_tag_trim($script_tag) : '') .
549
+ (!$this->options['js_move_foot'] ? $this->_tag_trim($inline_js) : '') .
550
  $this->_tag_trim($noscript_tag) .
551
  $this->_tag_trim($object_tag) ;
552
 
577
 
578
  $this->org_len = strlen(bin2hex($buffer));
579
  $this->ret_len = strlen(bin2hex($ret_val));
580
+ $this->process_time = $this->_microtime_diff($this->mtime_start);
581
  // $ret_val .= "<!-- {$this->process_time} seconds. {$this->ret_len} / {$this->org_len} (" . (int) (($this->org_len - $this->ret_len) / $this->org_len * 10000) / 100 . "% saving) -->\n";
582
 
583
+ $ret_val = apply_filters($this->plugin_name.'/head_cleaner', $ret_val);
 
584
  return $ret_val;
585
  }
586
 
653
  $css_src = array();
654
  $wk_inline_css = array();
655
  $inline_css = '';
656
+ $inner_css_src = array();
657
 
658
  // css file
659
  foreach ((array) $elements_linktag as $element) {
673
  ? $this->options['default_media']
674
  : $media );
675
  $inner_css .= $this->_tag_trim($tag);
676
+ if (!isset($css_src[$media]))
677
+ $css_src[$media] = array();
678
  $css_src[$media][] = $element->href;
679
+ $inner_css_src[] = $element->href;
680
  }
681
  }
682
  }
687
  $media = trim( isset($element->media) ? $element->media : $this->options['default_media'] );
688
  $media = ( empty($media) || is_null($media) || $media === FALSE ? $this->options['default_media'] : $media );
689
  $wk_text = $this->_remove_comment($element->innertext, 'css');
690
+ $wk_text = $this->_css_import($wk_text);
 
 
 
 
 
 
 
 
 
 
 
 
 
691
  if ( !empty($wk_text) ) {
692
  if ( !isset($wk_inline_css[$media]) )
693
  $wk_inline_css[$media] = $this->_tag_trim($wk_text);
695
  $wk_inline_css[$media] .= $this->_tag_trim($wk_text);
696
  }
697
  }
698
+
699
+ // make cache file
700
  if ($this->options['cache_enabled']) {
701
  if ($this->options['combined_css']) {
702
+ $inner_css = '';
703
+ foreach ($css_src as $media => $val) {
704
+ $inner_css .= $this->_combined_css($val, trim(isset($wk_inline_css[$media]) ? $wk_inline_css[$media] : '' ), $media);
705
+ if (isset($wk_inline_css[$media]))
706
+ unset($wk_inline_css[$media]);
 
 
 
 
707
  }
708
  foreach ($wk_inline_css as $key => $val) {
709
  $val = trim($val);
710
  if (!empty($val)) {
711
+ $inner_css .= $this->_combined_css(array(), $val, $key);
 
712
  }
713
  }
714
 
715
  } else {
716
+ if ($this->options['css_optimise'] || $this->options['img_base64']) {
717
+ foreach ($inner_css_src as $path) {
718
+ $real_path = realpath(preg_replace('/^([^\?]*)([\?]?.*)$/', "$1", str_replace($this->wp_url, ABSPATH, $path)));
719
+ if ($real_path !== false && file_exists($real_path)) {
720
+ list($content, $cache_path) = $this->_file_read($real_path, 'css');
721
+ if (file_exists($cache_path)) {
722
+ $cache_url = str_replace(ABSPATH, $this->wp_url, $cache_path);
723
+ $inner_css = str_replace($path, $cache_url, $inner_css);
724
+ }
725
+ }
726
+ }
727
+ }
728
+
729
  foreach ($wk_inline_css as $key => $val) {
730
  $val = trim($val);
731
  if (!empty($val)) {
732
+ $inner_css .= $this->_combined_inline_css(trim($val), $key);
 
733
  }
734
  }
735
  }
736
+
737
  } else {
 
 
 
 
 
738
  foreach ($wk_inline_css as $key => $val) {
739
  $val = trim($val);
740
  if (!empty($val))
744
  unset($wk_inline_css);
745
  unset($element);
746
 
747
+ $css_tag =
748
+ $this->_tag_trim($css_tag) .
749
+ $this->_tag_trim($inner_css) .
750
+ $this->_tag_trim($css_tag_with_id) .
751
+ $this->_tag_trim($css_tag_with_title) ;
752
+
753
  $css_tag = $this->_tag_trim($css_tag);
754
  $inline_css = $this->_tag_trim($inline_css);
755
 
756
+ $css_tag = apply_filters($this->plugin_name.'/css_tag', $css_tag);
757
+ $inline_css = apply_filters($this->plugin_name.'/inline_css', $inline_css);
758
  return array($css_tag, $inline_css);
759
  }
760
 
761
  //**************************************************************************************
762
+ // parse script tag
763
  //**************************************************************************************
764
  private function _parse_script_tag($elements){
765
  $script_tag = '';
767
  $foot_js = '';
768
  $js_src = array();
769
  $js_libs = array();
770
+ $inner_js_src = array();
771
 
772
  foreach ((array) $elements as $element) {
773
  if (!isset($element->src)) {
805
  } else {
806
  $inner_js .= $this->_tag_trim($element->outertext);
807
  $js_src[] = $element->src;
808
+ $inner_js_src[] = $element->src;
809
  }
810
  }
811
  }
826
  unset($js_libs);
827
  }
828
 
829
+ // make chache file
830
  $inline_js = $this->_tag_trim($inline_js);
831
  if ($this->options['cache_enabled']) {
832
  if ($this->options['combined_js']) {
833
  $inner_js = $this->_combined_javascript($js_src, trim($inline_js));
 
834
  $inline_js = '';
835
+
836
  } else {
837
+ if ($this->options['js_minify']) {
838
+ foreach ($inner_js_src as $path) {
839
+ $real_path = realpath(preg_replace('/^([^\?]*)([\?]?.*)$/', "$1", str_replace($this->wp_url, ABSPATH, $path)));
840
+ if ($real_path !== false && file_exists($real_path)) {
841
+ list($content, $cache_path) = $this->_file_read($real_path, 'js');
842
+ if (file_exists($cache_path)) {
843
+ $cache_url = str_replace(ABSPATH, $this->wp_url, $cache_path);
844
+ $inner_js = str_replace($path, $cache_url, $inner_js);
845
+ }
846
+ }
847
+ }
848
+ }
849
  $inline_js = $this->_combined_inline_javascript(trim($inline_js));
850
  }
851
+
852
  } else {
 
853
  $inline_js = $this->_script_tag($inline_js, true);
854
  }
855
 
856
+ $script_tag =
857
+ $this->_tag_trim($script_tag) .
858
+ $this->_tag_trim($inner_js) ;
859
+
860
  $script_tag = $this->_tag_trim($script_tag);
861
  $inline_js = $this->_tag_trim($inline_js);
862
  $foot_js = $this->_tag_trim($foot_js);
863
 
864
+ $script_tag = apply_filters($this->plugin_name.'/script_tag', $script_tag);
865
+ $inline_js = apply_filters($this->plugin_name.'/inline_js', $inline_js);
866
+ $foot_js = apply_filters($this->plugin_name.'/foot_js', $foot_js);
867
  return array($script_tag, $inline_js, $foot_js);
868
  }
869
 
882
  if (!function_exists('str_get_html'))
883
  return $buffer;
884
 
 
 
 
 
 
885
  $ret_val = '';
886
  $script_tag = '';
887
  $inline_js = '';
899
  // parse
900
  $inner_js = '';
901
  $js_src = array();
902
+ $inner_js_src = array();
903
  $elements = (array) $dom->find("div#footer *");
904
  foreach ($elements as $element) {
905
  switch ($element->tag) {
914
  } else {
915
  $inner_js .= $this->_tag_trim($element->outertext);
916
  $js_src[] = preg_replace('/\.gz$/i', '', $src);
917
+ $inner_js_src[] = $src;
918
  }
919
  }
920
  }
940
  $script_tag .= $inner_js;
941
  $inline_js = '';
942
  } else {
943
+ if ($this->options['js_minify']) {
944
+ foreach ($inner_js_src as $path) {
945
+ $real_path = realpath(preg_replace('/^([^\?]*)([\?]?.*)$/', "$1", str_replace($this->wp_url, ABSPATH, $path)));
946
+ if ($real_path !== false && file_exists($real_path)) {
947
+ list($content, $cache_path) = $this->_file_read($real_path, 'js');
948
+ if (file_exists($cache_path)) {
949
+ $cache_url = str_replace(ABSPATH, $this->wp_url, $cache_path);
950
+ $inner_js = str_replace($path, $cache_url, $inner_js);
951
+ }
952
+ }
953
+ }
954
+ }
955
  $script_tag .= $inner_js;
956
  $inline_js = $this->_combined_inline_javascript($inline_js);
957
  }
983
 
984
  // $ret_val .= $this->_process_time();
985
 
986
+ $ret_val = apply_filters($this->plugin_name.'/footer_cleaner', $ret_val);
 
987
  return $ret_val;
988
  }
989
 
1117
  break;
1118
  }
1119
  }
1120
+ unset($element);
1121
+ unset($elements);
1122
 
1123
  foreach ((array) $tags as $tag_type => $contents) {
1124
  switch($tag_type) {
1151
  return $html;
1152
  }
1153
 
1154
+ private function _rdf_convert($elements, $limit = false, $exclusion = '') {
1155
+ $html = $this->_dom_to_html($elements, $limit, $exclusion);
1156
+
1157
+ if (!empty($html)) {
1158
+ $html = str_replace(
1159
+ array(
1160
+ 'rdf:rdf',
1161
+ 'rdf:description',
1162
+ 'rdf:parsetype',
1163
+ 'foaf:holdsaccount',
1164
+ 'foaf:onlineaccount',
1165
+ 'foaf:accountname',
1166
+ 'foaf:accountservicehomepage',
1167
+ ),
1168
+ array(
1169
+ 'rdf:RDF',
1170
+ 'rdf:Description',
1171
+ 'rdf:parseType',
1172
+ 'foaf:holdsAccount',
1173
+ 'foaf:OnlineAccount',
1174
+ 'foaf:accountName',
1175
+ 'foaf:accountServiceHomepage',
1176
+ ),
1177
+ $html);
1178
+ $html = preg_replace(
1179
+ array(
1180
+ '/[\t ]+</',
1181
+ '/>[\t ]+/',
1182
+ ),
1183
+ array(
1184
+ '<',
1185
+ '>',
1186
+ ),
1187
+ $html);
1188
+ }
1189
+
1190
+ return $html;
1191
+ }
1192
+
1193
  //**************************************************************************************
1194
  // Get absolute url
1195
  //**************************************************************************************
1196
  private function _abs_url($path, $base_path = ''){
1197
  if (preg_match('/^https?:\/\//i', $base_path))
1198
  $base_path = str_replace($this->wp_url, ABSPATH, $base_path);
1199
+ $real_path = realpath($base_path . '/' . $path);
1200
+ if ( $real_path === FALSE )
1201
+ $real_path = $base_path . '/' . $path;
1202
 
1203
+ $abs_url = str_replace(ABSPATH, $this->wp_url, $real_path);
1204
+ $abs_url = str_replace('/./', '/', $abs_url);
1205
+ $abs_url = preg_replace('/(\/[^\/]*\/)\.\.(\/[^\/]*\/)/', '$2', $abs_url);
 
 
 
 
1206
 
1207
+ return $abs_url;
1208
  }
1209
 
1210
  private function _css_url_edit($content, $filename) {
1229
  }
1230
 
1231
  //**************************************************************************************
1232
+ // cache filename
1233
  //**************************************************************************************
1234
+ private function _cache_filename($filename, $type) {
1235
+ $cache_filename = '';
1236
+ if (!preg_match('/^https?:\/\//i', $filename)) {
 
 
 
 
 
 
 
 
 
1237
  $filename = realpath($filename);
1238
+ $cache_filename = md5($filename . filemtime($filename));
1239
+ switch ($type) {
1240
+ case 'css':
1241
+ $cache_filename = $this->cache_path . 'css/' . $cache_filename . ($this->_base64_img_ok() ? '.b64' : '') . '.css';
1242
+ break;
1243
+ case 'js':
1244
+ $cache_filename = $this->cache_path . 'js/' . $cache_filename . '.js';
1245
+ break;
1246
  }
1247
  }
1248
+ return $cache_filename;
 
 
1249
  }
1250
 
1251
  //**************************************************************************************
1252
+ // Read file
1253
  //**************************************************************************************
1254
+ private function _file_read($filename, $type = false) {
1255
+ $content = false;
1256
+ $cache_filename = $this->_cache_filename($filename, $type);
1257
+
1258
+ if (!file_exists($cache_filename)) {
1259
+ $src = trim(preg_replace('/([^\?]*)(\?[^\?]*)$/i', '$1', str_replace($this->wp_url, ABSPATH, $style)));
1260
+ if (preg_match('/^https?:\/\//i', $src)) {
1261
+ $content = $this->_remote_get($src);
1262
+
1263
+ } else {
1264
+ $src = realpath($src);
1265
+ if ($filename !== FALSE && file_exists($src)) {
1266
+ $handle = @fopen($src, 'r');
1267
+ $content = trim(@fread($handle, filesize($src)));
1268
+ @fclose($handle);
1269
+ }
1270
+ }
1271
+
1272
  switch ($type) {
1273
  case 'css':
1274
  $content = $this->_css_url_edit($content, $filename);
1275
+ // URLs of images in CSS will be converted into the data scheme URIs
1276
+ if ($this->_base64_img_ok())
1277
+ $content = preg_replace_callback('/url\((https?:\/\/.*?\.(jpe?g|png|gif|bmp|ico)[^\)]*)\)/i', array(&$this, '_base64_replace'), $content);
1278
+ // Optimise CSS
1279
+ if ($this->options['css_optimise'])
1280
+ $content = $this->_css_optimise($content);
1281
+ $content = apply_filters($this->plugin_name.'/css_content', $content);
1282
  break;
1283
 
1284
  case 'js':
1285
+ // Minified JavaScript
1286
+ if ($this->options['js_minify'])
1287
+ $content = $this->_js_minify($content);
1288
+ $content = apply_filters($this->plugin_name.'/js_content', $content);
1289
+ break;
1290
+
1291
+ default:
1292
+ $content = apply_filters($this->plugin_name.'/content', $content);
1293
  break;
1294
  }
1295
+ $content = trim($content);
1296
+ $this->_file_write($cache_filename, $content, $this->options['gzip_on'] || HC_MAKE_GZ_FILE);
1297
+
1298
+ } else {
1299
+ $handle = @fopen($cache_filename, 'r');
1300
+ $content = trim(@fread($handle, filesize($cache_filename)));
1301
+ @fclose($handle);
1302
+ }
1303
+
1304
+ $this->org_len += strlen(bin2hex($content));
1305
+ return array($content, $cache_filename);
1306
+ }
1307
 
1308
+ //**************************************************************************************
1309
+ // Read files
1310
+ //**************************************************************************************
1311
+ private function _files_read($files, $type = 'js') {
1312
+ $text = '';
1313
+ foreach ((array) $files as $filename) {
1314
+ list($content, $cache_path) = $this->_file_read($filename, $type);
1315
+ $text .= trim($content) . "\n\n";
1316
  }
 
1317
  $text = $this->_tag_trim($text);
1318
 
1319
  return $text . (!empty($text) ? "\n" : '');
1424
  if (!empty($src)) {
1425
  if ($prototype)
1426
  $src = $this->plugin_url . 'includes/js/jquery-1.2.6.min.js';
1427
+ elseif (version_compare($ver, '1.4.4', '<='))
1428
+ $src = $this->plugin_url . 'includes/js/jquery-1.4.4.min.js';
1429
 
1430
  if ($prototype || $mootools || strpos($src, $this->wp_url) === FALSE) {
1431
  $wk_outer_js .= $this->_script_tag($src);
1468
  //**************************************************************************************
1469
  // Combined CSS
1470
  //**************************************************************************************
1471
+ private function _combined_css($styles, $css = '', $media = '') {
1472
  $html = '';
1473
+ $longfilename = '';
1474
+ $files = array();
1475
 
1476
  if (empty($media))
1477
+ $media = $this->options['default_media'];
1478
 
1479
  foreach ((array) $styles as $style) {
1480
  $src = trim(preg_replace('/(\.css|\.php)(\?[^\?]*)$/i', '$1', str_replace($this->wp_url, ABSPATH, $style)));
1483
  $longfilename .= $filename . filemtime($src);
1484
  $files[] = $filename;
1485
  } else {
1486
+ $html .= $this->_css_tag($styles, $media);
1487
  }
1488
  }
1489
 
1490
  $md5_filename = md5($longfilename . $css);
1491
+ $longfilename = 'css/' . $md5_filename . ($this->_base64_img_ok() ? '.b64' : '') . '.css';
1492
  $filename = $this->cache_path . $longfilename;
1493
  if (! file_exists($filename) ) {
1494
+ $css = $this->_files_read($files, 'css') . "\n\n" . $css;
1495
+ // Optimise CSS
1496
+ if ($this->options['css_optimise'])
1497
+ $css = $this->_css_optimise($css);
1498
  if (!empty($css))
1499
  $this->_file_write($filename, $css, $this->options['gzip_on'] || HC_MAKE_GZ_FILE );
1500
  }
 
1501
  $fileurl = $this->cache_url . $longfilename;
 
 
 
1502
 
1503
  if (file_exists($filename))
1504
  $html .= $this->_css_tag($fileurl, $media);
1518
 
1519
  $html = '';
1520
  $md5_filename = md5($css);
1521
+ $longfilename = 'css/'. $md5_filename . ($this->_base64_img_ok() ? '.b64' : '') . '.css';
1522
 
1523
  // Optimise CSS
1524
+ if ($this->options['css_optimise'])
1525
+ $css = $this->_css_optimise($css);
1526
 
1527
  $filename = $this->cache_path . $longfilename;
1528
  if (!file_exists($filename) && !empty($css))
1529
  $this->_file_write($filename, $css, $this->options['gzip_on'] || HC_MAKE_GZ_FILE);
1530
 
1531
  $fileurl = $this->cache_url . $longfilename;
 
 
 
1532
 
1533
  if (file_exists($filename))
1534
  $html .= $this->_css_tag($fileurl, $media);
1541
  //**************************************************************************************
1542
  private function _combined_javascript($javascripts, $script = '') {
1543
  $html = '';
1544
+ $longfilename = '';
1545
+ $files = array();
1546
 
1547
  foreach ((array) $javascripts as $javascript) {
1548
  $src = trim(preg_replace('/(\.js|\.php)(\?[^\?]*)$/i', '$1', str_replace($this->wp_url, ABSPATH, $javascript)));
1559
  $longfilename = 'js/' . $md5_filename . '.js';
1560
  $filename = $this->cache_path . $longfilename;
1561
  if (! file_exists($filename) ) {
1562
+ $script = $this->_files_read($files, 'js') . "\n\n" . $script;
1563
+ if ($this->options['js_minify'])
1564
+ $script = $this->_js_minify($script); // Minified JavaScript
1565
  if (!empty($script))
1566
  $this->_file_write($filename, $script, $this->options['gzip_on'] || HC_MAKE_GZ_FILE);
1567
  }
1586
  $longfilename = 'js/' . $md5_filename . '.js';
1587
 
1588
  // Minified JavaScript
1589
+ if ($this->options['js_minify'])
1590
+ $script = $this->_js_minify($script);
1591
 
1592
  $filename = $this->cache_path . $longfilename;
1593
  if (!file_exists($filename) && !empty($script) )
1624
  array('', '', '', '', '') ,
1625
  $text)
1626
  );
 
 
 
 
 
 
1627
  break;
1628
  }
1629
 
1634
  // Get Newer version
1635
  //**************************************************************************************
1636
  private function _newer_version_src($js_libs, $limit_ver = '') {
1637
+ $src = '';
1638
+ $ver = '0.0';
1639
  foreach ((array) $js_libs as $key => $val) {
1640
  if ( version_compare( $key, $ver, '>') ) {
1641
+ $src = $val;
1642
+ $ver = $key;
1643
  }
1644
  }
1645
 
1659
  }
1660
  }
1661
  $js = trim($js);
1662
+ $js = apply_filters($this->plugin_name.'/js_minify', $js . (!empty($js) ? "\n" : ''));
1663
 
1664
+ return $js;
1665
  }
1666
 
1667
  //**************************************************************************************
1669
  //**************************************************************************************
1670
  private function _css_import($css) {
1671
  if (preg_match_all('/@import[ \t]*url[ \t]*\([\'"]?([^\)\'"]*)[\'"]?\);?/i', $css, $matches, PREG_SET_ORDER)) {
1672
+ $search = array();
1673
+ $replace = array();
1674
  foreach ((array) $matches as $match) {
1675
  $filename = str_replace($this->wp_url, ABSPATH, trim($match[1]));
1676
+ list($content, $cache_path) = $this->_file_read(file_exists($filename) ? $filename : $match[1]);
1677
+ $content = $this->_css_url_edit($content, $filename);
1678
  if ($this->options['css_optimise'])
1679
  $content = $this->_css_optimise($content, false);
1680
  if (preg_match('/@import[ \t]*url[ \t]*\([\'"]?[^\)\'"]*[\'"]?\);?/i', $content))
1683
  $replace[] = $content;
1684
  }
1685
  $css = str_replace($search, $replace, $css);
1686
+ unset($match);
1687
+ unset($search);
1688
+ unset($replace);
1689
  }
1690
  unset($matches);
1691
 
1695
  private function _css_optimise($buffer, $merge = true) {
1696
  $css = $this->_tag_trim($buffer);
1697
 
1698
+ if ($this->options['css_optimise'] && class_exists('Minify_CSS'))
1699
+ $css = Minify_CSS::minify($css);
 
 
 
 
 
 
 
 
 
 
 
 
 
1700
  if ( $merge )
1701
  $css = str_replace("\n\n", "\n", $this->_css_import($css));
1702
  $css = trim($css);
1703
+ $css = apply_filters($this->plugin_name.'/css_optimise', $css . (!empty($css) ? "\n" : ''));
1704
 
1705
+ return $css;
1706
+ }
1707
+
1708
+ //**************************************************************************************
1709
+ // remote get
1710
+ //**************************************************************************************
1711
+ private function _remote_get( $url, $args = array() ){
1712
+ if ( function_exists('wp_remote_get') ) {
1713
+ $ret = wp_remote_get( $url, $args );
1714
+ if ( is_array($ret) && isset($ret["body"]) && !empty($ret["body"]) )
1715
+ return $ret["body"];
1716
+ } else {
1717
+ return @file_get_contents($filename);
1718
+ }
1719
+
1720
+ return false;
1721
+ }
1722
+
1723
+ //**************************************************************************************
1724
+ // BASE64 IMAGE
1725
+ //**************************************************************************************
1726
+ private function _base64_replace($matches) {
1727
+ $img_enc = $this->_base64_img($matches[1]);
1728
+
1729
+ return (
1730
+ $img_enc != $matches[1]
1731
+ ? str_replace($matches[1], $img_enc, $matches[0])
1732
+ : $matches[0]
1733
+ );
1734
+ }
1735
+ private function _get_image_mime($file_name) {
1736
+ $img_mime = false;
1737
+
1738
+ if (preg_match('/https?:\/\/.*?\.(jpe?g|png|gif|bmp|ico)/i', $file_name, $matches)) {
1739
+ $img_type = strtolower(trim($matches[1]));
1740
+ if ($img_type == 'jpg')
1741
+ $img_type = 'jpeg';
1742
+ elseif ($img_type == 'ico')
1743
+ $img_type = 'x-icon';
1744
+ $img_mime = 'image/'.$img_type;
1745
+ } elseif (false !== ($img_type = exif_imagetype($file_name))) {
1746
+ $img_mime = image_type_to_mime_type($img_type);
1747
+ }
1748
+ unset($matches);
1749
+
1750
+ return $img_mime;
1751
+ }
1752
+ private function _base64_img($img_url) {
1753
+ if (!$this->_base64_img_ok())
1754
+ return $img_url;
1755
+
1756
+ if (isset($img_urls[$img_url])) {
1757
+ $img_enc = $img_urls[$img_url];
1758
+ } else {
1759
+ $img_bin = $this->_remote_get($img_url);
1760
+ $img_enc = base64_encode($img_bin);
1761
+ if (false !== ($img_mime = $this->_get_image_mime($img_url))) {
1762
+ $img_enc = (
1763
+ $img_mime != ''
1764
+ ? "data:{$img_mime};base64,{$img_enc}"
1765
+ : $img_url
1766
+ );
1767
+ $img_enc = (
1768
+ $img_enc != $img_url && strlen($img_enc) <= HeadCleaner::IMG_BASE64_MAX_SIZE
1769
+ ? $img_enc
1770
+ : $img_url
1771
+ );
1772
+ } else {
1773
+ $img_enc = $img_url;
1774
+ }
1775
+ $img_urls[$img_url] = $img_enc;
1776
+ }
1777
+
1778
+ return $img_enc;
1779
+ }
1780
+
1781
+ private function _base64_img_ok() {
1782
+ global $is_lynx, $is_gecko, $is_IE, $is_opera, $is_NS4, $is_safari, $is_chrome, $is_iphone;
1783
+
1784
+ if ($this->options['img_base64'])
1785
+ return ($is_gecko || $is_opera || $is_safari || $is_chrome);
1786
+ else
1787
+ return false;
1788
  }
1789
 
1790
  //**************************************************************************************
1863
  if (!file_exists($filename)) {
1864
  return $this->_file_write($filename, $text, false);
1865
  } else {
1866
+ list($content, $cache_path) = $this->_file_read($filename);
1867
  if ($content !== FALSE) {
1868
  if (strpos($content, '# BEGIN Head Cleaner') === FALSE && strpos($content, 'RewriteRule .+ %{REQUEST_URI}.gz') === FALSE) {
1869
  $text = $content . "\n" . $text;
1877
  }
1878
  } else {
1879
  if ( file_exists($filename) ) {
1880
+ list($content, $cache_path) = $this->_file_read($filename);
1881
  if ($content !== FALSE) {
1882
  $content = trim(preg_replace('/# BEGIN Head Cleaner.*# END Head Cleaner/ism', '', $content));
1883
  if ( $text === $content || $content === '') {
1900
  //**************************************************************************************
1901
  public function admin_menu() {
1902
  $this->addOptionPage(__('Head Cleaner'), array($this, 'option_page'));
1903
+ add_action('admin_print_scripts-'.$this->admin_hook['option'], array($this,'add_admin_scripts'));
1904
+ add_action('admin_head-'.$this->admin_hook['option'], array($this,'add_admin_head'));
1905
  }
1906
 
1907
  public function plugin_setting_links($links, $file) {
1920
  //**************************************************************************************
1921
  // Show Option Page
1922
  //**************************************************************************************
1923
+ public function add_admin_scripts() {
1924
+ $this->addjQuery(); // regist jQuery
1925
+ }
1926
+
1927
+ public function add_admin_head() {
1928
+ $out = <<< E__O__T
1929
+ <style type="text/css">/*<![CDATA[ */
1930
+ .optiontable td {line-height:25px;}
1931
+ td.more-options {display:none;}
1932
+ /* ]]>*/</style>
1933
+
1934
+ <script type="text/javascript">//<![CDATA[
1935
+ jQuery(function(){
1936
+ if (jQuery('#cache_enabled').attr('checked'))
1937
+ jQuery('td.more-options').show();
1938
+ else
1939
+ jQuery('td.more-options').hide();
1940
+
1941
+ jQuery('#cache_enabled').click(function(){
1942
+ if (jQuery('#cache_enabled').attr('checked'))
1943
+ jQuery('td.more-options').show();
1944
+ else
1945
+ jQuery('td.more-options').hide();
1946
+ });
1947
+ });
1948
+ //]]></script>
1949
+ E__O__T;
1950
+ echo $out;
1951
+ }
1952
+
1953
  private function _checkbox($id, $flag = '') {
1954
  if ( $flag === '' )
1955
  $flag = $this->options[$id];
1994
  $out = '';
1995
 
1996
  // Add Options
1997
+ $out .= '<div class="wrap">'."\n";
1998
+ $out .= '<form method="post" id="update_options" action="'.$this->admin_action.'">'."\n";
1999
+ $out .= '<h2>'.__('Head Cleaner Options', $this->textdomain_name).'</h2>'."\n";
2000
  if ($this->wp25)
2001
  $out .= $this->makeNonceField("update_options", "_wpnonce_update_options", true, false);
2002
 
2003
+ $out .= '<table class="optiontable form-table" style="margin-top:0;"><tbody>'."\n";
2004
 
2005
+ $out .= '<tr>';
2006
+ $out .= '<td>';
2007
  $out .= $this->_checkbox('cache_enabled');
2008
  $out .= __('CSS and JavaScript are cached on the server.', $this->textdomain_name);
2009
+ $out .= '</td>';
2010
+ $out .= '<td class="more-options">';
2011
+ $out .= $this->_checkbox('dynamic');
2012
+ $out .= __('CSS and JS are dynamically generated.', $this->textdomain_name);
2013
+ $out .= '</td>';
2014
+ $out .= '<td class="more-options">';
2015
+ $out .= __('Default media attribute applied to CSS.', $this->textdomain_name);
2016
+ $out .= "<input type=\"text\" name=\"default_media\" id=\"default_media\" value=\"{$this->options['default_media']}\" style=\"margin-left:0.5em;\" />";
2017
+ $out .= '</td>';
2018
+ $out .= '</tr>'."\n";
2019
+
2020
+ $out .= '<tr>';
2021
+ $out .= '<td class="more-options">';
2022
+ $out .= $this->_checkbox('combined_css');
2023
+ $out .= __('Two or more CSS is combined.', $this->textdomain_name);
2024
+ $out .= '</td>';
2025
+ $out .= '<td class="more-options">';
2026
+ $out .= $this->_checkbox('css_optimise');
2027
+ $out .= __('CSS is optimized.', $this->textdomain_name);
2028
+ $out .= '</td>';
2029
+ $out .= '<td class="more-options">';
2030
+ $out .= $this->_checkbox('img_base64');
2031
+ $out .= __('URLs of images in CSS will be converted into the data scheme URIs.', $this->textdomain_name);
2032
+ $out .= '</td>';
2033
+ $out .= '</tr>'."\n";
2034
+
2035
+ $out .= '<tr>';
2036
+ $out .= '<td class="more-options">';
2037
+ $out .= $this->_checkbox('combined_js');
2038
+ $out .= __('Two or more JavaScript is combined.', $this->textdomain_name);
2039
+ $out .= '</td>';
2040
+ $out .= '<td class="more-options">';
2041
+ $out .= $this->_checkbox('js_minify');
2042
+ $out .= __('JavaScript is minified.', $this->textdomain_name);
2043
+ $out .= '</td>';
2044
+ $out .= '<td class="more-options">';
2045
+ $out .= $this->_checkbox('foot_js');
2046
+ $out .= __('Bottom JavaScript is combined, too.', $this->textdomain_name);
2047
+ $out .= '</td>';
2048
+ $out .= '</tr>'."\n";
2049
+
2050
+ $out .= '<tr>';
2051
+ $out .= '<td>';
2052
  $out .= $this->_checkbox('js_move_foot');
2053
  $out .= __('Put JavaScripts at the Bottom.', $this->textdomain_name);
2054
+ $out .= '</td>';
2055
+ $out .= '<td>';
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2056
  $out .= $this->_checkbox('use_ajax_libs');
2057
  $out .= __('Use Google Ajax Libraries.', $this->textdomain_name);
2058
+ $out .= '</td>';
2059
+ $out .= '<td>';
2060
+ $out .= '</td>';
2061
+ $out .= '</tr>'."\n";
 
 
 
 
2062
 
2063
+ $out .= '<tr>';
2064
+ $out .= '<td>';
2065
  $out .= $this->_checkbox('xml_declaration');
2066
  $out .= __('Add XML Declaration.', $this->textdomain_name);
2067
+ $out .= '</td>';
2068
+ $out .= '<td>';
2069
  $out .= $this->_checkbox('canonical_tag');
2070
  $out .= __('Add canonical tag.', $this->textdomain_name);
2071
+ $out .= '</td>';
2072
+ $out .= '<td>';
2073
+ $out .= $this->_checkbox('ie_conditional');
2074
+ $out .= __('Remove IE Conditional Tag.', $this->textdomain_name);
2075
+ $out .= '</td>';
2076
+ $out .= '</tr>'."\n";
2077
 
2078
+ $out .= '<tr>';
2079
+ $out .= '<td>';
2080
  $out .= $this->_checkbox('rm_generator', isset($this->options['priority']['wp_head']['wp_generator']) && $this->options['priority']['wp_head']['wp_generator'] <= 0);
2081
  $out .= __('Remove generator tag.', $this->textdomain_name);
2082
+ $out .= '</td>';
2083
+ $out .= '<td>';
2084
  $out .= $this->_checkbox('rm_rsd_link', isset($this->options['priority']['wp_head']['rsd_link']) && $this->options['priority']['wp_head']['rsd_link'] <= 0);
2085
  $out .= __('Remove RSD link tag.', $this->textdomain_name);
2086
+ $out .= '</td>';
2087
+ $out .= '<td>';
2088
  $out .= $this->_checkbox('rm_manifest', isset($this->options['priority']['wp_head']['wlwmanifest_link']) && $this->options['priority']['wp_head']['wlwmanifest_link'] <= 0);
2089
  $out .= __('Remove wlwmanifest link tag.', $this->textdomain_name);
2090
+ $out .= '</td>';
2091
+ $out .= '</tr>'."\n";
2092
 
2093
+ $out .= '<tr>';
2094
+ $out .= '<td>';
2095
  $out .= $this->_checkbox('debug_mode');
2096
  $out .= __('Debug mode', $this->textdomain_name);
2097
+ $out .= '</td>';
2098
+ $out .= '<td>';
2099
+ $out .= '</td>';
2100
+ $out .= '<td>';
2101
+ // $out .= $this->_checkbox('gzip_on');
2102
+ // $out .= __('gzip compress to CSS and JS.', $this->textdomain_name);
2103
+ $out .= '</td>';
2104
+ $out .= '</tr>'."\n";
2105
+
2106
+ $out .= '</tbody></table>';
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2107
 
2108
  // Active Filters
2109
  $out .= "<div style=\"margin-top:2em;\" id=\"active_filters\">\n";
2110
+ $out .= '<h3>' . __('Active Filters', $this->textdomain_name) . '</h3>'."\n" ;
2111
+ $out .= '<table><tbody>'."\n";
2112
+ $out .= '<tr>';
2113
+ $out .= '<th style="padding:0 .5em;">' . __("Don't process!", $this->textdomain_name) . '</th>'."\n";
2114
+ $out .= '<th style="padding:0 .5em;">' . __('Remove', $this->textdomain_name) . '</th>'."\n";
2115
+ $out .= '<th>' . __('Head filters', $this->textdomain_name) . '</th>'."\n";
2116
  if ($this->options['debug_mode'])
2117
+ $out .= '<th>' . __('Priority', $this->textdomain_name) . '</th>'."\n";
2118
+ $out .= '</tr>'."\n";
2119
  $head_filters = array();
2120
  foreach ((array) $this->options['filters']['wp_head'] as $function_name => $priority) {
2121
+ if ($priority < HeadCleaner::PRIORITY) {
2122
  if (isset($this->options['priority']['wp_head'][$function_name]))
2123
  $priority = (int) $this->options['priority']['wp_head'][$function_name];
2124
  if (!isset($head_filters[$priority]))
2131
  foreach ($head_filters as $priority => $filters) {
2132
  foreach ($filters as $function_name){
2133
  if ( ! preg_match('/^(' . implode('|', $this->default_head_filters) . ')$/i', $function_name)) {
2134
+ $out .= '<tr>';
2135
+ $out .= '<th><input type="checkbox" name="'.$head_filters[$i].'" value="'.$function_name.'"'.($priority > HeadCleaner::PRIORITY ? ' checked="true"' : '').' /></th>';
2136
+ $out .= '<th><input type="checkbox" name="'.$head_remove[$i] .'" value="'.$function_name.'"'.($priority <= 0 ? ' checked="true"' : '').' /></th>';
2137
+ $out .= '<td>'.$function_name.'</td>';
2138
  if ($this->options['debug_mode'])
2139
+ $out .= '<td>( '.$priority.' )</td>';
2140
+ $out .= '</tr>'."\n";
2141
  $i++;
2142
  }
2143
  }
2144
  }
2145
+ unset($filters);
2146
+ unset($head_filters);
2147
 
2148
  if ($this->options['foot_js'] === true) {
2149
+ $out .= '<tr><td colspan="3">&nbsp;</td></tr>'."\n";
2150
+ $out .= '<tr>';
2151
+ $out .= '<th style="padding:0 .5em;">' . __("Don't process!", $this->textdomain_name) . '</th>'."\n";
2152
+ $out .= '<th style="padding:0 .5em;">' . __('Remove', $this->textdomain_name) . '</th>'."\n";
2153
+ $out .= '<th>' . __('Bottom filters', $this->textdomain_name) . '</th>'."\n";
2154
  if ($this->options['debug_mode'])
2155
+ $out .= '<th>' . __('Priority', $this->textdomain_name) . '</th>'."\n";
2156
+ $out .= '</tr>'."\n";
2157
  $footer_filters = array();
2158
  foreach ((array) $this->options['filters']['wp_footer'] as $function_name => $priority) {
2159
+ if ($priority < HeadCleaner::PRIORITY) {
2160
  if (isset($this->options['priority']['wp_footer'][$function_name]))
2161
  $priority = (int) $this->options['priority']['wp_footer'][$function_name];
2162
  if (!isset($footer_filters[$priority]))
2169
  foreach ($footer_filters as $priority => $filters) {
2170
  foreach ($filters as $function_name){
2171
  if ( ! preg_match('/^(' . implode('|', $this->default_head_filters) . ')$/i', $function_name)) {
2172
+ $out .= '<tr>';
2173
+ $out .= '<th><input type="checkbox" name="'.$foot_filters[$i].'" value="'.$function_name.'"'.($priority > HeadCleaner::PRIORITY ? ' checked="true"' : '').' /></th>';
2174
+ $out .= '<th><input type="checkbox" name="'.$foot_remove[$i] .'" value="'.$function_name.'"'.($priority <= 0 ? ' checked="true"' : '').' /></th>';
2175
+ $out .= '<td>'.$function_name.'</td>';
2176
  if ($this->options['debug_mode'])
2177
+ $out .= '<td>( '.$priority.' )</td>';
2178
+ $out .= '</tr>'."\n";
2179
  $i++;
2180
  }
2181
  }
2182
  }
2183
+ unset($filters);
2184
+ unset($footer_filters);
2185
  }
2186
+ $out .= '</tbody></table>';
2187
+ $out .= '</div>'."\n";
2188
 
2189
  // Active JavaScripts
2190
+ $out .= '<div style="margin-top:2em;" id="active_javascripts">'."\n";
2191
+ $out .= '<h3>' . __('Active JavaScripts', $this->textdomain_name) . '</h3>'."\n" ;
2192
+ $out .= '<table><tbody>'."\n";
2193
+ $out .= '<tr>';
2194
+ $out .= '<th style="padding:0 .5em;">' . __('Move to footer', $this->textdomain_name) . '</th>'."\n";
2195
+ $out .= '<th style="padding:0 .5em;">' . __('Remove', $this->textdomain_name) . '</th>'."\n";
2196
+ $out .= '<th>' . __('JavaScripts', $this->textdomain_name) . '</th>'."\n";
2197
  foreach ($this->options['head_js'] as $javascript => $value) {
2198
  $remove = (array_search( $javascript, (array)$this->options["remove_js"] ) !== FALSE);
2199
+ $out .= '<tr>';
2200
+ $out .= '<th><input type="checkbox" name="'.$head_js[$i] .'" value="'.$javascript.'"'.($value === FALSE ? ' checked="true"' : '').' /></th>';
2201
+ $out .= '<th><input type="checkbox" name="'.$remove_js[$i].'" value="'.$javascript.'"'.($remove !== FALSE ? ' checked="true"' : '').' /></th>';
2202
+ $out .= '<td>'.$javascript.'</td>';
2203
  $i++;
2204
  }
2205
+ $out .= '</tbody></table>';
2206
+ $out .= '</div>'."\n";
2207
 
2208
  // Add Update Button
2209
+ $out .= '<p style="margin-top:1em">';
2210
+ $out .= '<input type="submit" name="options_update" class="button-primary" value="'.__('Update Options', $this->textdomain_name).' &raquo;" class="button" />';
2211
+ $out .= '</p>';
2212
+ $out .= '</form></div>'."\n";
2213
 
2214
  // Cache Delete
2215
+ $out .= '<div class="wrap" style="margin-top:2em;">'."\n";
2216
+ $out .= '<h2>' . __('Remove all cache files', $this->textdomain_name) . '</h2>'."\n";
2217
+ $out .= '<form method="post" id="remove_cache" action="'.$this->admin_action.'">'."\n";
2218
+ if ($this->wp25)
2219
+ $out .= $this->makeNonceField("remove_cache", "_wpnonce_remove_cache", true, false);
2220
+ $out .= '<p>' . __('All cache files are removed.', $this->textdomain_name) . '</p>';
2221
+ $out .= '<input type="submit" name="remove_cache" class="button-primary" value="'.__('Remove All Cache Files', $this->textdomain_name).' &raquo;" class="button" />';
2222
+ $out .= '</form></div>'."\n";
2223
 
2224
  // Options Delete
2225
+ $out .= '<div class="wrap" style="margin-top:2em;">'."\n";
2226
+ $out .= '<h2>' . __('Uninstall', $this->textdomain_name) . '</h2>'."\n";
2227
+ $out .= '<form method="post" id="delete_options" action="'.$this->admin_action.'">'."\n";
2228
+ if ($this->wp25)
2229
+ $out .= $this->makeNonceField("delete_options", "_wpnonce_delete_options", true, false);
2230
+ $out .= '<p>' . __('All the settings of &quot;Head Cleaner&quot; are deleted.', $this->textdomain_name) . '</p>';
2231
+ $out .= '<input type="submit" name="options_delete" class="button-primary" value="'.__('Delete Options', $this->textdomain_name).' &raquo;" class="button" />';
2232
+ $out .= '</form></div>'."\n";
2233
 
2234
  // Output
2235
+ echo ( !empty($this->note)
2236
+ ? '<div id="message" class="updated fade"><p>'.$this->note.'</p></div>'
2237
+ : '' );
2238
+ echo "\n";
2239
+
2240
+ echo ( $this->error == 0 ? $out : '' );
2241
+ echo "\n";
2242
 
2243
  }
2244
 
2265
  $this->options['js_move_foot'] = $this->_checkbox_val($recv_param, 'js_move_foot');
2266
  $this->options['cache_enabled'] = $this->_checkbox_val($recv_param, 'cache_enabled');
2267
  $this->options['combined_css'] = $this->_checkbox_val($recv_param, 'combined_css');
 
 
2268
  $this->options['css_optimise'] = $this->_checkbox_val($recv_param, 'css_optimise');
2269
  $this->options['default_media'] = trim($recv_param['default_media']);
2270
+ $this->options['img_base64'] = $this->_checkbox_val($recv_param, 'img_base64');
2271
+ $this->options['combined_js'] = $this->_checkbox_val($recv_param, 'combined_js');
2272
+ $this->options['js_minify'] = $this->_checkbox_val($recv_param, 'js_minify');
2273
  $this->options['gzip_on'] = $this->_checkbox_val($recv_param, 'gzip_on');
2274
  $this->options['use_ajax_libs'] = $this->_checkbox_val($recv_param, 'use_ajax_libs');
2275
  $this->options['debug_mode'] = $this->_checkbox_val($recv_param, 'debug_mode');
 
 
 
 
 
 
 
2276
 
2277
  $rm_generator = $this->_checkbox_val($recv_param, 'rm_generator');
2278
  $rm_rsd_link = $this->_checkbox_val($recv_param, 'rm_rsd_link');
2294
  $tag = 'wp_head';
2295
  foreach ((array) $this->options['filters'][$tag] as $function_name => $priority) {
2296
  if (count($head_filters) > 0 && array_search($function_name, $head_filters) !== FALSE)
2297
+ $this->options['priority'][$tag][$function_name] = HeadCleaner::PRIORITY + 1;
2298
  elseif (count($head_remove) > 0 && array_search($function_name, $head_remove) !== FALSE)
2299
  $this->options['priority'][$tag][$function_name] = -1;
2300
  elseif (isset($this->options['priority'][$tag][$function_name]))
2309
  $tag = 'wp_footer';
2310
  foreach ((array) $this->options['filters'][$tag] as $function_name => $priority) {
2311
  if (count($foot_filters) > 0 && array_search($function_name, $foot_filters) !== FALSE)
2312
+ $this->options['priority'][$tag][$function_name] = HeadCleaner::PRIORITY + 1;
2313
  elseif (count($foot_remove) > 0 && array_search($function_name, $foot_remove) !== FALSE)
2314
  $this->options['priority'][$tag][$function_name] = -1;
2315
  elseif (isset($this->options['priority'][$tag][$function_name]))
2343
  // Get function name
2344
  //**************************************************************************************
2345
  private function _get_function_name($function) {
 
2346
  return (is_object($function[0])
2347
  ? (get_class($function[0]) !== FALSE ? get_class($function[0]) : $function[0]) . '::' . $function[1]
2348
  : $function );
2366
  foreach ($active_filters as $priority => $filters) {
2367
  foreach ($filters as $filter) {
2368
  $function_name = $this->_get_function_name($filter['function']);
2369
+ if (!isset($this->filters[$tag]))
2370
+ $this->filters[$tag] = array();
2371
  $this->filters[$tag][$function_name] = $priority;
2372
  }
2373
  }
2421
  ? $this->options['priority'][$tag]
2422
  : array() );
2423
  foreach ($this->no_conflict as $function_name) {
2424
+ $custom_priority[$function_name] = HeadCleaner::PRIORITY + 1;
2425
  }
2426
  foreach ($active_filters as $priority => $filters) {
2427
  foreach ($filters as $filter) {
includes/common-controller.php CHANGED
@@ -27,11 +27,10 @@ class wokController {
27
  var $admin_option, $admin_action, $admin_hook;
28
  var $note, $error;
29
  var $charset;
30
- var $wp25, $wp26, $wp27, $wp28, $wp29, $wp30;
31
- var $inline_js;
32
 
33
- var $jquery_js = 'includes/js/jquery-1.4.2.min.js';
34
- var $jquery_ver = '1.4.2';
35
 
36
  var $jquery_noconflict_js = 'includes/js/jquery.noconflict.js';
37
 
@@ -48,6 +47,7 @@ class wokController {
48
  $this->wp28 = version_compare($wp_version, "2.8", ">=");
49
  $this->wp29 = version_compare($wp_version, "2.9", ">=");
50
  $this->wp30 = version_compare($wp_version, "3.0", ">=");
 
51
 
52
  $this->setPluginDir($file);
53
  $this->loadTextdomain();
@@ -70,12 +70,6 @@ class wokController {
70
 
71
  if (!isset($wok_script_manager) && class_exists('wokScriptManager'))
72
  $wok_script_manager = new wokScriptManager();
73
-
74
- $this->inline_js = array(
75
- 'admin_head' => '',
76
- 'head' => '',
77
- 'footer' => '',
78
- );
79
  }
80
 
81
  function setPluginDir($file) {
@@ -227,15 +221,11 @@ class wokController {
227
  }
228
 
229
  // Output Javascript
230
- function scriptConcat($js, $place) {
231
- return $js . $this->inline_js[$place];
232
- }
233
  function writeScript($out = '', $place = 'head') {
234
  global $wok_script_manager;
235
  if ($out == '' || !isset($wok_script_manager))
236
  return;
237
- $this->inline_js[$place] .= $out;
238
- add_filter($place.'_script/manageScripts', array(&$this, "scriptConcat"), 10, 2);
239
  }
240
 
241
  // Regist jQuery
@@ -367,16 +357,15 @@ class wokScriptManager {
367
  }
368
 
369
  function adminHeadPrintScript() {
370
- $this->printScript(apply_filters('admin_head_script/manageScripts', '', 'admin_head'));
371
  }
372
 
373
  function headPrintScript() {
374
- $this->printScript(apply_filters('head_script/manageScripts', '', 'head'));
375
  }
376
 
377
  function footerPrintScript() {
378
- $this->printScript(apply_filters('footer_script/manageScripts', '', 'footer'));
379
  }
380
  }
381
  endif;
382
- ?>
27
  var $admin_option, $admin_action, $admin_hook;
28
  var $note, $error;
29
  var $charset;
30
+ var $wp25, $wp26, $wp27, $wp28, $wp29, $wp30, $wp31;
 
31
 
32
+ var $jquery_js = 'includes/js/jquery-1.4.4.min.js';
33
+ var $jquery_ver = '1.4.4';
34
 
35
  var $jquery_noconflict_js = 'includes/js/jquery.noconflict.js';
36
 
47
  $this->wp28 = version_compare($wp_version, "2.8", ">=");
48
  $this->wp29 = version_compare($wp_version, "2.9", ">=");
49
  $this->wp30 = version_compare($wp_version, "3.0", ">=");
50
+ $this->wp31 = version_compare($wp_version, "3.1", ">=");
51
 
52
  $this->setPluginDir($file);
53
  $this->loadTextdomain();
70
 
71
  if (!isset($wok_script_manager) && class_exists('wokScriptManager'))
72
  $wok_script_manager = new wokScriptManager();
 
 
 
 
 
 
73
  }
74
 
75
  function setPluginDir($file) {
221
  }
222
 
223
  // Output Javascript
 
 
 
224
  function writeScript($out = '', $place = 'head') {
225
  global $wok_script_manager;
226
  if ($out == '' || !isset($wok_script_manager))
227
  return;
228
+ add_filter($place.'_script/manageScripts', create_function('$js', 'return $js . "'.addcslashes($out,'"').'";'));
 
229
  }
230
 
231
  // Regist jQuery
357
  }
358
 
359
  function adminHeadPrintScript() {
360
+ $this->printScript(apply_filters('admin_head_script/manageScripts', ''));
361
  }
362
 
363
  function headPrintScript() {
364
+ $this->printScript(apply_filters('head_script/manageScripts', ''));
365
  }
366
 
367
  function footerPrintScript() {
368
+ $this->printScript(apply_filters('footer_script/manageScripts', ''));
369
  }
370
  }
371
  endif;
 
includes/csstidy-1.3/COPYING DELETED
@@ -1,340 +0,0 @@
1
- GNU GENERAL PUBLIC LICENSE
2
- Version 2, June 1991
3
-
4
- Copyright (C) 1989, 1991 Free Software Foundation, Inc.
5
- 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
6
- Everyone is permitted to copy and distribute verbatim copies
7
- of this license document, but changing it is not allowed.
8
-
9
- Preamble
10
-
11
- The licenses for most software are designed to take away your
12
- freedom to share and change it. By contrast, the GNU General Public
13
- License is intended to guarantee your freedom to share and change free
14
- software--to make sure the software is free for all its users. This
15
- General Public License applies to most of the Free Software
16
- Foundation's software and to any other program whose authors commit to
17
- using it. (Some other Free Software Foundation software is covered by
18
- the GNU Library General Public License instead.) You can apply it to
19
- your programs, too.
20
-
21
- When we speak of free software, we are referring to freedom, not
22
- price. Our General Public Licenses are designed to make sure that you
23
- have the freedom to distribute copies of free software (and charge for
24
- this service if you wish), that you receive source code or can get it
25
- if you want it, that you can change the software or use pieces of it
26
- in new free programs; and that you know you can do these things.
27
-
28
- To protect your rights, we need to make restrictions that forbid
29
- anyone to deny you these rights or to ask you to surrender the rights.
30
- These restrictions translate to certain responsibilities for you if you
31
- distribute copies of the software, or if you modify it.
32
-
33
- For example, if you distribute copies of such a program, whether
34
- gratis or for a fee, you must give the recipients all the rights that
35
- you have. You must make sure that they, too, receive or can get the
36
- source code. And you must show them these terms so they know their
37
- rights.
38
-
39
- We protect your rights with two steps: (1) copyright the software, and
40
- (2) offer you this license which gives you legal permission to copy,
41
- distribute and/or modify the software.
42
-
43
- Also, for each author's protection and ours, we want to make certain
44
- that everyone understands that there is no warranty for this free
45
- software. If the software is modified by someone else and passed on, we
46
- want its recipients to know that what they have is not the original, so
47
- that any problems introduced by others will not reflect on the original
48
- authors' reputations.
49
-
50
- Finally, any free program is threatened constantly by software
51
- patents. We wish to avoid the danger that redistributors of a free
52
- program will individually obtain patent licenses, in effect making the
53
- program proprietary. To prevent this, we have made it clear that any
54
- patent must be licensed for everyone's free use or not licensed at all.
55
-
56
- The precise terms and conditions for copying, distribution and
57
- modification follow.
58
-
59
- GNU GENERAL PUBLIC LICENSE
60
- TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
61
-
62
- 0. This License applies to any program or other work which contains
63
- a notice placed by the copyright holder saying it may be distributed
64
- under the terms of this General Public License. The "Program", below,
65
- refers to any such program or work, and a "work based on the Program"
66
- means either the Program or any derivative work under copyright law:
67
- that is to say, a work containing the Program or a portion of it,
68
- either verbatim or with modifications and/or translated into another
69
- language. (Hereinafter, translation is included without limitation in
70
- the term "modification".) Each licensee is addressed as "you".
71
-
72
- Activities other than copying, distribution and modification are not
73
- covered by this License; they are outside its scope. The act of
74
- running the Program is not restricted, and the output from the Program
75
- is covered only if its contents constitute a work based on the
76
- Program (independent of having been made by running the Program).
77
- Whether that is true depends on what the Program does.
78
-
79
- 1. You may copy and distribute verbatim copies of the Program's
80
- source code as you receive it, in any medium, provided that you
81
- conspicuously and appropriately publish on each copy an appropriate
82
- copyright notice and disclaimer of warranty; keep intact all the
83
- notices that refer to this License and to the absence of any warranty;
84
- and give any other recipients of the Program a copy of this License
85
- along with the Program.
86
-
87
- You may charge a fee for the physical act of transferring a copy, and
88
- you may at your option offer warranty protection in exchange for a fee.
89
-
90
- 2. You may modify your copy or copies of the Program or any portion
91
- of it, thus forming a work based on the Program, and copy and
92
- distribute such modifications or work under the terms of Section 1
93
- above, provided that you also meet all of these conditions:
94
-
95
- a) You must cause the modified files to carry prominent notices
96
- stating that you changed the files and the date of any change.
97
-
98
- b) You must cause any work that you distribute or publish, that in
99
- whole or in part contains or is derived from the Program or any
100
- part thereof, to be licensed as a whole at no charge to all third
101
- parties under the terms of this License.
102
-
103
- c) If the modified program normally reads commands interactively
104
- when run, you must cause it, when started running for such
105
- interactive use in the most ordinary way, to print or display an
106
- announcement including an appropriate copyright notice and a
107
- notice that there is no warranty (or else, saying that you provide
108
- a warranty) and that users may redistribute the program under
109
- these conditions, and telling the user how to view a copy of this
110
- License. (Exception: if the Program itself is interactive but
111
- does not normally print such an announcement, your work based on
112
- the Program is not required to print an announcement.)
113
-
114
- These requirements apply to the modified work as a whole. If
115
- identifiable sections of that work are not derived from the Program,
116
- and can be reasonably considered independent and separate works in
117
- themselves, then this License, and its terms, do not apply to those
118
- sections when you distribute them as separate works. But when you
119
- distribute the same sections as part of a whole which is a work based
120
- on the Program, the distribution of the whole must be on the terms of
121
- this License, whose permissions for other licensees extend to the
122
- entire whole, and thus to each and every part regardless of who wrote it.
123
-
124
- Thus, it is not the intent of this section to claim rights or contest
125
- your rights to work written entirely by you; rather, the intent is to
126
- exercise the right to control the distribution of derivative or
127
- collective works based on the Program.
128
-
129
- In addition, mere aggregation of another work not based on the Program
130
- with the Program (or with a work based on the Program) on a volume of
131
- a storage or distribution medium does not bring the other work under
132
- the scope of this License.
133
-
134
- 3. You may copy and distribute the Program (or a work based on it,
135
- under Section 2) in object code or executable form under the terms of
136
- Sections 1 and 2 above provided that you also do one of the following:
137
-
138
- a) Accompany it with the complete corresponding machine-readable
139
- source code, which must be distributed under the terms of Sections
140
- 1 and 2 above on a medium customarily used for software interchange; or,
141
-
142
- b) Accompany it with a written offer, valid for at least three
143
- years, to give any third party, for a charge no more than your
144
- cost of physically performing source distribution, a complete
145
- machine-readable copy of the corresponding source code, to be
146
- distributed under the terms of Sections 1 and 2 above on a medium
147
- customarily used for software interchange; or,
148
-
149
- c) Accompany it with the information you received as to the offer
150
- to distribute corresponding source code. (This alternative is
151
- allowed only for noncommercial distribution and only if you
152
- received the program in object code or executable form with such
153
- an offer, in accord with Subsection b above.)
154
-
155
- The source code for a work means the preferred form of the work for
156
- making modifications to it. For an executable work, complete source
157
- code means all the source code for all modules it contains, plus any
158
- associated interface definition files, plus the scripts used to
159
- control compilation and installation of the executable. However, as a
160
- special exception, the source code distributed need not include
161
- anything that is normally distributed (in either source or binary
162
- form) with the major components (compiler, kernel, and so on) of the
163
- operating system on which the executable runs, unless that component
164
- itself accompanies the executable.
165
-
166
- If distribution of executable or object code is made by offering
167
- access to copy from a designated place, then offering equivalent
168
- access to copy the source code from the same place counts as
169
- distribution of the source code, even though third parties are not
170
- compelled to copy the source along with the object code.
171
-
172
- 4. You may not copy, modify, sublicense, or distribute the Program
173
- except as expressly provided under this License. Any attempt
174
- otherwise to copy, modify, sublicense or distribute the Program is
175
- void, and will automatically terminate your rights under this License.
176
- However, parties who have received copies, or rights, from you under
177
- this License will not have their licenses terminated so long as such
178
- parties remain in full compliance.
179
-
180
- 5. You are not required to accept this License, since you have not
181
- signed it. However, nothing else grants you permission to modify or
182
- distribute the Program or its derivative works. These actions are
183
- prohibited by law if you do not accept this License. Therefore, by
184
- modifying or distributing the Program (or any work based on the
185
- Program), you indicate your acceptance of this License to do so, and
186
- all its terms and conditions for copying, distributing or modifying
187
- the Program or works based on it.
188
-
189
- 6. Each time you redistribute the Program (or any work based on the
190
- Program), the recipient automatically receives a license from the
191
- original licensor to copy, distribute or modify the Program subject to
192
- these terms and conditions. You may not impose any further
193
- restrictions on the recipients' exercise of the rights granted herein.
194
- You are not responsible for enforcing compliance by third parties to
195
- this License.
196
-
197
- 7. If, as a consequence of a court judgment or allegation of patent
198
- infringement or for any other reason (not limited to patent issues),
199
- conditions are imposed on you (whether by court order, agreement or
200
- otherwise) that contradict the conditions of this License, they do not
201
- excuse you from the conditions of this License. If you cannot
202
- distribute so as to satisfy simultaneously your obligations under this
203
- License and any other pertinent obligations, then as a consequence you
204
- may not distribute the Program at all. For example, if a patent
205
- license would not permit royalty-free redistribution of the Program by
206
- all those who receive copies directly or indirectly through you, then
207
- the only way you could satisfy both it and this License would be to
208
- refrain entirely from distribution of the Program.
209
-
210
- If any portion of this section is held invalid or unenforceable under
211
- any particular circumstance, the balance of the section is intended to
212
- apply and the section as a whole is intended to apply in other
213
- circumstances.
214
-
215
- It is not the purpose of this section to induce you to infringe any
216
- patents or other property right claims or to contest validity of any
217
- such claims; this section has the sole purpose of protecting the
218
- integrity of the free software distribution system, which is
219
- implemented by public license practices. Many people have made
220
- generous contributions to the wide range of software distributed
221
- through that system in reliance on consistent application of that
222
- system; it is up to the author/donor to decide if he or she is willing
223
- to distribute software through any other system and a licensee cannot
224
- impose that choice.
225
-
226
- This section is intended to make thoroughly clear what is believed to
227
- be a consequence of the rest of this License.
228
-
229
- 8. If the distribution and/or use of the Program is restricted in
230
- certain countries either by patents or by copyrighted interfaces, the
231
- original copyright holder who places the Program under this License
232
- may add an explicit geographical distribution limitation excluding
233
- those countries, so that distribution is permitted only in or among
234
- countries not thus excluded. In such case, this License incorporates
235
- the limitation as if written in the body of this License.
236
-
237
- 9. The Free Software Foundation may publish revised and/or new versions
238
- of the General Public License from time to time. Such new versions will
239
- be similar in spirit to the present version, but may differ in detail to
240
- address new problems or concerns.
241
-
242
- Each version is given a distinguishing version number. If the Program
243
- specifies a version number of this License which applies to it and "any
244
- later version", you have the option of following the terms and conditions
245
- either of that version or of any later version published by the Free
246
- Software Foundation. If the Program does not specify a version number of
247
- this License, you may choose any version ever published by the Free Software
248
- Foundation.
249
-
250
- 10. If you wish to incorporate parts of the Program into other free
251
- programs whose distribution conditions are different, write to the author
252
- to ask for permission. For software which is copyrighted by the Free
253
- Software Foundation, write to the Free Software Foundation; we sometimes
254
- make exceptions for this. Our decision will be guided by the two goals
255
- of preserving the free status of all derivatives of our free software and
256
- of promoting the sharing and reuse of software generally.
257
-
258
- NO WARRANTY
259
-
260
- 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
261
- FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
262
- OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
263
- PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
264
- OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
265
- MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
266
- TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
267
- PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
268
- REPAIR OR CORRECTION.
269
-
270
- 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
271
- WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
272
- REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
273
- INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
274
- OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
275
- TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
276
- YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
277
- PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
278
- POSSIBILITY OF SUCH DAMAGES.
279
-
280
- END OF TERMS AND CONDITIONS
281
-
282
- How to Apply These Terms to Your New Programs
283
-
284
- If you develop a new program, and you want it to be of the greatest
285
- possible use to the public, the best way to achieve this is to make it
286
- free software which everyone can redistribute and change under these terms.
287
-
288
- To do so, attach the following notices to the program. It is safest
289
- to attach them to the start of each source file to most effectively
290
- convey the exclusion of warranty; and each file should have at least
291
- the "copyright" line and a pointer to where the full notice is found.
292
-
293
- <one line to give the program's name and a brief idea of what it does.>
294
- Copyright (C) <year> <name of author>
295
-
296
- This program is free software; you can redistribute it and/or modify
297
- it under the terms of the GNU General Public License as published by
298
- the Free Software Foundation; either version 2 of the License, or
299
- (at your option) any later version.
300
-
301
- This program is distributed in the hope that it will be useful,
302
- but WITHOUT ANY WARRANTY; without even the implied warranty of
303
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
304
- GNU General Public License for more details.
305
-
306
- You should have received a copy of the GNU General Public License
307
- along with this program; if not, write to the Free Software
308
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
309
-
310
-
311
- Also add information on how to contact you by electronic and paper mail.
312
-
313
- If the program is interactive, make it output a short notice like this
314
- when it starts in an interactive mode:
315
-
316
- Gnomovision version 69, Copyright (C) year name of author
317
- Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
318
- This is free software, and you are welcome to redistribute it
319
- under certain conditions; type `show c' for details.
320
-
321
- The hypothetical commands `show w' and `show c' should show the appropriate
322
- parts of the General Public License. Of course, the commands you use may
323
- be called something other than `show w' and `show c'; they could even be
324
- mouse-clicks or menu items--whatever suits your program.
325
-
326
- You should also get your employer (if you work as a programmer) or your
327
- school, if any, to sign a "copyright disclaimer" for the program, if
328
- necessary. Here is a sample; alter the names:
329
-
330
- Yoyodyne, Inc., hereby disclaims all copyright interest in the program
331
- `Gnomovision' (which makes passes at compilers) written by James Hacker.
332
-
333
- <signature of Ty Coon>, 1 April 1989
334
- Ty Coon, President of Vice
335
-
336
- This General Public License does not permit incorporating your program into
337
- proprietary programs. If your program is a subroutine library, you may
338
- consider it more useful to permit linking proprietary applications with the
339
- library. If this is what you want to do, use the GNU Library General
340
- Public License instead of this License.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
includes/csstidy-1.3/README DELETED
@@ -1,28 +0,0 @@
1
- CSSTidy
2
-
3
- Changelog: http://cdburnerxp.se/cssparse/csstidy/changelog.php
4
-
5
- css_optimiser.php is the web-interface, css_parser.php contains the PHP class (CSSTidy).
6
-
7
- This class represents a CSS parser which reads CSS code and saves it in an array.
8
- In opposite to most other CSS parsers, it does not use regular expressions and
9
- thus has full CSS2 support and a higher reliability. The downside of not using regular expressions
10
- is a lower speed though.
11
- Additional to that it applies some optimisations and fixes to the CSS code.
12
- An online version should be available here: http://cdburnerxp.se/cssparse/css_optimiser.php
13
-
14
-
15
-
16
- CSSTidy is free software; you can redistribute it and/or modify
17
- it under the terms of the GNU General Public License as published by
18
- the Free Software Foundation; either version 2 of the License, or
19
- (at your option) any later version.
20
-
21
- CSSTidy is distributed in the hope that it will be useful,
22
- but WITHOUT ANY WARRANTY; without even the implied warranty of
23
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
24
- GNU General Public License for more details.
25
-
26
- You should have received a copy of the GNU General Public License
27
- along with CSSTidy; if not, write to the Free Software
28
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
includes/csstidy-1.3/class.csstidy.php DELETED
@@ -1,999 +0,0 @@
1
- <?php
2
- /**
3
- * CSSTidy - CSS Parser and Optimiser
4
- *
5
- * CSS Parser class
6
- *
7
- * This file is part of CSSTidy.
8
- *
9
- * CSSTidy is free software; you can redistribute it and/or modify
10
- * it under the terms of the GNU General Public License as published by
11
- * the Free Software Foundation; either version 2 of the License, or
12
- * (at your option) any later version.
13
- *
14
- * CSSTidy is distributed in the hope that it will be useful,
15
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
16
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17
- * GNU General Public License for more details.
18
- *
19
- * You should have received a copy of the GNU General Public License
20
- * along with CSSTidy; if not, write to the Free Software
21
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
22
- *
23
- * @license http://opensource.org/licenses/gpl-license.php GNU Public License
24
- * @package csstidy
25
- * @author Florian Schmitz (floele at gmail dot com) 2005-2006
26
- */
27
-
28
- /**
29
- * Various CSS data needed for correct optimisations etc.
30
- *
31
- * @version 1.3
32
- */
33
- require(dirname(__FILE__).'/data.inc.php');
34
-
35
- /**
36
- * Contains a class for printing CSS code
37
- *
38
- * @version 1.0
39
- */
40
- require(dirname(__FILE__).'/class.csstidy_print.php');
41
-
42
- /**
43
- * Contains a class for optimising CSS code
44
- *
45
- * @version 1.0
46
- */
47
- require(dirname(__FILE__).'/class.csstidy_optimise.php');
48
-
49
- /**
50
- * CSS Parser class
51
- *
52
- * This class represents a CSS parser which reads CSS code and saves it in an array.
53
- * In opposite to most other CSS parsers, it does not use regular expressions and
54
- * thus has full CSS2 support and a higher reliability.
55
- * Additional to that it applies some optimisations and fixes to the CSS code.
56
- * An online version should be available here: http://cdburnerxp.se/cssparse/css_optimiser.php
57
- * @package csstidy
58
- * @author Florian Schmitz (floele at gmail dot com) 2005-2006
59
- * @version 1.3
60
- */
61
- class csstidy {
62
-
63
- /**
64
- * Saves the parsed CSS
65
- * @var array
66
- * @access public
67
- */
68
- var $css = array();
69
-
70
- /**
71
- * Saves the parsed CSS (raw)
72
- * @var array
73
- * @access private
74
- */
75
- var $tokens = array();
76
-
77
- /**
78
- * Printer class
79
- * @see csstidy_print
80
- * @var object
81
- * @access public
82
- */
83
- var $print;
84
-
85
- /**
86
- * Optimiser class
87
- * @see csstidy_optimise
88
- * @var object
89
- * @access private
90
- */
91
- var $optimise;
92
-
93
- /**
94
- * Saves the CSS charset (@charset)
95
- * @var string
96
- * @access private
97
- */
98
- var $charset = '';
99
-
100
- /**
101
- * Saves all @import URLs
102
- * @var array
103
- * @access private
104
- */
105
- var $import = array();
106
-
107
- /**
108
- * Saves the namespace
109
- * @var string
110
- * @access private
111
- */
112
- var $namespace = '';
113
-
114
- /**
115
- * Contains the version of csstidy
116
- * @var string
117
- * @access private
118
- */
119
- var $version = '1.3';
120
-
121
- /**
122
- * Stores the settings
123
- * @var array
124
- * @access private
125
- */
126
- var $settings = array();
127
-
128
- /**
129
- * Saves the parser-status.
130
- *
131
- * Possible values:
132
- * - is = in selector
133
- * - ip = in property
134
- * - iv = in value
135
- * - instr = in string (started at " or ' or ( )
136
- * - ic = in comment (ignore everything)
137
- * - at = in @-block
138
- *
139
- * @var string
140
- * @access private
141
- */
142
- var $status = 'is';
143
-
144
-
145
- /**
146
- * Saves the current at rule (@media)
147
- * @var string
148
- * @access private
149
- */
150
- var $at = '';
151
-
152
- /**
153
- * Saves the current selector
154
- * @var string
155
- * @access private
156
- */
157
- var $selector = '';
158
-
159
- /**
160
- * Saves the current property
161
- * @var string
162
- * @access private
163
- */
164
- var $property = '';
165
-
166
- /**
167
- * Saves the position of , in selectors
168
- * @var array
169
- * @access private
170
- */
171
- var $sel_separate = array();
172
-
173
- /**
174
- * Saves the current value
175
- * @var string
176
- * @access private
177
- */
178
- var $value = '';
179
-
180
- /**
181
- * Saves the current sub-value
182
- *
183
- * Example for a subvalue:
184
- * background:url(foo.png) red no-repeat;
185
- * "url(foo.png)", "red", and "no-repeat" are subvalues,
186
- * seperated by whitespace
187
- * @var string
188
- * @access private
189
- */
190
- var $sub_value = '';
191
-
192
- /**
193
- * Array which saves all subvalues for a property.
194
- * @var array
195
- * @see sub_value
196
- * @access private
197
- */
198
- var $sub_value_arr = array();
199
-
200
- /**
201
- * Saves the char which opened the last string
202
- * @var string
203
- * @access private
204
- */
205
- var $str_char = '';
206
- var $cur_string = '';
207
-
208
- /**
209
- * Status from which the parser switched to ic or instr
210
- * @var string
211
- * @access private
212
- */
213
- var $from = '';
214
-
215
- /**
216
- * Variable needed to manage string-in-strings, for example url("foo.png")
217
- * @var string
218
- * @access private
219
- */
220
- var $str_in_str = false;
221
-
222
- /**
223
- * =true if in invalid at-rule
224
- * @var bool
225
- * @access private
226
- */
227
- var $invalid_at = false;
228
-
229
- /**
230
- * =true if something has been added to the current selector
231
- * @var bool
232
- * @access private
233
- */
234
- var $added = false;
235
-
236
- /**
237
- * Array which saves the message log
238
- * @var array
239
- * @access private
240
- */
241
- var $log = array();
242
-
243
- /**
244
- * Saves the line number
245
- * @var integer
246
- * @access private
247
- */
248
- var $line = 1;
249
-
250
- /**
251
- * Loads standard template and sets default settings
252
- * @access private
253
- * @version 1.3
254
- */
255
- function csstidy()
256
- {
257
- $this->settings['remove_bslash'] = true;
258
- $this->settings['compress_colors'] = true;
259
- $this->settings['compress_font-weight'] = true;
260
- $this->settings['lowercase_s'] = false;
261
- $this->settings['optimise_shorthands'] = 1;
262
- $this->settings['remove_last_;'] = false;
263
- $this->settings['case_properties'] = 1;
264
- $this->settings['sort_properties'] = false;
265
- $this->settings['sort_selectors'] = false;
266
- $this->settings['merge_selectors'] = 2;
267
- $this->settings['discard_invalid_properties'] = false;
268
- $this->settings['css_level'] = 'CSS2.1';
269
- $this->settings['preserve_css'] = false;
270
- $this->settings['timestamp'] = false;
271
-
272
- $this->load_template('default');
273
- $this->print = new csstidy_print($this);
274
- $this->optimise = new csstidy_optimise($this);
275
- }
276
-
277
- /**
278
- * Get the value of a setting.
279
- * @param string $setting
280
- * @access public
281
- * @return mixed
282
- * @version 1.0
283
- */
284
- function get_cfg($setting)
285
- {
286
- if(isset($this->settings[$setting]))
287
- {
288
- return $this->settings[$setting];
289
- }
290
- return false;
291
- }
292
-
293
- /**
294
- * Set the value of a setting.
295
- * @param string $setting
296
- * @param mixed $value
297
- * @access public
298
- * @return bool
299
- * @version 1.0
300
- */
301
- function set_cfg($setting,$value)
302
- {
303
- if(isset($this->settings[$setting]) && $value !== '')
304
- {
305
- $this->settings[$setting] = $value;
306
- return true;
307
- }
308
- return false;
309
- }
310
-
311
- /**
312
- * Adds a token to $this->tokens
313
- * @param mixed $type
314
- * @param string $data
315
- * @param bool $do add a token even if preserve_css is off
316
- * @access private
317
- * @version 1.0
318
- */
319
- function _add_token($type, $data, $do = false) {
320
- if($this->get_cfg('preserve_css') || $do) {
321
- $this->tokens[] = array($type, ($type == COMMENT) ? $data : trim($data));
322
- }
323
- }
324
-
325
- /**
326
- * Add a message to the message log
327
- * @param string $message
328
- * @param string $type
329
- * @param integer $line
330
- * @access private
331
- * @version 1.0
332
- */
333
- function log($message,$type,$line = -1)
334
- {
335
- if($line === -1)
336
- {
337
- $line = $this->line;
338
- }
339
- $line = intval($line);
340
- $add = array('m' => $message, 't' => $type);
341
- if(!isset($this->log[$line]) || !in_array($add,$this->log[$line]))
342
- {
343
- $this->log[$line][] = $add;
344
- }
345
- }
346
-
347
- /**
348
- * Parse unicode notations and find a replacement character
349
- * @param string $string
350
- * @param integer $i
351
- * @access private
352
- * @return string
353
- * @version 1.2
354
- */
355
- function _unicode(&$string, &$i)
356
- {
357
- ++$i;
358
- $add = '';
359
- $tokens =& $GLOBALS['csstidy']['tokens'];
360
- $replaced = false;
361
-
362
- while($i < strlen($string) && (ctype_xdigit($string{$i}) || ctype_space($string{$i})) && strlen($add) < 6)
363
- {
364
- $add .= $string{$i};
365
-
366
- if(ctype_space($string{$i})) {
367
- break;
368
- }
369
- $i++;
370
- }
371
-
372
- if(hexdec($add) > 47 && hexdec($add) < 58 || hexdec($add) > 64 && hexdec($add) < 91 || hexdec($add) > 96 && hexdec($add) < 123)
373
- {
374
- $this->log('Replaced unicode notation: Changed \\'. $add .' to ' . chr(hexdec($add)),'Information');
375
- $add = chr(hexdec($add));
376
- $replaced = true;
377
- }
378
- else {
379
- $add = trim('\\'.$add);
380
- }
381
-
382
- if(@ctype_xdigit($string{$i+1}) && ctype_space($string{$i})
383
- && !$replaced || !ctype_space($string{$i})) {
384
- $i--;
385
- }
386
-
387
- if($add != '\\' || !$this->get_cfg('remove_bslash') || strpos($tokens, $string{$i+1}) !== false) {
388
- return $add;
389
- }
390
-
391
- if($add == '\\') {
392
- $this->log('Removed unnecessary backslash','Information');
393
- }
394
- return '';
395
- }
396
-
397
- /**
398
- * Loads a new template
399
- * @param string $content either filename (if $from_file == true), content of a template file, "high_compression", "highest_compression", "low_compression", or "default"
400
- * @param bool $from_file uses $content as filename if true
401
- * @access public
402
- * @version 1.1
403
- * @see http://csstidy.sourceforge.net/templates.php
404
- */
405
- function load_template($content, $from_file=true)
406
- {
407
- $predefined_templates =& $GLOBALS['csstidy']['predefined_templates'];
408
- if($content == 'high_compression' || $content == 'default' || $content == 'highest_compression' || $content == 'low_compression')
409
- {
410
- $this->template = $predefined_templates[$content];
411
- return;
412
- }
413
-
414
- if($from_file)
415
- {
416
- $content = strip_tags(file_get_contents($content),'<span>');
417
- }
418
- $content = str_replace("\r\n","\n",$content); // Unify newlines (because the output also only uses \n)
419
- $template = explode('|',$content);
420
-
421
- for ($i = 0; $i < count($template); $i++ )
422
- {
423
- $this->template[$i] = $template[$i];
424
- }
425
- }
426
-
427
- /**
428
- * Starts parsing from URL
429
- * @param string $url
430
- * @access public
431
- * @version 1.0
432
- */
433
- function parse_from_url($url)
434
- {
435
- return $this->parse(@file_get_contents($url));
436
- }
437
-
438
- /**
439
- * Checks if there is a token at the current position
440
- * @param string $string
441
- * @param integer $i
442
- * @access public
443
- * @version 1.11
444
- */
445
- function is_token(&$string, $i)
446
- {
447
- $tokens =& $GLOBALS['csstidy']['tokens'];
448
- return (strpos($tokens, $string{$i}) !== false && !csstidy::escaped($string,$i));
449
- }
450
-
451
-
452
- /**
453
- * Parses CSS in $string. The code is saved as array in $this->css
454
- * @param string $string the CSS code
455
- * @access public
456
- * @return bool
457
- * @version 1.1
458
- */
459
- function parse($string) {
460
- // PHP bug? Settings need to be refreshed in PHP4
461
- $this->print = new csstidy_print($this);
462
- $this->optimise = new csstidy_optimise($this);
463
-
464
- $all_properties =& $GLOBALS['csstidy']['all_properties'];
465
- $at_rules =& $GLOBALS['csstidy']['at_rules'];
466
-
467
- $this->css = array();
468
- $this->print->input_css = $string;
469
- $string = str_replace("\r\n","\n",$string) . ' ';
470
- $cur_comment = '';
471
-
472
- for ($i = 0, $size = strlen($string); $i < $size; $i++ )
473
- {
474
- if($string{$i} == "\n" || $string{$i} == "\r")
475
- {
476
- ++$this->line;
477
- }
478
-
479
- switch($this->status)
480
- {
481
- /* Case in at-block */
482
- case 'at':
483
- if(csstidy::is_token($string,$i))
484
- {
485
- if($string{$i} == '/' && @$string{$i+1} == '*')
486
- {
487
- $this->status = 'ic'; ++$i;
488
- $this->from = 'at';
489
- }
490
- elseif($string{$i} == '{')
491
- {
492
- $this->status = 'is';
493
- $this->_add_token(AT_START, $this->at);
494
- }
495
- elseif($string{$i} == ',')
496
- {
497
- $this->at = trim($this->at).',';
498
- }
499
- elseif($string{$i} == '\\')
500
- {
501
- $this->at .= $this->_unicode($string,$i);
502
- }
503
- }
504
- else
505
- {
506
- $lastpos = strlen($this->at)-1;
507
- if(!( (ctype_space($this->at{$lastpos}) || csstidy::is_token($this->at,$lastpos) && $this->at{$lastpos} == ',') && ctype_space($string{$i})))
508
- {
509
- $this->at .= $string{$i};
510
- }
511
- }
512
- break;
513
-
514
- /* Case in-selector */
515
- case 'is':
516
- if(csstidy::is_token($string,$i))
517
- {
518
- if($string{$i} == '/' && @$string{$i+1} == '*' && trim($this->selector) == '')
519
- {
520
- $this->status = 'ic'; ++$i;
521
- $this->from = 'is';
522
- }
523
- elseif($string{$i} == '@' && trim($this->selector) == '')
524
- {
525
- // Check for at-rule
526
- $this->invalid_at = true;
527
- foreach($at_rules as $name => $type)
528
- {
529
- if(!strcasecmp(substr($string,$i+1,strlen($name)),$name))
530
- {
531
- ($type == 'at') ? $this->at = '@'.$name : $this->selector = '@'.$name;
532
- $this->status = $type;
533
- $i += strlen($name);
534
- $this->invalid_at = false;
535
- }
536
- }
537
-
538
- if($this->invalid_at)
539
- {
540
- $this->selector = '@';
541
- $invalid_at_name = '';
542
- for($j = $i+1; $j < $size; ++$j)
543
- {
544
- if(!ctype_alpha($string{$j}))
545
- {
546
- break;
547
- }
548
- $invalid_at_name .= $string{$j};
549
- }
550
- $this->log('Invalid @-rule: '.$invalid_at_name.' (removed)','Warning');
551
- }
552
- }
553
- elseif(($string{$i} == '"' || $string{$i} == "'"))
554
- {
555
- $this->cur_string = $string{$i};
556
- $this->status = 'instr';
557
- $this->str_char = $string{$i};
558
- $this->from = 'is';
559
- }
560
- elseif($this->invalid_at && $string{$i} == ';')
561
- {
562
- $this->invalid_at = false;
563
- $this->status = 'is';
564
- }
565
- elseif($string{$i} == '{')
566
- {
567
- $this->status = 'ip';
568
- $this->_add_token(SEL_START, $this->selector);
569
- $this->added = false;
570
- }
571
- elseif($string{$i} == '}')
572
- {
573
- $this->_add_token(AT_END, $this->at);
574
- $this->at = '';
575
- $this->selector = '';
576
- $this->sel_separate = array();
577
- }
578
- elseif($string{$i} == ',')
579
- {
580
- $this->selector = trim($this->selector).',';
581
- $this->sel_separate[] = strlen($this->selector);
582
- }
583
- elseif($string{$i} == '\\')
584
- {
585
- $this->selector .= $this->_unicode($string,$i);
586
- }
587
- // remove unnecessary universal selector, FS#147
588
- else if(!($string{$i} == '*' && @in_array($string{$i+1}, array('.', '#', '[', ':')))) {
589
- $this->selector .= $string{$i};
590
- }
591
- }
592
- else
593
- {
594
- $lastpos = strlen($this->selector)-1;
595
- if($lastpos == -1 || !( (ctype_space($this->selector{$lastpos}) || csstidy::is_token($this->selector,$lastpos) && $this->selector{$lastpos} == ',') && ctype_space($string{$i})))
596
- {
597
- $this->selector .= $string{$i};
598
- }
599
- }
600
- break;
601
-
602
- /* Case in-property */
603
- case 'ip':
604
- if(csstidy::is_token($string,$i))
605
- {
606
- if(($string{$i} == ':' || $string{$i} == '=') && $this->property != '')
607
- {
608
- $this->status = 'iv';
609
- if(!$this->get_cfg('discard_invalid_properties') || csstidy::property_is_valid($this->property)) {
610
- $this->_add_token(PROPERTY, $this->property);
611
- }
612
- }
613
- elseif($string{$i} == '/' && @$string{$i+1} == '*' && $this->property == '')
614
- {
615
- $this->status = 'ic'; ++$i;
616
- $this->from = 'ip';
617
- }
618
- elseif($string{$i} == '}')
619
- {
620
- $this->explode_selectors();
621
- $this->status = 'is';
622
- $this->invalid_at = false;
623
- $this->_add_token(SEL_END, $this->selector);
624
- $this->selector = '';
625
- $this->property = '';
626
- }
627
- elseif($string{$i} == ';')
628
- {
629
- $this->property = '';
630
- }
631
- elseif($string{$i} == '\\')
632
- {
633
- $this->property .= $this->_unicode($string,$i);
634
- }
635
- }
636
- elseif(!ctype_space($string{$i}))
637
- {
638
- $this->property .= $string{$i};
639
- }
640
- break;
641
-
642
- /* Case in-value */
643
- case 'iv':
644
- $pn = (($string{$i} == "\n" || $string{$i} == "\r") && $this->property_is_next($string,$i+1) || $i == strlen($string)-1);
645
- if(csstidy::is_token($string,$i) || $pn)
646
- {
647
- if($string{$i} == '/' && @$string{$i+1} == '*')
648
- {
649
- $this->status = 'ic'; ++$i;
650
- $this->from = 'iv';
651
- }
652
- elseif(($string{$i} == '"' || $string{$i} == "'" || $string{$i} == '('))
653
- {
654
- $this->cur_string = $string{$i};
655
- $this->str_char = ($string{$i} == '(') ? ')' : $string{$i};
656
- $this->status = 'instr';
657
- $this->from = 'iv';
658
- }
659
- elseif($string{$i} == ',')
660
- {
661
- $this->sub_value = trim($this->sub_value).',';
662
- }
663
- elseif($string{$i} == '\\')
664
- {
665
- $this->sub_value .= $this->_unicode($string,$i);
666
- }
667
- elseif($string{$i} == ';' || $pn)
668
- {
669
- if($this->selector{0} == '@' && isset($at_rules[substr($this->selector,1)]) && $at_rules[substr($this->selector,1)] == 'iv')
670
- {
671
- $this->sub_value_arr[] = trim($this->sub_value);
672
-
673
- $this->status = 'is';
674
-
675
- switch($this->selector)
676
- {
677
- case '@charset': $this->charset = $this->sub_value_arr[0]; break;
678
- case '@namespace': $this->namespace = implode(' ',$this->sub_value_arr); break;
679
- case '@import': $this->import[] = implode(' ',$this->sub_value_arr); break;
680
- }
681
-
682
- $this->sub_value_arr = array();
683
- $this->sub_value = '';
684
- $this->selector = '';
685
- $this->sel_separate = array();
686
- }
687
- else
688
- {
689
- $this->status = 'ip';
690
- }
691
- }
692
- elseif($string{$i} != '}')
693
- {
694
- $this->sub_value .= $string{$i};
695
- }
696
- if(($string{$i} == '}' || $string{$i} == ';' || $pn) && !empty($this->selector))
697
- {
698
- if($this->at == '')
699
- {
700
- $this->at = DEFAULT_AT;
701
- }
702
-
703
- // case settings
704
- if($this->get_cfg('lowercase_s'))
705
- {
706
- $this->selector = strtolower($this->selector);
707
- }
708
- $this->property = strtolower($this->property);
709
-
710
- $this->optimise->subvalue();
711
- if($this->sub_value != '') {
712
- $this->sub_value_arr[] = $this->sub_value;
713
- $this->sub_value = '';
714
- }
715
-
716
- $this->value = implode(' ',$this->sub_value_arr);
717
-
718
- $this->selector = trim($this->selector);
719
-
720
- $this->optimise->value();
721
-
722
- $valid = csstidy::property_is_valid($this->property);
723
- if((!$this->invalid_at || $this->get_cfg('preserve_css')) && (!$this->get_cfg('discard_invalid_properties') || $valid))
724
- {
725
- $this->css_add_property($this->at,$this->selector,$this->property,$this->value);
726
- $this->_add_token(VALUE, $this->value);
727
- $this->optimise->shorthands();
728
- }
729
- if(!$valid)
730
- {
731
- if($this->get_cfg('discard_invalid_properties'))
732
- {
733
- $this->log('Removed invalid property: '.$this->property,'Warning');
734
- }
735
- else
736
- {
737
- $this->log('Invalid property in '.strtoupper($this->get_cfg('css_level')).': '.$this->property,'Warning');
738
- }
739
- }
740
-
741
- $this->property = '';
742
- $this->sub_value_arr = array();
743
- $this->value = '';
744
- }
745
- if($string{$i} == '}')
746
- {
747
- $this->explode_selectors();
748
- $this->_add_token(SEL_END, $this->selector);
749
- $this->status = 'is';
750
- $this->invalid_at = false;
751
- $this->selector = '';
752
- }
753
- }
754
- elseif(!$pn)
755
- {
756
- $this->sub_value .= $string{$i};
757
-
758
- if(ctype_space($string{$i}))
759
- {
760
- $this->optimise->subvalue();
761
- if($this->sub_value != '') {
762
- $this->sub_value_arr[] = $this->sub_value;
763
- $this->sub_value = '';
764
- }
765
- }
766
- }
767
- break;
768
-
769
- /* Case in string */
770
- case 'instr':
771
- if($this->str_char == ')' && ($string{$i} == '"' || $string{$i} == '\'') && !$this->str_in_str && !csstidy::escaped($string,$i))
772
- {
773
- $this->str_in_str = true;
774
- }
775
- elseif($this->str_char == ')' && ($string{$i} == '"' || $string{$i} == '\'') && $this->str_in_str && !csstidy::escaped($string,$i))
776
- {
777
- $this->str_in_str = false;
778
- }
779
- $temp_add = $string{$i}; // ...and no not-escaped backslash at the previous position
780
- if( ($string{$i} == "\n" || $string{$i} == "\r") && !($string{$i-1} == '\\' && !csstidy::escaped($string,$i-1)) )
781
- {
782
- $temp_add = "\\A ";
783
- $this->log('Fixed incorrect newline in string','Warning');
784
- }
785
- if (!($this->str_char == ')' && in_array($string{$i}, $GLOBALS['csstidy']['whitespace']) && !$this->str_in_str)) {
786
- $this->cur_string .= $temp_add;
787
- }
788
- if($string{$i} == $this->str_char && !csstidy::escaped($string,$i) && !$this->str_in_str)
789
- {
790
- $this->status = $this->from;
791
- if (!preg_match('|[' . implode('', $GLOBALS['csstidy']['whitespace']) . ']|uis', $this->cur_string) && $this->property != 'content') {
792
- if ($this->str_char == '"' || $this->str_char == '\'') {
793
- $this->cur_string = substr($this->cur_string, 1, -1);
794
- } else if (strlen($this->cur_string) > 3 && ($this->cur_string[1] == '"' || $this->cur_string[1] == '\'')) /* () */ {
795
- $this->cur_string = $this->cur_string[0] . substr($this->cur_string, 2, -2) . substr($this->cur_string, -1);
796
- }
797
- }
798
- if($this->from == 'iv')
799
- {
800
- $this->sub_value .= $this->cur_string;
801
- }
802
- elseif($this->from == 'is')
803
- {
804
- $this->selector .= $this->cur_string;
805
- }
806
- }
807
- break;
808
-
809
- /* Case in-comment */
810
- case 'ic':
811
- if($string{$i} == '*' && $string{$i+1} == '/')
812
- {
813
- $this->status = $this->from;
814
- $i++;
815
- $this->_add_token(COMMENT, $cur_comment);
816
- $cur_comment = '';
817
- }
818
- else
819
- {
820
- $cur_comment .= $string{$i};
821
- }
822
- break;
823
- }
824
- }
825
-
826
- $this->optimise->postparse();
827
-
828
- $this->print->_reset();
829
-
830
- return !(empty($this->css) && empty($this->import) && empty($this->charset) && empty($this->tokens) && empty($this->namespace));
831
- }
832
-
833
- /**
834
- * Explodes selectors
835
- * @access private
836
- * @version 1.0
837
- */
838
- function explode_selectors()
839
- {
840
- // Explode multiple selectors
841
- if($this->get_cfg('merge_selectors') == 1)
842
- {
843
- $new_sels = array();
844
- $lastpos = 0;
845
- $this->sel_separate[] = strlen($this->selector);
846
- foreach($this->sel_separate as $num => $pos)
847
- {
848
- if($num == count($this->sel_separate)-1) {
849
- $pos += 1;
850
- }
851
-
852
- $new_sels[] = substr($this->selector,$lastpos,$pos-$lastpos-1);
853
- $lastpos = $pos;
854
- }
855
-
856
- if(count($new_sels) > 1)
857
- {
858
- foreach($new_sels as $selector)
859
- {
860
- $this->merge_css_blocks($this->at,$selector,$this->css[$this->at][$this->selector]);
861
- }
862
- unset($this->css[$this->at][$this->selector]);
863
- }
864
- }
865
- $this->sel_separate = array();
866
- }
867
-
868
- /**
869
- * Checks if a character is escaped (and returns true if it is)
870
- * @param string $string
871
- * @param integer $pos
872
- * @access public
873
- * @return bool
874
- * @version 1.02
875
- */
876
- function escaped(&$string,$pos)
877
- {
878
- return !(@($string{$pos-1} != '\\') || csstidy::escaped($string,$pos-1));
879
- }
880
-
881
- /**
882
- * Adds a property with value to the existing CSS code
883
- * @param string $media
884
- * @param string $selector
885
- * @param string $property
886
- * @param string $new_val
887
- * @access private
888
- * @version 1.2
889
- */
890
- function css_add_property($media,$selector,$property,$new_val)
891
- {
892
- if($this->get_cfg('preserve_css') || trim($new_val) == '') {
893
- return;
894
- }
895
-
896
- $this->added = true;
897
- if(isset($this->css[$media][$selector][$property]))
898
- {
899
- if((csstidy::is_important($this->css[$media][$selector][$property]) && csstidy::is_important($new_val)) || !csstidy::is_important($this->css[$media][$selector][$property]))
900
- {
901
- unset($this->css[$media][$selector][$property]);
902
- $this->css[$media][$selector][$property] = trim($new_val);
903
- }
904
- }
905
- else
906
- {
907
- $this->css[$media][$selector][$property] = trim($new_val);
908
- }
909
- }
910
-
911
- /**
912
- * Adds CSS to an existing media/selector
913
- * @param string $media
914
- * @param string $selector
915
- * @param array $css_add
916
- * @access private
917
- * @version 1.1
918
- */
919
- function merge_css_blocks($media,$selector,$css_add)
920
- {
921
- foreach($css_add as $property => $value)
922
- {
923
- $this->css_add_property($media,$selector,$property,$value,false);
924
- }
925
- }
926
-
927
- /**
928
- * Checks if $value is !important.
929
- * @param string $value
930
- * @return bool
931
- * @access public
932
- * @version 1.0
933
- */
934
- function is_important(&$value)
935
- {
936
- return (!strcasecmp(substr(str_replace($GLOBALS['csstidy']['whitespace'],'',$value),-10,10),'!important'));
937
- }
938
-
939
- /**
940
- * Returns a value without !important
941
- * @param string $value
942
- * @return string
943
- * @access public
944
- * @version 1.0
945
- */
946
- function gvw_important($value)
947
- {
948
- if(csstidy::is_important($value))
949
- {
950
- $value = trim($value);
951
- $value = substr($value,0,-9);
952
- $value = trim($value);
953
- $value = substr($value,0,-1);
954
- $value = trim($value);
955
- return $value;
956
- }
957
- return $value;
958
- }
959
-
960
- /**
961
- * Checks if the next word in a string from pos is a CSS property
962
- * @param string $istring
963
- * @param integer $pos
964
- * @return bool
965
- * @access private
966
- * @version 1.2
967
- */
968
- function property_is_next($istring, $pos)
969
- {
970
- $all_properties =& $GLOBALS['csstidy']['all_properties'];
971
- $istring = substr($istring,$pos,strlen($istring)-$pos);
972
- $pos = strpos($istring,':');
973
- if($pos === false)
974
- {
975
- return false;
976
- }
977
- $istring = strtolower(trim(substr($istring,0,$pos)));
978
- if(isset($all_properties[$istring]))
979
- {
980
- $this->log('Added semicolon to the end of declaration','Warning');
981
- return true;
982
- }
983
- return false;
984
- }
985
-
986
- /**
987
- * Checks if a property is valid
988
- * @param string $property
989
- * @return bool;
990
- * @access public
991
- * @version 1.0
992
- */
993
- function property_is_valid($property) {
994
- $all_properties =& $GLOBALS['csstidy']['all_properties'];
995
- return (isset($all_properties[$property]) && strpos($all_properties[$property],strtoupper($this->get_cfg('css_level'))) !== false );
996
- }
997
-
998
- }
999
- ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
includes/csstidy-1.3/class.csstidy_optimise.php DELETED
@@ -1,809 +0,0 @@
1
- <?php
2
- /**
3
- * CSSTidy - CSS Parser and Optimiser
4
- *
5
- * CSS Optimising Class
6
- * This class optimises CSS data generated by csstidy.
7
- *
8
- * This file is part of CSSTidy.
9
- *
10
- * CSSTidy is free software; you can redistribute it and/or modify
11
- * it under the terms of the GNU General Public License as published by
12
- * the Free Software Foundation; either version 2 of the License, or
13
- * (at your option) any later version.
14
- *
15
- * CSSTidy is distributed in the hope that it will be useful,
16
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
17
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18
- * GNU General Public License for more details.
19
- *
20
- * You should have received a copy of the GNU General Public License
21
- * along with CSSTidy; if not, write to the Free Software
22
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
23
- *
24
- * @license http://opensource.org/licenses/gpl-license.php GNU Public License
25
- * @package csstidy
26
- * @author Florian Schmitz (floele at gmail dot com) 2005-2006
27
- */
28
-
29
- /**
30
- * CSS Optimising Class
31
- *
32
- * This class optimises CSS data generated by csstidy.
33
- *
34
- * @package csstidy
35
- * @author Florian Schmitz (floele at gmail dot com) 2005-2006
36
- * @version 1.0
37
- */
38
-
39
- class csstidy_optimise
40
- {
41
- /**
42
- * Constructor
43
- * @param array $css contains the class csstidy
44
- * @access private
45
- * @version 1.0
46
- */
47
- function csstidy_optimise(&$css)
48
- {
49
- $this->parser =& $css;
50
- $this->css =& $css->css;
51
- $this->sub_value =& $css->sub_value;
52
- $this->at =& $css->at;
53
- $this->selector =& $css->selector;
54
- $this->property =& $css->property;
55
- $this->value =& $css->value;
56
- }
57
-
58
- /**
59
- * Optimises $css after parsing
60
- * @access public
61
- * @version 1.0
62
- */
63
- function postparse()
64
- {
65
- if ($this->parser->get_cfg('preserve_css')) {
66
- return;
67
- }
68
-
69
- if ($this->parser->get_cfg('merge_selectors') == 2)
70
- {
71
- foreach ($this->css as $medium => $value)
72
- {
73
- $this->merge_selectors($this->css[$medium]);
74
- }
75
- }
76
-
77
- if ($this->parser->get_cfg('optimise_shorthands') > 0)
78
- {
79
- foreach ($this->css as $medium => $value)
80
- {
81
- foreach ($value as $selector => $value1)
82
- {
83
- $this->css[$medium][$selector] = csstidy_optimise::merge_4value_shorthands($this->css[$medium][$selector]);
84
-
85
- if ($this->parser->get_cfg('optimise_shorthands') < 2) {
86
- continue;
87
- }
88
-
89
- $this->css[$medium][$selector] = csstidy_optimise::merge_bg($this->css[$medium][$selector]);
90
- if (empty($this->css[$medium][$selector])) {
91
- unset($this->css[$medium][$selector]);
92
- }
93
- }
94
- }
95
- }
96
- }
97
-
98
- /**
99
- * Optimises values
100
- * @access public
101
- * @version 1.0
102
- */
103
- function value()
104
- {
105
- $shorthands =& $GLOBALS['csstidy']['shorthands'];
106
-
107
- // optimise shorthand properties
108
- if(isset($shorthands[$this->property]))
109
- {
110
- $temp = csstidy_optimise::shorthand($this->value); // FIXME - move
111
- if($temp != $this->value)
112
- {
113
- $this->parser->log('Optimised shorthand notation ('.$this->property.'): Changed "'.$this->value.'" to "'.$temp.'"','Information');
114
- }
115
- $this->value = $temp;
116
- }
117
-
118
- // Remove whitespace at ! important
119
- if($this->value != $this->compress_important($this->value))
120
- {
121
- $this->parser->log('Optimised !important','Information');
122
- }
123
- }
124
-
125
- /**
126
- * Optimises shorthands
127
- * @access public
128
- * @version 1.0
129
- */
130
- function shorthands()
131
- {
132
- $shorthands =& $GLOBALS['csstidy']['shorthands'];
133
-
134
- if(!$this->parser->get_cfg('optimise_shorthands') || $this->parser->get_cfg('preserve_css')) {
135
- return;
136
- }
137
-
138
- if($this->property == 'background' && $this->parser->get_cfg('optimise_shorthands') > 1)
139
- {
140
- unset($this->css[$this->at][$this->selector]['background']);
141
- $this->parser->merge_css_blocks($this->at,$this->selector,csstidy_optimise::dissolve_short_bg($this->value));
142
- }
143
- if(isset($shorthands[$this->property]))
144
- {
145
- $this->parser->merge_css_blocks($this->at,$this->selector,csstidy_optimise::dissolve_4value_shorthands($this->property,$this->value));
146
- if(is_array($shorthands[$this->property]))
147
- {
148
- unset($this->css[$this->at][$this->selector][$this->property]);
149
- }
150
- }
151
- }
152
-
153
- /**
154
- * Optimises a sub-value
155
- * @access public
156
- * @version 1.0
157
- */
158
- function subvalue()
159
- {
160
- $replace_colors =& $GLOBALS['csstidy']['replace_colors'];
161
-
162
- $this->sub_value = trim($this->sub_value);
163
- if($this->sub_value == '') // caution : '0'
164
- {
165
- return;
166
- }
167
-
168
- $important = '';
169
- if(csstidy::is_important($this->sub_value))
170
- {
171
- $important = '!important';
172
- }
173
- $this->sub_value = csstidy::gvw_important($this->sub_value);
174
-
175
- // Compress font-weight
176
- if($this->property == 'font-weight' && $this->parser->get_cfg('compress_font-weight'))
177
- {
178
- if($this->sub_value == 'bold')
179
- {
180
- $this->sub_value = '700';
181
- $this->parser->log('Optimised font-weight: Changed "bold" to "700"','Information');
182
- }
183
- else if($this->sub_value == 'normal')
184
- {
185
- $this->sub_value = '400';
186
- $this->parser->log('Optimised font-weight: Changed "normal" to "400"','Information');
187
- }
188
- }
189
-
190
- $temp = $this->compress_numbers($this->sub_value);
191
- if($temp != $this->sub_value)
192
- {
193
- if(strlen($temp) > strlen($this->sub_value)) {
194
- $this->parser->log('Fixed invalid number: Changed "'.$this->sub_value.'" to "'.$temp.'"','Warning');
195
- } else {
196
- $this->parser->log('Optimised number: Changed "'.$this->sub_value.'" to "'.$temp.'"','Information');
197
- }
198
- $this->sub_value = $temp;
199
- }
200
- if($this->parser->get_cfg('compress_colors'))
201
- {
202
- $temp = $this->cut_color($this->sub_value);
203
- if($temp !== $this->sub_value)
204
- {
205
- if(isset($replace_colors[$this->sub_value])) {
206
- $this->parser->log('Fixed invalid color name: Changed "'.$this->sub_value.'" to "'.$temp.'"','Warning');
207
- } else {
208
- $this->parser->log('Optimised color: Changed "'.$this->sub_value.'" to "'.$temp.'"','Information');
209
- }
210
- $this->sub_value = $temp;
211
- }
212
- }
213
- $this->sub_value .= $important;
214
- }
215
-
216
- /**
217
- * Compresses shorthand values. Example: margin:1px 1px 1px 1px -> margin:1px
218
- * @param string $value
219
- * @access public
220
- * @return string
221
- * @version 1.0
222
- */
223
- function shorthand($value)
224
- {
225
- $important = '';
226
- if(csstidy::is_important($value))
227
- {
228
- $values = csstidy::gvw_important($value);
229
- $important = '!important';
230
- }
231
- else $values = $value;
232
-
233
- $values = explode(' ',$values);
234
- switch(count($values))
235
- {
236
- case 4:
237
- if($values[0] == $values[1] && $values[0] == $values[2] && $values[0] == $values[3])
238
- {
239
- return $values[0].$important;
240
- }
241
- elseif($values[1] == $values[3] && $values[0] == $values[2])
242
- {
243
- return $values[0].' '.$values[1].$important;
244
- }
245
- elseif($values[1] == $values[3])
246
- {
247
- return $values[0].' '.$values[1].' '.$values[2].$important;
248
- }
249
- break;
250
-
251
- case 3:
252
- if($values[0] == $values[1] && $values[0] == $values[2])
253
- {
254
- return $values[0].$important;
255
- }
256
- elseif($values[0] == $values[2])
257
- {
258
- return $values[0].' '.$values[1].$important;
259
- }
260
- break;
261
-
262
- case 2:
263
- if($values[0] == $values[1])
264
- {
265
- return $values[0].$important;
266
- }
267
- break;
268
- }
269
-
270
- return $value;
271
- }
272
-
273
- /**
274
- * Removes unnecessary whitespace in ! important
275
- * @param string $string
276
- * @return string
277
- * @access public
278
- * @version 1.1
279
- */
280
- function compress_important(&$string)
281
- {
282
- if(csstidy::is_important($string))
283
- {
284
- $string = csstidy::gvw_important($string) . '!important';
285
- }
286
- return $string;
287
- }
288
-
289
- /**
290
- * Color compression function. Converts all rgb() values to #-values and uses the short-form if possible. Also replaces 4 color names by #-values.
291
- * @param string $color
292
- * @return string
293
- * @version 1.1
294
- */
295
- function cut_color($color)
296
- {
297
- $replace_colors =& $GLOBALS['csstidy']['replace_colors'];
298
-
299
- // rgb(0,0,0) -> #000000 (or #000 in this case later)
300
- if(strtolower(substr($color,0,4)) == 'rgb(')
301
- {
302
- $color_tmp = substr($color,4,strlen($color)-5);
303
- $color_tmp = explode(',',$color_tmp);
304
- for ( $i = 0; $i < count($color_tmp); $i++ )
305
- {
306
- $color_tmp[$i] = trim ($color_tmp[$i]);
307
- if(substr($color_tmp[$i],-1) == '%')
308
- {
309
- $color_tmp[$i] = round((255*$color_tmp[$i])/100);
310
- }
311
- if($color_tmp[$i]>255) $color_tmp[$i] = 255;
312
- }
313
- $color = '#';
314
- for ($i = 0; $i < 3; $i++ )
315
- {
316
- if($color_tmp[$i]<16) {
317
- $color .= '0' . dechex($color_tmp[$i]);
318
- } else {
319
- $color .= dechex($color_tmp[$i]);
320
- }
321
- }
322
- }
323
-
324
- // Fix bad color names
325
- if(isset($replace_colors[strtolower($color)]))
326
- {
327
- $color = $replace_colors[strtolower($color)];
328
- }
329
-
330
- // #aabbcc -> #abc
331
- if(strlen($color) == 7)
332
- {
333
- $color_temp = strtolower($color);
334
- if($color_temp{0} == '#' && $color_temp{1} == $color_temp{2} && $color_temp{3} == $color_temp{4} && $color_temp{5} == $color_temp{6})
335
- {
336
- $color = '#'.$color{1}.$color{3}.$color{5};
337
- }
338
- }
339
-
340
- switch(strtolower($color))
341
- {
342
- /* color name -> hex code */
343
- case 'black': return '#000';
344
- case 'fuchsia': return '#F0F';
345
- case 'white': return '#FFF';
346
- case 'yellow': return '#FF0';
347
-
348
- /* hex code -> color name */
349
- case '#800000': return 'maroon';
350
- case '#ffa500': return 'orange';
351
- case '#808000': return 'olive';
352
- case '#800080': return 'purple';
353
- case '#008000': return 'green';
354
- case '#000080': return 'navy';
355
- case '#008080': return 'teal';
356
- case '#c0c0c0': return 'silver';
357
- case '#808080': return 'gray';
358
- case '#f00': return 'red';
359
- }
360
-
361
- return $color;
362
- }
363
-
364
- /**
365
- * Compresses numbers (ie. 1.0 becomes 1 or 1.100 becomes 1.1 )
366
- * @param string $subvalue
367
- * @return string
368
- * @version 1.2
369
- */
370
- function compress_numbers($subvalue)
371
- {
372
- $units =& $GLOBALS['csstidy']['units'];
373
- $unit_values =& $GLOBALS['csstidy']['unit_values'];
374
- $color_values =& $GLOBALS['csstidy']['color_values'];
375
-
376
- // for font:1em/1em sans-serif...;
377
- if($this->property == 'font')
378
- {
379
- $temp = explode('/',$subvalue);
380
- }
381
- else
382
- {
383
- $temp = array($subvalue);
384
- }
385
- for ($l = 0; $l < count($temp); $l++)
386
- {
387
- // continue if no numeric value
388
- if (!(strlen($temp[$l]) > 0 && ( is_numeric($temp[$l]{0}) || $temp[$l]{0} == '+' || $temp[$l]{0} == '-' ) ))
389
- {
390
- continue;
391
- }
392
-
393
- // Fix bad colors
394
- if (in_array($this->property, $color_values))
395
- {
396
- $temp[$l] = '#'.$temp[$l];
397
- }
398
-
399
- if (floatval($temp[$l]) == 0)
400
- {
401
- $temp[$l] = '0';
402
- }
403
- else
404
- {
405
- $unit_found = FALSE;
406
- for ($m = 0, $size_4 = count($units); $m < $size_4; $m++)
407
- {
408
- if (strpos(strtolower($temp[$l]),$units[$m]) !== FALSE)
409
- {
410
- $temp[$l] = floatval($temp[$l]).$units[$m];
411
- $unit_found = TRUE;
412
- break;
413
- }
414
- }
415
- if (!$unit_found && in_array($this->property,$unit_values,TRUE))
416
- {
417
- $temp[$l] = floatval($temp[$l]).'px';
418
- }
419
- else if (!$unit_found)
420
- {
421
- $temp[$l] = floatval($temp[$l]);
422
- }
423
- // Remove leading zero
424
- if (abs(floatval($temp[$l])) < 1) {
425
- if (floatval($temp[$l]) < 0) {
426
- $temp[$l] = '-' . substr($temp[$l], 2);
427
- } else {
428
- $temp[$l] = substr($temp[$l], 1);
429
- }
430
- }
431
- }
432
- }
433
-
434
- return ((count($temp) > 1) ? $temp[0].'/'.$temp[1] : $temp[0]);
435
- }
436
-
437
- /**
438
- * Merges selectors with same properties. Example: a{color:red} b{color:red} -> a,b{color:red}
439
- * Very basic and has at least one bug. Hopefully there is a replacement soon.
440
- * @param array $array
441
- * @return array
442
- * @access public
443
- * @version 1.2
444
- */
445
- function merge_selectors(&$array)
446
- {
447
- $css = $array;
448
- foreach($css as $key => $value)
449
- {
450
- if(!isset($css[$key]))
451
- {
452
- continue;
453
- }
454
- $newsel = '';
455
-
456
- // Check if properties also exist in another selector
457
- $keys = array();
458
- // PHP bug (?) without $css = $array; here
459
- foreach($css as $selector => $vali)
460
- {
461
- if($selector == $key)
462
- {
463
- continue;
464
- }
465
-
466
- if($css[$key] === $vali)
467
- {
468
- $keys[] = $selector;
469
- }
470
- }
471
-
472
- if(!empty($keys))
473
- {
474
- $newsel = $key;
475
- unset($css[$key]);
476
- foreach($keys as $selector)
477
- {
478
- unset($css[$selector]);
479
- $newsel .= ','.$selector;
480
- }
481
- $css[$newsel] = $value;
482
- }
483
- }
484
- $array = $css;
485
- }
486
-
487
- /**
488
- * Dissolves properties like padding:10px 10px 10px to padding-top:10px;padding-bottom:10px;...
489
- * @param string $property
490
- * @param string $value
491
- * @return array
492
- * @version 1.0
493
- * @see merge_4value_shorthands()
494
- */
495
- function dissolve_4value_shorthands($property,$value)
496
- {
497
- $shorthands =& $GLOBALS['csstidy']['shorthands'];
498
- if(!is_array($shorthands[$property]))
499
- {
500
- $return[$property] = $value;
501
- return $return;
502
- }
503
-
504
- $important = '';
505
- if(csstidy::is_important($value))
506
- {
507
- $value = csstidy::gvw_important($value);
508
- $important = '!important';
509
- }
510
- $values = explode(' ',$value);
511
-
512
-
513
- $return = array();
514
- if(count($values) == 4)
515
- {
516
- for($i=0;$i<4;$i++)
517
- {
518
- $return[$shorthands[$property][$i]] = $values[$i].$important;
519
- }
520
- }
521
- elseif(count($values) == 3)
522
- {
523
- $return[$shorthands[$property][0]] = $values[0].$important;
524
- $return[$shorthands[$property][1]] = $values[1].$important;
525
- $return[$shorthands[$property][3]] = $values[1].$important;
526
- $return[$shorthands[$property][2]] = $values[2].$important;
527
- }
528
- elseif(count($values) == 2)
529
- {
530
- for($i=0;$i<4;$i++)
531
- {
532
- $return[$shorthands[$property][$i]] = (($i % 2 != 0)) ? $values[1].$important : $values[0].$important;
533
- }
534
- }
535
- else
536
- {
537
- for($i=0;$i<4;$i++)
538
- {
539
- $return[$shorthands[$property][$i]] = $values[0].$important;
540
- }
541
- }
542
-
543
- return $return;
544
- }
545
-
546
- /**
547
- * Explodes a string as explode() does, however, not if $sep is escaped or within a string.
548
- * @param string $sep seperator
549
- * @param string $string
550
- * @return array
551
- * @version 1.0
552
- */
553
- function explode_ws($sep,$string)
554
- {
555
- $status = 'st';
556
- $to = '';
557
-
558
- $output = array();
559
- $num = 0;
560
- for($i = 0, $len = strlen($string);$i < $len; $i++)
561
- {
562
- switch($status)
563
- {
564
- case 'st':
565
- if($string{$i} == $sep && !csstidy::escaped($string,$i))
566
- {
567
- ++$num;
568
- }
569
- elseif($string{$i} == '"' || $string{$i} == '\'' || $string{$i} == '(' && !csstidy::escaped($string,$i))
570
- {
571
- $status = 'str';
572
- $to = ($string{$i} == '(') ? ')' : $string{$i};
573
- (isset($output[$num])) ? $output[$num] .= $string{$i} : $output[$num] = $string{$i};
574
- }
575
- else
576
- {
577
- (isset($output[$num])) ? $output[$num] .= $string{$i} : $output[$num] = $string{$i};
578
- }
579
- break;
580
-
581
- case 'str':
582
- if($string{$i} == $to && !csstidy::escaped($string,$i))
583
- {
584
- $status = 'st';
585
- }
586
- (isset($output[$num])) ? $output[$num] .= $string{$i} : $output[$num] = $string{$i};
587
- break;
588
- }
589
- }
590
-
591
- if(isset($output[0]))
592
- {
593
- return $output;
594
- }
595
- else
596
- {
597
- return array($output);
598
- }
599
- }
600
-
601
- /**
602
- * Merges Shorthand properties again, the opposite of dissolve_4value_shorthands()
603
- * @param array $array
604
- * @return array
605
- * @version 1.2
606
- * @see dissolve_4value_shorthands()
607
- */
608
- function merge_4value_shorthands($array)
609
- {
610
- $return = $array;
611
- $shorthands =& $GLOBALS['csstidy']['shorthands'];
612
-
613
- foreach($shorthands as $key => $value)
614
- {
615
- if(isset($array[$value[0]]) && isset($array[$value[1]])
616
- && isset($array[$value[2]]) && isset($array[$value[3]]) && $value !== 0)
617
- {
618
- $return[$key] = '';
619
-
620
- $important = '';
621
- for($i = 0; $i < 4; $i++)
622
- {
623
- $val = $array[$value[$i]];
624
- if(csstidy::is_important($val))
625
- {
626
- $important = '!important';
627
- $return[$key] .= csstidy::gvw_important($val).' ';
628
- }
629
- else
630
- {
631
- $return[$key] .= $val.' ';
632
- }
633
- unset($return[$value[$i]]);
634
- }
635
- $return[$key] = csstidy_optimise::shorthand(trim($return[$key].$important));
636
- }
637
- }
638
- return $return;
639
- }
640
-
641
- /**
642
- * Dissolve background property
643
- * @param string $str_value
644
- * @return array
645
- * @version 1.0
646
- * @see merge_bg()
647
- * @todo full CSS 3 compliance
648
- */
649
- function dissolve_short_bg($str_value)
650
- {
651
- $background_prop_default =& $GLOBALS['csstidy']['background_prop_default'];
652
- $repeat = array('repeat','repeat-x','repeat-y','no-repeat','space');
653
- $attachment = array('scroll','fixed','local');
654
- $clip = array('border','padding');
655
- $origin = array('border','padding','content');
656
- $pos = array('top','center','bottom','left','right');
657
- $important = '';
658
- $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);
659
-
660
- if(csstidy::is_important($str_value))
661
- {
662
- $important = ' !important';
663
- $str_value = csstidy::gvw_important($str_value);
664
- }
665
-
666
- $str_value = csstidy_optimise::explode_ws(',',$str_value);
667
- for($i = 0; $i < count($str_value); $i++)
668
- {
669
- $have['clip'] = FALSE; $have['pos'] = FALSE;
670
- $have['color'] = FALSE; $have['bg'] = FALSE;
671
-
672
- $str_value[$i] = csstidy_optimise::explode_ws(' ',trim($str_value[$i]));
673
-
674
- for($j = 0; $j < count($str_value[$i]); $j++)
675
- {
676
- if($have['bg'] === FALSE && (substr($str_value[$i][$j],0,4) == 'url(' || $str_value[$i][$j] === 'none'))
677
- {
678
- $return['background-image'] .= $str_value[$i][$j].',';
679
- $have['bg'] = TRUE;
680
- }
681
- elseif(in_array($str_value[$i][$j],$repeat,TRUE))
682
- {
683
- $return['background-repeat'] .= $str_value[$i][$j].',';
684
- }
685
- elseif(in_array($str_value[$i][$j],$attachment,TRUE))
686
- {
687
- $return['background-attachment'] .= $str_value[$i][$j].',';
688
- }
689
- elseif(in_array($str_value[$i][$j],$clip,TRUE) && !$have['clip'])
690
- {
691
- $return['background-clip'] .= $str_value[$i][$j].',';
692
- $have['clip'] = TRUE;
693
- }
694
- elseif(in_array($str_value[$i][$j],$origin,TRUE))
695
- {
696
- $return['background-origin'] .= $str_value[$i][$j].',';
697
- }
698
- elseif($str_value[$i][$j]{0} == '(')
699
- {
700
- $return['background-size'] .= substr($str_value[$i][$j],1,-1).',';
701
- }
702
- elseif(in_array($str_value[$i][$j],$pos,TRUE) || is_numeric($str_value[$i][$j]{0}) || $str_value[$i][$j]{0} === NULL)
703
- {
704
- $return['background-position'] .= $str_value[$i][$j];
705
- if(!$have['pos']) $return['background-position'] .= ' '; else $return['background-position'].= ',';
706
- $have['pos'] = TRUE;
707
- }
708
- elseif(!$have['color'])
709
- {
710
- $return['background-color'] .= $str_value[$i][$j].',';
711
- $have['color'] = TRUE;
712
- }
713
- }
714
- }
715
-
716
- foreach($background_prop_default as $bg_prop => $default_value)
717
- {
718
- if($return[$bg_prop] !== NULL)
719
- {
720
- $return[$bg_prop] = substr($return[$bg_prop],0,-1).$important;
721
- }
722
- else $return[$bg_prop] = $default_value.$important;
723
- }
724
- return $return;
725
- }
726
-
727
- /**
728
- * Merges all background properties
729
- * @param array $input_css
730
- * @return array
731
- * @version 1.0
732
- * @see dissolve_short_bg()
733
- * @todo full CSS 3 compliance
734
- */
735
- function merge_bg($input_css)
736
- {
737
- $background_prop_default =& $GLOBALS['csstidy']['background_prop_default'];
738
- // Max number of background images. CSS3 not yet fully implemented
739
- $number_of_values = @max(count(csstidy_optimise::explode_ws(',',$input_css['background-image'])),count(csstidy_optimise::explode_ws(',',$input_css['background-color'])),1);
740
- // Array with background images to check if BG image exists
741
- $bg_img_array = @csstidy_optimise::explode_ws(',',csstidy::gvw_important($input_css['background-image']));
742
- $new_bg_value = '';
743
- $important = '';
744
-
745
- for($i = 0; $i < $number_of_values; $i++)
746
- {
747
- foreach($background_prop_default as $bg_property => $default_value)
748
- {
749
- // Skip if property does not exist
750
- if(!isset($input_css[$bg_property]))
751
- {
752
- continue;
753
- }
754
-
755
- $cur_value = $input_css[$bg_property];
756
-
757
- // Skip some properties if there is no background image
758
- if((!isset($bg_img_array[$i]) || $bg_img_array[$i] === 'none')
759
- && ($bg_property === 'background-size' || $bg_property === 'background-position'
760
- || $bg_property === 'background-attachment' || $bg_property === 'background-repeat'))
761
- {
762
- continue;
763
- }
764
-
765
- // Remove !important
766
- if(csstidy::is_important($cur_value))
767
- {
768
- $important = ' !important';
769
- $cur_value = csstidy::gvw_important($cur_value);
770
- }
771
-
772
- // Do not add default values
773
- if($cur_value === $default_value)
774
- {
775
- continue;
776
- }
777
-
778
- $temp = csstidy_optimise::explode_ws(',',$cur_value);
779
-
780
- if(isset($temp[$i]))
781
- {
782
- if($bg_property == 'background-size')
783
- {
784
- $new_bg_value .= '('.$temp[$i].') ';
785
- }
786
- else
787
- {
788
- $new_bg_value .= $temp[$i].' ';
789
- }
790
- }
791
- }
792
-
793
- $new_bg_value = trim($new_bg_value);
794
- if($i != $number_of_values-1) $new_bg_value .= ',';
795
- }
796
-
797
- // Delete all background-properties
798
- foreach($background_prop_default as $bg_property => $default_value)
799
- {
800
- unset($input_css[$bg_property]);
801
- }
802
-
803
- // Add new background property
804
- if($new_bg_value !== '') $input_css['background'] = $new_bg_value.$important;
805
-
806
- return $input_css;
807
- }
808
- }
809
- ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
includes/csstidy-1.3/class.csstidy_print.php DELETED
@@ -1,349 +0,0 @@
1
- <?php
2
- /**
3
- * CSSTidy - CSS Parser and Optimiser
4
- *
5
- * CSS Printing class
6
- * This class prints CSS data generated by csstidy.
7
- *
8
- * This file is part of CSSTidy.
9
- *
10
- * CSSTidy is free software; you can redistribute it and/or modify
11
- * it under the terms of the GNU General Public License as published by
12
- * the Free Software Foundation; either version 2 of the License, or
13
- * (at your option) any later version.
14
- *
15
- * CSSTidy is distributed in the hope that it will be useful,
16
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
17
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18
- * GNU General Public License for more details.
19
- *
20
- * You should have received a copy of the GNU General Public License
21
- * along with CSSTidy; if not, write to the Free Software
22
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
23
- *
24
- * @license http://opensource.org/licenses/gpl-license.php GNU Public License
25
- * @package csstidy
26
- * @author Florian Schmitz (floele at gmail dot com) 2005-2006
27
- */
28
-
29
- /**
30
- * CSS Printing class
31
- *
32
- * This class prints CSS data generated by csstidy.
33
- *
34
- * @package csstidy
35
- * @author Florian Schmitz (floele at gmail dot com) 2005-2006
36
- * @version 1.0
37
- */
38
-
39
- class csstidy_print
40
- {
41
- /**
42
- * Saves the input CSS string
43
- * @var string
44
- * @access private
45
- */
46
- var $input_css = '';
47
-
48
- /**
49
- * Saves the formatted CSS string
50
- * @var string
51
- * @access public
52
- */
53
- var $output_css = '';
54
-
55
- /**
56
- * Saves the formatted CSS string (plain text)
57
- * @var string
58
- * @access public
59
- */
60
- var $output_css_plain = '';
61
-
62
- /**
63
- * Constructor
64
- * @param array $css contains the class csstidy
65
- * @access private
66
- * @version 1.0
67
- */
68
- function csstidy_print(&$css)
69
- {
70
- $this->parser =& $css;
71
- $this->css =& $css->css;
72
- $this->template =& $css->template;
73
- $this->tokens =& $css->tokens;
74
- $this->charset =& $css->charset;
75
- $this->import =& $css->import;
76
- $this->namespace =& $css->namespace;
77
- }
78
-
79
- /**
80
- * Resets output_css and output_css_plain (new css code)
81
- * @access private
82
- * @version 1.0
83
- */
84
- function _reset()
85
- {
86
- $this->output_css = '';
87
- $this->output_css_plain = '';
88
- }
89
-
90
- /**
91
- * Returns the CSS code as plain text
92
- * @return string
93
- * @access public
94
- * @version 1.0
95
- */
96
- function plain()
97
- {
98
- $this->_print(true);
99
- return $this->output_css_plain;
100
- }
101
-
102
- /**
103
- * Returns the formatted CSS code
104
- * @return string
105
- * @access public
106
- * @version 1.0
107
- */
108
- function formatted()
109
- {
110
- $this->_print(false);
111
- return $this->output_css;
112
- }
113
-
114
- /**
115
- * Returns the formatted CSS Code and saves it into $this->output_css and $this->output_css_plain
116
- * @param bool $plain plain text or not
117
- * @access private
118
- * @version 2.0
119
- */
120
- function _print($plain = false)
121
- {
122
- if ($this->output_css && $this->output_css_plain) {
123
- return;
124
- }
125
-
126
- $output = '';
127
- if (!$this->parser->get_cfg('preserve_css')) {
128
- $this->_convert_raw_css();
129
- }
130
-
131
- $template =& $this->template;
132
-
133
- if ($plain) {
134
- $template = array_map('strip_tags', $template);
135
- }
136
-
137
- if ($this->parser->get_cfg('timestamp')) {
138
- array_unshift($this->tokens, array(COMMENT, ' CSSTidy ' . $this->parser->version . ': ' . date('r') . ' '));
139
- }
140
-
141
- if (!empty($this->charset)) {
142
- $output .= $template[0].'@charset '.$template[5].$this->charset.$template[6];
143
- }
144
-
145
- if (!empty($this->import)) {
146
- for ($i = 0, $size = count($this->import); $i < $size; $i ++) {
147
- $output .= $template[0].'@import '.$template[5].$this->import[$i].$template[6];
148
- }
149
- }
150
-
151
- if (!empty($this->namespace)) {
152
- $output .= $template[0].'@namespace '.$template[5].$this->namespace.$template[6];
153
- }
154
-
155
- $output .= $template[13];
156
- $in_at_out = '';
157
- $out =& $output;
158
-
159
- foreach ($this->tokens as $key => $token)
160
- {
161
- switch ($token[0])
162
- {
163
- case AT_START:
164
- $out .= $template[0].$this->_htmlsp($token[1], $plain).$template[1];
165
- $out =& $in_at_out;
166
- break;
167
-
168
- case SEL_START:
169
- if($this->parser->get_cfg('lowercase_s')) $token[1] = strtolower($token[1]);
170
- $out .= ($token[1]{0} !== '@') ? $template[2].$this->_htmlsp($token[1], $plain) : $template[0].$this->_htmlsp($token[1], $plain);
171
- $out .= $template[3];
172
- break;
173
-
174
- case PROPERTY:
175
- if($this->parser->get_cfg('case_properties') == 2) $token[1] = strtoupper($token[1]);
176
- if($this->parser->get_cfg('case_properties') == 1) $token[1] = strtolower($token[1]);
177
- $out .= $template[4] . $this->_htmlsp($token[1], $plain) . ':' . $template[5];
178
- break;
179
-
180
- case VALUE:
181
- $out .= $this->_htmlsp($token[1], $plain);
182
- if($this->_seeknocomment($key, 1) == SEL_END && $this->parser->get_cfg('remove_last_;')) {
183
- $out .= str_replace(';', '', $template[6]);
184
- } else {
185
- $out .= $template[6];
186
- }
187
- break;
188
-
189
- case SEL_END:
190
- $out .= $template[7];
191
- if($this->_seeknocomment($key, 1) != AT_END) $out .= $template[8];
192
- break;
193
-
194
- case AT_END:
195
- $out =& $output;
196
- $out .= $template[10] . str_replace("\n", "\n" . $template[10], $in_at_out);
197
- $in_at_out = '';
198
- $out .= $template[9];
199
- break;
200
-
201
- case COMMENT:
202
- $out .= $template[11] . '/*' . $this->_htmlsp($token[1], $plain) . '*/' . $template[12];
203
- break;
204
- }
205
- }
206
-
207
- $output = trim($output);
208
-
209
- if (!$plain) {
210
- $this->output_css = $output;
211
- $this->_print(true);
212
- } else {
213
- $this->output_css_plain = $output;
214
- }
215
- }
216
-
217
- /**
218
- * Gets the next token type which is $move away from $key, excluding comments
219
- * @param integer $key current position
220
- * @param integer $move move this far
221
- * @return mixed a token type
222
- * @access private
223
- * @version 1.0
224
- */
225
- function _seeknocomment($key, $move) {
226
- $go = ($move > 0) ? 1 : -1;
227
- for ($i = $key + 1; abs($key-$i)-1 < abs($move); $i += $go) {
228
- if (!isset($this->tokens[$i])) {
229
- return;
230
- }
231
- if ($this->tokens[$i][0] == COMMENT) {
232
- $move += 1;
233
- continue;
234
- }
235
- return $this->tokens[$i][0];
236
- }
237
- }
238
-
239
- /**
240
- * Converts $this->css array to a raw array ($this->tokens)
241
- * @access private
242
- * @version 1.0
243
- */
244
- function _convert_raw_css()
245
- {
246
- $this->tokens = array();
247
-
248
- foreach ($this->css as $medium => $val)
249
- {
250
- if ($this->parser->get_cfg('sort_selectors')) ksort($val);
251
- if ($medium != DEFAULT_AT) {
252
- $this->parser->_add_token(AT_START, $medium, true);
253
- }
254
-
255
- foreach ($val as $selector => $vali)
256
- {
257
- if ($this->parser->get_cfg('sort_properties')) ksort($vali);
258
- $this->parser->_add_token(SEL_START, $selector, true);
259
-
260
- foreach ($vali as $property => $valj)
261
- {
262
- $this->parser->_add_token(PROPERTY, $property, true);
263
- $this->parser->_add_token(VALUE, $valj, true);
264
- }
265
-
266
- $this->parser->_add_token(SEL_END, $selector, true);
267
- }
268
-
269
- if ($medium != DEFAULT_AT) {
270
- $this->parser->_add_token(AT_END, $medium, true);
271
- }
272
- }
273
- }
274
-
275
- /**
276
- * Same as htmlspecialchars, only that chars are not replaced if $plain !== true. This makes print_code() cleaner.
277
- * @param string $string
278
- * @param bool $plain
279
- * @return string
280
- * @see csstidy_print::_print()
281
- * @access private
282
- * @version 1.0
283
- */
284
- function _htmlsp($string, $plain)
285
- {
286
- if (!$plain) {
287
- return htmlspecialchars($string);
288
- }
289
- return $string;
290
- }
291
-
292
- /**
293
- * Get compression ratio
294
- * @access public
295
- * @return float
296
- * @version 1.2
297
- */
298
- function get_ratio()
299
- {
300
- if (!$this->output_css_plain) {
301
- $this->formatted();
302
- }
303
- return round((strlen($this->input_css) - strlen($this->output_css_plain)) / strlen($this->input_css), 3) * 100;
304
- }
305
-
306
- /**
307
- * Get difference between the old and new code in bytes and prints the code if necessary.
308
- * @access public
309
- * @return string
310
- * @version 1.1
311
- */
312
- function get_diff()
313
- {
314
- if (!$this->output_css_plain) {
315
- $this->formatted();
316
- }
317
-
318
- $diff = strlen($this->output_css_plain) - strlen($this->input_css);
319
-
320
- if ($diff > 0) {
321
- return '+' . $diff;
322
- } elseif ($diff == 0) {
323
- return '+-' . $diff;
324
- }
325
-
326
- return $diff;
327
- }
328
-
329
- /**
330
- * Get the size of either input or output CSS in KB
331
- * @param string $loc default is "output"
332
- * @access public
333
- * @return integer
334
- * @version 1.0
335
- */
336
- function size($loc = 'output')
337
- {
338
- if ($loc == 'output' && !$this->output_css) {
339
- $this->formatted();
340
- }
341
-
342
- if ($loc == 'input') {
343
- return (strlen($this->input_css) / 1000);
344
- } else {
345
- return (strlen($this->output_css_plain) / 1000);
346
- }
347
- }
348
- }
349
- ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
includes/csstidy-1.3/data.inc.php DELETED
@@ -1,473 +0,0 @@
1
- <?php
2
- /**
3
- * Various CSS Data for CSSTidy
4
- *
5
- * This file is part of CSSTidy.
6
- *
7
- * CSSTidy is free software; you can redistribute it and/or modify
8
- * it under the terms of the GNU General Public License as published by
9
- * the Free Software Foundation; either version 2 of the License, or
10
- * (at your option) any later version.
11
- *
12
- * CSSTidy is distributed in the hope that it will be useful,
13
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
14
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15
- * GNU General Public License for more details.
16
- *
17
- * You should have received a copy of the GNU General Public License
18
- * along with CSSTidy; if not, write to the Free Software
19
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
20
- *
21
- * @license http://opensource.org/licenses/gpl-license.php GNU Public License
22
- * @package csstidy
23
- * @author Florian Schmitz (floele at gmail dot com) 2005
24
- */
25
-
26
- define('AT_START', 1);
27
- define('AT_END', 2);
28
- define('SEL_START', 3);
29
- define('SEL_END', 4);
30
- define('PROPERTY', 5);
31
- define('VALUE', 6);
32
- define('COMMENT', 7);
33
- define('DEFAULT_AT', 41);
34
-
35
- /**
36
- * All whitespace allowed in CSS
37
- *
38
- * @global array $GLOBALS['csstidy']['whitespace']
39
- * @version 1.0
40
- */
41
- $GLOBALS['csstidy']['whitespace'] = array(' ',"\n","\t","\r","\x0B");
42
-
43
- /**
44
- * All CSS tokens used by csstidy
45
- *
46
- * @global string $GLOBALS['csstidy']['tokens']
47
- * @version 1.0
48
- */
49
- $GLOBALS['csstidy']['tokens'] = '/@}{;:=\'"(,\\!$%&)*+.<>?[]^`|~';
50
-
51
- /**
52
- * All CSS units (CSS 3 units included)
53
- *
54
- * @see compress_numbers()
55
- * @global array $GLOBALS['csstidy']['units']
56
- * @version 1.0
57
- */
58
- $GLOBALS['csstidy']['units'] = array('in','cm','mm','pt','pc','px','rem','em','%','ex','gd','vw','vh','vm','deg','grad','rad','ms','s','khz','hz');
59
-
60
- /**
61
- * Available at-rules
62
- *
63
- * @global array $GLOBALS['csstidy']['at_rules']
64
- * @version 1.0
65
- */
66
- $GLOBALS['csstidy']['at_rules'] = array('page' => 'is','font-face' => 'is','charset' => 'iv', 'import' => 'iv','namespace' => 'iv','media' => 'at');
67
-
68
- /**
69
- * Properties that need a value with unit
70
- *
71
- * @todo CSS3 properties
72
- * @see compress_numbers();
73
- * @global array $GLOBALS['csstidy']['unit_values']
74
- * @version 1.2
75
- */
76
- $GLOBALS['csstidy']['unit_values'] = array ('background', 'background-position', 'border', 'border-top', 'border-right', 'border-bottom', 'border-left', 'border-width',
77
- 'border-top-width', 'border-right-width', 'border-left-width', 'border-bottom-width', 'bottom', 'border-spacing', 'font-size',
78
- 'height', 'left', 'margin', 'margin-top', 'margin-right', 'margin-bottom', 'margin-left', 'max-height', 'max-width',
79
- 'min-height', 'min-width', 'outline-width', 'padding', 'padding-top', 'padding-right', 'padding-bottom', 'padding-left',
80
- 'position', 'right', 'top', 'text-indent', 'letter-spacing', 'word-spacing', 'width');
81
-
82
- /**
83
- * Properties that allow <color> as value
84
- *
85
- * @todo CSS3 properties
86
- * @see compress_numbers();
87
- * @global array $GLOBALS['csstidy']['color_values']
88
- * @version 1.0
89
- */
90
- $GLOBALS['csstidy']['color_values'] = array();
91
- $GLOBALS['csstidy']['color_values'][] = 'background-color';
92
- $GLOBALS['csstidy']['color_values'][] = 'border-color';
93
- $GLOBALS['csstidy']['color_values'][] = 'border-top-color';
94
- $GLOBALS['csstidy']['color_values'][] = 'border-right-color';
95
- $GLOBALS['csstidy']['color_values'][] = 'border-bottom-color';
96
- $GLOBALS['csstidy']['color_values'][] = 'border-left-color';
97
- $GLOBALS['csstidy']['color_values'][] = 'color';
98
- $GLOBALS['csstidy']['color_values'][] = 'outline-color';
99
-
100
-
101
- /**
102
- * Default values for the background properties
103
- *
104
- * @todo Possibly property names will change during CSS3 development
105
- * @global array $GLOBALS['csstidy']['background_prop_default']
106
- * @see dissolve_short_bg()
107
- * @see merge_bg()
108
- * @version 1.0
109
- */
110
- $GLOBALS['csstidy']['background_prop_default'] = array();
111
- $GLOBALS['csstidy']['background_prop_default']['background-image'] = 'none';
112
- $GLOBALS['csstidy']['background_prop_default']['background-size'] = 'auto';
113
- $GLOBALS['csstidy']['background_prop_default']['background-repeat'] = 'repeat';
114
- $GLOBALS['csstidy']['background_prop_default']['background-position'] = '0 0';
115
- $GLOBALS['csstidy']['background_prop_default']['background-attachment'] = 'scroll';
116
- $GLOBALS['csstidy']['background_prop_default']['background-clip'] = 'border';
117
- $GLOBALS['csstidy']['background_prop_default']['background-origin'] = 'padding';
118
- $GLOBALS['csstidy']['background_prop_default']['background-color'] = 'transparent';
119
-
120
- /**
121
- * A list of non-W3C color names which get replaced by their hex-codes
122
- *
123
- * @global array $GLOBALS['csstidy']['replace_colors']
124
- * @see cut_color()
125
- * @version 1.0
126
- */
127
- $GLOBALS['csstidy']['replace_colors'] = array();
128
- $GLOBALS['csstidy']['replace_colors']['aliceblue'] = '#F0F8FF';
129
- $GLOBALS['csstidy']['replace_colors']['antiquewhite'] = '#FAEBD7';
130
- $GLOBALS['csstidy']['replace_colors']['aquamarine'] = '#7FFFD4';
131
- $GLOBALS['csstidy']['replace_colors']['azure'] = '#F0FFFF';
132
- $GLOBALS['csstidy']['replace_colors']['beige'] = '#F5F5DC';
133
- $GLOBALS['csstidy']['replace_colors']['bisque'] = '#FFE4C4';
134
- $GLOBALS['csstidy']['replace_colors']['blanchedalmond'] = '#FFEBCD';
135
- $GLOBALS['csstidy']['replace_colors']['blueviolet'] = '#8A2BE2';
136
- $GLOBALS['csstidy']['replace_colors']['brown'] = '#A52A2A';
137
- $GLOBALS['csstidy']['replace_colors']['burlywood'] = '#DEB887';
138
- $GLOBALS['csstidy']['replace_colors']['cadetblue'] = '#5F9EA0';
139
- $GLOBALS['csstidy']['replace_colors']['chartreuse'] = '#7FFF00';
140
- $GLOBALS['csstidy']['replace_colors']['chocolate'] = '#D2691E';
141
- $GLOBALS['csstidy']['replace_colors']['coral'] = '#FF7F50';
142
- $GLOBALS['csstidy']['replace_colors']['cornflowerblue'] = '#6495ED';
143
- $GLOBALS['csstidy']['replace_colors']['cornsilk'] = '#FFF8DC';
144
- $GLOBALS['csstidy']['replace_colors']['crimson'] = '#DC143C';
145
- $GLOBALS['csstidy']['replace_colors']['cyan'] = '#00FFFF';
146
- $GLOBALS['csstidy']['replace_colors']['darkblue'] = '#00008B';
147
- $GLOBALS['csstidy']['replace_colors']['darkcyan'] = '#008B8B';
148
- $GLOBALS['csstidy']['replace_colors']['darkgoldenrod'] = '#B8860B';
149
- $GLOBALS['csstidy']['replace_colors']['darkgray'] = '#A9A9A9';
150
- $GLOBALS['csstidy']['replace_colors']['darkgreen'] = '#006400';
151
- $GLOBALS['csstidy']['replace_colors']['darkkhaki'] = '#BDB76B';
152
- $GLOBALS['csstidy']['replace_colors']['darkmagenta'] = '#8B008B';
153
- $GLOBALS['csstidy']['replace_colors']['darkolivegreen'] = '#556B2F';
154
- $GLOBALS['csstidy']['replace_colors']['darkorange'] = '#FF8C00';
155
- $GLOBALS['csstidy']['replace_colors']['darkorchid'] = '#9932CC';
156
- $GLOBALS['csstidy']['replace_colors']['darkred'] = '#8B0000';
157
- $GLOBALS['csstidy']['replace_colors']['darksalmon'] = '#E9967A';
158
- $GLOBALS['csstidy']['replace_colors']['darkseagreen'] = '#8FBC8F';
159
- $GLOBALS['csstidy']['replace_colors']['darkslateblue'] = '#483D8B';
160
- $GLOBALS['csstidy']['replace_colors']['darkslategray'] = '#2F4F4F';
161
- $GLOBALS['csstidy']['replace_colors']['darkturquoise'] = '#00CED1';
162
- $GLOBALS['csstidy']['replace_colors']['darkviolet'] = '#9400D3';
163
- $GLOBALS['csstidy']['replace_colors']['deeppink'] = '#FF1493';
164
- $GLOBALS['csstidy']['replace_colors']['deepskyblue'] = '#00BFFF';
165
- $GLOBALS['csstidy']['replace_colors']['dimgray'] = '#696969';
166
- $GLOBALS['csstidy']['replace_colors']['dodgerblue'] = '#1E90FF';
167
- $GLOBALS['csstidy']['replace_colors']['feldspar'] = '#D19275';
168
- $GLOBALS['csstidy']['replace_colors']['firebrick'] = '#B22222';
169
- $GLOBALS['csstidy']['replace_colors']['floralwhite'] = '#FFFAF0';
170
- $GLOBALS['csstidy']['replace_colors']['forestgreen'] = '#228B22';
171
- $GLOBALS['csstidy']['replace_colors']['gainsboro'] = '#DCDCDC';
172
- $GLOBALS['csstidy']['replace_colors']['ghostwhite'] = '#F8F8FF';
173
- $GLOBALS['csstidy']['replace_colors']['gold'] = '#FFD700';
174
- $GLOBALS['csstidy']['replace_colors']['goldenrod'] = '#DAA520';
175
- $GLOBALS['csstidy']['replace_colors']['greenyellow'] = '#ADFF2F';
176
- $GLOBALS['csstidy']['replace_colors']['honeydew'] = '#F0FFF0';
177
- $GLOBALS['csstidy']['replace_colors']['hotpink'] = '#FF69B4';
178
- $GLOBALS['csstidy']['replace_colors']['indianred'] = '#CD5C5C';
179
- $GLOBALS['csstidy']['replace_colors']['indigo'] = '#4B0082';
180
- $GLOBALS['csstidy']['replace_colors']['ivory'] = '#FFFFF0';
181
- $GLOBALS['csstidy']['replace_colors']['khaki'] = '#F0E68C';
182
- $GLOBALS['csstidy']['replace_colors']['lavender'] = '#E6E6FA';
183
- $GLOBALS['csstidy']['replace_colors']['lavenderblush'] = '#FFF0F5';
184
- $GLOBALS['csstidy']['replace_colors']['lawngreen'] = '#7CFC00';
185
- $GLOBALS['csstidy']['replace_colors']['lemonchiffon'] = '#FFFACD';
186
- $GLOBALS['csstidy']['replace_colors']['lightblue'] = '#ADD8E6';
187
- $GLOBALS['csstidy']['replace_colors']['lightcoral'] = '#F08080';
188
- $GLOBALS['csstidy']['replace_colors']['lightcyan'] = '#E0FFFF';
189
- $GLOBALS['csstidy']['replace_colors']['lightgoldenrodyellow'] = '#FAFAD2';
190
- $GLOBALS['csstidy']['replace_colors']['lightgrey'] = '#D3D3D3';
191
- $GLOBALS['csstidy']['replace_colors']['lightgreen'] = '#90EE90';
192
- $GLOBALS['csstidy']['replace_colors']['lightpink'] = '#FFB6C1';
193
- $GLOBALS['csstidy']['replace_colors']['lightsalmon'] = '#FFA07A';
194
- $GLOBALS['csstidy']['replace_colors']['lightseagreen'] = '#20B2AA';
195
- $GLOBALS['csstidy']['replace_colors']['lightskyblue'] = '#87CEFA';
196
- $GLOBALS['csstidy']['replace_colors']['lightslateblue'] = '#8470FF';
197
- $GLOBALS['csstidy']['replace_colors']['lightslategray'] = '#778899';
198
- $GLOBALS['csstidy']['replace_colors']['lightsteelblue'] = '#B0C4DE';
199
- $GLOBALS['csstidy']['replace_colors']['lightyellow'] = '#FFFFE0';
200
- $GLOBALS['csstidy']['replace_colors']['limegreen'] = '#32CD32';
201
- $GLOBALS['csstidy']['replace_colors']['linen'] = '#FAF0E6';
202
- $GLOBALS['csstidy']['replace_colors']['magenta'] = '#FF00FF';
203
- $GLOBALS['csstidy']['replace_colors']['mediumaquamarine'] = '#66CDAA';
204
- $GLOBALS['csstidy']['replace_colors']['mediumblue'] = '#0000CD';
205
- $GLOBALS['csstidy']['replace_colors']['mediumorchid'] = '#BA55D3';
206
- $GLOBALS['csstidy']['replace_colors']['mediumpurple'] = '#9370D8';
207
- $GLOBALS['csstidy']['replace_colors']['mediumseagreen'] = '#3CB371';
208
- $GLOBALS['csstidy']['replace_colors']['mediumslateblue'] = '#7B68EE';
209
- $GLOBALS['csstidy']['replace_colors']['mediumspringgreen'] = '#00FA9A';
210
- $GLOBALS['csstidy']['replace_colors']['mediumturquoise'] = '#48D1CC';
211
- $GLOBALS['csstidy']['replace_colors']['mediumvioletred'] = '#C71585';
212
- $GLOBALS['csstidy']['replace_colors']['midnightblue'] = '#191970';
213
- $GLOBALS['csstidy']['replace_colors']['mintcream'] = '#F5FFFA';
214
- $GLOBALS['csstidy']['replace_colors']['mistyrose'] = '#FFE4E1';
215
- $GLOBALS['csstidy']['replace_colors']['moccasin'] = '#FFE4B5';
216
- $GLOBALS['csstidy']['replace_colors']['navajowhite'] = '#FFDEAD';
217
- $GLOBALS['csstidy']['replace_colors']['oldlace'] = '#FDF5E6';
218
- $GLOBALS['csstidy']['replace_colors']['olivedrab'] = '#6B8E23';
219
- $GLOBALS['csstidy']['replace_colors']['orangered'] = '#FF4500';
220
- $GLOBALS['csstidy']['replace_colors']['orchid'] = '#DA70D6';
221
- $GLOBALS['csstidy']['replace_colors']['palegoldenrod'] = '#EEE8AA';
222
- $GLOBALS['csstidy']['replace_colors']['palegreen'] = '#98FB98';
223
- $GLOBALS['csstidy']['replace_colors']['paleturquoise'] = '#AFEEEE';
224
- $GLOBALS['csstidy']['replace_colors']['palevioletred'] = '#D87093';
225
- $GLOBALS['csstidy']['replace_colors']['papayawhip'] = '#FFEFD5';
226
- $GLOBALS['csstidy']['replace_colors']['peachpuff'] = '#FFDAB9';
227
- $GLOBALS['csstidy']['replace_colors']['peru'] = '#CD853F';
228
- $GLOBALS['csstidy']['replace_colors']['pink'] = '#FFC0CB';
229
- $GLOBALS['csstidy']['replace_colors']['plum'] = '#DDA0DD';
230
- $GLOBALS['csstidy']['replace_colors']['powderblue'] = '#B0E0E6';
231
- $GLOBALS['csstidy']['replace_colors']['rosybrown'] = '#BC8F8F';
232
- $GLOBALS['csstidy']['replace_colors']['royalblue'] = '#4169E1';
233
- $GLOBALS['csstidy']['replace_colors']['saddlebrown'] = '#8B4513';
234
- $GLOBALS['csstidy']['replace_colors']['salmon'] = '#FA8072';
235
- $GLOBALS['csstidy']['replace_colors']['sandybrown'] = '#F4A460';
236
- $GLOBALS['csstidy']['replace_colors']['seagreen'] = '#2E8B57';
237
- $GLOBALS['csstidy']['replace_colors']['seashell'] = '#FFF5EE';
238
- $GLOBALS['csstidy']['replace_colors']['sienna'] = '#A0522D';
239
- $GLOBALS['csstidy']['replace_colors']['skyblue'] = '#87CEEB';
240
- $GLOBALS['csstidy']['replace_colors']['slateblue'] = '#6A5ACD';
241
- $GLOBALS['csstidy']['replace_colors']['slategray'] = '#708090';
242
- $GLOBALS['csstidy']['replace_colors']['snow'] = '#FFFAFA';
243
- $GLOBALS['csstidy']['replace_colors']['springgreen'] = '#00FF7F';
244
- $GLOBALS['csstidy']['replace_colors']['steelblue'] = '#4682B4';
245
- $GLOBALS['csstidy']['replace_colors']['tan'] = '#D2B48C';
246
- $GLOBALS['csstidy']['replace_colors']['thistle'] = '#D8BFD8';
247
- $GLOBALS['csstidy']['replace_colors']['tomato'] = '#FF6347';
248
- $GLOBALS['csstidy']['replace_colors']['turquoise'] = '#40E0D0';
249
- $GLOBALS['csstidy']['replace_colors']['violet'] = '#EE82EE';
250
- $GLOBALS['csstidy']['replace_colors']['violetred'] = '#D02090';
251
- $GLOBALS['csstidy']['replace_colors']['wheat'] = '#F5DEB3';
252
- $GLOBALS['csstidy']['replace_colors']['whitesmoke'] = '#F5F5F5';
253
- $GLOBALS['csstidy']['replace_colors']['yellowgreen'] = '#9ACD32';
254
-
255
-
256
- /**
257
- * A list of all shorthand properties that are devided into four properties and/or have four subvalues
258
- *
259
- * @global array $GLOBALS['csstidy']['shorthands']
260
- * @todo Are there new ones in CSS3?
261
- * @see dissolve_4value_shorthands()
262
- * @see merge_4value_shorthands()
263
- * @version 1.0
264
- */
265
- $GLOBALS['csstidy']['shorthands'] = array();
266
- $GLOBALS['csstidy']['shorthands']['border-color'] = array('border-top-color','border-right-color','border-bottom-color','border-left-color');
267
- $GLOBALS['csstidy']['shorthands']['border-style'] = array('border-top-style','border-right-style','border-bottom-style','border-left-style');
268
- $GLOBALS['csstidy']['shorthands']['border-width'] = array('border-top-width','border-right-width','border-bottom-width','border-left-width');
269
- $GLOBALS['csstidy']['shorthands']['margin'] = array('margin-top','margin-right','margin-bottom','margin-left');
270
- $GLOBALS['csstidy']['shorthands']['padding'] = array('padding-top','padding-right','padding-bottom','padding-left');
271
- $GLOBALS['csstidy']['shorthands']['-moz-border-radius'] = 0;
272
-
273
- /**
274
- * All CSS Properties. Needed for csstidy::property_is_next()
275
- *
276
- * @global array $GLOBALS['csstidy']['all_properties']
277
- * @todo Add CSS3 properties
278
- * @version 1.0
279
- * @see csstidy::property_is_next()
280
- */
281
- $GLOBALS['csstidy']['all_properties'] = array();
282
- $GLOBALS['csstidy']['all_properties']['background'] = 'CSS1.0,CSS2.0,CSS2.1';
283
- $GLOBALS['csstidy']['all_properties']['background-color'] = 'CSS1.0,CSS2.0,CSS2.1';
284
- $GLOBALS['csstidy']['all_properties']['background-image'] = 'CSS1.0,CSS2.0,CSS2.1';
285
- $GLOBALS['csstidy']['all_properties']['background-repeat'] = 'CSS1.0,CSS2.0,CSS2.1';
286
- $GLOBALS['csstidy']['all_properties']['background-attachment'] = 'CSS1.0,CSS2.0,CSS2.1';
287
- $GLOBALS['csstidy']['all_properties']['background-position'] = 'CSS1.0,CSS2.0,CSS2.1';
288
- $GLOBALS['csstidy']['all_properties']['border'] = 'CSS1.0,CSS2.0,CSS2.1';
289
- $GLOBALS['csstidy']['all_properties']['border-top'] = 'CSS1.0,CSS2.0,CSS2.1';
290
- $GLOBALS['csstidy']['all_properties']['border-right'] = 'CSS1.0,CSS2.0,CSS2.1';
291
- $GLOBALS['csstidy']['all_properties']['border-bottom'] = 'CSS1.0,CSS2.0,CSS2.1';
292
- $GLOBALS['csstidy']['all_properties']['border-left'] = 'CSS1.0,CSS2.0,CSS2.1';
293
- $GLOBALS['csstidy']['all_properties']['border-color'] = 'CSS1.0,CSS2.0,CSS2.1';
294
- $GLOBALS['csstidy']['all_properties']['border-top-color'] = 'CSS2.0,CSS2.1';
295
- $GLOBALS['csstidy']['all_properties']['border-bottom-color'] = 'CSS2.0,CSS2.1';
296
- $GLOBALS['csstidy']['all_properties']['border-left-color'] = 'CSS2.0,CSS2.1';
297
- $GLOBALS['csstidy']['all_properties']['border-right-color'] = 'CSS2.0,CSS2.1';
298
- $GLOBALS['csstidy']['all_properties']['border-style'] = 'CSS1.0,CSS2.0,CSS2.1';
299
- $GLOBALS['csstidy']['all_properties']['border-top-style'] = 'CSS2.0,CSS2.1';
300
- $GLOBALS['csstidy']['all_properties']['border-right-style'] = 'CSS2.0,CSS2.1';
301
- $GLOBALS['csstidy']['all_properties']['border-left-style'] = 'CSS2.0,CSS2.1';
302
- $GLOBALS['csstidy']['all_properties']['border-bottom-style'] = 'CSS2.0,CSS2.1';
303
- $GLOBALS['csstidy']['all_properties']['border-width'] = 'CSS1.0,CSS2.0,CSS2.1';
304
- $GLOBALS['csstidy']['all_properties']['border-top-width'] = 'CSS1.0,CSS2.0,CSS2.1';
305
- $GLOBALS['csstidy']['all_properties']['border-right-width'] = 'CSS1.0,CSS2.0,CSS2.1';
306
- $GLOBALS['csstidy']['all_properties']['border-left-width'] = 'CSS1.0,CSS2.0,CSS2.1';
307
- $GLOBALS['csstidy']['all_properties']['border-bottom-width'] = 'CSS1.0,CSS2.0,CSS2.1';
308
- $GLOBALS['csstidy']['all_properties']['border-collapse'] = 'CSS2.0,CSS2.1';
309
- $GLOBALS['csstidy']['all_properties']['border-spacing'] = 'CSS2.0,CSS2.1';
310
- $GLOBALS['csstidy']['all_properties']['bottom'] = 'CSS2.0,CSS2.1';
311
- $GLOBALS['csstidy']['all_properties']['caption-side'] = 'CSS2.0,CSS2.1';
312
- $GLOBALS['csstidy']['all_properties']['content'] = 'CSS2.0,CSS2.1';
313
- $GLOBALS['csstidy']['all_properties']['clear'] = 'CSS1.0,CSS2.0,CSS2.1';
314
- $GLOBALS['csstidy']['all_properties']['clip'] = 'CSS1.0,CSS2.0,CSS2.1';
315
- $GLOBALS['csstidy']['all_properties']['color'] = 'CSS1.0,CSS2.0,CSS2.1';
316
- $GLOBALS['csstidy']['all_properties']['counter-reset'] = 'CSS2.0,CSS2.1';
317
- $GLOBALS['csstidy']['all_properties']['counter-increment'] = 'CSS2.0,CSS2.1';
318
- $GLOBALS['csstidy']['all_properties']['cursor'] = 'CSS2.0,CSS2.1';
319
- $GLOBALS['csstidy']['all_properties']['empty-cells'] = 'CSS2.0,CSS2.1';
320
- $GLOBALS['csstidy']['all_properties']['display'] = 'CSS1.0,CSS2.0,CSS2.1';
321
- $GLOBALS['csstidy']['all_properties']['direction'] = 'CSS2.0,CSS2.1';
322
- $GLOBALS['csstidy']['all_properties']['float'] = 'CSS1.0,CSS2.0,CSS2.1';
323
- $GLOBALS['csstidy']['all_properties']['font'] = 'CSS1.0,CSS2.0,CSS2.1';
324
- $GLOBALS['csstidy']['all_properties']['font-family'] = 'CSS1.0,CSS2.0,CSS2.1';
325
- $GLOBALS['csstidy']['all_properties']['font-style'] = 'CSS1.0,CSS2.0,CSS2.1';
326
- $GLOBALS['csstidy']['all_properties']['font-variant'] = 'CSS1.0,CSS2.0,CSS2.1';
327
- $GLOBALS['csstidy']['all_properties']['font-weight'] = 'CSS1.0,CSS2.0,CSS2.1';
328
- $GLOBALS['csstidy']['all_properties']['font-stretch'] = 'CSS2.0';
329
- $GLOBALS['csstidy']['all_properties']['font-size-adjust'] = 'CSS2.0';
330
- $GLOBALS['csstidy']['all_properties']['font-size'] = 'CSS1.0,CSS2.0,CSS2.1';
331
- $GLOBALS['csstidy']['all_properties']['height'] = 'CSS1.0,CSS2.0,CSS2.1';
332
- $GLOBALS['csstidy']['all_properties']['left'] = 'CSS1.0,CSS2.0,CSS2.1';
333
- $GLOBALS['csstidy']['all_properties']['line-height'] = 'CSS1.0,CSS2.0,CSS2.1';
334
- $GLOBALS['csstidy']['all_properties']['list-style'] = 'CSS1.0,CSS2.0,CSS2.1';
335
- $GLOBALS['csstidy']['all_properties']['list-style-type'] = 'CSS1.0,CSS2.0,CSS2.1';
336
- $GLOBALS['csstidy']['all_properties']['list-style-image'] = 'CSS1.0,CSS2.0,CSS2.1';
337
- $GLOBALS['csstidy']['all_properties']['list-style-position'] = 'CSS1.0,CSS2.0,CSS2.1';
338
- $GLOBALS['csstidy']['all_properties']['margin'] = 'CSS1.0,CSS2.0,CSS2.1';
339
- $GLOBALS['csstidy']['all_properties']['margin-top'] = 'CSS1.0,CSS2.0,CSS2.1';
340
- $GLOBALS['csstidy']['all_properties']['margin-right'] = 'CSS1.0,CSS2.0,CSS2.1';
341
- $GLOBALS['csstidy']['all_properties']['margin-bottom'] = 'CSS1.0,CSS2.0,CSS2.1';
342
- $GLOBALS['csstidy']['all_properties']['margin-left'] = 'CSS1.0,CSS2.0,CSS2.1';
343
- $GLOBALS['csstidy']['all_properties']['marks'] = 'CSS1.0,CSS2.0';
344
- $GLOBALS['csstidy']['all_properties']['marker-offset'] = 'CSS2.0';
345
- $GLOBALS['csstidy']['all_properties']['max-height'] = 'CSS2.0,CSS2.1';
346
- $GLOBALS['csstidy']['all_properties']['max-width'] = 'CSS2.0,CSS2.1';
347
- $GLOBALS['csstidy']['all_properties']['min-height'] = 'CSS2.0,CSS2.1';
348
- $GLOBALS['csstidy']['all_properties']['min-width'] = 'CSS2.0,CSS2.1';
349
- $GLOBALS['csstidy']['all_properties']['overflow'] = 'CSS1.0,CSS2.0,CSS2.1';
350
- $GLOBALS['csstidy']['all_properties']['orphans'] = 'CSS2.0,CSS2.1';
351
- $GLOBALS['csstidy']['all_properties']['outline'] = 'CSS2.0,CSS2.1';
352
- $GLOBALS['csstidy']['all_properties']['outline-width'] = 'CSS2.0,CSS2.1';
353
- $GLOBALS['csstidy']['all_properties']['outline-style'] = 'CSS2.0,CSS2.1';
354
- $GLOBALS['csstidy']['all_properties']['outline-color'] = 'CSS2.0,CSS2.1';
355
- $GLOBALS['csstidy']['all_properties']['padding'] = 'CSS1.0,CSS2.0,CSS2.1';
356
- $GLOBALS['csstidy']['all_properties']['padding-top'] = 'CSS1.0,CSS2.0,CSS2.1';
357
- $GLOBALS['csstidy']['all_properties']['padding-right'] = 'CSS1.0,CSS2.0,CSS2.1';
358
- $GLOBALS['csstidy']['all_properties']['padding-bottom'] = 'CSS1.0,CSS2.0,CSS2.1';
359
- $GLOBALS['csstidy']['all_properties']['padding-left'] = 'CSS1.0,CSS2.0,CSS2.1';
360
- $GLOBALS['csstidy']['all_properties']['page-break-before'] = 'CSS1.0,CSS2.0,CSS2.1';
361
- $GLOBALS['csstidy']['all_properties']['page-break-after'] = 'CSS1.0,CSS2.0,CSS2.1';
362
- $GLOBALS['csstidy']['all_properties']['page-break-inside'] = 'CSS2.0,CSS2.1';
363
- $GLOBALS['csstidy']['all_properties']['page'] = 'CSS2.0';
364
- $GLOBALS['csstidy']['all_properties']['position'] = 'CSS1.0,CSS2.0,CSS2.1';
365
- $GLOBALS['csstidy']['all_properties']['quotes'] = 'CSS2.0,CSS2.1';
366
- $GLOBALS['csstidy']['all_properties']['right'] = 'CSS2.0,CSS2.1';
367
- $GLOBALS['csstidy']['all_properties']['size'] = 'CSS1.0,CSS2.0';
368
- $GLOBALS['csstidy']['all_properties']['speak-header'] = 'CSS2.0,CSS2.1';
369
- $GLOBALS['csstidy']['all_properties']['table-layout'] = 'CSS2.0,CSS2.1';
370
- $GLOBALS['csstidy']['all_properties']['top'] = 'CSS1.0,CSS2.0,CSS2.1';
371
- $GLOBALS['csstidy']['all_properties']['text-indent'] = 'CSS1.0,CSS2.0,CSS2.1';
372
- $GLOBALS['csstidy']['all_properties']['text-align'] = 'CSS1.0,CSS2.0,CSS2.1';
373
- $GLOBALS['csstidy']['all_properties']['text-decoration'] = 'CSS1.0,CSS2.0,CSS2.1';
374
- $GLOBALS['csstidy']['all_properties']['text-shadow'] = 'CSS2.0';
375
- $GLOBALS['csstidy']['all_properties']['letter-spacing'] = 'CSS1.0,CSS2.0,CSS2.1';
376
- $GLOBALS['csstidy']['all_properties']['word-spacing'] = 'CSS1.0,CSS2.0,CSS2.1';
377
- $GLOBALS['csstidy']['all_properties']['text-transform'] = 'CSS1.0,CSS2.0,CSS2.1';
378
- $GLOBALS['csstidy']['all_properties']['white-space'] = 'CSS1.0,CSS2.0,CSS2.1';
379
- $GLOBALS['csstidy']['all_properties']['unicode-bidi'] = 'CSS2.0,CSS2.1';
380
- $GLOBALS['csstidy']['all_properties']['vertical-align'] = 'CSS1.0,CSS2.0,CSS2.1';
381
- $GLOBALS['csstidy']['all_properties']['visibility'] = 'CSS1.0,CSS2.0,CSS2.1';
382
- $GLOBALS['csstidy']['all_properties']['width'] = 'CSS1.0,CSS2.0,CSS2.1';
383
- $GLOBALS['csstidy']['all_properties']['widows'] = 'CSS2.0,CSS2.1';
384
- $GLOBALS['csstidy']['all_properties']['z-index'] = 'CSS1.0,CSS2.0,CSS2.1';
385
- /* Speech */
386
- $GLOBALS['csstidy']['all_properties']['volume'] = 'CSS2.0,CSS2.1';
387
- $GLOBALS['csstidy']['all_properties']['speak'] = 'CSS2.0,CSS2.1';
388
- $GLOBALS['csstidy']['all_properties']['pause'] = 'CSS2.0,CSS2.1';
389
- $GLOBALS['csstidy']['all_properties']['pause-before'] = 'CSS2.0,CSS2.1';
390
- $GLOBALS['csstidy']['all_properties']['pause-after'] = 'CSS2.0,CSS2.1';
391
- $GLOBALS['csstidy']['all_properties']['cue'] = 'CSS2.0,CSS2.1';
392
- $GLOBALS['csstidy']['all_properties']['cue-before'] = 'CSS2.0,CSS2.1';
393
- $GLOBALS['csstidy']['all_properties']['cue-after'] = 'CSS2.0,CSS2.1';
394
- $GLOBALS['csstidy']['all_properties']['play-during'] = 'CSS2.0,CSS2.1';
395
- $GLOBALS['csstidy']['all_properties']['azimuth'] = 'CSS2.0,CSS2.1';
396
- $GLOBALS['csstidy']['all_properties']['elevation'] = 'CSS2.0,CSS2.1';
397
- $GLOBALS['csstidy']['all_properties']['speech-rate'] = 'CSS2.0,CSS2.1';
398
- $GLOBALS['csstidy']['all_properties']['voice-family'] = 'CSS2.0,CSS2.1';
399
- $GLOBALS['csstidy']['all_properties']['pitch'] = 'CSS2.0,CSS2.1';
400
- $GLOBALS['csstidy']['all_properties']['pitch-range'] = 'CSS2.0,CSS2.1';
401
- $GLOBALS['csstidy']['all_properties']['stress'] = 'CSS2.0,CSS2.1';
402
- $GLOBALS['csstidy']['all_properties']['richness'] = 'CSS2.0,CSS2.1';
403
- $GLOBALS['csstidy']['all_properties']['speak-punctuation'] = 'CSS2.0,CSS2.1';
404
- $GLOBALS['csstidy']['all_properties']['speak-numeral'] = 'CSS2.0,CSS2.1';
405
-
406
- /**
407
- * An array containing all predefined templates.
408
- *
409
- * @global array $GLOBALS['csstidy']['predefined_templates']
410
- * @version 1.0
411
- * @see csstidy::load_template()
412
- */
413
- $GLOBALS['csstidy']['predefined_templates']['default'][] = '<span class="at">'; //string before @rule
414
- $GLOBALS['csstidy']['predefined_templates']['default'][] = '</span> <span class="format">{</span>'."\n"; //bracket after @-rule
415
- $GLOBALS['csstidy']['predefined_templates']['default'][] = '<span class="selector">'; //string before selector
416
- $GLOBALS['csstidy']['predefined_templates']['default'][] = '</span> <span class="format">{</span>'."\n"; //bracket after selector
417
- $GLOBALS['csstidy']['predefined_templates']['default'][] = '<span class="property">'; //string before property
418
- $GLOBALS['csstidy']['predefined_templates']['default'][] = '</span><span class="value">'; //string after property+before value
419
- $GLOBALS['csstidy']['predefined_templates']['default'][] = '</span><span class="format">;</span>'."\n"; //string after value
420
- $GLOBALS['csstidy']['predefined_templates']['default'][] = '<span class="format">}</span>'; //closing bracket - selector
421
- $GLOBALS['csstidy']['predefined_templates']['default'][] = "\n\n"; //space between blocks {...}
422
- $GLOBALS['csstidy']['predefined_templates']['default'][] = "\n".'<span class="format">}</span>'. "\n\n"; //closing bracket @-rule
423
- $GLOBALS['csstidy']['predefined_templates']['default'][] = ''; //indent in @-rule
424
- $GLOBALS['csstidy']['predefined_templates']['default'][] = '<span class="comment">'; // before comment
425
- $GLOBALS['csstidy']['predefined_templates']['default'][] = '</span>'."\n"; // after comment
426
- $GLOBALS['csstidy']['predefined_templates']['default'][] = "\n"; // after last line @-rule
427
-
428
- $GLOBALS['csstidy']['predefined_templates']['high_compression'][] = '<span class="at">';
429
- $GLOBALS['csstidy']['predefined_templates']['high_compression'][] = '</span> <span class="format">{</span>'."\n";
430
- $GLOBALS['csstidy']['predefined_templates']['high_compression'][] = '<span class="selector">';
431
- $GLOBALS['csstidy']['predefined_templates']['high_compression'][] = '</span><span class="format">{</span>';
432
- $GLOBALS['csstidy']['predefined_templates']['high_compression'][] = '<span class="property">';
433
- $GLOBALS['csstidy']['predefined_templates']['high_compression'][] = '</span><span class="value">';
434
- $GLOBALS['csstidy']['predefined_templates']['high_compression'][] = '</span><span class="format">;</span>';
435
- $GLOBALS['csstidy']['predefined_templates']['high_compression'][] = '<span class="format">}</span>';
436
- $GLOBALS['csstidy']['predefined_templates']['high_compression'][] = "\n";
437
- $GLOBALS['csstidy']['predefined_templates']['high_compression'][] = "\n". '<span class="format">}'."\n".'</span>';
438
- $GLOBALS['csstidy']['predefined_templates']['high_compression'][] = '';
439
- $GLOBALS['csstidy']['predefined_templates']['high_compression'][] = '<span class="comment">'; // before comment
440
- $GLOBALS['csstidy']['predefined_templates']['high_compression'][] = '</span>'; // after comment
441
- $GLOBALS['csstidy']['predefined_templates']['high_compression'][] = "\n";
442
-
443
- $GLOBALS['csstidy']['predefined_templates']['highest_compression'][] = '<span class="at">';
444
- $GLOBALS['csstidy']['predefined_templates']['highest_compression'][] = '</span><span class="format">{</span>';
445
- $GLOBALS['csstidy']['predefined_templates']['highest_compression'][] = '<span class="selector">';
446
- $GLOBALS['csstidy']['predefined_templates']['highest_compression'][] = '</span><span class="format">{</span>';
447
- $GLOBALS['csstidy']['predefined_templates']['highest_compression'][] = '<span class="property">';
448
- $GLOBALS['csstidy']['predefined_templates']['highest_compression'][] = '</span><span class="value">';
449
- $GLOBALS['csstidy']['predefined_templates']['highest_compression'][] = '</span><span class="format">;</span>';
450
- $GLOBALS['csstidy']['predefined_templates']['highest_compression'][] = '<span class="format">}</span>';
451
- $GLOBALS['csstidy']['predefined_templates']['highest_compression'][] = '';
452
- $GLOBALS['csstidy']['predefined_templates']['highest_compression'][] = '<span class="format">}</span>';
453
- $GLOBALS['csstidy']['predefined_templates']['highest_compression'][] = '';
454
- $GLOBALS['csstidy']['predefined_templates']['highest_compression'][] = '<span class="comment">'; // before comment
455
- $GLOBALS['csstidy']['predefined_templates']['highest_compression'][] = '</span>'; // after comment
456
- $GLOBALS['csstidy']['predefined_templates']['highest_compression'][] = '';
457
-
458
- $GLOBALS['csstidy']['predefined_templates']['low_compression'][] = '<span class="at">';
459
- $GLOBALS['csstidy']['predefined_templates']['low_compression'][] = '</span> <span class="format">{</span>'."\n";
460
- $GLOBALS['csstidy']['predefined_templates']['low_compression'][] = '<span class="selector">';
461
- $GLOBALS['csstidy']['predefined_templates']['low_compression'][] = '</span>'."\n".'<span class="format">{</span>'."\n";
462
- $GLOBALS['csstidy']['predefined_templates']['low_compression'][] = ' <span class="property">';
463
- $GLOBALS['csstidy']['predefined_templates']['low_compression'][] = '</span><span class="value">';
464
- $GLOBALS['csstidy']['predefined_templates']['low_compression'][] = '</span><span class="format">;</span>'."\n";
465
- $GLOBALS['csstidy']['predefined_templates']['low_compression'][] = '<span class="format">}</span>';
466
- $GLOBALS['csstidy']['predefined_templates']['low_compression'][] = "\n\n";
467
- $GLOBALS['csstidy']['predefined_templates']['low_compression'][] = "\n".'<span class="format">}</span>'."\n\n";
468
- $GLOBALS['csstidy']['predefined_templates']['low_compression'][] = ' ';
469
- $GLOBALS['csstidy']['predefined_templates']['low_compression'][] = '<span class="comment">'; // before comment
470
- $GLOBALS['csstidy']['predefined_templates']['low_compression'][] = '</span>'."\n"; // after comment
471
- $GLOBALS['csstidy']['predefined_templates']['low_compression'][] = "\n";
472
-
473
- ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
includes/csstidy-1.3/lang.inc.php DELETED
@@ -1,238 +0,0 @@
1
- <?php
2
- if(isset($_GET['lang'])) {
3
- $l = $_GET['lang'];
4
- } else {
5
- $l = getenv('HTTP_ACCEPT_LANGUAGE');
6
- $l = strtolower(substr($l,0,2));
7
- }
8
- $l = ($l == 'de' || $l == 'fr' || $l == 'zh') ? $l : 'en';
9
-
10
- $lang = array();
11
- $lang['en'][0] = 'CSS Formatter and Optimiser/Optimizer (based on CSSTidy ';
12
- $lang['de'][0] = 'CSS Formatierer und Optimierer (basierend auf CSSTidy ';
13
- $lang['en'][1] = 'CSS Formatter and Optimiser';
14
- $lang['de'][1] = 'CSS Formatierer und Optimierer';
15
- $lang['en'][2] = '(based on';
16
- $lang['de'][2] = '(basierend auf';
17
- $lang['en'][3] = '(plaintext)';
18
- $lang['de'][3] = '(Textversion)';
19
- $lang['en'][4] = 'Important Note:';
20
- $lang['de'][4] = 'Wichtiger Hinweis:';
21
- $lang['en'][6] = 'Your code should be well-formed. This is <strong>no validator</strong> which points out errors in your CSS code. To make sure that your code is valid, use the <a href="http://jigsaw.w3.org/css-validator/">W3C Validator</a>.';
22
- $lang['de'][6] = 'Der CSS Code sollte wohlgeformt sein. Der CSS Code wird <strong>nicht auf Gültigkeit überprüft</strong>. Um sicherzugehen dass dein Code valide ist, benutze den <a href="http://jigsaw.w3.org/css-validator/">W3C Validierungsservice</a>.';
23
- $lang['en'][7] = 'all comments are removed';
24
- $lang['de'][7] = 'alle Kommentare werden entfernt';
25
- $lang['en'][8] = 'CSS Input:';
26
- $lang['de'][8] = 'CSS Eingabe:';
27
- $lang['en'][9] = 'CSS-Code:';
28
- $lang['de'][9] = 'CSS-Code:';
29
- $lang['en'][10] = 'CSS from URL:';
30
- $lang['de'][10] = 'CSS von URL:';
31
- $lang['en'][11] = 'Code Layout:';
32
- $lang['de'][11] = 'Code Layout:';
33
- $lang['en'][12] = 'Compression&nbsp;(code&nbsp;layout):';
34
- $lang['de'][12] = 'Komprimierung&nbsp;(Code&nbsp;Layout):';
35
- $lang['en'][13] = 'Highest (no readability, smallest size)';
36
- $lang['de'][13] = 'Höchste (keine Lesbarkeit, niedrigste Größe)';
37
- $lang['en'][14] = 'High (moderate readability, smaller size)';
38
- $lang['de'][14] = 'Hoch (mittelmäßige Lesbarkeit, geringe Größe)';
39
- $lang['en'][15] = 'Standard (balance between readability and size)';
40
- $lang['de'][15] = 'Standard (Kompromiss zwischen Lesbarkeit und Größe)';
41
- $lang['en'][16] = 'Low (higher readability)';
42
- $lang['de'][16] = 'Niedrig (höhere Lesbarkeit)';
43
- $lang['en'][17] = 'Custom (enter below)';
44
- $lang['de'][17] = 'Benutzerdefiniert (unten eingeben)';
45
- $lang['en'][18] = 'Custom <a href="http://csstidy.sourceforge.net/templates.php">template</a>';
46
- $lang['de'][18] = 'Benutzerdefinierte <a href="http://csstidy.sourceforge.net/templates.php">Vorlage</a>';
47
- $lang['en'][19] = 'Options';
48
- $lang['de'][19] = 'Optionen';
49
- $lang['en'][20] = 'Sort Selectors (caution)';
50
- $lang['de'][20] = 'Selektoren sortieren (Vorsicht)';
51
- $lang['en'][21] = 'Sort Properties';
52
- $lang['de'][21] = 'Eigenschaften sortieren';
53
- $lang['en'][22] = 'Regroup selectors';
54
- $lang['de'][22] = 'Selektoren umgruppieren';
55
- $lang['en'][23] = 'Optimise shorthands';
56
- $lang['de'][23] = 'Shorthands optimieren';
57
- $lang['en'][24] = 'Compress colors';
58
- $lang['de'][24] = 'Farben komprimieren';
59
- $lang['en'][25] = 'Lowercase selectors';
60
- $lang['de'][25] = 'Selektoren in Kleinbuchstaben';
61
- $lang['en'][26] = 'Case for properties:';
62
- $lang['de'][26] = 'Groß-/Kleinschreibung für Eigenschaften';
63
- $lang['en'][27] = 'Lowercase';
64
- $lang['de'][27] = 'Kleinbuchstaben';
65
- $lang['en'][28] = 'No or invalid CSS input or wrong URL!';
66
- $lang['de'][28] = 'Keine oder ungültige CSS Eingabe oder falsche URL!';
67
- $lang['en'][29] = 'Uppercase';
68
- $lang['de'][29] = 'Großbuchstaben';
69
- $lang['en'][30] = 'lowercase elementnames needed for XHTML';
70
- $lang['de'][30] = 'kleingeschriebene Elementnamen benötigt für XHTML';
71
- $lang['en'][31] = 'Remove unnecessary backslashes';
72
- $lang['de'][31] = 'Unnötige Backslashes entfernen';
73
- $lang['en'][32] = 'convert !important-hack';
74
- $lang['de'][32] = '!important-Hack konvertieren';
75
- $lang['en'][33] = 'Output as file';
76
- $lang['de'][33] = 'Als Datei ausgeben';
77
- $lang['en'][34] = 'Bigger compression because of smaller newlines (copy &amp; paste doesn\'t work)';
78
- $lang['de'][34] = 'Größere Komprimierung augrund von kleineren Neuezeile-Zeichen';
79
- $lang['en'][35] = 'Process CSS';
80
- $lang['de'][35] = 'CSS verarbeiten';
81
- $lang['en'][36] = 'Compression Ratio';
82
- $lang['de'][36] = 'Komprimierungsrate';
83
- $lang['en'][37] = 'Input';
84
- $lang['de'][37] = 'Eingabe';
85
- $lang['en'][38] = 'Output';
86
- $lang['de'][38] = 'Ausgabe';
87
- $lang['en'][39] = 'Language';
88
- $lang['de'][39] = 'Sprache';
89
- $lang['en'][41] = 'Attention: This may change the behaviour of your CSS Code!';
90
- $lang['de'][41] = 'Achtung: Dies könnte das Verhalten ihres CSS-Codes verändern!';
91
- $lang['en'][42] = 'Remove last ;';
92
- $lang['de'][42] = 'Letztes ; entfernen';
93
- $lang['en'][43] = 'Discard invalid properties';
94
- $lang['de'][43] = 'Ungültige Eigenschaften entfernen';
95
- $lang['en'][44] = 'Only safe optimisations';
96
- $lang['de'][44] = 'Nur sichere Optimierungen';
97
- $lang['en'][45] = 'Compress font-weight';
98
- $lang['de'][45] = 'font-weight komprimieren';
99
- $lang['en'][46] = 'Save comments';
100
- $lang['de'][46] = 'Kommentare beibehalten';
101
- $lang['en'][47] = 'Do not change anything';
102
- $lang['en'][48] = 'Only seperate selectors (split at ,)';
103
- $lang['en'][49] = 'Merge selectors with the same properties (fast)';
104
- $lang['en'][50] = 'Merge selectors intelligently (slow)';
105
- $lang['de'][47] = 'Nichts ändern';
106
- $lang['de'][48] = 'Selektoren nur trennen (am Komma)';
107
- $lang['de'][49] = 'Selektoren mit gleichen Eigenschaften zusammenfassen (schnell)';
108
- $lang['de'][50] = 'Selektoren intelligent zusammenfassen (langsam!)';
109
- $lang['en'][51] = 'Preserve CSS';
110
- $lang['de'][51] = 'CSS erhalten';
111
- $lang['en'][52] = 'Save comments, hacks, etc. Most optimisations can *not* be applied if this is enabled.';
112
- $lang['de'][52] = 'Kommentare, Hacks, etc. speichern. Viele Optimierungen sind dann aber nicht mehr möglich.';
113
- $lang['en'][53] = 'None';
114
- $lang['de'][53] = 'Keine';
115
- $lang['en'][54] = 'Don\'t optimise';
116
- $lang['de'][54] = 'Nicht optimieren';
117
- $lang['en'][55] = 'Safe optimisations';
118
- $lang['de'][55] = 'Sichere Optimierungen';
119
- $lang['en'][56] = 'All optimisations';
120
- $lang['de'][56] = 'Alle Optimierungen';
121
- $lang['en'][57] = 'Add timestamp';
122
- $lang['de'][57] = 'Zeitstempel hinzufügen';
123
-
124
- $lang['fr'][0] = 'CSS Formatteur et Optimiseur (basé sur CSSTidy ';
125
- $lang['fr'][1] = 'CSS Formatteur et Optimiseur';
126
- $lang['fr'][2] = '(basé sur ';
127
- $lang['fr'][3] = '(Version Text)';
128
- $lang['fr'][4] = 'notes Importantes:';
129
- $lang['fr'][5] = 'les mêmes sélecteurs et les propriétés sont automatiquement fusionnés';
130
- $lang['fr'][6] = 'votre code doit être Valide. Ce n\'est <strong>pas un validateur</strong> qui signale des erreurs dans votre code de CSS. Assurez-vous que votre code est correct en utilisant le le validateur : <a href="http://jigsaw.w3.org/css-validator/">W3C Validator</a>';
131
- $lang['fr'][7] = 'tous les commentaires sont enlevés';
132
- $lang['fr'][8] = 'Champ CSS:';
133
- $lang['fr'][9] = 'CSS-Code:';
134
- $lang['fr'][10] = 'CSS en provenance d\'une URL:<br />';
135
- $lang['fr'][11] = 'Mise en page du code:';
136
- $lang['fr'][12] = 'Compression (Mise en page du code):';
137
- $lang['fr'][13] = 'Le plus compact (aucune lisibilité, plus petite taille)';
138
- $lang['fr'][14] = 'Trés compact (lisibilité modérée, plus petite taille)';
139
- $lang['fr'][15] = 'Normale (équilibre entre la lisibilité et la taille)';
140
- $lang['fr'][16] = 'Peu compact (une lisibilité plus élevée)';
141
- $lang['fr'][17] = 'Sur mesure (entrer ci-dessous)';
142
- $lang['fr'][18] = 'Sur mesure <a href="http://csstidy.sourceforge.net/templates.php">Gabarit</a>';
143
- $lang['fr'][19] = 'Options';
144
- $lang['fr'][20] = 'Trier les sélecteurs (attention)';
145
- $lang['fr'][21] = 'Trier les propriétés';
146
- $lang['fr'][22] = 'Fusionner les sélecteurs';
147
- $lang['fr'][23] = 'Optimise shorthands';
148
- $lang['fr'][24] = 'Compresser les couleurs';
149
- $lang['fr'][25] = 'Sélecteurs en minuscules';
150
- $lang['fr'][26] = 'Cases (Minuscules &amp; Majuscule) pour les propriétés:';
151
- $lang['fr'][27] = 'Minuscules';
152
- $lang['fr'][28] = 'CSS non valide ou URL incorrecte!';
153
- $lang['fr'][29] = 'Majuscule';
154
- $lang['fr'][30] = 'les noms des éléments en minuscules (indispensables pour XHTML)';
155
- $lang['fr'][31] = 'enlever les antislashs inutiles';
156
- $lang['fr'][32] = 'convertir !important-hack';
157
- $lang['fr'][33] = 'Sauver en tant que fichier';
158
- $lang['fr'][34] = 'Une plus grande compression en raison de plus petits caractères';
159
- $lang['fr'][35] = 'Compresser le CSS';
160
- $lang['fr'][36] = 'Facteur de Compression';
161
- $lang['fr'][37] = 'Entrée';
162
- $lang['fr'][38] = 'Sortie';
163
- $lang['fr'][39] = 'Language';
164
- $lang['fr'][41] = 'Attention : ceci peut changer le comportement de votre code de CSS !';
165
- $lang['fr'][42] = 'Enlever le dernier ;';
166
- $lang['fr'][43] = 'Supprimer les propriétés non valide';
167
- $lang['fr'][44] = 'Seulement les optimisations sûres';
168
- $lang['fr'][45] = 'Compresser font-weight';
169
- $lang['fr'][46] = 'Sauvegarder les commentaires ';
170
- $lang['fr'][47] = 'Ne changer rien';
171
- $lang['fr'][48] = 'Sépare les sélecteurs (sépare au niveau de ,)';
172
- $lang['fr'][49] = 'Fusionne les sélecteurs avec les mêmes propriétés (rapides)';
173
- $lang['fr'][50] = 'Fusionne les sélecteurs intelligemment (lent)';
174
- $lang['fr'][51] = 'Preserve CSS';
175
- $lang['fr'][52] = 'Save comments, hacks, etc. Most optimisations can *not* be applied if this is enabled.';
176
- $lang['fr'][53] = 'None';
177
- $lang['fr'][54] = 'Don\'t optimise';
178
- $lang['fr'][55] = 'Safe optimisations';
179
- $lang['fr'][56] = 'All optimisations';
180
- $lang['fr'][57] = 'Add timestamp';
181
-
182
- $lang['zh'][0] = 'CSS整形與最佳化工具(使用 CSSTidy ';
183
- $lang['zh'][1] = 'CSS整形與最佳化工具';
184
- $lang['zh'][2] = '(使用';
185
- $lang['zh'][3] = '(純文字)';
186
- $lang['zh'][4] = '重要事項:';
187
- $lang['zh'][6] = '你的原始碼必須是良構的(well-formed). 這個工具<strong>沒有內建驗證器(validator)</strong>. 驗證器能夠指出你CSS原始碼裡的錯誤. 請使用 <a href="http://jigsaw.w3.org/css-validator/">W3C 驗證器</a>, 確保你的原始碼合乎規範.';
188
- $lang['zh'][7] = '所有註解都移除了';
189
- $lang['zh'][8] = 'CSS 輸入:';
190
- $lang['zh'][9] = 'CSS 原始碼:';
191
- $lang['zh'][10] = 'CSS 檔案網址(URL):';
192
- $lang['zh'][11] = '原始碼規劃:';
193
- $lang['zh'][12] = '壓縮程度(原始碼規劃):';
194
- $lang['zh'][13] = '最高 (沒有辦法讀, 檔案最小)';
195
- $lang['zh'][14] = '高 (適度的可讀性, 檔案小)';
196
- $lang['zh'][15] = '標準 (兼顧可讀性與檔案大小)';
197
- $lang['zh'][16] = '低 (注重可讀性)';
198
- $lang['zh'][17] = '自訂 (在下方設定)';
199
- $lang['zh'][18] = '自訂<a href="http://csstidy.sourceforge.net/templates.php">樣板</a>';
200
- $lang['zh'][19] = '選項';
201
- $lang['zh'][20] = '整理選擇符(請謹慎使用)';
202
- $lang['zh'][21] = '整理屬性';
203
- $lang['zh'][22] = '重組選擇符';
204
- $lang['zh'][23] = '速記法(shorthand)最佳化';
205
- $lang['zh'][24] = '壓縮色彩語法';
206
- $lang['zh'][25] = '改用小寫選擇符';
207
- $lang['zh'][26] = '屬性的字形:';
208
- $lang['zh'][27] = '小寫';
209
- $lang['zh'][28] = '沒有輸入CSS, 語法不符合規定, 或是網址錯誤!';
210
- $lang['zh'][29] = '大寫';
211
- $lang['zh'][30] = 'XHTML必須使用小寫的元素名稱';
212
- $lang['zh'][31] = '移除不必要的反斜線';
213
- $lang['zh'][32] = '轉換 !important-hack';
214
- $lang['zh'][33] = '輸出成檔案形式';
215
- $lang['zh'][34] = '由於比較少換行字元, 會有更大的壓縮比率(複製&amp;貼上沒有用)';
216
- $lang['zh'][35] = '執行';
217
- $lang['zh'][36] = '壓縮比率';
218
- $lang['zh'][37] = '輸入';
219
- $lang['zh'][38] = '輸出';
220
- $lang['zh'][39] = '語言';
221
- $lang['zh'][41] = '注意: 這或許會變更你CSS原始碼的行為!';
222
- $lang['zh'][42] = '除去最後一個分號';
223
- $lang['zh'][43] = '拋棄不符合規定的屬性';
224
- $lang['zh'][44] = '只安全地最佳化';
225
- $lang['zh'][45] = '壓縮 font-weight';
226
- $lang['zh'][46] = '保留註解';
227
- $lang['zh'][47] = '什麼都不要改';
228
- $lang['zh'][48] = '只分開原本用逗號分隔的選擇符';
229
- $lang['zh'][49] = '合併有相同屬性的選擇符(快速)';
230
- $lang['zh'][50] = '聰明地合併選擇符(慢速)';
231
- $lang['zh'][51] = '保護CSS';
232
- $lang['zh'][52] = '保留註解與 hack 等等. 如果啟用這個選項, 大多數的最佳化程序都不會執行.';
233
- $lang['zh'][53] = '不改變';
234
- $lang['zh'][54] = '不做最佳化';
235
- $lang['zh'][55] = '安全地最佳化';
236
- $lang['zh'][56] = '全部最佳化';
237
- $lang['zh'][57] = '加上時間戳記';
238
- ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
includes/csstidy-1.3/template.tpl DELETED
@@ -1,10 +0,0 @@
1
- <span class="at">|</span> <span class="format">{</span>
2
- |<span class="selector">|</span> <span class="format">{</span>
3
- |<span class="property">|</span><span class="value">|</span><span class="format">;</span>
4
- |<span class="format">}</span>|
5
-
6
- |
7
- <span class="format">}</span>
8
-
9
- ||<span class="comment">|</span>
10
- |
 
 
 
 
 
 
 
 
 
 
includes/csstidy-1.3/template1.tpl DELETED
@@ -1,12 +0,0 @@
1
- <span class="at">|</span> <span class="format">{</span>
2
- |<span class="selector">|</span>
3
- <span class="format">{</span>
4
- | <span class="property">|</span><span class="value">|</span><span class="format">;</span>
5
- |<span class="format">}</span>|
6
-
7
- |
8
-
9
- <span class="format">}</span>
10
-
11
- | |<span class="comment">|</span>
12
- |
 
 
 
 
 
 
 
 
 
 
 
 
includes/csstidy-1.3/template2.tpl DELETED
@@ -1,5 +0,0 @@
1
- <span class="at">|</span> <span class="format">{</span>
2
- |<span class="selector">|</span><span class="format">{</span>|<span class="property">|</span><span class="value">|</span><span class="format">;</span>|<span class="format">}</span>|
3
- |
4
- <span class="format">}
5
- </span>||<span class="comment">|</span>|
 
 
 
 
 
includes/csstidy-1.3/template3.tpl DELETED
@@ -1 +0,0 @@
1
- <span class="at">|</span><span class="format">{</span>|<span class="selector">|</span><span class="format">{</span>|<span class="property">|</span><span class="value">|</span><span class="format">;</span>|<span class="format">}</span>||<span class="format">}</span>||<span class="comment">|</span>|
 
includes/js/jquery-1.4.4.min.js ADDED
@@ -0,0 +1,167 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*!
2
+ * jQuery JavaScript Library v1.4.4
3
+ * http://jquery.com/
4
+ *
5
+ * Copyright 2010, John Resig
6
+ * Dual licensed under the MIT or GPL Version 2 licenses.
7
+ * http://jquery.org/license
8
+ *
9
+ * Includes Sizzle.js
10
+ * http://sizzlejs.com/
11
+ * Copyright 2010, The Dojo Foundation
12
+ * Released under the MIT, BSD, and GPL Licenses.
13
+ *
14
+ * Date: Thu Nov 11 19:04:53 2010 -0500
15
+ */
16
+ (function(E,B){function ka(a,b,d){if(d===B&&a.nodeType===1){d=a.getAttribute("data-"+b);if(typeof d==="string"){try{d=d==="true"?true:d==="false"?false:d==="null"?null:!c.isNaN(d)?parseFloat(d):Ja.test(d)?c.parseJSON(d):d}catch(e){}c.data(a,b,d)}else d=B}return d}function U(){return false}function ca(){return true}function la(a,b,d){d[0].type=a;return c.event.handle.apply(b,d)}function Ka(a){var b,d,e,f,h,l,k,o,x,r,A,C=[];f=[];h=c.data(this,this.nodeType?"events":"__events__");if(typeof h==="function")h=
17
+ h.events;if(!(a.liveFired===this||!h||!h.live||a.button&&a.type==="click")){if(a.namespace)A=RegExp("(^|\\.)"+a.namespace.split(".").join("\\.(?:.*\\.)?")+"(\\.|$)");a.liveFired=this;var J=h.live.slice(0);for(k=0;k<J.length;k++){h=J[k];h.origType.replace(X,"")===a.type?f.push(h.selector):J.splice(k--,1)}f=c(a.target).closest(f,a.currentTarget);o=0;for(x=f.length;o<x;o++){r=f[o];for(k=0;k<J.length;k++){h=J[k];if(r.selector===h.selector&&(!A||A.test(h.namespace))){l=r.elem;e=null;if(h.preType==="mouseenter"||
18
+ h.preType==="mouseleave"){a.type=h.preType;e=c(a.relatedTarget).closest(h.selector)[0]}if(!e||e!==l)C.push({elem:l,handleObj:h,level:r.level})}}}o=0;for(x=C.length;o<x;o++){f=C[o];if(d&&f.level>d)break;a.currentTarget=f.elem;a.data=f.handleObj.data;a.handleObj=f.handleObj;A=f.handleObj.origHandler.apply(f.elem,arguments);if(A===false||a.isPropagationStopped()){d=f.level;if(A===false)b=false;if(a.isImmediatePropagationStopped())break}}return b}}function Y(a,b){return(a&&a!=="*"?a+".":"")+b.replace(La,
19
+ "`").replace(Ma,"&")}function ma(a,b,d){if(c.isFunction(b))return c.grep(a,function(f,h){return!!b.call(f,h,f)===d});else if(b.nodeType)return c.grep(a,function(f){return f===b===d});else if(typeof b==="string"){var e=c.grep(a,function(f){return f.nodeType===1});if(Na.test(b))return c.filter(b,e,!d);else b=c.filter(b,e)}return c.grep(a,function(f){return c.inArray(f,b)>=0===d})}function na(a,b){var d=0;b.each(function(){if(this.nodeName===(a[d]&&a[d].nodeName)){var e=c.data(a[d++]),f=c.data(this,
20
+ e);if(e=e&&e.events){delete f.handle;f.events={};for(var h in e)for(var l in e[h])c.event.add(this,h,e[h][l],e[h][l].data)}}})}function Oa(a,b){b.src?c.ajax({url:b.src,async:false,dataType:"script"}):c.globalEval(b.text||b.textContent||b.innerHTML||"");b.parentNode&&b.parentNode.removeChild(b)}function oa(a,b,d){var e=b==="width"?a.offsetWidth:a.offsetHeight;if(d==="border")return e;c.each(b==="width"?Pa:Qa,function(){d||(e-=parseFloat(c.css(a,"padding"+this))||0);if(d==="margin")e+=parseFloat(c.css(a,
21
+ "margin"+this))||0;else e-=parseFloat(c.css(a,"border"+this+"Width"))||0});return e}function da(a,b,d,e){if(c.isArray(b)&&b.length)c.each(b,function(f,h){d||Ra.test(a)?e(a,h):da(a+"["+(typeof h==="object"||c.isArray(h)?f:"")+"]",h,d,e)});else if(!d&&b!=null&&typeof b==="object")c.isEmptyObject(b)?e(a,""):c.each(b,function(f,h){da(a+"["+f+"]",h,d,e)});else e(a,b)}function S(a,b){var d={};c.each(pa.concat.apply([],pa.slice(0,b)),function(){d[this]=a});return d}function qa(a){if(!ea[a]){var b=c("<"+
22
+ a+">").appendTo("body"),d=b.css("display");b.remove();if(d==="none"||d==="")d="block";ea[a]=d}return ea[a]}function fa(a){return c.isWindow(a)?a:a.nodeType===9?a.defaultView||a.parentWindow:false}var t=E.document,c=function(){function a(){if(!b.isReady){try{t.documentElement.doScroll("left")}catch(j){setTimeout(a,1);return}b.ready()}}var b=function(j,s){return new b.fn.init(j,s)},d=E.jQuery,e=E.$,f,h=/^(?:[^<]*(<[\w\W]+>)[^>]*$|#([\w\-]+)$)/,l=/\S/,k=/^\s+/,o=/\s+$/,x=/\W/,r=/\d/,A=/^<(\w+)\s*\/?>(?:<\/\1>)?$/,
23
+ C=/^[\],:{}\s]*$/,J=/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,w=/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,I=/(?:^|:|,)(?:\s*\[)+/g,L=/(webkit)[ \/]([\w.]+)/,g=/(opera)(?:.*version)?[ \/]([\w.]+)/,i=/(msie) ([\w.]+)/,n=/(mozilla)(?:.*? rv:([\w.]+))?/,m=navigator.userAgent,p=false,q=[],u,y=Object.prototype.toString,F=Object.prototype.hasOwnProperty,M=Array.prototype.push,N=Array.prototype.slice,O=String.prototype.trim,D=Array.prototype.indexOf,R={};b.fn=b.prototype={init:function(j,
24
+ s){var v,z,H;if(!j)return this;if(j.nodeType){this.context=this[0]=j;this.length=1;return this}if(j==="body"&&!s&&t.body){this.context=t;this[0]=t.body;this.selector="body";this.length=1;return this}if(typeof j==="string")if((v=h.exec(j))&&(v[1]||!s))if(v[1]){H=s?s.ownerDocument||s:t;if(z=A.exec(j))if(b.isPlainObject(s)){j=[t.createElement(z[1])];b.fn.attr.call(j,s,true)}else j=[H.createElement(z[1])];else{z=b.buildFragment([v[1]],[H]);j=(z.cacheable?z.fragment.cloneNode(true):z.fragment).childNodes}return b.merge(this,
25
+ j)}else{if((z=t.getElementById(v[2]))&&z.parentNode){if(z.id!==v[2])return f.find(j);this.length=1;this[0]=z}this.context=t;this.selector=j;return this}else if(!s&&!x.test(j)){this.selector=j;this.context=t;j=t.getElementsByTagName(j);return b.merge(this,j)}else return!s||s.jquery?(s||f).find(j):b(s).find(j);else if(b.isFunction(j))return f.ready(j);if(j.selector!==B){this.selector=j.selector;this.context=j.context}return b.makeArray(j,this)},selector:"",jquery:"1.4.4",length:0,size:function(){return this.length},
26
+ toArray:function(){return N.call(this,0)},get:function(j){return j==null?this.toArray():j<0?this.slice(j)[0]:this[j]},pushStack:function(j,s,v){var z=b();b.isArray(j)?M.apply(z,j):b.merge(z,j);z.prevObject=this;z.context=this.context;if(s==="find")z.selector=this.selector+(this.selector?" ":"")+v;else if(s)z.selector=this.selector+"."+s+"("+v+")";return z},each:function(j,s){return b.each(this,j,s)},ready:function(j){b.bindReady();if(b.isReady)j.call(t,b);else q&&q.push(j);return this},eq:function(j){return j===
27
+ -1?this.slice(j):this.slice(j,+j+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},slice:function(){return this.pushStack(N.apply(this,arguments),"slice",N.call(arguments).join(","))},map:function(j){return this.pushStack(b.map(this,function(s,v){return j.call(s,v,s)}))},end:function(){return this.prevObject||b(null)},push:M,sort:[].sort,splice:[].splice};b.fn.init.prototype=b.fn;b.extend=b.fn.extend=function(){var j,s,v,z,H,G=arguments[0]||{},K=1,Q=arguments.length,ga=false;
28
+ if(typeof G==="boolean"){ga=G;G=arguments[1]||{};K=2}if(typeof G!=="object"&&!b.isFunction(G))G={};if(Q===K){G=this;--K}for(;K<Q;K++)if((j=arguments[K])!=null)for(s in j){v=G[s];z=j[s];if(G!==z)if(ga&&z&&(b.isPlainObject(z)||(H=b.isArray(z)))){if(H){H=false;v=v&&b.isArray(v)?v:[]}else v=v&&b.isPlainObject(v)?v:{};G[s]=b.extend(ga,v,z)}else if(z!==B)G[s]=z}return G};b.extend({noConflict:function(j){E.$=e;if(j)E.jQuery=d;return b},isReady:false,readyWait:1,ready:function(j){j===true&&b.readyWait--;
29
+ if(!b.readyWait||j!==true&&!b.isReady){if(!t.body)return setTimeout(b.ready,1);b.isReady=true;if(!(j!==true&&--b.readyWait>0))if(q){var s=0,v=q;for(q=null;j=v[s++];)j.call(t,b);b.fn.trigger&&b(t).trigger("ready").unbind("ready")}}},bindReady:function(){if(!p){p=true;if(t.readyState==="complete")return setTimeout(b.ready,1);if(t.addEventListener){t.addEventListener("DOMContentLoaded",u,false);E.addEventListener("load",b.ready,false)}else if(t.attachEvent){t.attachEvent("onreadystatechange",u);E.attachEvent("onload",
30
+ b.ready);var j=false;try{j=E.frameElement==null}catch(s){}t.documentElement.doScroll&&j&&a()}}},isFunction:function(j){return b.type(j)==="function"},isArray:Array.isArray||function(j){return b.type(j)==="array"},isWindow:function(j){return j&&typeof j==="object"&&"setInterval"in j},isNaN:function(j){return j==null||!r.test(j)||isNaN(j)},type:function(j){return j==null?String(j):R[y.call(j)]||"object"},isPlainObject:function(j){if(!j||b.type(j)!=="object"||j.nodeType||b.isWindow(j))return false;if(j.constructor&&
31
+ !F.call(j,"constructor")&&!F.call(j.constructor.prototype,"isPrototypeOf"))return false;for(var s in j);return s===B||F.call(j,s)},isEmptyObject:function(j){for(var s in j)return false;return true},error:function(j){throw j;},parseJSON:function(j){if(typeof j!=="string"||!j)return null;j=b.trim(j);if(C.test(j.replace(J,"@").replace(w,"]").replace(I,"")))return E.JSON&&E.JSON.parse?E.JSON.parse(j):(new Function("return "+j))();else b.error("Invalid JSON: "+j)},noop:function(){},globalEval:function(j){if(j&&
32
+ l.test(j)){var s=t.getElementsByTagName("head")[0]||t.documentElement,v=t.createElement("script");v.type="text/javascript";if(b.support.scriptEval)v.appendChild(t.createTextNode(j));else v.text=j;s.insertBefore(v,s.firstChild);s.removeChild(v)}},nodeName:function(j,s){return j.nodeName&&j.nodeName.toUpperCase()===s.toUpperCase()},each:function(j,s,v){var z,H=0,G=j.length,K=G===B||b.isFunction(j);if(v)if(K)for(z in j){if(s.apply(j[z],v)===false)break}else for(;H<G;){if(s.apply(j[H++],v)===false)break}else if(K)for(z in j){if(s.call(j[z],
33
+ z,j[z])===false)break}else for(v=j[0];H<G&&s.call(v,H,v)!==false;v=j[++H]);return j},trim:O?function(j){return j==null?"":O.call(j)}:function(j){return j==null?"":j.toString().replace(k,"").replace(o,"")},makeArray:function(j,s){var v=s||[];if(j!=null){var z=b.type(j);j.length==null||z==="string"||z==="function"||z==="regexp"||b.isWindow(j)?M.call(v,j):b.merge(v,j)}return v},inArray:function(j,s){if(s.indexOf)return s.indexOf(j);for(var v=0,z=s.length;v<z;v++)if(s[v]===j)return v;return-1},merge:function(j,
34
+ s){var v=j.length,z=0;if(typeof s.length==="number")for(var H=s.length;z<H;z++)j[v++]=s[z];else for(;s[z]!==B;)j[v++]=s[z++];j.length=v;return j},grep:function(j,s,v){var z=[],H;v=!!v;for(var G=0,K=j.length;G<K;G++){H=!!s(j[G],G);v!==H&&z.push(j[G])}return z},map:function(j,s,v){for(var z=[],H,G=0,K=j.length;G<K;G++){H=s(j[G],G,v);if(H!=null)z[z.length]=H}return z.concat.apply([],z)},guid:1,proxy:function(j,s,v){if(arguments.length===2)if(typeof s==="string"){v=j;j=v[s];s=B}else if(s&&!b.isFunction(s)){v=
35
+ s;s=B}if(!s&&j)s=function(){return j.apply(v||this,arguments)};if(j)s.guid=j.guid=j.guid||s.guid||b.guid++;return s},access:function(j,s,v,z,H,G){var K=j.length;if(typeof s==="object"){for(var Q in s)b.access(j,Q,s[Q],z,H,v);return j}if(v!==B){z=!G&&z&&b.isFunction(v);for(Q=0;Q<K;Q++)H(j[Q],s,z?v.call(j[Q],Q,H(j[Q],s)):v,G);return j}return K?H(j[0],s):B},now:function(){return(new Date).getTime()},uaMatch:function(j){j=j.toLowerCase();j=L.exec(j)||g.exec(j)||i.exec(j)||j.indexOf("compatible")<0&&n.exec(j)||
36
+ [];return{browser:j[1]||"",version:j[2]||"0"}},browser:{}});b.each("Boolean Number String Function Array Date RegExp Object".split(" "),function(j,s){R["[object "+s+"]"]=s.toLowerCase()});m=b.uaMatch(m);if(m.browser){b.browser[m.browser]=true;b.browser.version=m.version}if(b.browser.webkit)b.browser.safari=true;if(D)b.inArray=function(j,s){return D.call(s,j)};if(!/\s/.test("\u00a0")){k=/^[\s\xA0]+/;o=/[\s\xA0]+$/}f=b(t);if(t.addEventListener)u=function(){t.removeEventListener("DOMContentLoaded",u,
37
+ false);b.ready()};else if(t.attachEvent)u=function(){if(t.readyState==="complete"){t.detachEvent("onreadystatechange",u);b.ready()}};return E.jQuery=E.$=b}();(function(){c.support={};var a=t.documentElement,b=t.createElement("script"),d=t.createElement("div"),e="script"+c.now();d.style.display="none";d.innerHTML=" <link/><table></table><a href='/a' style='color:red;float:left;opacity:.55;'>a</a><input type='checkbox'/>";var f=d.getElementsByTagName("*"),h=d.getElementsByTagName("a")[0],l=t.createElement("select"),
38
+ k=l.appendChild(t.createElement("option"));if(!(!f||!f.length||!h)){c.support={leadingWhitespace:d.firstChild.nodeType===3,tbody:!d.getElementsByTagName("tbody").length,htmlSerialize:!!d.getElementsByTagName("link").length,style:/red/.test(h.getAttribute("style")),hrefNormalized:h.getAttribute("href")==="/a",opacity:/^0.55$/.test(h.style.opacity),cssFloat:!!h.style.cssFloat,checkOn:d.getElementsByTagName("input")[0].value==="on",optSelected:k.selected,deleteExpando:true,optDisabled:false,checkClone:false,
39
+ scriptEval:false,noCloneEvent:true,boxModel:null,inlineBlockNeedsLayout:false,shrinkWrapBlocks:false,reliableHiddenOffsets:true};l.disabled=true;c.support.optDisabled=!k.disabled;b.type="text/javascript";try{b.appendChild(t.createTextNode("window."+e+"=1;"))}catch(o){}a.insertBefore(b,a.firstChild);if(E[e]){c.support.scriptEval=true;delete E[e]}try{delete b.test}catch(x){c.support.deleteExpando=false}a.removeChild(b);if(d.attachEvent&&d.fireEvent){d.attachEvent("onclick",function r(){c.support.noCloneEvent=
40
+ false;d.detachEvent("onclick",r)});d.cloneNode(true).fireEvent("onclick")}d=t.createElement("div");d.innerHTML="<input type='radio' name='radiotest' checked='checked'/>";a=t.createDocumentFragment();a.appendChild(d.firstChild);c.support.checkClone=a.cloneNode(true).cloneNode(true).lastChild.checked;c(function(){var r=t.createElement("div");r.style.width=r.style.paddingLeft="1px";t.body.appendChild(r);c.boxModel=c.support.boxModel=r.offsetWidth===2;if("zoom"in r.style){r.style.display="inline";r.style.zoom=
41
+ 1;c.support.inlineBlockNeedsLayout=r.offsetWidth===2;r.style.display="";r.innerHTML="<div style='width:4px;'></div>";c.support.shrinkWrapBlocks=r.offsetWidth!==2}r.innerHTML="<table><tr><td style='padding:0;display:none'></td><td>t</td></tr></table>";var A=r.getElementsByTagName("td");c.support.reliableHiddenOffsets=A[0].offsetHeight===0;A[0].style.display="";A[1].style.display="none";c.support.reliableHiddenOffsets=c.support.reliableHiddenOffsets&&A[0].offsetHeight===0;r.innerHTML="";t.body.removeChild(r).style.display=
42
+ "none"});a=function(r){var A=t.createElement("div");r="on"+r;var C=r in A;if(!C){A.setAttribute(r,"return;");C=typeof A[r]==="function"}return C};c.support.submitBubbles=a("submit");c.support.changeBubbles=a("change");a=b=d=f=h=null}})();var ra={},Ja=/^(?:\{.*\}|\[.*\])$/;c.extend({cache:{},uuid:0,expando:"jQuery"+c.now(),noData:{embed:true,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",applet:true},data:function(a,b,d){if(c.acceptData(a)){a=a==E?ra:a;var e=a.nodeType,f=e?a[c.expando]:null,h=
43
+ c.cache;if(!(e&&!f&&typeof b==="string"&&d===B)){if(e)f||(a[c.expando]=f=++c.uuid);else h=a;if(typeof b==="object")if(e)h[f]=c.extend(h[f],b);else c.extend(h,b);else if(e&&!h[f])h[f]={};a=e?h[f]:h;if(d!==B)a[b]=d;return typeof b==="string"?a[b]:a}}},removeData:function(a,b){if(c.acceptData(a)){a=a==E?ra:a;var d=a.nodeType,e=d?a[c.expando]:a,f=c.cache,h=d?f[e]:e;if(b){if(h){delete h[b];d&&c.isEmptyObject(h)&&c.removeData(a)}}else if(d&&c.support.deleteExpando)delete a[c.expando];else if(a.removeAttribute)a.removeAttribute(c.expando);
44
+ else if(d)delete f[e];else for(var l in a)delete a[l]}},acceptData:function(a){if(a.nodeName){var b=c.noData[a.nodeName.toLowerCase()];if(b)return!(b===true||a.getAttribute("classid")!==b)}return true}});c.fn.extend({data:function(a,b){var d=null;if(typeof a==="undefined"){if(this.length){var e=this[0].attributes,f;d=c.data(this[0]);for(var h=0,l=e.length;h<l;h++){f=e[h].name;if(f.indexOf("data-")===0){f=f.substr(5);ka(this[0],f,d[f])}}}return d}else if(typeof a==="object")return this.each(function(){c.data(this,
45
+ a)});var k=a.split(".");k[1]=k[1]?"."+k[1]:"";if(b===B){d=this.triggerHandler("getData"+k[1]+"!",[k[0]]);if(d===B&&this.length){d=c.data(this[0],a);d=ka(this[0],a,d)}return d===B&&k[1]?this.data(k[0]):d}else return this.each(function(){var o=c(this),x=[k[0],b];o.triggerHandler("setData"+k[1]+"!",x);c.data(this,a,b);o.triggerHandler("changeData"+k[1]+"!",x)})},removeData:function(a){return this.each(function(){c.removeData(this,a)})}});c.extend({queue:function(a,b,d){if(a){b=(b||"fx")+"queue";var e=
46
+ c.data(a,b);if(!d)return e||[];if(!e||c.isArray(d))e=c.data(a,b,c.makeArray(d));else e.push(d);return e}},dequeue:function(a,b){b=b||"fx";var d=c.queue(a,b),e=d.shift();if(e==="inprogress")e=d.shift();if(e){b==="fx"&&d.unshift("inprogress");e.call(a,function(){c.dequeue(a,b)})}}});c.fn.extend({queue:function(a,b){if(typeof a!=="string"){b=a;a="fx"}if(b===B)return c.queue(this[0],a);return this.each(function(){var d=c.queue(this,a,b);a==="fx"&&d[0]!=="inprogress"&&c.dequeue(this,a)})},dequeue:function(a){return this.each(function(){c.dequeue(this,
47
+ a)})},delay:function(a,b){a=c.fx?c.fx.speeds[a]||a:a;b=b||"fx";return this.queue(b,function(){var d=this;setTimeout(function(){c.dequeue(d,b)},a)})},clearQueue:function(a){return this.queue(a||"fx",[])}});var sa=/[\n\t]/g,ha=/\s+/,Sa=/\r/g,Ta=/^(?:href|src|style)$/,Ua=/^(?:button|input)$/i,Va=/^(?:button|input|object|select|textarea)$/i,Wa=/^a(?:rea)?$/i,ta=/^(?:radio|checkbox)$/i;c.props={"for":"htmlFor","class":"className",readonly:"readOnly",maxlength:"maxLength",cellspacing:"cellSpacing",rowspan:"rowSpan",
48
+ colspan:"colSpan",tabindex:"tabIndex",usemap:"useMap",frameborder:"frameBorder"};c.fn.extend({attr:function(a,b){return c.access(this,a,b,true,c.attr)},removeAttr:function(a){return this.each(function(){c.attr(this,a,"");this.nodeType===1&&this.removeAttribute(a)})},addClass:function(a){if(c.isFunction(a))return this.each(function(x){var r=c(this);r.addClass(a.call(this,x,r.attr("class")))});if(a&&typeof a==="string")for(var b=(a||"").split(ha),d=0,e=this.length;d<e;d++){var f=this[d];if(f.nodeType===
49
+ 1)if(f.className){for(var h=" "+f.className+" ",l=f.className,k=0,o=b.length;k<o;k++)if(h.indexOf(" "+b[k]+" ")<0)l+=" "+b[k];f.className=c.trim(l)}else f.className=a}return this},removeClass:function(a){if(c.isFunction(a))return this.each(function(o){var x=c(this);x.removeClass(a.call(this,o,x.attr("class")))});if(a&&typeof a==="string"||a===B)for(var b=(a||"").split(ha),d=0,e=this.length;d<e;d++){var f=this[d];if(f.nodeType===1&&f.className)if(a){for(var h=(" "+f.className+" ").replace(sa," "),
50
+ l=0,k=b.length;l<k;l++)h=h.replace(" "+b[l]+" "," ");f.className=c.trim(h)}else f.className=""}return this},toggleClass:function(a,b){var d=typeof a,e=typeof b==="boolean";if(c.isFunction(a))return this.each(function(f){var h=c(this);h.toggleClass(a.call(this,f,h.attr("class"),b),b)});return this.each(function(){if(d==="string")for(var f,h=0,l=c(this),k=b,o=a.split(ha);f=o[h++];){k=e?k:!l.hasClass(f);l[k?"addClass":"removeClass"](f)}else if(d==="undefined"||d==="boolean"){this.className&&c.data(this,
51
+ "__className__",this.className);this.className=this.className||a===false?"":c.data(this,"__className__")||""}})},hasClass:function(a){a=" "+a+" ";for(var b=0,d=this.length;b<d;b++)if((" "+this[b].className+" ").replace(sa," ").indexOf(a)>-1)return true;return false},val:function(a){if(!arguments.length){var b=this[0];if(b){if(c.nodeName(b,"option")){var d=b.attributes.value;return!d||d.specified?b.value:b.text}if(c.nodeName(b,"select")){var e=b.selectedIndex;d=[];var f=b.options;b=b.type==="select-one";
52
+ if(e<0)return null;var h=b?e:0;for(e=b?e+1:f.length;h<e;h++){var l=f[h];if(l.selected&&(c.support.optDisabled?!l.disabled:l.getAttribute("disabled")===null)&&(!l.parentNode.disabled||!c.nodeName(l.parentNode,"optgroup"))){a=c(l).val();if(b)return a;d.push(a)}}return d}if(ta.test(b.type)&&!c.support.checkOn)return b.getAttribute("value")===null?"on":b.value;return(b.value||"").replace(Sa,"")}return B}var k=c.isFunction(a);return this.each(function(o){var x=c(this),r=a;if(this.nodeType===1){if(k)r=
53
+ a.call(this,o,x.val());if(r==null)r="";else if(typeof r==="number")r+="";else if(c.isArray(r))r=c.map(r,function(C){return C==null?"":C+""});if(c.isArray(r)&&ta.test(this.type))this.checked=c.inArray(x.val(),r)>=0;else if(c.nodeName(this,"select")){var A=c.makeArray(r);c("option",this).each(function(){this.selected=c.inArray(c(this).val(),A)>=0});if(!A.length)this.selectedIndex=-1}else this.value=r}})}});c.extend({attrFn:{val:true,css:true,html:true,text:true,data:true,width:true,height:true,offset:true},
54
+ attr:function(a,b,d,e){if(!a||a.nodeType===3||a.nodeType===8)return B;if(e&&b in c.attrFn)return c(a)[b](d);e=a.nodeType!==1||!c.isXMLDoc(a);var f=d!==B;b=e&&c.props[b]||b;var h=Ta.test(b);if((b in a||a[b]!==B)&&e&&!h){if(f){b==="type"&&Ua.test(a.nodeName)&&a.parentNode&&c.error("type property can't be changed");if(d===null)a.nodeType===1&&a.removeAttribute(b);else a[b]=d}if(c.nodeName(a,"form")&&a.getAttributeNode(b))return a.getAttributeNode(b).nodeValue;if(b==="tabIndex")return(b=a.getAttributeNode("tabIndex"))&&
55
+ b.specified?b.value:Va.test(a.nodeName)||Wa.test(a.nodeName)&&a.href?0:B;return a[b]}if(!c.support.style&&e&&b==="style"){if(f)a.style.cssText=""+d;return a.style.cssText}f&&a.setAttribute(b,""+d);if(!a.attributes[b]&&a.hasAttribute&&!a.hasAttribute(b))return B;a=!c.support.hrefNormalized&&e&&h?a.getAttribute(b,2):a.getAttribute(b);return a===null?B:a}});var X=/\.(.*)$/,ia=/^(?:textarea|input|select)$/i,La=/\./g,Ma=/ /g,Xa=/[^\w\s.|`]/g,Ya=function(a){return a.replace(Xa,"\\$&")},ua={focusin:0,focusout:0};
56
+ c.event={add:function(a,b,d,e){if(!(a.nodeType===3||a.nodeType===8)){if(c.isWindow(a)&&a!==E&&!a.frameElement)a=E;if(d===false)d=U;else if(!d)return;var f,h;if(d.handler){f=d;d=f.handler}if(!d.guid)d.guid=c.guid++;if(h=c.data(a)){var l=a.nodeType?"events":"__events__",k=h[l],o=h.handle;if(typeof k==="function"){o=k.handle;k=k.events}else if(!k){a.nodeType||(h[l]=h=function(){});h.events=k={}}if(!o)h.handle=o=function(){return typeof c!=="undefined"&&!c.event.triggered?c.event.handle.apply(o.elem,
57
+ arguments):B};o.elem=a;b=b.split(" ");for(var x=0,r;l=b[x++];){h=f?c.extend({},f):{handler:d,data:e};if(l.indexOf(".")>-1){r=l.split(".");l=r.shift();h.namespace=r.slice(0).sort().join(".")}else{r=[];h.namespace=""}h.type=l;if(!h.guid)h.guid=d.guid;var A=k[l],C=c.event.special[l]||{};if(!A){A=k[l]=[];if(!C.setup||C.setup.call(a,e,r,o)===false)if(a.addEventListener)a.addEventListener(l,o,false);else a.attachEvent&&a.attachEvent("on"+l,o)}if(C.add){C.add.call(a,h);if(!h.handler.guid)h.handler.guid=
58
+ d.guid}A.push(h);c.event.global[l]=true}a=null}}},global:{},remove:function(a,b,d,e){if(!(a.nodeType===3||a.nodeType===8)){if(d===false)d=U;var f,h,l=0,k,o,x,r,A,C,J=a.nodeType?"events":"__events__",w=c.data(a),I=w&&w[J];if(w&&I){if(typeof I==="function"){w=I;I=I.events}if(b&&b.type){d=b.handler;b=b.type}if(!b||typeof b==="string"&&b.charAt(0)==="."){b=b||"";for(f in I)c.event.remove(a,f+b)}else{for(b=b.split(" ");f=b[l++];){r=f;k=f.indexOf(".")<0;o=[];if(!k){o=f.split(".");f=o.shift();x=RegExp("(^|\\.)"+
59
+ c.map(o.slice(0).sort(),Ya).join("\\.(?:.*\\.)?")+"(\\.|$)")}if(A=I[f])if(d){r=c.event.special[f]||{};for(h=e||0;h<A.length;h++){C=A[h];if(d.guid===C.guid){if(k||x.test(C.namespace)){e==null&&A.splice(h--,1);r.remove&&r.remove.call(a,C)}if(e!=null)break}}if(A.length===0||e!=null&&A.length===1){if(!r.teardown||r.teardown.call(a,o)===false)c.removeEvent(a,f,w.handle);delete I[f]}}else for(h=0;h<A.length;h++){C=A[h];if(k||x.test(C.namespace)){c.event.remove(a,r,C.handler,h);A.splice(h--,1)}}}if(c.isEmptyObject(I)){if(b=
60
+ w.handle)b.elem=null;delete w.events;delete w.handle;if(typeof w==="function")c.removeData(a,J);else c.isEmptyObject(w)&&c.removeData(a)}}}}},trigger:function(a,b,d,e){var f=a.type||a;if(!e){a=typeof a==="object"?a[c.expando]?a:c.extend(c.Event(f),a):c.Event(f);if(f.indexOf("!")>=0){a.type=f=f.slice(0,-1);a.exclusive=true}if(!d){a.stopPropagation();c.event.global[f]&&c.each(c.cache,function(){this.events&&this.events[f]&&c.event.trigger(a,b,this.handle.elem)})}if(!d||d.nodeType===3||d.nodeType===
61
+ 8)return B;a.result=B;a.target=d;b=c.makeArray(b);b.unshift(a)}a.currentTarget=d;(e=d.nodeType?c.data(d,"handle"):(c.data(d,"__events__")||{}).handle)&&e.apply(d,b);e=d.parentNode||d.ownerDocument;try{if(!(d&&d.nodeName&&c.noData[d.nodeName.toLowerCase()]))if(d["on"+f]&&d["on"+f].apply(d,b)===false){a.result=false;a.preventDefault()}}catch(h){}if(!a.isPropagationStopped()&&e)c.event.trigger(a,b,e,true);else if(!a.isDefaultPrevented()){var l;e=a.target;var k=f.replace(X,""),o=c.nodeName(e,"a")&&k===
62
+ "click",x=c.event.special[k]||{};if((!x._default||x._default.call(d,a)===false)&&!o&&!(e&&e.nodeName&&c.noData[e.nodeName.toLowerCase()])){try{if(e[k]){if(l=e["on"+k])e["on"+k]=null;c.event.triggered=true;e[k]()}}catch(r){}if(l)e["on"+k]=l;c.event.triggered=false}}},handle:function(a){var b,d,e,f;d=[];var h=c.makeArray(arguments);a=h[0]=c.event.fix(a||E.event);a.currentTarget=this;b=a.type.indexOf(".")<0&&!a.exclusive;if(!b){e=a.type.split(".");a.type=e.shift();d=e.slice(0).sort();e=RegExp("(^|\\.)"+
63
+ d.join("\\.(?:.*\\.)?")+"(\\.|$)")}a.namespace=a.namespace||d.join(".");f=c.data(this,this.nodeType?"events":"__events__");if(typeof f==="function")f=f.events;d=(f||{})[a.type];if(f&&d){d=d.slice(0);f=0;for(var l=d.length;f<l;f++){var k=d[f];if(b||e.test(k.namespace)){a.handler=k.handler;a.data=k.data;a.handleObj=k;k=k.handler.apply(this,h);if(k!==B){a.result=k;if(k===false){a.preventDefault();a.stopPropagation()}}if(a.isImmediatePropagationStopped())break}}}return a.result},props:"altKey attrChange attrName bubbles button cancelable charCode clientX clientY ctrlKey currentTarget data detail eventPhase fromElement handler keyCode layerX layerY metaKey newValue offsetX offsetY pageX pageY prevValue relatedNode relatedTarget screenX screenY shiftKey srcElement target toElement view wheelDelta which".split(" "),
64
+ fix:function(a){if(a[c.expando])return a;var b=a;a=c.Event(b);for(var d=this.props.length,e;d;){e=this.props[--d];a[e]=b[e]}if(!a.target)a.target=a.srcElement||t;if(a.target.nodeType===3)a.target=a.target.parentNode;if(!a.relatedTarget&&a.fromElement)a.relatedTarget=a.fromElement===a.target?a.toElement:a.fromElement;if(a.pageX==null&&a.clientX!=null){b=t.documentElement;d=t.body;a.pageX=a.clientX+(b&&b.scrollLeft||d&&d.scrollLeft||0)-(b&&b.clientLeft||d&&d.clientLeft||0);a.pageY=a.clientY+(b&&b.scrollTop||
65
+ d&&d.scrollTop||0)-(b&&b.clientTop||d&&d.clientTop||0)}if(a.which==null&&(a.charCode!=null||a.keyCode!=null))a.which=a.charCode!=null?a.charCode:a.keyCode;if(!a.metaKey&&a.ctrlKey)a.metaKey=a.ctrlKey;if(!a.which&&a.button!==B)a.which=a.button&1?1:a.button&2?3:a.button&4?2:0;return a},guid:1E8,proxy:c.proxy,special:{ready:{setup:c.bindReady,teardown:c.noop},live:{add:function(a){c.event.add(this,Y(a.origType,a.selector),c.extend({},a,{handler:Ka,guid:a.handler.guid}))},remove:function(a){c.event.remove(this,
66
+ Y(a.origType,a.selector),a)}},beforeunload:{setup:function(a,b,d){if(c.isWindow(this))this.onbeforeunload=d},teardown:function(a,b){if(this.onbeforeunload===b)this.onbeforeunload=null}}}};c.removeEvent=t.removeEventListener?function(a,b,d){a.removeEventListener&&a.removeEventListener(b,d,false)}:function(a,b,d){a.detachEvent&&a.detachEvent("on"+b,d)};c.Event=function(a){if(!this.preventDefault)return new c.Event(a);if(a&&a.type){this.originalEvent=a;this.type=a.type}else this.type=a;this.timeStamp=
67
+ c.now();this[c.expando]=true};c.Event.prototype={preventDefault:function(){this.isDefaultPrevented=ca;var a=this.originalEvent;if(a)if(a.preventDefault)a.preventDefault();else a.returnValue=false},stopPropagation:function(){this.isPropagationStopped=ca;var a=this.originalEvent;if(a){a.stopPropagation&&a.stopPropagation();a.cancelBubble=true}},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=ca;this.stopPropagation()},isDefaultPrevented:U,isPropagationStopped:U,isImmediatePropagationStopped:U};
68
+ var va=function(a){var b=a.relatedTarget;try{for(;b&&b!==this;)b=b.parentNode;if(b!==this){a.type=a.data;c.event.handle.apply(this,arguments)}}catch(d){}},wa=function(a){a.type=a.data;c.event.handle.apply(this,arguments)};c.each({mouseenter:"mouseover",mouseleave:"mouseout"},function(a,b){c.event.special[a]={setup:function(d){c.event.add(this,b,d&&d.selector?wa:va,a)},teardown:function(d){c.event.remove(this,b,d&&d.selector?wa:va)}}});if(!c.support.submitBubbles)c.event.special.submit={setup:function(){if(this.nodeName.toLowerCase()!==
69
+ "form"){c.event.add(this,"click.specialSubmit",function(a){var b=a.target,d=b.type;if((d==="submit"||d==="image")&&c(b).closest("form").length){a.liveFired=B;return la("submit",this,arguments)}});c.event.add(this,"keypress.specialSubmit",function(a){var b=a.target,d=b.type;if((d==="text"||d==="password")&&c(b).closest("form").length&&a.keyCode===13){a.liveFired=B;return la("submit",this,arguments)}})}else return false},teardown:function(){c.event.remove(this,".specialSubmit")}};if(!c.support.changeBubbles){var V,
70
+ xa=function(a){var b=a.type,d=a.value;if(b==="radio"||b==="checkbox")d=a.checked;else if(b==="select-multiple")d=a.selectedIndex>-1?c.map(a.options,function(e){return e.selected}).join("-"):"";else if(a.nodeName.toLowerCase()==="select")d=a.selectedIndex;return d},Z=function(a,b){var d=a.target,e,f;if(!(!ia.test(d.nodeName)||d.readOnly)){e=c.data(d,"_change_data");f=xa(d);if(a.type!=="focusout"||d.type!=="radio")c.data(d,"_change_data",f);if(!(e===B||f===e))if(e!=null||f){a.type="change";a.liveFired=
71
+ B;return c.event.trigger(a,b,d)}}};c.event.special.change={filters:{focusout:Z,beforedeactivate:Z,click:function(a){var b=a.target,d=b.type;if(d==="radio"||d==="checkbox"||b.nodeName.toLowerCase()==="select")return Z.call(this,a)},keydown:function(a){var b=a.target,d=b.type;if(a.keyCode===13&&b.nodeName.toLowerCase()!=="textarea"||a.keyCode===32&&(d==="checkbox"||d==="radio")||d==="select-multiple")return Z.call(this,a)},beforeactivate:function(a){a=a.target;c.data(a,"_change_data",xa(a))}},setup:function(){if(this.type===
72
+ "file")return false;for(var a in V)c.event.add(this,a+".specialChange",V[a]);return ia.test(this.nodeName)},teardown:function(){c.event.remove(this,".specialChange");return ia.test(this.nodeName)}};V=c.event.special.change.filters;V.focus=V.beforeactivate}t.addEventListener&&c.each({focus:"focusin",blur:"focusout"},function(a,b){function d(e){e=c.event.fix(e);e.type=b;return c.event.trigger(e,null,e.target)}c.event.special[b]={setup:function(){ua[b]++===0&&t.addEventListener(a,d,true)},teardown:function(){--ua[b]===
73
+ 0&&t.removeEventListener(a,d,true)}}});c.each(["bind","one"],function(a,b){c.fn[b]=function(d,e,f){if(typeof d==="object"){for(var h in d)this[b](h,e,d[h],f);return this}if(c.isFunction(e)||e===false){f=e;e=B}var l=b==="one"?c.proxy(f,function(o){c(this).unbind(o,l);return f.apply(this,arguments)}):f;if(d==="unload"&&b!=="one")this.one(d,e,f);else{h=0;for(var k=this.length;h<k;h++)c.event.add(this[h],d,l,e)}return this}});c.fn.extend({unbind:function(a,b){if(typeof a==="object"&&!a.preventDefault)for(var d in a)this.unbind(d,
74
+ a[d]);else{d=0;for(var e=this.length;d<e;d++)c.event.remove(this[d],a,b)}return this},delegate:function(a,b,d,e){return this.live(b,d,e,a)},undelegate:function(a,b,d){return arguments.length===0?this.unbind("live"):this.die(b,null,d,a)},trigger:function(a,b){return this.each(function(){c.event.trigger(a,b,this)})},triggerHandler:function(a,b){if(this[0]){var d=c.Event(a);d.preventDefault();d.stopPropagation();c.event.trigger(d,b,this[0]);return d.result}},toggle:function(a){for(var b=arguments,d=
75
+ 1;d<b.length;)c.proxy(a,b[d++]);return this.click(c.proxy(a,function(e){var f=(c.data(this,"lastToggle"+a.guid)||0)%d;c.data(this,"lastToggle"+a.guid,f+1);e.preventDefault();return b[f].apply(this,arguments)||false}))},hover:function(a,b){return this.mouseenter(a).mouseleave(b||a)}});var ya={focus:"focusin",blur:"focusout",mouseenter:"mouseover",mouseleave:"mouseout"};c.each(["live","die"],function(a,b){c.fn[b]=function(d,e,f,h){var l,k=0,o,x,r=h||this.selector;h=h?this:c(this.context);if(typeof d===
76
+ "object"&&!d.preventDefault){for(l in d)h[b](l,e,d[l],r);return this}if(c.isFunction(e)){f=e;e=B}for(d=(d||"").split(" ");(l=d[k++])!=null;){o=X.exec(l);x="";if(o){x=o[0];l=l.replace(X,"")}if(l==="hover")d.push("mouseenter"+x,"mouseleave"+x);else{o=l;if(l==="focus"||l==="blur"){d.push(ya[l]+x);l+=x}else l=(ya[l]||l)+x;if(b==="live"){x=0;for(var A=h.length;x<A;x++)c.event.add(h[x],"live."+Y(l,r),{data:e,selector:r,handler:f,origType:l,origHandler:f,preType:o})}else h.unbind("live."+Y(l,r),f)}}return this}});
77
+ c.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error".split(" "),function(a,b){c.fn[b]=function(d,e){if(e==null){e=d;d=null}return arguments.length>0?this.bind(b,d,e):this.trigger(b)};if(c.attrFn)c.attrFn[b]=true});E.attachEvent&&!E.addEventListener&&c(E).bind("unload",function(){for(var a in c.cache)if(c.cache[a].handle)try{c.event.remove(c.cache[a].handle.elem)}catch(b){}});
78
+ (function(){function a(g,i,n,m,p,q){p=0;for(var u=m.length;p<u;p++){var y=m[p];if(y){var F=false;for(y=y[g];y;){if(y.sizcache===n){F=m[y.sizset];break}if(y.nodeType===1&&!q){y.sizcache=n;y.sizset=p}if(y.nodeName.toLowerCase()===i){F=y;break}y=y[g]}m[p]=F}}}function b(g,i,n,m,p,q){p=0;for(var u=m.length;p<u;p++){var y=m[p];if(y){var F=false;for(y=y[g];y;){if(y.sizcache===n){F=m[y.sizset];break}if(y.nodeType===1){if(!q){y.sizcache=n;y.sizset=p}if(typeof i!=="string"){if(y===i){F=true;break}}else if(k.filter(i,
79
+ [y]).length>0){F=y;break}}y=y[g]}m[p]=F}}}var d=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^\[\]]*\]|['"][^'"]*['"]|[^\[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,e=0,f=Object.prototype.toString,h=false,l=true;[0,0].sort(function(){l=false;return 0});var k=function(g,i,n,m){n=n||[];var p=i=i||t;if(i.nodeType!==1&&i.nodeType!==9)return[];if(!g||typeof g!=="string")return n;var q,u,y,F,M,N=true,O=k.isXML(i),D=[],R=g;do{d.exec("");if(q=d.exec(R)){R=q[3];D.push(q[1]);if(q[2]){F=q[3];
80
+ break}}}while(q);if(D.length>1&&x.exec(g))if(D.length===2&&o.relative[D[0]])u=L(D[0]+D[1],i);else for(u=o.relative[D[0]]?[i]:k(D.shift(),i);D.length;){g=D.shift();if(o.relative[g])g+=D.shift();u=L(g,u)}else{if(!m&&D.length>1&&i.nodeType===9&&!O&&o.match.ID.test(D[0])&&!o.match.ID.test(D[D.length-1])){q=k.find(D.shift(),i,O);i=q.expr?k.filter(q.expr,q.set)[0]:q.set[0]}if(i){q=m?{expr:D.pop(),set:C(m)}:k.find(D.pop(),D.length===1&&(D[0]==="~"||D[0]==="+")&&i.parentNode?i.parentNode:i,O);u=q.expr?k.filter(q.expr,
81
+ q.set):q.set;if(D.length>0)y=C(u);else N=false;for(;D.length;){q=M=D.pop();if(o.relative[M])q=D.pop();else M="";if(q==null)q=i;o.relative[M](y,q,O)}}else y=[]}y||(y=u);y||k.error(M||g);if(f.call(y)==="[object Array]")if(N)if(i&&i.nodeType===1)for(g=0;y[g]!=null;g++){if(y[g]&&(y[g]===true||y[g].nodeType===1&&k.contains(i,y[g])))n.push(u[g])}else for(g=0;y[g]!=null;g++)y[g]&&y[g].nodeType===1&&n.push(u[g]);else n.push.apply(n,y);else C(y,n);if(F){k(F,p,n,m);k.uniqueSort(n)}return n};k.uniqueSort=function(g){if(w){h=
82
+ l;g.sort(w);if(h)for(var i=1;i<g.length;i++)g[i]===g[i-1]&&g.splice(i--,1)}return g};k.matches=function(g,i){return k(g,null,null,i)};k.matchesSelector=function(g,i){return k(i,null,null,[g]).length>0};k.find=function(g,i,n){var m;if(!g)return[];for(var p=0,q=o.order.length;p<q;p++){var u,y=o.order[p];if(u=o.leftMatch[y].exec(g)){var F=u[1];u.splice(1,1);if(F.substr(F.length-1)!=="\\"){u[1]=(u[1]||"").replace(/\\/g,"");m=o.find[y](u,i,n);if(m!=null){g=g.replace(o.match[y],"");break}}}}m||(m=i.getElementsByTagName("*"));
83
+ return{set:m,expr:g}};k.filter=function(g,i,n,m){for(var p,q,u=g,y=[],F=i,M=i&&i[0]&&k.isXML(i[0]);g&&i.length;){for(var N in o.filter)if((p=o.leftMatch[N].exec(g))!=null&&p[2]){var O,D,R=o.filter[N];D=p[1];q=false;p.splice(1,1);if(D.substr(D.length-1)!=="\\"){if(F===y)y=[];if(o.preFilter[N])if(p=o.preFilter[N](p,F,n,y,m,M)){if(p===true)continue}else q=O=true;if(p)for(var j=0;(D=F[j])!=null;j++)if(D){O=R(D,p,j,F);var s=m^!!O;if(n&&O!=null)if(s)q=true;else F[j]=false;else if(s){y.push(D);q=true}}if(O!==
84
+ B){n||(F=y);g=g.replace(o.match[N],"");if(!q)return[];break}}}if(g===u)if(q==null)k.error(g);else break;u=g}return F};k.error=function(g){throw"Syntax error, unrecognized expression: "+g;};var o=k.selectors={order:["ID","NAME","TAG"],match:{ID:/#((?:[\w\u00c0-\uFFFF\-]|\\.)+)/,CLASS:/\.((?:[\w\u00c0-\uFFFF\-]|\\.)+)/,NAME:/\[name=['"]*((?:[\w\u00c0-\uFFFF\-]|\\.)+)['"]*\]/,ATTR:/\[\s*((?:[\w\u00c0-\uFFFF\-]|\\.)+)\s*(?:(\S?=)\s*(['"]*)(.*?)\3|)\s*\]/,TAG:/^((?:[\w\u00c0-\uFFFF\*\-]|\\.)+)/,CHILD:/:(only|nth|last|first)-child(?:\((even|odd|[\dn+\-]*)\))?/,
85
+ POS:/:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^\-]|$)/,PSEUDO:/:((?:[\w\u00c0-\uFFFF\-]|\\.)+)(?:\((['"]?)((?:\([^\)]+\)|[^\(\)]*)+)\2\))?/},leftMatch:{},attrMap:{"class":"className","for":"htmlFor"},attrHandle:{href:function(g){return g.getAttribute("href")}},relative:{"+":function(g,i){var n=typeof i==="string",m=n&&!/\W/.test(i);n=n&&!m;if(m)i=i.toLowerCase();m=0;for(var p=g.length,q;m<p;m++)if(q=g[m]){for(;(q=q.previousSibling)&&q.nodeType!==1;);g[m]=n||q&&q.nodeName.toLowerCase()===
86
+ i?q||false:q===i}n&&k.filter(i,g,true)},">":function(g,i){var n,m=typeof i==="string",p=0,q=g.length;if(m&&!/\W/.test(i))for(i=i.toLowerCase();p<q;p++){if(n=g[p]){n=n.parentNode;g[p]=n.nodeName.toLowerCase()===i?n:false}}else{for(;p<q;p++)if(n=g[p])g[p]=m?n.parentNode:n.parentNode===i;m&&k.filter(i,g,true)}},"":function(g,i,n){var m,p=e++,q=b;if(typeof i==="string"&&!/\W/.test(i)){m=i=i.toLowerCase();q=a}q("parentNode",i,p,g,m,n)},"~":function(g,i,n){var m,p=e++,q=b;if(typeof i==="string"&&!/\W/.test(i)){m=
87
+ i=i.toLowerCase();q=a}q("previousSibling",i,p,g,m,n)}},find:{ID:function(g,i,n){if(typeof i.getElementById!=="undefined"&&!n)return(g=i.getElementById(g[1]))&&g.parentNode?[g]:[]},NAME:function(g,i){if(typeof i.getElementsByName!=="undefined"){for(var n=[],m=i.getElementsByName(g[1]),p=0,q=m.length;p<q;p++)m[p].getAttribute("name")===g[1]&&n.push(m[p]);return n.length===0?null:n}},TAG:function(g,i){return i.getElementsByTagName(g[1])}},preFilter:{CLASS:function(g,i,n,m,p,q){g=" "+g[1].replace(/\\/g,
88
+ "")+" ";if(q)return g;q=0;for(var u;(u=i[q])!=null;q++)if(u)if(p^(u.className&&(" "+u.className+" ").replace(/[\t\n]/g," ").indexOf(g)>=0))n||m.push(u);else if(n)i[q]=false;return false},ID:function(g){return g[1].replace(/\\/g,"")},TAG:function(g){return g[1].toLowerCase()},CHILD:function(g){if(g[1]==="nth"){var i=/(-?)(\d*)n((?:\+|-)?\d*)/.exec(g[2]==="even"&&"2n"||g[2]==="odd"&&"2n+1"||!/\D/.test(g[2])&&"0n+"+g[2]||g[2]);g[2]=i[1]+(i[2]||1)-0;g[3]=i[3]-0}g[0]=e++;return g},ATTR:function(g,i,n,
89
+ m,p,q){i=g[1].replace(/\\/g,"");if(!q&&o.attrMap[i])g[1]=o.attrMap[i];if(g[2]==="~=")g[4]=" "+g[4]+" ";return g},PSEUDO:function(g,i,n,m,p){if(g[1]==="not")if((d.exec(g[3])||"").length>1||/^\w/.test(g[3]))g[3]=k(g[3],null,null,i);else{g=k.filter(g[3],i,n,true^p);n||m.push.apply(m,g);return false}else if(o.match.POS.test(g[0])||o.match.CHILD.test(g[0]))return true;return g},POS:function(g){g.unshift(true);return g}},filters:{enabled:function(g){return g.disabled===false&&g.type!=="hidden"},disabled:function(g){return g.disabled===
90
+ true},checked:function(g){return g.checked===true},selected:function(g){return g.selected===true},parent:function(g){return!!g.firstChild},empty:function(g){return!g.firstChild},has:function(g,i,n){return!!k(n[3],g).length},header:function(g){return/h\d/i.test(g.nodeName)},text:function(g){return"text"===g.type},radio:function(g){return"radio"===g.type},checkbox:function(g){return"checkbox"===g.type},file:function(g){return"file"===g.type},password:function(g){return"password"===g.type},submit:function(g){return"submit"===
91
+ g.type},image:function(g){return"image"===g.type},reset:function(g){return"reset"===g.type},button:function(g){return"button"===g.type||g.nodeName.toLowerCase()==="button"},input:function(g){return/input|select|textarea|button/i.test(g.nodeName)}},setFilters:{first:function(g,i){return i===0},last:function(g,i,n,m){return i===m.length-1},even:function(g,i){return i%2===0},odd:function(g,i){return i%2===1},lt:function(g,i,n){return i<n[3]-0},gt:function(g,i,n){return i>n[3]-0},nth:function(g,i,n){return n[3]-
92
+ 0===i},eq:function(g,i,n){return n[3]-0===i}},filter:{PSEUDO:function(g,i,n,m){var p=i[1],q=o.filters[p];if(q)return q(g,n,i,m);else if(p==="contains")return(g.textContent||g.innerText||k.getText([g])||"").indexOf(i[3])>=0;else if(p==="not"){i=i[3];n=0;for(m=i.length;n<m;n++)if(i[n]===g)return false;return true}else k.error("Syntax error, unrecognized expression: "+p)},CHILD:function(g,i){var n=i[1],m=g;switch(n){case "only":case "first":for(;m=m.previousSibling;)if(m.nodeType===1)return false;if(n===
93
+ "first")return true;m=g;case "last":for(;m=m.nextSibling;)if(m.nodeType===1)return false;return true;case "nth":n=i[2];var p=i[3];if(n===1&&p===0)return true;var q=i[0],u=g.parentNode;if(u&&(u.sizcache!==q||!g.nodeIndex)){var y=0;for(m=u.firstChild;m;m=m.nextSibling)if(m.nodeType===1)m.nodeIndex=++y;u.sizcache=q}m=g.nodeIndex-p;return n===0?m===0:m%n===0&&m/n>=0}},ID:function(g,i){return g.nodeType===1&&g.getAttribute("id")===i},TAG:function(g,i){return i==="*"&&g.nodeType===1||g.nodeName.toLowerCase()===
94
+ i},CLASS:function(g,i){return(" "+(g.className||g.getAttribute("class"))+" ").indexOf(i)>-1},ATTR:function(g,i){var n=i[1];n=o.attrHandle[n]?o.attrHandle[n](g):g[n]!=null?g[n]:g.getAttribute(n);var m=n+"",p=i[2],q=i[4];return n==null?p==="!=":p==="="?m===q:p==="*="?m.indexOf(q)>=0:p==="~="?(" "+m+" ").indexOf(q)>=0:!q?m&&n!==false:p==="!="?m!==q:p==="^="?m.indexOf(q)===0:p==="$="?m.substr(m.length-q.length)===q:p==="|="?m===q||m.substr(0,q.length+1)===q+"-":false},POS:function(g,i,n,m){var p=o.setFilters[i[2]];
95
+ if(p)return p(g,n,i,m)}}},x=o.match.POS,r=function(g,i){return"\\"+(i-0+1)},A;for(A in o.match){o.match[A]=RegExp(o.match[A].source+/(?![^\[]*\])(?![^\(]*\))/.source);o.leftMatch[A]=RegExp(/(^(?:.|\r|\n)*?)/.source+o.match[A].source.replace(/\\(\d+)/g,r))}var C=function(g,i){g=Array.prototype.slice.call(g,0);if(i){i.push.apply(i,g);return i}return g};try{Array.prototype.slice.call(t.documentElement.childNodes,0)}catch(J){C=function(g,i){var n=0,m=i||[];if(f.call(g)==="[object Array]")Array.prototype.push.apply(m,
96
+ g);else if(typeof g.length==="number")for(var p=g.length;n<p;n++)m.push(g[n]);else for(;g[n];n++)m.push(g[n]);return m}}var w,I;if(t.documentElement.compareDocumentPosition)w=function(g,i){if(g===i){h=true;return 0}if(!g.compareDocumentPosition||!i.compareDocumentPosition)return g.compareDocumentPosition?-1:1;return g.compareDocumentPosition(i)&4?-1:1};else{w=function(g,i){var n,m,p=[],q=[];n=g.parentNode;m=i.parentNode;var u=n;if(g===i){h=true;return 0}else if(n===m)return I(g,i);else if(n){if(!m)return 1}else return-1;
97
+ for(;u;){p.unshift(u);u=u.parentNode}for(u=m;u;){q.unshift(u);u=u.parentNode}n=p.length;m=q.length;for(u=0;u<n&&u<m;u++)if(p[u]!==q[u])return I(p[u],q[u]);return u===n?I(g,q[u],-1):I(p[u],i,1)};I=function(g,i,n){if(g===i)return n;for(g=g.nextSibling;g;){if(g===i)return-1;g=g.nextSibling}return 1}}k.getText=function(g){for(var i="",n,m=0;g[m];m++){n=g[m];if(n.nodeType===3||n.nodeType===4)i+=n.nodeValue;else if(n.nodeType!==8)i+=k.getText(n.childNodes)}return i};(function(){var g=t.createElement("div"),
98
+ i="script"+(new Date).getTime(),n=t.documentElement;g.innerHTML="<a name='"+i+"'/>";n.insertBefore(g,n.firstChild);if(t.getElementById(i)){o.find.ID=function(m,p,q){if(typeof p.getElementById!=="undefined"&&!q)return(p=p.getElementById(m[1]))?p.id===m[1]||typeof p.getAttributeNode!=="undefined"&&p.getAttributeNode("id").nodeValue===m[1]?[p]:B:[]};o.filter.ID=function(m,p){var q=typeof m.getAttributeNode!=="undefined"&&m.getAttributeNode("id");return m.nodeType===1&&q&&q.nodeValue===p}}n.removeChild(g);
99
+ n=g=null})();(function(){var g=t.createElement("div");g.appendChild(t.createComment(""));if(g.getElementsByTagName("*").length>0)o.find.TAG=function(i,n){var m=n.getElementsByTagName(i[1]);if(i[1]==="*"){for(var p=[],q=0;m[q];q++)m[q].nodeType===1&&p.push(m[q]);m=p}return m};g.innerHTML="<a href='#'></a>";if(g.firstChild&&typeof g.firstChild.getAttribute!=="undefined"&&g.firstChild.getAttribute("href")!=="#")o.attrHandle.href=function(i){return i.getAttribute("href",2)};g=null})();t.querySelectorAll&&
100
+ function(){var g=k,i=t.createElement("div");i.innerHTML="<p class='TEST'></p>";if(!(i.querySelectorAll&&i.querySelectorAll(".TEST").length===0)){k=function(m,p,q,u){p=p||t;m=m.replace(/\=\s*([^'"\]]*)\s*\]/g,"='$1']");if(!u&&!k.isXML(p))if(p.nodeType===9)try{return C(p.querySelectorAll(m),q)}catch(y){}else if(p.nodeType===1&&p.nodeName.toLowerCase()!=="object"){var F=p.getAttribute("id"),M=F||"__sizzle__";F||p.setAttribute("id",M);try{return C(p.querySelectorAll("#"+M+" "+m),q)}catch(N){}finally{F||
101
+ p.removeAttribute("id")}}return g(m,p,q,u)};for(var n in g)k[n]=g[n];i=null}}();(function(){var g=t.documentElement,i=g.matchesSelector||g.mozMatchesSelector||g.webkitMatchesSelector||g.msMatchesSelector,n=false;try{i.call(t.documentElement,"[test!='']:sizzle")}catch(m){n=true}if(i)k.matchesSelector=function(p,q){q=q.replace(/\=\s*([^'"\]]*)\s*\]/g,"='$1']");if(!k.isXML(p))try{if(n||!o.match.PSEUDO.test(q)&&!/!=/.test(q))return i.call(p,q)}catch(u){}return k(q,null,null,[p]).length>0}})();(function(){var g=
102
+ t.createElement("div");g.innerHTML="<div class='test e'></div><div class='test'></div>";if(!(!g.getElementsByClassName||g.getElementsByClassName("e").length===0)){g.lastChild.className="e";if(g.getElementsByClassName("e").length!==1){o.order.splice(1,0,"CLASS");o.find.CLASS=function(i,n,m){if(typeof n.getElementsByClassName!=="undefined"&&!m)return n.getElementsByClassName(i[1])};g=null}}})();k.contains=t.documentElement.contains?function(g,i){return g!==i&&(g.contains?g.contains(i):true)}:t.documentElement.compareDocumentPosition?
103
+ function(g,i){return!!(g.compareDocumentPosition(i)&16)}:function(){return false};k.isXML=function(g){return(g=(g?g.ownerDocument||g:0).documentElement)?g.nodeName!=="HTML":false};var L=function(g,i){for(var n,m=[],p="",q=i.nodeType?[i]:i;n=o.match.PSEUDO.exec(g);){p+=n[0];g=g.replace(o.match.PSEUDO,"")}g=o.relative[g]?g+"*":g;n=0;for(var u=q.length;n<u;n++)k(g,q[n],m);return k.filter(p,m)};c.find=k;c.expr=k.selectors;c.expr[":"]=c.expr.filters;c.unique=k.uniqueSort;c.text=k.getText;c.isXMLDoc=k.isXML;
104
+ c.contains=k.contains})();var Za=/Until$/,$a=/^(?:parents|prevUntil|prevAll)/,ab=/,/,Na=/^.[^:#\[\.,]*$/,bb=Array.prototype.slice,cb=c.expr.match.POS;c.fn.extend({find:function(a){for(var b=this.pushStack("","find",a),d=0,e=0,f=this.length;e<f;e++){d=b.length;c.find(a,this[e],b);if(e>0)for(var h=d;h<b.length;h++)for(var l=0;l<d;l++)if(b[l]===b[h]){b.splice(h--,1);break}}return b},has:function(a){var b=c(a);return this.filter(function(){for(var d=0,e=b.length;d<e;d++)if(c.contains(this,b[d]))return true})},
105
+ not:function(a){return this.pushStack(ma(this,a,false),"not",a)},filter:function(a){return this.pushStack(ma(this,a,true),"filter",a)},is:function(a){return!!a&&c.filter(a,this).length>0},closest:function(a,b){var d=[],e,f,h=this[0];if(c.isArray(a)){var l,k={},o=1;if(h&&a.length){e=0;for(f=a.length;e<f;e++){l=a[e];k[l]||(k[l]=c.expr.match.POS.test(l)?c(l,b||this.context):l)}for(;h&&h.ownerDocument&&h!==b;){for(l in k){e=k[l];if(e.jquery?e.index(h)>-1:c(h).is(e))d.push({selector:l,elem:h,level:o})}h=
106
+ h.parentNode;o++}}return d}l=cb.test(a)?c(a,b||this.context):null;e=0;for(f=this.length;e<f;e++)for(h=this[e];h;)if(l?l.index(h)>-1:c.find.matchesSelector(h,a)){d.push(h);break}else{h=h.parentNode;if(!h||!h.ownerDocument||h===b)break}d=d.length>1?c.unique(d):d;return this.pushStack(d,"closest",a)},index:function(a){if(!a||typeof a==="string")return c.inArray(this[0],a?c(a):this.parent().children());return c.inArray(a.jquery?a[0]:a,this)},add:function(a,b){var d=typeof a==="string"?c(a,b||this.context):
107
+ c.makeArray(a),e=c.merge(this.get(),d);return this.pushStack(!d[0]||!d[0].parentNode||d[0].parentNode.nodeType===11||!e[0]||!e[0].parentNode||e[0].parentNode.nodeType===11?e:c.unique(e))},andSelf:function(){return this.add(this.prevObject)}});c.each({parent:function(a){return(a=a.parentNode)&&a.nodeType!==11?a:null},parents:function(a){return c.dir(a,"parentNode")},parentsUntil:function(a,b,d){return c.dir(a,"parentNode",d)},next:function(a){return c.nth(a,2,"nextSibling")},prev:function(a){return c.nth(a,
108
+ 2,"previousSibling")},nextAll:function(a){return c.dir(a,"nextSibling")},prevAll:function(a){return c.dir(a,"previousSibling")},nextUntil:function(a,b,d){return c.dir(a,"nextSibling",d)},prevUntil:function(a,b,d){return c.dir(a,"previousSibling",d)},siblings:function(a){return c.sibling(a.parentNode.firstChild,a)},children:function(a){return c.sibling(a.firstChild)},contents:function(a){return c.nodeName(a,"iframe")?a.contentDocument||a.contentWindow.document:c.makeArray(a.childNodes)}},function(a,
109
+ b){c.fn[a]=function(d,e){var f=c.map(this,b,d);Za.test(a)||(e=d);if(e&&typeof e==="string")f=c.filter(e,f);f=this.length>1?c.unique(f):f;if((this.length>1||ab.test(e))&&$a.test(a))f=f.reverse();return this.pushStack(f,a,bb.call(arguments).join(","))}});c.extend({filter:function(a,b,d){if(d)a=":not("+a+")";return b.length===1?c.find.matchesSelector(b[0],a)?[b[0]]:[]:c.find.matches(a,b)},dir:function(a,b,d){var e=[];for(a=a[b];a&&a.nodeType!==9&&(d===B||a.nodeType!==1||!c(a).is(d));){a.nodeType===1&&
110
+ e.push(a);a=a[b]}return e},nth:function(a,b,d){b=b||1;for(var e=0;a;a=a[d])if(a.nodeType===1&&++e===b)break;return a},sibling:function(a,b){for(var d=[];a;a=a.nextSibling)a.nodeType===1&&a!==b&&d.push(a);return d}});var za=/ jQuery\d+="(?:\d+|null)"/g,$=/^\s+/,Aa=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/ig,Ba=/<([\w:]+)/,db=/<tbody/i,eb=/<|&#?\w+;/,Ca=/<(?:script|object|embed|option|style)/i,Da=/checked\s*(?:[^=]|=\s*.checked.)/i,fb=/\=([^="'>\s]+\/)>/g,P={option:[1,
111
+ "<select multiple='multiple'>","</select>"],legend:[1,"<fieldset>","</fieldset>"],thead:[1,"<table>","</table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],col:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],area:[1,"<map>","</map>"],_default:[0,"",""]};P.optgroup=P.option;P.tbody=P.tfoot=P.colgroup=P.caption=P.thead;P.th=P.td;if(!c.support.htmlSerialize)P._default=[1,"div<div>","</div>"];c.fn.extend({text:function(a){if(c.isFunction(a))return this.each(function(b){var d=
112
+ c(this);d.text(a.call(this,b,d.text()))});if(typeof a!=="object"&&a!==B)return this.empty().append((this[0]&&this[0].ownerDocument||t).createTextNode(a));return c.text(this)},wrapAll:function(a){if(c.isFunction(a))return this.each(function(d){c(this).wrapAll(a.call(this,d))});if(this[0]){var b=c(a,this[0].ownerDocument).eq(0).clone(true);this[0].parentNode&&b.insertBefore(this[0]);b.map(function(){for(var d=this;d.firstChild&&d.firstChild.nodeType===1;)d=d.firstChild;return d}).append(this)}return this},
113
+ wrapInner:function(a){if(c.isFunction(a))return this.each(function(b){c(this).wrapInner(a.call(this,b))});return this.each(function(){var b=c(this),d=b.contents();d.length?d.wrapAll(a):b.append(a)})},wrap:function(a){return this.each(function(){c(this).wrapAll(a)})},unwrap:function(){return this.parent().each(function(){c.nodeName(this,"body")||c(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments,true,function(a){this.nodeType===1&&this.appendChild(a)})},
114
+ prepend:function(){return this.domManip(arguments,true,function(a){this.nodeType===1&&this.insertBefore(a,this.firstChild)})},before:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,false,function(b){this.parentNode.insertBefore(b,this)});else if(arguments.length){var a=c(arguments[0]);a.push.apply(a,this.toArray());return this.pushStack(a,"before",arguments)}},after:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,false,function(b){this.parentNode.insertBefore(b,
115
+ this.nextSibling)});else if(arguments.length){var a=this.pushStack(this,"after",arguments);a.push.apply(a,c(arguments[0]).toArray());return a}},remove:function(a,b){for(var d=0,e;(e=this[d])!=null;d++)if(!a||c.filter(a,[e]).length){if(!b&&e.nodeType===1){c.cleanData(e.getElementsByTagName("*"));c.cleanData([e])}e.parentNode&&e.parentNode.removeChild(e)}return this},empty:function(){for(var a=0,b;(b=this[a])!=null;a++)for(b.nodeType===1&&c.cleanData(b.getElementsByTagName("*"));b.firstChild;)b.removeChild(b.firstChild);
116
+ return this},clone:function(a){var b=this.map(function(){if(!c.support.noCloneEvent&&!c.isXMLDoc(this)){var d=this.outerHTML,e=this.ownerDocument;if(!d){d=e.createElement("div");d.appendChild(this.cloneNode(true));d=d.innerHTML}return c.clean([d.replace(za,"").replace(fb,'="$1">').replace($,"")],e)[0]}else return this.cloneNode(true)});if(a===true){na(this,b);na(this.find("*"),b.find("*"))}return b},html:function(a){if(a===B)return this[0]&&this[0].nodeType===1?this[0].innerHTML.replace(za,""):null;
117
+ else if(typeof a==="string"&&!Ca.test(a)&&(c.support.leadingWhitespace||!$.test(a))&&!P[(Ba.exec(a)||["",""])[1].toLowerCase()]){a=a.replace(Aa,"<$1></$2>");try{for(var b=0,d=this.length;b<d;b++)if(this[b].nodeType===1){c.cleanData(this[b].getElementsByTagName("*"));this[b].innerHTML=a}}catch(e){this.empty().append(a)}}else c.isFunction(a)?this.each(function(f){var h=c(this);h.html(a.call(this,f,h.html()))}):this.empty().append(a);return this},replaceWith:function(a){if(this[0]&&this[0].parentNode){if(c.isFunction(a))return this.each(function(b){var d=
118
+ c(this),e=d.html();d.replaceWith(a.call(this,b,e))});if(typeof a!=="string")a=c(a).detach();return this.each(function(){var b=this.nextSibling,d=this.parentNode;c(this).remove();b?c(b).before(a):c(d).append(a)})}else return this.pushStack(c(c.isFunction(a)?a():a),"replaceWith",a)},detach:function(a){return this.remove(a,true)},domManip:function(a,b,d){var e,f,h,l=a[0],k=[];if(!c.support.checkClone&&arguments.length===3&&typeof l==="string"&&Da.test(l))return this.each(function(){c(this).domManip(a,
119
+ b,d,true)});if(c.isFunction(l))return this.each(function(x){var r=c(this);a[0]=l.call(this,x,b?r.html():B);r.domManip(a,b,d)});if(this[0]){e=l&&l.parentNode;e=c.support.parentNode&&e&&e.nodeType===11&&e.childNodes.length===this.length?{fragment:e}:c.buildFragment(a,this,k);h=e.fragment;if(f=h.childNodes.length===1?h=h.firstChild:h.firstChild){b=b&&c.nodeName(f,"tr");f=0;for(var o=this.length;f<o;f++)d.call(b?c.nodeName(this[f],"table")?this[f].getElementsByTagName("tbody")[0]||this[f].appendChild(this[f].ownerDocument.createElement("tbody")):
120
+ this[f]:this[f],f>0||e.cacheable||this.length>1?h.cloneNode(true):h)}k.length&&c.each(k,Oa)}return this}});c.buildFragment=function(a,b,d){var e,f,h;b=b&&b[0]?b[0].ownerDocument||b[0]:t;if(a.length===1&&typeof a[0]==="string"&&a[0].length<512&&b===t&&!Ca.test(a[0])&&(c.support.checkClone||!Da.test(a[0]))){f=true;if(h=c.fragments[a[0]])if(h!==1)e=h}if(!e){e=b.createDocumentFragment();c.clean(a,b,e,d)}if(f)c.fragments[a[0]]=h?e:1;return{fragment:e,cacheable:f}};c.fragments={};c.each({appendTo:"append",
121
+ prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(a,b){c.fn[a]=function(d){var e=[];d=c(d);var f=this.length===1&&this[0].parentNode;if(f&&f.nodeType===11&&f.childNodes.length===1&&d.length===1){d[b](this[0]);return this}else{f=0;for(var h=d.length;f<h;f++){var l=(f>0?this.clone(true):this).get();c(d[f])[b](l);e=e.concat(l)}return this.pushStack(e,a,d.selector)}}});c.extend({clean:function(a,b,d,e){b=b||t;if(typeof b.createElement==="undefined")b=b.ownerDocument||
122
+ b[0]&&b[0].ownerDocument||t;for(var f=[],h=0,l;(l=a[h])!=null;h++){if(typeof l==="number")l+="";if(l){if(typeof l==="string"&&!eb.test(l))l=b.createTextNode(l);else if(typeof l==="string"){l=l.replace(Aa,"<$1></$2>");var k=(Ba.exec(l)||["",""])[1].toLowerCase(),o=P[k]||P._default,x=o[0],r=b.createElement("div");for(r.innerHTML=o[1]+l+o[2];x--;)r=r.lastChild;if(!c.support.tbody){x=db.test(l);k=k==="table"&&!x?r.firstChild&&r.firstChild.childNodes:o[1]==="<table>"&&!x?r.childNodes:[];for(o=k.length-
123
+ 1;o>=0;--o)c.nodeName(k[o],"tbody")&&!k[o].childNodes.length&&k[o].parentNode.removeChild(k[o])}!c.support.leadingWhitespace&&$.test(l)&&r.insertBefore(b.createTextNode($.exec(l)[0]),r.firstChild);l=r.childNodes}if(l.nodeType)f.push(l);else f=c.merge(f,l)}}if(d)for(h=0;f[h];h++)if(e&&c.nodeName(f[h],"script")&&(!f[h].type||f[h].type.toLowerCase()==="text/javascript"))e.push(f[h].parentNode?f[h].parentNode.removeChild(f[h]):f[h]);else{f[h].nodeType===1&&f.splice.apply(f,[h+1,0].concat(c.makeArray(f[h].getElementsByTagName("script"))));
124
+ d.appendChild(f[h])}return f},cleanData:function(a){for(var b,d,e=c.cache,f=c.event.special,h=c.support.deleteExpando,l=0,k;(k=a[l])!=null;l++)if(!(k.nodeName&&c.noData[k.nodeName.toLowerCase()]))if(d=k[c.expando]){if((b=e[d])&&b.events)for(var o in b.events)f[o]?c.event.remove(k,o):c.removeEvent(k,o,b.handle);if(h)delete k[c.expando];else k.removeAttribute&&k.removeAttribute(c.expando);delete e[d]}}});var Ea=/alpha\([^)]*\)/i,gb=/opacity=([^)]*)/,hb=/-([a-z])/ig,ib=/([A-Z])/g,Fa=/^-?\d+(?:px)?$/i,
125
+ jb=/^-?\d/,kb={position:"absolute",visibility:"hidden",display:"block"},Pa=["Left","Right"],Qa=["Top","Bottom"],W,Ga,aa,lb=function(a,b){return b.toUpperCase()};c.fn.css=function(a,b){if(arguments.length===2&&b===B)return this;return c.access(this,a,b,true,function(d,e,f){return f!==B?c.style(d,e,f):c.css(d,e)})};c.extend({cssHooks:{opacity:{get:function(a,b){if(b){var d=W(a,"opacity","opacity");return d===""?"1":d}else return a.style.opacity}}},cssNumber:{zIndex:true,fontWeight:true,opacity:true,
126
+ zoom:true,lineHeight:true},cssProps:{"float":c.support.cssFloat?"cssFloat":"styleFloat"},style:function(a,b,d,e){if(!(!a||a.nodeType===3||a.nodeType===8||!a.style)){var f,h=c.camelCase(b),l=a.style,k=c.cssHooks[h];b=c.cssProps[h]||h;if(d!==B){if(!(typeof d==="number"&&isNaN(d)||d==null)){if(typeof d==="number"&&!c.cssNumber[h])d+="px";if(!k||!("set"in k)||(d=k.set(a,d))!==B)try{l[b]=d}catch(o){}}}else{if(k&&"get"in k&&(f=k.get(a,false,e))!==B)return f;return l[b]}}},css:function(a,b,d){var e,f=c.camelCase(b),
127
+ h=c.cssHooks[f];b=c.cssProps[f]||f;if(h&&"get"in h&&(e=h.get(a,true,d))!==B)return e;else if(W)return W(a,b,f)},swap:function(a,b,d){var e={},f;for(f in b){e[f]=a.style[f];a.style[f]=b[f]}d.call(a);for(f in b)a.style[f]=e[f]},camelCase:function(a){return a.replace(hb,lb)}});c.curCSS=c.css;c.each(["height","width"],function(a,b){c.cssHooks[b]={get:function(d,e,f){var h;if(e){if(d.offsetWidth!==0)h=oa(d,b,f);else c.swap(d,kb,function(){h=oa(d,b,f)});if(h<=0){h=W(d,b,b);if(h==="0px"&&aa)h=aa(d,b,b);
128
+ if(h!=null)return h===""||h==="auto"?"0px":h}if(h<0||h==null){h=d.style[b];return h===""||h==="auto"?"0px":h}return typeof h==="string"?h:h+"px"}},set:function(d,e){if(Fa.test(e)){e=parseFloat(e);if(e>=0)return e+"px"}else return e}}});if(!c.support.opacity)c.cssHooks.opacity={get:function(a,b){return gb.test((b&&a.currentStyle?a.currentStyle.filter:a.style.filter)||"")?parseFloat(RegExp.$1)/100+"":b?"1":""},set:function(a,b){var d=a.style;d.zoom=1;var e=c.isNaN(b)?"":"alpha(opacity="+b*100+")",f=
129
+ d.filter||"";d.filter=Ea.test(f)?f.replace(Ea,e):d.filter+" "+e}};if(t.defaultView&&t.defaultView.getComputedStyle)Ga=function(a,b,d){var e;d=d.replace(ib,"-$1").toLowerCase();if(!(b=a.ownerDocument.defaultView))return B;if(b=b.getComputedStyle(a,null)){e=b.getPropertyValue(d);if(e===""&&!c.contains(a.ownerDocument.documentElement,a))e=c.style(a,d)}return e};if(t.documentElement.currentStyle)aa=function(a,b){var d,e,f=a.currentStyle&&a.currentStyle[b],h=a.style;if(!Fa.test(f)&&jb.test(f)){d=h.left;
130
+ e=a.runtimeStyle.left;a.runtimeStyle.left=a.currentStyle.left;h.left=b==="fontSize"?"1em":f||0;f=h.pixelLeft+"px";h.left=d;a.runtimeStyle.left=e}return f===""?"auto":f};W=Ga||aa;if(c.expr&&c.expr.filters){c.expr.filters.hidden=function(a){var b=a.offsetHeight;return a.offsetWidth===0&&b===0||!c.support.reliableHiddenOffsets&&(a.style.display||c.css(a,"display"))==="none"};c.expr.filters.visible=function(a){return!c.expr.filters.hidden(a)}}var mb=c.now(),nb=/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi,
131
+ ob=/^(?:select|textarea)/i,pb=/^(?:color|date|datetime|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,qb=/^(?:GET|HEAD)$/,Ra=/\[\]$/,T=/\=\?(&|$)/,ja=/\?/,rb=/([?&])_=[^&]*/,sb=/^(\w+:)?\/\/([^\/?#]+)/,tb=/%20/g,ub=/#.*$/,Ha=c.fn.load;c.fn.extend({load:function(a,b,d){if(typeof a!=="string"&&Ha)return Ha.apply(this,arguments);else if(!this.length)return this;var e=a.indexOf(" ");if(e>=0){var f=a.slice(e,a.length);a=a.slice(0,e)}e="GET";if(b)if(c.isFunction(b)){d=b;b=null}else if(typeof b===
132
+ "object"){b=c.param(b,c.ajaxSettings.traditional);e="POST"}var h=this;c.ajax({url:a,type:e,dataType:"html",data:b,complete:function(l,k){if(k==="success"||k==="notmodified")h.html(f?c("<div>").append(l.responseText.replace(nb,"")).find(f):l.responseText);d&&h.each(d,[l.responseText,k,l])}});return this},serialize:function(){return c.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?c.makeArray(this.elements):this}).filter(function(){return this.name&&
133
+ !this.disabled&&(this.checked||ob.test(this.nodeName)||pb.test(this.type))}).map(function(a,b){var d=c(this).val();return d==null?null:c.isArray(d)?c.map(d,function(e){return{name:b.name,value:e}}):{name:b.name,value:d}}).get()}});c.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "),function(a,b){c.fn[b]=function(d){return this.bind(b,d)}});c.extend({get:function(a,b,d,e){if(c.isFunction(b)){e=e||d;d=b;b=null}return c.ajax({type:"GET",url:a,data:b,success:d,dataType:e})},
134
+ getScript:function(a,b){return c.get(a,null,b,"script")},getJSON:function(a,b,d){return c.get(a,b,d,"json")},post:function(a,b,d,e){if(c.isFunction(b)){e=e||d;d=b;b={}}return c.ajax({type:"POST",url:a,data:b,success:d,dataType:e})},ajaxSetup:function(a){c.extend(c.ajaxSettings,a)},ajaxSettings:{url:location.href,global:true,type:"GET",contentType:"application/x-www-form-urlencoded",processData:true,async:true,xhr:function(){return new E.XMLHttpRequest},accepts:{xml:"application/xml, text/xml",html:"text/html",
135
+ script:"text/javascript, application/javascript",json:"application/json, text/javascript",text:"text/plain",_default:"*/*"}},ajax:function(a){var b=c.extend(true,{},c.ajaxSettings,a),d,e,f,h=b.type.toUpperCase(),l=qb.test(h);b.url=b.url.replace(ub,"");b.context=a&&a.context!=null?a.context:b;if(b.data&&b.processData&&typeof b.data!=="string")b.data=c.param(b.data,b.traditional);if(b.dataType==="jsonp"){if(h==="GET")T.test(b.url)||(b.url+=(ja.test(b.url)?"&":"?")+(b.jsonp||"callback")+"=?");else if(!b.data||
136
+ !T.test(b.data))b.data=(b.data?b.data+"&":"")+(b.jsonp||"callback")+"=?";b.dataType="json"}if(b.dataType==="json"&&(b.data&&T.test(b.data)||T.test(b.url))){d=b.jsonpCallback||"jsonp"+mb++;if(b.data)b.data=(b.data+"").replace(T,"="+d+"$1");b.url=b.url.replace(T,"="+d+"$1");b.dataType="script";var k=E[d];E[d]=function(m){if(c.isFunction(k))k(m);else{E[d]=B;try{delete E[d]}catch(p){}}f=m;c.handleSuccess(b,w,e,f);c.handleComplete(b,w,e,f);r&&r.removeChild(A)}}if(b.dataType==="script"&&b.cache===null)b.cache=
137
+ false;if(b.cache===false&&l){var o=c.now(),x=b.url.replace(rb,"$1_="+o);b.url=x+(x===b.url?(ja.test(b.url)?"&":"?")+"_="+o:"")}if(b.data&&l)b.url+=(ja.test(b.url)?"&":"?")+b.data;b.global&&c.active++===0&&c.event.trigger("ajaxStart");o=(o=sb.exec(b.url))&&(o[1]&&o[1].toLowerCase()!==location.protocol||o[2].toLowerCase()!==location.host);if(b.dataType==="script"&&h==="GET"&&o){var r=t.getElementsByTagName("head")[0]||t.documentElement,A=t.createElement("script");if(b.scriptCharset)A.charset=b.scriptCharset;
138
+ A.src=b.url;if(!d){var C=false;A.onload=A.onreadystatechange=function(){if(!C&&(!this.readyState||this.readyState==="loaded"||this.readyState==="complete")){C=true;c.handleSuccess(b,w,e,f);c.handleComplete(b,w,e,f);A.onload=A.onreadystatechange=null;r&&A.parentNode&&r.removeChild(A)}}}r.insertBefore(A,r.firstChild);return B}var J=false,w=b.xhr();if(w){b.username?w.open(h,b.url,b.async,b.username,b.password):w.open(h,b.url,b.async);try{if(b.data!=null&&!l||a&&a.contentType)w.setRequestHeader("Content-Type",
139
+ b.contentType);if(b.ifModified){c.lastModified[b.url]&&w.setRequestHeader("If-Modified-Since",c.lastModified[b.url]);c.etag[b.url]&&w.setRequestHeader("If-None-Match",c.etag[b.url])}o||w.setRequestHeader("X-Requested-With","XMLHttpRequest");w.setRequestHeader("Accept",b.dataType&&b.accepts[b.dataType]?b.accepts[b.dataType]+", */*; q=0.01":b.accepts._default)}catch(I){}if(b.beforeSend&&b.beforeSend.call(b.context,w,b)===false){b.global&&c.active--===1&&c.event.trigger("ajaxStop");w.abort();return false}b.global&&
140
+ c.triggerGlobal(b,"ajaxSend",[w,b]);var L=w.onreadystatechange=function(m){if(!w||w.readyState===0||m==="abort"){J||c.handleComplete(b,w,e,f);J=true;if(w)w.onreadystatechange=c.noop}else if(!J&&w&&(w.readyState===4||m==="timeout")){J=true;w.onreadystatechange=c.noop;e=m==="timeout"?"timeout":!c.httpSuccess(w)?"error":b.ifModified&&c.httpNotModified(w,b.url)?"notmodified":"success";var p;if(e==="success")try{f=c.httpData(w,b.dataType,b)}catch(q){e="parsererror";p=q}if(e==="success"||e==="notmodified")d||
141
+ c.handleSuccess(b,w,e,f);else c.handleError(b,w,e,p);d||c.handleComplete(b,w,e,f);m==="timeout"&&w.abort();if(b.async)w=null}};try{var g=w.abort;w.abort=function(){w&&Function.prototype.call.call(g,w);L("abort")}}catch(i){}b.async&&b.timeout>0&&setTimeout(function(){w&&!J&&L("timeout")},b.timeout);try{w.send(l||b.data==null?null:b.data)}catch(n){c.handleError(b,w,null,n);c.handleComplete(b,w,e,f)}b.async||L();return w}},param:function(a,b){var d=[],e=function(h,l){l=c.isFunction(l)?l():l;d[d.length]=
142
+ encodeURIComponent(h)+"="+encodeURIComponent(l)};if(b===B)b=c.ajaxSettings.traditional;if(c.isArray(a)||a.jquery)c.each(a,function(){e(this.name,this.value)});else for(var f in a)da(f,a[f],b,e);return d.join("&").replace(tb,"+")}});c.extend({active:0,lastModified:{},etag:{},handleError:function(a,b,d,e){a.error&&a.error.call(a.context,b,d,e);a.global&&c.triggerGlobal(a,"ajaxError",[b,a,e])},handleSuccess:function(a,b,d,e){a.success&&a.success.call(a.context,e,d,b);a.global&&c.triggerGlobal(a,"ajaxSuccess",
143
+ [b,a])},handleComplete:function(a,b,d){a.complete&&a.complete.call(a.context,b,d);a.global&&c.triggerGlobal(a,"ajaxComplete",[b,a]);a.global&&c.active--===1&&c.event.trigger("ajaxStop")},triggerGlobal:function(a,b,d){(a.context&&a.context.url==null?c(a.context):c.event).trigger(b,d)},httpSuccess:function(a){try{return!a.status&&location.protocol==="file:"||a.status>=200&&a.status<300||a.status===304||a.status===1223}catch(b){}return false},httpNotModified:function(a,b){var d=a.getResponseHeader("Last-Modified"),
144
+ e=a.getResponseHeader("Etag");if(d)c.lastModified[b]=d;if(e)c.etag[b]=e;return a.status===304},httpData:function(a,b,d){var e=a.getResponseHeader("content-type")||"",f=b==="xml"||!b&&e.indexOf("xml")>=0;a=f?a.responseXML:a.responseText;f&&a.documentElement.nodeName==="parsererror"&&c.error("parsererror");if(d&&d.dataFilter)a=d.dataFilter(a,b);if(typeof a==="string")if(b==="json"||!b&&e.indexOf("json")>=0)a=c.parseJSON(a);else if(b==="script"||!b&&e.indexOf("javascript")>=0)c.globalEval(a);return a}});
145
+ if(E.ActiveXObject)c.ajaxSettings.xhr=function(){if(E.location.protocol!=="file:")try{return new E.XMLHttpRequest}catch(a){}try{return new E.ActiveXObject("Microsoft.XMLHTTP")}catch(b){}};c.support.ajax=!!c.ajaxSettings.xhr();var ea={},vb=/^(?:toggle|show|hide)$/,wb=/^([+\-]=)?([\d+.\-]+)(.*)$/,ba,pa=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]];c.fn.extend({show:function(a,b,d){if(a||a===0)return this.animate(S("show",
146
+ 3),a,b,d);else{d=0;for(var e=this.length;d<e;d++){a=this[d];b=a.style.display;if(!c.data(a,"olddisplay")&&b==="none")b=a.style.display="";b===""&&c.css(a,"display")==="none"&&c.data(a,"olddisplay",qa(a.nodeName))}for(d=0;d<e;d++){a=this[d];b=a.style.display;if(b===""||b==="none")a.style.display=c.data(a,"olddisplay")||""}return this}},hide:function(a,b,d){if(a||a===0)return this.animate(S("hide",3),a,b,d);else{a=0;for(b=this.length;a<b;a++){d=c.css(this[a],"display");d!=="none"&&c.data(this[a],"olddisplay",
147
+ d)}for(a=0;a<b;a++)this[a].style.display="none";return this}},_toggle:c.fn.toggle,toggle:function(a,b,d){var e=typeof a==="boolean";if(c.isFunction(a)&&c.isFunction(b))this._toggle.apply(this,arguments);else a==null||e?this.each(function(){var f=e?a:c(this).is(":hidden");c(this)[f?"show":"hide"]()}):this.animate(S("toggle",3),a,b,d);return this},fadeTo:function(a,b,d,e){return this.filter(":hidden").css("opacity",0).show().end().animate({opacity:b},a,d,e)},animate:function(a,b,d,e){var f=c.speed(b,
148
+ d,e);if(c.isEmptyObject(a))return this.each(f.complete);return this[f.queue===false?"each":"queue"](function(){var h=c.extend({},f),l,k=this.nodeType===1,o=k&&c(this).is(":hidden"),x=this;for(l in a){var r=c.camelCase(l);if(l!==r){a[r]=a[l];delete a[l];l=r}if(a[l]==="hide"&&o||a[l]==="show"&&!o)return h.complete.call(this);if(k&&(l==="height"||l==="width")){h.overflow=[this.style.overflow,this.style.overflowX,this.style.overflowY];if(c.css(this,"display")==="inline"&&c.css(this,"float")==="none")if(c.support.inlineBlockNeedsLayout)if(qa(this.nodeName)===
149
+ "inline")this.style.display="inline-block";else{this.style.display="inline";this.style.zoom=1}else this.style.display="inline-block"}if(c.isArray(a[l])){(h.specialEasing=h.specialEasing||{})[l]=a[l][1];a[l]=a[l][0]}}if(h.overflow!=null)this.style.overflow="hidden";h.curAnim=c.extend({},a);c.each(a,function(A,C){var J=new c.fx(x,h,A);if(vb.test(C))J[C==="toggle"?o?"show":"hide":C](a);else{var w=wb.exec(C),I=J.cur()||0;if(w){var L=parseFloat(w[2]),g=w[3]||"px";if(g!=="px"){c.style(x,A,(L||1)+g);I=(L||
150
+ 1)/J.cur()*I;c.style(x,A,I+g)}if(w[1])L=(w[1]==="-="?-1:1)*L+I;J.custom(I,L,g)}else J.custom(I,C,"")}});return true})},stop:function(a,b){var d=c.timers;a&&this.queue([]);this.each(function(){for(var e=d.length-1;e>=0;e--)if(d[e].elem===this){b&&d[e](true);d.splice(e,1)}});b||this.dequeue();return this}});c.each({slideDown:S("show",1),slideUp:S("hide",1),slideToggle:S("toggle",1),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(a,b){c.fn[a]=function(d,e,f){return this.animate(b,
151
+ d,e,f)}});c.extend({speed:function(a,b,d){var e=a&&typeof a==="object"?c.extend({},a):{complete:d||!d&&b||c.isFunction(a)&&a,duration:a,easing:d&&b||b&&!c.isFunction(b)&&b};e.duration=c.fx.off?0:typeof e.duration==="number"?e.duration:e.duration in c.fx.speeds?c.fx.speeds[e.duration]:c.fx.speeds._default;e.old=e.complete;e.complete=function(){e.queue!==false&&c(this).dequeue();c.isFunction(e.old)&&e.old.call(this)};return e},easing:{linear:function(a,b,d,e){return d+e*a},swing:function(a,b,d,e){return(-Math.cos(a*
152
+ Math.PI)/2+0.5)*e+d}},timers:[],fx:function(a,b,d){this.options=b;this.elem=a;this.prop=d;if(!b.orig)b.orig={}}});c.fx.prototype={update:function(){this.options.step&&this.options.step.call(this.elem,this.now,this);(c.fx.step[this.prop]||c.fx.step._default)(this)},cur:function(){if(this.elem[this.prop]!=null&&(!this.elem.style||this.elem.style[this.prop]==null))return this.elem[this.prop];var a=parseFloat(c.css(this.elem,this.prop));return a&&a>-1E4?a:0},custom:function(a,b,d){function e(l){return f.step(l)}
153
+ var f=this,h=c.fx;this.startTime=c.now();this.start=a;this.end=b;this.unit=d||this.unit||"px";this.now=this.start;this.pos=this.state=0;e.elem=this.elem;if(e()&&c.timers.push(e)&&!ba)ba=setInterval(h.tick,h.interval)},show:function(){this.options.orig[this.prop]=c.style(this.elem,this.prop);this.options.show=true;this.custom(this.prop==="width"||this.prop==="height"?1:0,this.cur());c(this.elem).show()},hide:function(){this.options.orig[this.prop]=c.style(this.elem,this.prop);this.options.hide=true;
154
+ this.custom(this.cur(),0)},step:function(a){var b=c.now(),d=true;if(a||b>=this.options.duration+this.startTime){this.now=this.end;this.pos=this.state=1;this.update();this.options.curAnim[this.prop]=true;for(var e in this.options.curAnim)if(this.options.curAnim[e]!==true)d=false;if(d){if(this.options.overflow!=null&&!c.support.shrinkWrapBlocks){var f=this.elem,h=this.options;c.each(["","X","Y"],function(k,o){f.style["overflow"+o]=h.overflow[k]})}this.options.hide&&c(this.elem).hide();if(this.options.hide||
155
+ this.options.show)for(var l in this.options.curAnim)c.style(this.elem,l,this.options.orig[l]);this.options.complete.call(this.elem)}return false}else{a=b-this.startTime;this.state=a/this.options.duration;b=this.options.easing||(c.easing.swing?"swing":"linear");this.pos=c.easing[this.options.specialEasing&&this.options.specialEasing[this.prop]||b](this.state,a,0,1,this.options.duration);this.now=this.start+(this.end-this.start)*this.pos;this.update()}return true}};c.extend(c.fx,{tick:function(){for(var a=
156
+ c.timers,b=0;b<a.length;b++)a[b]()||a.splice(b--,1);a.length||c.fx.stop()},interval:13,stop:function(){clearInterval(ba);ba=null},speeds:{slow:600,fast:200,_default:400},step:{opacity:function(a){c.style(a.elem,"opacity",a.now)},_default:function(a){if(a.elem.style&&a.elem.style[a.prop]!=null)a.elem.style[a.prop]=(a.prop==="width"||a.prop==="height"?Math.max(0,a.now):a.now)+a.unit;else a.elem[a.prop]=a.now}}});if(c.expr&&c.expr.filters)c.expr.filters.animated=function(a){return c.grep(c.timers,function(b){return a===
157
+ b.elem}).length};var xb=/^t(?:able|d|h)$/i,Ia=/^(?:body|html)$/i;c.fn.offset="getBoundingClientRect"in t.documentElement?function(a){var b=this[0],d;if(a)return this.each(function(l){c.offset.setOffset(this,a,l)});if(!b||!b.ownerDocument)return null;if(b===b.ownerDocument.body)return c.offset.bodyOffset(b);try{d=b.getBoundingClientRect()}catch(e){}var f=b.ownerDocument,h=f.documentElement;if(!d||!c.contains(h,b))return d||{top:0,left:0};b=f.body;f=fa(f);return{top:d.top+(f.pageYOffset||c.support.boxModel&&
158
+ h.scrollTop||b.scrollTop)-(h.clientTop||b.clientTop||0),left:d.left+(f.pageXOffset||c.support.boxModel&&h.scrollLeft||b.scrollLeft)-(h.clientLeft||b.clientLeft||0)}}:function(a){var b=this[0];if(a)return this.each(function(x){c.offset.setOffset(this,a,x)});if(!b||!b.ownerDocument)return null;if(b===b.ownerDocument.body)return c.offset.bodyOffset(b);c.offset.initialize();var d,e=b.offsetParent,f=b.ownerDocument,h=f.documentElement,l=f.body;d=(f=f.defaultView)?f.getComputedStyle(b,null):b.currentStyle;
159
+ for(var k=b.offsetTop,o=b.offsetLeft;(b=b.parentNode)&&b!==l&&b!==h;){if(c.offset.supportsFixedPosition&&d.position==="fixed")break;d=f?f.getComputedStyle(b,null):b.currentStyle;k-=b.scrollTop;o-=b.scrollLeft;if(b===e){k+=b.offsetTop;o+=b.offsetLeft;if(c.offset.doesNotAddBorder&&!(c.offset.doesAddBorderForTableAndCells&&xb.test(b.nodeName))){k+=parseFloat(d.borderTopWidth)||0;o+=parseFloat(d.borderLeftWidth)||0}e=b.offsetParent}if(c.offset.subtractsBorderForOverflowNotVisible&&d.overflow!=="visible"){k+=
160
+ parseFloat(d.borderTopWidth)||0;o+=parseFloat(d.borderLeftWidth)||0}d=d}if(d.position==="relative"||d.position==="static"){k+=l.offsetTop;o+=l.offsetLeft}if(c.offset.supportsFixedPosition&&d.position==="fixed"){k+=Math.max(h.scrollTop,l.scrollTop);o+=Math.max(h.scrollLeft,l.scrollLeft)}return{top:k,left:o}};c.offset={initialize:function(){var a=t.body,b=t.createElement("div"),d,e,f,h=parseFloat(c.css(a,"marginTop"))||0;c.extend(b.style,{position:"absolute",top:0,left:0,margin:0,border:0,width:"1px",
161
+ height:"1px",visibility:"hidden"});b.innerHTML="<div style='position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;'><div></div></div><table style='position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;' cellpadding='0' cellspacing='0'><tr><td></td></tr></table>";a.insertBefore(b,a.firstChild);d=b.firstChild;e=d.firstChild;f=d.nextSibling.firstChild.firstChild;this.doesNotAddBorder=e.offsetTop!==5;this.doesAddBorderForTableAndCells=
162
+ f.offsetTop===5;e.style.position="fixed";e.style.top="20px";this.supportsFixedPosition=e.offsetTop===20||e.offsetTop===15;e.style.position=e.style.top="";d.style.overflow="hidden";d.style.position="relative";this.subtractsBorderForOverflowNotVisible=e.offsetTop===-5;this.doesNotIncludeMarginInBodyOffset=a.offsetTop!==h;a.removeChild(b);c.offset.initialize=c.noop},bodyOffset:function(a){var b=a.offsetTop,d=a.offsetLeft;c.offset.initialize();if(c.offset.doesNotIncludeMarginInBodyOffset){b+=parseFloat(c.css(a,
163
+ "marginTop"))||0;d+=parseFloat(c.css(a,"marginLeft"))||0}return{top:b,left:d}},setOffset:function(a,b,d){var e=c.css(a,"position");if(e==="static")a.style.position="relative";var f=c(a),h=f.offset(),l=c.css(a,"top"),k=c.css(a,"left"),o=e==="absolute"&&c.inArray("auto",[l,k])>-1;e={};var x={};if(o)x=f.position();l=o?x.top:parseInt(l,10)||0;k=o?x.left:parseInt(k,10)||0;if(c.isFunction(b))b=b.call(a,d,h);if(b.top!=null)e.top=b.top-h.top+l;if(b.left!=null)e.left=b.left-h.left+k;"using"in b?b.using.call(a,
164
+ e):f.css(e)}};c.fn.extend({position:function(){if(!this[0])return null;var a=this[0],b=this.offsetParent(),d=this.offset(),e=Ia.test(b[0].nodeName)?{top:0,left:0}:b.offset();d.top-=parseFloat(c.css(a,"marginTop"))||0;d.left-=parseFloat(c.css(a,"marginLeft"))||0;e.top+=parseFloat(c.css(b[0],"borderTopWidth"))||0;e.left+=parseFloat(c.css(b[0],"borderLeftWidth"))||0;return{top:d.top-e.top,left:d.left-e.left}},offsetParent:function(){return this.map(function(){for(var a=this.offsetParent||t.body;a&&!Ia.test(a.nodeName)&&
165
+ c.css(a,"position")==="static";)a=a.offsetParent;return a})}});c.each(["Left","Top"],function(a,b){var d="scroll"+b;c.fn[d]=function(e){var f=this[0],h;if(!f)return null;if(e!==B)return this.each(function(){if(h=fa(this))h.scrollTo(!a?e:c(h).scrollLeft(),a?e:c(h).scrollTop());else this[d]=e});else return(h=fa(f))?"pageXOffset"in h?h[a?"pageYOffset":"pageXOffset"]:c.support.boxModel&&h.document.documentElement[d]||h.document.body[d]:f[d]}});c.each(["Height","Width"],function(a,b){var d=b.toLowerCase();
166
+ c.fn["inner"+b]=function(){return this[0]?parseFloat(c.css(this[0],d,"padding")):null};c.fn["outer"+b]=function(e){return this[0]?parseFloat(c.css(this[0],d,e?"margin":"border")):null};c.fn[d]=function(e){var f=this[0];if(!f)return e==null?null:this;if(c.isFunction(e))return this.each(function(l){var k=c(this);k[d](e.call(this,l,k[d]()))});if(c.isWindow(f))return f.document.compatMode==="CSS1Compat"&&f.document.documentElement["client"+b]||f.document.body["client"+b];else if(f.nodeType===9)return Math.max(f.documentElement["client"+
167
+ b],f.body["scroll"+b],f.documentElement["scroll"+b],f.body["offset"+b],f.documentElement["offset"+b]);else if(e===B){f=c.css(f,d);var h=parseFloat(f);return c.isNaN(h)?f:h}else return this.css(d,typeof e==="string"?e:e+"px")}})})(window);
includes/regist_ajax_libs.php CHANGED
@@ -30,7 +30,7 @@ if (AJAX_LIBS_GOOGLE) {
30
  define('AJAX_LIBS_GOOGLE_URL', 'http://ajax.googleapis.com/ajax/libs/');
31
  define('AJAX_LIBS_PROTOTYPE_JS_VER', '1.6.0.3');
32
  define('AJAX_LIBS_SCRIPTACULOUS_VER', '1.8.2');
33
- define('AJAX_LIBS_JQUERY_VER', '1.4.2');
34
  define('AJAX_LIBS_JQUERY_UI_VER', '1.7');
35
  define('AJAX_LIBS_MOOTOOLS_VER', '1.11');
36
  define('AJAX_LIBS_DOJO_VER', '1.1.1');
@@ -286,4 +286,3 @@ if (function_exists('wp_register_style')) {
286
  }
287
 
288
  endif;
289
- ?>
30
  define('AJAX_LIBS_GOOGLE_URL', 'http://ajax.googleapis.com/ajax/libs/');
31
  define('AJAX_LIBS_PROTOTYPE_JS_VER', '1.6.0.3');
32
  define('AJAX_LIBS_SCRIPTACULOUS_VER', '1.8.2');
33
+ define('AJAX_LIBS_JQUERY_VER', '1.4.4');
34
  define('AJAX_LIBS_JQUERY_UI_VER', '1.7');
35
  define('AJAX_LIBS_MOOTOOLS_VER', '1.11');
36
  define('AJAX_LIBS_DOJO_VER', '1.1.1');
286
  }
287
 
288
  endif;
 
includes/simple_html_dom.php CHANGED
@@ -972,4 +972,3 @@ class simple_html_dom {
972
  function getElementsByTagName($name, $idx=-1) {return $this->find($name, $idx);}
973
  function loadFile() {$args = func_get_args();$this->load(call_user_func_array('file_get_contents', $args), true);}
974
  }
975
- ?>
972
  function getElementsByTagName($name, $idx=-1) {return $this->find($name, $idx);}
973
  function loadFile() {$args = func_get_args();$this->load(call_user_func_array('file_get_contents', $args), true);}
974
  }
 
languages/head-cleaner-ja.mo CHANGED
Binary file
languages/head-cleaner-ja.po CHANGED
@@ -2,8 +2,8 @@ msgid ""
2
  msgstr ""
3
  "Project-Id-Version: Head Cleaner\n"
4
  "Report-Msgid-Bugs-To: \n"
5
- "POT-Creation-Date: 2009-08-26 15:40+0900\n"
6
- "PO-Revision-Date: 2010-02-15 18:09+0900\n"
7
  "Last-Translator: wokamoto <wokamoto1973@gmail.com>\n"
8
  "Language-Team: JAPANESE <http://wppluginsj.sourceforge.jp/>\n"
9
  "MIME-Version: 1.0\n"
@@ -20,213 +20,214 @@ msgstr ""
20
  msgid "Cleaning tags from your WordPress header and footer."
21
  msgstr "WordPress サイトの &lt;head&gt; の中身と、フッタ領域を整形しなおします。"
22
 
23
- #: ../head-cleaner.php:1420
24
  msgid "Head Cleaner"
25
  msgstr "Head Cleaner"
26
 
27
- #: ../head-cleaner.php:1429
28
- #: ../includes/common-controller.php:175
29
  msgid "Settings"
30
  msgstr "設定"
31
 
32
- #: ../head-cleaner.php:1526
33
- #: ../head-cleaner.php:1536
34
- #: ../head-cleaner.php:1546
35
  msgid "Done!"
36
  msgstr "完了!"
37
 
38
- #: ../head-cleaner.php:1558
39
  msgid "Head Cleaner Options"
40
  msgstr "Head Cleaner 設定"
41
 
42
- #: ../head-cleaner.php:1566
43
  msgid "CSS and JavaScript are cached on the server."
44
  msgstr "CSS と JavaScript を、サーバ上にキャッシュする"
45
 
46
- #: ../head-cleaner.php:1570
47
  msgid "Put JavaScripts at the Bottom."
48
  msgstr "&lt;head&gt; 内の JavaScript を、フッタ領域に移動"
49
 
50
- #: ../head-cleaner.php:1574
51
  msgid "CSS and JS are dynamically generated."
52
  msgstr "CSS, JS を動的生成する。"
53
 
54
- #: ../head-cleaner.php:1582
55
  msgid "Two or more CSS is combined."
56
  msgstr "複数の CSS を結合する"
57
 
58
- #: ../head-cleaner.php:1586
59
  msgid "CSS is optimized."
60
  msgstr "CSS を最適化する"
61
 
62
- #: ../head-cleaner.php:1589
63
  msgid "Default media attribute applied to CSS."
64
  msgstr "CSS に適用するデフォルト media 属性"
65
 
66
- #: ../head-cleaner.php:1598
 
 
 
 
67
  msgid "Two or more JavaScript is combined."
68
  msgstr "複数の JavaScript を結合する"
69
 
70
- #: ../head-cleaner.php:1602
71
  msgid "JavaScript is minified."
72
  msgstr "JavaScript を小さくする"
73
 
74
- #: ../head-cleaner.php:1606
75
  msgid "Bottom JavaScript is combined, too."
76
  msgstr "フッタ領域の JavaScript も対象にする"
77
 
78
- #: ../head-cleaner.php:1613
79
- msgid "gzip compress to CSS and JS."
80
- msgstr "CSS と JS を gzip 圧縮転送"
81
-
82
- #: ../head-cleaner.php:1617
83
  msgid "Use Google Ajax Libraries."
84
  msgstr "Google Ajax Libraries を利用する"
85
 
86
- #: ../head-cleaner.php:1626
 
 
 
 
87
  msgid "Add XML Declaration."
88
  msgstr "XML宣言を付与"
89
 
90
- #: ../head-cleaner.php:1630
91
  msgid "Add canonical tag."
92
  msgstr "メタタグ &quot;canonical&quot; を追加"
93
 
94
- #: ../head-cleaner.php:1634
95
- msgid "Remove IE Conditional Tag."
96
- msgstr "IEコンディショナルタグを削除"
97
-
98
- #: ../head-cleaner.php:1641
99
  msgid "Remove generator tag."
100
  msgstr "メタタグ &quot;generator&quot; を削除"
101
 
102
- #: ../head-cleaner.php:1645
103
  msgid "Remove RSD link tag."
104
  msgstr "リンクタグ &quot;RSD&quot; を削除"
105
 
106
- #: ../head-cleaner.php:1649
107
  msgid "Remove wlwmanifest link tag."
108
  msgstr "リンクタグ &quot;wlwmanifest&quot; を削除."
109
 
110
- #: ../head-cleaner.php:1656
111
  msgid "Debug mode"
112
  msgstr "デバッグモード"
113
 
114
- #: ../head-cleaner.php:1669
115
  msgid "The CSS optimization settings"
116
  msgstr "CSS最適化 オプション"
117
 
118
- #: ../head-cleaner.php:1671
119
  msgid "Compression (code layout):"
120
  msgstr "圧縮率(コードレイアウト):"
121
 
122
- #: ../head-cleaner.php:1673
123
  msgid "Highest (no readability, smallest size)"
124
  msgstr "最高 (改行なし)"
125
 
126
- #: ../head-cleaner.php:1674
127
  msgid "High (moderate readability, smaller size)"
128
  msgstr "高 (セレクタ1行表記)"
129
 
130
- #: ../head-cleaner.php:1675
131
  msgid "Standard (balance between readability and size)"
132
  msgstr "標準 (プロパティごと改行)"
133
 
134
- #: ../head-cleaner.php:1676
135
  msgid "Low (higher readability)"
136
  msgstr "低 (プロパティをインデント)"
137
 
138
- #: ../head-cleaner.php:1679
139
  msgid "Optimise shorthands"
140
  msgstr "ショートハンドCSSの最適化"
141
 
142
- #: ../head-cleaner.php:1681
143
  msgid "All optimisations"
144
  msgstr "margin,padding,border,backgroundを最適化"
145
 
146
- #: ../head-cleaner.php:1682
147
  msgid "Safe optimisations"
148
  msgstr "margin,padding,borderのみ"
149
 
150
- #: ../head-cleaner.php:1683
151
  msgid "Don't optimise"
152
  msgstr "最適化しない"
153
 
154
- #: ../head-cleaner.php:1688
155
  msgid "Compress colors"
156
  msgstr "colorの値を簡略化する"
157
 
158
- #: ../head-cleaner.php:1691
159
  msgid "Compress font-weight"
160
  msgstr "font-weightを数値にする"
161
 
162
- #: ../head-cleaner.php:1694
163
  msgid "Remove unnecessary backslashes"
164
  msgstr "不要なバックスラッシュを削除"
165
 
166
- #: ../head-cleaner.php:1702
167
  msgid "Active Filters"
168
  msgstr "有効なフィルタ"
169
 
170
- #: ../head-cleaner.php:1705
171
- #: ../head-cleaner.php:1742
172
  msgid "Don't process!"
173
  msgstr "対象外"
174
 
175
- #: ../head-cleaner.php:1706
176
- #: ../head-cleaner.php:1743
 
177
  msgid "Remove"
178
  msgstr "削除"
179
 
180
- #: ../head-cleaner.php:1707
181
  msgid "Head filters"
182
  msgstr "&lt;head&gt; 内の有効なフィルタ"
183
 
184
- #: ../head-cleaner.php:1709
185
- #: ../head-cleaner.php:1746
186
  msgid "Priority"
187
  msgstr "フィルタの優先順位"
188
 
189
- #: ../head-cleaner.php:1744
190
  msgid "Bottom filters"
191
  msgstr "フッタ領域の有効なフィルタ"
192
 
193
- #: ../head-cleaner.php:1781
194
  msgid "Active JavaScripts"
195
  msgstr "&lt;head&gt; 部で有効な JavaScript"
196
 
197
- #: ../head-cleaner.php:1784
198
  msgid "Move to footer"
199
  msgstr "フッタに移動"
200
 
201
- #: ../head-cleaner.php:1785
202
  msgid "JavaScripts"
203
  msgstr "JavaScript"
204
 
205
- #: ../head-cleaner.php:1796
206
  msgid "Update Options"
207
  msgstr "更新"
208
 
209
- #: ../head-cleaner.php:1801
210
  msgid "Remove all cache files"
211
  msgstr "キャッシュファイル削除"
212
 
213
- #: ../head-cleaner.php:1804
214
  msgid "All cache files are removed."
215
  msgstr "キャッシュフォルダ内のファイルをすべて削除する。"
216
 
217
- #: ../head-cleaner.php:1805
218
  msgid "Remove All Cache Files"
219
  msgstr "削除"
220
 
221
- #: ../head-cleaner.php:1810
222
  msgid "Uninstall"
223
  msgstr "アンインストール"
224
 
225
- #: ../head-cleaner.php:1813
226
  msgid "All the settings of &quot;Head Cleaner&quot; are deleted."
227
  msgstr "&quot;Head Cleaner&quot; の設定をすべて消去する。"
228
 
229
- #: ../head-cleaner.php:1814
230
  msgid "Delete Options"
231
  msgstr "削除"
232
 
2
  msgstr ""
3
  "Project-Id-Version: Head Cleaner\n"
4
  "Report-Msgid-Bugs-To: \n"
5
+ "POT-Creation-Date: 2010-11-18 19:42+0900\n"
6
+ "PO-Revision-Date: 2010-11-18 19:44+0900\n"
7
  "Last-Translator: wokamoto <wokamoto1973@gmail.com>\n"
8
  "Language-Team: JAPANESE <http://wppluginsj.sourceforge.jp/>\n"
9
  "MIME-Version: 1.0\n"
20
  msgid "Cleaning tags from your WordPress header and footer."
21
  msgstr "WordPress サイトの &lt;head&gt; の中身と、フッタ領域を整形しなおします。"
22
 
23
+ #: ../head-cleaner.php:1856
24
  msgid "Head Cleaner"
25
  msgstr "Head Cleaner"
26
 
27
+ #: ../head-cleaner.php:1865
28
+ #: ../includes/common-controller.php:186
29
  msgid "Settings"
30
  msgstr "設定"
31
 
32
+ #: ../head-cleaner.php:1893
33
+ #: ../head-cleaner.php:1901
34
+ #: ../head-cleaner.php:1909
35
  msgid "Done!"
36
  msgstr "完了!"
37
 
38
+ #: ../head-cleaner.php:1921
39
  msgid "Head Cleaner Options"
40
  msgstr "Head Cleaner 設定"
41
 
42
+ #: ../head-cleaner.php:1930
43
  msgid "CSS and JavaScript are cached on the server."
44
  msgstr "CSS と JavaScript を、サーバ上にキャッシュする"
45
 
46
+ #: ../head-cleaner.php:1934
47
  msgid "Put JavaScripts at the Bottom."
48
  msgstr "&lt;head&gt; 内の JavaScript を、フッタ領域に移動"
49
 
50
+ #: ../head-cleaner.php:1939
51
  msgid "CSS and JS are dynamically generated."
52
  msgstr "CSS, JS を動的生成する。"
53
 
54
+ #: ../head-cleaner.php:1948
55
  msgid "Two or more CSS is combined."
56
  msgstr "複数の CSS を結合する"
57
 
58
+ #: ../head-cleaner.php:1952
59
  msgid "CSS is optimized."
60
  msgstr "CSS を最適化する"
61
 
62
+ #: ../head-cleaner.php:1955
63
  msgid "Default media attribute applied to CSS."
64
  msgstr "CSS に適用するデフォルト media 属性"
65
 
66
+ #: ../head-cleaner.php:1963
67
+ msgid "URLs of images in CSS will be converted into the data scheme URIs."
68
+ msgstr "CSS に含まれる画像の URL を、データスキーマ URI に変換する"
69
+
70
+ #: ../head-cleaner.php:1972
71
  msgid "Two or more JavaScript is combined."
72
  msgstr "複数の JavaScript を結合する"
73
 
74
+ #: ../head-cleaner.php:1976
75
  msgid "JavaScript is minified."
76
  msgstr "JavaScript を小さくする"
77
 
78
+ #: ../head-cleaner.php:1980
79
  msgid "Bottom JavaScript is combined, too."
80
  msgstr "フッタ領域の JavaScript も対象にする"
81
 
82
+ #: ../head-cleaner.php:1991
 
 
 
 
83
  msgid "Use Google Ajax Libraries."
84
  msgstr "Google Ajax Libraries を利用する"
85
 
86
+ #: ../head-cleaner.php:1995
87
+ msgid "Remove IE Conditional Tag."
88
+ msgstr "IEコンディショナルタグを削除"
89
+
90
+ #: ../head-cleaner.php:2004
91
  msgid "Add XML Declaration."
92
  msgstr "XML宣言を付与"
93
 
94
+ #: ../head-cleaner.php:2008
95
  msgid "Add canonical tag."
96
  msgstr "メタタグ &quot;canonical&quot; を追加"
97
 
98
+ #: ../head-cleaner.php:2017
 
 
 
 
99
  msgid "Remove generator tag."
100
  msgstr "メタタグ &quot;generator&quot; を削除"
101
 
102
+ #: ../head-cleaner.php:2021
103
  msgid "Remove RSD link tag."
104
  msgstr "リンクタグ &quot;RSD&quot; を削除"
105
 
106
+ #: ../head-cleaner.php:2025
107
  msgid "Remove wlwmanifest link tag."
108
  msgstr "リンクタグ &quot;wlwmanifest&quot; を削除."
109
 
110
+ #: ../head-cleaner.php:2032
111
  msgid "Debug mode"
112
  msgstr "デバッグモード"
113
 
114
+ #: ../head-cleaner.php:2045
115
  msgid "The CSS optimization settings"
116
  msgstr "CSS最適化 オプション"
117
 
118
+ #: ../head-cleaner.php:2047
119
  msgid "Compression (code layout):"
120
  msgstr "圧縮率(コードレイアウト):"
121
 
122
+ #: ../head-cleaner.php:2049
123
  msgid "Highest (no readability, smallest size)"
124
  msgstr "最高 (改行なし)"
125
 
126
+ #: ../head-cleaner.php:2050
127
  msgid "High (moderate readability, smaller size)"
128
  msgstr "高 (セレクタ1行表記)"
129
 
130
+ #: ../head-cleaner.php:2051
131
  msgid "Standard (balance between readability and size)"
132
  msgstr "標準 (プロパティごと改行)"
133
 
134
+ #: ../head-cleaner.php:2052
135
  msgid "Low (higher readability)"
136
  msgstr "低 (プロパティをインデント)"
137
 
138
+ #: ../head-cleaner.php:2055
139
  msgid "Optimise shorthands"
140
  msgstr "ショートハンドCSSの最適化"
141
 
142
+ #: ../head-cleaner.php:2057
143
  msgid "All optimisations"
144
  msgstr "margin,padding,border,backgroundを最適化"
145
 
146
+ #: ../head-cleaner.php:2058
147
  msgid "Safe optimisations"
148
  msgstr "margin,padding,borderのみ"
149
 
150
+ #: ../head-cleaner.php:2059
151
  msgid "Don't optimise"
152
  msgstr "最適化しない"
153
 
154
+ #: ../head-cleaner.php:2064
155
  msgid "Compress colors"
156
  msgstr "colorの値を簡略化する"
157
 
158
+ #: ../head-cleaner.php:2067
159
  msgid "Compress font-weight"
160
  msgstr "font-weightを数値にする"
161
 
162
+ #: ../head-cleaner.php:2070
163
  msgid "Remove unnecessary backslashes"
164
  msgstr "不要なバックスラッシュを削除"
165
 
166
+ #: ../head-cleaner.php:2078
167
  msgid "Active Filters"
168
  msgstr "有効なフィルタ"
169
 
170
+ #: ../head-cleaner.php:2081
171
+ #: ../head-cleaner.php:2118
172
  msgid "Don't process!"
173
  msgstr "対象外"
174
 
175
+ #: ../head-cleaner.php:2082
176
+ #: ../head-cleaner.php:2119
177
+ #: ../head-cleaner.php:2161
178
  msgid "Remove"
179
  msgstr "削除"
180
 
181
+ #: ../head-cleaner.php:2083
182
  msgid "Head filters"
183
  msgstr "&lt;head&gt; 内の有効なフィルタ"
184
 
185
+ #: ../head-cleaner.php:2085
186
+ #: ../head-cleaner.php:2122
187
  msgid "Priority"
188
  msgstr "フィルタの優先順位"
189
 
190
+ #: ../head-cleaner.php:2120
191
  msgid "Bottom filters"
192
  msgstr "フッタ領域の有効なフィルタ"
193
 
194
+ #: ../head-cleaner.php:2157
195
  msgid "Active JavaScripts"
196
  msgstr "&lt;head&gt; 部で有効な JavaScript"
197
 
198
+ #: ../head-cleaner.php:2160
199
  msgid "Move to footer"
200
  msgstr "フッタに移動"
201
 
202
+ #: ../head-cleaner.php:2162
203
  msgid "JavaScripts"
204
  msgstr "JavaScript"
205
 
206
+ #: ../head-cleaner.php:2175
207
  msgid "Update Options"
208
  msgstr "更新"
209
 
210
+ #: ../head-cleaner.php:2180
211
  msgid "Remove all cache files"
212
  msgstr "キャッシュファイル削除"
213
 
214
+ #: ../head-cleaner.php:2183
215
  msgid "All cache files are removed."
216
  msgstr "キャッシュフォルダ内のファイルをすべて削除する。"
217
 
218
+ #: ../head-cleaner.php:2184
219
  msgid "Remove All Cache Files"
220
  msgstr "削除"
221
 
222
+ #: ../head-cleaner.php:2189
223
  msgid "Uninstall"
224
  msgstr "アンインストール"
225
 
226
+ #: ../head-cleaner.php:2192
227
  msgid "All the settings of &quot;Head Cleaner&quot; are deleted."
228
  msgstr "&quot;Head Cleaner&quot; の設定をすべて消去する。"
229
 
230
+ #: ../head-cleaner.php:2193
231
  msgid "Delete Options"
232
  msgstr "削除"
233
 
languages/head-cleaner.pot CHANGED
@@ -2,7 +2,7 @@ msgid ""
2
  msgstr ""
3
  "Project-Id-Version: Head Cleaner\n"
4
  "Report-Msgid-Bugs-To: \n"
5
- "POT-Creation-Date: 2009-08-26 15:40+0900\n"
6
  "PO-Revision-Date: \n"
7
  "Last-Translator: \n"
8
  "Language-Team: \n"
@@ -14,213 +14,214 @@ msgstr ""
14
  msgid "Cleaning tags from your WordPress header and footer."
15
  msgstr ""
16
 
17
- #: ../head-cleaner.php:1420
18
  msgid "Head Cleaner"
19
  msgstr ""
20
 
21
- #: ../head-cleaner.php:1429
22
- #: ../includes/common-controller.php:175
23
  msgid "Settings"
24
  msgstr ""
25
 
26
- #: ../head-cleaner.php:1526
27
- #: ../head-cleaner.php:1536
28
- #: ../head-cleaner.php:1546
29
  msgid "Done!"
30
  msgstr ""
31
 
32
- #: ../head-cleaner.php:1558
33
  msgid "Head Cleaner Options"
34
  msgstr ""
35
 
36
- #: ../head-cleaner.php:1566
37
  msgid "CSS and JavaScript are cached on the server."
38
  msgstr ""
39
 
40
- #: ../head-cleaner.php:1570
41
  msgid "Put JavaScripts at the Bottom."
42
  msgstr ""
43
 
44
- #: ../head-cleaner.php:1574
45
  msgid "CSS and JS are dynamically generated."
46
  msgstr ""
47
 
48
- #: ../head-cleaner.php:1582
49
  msgid "Two or more CSS is combined."
50
  msgstr ""
51
 
52
- #: ../head-cleaner.php:1586
53
  msgid "CSS is optimized."
54
  msgstr ""
55
 
56
- #: ../head-cleaner.php:1589
57
  msgid "Default media attribute applied to CSS."
58
  msgstr ""
59
 
60
- #: ../head-cleaner.php:1598
 
 
 
 
61
  msgid "Two or more JavaScript is combined."
62
  msgstr ""
63
 
64
- #: ../head-cleaner.php:1602
65
  msgid "JavaScript is minified."
66
  msgstr ""
67
 
68
- #: ../head-cleaner.php:1606
69
  msgid "Bottom JavaScript is combined, too."
70
  msgstr ""
71
 
72
- #: ../head-cleaner.php:1613
73
- msgid "gzip compress to CSS and JS."
74
  msgstr ""
75
 
76
- #: ../head-cleaner.php:1617
77
- msgid "Use Google Ajax Libraries."
78
  msgstr ""
79
 
80
- #: ../head-cleaner.php:1626
81
  msgid "Add XML Declaration."
82
  msgstr ""
83
 
84
- #: ../head-cleaner.php:1630
85
  msgid "Add canonical tag."
86
  msgstr ""
87
 
88
- #: ../head-cleaner.php:1634
89
- msgid "Remove IE Conditional Tag."
90
- msgstr ""
91
-
92
- #: ../head-cleaner.php:1641
93
  msgid "Remove generator tag."
94
  msgstr ""
95
 
96
- #: ../head-cleaner.php:1645
97
  msgid "Remove RSD link tag."
98
  msgstr ""
99
 
100
- #: ../head-cleaner.php:1649
101
  msgid "Remove wlwmanifest link tag."
102
  msgstr ""
103
 
104
- #: ../head-cleaner.php:1656
105
  msgid "Debug mode"
106
  msgstr ""
107
 
108
- #: ../head-cleaner.php:1669
109
  msgid "The CSS optimization settings"
110
  msgstr ""
111
 
112
- #: ../head-cleaner.php:1671
113
  msgid "Compression (code layout):"
114
  msgstr ""
115
 
116
- #: ../head-cleaner.php:1673
117
  msgid "Highest (no readability, smallest size)"
118
  msgstr ""
119
 
120
- #: ../head-cleaner.php:1674
121
  msgid "High (moderate readability, smaller size)"
122
  msgstr ""
123
 
124
- #: ../head-cleaner.php:1675
125
  msgid "Standard (balance between readability and size)"
126
  msgstr ""
127
 
128
- #: ../head-cleaner.php:1676
129
  msgid "Low (higher readability)"
130
  msgstr ""
131
 
132
- #: ../head-cleaner.php:1679
133
  msgid "Optimise shorthands"
134
  msgstr ""
135
 
136
- #: ../head-cleaner.php:1681
137
  msgid "All optimisations"
138
  msgstr ""
139
 
140
- #: ../head-cleaner.php:1682
141
  msgid "Safe optimisations"
142
  msgstr ""
143
 
144
- #: ../head-cleaner.php:1683
145
  msgid "Don't optimise"
146
  msgstr ""
147
 
148
- #: ../head-cleaner.php:1688
149
  msgid "Compress colors"
150
  msgstr ""
151
 
152
- #: ../head-cleaner.php:1691
153
  msgid "Compress font-weight"
154
  msgstr ""
155
 
156
- #: ../head-cleaner.php:1694
157
  msgid "Remove unnecessary backslashes"
158
  msgstr ""
159
 
160
- #: ../head-cleaner.php:1702
161
  msgid "Active Filters"
162
  msgstr ""
163
 
164
- #: ../head-cleaner.php:1705
165
- #: ../head-cleaner.php:1742
166
  msgid "Don't process!"
167
  msgstr ""
168
 
169
- #: ../head-cleaner.php:1706
170
- #: ../head-cleaner.php:1743
 
171
  msgid "Remove"
172
  msgstr ""
173
 
174
- #: ../head-cleaner.php:1707
175
  msgid "Head filters"
176
  msgstr ""
177
 
178
- #: ../head-cleaner.php:1709
179
- #: ../head-cleaner.php:1746
180
  msgid "Priority"
181
  msgstr ""
182
 
183
- #: ../head-cleaner.php:1744
184
  msgid "Bottom filters"
185
  msgstr ""
186
 
187
- #: ../head-cleaner.php:1781
188
  msgid "Active JavaScripts"
189
  msgstr ""
190
 
191
- #: ../head-cleaner.php:1784
192
  msgid "Move to footer"
193
  msgstr ""
194
 
195
- #: ../head-cleaner.php:1785
196
  msgid "JavaScripts"
197
  msgstr ""
198
 
199
- #: ../head-cleaner.php:1796
200
  msgid "Update Options"
201
  msgstr ""
202
 
203
- #: ../head-cleaner.php:1801
204
  msgid "Remove all cache files"
205
  msgstr ""
206
 
207
- #: ../head-cleaner.php:1804
208
  msgid "All cache files are removed."
209
  msgstr ""
210
 
211
- #: ../head-cleaner.php:1805
212
  msgid "Remove All Cache Files"
213
  msgstr ""
214
 
215
- #: ../head-cleaner.php:1810
216
  msgid "Uninstall"
217
  msgstr ""
218
 
219
- #: ../head-cleaner.php:1813
220
  msgid "All the settings of &quot;Head Cleaner&quot; are deleted."
221
  msgstr ""
222
 
223
- #: ../head-cleaner.php:1814
224
  msgid "Delete Options"
225
  msgstr ""
226
 
2
  msgstr ""
3
  "Project-Id-Version: Head Cleaner\n"
4
  "Report-Msgid-Bugs-To: \n"
5
+ "POT-Creation-Date: 2010-11-18 19:42+0900\n"
6
  "PO-Revision-Date: \n"
7
  "Last-Translator: \n"
8
  "Language-Team: \n"
14
  msgid "Cleaning tags from your WordPress header and footer."
15
  msgstr ""
16
 
17
+ #: ../head-cleaner.php:1856
18
  msgid "Head Cleaner"
19
  msgstr ""
20
 
21
+ #: ../head-cleaner.php:1865
22
+ #: ../includes/common-controller.php:186
23
  msgid "Settings"
24
  msgstr ""
25
 
26
+ #: ../head-cleaner.php:1893
27
+ #: ../head-cleaner.php:1901
28
+ #: ../head-cleaner.php:1909
29
  msgid "Done!"
30
  msgstr ""
31
 
32
+ #: ../head-cleaner.php:1921
33
  msgid "Head Cleaner Options"
34
  msgstr ""
35
 
36
+ #: ../head-cleaner.php:1930
37
  msgid "CSS and JavaScript are cached on the server."
38
  msgstr ""
39
 
40
+ #: ../head-cleaner.php:1934
41
  msgid "Put JavaScripts at the Bottom."
42
  msgstr ""
43
 
44
+ #: ../head-cleaner.php:1939
45
  msgid "CSS and JS are dynamically generated."
46
  msgstr ""
47
 
48
+ #: ../head-cleaner.php:1948
49
  msgid "Two or more CSS is combined."
50
  msgstr ""
51
 
52
+ #: ../head-cleaner.php:1952
53
  msgid "CSS is optimized."
54
  msgstr ""
55
 
56
+ #: ../head-cleaner.php:1955
57
  msgid "Default media attribute applied to CSS."
58
  msgstr ""
59
 
60
+ #: ../head-cleaner.php:1963
61
+ msgid "URLs of images in CSS will be converted into the data scheme URIs."
62
+ msgstr ""
63
+
64
+ #: ../head-cleaner.php:1972
65
  msgid "Two or more JavaScript is combined."
66
  msgstr ""
67
 
68
+ #: ../head-cleaner.php:1976
69
  msgid "JavaScript is minified."
70
  msgstr ""
71
 
72
+ #: ../head-cleaner.php:1980
73
  msgid "Bottom JavaScript is combined, too."
74
  msgstr ""
75
 
76
+ #: ../head-cleaner.php:1991
77
+ msgid "Use Google Ajax Libraries."
78
  msgstr ""
79
 
80
+ #: ../head-cleaner.php:1995
81
+ msgid "Remove IE Conditional Tag."
82
  msgstr ""
83
 
84
+ #: ../head-cleaner.php:2004
85
  msgid "Add XML Declaration."
86
  msgstr ""
87
 
88
+ #: ../head-cleaner.php:2008
89
  msgid "Add canonical tag."
90
  msgstr ""
91
 
92
+ #: ../head-cleaner.php:2017
 
 
 
 
93
  msgid "Remove generator tag."
94
  msgstr ""
95
 
96
+ #: ../head-cleaner.php:2021
97
  msgid "Remove RSD link tag."
98
  msgstr ""
99
 
100
+ #: ../head-cleaner.php:2025
101
  msgid "Remove wlwmanifest link tag."
102
  msgstr ""
103
 
104
+ #: ../head-cleaner.php:2032
105
  msgid "Debug mode"
106
  msgstr ""
107
 
108
+ #: ../head-cleaner.php:2045
109
  msgid "The CSS optimization settings"
110
  msgstr ""
111
 
112
+ #: ../head-cleaner.php:2047
113
  msgid "Compression (code layout):"
114
  msgstr ""
115
 
116
+ #: ../head-cleaner.php:2049
117
  msgid "Highest (no readability, smallest size)"
118
  msgstr ""
119
 
120
+ #: ../head-cleaner.php:2050
121
  msgid "High (moderate readability, smaller size)"
122
  msgstr ""
123
 
124
+ #: ../head-cleaner.php:2051
125
  msgid "Standard (balance between readability and size)"
126
  msgstr ""
127
 
128
+ #: ../head-cleaner.php:2052
129
  msgid "Low (higher readability)"
130
  msgstr ""
131
 
132
+ #: ../head-cleaner.php:2055
133
  msgid "Optimise shorthands"
134
  msgstr ""
135
 
136
+ #: ../head-cleaner.php:2057
137
  msgid "All optimisations"
138
  msgstr ""
139
 
140
+ #: ../head-cleaner.php:2058
141
  msgid "Safe optimisations"
142
  msgstr ""
143
 
144
+ #: ../head-cleaner.php:2059
145
  msgid "Don't optimise"
146
  msgstr ""
147
 
148
+ #: ../head-cleaner.php:2064
149
  msgid "Compress colors"
150
  msgstr ""
151
 
152
+ #: ../head-cleaner.php:2067
153
  msgid "Compress font-weight"
154
  msgstr ""
155
 
156
+ #: ../head-cleaner.php:2070
157
  msgid "Remove unnecessary backslashes"
158
  msgstr ""
159
 
160
+ #: ../head-cleaner.php:2078
161
  msgid "Active Filters"
162
  msgstr ""
163
 
164
+ #: ../head-cleaner.php:2081
165
+ #: ../head-cleaner.php:2118
166
  msgid "Don't process!"
167
  msgstr ""
168
 
169
+ #: ../head-cleaner.php:2082
170
+ #: ../head-cleaner.php:2119
171
+ #: ../head-cleaner.php:2161
172
  msgid "Remove"
173
  msgstr ""
174
 
175
+ #: ../head-cleaner.php:2083
176
  msgid "Head filters"
177
  msgstr ""
178
 
179
+ #: ../head-cleaner.php:2085
180
+ #: ../head-cleaner.php:2122
181
  msgid "Priority"
182
  msgstr ""
183
 
184
+ #: ../head-cleaner.php:2120
185
  msgid "Bottom filters"
186
  msgstr ""
187
 
188
+ #: ../head-cleaner.php:2157
189
  msgid "Active JavaScripts"
190
  msgstr ""
191
 
192
+ #: ../head-cleaner.php:2160
193
  msgid "Move to footer"
194
  msgstr ""
195
 
196
+ #: ../head-cleaner.php:2162
197
  msgid "JavaScripts"
198
  msgstr ""
199
 
200
+ #: ../head-cleaner.php:2175
201
  msgid "Update Options"
202
  msgstr ""
203
 
204
+ #: ../head-cleaner.php:2180
205
  msgid "Remove all cache files"
206
  msgstr ""
207
 
208
+ #: ../head-cleaner.php:2183
209
  msgid "All cache files are removed."
210
  msgstr ""
211
 
212
+ #: ../head-cleaner.php:2184
213
  msgid "Remove All Cache Files"
214
  msgstr ""
215
 
216
+ #: ../head-cleaner.php:2189
217
  msgid "Uninstall"
218
  msgstr ""
219
 
220
+ #: ../head-cleaner.php:2192
221
  msgid "All the settings of &quot;Head Cleaner&quot; are deleted."
222
  msgstr ""
223
 
224
+ #: ../head-cleaner.php:2193
225
  msgid "Delete Options"
226
  msgstr ""
227
 
readme.txt CHANGED
@@ -3,8 +3,8 @@ Contributors: wokamoto
3
  Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=9S8AJCY7XB8F4&lc=JP&item_name=WordPress%20Plugins&item_number=wp%2dplugins&currency_code=JPY&bn=PP%2dDonationsBF%3abtn_donate_SM%2egif%3aNonHosted
4
  Tags: head, header, footer, javascript, css, optimization, minified, performance
5
  Requires at least: 2.5
6
- Tested up to: 3.0.1
7
- Stable tag: 1.3.14
8
 
9
  Cleaning tags from your WordPress header and footer.
10
 
@@ -27,6 +27,7 @@ To speed up the loading of JavaScript and CSS.
27
  * Have multiple CSS files into the media and a binding for each attribute.
28
  Of course, the file contains inline CSS.
29
  * CSS minified.
 
30
  * Have multiple JavaScript files into a binding and all.
31
  Of course, the file also includes an inline JavaScript.
32
  * JavaScript source code minified at [JSMin](http://code.google.com/p/jsmin-php/ "JSMin").
@@ -89,6 +90,9 @@ Head Cleaner Ver.1.1.5 includes 'php_browscap.ini' .
89
 
90
  == Changelog ==
91
 
 
 
 
92
  **1.3.13 - August 20, 2010**
93
  Twenty Ten Themes support.
94
 
3
  Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=9S8AJCY7XB8F4&lc=JP&item_name=WordPress%20Plugins&item_number=wp%2dplugins&currency_code=JPY&bn=PP%2dDonationsBF%3abtn_donate_SM%2egif%3aNonHosted
4
  Tags: head, header, footer, javascript, css, optimization, minified, performance
5
  Requires at least: 2.5
6
+ Tested up to: 3.0.2
7
+ Stable tag: 1.4.0
8
 
9
  Cleaning tags from your WordPress header and footer.
10
 
27
  * Have multiple CSS files into the media and a binding for each attribute.
28
  Of course, the file contains inline CSS.
29
  * CSS minified.
30
+ * URLs of images in CSS will be converted into the data scheme URIs.
31
  * Have multiple JavaScript files into a binding and all.
32
  Of course, the file also includes an inline JavaScript.
33
  * JavaScript source code minified at [JSMin](http://code.google.com/p/jsmin-php/ "JSMin").
90
 
91
  == Changelog ==
92
 
93
+ **1.4.0 - December 2, 2010**
94
+ URLs of images in CSS will be converted into the data scheme URIs.
95
+
96
  **1.3.13 - August 20, 2010**
97
  Twenty Ten Themes support.
98
 
readme_ja.txt CHANGED
@@ -1,94 +1,94 @@
1
- === Head Cleaner ===
2
- Contributors: wokamoto
3
- Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=9S8AJCY7XB8F4&lc=JP&item_name=WordPress%20Plugins&item_number=wp%2dplugins&currency_code=JPY&bn=PP%2dDonationsBF%3abtn_donate_SM%2egif%3aNonHosted
4
- Tags: head optimization, javascript, css, optimization, minified, performance
5
- Requires at least: 2.5
6
- Tested up to: 3.0.1
7
- Stable tag: 1.3.14
8
-
9
- Head �� footer �����|�����܂��B
10
-
11
- == Description ==
12
-
13
- WordPress �T�C�g�� `<head>` �̒��g�ƁA�t�b�^�̈�𐮌`���Ȃ����܂��B
14
- **PHP5 �ȍ~�̂ݑΉ��ł��B**
15
-
16
- = Features =
17
-
18
- * IE6 �ȊO�̎��͐擪�� xml �錾��t�^�B
19
- * �d���^�O��A�s�v�ȃ^�O�A�R�����g�A�󔒂��폜�B
20
- * `<meta name="description" />` �^�O����������ꍇ�A��‚ɂ܂Ƃ߂�
21
- * `<meta name="keyword" />` �^�O����������ꍇ�A��‚ɂ܂Ƃ߂�
22
- * �b��� `<link rel="canonical" />` �^�O��lj��B
23
- * IE �R���f�B�V���i���^�O�𔻒肵�āA�u���E�U�� IE �̎������Ώۃ^�O��\���B
24
- * CSS, JavaScript �́A�u���E�U���Ή����Ă���� gzip ���k�]���B
25
- * �������� CSS �� media �������ƂɌ������Ĉ�t�@�C���ɂ܂Ƃ߂�B
26
- �������A���̃t�@�C���ɂ� �C�����C�� CSS ���܂܂��B
27
- * [CSSTidy](http://csstidy.sourceforge.net/ "CSSTidy") ���g�p���� CSS ���œK������B
28
- * CSSTidy �̍œK���I�v�V�������Ǘ���ʂŎw��ł���B
29
- * �������� JavaScript �����ׂČ������Ĉ�t�@�C���ɂ܂Ƃ߂�B
30
- �������A���̃t�@�C���ɂ� �C�����C�� JavaScript ���܂܂��B
31
- * [JSMin](http://code.google.com/p/jsmin-php/ "JSMin") �ŁAJavaScript �̃\�[�X�R�[�h�����k����B
32
- * JavaScript ���t�b�^�̈�Ɉړ����邱�Ƃ��ł���B
33
- * �t�b�^�̈�� JavaScript �����l�Ɍ������Ĉ�t�@�C���ɂ܂Ƃ߂�B
34
- * Prototype.js, script.aculo.us, jQuery, mootools �������ǂݍ��܂�Ă���ꍇ�A�P�񂾂��ǂݍ��ނ悤�ɂ���B
35
- * Prototype.js, script.aculo.us, jQuery, mootools �̓ǂݍ��ݏ����C�����āA�ł��邾���R���t���N�g���������Ȃ��悤�ɂ���B
36
-
37
- = Localization =
38
- "Head Cleaner" ���e����ɖ|�󂵂Ă������������X�Ɋ��ӂ����߂āB
39
-
40
- * Belorussian (by) - [Marcis Gasuns](http://www.comfi.com/ "Marcis Gasuns")
41
- * Dutch (nl_NL) - [Rene](http://wpwebshop.com/blog "WPWebshop Blog")
42
- * German (de) - Carsten
43
- * Japanese (ja) - [OKAMOTO Wataru](http://dogmap.jp/ "dogmap.jp") (plugin author)
44
- * Spanish (es) - [Franz Hartmann](http://tolingo.com/ "tolingo.com - Franz Hartmann")
45
- * Russian (ru) - [ilyuha](http://antsar.info/ "ilyuha")
46
-
47
-
48
- == Installation ==
49
-
50
- 1. `/wp-content/plugins/` �f�B���N�g���� `head-cleaner` �f�B���N�g�����쐬���A���̒��Ƀv���O�C���t�@�C�����i�[���Ă��������B
51
- �@��ʓI�ɂ� .zip ����W�J���ꂽ head-cleaner �t�H���_�����̂܂܃A�b�v���[�h����� OK �ł��B
52
- 2. `/wp-content/` �f�B���N�g���ȉ��� `cache/head-cleaner` �Ƃ����f�B���N�g�����쐬���A����ɂ��̒��� `js`, `css` �Ƃ����Q�‚̃f�B���N�g�����쐬���āA�������݌�����^���Ă��������B
53
- 3. WordPress �� "�v���O�C��" ���j���[���� "Head Cleaner" ��L���������������B
54
-
55
- Head Cleaner �̃I�v�V�����ݒ�� "�ݒ� > Head Cleaner" �ōs���܂��B
56
-
57
-
58
- **�g�p���Ă���PHP���C�u���� [Simple HTML DOM Parser](http://simplehtmldom.sourceforge.net/ "Simple HTML DOM Parser") �� [JSMin](http://code.google.com/p/jsmin-php/ "JSMin") �̐�����APHP5 �ȍ~�̂ݑΉ��ł��B**
59
-
60
- == Frequently Asked Questions ==
61
-
62
- ����̃v���O�C���������o���R�[�h�𐮌`�ΏۊO�ɂ������ꍇ�́A�ݒ��ʂ́u�A�N�e�B�u�ȃt�B���^�v����A�ΏۊO�ɂ������t�B���^����I�����Ă��������B
63
-
64
-
65
- �e�[�}���̓���̋L�q�𐮌`�ΏۊO�ɂ������ꍇ�� `header.php` ���C������K�v������܂��B
66
- ��̓I�ɂ́A���`�ΏۊO�ɂ����������� `<?php wp_head(); ?>` ��艺�ɋL�q���Ă��������B
67
-
68
-
69
- �����Ɏg�p���Ă���v���O�C���E�e�[�}�ɂ���Ă͐���ɓ��삵�܂���B
70
- ����ɓ��삵�Ȃ��ꍇ�́A���̃v���O�C���ȊO�̂��ׂẴv���O�C�����~������A��ˆ�—L�������āA�ǂ̃v���O�C���Ƌ������邩�m���߂Ă݂Ă��������B
71
- ��������v���O�C�������������ꍇ�A��҂܂ŘA������������Ɣ��ɏ�����܂��B
72
- [http://dogmap.jp/2009/02/20/head-cleaner/](http://dogmap.jp/2009/02/20/head-cleaner/ "http://dogmap.jp/2009/02/20/head-cleaner/")
73
-
74
-
75
- ���݁A�ȉ��̃v���O�C���Ɠ����Ɏg�p����ƁA����ɓ��삵�Ȃ����Ƃ��񍐂���Ă��܂��B
76
-
77
- **[All in One SEO Pack](http://wordpress.org/extend/plugins/all-in-one-seo-pack/ "All in One SEO Pack")**
78
- �@�ꕔ�‹��Łu�^�C�g���̏��������v�I�v�V�������L���ɂȂ��Ă���ƁA���̃v���O�C�������퓮�삵�Ȃ��Ƃ����񍐂�����܂����B
79
- �@�ʏ�͖�肪����܂��񂪁A��肪���������ꍇ�́u�^�C�g���̏��������v���I�t�ɂ��āA�^�C�g���̏��������͕ʃv���O�C�����g�p����悤�ɂ��Ă��������B
80
- ( Ver.1.3.4 �ŏC�� )
81
-
82
- = CSS, JavaScript �̃L���b�V���t�@�C�����쐬����܂��� =
83
-
84
- �ȉ��̓�‚̃f�B���N�g���� CSS, JavaScript ���L���b�V�����܂��B
85
- �L���b�V����L���ɂ������ꍇ�́A���ꂼ��̃t�H���_���쐬���Ă��������B
86
-
87
- * `wp-content/cache/head-cleaner/css/`
88
- * `wp-content/cache/head-cleaner/js/`
89
-
90
- = ���[�j���O���\������܂��uget_browser(): browscap ini directive not set in �`�v =
91
-
92
- ���̊֐�������ɋ@�\���邽�߂ɂ́Aphp.ini �� browscap �ݒ肪�A�V�X�e����� browscap.ini �̐��m�Ȉʒu�� �w���Ă���K�v������܂��B
93
- �Q�ƁF[PHP: get_browser](http://jp.php.net/manual/ja/function.get-browser.php "PHP: get_browser - Manual")
94
-
1
+ === Head Cleaner ===
2
+ Contributors: wokamoto
3
+ Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=9S8AJCY7XB8F4&lc=JP&item_name=WordPress%20Plugins&item_number=wp%2dplugins&currency_code=JPY&bn=PP%2dDonationsBF%3abtn_donate_SM%2egif%3aNonHosted
4
+ Tags: head optimization, javascript, css, optimization, minified, performance
5
+ Requires at least: 2.5
6
+ Tested up to: 3.0.2
7
+ Stable tag: 1.4.0
8
+
9
+ Head footer をお掃除します。
10
+
11
+ == Description ==
12
+
13
+ WordPress サイトの `<head>` の中身と、フッタ領域を整形しなおします。
14
+ **PHP5 以降のみ対応です。**
15
+
16
+ = Features =
17
+
18
+ * IE6 以外の時は先頭に xml 宣言を付与。
19
+ * 重複タグや、不要なタグ、コメント、空白を削除。
20
+ * `<meta name="description" />` タグが複数ある場合、一つにまとめる
21
+ * `<meta name="keyword" />` タグが複数ある場合、一つにまとめる
22
+ * 話題の `<link rel="canonical" />` タグを追加。
23
+ * IE コンディショナルタグを判定して、ブラウザが IE の時だけ対象タグを表示。
24
+ * 複数ある CSS media 属性ごとに結合して一ファイルにまとめる。
25
+ もちろん、そのファイルには インライン CSS も含まれる。
26
+ * CSS を圧縮する。
27
+ * CSS に含まれる画像の URL を、データスキーマ URI に変換する。
28
+ * 複数ある JavaScript をすべて結合して一ファイルにまとめる。
29
+ もちろん、そのファイルには インライン JavaScript も含まれる。
30
+ * [JSMin](http://code.google.com/p/jsmin-php/ "JSMin") で、JavaScript のソースコードを圧縮する。
31
+ * JavaScript をフッタ領域に移動することもできる。
32
+ * フッタ領域の JavaScript も同様に結合して一ファイルにまとめる。
33
+ * Prototype.js, script.aculo.us, jQuery, mootools が複数読み込まれている場合、1回だけ読み込むようにする。
34
+ * Prototype.js, script.aculo.us, jQuery, mootools の読み込み順を修正して、できるだけコンフリクトが発生しないようにする。
35
+
36
+ = Localization =
37
+ "Head Cleaner" を各国語に翻訳してくださった方々に感謝を込めて。
38
+
39
+ * Belorussian (by) - [Marcis Gasuns](http://www.comfi.com/ "Marcis Gasuns")
40
+ * Dutch (nl_NL) - [Rene](http://wpwebshop.com/blog "WPWebshop Blog")
41
+ * German (de) - Carsten
42
+ * Japanese (ja) - [OKAMOTO Wataru](http://dogmap.jp/ "dogmap.jp") (plugin author)
43
+ * Spanish (es) - [Franz Hartmann](http://tolingo.com/ "tolingo.com - Franz Hartmann")
44
+ * Russian (ru) - [ilyuha](http://antsar.info/ "ilyuha")
45
+ * Turkish (tr_TR) - [Hakan Demiray](http://www.dmry.net/ "Günlük Haftalık Aylık")
46
+
47
+
48
+ == Installation ==
49
+
50
+ 1. `/wp-content/plugins/` ディレクトリに `head-cleaner` ディレクトリを作成し、その中にプラグインファイルを格納してください。
51
+  一般的には .zip から展開された head-cleaner フォルダをそのままアップロードすれば OK です。
52
+ 2. `/wp-content/` ディレクトリ以下に `cache/head-cleaner` というディレクトリを作成し、さらにその中に `js`, `css` という2つのディレクトリを作成して、書き込み権限を与えてください。
53
+ 3. WordPress "プラグイン" メニューから "Head Cleaner" を有効化してください。
54
+
55
+ Head Cleaner のオプション設定は "設定 > Head Cleaner" で行えます。
56
+
57
+
58
+ **使用しているPHPライブラリ [Simple HTML DOM Parser](http://simplehtmldom.sourceforge.net/ "Simple HTML DOM Parser") [JSMin](http://code.google.com/p/jsmin-php/ "JSMin") の制限上、PHP5 以降のみ対応です。**
59
+
60
+ == Frequently Asked Questions ==
61
+
62
+ 特定のプラグインが書き出すコードを整形対象外にしたい場合は、設定画面の「アクティブなフィルタ」から、対象外にしたいフィルタ名を選択してください。
63
+
64
+
65
+ テーマ内の特定の記述を整形対象外にしたい場合は `header.php` を修正する必要があります。
66
+ 具体的には、整形対象外にしたい部分を `<?php wp_head(); ?>` より下に記述してください。
67
+
68
+
69
+ 同時に使用しているプラグイン・テーマによっては正常に動作しません。
70
+ 正常に動作しない場合は、このプラグイン以外のすべてのプラグインを停止した後、一つ一つ有効化して、どのプラグインと競合するか確かめてみてください。
71
+ 競合するプラグインが判明した場合、作者まで連絡いただけると非常に助かります。
72
+ [http://dogmap.jp/2009/02/20/head-cleaner/](http://dogmap.jp/2009/02/20/head-cleaner/ "http://dogmap.jp/2009/02/20/head-cleaner/")
73
+
74
+
75
+ 現在、以下のプラグインと同時に使用すると、正常に動作しないことが報告されています。
76
+
77
+ **[All in One SEO Pack](http://wordpress.org/extend/plugins/all-in-one-seo-pack/ "All in One SEO Pack")**
78
+  一部環境で「タイトルの書き換え」オプションが有効になっていると、このプラグインが正常動作しないという報告がありました。
79
+  通常は問題がありませんが、問題が発生した場合は「タイトルの書き換え」をオフにして、タイトルの書き換えは別プラグインを使用するようにしてください。
80
+ ( Ver.1.3.4 で修正 )
81
+
82
+ = CSS, JavaScript のキャッシュファイルが作成されません =
83
+
84
+ 以下の二つのディレクトリに CSS, JavaScript をキャッシュします。
85
+ キャッシュを有効にしたい場合は、それぞれのフォルダを作成してください。
86
+
87
+ * `wp-content/cache/head-cleaner/css/`
88
+ * `wp-content/cache/head-cleaner/js/`
89
+
90
+ = ワーニングが表示されます「get_browser(): browscap ini directive not set in ~」 =
91
+
92
+ この関数が正常に機能するためには、php.ini browscap 設定が、システム上の browscap.ini の正確な位置を 指している必要があります。
93
+ 参照:[PHP: get_browser](http://jp.php.net/manual/ja/function.get-browser.php "PHP: get_browser - Manual")
94
+