Browse Source

Add simplepie

pull/1/head
Mike Macgirvin 11 years ago
parent
commit
9f7ae0e95f
  1. 26
      simplepie/LICENSE.txt
  2. 53
      simplepie/README.markdown
  3. 7
      simplepie/compatibility_test/COMPATIBILITY README.txt
  4. 330
      simplepie/compatibility_test/sp_compatibility_test.php
  5. 178
      simplepie/create.php
  6. 38
      simplepie/db.sql
  7. 23
      simplepie/demo/cli_test.php
  8. BIN
      simplepie/demo/for_the_demo/alternate_favicon.png
  9. BIN
      simplepie/demo/for_the_demo/background_blockquote.png
  10. BIN
      simplepie/demo/for_the_demo/background_menuitem.gif
  11. BIN
      simplepie/demo/for_the_demo/background_menuitem_off.gif
  12. BIN
      simplepie/demo/for_the_demo/background_menuitem_shadow.gif
  13. BIN
      simplepie/demo/for_the_demo/favicons/alternate.png
  14. BIN
      simplepie/demo/for_the_demo/favicons/blinklist.png
  15. BIN
      simplepie/demo/for_the_demo/favicons/blogmarks.png
  16. BIN
      simplepie/demo/for_the_demo/favicons/delicious.png
  17. BIN
      simplepie/demo/for_the_demo/favicons/digg.png
  18. BIN
      simplepie/demo/for_the_demo/favicons/magnolia.png
  19. BIN
      simplepie/demo/for_the_demo/favicons/myweb2.png
  20. BIN
      simplepie/demo/for_the_demo/favicons/newsvine.png
  21. BIN
      simplepie/demo/for_the_demo/favicons/reddit.png
  22. BIN
      simplepie/demo/for_the_demo/favicons/segnalo.png
  23. BIN
      simplepie/demo/for_the_demo/favicons/simpy.png
  24. BIN
      simplepie/demo/for_the_demo/favicons/spurl.png
  25. BIN
      simplepie/demo/for_the_demo/favicons/technorati.png
  26. BIN
      simplepie/demo/for_the_demo/favicons/wists.png
  27. BIN
      simplepie/demo/for_the_demo/feed.png
  28. BIN
      simplepie/demo/for_the_demo/logo_simplepie_demo.png
  29. BIN
      simplepie/demo/for_the_demo/lucida-grande-bold.swf
  30. BIN
      simplepie/demo/for_the_demo/mediaplayer.swf
  31. 5
      simplepie/demo/for_the_demo/mediaplayer_readme.htm
  32. BIN
      simplepie/demo/for_the_demo/mini_podcast.png
  33. BIN
      simplepie/demo/for_the_demo/place_audio.png
  34. BIN
      simplepie/demo/for_the_demo/place_video.png
  35. 35
      simplepie/demo/for_the_demo/sIFR-print.css
  36. 39
      simplepie/demo/for_the_demo/sIFR-screen.css
  37. 40
      simplepie/demo/for_the_demo/sifr-config.js
  38. 19
      simplepie/demo/for_the_demo/sifr.js
  39. 397
      simplepie/demo/for_the_demo/simplepie.css
  40. 31
      simplepie/demo/for_the_demo/sleight.js
  41. BIN
      simplepie/demo/for_the_demo/source_files/place_audio_fireworksfile.png
  42. BIN
      simplepie/demo/for_the_demo/source_files/place_video_fireworksfile.png
  43. 71
      simplepie/demo/for_the_demo/source_files/sIFR-r245/SifrStyleSheet.as
  44. 12
      simplepie/demo/for_the_demo/source_files/sIFR-r245/_README_.txt
  45. 12
      simplepie/demo/for_the_demo/source_files/sIFR-r245/options.as
  46. 359
      simplepie/demo/for_the_demo/source_files/sIFR-r245/sIFR.as
  47. BIN
      simplepie/demo/for_the_demo/source_files/sIFR-r245/sifr.fla
  48. BIN
      simplepie/demo/for_the_demo/top_gradient.gif
  49. BIN
      simplepie/demo/for_the_demo/verdana.swf
  50. BIN
      simplepie/demo/for_the_demo/yanone-kaffeesatz-bold.swf
  51. 6
      simplepie/demo/handler_image.php
  52. 295
      simplepie/demo/index.php
  53. 137
      simplepie/demo/minimalistic.php
  54. 108
      simplepie/demo/multifeeds.php
  55. 62
      simplepie/demo/test.php
  56. 502
      simplepie/idn/LICENCE
  57. 123
      simplepie/idn/ReadMe.txt
  58. 969
      simplepie/idn/idna_convert.class.php
  59. 1
      simplepie/idn/npdata.ser
  60. 15023
      simplepie/simplepie.inc
  61. 1
      simplepie/test/absolutize/RFC3986.5.4/README
  62. 16
      simplepie/test/absolutize/RFC3986.5.4/abnormal/1.php
  63. 16
      simplepie/test/absolutize/RFC3986.5.4/abnormal/10.php
  64. 16
      simplepie/test/absolutize/RFC3986.5.4/abnormal/11.php
  65. 16
      simplepie/test/absolutize/RFC3986.5.4/abnormal/12.php
  66. 16
      simplepie/test/absolutize/RFC3986.5.4/abnormal/13.php
  67. 16
      simplepie/test/absolutize/RFC3986.5.4/abnormal/14.php
  68. 16
      simplepie/test/absolutize/RFC3986.5.4/abnormal/15.php
  69. 16
      simplepie/test/absolutize/RFC3986.5.4/abnormal/16.php
  70. 16
      simplepie/test/absolutize/RFC3986.5.4/abnormal/17.php
  71. 16
      simplepie/test/absolutize/RFC3986.5.4/abnormal/18.php
  72. 16
      simplepie/test/absolutize/RFC3986.5.4/abnormal/19.php
  73. 16
      simplepie/test/absolutize/RFC3986.5.4/abnormal/2.php
  74. 16
      simplepie/test/absolutize/RFC3986.5.4/abnormal/3.php
  75. 16
      simplepie/test/absolutize/RFC3986.5.4/abnormal/4.php
  76. 16
      simplepie/test/absolutize/RFC3986.5.4/abnormal/5.php
  77. 16
      simplepie/test/absolutize/RFC3986.5.4/abnormal/6.php
  78. 16
      simplepie/test/absolutize/RFC3986.5.4/abnormal/7.php
  79. 16
      simplepie/test/absolutize/RFC3986.5.4/abnormal/8.php
  80. 16
      simplepie/test/absolutize/RFC3986.5.4/abnormal/9.php
  81. 25
      simplepie/test/absolutize/RFC3986.5.4/base.php
  82. 16
      simplepie/test/absolutize/RFC3986.5.4/normal/1.php
  83. 16
      simplepie/test/absolutize/RFC3986.5.4/normal/10.php
  84. 16
      simplepie/test/absolutize/RFC3986.5.4/normal/11.php
  85. 16
      simplepie/test/absolutize/RFC3986.5.4/normal/12.php
  86. 16
      simplepie/test/absolutize/RFC3986.5.4/normal/13.php
  87. 16
      simplepie/test/absolutize/RFC3986.5.4/normal/14.php
  88. 16
      simplepie/test/absolutize/RFC3986.5.4/normal/15.php
  89. 16
      simplepie/test/absolutize/RFC3986.5.4/normal/16.php
  90. 16
      simplepie/test/absolutize/RFC3986.5.4/normal/17.php
  91. 16
      simplepie/test/absolutize/RFC3986.5.4/normal/18.php
  92. 16
      simplepie/test/absolutize/RFC3986.5.4/normal/19.php
  93. 16
      simplepie/test/absolutize/RFC3986.5.4/normal/2.php
  94. 16
      simplepie/test/absolutize/RFC3986.5.4/normal/20.php
  95. 16
      simplepie/test/absolutize/RFC3986.5.4/normal/21.php
  96. 16
      simplepie/test/absolutize/RFC3986.5.4/normal/22.php
  97. 16
      simplepie/test/absolutize/RFC3986.5.4/normal/23.php
  98. 16
      simplepie/test/absolutize/RFC3986.5.4/normal/3.php
  99. 16
      simplepie/test/absolutize/RFC3986.5.4/normal/4.php
  100. 16
      simplepie/test/absolutize/RFC3986.5.4/normal/5.php

26
simplepie/LICENSE.txt

@ -0,0 +1,26 @@
Copyright (c) 2004-2007, Ryan Parman and Geoffrey Sneddon.
All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are
permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice, this list of
conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice, this list
of conditions and the following disclaimer in the documentation and/or other materials
provided with the distribution.
* Neither the name of the SimplePie Team nor the names of its contributors may be used
to endorse or promote products derived from this software without specific prior
written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS
OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS
AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.

53
simplepie/README.markdown

@ -0,0 +1,53 @@
# SimplePie
## Authors and contributors
* [Ryan Parman](http://ryanparman.com)
* [Geoffrey Sneddon](http://gsnedders.com)
* [Ryan McCue](http://ryanmccue.info)
* [Michael Shipley](http://michaelpshipley.com)
* [Steve Minutillo](http://minutillo.com/steve/)
## License
[New BSD license](http://www.opensource.org/licenses/bsd-license.php)
## Project status
SimplePie is currently maintained by Ryan McCue.
At the moment, there isn't a lot of active development happening. If the community decides that SimplePie is a valuable tool, then the community will come together to maintain it into the future.
If you're interested in getting involved with SimplePie, please get in touch with Ryan McCue.
## What comes in the package?
1. `simplepie.inc` - The SimplePie library. This is all that's required for your pages.
2. `README.markdown` - This document.
3. `LICENSE.txt` - A copy of the BSD license.
4. `compatibility_test/` - The SimplePie compatibility test that checks your server for required settings.
5. `demo/` - A basic feed reader demo that shows off some of SimplePie's more noticable features.
6. `idn/` - A third-party library that SimplePie can optionally use to understand Internationalized Domain Names (IDNs).
7. `test/` - SimplePie's unit test suite.
## To start the demo
1. Upload this package to your webserver.
2. Make sure that the cache folder inside of the demo folder is server-writable.
3. Navigate your browser to the demo folder.
## Need support?
For further setup and install documentation, function references, etc., visit:
[http://simplepie.org/wiki/](http://simplepie.org/wiki/)
For bug reports and feature requests, visit:
[http://github.com/rmccue/simplepie/issues](http://github.com/rmccue/simplepie/issues)
Support mailing list -- powered by users, for users.
[http://tech.groups.yahoo.com/group/simplepie-support/](http://tech.groups.yahoo.com/group/simplepie-support/)

7
simplepie/compatibility_test/COMPATIBILITY README.txt

@ -0,0 +1,7 @@
SIMPLEPIE COMPATIBILITY TEST
1) Upload sp_compatibility_test.php to the web-accessible root of your website.
For example, if your website is www.example.com, upload it so that you can get
to it at www.example.com/sp_compatibility_test.php
2) Open your web browser and go to the page you just uploaded.

330
simplepie/compatibility_test/sp_compatibility_test.php
File diff suppressed because it is too large
View File

178
simplepie/create.php

@ -0,0 +1,178 @@
<?php
require_once 'simplepie.inc';
function normalize_character_set($charset)
{
return strtolower(preg_replace('/(?:[^a-zA-Z0-9]+|([^0-9])0+)/', '\1', $charset));
}
function build_character_set_list()
{
$file = new SimplePie_File('http://www.iana.org/assignments/character-sets');
if (!$file->success && !($file->method & SIMPLEPIE_FILE_SOURCE_REMOTE === 0 || ($file->status_code === 200 || $file->status_code > 206 && $file->status_code < 300)))
{
return false;
}
else
{
$data = explode("\n", $file->body);
unset($file);
foreach ($data as $line)
{
// New character set
if (substr($line, 0, 5) === 'Name:')
{
// If we already have one, push it on to the array
if (isset($aliases))
{
for ($i = 0, $count = count($aliases); $i < $count; $i++)
{
$aliases[$i] = normalize_character_set($aliases[$i]);
}
$charsets[$preferred] = array_unique($aliases);
natsort($charsets[$preferred]);
}
$start = 5 + strspn($line, "\x09\x0A\x0B\xC\x0D\x20", 5);
$chars = strcspn($line, "\x09\x0A\x0B\xC\x0D\x20", $start);
$aliases = array(substr($line, $start, $chars));
$preferred = end($aliases);
}
// Another alias
elseif(substr($line, 0, 6) === 'Alias:')
{
$start = 7 + strspn($line, "\x09\x0A\x0B\xC\x0D\x20", 7);
$chars = strcspn($line, "\x09\x0A\x0B\xC\x0D\x20", $start);
$aliases[] = substr($line, $start, $chars);
if (end($aliases) === 'None')
{
array_pop($aliases);
}
elseif (substr($line, 7 + $chars + 1, 21) === '(preferred MIME name)')
{
$preferred = end($aliases);
}
}
}
// Compatibility replacements
$compat = array(
'EUC-KR' => 'windows-949',
'GB2312' => 'GBK',
'GB_2312-80' => 'GBK',
'ISO-8859-1' => 'windows-1252',
'ISO-8859-9' => 'windows-1254',
'ISO-8859-11' => 'windows-874',
'KS_C_5601-1987' => 'windows-949',
'TIS-620' => 'windows-874',
//'US-ASCII' => 'windows-1252',
'x-x-big5' => 'Big5',
);
foreach ($compat as $real => $replace)
{
if (isset($charsets[$real]) && isset($charsets[$replace]))
{
$charsets[$replace] = array_merge($charsets[$replace], $charsets[$real]);
unset($charsets[$real]);
}
elseif (isset($charsets[$real]))
{
$charsets[$replace] = $charsets[$real];
$charsets[$replace][] = normalize_character_set($replace);
unset($charsets[$real]);
}
else
{
$charsets[$replace][] = normalize_character_set($real);
}
$charsets[$replace] = array_unique($charsets[$replace]);
natsort($charsets[$replace]);
}
// Sort it
uksort($charsets, 'strnatcasecmp');
// Check that nothing matches more than one
$all = call_user_func_array('array_merge', $charsets);
$all_count = array_count_values($all);
if (max($all_count) > 1)
{
echo "Duplicated charsets:\n";
foreach ($all_count as $charset => $count)
{
if ($count > 1)
{
echo "$charset\n";
}
}
}
// And we're done!
return $charsets;
}
}
function charset($charset)
{
$normalized_charset = normalize_character_set($charset);
if ($charsets = build_character_set_list())
{
foreach ($charsets as $preferred => $aliases)
{
if (in_array($normalized_charset, $aliases))
{
return $preferred;
}
}
return $charset;
}
else
{
return false;
}
}
function build_function()
{
if ($charsets = build_character_set_list())
{
$return = <<<EOF
function charset(\$charset)
{
// Normalization from UTS #22
switch (strtolower(preg_replace('/(?:[^a-zA-Z0-9]+|([^0-9])0+)/', '\\1', \$charset)))
{
EOF;
foreach ($charsets as $preferred => $aliases)
{
foreach ($aliases as $alias)
{
$return .= "\t\tcase " . var_export($alias, true) . ":\n";
}
$return .= "\t\t\treturn " . var_export($preferred, true) . ";\n\n";
}
$return .= <<<EOF
default:
return \$charset;
}
}
EOF;
return $return;
}
else
{
return false;
}
}
if (php_sapi_name() === 'cli' && realpath($_SERVER['argv'][0]) === __FILE__)
{
echo build_function();
}
?>

38
simplepie/db.sql

@ -0,0 +1,38 @@
/* SQLite */
CREATE TABLE cache_data (
id TEXT NOT NULL,
items SMALLINT NOT NULL DEFAULT 0,
data BLOB NOT NULL,
mtime INTEGER UNSIGNED NOT NULL
);
CREATE UNIQUE INDEX id ON cache_data(id);
CREATE TABLE items (
feed_id TEXT NOT NULL,
id TEXT NOT NULL,
data TEXT NOT NULL,
posted INTEGER UNSIGNED NOT NULL
);
CREATE INDEX feed_id ON items(feed_id);
/* MySQL */
CREATE TABLE `cache_data` (
`id` TEXT CHARACTER SET utf8 NOT NULL,
`items` SMALLINT NOT NULL DEFAULT 0,
`data` BLOB NOT NULL,
`mtime` INT UNSIGNED NOT NULL,
UNIQUE (
`id`(125)
)
);
CREATE TABLE `items` (
`feed_id` TEXT CHARACTER SET utf8 NOT NULL,
`id` TEXT CHARACTER SET utf8 NOT NULL,
`data` TEXT CHARACTER SET utf8 NOT NULL,
`posted` INT UNSIGNED NOT NULL,
INDEX `feed_id` (
`feed_id`(125)
)
);

23
simplepie/demo/cli_test.php

@ -0,0 +1,23 @@
#!/usr/bin/php
<?php
include_once('../simplepie.inc');
// Parse it
$feed = new SimplePie();
if (isset($argv[1]) && $argv[1] !== '')
{
$feed->set_feed_url($argv[1]);
$feed->enable_cache(false);
$feed->init();
}
$items = $feed->get_items();
foreach ($items as $item)
{
echo $item->get_title() . "\n";
}
var_dump($feed->get_item_quantity());
?>

BIN
simplepie/demo/for_the_demo/alternate_favicon.png

After

Width: 16  |  Height: 16  |  Size: 28 KiB

BIN
simplepie/demo/for_the_demo/background_blockquote.png

After

Width: 500  |  Height: 10  |  Size: 27 KiB

BIN
simplepie/demo/for_the_demo/background_menuitem.gif

After

Width: 300  |  Height: 28  |  Size: 533 B

BIN
simplepie/demo/for_the_demo/background_menuitem_off.gif

After

Width: 300  |  Height: 28  |  Size: 533 B

BIN
simplepie/demo/for_the_demo/background_menuitem_shadow.gif

After

Width: 10  |  Height: 120  |  Size: 250 B

BIN
simplepie/demo/for_the_demo/favicons/alternate.png

After

Width: 16  |  Height: 16  |  Size: 28 KiB

BIN
simplepie/demo/for_the_demo/favicons/blinklist.png

After

Width: 16  |  Height: 16  |  Size: 4.3 KiB

BIN
simplepie/demo/for_the_demo/favicons/blogmarks.png

After

Width: 16  |  Height: 16  |  Size: 3.7 KiB

BIN
simplepie/demo/for_the_demo/favicons/delicious.png

After

Width: 16  |  Height: 16  |  Size: 3.7 KiB

BIN
simplepie/demo/for_the_demo/favicons/digg.png

After

Width: 16  |  Height: 16  |  Size: 3.9 KiB

BIN
simplepie/demo/for_the_demo/favicons/magnolia.png

After

Width: 16  |  Height: 16  |  Size: 4.5 KiB

BIN
simplepie/demo/for_the_demo/favicons/myweb2.png

After

Width: 16  |  Height: 16  |  Size: 3.9 KiB

BIN
simplepie/demo/for_the_demo/favicons/newsvine.png

After

Width: 16  |  Height: 16  |  Size: 3.7 KiB

BIN
simplepie/demo/for_the_demo/favicons/reddit.png

After

Width: 16  |  Height: 16  |  Size: 4.1 KiB

BIN
simplepie/demo/for_the_demo/favicons/segnalo.png

After

Width: 16  |  Height: 16  |  Size: 4.0 KiB

BIN
simplepie/demo/for_the_demo/favicons/simpy.png

After

Width: 16  |  Height: 16  |  Size: 4.2 KiB

BIN
simplepie/demo/for_the_demo/favicons/spurl.png

After

Width: 16  |  Height: 16  |  Size: 3.9 KiB

BIN
simplepie/demo/for_the_demo/favicons/technorati.png

After

Width: 16  |  Height: 16  |  Size: 4.0 KiB

BIN
simplepie/demo/for_the_demo/favicons/wists.png

After

Width: 16  |  Height: 16  |  Size: 3.9 KiB

BIN
simplepie/demo/for_the_demo/feed.png

After

Width: 16  |  Height: 16  |  Size: 715 B

BIN
simplepie/demo/for_the_demo/logo_simplepie_demo.png

After

Width: 247  |  Height: 45  |  Size: 3.0 KiB

BIN
simplepie/demo/for_the_demo/lucida-grande-bold.swf

BIN
simplepie/demo/for_the_demo/mediaplayer.swf

5
simplepie/demo/for_the_demo/mediaplayer_readme.htm

@ -0,0 +1,5 @@
<html>
<head>
<meta http-equiv="refresh" content="0;url=http://www.jeroenwijering.com/extras/readme.html">
</head>
</html>

BIN
simplepie/demo/for_the_demo/mini_podcast.png

After

Width: 68  |  Height: 19  |  Size: 1.2 KiB

BIN
simplepie/demo/for_the_demo/place_audio.png

After

Width: 130  |  Height: 16  |  Size: 851 B

BIN
simplepie/demo/for_the_demo/place_video.png

After

Width: 480  |  Height: 376  |  Size: 36 KiB

35
simplepie/demo/for_the_demo/sIFR-print.css

@ -0,0 +1,35 @@
/*=:project
scalable Inman Flash Replacement (sIFR) version 3.
=:file
Copyright: 2006 Mark Wubben.
Author: Mark Wubben, <http://novemberborn.net/>
=:history
* IFR: Shaun Inman
* sIFR 1: Mike Davidson, Shaun Inman and Tomas Jogin
* sIFR 2: Mike Davidson, Shaun Inman, Tomas Jogin and Mark Wubben
=:license
This software is licensed and provided under the CC-GNU LGPL.
See <http://creativecommons.org/licenses/LGPL/2.1/>
*/
/* This is the print stylesheet to hide the Flash headlines from the browser... regular browser text headlines will now print as normal */
.sIFR-flash {
display: none !important;
height: 0;
width: 0;
position: absolute;
overflow: hidden;
}
.sIFR-alternate {
visibility: visible !important;
display: block !important;
position: static !important;
left: auto !important;
top: auto !important;
}

39
simplepie/demo/for_the_demo/sIFR-screen.css

@ -0,0 +1,39 @@
/*=:project
scalable Inman Flash Replacement (sIFR) version 3.
=:file
Copyright: 2006 Mark Wubben.
Author: Mark Wubben, <http://novemberborn.net/>
=:history
* IFR: Shaun Inman
* sIFR 1: Mike Davidson, Shaun Inman and Tomas Jogin
* sIFR 2: Mike Davidson, Shaun Inman, Tomas Jogin and Mark Wubben
=:license
This software is licensed and provided under the CC-GNU LGPL.
See <http://creativecommons.org/licenses/LGPL/2.1/>
*/
/*---- sIFR ---*/
.sIFR-flash {
visibility: visible !important;
margin: 0;
padding: 0;
}
.sIFR-replaced {
visibility: visible !important;
}
.sIFR-alternate {
position: absolute;
left: 0;
top: 0;
width: 0;
height: 0;
display: block;
overflow: hidden;
}
/*---- Header styling ---*/

40
simplepie/demo/for_the_demo/sifr-config.js

@ -0,0 +1,40 @@
var yanone_kaffeesatz = {
src: './for_the_demo/yanone-kaffeesatz-bold.swf'
};
var lucida_grande = {
src: './for_the_demo/lucida-grande-bold.swf'
};
sIFR.activate(yanone_kaffeesatz);
//sIFR.activate(lucida_grande);
sIFR.replace(yanone_kaffeesatz, {
//sIFR.replace(lucida_grande, {
selector: 'h3.header',
wmode: 'transparent',
css: {
'.sIFR-root': {
'text-align': 'center',
'color': '#000000',
'font-weight': 'bold',
'background-color': '#EEFFEE',
'font-size': '50px', // For Yanone Kaffeesatz
//'font-size': '40px', // For Lucida Grande
'letter-spacing': '0' // For Yanone Kaffeesatz
//'letter-spacing': '-4' // For Lucida Grande
},
'a': {
'text-decoration': 'none',
'color': '#000000'
},
'a:hover': {
'text-decoration': 'none',
'color': '#666666'
}
}
});

19
simplepie/demo/for_the_demo/sifr.js
File diff suppressed because it is too large
View File

397
simplepie/demo/for_the_demo/simplepie.css

@ -0,0 +1,397 @@
/*
Theme Name: SimplePie
Theme URI: http://simplepie.org
Description: A simple, yet beautiful theme inspired by several cleanly designed websites.
Version: 1.4
Author: Ryan Parman
Author URI: http://skyzyx.com
Updated: 21 June 2007
*/
/*********************************************
HYPERLINK STYLES
*********************************************/
a {
color:#369;
text-decoration:underline;
padding:0 1px;
}
a:hover {
color:#fff !important;
background-color:#333;
text-decoration:none;
padding:0 1px;
}
a.nohover {
text-decoration:none;
border:none;
}
a.nohover:hover {
background-color:transparent;
border:none;
}
a.namelink {
padding:0;
margin:0;
overflow:hidden;
height:1px;
}
h4 a,
.sample_feeds a {
color:#000;
}
/*********************************************
GENERAL STYLES
*********************************************/
body {
/*font:12px/18px Verdana, sans-serif;*/
font:14px/1.5em "Lucida Grande", Tahoma, sans-serif;
letter-spacing:0px;
color:#333;
background-color:#fff;
margin:0;
padding:0;
}
div#site {
width:600px;
margin:50px auto 0 auto;
}
h1#logo {
margin:0;
padding:0;
text-align:center;
}
h1#logo a,
h1#logo a:hover {
background-color:transparent;
text-decoration:none;
padding:0;
}
h2.image {
margin:0;
padding:0;
text-align:center;
}
h3 {
margin:20px 0 0 0;
padding:0;
font-size:1.5em;
}
h4 {
margin:20px 0 0 0;
padding:0;
font-size:1.2em;
letter-spacing:-1px;
}
h5 {
margin:10px 0 0 0;
padding:0;
font-size:1em;
font-weight:bold;
}
em {
font-style:normal;
background-color:#ffc;
}
p {
margin:0;
padding:5px 0;
}
ul, ol {
margin:10px 0 10px 20px;
padding:0 0 0 15px;
}
ul li, ol li {
margin:0 0 7px 0;
padding:0 0 0 3px;
}
form {
margin:0;
padding:0;
}
code {
font-size:1em;
background-color:#f3f3ff;
color:#000;
}
div#site pre {
background-color:#f3f3ff;
color:#000080;
border:1px dotted #000080;
overflow:auto;
padding:3px 5px;
}
blockquote {
font-size:1em;
color:#666;
border-left:4px solid #666;
margin:10px 0 10px 30px;
padding:0 5px 0 10px;
background:#f3f3f3 url(background_blockquote.png) repeat top left;
}
input, select, textarea {
font-size:12px;
line-height:1.2em;
padding:2px;
}
input[type=text], select, textarea {
background-color:#e9f5ff;
border:1px solid #333;
}
input[type=text]:focus, select:focus, textarea:focus {
background-color:#ffe;
}
.clearLeft {clear:left;}
.clearRight {clear:right;}
.clearBoth {clear:both;}
.hide {display:none;}
/*********************************************
NAVIGATION STYLES
*********************************************/
div#header {
background:#fff url(top_gradient.gif) repeat-x top left;
margin:0;
padding:0;
}
div#header form {
margin:0;
padding:0;
}
div#header div#headerInner {
margin:0;
padding:0;
}
div#header div#headerInner div#logoContainer {}
div#header div#headerInner div#logoContainerInner {
width:550px;
margin:0 auto;
padding:20px;
}
div#header div#headerInner div#logoContainer div#logo {
float:left;
width:200px;
}
div#header div#headerInner div#logoContainer div#logo a,
div#header div#headerInner div#logoContainer div#logo a:hover {
border:none;
background:none;
}
div#header div#headerInner div#logoContainer div#feed {
float:right;
width:300px;
text-align:right;
padding:10px 0 0 0;
}
div#header div#headerInner div#logoContainer div#feed input.text {
width:60%;
}
div#header div#headerInner div#menu {
background:#eee url(background_menuitem_shadow.gif) repeat-x top left;
border-top:2px solid #ccc;
border-bottom:1px solid #ddd;
text-align:center;
}
div#header div#headerInner div#menu table {
width:auto;
margin:0 auto;
}
div#header div#headerInner div#menu ul {
display:block;
width:100%;
margin:0 auto;
padding:0;
font-size:12px;
}
div#header div#headerInner div#menu ul li {
display:block;
float:left;
}
div#header div#headerInner div#menu ul li a {
display:block;
margin:-2px 0 0 0;
padding:5px 7px 8px 7px;
text-decoration:none;
color:#666 !important;
background-color:transparent;
}
div#header div#headerInner div#menu ul li a:hover {
display:block;
margin:-2px 0 0 0;
padding:5px 7px 8px 7px;
text-decoration:none;
color:#666;
background:#fff url(background_menuitem_off.gif) no-repeat bottom right;
}
body#bodydemo div#header div#headerInner div#menu ul li#demo a {
display:block;
margin:-2px 0 0 0;
padding:5px 7px 8px 7px;
text-decoration:none;
color:#333;
font-weight:bold;
background:#fff url(background_menuitem.gif) no-repeat bottom right;
}
/*********************************************
CONTENT STYLES
*********************************************/
div.chunk {
margin:20px 0 0 0;
padding:0 0 10px 0;
border-bottom:1px solid #ccc;
}
div.topchunk {
margin:0 !important;
}
.footnote,
.footnote a {
font-size:12px;
line-height:1.3em;
color:#aaa;
}
.footnote em {
background-color:transparent;
font-style:italic;
}
.footnote code {
background-color:transparent;
font:11px/14px monospace;
color:#aaa;
}
p.subscribe {
background-color:#f3f3f3;
font-size:12px;
text-align:center;
}
p.highlight {
background-color:#ffc;
font-size:12px;
text-align:center;
}
p.sample_feeds {
font-size:12px;
line-height:1.2em;
}
div.sp_errors {
background-color:#eee;
padding:5px;
text-align:center;
font-size:12px;
}
.noborder {
border:none !important;
}
img.favicon {
margin:0 4px -2px 0;
width:16px;
height:16px;
}
p.favicons a,
p.favicons a:hover {
border:none;
background-color:transparent;
}
p.favicons img {
border:none;
}
/*********************************************
DEMO STYLES
*********************************************/
div#sp_input {
background-color:#ffc;
border:2px solid #f90;
padding:5px;
text-align:center;
}
div#sp_input input.text {
border:1px solid #999;
background:#e9f5ff url(feed.png) no-repeat 4px 50%;
width:75%;
padding:2px 2px 2px 28px;
font:18px/22px "Lucida Grande", Verdana, sans-serif;
font-weight:bold;
letter-spacing:-1px;
}
form#sp_form {
margin:15px 0;
}
div.focus {
margin:0;
padding:10px 20px;
background-color:#efe;
}
p.sample_feeds {
text-align:justify;
}
/*********************************************
SIFR STYLES
*********************************************/
.sIFR-active h3.header {
visibility:hidden;
line-height:1em;
}

31
simplepie/demo/for_the_demo/sleight.js

@ -0,0 +1,31 @@
/**********************************************************
Sleight
(c) 2001, Aaron Boodman
http://www.youngpup.net
**********************************************************/
if (navigator.platform == "Win32" && navigator.appName == "Microsoft Internet Explorer" && window.attachEvent)
{
document.writeln('<style type="text/css">img { visibility:hidden; } </style>');
window.attachEvent("onload", fnLoadPngs);
}
function fnLoadPngs()
{
var rslt = navigator.appVersion.match(/MSIE (\d+\.\d+)/, '');
var itsAllGood = (rslt != null && Number(rslt[1]) >= 5.5);
for (var i = document.images.length - 1, img = null; (img = document.images[i]); i--)
{
if (itsAllGood && img.src.match(/\.png$/i) != null)
{
var src = img.src;
var div = document.createElement("DIV");
div.style.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" + src + "', sizing='scale')"
div.style.width = img.width + "px";
div.style.height = img.height + "px";
img.replaceNode(div);
}
img.style.visibility = "visible";
}
}

BIN
simplepie/demo/for_the_demo/source_files/place_audio_fireworksfile.png

After

Width: 130  |  Height: 16  |  Size: 38 KiB

BIN
simplepie/demo/for_the_demo/source_files/place_video_fireworksfile.png

After

Width: 480  |  Height: 376  |  Size: 113 KiB

71
simplepie/demo/for_the_demo/source_files/sIFR-r245/SifrStyleSheet.as

@ -0,0 +1,71 @@
/*=:project
scalable Inman Flash Replacement (sIFR) version 3.
=:file
Copyright: 2006 Mark Wubben.
Author: Mark Wubben, <http://novemberborn.net/>
=:history
* IFR: Shaun Inman
* sIFR 1: Mike Davidson, Shaun Inman and Tomas Jogin
* sIFR 2: Mike Davidson, Shaun Inman, Tomas Jogin and Mark Wubben
=:license
This software is licensed and provided under the CC-GNU LGPL.
See <http://creativecommons.org/licenses/LGPL/2.1/>
*/
import TextField.StyleSheet;
class SifrStyleSheet extends TextField.StyleSheet {
public var fontSize;
public var latestLeading = 0;
public function parseCSS(cssText:String) {
var native = new TextField.StyleSheet();
var parsed = native.parseCSS(cssText);
if(!parsed) return false;
var selectors = native.getStyleNames();
for(var i = selectors.length - 1; i >= 0; i--) {
var selector = selectors[i];
var nativeStyle = native.getStyle(selector);
var style = this.getStyle(selector) || nativeStyle;
if(style != nativeStyle) {
for(var property in nativeStyle) style[property] = nativeStyle[property];
}
this.setStyle(selector, style);
}
return true;
}
// Apply leading to the textFormat. Much thanks to <http://www.blog.lessrain.com/?p=98>.
private function applyLeading(format, leading) {
this.latestLeading = leading;
if(leading >= 0) {
format.leading = leading;
return format;
}
// Workaround for negative leading, which is ignored otherwise.
var newFormat = new TextFormat(null, null, null, null, null, null, null, null, null, null, null, null, leading);
for(var property in format) if(property != 'leading') newFormat[property] = format[property];
return newFormat;
}
public function transform(style) {
var format = super.transform(style);
if(style.leading) format = applyLeading(format, style.leading);
if(style.letterSpacing) format.letterSpacing = style.letterSpacing;
// Support font sizes relative to the size of .sIFR-root.
if(this.fontSize && style.fontSize && style.fontSize.indexOf('%')) {
format.size = this.fontSize * parseInt(style.fontSize) / 100;
}
format.kerning = _root.kerning == 'true' || !(_root.kerning == 'false') || sIFR.defaultKerning;
return format;
}
}

12
simplepie/demo/for_the_demo/source_files/sIFR-r245/_README_.txt

@ -0,0 +1,12 @@
This is a pre-release nightly of sIFR 3 (r245 to be exact). We (the SimplePie team) will be updating the
sIFR code and font files from time to time as new releases of sIFR 3 are made available.
In this folder you'll find a few Flash 8 files. The only one of you might want to mess with is sifr.fla.
* Open it up
* Double-click the rectangle in the middle
* Select all
* Change the font
More information about sIFR 3 can be found here:
* http://dev.novemberborn.net/sifr3/
* http://wiki.novemberborn.net/sifr3/

12
simplepie/demo/for_the_demo/source_files/sIFR-r245/options.as

@ -0,0 +1,12 @@
// MTASC only parses as-files with class definitions, so here goes...
class Options {
public static function apply() {
sIFR.fromLocal = true;
sIFR.domains = ['*'];
// Parsing `p.foo` might not work, see: <http://livedocs.macromedia.com/flash/mx2004/main_7_2/wwhelp/wwhimpl/common/html/wwhelp.htm?context=Flash_MX_2004&file=00001766.html>
// Appearantly you have to use hex color codes as well, names are not supported!
sIFR.styles.parseCSS('.foo { text-decoration: underline; }');
}
}

359
simplepie/demo/for_the_demo/source_files/sIFR-r245/sIFR.as

@ -0,0 +1,359 @@
/*=:project
scalable Inman Flash Replacement (sIFR) version 3.
=:file
Copyright: 2006 Mark Wubben.
Author: Mark Wubben, <http://novemberborn.net/>
=:history
* IFR: Shaun Inman
* sIFR 1: Mike Davidson, Shaun Inman and Tomas Jogin
* sIFR 2: Mike Davidson, Shaun Inman, Tomas Jogin and Mark Wubben
=:license
This software is licensed and provided under the CC-GNU LGPL.
See <http://creativecommons.org/licenses/LGPL/2.1/>
*/
import SifrStyleSheet;
class sIFR {
public static var DEFAULT_TEXT = 'Rendered with sIFR 3, revision 245';
public static var CSS_ROOT_CLASS = 'sIFR-root';
public static var DEFAULT_WIDTH = 300;
public static var DEFAULT_HEIGHT = 100;
public static var DEFAULT_ANTI_ALIAS_TYPE = 'advanced';
public static var MARGIN_LEFT = -3;
public static var PADDING_BOTTOM = 5; // Extra padding to make sure the movie is high enough in most cases.
public static var LEADING_REMAINDER = 2; // Flash uses the specified leading minus 2 as the applied leading.
public static var MAX_FONT_SIZE = 126;
public static var ALIASING_MAX_FONT_SIZE = 48;
//= Holds CSS properties and other rendering properties for the Flash movie.
// *Don't overwrite!*
public static var styles:SifrStyleSheet = new SifrStyleSheet();
//= Allow sIFR to be run from localhost
public static var fromLocal:Boolean = true;
//= Array containing domains for which sIFR may render text. Used to prevent
// hotlinking. Use `*` to allow all domains.
public static var domains:Array = [];
//= Whether kerning is enabled by default. This can be overriden from the client side.
// See also <http://livedocs.macromedia.com/flash/8/main/wwhelp/wwhimpl/common/html/wwhelp.htm?context=LiveDocs_Parts&file=00002811.html>.
public static var defaultKerning:Boolean = true;
//= Default value which can be overriden from the client side.
// See also <http://livedocs.macromedia.com/flash/8/main/wwhelp/wwhimpl/common/html/wwhelp.htm?context=LiveDocs_Parts&file=00002788.html>.
public static var defaultSharpness:Number = 0;
//= Default value which can be overriden from the client side.
// See also <http://livedocs.macromedia.com/flash/8/main/wwhelp/wwhimpl/common/html/wwhelp.htm?context=LiveDocs_Parts&file=00002787.html>.
public static var defaultThickness:Number = 0;
//= Default value which can be overriden from the client side.
// See also <http://livedocs.macromedia.com/flash/8/main/wwhelp/wwhimpl/common/html/wwhelp.htm?context=LiveDocs_Parts&file=00002732.html>.
public static var defaultOpacity:Number = -1; // Use client settings
//= Default value which can be overriden from the client side.
// See also <http://livedocs.macromedia.com/flash/8/main/wwhelp/wwhimpl/common/html/wwhelp.htm?context=LiveDocs_Parts&file=00002788.html>.
public static var defaultBlendMode:Number = -1; // Use cliest settings
//= Overrides the grid fit type as defined on the client side.
// See also <http://livedocs.macromedia.com/flash/8/main/wwhelp/wwhimpl/common/html/wwhelp.htm?context=LiveDocs_Parts&file=00002444.html>.
public static var enforcedGridFitType:String = null;
//= If `true` sIFR won't override the anti aliasing set in the Flash IDE when exporting.
// Thickness and sharpness won't be affected either.
public static var preserveAntiAlias:Boolean = false;
//= If `true` sIFR will disable anti-aliasing if the font size is larger than `ALIASING_MAX_FONT_SIZE`.
// This setting is *independent* from `preserveAntiAlias`.
public static var conditionalAntiAlias:Boolean = true;
//= Sets the anti alias type. By default it's `DEFAULT_ANTI_ALIAS_TYPE`.
// See also <http://livedocs.macromedia.com/flash/8/main/wwhelp/wwhimpl/common/html/wwhelp.htm?context=LiveDocs_Parts&file=00002733.html>.
public static var antiAliasType:String = null;
//= Flash filters can be added to this array and will be applied to the text field.
public static var filters:Array = [];
//= A mapping from the names of the filters to their actual objecs, used when transforming
// filters defined on the client. You can add additional filters here so they'll be supported
// when defined on the client.
public static var filterMap:Object = {
DisplacementMapFilter : flash.filters.DisplacementMapFilter,
ColorMatrixFilter : flash.filters.ColorMatrixFilter,
ConvolutionFilter : flash.filters.ConvolutionFilter,
GradientBevelFilter : flash.filters.GradientBevelFilter,
GradientGlowFilter : flash.filters.GradientGlowFilter,
BevelFilter : flash.filters.BevelFilter,
GlowFilter : flash.filters.GlowFilter,
BlurFilter : flash.filters.BlurFilter,
DropShadowFilter : flash.filters.DropShadowFilter
};
private static var instance;
private var textField;
private var content;
private var realHeight;
private var originalHeight;
private var currentHeight;
private var fontSize;
private var tuneWidth;
private var tuneHeight;
//= Sets the default styles for `sIFR.styles`. This method is called
// directly in `sifr.fla`, before options are applied.
public static function setDefaultStyles() {
sIFR.styles.parseCSS([
'.', CSS_ROOT_CLASS, ' { color: #000000; }',
'strong { display: inline; font-weight: bold; } ',
'em { display: inline; font-style: italic; }',
'a { color: #0000FF; text-decoration: underline; }',
'a:hover { color: #0000FF; text-decoration: none; }'
].join(''));
}
//= Validates the domain sIFR is being used on.
// Returns `true` if the domain is valid, `false` otherwise.
public static function checkDomain():Boolean {
if(sIFR.domains.length == 0) return true;
var domain = (new LocalConnection()).domain();
if(sIFR.fromLocal) sIFR.domains.push('localhost');
for(var i = 0; i < sIFR.domains.length; i++) {
var match = sIFR.domains[i];
if(match == '*' || match == domain) return true;
var wildcard = match.lastIndexOf('*');
if(wildcard > -1) {
match = match.substr(wildcard + 1);
var matchPosition = domain.lastIndexOf(match);
if(matchPosition > -1 && (matchPosition + match.length) == domain.length) return true;
}
}
return false;
}
//= Runs sIFR. Called automatically.
public static function run() {
var holder = _root.holder;
var content = checkDomain() ? unescape(_root.content) : DEFAULT_TEXT
if(content == 'undefined' || content == '') {
content = DEFAULT_TEXT;
fscommand('resetmovie', '');
} else fscommand('ping', '');
// Sets stage parameters
Stage.scaleMode = 'noscale';
Stage.align = 'TL';
Stage.showMenu = false;
// Other parameters
var opacity = parseInt(_root.opacity);
if(!isNaN(opacity)) holder._alpha = sIFR.defaultOpacity == -1 ? opacity : sIFR.defaultOpacity;
else holder._alpha = 100;
_root.blendMode = sIFR.defaultBlendMode == -1 ? _root.blendmode : sIFR.defaultBlendMode;
sIFR.instance = new sIFR(holder.txtF, content);
// This should ignore resizes from the callback. Disabled for now.
/* if(_root.zoomsupport == 'true') Stage.addListener({onResize: function() { sIFR.instance.scale() }});*/
// Setup callbacks
_root.watch('callbackTrigger', function() {
sIFR.callback();
return false;
});
}
private static function eval(str) {
var as;
if(str.charAt(0) == '{') { // Ah, we need to create an object
as = {};
str = str.substring(1, str.length - 1);
var $ = str.split(',');
for(var i = 0; i < $.length; i++) {
var $1 = $[i].split(':');
as[$1[0]] = sIFR.eval($1[1]);
}
} else if(str.charAt(0) == '"') { // String
as = str.substring(1, str.length - 1);
} else if(str == 'true' || str == 'false') { // Boolean
as = str == 'true';
} else { // Float
as = parseFloat(str);
}
return as;
}
private function applyFilters() {
var $filters = this.textField.filters;
$filters = $filters.concat(sIFR.filters);
var $ = _root.flashfilters.split(';'); // name,prop:value,...;
for(var i = 0; i < $.length; i++) {
var $1 = $[i].split(',');
var newFilter = new sIFR.filterMap[$1[0]]();
for(var j = 1; j < $1.length; j++) {
var $2 = $1[j].split(':');
newFilter[$2[0]] = sIFR.eval(unescape($2[1]));
}
$filters.push(newFilter);
}
this.textField.filters = $filters;
}
private function sIFR(textField, content) {
this.textField = textField;
this.content = content;
var offsetLeft = parseInt(_root.offsetleft);
textField._x = MARGIN_LEFT + (isNaN(offsetLeft) ? 0 : offsetLeft);
var offsetTop = parseInt(_root.offsettop);
if(!isNaN(offsetTop)) textField._y += offsetTop;
tuneWidth = parseInt(_root.tunewidth);
if(isNaN(tuneWidth)) tuneWidth = 0;
tuneHeight = parseInt(_root.tuneheight);
if(isNaN(tuneHeight)) tuneHeight = 0;
textField._width = tuneWidth + (isNaN(parseInt(_root.width)) ? DEFAULT_WIDTH : parseInt(_root.width));
textField._height = tuneHeight + (isNaN(parseInt(_root.height)) ? DEFAULT_HEIGHT : parseInt(_root.height));
textField.wordWrap = true;
textField.selectable = _root.selectable == 'true';
textField.gridFitType = sIFR.enforcedGridFitType || _root.gridfittype;
this.applyFilters();
// Determine font-size and the number of lines
this.fontSize = parseInt(_root.size);
if(isNaN(this.fontSize)) this.fontSize = 26;
styles.fontSize = this.fontSize;
if(!sIFR.preserveAntiAlias && (sIFR.conditionalAntiAlias && this.fontSize < ALIASING_MAX_FONT_SIZE
|| !sIFR.conditionalAntiAlias)) {
textField.antiAliasType = sIFR.antiAliasType || DEFAULT_ANTI_ALIAS_TYPE;
}
if(!sIFR.preserveAntiAlias || !isNaN(parseInt(_root.sharpness))) {
textField.sharpness = parseInt(_root.sharpness);
}
if(isNaN(textField.sharpness)) textField.sharpness = sIFR.defaultSharpness;
if(!sIFR.preserveAntiAlias || !isNaN(parseInt(_root.thickness))) {
textField.thickness = parseInt(_root.thickness);
}
if(isNaN(textField.thickness)) textField.thickness = sIFR.defaultThickness;
// Set font-size and other styles
sIFR.styles.parseCSS(unescape(_root.css));
var rootStyle = styles.getStyle('.sIFR-root') || {};
rootStyle.fontSize = this.fontSize; // won't go higher than 126!
styles.setStyle('.sIFR-root', rootStyle);
textField.styleSheet = styles;
this.write(content);
this.repaint();
}
private function repaint() {
var leadingFix = this.isSingleLine() ? sIFR.styles.latestLeading : 0;
if(leadingFix > 0) leadingFix -= LEADING_REMAINDER;
// Flash wants to scroll the movie by one line, by adding the fontSize to the
// textField height this is no longer happens. We also add the absolute tuneHeight,
// to prevent a negative value from triggering the bug. We won't send the fake
// value to the JavaScript side, though.
textField._height = textField.textHeight + PADDING_BOTTOM + this.fontSize + Math.abs(tuneHeight) + tuneHeight - leadingFix;
this.realHeight = textField._height - this.fontSize - Math.abs(tuneHeight);
var arg = 'height:' + this.realHeight;
if(_root.fitexactly == 'true') arg += ',width:' + (textField.textWidth + tuneWidth);
fscommand('resize', arg);
this.originalHeight = textField._height;
this.currentHeight = Stage.height;
textField._xscale = textField._yscale = parseInt(_root.zoom);
}
private function write(content) {
this.textField.htmlText = ['<p class="', CSS_ROOT_CLASS, '">',
content, '</p>'
].join('');
}
private function isSingleLine() {
return Math.round((this.textField.textHeight - sIFR.styles.latestLeading) / this.fontSize) == 1;
}
//= Scales the text field to the new scale of the Flash movie itself.
public function scale() {
this.currentHeight = Stage.height;
var scale = 100 * Math.round(this.currentHeight / this.originalHeight);
textField._xscale = textField._yscale = scale;
}
private function calculateRatios() {
var strings = ['X', 'X<br>X', 'X<br>X<br>X', 'X<br>X<br>X<br>X'];
var results = {};
for(var i = 1; i <= strings.length; i++) {
var size = 6;
this.write(strings[i - 1]);
while(size < MAX_FONT_SIZE) {
var rootStyle = sIFR.styles.getStyle('.sIFR-root') || {};
rootStyle.fontSize = size;
sIFR.styles.setStyle('.sIFR-root', rootStyle);
this.textField.styleSheet = sIFR.styles;
this.repaint();
var ratio = (this.realHeight - PADDING_BOTTOM) / i / size;
if(!results[size]) results[size] = ratio;
else results[size] = ((i - 1) * results[size] + ratio) / i;
size++;
}
}
var sizes = [], ratios = [];
var ratiosToSizes = {}, sizesToRatios = {};
for(var size in results) {
if(results[size] == Object.prototype[size]) continue;
var ratio = results[size];
ratiosToSizes[ratio] = Math.max(ratio, parseInt(size));
}
for(var ratio in ratiosToSizes) {
if(ratiosToSizes[ratio] == Object.prototype[ratio]) continue;
sizesToRatios[ratiosToSizes[ratio]] = roundDecimals(ratio, 2);
sizes.push(ratiosToSizes[ratio]);
}
sizes.sort(function(a, b) { return a - b; });
for(var j = 0; j < sizes.length - 1; j++) ratios.push(sizes[j], sizesToRatios[sizes[j]]);
ratios.push(sizesToRatios[sizes[sizes.length - 1]]);
fscommand('debug:ratios', '[' + ratios.join(',') + ']');
}
private function roundDecimals(value, decimals) {
return Math.round(value * Math.pow(10, decimals)) / Math.pow(10, decimals);
}
public static function callback() {
switch(_root.callbackType) {
case 'replacetext':
sIFR.instance.content = _root.callbackValue;
sIFR.instance.write(_root.callbackValue);
sIFR.instance.repaint();
break;
case 'resettext':
sIFR.instance.write('');
sIFR.instance.write(sIFR.instance.content);
break;
case 'ratios':
sIFR.instance.calculateRatios();
break;
}
}
}

BIN
simplepie/demo/for_the_demo/source_files/sIFR-r245/sifr.fla

BIN
simplepie/demo/for_the_demo/top_gradient.gif

After

Width: 50  |  Height: 85  |  Size: 1.3 KiB

BIN
simplepie/demo/for_the_demo/verdana.swf

BIN
simplepie/demo/for_the_demo/yanone-kaffeesatz-bold.swf

6
simplepie/demo/handler_image.php

@ -0,0 +1,6 @@
<?php
// This should be modifed as your own use warrants.
require_once('../simplepie.inc');
SimplePie_Misc::display_cached_file($_GET['i'], './cache', 'spi');
?>

295
simplepie/demo/index.php

@ -0,0 +1,295 @@
<?php
// Start counting time for the page load
$starttime = explode(' ', microtime());
$starttime = $starttime[1] + $starttime[0];
// Include SimplePie
// Located in the parent directory
include_once('../simplepie.inc');
include_once('../idn/idna_convert.class.php');
// Create a new instance of the SimplePie object
$feed = new SimplePie();
//$feed->force_fsockopen(true);
// Make sure that page is getting passed a URL
if (isset($_GET['feed']) && $_GET['feed'] !== '')
{
// Strip slashes if magic quotes is enabled (which automatically escapes certain characters)
if (function_exists('get_magic_quotes_gpc') && get_magic_quotes_gpc())
{
$_GET['feed'] = stripslashes($_GET['feed']);
}</