mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-08 10:34:34 +00:00
Merge remote-tracking branch 'upstream/master' into 20150306-elastic-indexer
Conflicts: bin/console bower.json composer.json composer.lock lib/Alchemy/Phrasea/Application.php lib/Alchemy/Phrasea/Border/Manager.php lib/Alchemy/Phrasea/Controller/Api/V1.php lib/Alchemy/Phrasea/Core/PhraseaEvents.php lib/Alchemy/Phrasea/SearchEngine/SearchEngineOptions.php lib/classes/caption/field.php lib/classes/record/Interface.php templates/web/prod/index.html.twig www/skins/prod/000000/prodcolor.css
This commit is contained in:
4
.gitignore
vendored
4
.gitignore
vendored
@@ -6,6 +6,9 @@
|
||||
/www/assets
|
||||
/tmp-assets
|
||||
|
||||
# Exclude thumbnails folder
|
||||
/www/thumbnails
|
||||
|
||||
# Exclude node.js dependencies folder
|
||||
/node_modules
|
||||
|
||||
@@ -56,6 +59,7 @@ behat.yml
|
||||
|
||||
# Exclude vagrant configuration file
|
||||
/.vagrant
|
||||
/vagrant
|
||||
|
||||
# Exclude crossdomain.xml file it's generated
|
||||
/www/crossdomain.xml
|
||||
|
30
.travis.yml
30
.travis.yml
@@ -8,26 +8,20 @@ services:
|
||||
- mysql
|
||||
- memcached
|
||||
- redis
|
||||
- elasticsearch
|
||||
|
||||
before_script:
|
||||
- export JS_COMPILER=$TRAVIS_BUILD_DIR/closure/compiler.jar
|
||||
- sudo apt-get update -qq && sudo apt-get install -qq scons inkscape python-setuptools
|
||||
- sudo easy_install -U taschenmesser scour boto
|
||||
- wget http://dl.google.com/closure-compiler/compiler-latest.zip && unzip compiler-latest.zip -d closure
|
||||
- node --version
|
||||
- npm --version
|
||||
- travis_retry npm install
|
||||
- echo '' > ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/xdebug.ini
|
||||
- phpenv config-rm xdebug.ini
|
||||
- sh -c 'if [ $(php -r "echo PHP_MINOR_VERSION;") -le 4 ]; then echo "extension = apc.so" >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini; fi;'
|
||||
- echo 'session.cache_limiter = ""' >> ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/travis.ini
|
||||
- echo 'extension="redis.so"' > ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/redis.ini
|
||||
- echo 'extension="memcache.so"' > ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/memcache.ini
|
||||
- echo 'extension="memcached.so"' > ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/memcached.ini
|
||||
- echo "extension=zmq.so" > ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/zmq.ini
|
||||
- yes | pecl install imagick
|
||||
- mysql -e 'create database update39_test;create database ab_test;create database db_test; create database ab_unitTests; create database db_unitTests;'
|
||||
- sudo mysql -e "GRANT ALL PRIVILEGES ON ab_unitTests.* TO 'phraseaUnitTests'@'localhost' IDENTIFIED BY 'iWvGxPE8' WITH GRANT OPTION"
|
||||
- sudo mysql -e "GRANT ALL PRIVILEGES ON db_unitTests.* TO 'phraseaUnitTests'@'localhost' IDENTIFIED BY 'iWvGxPE8' WITH GRANT OPTION"
|
||||
- mysql -e 'create database update39_test;create database ab_test;create database db_test;'
|
||||
- mysql -e 'SET @@global.sql_mode= "";'
|
||||
- mysql -e 'SET @@global.max_allowed_packet= 33554432;'
|
||||
- mysql -e 'SET @@global.wait_timeout= 999999;'
|
||||
@@ -48,21 +42,17 @@ matrix:
|
||||
- php: 5.6
|
||||
|
||||
script:
|
||||
- travis_retry composer install --dev --prefer-source -vvv
|
||||
- travis_retry grunt install-assets -vvv
|
||||
- travis_retry composer install --optimize-autoloader --dev --prefer-source
|
||||
- travis_retry grunt install-assets
|
||||
- bin/developer assets:compile-less
|
||||
- bin/developer system:uninstall
|
||||
- bin/setup system:install --email=test@phraseanet.com --password=test --db-user=root --db-template=fr --db-password= --databox=db_test --appbox=ab_test --server-name=http://127.0.0.1 -y;
|
||||
- sh -c " if [ '$SETUP_MODE' = 'update' ]; then
|
||||
bin/setup system:install --email=test@phraseanet.com --password=test --db-user=root --db-template=fr --db-password= --databox=db_test --appbox=ab_test --server-name=http://127.0.0.1 -y -v;
|
||||
bin/developer ini:reset --email=test@phraseanet.com --password=test --run-patches -v;
|
||||
bin/developer ini:reset --email=test@phraseanet.com --password=test --run-patches --no-setup-dbs;
|
||||
php resources/hudson/cleanupSubdefs.php;
|
||||
fi"
|
||||
- sh -c " if [ '$SETUP_MODE' = 'install' ]; then
|
||||
bin/setup system:install --email=test@phraseanet.com --password=test --db-user=root --db-template=fr --db-password= --databox=db_test --appbox=ab_test --server-name=http://127.0.0.1 -y -v;
|
||||
bin/developer ini:setup-tests-dbs -v;
|
||||
fi"
|
||||
- php resources/hudson/cleanupSubdefs.php
|
||||
#sqlite db generation should occur once Phraseanet is up to date :
|
||||
- bin/developer ini:setup-tests-dbs
|
||||
- bin/developer phraseanet:regenerate-sqlite
|
||||
- bin/developer phraseanet:generate-js-fixtures
|
||||
- ./node_modules/.bin/grunt test
|
||||
#ls -d tests/Alchemy/Tests/Phrasea/*/ | parallel --gnu 'bin/phpunit {};'
|
||||
- bin/phpunit
|
||||
|
56
CHANGELOG.md
56
CHANGELOG.md
@@ -1,5 +1,6 @@
|
||||
# CHANGELOG
|
||||
|
||||
|
||||
* 3.9.0 (xxxx-xx-xx)
|
||||
|
||||
- Convert Orders custom adapter to Doctrine entity.
|
||||
@@ -9,6 +10,61 @@
|
||||
- Convert Ftp Export custom adapter to Doctrine entity.
|
||||
- Session management is now part of Phraseanet configuration.
|
||||
|
||||
## 3.8.6 (2015-01-20)
|
||||
|
||||
- BugFix : Fixes the stories editing. When opening an editing form, the style applied to the notice doesn't match its selection
|
||||
- BugFix : Fixes the sending of a return receipt (attributed in the headers of the email) at the export
|
||||
- BugFix : Fixes the SMTP field in the Administration panel which is pre filled with a wrong information
|
||||
- BugFix : Fixes a bad mapping of the registration fields on the homepage and the displayed fields in the registration requests in the Administration
|
||||
- BugFix : In the detailed view, fixes the list of the stories titles which is truncated.
|
||||
- BugFix : Fixes Oauth 2.0, the authorization of the client applications is not systematically requested when logging in.
|
||||
- BugFix : When uploading documents, the first status is not taken into account
|
||||
- BugFix : Fixes the cache invalidation of the status bits icons when changed in Admin section
|
||||
- BugFix : Fixes the reordering of the media in a basket
|
||||
- BugFix : Fixes the control of field "name" when creating a push or a feedback
|
||||
- BugFix : Fixes Oauth 2.0 message when the connection fails
|
||||
- BugFix : Fixes the suppression of diffusion lists on IE9
|
||||
- BugFix : Fixes the anonymous download when a user is logged off
|
||||
- BugFix : Fixes the setup of the default display mode of the collections (stamp/watermark) on a non authenticated mode
|
||||
- BugFix : Fixes the printing of the thumbnails of documents for the videos or PDFs
|
||||
- BugFix : Fixes the reordering of the basket when the documents come from n different collections
|
||||
- BugFix : Fixes the application of the "status bits" when the status bit is defined by the task "RecordMover"
|
||||
- BugFix : Fixes the detection of duplicates for PDF files
|
||||
- BugFix : Fixes the rewriting of metadata of a document, when the name space is empty
|
||||
- BugFix : Fixes the injection of the rights of a user for a connection via Oauth2
|
||||
- BugFix : Fixes the invalidation of the cache when disassembling a databox
|
||||
- BugFix : Fixes the sorting criteria by date and by field, according to users rights
|
||||
- BugFix : Fixes the right to download for the guest access
|
||||
- BugFix : Fixes the report generation for the number of downloads and connections
|
||||
- BugFix : Fixes the memory use of the task for the the sub-definitions creation
|
||||
- BugFix : Fixes the generation of sub-definitions when editing the sub-definitions task
|
||||
- BugFix : Fixes the display of multivalued fields in the editing window
|
||||
- BugFix : Fixes the adding of a term in the candidates which was is not detected as present in the candidates
|
||||
- BugFix : Fixes the users' rights when using the API
|
||||
- BugFix : When being redirected, fixes the add of parameters after login.
|
||||
- BugFix : Fixes the thumbnails' size of EPS files.
|
||||
- BugFix : The "Delete" action of a task ("Record Mover" type) is now taken into consideration.
|
||||
- BugFix : The edition dates of a record sent back by the API are now fixed
|
||||
- BuxFix : Writing of IPTC fields is fixed, when setting up a stamp on a media (image type).
|
||||
- Enhancement : Possibility to adapt a task "creation of subdefinition", by database and type of document
|
||||
- Enhancement : Reporting modifications of Flickr & Dailymotion APIs (Bridge feature).
|
||||
- Enhancement : Adding the possibility to overload the name space reserved for the cache
|
||||
- Enhancement : Adding the possibility to deactivate the use of the TaskManager by instance
|
||||
- Enhancement : Adding an extended format for the API replies. Get more information about Phraseanet records in one API request.
|
||||
- Enhancement : Adding a block for the help text of Production when no result is displayed to authorize the modification of this text via a plugin
|
||||
- Enhancement : Adding the possibility to deactivate the notifications to the users for a new publication
|
||||
- Enhancement : Adding the possibility to modify the rotation of pictures representing the videos and PDF files
|
||||
- Enhancement : Adding the possibility to serve the thumbnails of the application in a static way for improved performances
|
||||
- Enhancement : Adding the possibility to deactivate the lazy load for the thumbnails
|
||||
- Enhancement : The tasks can now reconnect automatically to MySQL
|
||||
- Enhancement : The sorting on the fields "Number" is now possible
|
||||
- Enhancement : The sub-definition creation task now displays the remaining number of sub-definitions to create
|
||||
- Enhancement : Adding the date of edition of the media
|
||||
- Enhancement : Use of http cache for the display of documents
|
||||
- Enhancement : Adding the possibility to deactivate the CSRF for the authentication form
|
||||
- NewFeature : Adding a Vagrant VM (for developers and testers). The setup is quicker: development environments made easy.
|
||||
- NewFeature : Adding a command for the file generation crossdomain.xml depending on the configuration.
|
||||
|
||||
## 3.8.5 (2014-07-08)
|
||||
|
||||
- BugFix : Fix Flickr connexion throught Bridge Application
|
||||
|
58
Gruntfile.js
58
Gruntfile.js
@@ -42,23 +42,22 @@ module.exports = function(grunt) {
|
||||
dist: {
|
||||
options: {
|
||||
components: {
|
||||
"jquery.ui": ["npm", {"../../node_modules/.bin/grunt": "build"}],
|
||||
"jquery-mobile": ["npm", {"../../node_modules/.bin/grunt": "dist"}],
|
||||
"bootstrap": ["npm", {"make": "bootstrap"}],
|
||||
"autobahnjs": [{"make":"build"}]
|
||||
"bootstrap": ["npm", {"make": "bootstrap"}]
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
copy: {
|
||||
"autobahnjs": {
|
||||
"autobahn": {
|
||||
"expand": true,
|
||||
"src": [
|
||||
"<%= path.bower %>/autobahnjs/build/autobahn.js",
|
||||
"<%= path.bower %>/autobahnjs/LICENSE"
|
||||
"<%= path.bower %>/autobahn/index.js",
|
||||
],
|
||||
"dest": "<%= path.asset %>/autobahnjs/",
|
||||
"flatten": true
|
||||
"dest": "<%= path.asset %>/autobahn/",
|
||||
"flatten": true,
|
||||
"rename": function(dest, src) {
|
||||
return dest + "autobahn.js"
|
||||
}
|
||||
},
|
||||
"backbone": {
|
||||
"expand": true,
|
||||
@@ -102,7 +101,7 @@ module.exports = function(grunt) {
|
||||
},
|
||||
"bootstrap-multiselect": {
|
||||
"expand": true,
|
||||
"cwd": "<%= path.bower %>/bootstrap-multiselect",
|
||||
"cwd": "<%= path.bower %>/bootstrap-multiselect/dist",
|
||||
"src": [
|
||||
"css/bootstrap-multiselect.css",
|
||||
"js/bootstrap-multiselect.js"
|
||||
@@ -115,12 +114,6 @@ module.exports = function(grunt) {
|
||||
"dest": "<%= path.asset %>/chai/",
|
||||
"flatten": true
|
||||
},
|
||||
"deps-when": {
|
||||
"expand": true,
|
||||
"cwd": "<%= path.bower %>/autobahnjs",
|
||||
"src": "../when/when.js",
|
||||
"dest": "<%= path.bower %>/autobahnjs/when"
|
||||
},
|
||||
"font-awesome": {
|
||||
"expand": true,
|
||||
"cwd": "<%= path.bower %>/font-awesome",
|
||||
@@ -190,12 +183,13 @@ module.exports = function(grunt) {
|
||||
},
|
||||
"jquery-mobile": {
|
||||
"expand": true,
|
||||
"cwd": "<%= path.bower %>/jquery-mobile/dist",
|
||||
"cwd": "<%= path.bower %>/jquery-mobile-bower/",
|
||||
"src": [
|
||||
"images/*",
|
||||
"jquery.mobile.css",
|
||||
"jquery.mobile.js"
|
||||
"css/jquery.mobile-1.3.2.css",
|
||||
"js/jquery.mobile-1.3.2.js"
|
||||
],
|
||||
"flatten": true,
|
||||
"dest": "<%= path.asset %>/jquery-mobile/"
|
||||
},
|
||||
"jquery.cookie": {
|
||||
@@ -208,18 +202,17 @@ module.exports = function(grunt) {
|
||||
},
|
||||
"jquery-ui": {
|
||||
"expand": true,
|
||||
"cwd": "<%= path.bower %>/jquery.ui",
|
||||
"cwd": "<%= path.bower %>/jquery-ui",
|
||||
"src": [
|
||||
"dist/i18n/*",
|
||||
"dist/images/*",
|
||||
"ui/i18n/*",
|
||||
"ui/*",
|
||||
"themes/base/*",
|
||||
"themes/base/images/*",
|
||||
"dist/jquery-ui.css",
|
||||
"dist/jquery-ui.js",
|
||||
"MIT-LICENSE.txt"
|
||||
],
|
||||
"rename": function(dest, src) {
|
||||
return dest + src.replace("dist", "");
|
||||
var dest = dest + src.replace("ui/", "/");
|
||||
return dest.replace("themes/base/", "/")
|
||||
},
|
||||
"dest": "<%= path.asset %>/jquery.ui/"
|
||||
},
|
||||
@@ -319,12 +312,13 @@ module.exports = function(grunt) {
|
||||
},
|
||||
"tinymce": {
|
||||
"expand": true,
|
||||
"cwd": "<%= path.bower %>/tinymce/js/tinymce",
|
||||
"cwd": "<%= path.bower %>/tinymce/",
|
||||
"src": [
|
||||
"plugins/**",
|
||||
"skins/**",
|
||||
"themes/**",
|
||||
"tinymce.js",
|
||||
"*.js",
|
||||
"changelog.txt",
|
||||
"license.txt"
|
||||
],
|
||||
"dest": "<%= path.asset %>/tinymce"
|
||||
@@ -413,15 +407,8 @@ module.exports = function(grunt) {
|
||||
grunt.loadNpmTasks("grunt-bower-postinst");
|
||||
grunt.loadNpmTasks('grunt-mocha-phantomjs');
|
||||
|
||||
// This task is here to copy bower module into an other bower module
|
||||
// Because bower removes .git folder you can not use git submodule update
|
||||
// So fetch them with bower and copy them to appropriate path
|
||||
grunt.registerTask("copy-deps", [
|
||||
"copy:deps-when"
|
||||
]);
|
||||
|
||||
grunt.registerTask("copy-assets", [
|
||||
"copy:autobahnjs",
|
||||
"copy:autobahn",
|
||||
"copy:backbone",
|
||||
"copy:blueimp",
|
||||
"copy:bootstrap",
|
||||
@@ -458,7 +445,6 @@ module.exports = function(grunt) {
|
||||
grunt.registerTask("install-assets", [
|
||||
"clean:assets",
|
||||
"bower",
|
||||
"copy-deps",
|
||||
"bower_postinst",
|
||||
"copy-assets",
|
||||
"clean:bower"
|
||||
|
@@ -3,7 +3,7 @@
|
||||
/*
|
||||
* This file is part of Phraseanet
|
||||
*
|
||||
* (c) 2005-2014 Alchemy
|
||||
* (c) 2005-2015 Alchemy
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
@@ -11,6 +11,7 @@
|
||||
|
||||
namespace KonsoleKommander;
|
||||
|
||||
use Alchemy\Phrasea\Command\BuildSubdefs;
|
||||
use Alchemy\Phrasea\Command\Plugin\ListPlugin;
|
||||
use Alchemy\Phrasea\Command\Setup\H264ConfigurationDumper;
|
||||
use Alchemy\Phrasea\Command\Setup\H264MappingGenerator;
|
||||
@@ -113,6 +114,7 @@ $cli->command(new CreateCollection('collection:create'));
|
||||
$cli->command(new RecordAdd('records:add'));
|
||||
$cli->command(new RescanTechnicalDatas('records:rescan-technical-datas'));
|
||||
$cli->command(new BuildMissingSubdefs('records:build-missing-subdefs'));
|
||||
$cli->command(new BuildSubdefs('records:build-subdefs'));
|
||||
|
||||
$cli->command(new AddPlugin());
|
||||
$cli->command(new ListPlugin());
|
||||
|
@@ -3,7 +3,7 @@
|
||||
/*
|
||||
* This file is part of Phraseanet
|
||||
*
|
||||
* (c) 2005-2014 Alchemy
|
||||
* (c) 2005-2015 Alchemy
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
@@ -69,8 +69,8 @@ $cli = new CLI("
|
||||
|
||||
if ($cli['configuration.store']->isSetup()) {
|
||||
$helpers = [
|
||||
'db' => new ConnectionHelper($cli['EM']->getConnection()),
|
||||
'em' => new EntityManagerHelper($cli['EM'])
|
||||
'db' => new ConnectionHelper($cli['orm.em']->getConnection()),
|
||||
'em' => new EntityManagerHelper($cli['orm.em'])
|
||||
];
|
||||
|
||||
$helperSet = $cli['console']->getHelperSet();
|
||||
|
@@ -3,7 +3,7 @@
|
||||
/*
|
||||
* This file is part of Phraseanet
|
||||
*
|
||||
* (c) 2005-2014 Alchemy
|
||||
* (c) 2005-2015 Alchemy
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
|
@@ -4,8 +4,8 @@
|
||||
"dependencies": {
|
||||
"bootstrap": "2.3.2",
|
||||
"jquery": "~1.8.3",
|
||||
"jquery.ui": "~1.10.0",
|
||||
"jquery-mobile": "~1.3.0",
|
||||
"jquery-ui": "~1.10.0",
|
||||
"jquery-mobile-bower": "~1.3.0",
|
||||
"underscore": "~1.4.4",
|
||||
"font-awesome": "~3.0.2",
|
||||
"modernizr": "~2.6.2",
|
||||
@@ -25,11 +25,12 @@
|
||||
"tinymce": "~4.0",
|
||||
"jquery-galleria": "1.2.9",
|
||||
"jquery.cookie": "~1.4",
|
||||
"autobahnjs": "~0.8.0",
|
||||
"autobahn": "http://autobahn.s3.amazonaws.com/js/autobahn.min.js",
|
||||
"when": "~2.7.0",
|
||||
"web-socket-js": "~1.0.1",
|
||||
"jquery.treeview": "1.4.1",
|
||||
"fancytree": "~2.7"
|
||||
"fancytree": "~2.7",
|
||||
"joyride": "https://github.com/zurb/joyride/archive/v2.0.0.zip"
|
||||
},
|
||||
"devDependencies": {
|
||||
"mocha": "latest",
|
||||
|
@@ -26,28 +26,29 @@
|
||||
"require": {
|
||||
"php" : ">=5.4",
|
||||
"alchemy/oauth2php" : "1.0.0",
|
||||
"alchemy/phlickr" : "0.2.8",
|
||||
"alchemy/phlickr" : "0.2.9",
|
||||
"alchemy/task-manager" : "2.0.x-dev@dev",
|
||||
"alchemy/zippy" : "0.2.x-dev@dev",
|
||||
"cboden/ratchet" : "~0.3",
|
||||
"dailymotion/sdk" : "~1.5",
|
||||
"data-uri/data-uri" : "~0.1.0",
|
||||
"doctrine/orm" : "~2.4.0",
|
||||
"doctrine/dbal" : "~2.4.0",
|
||||
"elasticsearch/elasticsearch" : "~1.0",
|
||||
"facebook/php-sdk" : "~3.0",
|
||||
"gedmo/doctrine-extensions" : "~2.3.0",
|
||||
"alchemy/google-plus-api-client" : "~0.6.2",
|
||||
"alchemy/geonames-api-consumer" : "~0.1.0",
|
||||
"goodby/csv" : "~1.0",
|
||||
"goodby/csv" : "dev-master",
|
||||
"guzzle/guzzle" : "~3.0",
|
||||
"imagine/imagine" : "dev-0.6.1-flatten-layer as 0.6.1",
|
||||
"imagine/imagine" : "dev-alchemy-0.6.2 as 0.6.2",
|
||||
"igorw/get-in" : "~1.0",
|
||||
"ircmaxell/random-lib" : "~1.0",
|
||||
"jms/serializer" : "~0.10",
|
||||
"jms/serializer" : "~0.10",
|
||||
"jms/translation-bundle" : "~1.1",
|
||||
"justinrainbow/json-schema" : "~1.3",
|
||||
"mediavorus/mediavorus" : "~0.4.0",
|
||||
"media-alchemyst/media-alchemyst" : "~0.4.0",
|
||||
"media-alchemyst/media-alchemyst" : "~0.4",
|
||||
"monolog/monolog" : "~1.3",
|
||||
"mrclay/minify" : "~2.1.6",
|
||||
"neutron/process-manager" : "2.0.x-dev@dev",
|
||||
@@ -64,7 +65,7 @@
|
||||
"silex/silex" : "1.1.x-dev@dev",
|
||||
"silex/web-profiler" : "~1.0.0@dev",
|
||||
"sorien/silex-dbal-profiler" : "~1.0.0",
|
||||
"swiftmailer/swiftmailer" : "~4.3.0",
|
||||
"swiftmailer/swiftmailer" : "~5.3.0",
|
||||
"symfony/symfony" : "~2.4",
|
||||
"alchemy-fr/tcpdf-clone" : "~6.0",
|
||||
"themattharris/tmhoauth" : "~0.7",
|
||||
@@ -73,8 +74,10 @@
|
||||
"vierbergenlars/php-semver" : "~2.1",
|
||||
"zend/gdata" : "~1.12.1",
|
||||
"doctrine/migrations" : "1.0.x-dev@dev",
|
||||
"willdurand/negotiation" : "~1.3",
|
||||
"hoa/compiler": "2.14.09.23"
|
||||
"willdurand/negotiation" : "~1.3",
|
||||
"hoa/compiler": "2.14.09.23",
|
||||
"dflydev/doctrine-orm-service-provider" : "~1.0",
|
||||
"roave/security-advisories": "dev-master"
|
||||
},
|
||||
"require-dev": {
|
||||
"phpunit/phpunit" : "~3.7",
|
||||
|
419
composer.lock
generated
419
composer.lock
generated
@@ -4,16 +4,22 @@
|
||||
"Read more about it at http://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file",
|
||||
"This file is @generated automatically"
|
||||
],
|
||||
"hash": "73cfb65537610dfd0edc9cf6485c4ebb",
|
||||
"hash": "f5e0457425e2c151f1a6b27e0bad160d",
|
||||
"packages": [
|
||||
{
|
||||
"name": "alchemy-fr/tcpdf-clone",
|
||||
"version": "6.0.039",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/alchemy-fr/tcpdf-clone",
|
||||
"url": "https://github.com/alchemy-fr/tcpdf-clone.git",
|
||||
"reference": "2ba0248a7187f1626df6c128750650416267f0e7"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/alchemy-fr/tcpdf-clone/zipball/2ba0248a7187f1626df6c128750650416267f0e7",
|
||||
"reference": "2ba0248a7187f1626df6c128750650416267f0e7",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"php": ">=5.3.0"
|
||||
},
|
||||
@@ -60,6 +66,10 @@
|
||||
"qrcode",
|
||||
"tcpdf"
|
||||
],
|
||||
"support": {
|
||||
"source": "https://github.com/alchemy-fr/tcpdf-clone/tree/6.0.039",
|
||||
"issues": "https://github.com/alchemy-fr/tcpdf-clone/issues"
|
||||
},
|
||||
"time": "2013-10-13 16:11:17"
|
||||
},
|
||||
{
|
||||
@@ -103,7 +113,7 @@
|
||||
"homepage": "http://www.lickmychip.com/"
|
||||
},
|
||||
{
|
||||
"name": "Nicolas Le Goff",
|
||||
"name": "nlegoff",
|
||||
"email": "legoff.n@gmail.com"
|
||||
},
|
||||
{
|
||||
@@ -272,16 +282,16 @@
|
||||
},
|
||||
{
|
||||
"name": "alchemy/phlickr",
|
||||
"version": "0.2.8",
|
||||
"version": "0.2.9",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/alchemy-fr/Phlickr.git",
|
||||
"reference": "26b7764fd45c15062cb1b21c9389aff919e8c2bd"
|
||||
"reference": "f9af93e27e9235db43e61ce2f9588d8ce9859b68"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/alchemy-fr/Phlickr/zipball/26b7764fd45c15062cb1b21c9389aff919e8c2bd",
|
||||
"reference": "26b7764fd45c15062cb1b21c9389aff919e8c2bd",
|
||||
"url": "https://api.github.com/repos/alchemy-fr/Phlickr/zipball/f9af93e27e9235db43e61ce2f9588d8ce9859b68",
|
||||
"reference": "f9af93e27e9235db43e61ce2f9588d8ce9859b68",
|
||||
"shasum": ""
|
||||
},
|
||||
"type": "library",
|
||||
@@ -291,7 +301,7 @@
|
||||
}
|
||||
},
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
"time": "2014-07-07 14:01:51"
|
||||
"time": "2014-12-15 14:27:57"
|
||||
},
|
||||
{
|
||||
"name": "alchemy/task-manager",
|
||||
@@ -469,16 +479,16 @@
|
||||
},
|
||||
{
|
||||
"name": "dailymotion/sdk",
|
||||
"version": "1.6",
|
||||
"version": "1.6.2",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/dailymotion/dailymotion-sdk-php.git",
|
||||
"reference": "670ce8c536077a17ac31096d4c61372c35caa713"
|
||||
"reference": "96b291b755e97906f54cafa60be4990ece624e83"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/dailymotion/dailymotion-sdk-php/zipball/670ce8c536077a17ac31096d4c61372c35caa713",
|
||||
"reference": "670ce8c536077a17ac31096d4c61372c35caa713",
|
||||
"url": "https://api.github.com/repos/dailymotion/dailymotion-sdk-php/zipball/96b291b755e97906f54cafa60be4990ece624e83",
|
||||
"reference": "96b291b755e97906f54cafa60be4990ece624e83",
|
||||
"shasum": ""
|
||||
},
|
||||
"type": "library",
|
||||
@@ -498,7 +508,7 @@
|
||||
"dailymotion",
|
||||
"sdk"
|
||||
],
|
||||
"time": "2014-09-11 15:14:39"
|
||||
"time": "2014-11-03 16:53:45"
|
||||
},
|
||||
{
|
||||
"name": "data-uri/data-uri",
|
||||
@@ -545,6 +555,68 @@
|
||||
],
|
||||
"time": "2014-08-22 15:01:57"
|
||||
},
|
||||
{
|
||||
"name": "dflydev/doctrine-orm-service-provider",
|
||||
"version": "v1.0.6",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/dflydev/dflydev-doctrine-orm-service-provider.git",
|
||||
"reference": "a55b92ac5111b8cb2aca19623f10301bab373718"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/dflydev/dflydev-doctrine-orm-service-provider/zipball/a55b92ac5111b8cb2aca19623f10301bab373718",
|
||||
"reference": "a55b92ac5111b8cb2aca19623f10301bab373718",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"doctrine/orm": "~2.3",
|
||||
"php": ">=5.3.3",
|
||||
"pimple/pimple": "1.*@dev"
|
||||
},
|
||||
"require-dev": {
|
||||
"cilex/cilex": "1.*@dev",
|
||||
"cilex/console-service-provider": "@dev",
|
||||
"silex/silex": "1.*@dev"
|
||||
},
|
||||
"suggest": {
|
||||
"dflydev/psr0-resource-locator-service-provider": "1.0.*@dev"
|
||||
},
|
||||
"type": "library",
|
||||
"autoload": {
|
||||
"psr-0": {
|
||||
"Dflydev\\Cilex\\Provider\\DoctrineOrm": "src",
|
||||
"Dflydev\\Pimple\\Provider\\DoctrineOrm": "src",
|
||||
"Dflydev\\Silex\\Provider\\DoctrineOrm": "src"
|
||||
}
|
||||
},
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
"license": [
|
||||
"MIT"
|
||||
],
|
||||
"authors": [
|
||||
{
|
||||
"name": "Dragonfly Development Inc.",
|
||||
"email": "info@dflydev.com",
|
||||
"homepage": "http://dflydev.com"
|
||||
},
|
||||
{
|
||||
"name": "Beau Simensen",
|
||||
"email": "beau@dflydev.com",
|
||||
"homepage": "http://beausimensen.com"
|
||||
}
|
||||
],
|
||||
"description": "Doctrine ORM Service Provider",
|
||||
"homepage": "http://dflydev.com/projects/doctrine-orm-service-provider/",
|
||||
"keywords": [
|
||||
"cilex",
|
||||
"doctrine",
|
||||
"orm",
|
||||
"pimple",
|
||||
"silex"
|
||||
],
|
||||
"time": "2014-07-24 19:35:45"
|
||||
},
|
||||
{
|
||||
"name": "doctrine/annotations",
|
||||
"version": "v1.2.1",
|
||||
@@ -737,7 +809,7 @@
|
||||
{
|
||||
"name": "Johannes Schmitt",
|
||||
"email": "schmittjoh@gmail.com",
|
||||
"homepage": "http://jmsyst.com",
|
||||
"homepage": "https://github.com/schmittjoh",
|
||||
"role": "Developer of wrapped JMSSerializerBundle"
|
||||
}
|
||||
],
|
||||
@@ -830,16 +902,16 @@
|
||||
},
|
||||
{
|
||||
"name": "doctrine/dbal",
|
||||
"version": "v2.4.2",
|
||||
"version": "v2.4.4",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/doctrine/dbal.git",
|
||||
"reference": "fec965d330c958e175c39e61c3f6751955af32d0"
|
||||
"reference": "a370e5b95e509a7809d11f3d280acfc9310d464b"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/doctrine/dbal/zipball/fec965d330c958e175c39e61c3f6751955af32d0",
|
||||
"reference": "fec965d330c958e175c39e61c3f6751955af32d0",
|
||||
"url": "https://api.github.com/repos/doctrine/dbal/zipball/a370e5b95e509a7809d11f3d280acfc9310d464b",
|
||||
"reference": "a370e5b95e509a7809d11f3d280acfc9310d464b",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@@ -851,7 +923,7 @@
|
||||
"symfony/console": "~2.0"
|
||||
},
|
||||
"suggest": {
|
||||
"symfony/console": "Allows use of the command line interface"
|
||||
"symfony/console": "For helpful console commands such as SQL execution and import of files."
|
||||
},
|
||||
"type": "library",
|
||||
"autoload": {
|
||||
@@ -864,17 +936,6 @@
|
||||
"MIT"
|
||||
],
|
||||
"authors": [
|
||||
{
|
||||
"name": "Jonathan Wage",
|
||||
"email": "jonwage@gmail.com",
|
||||
"homepage": "http://www.jwage.com/",
|
||||
"role": "Creator"
|
||||
},
|
||||
{
|
||||
"name": "Guilherme Blanco",
|
||||
"email": "guilhermeblanco@gmail.com",
|
||||
"homepage": "http://www.instaclick.com"
|
||||
},
|
||||
{
|
||||
"name": "Roman Borschel",
|
||||
"email": "roman@code-factory.org"
|
||||
@@ -882,6 +943,14 @@
|
||||
{
|
||||
"name": "Benjamin Eberlei",
|
||||
"email": "kontakt@beberlei.de"
|
||||
},
|
||||
{
|
||||
"name": "Guilherme Blanco",
|
||||
"email": "guilhermeblanco@gmail.com"
|
||||
},
|
||||
{
|
||||
"name": "Jonathan Wage",
|
||||
"email": "jonwage@gmail.com"
|
||||
}
|
||||
],
|
||||
"description": "Database Abstraction Layer",
|
||||
@@ -892,7 +961,7 @@
|
||||
"persistence",
|
||||
"queryobject"
|
||||
],
|
||||
"time": "2014-01-01 16:43:57"
|
||||
"time": "2015-01-12 21:57:01"
|
||||
},
|
||||
{
|
||||
"name": "doctrine/inflector",
|
||||
@@ -925,7 +994,8 @@
|
||||
{
|
||||
"name": "Jonathan Wage",
|
||||
"email": "jonwage@gmail.com",
|
||||
"homepage": "http://www.jwage.com/"
|
||||
"homepage": "http://www.jwage.com/",
|
||||
"role": "Creator"
|
||||
},
|
||||
{
|
||||
"name": "Guilherme Blanco",
|
||||
@@ -943,7 +1013,7 @@
|
||||
{
|
||||
"name": "Johannes Schmitt",
|
||||
"email": "schmittjoh@gmail.com",
|
||||
"homepage": "http://jmsyst.com",
|
||||
"homepage": "https://github.com/schmittjoh",
|
||||
"role": "Developer of wrapped JMSSerializerBundle"
|
||||
}
|
||||
],
|
||||
@@ -997,7 +1067,7 @@
|
||||
{
|
||||
"name": "Johannes Schmitt",
|
||||
"email": "schmittjoh@gmail.com",
|
||||
"homepage": "http://jmsyst.com",
|
||||
"homepage": "https://github.com/schmittjoh",
|
||||
"role": "Developer of wrapped JMSSerializerBundle"
|
||||
}
|
||||
],
|
||||
@@ -1015,12 +1085,12 @@
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/doctrine/migrations.git",
|
||||
"reference": "4256449c5e2603a6b6ee5a78c7c4521d4d4430b8"
|
||||
"reference": "f4fe9d9cc21a711d89d91d29c4a4e7945289cdd0"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/doctrine/migrations/zipball/4256449c5e2603a6b6ee5a78c7c4521d4d4430b8",
|
||||
"reference": "4256449c5e2603a6b6ee5a78c7c4521d4d4430b8",
|
||||
"url": "https://api.github.com/repos/doctrine/migrations/zipball/f4fe9d9cc21a711d89d91d29c4a4e7945289cdd0",
|
||||
"reference": "f4fe9d9cc21a711d89d91d29c4a4e7945289cdd0",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@@ -1067,20 +1137,20 @@
|
||||
"database",
|
||||
"migrations"
|
||||
],
|
||||
"time": "2014-07-09 07:58:02"
|
||||
"time": "2014-10-30 14:49:25"
|
||||
},
|
||||
{
|
||||
"name": "doctrine/orm",
|
||||
"version": "v2.4.6",
|
||||
"version": "v2.4.7",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/doctrine/doctrine2.git",
|
||||
"reference": "bebacf79d8d4dae9168f0f9bc6811e6c2cb6a4d9"
|
||||
"reference": "2bc4ff3cab2ae297bcd05f2e619d42e6a7ca9e68"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/doctrine/doctrine2/zipball/bebacf79d8d4dae9168f0f9bc6811e6c2cb6a4d9",
|
||||
"reference": "bebacf79d8d4dae9168f0f9bc6811e6c2cb6a4d9",
|
||||
"url": "https://api.github.com/repos/doctrine/doctrine2/zipball/2bc4ff3cab2ae297bcd05f2e619d42e6a7ca9e68",
|
||||
"reference": "2bc4ff3cab2ae297bcd05f2e619d42e6a7ca9e68",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@@ -1140,7 +1210,7 @@
|
||||
"database",
|
||||
"orm"
|
||||
],
|
||||
"time": "2014-10-06 13:22:50"
|
||||
"time": "2014-12-16 13:45:01"
|
||||
},
|
||||
{
|
||||
"name": "elasticsearch/elasticsearch",
|
||||
@@ -1204,13 +1274,13 @@
|
||||
"version": "v1.0.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/igorw/evenement",
|
||||
"reference": "v1.0.0"
|
||||
"url": "https://github.com/igorw/evenement.git",
|
||||
"reference": "fa966683e7df3e5dd5929d984a44abfbd6bafe8d"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://github.com/igorw/evenement/zipball/v1.0.0",
|
||||
"reference": "v1.0.0",
|
||||
"url": "https://api.github.com/repos/igorw/evenement/zipball/fa966683e7df3e5dd5929d984a44abfbd6bafe8d",
|
||||
"reference": "fa966683e7df3e5dd5929d984a44abfbd6bafe8d",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@@ -1237,7 +1307,7 @@
|
||||
"keywords": [
|
||||
"event-dispatcher"
|
||||
],
|
||||
"time": "2012-05-30 08:01:08"
|
||||
"time": "2012-05-30 15:01:08"
|
||||
},
|
||||
{
|
||||
"name": "facebook/php-sdk",
|
||||
@@ -1290,12 +1360,12 @@
|
||||
"version": "v2.3.9",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/l3pp4rd/DoctrineExtensions.git",
|
||||
"url": "https://github.com/Atlantic18/DoctrineExtensions.git",
|
||||
"reference": "35adcaae1a3f50d0d5b73aa50ed8fd28ee35ce54"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/l3pp4rd/DoctrineExtensions/zipball/35adcaae1a3f50d0d5b73aa50ed8fd28ee35ce54",
|
||||
"url": "https://api.github.com/repos/Atlantic18/DoctrineExtensions/zipball/35adcaae1a3f50d0d5b73aa50ed8fd28ee35ce54",
|
||||
"reference": "35adcaae1a3f50d0d5b73aa50ed8fd28ee35ce54",
|
||||
"shasum": ""
|
||||
},
|
||||
@@ -1363,20 +1433,20 @@
|
||||
"tree",
|
||||
"uploadable"
|
||||
],
|
||||
"time": "2013-08-18 07:18:44"
|
||||
"time": "2014-01-12 16:34:06"
|
||||
},
|
||||
{
|
||||
"name": "goodby/csv",
|
||||
"version": "1.1.0",
|
||||
"version": "dev-master",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/goodby/csv.git",
|
||||
"reference": "da672802985d196cae767da29b11618a676496b0"
|
||||
"reference": "b289ca3e3f6ad3c76b7d8c3bef3effd0232ca13a"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/goodby/csv/zipball/da672802985d196cae767da29b11618a676496b0",
|
||||
"reference": "da672802985d196cae767da29b11618a676496b0",
|
||||
"url": "https://api.github.com/repos/goodby/csv/zipball/b289ca3e3f6ad3c76b7d8c3bef3effd0232ca13a",
|
||||
"reference": "b289ca3e3f6ad3c76b7d8c3bef3effd0232ca13a",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@@ -1420,7 +1490,7 @@
|
||||
"export",
|
||||
"import"
|
||||
],
|
||||
"time": "2014-01-12 16:34:06"
|
||||
"time": "2015-02-02 12:29:23"
|
||||
},
|
||||
{
|
||||
"name": "guzzle/guzzle",
|
||||
@@ -1988,16 +2058,16 @@
|
||||
},
|
||||
{
|
||||
"name": "imagine/imagine",
|
||||
"version": "dev-0.6.1-flatten-layer",
|
||||
"version": "dev-alchemy-0.6.2",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/alchemy-fr/Imagine.git",
|
||||
"reference": "e75d9495677b40e0868836e3510667178b2bd90a"
|
||||
"reference": "6605d13e3b24f335fe80099c193546671158c041"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/alchemy-fr/Imagine/zipball/e75d9495677b40e0868836e3510667178b2bd90a",
|
||||
"reference": "e75d9495677b40e0868836e3510667178b2bd90a",
|
||||
"url": "https://api.github.com/repos/alchemy-fr/Imagine/zipball/6605d13e3b24f335fe80099c193546671158c041",
|
||||
"reference": "6605d13e3b24f335fe80099c193546671158c041",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@@ -2041,9 +2111,9 @@
|
||||
"image processing"
|
||||
],
|
||||
"support": {
|
||||
"source": "https://github.com/alchemy-fr/Imagine/tree/0.6.1-flatten-layer"
|
||||
"source": "https://github.com/alchemy-fr/Imagine/tree/alchemy-0.6.2"
|
||||
},
|
||||
"time": "2014-10-08 16:23:33"
|
||||
"time": "2015-01-13 18:12:26"
|
||||
},
|
||||
{
|
||||
"name": "ircmaxell/random-lib",
|
||||
@@ -2350,9 +2420,9 @@
|
||||
],
|
||||
"authors": [
|
||||
{
|
||||
"name": "Johannes M. Schmitt",
|
||||
"name": "Johannes Schmitt",
|
||||
"email": "schmittjoh@gmail.com",
|
||||
"homepage": "http://jmsyst.com",
|
||||
"homepage": "https://github.com/schmittjoh",
|
||||
"role": "Developer of wrapped JMSSerializerBundle"
|
||||
}
|
||||
],
|
||||
@@ -2438,16 +2508,16 @@
|
||||
},
|
||||
{
|
||||
"name": "media-alchemyst/media-alchemyst",
|
||||
"version": "0.4.6",
|
||||
"version": "0.4.8",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/alchemy-fr/Media-Alchemyst.git",
|
||||
"reference": "0145a40c01b67268a29ee3863e1ce7be4ad60ac8"
|
||||
"reference": "cf1fdacbaf0d54440fa7b61c750234d0befde0c8"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/alchemy-fr/Media-Alchemyst/zipball/0145a40c01b67268a29ee3863e1ce7be4ad60ac8",
|
||||
"reference": "0145a40c01b67268a29ee3863e1ce7be4ad60ac8",
|
||||
"url": "https://api.github.com/repos/alchemy-fr/Media-Alchemyst/zipball/cf1fdacbaf0d54440fa7b61c750234d0befde0c8",
|
||||
"reference": "cf1fdacbaf0d54440fa7b61c750234d0befde0c8",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@@ -2507,7 +2577,7 @@
|
||||
"video",
|
||||
"video processing"
|
||||
],
|
||||
"time": "2014-09-10 09:44:33"
|
||||
"time": "2015-02-03 16:25:38"
|
||||
},
|
||||
{
|
||||
"name": "mediavorus/mediavorus",
|
||||
@@ -2567,16 +2637,16 @@
|
||||
},
|
||||
{
|
||||
"name": "monolog/monolog",
|
||||
"version": "1.11.0",
|
||||
"version": "1.13.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/Seldaek/monolog.git",
|
||||
"reference": "ec3961874c43840e96da3a8a1ed20d8c73d7e5aa"
|
||||
"reference": "c41c218e239b50446fd883acb1ecfd4b770caeae"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/Seldaek/monolog/zipball/ec3961874c43840e96da3a8a1ed20d8c73d7e5aa",
|
||||
"reference": "ec3961874c43840e96da3a8a1ed20d8c73d7e5aa",
|
||||
"url": "https://api.github.com/repos/Seldaek/monolog/zipball/c41c218e239b50446fd883acb1ecfd4b770caeae",
|
||||
"reference": "c41c218e239b50446fd883acb1ecfd4b770caeae",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@@ -2590,9 +2660,10 @@
|
||||
"aws/aws-sdk-php": "~2.4, >2.4.8",
|
||||
"doctrine/couchdb": "~1.0@dev",
|
||||
"graylog2/gelf-php": "~1.0",
|
||||
"phpunit/phpunit": "~3.7.0",
|
||||
"phpunit/phpunit": "~4.0",
|
||||
"raven/raven": "~0.5",
|
||||
"ruflin/elastica": "0.90.*",
|
||||
"swiftmailer/swiftmailer": "~5.3",
|
||||
"videlalvaro/php-amqplib": "~2.4"
|
||||
},
|
||||
"suggest": {
|
||||
@@ -2609,7 +2680,7 @@
|
||||
"type": "library",
|
||||
"extra": {
|
||||
"branch-alias": {
|
||||
"dev-master": "1.11.x-dev"
|
||||
"dev-master": "1.13.x-dev"
|
||||
}
|
||||
},
|
||||
"autoload": {
|
||||
@@ -2635,7 +2706,7 @@
|
||||
"logging",
|
||||
"psr-3"
|
||||
],
|
||||
"time": "2014-09-30 13:30:58"
|
||||
"time": "2015-03-05 01:12:12"
|
||||
},
|
||||
{
|
||||
"name": "mrclay/minify",
|
||||
@@ -2667,7 +2738,7 @@
|
||||
],
|
||||
"authors": [
|
||||
{
|
||||
"name": "Stephen Clay",
|
||||
"name": "Steve Clay",
|
||||
"email": "steve@mrclay.org",
|
||||
"homepage": "http://www.mrclay.org/",
|
||||
"role": "Developer"
|
||||
@@ -2853,21 +2924,21 @@
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/romainneutron/Imagine-Silex-Service-Provider.git",
|
||||
"reference": "0.1.2"
|
||||
"reference": "a8a7862ae90419f2b23746cd8436c2310e4eb084"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/romainneutron/Imagine-Silex-Service-Provider/zipball/0.1.2",
|
||||
"reference": "0.1.2",
|
||||
"url": "https://api.github.com/repos/romainneutron/Imagine-Silex-Service-Provider/zipball/a8a7862ae90419f2b23746cd8436c2310e4eb084",
|
||||
"reference": "a8a7862ae90419f2b23746cd8436c2310e4eb084",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"imagine/imagine": "*",
|
||||
"php": ">=5.3.3",
|
||||
"silex/silex": ">=1.0,<2.0"
|
||||
"silex/silex": "~1.0"
|
||||
},
|
||||
"require-dev": {
|
||||
"symfony/browser-kit": ">=2.0,<3.0"
|
||||
"symfony/browser-kit": "~2.0"
|
||||
},
|
||||
"type": "library",
|
||||
"autoload": {
|
||||
@@ -3381,7 +3452,7 @@
|
||||
"metadata"
|
||||
],
|
||||
"support": {
|
||||
"source": "https://github.com/alchemy-fr/PHPExiftool/tree/0.4.1-mwg-metadata-copy"
|
||||
"source": "https://github.com/alchemy-fr/PHPExiftool/tree/dev"
|
||||
},
|
||||
"time": "2014-10-08 16:09:02"
|
||||
},
|
||||
@@ -3419,9 +3490,9 @@
|
||||
],
|
||||
"authors": [
|
||||
{
|
||||
"name": "Johannes M. Schmitt",
|
||||
"name": "Johannes Schmitt",
|
||||
"email": "schmittjoh@gmail.com",
|
||||
"homepage": "http://jmsyst.com",
|
||||
"homepage": "https://github.com/schmittjoh",
|
||||
"role": "Developer of wrapped JMSSerializerBundle"
|
||||
}
|
||||
],
|
||||
@@ -3697,16 +3768,16 @@
|
||||
},
|
||||
{
|
||||
"name": "rhumsaa/uuid",
|
||||
"version": "2.7.3",
|
||||
"version": "2.8.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/ramsey/uuid.git",
|
||||
"reference": "b976326ca5977d7333f34e3c828ae7c22a49a65a"
|
||||
"reference": "cca98c652cac412c9c2f109c69e5532f313435fc"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/ramsey/uuid/zipball/b976326ca5977d7333f34e3c828ae7c22a49a65a",
|
||||
"reference": "b976326ca5977d7333f34e3c828ae7c22a49a65a",
|
||||
"url": "https://api.github.com/repos/ramsey/uuid/zipball/cca98c652cac412c9c2f109c69e5532f313435fc",
|
||||
"reference": "cca98c652cac412c9c2f109c69e5532f313435fc",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@@ -3730,7 +3801,7 @@
|
||||
"type": "library",
|
||||
"extra": {
|
||||
"branch-alias": {
|
||||
"dev-master": "2.7.x-dev"
|
||||
"dev-master": "2.8.x-dev"
|
||||
}
|
||||
},
|
||||
"autoload": {
|
||||
@@ -3759,7 +3830,81 @@
|
||||
"identifier",
|
||||
"uuid"
|
||||
],
|
||||
"time": "2014-08-27 22:39:41"
|
||||
"time": "2014-11-09 18:42:56"
|
||||
},
|
||||
{
|
||||
"name": "roave/security-advisories",
|
||||
"version": "dev-master",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/Roave/SecurityAdvisories.git",
|
||||
"reference": "a1d7d327e9b8017b5a848ccb6a1433f25975f65b"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/Roave/SecurityAdvisories/zipball/a1d7d327e9b8017b5a848ccb6a1433f25975f65b",
|
||||
"reference": "a1d7d327e9b8017b5a848ccb6a1433f25975f65b",
|
||||
"shasum": ""
|
||||
},
|
||||
"conflict": {
|
||||
"contao/core": ">=2.11.0,<2.11.16|>=3.0.0,<3.1.0|>=3.1.0,<3.2.0|>=3.2.0,<3.2.7|>=2.11.0,<2.11.17|>=3.0.0,<3.1.0|>=3.1.0,<3.2.0|>=3.2.0,<3.2.9|>=2.11.0,<3.0.0|>=3.0.0,<3.1.0|>=3.1.0,<3.2.0|>=3.2.0,<3.2.19|>=3.3.0,<3.4.0|>=3.4.0,<3.4.4",
|
||||
"doctrine/dbal": ">=2.0.0,<2.0.8|>=2.1.0,<2.1.2",
|
||||
"doctrine/doctrine-module": "<=0.7.1|<=0.7.1",
|
||||
"doctrine/orm": ">=2.0.0,<2.0.3",
|
||||
"dompdf/dompdf": ">=0.6.0,<0.6.1",
|
||||
"friendsofsymfony/rest-bundle": ">=1.2.0,<1.2.2",
|
||||
"friendsofsymfony/user-bundle": ">=1.2.0,<1.2.1|>=1.2.0,<1.2.4|>=1.2.0,<1.3.0|>=1.3.0,<1.3.5|>=1.2.0,<1.2.5|>=1.3.0,<1.3.3",
|
||||
"illuminate/auth": ">=4.0.0,<4.0.99|>=4.1.0,<4.1.26",
|
||||
"illuminate/database": ">=4.0.0,<4.0.99|>=4.1.0,<4.1.29",
|
||||
"laravel/framework": ">=4.0.0,<4.0.99|>=4.1.0,<4.1.26|>=4.0.0,<4.0.99|>=4.1.0,<4.1.29",
|
||||
"monolog/monolog": ">=1.8.0,<1.12.0",
|
||||
"sabre/dav": ">=1.6.0,<1.6.9|>=1.7.0,<1.7.7|>=1.8.0,<1.8.5",
|
||||
"socalnick/scn-social-auth": "<1.15.2",
|
||||
"swiftmailer/swiftmailer": ">=4.0.0,<4.99.99|>=5.0.0,<5.2.1",
|
||||
"symfony/dependency-injection": ">=2.0.0,<2.0.17",
|
||||
"symfony/framework-bundle": ">=2.0.0,<2.1.0|>=2.1.0,<2.2.0|>=2.2.0,<2.3.0|>=2.3.0,<2.3.18|>=2.4.0,<2.4.8|>=2.5.0,<2.5.2",
|
||||
"symfony/http-foundation": ">=2.0.0,<2.0.19|>=2.1.0,<2.1.4|>=2.0.0,<2.0.19|>=2.0.0,<2.0.24|>=2.1.0,<2.1.12|>=2.2.0,<2.2.5|>=2.3.0,<2.3.3|>=2.0.0,<2.1.0|>=2.1.0,<2.2.0|>=2.2.0,<2.3.0|>=2.3.0,<2.3.19|>=2.4.0,<2.4.9|>=2.5.0,<2.5.4|>=2.0.0,<2.1.0|>=2.1.0,<2.2.0|>=2.2.0,<2.3.0|>=2.3.0,<2.3.19|>=2.4.0,<2.4.9|>=2.5.0,<2.5.4",
|
||||
"symfony/http-kernel": ">=2.0.0,<2.1.0|>=2.1.0,<2.2.0|>=2.2.0,<2.3.0|>=2.3.0,<2.3.19|>=2.4.0,<2.4.9|>=2.5.0,<2.5.4",
|
||||
"symfony/routing": ">=2.0.0,<2.0.17|>=2.0.0,<2.0.19",
|
||||
"symfony/security": ">=2.0.0,<2.0.19|>=2.0.0,<2.0.25|>=2.1.0,<2.1.13|>=2.2.0,<2.2.9|>=2.3.0,<2.3.6",
|
||||
"symfony/serializer": ">=2.0.0,<2.0.11",
|
||||
"symfony/symfony": ">=2.0.0,<2.0.6|>=2.0.0,<2.0.11|>=2.0.0,<2.0.17|>=2.0.0,<2.0.19|>=2.1.0,<2.1.4|>=2.0.0,<2.0.19|>=2.0.0,<2.0.20|>=2.1.0,<2.1.5|>=2.0.0,<2.0.22|>=2.0.0,<2.0.22|>=2.1.0,<2.1.7|>=2.0.0,<2.0.24|>=2.1.0,<2.1.12|>=2.2.0,<2.2.5|>=2.3.0,<2.3.3|>=2.0.0,<2.0.24|>=2.1.0,<2.1.12|>=2.2.0,<2.2.5|>=2.3.0,<2.3.3|>=2.0.0,<2.0.25|>=2.1.0,<2.1.13|>=2.2.0,<2.2.9|>=2.3.0,<2.3.6|>=2.0.0,<2.1.0|>=2.1.0,<2.2.0|>=2.2.0,<2.3.0|>=2.3.0,<2.3.19|>=2.4.0,<2.4.9|>=2.5.0,<2.5.4|>=2.0.0,<2.1.0|>=2.1.0,<2.2.0|>=2.2.0,<2.3.0|>=2.3.0,<2.3.19|>=2.4.0,<2.4.9|>=2.5.0,<2.5.4|>=2.0.0,<2.1.0|>=2.1.0,<2.2.0|>=2.2.0,<2.3.0|>=2.3.0,<2.3.19|>=2.4.0,<2.4.9|>=2.5.0,<2.5.4|>=2.0.0,<2.1.0|>=2.1.0,<2.2.0|>=2.2.0,<2.3.0|>=2.3.0,<2.3.19|>=2.4.0,<2.4.9|>=2.5.0,<2.5.4|>=2.0.0,<2.1.0|>=2.1.0,<2.2.0|>=2.2.0,<2.3.0|>=2.3.0,<2.3.19|>=2.4.0,<2.4.9|>=2.5.0,<2.5.4",
|
||||
"symfony/translation": ">=2.0.0,<2.0.17",
|
||||
"symfony/validator": ">=2.0.0,<2.0.17|>=2.0.0,<2.0.24|>=2.1.0,<2.1.12|>=2.2.0,<2.2.5|>=2.3.0,<2.3.3",
|
||||
"symfony/web-profiler-bundle": ">=2.0.0,<2.1.0|>=2.1.0,<2.2.0|>=2.2.0,<2.3.0|>=2.3.0,<2.3.19|>=2.4.0,<2.4.9|>=2.5.0,<2.5.4",
|
||||
"symfony/yaml": ">=2.0.0,<2.0.22|>=2.0.0,<2.0.22|>=2.1.0,<2.1.7",
|
||||
"thelia/backoffice-default-template": ">=2.1.0,<2.1.2",
|
||||
"thelia/thelia": ">=2.1.0,<2.1.2",
|
||||
"twig/twig": ">=1.0.0,<1.12.3",
|
||||
"willdurand/js-translation-bundle": "<2.1.1",
|
||||
"yiisoft/yii": ">=1.1.14,<1.1.15",
|
||||
"zendframework/zend-db": ">=2.0.0,<2.0.99|>=2.1.0,<2.1.99|>=2.2.0,<2.2.10|>=2.3.0,<2.3.5",
|
||||
"zendframework/zend-form": ">=2.0.0,<2.2.7|>=2.3.0,<2.3.1",
|
||||
"zendframework/zend-json": ">=2.1.0,<2.1.6|>=2.2.0,<2.2.6",
|
||||
"zendframework/zend-navigation": ">=2.0.0,<2.2.7|>=2.3.0,<2.3.1",
|
||||
"zendframework/zend-session": ">=2.0.0,<2.0.99|>=2.1.0,<2.1.99|>=2.2.0,<2.2.9|>=2.3.0,<2.3.4",
|
||||
"zendframework/zend-view": ">=2.0.0,<2.2.7|>=2.3.0,<2.3.1",
|
||||
"zendframework/zend-xmlrpc": ">=2.1.0,<2.1.6|>=2.2.0,<2.2.6",
|
||||
"zendframework/zendframework": ">=2.0.0,<2.0.1|>=2.0.0,<2.0.5|>=2.0.0,<2.0.8|>=2.1.0,<2.1.4|>=2.0.0,<2.0.8|>=2.1.0,<2.1.4|>=2.0.0,<2.0.8|>=2.1.0,<2.1.4|>=2.2.0,<2.2.5|>=2.1.0,<2.1.6|>=2.2.0,<2.2.6|>=2.0.0,<2.2.7|>=2.3.0,<2.3.1|>=2.0.0,<2.0.99|>=2.1.0,<2.1.99|>=2.2.0,<2.2.8|>=2.3.0,<2.3.3|>=2.0.0,<2.0.99|>=2.1.0,<2.1.99|>=2.2.0,<2.2.8|>=2.3.0,<2.3.3|>=2.0.0,<2.0.99|>=2.1.0,<2.1.99|>=2.2.0,<2.2.9|>=2.3.0,<2.3.4|>=2.0.0,<2.0.99|>=2.1.0,<2.1.99|>=2.2.0,<2.2.10|>=2.3.0,<2.3.5",
|
||||
"zendframework/zendframework1": ">=1.7.0,<1.7.5|>=1.7.0,<1.7.6|>=1.9.0,<1.9.7|>=1.7.0,<1.7.9|>=1.8.0,<1.8.5|>=1.9.0,<1.9.7|>=1.7.0,<1.7.9|>=1.8.0,<1.8.5|>=1.9.0,<1.9.7|>=1.8.0,<1.8.5|>=1.9.0,<1.9.7|>=1.7.0,<1.7.9|>=1.8.0,<1.8.5|>=1.9.0,<1.9.7|>=1.7.0,<1.7.9|>=1.8.0,<1.8.5|>=1.9.0,<1.9.7|>=1.9.0,<1.9.8|>=1.10.0,<1.10.3|>=1.0.0,<1.11.4|>=1.10.0,<1.10.9|>=1.11.0,<1.11.6|>=1.0.0,<1.11.13|>=1.0.0,<1.11.13|>=1.11.0,<1.11.15|>=1.12.0,<1.12.1|>=1.12.0,<1.12.4|>=1.12.0,<1.12.4|>=1.12.0,<1.12.7|>=1.12.0,<1.12.9|>=1.12.0,<1.12.9",
|
||||
"zendframework/zendopenid": ">=2.0.0,<2.0.2",
|
||||
"zf-commons/zfc-user": "<1.2.2",
|
||||
"zfr/zfr-oauth2-server-module": "<0.1.2"
|
||||
},
|
||||
"type": "metapackage",
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
"license": [
|
||||
"MIT"
|
||||
],
|
||||
"authors": [
|
||||
{
|
||||
"name": "Marco Pivetta",
|
||||
"email": "ocramius@gmail.com",
|
||||
"role": "maintainer"
|
||||
}
|
||||
],
|
||||
"description": "Prevents installation of composer packages with known security vulnerabilities: no API, simply require it",
|
||||
"time": "2015-03-02 13:02:36"
|
||||
},
|
||||
{
|
||||
"name": "silex/silex",
|
||||
@@ -3978,7 +4123,7 @@
|
||||
},
|
||||
{
|
||||
"name": "Phraseanet Team",
|
||||
"email": "support@alchemy.fr",
|
||||
"email": "info@alchemy.fr",
|
||||
"homepage": "http://www.phraseanet.com/"
|
||||
}
|
||||
],
|
||||
@@ -3992,25 +4137,28 @@
|
||||
},
|
||||
{
|
||||
"name": "swiftmailer/swiftmailer",
|
||||
"version": "v4.3.1",
|
||||
"version": "v5.3.1",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/swiftmailer/swiftmailer.git",
|
||||
"reference": "ae540bed1079c07aa12e9e62d9d8d4fc49bbdff2"
|
||||
"reference": "c5f963e7f9d6f6438fda4f22d5cc2db296ec621a"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/swiftmailer/swiftmailer/zipball/ae540bed1079c07aa12e9e62d9d8d4fc49bbdff2",
|
||||
"reference": "ae540bed1079c07aa12e9e62d9d8d4fc49bbdff2",
|
||||
"url": "https://api.github.com/repos/swiftmailer/swiftmailer/zipball/c5f963e7f9d6f6438fda4f22d5cc2db296ec621a",
|
||||
"reference": "c5f963e7f9d6f6438fda4f22d5cc2db296ec621a",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"php": ">=5.2.4"
|
||||
"php": ">=5.3.3"
|
||||
},
|
||||
"require-dev": {
|
||||
"mockery/mockery": "~0.9.1"
|
||||
},
|
||||
"type": "library",
|
||||
"extra": {
|
||||
"branch-alias": {
|
||||
"dev-master": "4.3-dev"
|
||||
"dev-master": "5.3-dev"
|
||||
}
|
||||
},
|
||||
"autoload": {
|
||||
@@ -4020,15 +4168,15 @@
|
||||
},
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
"license": [
|
||||
"LGPL"
|
||||
"MIT"
|
||||
],
|
||||
"authors": [
|
||||
{
|
||||
"name": "Fabien Potencier",
|
||||
"email": "fabien@symfony.com"
|
||||
"name": "Chris Corbyn"
|
||||
},
|
||||
{
|
||||
"name": "Chris Corbyn"
|
||||
"name": "Fabien Potencier",
|
||||
"email": "fabien@symfony.com"
|
||||
}
|
||||
],
|
||||
"description": "Swiftmailer, free feature-rich PHP mailer",
|
||||
@@ -4037,7 +4185,7 @@
|
||||
"mail",
|
||||
"mailer"
|
||||
],
|
||||
"time": "2013-04-11 10:22:09"
|
||||
"time": "2014-12-05 14:17:14"
|
||||
},
|
||||
{
|
||||
"name": "symfony/icu",
|
||||
@@ -4245,25 +4393,31 @@
|
||||
},
|
||||
{
|
||||
"name": "twig/extensions",
|
||||
"version": "v1.1.0",
|
||||
"version": "v1.2.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/fabpot/Twig-extensions.git",
|
||||
"reference": "c0ab818595338dd5569369bfce2552d02cec5d50"
|
||||
"url": "https://github.com/twigphp/Twig-extensions.git",
|
||||
"reference": "8cf4b9fe04077bd54fc73f4fde83347040c3b8cd"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/fabpot/Twig-extensions/zipball/c0ab818595338dd5569369bfce2552d02cec5d50",
|
||||
"reference": "c0ab818595338dd5569369bfce2552d02cec5d50",
|
||||
"url": "https://api.github.com/repos/twigphp/Twig-extensions/zipball/8cf4b9fe04077bd54fc73f4fde83347040c3b8cd",
|
||||
"reference": "8cf4b9fe04077bd54fc73f4fde83347040c3b8cd",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"twig/twig": "~1.12"
|
||||
},
|
||||
"require-dev": {
|
||||
"symfony/translation": "~2.3"
|
||||
},
|
||||
"suggest": {
|
||||
"symfony/translation": "Allow the time_diff output to be translated"
|
||||
},
|
||||
"type": "library",
|
||||
"extra": {
|
||||
"branch-alias": {
|
||||
"dev-master": "1.1.x-dev"
|
||||
"dev-master": "1.2.x-dev"
|
||||
}
|
||||
},
|
||||
"autoload": {
|
||||
@@ -4278,30 +4432,28 @@
|
||||
"authors": [
|
||||
{
|
||||
"name": "Fabien Potencier",
|
||||
"email": "fabien@symfony.com",
|
||||
"homepage": "http://fabien.potencier.org",
|
||||
"role": "Lead Developer"
|
||||
"email": "fabien@symfony.com"
|
||||
}
|
||||
],
|
||||
"description": "Common additional features for Twig that do not directly belong in core",
|
||||
"homepage": "https://github.com/fabpot/Twig-extensions",
|
||||
"homepage": "http://twig.sensiolabs.org/doc/extensions/index.html",
|
||||
"keywords": [
|
||||
"i18n",
|
||||
"text"
|
||||
],
|
||||
"time": "2014-07-05 10:01:35"
|
||||
"time": "2014-10-30 14:30:03"
|
||||
},
|
||||
{
|
||||
"name": "twig/twig",
|
||||
"version": "v1.16.0",
|
||||
"version": "v1.16.2",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/fabpot/Twig.git",
|
||||
"url": "https://github.com/twigphp/Twig.git",
|
||||
"reference": "8ce37115802e257a984a82d38254884085060024"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/fabpot/Twig/zipball/8ce37115802e257a984a82d38254884085060024",
|
||||
"url": "https://api.github.com/repos/twigphp/Twig/zipball/8ce37115802e257a984a82d38254884085060024",
|
||||
"reference": "8ce37115802e257a984a82d38254884085060024",
|
||||
"shasum": ""
|
||||
},
|
||||
@@ -4346,7 +4498,7 @@
|
||||
"keywords": [
|
||||
"templating"
|
||||
],
|
||||
"time": "2014-07-05 12:19:05"
|
||||
"time": "2014-10-17 12:53:44"
|
||||
},
|
||||
{
|
||||
"name": "vierbergenlars/php-semver",
|
||||
@@ -5176,16 +5328,16 @@
|
||||
},
|
||||
{
|
||||
"name": "instaclick/php-webdriver",
|
||||
"version": "1.4.0",
|
||||
"version": "1.4.1",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/instaclick/php-webdriver.git",
|
||||
"reference": "3cf130283b054b50119f887e11b9b5a648d785a9"
|
||||
"reference": "a57b2bcd9467e217134a2248b261b8b3a90ccea0"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/instaclick/php-webdriver/zipball/3cf130283b054b50119f887e11b9b5a648d785a9",
|
||||
"reference": "3cf130283b054b50119f887e11b9b5a648d785a9",
|
||||
"url": "https://api.github.com/repos/instaclick/php-webdriver/zipball/a57b2bcd9467e217134a2248b261b8b3a90ccea0",
|
||||
"reference": "a57b2bcd9467e217134a2248b261b8b3a90ccea0",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@@ -5219,7 +5371,7 @@
|
||||
{
|
||||
"name": "Anthon Pang",
|
||||
"email": "apang@softwaredevelopment.ca",
|
||||
"role": "developer"
|
||||
"role": "Fork Maintainer"
|
||||
}
|
||||
],
|
||||
"description": "PHP WebDriver for Selenium 2",
|
||||
@@ -5230,7 +5382,7 @@
|
||||
"webdriver",
|
||||
"webtest"
|
||||
],
|
||||
"time": "2014-05-08 04:19:19"
|
||||
"time": "2014-05-12 21:03:05"
|
||||
},
|
||||
{
|
||||
"name": "phpunit/php-code-coverage",
|
||||
@@ -5478,16 +5630,16 @@
|
||||
},
|
||||
{
|
||||
"name": "phpunit/phpunit",
|
||||
"version": "3.7.37",
|
||||
"version": "3.7.38",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/sebastianbergmann/phpunit.git",
|
||||
"reference": "ae6cefd7cc84586a5ef27e04bae11ee940ec63dc"
|
||||
"reference": "38709dc22d519a3d1be46849868aa2ddf822bcf6"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/ae6cefd7cc84586a5ef27e04bae11ee940ec63dc",
|
||||
"reference": "ae6cefd7cc84586a5ef27e04bae11ee940ec63dc",
|
||||
"url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/38709dc22d519a3d1be46849868aa2ddf822bcf6",
|
||||
"reference": "38709dc22d519a3d1be46849868aa2ddf822bcf6",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@@ -5547,7 +5699,7 @@
|
||||
"testing",
|
||||
"xunit"
|
||||
],
|
||||
"time": "2014-04-30 12:24:19"
|
||||
"time": "2014-10-17 09:04:17"
|
||||
},
|
||||
{
|
||||
"name": "phpunit/phpunit-mock-objects",
|
||||
@@ -5601,9 +5753,9 @@
|
||||
],
|
||||
"aliases": [
|
||||
{
|
||||
"alias": "0.6.1",
|
||||
"alias_normalized": "0.6.1.0",
|
||||
"version": "dev-0.6.1-flatten-layer",
|
||||
"alias": "0.6.2",
|
||||
"alias_normalized": "0.6.2.0",
|
||||
"version": "dev-alchemy-0.6.2",
|
||||
"package": "imagine/imagine"
|
||||
},
|
||||
{
|
||||
@@ -5617,16 +5769,19 @@
|
||||
"stability-flags": {
|
||||
"alchemy/task-manager": 20,
|
||||
"alchemy/zippy": 20,
|
||||
"goodby/csv": 20,
|
||||
"imagine/imagine": 20,
|
||||
"neutron/process-manager": 20,
|
||||
"phpexiftool/phpexiftool": 20,
|
||||
"silex/silex": 20,
|
||||
"silex/web-profiler": 20,
|
||||
"doctrine/migrations": 20,
|
||||
"roave/security-advisories": 20,
|
||||
"behat/behat": 20,
|
||||
"behat/gherkin": 20
|
||||
},
|
||||
"prefer-stable": false,
|
||||
"prefer-lowest": false,
|
||||
"platform": {
|
||||
"php": ">=5.4"
|
||||
},
|
||||
|
@@ -206,10 +206,6 @@ api_cors:
|
||||
session:
|
||||
idle: 0
|
||||
lifetime: 604800 # 1 week
|
||||
static-file:
|
||||
enabled: false
|
||||
type: nginx
|
||||
symlink-directory: ''
|
||||
crossdomain:
|
||||
site-control: 'master-only'
|
||||
allow-access-from:
|
||||
|
@@ -1,92 +0,0 @@
|
||||
package caurina.transitions {
|
||||
|
||||
/**
|
||||
* Generic, auxiliary functions
|
||||
*
|
||||
* @author Zeh Fernando
|
||||
* @version 1.0.0
|
||||
* @private
|
||||
*/
|
||||
|
||||
public class AuxFunctions {
|
||||
|
||||
/**
|
||||
* Gets the R (xx0000) bits from a number
|
||||
*
|
||||
* @param p_num Number Color number (ie, 0xffff00)
|
||||
* @return Number The R value
|
||||
*/
|
||||
public static function numberToR(p_num:Number):Number {
|
||||
// The initial & is meant to crop numbers bigger than 0xffffff
|
||||
return (p_num & 0xff0000) >> 16;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the G (00xx00) bits from a number
|
||||
*
|
||||
* @param p_num Number Color number (ie, 0xffff00)
|
||||
* @return Number The G value
|
||||
*/
|
||||
public static function numberToG(p_num:Number):Number {
|
||||
return (p_num & 0xff00) >> 8;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the B (0000xx) bits from a number
|
||||
*
|
||||
* @param p_num Number Color number (ie, 0xffff00)
|
||||
* @return Number The B value
|
||||
*/
|
||||
public static function numberToB(p_num:Number):Number {
|
||||
return (p_num & 0xff);
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks whether a string is on an array
|
||||
*
|
||||
* @param p_string String String to search for
|
||||
* @param p_array Array Array to be searched
|
||||
* @return Boolean Whether the array contains the string or not
|
||||
*/
|
||||
public static function isInArray(p_string:String, p_array:Array):Boolean {
|
||||
var l:uint = p_array.length;
|
||||
for (var i:uint = 0; i < l; i++) {
|
||||
if (p_array[i] == p_string) return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the number of properties an object has
|
||||
*
|
||||
* @param p_object Object Target object with a number of properties
|
||||
* @return Number Number of total properties the object has
|
||||
*/
|
||||
public static function getObjectLength(p_object:Object):uint {
|
||||
var totalProperties:uint = 0;
|
||||
for (var pName:String in p_object) totalProperties ++;
|
||||
return totalProperties;
|
||||
}
|
||||
|
||||
/* Takes a variable number of objects as parameters and "adds" their properties, from left to right. If a latter object defines a property as null, it will be removed from the final object
|
||||
* @param args Object(s) A variable number of objects
|
||||
* @return Object An object with the sum of all paremeters added as properties.
|
||||
*/
|
||||
public static function concatObjects(...args) : Object{
|
||||
var finalObject : Object = {};
|
||||
var currentObject : Object;
|
||||
for (var i : int = 0; i < args.length; i++){
|
||||
currentObject = args[i];
|
||||
for (var prop : String in currentObject){
|
||||
if (currentObject[prop] == null){
|
||||
// delete in case is null
|
||||
delete finalObject[prop];
|
||||
}else{
|
||||
finalObject[prop] = currentObject[prop];
|
||||
}
|
||||
}
|
||||
}
|
||||
return finalObject;
|
||||
}
|
||||
}
|
||||
}
|
@@ -1,714 +0,0 @@
|
||||
/**
|
||||
* Equations
|
||||
* Main equations for the Tweener class
|
||||
*
|
||||
* @author Zeh Fernando, Nate Chatellier
|
||||
* @version 1.0.2
|
||||
*/
|
||||
|
||||
/*
|
||||
Disclaimer for Robert Penner's Easing Equations license:
|
||||
|
||||
TERMS OF USE - EASING EQUATIONS
|
||||
|
||||
Open source under the BSD License.
|
||||
|
||||
Copyright © 2001 Robert Penner
|
||||
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 author nor the names of 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 OWNER OR 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.
|
||||
*/
|
||||
|
||||
package caurina.transitions {
|
||||
|
||||
public class Equations {
|
||||
|
||||
/**
|
||||
* There's no constructor.
|
||||
* @private
|
||||
*/
|
||||
public function Equations () {
|
||||
trace ("Equations is a static class and should not be instantiated.")
|
||||
}
|
||||
|
||||
/**
|
||||
* Registers all the equations to the Tweener class, so they can be found by the direct string parameters.
|
||||
* This method doesn't actually have to be used - equations can always be referenced by their full function
|
||||
* names. But "registering" them make them available as their shorthand string names.
|
||||
*/
|
||||
public static function init():void {
|
||||
Tweener.registerTransition("easenone", easeNone);
|
||||
Tweener.registerTransition("linear", easeNone); // mx.transitions.easing.None.easeNone
|
||||
|
||||
Tweener.registerTransition("easeinquad", easeInQuad); // mx.transitions.easing.Regular.easeIn
|
||||
Tweener.registerTransition("easeoutquad", easeOutQuad); // mx.transitions.easing.Regular.easeOut
|
||||
Tweener.registerTransition("easeinoutquad", easeInOutQuad); // mx.transitions.easing.Regular.easeInOut
|
||||
Tweener.registerTransition("easeoutinquad", easeOutInQuad);
|
||||
|
||||
Tweener.registerTransition("easeincubic", easeInCubic);
|
||||
Tweener.registerTransition("easeoutcubic", easeOutCubic);
|
||||
Tweener.registerTransition("easeinoutcubic", easeInOutCubic);
|
||||
Tweener.registerTransition("easeoutincubic", easeOutInCubic);
|
||||
|
||||
Tweener.registerTransition("easeinquart", easeInQuart);
|
||||
Tweener.registerTransition("easeoutquart", easeOutQuart);
|
||||
Tweener.registerTransition("easeinoutquart", easeInOutQuart);
|
||||
Tweener.registerTransition("easeoutinquart", easeOutInQuart);
|
||||
|
||||
Tweener.registerTransition("easeinquint", easeInQuint);
|
||||
Tweener.registerTransition("easeoutquint", easeOutQuint);
|
||||
Tweener.registerTransition("easeinoutquint", easeInOutQuint);
|
||||
Tweener.registerTransition("easeoutinquint", easeOutInQuint);
|
||||
|
||||
Tweener.registerTransition("easeinsine", easeInSine);
|
||||
Tweener.registerTransition("easeoutsine", easeOutSine);
|
||||
Tweener.registerTransition("easeinoutsine", easeInOutSine);
|
||||
Tweener.registerTransition("easeoutinsine", easeOutInSine);
|
||||
|
||||
Tweener.registerTransition("easeincirc", easeInCirc);
|
||||
Tweener.registerTransition("easeoutcirc", easeOutCirc);
|
||||
Tweener.registerTransition("easeinoutcirc", easeInOutCirc);
|
||||
Tweener.registerTransition("easeoutincirc", easeOutInCirc);
|
||||
|
||||
Tweener.registerTransition("easeinexpo", easeInExpo); // mx.transitions.easing.Strong.easeIn
|
||||
Tweener.registerTransition("easeoutexpo", easeOutExpo); // mx.transitions.easing.Strong.easeOut
|
||||
Tweener.registerTransition("easeinoutexpo", easeInOutExpo); // mx.transitions.easing.Strong.easeInOut
|
||||
Tweener.registerTransition("easeoutinexpo", easeOutInExpo);
|
||||
|
||||
Tweener.registerTransition("easeinelastic", easeInElastic); // mx.transitions.easing.Elastic.easeIn
|
||||
Tweener.registerTransition("easeoutelastic", easeOutElastic); // mx.transitions.easing.Elastic.easeOut
|
||||
Tweener.registerTransition("easeinoutelastic", easeInOutElastic); // mx.transitions.easing.Elastic.easeInOut
|
||||
Tweener.registerTransition("easeoutinelastic", easeOutInElastic);
|
||||
|
||||
Tweener.registerTransition("easeinback", easeInBack); // mx.transitions.easing.Back.easeIn
|
||||
Tweener.registerTransition("easeoutback", easeOutBack); // mx.transitions.easing.Back.easeOut
|
||||
Tweener.registerTransition("easeinoutback", easeInOutBack); // mx.transitions.easing.Back.easeInOut
|
||||
Tweener.registerTransition("easeoutinback", easeOutInBack);
|
||||
|
||||
Tweener.registerTransition("easeinbounce", easeInBounce); // mx.transitions.easing.Bounce.easeIn
|
||||
Tweener.registerTransition("easeoutbounce", easeOutBounce); // mx.transitions.easing.Bounce.easeOut
|
||||
Tweener.registerTransition("easeinoutbounce", easeInOutBounce); // mx.transitions.easing.Bounce.easeInOut
|
||||
Tweener.registerTransition("easeoutinbounce", easeOutInBounce);
|
||||
}
|
||||
|
||||
// ==================================================================================================================================
|
||||
// TWEENING EQUATIONS functions -----------------------------------------------------------------------------------------------------
|
||||
// (the original equations are Robert Penner's work as mentioned on the disclaimer)
|
||||
|
||||
/**
|
||||
* Easing equation function for a simple linear tweening, with no easing.
|
||||
*
|
||||
* @param t Current time (in frames or seconds).
|
||||
* @param b Starting value.
|
||||
* @param c Change needed in value.
|
||||
* @param d Expected easing duration (in frames or seconds).
|
||||
* @return The correct value.
|
||||
*/
|
||||
public static function easeNone (t:Number, b:Number, c:Number, d:Number, p_params:Object = null):Number {
|
||||
return c*t/d + b;
|
||||
}
|
||||
|
||||
/**
|
||||
* Easing equation function for a quadratic (t^2) easing in: accelerating from zero velocity.
|
||||
*
|
||||
* @param t Current time (in frames or seconds).
|
||||
* @param b Starting value.
|
||||
* @param c Change needed in value.
|
||||
* @param d Expected easing duration (in frames or seconds).
|
||||
* @return The correct value.
|
||||
*/
|
||||
public static function easeInQuad (t:Number, b:Number, c:Number, d:Number, p_params:Object = null):Number {
|
||||
return c*(t/=d)*t + b;
|
||||
}
|
||||
|
||||
/**
|
||||
* Easing equation function for a quadratic (t^2) easing out: decelerating to zero velocity.
|
||||
*
|
||||
* @param t Current time (in frames or seconds).
|
||||
* @param b Starting value.
|
||||
* @param c Change needed in value.
|
||||
* @param d Expected easing duration (in frames or seconds).
|
||||
* @return The correct value.
|
||||
*/
|
||||
public static function easeOutQuad (t:Number, b:Number, c:Number, d:Number, p_params:Object = null):Number {
|
||||
return -c *(t/=d)*(t-2) + b;
|
||||
}
|
||||
|
||||
/**
|
||||
* Easing equation function for a quadratic (t^2) easing in/out: acceleration until halfway, then deceleration.
|
||||
*
|
||||
* @param t Current time (in frames or seconds).
|
||||
* @param b Starting value.
|
||||
* @param c Change needed in value.
|
||||
* @param d Expected easing duration (in frames or seconds).
|
||||
* @return The correct value.
|
||||
*/
|
||||
public static function easeInOutQuad (t:Number, b:Number, c:Number, d:Number, p_params:Object = null):Number {
|
||||
if ((t/=d/2) < 1) return c/2*t*t + b;
|
||||
return -c/2 * ((--t)*(t-2) - 1) + b;
|
||||
}
|
||||
|
||||
/**
|
||||
* Easing equation function for a quadratic (t^2) easing out/in: deceleration until halfway, then acceleration.
|
||||
*
|
||||
* @param t Current time (in frames or seconds).
|
||||
* @param b Starting value.
|
||||
* @param c Change needed in value.
|
||||
* @param d Expected easing duration (in frames or seconds).
|
||||
* @return The correct value.
|
||||
*/
|
||||
public static function easeOutInQuad (t:Number, b:Number, c:Number, d:Number, p_params:Object = null):Number {
|
||||
if (t < d/2) return easeOutQuad (t*2, b, c/2, d, p_params);
|
||||
return easeInQuad((t*2)-d, b+c/2, c/2, d, p_params);
|
||||
}
|
||||
|
||||
/**
|
||||
* Easing equation function for a cubic (t^3) easing in: accelerating from zero velocity.
|
||||
*
|
||||
* @param t Current time (in frames or seconds).
|
||||
* @param b Starting value.
|
||||
* @param c Change needed in value.
|
||||
* @param d Expected easing duration (in frames or seconds).
|
||||
* @return The correct value.
|
||||
*/
|
||||
public static function easeInCubic (t:Number, b:Number, c:Number, d:Number, p_params:Object = null):Number {
|
||||
return c*(t/=d)*t*t + b;
|
||||
}
|
||||
|
||||
/**
|
||||
* Easing equation function for a cubic (t^3) easing out: decelerating from zero velocity.
|
||||
*
|
||||
* @param t Current time (in frames or seconds).
|
||||
* @param b Starting value.
|
||||
* @param c Change needed in value.
|
||||
* @param d Expected easing duration (in frames or seconds).
|
||||
* @return The correct value.
|
||||
*/
|
||||
public static function easeOutCubic (t:Number, b:Number, c:Number, d:Number, p_params:Object = null):Number {
|
||||
return c*((t=t/d-1)*t*t + 1) + b;
|
||||
}
|
||||
|
||||
/**
|
||||
* Easing equation function for a cubic (t^3) easing in/out: acceleration until halfway, then deceleration.
|
||||
*
|
||||
* @param t Current time (in frames or seconds).
|
||||
* @param b Starting value.
|
||||
* @param c Change needed in value.
|
||||
* @param d Expected easing duration (in frames or seconds).
|
||||
* @return The correct value.
|
||||
*/
|
||||
public static function easeInOutCubic (t:Number, b:Number, c:Number, d:Number, p_params:Object = null):Number {
|
||||
if ((t/=d/2) < 1) return c/2*t*t*t + b;
|
||||
return c/2*((t-=2)*t*t + 2) + b;
|
||||
}
|
||||
|
||||
/**
|
||||
* Easing equation function for a cubic (t^3) easing out/in: deceleration until halfway, then acceleration.
|
||||
*
|
||||
* @param t Current time (in frames or seconds).
|
||||
* @param b Starting value.
|
||||
* @param c Change needed in value.
|
||||
* @param d Expected easing duration (in frames or seconds).
|
||||
* @return The correct value.
|
||||
*/
|
||||
public static function easeOutInCubic (t:Number, b:Number, c:Number, d:Number, p_params:Object = null):Number {
|
||||
if (t < d/2) return easeOutCubic (t*2, b, c/2, d, p_params);
|
||||
return easeInCubic((t*2)-d, b+c/2, c/2, d, p_params);
|
||||
}
|
||||
|
||||
/**
|
||||
* Easing equation function for a quartic (t^4) easing in: accelerating from zero velocity.
|
||||
*
|
||||
* @param t Current time (in frames or seconds).
|
||||
* @param b Starting value.
|
||||
* @param c Change needed in value.
|
||||
* @param d Expected easing duration (in frames or seconds).
|
||||
* @return The correct value.
|
||||
*/
|
||||
public static function easeInQuart (t:Number, b:Number, c:Number, d:Number, p_params:Object = null):Number {
|
||||
return c*(t/=d)*t*t*t + b;
|
||||
}
|
||||
|
||||
/**
|
||||
* Easing equation function for a quartic (t^4) easing out: decelerating from zero velocity.
|
||||
*
|
||||
* @param t Current time (in frames or seconds).
|
||||
* @param b Starting value.
|
||||
* @param c Change needed in value.
|
||||
* @param d Expected easing duration (in frames or seconds).
|
||||
* @return The correct value.
|
||||
*/
|
||||
public static function easeOutQuart (t:Number, b:Number, c:Number, d:Number, p_params:Object = null):Number {
|
||||
return -c * ((t=t/d-1)*t*t*t - 1) + b;
|
||||
}
|
||||
|
||||
/**
|
||||
* Easing equation function for a quartic (t^4) easing in/out: acceleration until halfway, then deceleration.
|
||||
*
|
||||
* @param t Current time (in frames or seconds).
|
||||
* @param b Starting value.
|
||||
* @param c Change needed in value.
|
||||
* @param d Expected easing duration (in frames or seconds).
|
||||
* @return The correct value.
|
||||
*/
|
||||
public static function easeInOutQuart (t:Number, b:Number, c:Number, d:Number, p_params:Object = null):Number {
|
||||
if ((t/=d/2) < 1) return c/2*t*t*t*t + b;
|
||||
return -c/2 * ((t-=2)*t*t*t - 2) + b;
|
||||
}
|
||||
|
||||
/**
|
||||
* Easing equation function for a quartic (t^4) easing out/in: deceleration until halfway, then acceleration.
|
||||
*
|
||||
* @param t Current time (in frames or seconds).
|
||||
* @param b Starting value.
|
||||
* @param c Change needed in value.
|
||||
* @param d Expected easing duration (in frames or seconds).
|
||||
* @return The correct value.
|
||||
*/
|
||||
public static function easeOutInQuart (t:Number, b:Number, c:Number, d:Number, p_params:Object = null):Number {
|
||||
if (t < d/2) return easeOutQuart (t*2, b, c/2, d, p_params);
|
||||
return easeInQuart((t*2)-d, b+c/2, c/2, d, p_params);
|
||||
}
|
||||
|
||||
/**
|
||||
* Easing equation function for a quintic (t^5) easing in: accelerating from zero velocity.
|
||||
*
|
||||
* @param t Current time (in frames or seconds).
|
||||
* @param b Starting value.
|
||||
* @param c Change needed in value.
|
||||
* @param d Expected easing duration (in frames or seconds).
|
||||
* @return The correct value.
|
||||
*/
|
||||
public static function easeInQuint (t:Number, b:Number, c:Number, d:Number, p_params:Object = null):Number {
|
||||
return c*(t/=d)*t*t*t*t + b;
|
||||
}
|
||||
|
||||
/**
|
||||
* Easing equation function for a quintic (t^5) easing out: decelerating from zero velocity.
|
||||
*
|
||||
* @param t Current time (in frames or seconds).
|
||||
* @param b Starting value.
|
||||
* @param c Change needed in value.
|
||||
* @param d Expected easing duration (in frames or seconds).
|
||||
* @return The correct value.
|
||||
*/
|
||||
public static function easeOutQuint (t:Number, b:Number, c:Number, d:Number, p_params:Object = null):Number {
|
||||
return c*((t=t/d-1)*t*t*t*t + 1) + b;
|
||||
}
|
||||
|
||||
/**
|
||||
* Easing equation function for a quintic (t^5) easing in/out: acceleration until halfway, then deceleration.
|
||||
*
|
||||
* @param t Current time (in frames or seconds).
|
||||
* @param b Starting value.
|
||||
* @param c Change needed in value.
|
||||
* @param d Expected easing duration (in frames or seconds).
|
||||
* @return The correct value.
|
||||
*/
|
||||
public static function easeInOutQuint (t:Number, b:Number, c:Number, d:Number, p_params:Object = null):Number {
|
||||
if ((t/=d/2) < 1) return c/2*t*t*t*t*t + b;
|
||||
return c/2*((t-=2)*t*t*t*t + 2) + b;
|
||||
}
|
||||
|
||||
/**
|
||||
* Easing equation function for a quintic (t^5) easing out/in: deceleration until halfway, then acceleration.
|
||||
*
|
||||
* @param t Current time (in frames or seconds).
|
||||
* @param b Starting value.
|
||||
* @param c Change needed in value.
|
||||
* @param d Expected easing duration (in frames or seconds).
|
||||
* @return The correct value.
|
||||
*/
|
||||
public static function easeOutInQuint (t:Number, b:Number, c:Number, d:Number, p_params:Object = null):Number {
|
||||
if (t < d/2) return easeOutQuint (t*2, b, c/2, d, p_params);
|
||||
return easeInQuint((t*2)-d, b+c/2, c/2, d, p_params);
|
||||
}
|
||||
|
||||
/**
|
||||
* Easing equation function for a sinusoidal (sin(t)) easing in: accelerating from zero velocity.
|
||||
*
|
||||
* @param t Current time (in frames or seconds).
|
||||
* @param b Starting value.
|
||||
* @param c Change needed in value.
|
||||
* @param d Expected easing duration (in frames or seconds).
|
||||
* @return The correct value.
|
||||
*/
|
||||
public static function easeInSine (t:Number, b:Number, c:Number, d:Number, p_params:Object = null):Number {
|
||||
return -c * Math.cos(t/d * (Math.PI/2)) + c + b;
|
||||
}
|
||||
|
||||
/**
|
||||
* Easing equation function for a sinusoidal (sin(t)) easing out: decelerating from zero velocity.
|
||||
*
|
||||
* @param t Current time (in frames or seconds).
|
||||
* @param b Starting value.
|
||||
* @param c Change needed in value.
|
||||
* @param d Expected easing duration (in frames or seconds).
|
||||
* @return The correct value.
|
||||
*/
|
||||
public static function easeOutSine (t:Number, b:Number, c:Number, d:Number, p_params:Object = null):Number {
|
||||
return c * Math.sin(t/d * (Math.PI/2)) + b;
|
||||
}
|
||||
|
||||
/**
|
||||
* Easing equation function for a sinusoidal (sin(t)) easing in/out: acceleration until halfway, then deceleration.
|
||||
*
|
||||
* @param t Current time (in frames or seconds).
|
||||
* @param b Starting value.
|
||||
* @param c Change needed in value.
|
||||
* @param d Expected easing duration (in frames or seconds).
|
||||
* @return The correct value.
|
||||
*/
|
||||
public static function easeInOutSine (t:Number, b:Number, c:Number, d:Number, p_params:Object = null):Number {
|
||||
return -c/2 * (Math.cos(Math.PI*t/d) - 1) + b;
|
||||
}
|
||||
|
||||
/**
|
||||
* Easing equation function for a sinusoidal (sin(t)) easing out/in: deceleration until halfway, then acceleration.
|
||||
*
|
||||
* @param t Current time (in frames or seconds).
|
||||
* @param b Starting value.
|
||||
* @param c Change needed in value.
|
||||
* @param d Expected easing duration (in frames or seconds).
|
||||
* @return The correct value.
|
||||
*/
|
||||
public static function easeOutInSine (t:Number, b:Number, c:Number, d:Number, p_params:Object = null):Number {
|
||||
if (t < d/2) return easeOutSine (t*2, b, c/2, d, p_params);
|
||||
return easeInSine((t*2)-d, b+c/2, c/2, d, p_params);
|
||||
}
|
||||
|
||||
/**
|
||||
* Easing equation function for an exponential (2^t) easing in: accelerating from zero velocity.
|
||||
*
|
||||
* @param t Current time (in frames or seconds).
|
||||
* @param b Starting value.
|
||||
* @param c Change needed in value.
|
||||
* @param d Expected easing duration (in frames or seconds).
|
||||
* @return The correct value.
|
||||
*/
|
||||
public static function easeInExpo (t:Number, b:Number, c:Number, d:Number, p_params:Object = null):Number {
|
||||
return (t==0) ? b : c * Math.pow(2, 10 * (t/d - 1)) + b - c * 0.001;
|
||||
}
|
||||
|
||||
/**
|
||||
* Easing equation function for an exponential (2^t) easing out: decelerating from zero velocity.
|
||||
*
|
||||
* @param t Current time (in frames or seconds).
|
||||
* @param b Starting value.
|
||||
* @param c Change needed in value.
|
||||
* @param d Expected easing duration (in frames or seconds).
|
||||
* @return The correct value.
|
||||
*/
|
||||
public static function easeOutExpo (t:Number, b:Number, c:Number, d:Number, p_params:Object = null):Number {
|
||||
return (t==d) ? b+c : c * 1.001 * (-Math.pow(2, -10 * t/d) + 1) + b;
|
||||
}
|
||||
|
||||
/**
|
||||
* Easing equation function for an exponential (2^t) easing in/out: acceleration until halfway, then deceleration.
|
||||
*
|
||||
* @param t Current time (in frames or seconds).
|
||||
* @param b Starting value.
|
||||
* @param c Change needed in value.
|
||||
* @param d Expected easing duration (in frames or seconds).
|
||||
* @return The correct value.
|
||||
*/
|
||||
public static function easeInOutExpo (t:Number, b:Number, c:Number, d:Number, p_params:Object = null):Number {
|
||||
if (t==0) return b;
|
||||
if (t==d) return b+c;
|
||||
if ((t/=d/2) < 1) return c/2 * Math.pow(2, 10 * (t - 1)) + b - c * 0.0005;
|
||||
return c/2 * 1.0005 * (-Math.pow(2, -10 * --t) + 2) + b;
|
||||
}
|
||||
|
||||
/**
|
||||
* Easing equation function for an exponential (2^t) easing out/in: deceleration until halfway, then acceleration.
|
||||
*
|
||||
* @param t Current time (in frames or seconds).
|
||||
* @param b Starting value.
|
||||
* @param c Change needed in value.
|
||||
* @param d Expected easing duration (in frames or seconds).
|
||||
* @return The correct value.
|
||||
*/
|
||||
public static function easeOutInExpo (t:Number, b:Number, c:Number, d:Number, p_params:Object = null):Number {
|
||||
if (t < d/2) return easeOutExpo (t*2, b, c/2, d, p_params);
|
||||
return easeInExpo((t*2)-d, b+c/2, c/2, d, p_params);
|
||||
}
|
||||
|
||||
/**
|
||||
* Easing equation function for a circular (sqrt(1-t^2)) easing in: accelerating from zero velocity.
|
||||
*
|
||||
* @param t Current time (in frames or seconds).
|
||||
* @param b Starting value.
|
||||
* @param c Change needed in value.
|
||||
* @param d Expected easing duration (in frames or seconds).
|
||||
* @return The correct value.
|
||||
*/
|
||||
public static function easeInCirc (t:Number, b:Number, c:Number, d:Number, p_params:Object = null):Number {
|
||||
return -c * (Math.sqrt(1 - (t/=d)*t) - 1) + b;
|
||||
}
|
||||
|
||||
/**
|
||||
* Easing equation function for a circular (sqrt(1-t^2)) easing out: decelerating from zero velocity.
|
||||
*
|
||||
* @param t Current time (in frames or seconds).
|
||||
* @param b Starting value.
|
||||
* @param c Change needed in value.
|
||||
* @param d Expected easing duration (in frames or seconds).
|
||||
* @return The correct value.
|
||||
*/
|
||||
public static function easeOutCirc (t:Number, b:Number, c:Number, d:Number, p_params:Object = null):Number {
|
||||
return c * Math.sqrt(1 - (t=t/d-1)*t) + b;
|
||||
}
|
||||
|
||||
/**
|
||||
* Easing equation function for a circular (sqrt(1-t^2)) easing in/out: acceleration until halfway, then deceleration.
|
||||
*
|
||||
* @param t Current time (in frames or seconds).
|
||||
* @param b Starting value.
|
||||
* @param c Change needed in value.
|
||||
* @param d Expected easing duration (in frames or seconds).
|
||||
* @return The correct value.
|
||||
*/
|
||||
public static function easeInOutCirc (t:Number, b:Number, c:Number, d:Number, p_params:Object = null):Number {
|
||||
if ((t/=d/2) < 1) return -c/2 * (Math.sqrt(1 - t*t) - 1) + b;
|
||||
return c/2 * (Math.sqrt(1 - (t-=2)*t) + 1) + b;
|
||||
}
|
||||
|
||||
/**
|
||||
* Easing equation function for a circular (sqrt(1-t^2)) easing out/in: deceleration until halfway, then acceleration.
|
||||
*
|
||||
* @param t Current time (in frames or seconds).
|
||||
* @param b Starting value.
|
||||
* @param c Change needed in value.
|
||||
* @param d Expected easing duration (in frames or seconds).
|
||||
* @return The correct value.
|
||||
*/
|
||||
public static function easeOutInCirc (t:Number, b:Number, c:Number, d:Number, p_params:Object = null):Number {
|
||||
if (t < d/2) return easeOutCirc (t*2, b, c/2, d, p_params);
|
||||
return easeInCirc((t*2)-d, b+c/2, c/2, d, p_params);
|
||||
}
|
||||
|
||||
/**
|
||||
* Easing equation function for an elastic (exponentially decaying sine wave) easing in: accelerating from zero velocity.
|
||||
*
|
||||
* @param t Current time (in frames or seconds).
|
||||
* @param b Starting value.
|
||||
* @param c Change needed in value.
|
||||
* @param d Expected easing duration (in frames or seconds).
|
||||
* @param a Amplitude.
|
||||
* @param p Period.
|
||||
* @return The correct value.
|
||||
*/
|
||||
public static function easeInElastic (t:Number, b:Number, c:Number, d:Number, p_params:Object = null):Number {
|
||||
if (t==0) return b;
|
||||
if ((t/=d)==1) return b+c;
|
||||
var p:Number = !Boolean(p_params) || isNaN(p_params.period) ? d*.3 : p_params.period;
|
||||
var s:Number;
|
||||
var a:Number = !Boolean(p_params) || isNaN(p_params.amplitude) ? 0 : p_params.amplitude;
|
||||
if (!Boolean(a) || a < Math.abs(c)) {
|
||||
a = c;
|
||||
s = p/4;
|
||||
} else {
|
||||
s = p/(2*Math.PI) * Math.asin (c/a);
|
||||
}
|
||||
return -(a*Math.pow(2,10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )) + b;
|
||||
}
|
||||
|
||||
/**
|
||||
* Easing equation function for an elastic (exponentially decaying sine wave) easing out: decelerating from zero velocity.
|
||||
*
|
||||
* @param t Current time (in frames or seconds).
|
||||
* @param b Starting value.
|
||||
* @param c Change needed in value.
|
||||
* @param d Expected easing duration (in frames or seconds).
|
||||
* @param a Amplitude.
|
||||
* @param p Period.
|
||||
* @return The correct value.
|
||||
*/
|
||||
public static function easeOutElastic (t:Number, b:Number, c:Number, d:Number, p_params:Object = null):Number {
|
||||
if (t==0) return b;
|
||||
if ((t/=d)==1) return b+c;
|
||||
var p:Number = !Boolean(p_params) || isNaN(p_params.period) ? d*.3 : p_params.period;
|
||||
var s:Number;
|
||||
var a:Number = !Boolean(p_params) || isNaN(p_params.amplitude) ? 0 : p_params.amplitude;
|
||||
if (!Boolean(a) || a < Math.abs(c)) {
|
||||
a = c;
|
||||
s = p/4;
|
||||
} else {
|
||||
s = p/(2*Math.PI) * Math.asin (c/a);
|
||||
}
|
||||
return (a*Math.pow(2,-10*t) * Math.sin( (t*d-s)*(2*Math.PI)/p ) + c + b);
|
||||
}
|
||||
|
||||
/**
|
||||
* Easing equation function for an elastic (exponentially decaying sine wave) easing in/out: acceleration until halfway, then deceleration.
|
||||
*
|
||||
* @param t Current time (in frames or seconds).
|
||||
* @param b Starting value.
|
||||
* @param c Change needed in value.
|
||||
* @param d Expected easing duration (in frames or seconds).
|
||||
* @param a Amplitude.
|
||||
* @param p Period.
|
||||
* @return The correct value.
|
||||
*/
|
||||
public static function easeInOutElastic (t:Number, b:Number, c:Number, d:Number, p_params:Object = null):Number {
|
||||
if (t==0) return b;
|
||||
if ((t/=d/2)==2) return b+c;
|
||||
var p:Number = !Boolean(p_params) || isNaN(p_params.period) ? d*(.3*1.5) : p_params.period;
|
||||
var s:Number;
|
||||
var a:Number = !Boolean(p_params) || isNaN(p_params.amplitude) ? 0 : p_params.amplitude;
|
||||
if (!Boolean(a) || a < Math.abs(c)) {
|
||||
a = c;
|
||||
s = p/4;
|
||||
} else {
|
||||
s = p/(2*Math.PI) * Math.asin (c/a);
|
||||
}
|
||||
if (t < 1) return -.5*(a*Math.pow(2,10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )) + b;
|
||||
return a*Math.pow(2,-10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )*.5 + c + b;
|
||||
}
|
||||
|
||||
/**
|
||||
* Easing equation function for an elastic (exponentially decaying sine wave) easing out/in: deceleration until halfway, then acceleration.
|
||||
*
|
||||
* @param t Current time (in frames or seconds).
|
||||
* @param b Starting value.
|
||||
* @param c Change needed in value.
|
||||
* @param d Expected easing duration (in frames or seconds).
|
||||
* @param a Amplitude.
|
||||
* @param p Period.
|
||||
* @return The correct value.
|
||||
*/
|
||||
public static function easeOutInElastic (t:Number, b:Number, c:Number, d:Number, p_params:Object = null):Number {
|
||||
if (t < d/2) return easeOutElastic (t*2, b, c/2, d, p_params);
|
||||
return easeInElastic((t*2)-d, b+c/2, c/2, d, p_params);
|
||||
}
|
||||
|
||||
/**
|
||||
* Easing equation function for a back (overshooting cubic easing: (s+1)*t^3 - s*t^2) easing in: accelerating from zero velocity.
|
||||
*
|
||||
* @param t Current time (in frames or seconds).
|
||||
* @param b Starting value.
|
||||
* @param c Change needed in value.
|
||||
* @param d Expected easing duration (in frames or seconds).
|
||||
* @param s Overshoot ammount: higher s means greater overshoot (0 produces cubic easing with no overshoot, and the default value of 1.70158 produces an overshoot of 10 percent).
|
||||
* @return The correct value.
|
||||
*/
|
||||
public static function easeInBack (t:Number, b:Number, c:Number, d:Number, p_params:Object = null):Number {
|
||||
var s:Number = !Boolean(p_params) || isNaN(p_params.overshoot) ? 1.70158 : p_params.overshoot;
|
||||
return c*(t/=d)*t*((s+1)*t - s) + b;
|
||||
}
|
||||
|
||||
/**
|
||||
* Easing equation function for a back (overshooting cubic easing: (s+1)*t^3 - s*t^2) easing out: decelerating from zero velocity.
|
||||
*
|
||||
* @param t Current time (in frames or seconds).
|
||||
* @param b Starting value.
|
||||
* @param c Change needed in value.
|
||||
* @param d Expected easing duration (in frames or seconds).
|
||||
* @param s Overshoot ammount: higher s means greater overshoot (0 produces cubic easing with no overshoot, and the default value of 1.70158 produces an overshoot of 10 percent).
|
||||
* @return The correct value.
|
||||
*/
|
||||
public static function easeOutBack (t:Number, b:Number, c:Number, d:Number, p_params:Object = null):Number {
|
||||
var s:Number = !Boolean(p_params) || isNaN(p_params.overshoot) ? 1.70158 : p_params.overshoot;
|
||||
return c*((t=t/d-1)*t*((s+1)*t + s) + 1) + b;
|
||||
}
|
||||
|
||||
/**
|
||||
* Easing equation function for a back (overshooting cubic easing: (s+1)*t^3 - s*t^2) easing in/out: acceleration until halfway, then deceleration.
|
||||
*
|
||||
* @param t Current time (in frames or seconds).
|
||||
* @param b Starting value.
|
||||
* @param c Change needed in value.
|
||||
* @param d Expected easing duration (in frames or seconds).
|
||||
* @param s Overshoot ammount: higher s means greater overshoot (0 produces cubic easing with no overshoot, and the default value of 1.70158 produces an overshoot of 10 percent).
|
||||
* @return The correct value.
|
||||
*/
|
||||
public static function easeInOutBack (t:Number, b:Number, c:Number, d:Number, p_params:Object = null):Number {
|
||||
var s:Number = !Boolean(p_params) || isNaN(p_params.overshoot) ? 1.70158 : p_params.overshoot;
|
||||
if ((t/=d/2) < 1) return c/2*(t*t*(((s*=(1.525))+1)*t - s)) + b;
|
||||
return c/2*((t-=2)*t*(((s*=(1.525))+1)*t + s) + 2) + b;
|
||||
}
|
||||
|
||||
/**
|
||||
* Easing equation function for a back (overshooting cubic easing: (s+1)*t^3 - s*t^2) easing out/in: deceleration until halfway, then acceleration.
|
||||
*
|
||||
* @param t Current time (in frames or seconds).
|
||||
* @param b Starting value.
|
||||
* @param c Change needed in value.
|
||||
* @param d Expected easing duration (in frames or seconds).
|
||||
* @param s Overshoot ammount: higher s means greater overshoot (0 produces cubic easing with no overshoot, and the default value of 1.70158 produces an overshoot of 10 percent).
|
||||
* @return The correct value.
|
||||
*/
|
||||
public static function easeOutInBack (t:Number, b:Number, c:Number, d:Number, p_params:Object = null):Number {
|
||||
if (t < d/2) return easeOutBack (t*2, b, c/2, d, p_params);
|
||||
return easeInBack((t*2)-d, b+c/2, c/2, d, p_params);
|
||||
}
|
||||
|
||||
/**
|
||||
* Easing equation function for a bounce (exponentially decaying parabolic bounce) easing in: accelerating from zero velocity.
|
||||
*
|
||||
* @param t Current time (in frames or seconds).
|
||||
* @param b Starting value.
|
||||
* @param c Change needed in value.
|
||||
* @param d Expected easing duration (in frames or seconds).
|
||||
* @return The correct value.
|
||||
*/
|
||||
public static function easeInBounce (t:Number, b:Number, c:Number, d:Number, p_params:Object = null):Number {
|
||||
return c - easeOutBounce (d-t, 0, c, d) + b;
|
||||
}
|
||||
|
||||
/**
|
||||
* Easing equation function for a bounce (exponentially decaying parabolic bounce) easing out: decelerating from zero velocity.
|
||||
*
|
||||
* @param t Current time (in frames or seconds).
|
||||
* @param b Starting value.
|
||||
* @param c Change needed in value.
|
||||
* @param d Expected easing duration (in frames or seconds).
|
||||
* @return The correct value.
|
||||
*/
|
||||
public static function easeOutBounce (t:Number, b:Number, c:Number, d:Number, p_params:Object = null):Number {
|
||||
if ((t/=d) < (1/2.75)) {
|
||||
return c*(7.5625*t*t) + b;
|
||||
} else if (t < (2/2.75)) {
|
||||
return c*(7.5625*(t-=(1.5/2.75))*t + .75) + b;
|
||||
} else if (t < (2.5/2.75)) {
|
||||
return c*(7.5625*(t-=(2.25/2.75))*t + .9375) + b;
|
||||
} else {
|
||||
return c*(7.5625*(t-=(2.625/2.75))*t + .984375) + b;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Easing equation function for a bounce (exponentially decaying parabolic bounce) easing in/out: acceleration until halfway, then deceleration.
|
||||
*
|
||||
* @param t Current time (in frames or seconds).
|
||||
* @param b Starting value.
|
||||
* @param c Change needed in value.
|
||||
* @param d Expected easing duration (in frames or seconds).
|
||||
* @return The correct value.
|
||||
*/
|
||||
public static function easeInOutBounce (t:Number, b:Number, c:Number, d:Number, p_params:Object = null):Number {
|
||||
if (t < d/2) return easeInBounce (t*2, 0, c, d) * .5 + b;
|
||||
else return easeOutBounce (t*2-d, 0, c, d) * .5 + c*.5 + b;
|
||||
}
|
||||
|
||||
/**
|
||||
* Easing equation function for a bounce (exponentially decaying parabolic bounce) easing out/in: deceleration until halfway, then acceleration.
|
||||
*
|
||||
* @param t Current time (in frames or seconds).
|
||||
* @param b Starting value.
|
||||
* @param c Change needed in value.
|
||||
* @param d Expected easing duration (in frames or seconds).
|
||||
* @return The correct value.
|
||||
*/
|
||||
public static function easeOutInBounce (t:Number, b:Number, c:Number, d:Number, p_params:Object = null):Number {
|
||||
if (t < d/2) return easeOutBounce (t*2, b, c/2, d, p_params);
|
||||
return easeInBounce((t*2)-d, b+c/2, c/2, d, p_params);
|
||||
}
|
||||
}
|
||||
}
|
@@ -1,90 +0,0 @@
|
||||
package caurina.transitions {
|
||||
|
||||
/**
|
||||
* PropertyInfoObj
|
||||
* An object containing the updating info for a given property (its starting value, and its final value)
|
||||
*
|
||||
* @author Zeh Fernando
|
||||
* @version 1.0.0
|
||||
* @private
|
||||
*/
|
||||
|
||||
public class PropertyInfoObj {
|
||||
|
||||
public var valueStart :Number; // Starting value of the tweening (null if not started yet)
|
||||
public var valueComplete :Number; // Final desired value
|
||||
public var originalValueComplete :Object; // Final desired value as declared initially
|
||||
public var arrayIndex :Number; // Index (if this is an array item)
|
||||
public var extra :Object; // Additional parameters, used by some special properties
|
||||
public var isSpecialProperty :Boolean; // Whether or not this is a special property instead of a direct one
|
||||
public var hasModifier :Boolean; // Whether or not it has a modifier function
|
||||
public var modifierFunction :Function; // Modifier function, if any
|
||||
public var modifierParameters :Array; // Additional array of modifier parameters
|
||||
|
||||
// ==================================================================================================================================
|
||||
// CONSTRUCTOR function -------------------------------------------------------------------------------------------------------------
|
||||
|
||||
/**
|
||||
* Initializes the basic PropertyInfoObj.
|
||||
*
|
||||
* @param p_valueStart Number Starting value of the tweening (null if not started yet)
|
||||
* @param p_valueComplete Number Final (desired) property value
|
||||
*/
|
||||
function PropertyInfoObj(p_valueStart:Number, p_valueComplete:Number, p_originalValueComplete:Object, p_arrayIndex:Number, p_extra:Object, p_isSpecialProperty:Boolean, p_modifierFunction:Function, p_modifierParameters:Array) {
|
||||
valueStart = p_valueStart;
|
||||
valueComplete = p_valueComplete;
|
||||
originalValueComplete = p_originalValueComplete;
|
||||
arrayIndex = p_arrayIndex;
|
||||
extra = p_extra;
|
||||
isSpecialProperty = p_isSpecialProperty;
|
||||
hasModifier = Boolean(p_modifierFunction);
|
||||
modifierFunction = p_modifierFunction;
|
||||
modifierParameters = p_modifierParameters;
|
||||
}
|
||||
|
||||
|
||||
// ==================================================================================================================================
|
||||
// OTHER functions ------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
/**
|
||||
* Clones this property info and returns the new PropertyInfoObj
|
||||
*
|
||||
* @param omitEvents Boolean Whether or not events such as onStart (and its parameters) should be omitted
|
||||
* @return TweenListObj A copy of this object
|
||||
*/
|
||||
public function clone():PropertyInfoObj {
|
||||
var nProperty:PropertyInfoObj = new PropertyInfoObj(valueStart, valueComplete, originalValueComplete, arrayIndex, extra, isSpecialProperty, modifierFunction, modifierParameters);
|
||||
return nProperty;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns this object described as a String.
|
||||
*
|
||||
* @return String The description of this object.
|
||||
*/
|
||||
public function toString():String {
|
||||
var returnStr:String = "\n[PropertyInfoObj ";
|
||||
returnStr += "valueStart:" + String(valueStart);
|
||||
returnStr += ", ";
|
||||
returnStr += "valueComplete:" + String(valueComplete);
|
||||
returnStr += ", ";
|
||||
returnStr += "originalValueComplete:" + String(originalValueComplete);
|
||||
returnStr += ", ";
|
||||
returnStr += "arrayIndex:" + String(arrayIndex);
|
||||
returnStr += ", ";
|
||||
returnStr += "extra:" + String(extra);
|
||||
returnStr += ", ";
|
||||
returnStr += "isSpecialProperty:" + String(isSpecialProperty);
|
||||
returnStr += ", ";
|
||||
returnStr += "hasModifier:" + String(hasModifier);
|
||||
returnStr += ", ";
|
||||
returnStr += "modifierFunction:" + String(modifierFunction);
|
||||
returnStr += ", ";
|
||||
returnStr += "modifierParameters:" + String(modifierParameters);
|
||||
returnStr += "]\n";
|
||||
return returnStr;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
@@ -1,49 +0,0 @@
|
||||
package caurina.transitions {
|
||||
|
||||
/**
|
||||
* SpecialProperty
|
||||
* A kind of a getter/setter for special properties
|
||||
*
|
||||
* @author Zeh Fernando
|
||||
* @version 1.0.0
|
||||
* @private
|
||||
*/
|
||||
|
||||
public class SpecialProperty {
|
||||
|
||||
public var getValue:Function; // (p_obj:Object, p_parameters:Array, p_extra:Object): Number
|
||||
public var setValue:Function; // (p_obj:Object, p_value:Number, p_parameters:Array, p_extra:Object): Void
|
||||
public var parameters:Array;
|
||||
public var preProcess:Function; // (p_obj:Object, p_parameters:Array, p_originalValueComplete:Object, p_extra:Object): Number
|
||||
|
||||
/**
|
||||
* Builds a new special property object.
|
||||
*
|
||||
* @param p_getFunction Function Reference to the function used to get the special property value
|
||||
* @param p_setFunction Function Reference to the function used to set the special property value
|
||||
*/
|
||||
public function SpecialProperty (p_getFunction:Function, p_setFunction:Function, p_parameters:Array = null, p_preProcessFunction:Function = null) {
|
||||
getValue = p_getFunction;
|
||||
setValue = p_setFunction;
|
||||
parameters = p_parameters;
|
||||
preProcess = p_preProcessFunction;
|
||||
}
|
||||
|
||||
/**
|
||||
* Converts the instance to a string that can be used when trace()ing the object
|
||||
*/
|
||||
public function toString():String {
|
||||
var value:String = "";
|
||||
value += "[SpecialProperty ";
|
||||
value += "getValue:"+String(getValue);
|
||||
value += ", ";
|
||||
value += "setValue:"+String(setValue);
|
||||
value += ", ";
|
||||
value += "parameters:"+String(parameters);
|
||||
value += ", ";
|
||||
value += "preProcess:"+String(preProcess);
|
||||
value += "]";
|
||||
return value;
|
||||
}
|
||||
}
|
||||
}
|
@@ -1,42 +0,0 @@
|
||||
package caurina.transitions {
|
||||
|
||||
/**
|
||||
* SpecialPropertyModifier
|
||||
* A special property which actually acts on other properties
|
||||
*
|
||||
* @author Zeh Fernando
|
||||
* @version 1.0.0
|
||||
* @private
|
||||
*/
|
||||
|
||||
public class SpecialPropertyModifier {
|
||||
|
||||
public var modifyValues:Function;
|
||||
public var getValue:Function;
|
||||
|
||||
/**
|
||||
* Builds a new special property modifier object.
|
||||
*
|
||||
* @param p_modifyFunction Function Function that returns the modifider parameters.
|
||||
*/
|
||||
public function SpecialPropertyModifier (p_modifyFunction:Function, p_getFunction:Function) {
|
||||
modifyValues = p_modifyFunction;
|
||||
getValue = p_getFunction;
|
||||
}
|
||||
|
||||
/**
|
||||
* Converts the instance to a string that can be used when trace()ing the object
|
||||
*/
|
||||
public function toString():String {
|
||||
var value:String = "";
|
||||
value += "[SpecialPropertyModifier ";
|
||||
value += "modifyValues:"+String(modifyValues);
|
||||
value += ", ";
|
||||
value += "getValue:"+String(getValue);
|
||||
value += "]";
|
||||
return value;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
@@ -1,42 +0,0 @@
|
||||
package caurina.transitions {
|
||||
|
||||
/**
|
||||
* SpecialPropertySplitter
|
||||
* A proxy setter for special properties
|
||||
*
|
||||
* @author Zeh Fernando
|
||||
* @version 1.0.0
|
||||
* @private
|
||||
*/
|
||||
|
||||
public class SpecialPropertySplitter {
|
||||
|
||||
public var parameters:Array;
|
||||
public var splitValues:Function;
|
||||
|
||||
/**
|
||||
* Builds a new group special property object.
|
||||
*
|
||||
* @param p_splitFunction Function Reference to the function used to split a value
|
||||
*/
|
||||
public function SpecialPropertySplitter (p_splitFunction:Function, p_parameters:Array) {
|
||||
splitValues = p_splitFunction;
|
||||
parameters = p_parameters;
|
||||
}
|
||||
|
||||
/**
|
||||
* Converts the instance to a string that can be used when trace()ing the object
|
||||
*/
|
||||
public function toString():String {
|
||||
var value:String = "";
|
||||
value += "[SpecialPropertySplitter ";
|
||||
value += "splitValues:"+String(splitValues); // .toString();
|
||||
value += ", ";
|
||||
value += "parameters:"+String(parameters);
|
||||
value += "]";
|
||||
return value;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
@@ -1,236 +0,0 @@
|
||||
package caurina.transitions {
|
||||
import caurina.transitions.AuxFunctions;
|
||||
/**
|
||||
* The tween list object. Stores all of the properties and information that pertain to individual tweens.
|
||||
*
|
||||
* @author Nate Chatellier, Zeh Fernando
|
||||
* @version 1.0.4
|
||||
* @private
|
||||
*/
|
||||
|
||||
public class TweenListObj {
|
||||
|
||||
public var scope :Object; // Object affected by this tweening
|
||||
public var properties :Object; // List of properties that are tweened (PropertyInfoObj instances)
|
||||
// .valueStart :Number // Initial value of the property
|
||||
// .valueComplete :Number // The value the property should have when completed
|
||||
public var timeStart :Number; // Time when this tweening should start
|
||||
public var timeComplete :Number; // Time when this tweening should end
|
||||
public var useFrames :Boolean; // Whether or not to use frames instead of time
|
||||
public var transition :Function; // Equation to control the transition animation
|
||||
public var transitionParams :Object; // Additional parameters for the transition
|
||||
public var onStart :Function; // Function to be executed on the object when the tween starts (once)
|
||||
public var onUpdate :Function; // Function to be executed on the object when the tween updates (several times)
|
||||
public var onComplete :Function; // Function to be executed on the object when the tween completes (once)
|
||||
public var onOverwrite :Function; // Function to be executed on the object when the tween is overwritten
|
||||
public var onError :Function; // Function to be executed if an error is thrown when tweener exectues a callback (onComplete, onUpdate etc)
|
||||
public var onStartParams :Array; // Array of parameters to be passed for the event
|
||||
public var onUpdateParams :Array; // Array of parameters to be passed for the event
|
||||
public var onCompleteParams :Array; // Array of parameters to be passed for the event
|
||||
public var onOverwriteParams :Array; // Array of parameters to be passed for the event
|
||||
public var onStartScope :Object; // Scope in which the event function is ran
|
||||
public var onUpdateScope :Object; // Scope in which the event function is ran
|
||||
public var onCompleteScope :Object; // Scope in which the event function is ran
|
||||
public var onOverwriteScope :Object; // Scope in which the event function is ran
|
||||
public var onErrorScope :Object; // Scope in which the event function is ran
|
||||
public var rounded :Boolean; // Use rounded values when updating
|
||||
public var isPaused :Boolean; // Whether or not this tween is paused
|
||||
public var timePaused :Number; // Time when this tween was paused
|
||||
public var isCaller :Boolean; // Whether or not this tween is a "caller" tween
|
||||
public var count :Number; // Number of times this caller should be called
|
||||
public var timesCalled :Number; // How many times the caller has already been called ("caller" tweens only)
|
||||
public var waitFrames :Boolean; // Whether or not this caller should wait at least one frame for each call execution ("caller" tweens only)
|
||||
public var skipUpdates :Number; // How many updates should be skipped (default = 0; 1 = update-skip-update-skip...)
|
||||
public var updatesSkipped :Number; // How many updates have already been skipped
|
||||
public var hasStarted :Boolean; // Whether or not this tween has already started
|
||||
|
||||
// ==================================================================================================================================
|
||||
// CONSTRUCTOR function -------------------------------------------------------------------------------------------------------------
|
||||
|
||||
/**
|
||||
* Initializes the basic TweenListObj.
|
||||
*
|
||||
* @param p_scope Object Object affected by this tweening
|
||||
* @param p_timeStart Number Time when this tweening should start
|
||||
* @param p_timeComplete Number Time when this tweening should end
|
||||
* @param p_useFrames Boolean Whether or not to use frames instead of time
|
||||
* @param p_transition Function Equation to control the transition animation
|
||||
*/
|
||||
function TweenListObj(p_scope:Object, p_timeStart:Number, p_timeComplete:Number, p_useFrames:Boolean, p_transition:Function, p_transitionParams:Object) {
|
||||
scope = p_scope;
|
||||
timeStart = p_timeStart;
|
||||
timeComplete = p_timeComplete;
|
||||
useFrames = p_useFrames;
|
||||
transition = p_transition;
|
||||
transitionParams = p_transitionParams;
|
||||
|
||||
// Other default information
|
||||
properties = new Object();
|
||||
isPaused = false;
|
||||
timePaused = undefined;
|
||||
isCaller = false;
|
||||
updatesSkipped = 0;
|
||||
timesCalled = 0;
|
||||
skipUpdates = 0;
|
||||
hasStarted = false;
|
||||
}
|
||||
|
||||
|
||||
// ==================================================================================================================================
|
||||
// OTHER functions ------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
/**
|
||||
* Clones this tweening and returns the new TweenListObj
|
||||
*
|
||||
* @param omitEvents Boolean Whether or not events such as onStart (and its parameters) should be omitted
|
||||
* @return TweenListObj A copy of this object
|
||||
*/
|
||||
public function clone(omitEvents:Boolean):TweenListObj {
|
||||
var nTween:TweenListObj = new TweenListObj(scope, timeStart, timeComplete, useFrames, transition, transitionParams);
|
||||
nTween.properties = new Array();
|
||||
for (var pName:String in properties) {
|
||||
nTween.properties[pName] = properties[pName].clone();
|
||||
}
|
||||
nTween.skipUpdates = skipUpdates;
|
||||
nTween.updatesSkipped = updatesSkipped;
|
||||
if (!omitEvents) {
|
||||
nTween.onStart = onStart;
|
||||
nTween.onUpdate = onUpdate;
|
||||
nTween.onComplete = onComplete;
|
||||
nTween.onOverwrite = onOverwrite;
|
||||
nTween.onError = onError;
|
||||
nTween.onStartParams = onStartParams;
|
||||
nTween.onUpdateParams = onUpdateParams;
|
||||
nTween.onCompleteParams = onCompleteParams;
|
||||
nTween.onOverwriteParams = onOverwriteParams;
|
||||
nTween.onStartScope = onStartScope;
|
||||
nTween.onUpdateScope = onUpdateScope;
|
||||
nTween.onCompleteScope = onCompleteScope;
|
||||
nTween.onOverwriteScope = onOverwriteScope;
|
||||
nTween.onErrorScope = onErrorScope;
|
||||
}
|
||||
nTween.rounded = rounded;
|
||||
nTween.isPaused = isPaused;
|
||||
nTween.timePaused = timePaused;
|
||||
nTween.isCaller = isCaller;
|
||||
nTween.count = count;
|
||||
nTween.timesCalled = timesCalled;
|
||||
nTween.waitFrames = waitFrames;
|
||||
nTween.hasStarted = hasStarted;
|
||||
|
||||
return nTween;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns this object described as a String.
|
||||
*
|
||||
* @return String The description of this object.
|
||||
*/
|
||||
public function toString():String {
|
||||
var returnStr:String = "\n[TweenListObj ";
|
||||
returnStr += "scope:" + String(scope);
|
||||
returnStr += ", properties:";
|
||||
var isFirst:Boolean = true;
|
||||
for (var i:String in properties) {
|
||||
if (!isFirst) returnStr += ",";
|
||||
returnStr += "[name:"+properties[i].name;
|
||||
returnStr += ",valueStart:"+properties[i].valueStart;
|
||||
returnStr += ",valueComplete:"+properties[i].valueComplete;
|
||||
returnStr += "]";
|
||||
isFirst = false;
|
||||
}
|
||||
returnStr += ", timeStart:" + String(timeStart);
|
||||
returnStr += ", timeComplete:" + String(timeComplete);
|
||||
returnStr += ", useFrames:" + String(useFrames);
|
||||
returnStr += ", transition:" + String(transition);
|
||||
returnStr += ", transitionParams:" + String(transitionParams);
|
||||
|
||||
if (skipUpdates) returnStr += ", skipUpdates:" + String(skipUpdates);
|
||||
if (updatesSkipped) returnStr += ", updatesSkipped:" + String(updatesSkipped);
|
||||
|
||||
if (Boolean(onStart)) returnStr += ", onStart:" + String(onStart);
|
||||
if (Boolean(onUpdate)) returnStr += ", onUpdate:" + String(onUpdate);
|
||||
if (Boolean(onComplete)) returnStr += ", onComplete:" + String(onComplete);
|
||||
if (Boolean(onOverwrite)) returnStr += ", onOverwrite:" + String(onOverwrite);
|
||||
if (Boolean(onError)) returnStr += ", onError:" + String(onError);
|
||||
|
||||
if (onStartParams) returnStr += ", onStartParams:" + String(onStartParams);
|
||||
if (onUpdateParams) returnStr += ", onUpdateParams:" + String(onUpdateParams);
|
||||
if (onCompleteParams) returnStr += ", onCompleteParams:" + String(onCompleteParams);
|
||||
if (onOverwriteParams) returnStr += ", onOverwriteParams:" + String(onOverwriteParams);
|
||||
|
||||
if (onStartScope) returnStr += ", onStartScope:" + String(onStartScope);
|
||||
if (onUpdateScope) returnStr += ", onUpdateScope:" + String(onUpdateScope);
|
||||
if (onCompleteScope) returnStr += ", onCompleteScope:" + String(onCompleteScope);
|
||||
if (onOverwriteScope) returnStr += ", onOverwriteScope:" + String(onOverwriteScope);
|
||||
if (onErrorScope) returnStr += ", onErrorScope:" + String(onErrorScope);
|
||||
|
||||
if (rounded) returnStr += ", rounded:" + String(rounded);
|
||||
if (isPaused) returnStr += ", isPaused:" + String(isPaused);
|
||||
if (timePaused) returnStr += ", timePaused:" + String(timePaused);
|
||||
if (isCaller) returnStr += ", isCaller:" + String(isCaller);
|
||||
if (count) returnStr += ", count:" + String(count);
|
||||
if (timesCalled) returnStr += ", timesCalled:" + String(timesCalled);
|
||||
if (waitFrames) returnStr += ", waitFrames:" + String(waitFrames);
|
||||
if (hasStarted) returnStr += ", hasStarted:" + String(hasStarted);
|
||||
|
||||
returnStr += "]\n";
|
||||
return returnStr;
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks if p_obj "inherits" properties from other objects, as set by the "base" property. Will create a new object, leaving others intact.
|
||||
* o_bj.base can be an object or an array of objects. Properties are collected from the first to the last element of the "base" filed, with higher
|
||||
* indexes overwritting smaller ones. Does not modify any of the passed objects, but makes a shallow copy of all properties.
|
||||
*
|
||||
* @param p_obj Object Object that should be tweened: a movieclip, textfield, etc.. OR an array of objects
|
||||
* @return Object A new object with all properties from the p_obj and p_obj.base.
|
||||
*/
|
||||
|
||||
public static function makePropertiesChain(p_obj : Object) : Object{
|
||||
// Is this object inheriting properties from another object?
|
||||
var baseObject : Object = p_obj.base;
|
||||
if(baseObject){
|
||||
// object inherits. Are we inheriting from an object or an array
|
||||
var chainedObject : Object = {};
|
||||
var chain : Object;
|
||||
if (baseObject is Array){
|
||||
// Inheritance chain is the base array
|
||||
chain = [];
|
||||
// make a shallow copy
|
||||
for (var k : Number = 0 ; k< baseObject.length; k++) chain.push(baseObject[k]);
|
||||
}else{
|
||||
// Only one object to be added to the array
|
||||
chain = [baseObject];
|
||||
}
|
||||
// add the final object to the array, so it's properties are added last
|
||||
chain.push(p_obj);
|
||||
var currChainObj : Object;
|
||||
// Loops through each object adding it's property to the final object
|
||||
var len : Number = chain.length;
|
||||
for(var i : Number = 0; i < len ; i ++){
|
||||
if(chain[i]["base"]){
|
||||
// deal with recursion: watch the order! "parent" base must be concatenated first!
|
||||
currChainObj = AuxFunctions.concatObjects( makePropertiesChain(chain[i]["base"] ), chain[i]);
|
||||
}else{
|
||||
currChainObj = chain[i] ;
|
||||
}
|
||||
chainedObject = AuxFunctions.concatObjects(chainedObject, currChainObj );
|
||||
}
|
||||
if( chainedObject["base"]){
|
||||
delete chainedObject["base"];
|
||||
}
|
||||
return chainedObject;
|
||||
}else{
|
||||
// No inheritance, just return the object it self
|
||||
return p_obj;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
File diff suppressed because it is too large
Load Diff
@@ -1,479 +0,0 @@
|
||||
package caurina.transitions.properties {
|
||||
|
||||
/**
|
||||
* properties.ColorShortcuts
|
||||
* List of default special color properties (normal and splitter properties) for the Tweener class
|
||||
* The function names are strange/inverted because it makes for easier debugging (alphabetic order). They're only for internal use (on this class) anyways.
|
||||
*
|
||||
* @author Zeh Fernando, Nate Chatellier, Arthur Debert
|
||||
* @version 1.0.0
|
||||
*/
|
||||
|
||||
import flash.geom.ColorTransform;
|
||||
import flash.filters.ColorMatrixFilter;
|
||||
|
||||
import caurina.transitions.Tweener;
|
||||
import caurina.transitions.AuxFunctions;
|
||||
|
||||
public class ColorShortcuts {
|
||||
|
||||
// Sources:
|
||||
// http://www.graficaobscura.com/matrix/index.html
|
||||
// And mario Klingemann's ColorMatrix class as mentioned on the credits:
|
||||
// http://www.quasimondo.com/archives/000565.php
|
||||
|
||||
// Defines luminance using sRGB luminance
|
||||
private static var LUMINANCE_R:Number = 0.212671;
|
||||
private static var LUMINANCE_G:Number = 0.715160;
|
||||
private static var LUMINANCE_B:Number = 0.072169;
|
||||
|
||||
/**
|
||||
* There's no constructor.
|
||||
*/
|
||||
public function ColorShortcuts () {
|
||||
trace ("This is an static class and should not be instantiated.")
|
||||
}
|
||||
|
||||
/**
|
||||
* Registers all the special properties to the Tweener class, so the Tweener knows what to do with them.
|
||||
*/
|
||||
public static function init(): void {
|
||||
|
||||
// Normal properties
|
||||
Tweener.registerSpecialProperty("_color_ra", _oldColor_property_get, _oldColor_property_set, ["redMultiplier"]);
|
||||
Tweener.registerSpecialProperty("_color_rb", _color_property_get, _color_property_set, ["redOffset"]);
|
||||
Tweener.registerSpecialProperty("_color_ga", _oldColor_property_get, _oldColor_property_set, ["greenMultiplier"]);
|
||||
Tweener.registerSpecialProperty("_color_gb", _color_property_get, _color_property_set, ["greenOffset"]);
|
||||
Tweener.registerSpecialProperty("_color_ba", _oldColor_property_get, _oldColor_property_set, ["blueMultiplier"]);
|
||||
Tweener.registerSpecialProperty("_color_bb", _color_property_get, _color_property_set, ["blueOffset"]);
|
||||
Tweener.registerSpecialProperty("_color_aa", _oldColor_property_get, _oldColor_property_set, ["alphaMultiplier"]);
|
||||
Tweener.registerSpecialProperty("_color_ab", _color_property_get, _color_property_set, ["alphaOffset"]);
|
||||
|
||||
Tweener.registerSpecialProperty("_color_redMultiplier", _color_property_get, _color_property_set, ["redMultiplier"]);
|
||||
Tweener.registerSpecialProperty("_color_redOffset", _color_property_get, _color_property_set, ["redOffset"]);
|
||||
Tweener.registerSpecialProperty("_color_greenMultiplier", _color_property_get, _color_property_set, ["greenMultiplier"]);
|
||||
Tweener.registerSpecialProperty("_color_greenOffset", _color_property_get, _color_property_set, ["greenOffset"]);
|
||||
Tweener.registerSpecialProperty("_color_blueMultiplier", _color_property_get, _color_property_set, ["blueMultiplier"]);
|
||||
Tweener.registerSpecialProperty("_color_blueOffset", _color_property_get, _color_property_set, ["blueOffset"]);
|
||||
Tweener.registerSpecialProperty("_color_alphaMultiplier", _color_property_get, _color_property_set, ["alphaMultiplier"]);
|
||||
Tweener.registerSpecialProperty("_color_alphaOffset", _color_property_get, _color_property_set, ["alphaOffset"]);
|
||||
|
||||
// Normal splitter properties
|
||||
Tweener.registerSpecialPropertySplitter("_color", _color_splitter);
|
||||
Tweener.registerSpecialPropertySplitter("_colorTransform", _colorTransform_splitter);
|
||||
|
||||
// Color changes that depend on the ColorMatrixFilter
|
||||
Tweener.registerSpecialProperty("_brightness", _brightness_get, _brightness_set, [false]);
|
||||
Tweener.registerSpecialProperty("_tintBrightness", _brightness_get, _brightness_set, [true]);
|
||||
Tweener.registerSpecialProperty("_contrast", _contrast_get, _contrast_set);
|
||||
Tweener.registerSpecialProperty("_hue", _hue_get, _hue_set);
|
||||
Tweener.registerSpecialProperty("_saturation", _saturation_get, _saturation_set, [false]);
|
||||
Tweener.registerSpecialProperty("_dumbSaturation", _saturation_get, _saturation_set, [true]);
|
||||
|
||||
}
|
||||
|
||||
|
||||
// ==================================================================================================================================
|
||||
// PROPERTY GROUPING/SPLITTING functions --------------------------------------------------------------------------------------------
|
||||
|
||||
// ----------------------------------------------------------------------------------------------------------------------------------
|
||||
// _color
|
||||
|
||||
/**
|
||||
* Splits the _color parameter into specific color variables
|
||||
*
|
||||
* @param p_value Number The original _color value
|
||||
* @return Array An array containing the .name and .value of all new properties
|
||||
*/
|
||||
public static function _color_splitter (p_value:*, p_parameters:Array):Array {
|
||||
var nArray:Array = new Array();
|
||||
if (p_value == null) {
|
||||
// No parameter passed, so just resets the color
|
||||
nArray.push({name:"_color_redMultiplier", value:1});
|
||||
nArray.push({name:"_color_redOffset", value:0});
|
||||
nArray.push({name:"_color_greenMultiplier", value:1});
|
||||
nArray.push({name:"_color_greenOffset", value:0});
|
||||
nArray.push({name:"_color_blueMultiplier", value:1});
|
||||
nArray.push({name:"_color_blueOffset", value:0});
|
||||
} else {
|
||||
// A color tinting is passed, so converts it to the object values
|
||||
nArray.push({name:"_color_redMultiplier", value:0});
|
||||
nArray.push({name:"_color_redOffset", value:AuxFunctions.numberToR(p_value)});
|
||||
nArray.push({name:"_color_greenMultiplier", value:0});
|
||||
nArray.push({name:"_color_greenOffset", value:AuxFunctions.numberToG(p_value)});
|
||||
nArray.push({name:"_color_blueMultiplier", value:0});
|
||||
nArray.push({name:"_color_blueOffset", value:AuxFunctions.numberToB(p_value)});
|
||||
}
|
||||
return nArray;
|
||||
}
|
||||
|
||||
|
||||
// ----------------------------------------------------------------------------------------------------------------------------------
|
||||
// _colorTransform
|
||||
|
||||
/**
|
||||
* Splits the _colorTransform parameter into specific color variables
|
||||
*
|
||||
* @param p_value Number The original _colorTransform value
|
||||
* @return Array An array containing the .name and .value of all new properties
|
||||
*/
|
||||
public static function _colorTransform_splitter (p_value:Object, p_parameters:Array):Array {
|
||||
var nArray:Array = new Array();
|
||||
if (p_value == null) {
|
||||
// No parameter passed, so just resets the color
|
||||
nArray.push({name:"_color_redMultiplier", value:1});
|
||||
nArray.push({name:"_color_redOffset", value:0});
|
||||
nArray.push({name:"_color_greenMultiplier", value:1});
|
||||
nArray.push({name:"_color_greenOffset", value:0});
|
||||
nArray.push({name:"_color_blueMultiplier", value:1});
|
||||
nArray.push({name:"_color_blueOffset", value:0});
|
||||
} else {
|
||||
// A color tinting is passed, so converts it to the object values
|
||||
if (p_value.ra != undefined) nArray.push({name:"_color_ra", value:p_value.ra});
|
||||
if (p_value.rb != undefined) nArray.push({name:"_color_rb", value:p_value.rb});
|
||||
if (p_value.ga != undefined) nArray.push({name:"_color_ba", value:p_value.ba});
|
||||
if (p_value.gb != undefined) nArray.push({name:"_color_bb", value:p_value.bb});
|
||||
if (p_value.ba != undefined) nArray.push({name:"_color_ga", value:p_value.ga});
|
||||
if (p_value.bb != undefined) nArray.push({name:"_color_gb", value:p_value.gb});
|
||||
if (p_value.aa != undefined) nArray.push({name:"_color_aa", value:p_value.aa});
|
||||
if (p_value.ab != undefined) nArray.push({name:"_color_ab", value:p_value.ab});
|
||||
if (p_value.redMultiplier != undefined) nArray.push({name:"_color_redMultiplier", value:p_value.redMultiplier});
|
||||
if (p_value.redOffset != undefined) nArray.push({name:"_color_redOffset", value:p_value.redOffset});
|
||||
if (p_value.blueMultiplier != undefined) nArray.push({name:"_color_blueMultiplier", value:p_value.blueMultiplier});
|
||||
if (p_value.blueOffset != undefined) nArray.push({name:"_color_blueOffset", value:p_value.blueOffset});
|
||||
if (p_value.greenMultiplier != undefined) nArray.push({name:"_color_greenMultiplier", value:p_value.greenMultiplier});
|
||||
if (p_value.greenOffset != undefined) nArray.push({name:"_color_greenOffset", value:p_value.greenOffset});
|
||||
if (p_value.alphaMultiplier != undefined) nArray.push({name:"_color_alphaMultiplier", value:p_value.alphaMultiplier});
|
||||
if (p_value.alphaOffset != undefined) nArray.push({name:"_color_alphaOffset", value:p_value.alphaOffset});
|
||||
}
|
||||
return nArray;
|
||||
}
|
||||
|
||||
|
||||
// ==================================================================================================================================
|
||||
// NORMAL SPECIAL PROPERTY functions ------------------------------------------------------------------------------------------------
|
||||
|
||||
// ----------------------------------------------------------------------------------------------------------------------------------
|
||||
// _color_*
|
||||
|
||||
/**
|
||||
* _color_*
|
||||
* Generic function for the ra/rb/etc components of the deprecated colorTransform object
|
||||
*/
|
||||
public static function _oldColor_property_get (p_obj:Object, p_parameters:Array, p_extra:Object = null):Number {
|
||||
return p_obj.transform.colorTransform[p_parameters[0]] * 100;
|
||||
}
|
||||
public static function _oldColor_property_set (p_obj:Object, p_value:Number, p_parameters:Array, p_extra:Object = null): void {
|
||||
var tf:ColorTransform = p_obj.transform.colorTransform;
|
||||
tf[p_parameters[0]] = p_value / 100;
|
||||
p_obj.transform.colorTransform = tf;
|
||||
}
|
||||
|
||||
/**
|
||||
* _color_*
|
||||
* Generic function for the redMultiplier/redOffset/etc components of the new colorTransform
|
||||
*/
|
||||
public static function _color_property_get (p_obj:Object, p_parameters:Array, p_extra:Object = null):Number {
|
||||
return p_obj.transform.colorTransform[p_parameters[0]];
|
||||
}
|
||||
public static function _color_property_set (p_obj:Object, p_value:Number, p_parameters:Array, p_extra:Object = null): void {
|
||||
var cfm:ColorTransform = p_obj.transform.colorTransform;
|
||||
cfm[p_parameters[0]] = p_value;
|
||||
p_obj.transform.colorTransform = cfm;
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------------------------------------------------------------
|
||||
// Special coloring
|
||||
|
||||
/**
|
||||
* _brightness
|
||||
* Brightness of an object: -1 -> [0] -> +1
|
||||
*/
|
||||
public static function _brightness_get (p_obj:Object, p_parameters:Array, p_extra:Object = null):Number {
|
||||
|
||||
var isTint:Boolean = p_parameters[0];
|
||||
|
||||
/*
|
||||
// Using ColorMatrix:
|
||||
|
||||
var mtx:Array = getObjectMatrix(p_obj);
|
||||
|
||||
var mc:Number = 1 - ((mtx[0] + mtx[6] + mtx[12]) / 3); // Brightness as determined by the main channels
|
||||
var co:Number = (mtx[4] + mtx[9] + mtx[14]) / 3; // Brightness as determined by the offset channels
|
||||
*/
|
||||
|
||||
var cfm:ColorTransform = p_obj.transform.colorTransform;
|
||||
var mc:Number = 1 - ((cfm.redMultiplier + cfm.greenMultiplier + cfm.blueMultiplier) / 3); // Brightness as determined by the main channels
|
||||
var co:Number = (cfm.redOffset + cfm.greenOffset + cfm.blueOffset) / 3;
|
||||
|
||||
if (isTint) {
|
||||
// Tint style
|
||||
//return (mc+(co/255))/2;
|
||||
return co > 0 ? co / 255 : -mc;
|
||||
} else {
|
||||
// Native, Flash "Adjust Color" and Photoshop style
|
||||
return co / 100;
|
||||
}
|
||||
}
|
||||
public static function _brightness_set (p_obj:Object, p_value:Number, p_parameters:Array, p_extra:Object = null): void {
|
||||
//var mtx:Array = getObjectMatrix(p_obj);
|
||||
|
||||
var isTint:Boolean = p_parameters[0];
|
||||
|
||||
var mc:Number; // Main channel
|
||||
var co:Number; // Channel offset
|
||||
|
||||
if (isTint) {
|
||||
// Tint style
|
||||
mc = 1 - Math.abs(p_value);
|
||||
co = p_value > 0 ? Math.round(p_value*255) : 0;
|
||||
} else {
|
||||
// Native, Flash "Adjust Color" and Photoshop style
|
||||
mc = 1;
|
||||
co = Math.round(p_value*100);
|
||||
}
|
||||
|
||||
/*
|
||||
// Using ColorMatrix:
|
||||
var mtx:Array = [
|
||||
mc, cc, cc, cc, co,
|
||||
cc, mc, cc, cc, co,
|
||||
cc, cc, mc, cc, co,
|
||||
0, 0, 0, 1, 0
|
||||
];
|
||||
setObjectMatrix(p_obj, mtx);
|
||||
*/
|
||||
var cfm:ColorTransform = new ColorTransform(mc, mc, mc, 1, co, co, co, 0);
|
||||
p_obj.transform.colorTransform = cfm;
|
||||
}
|
||||
|
||||
/**
|
||||
* _saturation
|
||||
* Saturation of an object: 0 -> [1] -> 2
|
||||
*/
|
||||
public static function _saturation_get (p_obj:Object, p_parameters:Array, p_extra:Object = null):Number {
|
||||
|
||||
var mtx:Array = getObjectMatrix(p_obj);
|
||||
|
||||
var isDumb:Boolean = p_parameters[0];
|
||||
var rl:Number = isDumb ? 1/3 : LUMINANCE_R;
|
||||
var gl:Number = isDumb ? 1/3 : LUMINANCE_G;
|
||||
var bl:Number = isDumb ? 1/3 : LUMINANCE_B;
|
||||
|
||||
var mc:Number = ((mtx[0]-rl)/(1-rl) + (mtx[6]-gl)/(1-gl) + (mtx[12]-bl)/(1-bl)) / 3; // Color saturation as determined by the main channels
|
||||
var cc:Number = 1 - ((mtx[1]/gl + mtx[2]/bl + mtx[5]/rl + mtx[7]/bl + mtx[10]/rl + mtx[11]/gl) / 6); // Color saturation as determined by the other channels
|
||||
return (mc + cc) / 2;
|
||||
}
|
||||
public static function _saturation_set (p_obj:Object, p_value:Number, p_parameters:Array, p_extra:Object = null): void {
|
||||
|
||||
var isDumb:Boolean = p_parameters[0];
|
||||
var rl:Number = isDumb ? 1/3 : LUMINANCE_R;
|
||||
var gl:Number = isDumb ? 1/3 : LUMINANCE_G;
|
||||
var bl:Number = isDumb ? 1/3 : LUMINANCE_B;
|
||||
|
||||
var sf:Number = p_value;
|
||||
var nf:Number = 1-sf;
|
||||
var nr:Number = rl * nf;
|
||||
var ng:Number = gl * nf;
|
||||
var nb:Number = bl * nf;
|
||||
|
||||
var mtx:Array = [
|
||||
nr+sf, ng, nb, 0, 0,
|
||||
nr, ng+sf, nb, 0, 0,
|
||||
nr, ng, nb+sf, 0, 0,
|
||||
0, 0, 0, 1, 0
|
||||
];
|
||||
setObjectMatrix(p_obj, mtx);
|
||||
}
|
||||
|
||||
/**
|
||||
* _contrast
|
||||
* Contrast of an object: -1 -> [0] -> +1
|
||||
*/
|
||||
public static function _contrast_get (p_obj:Object, p_parameters:Array, p_extra:Object = null):Number {
|
||||
|
||||
/*
|
||||
// Using ColorMatrix:
|
||||
var mtx:Array = getObjectMatrix(p_obj);
|
||||
|
||||
var mc:Number = ((mtx[0] + mtx[6] + mtx[12]) / 3) - 1; // Contrast as determined by the main channels
|
||||
var co:Number = (mtx[4] + mtx[9] + mtx[14]) / 3 / -128; // Contrast as determined by the offset channel
|
||||
*/
|
||||
var cfm:ColorTransform = p_obj.transform.colorTransform;
|
||||
var mc:Number; // Contrast as determined by the main channels
|
||||
var co:Number; // Contrast as determined by the offset channel
|
||||
mc = ((cfm.redMultiplier + cfm.greenMultiplier + cfm.blueMultiplier) / 3) - 1;
|
||||
co = (cfm.redOffset + cfm.greenOffset + cfm.blueOffset) / 3 / -128;
|
||||
/*
|
||||
if (cfm.ra < 100) {
|
||||
// Low contrast
|
||||
mc = ((cfm.ra + cfm.ga + cfm.ba) / 300) - 1;
|
||||
co = (cfm.rb + cfm.gb + cfm.bb) / 3 / -128;
|
||||
} else {
|
||||
// High contrast
|
||||
mc = (((cfm.ra + cfm.ga + cfm.ba) / 300) - 1) / 37;
|
||||
co = (cfm.rb + cfm.gb + cfm.bb) / 3 / -3840;
|
||||
}
|
||||
*/
|
||||
|
||||
return (mc+co)/2;
|
||||
}
|
||||
public static function _contrast_set (p_obj:Object, p_value:Number, p_parameters:Array, p_extra:Object = null): void {
|
||||
|
||||
var mc:Number; // Main channel
|
||||
var co:Number; // Channel offset
|
||||
mc = p_value + 1;
|
||||
co = Math.round(p_value*-128);
|
||||
|
||||
/*
|
||||
if (p_value < 0) {
|
||||
// Low contrast
|
||||
mc = p_value + 1;
|
||||
co = Math.round(p_value*-128);
|
||||
} else {
|
||||
// High contrast
|
||||
mc = (p_value * 37) + 1;
|
||||
co = Math.round(p_value*-3840);
|
||||
}
|
||||
*/
|
||||
|
||||
// Flash: * 8, * -512
|
||||
|
||||
/*
|
||||
// Using ColorMatrix:
|
||||
var mtx:Array = [
|
||||
mc, 0, 0, 0, co,
|
||||
0, mc, 0, 0, co,
|
||||
0, 0, mc, 0, co,
|
||||
0, 0, 0, 1, 0
|
||||
];
|
||||
setObjectMatrix(p_obj, mtx);
|
||||
*/
|
||||
var cfm:ColorTransform = new ColorTransform(mc, mc, mc, 1, co, co, co, 0);
|
||||
p_obj.transform.colorTransform = cfm;
|
||||
}
|
||||
|
||||
/**
|
||||
* _hue
|
||||
* Hue of an object: -180 -> [0] -> 180
|
||||
*/
|
||||
public static function _hue_get (p_obj:Object, p_parameters:Array, p_extra:Object = null):Number {
|
||||
|
||||
var mtx:Array = getObjectMatrix(p_obj);
|
||||
|
||||
// Find the current Hue based on a given matrix.
|
||||
// This is a kind of a brute force method by sucessive division until a close enough angle is found.
|
||||
// Reverse-engineering the hue equation would be is a better choice, but it's hard to find material
|
||||
// on the correct calculation employed by Flash.
|
||||
// This code has to run only once (before the tween starts), so it's good enough.
|
||||
|
||||
var hues:Array = [];
|
||||
var i:Number;
|
||||
|
||||
hues[0] = {angle:-179.9, matrix:getHueMatrix(-179.9)};
|
||||
hues[1] = {angle:180, matrix:getHueMatrix(180)};
|
||||
|
||||
for (i = 0; i < hues.length; i++) {
|
||||
hues[i].distance = getHueDistance(mtx, hues[i].matrix);
|
||||
}
|
||||
|
||||
var maxTries:Number = 15; // Number o maximum divisions until the hue is found
|
||||
var angleToSplit:Number;
|
||||
|
||||
for (i = 0; i < maxTries; i++) {
|
||||
// Find the nearest angle
|
||||
if (hues[0].distance < hues[1].distance) {
|
||||
// First is closer
|
||||
angleToSplit = 1;
|
||||
} else {
|
||||
// Second is closer
|
||||
angleToSplit = 0;
|
||||
}
|
||||
hues[angleToSplit].angle = (hues[0].angle + hues[1].angle)/2;
|
||||
hues[angleToSplit].matrix = getHueMatrix(hues[angleToSplit].angle)
|
||||
hues[angleToSplit].distance = getHueDistance(mtx, hues[angleToSplit].matrix);
|
||||
}
|
||||
|
||||
return hues[angleToSplit].angle;
|
||||
}
|
||||
|
||||
public static function _hue_set (p_obj:Object, p_value:Number, p_parameters:Array, p_extra:Object = null): void {
|
||||
setObjectMatrix(p_obj, getHueMatrix(p_value));
|
||||
}
|
||||
|
||||
public static function getHueDistance (mtx1:Array, mtx2:Array): Number {
|
||||
return (Math.abs(mtx1[0] - mtx2[0]) + Math.abs(mtx1[1] - mtx2[1]) + Math.abs(mtx1[2] - mtx2[2]));
|
||||
}
|
||||
|
||||
public static function getHueMatrix (hue:Number): Array {
|
||||
var ha:Number = hue * Math.PI/180; // Hue angle, to radians
|
||||
|
||||
var rl:Number = LUMINANCE_R;
|
||||
var gl:Number = LUMINANCE_G;
|
||||
var bl:Number = LUMINANCE_B;
|
||||
|
||||
var c:Number = Math.cos(ha);
|
||||
var s:Number = Math.sin(ha);
|
||||
|
||||
var mtx:Array = [
|
||||
(rl + (c * (1 - rl))) + (s * (-rl)),
|
||||
(gl + (c * (-gl))) + (s * (-gl)),
|
||||
(bl + (c * (-bl))) + (s * (1 - bl)),
|
||||
0, 0,
|
||||
|
||||
(rl + (c * (-rl))) + (s * 0.143),
|
||||
(gl + (c * (1 - gl))) + (s * 0.14),
|
||||
(bl + (c * (-bl))) + (s * -0.283),
|
||||
0, 0,
|
||||
|
||||
(rl + (c * (-rl))) + (s * (-(1 - rl))),
|
||||
(gl + (c * (-gl))) + (s * gl),
|
||||
(bl + (c * (1 - bl))) + (s * bl),
|
||||
0, 0,
|
||||
|
||||
0, 0, 0, 1, 0
|
||||
];
|
||||
|
||||
return mtx;
|
||||
}
|
||||
|
||||
|
||||
// ==================================================================================================================================
|
||||
// AUXILIARY functions --------------------------------------------------------------------------------------------------------------
|
||||
|
||||
private static function getObjectMatrix(p_obj:Object): Array {
|
||||
// Get the current color matrix of an object
|
||||
for (var i:Number = 0; i < p_obj.filters.length; i++) {
|
||||
if (p_obj.filters[i] is ColorMatrixFilter) {
|
||||
return p_obj.filters[i].matrix.concat();
|
||||
}
|
||||
}
|
||||
return [
|
||||
1, 0, 0, 0, 0,
|
||||
0, 1, 0, 0, 0,
|
||||
0, 0, 1, 0, 0,
|
||||
0, 0, 0, 1, 0
|
||||
];
|
||||
}
|
||||
|
||||
private static function setObjectMatrix(p_obj:Object, p_matrix:Array): void {
|
||||
// Set the current color matrix of an object
|
||||
var objFilters:Array = p_obj.filters.concat();
|
||||
var found:Boolean = false;
|
||||
for (var i:Number = 0; i < objFilters.length; i++) {
|
||||
if (objFilters[i] is ColorMatrixFilter) {
|
||||
objFilters[i].matrix = p_matrix.concat();
|
||||
found = true;
|
||||
}
|
||||
}
|
||||
if (!found) {
|
||||
// Has to create a new color matrix filter
|
||||
var cmtx:ColorMatrixFilter = new ColorMatrixFilter(p_matrix);
|
||||
objFilters[objFilters.length] = cmtx;
|
||||
}
|
||||
p_obj.filters = objFilters;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
@@ -1,109 +0,0 @@
|
||||
package caurina.transitions.properties {
|
||||
|
||||
/**
|
||||
* properties.CurveModifiers
|
||||
* List of default special properties modifiers for the Tweener class
|
||||
* The function names are strange/inverted because it makes for easier debugging (alphabetic order). They're only for internal use (on this class) anyways.
|
||||
*
|
||||
* @author Zeh Fernando, Nate Chatellier, Arthur Debert
|
||||
* @version 1.0.0
|
||||
*/
|
||||
|
||||
import caurina.transitions.Tweener;
|
||||
|
||||
public class CurveModifiers {
|
||||
|
||||
/**
|
||||
* There's no constructor.
|
||||
*/
|
||||
public function CurveModifiers () {
|
||||
trace ("This is an static class and should not be instantiated.")
|
||||
}
|
||||
|
||||
/**
|
||||
* Registers all the special properties to the Tweener class, so the Tweener knows what to do with them.
|
||||
*/
|
||||
public static function init(): void {
|
||||
|
||||
// Bezier modifiers
|
||||
Tweener.registerSpecialPropertyModifier("_bezier", _bezier_modifier, _bezier_get);
|
||||
}
|
||||
|
||||
|
||||
// ==================================================================================================================================
|
||||
// SPECIAL PROPERTY MODIFIER functions ----------------------------------------------------------------------------------------------
|
||||
|
||||
// ----------------------------------------------------------------------------------------------------------------------------------
|
||||
// _bezier
|
||||
|
||||
/**
|
||||
* Given the parameter object passed to this special property, return an array listing the properties that should be modified, and their parameters
|
||||
*
|
||||
* @param p_obj Object Parameter passed to this property
|
||||
* @return Array Array listing name and parameter of each property
|
||||
*/
|
||||
public static function _bezier_modifier (p_obj:*):Array {
|
||||
var mList:Array = []; // List of properties to be modified
|
||||
var pList:Array; // List of parameters passed, normalized as an array
|
||||
if (p_obj is Array) {
|
||||
// Complex
|
||||
pList = p_obj;
|
||||
} else {
|
||||
pList = [p_obj];
|
||||
}
|
||||
|
||||
var i:uint;
|
||||
var istr:String;
|
||||
var mListObj:Object = {}; // Object describing each property name and parameter
|
||||
|
||||
for (i = 0; i < pList.length; i++) {
|
||||
for (istr in pList[i]) {
|
||||
if (mListObj[istr] == undefined) mListObj[istr] = [];
|
||||
mListObj[istr].push(pList[i][istr]);
|
||||
}
|
||||
}
|
||||
for (istr in mListObj) {
|
||||
mList.push({name:istr, parameters:mListObj[istr]});
|
||||
}
|
||||
return mList;
|
||||
}
|
||||
|
||||
/**
|
||||
* Given tweening specifications (beging, end, t), applies the property parameter to it, returning new t
|
||||
*
|
||||
* @param b Number Beginning value of the property
|
||||
* @param e Number Ending (desired) value of the property
|
||||
* @param t Number Current t of this tweening (0-1), after applying the easing equation
|
||||
* @param p Array Array of parameters passed to this specific property
|
||||
* @return Number New t, with the p parameters applied to it
|
||||
*/
|
||||
public static function _bezier_get (b:Number, e:Number, t:Number, p:Array):Number {
|
||||
// This is based on Robert Penner's code
|
||||
if (p.length == 1) {
|
||||
// Simple curve with just one bezier control point
|
||||
return b + t*(2*(1-t)*(p[0]-b) + t*(e - b));
|
||||
} else {
|
||||
// Array of bezier control points, must find the point between each pair of bezier points
|
||||
var ip:uint = Math.floor(t * p.length); // Position on the bezier list
|
||||
var it:Number = (t - (ip * (1 / p.length))) * p.length; // t inside this ip
|
||||
var p1:Number, p2:Number;
|
||||
if (ip == 0) {
|
||||
// First part: belongs to the first control point, find second midpoint
|
||||
p1 = b;
|
||||
p2 = (p[0]+p[1])/2;
|
||||
} else if (ip == p.length - 1) {
|
||||
// Last part: belongs to the last control point, find first midpoint
|
||||
p1 = (p[ip-1]+p[ip])/2;
|
||||
p2 = e;
|
||||
} else {
|
||||
// Any middle part: find both midpoints
|
||||
p1 = (p[ip-1]+p[ip])/2;
|
||||
p2 = (p[ip]+p[ip+1])/2;
|
||||
}
|
||||
return p1+it*(2*(1-it)*(p[ip]-p1) + it*(p2 - p1));
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
@@ -1,161 +0,0 @@
|
||||
package caurina.transitions.properties {
|
||||
|
||||
/**
|
||||
* properties.DisplayShortcuts.as
|
||||
* List of default special MovieClip properties (normal and splitter properties) for the Tweener class
|
||||
* The function names are strange/inverted because it makes for easier debugging (alphabetic order). They're only for internal use (on this class) anyways.
|
||||
*
|
||||
* @author Zeh Fernando, Nate Chatellier, Arthur Debert
|
||||
* @version 1.0.0
|
||||
*/
|
||||
|
||||
import flash.geom.Point;
|
||||
import flash.geom.Rectangle;
|
||||
|
||||
import caurina.transitions.Tweener;
|
||||
|
||||
public class DisplayShortcuts {
|
||||
|
||||
/**
|
||||
* There's no constructor.
|
||||
*/
|
||||
public function DisplayShortcuts () {
|
||||
trace ("This is an static class and should not be instantiated.")
|
||||
}
|
||||
|
||||
/**
|
||||
* Registers all the special properties to the Tweener class, so the Tweener knows what to do with them.
|
||||
*/
|
||||
public static function init(): void {
|
||||
|
||||
// Normal properties
|
||||
Tweener.registerSpecialProperty("_frame", _frame_get, _frame_set);
|
||||
Tweener.registerSpecialProperty("_autoAlpha", _autoAlpha_get, _autoAlpha_set);
|
||||
|
||||
// Scale splitter properties
|
||||
Tweener.registerSpecialPropertySplitter("_scale", _scale_splitter);
|
||||
|
||||
// scrollRect splitter properties
|
||||
Tweener.registerSpecialPropertySplitter("_scrollRect", _scrollRect_splitter);
|
||||
|
||||
// scrollrect normal properties
|
||||
Tweener.registerSpecialProperty("_scrollRect_x", _scrollRect_property_get, _scrollRect_property_set, ["x"]);
|
||||
Tweener.registerSpecialProperty("_scrollRect_y", _scrollRect_property_get, _scrollRect_property_set, ["y"]);
|
||||
Tweener.registerSpecialProperty("_scrollRect_left", _scrollRect_property_get, _scrollRect_property_set, ["left"]);
|
||||
Tweener.registerSpecialProperty("_scrollRect_right", _scrollRect_property_get, _scrollRect_property_set, ["right"]);
|
||||
Tweener.registerSpecialProperty("_scrollRect_top", _scrollRect_property_get, _scrollRect_property_set, ["top"]);
|
||||
Tweener.registerSpecialProperty("_scrollRect_bottom", _scrollRect_property_get, _scrollRect_property_set, ["bottom"]);
|
||||
Tweener.registerSpecialProperty("_scrollRect_width", _scrollRect_property_get, _scrollRect_property_set, ["width"]);
|
||||
Tweener.registerSpecialProperty("_scrollRect_height", _scrollRect_property_get, _scrollRect_property_set, ["height"]);
|
||||
|
||||
}
|
||||
|
||||
|
||||
// ==================================================================================================================================
|
||||
// PROPERTY GROUPING/SPLITTING functions --------------------------------------------------------------------------------------------
|
||||
|
||||
// ----------------------------------------------------------------------------------------------------------------------------------
|
||||
// scale
|
||||
public static function _scale_splitter(p_value:Number, p_parameters:Array) : Array{
|
||||
var nArray:Array = new Array();
|
||||
nArray.push({name:"scaleX", value: p_value});
|
||||
nArray.push({name:"scaleY", value: p_value});
|
||||
return nArray;
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------------------------------------------------------------
|
||||
// _scrollRect
|
||||
|
||||
/**
|
||||
* Splits the _scrollRect parameter into specific scrollRect variables
|
||||
*
|
||||
* @param p_value Rectangle The original _scrollRect rectangle
|
||||
* @return Array An array containing the .name and .value of all new properties
|
||||
*/
|
||||
public static function _scrollRect_splitter (p_value:Rectangle, p_parameters:Array, p_extra:Object = null):Array {
|
||||
var nArray:Array = new Array();
|
||||
if (p_value == null) {
|
||||
// No parameter passed, so try any rectangle :/
|
||||
nArray.push({name:"_scrollRect_x", value:0});
|
||||
nArray.push({name:"_scrollRect_y", value:0});
|
||||
nArray.push({name:"_scrollRect_width", value:100});
|
||||
nArray.push({name:"_scrollRect_height", value:100});
|
||||
} else {
|
||||
// A rectangle is passed, so just return the properties
|
||||
nArray.push({name:"_scrollRect_x", value:p_value.x});
|
||||
nArray.push({name:"_scrollRect_y", value:p_value.y});
|
||||
nArray.push({name:"_scrollRect_width", value:p_value.width});
|
||||
nArray.push({name:"_scrollRect_height", value:p_value.height});
|
||||
}
|
||||
return nArray;
|
||||
}
|
||||
|
||||
|
||||
// ==================================================================================================================================
|
||||
// NORMAL SPECIAL PROPERTY functions ------------------------------------------------------------------------------------------------
|
||||
|
||||
// ----------------------------------------------------------------------------------------------------------------------------------
|
||||
// _frame
|
||||
|
||||
/**
|
||||
* Returns the current frame number from the movieclip timeline
|
||||
*
|
||||
* @param p_obj Object MovieClip object
|
||||
* @return Number The current frame
|
||||
*/
|
||||
public static function _frame_get (p_obj:Object, p_parameters:Array, p_extra:Object = null):Number {
|
||||
return p_obj.currentFrame;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the timeline frame
|
||||
*
|
||||
* @param p_obj Object MovieClip object
|
||||
* @param p_value Number New frame number
|
||||
*/
|
||||
public static function _frame_set (p_obj:Object, p_value:Number, p_parameters:Array, p_extra:Object = null): void {
|
||||
p_obj.gotoAndStop(Math.round(p_value));
|
||||
}
|
||||
|
||||
|
||||
// ----------------------------------------------------------------------------------------------------------------------------------
|
||||
// _autoAlpha
|
||||
|
||||
/**
|
||||
* Returns the current alpha
|
||||
*
|
||||
* @param p_obj Object MovieClip or Textfield object
|
||||
* @return Number The current alpha
|
||||
*/
|
||||
public static function _autoAlpha_get (p_obj:Object, p_parameters:Array, p_extra:Object = null):Number {
|
||||
return p_obj.alpha;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the current autoAlpha
|
||||
*
|
||||
* @param p_obj Object MovieClip or Textfield object
|
||||
* @param p_value Number New alpha
|
||||
*/
|
||||
public static function _autoAlpha_set (p_obj:Object, p_value:Number, p_parameters:Array, p_extra:Object = null): void {
|
||||
p_obj.alpha = p_value;
|
||||
p_obj.visible = p_value > 0;
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------------------------------------------------------------
|
||||
// _scrollRect_*
|
||||
|
||||
/**
|
||||
* _scrollRect_*
|
||||
* Generic function for the properties of the scrollRect object
|
||||
*/
|
||||
public static function _scrollRect_property_get (p_obj:Object, p_parameters:Array, p_extra:Object = null):Number {
|
||||
return p_obj.scrollRect[p_parameters[0]];
|
||||
}
|
||||
public static function _scrollRect_property_set (p_obj:Object, p_value:Number, p_parameters:Array, p_extra:Object = null): void {
|
||||
var rect:Rectangle = p_obj.scrollRect;
|
||||
rect[p_parameters[0]] = Math.round(p_value);
|
||||
p_obj.scrollRect = rect;
|
||||
}
|
||||
}
|
||||
}
|
@@ -1,495 +0,0 @@
|
||||
package caurina.transitions.properties {
|
||||
|
||||
/**
|
||||
* properties.FilterShortcuts
|
||||
* Special properties for the Tweener class to handle MovieClip filters
|
||||
* The function names are strange/inverted because it makes for easier debugging (alphabetic order). They're only for internal use (on this class) anyways.
|
||||
*
|
||||
* @author Zeh Fernando, Nate Chatellier, Arthur Debert
|
||||
* @version 1.0.0
|
||||
*/
|
||||
|
||||
import flash.display.BitmapData;
|
||||
import flash.filters.BevelFilter;
|
||||
import flash.filters.BitmapFilter;
|
||||
import flash.filters.BlurFilter;
|
||||
import flash.filters.ColorMatrixFilter;
|
||||
import flash.filters.ConvolutionFilter;
|
||||
import flash.filters.DisplacementMapFilter;
|
||||
import flash.filters.DropShadowFilter;
|
||||
import flash.filters.GlowFilter;
|
||||
import flash.filters.GradientBevelFilter;
|
||||
import flash.filters.GradientGlowFilter;
|
||||
import flash.geom.Point;
|
||||
|
||||
import caurina.transitions.Tweener;
|
||||
import caurina.transitions.AuxFunctions;
|
||||
|
||||
public class FilterShortcuts {
|
||||
|
||||
/**
|
||||
* There's no constructor.
|
||||
*/
|
||||
public function FilterShortcuts () {
|
||||
trace ("This is an static class and should not be instantiated.")
|
||||
}
|
||||
|
||||
/**
|
||||
* Registers all the special properties to the Tweener class, so the Tweener knows what to do with them.
|
||||
*/
|
||||
public static function init(): void {
|
||||
|
||||
// Filter tweening splitter properties
|
||||
Tweener.registerSpecialPropertySplitter("_filter", _filter_splitter);
|
||||
|
||||
// Shortcuts - BevelFilter
|
||||
// http://livedocs.adobe.com/flex/2/langref/flash/filters/BevelFilter.html
|
||||
Tweener.registerSpecialProperty("_Bevel_angle", _filter_property_get, _filter_property_set, [BevelFilter, "angle"]);
|
||||
Tweener.registerSpecialProperty("_Bevel_blurX", _filter_property_get, _filter_property_set, [BevelFilter, "blurX"]);
|
||||
Tweener.registerSpecialProperty("_Bevel_blurY", _filter_property_get, _filter_property_set, [BevelFilter, "blurY"]);
|
||||
Tweener.registerSpecialProperty("_Bevel_distance", _filter_property_get, _filter_property_set, [BevelFilter, "distance"]);
|
||||
Tweener.registerSpecialProperty("_Bevel_highlightAlpha", _filter_property_get, _filter_property_set, [BevelFilter, "highlightAlpha"]);
|
||||
Tweener.registerSpecialPropertySplitter("_Bevel_highlightColor", _generic_color_splitter, ["_Bevel_highlightColor_r", "_Bevel_highlightColor_g", "_Bevel_highlightColor_b"]);
|
||||
Tweener.registerSpecialProperty("_Bevel_highlightColor_r", _filter_property_get, _filter_property_set, [BevelFilter, "highlightColor", "color", "r"]);
|
||||
Tweener.registerSpecialProperty("_Bevel_highlightColor_g", _filter_property_get, _filter_property_set, [BevelFilter, "highlightColor", "color", "g"]);
|
||||
Tweener.registerSpecialProperty("_Bevel_highlightColor_b", _filter_property_get, _filter_property_set, [BevelFilter, "highlightColor", "color", "b"]);
|
||||
Tweener.registerSpecialProperty("_Bevel_knockout", _filter_property_get, _filter_property_set, [BevelFilter, "knockout"]);
|
||||
Tweener.registerSpecialProperty("_Bevel_quality", _filter_property_get, _filter_property_set, [BevelFilter, "quality"]);
|
||||
Tweener.registerSpecialProperty("_Bevel_shadowAlpha", _filter_property_get, _filter_property_set, [BevelFilter, "shadowAlpha"]);
|
||||
Tweener.registerSpecialPropertySplitter("_Bevel_shadowColor", _generic_color_splitter, ["_Bevel_shadowColor_r", "_Bevel_shadowColor_g", "_Bevel_shadowColor_b"]);
|
||||
Tweener.registerSpecialProperty("_Bevel_shadowColor_r", _filter_property_get, _filter_property_set, [BevelFilter, "shadowColor", "color", "r"]);
|
||||
Tweener.registerSpecialProperty("_Bevel_shadowColor_g", _filter_property_get, _filter_property_set, [BevelFilter, "shadowColor", "color", "g"]);
|
||||
Tweener.registerSpecialProperty("_Bevel_shadowColor_b", _filter_property_get, _filter_property_set, [BevelFilter, "shadowColor", "color", "b"]);
|
||||
Tweener.registerSpecialProperty("_Bevel_strength", _filter_property_get, _filter_property_set, [BevelFilter, "strength"]);
|
||||
Tweener.registerSpecialProperty("_Bevel_type", _filter_property_get, _filter_property_set, [BevelFilter, "type"]);
|
||||
|
||||
// Shortcuts - BlurFilter
|
||||
// http://livedocs.adobe.com/flex/2/langref/flash/filters/BlurFilter.html
|
||||
Tweener.registerSpecialProperty("_Blur_blurX", _filter_property_get, _filter_property_set, [BlurFilter, "blurX"]);
|
||||
Tweener.registerSpecialProperty("_Blur_blurY", _filter_property_get, _filter_property_set, [BlurFilter, "blurY"]);
|
||||
Tweener.registerSpecialProperty("_Blur_quality", _filter_property_get, _filter_property_set, [BlurFilter, "quality"]);
|
||||
|
||||
// Shortcuts - ColorMatrixFilter
|
||||
// http://livedocs.adobe.com/flex/2/langref/flash/filters/ColorMatrixFilter.html
|
||||
Tweener.registerSpecialPropertySplitter("_ColorMatrix_matrix", _generic_matrix_splitter, [[1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0],
|
||||
["_ColorMatrix_matrix_rr", "_ColorMatrix_matrix_rg", "_ColorMatrix_matrix_rb", "_ColorMatrix_matrix_ra", "_ColorMatrix_matrix_ro",
|
||||
"_ColorMatrix_matrix_gr", "_ColorMatrix_matrix_gg", "_ColorMatrix_matrix_gb", "_ColorMatrix_matrix_ga", "_ColorMatrix_matrix_go",
|
||||
"_ColorMatrix_matrix_br", "_ColorMatrix_matrix_bg", "_ColorMatrix_matrix_bb", "_ColorMatrix_matrix_ba", "_ColorMatrix_matrix_bo",
|
||||
"_ColorMatrix_matrix_ar", "_ColorMatrix_matrix_ag", "_ColorMatrix_matrix_ab", "_ColorMatrix_matrix_aa", "_ColorMatrix_matrix_ao"]]);
|
||||
Tweener.registerSpecialProperty("_ColorMatrix_matrix_rr", _filter_property_get, _filter_property_set, [ColorMatrixFilter, "matrix", "matrix", 0]);
|
||||
Tweener.registerSpecialProperty("_ColorMatrix_matrix_rg", _filter_property_get, _filter_property_set, [ColorMatrixFilter, "matrix", "matrix", 1]);
|
||||
Tweener.registerSpecialProperty("_ColorMatrix_matrix_rb", _filter_property_get, _filter_property_set, [ColorMatrixFilter, "matrix", "matrix", 2]);
|
||||
Tweener.registerSpecialProperty("_ColorMatrix_matrix_ra", _filter_property_get, _filter_property_set, [ColorMatrixFilter, "matrix", "matrix", 3]);
|
||||
Tweener.registerSpecialProperty("_ColorMatrix_matrix_ro", _filter_property_get, _filter_property_set, [ColorMatrixFilter, "matrix", "matrix", 4]);
|
||||
Tweener.registerSpecialProperty("_ColorMatrix_matrix_gr", _filter_property_get, _filter_property_set, [ColorMatrixFilter, "matrix", "matrix", 5]);
|
||||
Tweener.registerSpecialProperty("_ColorMatrix_matrix_gg", _filter_property_get, _filter_property_set, [ColorMatrixFilter, "matrix", "matrix", 6]);
|
||||
Tweener.registerSpecialProperty("_ColorMatrix_matrix_gb", _filter_property_get, _filter_property_set, [ColorMatrixFilter, "matrix", "matrix", 7]);
|
||||
Tweener.registerSpecialProperty("_ColorMatrix_matrix_ga", _filter_property_get, _filter_property_set, [ColorMatrixFilter, "matrix", "matrix", 8]);
|
||||
Tweener.registerSpecialProperty("_ColorMatrix_matrix_go", _filter_property_get, _filter_property_set, [ColorMatrixFilter, "matrix", "matrix", 9]);
|
||||
Tweener.registerSpecialProperty("_ColorMatrix_matrix_br", _filter_property_get, _filter_property_set, [ColorMatrixFilter, "matrix", "matrix", 10]);
|
||||
Tweener.registerSpecialProperty("_ColorMatrix_matrix_bg", _filter_property_get, _filter_property_set, [ColorMatrixFilter, "matrix", "matrix", 11]);
|
||||
Tweener.registerSpecialProperty("_ColorMatrix_matrix_bb", _filter_property_get, _filter_property_set, [ColorMatrixFilter, "matrix", "matrix", 12]);
|
||||
Tweener.registerSpecialProperty("_ColorMatrix_matrix_ba", _filter_property_get, _filter_property_set, [ColorMatrixFilter, "matrix", "matrix", 13]);
|
||||
Tweener.registerSpecialProperty("_ColorMatrix_matrix_bo", _filter_property_get, _filter_property_set, [ColorMatrixFilter, "matrix", "matrix", 14]);
|
||||
Tweener.registerSpecialProperty("_ColorMatrix_matrix_ar", _filter_property_get, _filter_property_set, [ColorMatrixFilter, "matrix", "matrix", 15]);
|
||||
Tweener.registerSpecialProperty("_ColorMatrix_matrix_ag", _filter_property_get, _filter_property_set, [ColorMatrixFilter, "matrix", "matrix", 16]);
|
||||
Tweener.registerSpecialProperty("_ColorMatrix_matrix_ab", _filter_property_get, _filter_property_set, [ColorMatrixFilter, "matrix", "matrix", 17]);
|
||||
Tweener.registerSpecialProperty("_ColorMatrix_matrix_aa", _filter_property_get, _filter_property_set, [ColorMatrixFilter, "matrix", "matrix", 18]);
|
||||
Tweener.registerSpecialProperty("_ColorMatrix_matrix_ao", _filter_property_get, _filter_property_set, [ColorMatrixFilter, "matrix", "matrix", 19]);
|
||||
|
||||
// Shortcuts - ConvolutionFilter
|
||||
// http://livedocs.adobe.com/flex/2/langref/flash/filters/ConvolutionFilter.html
|
||||
Tweener.registerSpecialProperty("_Convolution_alpha", _filter_property_get, _filter_property_set, [ConvolutionFilter, "alpha"]);
|
||||
Tweener.registerSpecialProperty("_Convolution_bias", _filter_property_get, _filter_property_set, [ConvolutionFilter, "bias"]);
|
||||
Tweener.registerSpecialProperty("_Convolution_clamp", _filter_property_get, _filter_property_set, [ConvolutionFilter, "clamp"]);
|
||||
Tweener.registerSpecialPropertySplitter("_Convolution_color", _generic_color_splitter, ["_Convolution_color_r", "_Convolution_color_g", "_Convolution_color_b"]);
|
||||
Tweener.registerSpecialProperty("_Convolution_color_r", _filter_property_get, _filter_property_set, [ConvolutionFilter, "color", "color", "r"]);
|
||||
Tweener.registerSpecialProperty("_Convolution_color_g", _filter_property_get, _filter_property_set, [ConvolutionFilter, "color", "color", "g"]);
|
||||
Tweener.registerSpecialProperty("_Convolution_color_b", _filter_property_get, _filter_property_set, [ConvolutionFilter, "color", "color", "b"]);
|
||||
Tweener.registerSpecialProperty("_Convolution_divisor", _filter_property_get, _filter_property_set, [ConvolutionFilter, "divisor"]);
|
||||
//Tweener.registerSpecialPropertySplitter("_Convolution_matrix", _generic_array_splitter, ["_Convolution_matrix_array"]);
|
||||
//Tweener.registerSpecialProperty("_Convolution_matrix_array", _filter_property_get, _filter_property_set, [ConvolutionFilter, "matrix", "array"]);
|
||||
Tweener.registerSpecialProperty("_Convolution_matrixX", _filter_property_get, _filter_property_set, [ConvolutionFilter, "matrixX"]);
|
||||
Tweener.registerSpecialProperty("_Convolution_matrixY", _filter_property_get, _filter_property_set, [ConvolutionFilter, "matrixY"]);
|
||||
Tweener.registerSpecialProperty("_Convolution_preserveAlpha", _filter_property_get, _filter_property_set, [ConvolutionFilter, "preserveAlpha"]);
|
||||
|
||||
// Shortcuts - DisplacementMapFilter
|
||||
// http://livedocs.adobe.com/flex/2/langref/flash/filters/DisplacementMapFilter.html
|
||||
Tweener.registerSpecialProperty("_DisplacementMap_alpha", _filter_property_get, _filter_property_set, [DisplacementMapFilter, "alpha"]);
|
||||
Tweener.registerSpecialPropertySplitter("_DisplacementMap_color", _generic_color_splitter, ["_DisplacementMap_color_r", "_DisplacementMap_color_r", "_DisplacementMap_color_r"]);
|
||||
Tweener.registerSpecialProperty("_DisplacementMap_color_r", _filter_property_get, _filter_property_set, [DisplacementMapFilter, "color", "color", "r"]);
|
||||
Tweener.registerSpecialProperty("_DisplacementMap_color_g", _filter_property_get, _filter_property_set, [DisplacementMapFilter, "color", "color", "g"]);
|
||||
Tweener.registerSpecialProperty("_DisplacementMap_color_b", _filter_property_get, _filter_property_set, [DisplacementMapFilter, "color", "color", "b"]);
|
||||
Tweener.registerSpecialProperty("_DisplacementMap_componentX", _filter_property_get, _filter_property_set, [DisplacementMapFilter, "componentX"]);
|
||||
Tweener.registerSpecialProperty("_DisplacementMap_componentY", _filter_property_get, _filter_property_set, [DisplacementMapFilter, "componentY"]);
|
||||
Tweener.registerSpecialProperty("_DisplacementMap_mapBitmap", _filter_property_get, _filter_property_set, [DisplacementMapFilter, "mapBitmap"]);
|
||||
Tweener.registerSpecialProperty("_DisplacementMap_mapPoint", _filter_property_get, _filter_property_set, [DisplacementMapFilter, "mapPoint"]);
|
||||
Tweener.registerSpecialProperty("_DisplacementMap_mode", _filter_property_get, _filter_property_set, [DisplacementMapFilter, "mode"]);
|
||||
Tweener.registerSpecialProperty("_DisplacementMap_scaleX", _filter_property_get, _filter_property_set, [DisplacementMapFilter, "scaleX"]);
|
||||
Tweener.registerSpecialProperty("_DisplacementMap_scaleY", _filter_property_get, _filter_property_set, [DisplacementMapFilter, "scaleY"]);
|
||||
|
||||
// Shortcuts - DropShadowFilter
|
||||
// http://livedocs.adobe.com/flex/2/langref/flash/filters/DropShadowFilter.html
|
||||
Tweener.registerSpecialProperty("_DropShadow_alpha", _filter_property_get, _filter_property_set, [DropShadowFilter, "alpha"]);
|
||||
Tweener.registerSpecialProperty("_DropShadow_angle", _filter_property_get, _filter_property_set, [DropShadowFilter, "angle"]);
|
||||
Tweener.registerSpecialProperty("_DropShadow_blurX", _filter_property_get, _filter_property_set, [DropShadowFilter, "blurX"]);
|
||||
Tweener.registerSpecialProperty("_DropShadow_blurY", _filter_property_get, _filter_property_set, [DropShadowFilter, "blurY"]);
|
||||
Tweener.registerSpecialPropertySplitter("_DropShadow_color", _generic_color_splitter, ["_DropShadow_color_r", "_DropShadow_color_g", "_DropShadow_color_b"]);
|
||||
Tweener.registerSpecialProperty("_DropShadow_color_r", _filter_property_get, _filter_property_set, [DropShadowFilter, "color", "color", "r"]);
|
||||
Tweener.registerSpecialProperty("_DropShadow_color_g", _filter_property_get, _filter_property_set, [DropShadowFilter, "color", "color", "g"]);
|
||||
Tweener.registerSpecialProperty("_DropShadow_color_b", _filter_property_get, _filter_property_set, [DropShadowFilter, "color", "color", "b"]);
|
||||
Tweener.registerSpecialProperty("_DropShadow_distance", _filter_property_get, _filter_property_set, [DropShadowFilter, "distance"]);
|
||||
Tweener.registerSpecialProperty("_DropShadow_hideObject", _filter_property_get, _filter_property_set, [DropShadowFilter, "hideObject"]);
|
||||
Tweener.registerSpecialProperty("_DropShadow_inner", _filter_property_get, _filter_property_set, [DropShadowFilter, "inner"]);
|
||||
Tweener.registerSpecialProperty("_DropShadow_knockout", _filter_property_get, _filter_property_set, [DropShadowFilter, "knockout"]);
|
||||
Tweener.registerSpecialProperty("_DropShadow_quality", _filter_property_get, _filter_property_set, [DropShadowFilter, "quality"]);
|
||||
Tweener.registerSpecialProperty("_DropShadow_strength", _filter_property_get, _filter_property_set, [DropShadowFilter, "strength"]);
|
||||
|
||||
// Shortcuts - GlowFilter
|
||||
// http://livedocs.adobe.com/flex/2/langref/flash/filters/GlowFilter.html
|
||||
Tweener.registerSpecialProperty("_Glow_alpha", _filter_property_get, _filter_property_set, [GlowFilter, "alpha"]);
|
||||
Tweener.registerSpecialProperty("_Glow_blurX", _filter_property_get, _filter_property_set, [GlowFilter, "blurX"]);
|
||||
Tweener.registerSpecialProperty("_Glow_blurY", _filter_property_get, _filter_property_set, [GlowFilter, "blurY"]);
|
||||
Tweener.registerSpecialPropertySplitter("_Glow_color", _generic_color_splitter, ["_Glow_color_r", "_Glow_color_g", "_Glow_color_b"]);
|
||||
Tweener.registerSpecialProperty("_Glow_color_r", _filter_property_get, _filter_property_set, [GlowFilter, "color", "color", "r"]);
|
||||
Tweener.registerSpecialProperty("_Glow_color_g", _filter_property_get, _filter_property_set, [GlowFilter, "color", "color", "g"]);
|
||||
Tweener.registerSpecialProperty("_Glow_color_b", _filter_property_get, _filter_property_set, [GlowFilter, "color", "color", "b"]);
|
||||
Tweener.registerSpecialProperty("_Glow_inner", _filter_property_get, _filter_property_set, [GlowFilter, "inner"]);
|
||||
Tweener.registerSpecialProperty("_Glow_knockout", _filter_property_get, _filter_property_set, [GlowFilter, "knockout"]);
|
||||
Tweener.registerSpecialProperty("_Glow_quality", _filter_property_get, _filter_property_set, [GlowFilter, "quality"]);
|
||||
Tweener.registerSpecialProperty("_Glow_strength", _filter_property_get, _filter_property_set, [GlowFilter, "strength"]);
|
||||
|
||||
// Shortcuts - GradientBevelFilter
|
||||
// http://livedocs.adobe.com/flex/2/langref/flash/filters/GradientBevelFilter.html
|
||||
// .alphas (array)
|
||||
Tweener.registerSpecialProperty("_GradientBevel_angle", _filter_property_get, _filter_property_set, [GradientBevelFilter, "angle"]);
|
||||
Tweener.registerSpecialProperty("_GradientBevel_blurX", _filter_property_get, _filter_property_set, [GradientBevelFilter, "blurX"]);
|
||||
Tweener.registerSpecialProperty("_GradientBevel_blurY", _filter_property_get, _filter_property_set, [GradientBevelFilter, "blurY"]);
|
||||
// .colors (array)
|
||||
Tweener.registerSpecialProperty("_GradientBevel_distance", _filter_property_get, _filter_property_set, [GradientBevelFilter, "distance"]);
|
||||
Tweener.registerSpecialProperty("_GradientBevel_quality", _filter_property_get, _filter_property_set, [GradientBevelFilter, "quality"]);
|
||||
// .ratios(array)
|
||||
Tweener.registerSpecialProperty("_GradientBevel_strength", _filter_property_get, _filter_property_set, [GradientBevelFilter, "strength"]);
|
||||
Tweener.registerSpecialProperty("_GradientBevel_type", _filter_property_get, _filter_property_set, [GradientBevelFilter, "type"]);
|
||||
|
||||
// Shortcuts - GradientGlowFilter
|
||||
// http://livedocs.adobe.com/flex/2/langref/flash/filters/GradientGlowFilter.html
|
||||
// .alphas (array)
|
||||
Tweener.registerSpecialProperty("_GradientGlow_angle", _filter_property_get, _filter_property_set, [GradientGlowFilter, "angle"]);
|
||||
Tweener.registerSpecialProperty("_GradientGlow_blurX", _filter_property_get, _filter_property_set, [GradientGlowFilter, "blurX"]);
|
||||
Tweener.registerSpecialProperty("_GradientGlow_blurY", _filter_property_get, _filter_property_set, [GradientGlowFilter, "blurY"]);
|
||||
// .colors (array)
|
||||
Tweener.registerSpecialProperty("_GradientGlow_distance", _filter_property_get, _filter_property_set, [GradientGlowFilter, "distance"]);
|
||||
Tweener.registerSpecialProperty("_GradientGlow_knockout", _filter_property_get, _filter_property_set, [GradientGlowFilter, "knockout"]);
|
||||
Tweener.registerSpecialProperty("_GradientGlow_quality", _filter_property_get, _filter_property_set, [GradientGlowFilter, "quality"]);
|
||||
// .ratios (array)
|
||||
Tweener.registerSpecialProperty("_GradientGlow_strength", _filter_property_get, _filter_property_set, [GradientGlowFilter, "strength"]);
|
||||
Tweener.registerSpecialProperty("_GradientGlow_type", _filter_property_get, _filter_property_set, [GradientGlowFilter, "type"]);
|
||||
|
||||
}
|
||||
|
||||
|
||||
// ==================================================================================================================================
|
||||
// PROPERTY GROUPING/SPLITTING functions --------------------------------------------------------------------------------------------
|
||||
|
||||
// ----------------------------------------------------------------------------------------------------------------------------------
|
||||
// generic splitters
|
||||
|
||||
/**
|
||||
* A generic color splitter - from 0xrrggbb to r, g, b with the name of the parameters passed
|
||||
*
|
||||
* @param p_value Number The original _color value
|
||||
* @return Array An array containing the .name and .value of all new properties
|
||||
*/
|
||||
public static function _generic_color_splitter (p_value:Number, p_parameters:Array):Array {
|
||||
var nArray:Array = new Array();
|
||||
nArray.push({name:p_parameters[0], value:AuxFunctions.numberToR(p_value)});
|
||||
nArray.push({name:p_parameters[1], value:AuxFunctions.numberToG(p_value)});
|
||||
nArray.push({name:p_parameters[2], value:AuxFunctions.numberToB(p_value)});
|
||||
return nArray;
|
||||
}
|
||||
|
||||
/**
|
||||
* A generic matrix splitter - from [] to items with the name of the parameters passed
|
||||
*
|
||||
* @param p_value Array The original
|
||||
* @return Array An array containing the .name and .value of all new properties
|
||||
*/
|
||||
public static function _generic_matrix_splitter (p_value:Array, p_parameters:Array):Array {
|
||||
if (p_value == null) p_value = p_parameters[0].concat();
|
||||
var nArray:Array = new Array();
|
||||
for (var i:Number = 0; i < p_value.length; i++) {
|
||||
nArray.push({name:p_parameters[1][i], value:p_value[i]});
|
||||
}
|
||||
return nArray;
|
||||
}
|
||||
|
||||
/**
|
||||
* A generic array splitter - from [] to items with the index passed back
|
||||
*
|
||||
* @param p_value Array The original array value
|
||||
* @return Array An array containing the .name and .value of all new properties
|
||||
*/
|
||||
/*
|
||||
public static function _generic_array_splitter (p_value:Array, p_parameters:Array):Array {
|
||||
if (p_value == null) p_value = p_parameters[0].concat();
|
||||
var nArray:Array = new Array();
|
||||
for (var i:Number = 0; i < p_value.length; i++) {
|
||||
nArray.push({name:p_parameters[1][i], value:p_value[i], arrayIndex:i});
|
||||
}
|
||||
return nArray;
|
||||
}
|
||||
*/
|
||||
|
||||
// ----------------------------------------------------------------------------------------------------------------------------------
|
||||
// filters
|
||||
|
||||
/**
|
||||
* Splits the _filter, _blur, etc parameter into specific filter variables
|
||||
*
|
||||
* @param p_value BitmapFilter A BitmapFilter instance
|
||||
* @return Array An array containing the .name and .value of all new properties
|
||||
*/
|
||||
public static function _filter_splitter (p_value:BitmapFilter, p_parameters:Array, p_extra:Object = null):Array {
|
||||
var nArray:Array = new Array();
|
||||
if (p_value is BevelFilter) {
|
||||
nArray.push({name:"_Bevel_angle", value:BevelFilter(p_value).angle});
|
||||
nArray.push({name:"_Bevel_blurX", value:BevelFilter(p_value).blurX});
|
||||
nArray.push({name:"_Bevel_blurY", value:BevelFilter(p_value).blurY});
|
||||
nArray.push({name:"_Bevel_distance", value:BevelFilter(p_value).distance});
|
||||
nArray.push({name:"_Bevel_highlightAlpha", value:BevelFilter(p_value).highlightAlpha});
|
||||
nArray.push({name:"_Bevel_highlightColor", value:BevelFilter(p_value).highlightColor});
|
||||
nArray.push({name:"_Bevel_knockout", value:BevelFilter(p_value).knockout});
|
||||
nArray.push({name:"_Bevel_quality", value:BevelFilter(p_value).quality});
|
||||
nArray.push({name:"_Bevel_shadowAlpha", value:BevelFilter(p_value).shadowAlpha});
|
||||
nArray.push({name:"_Bevel_shadowColor", value:BevelFilter(p_value).shadowColor});
|
||||
nArray.push({name:"_Bevel_strength", value:BevelFilter(p_value).strength});
|
||||
nArray.push({name:"_Bevel_type", value:BevelFilter(p_value).type});
|
||||
} else if (p_value is BlurFilter) {
|
||||
nArray.push({name:"_Blur_blurX", value:BlurFilter(p_value).blurX});
|
||||
nArray.push({name:"_Blur_blurY", value:BlurFilter(p_value).blurY});
|
||||
nArray.push({name:"_Blur_quality", value:BlurFilter(p_value).quality});
|
||||
} else if (p_value is ColorMatrixFilter) {
|
||||
nArray.push({name:"_ColorMatrix_matrix", value:ColorMatrixFilter(p_value).matrix});
|
||||
} else if (p_value is ConvolutionFilter) {
|
||||
nArray.push({name:"_Convolution_alpha", value:ConvolutionFilter(p_value).alpha});
|
||||
nArray.push({name:"_Convolution_bias", value:ConvolutionFilter(p_value).bias});
|
||||
nArray.push({name:"_Convolution_clamp", value:ConvolutionFilter(p_value).clamp});
|
||||
nArray.push({name:"_Convolution_color", value:ConvolutionFilter(p_value).color});
|
||||
// .matrix
|
||||
nArray.push({name:"_Convolution_divisor", value:ConvolutionFilter(p_value).divisor});
|
||||
nArray.push({name:"_Convolution_matrixX", value:ConvolutionFilter(p_value).matrixX});
|
||||
nArray.push({name:"_Convolution_matrixY", value:ConvolutionFilter(p_value).matrixY});
|
||||
nArray.push({name:"_Convolution_preserveAlpha", value:ConvolutionFilter(p_value).preserveAlpha});
|
||||
} else if (p_value is DisplacementMapFilter) {
|
||||
nArray.push({name:"_DisplacementMap_alpha", value:DisplacementMapFilter(p_value).alpha});
|
||||
nArray.push({name:"_DisplacementMap_color", value:DisplacementMapFilter(p_value).color});
|
||||
nArray.push({name:"_DisplacementMap_componentX", value:DisplacementMapFilter(p_value).componentX});
|
||||
nArray.push({name:"_DisplacementMap_componentY", value:DisplacementMapFilter(p_value).componentY});
|
||||
nArray.push({name:"_DisplacementMap_mapBitmap", value:DisplacementMapFilter(p_value).mapBitmap});
|
||||
nArray.push({name:"_DisplacementMap_mapPoint", value:DisplacementMapFilter(p_value).mapPoint});
|
||||
nArray.push({name:"_DisplacementMap_mode", value:DisplacementMapFilter(p_value).mode});
|
||||
nArray.push({name:"_DisplacementMap_scaleX", value:DisplacementMapFilter(p_value).scaleX});
|
||||
nArray.push({name:"_DisplacementMap_scaleY", value:DisplacementMapFilter(p_value).scaleY});
|
||||
} else if (p_value is DropShadowFilter) {
|
||||
nArray.push({name:"_DropShadow_alpha", value:DropShadowFilter(p_value).alpha});
|
||||
nArray.push({name:"_DropShadow_angle", value:DropShadowFilter(p_value).angle});
|
||||
nArray.push({name:"_DropShadow_blurX", value:DropShadowFilter(p_value).blurX});
|
||||
nArray.push({name:"_DropShadow_blurY", value:DropShadowFilter(p_value).blurY});
|
||||
nArray.push({name:"_DropShadow_color", value:DropShadowFilter(p_value).color});
|
||||
nArray.push({name:"_DropShadow_distance", value:DropShadowFilter(p_value).distance});
|
||||
nArray.push({name:"_DropShadow_hideObject", value:DropShadowFilter(p_value).hideObject});
|
||||
nArray.push({name:"_DropShadow_inner", value:DropShadowFilter(p_value).inner});
|
||||
nArray.push({name:"_DropShadow_knockout", value:DropShadowFilter(p_value).knockout});
|
||||
nArray.push({name:"_DropShadow_quality", value:DropShadowFilter(p_value).quality});
|
||||
nArray.push({name:"_DropShadow_strength", value:DropShadowFilter(p_value).strength});
|
||||
} else if (p_value is GlowFilter) {
|
||||
nArray.push({name:"_Glow_alpha", value:GlowFilter(p_value).alpha});
|
||||
nArray.push({name:"_Glow_blurX", value:GlowFilter(p_value).blurX});
|
||||
nArray.push({name:"_Glow_blurY", value:GlowFilter(p_value).blurY});
|
||||
nArray.push({name:"_Glow_color", value:GlowFilter(p_value).color});
|
||||
nArray.push({name:"_Glow_inner", value:GlowFilter(p_value).inner});
|
||||
nArray.push({name:"_Glow_knockout", value:GlowFilter(p_value).knockout});
|
||||
nArray.push({name:"_Glow_quality", value:GlowFilter(p_value).quality});
|
||||
nArray.push({name:"_Glow_strength", value:GlowFilter(p_value).strength});
|
||||
} else if (p_value is GradientBevelFilter) {
|
||||
// .alphas (array)
|
||||
nArray.push({name:"_GradientBevel_angle", value:GradientBevelFilter(p_value).strength});
|
||||
nArray.push({name:"_GradientBevel_blurX", value:GradientBevelFilter(p_value).blurX});
|
||||
nArray.push({name:"_GradientBevel_blurY", value:GradientBevelFilter(p_value).blurY});
|
||||
// .colors (array)
|
||||
nArray.push({name:"_GradientBevel_distance", value:GradientBevelFilter(p_value).distance});
|
||||
nArray.push({name:"_GradientBevel_quality", value:GradientBevelFilter(p_value).quality});
|
||||
// .ratios(array)
|
||||
nArray.push({name:"_GradientBevel_strength", value:GradientBevelFilter(p_value).strength});
|
||||
nArray.push({name:"_GradientBevel_type", value:GradientBevelFilter(p_value).type});
|
||||
} else if (p_value is GradientGlowFilter) {
|
||||
// .alphas (array)
|
||||
nArray.push({name:"_GradientGlow_angle", value:GradientGlowFilter(p_value).strength});
|
||||
nArray.push({name:"_GradientGlow_blurX", value:GradientGlowFilter(p_value).blurX});
|
||||
nArray.push({name:"_GradientGlow_blurY", value:GradientGlowFilter(p_value).blurY});
|
||||
// .colors (array)
|
||||
nArray.push({name:"_GradientGlow_distance", value:GradientGlowFilter(p_value).distance});
|
||||
nArray.push({name:"_GradientGlow_knockout", value:GradientGlowFilter(p_value).knockout});
|
||||
nArray.push({name:"_GradientGlow_quality", value:GradientGlowFilter(p_value).quality});
|
||||
// .ratios(array)
|
||||
nArray.push({name:"_GradientGlow_strength", value:GradientGlowFilter(p_value).strength});
|
||||
nArray.push({name:"_GradientGlow_type", value:GradientGlowFilter(p_value).type});
|
||||
} else {
|
||||
// ?
|
||||
trace ("Tweener FilterShortcuts Error :: Unknown filter class used");
|
||||
}
|
||||
return nArray;
|
||||
}
|
||||
|
||||
|
||||
// ==================================================================================================================================
|
||||
// NORMAL SPECIAL PROPERTY functions ------------------------------------------------------------------------------------------------
|
||||
|
||||
// ----------------------------------------------------------------------------------------------------------------------------------
|
||||
// filters
|
||||
|
||||
/**
|
||||
* (filters)
|
||||
* Generic function for the properties of filter objects
|
||||
*/
|
||||
public static function _filter_property_get (p_obj:Object, p_parameters:Array, p_extra:Object = null):Number {
|
||||
var f:Array = p_obj.filters;
|
||||
var i:Number;
|
||||
var filterClass:Object = p_parameters[0];
|
||||
var propertyName:String = p_parameters[1];
|
||||
var splitType:String = p_parameters[2];
|
||||
for (i = 0; i < f.length; i++) {
|
||||
if (f[i] is Class(filterClass)) {
|
||||
if (splitType == "color") {
|
||||
// Composite, color channel
|
||||
var colorComponent:String = p_parameters[3];
|
||||
if (colorComponent == "r") return AuxFunctions.numberToR(f[i][propertyName]);
|
||||
if (colorComponent == "g") return AuxFunctions.numberToG(f[i][propertyName]);
|
||||
if (colorComponent == "b") return AuxFunctions.numberToB(f[i][propertyName]);
|
||||
} else if (splitType == "matrix") {
|
||||
// Composite, some kind of matrix
|
||||
return f[i][propertyName][p_parameters[3]];
|
||||
} else {
|
||||
// Standard property
|
||||
return (f[i][propertyName]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// No value found for this property - no filter instance found using this class!
|
||||
// Must return default desired values
|
||||
var defaultValues:Object;
|
||||
switch (filterClass) {
|
||||
case BevelFilter:
|
||||
defaultValues = {angle:NaN, blurX:0, blurY:0, distance:0, highlightAlpha:1, highlightColor:NaN, knockout:null, quality:NaN, shadowAlpha:1, shadowColor:NaN, strength:2, type:null};
|
||||
break;
|
||||
case BlurFilter:
|
||||
defaultValues = {blurX:0, blurY:0, quality:NaN};
|
||||
break;
|
||||
case ColorMatrixFilter:
|
||||
defaultValues = {matrix:[1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0]};
|
||||
break;
|
||||
case ConvolutionFilter:
|
||||
defaultValues = {alpha:0, bias:0, clamp:null, color:NaN, divisor:1, matrix:[1], matrixX:1, matrixY:1, preserveAlpha:null};
|
||||
break;
|
||||
case DisplacementMapFilter:
|
||||
defaultValues = {alpha:0, color:NaN, componentX:null, componentY:null, mapBitmap:null, mapPoint:null, mode:null, scaleX:0, scaleY:0};
|
||||
break;
|
||||
case DropShadowFilter:
|
||||
defaultValues = {distance:0, angle:NaN, color:NaN, alpha:1, blurX:0, blurY:0, strength:1, quality:NaN, inner:null, knockout:null, hideObject:null};
|
||||
break;
|
||||
case GlowFilter:
|
||||
defaultValues = {alpha:1, blurX:0, blurY:0, color:NaN, inner:null, knockout:null, quality:NaN, strength:2};
|
||||
break;
|
||||
case GradientBevelFilter:
|
||||
defaultValues = {alphas:null, angle:NaN, blurX:0, blurY:0, colors:null, distance:0, knockout:null, quality:NaN, ratios:NaN, strength:1, type:null};
|
||||
break;
|
||||
case GradientGlowFilter:
|
||||
defaultValues = {alphas:null, angle:NaN, blurX:0, blurY:0, colors:null, distance:0, knockout:null, quality:NaN, ratios:NaN, strength:1, type:null};
|
||||
break;
|
||||
}
|
||||
// When returning NaN, the Tweener engine sets the starting value as being the same as the final value (if not found)
|
||||
// When returning null, the Tweener engine doesn't tween it at all, just setting it to the final value
|
||||
// This is DIFFERENT from the default filter applied as default on _filter_property_set because some values shouldn't be tweened
|
||||
if (splitType == "color") {
|
||||
// Composite, color channel; always defaults to target value
|
||||
return NaN;
|
||||
} else if (splitType == "matrix") {
|
||||
// Composite, matrix; always defaults to target value
|
||||
return defaultValues[propertyName][p_parameters[3]];
|
||||
} else {
|
||||
// Standard property
|
||||
return defaultValues[propertyName];
|
||||
}
|
||||
}
|
||||
|
||||
public static function _filter_property_set (p_obj:Object, p_value:Number, p_parameters:Array, p_extra:Object = null): void {
|
||||
var f:Array = p_obj.filters;
|
||||
var i:Number;
|
||||
var filterClass:Object = p_parameters[0];
|
||||
var propertyName:String = p_parameters[1];
|
||||
var splitType:String = p_parameters[2];
|
||||
for (i = 0; i < f.length; i++) {
|
||||
if (f[i] is Class(filterClass)) {
|
||||
if (splitType == "color") {
|
||||
// Composite, color channel
|
||||
var colorComponent:String = p_parameters[3];
|
||||
if (colorComponent == "r") f[i][propertyName] = (f[i][propertyName] & 0xffff) | (p_value << 16);
|
||||
if (colorComponent == "g") f[i][propertyName] = (f[i][propertyName] & 0xff00ff) | (p_value << 8);
|
||||
if (colorComponent == "b") f[i][propertyName] = (f[i][propertyName] & 0xffff00) | p_value;
|
||||
} else if (splitType == "matrix") {
|
||||
var mtx:Array = f[i][propertyName];
|
||||
mtx[p_parameters[3]] = p_value;
|
||||
f[i][propertyName] = mtx;
|
||||
} else {
|
||||
// Standard property
|
||||
f[i][propertyName] = p_value;
|
||||
}
|
||||
p_obj.filters = f;
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
// The correct filter class wasn't found, so create a new one that is the equivalent of the object without the filter
|
||||
if (f == null) f = new Array();
|
||||
var fi:BitmapFilter;
|
||||
switch (filterClass) {
|
||||
case BevelFilter:
|
||||
fi = new BevelFilter(0, 45, 0xffffff, 1, 0x000000, 1, 0, 0);
|
||||
break;
|
||||
case BlurFilter:
|
||||
fi = new BlurFilter(0, 0);
|
||||
break;
|
||||
case ColorMatrixFilter:
|
||||
fi = new ColorMatrixFilter([1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0]);
|
||||
break;
|
||||
case ConvolutionFilter:
|
||||
fi = new ConvolutionFilter(1, 1, [1], 1, 0, true, true, 0x000000, 0);
|
||||
break;
|
||||
case DisplacementMapFilter:
|
||||
// Doesn't make much sense to create a new empty DisplacementMapFilter if there's nothing to tween
|
||||
fi = new DisplacementMapFilter(new BitmapData(10, 10), new Point(0, 0), 0, 1, 0, 0);
|
||||
break;
|
||||
case DropShadowFilter:
|
||||
fi = new DropShadowFilter(0, 45, 0x000000, 1, 0, 0);
|
||||
break;
|
||||
case GlowFilter:
|
||||
fi = new GlowFilter(0xff0000, 1, 0, 0);
|
||||
break;
|
||||
case GradientBevelFilter:
|
||||
fi = new GradientBevelFilter(0, 45, [0xffffff, 0x000000], [1, 1], [32, 223], 0, 0);
|
||||
break;
|
||||
case GradientGlowFilter:
|
||||
fi = new GradientGlowFilter(0, 45, [0xffffff, 0x000000], [1, 1], [32, 223], 0, 0);
|
||||
break;
|
||||
}
|
||||
//fi[propertyName] = p_value;
|
||||
f.push(fi);
|
||||
p_obj.filters = f;
|
||||
_filter_property_set(p_obj, p_value, p_parameters);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
@@ -1,93 +0,0 @@
|
||||
package caurina.transitions.properties {
|
||||
|
||||
/**
|
||||
* properties.SoundShortcuts
|
||||
* List of default special properties for Sounds
|
||||
* The function names are strange/inverted because it makes for easier debugging (alphabetic order). They're only for internal use (on this class) anyways.
|
||||
*
|
||||
* @author Zeh Fernando, Nate Chatellier, Arthur Debert
|
||||
* @version 1.0.0
|
||||
*/
|
||||
|
||||
import flash.media.SoundTransform;
|
||||
|
||||
import caurina.transitions.Tweener;
|
||||
|
||||
public class SoundShortcuts {
|
||||
|
||||
/**
|
||||
* There's no constructor.
|
||||
*/
|
||||
public function SoundShortcuts () {
|
||||
trace ("This is an static class and should not be instantiated.")
|
||||
}
|
||||
|
||||
/**
|
||||
* Registers all the special properties to the Tweener class, so the Tweener knows what to do with them.
|
||||
*/
|
||||
public static function init():void {
|
||||
|
||||
// Normal properties
|
||||
Tweener.registerSpecialProperty("_sound_volume", _sound_volume_get, _sound_volume_set);
|
||||
Tweener.registerSpecialProperty("_sound_pan", _sound_pan_get, _sound_pan_set);
|
||||
|
||||
}
|
||||
|
||||
|
||||
// ==================================================================================================================================
|
||||
// NORMAL SPECIAL PROPERTY functions ------------------------------------------------------------------------------------------------
|
||||
|
||||
// ----------------------------------------------------------------------------------------------------------------------------------
|
||||
// _sound_volume
|
||||
|
||||
/**
|
||||
* Returns the current sound volume
|
||||
*
|
||||
* @param p_obj Object SoundChannel object
|
||||
* @return Number The current volume
|
||||
*/
|
||||
public static function _sound_volume_get (p_obj:Object, p_parameters:Array, p_extra:Object = null):Number {
|
||||
return p_obj.soundTransform.volume;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the sound volume
|
||||
*
|
||||
* @param p_obj Object SoundChannel object
|
||||
* @param p_value Number New volume
|
||||
*/
|
||||
public static function _sound_volume_set (p_obj:Object, p_value:Number, p_parameters:Array, p_extra:Object = null):void {
|
||||
var sndTransform:SoundTransform = p_obj.soundTransform;
|
||||
sndTransform.volume = p_value;
|
||||
p_obj.soundTransform = sndTransform;
|
||||
}
|
||||
|
||||
|
||||
// ----------------------------------------------------------------------------------------------------------------------------------
|
||||
// _sound_pan
|
||||
|
||||
/**
|
||||
* Returns the current sound pan
|
||||
*
|
||||
* @param p_obj Object SoundChannel object
|
||||
* @return Number The current pan
|
||||
*/
|
||||
public static function _sound_pan_get (p_obj:Object, p_parameters:Array, p_extra:Object = null):Number {
|
||||
return p_obj.soundTransform.pan;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the sound volume
|
||||
*
|
||||
* @param p_obj Object SoundChannel object
|
||||
* @param p_value Number New pan
|
||||
*/
|
||||
public static function _sound_pan_set (p_obj:Object, p_value:Number, p_parameters:Array, p_extra:Object = null):void {
|
||||
var sndTransform:SoundTransform = p_obj.soundTransform;
|
||||
sndTransform.pan = p_value;
|
||||
p_obj.soundTransform = sndTransform;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
@@ -1,157 +0,0 @@
|
||||
package caurina.transitions.properties {
|
||||
|
||||
/**
|
||||
* properties.TextShortcuts
|
||||
* Special properties for the Tweener class to handle MovieClip filters
|
||||
* The function names are strange/inverted because it makes for easier debugging (alphabetic order). They're only for internal use (on this class) anyways.
|
||||
*
|
||||
* @author Zeh Fernando, Nate Chatellier, Arthur Debert
|
||||
* @version 1.0.0
|
||||
*/
|
||||
|
||||
import caurina.transitions.Tweener;
|
||||
import caurina.transitions.AuxFunctions;
|
||||
|
||||
import flash.text.TextFormat;
|
||||
|
||||
public class TextShortcuts {
|
||||
|
||||
/**
|
||||
* There's no constructor.
|
||||
*/
|
||||
public function TextShortcuts () {
|
||||
trace ("This is an static class and should not be instantiated.")
|
||||
}
|
||||
|
||||
/**
|
||||
* Registers all the special properties to the Tweener class, so the Tweener knows what to do with them.
|
||||
*/
|
||||
public static function init(): void {
|
||||
// Normal properties
|
||||
Tweener.registerSpecialProperty("_text", _text_get, _text_set, null, _text_preProcess);
|
||||
// Tweener.registerSpecialPropertyModifier("_text", _text_modifier, _text_get);
|
||||
|
||||
// TextFormat-based properties
|
||||
Tweener.registerSpecialPropertySplitter("_text_color", _generic_color_splitter, ["_text_color_r", "_text_color_g", "_text_color_b"]);
|
||||
Tweener.registerSpecialProperty("_text_color_r", _textFormat_property_get, _textFormat_property_set, ["color", true, "r"]);
|
||||
Tweener.registerSpecialProperty("_text_color_g", _textFormat_property_get, _textFormat_property_set, ["color", true, "g"]);
|
||||
Tweener.registerSpecialProperty("_text_color_b", _textFormat_property_get, _textFormat_property_set, ["color", true, "b"]);
|
||||
Tweener.registerSpecialProperty("_text_indent", _textFormat_property_get, _textFormat_property_set, ["indent"]);
|
||||
Tweener.registerSpecialProperty("_text_leading", _textFormat_property_get, _textFormat_property_set, ["leading"]);
|
||||
Tweener.registerSpecialProperty("_text_leftMargin", _textFormat_property_get, _textFormat_property_set, ["leftMargin"]);
|
||||
Tweener.registerSpecialProperty("_text_letterSpacing", _textFormat_property_get, _textFormat_property_set, ["letterSpacing"]);
|
||||
Tweener.registerSpecialProperty("_text_rightMargin", _textFormat_property_get, _textFormat_property_set, ["rightMargin"]);
|
||||
Tweener.registerSpecialProperty("_text_size", _textFormat_property_get, _textFormat_property_set, ["size"]);
|
||||
|
||||
}
|
||||
|
||||
|
||||
// ==================================================================================================================================
|
||||
// NORMAL SPECIAL PROPERTY functions ------------------------------------------------------------------------------------------------
|
||||
|
||||
// ----------------------------------------------------------------------------------------------------------------------------------
|
||||
// _text
|
||||
|
||||
/**
|
||||
* Returns the current frame number from the movieclip timeline
|
||||
*
|
||||
* @param p_obj Object MovieClip object
|
||||
* @return Number The current frame
|
||||
*/
|
||||
public static function _text_get (p_obj:Object, p_parameters:Array, p_extra:Object = null):Number {
|
||||
//return p_obj._currentFrame;
|
||||
return -p_obj.text.length;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the timeline frame
|
||||
*
|
||||
* @param p_obj Object MovieClip object
|
||||
* @param p_value Number New frame number
|
||||
*/
|
||||
public static function _text_set (p_obj:Object, p_value:Number, p_parameters:Array, p_extra:Object = null): void {
|
||||
//p_obj.gotoAndStop(Math.round(p_value));
|
||||
//p_obj.text =
|
||||
if (p_value < 0) {
|
||||
// Old text
|
||||
p_obj.text = p_extra.oldText.substr(0, -Math.round(p_value));
|
||||
} else {
|
||||
// New text
|
||||
p_obj.text = p_extra.newText.substr(0, Math.round(p_value));
|
||||
}
|
||||
}
|
||||
|
||||
public static function _text_preProcess (p_obj:Object, p_parameters:Array, p_originalValueComplete:Object, p_extra:Object): Number {
|
||||
p_extra.oldText = p_obj.text;
|
||||
p_extra.newText = p_originalValueComplete;
|
||||
return p_extra.newText.length;
|
||||
}
|
||||
|
||||
// ==================================================================================================================================
|
||||
// PROPERTY GROUPING/SPLITTING functions --------------------------------------------------------------------------------------------
|
||||
|
||||
// ----------------------------------------------------------------------------------------------------------------------------------
|
||||
// generic splitters
|
||||
|
||||
/**
|
||||
* A generic color splitter - from 0xrrggbb to r, g, b with the name of the parameters passed
|
||||
*
|
||||
* @param p_value Number The original _color value
|
||||
* @return Array An array containing the .name and .value of all new properties
|
||||
*/
|
||||
public static function _generic_color_splitter (p_value:Number, p_parameters:Array):Array {
|
||||
var nArray:Array = new Array();
|
||||
nArray.push({name:p_parameters[0], value:AuxFunctions.numberToR(p_value)});
|
||||
nArray.push({name:p_parameters[1], value:AuxFunctions.numberToG(p_value)});
|
||||
nArray.push({name:p_parameters[2], value:AuxFunctions.numberToB(p_value)});
|
||||
return nArray;
|
||||
}
|
||||
|
||||
|
||||
// ==================================================================================================================================
|
||||
// NORMAL SPECIAL PROPERTY functions ------------------------------------------------------------------------------------------------
|
||||
|
||||
/**
|
||||
* Generic function for the textformat properties
|
||||
*/
|
||||
public static function _textFormat_property_get (p_obj:Object, p_parameters:Array, p_extra:Object = null):Number {
|
||||
var fmt:TextFormat = p_obj.getTextFormat();
|
||||
var propertyName:String = p_parameters[0];
|
||||
var isColor:Boolean = p_parameters[1];
|
||||
if (!isColor) {
|
||||
// Standard property
|
||||
return (fmt[propertyName]);
|
||||
} else {
|
||||
// Composite, color channel
|
||||
var colorComponent:String = p_parameters[2];
|
||||
if (colorComponent == "r") return AuxFunctions.numberToR(fmt[propertyName]);
|
||||
if (colorComponent == "g") return AuxFunctions.numberToG(fmt[propertyName]);
|
||||
if (colorComponent == "b") return AuxFunctions.numberToB(fmt[propertyName]);
|
||||
}
|
||||
|
||||
return NaN;
|
||||
}
|
||||
|
||||
public static function _textFormat_property_set (p_obj:Object, p_value:Number, p_parameters:Array, p_extra:Object = null): void {
|
||||
var fmt:TextFormat = p_obj.getTextFormat();
|
||||
var propertyName:String = p_parameters[0];
|
||||
var isColor:Boolean = p_parameters[1];
|
||||
if (!isColor) {
|
||||
// Standard property
|
||||
fmt[propertyName] = p_value;
|
||||
} else {
|
||||
// Composite, color channel
|
||||
var colorComponent:String = p_parameters[2];
|
||||
if (colorComponent == "r") fmt[propertyName] = (fmt[propertyName] & 0xffff) | (p_value << 16);
|
||||
if (colorComponent == "g") fmt[propertyName] = (fmt[propertyName] & 0xff00ff) | (p_value << 8);
|
||||
if (colorComponent == "b") fmt[propertyName] = (fmt[propertyName] & 0xffff00) | p_value;
|
||||
}
|
||||
|
||||
p_obj.defaultTextFormat = fmt;
|
||||
p_obj.setTextFormat(fmt);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
Binary file not shown.
@@ -1,20 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<actionScriptProperties mainApplicationPath="ImageScroll.mxml" projectUUID="a8960ce3-1ebc-4877-b636-9ffcef714fdd" version="6">
|
||||
<compiler additionalCompilerArguments="-locale fr_FR" autoRSLOrdering="true" copyDependentFiles="true" fteInMXComponents="false" generateAccessible="true" htmlExpressInstall="true" htmlGenerate="true" htmlHistoryManagement="true" htmlPlayerVersionCheck="true" includeNetmonSwc="false" outputFolderPath="bin-debug" sourceFolderPath="src" strict="true" targetPlayerVersion="0.0.0" useApolloConfig="false" useDebugRSLSwfs="true" verifyDigests="true" warn="true">
|
||||
<compilerSourcePath/>
|
||||
<libraryPath defaultLinkType="0">
|
||||
<libraryPathEntry kind="4" path="">
|
||||
<excludedEntries>
|
||||
<libraryPathEntry kind="3" linkType="1" path="${PROJECT_FRAMEWORKS}/libs/flex.swc" useDefaultLinkType="false"/>
|
||||
</excludedEntries>
|
||||
</libraryPathEntry>
|
||||
<libraryPathEntry kind="1" linkType="1" path="libs"/>
|
||||
</libraryPath>
|
||||
<sourceAttachmentPath/>
|
||||
</compiler>
|
||||
<applications>
|
||||
<application path="ImageScroll.mxml"/>
|
||||
</applications>
|
||||
<modules/>
|
||||
<buildCSSFiles/>
|
||||
</actionScriptProperties>
|
@@ -1,2 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<flexProperties enableServiceManager="false" flexServerFeatures="0" flexServerType="0" toolCompile="true" useServerFlexSDK="false" version="2"/>
|
@@ -1,18 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<projectDescription>
|
||||
<name>ImageScroll</name>
|
||||
<comment></comment>
|
||||
<projects>
|
||||
</projects>
|
||||
<buildSpec>
|
||||
<buildCommand>
|
||||
<name>com.adobe.flexbuilder.project.flexbuilder</name>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
</buildSpec>
|
||||
<natures>
|
||||
<nature>com.adobe.flexbuilder.project.flexnature</nature>
|
||||
<nature>com.adobe.flexbuilder.project.actionscriptnature</nature>
|
||||
</natures>
|
||||
</projectDescription>
|
@@ -1,292 +0,0 @@
|
||||
// Flash Player Version Detection - Rev 1.6
|
||||
// Detect Client Browser type
|
||||
// Copyright(c) 2005-2006 Adobe Macromedia Software, LLC. All rights reserved.
|
||||
var isIE = (navigator.appVersion.indexOf("MSIE") != -1) ? true : false;
|
||||
var isWin = (navigator.appVersion.toLowerCase().indexOf("win") != -1) ? true : false;
|
||||
var isOpera = (navigator.userAgent.indexOf("Opera") != -1) ? true : false;
|
||||
|
||||
function ControlVersion()
|
||||
{
|
||||
var version;
|
||||
var axo;
|
||||
var e;
|
||||
|
||||
// NOTE : new ActiveXObject(strFoo) throws an exception if strFoo isn't in the registry
|
||||
|
||||
try {
|
||||
// version will be set for 7.X or greater players
|
||||
axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7");
|
||||
version = axo.GetVariable("$version");
|
||||
} catch (e) {
|
||||
}
|
||||
|
||||
if (!version)
|
||||
{
|
||||
try {
|
||||
// version will be set for 6.X players only
|
||||
axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");
|
||||
|
||||
// installed player is some revision of 6.0
|
||||
// GetVariable("$version") crashes for versions 6.0.22 through 6.0.29,
|
||||
// so we have to be careful.
|
||||
|
||||
// default to the first public version
|
||||
version = "WIN 6,0,21,0";
|
||||
|
||||
// throws if AllowScripAccess does not exist (introduced in 6.0r47)
|
||||
axo.AllowScriptAccess = "always";
|
||||
|
||||
// safe to call for 6.0r47 or greater
|
||||
version = axo.GetVariable("$version");
|
||||
|
||||
} catch (e) {
|
||||
}
|
||||
}
|
||||
|
||||
if (!version)
|
||||
{
|
||||
try {
|
||||
// version will be set for 4.X or 5.X player
|
||||
axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.3");
|
||||
version = axo.GetVariable("$version");
|
||||
} catch (e) {
|
||||
}
|
||||
}
|
||||
|
||||
if (!version)
|
||||
{
|
||||
try {
|
||||
// version will be set for 3.X player
|
||||
axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.3");
|
||||
version = "WIN 3,0,18,0";
|
||||
} catch (e) {
|
||||
}
|
||||
}
|
||||
|
||||
if (!version)
|
||||
{
|
||||
try {
|
||||
// version will be set for 2.X player
|
||||
axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash");
|
||||
version = "WIN 2,0,0,11";
|
||||
} catch (e) {
|
||||
version = -1;
|
||||
}
|
||||
}
|
||||
|
||||
return version;
|
||||
}
|
||||
|
||||
// JavaScript helper required to detect Flash Player PlugIn version information
|
||||
function GetSwfVer(){
|
||||
// NS/Opera version >= 3 check for Flash plugin in plugin array
|
||||
var flashVer = -1;
|
||||
|
||||
if (navigator.plugins != null && navigator.plugins.length > 0) {
|
||||
if (navigator.plugins["Shockwave Flash 2.0"] || navigator.plugins["Shockwave Flash"]) {
|
||||
var swVer2 = navigator.plugins["Shockwave Flash 2.0"] ? " 2.0" : "";
|
||||
var flashDescription = navigator.plugins["Shockwave Flash" + swVer2].description;
|
||||
var descArray = flashDescription.split(" ");
|
||||
var tempArrayMajor = descArray[2].split(".");
|
||||
var versionMajor = tempArrayMajor[0];
|
||||
var versionMinor = tempArrayMajor[1];
|
||||
var versionRevision = descArray[3];
|
||||
if (versionRevision == "") {
|
||||
versionRevision = descArray[4];
|
||||
}
|
||||
if (versionRevision[0] == "d") {
|
||||
versionRevision = versionRevision.substring(1);
|
||||
} else if (versionRevision[0] == "r") {
|
||||
versionRevision = versionRevision.substring(1);
|
||||
if (versionRevision.indexOf("d") > 0) {
|
||||
versionRevision = versionRevision.substring(0, versionRevision.indexOf("d"));
|
||||
}
|
||||
} else if (versionRevision[0] == "b") {
|
||||
versionRevision = versionRevision.substring(1);
|
||||
}
|
||||
var flashVer = versionMajor + "." + versionMinor + "." + versionRevision;
|
||||
}
|
||||
}
|
||||
// MSN/WebTV 2.6 supports Flash 4
|
||||
else if (navigator.userAgent.toLowerCase().indexOf("webtv/2.6") != -1) flashVer = 4;
|
||||
// WebTV 2.5 supports Flash 3
|
||||
else if (navigator.userAgent.toLowerCase().indexOf("webtv/2.5") != -1) flashVer = 3;
|
||||
// older WebTV supports Flash 2
|
||||
else if (navigator.userAgent.toLowerCase().indexOf("webtv") != -1) flashVer = 2;
|
||||
else if ( isIE && isWin && !isOpera ) {
|
||||
flashVer = ControlVersion();
|
||||
}
|
||||
return flashVer;
|
||||
}
|
||||
|
||||
// When called with reqMajorVer, reqMinorVer, reqRevision returns true if that version or greater is available
|
||||
function DetectFlashVer(reqMajorVer, reqMinorVer, reqRevision)
|
||||
{
|
||||
versionStr = GetSwfVer();
|
||||
if (versionStr == -1 ) {
|
||||
return false;
|
||||
} else if (versionStr != 0) {
|
||||
if(isIE && isWin && !isOpera) {
|
||||
// Given "WIN 2,0,0,11"
|
||||
tempArray = versionStr.split(" "); // ["WIN", "2,0,0,11"]
|
||||
tempString = tempArray[1]; // "2,0,0,11"
|
||||
versionArray = tempString.split(","); // ['2', '0', '0', '11']
|
||||
} else {
|
||||
versionArray = versionStr.split(".");
|
||||
}
|
||||
var versionMajor = versionArray[0];
|
||||
var versionMinor = versionArray[1];
|
||||
var versionRevision = versionArray[2];
|
||||
|
||||
// is the major.revision >= requested major.revision AND the minor version >= requested minor
|
||||
if (versionMajor > parseFloat(reqMajorVer)) {
|
||||
return true;
|
||||
} else if (versionMajor == parseFloat(reqMajorVer)) {
|
||||
if (versionMinor > parseFloat(reqMinorVer))
|
||||
return true;
|
||||
else if (versionMinor == parseFloat(reqMinorVer)) {
|
||||
if (versionRevision >= parseFloat(reqRevision))
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
function AC_AddExtension(src, ext)
|
||||
{
|
||||
var qIndex = src.indexOf('?');
|
||||
if ( qIndex != -1)
|
||||
{
|
||||
// Add the extention (if needed) before the query params
|
||||
var path = src.substring(0, qIndex);
|
||||
if (path.length >= ext.length && path.lastIndexOf(ext) == (path.length - ext.length))
|
||||
return src;
|
||||
else
|
||||
return src.replace(/\?/, ext+'?');
|
||||
}
|
||||
else
|
||||
{
|
||||
// Add the extension (if needed) to the end of the URL
|
||||
if (src.length >= ext.length && src.lastIndexOf(ext) == (src.length - ext.length))
|
||||
return src; // Already have extension
|
||||
else
|
||||
return src + ext;
|
||||
}
|
||||
}
|
||||
|
||||
function AC_Generateobj(objAttrs, params, embedAttrs)
|
||||
{
|
||||
var str = '';
|
||||
if (isIE && isWin && !isOpera)
|
||||
{
|
||||
str += '<object ';
|
||||
for (var i in objAttrs)
|
||||
str += i + '="' + objAttrs[i] + '" ';
|
||||
str += '>';
|
||||
for (var i in params)
|
||||
str += '<param name="' + i + '" value="' + params[i] + '" /> ';
|
||||
str += '</object>';
|
||||
} else {
|
||||
str += '<embed ';
|
||||
for (var i in embedAttrs)
|
||||
str += i + '="' + embedAttrs[i] + '" ';
|
||||
str += '> </embed>';
|
||||
}
|
||||
|
||||
document.write(str);
|
||||
}
|
||||
|
||||
function AC_FL_RunContent(){
|
||||
var ret =
|
||||
AC_GetArgs
|
||||
( arguments, ".swf", "movie", "clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"
|
||||
, "application/x-shockwave-flash"
|
||||
);
|
||||
AC_Generateobj(ret.objAttrs, ret.params, ret.embedAttrs);
|
||||
}
|
||||
|
||||
function AC_GetArgs(args, ext, srcParamName, classid, mimeType){
|
||||
var ret = new Object();
|
||||
ret.embedAttrs = new Object();
|
||||
ret.params = new Object();
|
||||
ret.objAttrs = new Object();
|
||||
for (var i=0; i < args.length; i=i+2){
|
||||
var currArg = args[i].toLowerCase();
|
||||
|
||||
switch (currArg){
|
||||
case "classid":
|
||||
break;
|
||||
case "pluginspage":
|
||||
ret.embedAttrs[args[i]] = args[i+1];
|
||||
break;
|
||||
case "src":
|
||||
case "movie":
|
||||
args[i+1] = AC_AddExtension(args[i+1], ext);
|
||||
ret.embedAttrs["src"] = args[i+1];
|
||||
ret.params[srcParamName] = args[i+1];
|
||||
break;
|
||||
case "onafterupdate":
|
||||
case "onbeforeupdate":
|
||||
case "onblur":
|
||||
case "oncellchange":
|
||||
case "onclick":
|
||||
case "ondblClick":
|
||||
case "ondrag":
|
||||
case "ondragend":
|
||||
case "ondragenter":
|
||||
case "ondragleave":
|
||||
case "ondragover":
|
||||
case "ondrop":
|
||||
case "onfinish":
|
||||
case "onfocus":
|
||||
case "onhelp":
|
||||
case "onmousedown":
|
||||
case "onmouseup":
|
||||
case "onmouseover":
|
||||
case "onmousemove":
|
||||
case "onmouseout":
|
||||
case "onkeypress":
|
||||
case "onkeydown":
|
||||
case "onkeyup":
|
||||
case "onload":
|
||||
case "onlosecapture":
|
||||
case "onpropertychange":
|
||||
case "onreadystatechange":
|
||||
case "onrowsdelete":
|
||||
case "onrowenter":
|
||||
case "onrowexit":
|
||||
case "onrowsinserted":
|
||||
case "onstart":
|
||||
case "onscroll":
|
||||
case "onbeforeeditfocus":
|
||||
case "onactivate":
|
||||
case "onbeforedeactivate":
|
||||
case "ondeactivate":
|
||||
case "type":
|
||||
case "codebase":
|
||||
ret.objAttrs[args[i]] = args[i+1];
|
||||
break;
|
||||
case "id":
|
||||
case "width":
|
||||
case "height":
|
||||
case "align":
|
||||
case "vspace":
|
||||
case "hspace":
|
||||
case "class":
|
||||
case "title":
|
||||
case "accesskey":
|
||||
case "name":
|
||||
case "tabindex":
|
||||
ret.embedAttrs[args[i]] = ret.objAttrs[args[i]] = args[i+1];
|
||||
break;
|
||||
default:
|
||||
ret.embedAttrs[args[i]] = ret.params[args[i]] = args[i+1];
|
||||
}
|
||||
}
|
||||
ret.objAttrs["classid"] = classid;
|
||||
if (mimeType) ret.embedAttrs["type"] = mimeType;
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
@@ -1,105 +0,0 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<!-- saved from url=(0014)about:internet -->
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
|
||||
<!--
|
||||
Smart developers always View Source.
|
||||
|
||||
This application was built using Adobe Flex, an open source framework
|
||||
for building rich Internet applications that get delivered via the
|
||||
Flash Player or to desktops via Adobe AIR.
|
||||
|
||||
Learn more about Flex at http://flex.org
|
||||
// -->
|
||||
<head>
|
||||
<title></title>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
<!-- Include CSS to eliminate any default margins/padding and set the height of the html element and
|
||||
the body element to 100%, because Firefox, or any Gecko based browser, interprets percentage as
|
||||
the percentage of the height of its parent container, which has to be set explicitly. Initially,
|
||||
don't display flashContent div so it won't show if JavaScript disabled.
|
||||
-->
|
||||
<style type="text/css" media="screen">
|
||||
html, body { height:100%; }
|
||||
body { margin:0; padding:0; overflow:auto; text-align:center;
|
||||
background-color: #ffffff; }
|
||||
#flashContent { display:none; }
|
||||
</style>
|
||||
|
||||
<!-- Enable Browser History by replacing useBrowserHistory tokens with two hyphens -->
|
||||
<!-- BEGIN Browser History required section -->
|
||||
<link rel="stylesheet" type="text/css" href="history/history.css" />
|
||||
<script type="text/javascript" src="history/history.js"></script>
|
||||
<!-- END Browser History required section -->
|
||||
|
||||
<script type="text/javascript" src="swfobject.js"></script>
|
||||
<script type="text/javascript">
|
||||
<!-- For version detection, set to min. required Flash Player version, or 0 (or 0.0.0), for no version detection. -->
|
||||
var swfVersionStr = "10.0.0";
|
||||
<!-- To use express install, set to playerProductInstall.swf, otherwise the empty string. -->
|
||||
var xiSwfUrlStr = "playerProductInstall.swf";
|
||||
var flashvars = {};
|
||||
var params = {};
|
||||
params.quality = "high";
|
||||
params.bgcolor = "#ffffff";
|
||||
params.allowscriptaccess = "sameDomain";
|
||||
params.allowfullscreen = "true";
|
||||
var attributes = {};
|
||||
attributes.id = "ImageScroll";
|
||||
attributes.name = "ImageScroll";
|
||||
attributes.align = "middle";
|
||||
swfobject.embedSWF(
|
||||
"ImageScroll.swf", "flashContent",
|
||||
"100%", "100%",
|
||||
swfVersionStr, xiSwfUrlStr,
|
||||
flashvars, params, attributes);
|
||||
<!-- JavaScript enabled so display the flashContent div in case it is not replaced with a swf object. -->
|
||||
swfobject.createCSS("#flashContent", "display:block;text-align:left;");
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<!-- SWFObject's dynamic embed method replaces this alternative HTML content with Flash content when enough
|
||||
JavaScript and Flash plug-in support is available. The div is initially hidden so that it doesn't show
|
||||
when JavaScript is disabled.
|
||||
-->
|
||||
<div id="flashContent">
|
||||
<p>
|
||||
To view this page ensure that Adobe Flash Player version
|
||||
10.0.0 or greater is installed.
|
||||
</p>
|
||||
<script type="text/javascript">
|
||||
var pageHost = ((document.location.protocol == "https:") ? "https://" : "http://");
|
||||
document.write("<a href='http://www.adobe.com/go/getflashplayer'><img src='"
|
||||
+ pageHost + "www.adobe.com/images/shared/download_buttons/get_flash_player.gif' alt='Get Adobe Flash player' /></a>" );
|
||||
</script>
|
||||
</div>
|
||||
|
||||
<noscript>
|
||||
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="100%" height="100%" id="ImageScroll">
|
||||
<param name="movie" value="ImageScroll.swf" />
|
||||
<param name="quality" value="high" />
|
||||
<param name="bgcolor" value="#ffffff" />
|
||||
<param name="allowScriptAccess" value="sameDomain" />
|
||||
<param name="allowFullScreen" value="true" />
|
||||
<!--[if !IE]>-->
|
||||
<object type="application/x-shockwave-flash" data="ImageScroll.swf" width="100%" height="100%">
|
||||
<param name="quality" value="high" />
|
||||
<param name="bgcolor" value="#ffffff" />
|
||||
<param name="allowScriptAccess" value="sameDomain" />
|
||||
<param name="allowFullScreen" value="true" />
|
||||
<!--<![endif]-->
|
||||
<!--[if gte IE 6]>-->
|
||||
<p>
|
||||
Either scripts and active content are not permitted to run or Adobe Flash Player version
|
||||
10.0.0 or greater is not installed.
|
||||
</p>
|
||||
<!--<![endif]-->
|
||||
<a href="http://www.adobe.com/go/getflashplayer">
|
||||
<img src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif" alt="Get Adobe Flash Player" />
|
||||
</a>
|
||||
<!--[if !IE]>-->
|
||||
</object>
|
||||
<!--<![endif]-->
|
||||
</object>
|
||||
</noscript>
|
||||
</body>
|
||||
</html>
|
Binary file not shown.
Binary file not shown.
@@ -1,6 +0,0 @@
|
||||
/* This CSS stylesheet defines styles used by required elements in a flex application page that supports browser history */
|
||||
|
||||
#ie_historyFrame { width: 0px; height: 0px; display:none }
|
||||
#firefox_anchorDiv { width: 0px; height: 0px; display:none }
|
||||
#safari_formDiv { width: 0px; height: 0px; display:none }
|
||||
#safari_rememberDiv { width: 0px; height: 0px; display:none }
|
@@ -1,710 +0,0 @@
|
||||
BrowserHistoryUtils = {
|
||||
addEvent: function(elm, evType, fn, useCapture) {
|
||||
useCapture = useCapture || false;
|
||||
if (elm.addEventListener) {
|
||||
elm.addEventListener(evType, fn, useCapture);
|
||||
return true;
|
||||
}
|
||||
else if (elm.attachEvent) {
|
||||
var r = elm.attachEvent('on' + evType, fn);
|
||||
return r;
|
||||
}
|
||||
else {
|
||||
elm['on' + evType] = fn;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
BrowserHistory = (function() {
|
||||
// type of browser
|
||||
var browser = {
|
||||
ie: false,
|
||||
ie8: false,
|
||||
firefox: false,
|
||||
safari: false,
|
||||
opera: false,
|
||||
version: -1
|
||||
};
|
||||
|
||||
// if setDefaultURL has been called, our first clue
|
||||
// that the SWF is ready and listening
|
||||
//var swfReady = false;
|
||||
|
||||
// the URL we'll send to the SWF once it is ready
|
||||
//var pendingURL = '';
|
||||
|
||||
// Default app state URL to use when no fragment ID present
|
||||
var defaultHash = '';
|
||||
|
||||
// Last-known app state URL
|
||||
var currentHref = document.location.href;
|
||||
|
||||
// Initial URL (used only by IE)
|
||||
var initialHref = document.location.href;
|
||||
|
||||
// Initial URL (used only by IE)
|
||||
var initialHash = document.location.hash;
|
||||
|
||||
// History frame source URL prefix (used only by IE)
|
||||
var historyFrameSourcePrefix = 'history/historyFrame.html?';
|
||||
|
||||
// History maintenance (used only by Safari)
|
||||
var currentHistoryLength = -1;
|
||||
|
||||
var historyHash = [];
|
||||
|
||||
var initialState = createState(initialHref, initialHref + '#' + initialHash, initialHash);
|
||||
|
||||
var backStack = [];
|
||||
var forwardStack = [];
|
||||
|
||||
var currentObjectId = null;
|
||||
|
||||
//UserAgent detection
|
||||
var useragent = navigator.userAgent.toLowerCase();
|
||||
|
||||
if (useragent.indexOf("opera") != -1) {
|
||||
browser.opera = true;
|
||||
} else if (useragent.indexOf("msie") != -1) {
|
||||
browser.ie = true;
|
||||
browser.version = parseFloat(useragent.substring(useragent.indexOf('msie') + 4));
|
||||
if (browser.version == 8)
|
||||
{
|
||||
browser.ie = false;
|
||||
browser.ie8 = true;
|
||||
}
|
||||
} else if (useragent.indexOf("safari") != -1) {
|
||||
browser.safari = true;
|
||||
browser.version = parseFloat(useragent.substring(useragent.indexOf('safari') + 7));
|
||||
} else if (useragent.indexOf("gecko") != -1) {
|
||||
browser.firefox = true;
|
||||
}
|
||||
|
||||
if (browser.ie == true && browser.version == 7) {
|
||||
window["_ie_firstload"] = false;
|
||||
}
|
||||
|
||||
function hashChangeHandler()
|
||||
{
|
||||
currentHref = document.location.href;
|
||||
var flexAppUrl = getHash();
|
||||
//ADR: to fix multiple
|
||||
if (typeof BrowserHistory_multiple != "undefined" && BrowserHistory_multiple == true) {
|
||||
var pl = getPlayers();
|
||||
for (var i = 0; i < pl.length; i++) {
|
||||
pl[i].browserURLChange(flexAppUrl);
|
||||
}
|
||||
} else {
|
||||
getPlayer().browserURLChange(flexAppUrl);
|
||||
}
|
||||
}
|
||||
|
||||
// Accessor functions for obtaining specific elements of the page.
|
||||
function getHistoryFrame()
|
||||
{
|
||||
return document.getElementById('ie_historyFrame');
|
||||
}
|
||||
|
||||
function getAnchorElement()
|
||||
{
|
||||
return document.getElementById('firefox_anchorDiv');
|
||||
}
|
||||
|
||||
function getFormElement()
|
||||
{
|
||||
return document.getElementById('safari_formDiv');
|
||||
}
|
||||
|
||||
function getRememberElement()
|
||||
{
|
||||
return document.getElementById("safari_remember_field");
|
||||
}
|
||||
|
||||
// Get the Flash player object for performing ExternalInterface callbacks.
|
||||
// Updated for changes to SWFObject2.
|
||||
function getPlayer(id) {
|
||||
var i;
|
||||
|
||||
if (id && document.getElementById(id)) {
|
||||
var r = document.getElementById(id);
|
||||
if (typeof r.SetVariable != "undefined") {
|
||||
return r;
|
||||
}
|
||||
else {
|
||||
var o = r.getElementsByTagName("object");
|
||||
var e = r.getElementsByTagName("embed");
|
||||
for (i = 0; i < o.length; i++) {
|
||||
if (typeof o[i].browserURLChange != "undefined")
|
||||
return o[i];
|
||||
}
|
||||
for (i = 0; i < e.length; i++) {
|
||||
if (typeof e[i].browserURLChange != "undefined")
|
||||
return e[i];
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
var o = document.getElementsByTagName("object");
|
||||
var e = document.getElementsByTagName("embed");
|
||||
for (i = 0; i < e.length; i++) {
|
||||
if (typeof e[i].browserURLChange != "undefined")
|
||||
{
|
||||
return e[i];
|
||||
}
|
||||
}
|
||||
for (i = 0; i < o.length; i++) {
|
||||
if (typeof o[i].browserURLChange != "undefined")
|
||||
{
|
||||
return o[i];
|
||||
}
|
||||
}
|
||||
}
|
||||
return undefined;
|
||||
}
|
||||
|
||||
function getPlayers() {
|
||||
var i;
|
||||
var players = [];
|
||||
if (players.length == 0) {
|
||||
var tmp = document.getElementsByTagName('object');
|
||||
for (i = 0; i < tmp.length; i++)
|
||||
{
|
||||
if (typeof tmp[i].browserURLChange != "undefined")
|
||||
players.push(tmp[i]);
|
||||
}
|
||||
}
|
||||
if (players.length == 0 || players[0].object == null) {
|
||||
var tmp = document.getElementsByTagName('embed');
|
||||
for (i = 0; i < tmp.length; i++)
|
||||
{
|
||||
if (typeof tmp[i].browserURLChange != "undefined")
|
||||
players.push(tmp[i]);
|
||||
}
|
||||
}
|
||||
return players;
|
||||
}
|
||||
|
||||
function getIframeHash() {
|
||||
var doc = getHistoryFrame().contentWindow.document;
|
||||
var hash = String(doc.location.search);
|
||||
if (hash.length == 1 && hash.charAt(0) == "?") {
|
||||
hash = "";
|
||||
}
|
||||
else if (hash.length >= 2 && hash.charAt(0) == "?") {
|
||||
hash = hash.substring(1);
|
||||
}
|
||||
return hash;
|
||||
}
|
||||
|
||||
/* Get the current location hash excluding the '#' symbol. */
|
||||
function getHash() {
|
||||
// It would be nice if we could use document.location.hash here,
|
||||
// but it's faulty sometimes.
|
||||
var idx = document.location.href.indexOf('#');
|
||||
return (idx >= 0) ? document.location.href.substr(idx+1) : '';
|
||||
}
|
||||
|
||||
/* Get the current location hash excluding the '#' symbol. */
|
||||
function setHash(hash) {
|
||||
// It would be nice if we could use document.location.hash here,
|
||||
// but it's faulty sometimes.
|
||||
if (hash == '') hash = '#'
|
||||
document.location.hash = hash;
|
||||
}
|
||||
|
||||
function createState(baseUrl, newUrl, flexAppUrl) {
|
||||
return { 'baseUrl': baseUrl, 'newUrl': newUrl, 'flexAppUrl': flexAppUrl, 'title': null };
|
||||
}
|
||||
|
||||
/* Add a history entry to the browser.
|
||||
* baseUrl: the portion of the location prior to the '#'
|
||||
* newUrl: the entire new URL, including '#' and following fragment
|
||||
* flexAppUrl: the portion of the location following the '#' only
|
||||
*/
|
||||
function addHistoryEntry(baseUrl, newUrl, flexAppUrl) {
|
||||
|
||||
//delete all the history entries
|
||||
forwardStack = [];
|
||||
|
||||
if (browser.ie) {
|
||||
//Check to see if we are being asked to do a navigate for the first
|
||||
//history entry, and if so ignore, because it's coming from the creation
|
||||
//of the history iframe
|
||||
if (flexAppUrl == defaultHash && document.location.href == initialHref && window['_ie_firstload']) {
|
||||
currentHref = initialHref;
|
||||
return;
|
||||
}
|
||||
if ((!flexAppUrl || flexAppUrl == defaultHash) && window['_ie_firstload']) {
|
||||
newUrl = baseUrl + '#' + defaultHash;
|
||||
flexAppUrl = defaultHash;
|
||||
} else {
|
||||
// for IE, tell the history frame to go somewhere without a '#'
|
||||
// in order to get this entry into the browser history.
|
||||
getHistoryFrame().src = historyFrameSourcePrefix + flexAppUrl;
|
||||
}
|
||||
setHash(flexAppUrl);
|
||||
} else {
|
||||
|
||||
//ADR
|
||||
if (backStack.length == 0 && initialState.flexAppUrl == flexAppUrl) {
|
||||
initialState = createState(baseUrl, newUrl, flexAppUrl);
|
||||
} else if(backStack.length > 0 && backStack[backStack.length - 1].flexAppUrl == flexAppUrl) {
|
||||
backStack[backStack.length - 1] = createState(baseUrl, newUrl, flexAppUrl);
|
||||
}
|
||||
|
||||
if (browser.safari) {
|
||||
// for Safari, submit a form whose action points to the desired URL
|
||||
if (browser.version <= 419.3) {
|
||||
var file = window.location.pathname.toString();
|
||||
file = file.substring(file.lastIndexOf("/")+1);
|
||||
getFormElement().innerHTML = '<form name="historyForm" action="'+file+'#' + flexAppUrl + '" method="GET"></form>';
|
||||
//get the current elements and add them to the form
|
||||
var qs = window.location.search.substring(1);
|
||||
var qs_arr = qs.split("&");
|
||||
for (var i = 0; i < qs_arr.length; i++) {
|
||||
var tmp = qs_arr[i].split("=");
|
||||
var elem = document.createElement("input");
|
||||
elem.type = "hidden";
|
||||
elem.name = tmp[0];
|
||||
elem.value = tmp[1];
|
||||
document.forms.historyForm.appendChild(elem);
|
||||
}
|
||||
document.forms.historyForm.submit();
|
||||
} else {
|
||||
top.location.hash = flexAppUrl;
|
||||
}
|
||||
// We also have to maintain the history by hand for Safari
|
||||
historyHash[history.length] = flexAppUrl;
|
||||
_storeStates();
|
||||
} else {
|
||||
// Otherwise, write an anchor into the page and tell the browser to go there
|
||||
addAnchor(flexAppUrl);
|
||||
setHash(flexAppUrl);
|
||||
|
||||
// For IE8 we must restore full focus/activation to our invoking player instance.
|
||||
if (browser.ie8)
|
||||
getPlayer().focus();
|
||||
}
|
||||
}
|
||||
backStack.push(createState(baseUrl, newUrl, flexAppUrl));
|
||||
}
|
||||
|
||||
function _storeStates() {
|
||||
if (browser.safari) {
|
||||
getRememberElement().value = historyHash.join(",");
|
||||
}
|
||||
}
|
||||
|
||||
function handleBackButton() {
|
||||
//The "current" page is always at the top of the history stack.
|
||||
var current = backStack.pop();
|
||||
if (!current) { return; }
|
||||
var last = backStack[backStack.length - 1];
|
||||
if (!last && backStack.length == 0){
|
||||
last = initialState;
|
||||
}
|
||||
forwardStack.push(current);
|
||||
}
|
||||
|
||||
function handleForwardButton() {
|
||||
//summary: private method. Do not call this directly.
|
||||
|
||||
var last = forwardStack.pop();
|
||||
if (!last) { return; }
|
||||
backStack.push(last);
|
||||
}
|
||||
|
||||
function handleArbitraryUrl() {
|
||||
//delete all the history entries
|
||||
forwardStack = [];
|
||||
}
|
||||
|
||||
/* Called periodically to poll to see if we need to detect navigation that has occurred */
|
||||
function checkForUrlChange() {
|
||||
|
||||
if (browser.ie) {
|
||||
if (currentHref != document.location.href && currentHref + '#' != document.location.href) {
|
||||
//This occurs when the user has navigated to a specific URL
|
||||
//within the app, and didn't use browser back/forward
|
||||
//IE seems to have a bug where it stops updating the URL it
|
||||
//shows the end-user at this point, but programatically it
|
||||
//appears to be correct. Do a full app reload to get around
|
||||
//this issue.
|
||||
if (browser.version < 7) {
|
||||
currentHref = document.location.href;
|
||||
document.location.reload();
|
||||
} else {
|
||||
if (getHash() != getIframeHash()) {
|
||||
// this.iframe.src = this.blankURL + hash;
|
||||
var sourceToSet = historyFrameSourcePrefix + getHash();
|
||||
getHistoryFrame().src = sourceToSet;
|
||||
currentHref = document.location.href;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (browser.safari) {
|
||||
// For Safari, we have to check to see if history.length changed.
|
||||
if (currentHistoryLength >= 0 && history.length != currentHistoryLength) {
|
||||
//alert("did change: " + history.length + ", " + historyHash.length + "|" + historyHash[history.length] + "|>" + historyHash.join("|"));
|
||||
var flexAppUrl = getHash();
|
||||
if (browser.version < 528.16 /* Anything earlier than Safari 4.0 */)
|
||||
{
|
||||
// If it did change and we're running Safari 3.x or earlier,
|
||||
// then we have to look the old state up in our hand-maintained
|
||||
// array since document.location.hash won't have changed,
|
||||
// then call back into BrowserManager.
|
||||
currentHistoryLength = history.length;
|
||||
flexAppUrl = historyHash[currentHistoryLength];
|
||||
}
|
||||
|
||||
//ADR: to fix multiple
|
||||
if (typeof BrowserHistory_multiple != "undefined" && BrowserHistory_multiple == true) {
|
||||
var pl = getPlayers();
|
||||
for (var i = 0; i < pl.length; i++) {
|
||||
pl[i].browserURLChange(flexAppUrl);
|
||||
}
|
||||
} else {
|
||||
getPlayer().browserURLChange(flexAppUrl);
|
||||
}
|
||||
_storeStates();
|
||||
}
|
||||
}
|
||||
if (browser.firefox) {
|
||||
if (currentHref != document.location.href) {
|
||||
var bsl = backStack.length;
|
||||
|
||||
var urlActions = {
|
||||
back: false,
|
||||
forward: false,
|
||||
set: false
|
||||
}
|
||||
|
||||
if ((window.location.hash == initialHash || window.location.href == initialHref) && (bsl == 1)) {
|
||||
urlActions.back = true;
|
||||
// FIXME: could this ever be a forward button?
|
||||
// we can't clear it because we still need to check for forwards. Ugg.
|
||||
// clearInterval(this.locationTimer);
|
||||
handleBackButton();
|
||||
}
|
||||
|
||||
// first check to see if we could have gone forward. We always halt on
|
||||
// a no-hash item.
|
||||
if (forwardStack.length > 0) {
|
||||
if (forwardStack[forwardStack.length-1].flexAppUrl == getHash()) {
|
||||
urlActions.forward = true;
|
||||
handleForwardButton();
|
||||
}
|
||||
}
|
||||
|
||||
// ok, that didn't work, try someplace back in the history stack
|
||||
if ((bsl >= 2) && (backStack[bsl - 2])) {
|
||||
if (backStack[bsl - 2].flexAppUrl == getHash()) {
|
||||
urlActions.back = true;
|
||||
handleBackButton();
|
||||
}
|
||||
}
|
||||
|
||||
if (!urlActions.back && !urlActions.forward) {
|
||||
var foundInStacks = {
|
||||
back: -1,
|
||||
forward: -1
|
||||
}
|
||||
|
||||
for (var i = 0; i < backStack.length; i++) {
|
||||
if (backStack[i].flexAppUrl == getHash() && i != (bsl - 2)) {
|
||||
arbitraryUrl = true;
|
||||
foundInStacks.back = i;
|
||||
}
|
||||
}
|
||||
for (var i = 0; i < forwardStack.length; i++) {
|
||||
if (forwardStack[i].flexAppUrl == getHash() && i != (bsl - 2)) {
|
||||
arbitraryUrl = true;
|
||||
foundInStacks.forward = i;
|
||||
}
|
||||
}
|
||||
handleArbitraryUrl();
|
||||
}
|
||||
|
||||
// Firefox changed; do a callback into BrowserManager to tell it.
|
||||
currentHref = document.location.href;
|
||||
var flexAppUrl = getHash();
|
||||
//ADR: to fix multiple
|
||||
if (typeof BrowserHistory_multiple != "undefined" && BrowserHistory_multiple == true) {
|
||||
var pl = getPlayers();
|
||||
for (var i = 0; i < pl.length; i++) {
|
||||
pl[i].browserURLChange(flexAppUrl);
|
||||
}
|
||||
} else {
|
||||
getPlayer().browserURLChange(flexAppUrl);
|
||||
}
|
||||
}
|
||||
}
|
||||
//setTimeout(checkForUrlChange, 50);
|
||||
}
|
||||
|
||||
/* Write an anchor into the page to legitimize it as a URL for Firefox et al. */
|
||||
function addAnchor(flexAppUrl)
|
||||
{
|
||||
if (document.getElementsByName(flexAppUrl).length == 0) {
|
||||
getAnchorElement().innerHTML += "<a name='" + flexAppUrl + "'>" + flexAppUrl + "</a>";
|
||||
}
|
||||
}
|
||||
|
||||
var _initialize = function () {
|
||||
if (browser.ie)
|
||||
{
|
||||
var scripts = document.getElementsByTagName('script');
|
||||
for (var i = 0, s; s = scripts[i]; i++) {
|
||||
if (s.src.indexOf("history.js") > -1) {
|
||||
var iframe_location = (new String(s.src)).replace("history.js", "historyFrame.html");
|
||||
}
|
||||
}
|
||||
historyFrameSourcePrefix = iframe_location + "?";
|
||||
var src = historyFrameSourcePrefix;
|
||||
|
||||
var iframe = document.createElement("iframe");
|
||||
iframe.id = 'ie_historyFrame';
|
||||
iframe.name = 'ie_historyFrame';
|
||||
iframe.src = 'javascript:false;';
|
||||
|
||||
try {
|
||||
document.body.appendChild(iframe);
|
||||
} catch(e) {
|
||||
setTimeout(function() {
|
||||
document.body.appendChild(iframe);
|
||||
}, 0);
|
||||
}
|
||||
}
|
||||
|
||||
if (browser.safari)
|
||||
{
|
||||
var rememberDiv = document.createElement("div");
|
||||
rememberDiv.id = 'safari_rememberDiv';
|
||||
document.body.appendChild(rememberDiv);
|
||||
rememberDiv.innerHTML = '<input type="text" id="safari_remember_field" style="width: 500px;">';
|
||||
|
||||
var formDiv = document.createElement("div");
|
||||
formDiv.id = 'safari_formDiv';
|
||||
document.body.appendChild(formDiv);
|
||||
|
||||
var reloader_content = document.createElement('div');
|
||||
reloader_content.id = 'safarireloader';
|
||||
var scripts = document.getElementsByTagName('script');
|
||||
for (var i = 0, s; s = scripts[i]; i++) {
|
||||
if (s.src.indexOf("history.js") > -1) {
|
||||
html = (new String(s.src)).replace(".js", ".html");
|
||||
}
|
||||
}
|
||||
reloader_content.innerHTML = '<iframe id="safarireloader-iframe" src="about:blank" frameborder="no" scrolling="no"></iframe>';
|
||||
document.body.appendChild(reloader_content);
|
||||
reloader_content.style.position = 'absolute';
|
||||
reloader_content.style.left = reloader_content.style.top = '-9999px';
|
||||
iframe = reloader_content.getElementsByTagName('iframe')[0];
|
||||
|
||||
if (document.getElementById("safari_remember_field").value != "" ) {
|
||||
historyHash = document.getElementById("safari_remember_field").value.split(",");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if (browser.firefox || browser.ie8)
|
||||
{
|
||||
var anchorDiv = document.createElement("div");
|
||||
anchorDiv.id = 'firefox_anchorDiv';
|
||||
document.body.appendChild(anchorDiv);
|
||||
}
|
||||
|
||||
if (browser.ie8)
|
||||
document.body.onhashchange = hashChangeHandler;
|
||||
//setTimeout(checkForUrlChange, 50);
|
||||
}
|
||||
|
||||
return {
|
||||
historyHash: historyHash,
|
||||
backStack: function() { return backStack; },
|
||||
forwardStack: function() { return forwardStack },
|
||||
getPlayer: getPlayer,
|
||||
initialize: function(src) {
|
||||
_initialize(src);
|
||||
},
|
||||
setURL: function(url) {
|
||||
document.location.href = url;
|
||||
},
|
||||
getURL: function() {
|
||||
return document.location.href;
|
||||
},
|
||||
getTitle: function() {
|
||||
return document.title;
|
||||
},
|
||||
setTitle: function(title) {
|
||||
try {
|
||||
backStack[backStack.length - 1].title = title;
|
||||
} catch(e) { }
|
||||
//if on safari, set the title to be the empty string.
|
||||
if (browser.safari) {
|
||||
if (title == "") {
|
||||
try {
|
||||
var tmp = window.location.href.toString();
|
||||
title = tmp.substring((tmp.lastIndexOf("/")+1), tmp.lastIndexOf("#"));
|
||||
} catch(e) {
|
||||
title = "";
|
||||
}
|
||||
}
|
||||
}
|
||||
document.title = title;
|
||||
},
|
||||
setDefaultURL: function(def)
|
||||
{
|
||||
defaultHash = def;
|
||||
def = getHash();
|
||||
//trailing ? is important else an extra frame gets added to the history
|
||||
//when navigating back to the first page. Alternatively could check
|
||||
//in history frame navigation to compare # and ?.
|
||||
if (browser.ie)
|
||||
{
|
||||
window['_ie_firstload'] = true;
|
||||
var sourceToSet = historyFrameSourcePrefix + def;
|
||||
var func = function() {
|
||||
getHistoryFrame().src = sourceToSet;
|
||||
window.location.replace("#" + def);
|
||||
setInterval(checkForUrlChange, 50);
|
||||
}
|
||||
try {
|
||||
func();
|
||||
} catch(e) {
|
||||
window.setTimeout(function() { func(); }, 0);
|
||||
}
|
||||
}
|
||||
|
||||
if (browser.safari)
|
||||
{
|
||||
currentHistoryLength = history.length;
|
||||
if (historyHash.length == 0) {
|
||||
historyHash[currentHistoryLength] = def;
|
||||
var newloc = "#" + def;
|
||||
window.location.replace(newloc);
|
||||
} else {
|
||||
//alert(historyHash[historyHash.length-1]);
|
||||
}
|
||||
//setHash(def);
|
||||
setInterval(checkForUrlChange, 50);
|
||||
}
|
||||
|
||||
|
||||
if (browser.firefox || browser.opera)
|
||||
{
|
||||
var reg = new RegExp("#" + def + "$");
|
||||
if (window.location.toString().match(reg)) {
|
||||
} else {
|
||||
var newloc ="#" + def;
|
||||
window.location.replace(newloc);
|
||||
}
|
||||
setInterval(checkForUrlChange, 50);
|
||||
//setHash(def);
|
||||
}
|
||||
|
||||
},
|
||||
|
||||
/* Set the current browser URL; called from inside BrowserManager to propagate
|
||||
* the application state out to the container.
|
||||
*/
|
||||
setBrowserURL: function(flexAppUrl, objectId) {
|
||||
if (browser.ie && typeof objectId != "undefined") {
|
||||
currentObjectId = objectId;
|
||||
}
|
||||
//fromIframe = fromIframe || false;
|
||||
//fromFlex = fromFlex || false;
|
||||
//alert("setBrowserURL: " + flexAppUrl);
|
||||
//flexAppUrl = (flexAppUrl == "") ? defaultHash : flexAppUrl ;
|
||||
|
||||
var pos = document.location.href.indexOf('#');
|
||||
var baseUrl = pos != -1 ? document.location.href.substr(0, pos) : document.location.href;
|
||||
var newUrl = baseUrl + '#' + flexAppUrl;
|
||||
|
||||
if (document.location.href != newUrl && document.location.href + '#' != newUrl) {
|
||||
currentHref = newUrl;
|
||||
addHistoryEntry(baseUrl, newUrl, flexAppUrl);
|
||||
currentHistoryLength = history.length;
|
||||
}
|
||||
},
|
||||
|
||||
browserURLChange: function(flexAppUrl) {
|
||||
var objectId = null;
|
||||
if (browser.ie && currentObjectId != null) {
|
||||
objectId = currentObjectId;
|
||||
}
|
||||
pendingURL = '';
|
||||
|
||||
if (typeof BrowserHistory_multiple != "undefined" && BrowserHistory_multiple == true) {
|
||||
var pl = getPlayers();
|
||||
for (var i = 0; i < pl.length; i++) {
|
||||
try {
|
||||
pl[i].browserURLChange(flexAppUrl);
|
||||
} catch(e) { }
|
||||
}
|
||||
} else {
|
||||
try {
|
||||
getPlayer(objectId).browserURLChange(flexAppUrl);
|
||||
} catch(e) { }
|
||||
}
|
||||
|
||||
currentObjectId = null;
|
||||
},
|
||||
getUserAgent: function() {
|
||||
return navigator.userAgent;
|
||||
},
|
||||
getPlatform: function() {
|
||||
return navigator.platform;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
})();
|
||||
|
||||
// Initialization
|
||||
|
||||
// Automated unit testing and other diagnostics
|
||||
|
||||
function setURL(url)
|
||||
{
|
||||
document.location.href = url;
|
||||
}
|
||||
|
||||
function backButton()
|
||||
{
|
||||
history.back();
|
||||
}
|
||||
|
||||
function forwardButton()
|
||||
{
|
||||
history.forward();
|
||||
}
|
||||
|
||||
function goForwardOrBackInHistory(step)
|
||||
{
|
||||
history.go(step);
|
||||
}
|
||||
|
||||
//BrowserHistoryUtils.addEvent(window, "load", function() { BrowserHistory.initialize(); });
|
||||
(function(i) {
|
||||
var u =navigator.userAgent;var e=/*@cc_on!@*/false;
|
||||
var st = setTimeout;
|
||||
if(/webkit/i.test(u)){
|
||||
st(function(){
|
||||
var dr=document.readyState;
|
||||
if(dr=="loaded"||dr=="complete"){i()}
|
||||
else{st(arguments.callee,10);}},10);
|
||||
} else if((/mozilla/i.test(u)&&!/(compati)/.test(u)) || (/opera/i.test(u))){
|
||||
document.addEventListener("DOMContentLoaded",i,false);
|
||||
} else if(e){
|
||||
(function(){
|
||||
var t=document.createElement('doc:rdy');
|
||||
try{t.doScroll('left');
|
||||
i();t=null;
|
||||
}catch(e){st(arguments.callee,0);}})();
|
||||
} else{
|
||||
window.onload=i;
|
||||
}
|
||||
})( function() {BrowserHistory.initialize();} );
|
@@ -1,29 +0,0 @@
|
||||
<html>
|
||||
<head>
|
||||
<META HTTP-EQUIV="Pragma" CONTENT="no-cache">
|
||||
<META HTTP-EQUIV="Expires" CONTENT="-1">
|
||||
</head>
|
||||
<body>
|
||||
<script>
|
||||
function processUrl()
|
||||
{
|
||||
|
||||
var pos = url.indexOf("?");
|
||||
url = pos != -1 ? url.substr(pos + 1) : "";
|
||||
if (!parent._ie_firstload) {
|
||||
parent.BrowserHistory.setBrowserURL(url);
|
||||
try {
|
||||
parent.BrowserHistory.browserURLChange(url);
|
||||
} catch(e) { }
|
||||
} else {
|
||||
parent._ie_firstload = false;
|
||||
}
|
||||
}
|
||||
|
||||
var url = document.location.href;
|
||||
processUrl();
|
||||
document.write(encodeURIComponent(url));
|
||||
</script>
|
||||
Hidden frame for Browser History support.
|
||||
</body>
|
||||
</html>
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -1,777 +0,0 @@
|
||||
/*! SWFObject v2.2 <http://code.google.com/p/swfobject/>
|
||||
is released under the MIT License <http://www.opensource.org/licenses/mit-license.php>
|
||||
*/
|
||||
|
||||
var swfobject = function() {
|
||||
|
||||
var UNDEF = "undefined",
|
||||
OBJECT = "object",
|
||||
SHOCKWAVE_FLASH = "Shockwave Flash",
|
||||
SHOCKWAVE_FLASH_AX = "ShockwaveFlash.ShockwaveFlash",
|
||||
FLASH_MIME_TYPE = "application/x-shockwave-flash",
|
||||
EXPRESS_INSTALL_ID = "SWFObjectExprInst",
|
||||
ON_READY_STATE_CHANGE = "onreadystatechange",
|
||||
|
||||
win = window,
|
||||
doc = document,
|
||||
nav = navigator,
|
||||
|
||||
plugin = false,
|
||||
domLoadFnArr = [main],
|
||||
regObjArr = [],
|
||||
objIdArr = [],
|
||||
listenersArr = [],
|
||||
storedAltContent,
|
||||
storedAltContentId,
|
||||
storedCallbackFn,
|
||||
storedCallbackObj,
|
||||
isDomLoaded = false,
|
||||
isExpressInstallActive = false,
|
||||
dynamicStylesheet,
|
||||
dynamicStylesheetMedia,
|
||||
autoHideShow = true,
|
||||
|
||||
/* Centralized function for browser feature detection
|
||||
- User agent string detection is only used when no good alternative is possible
|
||||
- Is executed directly for optimal performance
|
||||
*/
|
||||
ua = function() {
|
||||
var w3cdom = typeof doc.getElementById != UNDEF && typeof doc.getElementsByTagName != UNDEF && typeof doc.createElement != UNDEF,
|
||||
u = nav.userAgent.toLowerCase(),
|
||||
p = nav.platform.toLowerCase(),
|
||||
windows = p ? /win/.test(p) : /win/.test(u),
|
||||
mac = p ? /mac/.test(p) : /mac/.test(u),
|
||||
webkit = /webkit/.test(u) ? parseFloat(u.replace(/^.*webkit\/(\d+(\.\d+)?).*$/, "$1")) : false, // returns either the webkit version or false if not webkit
|
||||
ie = !+"\v1", // feature detection based on Andrea Giammarchi's solution: http://webreflection.blogspot.com/2009/01/32-bytes-to-know-if-your-browser-is-ie.html
|
||||
playerVersion = [0,0,0],
|
||||
d = null;
|
||||
if (typeof nav.plugins != UNDEF && typeof nav.plugins[SHOCKWAVE_FLASH] == OBJECT) {
|
||||
d = nav.plugins[SHOCKWAVE_FLASH].description;
|
||||
if (d && !(typeof nav.mimeTypes != UNDEF && nav.mimeTypes[FLASH_MIME_TYPE] && !nav.mimeTypes[FLASH_MIME_TYPE].enabledPlugin)) { // navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin indicates whether plug-ins are enabled or disabled in Safari 3+
|
||||
plugin = true;
|
||||
ie = false; // cascaded feature detection for Internet Explorer
|
||||
d = d.replace(/^.*\s+(\S+\s+\S+$)/, "$1");
|
||||
playerVersion[0] = parseInt(d.replace(/^(.*)\..*$/, "$1"), 10);
|
||||
playerVersion[1] = parseInt(d.replace(/^.*\.(.*)\s.*$/, "$1"), 10);
|
||||
playerVersion[2] = /[a-zA-Z]/.test(d) ? parseInt(d.replace(/^.*[a-zA-Z]+(.*)$/, "$1"), 10) : 0;
|
||||
}
|
||||
}
|
||||
else if (typeof win.ActiveXObject != UNDEF) {
|
||||
try {
|
||||
var a = new ActiveXObject(SHOCKWAVE_FLASH_AX);
|
||||
if (a) { // a will return null when ActiveX is disabled
|
||||
d = a.GetVariable("$version");
|
||||
if (d) {
|
||||
ie = true; // cascaded feature detection for Internet Explorer
|
||||
d = d.split(" ")[1].split(",");
|
||||
playerVersion = [parseInt(d[0], 10), parseInt(d[1], 10), parseInt(d[2], 10)];
|
||||
}
|
||||
}
|
||||
}
|
||||
catch(e) {}
|
||||
}
|
||||
return { w3:w3cdom, pv:playerVersion, wk:webkit, ie:ie, win:windows, mac:mac };
|
||||
}(),
|
||||
|
||||
/* Cross-browser onDomLoad
|
||||
- Will fire an event as soon as the DOM of a web page is loaded
|
||||
- Internet Explorer workaround based on Diego Perini's solution: http://javascript.nwbox.com/IEContentLoaded/
|
||||
- Regular onload serves as fallback
|
||||
*/
|
||||
onDomLoad = function() {
|
||||
if (!ua.w3) { return; }
|
||||
if ((typeof doc.readyState != UNDEF && doc.readyState == "complete") || (typeof doc.readyState == UNDEF && (doc.getElementsByTagName("body")[0] || doc.body))) { // function is fired after onload, e.g. when script is inserted dynamically
|
||||
callDomLoadFunctions();
|
||||
}
|
||||
if (!isDomLoaded) {
|
||||
if (typeof doc.addEventListener != UNDEF) {
|
||||
doc.addEventListener("DOMContentLoaded", callDomLoadFunctions, false);
|
||||
}
|
||||
if (ua.ie && ua.win) {
|
||||
doc.attachEvent(ON_READY_STATE_CHANGE, function() {
|
||||
if (doc.readyState == "complete") {
|
||||
doc.detachEvent(ON_READY_STATE_CHANGE, arguments.callee);
|
||||
callDomLoadFunctions();
|
||||
}
|
||||
});
|
||||
if (win == top) { // if not inside an iframe
|
||||
(function(){
|
||||
if (isDomLoaded) { return; }
|
||||
try {
|
||||
doc.documentElement.doScroll("left");
|
||||
}
|
||||
catch(e) {
|
||||
setTimeout(arguments.callee, 0);
|
||||
return;
|
||||
}
|
||||
callDomLoadFunctions();
|
||||
})();
|
||||
}
|
||||
}
|
||||
if (ua.wk) {
|
||||
(function(){
|
||||
if (isDomLoaded) { return; }
|
||||
if (!/loaded|complete/.test(doc.readyState)) {
|
||||
setTimeout(arguments.callee, 0);
|
||||
return;
|
||||
}
|
||||
callDomLoadFunctions();
|
||||
})();
|
||||
}
|
||||
addLoadEvent(callDomLoadFunctions);
|
||||
}
|
||||
}();
|
||||
|
||||
function callDomLoadFunctions() {
|
||||
if (isDomLoaded) { return; }
|
||||
try { // test if we can really add/remove elements to/from the DOM; we don't want to fire it too early
|
||||
var t = doc.getElementsByTagName("body")[0].appendChild(createElement("span"));
|
||||
t.parentNode.removeChild(t);
|
||||
}
|
||||
catch (e) { return; }
|
||||
isDomLoaded = true;
|
||||
var dl = domLoadFnArr.length;
|
||||
for (var i = 0; i < dl; i++) {
|
||||
domLoadFnArr[i]();
|
||||
}
|
||||
}
|
||||
|
||||
function addDomLoadEvent(fn) {
|
||||
if (isDomLoaded) {
|
||||
fn();
|
||||
}
|
||||
else {
|
||||
domLoadFnArr[domLoadFnArr.length] = fn; // Array.push() is only available in IE5.5+
|
||||
}
|
||||
}
|
||||
|
||||
/* Cross-browser onload
|
||||
- Based on James Edwards' solution: http://brothercake.com/site/resources/scripts/onload/
|
||||
- Will fire an event as soon as a web page including all of its assets are loaded
|
||||
*/
|
||||
function addLoadEvent(fn) {
|
||||
if (typeof win.addEventListener != UNDEF) {
|
||||
win.addEventListener("load", fn, false);
|
||||
}
|
||||
else if (typeof doc.addEventListener != UNDEF) {
|
||||
doc.addEventListener("load", fn, false);
|
||||
}
|
||||
else if (typeof win.attachEvent != UNDEF) {
|
||||
addListener(win, "onload", fn);
|
||||
}
|
||||
else if (typeof win.onload == "function") {
|
||||
var fnOld = win.onload;
|
||||
win.onload = function() {
|
||||
fnOld();
|
||||
fn();
|
||||
};
|
||||
}
|
||||
else {
|
||||
win.onload = fn;
|
||||
}
|
||||
}
|
||||
|
||||
/* Main function
|
||||
- Will preferably execute onDomLoad, otherwise onload (as a fallback)
|
||||
*/
|
||||
function main() {
|
||||
if (plugin) {
|
||||
testPlayerVersion();
|
||||
}
|
||||
else {
|
||||
matchVersions();
|
||||
}
|
||||
}
|
||||
|
||||
/* Detect the Flash Player version for non-Internet Explorer browsers
|
||||
- Detecting the plug-in version via the object element is more precise than using the plugins collection item's description:
|
||||
a. Both release and build numbers can be detected
|
||||
b. Avoid wrong descriptions by corrupt installers provided by Adobe
|
||||
c. Avoid wrong descriptions by multiple Flash Player entries in the plugin Array, caused by incorrect browser imports
|
||||
- Disadvantage of this method is that it depends on the availability of the DOM, while the plugins collection is immediately available
|
||||
*/
|
||||
function testPlayerVersion() {
|
||||
var b = doc.getElementsByTagName("body")[0];
|
||||
var o = createElement(OBJECT);
|
||||
o.setAttribute("type", FLASH_MIME_TYPE);
|
||||
var t = b.appendChild(o);
|
||||
if (t) {
|
||||
var counter = 0;
|
||||
(function(){
|
||||
if (typeof t.GetVariable != UNDEF) {
|
||||
var d = t.GetVariable("$version");
|
||||
if (d) {
|
||||
d = d.split(" ")[1].split(",");
|
||||
ua.pv = [parseInt(d[0], 10), parseInt(d[1], 10), parseInt(d[2], 10)];
|
||||
}
|
||||
}
|
||||
else if (counter < 10) {
|
||||
counter++;
|
||||
setTimeout(arguments.callee, 10);
|
||||
return;
|
||||
}
|
||||
b.removeChild(o);
|
||||
t = null;
|
||||
matchVersions();
|
||||
})();
|
||||
}
|
||||
else {
|
||||
matchVersions();
|
||||
}
|
||||
}
|
||||
|
||||
/* Perform Flash Player and SWF version matching; static publishing only
|
||||
*/
|
||||
function matchVersions() {
|
||||
var rl = regObjArr.length;
|
||||
if (rl > 0) {
|
||||
for (var i = 0; i < rl; i++) { // for each registered object element
|
||||
var id = regObjArr[i].id;
|
||||
var cb = regObjArr[i].callbackFn;
|
||||
var cbObj = {success:false, id:id};
|
||||
if (ua.pv[0] > 0) {
|
||||
var obj = getElementById(id);
|
||||
if (obj) {
|
||||
if (hasPlayerVersion(regObjArr[i].swfVersion) && !(ua.wk && ua.wk < 312)) { // Flash Player version >= published SWF version: Houston, we have a match!
|
||||
setVisibility(id, true);
|
||||
if (cb) {
|
||||
cbObj.success = true;
|
||||
cbObj.ref = getObjectById(id);
|
||||
cb(cbObj);
|
||||
}
|
||||
}
|
||||
else if (regObjArr[i].expressInstall && canExpressInstall()) { // show the Adobe Express Install dialog if set by the web page author and if supported
|
||||
var att = {};
|
||||
att.data = regObjArr[i].expressInstall;
|
||||
att.width = obj.getAttribute("width") || "0";
|
||||
att.height = obj.getAttribute("height") || "0";
|
||||
if (obj.getAttribute("class")) { att.styleclass = obj.getAttribute("class"); }
|
||||
if (obj.getAttribute("align")) { att.align = obj.getAttribute("align"); }
|
||||
// parse HTML object param element's name-value pairs
|
||||
var par = {};
|
||||
var p = obj.getElementsByTagName("param");
|
||||
var pl = p.length;
|
||||
for (var j = 0; j < pl; j++) {
|
||||
if (p[j].getAttribute("name").toLowerCase() != "movie") {
|
||||
par[p[j].getAttribute("name")] = p[j].getAttribute("value");
|
||||
}
|
||||
}
|
||||
showExpressInstall(att, par, id, cb);
|
||||
}
|
||||
else { // Flash Player and SWF version mismatch or an older Webkit engine that ignores the HTML object element's nested param elements: display alternative content instead of SWF
|
||||
displayAltContent(obj);
|
||||
if (cb) { cb(cbObj); }
|
||||
}
|
||||
}
|
||||
}
|
||||
else { // if no Flash Player is installed or the fp version cannot be detected we let the HTML object element do its job (either show a SWF or alternative content)
|
||||
setVisibility(id, true);
|
||||
if (cb) {
|
||||
var o = getObjectById(id); // test whether there is an HTML object element or not
|
||||
if (o && typeof o.SetVariable != UNDEF) {
|
||||
cbObj.success = true;
|
||||
cbObj.ref = o;
|
||||
}
|
||||
cb(cbObj);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function getObjectById(objectIdStr) {
|
||||
var r = null;
|
||||
var o = getElementById(objectIdStr);
|
||||
if (o && o.nodeName == "OBJECT") {
|
||||
if (typeof o.SetVariable != UNDEF) {
|
||||
r = o;
|
||||
}
|
||||
else {
|
||||
var n = o.getElementsByTagName(OBJECT)[0];
|
||||
if (n) {
|
||||
r = n;
|
||||
}
|
||||
}
|
||||
}
|
||||
return r;
|
||||
}
|
||||
|
||||
/* Requirements for Adobe Express Install
|
||||
- only one instance can be active at a time
|
||||
- fp 6.0.65 or higher
|
||||
- Win/Mac OS only
|
||||
- no Webkit engines older than version 312
|
||||
*/
|
||||
function canExpressInstall() {
|
||||
return !isExpressInstallActive && hasPlayerVersion("6.0.65") && (ua.win || ua.mac) && !(ua.wk && ua.wk < 312);
|
||||
}
|
||||
|
||||
/* Show the Adobe Express Install dialog
|
||||
- Reference: http://www.adobe.com/cfusion/knowledgebase/index.cfm?id=6a253b75
|
||||
*/
|
||||
function showExpressInstall(att, par, replaceElemIdStr, callbackFn) {
|
||||
isExpressInstallActive = true;
|
||||
storedCallbackFn = callbackFn || null;
|
||||
storedCallbackObj = {success:false, id:replaceElemIdStr};
|
||||
var obj = getElementById(replaceElemIdStr);
|
||||
if (obj) {
|
||||
if (obj.nodeName == "OBJECT") { // static publishing
|
||||
storedAltContent = abstractAltContent(obj);
|
||||
storedAltContentId = null;
|
||||
}
|
||||
else { // dynamic publishing
|
||||
storedAltContent = obj;
|
||||
storedAltContentId = replaceElemIdStr;
|
||||
}
|
||||
att.id = EXPRESS_INSTALL_ID;
|
||||
if (typeof att.width == UNDEF || (!/%$/.test(att.width) && parseInt(att.width, 10) < 310)) { att.width = "310"; }
|
||||
if (typeof att.height == UNDEF || (!/%$/.test(att.height) && parseInt(att.height, 10) < 137)) { att.height = "137"; }
|
||||
doc.title = doc.title.slice(0, 47) + " - Flash Player Installation";
|
||||
var pt = ua.ie && ua.win ? "ActiveX" : "PlugIn",
|
||||
fv = "MMredirectURL=" + encodeURI(window.location).toString().replace(/&/g,"%26") + "&MMplayerType=" + pt + "&MMdoctitle=" + doc.title;
|
||||
if (typeof par.flashvars != UNDEF) {
|
||||
par.flashvars += "&" + fv;
|
||||
}
|
||||
else {
|
||||
par.flashvars = fv;
|
||||
}
|
||||
// IE only: when a SWF is loading (AND: not available in cache) wait for the readyState of the object element to become 4 before removing it,
|
||||
// because you cannot properly cancel a loading SWF file without breaking browser load references, also obj.onreadystatechange doesn't work
|
||||
if (ua.ie && ua.win && obj.readyState != 4) {
|
||||
var newObj = createElement("div");
|
||||
replaceElemIdStr += "SWFObjectNew";
|
||||
newObj.setAttribute("id", replaceElemIdStr);
|
||||
obj.parentNode.insertBefore(newObj, obj); // insert placeholder div that will be replaced by the object element that loads expressinstall.swf
|
||||
obj.style.display = "none";
|
||||
(function(){
|
||||
if (obj.readyState == 4) {
|
||||
obj.parentNode.removeChild(obj);
|
||||
}
|
||||
else {
|
||||
setTimeout(arguments.callee, 10);
|
||||
}
|
||||
})();
|
||||
}
|
||||
createSWF(att, par, replaceElemIdStr);
|
||||
}
|
||||
}
|
||||
|
||||
/* Functions to abstract and display alternative content
|
||||
*/
|
||||
function displayAltContent(obj) {
|
||||
if (ua.ie && ua.win && obj.readyState != 4) {
|
||||
// IE only: when a SWF is loading (AND: not available in cache) wait for the readyState of the object element to become 4 before removing it,
|
||||
// because you cannot properly cancel a loading SWF file without breaking browser load references, also obj.onreadystatechange doesn't work
|
||||
var el = createElement("div");
|
||||
obj.parentNode.insertBefore(el, obj); // insert placeholder div that will be replaced by the alternative content
|
||||
el.parentNode.replaceChild(abstractAltContent(obj), el);
|
||||
obj.style.display = "none";
|
||||
(function(){
|
||||
if (obj.readyState == 4) {
|
||||
obj.parentNode.removeChild(obj);
|
||||
}
|
||||
else {
|
||||
setTimeout(arguments.callee, 10);
|
||||
}
|
||||
})();
|
||||
}
|
||||
else {
|
||||
obj.parentNode.replaceChild(abstractAltContent(obj), obj);
|
||||
}
|
||||
}
|
||||
|
||||
function abstractAltContent(obj) {
|
||||
var ac = createElement("div");
|
||||
if (ua.win && ua.ie) {
|
||||
ac.innerHTML = obj.innerHTML;
|
||||
}
|
||||
else {
|
||||
var nestedObj = obj.getElementsByTagName(OBJECT)[0];
|
||||
if (nestedObj) {
|
||||
var c = nestedObj.childNodes;
|
||||
if (c) {
|
||||
var cl = c.length;
|
||||
for (var i = 0; i < cl; i++) {
|
||||
if (!(c[i].nodeType == 1 && c[i].nodeName == "PARAM") && !(c[i].nodeType == 8)) {
|
||||
ac.appendChild(c[i].cloneNode(true));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return ac;
|
||||
}
|
||||
|
||||
/* Cross-browser dynamic SWF creation
|
||||
*/
|
||||
function createSWF(attObj, parObj, id) {
|
||||
var r, el = getElementById(id);
|
||||
if (ua.wk && ua.wk < 312) { return r; }
|
||||
if (el) {
|
||||
if (typeof attObj.id == UNDEF) { // if no 'id' is defined for the object element, it will inherit the 'id' from the alternative content
|
||||
attObj.id = id;
|
||||
}
|
||||
if (ua.ie && ua.win) { // Internet Explorer + the HTML object element + W3C DOM methods do not combine: fall back to outerHTML
|
||||
var att = "";
|
||||
for (var i in attObj) {
|
||||
if (attObj[i] != Object.prototype[i]) { // filter out prototype additions from other potential libraries
|
||||
if (i.toLowerCase() == "data") {
|
||||
parObj.movie = attObj[i];
|
||||
}
|
||||
else if (i.toLowerCase() == "styleclass") { // 'class' is an ECMA4 reserved keyword
|
||||
att += ' class="' + attObj[i] + '"';
|
||||
}
|
||||
else if (i.toLowerCase() != "classid") {
|
||||
att += ' ' + i + '="' + attObj[i] + '"';
|
||||
}
|
||||
}
|
||||
}
|
||||
var par = "";
|
||||
for (var j in parObj) {
|
||||
if (parObj[j] != Object.prototype[j]) { // filter out prototype additions from other potential libraries
|
||||
par += '<param name="' + j + '" value="' + parObj[j] + '" />';
|
||||
}
|
||||
}
|
||||
el.outerHTML = '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"' + att + '>' + par + '</object>';
|
||||
objIdArr[objIdArr.length] = attObj.id; // stored to fix object 'leaks' on unload (dynamic publishing only)
|
||||
r = getElementById(attObj.id);
|
||||
}
|
||||
else { // well-behaving browsers
|
||||
var o = createElement(OBJECT);
|
||||
o.setAttribute("type", FLASH_MIME_TYPE);
|
||||
for (var m in attObj) {
|
||||
if (attObj[m] != Object.prototype[m]) { // filter out prototype additions from other potential libraries
|
||||
if (m.toLowerCase() == "styleclass") { // 'class' is an ECMA4 reserved keyword
|
||||
o.setAttribute("class", attObj[m]);
|
||||
}
|
||||
else if (m.toLowerCase() != "classid") { // filter out IE specific attribute
|
||||
o.setAttribute(m, attObj[m]);
|
||||
}
|
||||
}
|
||||
}
|
||||
for (var n in parObj) {
|
||||
if (parObj[n] != Object.prototype[n] && n.toLowerCase() != "movie") { // filter out prototype additions from other potential libraries and IE specific param element
|
||||
createObjParam(o, n, parObj[n]);
|
||||
}
|
||||
}
|
||||
el.parentNode.replaceChild(o, el);
|
||||
r = o;
|
||||
}
|
||||
}
|
||||
return r;
|
||||
}
|
||||
|
||||
function createObjParam(el, pName, pValue) {
|
||||
var p = createElement("param");
|
||||
p.setAttribute("name", pName);
|
||||
p.setAttribute("value", pValue);
|
||||
el.appendChild(p);
|
||||
}
|
||||
|
||||
/* Cross-browser SWF removal
|
||||
- Especially needed to safely and completely remove a SWF in Internet Explorer
|
||||
*/
|
||||
function removeSWF(id) {
|
||||
var obj = getElementById(id);
|
||||
if (obj && obj.nodeName == "OBJECT") {
|
||||
if (ua.ie && ua.win) {
|
||||
obj.style.display = "none";
|
||||
(function(){
|
||||
if (obj.readyState == 4) {
|
||||
removeObjectInIE(id);
|
||||
}
|
||||
else {
|
||||
setTimeout(arguments.callee, 10);
|
||||
}
|
||||
})();
|
||||
}
|
||||
else {
|
||||
obj.parentNode.removeChild(obj);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function removeObjectInIE(id) {
|
||||
var obj = getElementById(id);
|
||||
if (obj) {
|
||||
for (var i in obj) {
|
||||
if (typeof obj[i] == "function") {
|
||||
obj[i] = null;
|
||||
}
|
||||
}
|
||||
obj.parentNode.removeChild(obj);
|
||||
}
|
||||
}
|
||||
|
||||
/* Functions to optimize JavaScript compression
|
||||
*/
|
||||
function getElementById(id) {
|
||||
var el = null;
|
||||
try {
|
||||
el = doc.getElementById(id);
|
||||
}
|
||||
catch (e) {}
|
||||
return el;
|
||||
}
|
||||
|
||||
function createElement(el) {
|
||||
return doc.createElement(el);
|
||||
}
|
||||
|
||||
/* Updated attachEvent function for Internet Explorer
|
||||
- Stores attachEvent information in an Array, so on unload the detachEvent functions can be called to avoid memory leaks
|
||||
*/
|
||||
function addListener(target, eventType, fn) {
|
||||
target.attachEvent(eventType, fn);
|
||||
listenersArr[listenersArr.length] = [target, eventType, fn];
|
||||
}
|
||||
|
||||
/* Flash Player and SWF content version matching
|
||||
*/
|
||||
function hasPlayerVersion(rv) {
|
||||
var pv = ua.pv, v = rv.split(".");
|
||||
v[0] = parseInt(v[0], 10);
|
||||
v[1] = parseInt(v[1], 10) || 0; // supports short notation, e.g. "9" instead of "9.0.0"
|
||||
v[2] = parseInt(v[2], 10) || 0;
|
||||
return (pv[0] > v[0] || (pv[0] == v[0] && pv[1] > v[1]) || (pv[0] == v[0] && pv[1] == v[1] && pv[2] >= v[2])) ? true : false;
|
||||
}
|
||||
|
||||
/* Cross-browser dynamic CSS creation
|
||||
- Based on Bobby van der Sluis' solution: http://www.bobbyvandersluis.com/articles/dynamicCSS.php
|
||||
*/
|
||||
function createCSS(sel, decl, media, newStyle) {
|
||||
if (ua.ie && ua.mac) { return; }
|
||||
var h = doc.getElementsByTagName("head")[0];
|
||||
if (!h) { return; } // to also support badly authored HTML pages that lack a head element
|
||||
var m = (media && typeof media == "string") ? media : "screen";
|
||||
if (newStyle) {
|
||||
dynamicStylesheet = null;
|
||||
dynamicStylesheetMedia = null;
|
||||
}
|
||||
if (!dynamicStylesheet || dynamicStylesheetMedia != m) {
|
||||
// create dynamic stylesheet + get a global reference to it
|
||||
var s = createElement("style");
|
||||
s.setAttribute("type", "text/css");
|
||||
s.setAttribute("media", m);
|
||||
dynamicStylesheet = h.appendChild(s);
|
||||
if (ua.ie && ua.win && typeof doc.styleSheets != UNDEF && doc.styleSheets.length > 0) {
|
||||
dynamicStylesheet = doc.styleSheets[doc.styleSheets.length - 1];
|
||||
}
|
||||
dynamicStylesheetMedia = m;
|
||||
}
|
||||
// add style rule
|
||||
if (ua.ie && ua.win) {
|
||||
if (dynamicStylesheet && typeof dynamicStylesheet.addRule == OBJECT) {
|
||||
dynamicStylesheet.addRule(sel, decl);
|
||||
}
|
||||
}
|
||||
else {
|
||||
if (dynamicStylesheet && typeof doc.createTextNode != UNDEF) {
|
||||
dynamicStylesheet.appendChild(doc.createTextNode(sel + " {" + decl + "}"));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function setVisibility(id, isVisible) {
|
||||
if (!autoHideShow) { return; }
|
||||
var v = isVisible ? "visible" : "hidden";
|
||||
if (isDomLoaded && getElementById(id)) {
|
||||
getElementById(id).style.visibility = v;
|
||||
}
|
||||
else {
|
||||
createCSS("#" + id, "visibility:" + v);
|
||||
}
|
||||
}
|
||||
|
||||
/* Filter to avoid XSS attacks
|
||||
*/
|
||||
function urlEncodeIfNecessary(s) {
|
||||
var regex = /[\\\"<>\.;]/;
|
||||
var hasBadChars = regex.exec(s) != null;
|
||||
return hasBadChars && typeof encodeURIComponent != UNDEF ? encodeURIComponent(s) : s;
|
||||
}
|
||||
|
||||
/* Release memory to avoid memory leaks caused by closures, fix hanging audio/video threads and force open sockets/NetConnections to disconnect (Internet Explorer only)
|
||||
*/
|
||||
var cleanup = function() {
|
||||
if (ua.ie && ua.win) {
|
||||
window.attachEvent("onunload", function() {
|
||||
// remove listeners to avoid memory leaks
|
||||
var ll = listenersArr.length;
|
||||
for (var i = 0; i < ll; i++) {
|
||||
listenersArr[i][0].detachEvent(listenersArr[i][1], listenersArr[i][2]);
|
||||
}
|
||||
// cleanup dynamically embedded objects to fix audio/video threads and force open sockets and NetConnections to disconnect
|
||||
var il = objIdArr.length;
|
||||
for (var j = 0; j < il; j++) {
|
||||
removeSWF(objIdArr[j]);
|
||||
}
|
||||
// cleanup library's main closures to avoid memory leaks
|
||||
for (var k in ua) {
|
||||
ua[k] = null;
|
||||
}
|
||||
ua = null;
|
||||
for (var l in swfobject) {
|
||||
swfobject[l] = null;
|
||||
}
|
||||
swfobject = null;
|
||||
});
|
||||
}
|
||||
}();
|
||||
|
||||
return {
|
||||
/* Public API
|
||||
- Reference: http://code.google.com/p/swfobject/wiki/documentation
|
||||
*/
|
||||
registerObject: function(objectIdStr, swfVersionStr, xiSwfUrlStr, callbackFn) {
|
||||
if (ua.w3 && objectIdStr && swfVersionStr) {
|
||||
var regObj = {};
|
||||
regObj.id = objectIdStr;
|
||||
regObj.swfVersion = swfVersionStr;
|
||||
regObj.expressInstall = xiSwfUrlStr;
|
||||
regObj.callbackFn = callbackFn;
|
||||
regObjArr[regObjArr.length] = regObj;
|
||||
setVisibility(objectIdStr, false);
|
||||
}
|
||||
else if (callbackFn) {
|
||||
callbackFn({success:false, id:objectIdStr});
|
||||
}
|
||||
},
|
||||
|
||||
getObjectById: function(objectIdStr) {
|
||||
if (ua.w3) {
|
||||
return getObjectById(objectIdStr);
|
||||
}
|
||||
},
|
||||
|
||||
embedSWF: function(swfUrlStr, replaceElemIdStr, widthStr, heightStr, swfVersionStr, xiSwfUrlStr, flashvarsObj, parObj, attObj, callbackFn) {
|
||||
var callbackObj = {success:false, id:replaceElemIdStr};
|
||||
if (ua.w3 && !(ua.wk && ua.wk < 312) && swfUrlStr && replaceElemIdStr && widthStr && heightStr && swfVersionStr) {
|
||||
setVisibility(replaceElemIdStr, false);
|
||||
addDomLoadEvent(function() {
|
||||
widthStr += ""; // auto-convert to string
|
||||
heightStr += "";
|
||||
var att = {};
|
||||
if (attObj && typeof attObj === OBJECT) {
|
||||
for (var i in attObj) { // copy object to avoid the use of references, because web authors often reuse attObj for multiple SWFs
|
||||
att[i] = attObj[i];
|
||||
}
|
||||
}
|
||||
att.data = swfUrlStr;
|
||||
att.width = widthStr;
|
||||
att.height = heightStr;
|
||||
var par = {};
|
||||
if (parObj && typeof parObj === OBJECT) {
|
||||
for (var j in parObj) { // copy object to avoid the use of references, because web authors often reuse parObj for multiple SWFs
|
||||
par[j] = parObj[j];
|
||||
}
|
||||
}
|
||||
if (flashvarsObj && typeof flashvarsObj === OBJECT) {
|
||||
for (var k in flashvarsObj) { // copy object to avoid the use of references, because web authors often reuse flashvarsObj for multiple SWFs
|
||||
if (typeof par.flashvars != UNDEF) {
|
||||
par.flashvars += "&" + k + "=" + flashvarsObj[k];
|
||||
}
|
||||
else {
|
||||
par.flashvars = k + "=" + flashvarsObj[k];
|
||||
}
|
||||
}
|
||||
}
|
||||
if (hasPlayerVersion(swfVersionStr)) { // create SWF
|
||||
var obj = createSWF(att, par, replaceElemIdStr);
|
||||
if (att.id == replaceElemIdStr) {
|
||||
setVisibility(replaceElemIdStr, true);
|
||||
}
|
||||
callbackObj.success = true;
|
||||
callbackObj.ref = obj;
|
||||
}
|
||||
else if (xiSwfUrlStr && canExpressInstall()) { // show Adobe Express Install
|
||||
att.data = xiSwfUrlStr;
|
||||
showExpressInstall(att, par, replaceElemIdStr, callbackFn);
|
||||
return;
|
||||
}
|
||||
else { // show alternative content
|
||||
setVisibility(replaceElemIdStr, true);
|
||||
}
|
||||
if (callbackFn) { callbackFn(callbackObj); }
|
||||
});
|
||||
}
|
||||
else if (callbackFn) { callbackFn(callbackObj); }
|
||||
},
|
||||
|
||||
switchOffAutoHideShow: function() {
|
||||
autoHideShow = false;
|
||||
},
|
||||
|
||||
ua: ua,
|
||||
|
||||
getFlashPlayerVersion: function() {
|
||||
return { major:ua.pv[0], minor:ua.pv[1], release:ua.pv[2] };
|
||||
},
|
||||
|
||||
hasFlashPlayerVersion: hasPlayerVersion,
|
||||
|
||||
createSWF: function(attObj, parObj, replaceElemIdStr) {
|
||||
if (ua.w3) {
|
||||
return createSWF(attObj, parObj, replaceElemIdStr);
|
||||
}
|
||||
else {
|
||||
return undefined;
|
||||
}
|
||||
},
|
||||
|
||||
showExpressInstall: function(att, par, replaceElemIdStr, callbackFn) {
|
||||
if (ua.w3 && canExpressInstall()) {
|
||||
showExpressInstall(att, par, replaceElemIdStr, callbackFn);
|
||||
}
|
||||
},
|
||||
|
||||
removeSWF: function(objElemIdStr) {
|
||||
if (ua.w3) {
|
||||
removeSWF(objElemIdStr);
|
||||
}
|
||||
},
|
||||
|
||||
createCSS: function(selStr, declStr, mediaStr, newStyleBoolean) {
|
||||
if (ua.w3) {
|
||||
createCSS(selStr, declStr, mediaStr, newStyleBoolean);
|
||||
}
|
||||
},
|
||||
|
||||
addDomLoadEvent: addDomLoadEvent,
|
||||
|
||||
addLoadEvent: addLoadEvent,
|
||||
|
||||
getQueryParamValue: function(param) {
|
||||
var q = doc.location.search || doc.location.hash;
|
||||
if (q) {
|
||||
if (/\?/.test(q)) { q = q.split("?")[1]; } // strip question mark
|
||||
if (param == null) {
|
||||
return urlEncodeIfNecessary(q);
|
||||
}
|
||||
var pairs = q.split("&");
|
||||
for (var i = 0; i < pairs.length; i++) {
|
||||
if (pairs[i].substring(0, pairs[i].indexOf("=")) == param) {
|
||||
return urlEncodeIfNecessary(pairs[i].substring((pairs[i].indexOf("=") + 1)));
|
||||
}
|
||||
}
|
||||
}
|
||||
return "";
|
||||
},
|
||||
|
||||
// For internal usage only
|
||||
expressInstallCallback: function() {
|
||||
if (isExpressInstallActive) {
|
||||
var obj = getElementById(EXPRESS_INSTALL_ID);
|
||||
if (obj && storedAltContent) {
|
||||
obj.parentNode.replaceChild(storedAltContent, obj);
|
||||
if (storedAltContentId) {
|
||||
setVisibility(storedAltContentId, true);
|
||||
if (ua.ie && ua.win) { storedAltContent.style.display = "block"; }
|
||||
}
|
||||
if (storedCallbackFn) { storedCallbackFn(storedCallbackObj); }
|
||||
}
|
||||
isExpressInstallActive = false;
|
||||
}
|
||||
}
|
||||
};
|
||||
}();
|
@@ -1,42 +0,0 @@
|
||||
<!--
|
||||
< ?xml version="1.0" encoding="UTF-8"?>
|
||||
<rss version="2.0" xmlns:media="http://search.yahoo.com/mrss/" xmlns:atom="http://www.w3.org/2005/Atom">
|
||||
<channel>
|
||||
<item>
|
||||
<title>ssid=423 rid=3492</title>
|
||||
<media:content url="http://192.168.1.106/phraseanet_jy_v2_2/zzz.php?sbid=163&rid=3492" width="640" height="426"/>
|
||||
<media:thumbnail url="http://192.168.1.106/phraseanet_jy_v2_2/web/db_JY_2_2_canal/SUBDEFS/3492_thumbnail.jpg" width="128" height="85"/>
|
||||
</item>
|
||||
<item>
|
||||
<title>ssid=423 rid=3493</title>
|
||||
<media:content url="http://192.168.1.106/phraseanet_jy_v2_2/zzz.php?sbid=163&rid=3493" width="640" height="435"/>
|
||||
<media:thumbnail url="http://192.168.1.106/phraseanet_jy_v2_2/web/db_JY_2_2_canal/SUBDEFS/3493_thumbnail.jpg" width="128" height="87"/>
|
||||
</item>
|
||||
</channel>
|
||||
</rss>
|
||||
-->
|
||||
<html>
|
||||
<body style="background-color:#ffFF00">
|
||||
|
||||
hello
|
||||
|
||||
<embed src="ImageScroll.swf"
|
||||
id="ImageScroll"
|
||||
quality="high"
|
||||
bgcolor="#ff0000"
|
||||
wmode="transparent"
|
||||
name="ImageScroll"
|
||||
allowscriptaccess="sameDomain"
|
||||
pluginspage="http://www.adobe.com/go/getflashplayer"
|
||||
type="application/x-shockwave-flash"
|
||||
width="600"
|
||||
height="300"
|
||||
align="middle"
|
||||
|
||||
flashVars='space=20&speed=1&media=content&zoom=0.5&rss=<?=urlencode('http://192.168.1.106/phraseanet_jy_v2_2/z_forscroll.php?ssid=423')?>'
|
||||
|
||||
>
|
||||
</embed>
|
||||
|
||||
</body>
|
||||
</html>
|
Binary file not shown.
@@ -1,292 +0,0 @@
|
||||
// Flash Player Version Detection - Rev 1.6
|
||||
// Detect Client Browser type
|
||||
// Copyright(c) 2005-2006 Adobe Macromedia Software, LLC. All rights reserved.
|
||||
var isIE = (navigator.appVersion.indexOf("MSIE") != -1) ? true : false;
|
||||
var isWin = (navigator.appVersion.toLowerCase().indexOf("win") != -1) ? true : false;
|
||||
var isOpera = (navigator.userAgent.indexOf("Opera") != -1) ? true : false;
|
||||
|
||||
function ControlVersion()
|
||||
{
|
||||
var version;
|
||||
var axo;
|
||||
var e;
|
||||
|
||||
// NOTE : new ActiveXObject(strFoo) throws an exception if strFoo isn't in the registry
|
||||
|
||||
try {
|
||||
// version will be set for 7.X or greater players
|
||||
axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7");
|
||||
version = axo.GetVariable("$version");
|
||||
} catch (e) {
|
||||
}
|
||||
|
||||
if (!version)
|
||||
{
|
||||
try {
|
||||
// version will be set for 6.X players only
|
||||
axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");
|
||||
|
||||
// installed player is some revision of 6.0
|
||||
// GetVariable("$version") crashes for versions 6.0.22 through 6.0.29,
|
||||
// so we have to be careful.
|
||||
|
||||
// default to the first public version
|
||||
version = "WIN 6,0,21,0";
|
||||
|
||||
// throws if AllowScripAccess does not exist (introduced in 6.0r47)
|
||||
axo.AllowScriptAccess = "always";
|
||||
|
||||
// safe to call for 6.0r47 or greater
|
||||
version = axo.GetVariable("$version");
|
||||
|
||||
} catch (e) {
|
||||
}
|
||||
}
|
||||
|
||||
if (!version)
|
||||
{
|
||||
try {
|
||||
// version will be set for 4.X or 5.X player
|
||||
axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.3");
|
||||
version = axo.GetVariable("$version");
|
||||
} catch (e) {
|
||||
}
|
||||
}
|
||||
|
||||
if (!version)
|
||||
{
|
||||
try {
|
||||
// version will be set for 3.X player
|
||||
axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.3");
|
||||
version = "WIN 3,0,18,0";
|
||||
} catch (e) {
|
||||
}
|
||||
}
|
||||
|
||||
if (!version)
|
||||
{
|
||||
try {
|
||||
// version will be set for 2.X player
|
||||
axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash");
|
||||
version = "WIN 2,0,0,11";
|
||||
} catch (e) {
|
||||
version = -1;
|
||||
}
|
||||
}
|
||||
|
||||
return version;
|
||||
}
|
||||
|
||||
// JavaScript helper required to detect Flash Player PlugIn version information
|
||||
function GetSwfVer(){
|
||||
// NS/Opera version >= 3 check for Flash plugin in plugin array
|
||||
var flashVer = -1;
|
||||
|
||||
if (navigator.plugins != null && navigator.plugins.length > 0) {
|
||||
if (navigator.plugins["Shockwave Flash 2.0"] || navigator.plugins["Shockwave Flash"]) {
|
||||
var swVer2 = navigator.plugins["Shockwave Flash 2.0"] ? " 2.0" : "";
|
||||
var flashDescription = navigator.plugins["Shockwave Flash" + swVer2].description;
|
||||
var descArray = flashDescription.split(" ");
|
||||
var tempArrayMajor = descArray[2].split(".");
|
||||
var versionMajor = tempArrayMajor[0];
|
||||
var versionMinor = tempArrayMajor[1];
|
||||
var versionRevision = descArray[3];
|
||||
if (versionRevision == "") {
|
||||
versionRevision = descArray[4];
|
||||
}
|
||||
if (versionRevision[0] == "d") {
|
||||
versionRevision = versionRevision.substring(1);
|
||||
} else if (versionRevision[0] == "r") {
|
||||
versionRevision = versionRevision.substring(1);
|
||||
if (versionRevision.indexOf("d") > 0) {
|
||||
versionRevision = versionRevision.substring(0, versionRevision.indexOf("d"));
|
||||
}
|
||||
} else if (versionRevision[0] == "b") {
|
||||
versionRevision = versionRevision.substring(1);
|
||||
}
|
||||
var flashVer = versionMajor + "." + versionMinor + "." + versionRevision;
|
||||
}
|
||||
}
|
||||
// MSN/WebTV 2.6 supports Flash 4
|
||||
else if (navigator.userAgent.toLowerCase().indexOf("webtv/2.6") != -1) flashVer = 4;
|
||||
// WebTV 2.5 supports Flash 3
|
||||
else if (navigator.userAgent.toLowerCase().indexOf("webtv/2.5") != -1) flashVer = 3;
|
||||
// older WebTV supports Flash 2
|
||||
else if (navigator.userAgent.toLowerCase().indexOf("webtv") != -1) flashVer = 2;
|
||||
else if ( isIE && isWin && !isOpera ) {
|
||||
flashVer = ControlVersion();
|
||||
}
|
||||
return flashVer;
|
||||
}
|
||||
|
||||
// When called with reqMajorVer, reqMinorVer, reqRevision returns true if that version or greater is available
|
||||
function DetectFlashVer(reqMajorVer, reqMinorVer, reqRevision)
|
||||
{
|
||||
versionStr = GetSwfVer();
|
||||
if (versionStr == -1 ) {
|
||||
return false;
|
||||
} else if (versionStr != 0) {
|
||||
if(isIE && isWin && !isOpera) {
|
||||
// Given "WIN 2,0,0,11"
|
||||
tempArray = versionStr.split(" "); // ["WIN", "2,0,0,11"]
|
||||
tempString = tempArray[1]; // "2,0,0,11"
|
||||
versionArray = tempString.split(","); // ['2', '0', '0', '11']
|
||||
} else {
|
||||
versionArray = versionStr.split(".");
|
||||
}
|
||||
var versionMajor = versionArray[0];
|
||||
var versionMinor = versionArray[1];
|
||||
var versionRevision = versionArray[2];
|
||||
|
||||
// is the major.revision >= requested major.revision AND the minor version >= requested minor
|
||||
if (versionMajor > parseFloat(reqMajorVer)) {
|
||||
return true;
|
||||
} else if (versionMajor == parseFloat(reqMajorVer)) {
|
||||
if (versionMinor > parseFloat(reqMinorVer))
|
||||
return true;
|
||||
else if (versionMinor == parseFloat(reqMinorVer)) {
|
||||
if (versionRevision >= parseFloat(reqRevision))
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
function AC_AddExtension(src, ext)
|
||||
{
|
||||
var qIndex = src.indexOf('?');
|
||||
if ( qIndex != -1)
|
||||
{
|
||||
// Add the extention (if needed) before the query params
|
||||
var path = src.substring(0, qIndex);
|
||||
if (path.length >= ext.length && path.lastIndexOf(ext) == (path.length - ext.length))
|
||||
return src;
|
||||
else
|
||||
return src.replace(/\?/, ext+'?');
|
||||
}
|
||||
else
|
||||
{
|
||||
// Add the extension (if needed) to the end of the URL
|
||||
if (src.length >= ext.length && src.lastIndexOf(ext) == (src.length - ext.length))
|
||||
return src; // Already have extension
|
||||
else
|
||||
return src + ext;
|
||||
}
|
||||
}
|
||||
|
||||
function AC_Generateobj(objAttrs, params, embedAttrs)
|
||||
{
|
||||
var str = '';
|
||||
if (isIE && isWin && !isOpera)
|
||||
{
|
||||
str += '<object ';
|
||||
for (var i in objAttrs)
|
||||
str += i + '="' + objAttrs[i] + '" ';
|
||||
str += '>';
|
||||
for (var i in params)
|
||||
str += '<param name="' + i + '" value="' + params[i] + '" /> ';
|
||||
str += '</object>';
|
||||
} else {
|
||||
str += '<embed ';
|
||||
for (var i in embedAttrs)
|
||||
str += i + '="' + embedAttrs[i] + '" ';
|
||||
str += '> </embed>';
|
||||
}
|
||||
|
||||
document.write(str);
|
||||
}
|
||||
|
||||
function AC_FL_RunContent(){
|
||||
var ret =
|
||||
AC_GetArgs
|
||||
( arguments, ".swf", "movie", "clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"
|
||||
, "application/x-shockwave-flash"
|
||||
);
|
||||
AC_Generateobj(ret.objAttrs, ret.params, ret.embedAttrs);
|
||||
}
|
||||
|
||||
function AC_GetArgs(args, ext, srcParamName, classid, mimeType){
|
||||
var ret = new Object();
|
||||
ret.embedAttrs = new Object();
|
||||
ret.params = new Object();
|
||||
ret.objAttrs = new Object();
|
||||
for (var i=0; i < args.length; i=i+2){
|
||||
var currArg = args[i].toLowerCase();
|
||||
|
||||
switch (currArg){
|
||||
case "classid":
|
||||
break;
|
||||
case "pluginspage":
|
||||
ret.embedAttrs[args[i]] = args[i+1];
|
||||
break;
|
||||
case "src":
|
||||
case "movie":
|
||||
args[i+1] = AC_AddExtension(args[i+1], ext);
|
||||
ret.embedAttrs["src"] = args[i+1];
|
||||
ret.params[srcParamName] = args[i+1];
|
||||
break;
|
||||
case "onafterupdate":
|
||||
case "onbeforeupdate":
|
||||
case "onblur":
|
||||
case "oncellchange":
|
||||
case "onclick":
|
||||
case "ondblClick":
|
||||
case "ondrag":
|
||||
case "ondragend":
|
||||
case "ondragenter":
|
||||
case "ondragleave":
|
||||
case "ondragover":
|
||||
case "ondrop":
|
||||
case "onfinish":
|
||||
case "onfocus":
|
||||
case "onhelp":
|
||||
case "onmousedown":
|
||||
case "onmouseup":
|
||||
case "onmouseover":
|
||||
case "onmousemove":
|
||||
case "onmouseout":
|
||||
case "onkeypress":
|
||||
case "onkeydown":
|
||||
case "onkeyup":
|
||||
case "onload":
|
||||
case "onlosecapture":
|
||||
case "onpropertychange":
|
||||
case "onreadystatechange":
|
||||
case "onrowsdelete":
|
||||
case "onrowenter":
|
||||
case "onrowexit":
|
||||
case "onrowsinserted":
|
||||
case "onstart":
|
||||
case "onscroll":
|
||||
case "onbeforeeditfocus":
|
||||
case "onactivate":
|
||||
case "onbeforedeactivate":
|
||||
case "ondeactivate":
|
||||
case "type":
|
||||
case "codebase":
|
||||
ret.objAttrs[args[i]] = args[i+1];
|
||||
break;
|
||||
case "id":
|
||||
case "width":
|
||||
case "height":
|
||||
case "align":
|
||||
case "vspace":
|
||||
case "hspace":
|
||||
case "class":
|
||||
case "title":
|
||||
case "accesskey":
|
||||
case "name":
|
||||
case "tabindex":
|
||||
ret.embedAttrs[args[i]] = ret.objAttrs[args[i]] = args[i+1];
|
||||
break;
|
||||
default:
|
||||
ret.embedAttrs[args[i]] = ret.params[args[i]] = args[i+1];
|
||||
}
|
||||
}
|
||||
ret.objAttrs["classid"] = classid;
|
||||
if (mimeType) ret.embedAttrs["type"] = mimeType;
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
@@ -1,105 +0,0 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<!-- saved from url=(0014)about:internet -->
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
|
||||
<!--
|
||||
Smart developers always View Source.
|
||||
|
||||
This application was built using Adobe Flex, an open source framework
|
||||
for building rich Internet applications that get delivered via the
|
||||
Flash Player or to desktops via Adobe AIR.
|
||||
|
||||
Learn more about Flex at http://flex.org
|
||||
// -->
|
||||
<head>
|
||||
<title></title>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
<!-- Include CSS to eliminate any default margins/padding and set the height of the html element and
|
||||
the body element to 100%, because Firefox, or any Gecko based browser, interprets percentage as
|
||||
the percentage of the height of its parent container, which has to be set explicitly. Initially,
|
||||
don't display flashContent div so it won't show if JavaScript disabled.
|
||||
-->
|
||||
<style type="text/css" media="screen">
|
||||
html, body { height:100%; }
|
||||
body { margin:0; padding:0; overflow:auto; text-align:center;
|
||||
background-color: #ffffff; }
|
||||
#flashContent { display:none; }
|
||||
</style>
|
||||
|
||||
<!-- Enable Browser History by replacing useBrowserHistory tokens with two hyphens -->
|
||||
<!-- BEGIN Browser History required section -->
|
||||
<link rel="stylesheet" type="text/css" href="history/history.css" />
|
||||
<script type="text/javascript" src="history/history.js"></script>
|
||||
<!-- END Browser History required section -->
|
||||
|
||||
<script type="text/javascript" src="swfobject.js"></script>
|
||||
<script type="text/javascript">
|
||||
<!-- For version detection, set to min. required Flash Player version, or 0 (or 0.0.0), for no version detection. -->
|
||||
var swfVersionStr = "10.0.0";
|
||||
<!-- To use express install, set to playerProductInstall.swf, otherwise the empty string. -->
|
||||
var xiSwfUrlStr = "playerProductInstall.swf";
|
||||
var flashvars = {};
|
||||
var params = {};
|
||||
params.quality = "high";
|
||||
params.bgcolor = "#ffffff";
|
||||
params.allowscriptaccess = "sameDomain";
|
||||
params.allowfullscreen = "true";
|
||||
var attributes = {};
|
||||
attributes.id = "ImageScroll";
|
||||
attributes.name = "ImageScroll";
|
||||
attributes.align = "middle";
|
||||
swfobject.embedSWF(
|
||||
"ImageScroll.swf", "flashContent",
|
||||
"100%", "100%",
|
||||
swfVersionStr, xiSwfUrlStr,
|
||||
flashvars, params, attributes);
|
||||
<!-- JavaScript enabled so display the flashContent div in case it is not replaced with a swf object. -->
|
||||
swfobject.createCSS("#flashContent", "display:block;text-align:left;");
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<!-- SWFObject's dynamic embed method replaces this alternative HTML content with Flash content when enough
|
||||
JavaScript and Flash plug-in support is available. The div is initially hidden so that it doesn't show
|
||||
when JavaScript is disabled.
|
||||
-->
|
||||
<div id="flashContent">
|
||||
<p>
|
||||
To view this page ensure that Adobe Flash Player version
|
||||
10.0.0 or greater is installed.
|
||||
</p>
|
||||
<script type="text/javascript">
|
||||
var pageHost = ((document.location.protocol == "https:") ? "https://" : "http://");
|
||||
document.write("<a href='http://www.adobe.com/go/getflashplayer'><img src='"
|
||||
+ pageHost + "www.adobe.com/images/shared/download_buttons/get_flash_player.gif' alt='Get Adobe Flash player' /></a>" );
|
||||
</script>
|
||||
</div>
|
||||
|
||||
<noscript>
|
||||
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="100%" height="100%" id="ImageScroll">
|
||||
<param name="movie" value="ImageScroll.swf" />
|
||||
<param name="quality" value="high" />
|
||||
<param name="bgcolor" value="#ffffff" />
|
||||
<param name="allowScriptAccess" value="sameDomain" />
|
||||
<param name="allowFullScreen" value="true" />
|
||||
<!--[if !IE]>-->
|
||||
<object type="application/x-shockwave-flash" data="ImageScroll.swf" width="100%" height="100%">
|
||||
<param name="quality" value="high" />
|
||||
<param name="bgcolor" value="#ffffff" />
|
||||
<param name="allowScriptAccess" value="sameDomain" />
|
||||
<param name="allowFullScreen" value="true" />
|
||||
<!--<![endif]-->
|
||||
<!--[if gte IE 6]>-->
|
||||
<p>
|
||||
Either scripts and active content are not permitted to run or Adobe Flash Player version
|
||||
10.0.0 or greater is not installed.
|
||||
</p>
|
||||
<!--<![endif]-->
|
||||
<a href="http://www.adobe.com/go/getflashplayer">
|
||||
<img src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif" alt="Get Adobe Flash Player" />
|
||||
</a>
|
||||
<!--[if !IE]>-->
|
||||
</object>
|
||||
<!--<![endif]-->
|
||||
</object>
|
||||
</noscript>
|
||||
</body>
|
||||
</html>
|
Binary file not shown.
Binary file not shown.
@@ -1,6 +0,0 @@
|
||||
/* This CSS stylesheet defines styles used by required elements in a flex application page that supports browser history */
|
||||
|
||||
#ie_historyFrame { width: 0px; height: 0px; display:none }
|
||||
#firefox_anchorDiv { width: 0px; height: 0px; display:none }
|
||||
#safari_formDiv { width: 0px; height: 0px; display:none }
|
||||
#safari_rememberDiv { width: 0px; height: 0px; display:none }
|
@@ -1,710 +0,0 @@
|
||||
BrowserHistoryUtils = {
|
||||
addEvent: function(elm, evType, fn, useCapture) {
|
||||
useCapture = useCapture || false;
|
||||
if (elm.addEventListener) {
|
||||
elm.addEventListener(evType, fn, useCapture);
|
||||
return true;
|
||||
}
|
||||
else if (elm.attachEvent) {
|
||||
var r = elm.attachEvent('on' + evType, fn);
|
||||
return r;
|
||||
}
|
||||
else {
|
||||
elm['on' + evType] = fn;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
BrowserHistory = (function() {
|
||||
// type of browser
|
||||
var browser = {
|
||||
ie: false,
|
||||
ie8: false,
|
||||
firefox: false,
|
||||
safari: false,
|
||||
opera: false,
|
||||
version: -1
|
||||
};
|
||||
|
||||
// if setDefaultURL has been called, our first clue
|
||||
// that the SWF is ready and listening
|
||||
//var swfReady = false;
|
||||
|
||||
// the URL we'll send to the SWF once it is ready
|
||||
//var pendingURL = '';
|
||||
|
||||
// Default app state URL to use when no fragment ID present
|
||||
var defaultHash = '';
|
||||
|
||||
// Last-known app state URL
|
||||
var currentHref = document.location.href;
|
||||
|
||||
// Initial URL (used only by IE)
|
||||
var initialHref = document.location.href;
|
||||
|
||||
// Initial URL (used only by IE)
|
||||
var initialHash = document.location.hash;
|
||||
|
||||
// History frame source URL prefix (used only by IE)
|
||||
var historyFrameSourcePrefix = 'history/historyFrame.html?';
|
||||
|
||||
// History maintenance (used only by Safari)
|
||||
var currentHistoryLength = -1;
|
||||
|
||||
var historyHash = [];
|
||||
|
||||
var initialState = createState(initialHref, initialHref + '#' + initialHash, initialHash);
|
||||
|
||||
var backStack = [];
|
||||
var forwardStack = [];
|
||||
|
||||
var currentObjectId = null;
|
||||
|
||||
//UserAgent detection
|
||||
var useragent = navigator.userAgent.toLowerCase();
|
||||
|
||||
if (useragent.indexOf("opera") != -1) {
|
||||
browser.opera = true;
|
||||
} else if (useragent.indexOf("msie") != -1) {
|
||||
browser.ie = true;
|
||||
browser.version = parseFloat(useragent.substring(useragent.indexOf('msie') + 4));
|
||||
if (browser.version == 8)
|
||||
{
|
||||
browser.ie = false;
|
||||
browser.ie8 = true;
|
||||
}
|
||||
} else if (useragent.indexOf("safari") != -1) {
|
||||
browser.safari = true;
|
||||
browser.version = parseFloat(useragent.substring(useragent.indexOf('safari') + 7));
|
||||
} else if (useragent.indexOf("gecko") != -1) {
|
||||
browser.firefox = true;
|
||||
}
|
||||
|
||||
if (browser.ie == true && browser.version == 7) {
|
||||
window["_ie_firstload"] = false;
|
||||
}
|
||||
|
||||
function hashChangeHandler()
|
||||
{
|
||||
currentHref = document.location.href;
|
||||
var flexAppUrl = getHash();
|
||||
//ADR: to fix multiple
|
||||
if (typeof BrowserHistory_multiple != "undefined" && BrowserHistory_multiple == true) {
|
||||
var pl = getPlayers();
|
||||
for (var i = 0; i < pl.length; i++) {
|
||||
pl[i].browserURLChange(flexAppUrl);
|
||||
}
|
||||
} else {
|
||||
getPlayer().browserURLChange(flexAppUrl);
|
||||
}
|
||||
}
|
||||
|
||||
// Accessor functions for obtaining specific elements of the page.
|
||||
function getHistoryFrame()
|
||||
{
|
||||
return document.getElementById('ie_historyFrame');
|
||||
}
|
||||
|
||||
function getAnchorElement()
|
||||
{
|
||||
return document.getElementById('firefox_anchorDiv');
|
||||
}
|
||||
|
||||
function getFormElement()
|
||||
{
|
||||
return document.getElementById('safari_formDiv');
|
||||
}
|
||||
|
||||
function getRememberElement()
|
||||
{
|
||||
return document.getElementById("safari_remember_field");
|
||||
}
|
||||
|
||||
// Get the Flash player object for performing ExternalInterface callbacks.
|
||||
// Updated for changes to SWFObject2.
|
||||
function getPlayer(id) {
|
||||
var i;
|
||||
|
||||
if (id && document.getElementById(id)) {
|
||||
var r = document.getElementById(id);
|
||||
if (typeof r.SetVariable != "undefined") {
|
||||
return r;
|
||||
}
|
||||
else {
|
||||
var o = r.getElementsByTagName("object");
|
||||
var e = r.getElementsByTagName("embed");
|
||||
for (i = 0; i < o.length; i++) {
|
||||
if (typeof o[i].browserURLChange != "undefined")
|
||||
return o[i];
|
||||
}
|
||||
for (i = 0; i < e.length; i++) {
|
||||
if (typeof e[i].browserURLChange != "undefined")
|
||||
return e[i];
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
var o = document.getElementsByTagName("object");
|
||||
var e = document.getElementsByTagName("embed");
|
||||
for (i = 0; i < e.length; i++) {
|
||||
if (typeof e[i].browserURLChange != "undefined")
|
||||
{
|
||||
return e[i];
|
||||
}
|
||||
}
|
||||
for (i = 0; i < o.length; i++) {
|
||||
if (typeof o[i].browserURLChange != "undefined")
|
||||
{
|
||||
return o[i];
|
||||
}
|
||||
}
|
||||
}
|
||||
return undefined;
|
||||
}
|
||||
|
||||
function getPlayers() {
|
||||
var i;
|
||||
var players = [];
|
||||
if (players.length == 0) {
|
||||
var tmp = document.getElementsByTagName('object');
|
||||
for (i = 0; i < tmp.length; i++)
|
||||
{
|
||||
if (typeof tmp[i].browserURLChange != "undefined")
|
||||
players.push(tmp[i]);
|
||||
}
|
||||
}
|
||||
if (players.length == 0 || players[0].object == null) {
|
||||
var tmp = document.getElementsByTagName('embed');
|
||||
for (i = 0; i < tmp.length; i++)
|
||||
{
|
||||
if (typeof tmp[i].browserURLChange != "undefined")
|
||||
players.push(tmp[i]);
|
||||
}
|
||||
}
|
||||
return players;
|
||||
}
|
||||
|
||||
function getIframeHash() {
|
||||
var doc = getHistoryFrame().contentWindow.document;
|
||||
var hash = String(doc.location.search);
|
||||
if (hash.length == 1 && hash.charAt(0) == "?") {
|
||||
hash = "";
|
||||
}
|
||||
else if (hash.length >= 2 && hash.charAt(0) == "?") {
|
||||
hash = hash.substring(1);
|
||||
}
|
||||
return hash;
|
||||
}
|
||||
|
||||
/* Get the current location hash excluding the '#' symbol. */
|
||||
function getHash() {
|
||||
// It would be nice if we could use document.location.hash here,
|
||||
// but it's faulty sometimes.
|
||||
var idx = document.location.href.indexOf('#');
|
||||
return (idx >= 0) ? document.location.href.substr(idx+1) : '';
|
||||
}
|
||||
|
||||
/* Get the current location hash excluding the '#' symbol. */
|
||||
function setHash(hash) {
|
||||
// It would be nice if we could use document.location.hash here,
|
||||
// but it's faulty sometimes.
|
||||
if (hash == '') hash = '#'
|
||||
document.location.hash = hash;
|
||||
}
|
||||
|
||||
function createState(baseUrl, newUrl, flexAppUrl) {
|
||||
return { 'baseUrl': baseUrl, 'newUrl': newUrl, 'flexAppUrl': flexAppUrl, 'title': null };
|
||||
}
|
||||
|
||||
/* Add a history entry to the browser.
|
||||
* baseUrl: the portion of the location prior to the '#'
|
||||
* newUrl: the entire new URL, including '#' and following fragment
|
||||
* flexAppUrl: the portion of the location following the '#' only
|
||||
*/
|
||||
function addHistoryEntry(baseUrl, newUrl, flexAppUrl) {
|
||||
|
||||
//delete all the history entries
|
||||
forwardStack = [];
|
||||
|
||||
if (browser.ie) {
|
||||
//Check to see if we are being asked to do a navigate for the first
|
||||
//history entry, and if so ignore, because it's coming from the creation
|
||||
//of the history iframe
|
||||
if (flexAppUrl == defaultHash && document.location.href == initialHref && window['_ie_firstload']) {
|
||||
currentHref = initialHref;
|
||||
return;
|
||||
}
|
||||
if ((!flexAppUrl || flexAppUrl == defaultHash) && window['_ie_firstload']) {
|
||||
newUrl = baseUrl + '#' + defaultHash;
|
||||
flexAppUrl = defaultHash;
|
||||
} else {
|
||||
// for IE, tell the history frame to go somewhere without a '#'
|
||||
// in order to get this entry into the browser history.
|
||||
getHistoryFrame().src = historyFrameSourcePrefix + flexAppUrl;
|
||||
}
|
||||
setHash(flexAppUrl);
|
||||
} else {
|
||||
|
||||
//ADR
|
||||
if (backStack.length == 0 && initialState.flexAppUrl == flexAppUrl) {
|
||||
initialState = createState(baseUrl, newUrl, flexAppUrl);
|
||||
} else if(backStack.length > 0 && backStack[backStack.length - 1].flexAppUrl == flexAppUrl) {
|
||||
backStack[backStack.length - 1] = createState(baseUrl, newUrl, flexAppUrl);
|
||||
}
|
||||
|
||||
if (browser.safari) {
|
||||
// for Safari, submit a form whose action points to the desired URL
|
||||
if (browser.version <= 419.3) {
|
||||
var file = window.location.pathname.toString();
|
||||
file = file.substring(file.lastIndexOf("/")+1);
|
||||
getFormElement().innerHTML = '<form name="historyForm" action="'+file+'#' + flexAppUrl + '" method="GET"></form>';
|
||||
//get the current elements and add them to the form
|
||||
var qs = window.location.search.substring(1);
|
||||
var qs_arr = qs.split("&");
|
||||
for (var i = 0; i < qs_arr.length; i++) {
|
||||
var tmp = qs_arr[i].split("=");
|
||||
var elem = document.createElement("input");
|
||||
elem.type = "hidden";
|
||||
elem.name = tmp[0];
|
||||
elem.value = tmp[1];
|
||||
document.forms.historyForm.appendChild(elem);
|
||||
}
|
||||
document.forms.historyForm.submit();
|
||||
} else {
|
||||
top.location.hash = flexAppUrl;
|
||||
}
|
||||
// We also have to maintain the history by hand for Safari
|
||||
historyHash[history.length] = flexAppUrl;
|
||||
_storeStates();
|
||||
} else {
|
||||
// Otherwise, write an anchor into the page and tell the browser to go there
|
||||
addAnchor(flexAppUrl);
|
||||
setHash(flexAppUrl);
|
||||
|
||||
// For IE8 we must restore full focus/activation to our invoking player instance.
|
||||
if (browser.ie8)
|
||||
getPlayer().focus();
|
||||
}
|
||||
}
|
||||
backStack.push(createState(baseUrl, newUrl, flexAppUrl));
|
||||
}
|
||||
|
||||
function _storeStates() {
|
||||
if (browser.safari) {
|
||||
getRememberElement().value = historyHash.join(",");
|
||||
}
|
||||
}
|
||||
|
||||
function handleBackButton() {
|
||||
//The "current" page is always at the top of the history stack.
|
||||
var current = backStack.pop();
|
||||
if (!current) { return; }
|
||||
var last = backStack[backStack.length - 1];
|
||||
if (!last && backStack.length == 0){
|
||||
last = initialState;
|
||||
}
|
||||
forwardStack.push(current);
|
||||
}
|
||||
|
||||
function handleForwardButton() {
|
||||
//summary: private method. Do not call this directly.
|
||||
|
||||
var last = forwardStack.pop();
|
||||
if (!last) { return; }
|
||||
backStack.push(last);
|
||||
}
|
||||
|
||||
function handleArbitraryUrl() {
|
||||
//delete all the history entries
|
||||
forwardStack = [];
|
||||
}
|
||||
|
||||
/* Called periodically to poll to see if we need to detect navigation that has occurred */
|
||||
function checkForUrlChange() {
|
||||
|
||||
if (browser.ie) {
|
||||
if (currentHref != document.location.href && currentHref + '#' != document.location.href) {
|
||||
//This occurs when the user has navigated to a specific URL
|
||||
//within the app, and didn't use browser back/forward
|
||||
//IE seems to have a bug where it stops updating the URL it
|
||||
//shows the end-user at this point, but programatically it
|
||||
//appears to be correct. Do a full app reload to get around
|
||||
//this issue.
|
||||
if (browser.version < 7) {
|
||||
currentHref = document.location.href;
|
||||
document.location.reload();
|
||||
} else {
|
||||
if (getHash() != getIframeHash()) {
|
||||
// this.iframe.src = this.blankURL + hash;
|
||||
var sourceToSet = historyFrameSourcePrefix + getHash();
|
||||
getHistoryFrame().src = sourceToSet;
|
||||
currentHref = document.location.href;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (browser.safari) {
|
||||
// For Safari, we have to check to see if history.length changed.
|
||||
if (currentHistoryLength >= 0 && history.length != currentHistoryLength) {
|
||||
//alert("did change: " + history.length + ", " + historyHash.length + "|" + historyHash[history.length] + "|>" + historyHash.join("|"));
|
||||
var flexAppUrl = getHash();
|
||||
if (browser.version < 528.16 /* Anything earlier than Safari 4.0 */)
|
||||
{
|
||||
// If it did change and we're running Safari 3.x or earlier,
|
||||
// then we have to look the old state up in our hand-maintained
|
||||
// array since document.location.hash won't have changed,
|
||||
// then call back into BrowserManager.
|
||||
currentHistoryLength = history.length;
|
||||
flexAppUrl = historyHash[currentHistoryLength];
|
||||
}
|
||||
|
||||
//ADR: to fix multiple
|
||||
if (typeof BrowserHistory_multiple != "undefined" && BrowserHistory_multiple == true) {
|
||||
var pl = getPlayers();
|
||||
for (var i = 0; i < pl.length; i++) {
|
||||
pl[i].browserURLChange(flexAppUrl);
|
||||
}
|
||||
} else {
|
||||
getPlayer().browserURLChange(flexAppUrl);
|
||||
}
|
||||
_storeStates();
|
||||
}
|
||||
}
|
||||
if (browser.firefox) {
|
||||
if (currentHref != document.location.href) {
|
||||
var bsl = backStack.length;
|
||||
|
||||
var urlActions = {
|
||||
back: false,
|
||||
forward: false,
|
||||
set: false
|
||||
}
|
||||
|
||||
if ((window.location.hash == initialHash || window.location.href == initialHref) && (bsl == 1)) {
|
||||
urlActions.back = true;
|
||||
// FIXME: could this ever be a forward button?
|
||||
// we can't clear it because we still need to check for forwards. Ugg.
|
||||
// clearInterval(this.locationTimer);
|
||||
handleBackButton();
|
||||
}
|
||||
|
||||
// first check to see if we could have gone forward. We always halt on
|
||||
// a no-hash item.
|
||||
if (forwardStack.length > 0) {
|
||||
if (forwardStack[forwardStack.length-1].flexAppUrl == getHash()) {
|
||||
urlActions.forward = true;
|
||||
handleForwardButton();
|
||||
}
|
||||
}
|
||||
|
||||
// ok, that didn't work, try someplace back in the history stack
|
||||
if ((bsl >= 2) && (backStack[bsl - 2])) {
|
||||
if (backStack[bsl - 2].flexAppUrl == getHash()) {
|
||||
urlActions.back = true;
|
||||
handleBackButton();
|
||||
}
|
||||
}
|
||||
|
||||
if (!urlActions.back && !urlActions.forward) {
|
||||
var foundInStacks = {
|
||||
back: -1,
|
||||
forward: -1
|
||||
}
|
||||
|
||||
for (var i = 0; i < backStack.length; i++) {
|
||||
if (backStack[i].flexAppUrl == getHash() && i != (bsl - 2)) {
|
||||
arbitraryUrl = true;
|
||||
foundInStacks.back = i;
|
||||
}
|
||||
}
|
||||
for (var i = 0; i < forwardStack.length; i++) {
|
||||
if (forwardStack[i].flexAppUrl == getHash() && i != (bsl - 2)) {
|
||||
arbitraryUrl = true;
|
||||
foundInStacks.forward = i;
|
||||
}
|
||||
}
|
||||
handleArbitraryUrl();
|
||||
}
|
||||
|
||||
// Firefox changed; do a callback into BrowserManager to tell it.
|
||||
currentHref = document.location.href;
|
||||
var flexAppUrl = getHash();
|
||||
//ADR: to fix multiple
|
||||
if (typeof BrowserHistory_multiple != "undefined" && BrowserHistory_multiple == true) {
|
||||
var pl = getPlayers();
|
||||
for (var i = 0; i < pl.length; i++) {
|
||||
pl[i].browserURLChange(flexAppUrl);
|
||||
}
|
||||
} else {
|
||||
getPlayer().browserURLChange(flexAppUrl);
|
||||
}
|
||||
}
|
||||
}
|
||||
//setTimeout(checkForUrlChange, 50);
|
||||
}
|
||||
|
||||
/* Write an anchor into the page to legitimize it as a URL for Firefox et al. */
|
||||
function addAnchor(flexAppUrl)
|
||||
{
|
||||
if (document.getElementsByName(flexAppUrl).length == 0) {
|
||||
getAnchorElement().innerHTML += "<a name='" + flexAppUrl + "'>" + flexAppUrl + "</a>";
|
||||
}
|
||||
}
|
||||
|
||||
var _initialize = function () {
|
||||
if (browser.ie)
|
||||
{
|
||||
var scripts = document.getElementsByTagName('script');
|
||||
for (var i = 0, s; s = scripts[i]; i++) {
|
||||
if (s.src.indexOf("history.js") > -1) {
|
||||
var iframe_location = (new String(s.src)).replace("history.js", "historyFrame.html");
|
||||
}
|
||||
}
|
||||
historyFrameSourcePrefix = iframe_location + "?";
|
||||
var src = historyFrameSourcePrefix;
|
||||
|
||||
var iframe = document.createElement("iframe");
|
||||
iframe.id = 'ie_historyFrame';
|
||||
iframe.name = 'ie_historyFrame';
|
||||
iframe.src = 'javascript:false;';
|
||||
|
||||
try {
|
||||
document.body.appendChild(iframe);
|
||||
} catch(e) {
|
||||
setTimeout(function() {
|
||||
document.body.appendChild(iframe);
|
||||
}, 0);
|
||||
}
|
||||
}
|
||||
|
||||
if (browser.safari)
|
||||
{
|
||||
var rememberDiv = document.createElement("div");
|
||||
rememberDiv.id = 'safari_rememberDiv';
|
||||
document.body.appendChild(rememberDiv);
|
||||
rememberDiv.innerHTML = '<input type="text" id="safari_remember_field" style="width: 500px;">';
|
||||
|
||||
var formDiv = document.createElement("div");
|
||||
formDiv.id = 'safari_formDiv';
|
||||
document.body.appendChild(formDiv);
|
||||
|
||||
var reloader_content = document.createElement('div');
|
||||
reloader_content.id = 'safarireloader';
|
||||
var scripts = document.getElementsByTagName('script');
|
||||
for (var i = 0, s; s = scripts[i]; i++) {
|
||||
if (s.src.indexOf("history.js") > -1) {
|
||||
html = (new String(s.src)).replace(".js", ".html");
|
||||
}
|
||||
}
|
||||
reloader_content.innerHTML = '<iframe id="safarireloader-iframe" src="about:blank" frameborder="no" scrolling="no"></iframe>';
|
||||
document.body.appendChild(reloader_content);
|
||||
reloader_content.style.position = 'absolute';
|
||||
reloader_content.style.left = reloader_content.style.top = '-9999px';
|
||||
iframe = reloader_content.getElementsByTagName('iframe')[0];
|
||||
|
||||
if (document.getElementById("safari_remember_field").value != "" ) {
|
||||
historyHash = document.getElementById("safari_remember_field").value.split(",");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if (browser.firefox || browser.ie8)
|
||||
{
|
||||
var anchorDiv = document.createElement("div");
|
||||
anchorDiv.id = 'firefox_anchorDiv';
|
||||
document.body.appendChild(anchorDiv);
|
||||
}
|
||||
|
||||
if (browser.ie8)
|
||||
document.body.onhashchange = hashChangeHandler;
|
||||
//setTimeout(checkForUrlChange, 50);
|
||||
}
|
||||
|
||||
return {
|
||||
historyHash: historyHash,
|
||||
backStack: function() { return backStack; },
|
||||
forwardStack: function() { return forwardStack },
|
||||
getPlayer: getPlayer,
|
||||
initialize: function(src) {
|
||||
_initialize(src);
|
||||
},
|
||||
setURL: function(url) {
|
||||
document.location.href = url;
|
||||
},
|
||||
getURL: function() {
|
||||
return document.location.href;
|
||||
},
|
||||
getTitle: function() {
|
||||
return document.title;
|
||||
},
|
||||
setTitle: function(title) {
|
||||
try {
|
||||
backStack[backStack.length - 1].title = title;
|
||||
} catch(e) { }
|
||||
//if on safari, set the title to be the empty string.
|
||||
if (browser.safari) {
|
||||
if (title == "") {
|
||||
try {
|
||||
var tmp = window.location.href.toString();
|
||||
title = tmp.substring((tmp.lastIndexOf("/")+1), tmp.lastIndexOf("#"));
|
||||
} catch(e) {
|
||||
title = "";
|
||||
}
|
||||
}
|
||||
}
|
||||
document.title = title;
|
||||
},
|
||||
setDefaultURL: function(def)
|
||||
{
|
||||
defaultHash = def;
|
||||
def = getHash();
|
||||
//trailing ? is important else an extra frame gets added to the history
|
||||
//when navigating back to the first page. Alternatively could check
|
||||
//in history frame navigation to compare # and ?.
|
||||
if (browser.ie)
|
||||
{
|
||||
window['_ie_firstload'] = true;
|
||||
var sourceToSet = historyFrameSourcePrefix + def;
|
||||
var func = function() {
|
||||
getHistoryFrame().src = sourceToSet;
|
||||
window.location.replace("#" + def);
|
||||
setInterval(checkForUrlChange, 50);
|
||||
}
|
||||
try {
|
||||
func();
|
||||
} catch(e) {
|
||||
window.setTimeout(function() { func(); }, 0);
|
||||
}
|
||||
}
|
||||
|
||||
if (browser.safari)
|
||||
{
|
||||
currentHistoryLength = history.length;
|
||||
if (historyHash.length == 0) {
|
||||
historyHash[currentHistoryLength] = def;
|
||||
var newloc = "#" + def;
|
||||
window.location.replace(newloc);
|
||||
} else {
|
||||
//alert(historyHash[historyHash.length-1]);
|
||||
}
|
||||
//setHash(def);
|
||||
setInterval(checkForUrlChange, 50);
|
||||
}
|
||||
|
||||
|
||||
if (browser.firefox || browser.opera)
|
||||
{
|
||||
var reg = new RegExp("#" + def + "$");
|
||||
if (window.location.toString().match(reg)) {
|
||||
} else {
|
||||
var newloc ="#" + def;
|
||||
window.location.replace(newloc);
|
||||
}
|
||||
setInterval(checkForUrlChange, 50);
|
||||
//setHash(def);
|
||||
}
|
||||
|
||||
},
|
||||
|
||||
/* Set the current browser URL; called from inside BrowserManager to propagate
|
||||
* the application state out to the container.
|
||||
*/
|
||||
setBrowserURL: function(flexAppUrl, objectId) {
|
||||
if (browser.ie && typeof objectId != "undefined") {
|
||||
currentObjectId = objectId;
|
||||
}
|
||||
//fromIframe = fromIframe || false;
|
||||
//fromFlex = fromFlex || false;
|
||||
//alert("setBrowserURL: " + flexAppUrl);
|
||||
//flexAppUrl = (flexAppUrl == "") ? defaultHash : flexAppUrl ;
|
||||
|
||||
var pos = document.location.href.indexOf('#');
|
||||
var baseUrl = pos != -1 ? document.location.href.substr(0, pos) : document.location.href;
|
||||
var newUrl = baseUrl + '#' + flexAppUrl;
|
||||
|
||||
if (document.location.href != newUrl && document.location.href + '#' != newUrl) {
|
||||
currentHref = newUrl;
|
||||
addHistoryEntry(baseUrl, newUrl, flexAppUrl);
|
||||
currentHistoryLength = history.length;
|
||||
}
|
||||
},
|
||||
|
||||
browserURLChange: function(flexAppUrl) {
|
||||
var objectId = null;
|
||||
if (browser.ie && currentObjectId != null) {
|
||||
objectId = currentObjectId;
|
||||
}
|
||||
pendingURL = '';
|
||||
|
||||
if (typeof BrowserHistory_multiple != "undefined" && BrowserHistory_multiple == true) {
|
||||
var pl = getPlayers();
|
||||
for (var i = 0; i < pl.length; i++) {
|
||||
try {
|
||||
pl[i].browserURLChange(flexAppUrl);
|
||||
} catch(e) { }
|
||||
}
|
||||
} else {
|
||||
try {
|
||||
getPlayer(objectId).browserURLChange(flexAppUrl);
|
||||
} catch(e) { }
|
||||
}
|
||||
|
||||
currentObjectId = null;
|
||||
},
|
||||
getUserAgent: function() {
|
||||
return navigator.userAgent;
|
||||
},
|
||||
getPlatform: function() {
|
||||
return navigator.platform;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
})();
|
||||
|
||||
// Initialization
|
||||
|
||||
// Automated unit testing and other diagnostics
|
||||
|
||||
function setURL(url)
|
||||
{
|
||||
document.location.href = url;
|
||||
}
|
||||
|
||||
function backButton()
|
||||
{
|
||||
history.back();
|
||||
}
|
||||
|
||||
function forwardButton()
|
||||
{
|
||||
history.forward();
|
||||
}
|
||||
|
||||
function goForwardOrBackInHistory(step)
|
||||
{
|
||||
history.go(step);
|
||||
}
|
||||
|
||||
//BrowserHistoryUtils.addEvent(window, "load", function() { BrowserHistory.initialize(); });
|
||||
(function(i) {
|
||||
var u =navigator.userAgent;var e=/*@cc_on!@*/false;
|
||||
var st = setTimeout;
|
||||
if(/webkit/i.test(u)){
|
||||
st(function(){
|
||||
var dr=document.readyState;
|
||||
if(dr=="loaded"||dr=="complete"){i()}
|
||||
else{st(arguments.callee,10);}},10);
|
||||
} else if((/mozilla/i.test(u)&&!/(compati)/.test(u)) || (/opera/i.test(u))){
|
||||
document.addEventListener("DOMContentLoaded",i,false);
|
||||
} else if(e){
|
||||
(function(){
|
||||
var t=document.createElement('doc:rdy');
|
||||
try{t.doScroll('left');
|
||||
i();t=null;
|
||||
}catch(e){st(arguments.callee,0);}})();
|
||||
} else{
|
||||
window.onload=i;
|
||||
}
|
||||
})( function() {BrowserHistory.initialize();} );
|
@@ -1,29 +0,0 @@
|
||||
<html>
|
||||
<head>
|
||||
<META HTTP-EQUIV="Pragma" CONTENT="no-cache">
|
||||
<META HTTP-EQUIV="Expires" CONTENT="-1">
|
||||
</head>
|
||||
<body>
|
||||
<script>
|
||||
function processUrl()
|
||||
{
|
||||
|
||||
var pos = url.indexOf("?");
|
||||
url = pos != -1 ? url.substr(pos + 1) : "";
|
||||
if (!parent._ie_firstload) {
|
||||
parent.BrowserHistory.setBrowserURL(url);
|
||||
try {
|
||||
parent.BrowserHistory.browserURLChange(url);
|
||||
} catch(e) { }
|
||||
} else {
|
||||
parent._ie_firstload = false;
|
||||
}
|
||||
}
|
||||
|
||||
var url = document.location.href;
|
||||
processUrl();
|
||||
document.write(encodeURIComponent(url));
|
||||
</script>
|
||||
Hidden frame for Browser History support.
|
||||
</body>
|
||||
</html>
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -1,777 +0,0 @@
|
||||
/*! SWFObject v2.2 <http://code.google.com/p/swfobject/>
|
||||
is released under the MIT License <http://www.opensource.org/licenses/mit-license.php>
|
||||
*/
|
||||
|
||||
var swfobject = function() {
|
||||
|
||||
var UNDEF = "undefined",
|
||||
OBJECT = "object",
|
||||
SHOCKWAVE_FLASH = "Shockwave Flash",
|
||||
SHOCKWAVE_FLASH_AX = "ShockwaveFlash.ShockwaveFlash",
|
||||
FLASH_MIME_TYPE = "application/x-shockwave-flash",
|
||||
EXPRESS_INSTALL_ID = "SWFObjectExprInst",
|
||||
ON_READY_STATE_CHANGE = "onreadystatechange",
|
||||
|
||||
win = window,
|
||||
doc = document,
|
||||
nav = navigator,
|
||||
|
||||
plugin = false,
|
||||
domLoadFnArr = [main],
|
||||
regObjArr = [],
|
||||
objIdArr = [],
|
||||
listenersArr = [],
|
||||
storedAltContent,
|
||||
storedAltContentId,
|
||||
storedCallbackFn,
|
||||
storedCallbackObj,
|
||||
isDomLoaded = false,
|
||||
isExpressInstallActive = false,
|
||||
dynamicStylesheet,
|
||||
dynamicStylesheetMedia,
|
||||
autoHideShow = true,
|
||||
|
||||
/* Centralized function for browser feature detection
|
||||
- User agent string detection is only used when no good alternative is possible
|
||||
- Is executed directly for optimal performance
|
||||
*/
|
||||
ua = function() {
|
||||
var w3cdom = typeof doc.getElementById != UNDEF && typeof doc.getElementsByTagName != UNDEF && typeof doc.createElement != UNDEF,
|
||||
u = nav.userAgent.toLowerCase(),
|
||||
p = nav.platform.toLowerCase(),
|
||||
windows = p ? /win/.test(p) : /win/.test(u),
|
||||
mac = p ? /mac/.test(p) : /mac/.test(u),
|
||||
webkit = /webkit/.test(u) ? parseFloat(u.replace(/^.*webkit\/(\d+(\.\d+)?).*$/, "$1")) : false, // returns either the webkit version or false if not webkit
|
||||
ie = !+"\v1", // feature detection based on Andrea Giammarchi's solution: http://webreflection.blogspot.com/2009/01/32-bytes-to-know-if-your-browser-is-ie.html
|
||||
playerVersion = [0,0,0],
|
||||
d = null;
|
||||
if (typeof nav.plugins != UNDEF && typeof nav.plugins[SHOCKWAVE_FLASH] == OBJECT) {
|
||||
d = nav.plugins[SHOCKWAVE_FLASH].description;
|
||||
if (d && !(typeof nav.mimeTypes != UNDEF && nav.mimeTypes[FLASH_MIME_TYPE] && !nav.mimeTypes[FLASH_MIME_TYPE].enabledPlugin)) { // navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin indicates whether plug-ins are enabled or disabled in Safari 3+
|
||||
plugin = true;
|
||||
ie = false; // cascaded feature detection for Internet Explorer
|
||||
d = d.replace(/^.*\s+(\S+\s+\S+$)/, "$1");
|
||||
playerVersion[0] = parseInt(d.replace(/^(.*)\..*$/, "$1"), 10);
|
||||
playerVersion[1] = parseInt(d.replace(/^.*\.(.*)\s.*$/, "$1"), 10);
|
||||
playerVersion[2] = /[a-zA-Z]/.test(d) ? parseInt(d.replace(/^.*[a-zA-Z]+(.*)$/, "$1"), 10) : 0;
|
||||
}
|
||||
}
|
||||
else if (typeof win.ActiveXObject != UNDEF) {
|
||||
try {
|
||||
var a = new ActiveXObject(SHOCKWAVE_FLASH_AX);
|
||||
if (a) { // a will return null when ActiveX is disabled
|
||||
d = a.GetVariable("$version");
|
||||
if (d) {
|
||||
ie = true; // cascaded feature detection for Internet Explorer
|
||||
d = d.split(" ")[1].split(",");
|
||||
playerVersion = [parseInt(d[0], 10), parseInt(d[1], 10), parseInt(d[2], 10)];
|
||||
}
|
||||
}
|
||||
}
|
||||
catch(e) {}
|
||||
}
|
||||
return { w3:w3cdom, pv:playerVersion, wk:webkit, ie:ie, win:windows, mac:mac };
|
||||
}(),
|
||||
|
||||
/* Cross-browser onDomLoad
|
||||
- Will fire an event as soon as the DOM of a web page is loaded
|
||||
- Internet Explorer workaround based on Diego Perini's solution: http://javascript.nwbox.com/IEContentLoaded/
|
||||
- Regular onload serves as fallback
|
||||
*/
|
||||
onDomLoad = function() {
|
||||
if (!ua.w3) { return; }
|
||||
if ((typeof doc.readyState != UNDEF && doc.readyState == "complete") || (typeof doc.readyState == UNDEF && (doc.getElementsByTagName("body")[0] || doc.body))) { // function is fired after onload, e.g. when script is inserted dynamically
|
||||
callDomLoadFunctions();
|
||||
}
|
||||
if (!isDomLoaded) {
|
||||
if (typeof doc.addEventListener != UNDEF) {
|
||||
doc.addEventListener("DOMContentLoaded", callDomLoadFunctions, false);
|
||||
}
|
||||
if (ua.ie && ua.win) {
|
||||
doc.attachEvent(ON_READY_STATE_CHANGE, function() {
|
||||
if (doc.readyState == "complete") {
|
||||
doc.detachEvent(ON_READY_STATE_CHANGE, arguments.callee);
|
||||
callDomLoadFunctions();
|
||||
}
|
||||
});
|
||||
if (win == top) { // if not inside an iframe
|
||||
(function(){
|
||||
if (isDomLoaded) { return; }
|
||||
try {
|
||||
doc.documentElement.doScroll("left");
|
||||
}
|
||||
catch(e) {
|
||||
setTimeout(arguments.callee, 0);
|
||||
return;
|
||||
}
|
||||
callDomLoadFunctions();
|
||||
})();
|
||||
}
|
||||
}
|
||||
if (ua.wk) {
|
||||
(function(){
|
||||
if (isDomLoaded) { return; }
|
||||
if (!/loaded|complete/.test(doc.readyState)) {
|
||||
setTimeout(arguments.callee, 0);
|
||||
return;
|
||||
}
|
||||
callDomLoadFunctions();
|
||||
})();
|
||||
}
|
||||
addLoadEvent(callDomLoadFunctions);
|
||||
}
|
||||
}();
|
||||
|
||||
function callDomLoadFunctions() {
|
||||
if (isDomLoaded) { return; }
|
||||
try { // test if we can really add/remove elements to/from the DOM; we don't want to fire it too early
|
||||
var t = doc.getElementsByTagName("body")[0].appendChild(createElement("span"));
|
||||
t.parentNode.removeChild(t);
|
||||
}
|
||||
catch (e) { return; }
|
||||
isDomLoaded = true;
|
||||
var dl = domLoadFnArr.length;
|
||||
for (var i = 0; i < dl; i++) {
|
||||
domLoadFnArr[i]();
|
||||
}
|
||||
}
|
||||
|
||||
function addDomLoadEvent(fn) {
|
||||
if (isDomLoaded) {
|
||||
fn();
|
||||
}
|
||||
else {
|
||||
domLoadFnArr[domLoadFnArr.length] = fn; // Array.push() is only available in IE5.5+
|
||||
}
|
||||
}
|
||||
|
||||
/* Cross-browser onload
|
||||
- Based on James Edwards' solution: http://brothercake.com/site/resources/scripts/onload/
|
||||
- Will fire an event as soon as a web page including all of its assets are loaded
|
||||
*/
|
||||
function addLoadEvent(fn) {
|
||||
if (typeof win.addEventListener != UNDEF) {
|
||||
win.addEventListener("load", fn, false);
|
||||
}
|
||||
else if (typeof doc.addEventListener != UNDEF) {
|
||||
doc.addEventListener("load", fn, false);
|
||||
}
|
||||
else if (typeof win.attachEvent != UNDEF) {
|
||||
addListener(win, "onload", fn);
|
||||
}
|
||||
else if (typeof win.onload == "function") {
|
||||
var fnOld = win.onload;
|
||||
win.onload = function() {
|
||||
fnOld();
|
||||
fn();
|
||||
};
|
||||
}
|
||||
else {
|
||||
win.onload = fn;
|
||||
}
|
||||
}
|
||||
|
||||
/* Main function
|
||||
- Will preferably execute onDomLoad, otherwise onload (as a fallback)
|
||||
*/
|
||||
function main() {
|
||||
if (plugin) {
|
||||
testPlayerVersion();
|
||||
}
|
||||
else {
|
||||
matchVersions();
|
||||
}
|
||||
}
|
||||
|
||||
/* Detect the Flash Player version for non-Internet Explorer browsers
|
||||
- Detecting the plug-in version via the object element is more precise than using the plugins collection item's description:
|
||||
a. Both release and build numbers can be detected
|
||||
b. Avoid wrong descriptions by corrupt installers provided by Adobe
|
||||
c. Avoid wrong descriptions by multiple Flash Player entries in the plugin Array, caused by incorrect browser imports
|
||||
- Disadvantage of this method is that it depends on the availability of the DOM, while the plugins collection is immediately available
|
||||
*/
|
||||
function testPlayerVersion() {
|
||||
var b = doc.getElementsByTagName("body")[0];
|
||||
var o = createElement(OBJECT);
|
||||
o.setAttribute("type", FLASH_MIME_TYPE);
|
||||
var t = b.appendChild(o);
|
||||
if (t) {
|
||||
var counter = 0;
|
||||
(function(){
|
||||
if (typeof t.GetVariable != UNDEF) {
|
||||
var d = t.GetVariable("$version");
|
||||
if (d) {
|
||||
d = d.split(" ")[1].split(",");
|
||||
ua.pv = [parseInt(d[0], 10), parseInt(d[1], 10), parseInt(d[2], 10)];
|
||||
}
|
||||
}
|
||||
else if (counter < 10) {
|
||||
counter++;
|
||||
setTimeout(arguments.callee, 10);
|
||||
return;
|
||||
}
|
||||
b.removeChild(o);
|
||||
t = null;
|
||||
matchVersions();
|
||||
})();
|
||||
}
|
||||
else {
|
||||
matchVersions();
|
||||
}
|
||||
}
|
||||
|
||||
/* Perform Flash Player and SWF version matching; static publishing only
|
||||
*/
|
||||
function matchVersions() {
|
||||
var rl = regObjArr.length;
|
||||
if (rl > 0) {
|
||||
for (var i = 0; i < rl; i++) { // for each registered object element
|
||||
var id = regObjArr[i].id;
|
||||
var cb = regObjArr[i].callbackFn;
|
||||
var cbObj = {success:false, id:id};
|
||||
if (ua.pv[0] > 0) {
|
||||
var obj = getElementById(id);
|
||||
if (obj) {
|
||||
if (hasPlayerVersion(regObjArr[i].swfVersion) && !(ua.wk && ua.wk < 312)) { // Flash Player version >= published SWF version: Houston, we have a match!
|
||||
setVisibility(id, true);
|
||||
if (cb) {
|
||||
cbObj.success = true;
|
||||
cbObj.ref = getObjectById(id);
|
||||
cb(cbObj);
|
||||
}
|
||||
}
|
||||
else if (regObjArr[i].expressInstall && canExpressInstall()) { // show the Adobe Express Install dialog if set by the web page author and if supported
|
||||
var att = {};
|
||||
att.data = regObjArr[i].expressInstall;
|
||||
att.width = obj.getAttribute("width") || "0";
|
||||
att.height = obj.getAttribute("height") || "0";
|
||||
if (obj.getAttribute("class")) { att.styleclass = obj.getAttribute("class"); }
|
||||
if (obj.getAttribute("align")) { att.align = obj.getAttribute("align"); }
|
||||
// parse HTML object param element's name-value pairs
|
||||
var par = {};
|
||||
var p = obj.getElementsByTagName("param");
|
||||
var pl = p.length;
|
||||
for (var j = 0; j < pl; j++) {
|
||||
if (p[j].getAttribute("name").toLowerCase() != "movie") {
|
||||
par[p[j].getAttribute("name")] = p[j].getAttribute("value");
|
||||
}
|
||||
}
|
||||
showExpressInstall(att, par, id, cb);
|
||||
}
|
||||
else { // Flash Player and SWF version mismatch or an older Webkit engine that ignores the HTML object element's nested param elements: display alternative content instead of SWF
|
||||
displayAltContent(obj);
|
||||
if (cb) { cb(cbObj); }
|
||||
}
|
||||
}
|
||||
}
|
||||
else { // if no Flash Player is installed or the fp version cannot be detected we let the HTML object element do its job (either show a SWF or alternative content)
|
||||
setVisibility(id, true);
|
||||
if (cb) {
|
||||
var o = getObjectById(id); // test whether there is an HTML object element or not
|
||||
if (o && typeof o.SetVariable != UNDEF) {
|
||||
cbObj.success = true;
|
||||
cbObj.ref = o;
|
||||
}
|
||||
cb(cbObj);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function getObjectById(objectIdStr) {
|
||||
var r = null;
|
||||
var o = getElementById(objectIdStr);
|
||||
if (o && o.nodeName == "OBJECT") {
|
||||
if (typeof o.SetVariable != UNDEF) {
|
||||
r = o;
|
||||
}
|
||||
else {
|
||||
var n = o.getElementsByTagName(OBJECT)[0];
|
||||
if (n) {
|
||||
r = n;
|
||||
}
|
||||
}
|
||||
}
|
||||
return r;
|
||||
}
|
||||
|
||||
/* Requirements for Adobe Express Install
|
||||
- only one instance can be active at a time
|
||||
- fp 6.0.65 or higher
|
||||
- Win/Mac OS only
|
||||
- no Webkit engines older than version 312
|
||||
*/
|
||||
function canExpressInstall() {
|
||||
return !isExpressInstallActive && hasPlayerVersion("6.0.65") && (ua.win || ua.mac) && !(ua.wk && ua.wk < 312);
|
||||
}
|
||||
|
||||
/* Show the Adobe Express Install dialog
|
||||
- Reference: http://www.adobe.com/cfusion/knowledgebase/index.cfm?id=6a253b75
|
||||
*/
|
||||
function showExpressInstall(att, par, replaceElemIdStr, callbackFn) {
|
||||
isExpressInstallActive = true;
|
||||
storedCallbackFn = callbackFn || null;
|
||||
storedCallbackObj = {success:false, id:replaceElemIdStr};
|
||||
var obj = getElementById(replaceElemIdStr);
|
||||
if (obj) {
|
||||
if (obj.nodeName == "OBJECT") { // static publishing
|
||||
storedAltContent = abstractAltContent(obj);
|
||||
storedAltContentId = null;
|
||||
}
|
||||
else { // dynamic publishing
|
||||
storedAltContent = obj;
|
||||
storedAltContentId = replaceElemIdStr;
|
||||
}
|
||||
att.id = EXPRESS_INSTALL_ID;
|
||||
if (typeof att.width == UNDEF || (!/%$/.test(att.width) && parseInt(att.width, 10) < 310)) { att.width = "310"; }
|
||||
if (typeof att.height == UNDEF || (!/%$/.test(att.height) && parseInt(att.height, 10) < 137)) { att.height = "137"; }
|
||||
doc.title = doc.title.slice(0, 47) + " - Flash Player Installation";
|
||||
var pt = ua.ie && ua.win ? "ActiveX" : "PlugIn",
|
||||
fv = "MMredirectURL=" + encodeURI(window.location).toString().replace(/&/g,"%26") + "&MMplayerType=" + pt + "&MMdoctitle=" + doc.title;
|
||||
if (typeof par.flashvars != UNDEF) {
|
||||
par.flashvars += "&" + fv;
|
||||
}
|
||||
else {
|
||||
par.flashvars = fv;
|
||||
}
|
||||
// IE only: when a SWF is loading (AND: not available in cache) wait for the readyState of the object element to become 4 before removing it,
|
||||
// because you cannot properly cancel a loading SWF file without breaking browser load references, also obj.onreadystatechange doesn't work
|
||||
if (ua.ie && ua.win && obj.readyState != 4) {
|
||||
var newObj = createElement("div");
|
||||
replaceElemIdStr += "SWFObjectNew";
|
||||
newObj.setAttribute("id", replaceElemIdStr);
|
||||
obj.parentNode.insertBefore(newObj, obj); // insert placeholder div that will be replaced by the object element that loads expressinstall.swf
|
||||
obj.style.display = "none";
|
||||
(function(){
|
||||
if (obj.readyState == 4) {
|
||||
obj.parentNode.removeChild(obj);
|
||||
}
|
||||
else {
|
||||
setTimeout(arguments.callee, 10);
|
||||
}
|
||||
})();
|
||||
}
|
||||
createSWF(att, par, replaceElemIdStr);
|
||||
}
|
||||
}
|
||||
|
||||
/* Functions to abstract and display alternative content
|
||||
*/
|
||||
function displayAltContent(obj) {
|
||||
if (ua.ie && ua.win && obj.readyState != 4) {
|
||||
// IE only: when a SWF is loading (AND: not available in cache) wait for the readyState of the object element to become 4 before removing it,
|
||||
// because you cannot properly cancel a loading SWF file without breaking browser load references, also obj.onreadystatechange doesn't work
|
||||
var el = createElement("div");
|
||||
obj.parentNode.insertBefore(el, obj); // insert placeholder div that will be replaced by the alternative content
|
||||
el.parentNode.replaceChild(abstractAltContent(obj), el);
|
||||
obj.style.display = "none";
|
||||
(function(){
|
||||
if (obj.readyState == 4) {
|
||||
obj.parentNode.removeChild(obj);
|
||||
}
|
||||
else {
|
||||
setTimeout(arguments.callee, 10);
|
||||
}
|
||||
})();
|
||||
}
|
||||
else {
|
||||
obj.parentNode.replaceChild(abstractAltContent(obj), obj);
|
||||
}
|
||||
}
|
||||
|
||||
function abstractAltContent(obj) {
|
||||
var ac = createElement("div");
|
||||
if (ua.win && ua.ie) {
|
||||
ac.innerHTML = obj.innerHTML;
|
||||
}
|
||||
else {
|
||||
var nestedObj = obj.getElementsByTagName(OBJECT)[0];
|
||||
if (nestedObj) {
|
||||
var c = nestedObj.childNodes;
|
||||
if (c) {
|
||||
var cl = c.length;
|
||||
for (var i = 0; i < cl; i++) {
|
||||
if (!(c[i].nodeType == 1 && c[i].nodeName == "PARAM") && !(c[i].nodeType == 8)) {
|
||||
ac.appendChild(c[i].cloneNode(true));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return ac;
|
||||
}
|
||||
|
||||
/* Cross-browser dynamic SWF creation
|
||||
*/
|
||||
function createSWF(attObj, parObj, id) {
|
||||
var r, el = getElementById(id);
|
||||
if (ua.wk && ua.wk < 312) { return r; }
|
||||
if (el) {
|
||||
if (typeof attObj.id == UNDEF) { // if no 'id' is defined for the object element, it will inherit the 'id' from the alternative content
|
||||
attObj.id = id;
|
||||
}
|
||||
if (ua.ie && ua.win) { // Internet Explorer + the HTML object element + W3C DOM methods do not combine: fall back to outerHTML
|
||||
var att = "";
|
||||
for (var i in attObj) {
|
||||
if (attObj[i] != Object.prototype[i]) { // filter out prototype additions from other potential libraries
|
||||
if (i.toLowerCase() == "data") {
|
||||
parObj.movie = attObj[i];
|
||||
}
|
||||
else if (i.toLowerCase() == "styleclass") { // 'class' is an ECMA4 reserved keyword
|
||||
att += ' class="' + attObj[i] + '"';
|
||||
}
|
||||
else if (i.toLowerCase() != "classid") {
|
||||
att += ' ' + i + '="' + attObj[i] + '"';
|
||||
}
|
||||
}
|
||||
}
|
||||
var par = "";
|
||||
for (var j in parObj) {
|
||||
if (parObj[j] != Object.prototype[j]) { // filter out prototype additions from other potential libraries
|
||||
par += '<param name="' + j + '" value="' + parObj[j] + '" />';
|
||||
}
|
||||
}
|
||||
el.outerHTML = '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"' + att + '>' + par + '</object>';
|
||||
objIdArr[objIdArr.length] = attObj.id; // stored to fix object 'leaks' on unload (dynamic publishing only)
|
||||
r = getElementById(attObj.id);
|
||||
}
|
||||
else { // well-behaving browsers
|
||||
var o = createElement(OBJECT);
|
||||
o.setAttribute("type", FLASH_MIME_TYPE);
|
||||
for (var m in attObj) {
|
||||
if (attObj[m] != Object.prototype[m]) { // filter out prototype additions from other potential libraries
|
||||
if (m.toLowerCase() == "styleclass") { // 'class' is an ECMA4 reserved keyword
|
||||
o.setAttribute("class", attObj[m]);
|
||||
}
|
||||
else if (m.toLowerCase() != "classid") { // filter out IE specific attribute
|
||||
o.setAttribute(m, attObj[m]);
|
||||
}
|
||||
}
|
||||
}
|
||||
for (var n in parObj) {
|
||||
if (parObj[n] != Object.prototype[n] && n.toLowerCase() != "movie") { // filter out prototype additions from other potential libraries and IE specific param element
|
||||
createObjParam(o, n, parObj[n]);
|
||||
}
|
||||
}
|
||||
el.parentNode.replaceChild(o, el);
|
||||
r = o;
|
||||
}
|
||||
}
|
||||
return r;
|
||||
}
|
||||
|
||||
function createObjParam(el, pName, pValue) {
|
||||
var p = createElement("param");
|
||||
p.setAttribute("name", pName);
|
||||
p.setAttribute("value", pValue);
|
||||
el.appendChild(p);
|
||||
}
|
||||
|
||||
/* Cross-browser SWF removal
|
||||
- Especially needed to safely and completely remove a SWF in Internet Explorer
|
||||
*/
|
||||
function removeSWF(id) {
|
||||
var obj = getElementById(id);
|
||||
if (obj && obj.nodeName == "OBJECT") {
|
||||
if (ua.ie && ua.win) {
|
||||
obj.style.display = "none";
|
||||
(function(){
|
||||
if (obj.readyState == 4) {
|
||||
removeObjectInIE(id);
|
||||
}
|
||||
else {
|
||||
setTimeout(arguments.callee, 10);
|
||||
}
|
||||
})();
|
||||
}
|
||||
else {
|
||||
obj.parentNode.removeChild(obj);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function removeObjectInIE(id) {
|
||||
var obj = getElementById(id);
|
||||
if (obj) {
|
||||
for (var i in obj) {
|
||||
if (typeof obj[i] == "function") {
|
||||
obj[i] = null;
|
||||
}
|
||||
}
|
||||
obj.parentNode.removeChild(obj);
|
||||
}
|
||||
}
|
||||
|
||||
/* Functions to optimize JavaScript compression
|
||||
*/
|
||||
function getElementById(id) {
|
||||
var el = null;
|
||||
try {
|
||||
el = doc.getElementById(id);
|
||||
}
|
||||
catch (e) {}
|
||||
return el;
|
||||
}
|
||||
|
||||
function createElement(el) {
|
||||
return doc.createElement(el);
|
||||
}
|
||||
|
||||
/* Updated attachEvent function for Internet Explorer
|
||||
- Stores attachEvent information in an Array, so on unload the detachEvent functions can be called to avoid memory leaks
|
||||
*/
|
||||
function addListener(target, eventType, fn) {
|
||||
target.attachEvent(eventType, fn);
|
||||
listenersArr[listenersArr.length] = [target, eventType, fn];
|
||||
}
|
||||
|
||||
/* Flash Player and SWF content version matching
|
||||
*/
|
||||
function hasPlayerVersion(rv) {
|
||||
var pv = ua.pv, v = rv.split(".");
|
||||
v[0] = parseInt(v[0], 10);
|
||||
v[1] = parseInt(v[1], 10) || 0; // supports short notation, e.g. "9" instead of "9.0.0"
|
||||
v[2] = parseInt(v[2], 10) || 0;
|
||||
return (pv[0] > v[0] || (pv[0] == v[0] && pv[1] > v[1]) || (pv[0] == v[0] && pv[1] == v[1] && pv[2] >= v[2])) ? true : false;
|
||||
}
|
||||
|
||||
/* Cross-browser dynamic CSS creation
|
||||
- Based on Bobby van der Sluis' solution: http://www.bobbyvandersluis.com/articles/dynamicCSS.php
|
||||
*/
|
||||
function createCSS(sel, decl, media, newStyle) {
|
||||
if (ua.ie && ua.mac) { return; }
|
||||
var h = doc.getElementsByTagName("head")[0];
|
||||
if (!h) { return; } // to also support badly authored HTML pages that lack a head element
|
||||
var m = (media && typeof media == "string") ? media : "screen";
|
||||
if (newStyle) {
|
||||
dynamicStylesheet = null;
|
||||
dynamicStylesheetMedia = null;
|
||||
}
|
||||
if (!dynamicStylesheet || dynamicStylesheetMedia != m) {
|
||||
// create dynamic stylesheet + get a global reference to it
|
||||
var s = createElement("style");
|
||||
s.setAttribute("type", "text/css");
|
||||
s.setAttribute("media", m);
|
||||
dynamicStylesheet = h.appendChild(s);
|
||||
if (ua.ie && ua.win && typeof doc.styleSheets != UNDEF && doc.styleSheets.length > 0) {
|
||||
dynamicStylesheet = doc.styleSheets[doc.styleSheets.length - 1];
|
||||
}
|
||||
dynamicStylesheetMedia = m;
|
||||
}
|
||||
// add style rule
|
||||
if (ua.ie && ua.win) {
|
||||
if (dynamicStylesheet && typeof dynamicStylesheet.addRule == OBJECT) {
|
||||
dynamicStylesheet.addRule(sel, decl);
|
||||
}
|
||||
}
|
||||
else {
|
||||
if (dynamicStylesheet && typeof doc.createTextNode != UNDEF) {
|
||||
dynamicStylesheet.appendChild(doc.createTextNode(sel + " {" + decl + "}"));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function setVisibility(id, isVisible) {
|
||||
if (!autoHideShow) { return; }
|
||||
var v = isVisible ? "visible" : "hidden";
|
||||
if (isDomLoaded && getElementById(id)) {
|
||||
getElementById(id).style.visibility = v;
|
||||
}
|
||||
else {
|
||||
createCSS("#" + id, "visibility:" + v);
|
||||
}
|
||||
}
|
||||
|
||||
/* Filter to avoid XSS attacks
|
||||
*/
|
||||
function urlEncodeIfNecessary(s) {
|
||||
var regex = /[\\\"<>\.;]/;
|
||||
var hasBadChars = regex.exec(s) != null;
|
||||
return hasBadChars && typeof encodeURIComponent != UNDEF ? encodeURIComponent(s) : s;
|
||||
}
|
||||
|
||||
/* Release memory to avoid memory leaks caused by closures, fix hanging audio/video threads and force open sockets/NetConnections to disconnect (Internet Explorer only)
|
||||
*/
|
||||
var cleanup = function() {
|
||||
if (ua.ie && ua.win) {
|
||||
window.attachEvent("onunload", function() {
|
||||
// remove listeners to avoid memory leaks
|
||||
var ll = listenersArr.length;
|
||||
for (var i = 0; i < ll; i++) {
|
||||
listenersArr[i][0].detachEvent(listenersArr[i][1], listenersArr[i][2]);
|
||||
}
|
||||
// cleanup dynamically embedded objects to fix audio/video threads and force open sockets and NetConnections to disconnect
|
||||
var il = objIdArr.length;
|
||||
for (var j = 0; j < il; j++) {
|
||||
removeSWF(objIdArr[j]);
|
||||
}
|
||||
// cleanup library's main closures to avoid memory leaks
|
||||
for (var k in ua) {
|
||||
ua[k] = null;
|
||||
}
|
||||
ua = null;
|
||||
for (var l in swfobject) {
|
||||
swfobject[l] = null;
|
||||
}
|
||||
swfobject = null;
|
||||
});
|
||||
}
|
||||
}();
|
||||
|
||||
return {
|
||||
/* Public API
|
||||
- Reference: http://code.google.com/p/swfobject/wiki/documentation
|
||||
*/
|
||||
registerObject: function(objectIdStr, swfVersionStr, xiSwfUrlStr, callbackFn) {
|
||||
if (ua.w3 && objectIdStr && swfVersionStr) {
|
||||
var regObj = {};
|
||||
regObj.id = objectIdStr;
|
||||
regObj.swfVersion = swfVersionStr;
|
||||
regObj.expressInstall = xiSwfUrlStr;
|
||||
regObj.callbackFn = callbackFn;
|
||||
regObjArr[regObjArr.length] = regObj;
|
||||
setVisibility(objectIdStr, false);
|
||||
}
|
||||
else if (callbackFn) {
|
||||
callbackFn({success:false, id:objectIdStr});
|
||||
}
|
||||
},
|
||||
|
||||
getObjectById: function(objectIdStr) {
|
||||
if (ua.w3) {
|
||||
return getObjectById(objectIdStr);
|
||||
}
|
||||
},
|
||||
|
||||
embedSWF: function(swfUrlStr, replaceElemIdStr, widthStr, heightStr, swfVersionStr, xiSwfUrlStr, flashvarsObj, parObj, attObj, callbackFn) {
|
||||
var callbackObj = {success:false, id:replaceElemIdStr};
|
||||
if (ua.w3 && !(ua.wk && ua.wk < 312) && swfUrlStr && replaceElemIdStr && widthStr && heightStr && swfVersionStr) {
|
||||
setVisibility(replaceElemIdStr, false);
|
||||
addDomLoadEvent(function() {
|
||||
widthStr += ""; // auto-convert to string
|
||||
heightStr += "";
|
||||
var att = {};
|
||||
if (attObj && typeof attObj === OBJECT) {
|
||||
for (var i in attObj) { // copy object to avoid the use of references, because web authors often reuse attObj for multiple SWFs
|
||||
att[i] = attObj[i];
|
||||
}
|
||||
}
|
||||
att.data = swfUrlStr;
|
||||
att.width = widthStr;
|
||||
att.height = heightStr;
|
||||
var par = {};
|
||||
if (parObj && typeof parObj === OBJECT) {
|
||||
for (var j in parObj) { // copy object to avoid the use of references, because web authors often reuse parObj for multiple SWFs
|
||||
par[j] = parObj[j];
|
||||
}
|
||||
}
|
||||
if (flashvarsObj && typeof flashvarsObj === OBJECT) {
|
||||
for (var k in flashvarsObj) { // copy object to avoid the use of references, because web authors often reuse flashvarsObj for multiple SWFs
|
||||
if (typeof par.flashvars != UNDEF) {
|
||||
par.flashvars += "&" + k + "=" + flashvarsObj[k];
|
||||
}
|
||||
else {
|
||||
par.flashvars = k + "=" + flashvarsObj[k];
|
||||
}
|
||||
}
|
||||
}
|
||||
if (hasPlayerVersion(swfVersionStr)) { // create SWF
|
||||
var obj = createSWF(att, par, replaceElemIdStr);
|
||||
if (att.id == replaceElemIdStr) {
|
||||
setVisibility(replaceElemIdStr, true);
|
||||
}
|
||||
callbackObj.success = true;
|
||||
callbackObj.ref = obj;
|
||||
}
|
||||
else if (xiSwfUrlStr && canExpressInstall()) { // show Adobe Express Install
|
||||
att.data = xiSwfUrlStr;
|
||||
showExpressInstall(att, par, replaceElemIdStr, callbackFn);
|
||||
return;
|
||||
}
|
||||
else { // show alternative content
|
||||
setVisibility(replaceElemIdStr, true);
|
||||
}
|
||||
if (callbackFn) { callbackFn(callbackObj); }
|
||||
});
|
||||
}
|
||||
else if (callbackFn) { callbackFn(callbackObj); }
|
||||
},
|
||||
|
||||
switchOffAutoHideShow: function() {
|
||||
autoHideShow = false;
|
||||
},
|
||||
|
||||
ua: ua,
|
||||
|
||||
getFlashPlayerVersion: function() {
|
||||
return { major:ua.pv[0], minor:ua.pv[1], release:ua.pv[2] };
|
||||
},
|
||||
|
||||
hasFlashPlayerVersion: hasPlayerVersion,
|
||||
|
||||
createSWF: function(attObj, parObj, replaceElemIdStr) {
|
||||
if (ua.w3) {
|
||||
return createSWF(attObj, parObj, replaceElemIdStr);
|
||||
}
|
||||
else {
|
||||
return undefined;
|
||||
}
|
||||
},
|
||||
|
||||
showExpressInstall: function(att, par, replaceElemIdStr, callbackFn) {
|
||||
if (ua.w3 && canExpressInstall()) {
|
||||
showExpressInstall(att, par, replaceElemIdStr, callbackFn);
|
||||
}
|
||||
},
|
||||
|
||||
removeSWF: function(objElemIdStr) {
|
||||
if (ua.w3) {
|
||||
removeSWF(objElemIdStr);
|
||||
}
|
||||
},
|
||||
|
||||
createCSS: function(selStr, declStr, mediaStr, newStyleBoolean) {
|
||||
if (ua.w3) {
|
||||
createCSS(selStr, declStr, mediaStr, newStyleBoolean);
|
||||
}
|
||||
},
|
||||
|
||||
addDomLoadEvent: addDomLoadEvent,
|
||||
|
||||
addLoadEvent: addLoadEvent,
|
||||
|
||||
getQueryParamValue: function(param) {
|
||||
var q = doc.location.search || doc.location.hash;
|
||||
if (q) {
|
||||
if (/\?/.test(q)) { q = q.split("?")[1]; } // strip question mark
|
||||
if (param == null) {
|
||||
return urlEncodeIfNecessary(q);
|
||||
}
|
||||
var pairs = q.split("&");
|
||||
for (var i = 0; i < pairs.length; i++) {
|
||||
if (pairs[i].substring(0, pairs[i].indexOf("=")) == param) {
|
||||
return urlEncodeIfNecessary(pairs[i].substring((pairs[i].indexOf("=") + 1)));
|
||||
}
|
||||
}
|
||||
}
|
||||
return "";
|
||||
},
|
||||
|
||||
// For internal usage only
|
||||
expressInstallCallback: function() {
|
||||
if (isExpressInstallActive) {
|
||||
var obj = getElementById(EXPRESS_INSTALL_ID);
|
||||
if (obj && storedAltContent) {
|
||||
obj.parentNode.replaceChild(storedAltContent, obj);
|
||||
if (storedAltContentId) {
|
||||
setVisibility(storedAltContentId, true);
|
||||
if (ua.ie && ua.win) { storedAltContent.style.display = "block"; }
|
||||
}
|
||||
if (storedCallbackFn) { storedCallbackFn(storedCallbackObj); }
|
||||
}
|
||||
isExpressInstallActive = false;
|
||||
}
|
||||
}
|
||||
};
|
||||
}();
|
@@ -1,42 +0,0 @@
|
||||
<!--
|
||||
< ?xml version="1.0" encoding="UTF-8"?>
|
||||
<rss version="2.0" xmlns:media="http://search.yahoo.com/mrss/" xmlns:atom="http://www.w3.org/2005/Atom">
|
||||
<channel>
|
||||
<item>
|
||||
<title>ssid=423 rid=3492</title>
|
||||
<media:content url="http://192.168.1.106/phraseanet_jy_v2_2/zzz.php?sbid=163&rid=3492" width="640" height="426"/>
|
||||
<media:thumbnail url="http://192.168.1.106/phraseanet_jy_v2_2/web/db_JY_2_2_canal/SUBDEFS/3492_thumbnail.jpg" width="128" height="85"/>
|
||||
</item>
|
||||
<item>
|
||||
<title>ssid=423 rid=3493</title>
|
||||
<media:content url="http://192.168.1.106/phraseanet_jy_v2_2/zzz.php?sbid=163&rid=3493" width="640" height="435"/>
|
||||
<media:thumbnail url="http://192.168.1.106/phraseanet_jy_v2_2/web/db_JY_2_2_canal/SUBDEFS/3493_thumbnail.jpg" width="128" height="87"/>
|
||||
</item>
|
||||
</channel>
|
||||
</rss>
|
||||
-->
|
||||
<html>
|
||||
<body style="background-color:#ffFF00">
|
||||
|
||||
hello
|
||||
|
||||
<embed src="ImageScroll.swf"
|
||||
id="ImageScroll"
|
||||
quality="high"
|
||||
bgcolor="#ff0000"
|
||||
wmode="transparent"
|
||||
name="ImageScroll"
|
||||
allowscriptaccess="sameDomain"
|
||||
pluginspage="http://www.adobe.com/go/getflashplayer"
|
||||
type="application/x-shockwave-flash"
|
||||
width="600"
|
||||
height="300"
|
||||
align="middle"
|
||||
|
||||
flashVars='space=20&speed=1&media=content&zoom=0.5&rss=<?=urlencode('http://192.168.1.106/phraseanet_jy_v2_2/z_forscroll.php?ssid=423')?>'
|
||||
|
||||
>
|
||||
</embed>
|
||||
|
||||
</body>
|
||||
</html>
|
Binary file not shown.
@@ -1,6 +0,0 @@
|
||||
/* This CSS stylesheet defines styles used by required elements in a flex application page that supports browser history */
|
||||
|
||||
#ie_historyFrame { width: 0px; height: 0px; display:none }
|
||||
#firefox_anchorDiv { width: 0px; height: 0px; display:none }
|
||||
#safari_formDiv { width: 0px; height: 0px; display:none }
|
||||
#safari_rememberDiv { width: 0px; height: 0px; display:none }
|
@@ -1,710 +0,0 @@
|
||||
BrowserHistoryUtils = {
|
||||
addEvent: function(elm, evType, fn, useCapture) {
|
||||
useCapture = useCapture || false;
|
||||
if (elm.addEventListener) {
|
||||
elm.addEventListener(evType, fn, useCapture);
|
||||
return true;
|
||||
}
|
||||
else if (elm.attachEvent) {
|
||||
var r = elm.attachEvent('on' + evType, fn);
|
||||
return r;
|
||||
}
|
||||
else {
|
||||
elm['on' + evType] = fn;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
BrowserHistory = (function() {
|
||||
// type of browser
|
||||
var browser = {
|
||||
ie: false,
|
||||
ie8: false,
|
||||
firefox: false,
|
||||
safari: false,
|
||||
opera: false,
|
||||
version: -1
|
||||
};
|
||||
|
||||
// if setDefaultURL has been called, our first clue
|
||||
// that the SWF is ready and listening
|
||||
//var swfReady = false;
|
||||
|
||||
// the URL we'll send to the SWF once it is ready
|
||||
//var pendingURL = '';
|
||||
|
||||
// Default app state URL to use when no fragment ID present
|
||||
var defaultHash = '';
|
||||
|
||||
// Last-known app state URL
|
||||
var currentHref = document.location.href;
|
||||
|
||||
// Initial URL (used only by IE)
|
||||
var initialHref = document.location.href;
|
||||
|
||||
// Initial URL (used only by IE)
|
||||
var initialHash = document.location.hash;
|
||||
|
||||
// History frame source URL prefix (used only by IE)
|
||||
var historyFrameSourcePrefix = 'history/historyFrame.html?';
|
||||
|
||||
// History maintenance (used only by Safari)
|
||||
var currentHistoryLength = -1;
|
||||
|
||||
var historyHash = [];
|
||||
|
||||
var initialState = createState(initialHref, initialHref + '#' + initialHash, initialHash);
|
||||
|
||||
var backStack = [];
|
||||
var forwardStack = [];
|
||||
|
||||
var currentObjectId = null;
|
||||
|
||||
//UserAgent detection
|
||||
var useragent = navigator.userAgent.toLowerCase();
|
||||
|
||||
if (useragent.indexOf("opera") != -1) {
|
||||
browser.opera = true;
|
||||
} else if (useragent.indexOf("msie") != -1) {
|
||||
browser.ie = true;
|
||||
browser.version = parseFloat(useragent.substring(useragent.indexOf('msie') + 4));
|
||||
if (browser.version == 8)
|
||||
{
|
||||
browser.ie = false;
|
||||
browser.ie8 = true;
|
||||
}
|
||||
} else if (useragent.indexOf("safari") != -1) {
|
||||
browser.safari = true;
|
||||
browser.version = parseFloat(useragent.substring(useragent.indexOf('safari') + 7));
|
||||
} else if (useragent.indexOf("gecko") != -1) {
|
||||
browser.firefox = true;
|
||||
}
|
||||
|
||||
if (browser.ie == true && browser.version == 7) {
|
||||
window["_ie_firstload"] = false;
|
||||
}
|
||||
|
||||
function hashChangeHandler()
|
||||
{
|
||||
currentHref = document.location.href;
|
||||
var flexAppUrl = getHash();
|
||||
//ADR: to fix multiple
|
||||
if (typeof BrowserHistory_multiple != "undefined" && BrowserHistory_multiple == true) {
|
||||
var pl = getPlayers();
|
||||
for (var i = 0; i < pl.length; i++) {
|
||||
pl[i].browserURLChange(flexAppUrl);
|
||||
}
|
||||
} else {
|
||||
getPlayer().browserURLChange(flexAppUrl);
|
||||
}
|
||||
}
|
||||
|
||||
// Accessor functions for obtaining specific elements of the page.
|
||||
function getHistoryFrame()
|
||||
{
|
||||
return document.getElementById('ie_historyFrame');
|
||||
}
|
||||
|
||||
function getAnchorElement()
|
||||
{
|
||||
return document.getElementById('firefox_anchorDiv');
|
||||
}
|
||||
|
||||
function getFormElement()
|
||||
{
|
||||
return document.getElementById('safari_formDiv');
|
||||
}
|
||||
|
||||
function getRememberElement()
|
||||
{
|
||||
return document.getElementById("safari_remember_field");
|
||||
}
|
||||
|
||||
// Get the Flash player object for performing ExternalInterface callbacks.
|
||||
// Updated for changes to SWFObject2.
|
||||
function getPlayer(id) {
|
||||
var i;
|
||||
|
||||
if (id && document.getElementById(id)) {
|
||||
var r = document.getElementById(id);
|
||||
if (typeof r.SetVariable != "undefined") {
|
||||
return r;
|
||||
}
|
||||
else {
|
||||
var o = r.getElementsByTagName("object");
|
||||
var e = r.getElementsByTagName("embed");
|
||||
for (i = 0; i < o.length; i++) {
|
||||
if (typeof o[i].browserURLChange != "undefined")
|
||||
return o[i];
|
||||
}
|
||||
for (i = 0; i < e.length; i++) {
|
||||
if (typeof e[i].browserURLChange != "undefined")
|
||||
return e[i];
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
var o = document.getElementsByTagName("object");
|
||||
var e = document.getElementsByTagName("embed");
|
||||
for (i = 0; i < e.length; i++) {
|
||||
if (typeof e[i].browserURLChange != "undefined")
|
||||
{
|
||||
return e[i];
|
||||
}
|
||||
}
|
||||
for (i = 0; i < o.length; i++) {
|
||||
if (typeof o[i].browserURLChange != "undefined")
|
||||
{
|
||||
return o[i];
|
||||
}
|
||||
}
|
||||
}
|
||||
return undefined;
|
||||
}
|
||||
|
||||
function getPlayers() {
|
||||
var i;
|
||||
var players = [];
|
||||
if (players.length == 0) {
|
||||
var tmp = document.getElementsByTagName('object');
|
||||
for (i = 0; i < tmp.length; i++)
|
||||
{
|
||||
if (typeof tmp[i].browserURLChange != "undefined")
|
||||
players.push(tmp[i]);
|
||||
}
|
||||
}
|
||||
if (players.length == 0 || players[0].object == null) {
|
||||
var tmp = document.getElementsByTagName('embed');
|
||||
for (i = 0; i < tmp.length; i++)
|
||||
{
|
||||
if (typeof tmp[i].browserURLChange != "undefined")
|
||||
players.push(tmp[i]);
|
||||
}
|
||||
}
|
||||
return players;
|
||||
}
|
||||
|
||||
function getIframeHash() {
|
||||
var doc = getHistoryFrame().contentWindow.document;
|
||||
var hash = String(doc.location.search);
|
||||
if (hash.length == 1 && hash.charAt(0) == "?") {
|
||||
hash = "";
|
||||
}
|
||||
else if (hash.length >= 2 && hash.charAt(0) == "?") {
|
||||
hash = hash.substring(1);
|
||||
}
|
||||
return hash;
|
||||
}
|
||||
|
||||
/* Get the current location hash excluding the '#' symbol. */
|
||||
function getHash() {
|
||||
// It would be nice if we could use document.location.hash here,
|
||||
// but it's faulty sometimes.
|
||||
var idx = document.location.href.indexOf('#');
|
||||
return (idx >= 0) ? document.location.href.substr(idx+1) : '';
|
||||
}
|
||||
|
||||
/* Get the current location hash excluding the '#' symbol. */
|
||||
function setHash(hash) {
|
||||
// It would be nice if we could use document.location.hash here,
|
||||
// but it's faulty sometimes.
|
||||
if (hash == '') hash = '#'
|
||||
document.location.hash = hash;
|
||||
}
|
||||
|
||||
function createState(baseUrl, newUrl, flexAppUrl) {
|
||||
return { 'baseUrl': baseUrl, 'newUrl': newUrl, 'flexAppUrl': flexAppUrl, 'title': null };
|
||||
}
|
||||
|
||||
/* Add a history entry to the browser.
|
||||
* baseUrl: the portion of the location prior to the '#'
|
||||
* newUrl: the entire new URL, including '#' and following fragment
|
||||
* flexAppUrl: the portion of the location following the '#' only
|
||||
*/
|
||||
function addHistoryEntry(baseUrl, newUrl, flexAppUrl) {
|
||||
|
||||
//delete all the history entries
|
||||
forwardStack = [];
|
||||
|
||||
if (browser.ie) {
|
||||
//Check to see if we are being asked to do a navigate for the first
|
||||
//history entry, and if so ignore, because it's coming from the creation
|
||||
//of the history iframe
|
||||
if (flexAppUrl == defaultHash && document.location.href == initialHref && window['_ie_firstload']) {
|
||||
currentHref = initialHref;
|
||||
return;
|
||||
}
|
||||
if ((!flexAppUrl || flexAppUrl == defaultHash) && window['_ie_firstload']) {
|
||||
newUrl = baseUrl + '#' + defaultHash;
|
||||
flexAppUrl = defaultHash;
|
||||
} else {
|
||||
// for IE, tell the history frame to go somewhere without a '#'
|
||||
// in order to get this entry into the browser history.
|
||||
getHistoryFrame().src = historyFrameSourcePrefix + flexAppUrl;
|
||||
}
|
||||
setHash(flexAppUrl);
|
||||
} else {
|
||||
|
||||
//ADR
|
||||
if (backStack.length == 0 && initialState.flexAppUrl == flexAppUrl) {
|
||||
initialState = createState(baseUrl, newUrl, flexAppUrl);
|
||||
} else if(backStack.length > 0 && backStack[backStack.length - 1].flexAppUrl == flexAppUrl) {
|
||||
backStack[backStack.length - 1] = createState(baseUrl, newUrl, flexAppUrl);
|
||||
}
|
||||
|
||||
if (browser.safari) {
|
||||
// for Safari, submit a form whose action points to the desired URL
|
||||
if (browser.version <= 419.3) {
|
||||
var file = window.location.pathname.toString();
|
||||
file = file.substring(file.lastIndexOf("/")+1);
|
||||
getFormElement().innerHTML = '<form name="historyForm" action="'+file+'#' + flexAppUrl + '" method="GET"></form>';
|
||||
//get the current elements and add them to the form
|
||||
var qs = window.location.search.substring(1);
|
||||
var qs_arr = qs.split("&");
|
||||
for (var i = 0; i < qs_arr.length; i++) {
|
||||
var tmp = qs_arr[i].split("=");
|
||||
var elem = document.createElement("input");
|
||||
elem.type = "hidden";
|
||||
elem.name = tmp[0];
|
||||
elem.value = tmp[1];
|
||||
document.forms.historyForm.appendChild(elem);
|
||||
}
|
||||
document.forms.historyForm.submit();
|
||||
} else {
|
||||
top.location.hash = flexAppUrl;
|
||||
}
|
||||
// We also have to maintain the history by hand for Safari
|
||||
historyHash[history.length] = flexAppUrl;
|
||||
_storeStates();
|
||||
} else {
|
||||
// Otherwise, write an anchor into the page and tell the browser to go there
|
||||
addAnchor(flexAppUrl);
|
||||
setHash(flexAppUrl);
|
||||
|
||||
// For IE8 we must restore full focus/activation to our invoking player instance.
|
||||
if (browser.ie8)
|
||||
getPlayer().focus();
|
||||
}
|
||||
}
|
||||
backStack.push(createState(baseUrl, newUrl, flexAppUrl));
|
||||
}
|
||||
|
||||
function _storeStates() {
|
||||
if (browser.safari) {
|
||||
getRememberElement().value = historyHash.join(",");
|
||||
}
|
||||
}
|
||||
|
||||
function handleBackButton() {
|
||||
//The "current" page is always at the top of the history stack.
|
||||
var current = backStack.pop();
|
||||
if (!current) { return; }
|
||||
var last = backStack[backStack.length - 1];
|
||||
if (!last && backStack.length == 0){
|
||||
last = initialState;
|
||||
}
|
||||
forwardStack.push(current);
|
||||
}
|
||||
|
||||
function handleForwardButton() {
|
||||
//summary: private method. Do not call this directly.
|
||||
|
||||
var last = forwardStack.pop();
|
||||
if (!last) { return; }
|
||||
backStack.push(last);
|
||||
}
|
||||
|
||||
function handleArbitraryUrl() {
|
||||
//delete all the history entries
|
||||
forwardStack = [];
|
||||
}
|
||||
|
||||
/* Called periodically to poll to see if we need to detect navigation that has occurred */
|
||||
function checkForUrlChange() {
|
||||
|
||||
if (browser.ie) {
|
||||
if (currentHref != document.location.href && currentHref + '#' != document.location.href) {
|
||||
//This occurs when the user has navigated to a specific URL
|
||||
//within the app, and didn't use browser back/forward
|
||||
//IE seems to have a bug where it stops updating the URL it
|
||||
//shows the end-user at this point, but programatically it
|
||||
//appears to be correct. Do a full app reload to get around
|
||||
//this issue.
|
||||
if (browser.version < 7) {
|
||||
currentHref = document.location.href;
|
||||
document.location.reload();
|
||||
} else {
|
||||
if (getHash() != getIframeHash()) {
|
||||
// this.iframe.src = this.blankURL + hash;
|
||||
var sourceToSet = historyFrameSourcePrefix + getHash();
|
||||
getHistoryFrame().src = sourceToSet;
|
||||
currentHref = document.location.href;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (browser.safari) {
|
||||
// For Safari, we have to check to see if history.length changed.
|
||||
if (currentHistoryLength >= 0 && history.length != currentHistoryLength) {
|
||||
//alert("did change: " + history.length + ", " + historyHash.length + "|" + historyHash[history.length] + "|>" + historyHash.join("|"));
|
||||
var flexAppUrl = getHash();
|
||||
if (browser.version < 528.16 /* Anything earlier than Safari 4.0 */)
|
||||
{
|
||||
// If it did change and we're running Safari 3.x or earlier,
|
||||
// then we have to look the old state up in our hand-maintained
|
||||
// array since document.location.hash won't have changed,
|
||||
// then call back into BrowserManager.
|
||||
currentHistoryLength = history.length;
|
||||
flexAppUrl = historyHash[currentHistoryLength];
|
||||
}
|
||||
|
||||
//ADR: to fix multiple
|
||||
if (typeof BrowserHistory_multiple != "undefined" && BrowserHistory_multiple == true) {
|
||||
var pl = getPlayers();
|
||||
for (var i = 0; i < pl.length; i++) {
|
||||
pl[i].browserURLChange(flexAppUrl);
|
||||
}
|
||||
} else {
|
||||
getPlayer().browserURLChange(flexAppUrl);
|
||||
}
|
||||
_storeStates();
|
||||
}
|
||||
}
|
||||
if (browser.firefox) {
|
||||
if (currentHref != document.location.href) {
|
||||
var bsl = backStack.length;
|
||||
|
||||
var urlActions = {
|
||||
back: false,
|
||||
forward: false,
|
||||
set: false
|
||||
}
|
||||
|
||||
if ((window.location.hash == initialHash || window.location.href == initialHref) && (bsl == 1)) {
|
||||
urlActions.back = true;
|
||||
// FIXME: could this ever be a forward button?
|
||||
// we can't clear it because we still need to check for forwards. Ugg.
|
||||
// clearInterval(this.locationTimer);
|
||||
handleBackButton();
|
||||
}
|
||||
|
||||
// first check to see if we could have gone forward. We always halt on
|
||||
// a no-hash item.
|
||||
if (forwardStack.length > 0) {
|
||||
if (forwardStack[forwardStack.length-1].flexAppUrl == getHash()) {
|
||||
urlActions.forward = true;
|
||||
handleForwardButton();
|
||||
}
|
||||
}
|
||||
|
||||
// ok, that didn't work, try someplace back in the history stack
|
||||
if ((bsl >= 2) && (backStack[bsl - 2])) {
|
||||
if (backStack[bsl - 2].flexAppUrl == getHash()) {
|
||||
urlActions.back = true;
|
||||
handleBackButton();
|
||||
}
|
||||
}
|
||||
|
||||
if (!urlActions.back && !urlActions.forward) {
|
||||
var foundInStacks = {
|
||||
back: -1,
|
||||
forward: -1
|
||||
}
|
||||
|
||||
for (var i = 0; i < backStack.length; i++) {
|
||||
if (backStack[i].flexAppUrl == getHash() && i != (bsl - 2)) {
|
||||
arbitraryUrl = true;
|
||||
foundInStacks.back = i;
|
||||
}
|
||||
}
|
||||
for (var i = 0; i < forwardStack.length; i++) {
|
||||
if (forwardStack[i].flexAppUrl == getHash() && i != (bsl - 2)) {
|
||||
arbitraryUrl = true;
|
||||
foundInStacks.forward = i;
|
||||
}
|
||||
}
|
||||
handleArbitraryUrl();
|
||||
}
|
||||
|
||||
// Firefox changed; do a callback into BrowserManager to tell it.
|
||||
currentHref = document.location.href;
|
||||
var flexAppUrl = getHash();
|
||||
//ADR: to fix multiple
|
||||
if (typeof BrowserHistory_multiple != "undefined" && BrowserHistory_multiple == true) {
|
||||
var pl = getPlayers();
|
||||
for (var i = 0; i < pl.length; i++) {
|
||||
pl[i].browserURLChange(flexAppUrl);
|
||||
}
|
||||
} else {
|
||||
getPlayer().browserURLChange(flexAppUrl);
|
||||
}
|
||||
}
|
||||
}
|
||||
//setTimeout(checkForUrlChange, 50);
|
||||
}
|
||||
|
||||
/* Write an anchor into the page to legitimize it as a URL for Firefox et al. */
|
||||
function addAnchor(flexAppUrl)
|
||||
{
|
||||
if (document.getElementsByName(flexAppUrl).length == 0) {
|
||||
getAnchorElement().innerHTML += "<a name='" + flexAppUrl + "'>" + flexAppUrl + "</a>";
|
||||
}
|
||||
}
|
||||
|
||||
var _initialize = function () {
|
||||
if (browser.ie)
|
||||
{
|
||||
var scripts = document.getElementsByTagName('script');
|
||||
for (var i = 0, s; s = scripts[i]; i++) {
|
||||
if (s.src.indexOf("history.js") > -1) {
|
||||
var iframe_location = (new String(s.src)).replace("history.js", "historyFrame.html");
|
||||
}
|
||||
}
|
||||
historyFrameSourcePrefix = iframe_location + "?";
|
||||
var src = historyFrameSourcePrefix;
|
||||
|
||||
var iframe = document.createElement("iframe");
|
||||
iframe.id = 'ie_historyFrame';
|
||||
iframe.name = 'ie_historyFrame';
|
||||
iframe.src = 'javascript:false;';
|
||||
|
||||
try {
|
||||
document.body.appendChild(iframe);
|
||||
} catch(e) {
|
||||
setTimeout(function() {
|
||||
document.body.appendChild(iframe);
|
||||
}, 0);
|
||||
}
|
||||
}
|
||||
|
||||
if (browser.safari)
|
||||
{
|
||||
var rememberDiv = document.createElement("div");
|
||||
rememberDiv.id = 'safari_rememberDiv';
|
||||
document.body.appendChild(rememberDiv);
|
||||
rememberDiv.innerHTML = '<input type="text" id="safari_remember_field" style="width: 500px;">';
|
||||
|
||||
var formDiv = document.createElement("div");
|
||||
formDiv.id = 'safari_formDiv';
|
||||
document.body.appendChild(formDiv);
|
||||
|
||||
var reloader_content = document.createElement('div');
|
||||
reloader_content.id = 'safarireloader';
|
||||
var scripts = document.getElementsByTagName('script');
|
||||
for (var i = 0, s; s = scripts[i]; i++) {
|
||||
if (s.src.indexOf("history.js") > -1) {
|
||||
html = (new String(s.src)).replace(".js", ".html");
|
||||
}
|
||||
}
|
||||
reloader_content.innerHTML = '<iframe id="safarireloader-iframe" src="about:blank" frameborder="no" scrolling="no"></iframe>';
|
||||
document.body.appendChild(reloader_content);
|
||||
reloader_content.style.position = 'absolute';
|
||||
reloader_content.style.left = reloader_content.style.top = '-9999px';
|
||||
iframe = reloader_content.getElementsByTagName('iframe')[0];
|
||||
|
||||
if (document.getElementById("safari_remember_field").value != "" ) {
|
||||
historyHash = document.getElementById("safari_remember_field").value.split(",");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if (browser.firefox || browser.ie8)
|
||||
{
|
||||
var anchorDiv = document.createElement("div");
|
||||
anchorDiv.id = 'firefox_anchorDiv';
|
||||
document.body.appendChild(anchorDiv);
|
||||
}
|
||||
|
||||
if (browser.ie8)
|
||||
document.body.onhashchange = hashChangeHandler;
|
||||
//setTimeout(checkForUrlChange, 50);
|
||||
}
|
||||
|
||||
return {
|
||||
historyHash: historyHash,
|
||||
backStack: function() { return backStack; },
|
||||
forwardStack: function() { return forwardStack },
|
||||
getPlayer: getPlayer,
|
||||
initialize: function(src) {
|
||||
_initialize(src);
|
||||
},
|
||||
setURL: function(url) {
|
||||
document.location.href = url;
|
||||
},
|
||||
getURL: function() {
|
||||
return document.location.href;
|
||||
},
|
||||
getTitle: function() {
|
||||
return document.title;
|
||||
},
|
||||
setTitle: function(title) {
|
||||
try {
|
||||
backStack[backStack.length - 1].title = title;
|
||||
} catch(e) { }
|
||||
//if on safari, set the title to be the empty string.
|
||||
if (browser.safari) {
|
||||
if (title == "") {
|
||||
try {
|
||||
var tmp = window.location.href.toString();
|
||||
title = tmp.substring((tmp.lastIndexOf("/")+1), tmp.lastIndexOf("#"));
|
||||
} catch(e) {
|
||||
title = "";
|
||||
}
|
||||
}
|
||||
}
|
||||
document.title = title;
|
||||
},
|
||||
setDefaultURL: function(def)
|
||||
{
|
||||
defaultHash = def;
|
||||
def = getHash();
|
||||
//trailing ? is important else an extra frame gets added to the history
|
||||
//when navigating back to the first page. Alternatively could check
|
||||
//in history frame navigation to compare # and ?.
|
||||
if (browser.ie)
|
||||
{
|
||||
window['_ie_firstload'] = true;
|
||||
var sourceToSet = historyFrameSourcePrefix + def;
|
||||
var func = function() {
|
||||
getHistoryFrame().src = sourceToSet;
|
||||
window.location.replace("#" + def);
|
||||
setInterval(checkForUrlChange, 50);
|
||||
}
|
||||
try {
|
||||
func();
|
||||
} catch(e) {
|
||||
window.setTimeout(function() { func(); }, 0);
|
||||
}
|
||||
}
|
||||
|
||||
if (browser.safari)
|
||||
{
|
||||
currentHistoryLength = history.length;
|
||||
if (historyHash.length == 0) {
|
||||
historyHash[currentHistoryLength] = def;
|
||||
var newloc = "#" + def;
|
||||
window.location.replace(newloc);
|
||||
} else {
|
||||
//alert(historyHash[historyHash.length-1]);
|
||||
}
|
||||
//setHash(def);
|
||||
setInterval(checkForUrlChange, 50);
|
||||
}
|
||||
|
||||
|
||||
if (browser.firefox || browser.opera)
|
||||
{
|
||||
var reg = new RegExp("#" + def + "$");
|
||||
if (window.location.toString().match(reg)) {
|
||||
} else {
|
||||
var newloc ="#" + def;
|
||||
window.location.replace(newloc);
|
||||
}
|
||||
setInterval(checkForUrlChange, 50);
|
||||
//setHash(def);
|
||||
}
|
||||
|
||||
},
|
||||
|
||||
/* Set the current browser URL; called from inside BrowserManager to propagate
|
||||
* the application state out to the container.
|
||||
*/
|
||||
setBrowserURL: function(flexAppUrl, objectId) {
|
||||
if (browser.ie && typeof objectId != "undefined") {
|
||||
currentObjectId = objectId;
|
||||
}
|
||||
//fromIframe = fromIframe || false;
|
||||
//fromFlex = fromFlex || false;
|
||||
//alert("setBrowserURL: " + flexAppUrl);
|
||||
//flexAppUrl = (flexAppUrl == "") ? defaultHash : flexAppUrl ;
|
||||
|
||||
var pos = document.location.href.indexOf('#');
|
||||
var baseUrl = pos != -1 ? document.location.href.substr(0, pos) : document.location.href;
|
||||
var newUrl = baseUrl + '#' + flexAppUrl;
|
||||
|
||||
if (document.location.href != newUrl && document.location.href + '#' != newUrl) {
|
||||
currentHref = newUrl;
|
||||
addHistoryEntry(baseUrl, newUrl, flexAppUrl);
|
||||
currentHistoryLength = history.length;
|
||||
}
|
||||
},
|
||||
|
||||
browserURLChange: function(flexAppUrl) {
|
||||
var objectId = null;
|
||||
if (browser.ie && currentObjectId != null) {
|
||||
objectId = currentObjectId;
|
||||
}
|
||||
pendingURL = '';
|
||||
|
||||
if (typeof BrowserHistory_multiple != "undefined" && BrowserHistory_multiple == true) {
|
||||
var pl = getPlayers();
|
||||
for (var i = 0; i < pl.length; i++) {
|
||||
try {
|
||||
pl[i].browserURLChange(flexAppUrl);
|
||||
} catch(e) { }
|
||||
}
|
||||
} else {
|
||||
try {
|
||||
getPlayer(objectId).browserURLChange(flexAppUrl);
|
||||
} catch(e) { }
|
||||
}
|
||||
|
||||
currentObjectId = null;
|
||||
},
|
||||
getUserAgent: function() {
|
||||
return navigator.userAgent;
|
||||
},
|
||||
getPlatform: function() {
|
||||
return navigator.platform;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
})();
|
||||
|
||||
// Initialization
|
||||
|
||||
// Automated unit testing and other diagnostics
|
||||
|
||||
function setURL(url)
|
||||
{
|
||||
document.location.href = url;
|
||||
}
|
||||
|
||||
function backButton()
|
||||
{
|
||||
history.back();
|
||||
}
|
||||
|
||||
function forwardButton()
|
||||
{
|
||||
history.forward();
|
||||
}
|
||||
|
||||
function goForwardOrBackInHistory(step)
|
||||
{
|
||||
history.go(step);
|
||||
}
|
||||
|
||||
//BrowserHistoryUtils.addEvent(window, "load", function() { BrowserHistory.initialize(); });
|
||||
(function(i) {
|
||||
var u =navigator.userAgent;var e=/*@cc_on!@*/false;
|
||||
var st = setTimeout;
|
||||
if(/webkit/i.test(u)){
|
||||
st(function(){
|
||||
var dr=document.readyState;
|
||||
if(dr=="loaded"||dr=="complete"){i()}
|
||||
else{st(arguments.callee,10);}},10);
|
||||
} else if((/mozilla/i.test(u)&&!/(compati)/.test(u)) || (/opera/i.test(u))){
|
||||
document.addEventListener("DOMContentLoaded",i,false);
|
||||
} else if(e){
|
||||
(function(){
|
||||
var t=document.createElement('doc:rdy');
|
||||
try{t.doScroll('left');
|
||||
i();t=null;
|
||||
}catch(e){st(arguments.callee,0);}})();
|
||||
} else{
|
||||
window.onload=i;
|
||||
}
|
||||
})( function() {BrowserHistory.initialize();} );
|
@@ -1,29 +0,0 @@
|
||||
<html>
|
||||
<head>
|
||||
<META HTTP-EQUIV="Pragma" CONTENT="no-cache">
|
||||
<META HTTP-EQUIV="Expires" CONTENT="-1">
|
||||
</head>
|
||||
<body>
|
||||
<script>
|
||||
function processUrl()
|
||||
{
|
||||
|
||||
var pos = url.indexOf("?");
|
||||
url = pos != -1 ? url.substr(pos + 1) : "";
|
||||
if (!parent._ie_firstload) {
|
||||
parent.BrowserHistory.setBrowserURL(url);
|
||||
try {
|
||||
parent.BrowserHistory.browserURLChange(url);
|
||||
} catch(e) { }
|
||||
} else {
|
||||
parent._ie_firstload = false;
|
||||
}
|
||||
}
|
||||
|
||||
var url = document.location.href;
|
||||
processUrl();
|
||||
document.write(encodeURIComponent(url));
|
||||
</script>
|
||||
Hidden frame for Browser History support.
|
||||
</body>
|
||||
</html>
|
@@ -1,105 +0,0 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<!-- saved from url=(0014)about:internet -->
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
|
||||
<!--
|
||||
Smart developers always View Source.
|
||||
|
||||
This application was built using Adobe Flex, an open source framework
|
||||
for building rich Internet applications that get delivered via the
|
||||
Flash Player or to desktops via Adobe AIR.
|
||||
|
||||
Learn more about Flex at http://flex.org
|
||||
// -->
|
||||
<head>
|
||||
<title>${title}</title>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
<!-- Include CSS to eliminate any default margins/padding and set the height of the html element and
|
||||
the body element to 100%, because Firefox, or any Gecko based browser, interprets percentage as
|
||||
the percentage of the height of its parent container, which has to be set explicitly. Initially,
|
||||
don't display flashContent div so it won't show if JavaScript disabled.
|
||||
-->
|
||||
<style type="text/css" media="screen">
|
||||
html, body { height:100%; }
|
||||
body { margin:0; padding:0; overflow:auto; text-align:center;
|
||||
background-color: ${bgcolor}; }
|
||||
#flashContent { display:none; }
|
||||
</style>
|
||||
|
||||
<!-- Enable Browser History by replacing useBrowserHistory tokens with two hyphens -->
|
||||
<!-- BEGIN Browser History required section ${useBrowserHistory}>
|
||||
<link rel="stylesheet" type="text/css" href="history/history.css" />
|
||||
<script type="text/javascript" src="history/history.js"></script>
|
||||
<!${useBrowserHistory} END Browser History required section -->
|
||||
|
||||
<script type="text/javascript" src="swfobject.js"></script>
|
||||
<script type="text/javascript">
|
||||
<!-- For version detection, set to min. required Flash Player version, or 0 (or 0.0.0), for no version detection. -->
|
||||
var swfVersionStr = "${version_major}.${version_minor}.${version_revision}";
|
||||
<!-- To use express install, set to playerProductInstall.swf, otherwise the empty string. -->
|
||||
var xiSwfUrlStr = "${expressInstallSwf}";
|
||||
var flashvars = {};
|
||||
var params = {};
|
||||
params.quality = "high";
|
||||
params.bgcolor = "${bgcolor}";
|
||||
params.allowscriptaccess = "sameDomain";
|
||||
params.allowfullscreen = "true";
|
||||
var attributes = {};
|
||||
attributes.id = "${application}";
|
||||
attributes.name = "${application}";
|
||||
attributes.align = "middle";
|
||||
swfobject.embedSWF(
|
||||
"${swf}.swf", "flashContent",
|
||||
"${width}", "${height}",
|
||||
swfVersionStr, xiSwfUrlStr,
|
||||
flashvars, params, attributes);
|
||||
<!-- JavaScript enabled so display the flashContent div in case it is not replaced with a swf object. -->
|
||||
swfobject.createCSS("#flashContent", "display:block;text-align:left;");
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<!-- SWFObject's dynamic embed method replaces this alternative HTML content with Flash content when enough
|
||||
JavaScript and Flash plug-in support is available. The div is initially hidden so that it doesn't show
|
||||
when JavaScript is disabled.
|
||||
-->
|
||||
<div id="flashContent">
|
||||
<p>
|
||||
To view this page ensure that Adobe Flash Player version
|
||||
${version_major}.${version_minor}.${version_revision} or greater is installed.
|
||||
</p>
|
||||
<script type="text/javascript">
|
||||
var pageHost = ((document.location.protocol == "https:") ? "https://" : "http://");
|
||||
document.write("<a href='http://www.adobe.com/go/getflashplayer'><img src='"
|
||||
+ pageHost + "www.adobe.com/images/shared/download_buttons/get_flash_player.gif' alt='Get Adobe Flash player' /></a>" );
|
||||
</script>
|
||||
</div>
|
||||
|
||||
<noscript>
|
||||
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="${width}" height="${height}" id="${application}">
|
||||
<param name="movie" value="${swf}.swf" />
|
||||
<param name="quality" value="high" />
|
||||
<param name="bgcolor" value="${bgcolor}" />
|
||||
<param name="allowScriptAccess" value="sameDomain" />
|
||||
<param name="allowFullScreen" value="true" />
|
||||
<!--[if !IE]>-->
|
||||
<object type="application/x-shockwave-flash" data="${swf}.swf" width="${width}" height="${height}">
|
||||
<param name="quality" value="high" />
|
||||
<param name="bgcolor" value="${bgcolor}" />
|
||||
<param name="allowScriptAccess" value="sameDomain" />
|
||||
<param name="allowFullScreen" value="true" />
|
||||
<!--<![endif]-->
|
||||
<!--[if gte IE 6]>-->
|
||||
<p>
|
||||
Either scripts and active content are not permitted to run or Adobe Flash Player version
|
||||
${version_major}.${version_minor}.${version_revision} or greater is not installed.
|
||||
</p>
|
||||
<!--<![endif]-->
|
||||
<a href="http://www.adobe.com/go/getflashplayer">
|
||||
<img src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif" alt="Get Adobe Flash Player" />
|
||||
</a>
|
||||
<!--[if !IE]>-->
|
||||
</object>
|
||||
<!--<![endif]-->
|
||||
</object>
|
||||
</noscript>
|
||||
</body>
|
||||
</html>
|
Binary file not shown.
@@ -1,777 +0,0 @@
|
||||
/*! SWFObject v2.2 <http://code.google.com/p/swfobject/>
|
||||
is released under the MIT License <http://www.opensource.org/licenses/mit-license.php>
|
||||
*/
|
||||
|
||||
var swfobject = function() {
|
||||
|
||||
var UNDEF = "undefined",
|
||||
OBJECT = "object",
|
||||
SHOCKWAVE_FLASH = "Shockwave Flash",
|
||||
SHOCKWAVE_FLASH_AX = "ShockwaveFlash.ShockwaveFlash",
|
||||
FLASH_MIME_TYPE = "application/x-shockwave-flash",
|
||||
EXPRESS_INSTALL_ID = "SWFObjectExprInst",
|
||||
ON_READY_STATE_CHANGE = "onreadystatechange",
|
||||
|
||||
win = window,
|
||||
doc = document,
|
||||
nav = navigator,
|
||||
|
||||
plugin = false,
|
||||
domLoadFnArr = [main],
|
||||
regObjArr = [],
|
||||
objIdArr = [],
|
||||
listenersArr = [],
|
||||
storedAltContent,
|
||||
storedAltContentId,
|
||||
storedCallbackFn,
|
||||
storedCallbackObj,
|
||||
isDomLoaded = false,
|
||||
isExpressInstallActive = false,
|
||||
dynamicStylesheet,
|
||||
dynamicStylesheetMedia,
|
||||
autoHideShow = true,
|
||||
|
||||
/* Centralized function for browser feature detection
|
||||
- User agent string detection is only used when no good alternative is possible
|
||||
- Is executed directly for optimal performance
|
||||
*/
|
||||
ua = function() {
|
||||
var w3cdom = typeof doc.getElementById != UNDEF && typeof doc.getElementsByTagName != UNDEF && typeof doc.createElement != UNDEF,
|
||||
u = nav.userAgent.toLowerCase(),
|
||||
p = nav.platform.toLowerCase(),
|
||||
windows = p ? /win/.test(p) : /win/.test(u),
|
||||
mac = p ? /mac/.test(p) : /mac/.test(u),
|
||||
webkit = /webkit/.test(u) ? parseFloat(u.replace(/^.*webkit\/(\d+(\.\d+)?).*$/, "$1")) : false, // returns either the webkit version or false if not webkit
|
||||
ie = !+"\v1", // feature detection based on Andrea Giammarchi's solution: http://webreflection.blogspot.com/2009/01/32-bytes-to-know-if-your-browser-is-ie.html
|
||||
playerVersion = [0,0,0],
|
||||
d = null;
|
||||
if (typeof nav.plugins != UNDEF && typeof nav.plugins[SHOCKWAVE_FLASH] == OBJECT) {
|
||||
d = nav.plugins[SHOCKWAVE_FLASH].description;
|
||||
if (d && !(typeof nav.mimeTypes != UNDEF && nav.mimeTypes[FLASH_MIME_TYPE] && !nav.mimeTypes[FLASH_MIME_TYPE].enabledPlugin)) { // navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin indicates whether plug-ins are enabled or disabled in Safari 3+
|
||||
plugin = true;
|
||||
ie = false; // cascaded feature detection for Internet Explorer
|
||||
d = d.replace(/^.*\s+(\S+\s+\S+$)/, "$1");
|
||||
playerVersion[0] = parseInt(d.replace(/^(.*)\..*$/, "$1"), 10);
|
||||
playerVersion[1] = parseInt(d.replace(/^.*\.(.*)\s.*$/, "$1"), 10);
|
||||
playerVersion[2] = /[a-zA-Z]/.test(d) ? parseInt(d.replace(/^.*[a-zA-Z]+(.*)$/, "$1"), 10) : 0;
|
||||
}
|
||||
}
|
||||
else if (typeof win.ActiveXObject != UNDEF) {
|
||||
try {
|
||||
var a = new ActiveXObject(SHOCKWAVE_FLASH_AX);
|
||||
if (a) { // a will return null when ActiveX is disabled
|
||||
d = a.GetVariable("$version");
|
||||
if (d) {
|
||||
ie = true; // cascaded feature detection for Internet Explorer
|
||||
d = d.split(" ")[1].split(",");
|
||||
playerVersion = [parseInt(d[0], 10), parseInt(d[1], 10), parseInt(d[2], 10)];
|
||||
}
|
||||
}
|
||||
}
|
||||
catch(e) {}
|
||||
}
|
||||
return { w3:w3cdom, pv:playerVersion, wk:webkit, ie:ie, win:windows, mac:mac };
|
||||
}(),
|
||||
|
||||
/* Cross-browser onDomLoad
|
||||
- Will fire an event as soon as the DOM of a web page is loaded
|
||||
- Internet Explorer workaround based on Diego Perini's solution: http://javascript.nwbox.com/IEContentLoaded/
|
||||
- Regular onload serves as fallback
|
||||
*/
|
||||
onDomLoad = function() {
|
||||
if (!ua.w3) { return; }
|
||||
if ((typeof doc.readyState != UNDEF && doc.readyState == "complete") || (typeof doc.readyState == UNDEF && (doc.getElementsByTagName("body")[0] || doc.body))) { // function is fired after onload, e.g. when script is inserted dynamically
|
||||
callDomLoadFunctions();
|
||||
}
|
||||
if (!isDomLoaded) {
|
||||
if (typeof doc.addEventListener != UNDEF) {
|
||||
doc.addEventListener("DOMContentLoaded", callDomLoadFunctions, false);
|
||||
}
|
||||
if (ua.ie && ua.win) {
|
||||
doc.attachEvent(ON_READY_STATE_CHANGE, function() {
|
||||
if (doc.readyState == "complete") {
|
||||
doc.detachEvent(ON_READY_STATE_CHANGE, arguments.callee);
|
||||
callDomLoadFunctions();
|
||||
}
|
||||
});
|
||||
if (win == top) { // if not inside an iframe
|
||||
(function(){
|
||||
if (isDomLoaded) { return; }
|
||||
try {
|
||||
doc.documentElement.doScroll("left");
|
||||
}
|
||||
catch(e) {
|
||||
setTimeout(arguments.callee, 0);
|
||||
return;
|
||||
}
|
||||
callDomLoadFunctions();
|
||||
})();
|
||||
}
|
||||
}
|
||||
if (ua.wk) {
|
||||
(function(){
|
||||
if (isDomLoaded) { return; }
|
||||
if (!/loaded|complete/.test(doc.readyState)) {
|
||||
setTimeout(arguments.callee, 0);
|
||||
return;
|
||||
}
|
||||
callDomLoadFunctions();
|
||||
})();
|
||||
}
|
||||
addLoadEvent(callDomLoadFunctions);
|
||||
}
|
||||
}();
|
||||
|
||||
function callDomLoadFunctions() {
|
||||
if (isDomLoaded) { return; }
|
||||
try { // test if we can really add/remove elements to/from the DOM; we don't want to fire it too early
|
||||
var t = doc.getElementsByTagName("body")[0].appendChild(createElement("span"));
|
||||
t.parentNode.removeChild(t);
|
||||
}
|
||||
catch (e) { return; }
|
||||
isDomLoaded = true;
|
||||
var dl = domLoadFnArr.length;
|
||||
for (var i = 0; i < dl; i++) {
|
||||
domLoadFnArr[i]();
|
||||
}
|
||||
}
|
||||
|
||||
function addDomLoadEvent(fn) {
|
||||
if (isDomLoaded) {
|
||||
fn();
|
||||
}
|
||||
else {
|
||||
domLoadFnArr[domLoadFnArr.length] = fn; // Array.push() is only available in IE5.5+
|
||||
}
|
||||
}
|
||||
|
||||
/* Cross-browser onload
|
||||
- Based on James Edwards' solution: http://brothercake.com/site/resources/scripts/onload/
|
||||
- Will fire an event as soon as a web page including all of its assets are loaded
|
||||
*/
|
||||
function addLoadEvent(fn) {
|
||||
if (typeof win.addEventListener != UNDEF) {
|
||||
win.addEventListener("load", fn, false);
|
||||
}
|
||||
else if (typeof doc.addEventListener != UNDEF) {
|
||||
doc.addEventListener("load", fn, false);
|
||||
}
|
||||
else if (typeof win.attachEvent != UNDEF) {
|
||||
addListener(win, "onload", fn);
|
||||
}
|
||||
else if (typeof win.onload == "function") {
|
||||
var fnOld = win.onload;
|
||||
win.onload = function() {
|
||||
fnOld();
|
||||
fn();
|
||||
};
|
||||
}
|
||||
else {
|
||||
win.onload = fn;
|
||||
}
|
||||
}
|
||||
|
||||
/* Main function
|
||||
- Will preferably execute onDomLoad, otherwise onload (as a fallback)
|
||||
*/
|
||||
function main() {
|
||||
if (plugin) {
|
||||
testPlayerVersion();
|
||||
}
|
||||
else {
|
||||
matchVersions();
|
||||
}
|
||||
}
|
||||
|
||||
/* Detect the Flash Player version for non-Internet Explorer browsers
|
||||
- Detecting the plug-in version via the object element is more precise than using the plugins collection item's description:
|
||||
a. Both release and build numbers can be detected
|
||||
b. Avoid wrong descriptions by corrupt installers provided by Adobe
|
||||
c. Avoid wrong descriptions by multiple Flash Player entries in the plugin Array, caused by incorrect browser imports
|
||||
- Disadvantage of this method is that it depends on the availability of the DOM, while the plugins collection is immediately available
|
||||
*/
|
||||
function testPlayerVersion() {
|
||||
var b = doc.getElementsByTagName("body")[0];
|
||||
var o = createElement(OBJECT);
|
||||
o.setAttribute("type", FLASH_MIME_TYPE);
|
||||
var t = b.appendChild(o);
|
||||
if (t) {
|
||||
var counter = 0;
|
||||
(function(){
|
||||
if (typeof t.GetVariable != UNDEF) {
|
||||
var d = t.GetVariable("$version");
|
||||
if (d) {
|
||||
d = d.split(" ")[1].split(",");
|
||||
ua.pv = [parseInt(d[0], 10), parseInt(d[1], 10), parseInt(d[2], 10)];
|
||||
}
|
||||
}
|
||||
else if (counter < 10) {
|
||||
counter++;
|
||||
setTimeout(arguments.callee, 10);
|
||||
return;
|
||||
}
|
||||
b.removeChild(o);
|
||||
t = null;
|
||||
matchVersions();
|
||||
})();
|
||||
}
|
||||
else {
|
||||
matchVersions();
|
||||
}
|
||||
}
|
||||
|
||||
/* Perform Flash Player and SWF version matching; static publishing only
|
||||
*/
|
||||
function matchVersions() {
|
||||
var rl = regObjArr.length;
|
||||
if (rl > 0) {
|
||||
for (var i = 0; i < rl; i++) { // for each registered object element
|
||||
var id = regObjArr[i].id;
|
||||
var cb = regObjArr[i].callbackFn;
|
||||
var cbObj = {success:false, id:id};
|
||||
if (ua.pv[0] > 0) {
|
||||
var obj = getElementById(id);
|
||||
if (obj) {
|
||||
if (hasPlayerVersion(regObjArr[i].swfVersion) && !(ua.wk && ua.wk < 312)) { // Flash Player version >= published SWF version: Houston, we have a match!
|
||||
setVisibility(id, true);
|
||||
if (cb) {
|
||||
cbObj.success = true;
|
||||
cbObj.ref = getObjectById(id);
|
||||
cb(cbObj);
|
||||
}
|
||||
}
|
||||
else if (regObjArr[i].expressInstall && canExpressInstall()) { // show the Adobe Express Install dialog if set by the web page author and if supported
|
||||
var att = {};
|
||||
att.data = regObjArr[i].expressInstall;
|
||||
att.width = obj.getAttribute("width") || "0";
|
||||
att.height = obj.getAttribute("height") || "0";
|
||||
if (obj.getAttribute("class")) { att.styleclass = obj.getAttribute("class"); }
|
||||
if (obj.getAttribute("align")) { att.align = obj.getAttribute("align"); }
|
||||
// parse HTML object param element's name-value pairs
|
||||
var par = {};
|
||||
var p = obj.getElementsByTagName("param");
|
||||
var pl = p.length;
|
||||
for (var j = 0; j < pl; j++) {
|
||||
if (p[j].getAttribute("name").toLowerCase() != "movie") {
|
||||
par[p[j].getAttribute("name")] = p[j].getAttribute("value");
|
||||
}
|
||||
}
|
||||
showExpressInstall(att, par, id, cb);
|
||||
}
|
||||
else { // Flash Player and SWF version mismatch or an older Webkit engine that ignores the HTML object element's nested param elements: display alternative content instead of SWF
|
||||
displayAltContent(obj);
|
||||
if (cb) { cb(cbObj); }
|
||||
}
|
||||
}
|
||||
}
|
||||
else { // if no Flash Player is installed or the fp version cannot be detected we let the HTML object element do its job (either show a SWF or alternative content)
|
||||
setVisibility(id, true);
|
||||
if (cb) {
|
||||
var o = getObjectById(id); // test whether there is an HTML object element or not
|
||||
if (o && typeof o.SetVariable != UNDEF) {
|
||||
cbObj.success = true;
|
||||
cbObj.ref = o;
|
||||
}
|
||||
cb(cbObj);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function getObjectById(objectIdStr) {
|
||||
var r = null;
|
||||
var o = getElementById(objectIdStr);
|
||||
if (o && o.nodeName == "OBJECT") {
|
||||
if (typeof o.SetVariable != UNDEF) {
|
||||
r = o;
|
||||
}
|
||||
else {
|
||||
var n = o.getElementsByTagName(OBJECT)[0];
|
||||
if (n) {
|
||||
r = n;
|
||||
}
|
||||
}
|
||||
}
|
||||
return r;
|
||||
}
|
||||
|
||||
/* Requirements for Adobe Express Install
|
||||
- only one instance can be active at a time
|
||||
- fp 6.0.65 or higher
|
||||
- Win/Mac OS only
|
||||
- no Webkit engines older than version 312
|
||||
*/
|
||||
function canExpressInstall() {
|
||||
return !isExpressInstallActive && hasPlayerVersion("6.0.65") && (ua.win || ua.mac) && !(ua.wk && ua.wk < 312);
|
||||
}
|
||||
|
||||
/* Show the Adobe Express Install dialog
|
||||
- Reference: http://www.adobe.com/cfusion/knowledgebase/index.cfm?id=6a253b75
|
||||
*/
|
||||
function showExpressInstall(att, par, replaceElemIdStr, callbackFn) {
|
||||
isExpressInstallActive = true;
|
||||
storedCallbackFn = callbackFn || null;
|
||||
storedCallbackObj = {success:false, id:replaceElemIdStr};
|
||||
var obj = getElementById(replaceElemIdStr);
|
||||
if (obj) {
|
||||
if (obj.nodeName == "OBJECT") { // static publishing
|
||||
storedAltContent = abstractAltContent(obj);
|
||||
storedAltContentId = null;
|
||||
}
|
||||
else { // dynamic publishing
|
||||
storedAltContent = obj;
|
||||
storedAltContentId = replaceElemIdStr;
|
||||
}
|
||||
att.id = EXPRESS_INSTALL_ID;
|
||||
if (typeof att.width == UNDEF || (!/%$/.test(att.width) && parseInt(att.width, 10) < 310)) { att.width = "310"; }
|
||||
if (typeof att.height == UNDEF || (!/%$/.test(att.height) && parseInt(att.height, 10) < 137)) { att.height = "137"; }
|
||||
doc.title = doc.title.slice(0, 47) + " - Flash Player Installation";
|
||||
var pt = ua.ie && ua.win ? "ActiveX" : "PlugIn",
|
||||
fv = "MMredirectURL=" + encodeURI(window.location).toString().replace(/&/g,"%26") + "&MMplayerType=" + pt + "&MMdoctitle=" + doc.title;
|
||||
if (typeof par.flashvars != UNDEF) {
|
||||
par.flashvars += "&" + fv;
|
||||
}
|
||||
else {
|
||||
par.flashvars = fv;
|
||||
}
|
||||
// IE only: when a SWF is loading (AND: not available in cache) wait for the readyState of the object element to become 4 before removing it,
|
||||
// because you cannot properly cancel a loading SWF file without breaking browser load references, also obj.onreadystatechange doesn't work
|
||||
if (ua.ie && ua.win && obj.readyState != 4) {
|
||||
var newObj = createElement("div");
|
||||
replaceElemIdStr += "SWFObjectNew";
|
||||
newObj.setAttribute("id", replaceElemIdStr);
|
||||
obj.parentNode.insertBefore(newObj, obj); // insert placeholder div that will be replaced by the object element that loads expressinstall.swf
|
||||
obj.style.display = "none";
|
||||
(function(){
|
||||
if (obj.readyState == 4) {
|
||||
obj.parentNode.removeChild(obj);
|
||||
}
|
||||
else {
|
||||
setTimeout(arguments.callee, 10);
|
||||
}
|
||||
})();
|
||||
}
|
||||
createSWF(att, par, replaceElemIdStr);
|
||||
}
|
||||
}
|
||||
|
||||
/* Functions to abstract and display alternative content
|
||||
*/
|
||||
function displayAltContent(obj) {
|
||||
if (ua.ie && ua.win && obj.readyState != 4) {
|
||||
// IE only: when a SWF is loading (AND: not available in cache) wait for the readyState of the object element to become 4 before removing it,
|
||||
// because you cannot properly cancel a loading SWF file without breaking browser load references, also obj.onreadystatechange doesn't work
|
||||
var el = createElement("div");
|
||||
obj.parentNode.insertBefore(el, obj); // insert placeholder div that will be replaced by the alternative content
|
||||
el.parentNode.replaceChild(abstractAltContent(obj), el);
|
||||
obj.style.display = "none";
|
||||
(function(){
|
||||
if (obj.readyState == 4) {
|
||||
obj.parentNode.removeChild(obj);
|
||||
}
|
||||
else {
|
||||
setTimeout(arguments.callee, 10);
|
||||
}
|
||||
})();
|
||||
}
|
||||
else {
|
||||
obj.parentNode.replaceChild(abstractAltContent(obj), obj);
|
||||
}
|
||||
}
|
||||
|
||||
function abstractAltContent(obj) {
|
||||
var ac = createElement("div");
|
||||
if (ua.win && ua.ie) {
|
||||
ac.innerHTML = obj.innerHTML;
|
||||
}
|
||||
else {
|
||||
var nestedObj = obj.getElementsByTagName(OBJECT)[0];
|
||||
if (nestedObj) {
|
||||
var c = nestedObj.childNodes;
|
||||
if (c) {
|
||||
var cl = c.length;
|
||||
for (var i = 0; i < cl; i++) {
|
||||
if (!(c[i].nodeType == 1 && c[i].nodeName == "PARAM") && !(c[i].nodeType == 8)) {
|
||||
ac.appendChild(c[i].cloneNode(true));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return ac;
|
||||
}
|
||||
|
||||
/* Cross-browser dynamic SWF creation
|
||||
*/
|
||||
function createSWF(attObj, parObj, id) {
|
||||
var r, el = getElementById(id);
|
||||
if (ua.wk && ua.wk < 312) { return r; }
|
||||
if (el) {
|
||||
if (typeof attObj.id == UNDEF) { // if no 'id' is defined for the object element, it will inherit the 'id' from the alternative content
|
||||
attObj.id = id;
|
||||
}
|
||||
if (ua.ie && ua.win) { // Internet Explorer + the HTML object element + W3C DOM methods do not combine: fall back to outerHTML
|
||||
var att = "";
|
||||
for (var i in attObj) {
|
||||
if (attObj[i] != Object.prototype[i]) { // filter out prototype additions from other potential libraries
|
||||
if (i.toLowerCase() == "data") {
|
||||
parObj.movie = attObj[i];
|
||||
}
|
||||
else if (i.toLowerCase() == "styleclass") { // 'class' is an ECMA4 reserved keyword
|
||||
att += ' class="' + attObj[i] + '"';
|
||||
}
|
||||
else if (i.toLowerCase() != "classid") {
|
||||
att += ' ' + i + '="' + attObj[i] + '"';
|
||||
}
|
||||
}
|
||||
}
|
||||
var par = "";
|
||||
for (var j in parObj) {
|
||||
if (parObj[j] != Object.prototype[j]) { // filter out prototype additions from other potential libraries
|
||||
par += '<param name="' + j + '" value="' + parObj[j] + '" />';
|
||||
}
|
||||
}
|
||||
el.outerHTML = '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"' + att + '>' + par + '</object>';
|
||||
objIdArr[objIdArr.length] = attObj.id; // stored to fix object 'leaks' on unload (dynamic publishing only)
|
||||
r = getElementById(attObj.id);
|
||||
}
|
||||
else { // well-behaving browsers
|
||||
var o = createElement(OBJECT);
|
||||
o.setAttribute("type", FLASH_MIME_TYPE);
|
||||
for (var m in attObj) {
|
||||
if (attObj[m] != Object.prototype[m]) { // filter out prototype additions from other potential libraries
|
||||
if (m.toLowerCase() == "styleclass") { // 'class' is an ECMA4 reserved keyword
|
||||
o.setAttribute("class", attObj[m]);
|
||||
}
|
||||
else if (m.toLowerCase() != "classid") { // filter out IE specific attribute
|
||||
o.setAttribute(m, attObj[m]);
|
||||
}
|
||||
}
|
||||
}
|
||||
for (var n in parObj) {
|
||||
if (parObj[n] != Object.prototype[n] && n.toLowerCase() != "movie") { // filter out prototype additions from other potential libraries and IE specific param element
|
||||
createObjParam(o, n, parObj[n]);
|
||||
}
|
||||
}
|
||||
el.parentNode.replaceChild(o, el);
|
||||
r = o;
|
||||
}
|
||||
}
|
||||
return r;
|
||||
}
|
||||
|
||||
function createObjParam(el, pName, pValue) {
|
||||
var p = createElement("param");
|
||||
p.setAttribute("name", pName);
|
||||
p.setAttribute("value", pValue);
|
||||
el.appendChild(p);
|
||||
}
|
||||
|
||||
/* Cross-browser SWF removal
|
||||
- Especially needed to safely and completely remove a SWF in Internet Explorer
|
||||
*/
|
||||
function removeSWF(id) {
|
||||
var obj = getElementById(id);
|
||||
if (obj && obj.nodeName == "OBJECT") {
|
||||
if (ua.ie && ua.win) {
|
||||
obj.style.display = "none";
|
||||
(function(){
|
||||
if (obj.readyState == 4) {
|
||||
removeObjectInIE(id);
|
||||
}
|
||||
else {
|
||||
setTimeout(arguments.callee, 10);
|
||||
}
|
||||
})();
|
||||
}
|
||||
else {
|
||||
obj.parentNode.removeChild(obj);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function removeObjectInIE(id) {
|
||||
var obj = getElementById(id);
|
||||
if (obj) {
|
||||
for (var i in obj) {
|
||||
if (typeof obj[i] == "function") {
|
||||
obj[i] = null;
|
||||
}
|
||||
}
|
||||
obj.parentNode.removeChild(obj);
|
||||
}
|
||||
}
|
||||
|
||||
/* Functions to optimize JavaScript compression
|
||||
*/
|
||||
function getElementById(id) {
|
||||
var el = null;
|
||||
try {
|
||||
el = doc.getElementById(id);
|
||||
}
|
||||
catch (e) {}
|
||||
return el;
|
||||
}
|
||||
|
||||
function createElement(el) {
|
||||
return doc.createElement(el);
|
||||
}
|
||||
|
||||
/* Updated attachEvent function for Internet Explorer
|
||||
- Stores attachEvent information in an Array, so on unload the detachEvent functions can be called to avoid memory leaks
|
||||
*/
|
||||
function addListener(target, eventType, fn) {
|
||||
target.attachEvent(eventType, fn);
|
||||
listenersArr[listenersArr.length] = [target, eventType, fn];
|
||||
}
|
||||
|
||||
/* Flash Player and SWF content version matching
|
||||
*/
|
||||
function hasPlayerVersion(rv) {
|
||||
var pv = ua.pv, v = rv.split(".");
|
||||
v[0] = parseInt(v[0], 10);
|
||||
v[1] = parseInt(v[1], 10) || 0; // supports short notation, e.g. "9" instead of "9.0.0"
|
||||
v[2] = parseInt(v[2], 10) || 0;
|
||||
return (pv[0] > v[0] || (pv[0] == v[0] && pv[1] > v[1]) || (pv[0] == v[0] && pv[1] == v[1] && pv[2] >= v[2])) ? true : false;
|
||||
}
|
||||
|
||||
/* Cross-browser dynamic CSS creation
|
||||
- Based on Bobby van der Sluis' solution: http://www.bobbyvandersluis.com/articles/dynamicCSS.php
|
||||
*/
|
||||
function createCSS(sel, decl, media, newStyle) {
|
||||
if (ua.ie && ua.mac) { return; }
|
||||
var h = doc.getElementsByTagName("head")[0];
|
||||
if (!h) { return; } // to also support badly authored HTML pages that lack a head element
|
||||
var m = (media && typeof media == "string") ? media : "screen";
|
||||
if (newStyle) {
|
||||
dynamicStylesheet = null;
|
||||
dynamicStylesheetMedia = null;
|
||||
}
|
||||
if (!dynamicStylesheet || dynamicStylesheetMedia != m) {
|
||||
// create dynamic stylesheet + get a global reference to it
|
||||
var s = createElement("style");
|
||||
s.setAttribute("type", "text/css");
|
||||
s.setAttribute("media", m);
|
||||
dynamicStylesheet = h.appendChild(s);
|
||||
if (ua.ie && ua.win && typeof doc.styleSheets != UNDEF && doc.styleSheets.length > 0) {
|
||||
dynamicStylesheet = doc.styleSheets[doc.styleSheets.length - 1];
|
||||
}
|
||||
dynamicStylesheetMedia = m;
|
||||
}
|
||||
// add style rule
|
||||
if (ua.ie && ua.win) {
|
||||
if (dynamicStylesheet && typeof dynamicStylesheet.addRule == OBJECT) {
|
||||
dynamicStylesheet.addRule(sel, decl);
|
||||
}
|
||||
}
|
||||
else {
|
||||
if (dynamicStylesheet && typeof doc.createTextNode != UNDEF) {
|
||||
dynamicStylesheet.appendChild(doc.createTextNode(sel + " {" + decl + "}"));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function setVisibility(id, isVisible) {
|
||||
if (!autoHideShow) { return; }
|
||||
var v = isVisible ? "visible" : "hidden";
|
||||
if (isDomLoaded && getElementById(id)) {
|
||||
getElementById(id).style.visibility = v;
|
||||
}
|
||||
else {
|
||||
createCSS("#" + id, "visibility:" + v);
|
||||
}
|
||||
}
|
||||
|
||||
/* Filter to avoid XSS attacks
|
||||
*/
|
||||
function urlEncodeIfNecessary(s) {
|
||||
var regex = /[\\\"<>\.;]/;
|
||||
var hasBadChars = regex.exec(s) != null;
|
||||
return hasBadChars && typeof encodeURIComponent != UNDEF ? encodeURIComponent(s) : s;
|
||||
}
|
||||
|
||||
/* Release memory to avoid memory leaks caused by closures, fix hanging audio/video threads and force open sockets/NetConnections to disconnect (Internet Explorer only)
|
||||
*/
|
||||
var cleanup = function() {
|
||||
if (ua.ie && ua.win) {
|
||||
window.attachEvent("onunload", function() {
|
||||
// remove listeners to avoid memory leaks
|
||||
var ll = listenersArr.length;
|
||||
for (var i = 0; i < ll; i++) {
|
||||
listenersArr[i][0].detachEvent(listenersArr[i][1], listenersArr[i][2]);
|
||||
}
|
||||
// cleanup dynamically embedded objects to fix audio/video threads and force open sockets and NetConnections to disconnect
|
||||
var il = objIdArr.length;
|
||||
for (var j = 0; j < il; j++) {
|
||||
removeSWF(objIdArr[j]);
|
||||
}
|
||||
// cleanup library's main closures to avoid memory leaks
|
||||
for (var k in ua) {
|
||||
ua[k] = null;
|
||||
}
|
||||
ua = null;
|
||||
for (var l in swfobject) {
|
||||
swfobject[l] = null;
|
||||
}
|
||||
swfobject = null;
|
||||
});
|
||||
}
|
||||
}();
|
||||
|
||||
return {
|
||||
/* Public API
|
||||
- Reference: http://code.google.com/p/swfobject/wiki/documentation
|
||||
*/
|
||||
registerObject: function(objectIdStr, swfVersionStr, xiSwfUrlStr, callbackFn) {
|
||||
if (ua.w3 && objectIdStr && swfVersionStr) {
|
||||
var regObj = {};
|
||||
regObj.id = objectIdStr;
|
||||
regObj.swfVersion = swfVersionStr;
|
||||
regObj.expressInstall = xiSwfUrlStr;
|
||||
regObj.callbackFn = callbackFn;
|
||||
regObjArr[regObjArr.length] = regObj;
|
||||
setVisibility(objectIdStr, false);
|
||||
}
|
||||
else if (callbackFn) {
|
||||
callbackFn({success:false, id:objectIdStr});
|
||||
}
|
||||
},
|
||||
|
||||
getObjectById: function(objectIdStr) {
|
||||
if (ua.w3) {
|
||||
return getObjectById(objectIdStr);
|
||||
}
|
||||
},
|
||||
|
||||
embedSWF: function(swfUrlStr, replaceElemIdStr, widthStr, heightStr, swfVersionStr, xiSwfUrlStr, flashvarsObj, parObj, attObj, callbackFn) {
|
||||
var callbackObj = {success:false, id:replaceElemIdStr};
|
||||
if (ua.w3 && !(ua.wk && ua.wk < 312) && swfUrlStr && replaceElemIdStr && widthStr && heightStr && swfVersionStr) {
|
||||
setVisibility(replaceElemIdStr, false);
|
||||
addDomLoadEvent(function() {
|
||||
widthStr += ""; // auto-convert to string
|
||||
heightStr += "";
|
||||
var att = {};
|
||||
if (attObj && typeof attObj === OBJECT) {
|
||||
for (var i in attObj) { // copy object to avoid the use of references, because web authors often reuse attObj for multiple SWFs
|
||||
att[i] = attObj[i];
|
||||
}
|
||||
}
|
||||
att.data = swfUrlStr;
|
||||
att.width = widthStr;
|
||||
att.height = heightStr;
|
||||
var par = {};
|
||||
if (parObj && typeof parObj === OBJECT) {
|
||||
for (var j in parObj) { // copy object to avoid the use of references, because web authors often reuse parObj for multiple SWFs
|
||||
par[j] = parObj[j];
|
||||
}
|
||||
}
|
||||
if (flashvarsObj && typeof flashvarsObj === OBJECT) {
|
||||
for (var k in flashvarsObj) { // copy object to avoid the use of references, because web authors often reuse flashvarsObj for multiple SWFs
|
||||
if (typeof par.flashvars != UNDEF) {
|
||||
par.flashvars += "&" + k + "=" + flashvarsObj[k];
|
||||
}
|
||||
else {
|
||||
par.flashvars = k + "=" + flashvarsObj[k];
|
||||
}
|
||||
}
|
||||
}
|
||||
if (hasPlayerVersion(swfVersionStr)) { // create SWF
|
||||
var obj = createSWF(att, par, replaceElemIdStr);
|
||||
if (att.id == replaceElemIdStr) {
|
||||
setVisibility(replaceElemIdStr, true);
|
||||
}
|
||||
callbackObj.success = true;
|
||||
callbackObj.ref = obj;
|
||||
}
|
||||
else if (xiSwfUrlStr && canExpressInstall()) { // show Adobe Express Install
|
||||
att.data = xiSwfUrlStr;
|
||||
showExpressInstall(att, par, replaceElemIdStr, callbackFn);
|
||||
return;
|
||||
}
|
||||
else { // show alternative content
|
||||
setVisibility(replaceElemIdStr, true);
|
||||
}
|
||||
if (callbackFn) { callbackFn(callbackObj); }
|
||||
});
|
||||
}
|
||||
else if (callbackFn) { callbackFn(callbackObj); }
|
||||
},
|
||||
|
||||
switchOffAutoHideShow: function() {
|
||||
autoHideShow = false;
|
||||
},
|
||||
|
||||
ua: ua,
|
||||
|
||||
getFlashPlayerVersion: function() {
|
||||
return { major:ua.pv[0], minor:ua.pv[1], release:ua.pv[2] };
|
||||
},
|
||||
|
||||
hasFlashPlayerVersion: hasPlayerVersion,
|
||||
|
||||
createSWF: function(attObj, parObj, replaceElemIdStr) {
|
||||
if (ua.w3) {
|
||||
return createSWF(attObj, parObj, replaceElemIdStr);
|
||||
}
|
||||
else {
|
||||
return undefined;
|
||||
}
|
||||
},
|
||||
|
||||
showExpressInstall: function(att, par, replaceElemIdStr, callbackFn) {
|
||||
if (ua.w3 && canExpressInstall()) {
|
||||
showExpressInstall(att, par, replaceElemIdStr, callbackFn);
|
||||
}
|
||||
},
|
||||
|
||||
removeSWF: function(objElemIdStr) {
|
||||
if (ua.w3) {
|
||||
removeSWF(objElemIdStr);
|
||||
}
|
||||
},
|
||||
|
||||
createCSS: function(selStr, declStr, mediaStr, newStyleBoolean) {
|
||||
if (ua.w3) {
|
||||
createCSS(selStr, declStr, mediaStr, newStyleBoolean);
|
||||
}
|
||||
},
|
||||
|
||||
addDomLoadEvent: addDomLoadEvent,
|
||||
|
||||
addLoadEvent: addLoadEvent,
|
||||
|
||||
getQueryParamValue: function(param) {
|
||||
var q = doc.location.search || doc.location.hash;
|
||||
if (q) {
|
||||
if (/\?/.test(q)) { q = q.split("?")[1]; } // strip question mark
|
||||
if (param == null) {
|
||||
return urlEncodeIfNecessary(q);
|
||||
}
|
||||
var pairs = q.split("&");
|
||||
for (var i = 0; i < pairs.length; i++) {
|
||||
if (pairs[i].substring(0, pairs[i].indexOf("=")) == param) {
|
||||
return urlEncodeIfNecessary(pairs[i].substring((pairs[i].indexOf("=") + 1)));
|
||||
}
|
||||
}
|
||||
}
|
||||
return "";
|
||||
},
|
||||
|
||||
// For internal usage only
|
||||
expressInstallCallback: function() {
|
||||
if (isExpressInstallActive) {
|
||||
var obj = getElementById(EXPRESS_INSTALL_ID);
|
||||
if (obj && storedAltContent) {
|
||||
obj.parentNode.replaceChild(storedAltContent, obj);
|
||||
if (storedAltContentId) {
|
||||
setVisibility(storedAltContentId, true);
|
||||
if (ua.ie && ua.win) { storedAltContent.style.display = "block"; }
|
||||
}
|
||||
if (storedCallbackFn) { storedCallbackFn(storedCallbackObj); }
|
||||
}
|
||||
isExpressInstallActive = false;
|
||||
}
|
||||
}
|
||||
};
|
||||
}();
|
@@ -1 +0,0 @@
|
||||
package {
|
@@ -1,69 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" creationComplete="loadXML()" backgroundAlpha="0" borderColor="#6587AE">
|
||||
<mx:Script>
|
||||
|
||||
<![CDATA[
|
||||
import mx.core.UIComponent;
|
||||
import mx.rpc.events.FaultEvent;
|
||||
import mx.rpc.events.ResultEvent;
|
||||
private var imagesXML:String = "";
|
||||
private var nav:Navigator;
|
||||
|
||||
public function loadXML( ):void
|
||||
{
|
||||
if(Application.application.parameters.rss != null)
|
||||
{
|
||||
httpService.url = Application.application.parameters.rss;
|
||||
}
|
||||
|
||||
httpService.send();
|
||||
}
|
||||
private function onLoad( e:ResultEvent ):void
|
||||
{
|
||||
var xml:XML = new XML( e.result );
|
||||
var component:UIComponent = new UIComponent();
|
||||
|
||||
var speed:int = 1;
|
||||
var space:int = 10;
|
||||
var zoom:Number = 1;
|
||||
var media:String = "thumbnail";
|
||||
|
||||
if(Application.application.parameters.speed != null)
|
||||
speed = Application.application.parameters.speed;
|
||||
if(Application.application.parameters.space != null)
|
||||
space = Application.application.parameters.space;
|
||||
if(Application.application.parameters.zoom != null)
|
||||
zoom = Application.application.parameters.zoom;
|
||||
if(Application.application.parameters.media != null)
|
||||
media = Application.application.parameters.media;
|
||||
|
||||
nav = new Navigator( xml, 10, canv.width/2, canv.width, zoom, speed, space, media );
|
||||
|
||||
nav.y = (canv.height - nav.height ) / 2;
|
||||
|
||||
component.addChild( nav );
|
||||
canv.addChild( component );
|
||||
|
||||
slideContainer.visible = true;
|
||||
|
||||
nav.startSlideshow();
|
||||
}
|
||||
private function httpService_fault(evt:FaultEvent):void
|
||||
{
|
||||
err.text = evt.fault.message;
|
||||
err.visible = true;
|
||||
}
|
||||
]]>
|
||||
</mx:Script>
|
||||
<mx:HTTPService id="httpService"
|
||||
resultFormat="e4x"
|
||||
fault="httpService_fault(event);"
|
||||
result="onLoad(event)" />
|
||||
<mx:VBox id="slideContainer" visible="false" width="100%" height="100%" horizontalAlign="center" backgroundAlpha="0" verticalCenter="0">
|
||||
<mx:Canvas width="100%" height="100%">
|
||||
<mx:Canvas mask="{canv_mask}" id="canv" width="100%" height="100%" clipContent="true"/>
|
||||
<mx:Canvas id="canv_mask" backgroundAlpha="1" x="{canv.x}" y="{canv.y}" backgroundColor="#FFFFFF" width="{canv.width}" height="{canv.height}"/>
|
||||
</mx:Canvas>
|
||||
</mx:VBox>
|
||||
<mx:Label id="err" x="0" y="0" text="Label" color="#FF0000" width="100%" height="100%" visible="false"/>
|
||||
</mx:Application>
|
@@ -1 +0,0 @@
|
||||
package {
|
@@ -1 +0,0 @@
|
||||
package {
|
@@ -3,7 +3,7 @@
|
||||
/*
|
||||
* This file is part of Phraseanet
|
||||
*
|
||||
* (c) 2005-2014 Alchemy
|
||||
* (c) 2005-2015 Alchemy
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
@@ -131,7 +131,9 @@ use Alchemy\Phrasea\Twig\Camelize;
|
||||
use Alchemy\Phrasea\Twig\BytesConverter;
|
||||
use Alchemy\Phrasea\Twig\PhraseanetExtension;
|
||||
use Alchemy\Phrasea\Utilities\CachedTranslator;
|
||||
use Dflydev\Silex\Provider\DoctrineOrm\DoctrineOrmServiceProvider;
|
||||
use FFMpeg\FFMpegServiceProvider;
|
||||
use Gedmo\DoctrineExtensions as GedmoExtension;
|
||||
use Monolog\Logger;
|
||||
use Monolog\Processor\IntrospectionProcessor;
|
||||
use Neutron\Silex\Provider\ImagineServiceProvider;
|
||||
@@ -145,6 +147,7 @@ use PHPExiftool\PHPExiftoolServiceProvider;
|
||||
use Silex\Application as SilexApplication;
|
||||
use Silex\Application\UrlGeneratorTrait;
|
||||
use Silex\Application\TranslationTrait;
|
||||
use Silex\Provider\DoctrineServiceProvider;
|
||||
use Silex\Provider\FormServiceProvider;
|
||||
use Silex\Provider\MonologServiceProvider;
|
||||
use Silex\Provider\SessionServiceProvider;
|
||||
@@ -159,7 +162,6 @@ use Symfony\Bridge\Twig\Extension\TranslationExtension;
|
||||
use Unoconv\UnoconvServiceProvider;
|
||||
use XPDF\PdfToText;
|
||||
use XPDF\XPDFServiceProvider;
|
||||
|
||||
use Symfony\Component\HttpKernel\Event\FilterResponseEvent;
|
||||
use Symfony\Component\HttpKernel\HttpKernelInterface;
|
||||
use Symfony\Component\HttpKernel\KernelEvents;
|
||||
@@ -201,116 +203,66 @@ class Application extends SilexApplication
|
||||
|
||||
$this->environment = $environment;
|
||||
|
||||
$this->setupApplicationPaths($this);
|
||||
|
||||
$this['charset'] = 'UTF-8';
|
||||
mb_internal_encoding($this['charset']);
|
||||
$this->setupCharset();
|
||||
$this->setupApplicationPaths();
|
||||
$this->setupConstants();
|
||||
|
||||
$this['debug'] = $this->share(function (Application $app) {
|
||||
return Application::ENV_PROD !== $app->getEnvironment();
|
||||
});
|
||||
|
||||
if ($this['debug'] === true) {
|
||||
if ($this['debug']) {
|
||||
ini_set('log_errors', 'on');
|
||||
ini_set('error_log', $this['root.path'].'/logs/php_error.log');
|
||||
}
|
||||
|
||||
$this->register(new ConfigurationServiceProvider());
|
||||
$this->register(new MonologServiceProvider());
|
||||
$this->setupMonolog();
|
||||
$this->register(new FilesystemServiceProvider());
|
||||
$this->register(new CacheServiceProvider());
|
||||
$this->register(new CacheConnectionServiceProvider());
|
||||
$this->register(new PhraseanetServiceProvider());
|
||||
$this->register(new ConfigurationTesterServiceProvider());
|
||||
$this->register(new ORMServiceProvider());
|
||||
$this->register(new DoctrineServiceProvider(), $this['dbs.service.conf']);
|
||||
$this->setupDBAL();
|
||||
$this->register(new DoctrineOrmServiceProvider(), $this['orm.service.conf']);
|
||||
$this->setupOrms();
|
||||
$this->register(new BasketMiddlewareProvider());
|
||||
$this->register(new TokenMiddlewareProvider());
|
||||
$this->register(new ApiApplicationMiddlewareProvider());
|
||||
|
||||
$this->register(new ACLServiceProvider());
|
||||
$this->register(new APIServiceProvider());
|
||||
$this->register(new AuthenticationManagerServiceProvider());
|
||||
$this->register(new BrowserServiceProvider());
|
||||
$this->register(new FilesystemServiceProvider());
|
||||
$this->register(new ConfigurationServiceProvider());
|
||||
$this->register(new ConfigurationTesterServiceProvider);
|
||||
$this->register(new ConvertersServiceProvider());
|
||||
$this->register(new CSVServiceProvider());
|
||||
$this->register(new RegistrationServiceProvider());
|
||||
$this->register(new CacheServiceProvider());
|
||||
$this->register(new CacheConnectionServiceProvider());
|
||||
$this->register(new ImagineServiceProvider());
|
||||
$this->setUpImagine();
|
||||
$this->register(new JMSSerializerServiceProvider());
|
||||
$this->register(new FFMpegServiceProvider());
|
||||
$this->register(new FeedServiceProvider());
|
||||
$this->register(new FtpServiceProvider());
|
||||
$this->register(new GeonamesServiceProvider());
|
||||
$this->register(new StatusServiceProvider());
|
||||
$this['geonames.server-uri'] = $this->share(function (Application $app) {
|
||||
return $app['conf']->get(['registry', 'webservices', 'geonames-server'], 'http://geonames.alchemyasp.com/');
|
||||
});
|
||||
|
||||
$this->setupGeonames();
|
||||
$this->register(new MediaAlchemystServiceProvider());
|
||||
$this['media-alchemyst.configuration'] = $this->share(function (Application $app) {
|
||||
$configuration = [];
|
||||
|
||||
foreach ([
|
||||
'swftools.pdf2swf.binaries' => 'pdf2swf_binary',
|
||||
'swftools.swfrender.binaries' => 'swf_render_binary',
|
||||
'swftools.swfextract.binaries' => 'swf_extract_binary',
|
||||
'unoconv.binaries' => 'unoconv_binary',
|
||||
'mp4box.binaries' => 'mp4box_binary',
|
||||
'gs.binaries' => 'ghostscript_binary',
|
||||
'ffmpeg.ffmpeg.binaries' => 'ffmpeg_binary',
|
||||
'ffmpeg.ffprobe.binaries' => 'ffprobe_binary',
|
||||
'ffmpeg.ffmpeg.timeout' => 'ffmpeg_timeout',
|
||||
'ffmpeg.ffprobe.timeout' => 'ffprobe_timeout',
|
||||
'gs.timeout' => 'gs_timeout',
|
||||
'mp4box.timeout' => 'mp4box_timeout',
|
||||
'swftools.timeout' => 'swftools_timeout',
|
||||
'unoconv.timeout' => 'unoconv_timeout',
|
||||
] as $parameter => $key) {
|
||||
if ($this['conf']->has(['main', 'binaries', $key])) {
|
||||
$configuration[$parameter] = $this['conf']->get(['main', 'binaries', $key]);
|
||||
}
|
||||
}
|
||||
|
||||
$configuration['ffmpeg.threads'] = $app['conf']->get(['registry', 'executables', 'ffmpeg-threads']) ?: null;
|
||||
$configuration['imagine.driver'] = $app['conf']->get(['registry', 'executables', 'imagine-driver']) ?: null;
|
||||
|
||||
return $configuration;
|
||||
});
|
||||
$this['media-alchemyst.logger'] = $this->share(function (Application $app) {
|
||||
return $app['monolog'];
|
||||
});
|
||||
|
||||
$this->setupMediaAlchemyst();
|
||||
$this->register(new MediaVorusServiceProvider());
|
||||
$this->register(new MonologServiceProvider());
|
||||
$this['monolog.name'] = 'Phraseanet logger';
|
||||
$this['monolog.handler'] = $this->share(function () {
|
||||
return new NullHandler();
|
||||
});
|
||||
$this['monolog'] = $this->share($this->extend('monolog', function (Logger $monolog) {
|
||||
$monolog->pushProcessor(new IntrospectionProcessor());
|
||||
|
||||
return $monolog;
|
||||
}));
|
||||
$this->register(new MP4BoxServiceProvider());
|
||||
$this->register(new NotificationDelivererServiceProvider());
|
||||
$this->register(new ORMServiceProvider());
|
||||
$this->register(new RepositoriesServiceProvider());
|
||||
$this->register(new ManipulatorServiceProvider());
|
||||
$this->register(new InstallerServiceProvider());
|
||||
$this->register(new PhraseanetServiceProvider());
|
||||
$this->register(new PhraseaVersionServiceProvider());
|
||||
$this->register(new PHPExiftoolServiceProvider());
|
||||
$this->register(new RandomGeneratorServiceProvider());
|
||||
$this->register(new ReCaptchaServiceProvider());
|
||||
$this->register(new SubdefServiceProvider());
|
||||
$this->register(new ZippyServiceProvider());
|
||||
|
||||
$this['recaptcha.public-key'] = $this->share(function (Application $app) {
|
||||
if ($app['conf']->get(['registry', 'webservices', 'captcha-enabled'])) {
|
||||
return $app['conf']->get(['registry', 'webservices', 'recaptcha-public-key']);
|
||||
}
|
||||
});
|
||||
$this['recaptcha.private-key'] = $this->share(function (Application $app) {
|
||||
if ($app['conf']->get(['registry', 'webservices', 'captcha-enabled'])) {
|
||||
return $app['conf']->get(['registry', 'webservices', 'recaptcha-private-key']);
|
||||
}
|
||||
});
|
||||
$this->setupRecaptacha();
|
||||
|
||||
if ($this['configuration.store']->isSetup()) {
|
||||
$this->register(new SearchEngineServiceProvider());
|
||||
@@ -322,21 +274,11 @@ class Application extends SilexApplication
|
||||
'session.test' => $this->getEnvironment() === static::ENV_TEST,
|
||||
'session.storage.options' => ['cookie_lifetime' => 0]
|
||||
]);
|
||||
|
||||
$this['session.storage.test'] = $this->share(function ($app) {
|
||||
return new MockArraySessionStorage();
|
||||
});
|
||||
|
||||
$this['session.storage.handler'] = $this->share(function ($app) {
|
||||
if (!$this['phraseanet.configuration-tester']->isInstalled()) {
|
||||
return new NullSessionHandler();
|
||||
}
|
||||
return $this['session.storage.handler.factory']->create($app['conf']);
|
||||
});
|
||||
|
||||
$this->setupSession();
|
||||
$this->register(new SerializerServiceProvider());
|
||||
$this->register(new ServiceControllerServiceProvider());
|
||||
$this->register(new SwiftmailerServiceProvider());
|
||||
$this->setupSwiftMailer();
|
||||
$this->register(new TasksServiceProvider());
|
||||
$this->register(new TemporaryFilesystemServiceProvider());
|
||||
$this->register(new TokensServiceProvider());
|
||||
@@ -345,179 +287,39 @@ class Application extends SilexApplication
|
||||
'cache' => $this->share(function($app) {return $app['cache.path'].'/twig';}),
|
||||
],
|
||||
]);
|
||||
|
||||
$this->setupTwig();
|
||||
$this->register(new TranslationServiceProvider(), [
|
||||
'locale_fallbacks' => ['fr'],
|
||||
'translator.cache-options' => [
|
||||
'debug' => $this['debug'],
|
||||
'cache_dir' => $this->share(function($app) {return $app['cache.path'].'/translations';}),
|
||||
'cache_dir' => $this->share(function($app) {
|
||||
return $app['cache.path'].'/translations';
|
||||
}),
|
||||
],
|
||||
]);
|
||||
|
||||
$this['translator'] = $this->share($this->extend('translator', function (CachedTranslator $translator, $app) {
|
||||
$translator->addResource('xlf', __DIR__.'/../../../resources/locales/messages.fr.xlf', 'fr', 'messages');
|
||||
$translator->addResource('xlf', __DIR__.'/../../../resources/locales/validators.fr.xlf', 'fr', 'validators');
|
||||
$translator->addResource('xlf', __DIR__.'/../../../resources/locales/messages.en.xlf', 'en', 'messages');
|
||||
$translator->addResource('xlf', __DIR__.'/../../../resources/locales/validators.en.xlf', 'en', 'validators');
|
||||
$translator->addResource('xlf', __DIR__.'/../../../resources/locales/messages.de.xlf', 'de', 'messages');
|
||||
$translator->addResource('xlf', __DIR__.'/../../../resources/locales/validators.de.xlf', 'de', 'validators');
|
||||
$translator->addResource('xlf', __DIR__.'/../../../resources/locales/messages.nl.xlf', 'nl', 'messages');
|
||||
$translator->addResource('xlf', __DIR__.'/../../../resources/locales/validators.nl.xlf', 'nl', 'validators');
|
||||
|
||||
return $translator;
|
||||
}));
|
||||
|
||||
$this->setupTranslation();
|
||||
$this->register(new FormServiceProvider());
|
||||
|
||||
$this['form.type.extensions'] = $this->share($this->extend('form.type.extensions', function ($extensions) {
|
||||
$extensions[] = new HelpTypeExtension();
|
||||
|
||||
return $extensions;
|
||||
}));
|
||||
|
||||
$this->setupTwig();
|
||||
$this->setupForm();
|
||||
$this->register(new UnoconvServiceProvider());
|
||||
$this->register(new UrlGeneratorServiceProvider());
|
||||
$this->setupUrlGenerator();
|
||||
$this->register(new UnicodeServiceProvider());
|
||||
$this->register(new ValidatorServiceProvider());
|
||||
$this->register(new XPDFServiceProvider());
|
||||
$this->setupXpdf();
|
||||
$this->register(new FileServeServiceProvider());
|
||||
$this->register(new ManipulatorServiceProvider());
|
||||
$this->register(new PluginServiceProvider());
|
||||
$this->register(new PhraseaEventServiceProvider());
|
||||
$this->register(new ContentNegotiationServiceProvider());
|
||||
|
||||
$this->register(new LocaleServiceProvider());
|
||||
$this->setupEventDispatcher();
|
||||
$this['phraseanet.exception_handler'] = $this->share(function ($app) {
|
||||
$handler = PhraseaExceptionHandler::register($app['debug']);
|
||||
$handler->setTranslator($app['translator']);
|
||||
|
||||
return $handler;
|
||||
});
|
||||
|
||||
$this['swiftmailer.transport'] = $this->share(function ($app) {
|
||||
if ($app['conf']->get(['registry', 'email', 'smtp-enabled'])) {
|
||||
$transport = new \Swift_Transport_EsmtpTransport(
|
||||
$app['swiftmailer.transport.buffer'],
|
||||
[$app['swiftmailer.transport.authhandler']],
|
||||
$app['swiftmailer.transport.eventdispatcher']
|
||||
);
|
||||
|
||||
$encryption = null;
|
||||
|
||||
if (in_array($app['conf']->get(['registry', 'email', 'smtp-secure-mode']), ['ssl', 'tls'])) {
|
||||
$encryption = $app['conf']->get(['registry', 'email', 'smtp-secure-mode']);
|
||||
}
|
||||
|
||||
$options = $app['swiftmailer.options'] = array_replace([
|
||||
'host' => $app['conf']->get(['registry', 'email', 'smtp-host']),
|
||||
'port' => $app['conf']->get(['registry', 'email', 'smtp-port']),
|
||||
'username' => $app['conf']->get(['registry', 'email', 'smtp-user']),
|
||||
'password' => $app['conf']->get(['registry', 'email', 'smtp-password']),
|
||||
'encryption' => $encryption,
|
||||
'auth_mode' => null,
|
||||
], $app['swiftmailer.options']);
|
||||
|
||||
$transport->setHost($options['host']);
|
||||
$transport->setPort($options['port']);
|
||||
// tls or ssl
|
||||
$transport->setEncryption($options['encryption']);
|
||||
|
||||
if ($app['conf']->get(['registry', 'email', 'smtp-auth-enabled'])) {
|
||||
$transport->setUsername($options['username']);
|
||||
$transport->setPassword($options['password']);
|
||||
$transport->setAuthMode($options['auth_mode']);
|
||||
}
|
||||
} else {
|
||||
$transport = new \Swift_Transport_MailTransport(
|
||||
new \Swift_Transport_SimpleMailInvoker(),
|
||||
$app['swiftmailer.transport.eventdispatcher']
|
||||
);
|
||||
}
|
||||
|
||||
return $transport;
|
||||
});
|
||||
|
||||
$this['imagine.factory'] = $this->share(function (Application $app) {
|
||||
if ($app['conf']->get(['registry', 'executables', 'imagine-driver']) != '') {
|
||||
return $app['conf']->get(['registry', 'executables', 'imagine-driver']);
|
||||
}
|
||||
if (class_exists('\Gmagick')) {
|
||||
return 'gmagick';
|
||||
}
|
||||
if (class_exists('\Imagick')) {
|
||||
return 'imagick';
|
||||
}
|
||||
if (extension_loaded('gd')) {
|
||||
return 'gd';
|
||||
}
|
||||
|
||||
throw new \RuntimeException('No Imagine driver available');
|
||||
});
|
||||
|
||||
$app = $this;
|
||||
$this['phraseanet.logger'] = $this->protect(function ($databox) use ($app) {
|
||||
try {
|
||||
return \Session_Logger::load($app, $databox);
|
||||
} catch (\Exception_Session_LoggerNotFound $e) {
|
||||
return \Session_Logger::create($app, $databox, $app['browser']);
|
||||
}
|
||||
});
|
||||
|
||||
$this['date-formatter'] = $this->share(function (Application $app) {
|
||||
return new \phraseadate($app);
|
||||
});
|
||||
|
||||
$this['xpdf.pdftotext'] = $this->share(
|
||||
$this->extend('xpdf.pdftotext', function (PdfToText $pdftotext, Application $app) {
|
||||
if ($app['conf']->get(['registry', 'executables', 'pdf-max-pages'])) {
|
||||
$pdftotext->setPageQuantity($app['conf']->get(['registry', 'executables', 'pdf-max-pages']));
|
||||
}
|
||||
|
||||
return $pdftotext;
|
||||
})
|
||||
);
|
||||
|
||||
$this['dispatcher'] = $this->share(
|
||||
$this->extend('dispatcher', function ($dispatcher, Application $app) {
|
||||
$dispatcher->addListener(KernelEvents::RESPONSE, [$app, 'addUTF8Charset'], -128);
|
||||
$dispatcher->addSubscriber($app['phraseanet.logout-subscriber']);
|
||||
$dispatcher->addSubscriber($app['phraseanet.locale-subscriber']);
|
||||
$dispatcher->addSubscriber($app['phraseanet.content-negotiation-subscriber']);
|
||||
$dispatcher->addSubscriber($app['phraseanet.maintenance-subscriber']);
|
||||
$dispatcher->addSubscriber($app['phraseanet.cookie-disabler-subscriber']);
|
||||
$dispatcher->addSubscriber($app['phraseanet.session-manager-subscriber']);
|
||||
$dispatcher->addSubscriber(new PhraseaInstallSubscriber($app));
|
||||
$dispatcher->addSubscriber(new FeedEntrySubscriber($app));
|
||||
$dispatcher->addSubscriber(new RegistrationSubscriber($app));
|
||||
$dispatcher->addSubscriber(new BridgeSubscriber($app));
|
||||
$dispatcher->addSubscriber(new ExportSubscriber($app));
|
||||
$dispatcher->addSubscriber(new OrderSubscriber($app));
|
||||
$dispatcher->addSubscriber(new BasketSubscriber($app));
|
||||
$dispatcher->addSubscriber(new LazaretSubscriber($app));
|
||||
$dispatcher->addSubscriber(new ValidationSubscriber($app));
|
||||
|
||||
return $dispatcher;
|
||||
})
|
||||
);
|
||||
|
||||
$this['log.channels'] = ['monolog', 'task-manager.logger'];
|
||||
|
||||
$this->register(new LocaleServiceProvider());
|
||||
|
||||
$this->mount('/include/minify/', new Minifier());
|
||||
$this->mount('/permalink/', new Permalink());
|
||||
$this->mount('/lightbox/', new Lightbox());
|
||||
|
||||
$app['plugins.directory'] = $app->share(function () {
|
||||
$dir = __DIR__ . '/../../../plugins';
|
||||
|
||||
if (is_dir($dir)) {
|
||||
return realpath($dir);
|
||||
}
|
||||
|
||||
return $dir;
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -526,7 +328,7 @@ class Application extends SilexApplication
|
||||
public function loadPlugins()
|
||||
{
|
||||
call_user_func(function ($app) {
|
||||
require $app['plugins.directory'] . '/services.php';
|
||||
require $app['plugin.path'] . '/services.php';
|
||||
}, $this);
|
||||
}
|
||||
|
||||
@@ -575,40 +377,13 @@ class Application extends SilexApplication
|
||||
return $this->redirect($this->url($route, $parameters));
|
||||
}
|
||||
|
||||
public function addUTF8Charset(FilterResponseEvent $event)
|
||||
{
|
||||
if (HttpKernelInterface::MASTER_REQUEST !== $event->getRequestType()) {
|
||||
return;
|
||||
}
|
||||
|
||||
$event->getResponse()->setCharset('UTF-8');
|
||||
}
|
||||
|
||||
private function setupUrlGenerator()
|
||||
{
|
||||
$this['url_generator'] = $this->share($this->extend('url_generator', function ($urlGenerator, $app) {
|
||||
if ($app['configuration.store']->isSetup()) {
|
||||
$data = parse_url($app['conf']->get('servername'));
|
||||
|
||||
if (isset($data['scheme'])) {
|
||||
$urlGenerator->getContext()->setScheme($data['scheme']);
|
||||
}
|
||||
if (isset($data['host'])) {
|
||||
$urlGenerator->getContext()->setHost($data['host']);
|
||||
}
|
||||
}
|
||||
|
||||
return $urlGenerator;
|
||||
}));
|
||||
}
|
||||
|
||||
public function setupTwig()
|
||||
{
|
||||
$this['twig'] = $this->share(
|
||||
$this->extend('twig', function ($twig, $app) {
|
||||
$twig->setCache($app['cache.path'].'/twig');
|
||||
|
||||
$paths = require $app['plugins.directory'] . '/twig-paths.php';
|
||||
$paths = require $app['plugin.path'] . '/twig-paths.php';
|
||||
|
||||
if ($app['browser']->isTablet() || $app['browser']->isMobile()) {
|
||||
$paths[] = $app['root.path'] . '/config/templates/mobile';
|
||||
@@ -832,6 +607,9 @@ class Application extends SilexApplication
|
||||
return [];
|
||||
}
|
||||
|
||||
/**
|
||||
* Mount all controllers
|
||||
*/
|
||||
public function bindRoutes()
|
||||
{
|
||||
$this->mount('/', new Root());
|
||||
@@ -898,6 +676,11 @@ class Application extends SilexApplication
|
||||
|
||||
$this->mount('/thesaurus', new Thesaurus());
|
||||
$this->mount('/xmlhttp', new ThesaurusXMLHttp());
|
||||
|
||||
$this->mount('/include/minify/', new Minifier());
|
||||
$this->mount('/permalink/', new Permalink());
|
||||
|
||||
$this->mount('/lightbox/', new Lightbox());
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -920,38 +703,44 @@ class Application extends SilexApplication
|
||||
return static::$flashTypes;
|
||||
}
|
||||
|
||||
private function setupApplicationPaths(Application $app)
|
||||
private function setupApplicationPaths()
|
||||
{
|
||||
// app root path
|
||||
$this['root.path'] = realpath(__DIR__ . '/../../..');
|
||||
// temporary resources default path such as download zip, quarantined documents etc ..
|
||||
$this['tmp.path'] = $this['root.path'].'/tmp';
|
||||
// plugin path
|
||||
$this['plugin.path'] = $dir = $this['root.path'].'/plugins';
|
||||
// thumbnails path
|
||||
$this['thumbnail.path'] = $dir = $this['root.path'].'/www/thumbnails';
|
||||
|
||||
// cache path for dev env
|
||||
$this['cache.dev.path'] = $app->share(function() use ($app) {
|
||||
$path = sys_get_temp_dir().'/'.md5($app['root.path']);
|
||||
$this['cache.dev.path'] = $this->share(function() {
|
||||
$path = sys_get_temp_dir().'/'.md5($this['root.path']);
|
||||
// ensure path is created
|
||||
$app['filesystem']->mkdir($path);
|
||||
$this['filesystem']->mkdir($path);
|
||||
|
||||
return $path;
|
||||
});
|
||||
|
||||
// cache path (twig, minify, translations, configuration, doctrine metas serializer metas, profiler etc ...)
|
||||
$this['cache.path'] = $app->share(function() use ($app) {
|
||||
// if ($app->getEnvironment() !== Application::ENV_PROD) {
|
||||
$this['cache.path'] = $this->share(function() {
|
||||
// if ($this->getEnvironment() !== Application::ENV_PROD) {
|
||||
// return $this['cache.dev.path'];
|
||||
// }
|
||||
$path = $app['root.path'].'/cache';
|
||||
if ($app['phraseanet.configuration']->isSetup()) {
|
||||
$path = $app['conf']->get(['main', 'storage', 'cache'], $path);
|
||||
$defaultPath = $path = $this['root.path'].'/cache';
|
||||
if ($this['phraseanet.configuration']->isSetup()) {
|
||||
$path = $this['conf']->get(['main', 'storage', 'cache'], $path);
|
||||
}
|
||||
$path = $path ?: $defaultPath;
|
||||
|
||||
// ensure path is created
|
||||
$app['filesystem']->mkdir($path);
|
||||
$this['filesystem']->mkdir($path);
|
||||
|
||||
return $path;
|
||||
});
|
||||
|
||||
$app['cache.paths'] = $app->share(function() use ($app) {
|
||||
$this['cache.paths'] = $this->share(function() {
|
||||
return array(
|
||||
self::ENV_DEV => $this['cache.path'],
|
||||
self::ENV_TEST => $this['cache.path'],
|
||||
@@ -960,51 +749,357 @@ class Application extends SilexApplication
|
||||
});
|
||||
|
||||
// log path
|
||||
$this['log.path'] = $app->share(function() use ($app) {
|
||||
$path = $this['root.path'].'/logs';
|
||||
if ($app['phraseanet.configuration']->isSetup()) {
|
||||
return $app['conf']->get(['main', 'storage', 'log'], $path);
|
||||
$this['log.path'] = $this->share(function() {
|
||||
$defaultPath = $path = $this['root.path'].'/logs';
|
||||
if ($this['phraseanet.configuration']->isSetup()) {
|
||||
return $this['conf']->get(['main', 'storage', 'log'], $path);
|
||||
}
|
||||
$path = $path ?: $defaultPath;
|
||||
|
||||
// ensure path is created
|
||||
$app['filesystem']->mkdir($path);
|
||||
$this['filesystem']->mkdir($path);
|
||||
|
||||
return $path;
|
||||
});
|
||||
|
||||
// temporary download file path (zip file)
|
||||
$this['tmp.download.path'] = $app->share(function() use ($app) {
|
||||
$path = $this['tmp.path'].'/download';
|
||||
if ($app['phraseanet.configuration']->isSetup()) {
|
||||
return $app['conf']->get(['main', 'storage', 'download'], $path);
|
||||
$this['tmp.download.path'] = $this->share(function() {
|
||||
$defaultPath = $path = $this['tmp.path'].'/download';
|
||||
if ($this['phraseanet.configuration']->isSetup()) {
|
||||
return $this['conf']->get(['main', 'storage', 'download'], $path);
|
||||
}
|
||||
$path = $path ?: $defaultPath;
|
||||
|
||||
// ensure path is created
|
||||
$app['filesystem']->mkdir($path);
|
||||
$this['filesystem']->mkdir($path);
|
||||
|
||||
return $path;
|
||||
});
|
||||
|
||||
// quarantined file path
|
||||
$this['tmp.lazaret.path'] = $app->share(function() use ($app) {
|
||||
$path = $this['tmp.path'].'/lazaret';
|
||||
if ($app['phraseanet.configuration']->isSetup()) {
|
||||
return $app['conf']->get(['main', 'storage', 'quarantine'], $path);
|
||||
$this['tmp.lazaret.path'] = $this->share(function() {
|
||||
$defaultPath = $path = $this['tmp.path'].'/lazaret';
|
||||
if ($this['phraseanet.configuration']->isSetup()) {
|
||||
return $this['conf']->get(['main', 'storage', 'quarantine'], $path);
|
||||
}
|
||||
$path = $path ?: $defaultPath;
|
||||
|
||||
// ensure path is created
|
||||
$app['filesystem']->mkdir($path);
|
||||
$this['filesystem']->mkdir($path);
|
||||
|
||||
return $path;
|
||||
});
|
||||
|
||||
// document caption file path
|
||||
$this['tmp.caption.path'] = $app->share(function() use ($app) {
|
||||
$path = $this['tmp.path'].'/caption';
|
||||
if ($app['phraseanet.configuration']->isSetup()) {
|
||||
return $app['conf']->get(['main', 'storage', 'caption'], $path);
|
||||
$this['tmp.caption.path'] = $this->share(function() {
|
||||
$defaultPath = $path = $this['tmp.path'].'/caption';
|
||||
if ($this['phraseanet.configuration']->isSetup()) {
|
||||
return $this['conf']->get(['main', 'storage', 'caption'], $path);
|
||||
}
|
||||
$path = $path ?: $defaultPath;
|
||||
|
||||
// ensure path is created
|
||||
$app['filesystem']->mkdir($path);
|
||||
$this['filesystem']->mkdir($path);
|
||||
|
||||
return $path;
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
private function setupXpdf()
|
||||
{
|
||||
$this['xpdf.pdftotext'] = $this->share(
|
||||
$this->extend('xpdf.pdftotext', function (PdfToText $pdftotext, Application $app) {
|
||||
if ($app['conf']->get(['registry', 'executables', 'pdf-max-pages'])) {
|
||||
$pdftotext->setPageQuantity($app['conf']->get(['registry', 'executables', 'pdf-max-pages']));
|
||||
}
|
||||
|
||||
return $pdftotext;
|
||||
})
|
||||
);
|
||||
}
|
||||
|
||||
private function setupForm()
|
||||
{
|
||||
$this['form.type.extensions'] = $this->share($this->extend('form.type.extensions', function ($extensions, Application $app) {
|
||||
$extensions[] = new HelpTypeExtension();
|
||||
|
||||
return $extensions;
|
||||
}));
|
||||
}
|
||||
|
||||
private function setUpImagine()
|
||||
{
|
||||
$this['imagine.factory'] = $this->share(function (Application $app) {
|
||||
if ($app['conf']->get(['registry', 'executables', 'imagine-driver']) != '') {
|
||||
return $app['conf']->get(['registry', 'executables', 'imagine-driver']);
|
||||
}
|
||||
if (class_exists('\Gmagick')) {
|
||||
return 'gmagick';
|
||||
}
|
||||
if (class_exists('\Imagick')) {
|
||||
return 'imagick';
|
||||
}
|
||||
if (extension_loaded('gd')) {
|
||||
return 'gd';
|
||||
}
|
||||
|
||||
throw new \RuntimeException('No Imagine driver available');
|
||||
});
|
||||
}
|
||||
|
||||
private function setupTranslation()
|
||||
{
|
||||
$this['translator'] = $this->share($this->extend('translator', function (CachedTranslator $translator, Application $app) {
|
||||
$translator->addResource('xlf', __DIR__.'/../../../resources/locales/messages.fr.xlf', 'fr', 'messages');
|
||||
$translator->addResource('xlf', __DIR__.'/../../../resources/locales/validators.fr.xlf', 'fr', 'validators');
|
||||
$translator->addResource('xlf', __DIR__.'/../../../resources/locales/messages.en.xlf', 'en', 'messages');
|
||||
$translator->addResource('xlf', __DIR__.'/../../../resources/locales/validators.en.xlf', 'en', 'validators');
|
||||
$translator->addResource('xlf', __DIR__.'/../../../resources/locales/messages.de.xlf', 'de', 'messages');
|
||||
$translator->addResource('xlf', __DIR__.'/../../../resources/locales/validators.de.xlf', 'de', 'validators');
|
||||
$translator->addResource('xlf', __DIR__.'/../../../resources/locales/messages.nl.xlf', 'nl', 'messages');
|
||||
$translator->addResource('xlf', __DIR__.'/../../../resources/locales/validators.nl.xlf', 'nl', 'validators');
|
||||
|
||||
return $translator;
|
||||
}));
|
||||
}
|
||||
|
||||
private function setupOrms()
|
||||
{
|
||||
$this['orm.ems'] = $this->share($this->extend('orm.ems', function ($ems, $app) {
|
||||
GedmoExtension::registerAnnotations();
|
||||
|
||||
foreach ($ems->keys() as $key) {
|
||||
$app['orm.annotation.register']($key);
|
||||
$connection = $ems[$key]->getConnection();
|
||||
|
||||
$app['connection.pool.manager']->add($connection);
|
||||
|
||||
$types = $app['orm.ems.options'][$key]['types'];
|
||||
$app['dbal.type.register']($connection, $types);
|
||||
}
|
||||
|
||||
return $ems;
|
||||
}));
|
||||
}
|
||||
|
||||
private function setupSession()
|
||||
{
|
||||
$this['session.storage.test'] = $this->share(function (Application $app) {
|
||||
return new MockArraySessionStorage();
|
||||
});
|
||||
|
||||
$this['session.storage.handler'] = $this->share(function (Application $app) {
|
||||
if (!$this['phraseanet.configuration-tester']->isInstalled()) {
|
||||
return new NullSessionHandler();
|
||||
}
|
||||
return $this['session.storage.handler.factory']->create($app['conf']);
|
||||
});
|
||||
}
|
||||
private function setupRecaptacha()
|
||||
{
|
||||
$this['recaptcha.public-key'] = $this->share(function (Application $app) {
|
||||
if ($app['conf']->get(['registry', 'webservices', 'captcha-enabled'])) {
|
||||
return $app['conf']->get(['registry', 'webservices', 'recaptcha-public-key']);
|
||||
}
|
||||
});
|
||||
$this['recaptcha.private-key'] = $this->share(function (Application $app) {
|
||||
if ($app['conf']->get(['registry', 'webservices', 'captcha-enabled'])) {
|
||||
return $app['conf']->get(['registry', 'webservices', 'recaptcha-private-key']);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private function setupGeonames()
|
||||
{
|
||||
$this['geonames.server-uri'] = $this->share(function (Application $app) {
|
||||
|
||||
return $app['conf']->get(['registry', 'webservices', 'geonames-server'], 'http://geonames.alchemyasp.com/');
|
||||
});
|
||||
}
|
||||
|
||||
private function setupDBAL()
|
||||
{
|
||||
$this['dbs.config'] = $this->share($this->extend('dbs.config', function ($configs, $app) {
|
||||
if ($app->getEnvironment() !== self::ENV_DEV) {
|
||||
return $configs;
|
||||
}
|
||||
|
||||
foreach($configs->keys() as $service) {
|
||||
$app['dbal.config.register.loggers']($configs[$service]);
|
||||
}
|
||||
|
||||
return $configs;
|
||||
}));
|
||||
|
||||
$this['dbs.event_manager'] = $this->share($this->extend('dbs.event_manager', function ($eventManagers, $app) {
|
||||
foreach ($eventManagers->keys() as $name) {
|
||||
$app['dbal.evm.register.listeners']($eventManagers[$name]);
|
||||
}
|
||||
|
||||
return $eventManagers;
|
||||
}));
|
||||
}
|
||||
|
||||
private function setupMediaAlchemyst()
|
||||
{
|
||||
$this['media-alchemyst.configuration'] = $this->share(function (Application $app) {
|
||||
$configuration = [];
|
||||
|
||||
foreach ([
|
||||
'swftools.pdf2swf.binaries' => 'pdf2swf_binary',
|
||||
'swftools.swfrender.binaries' => 'swf_render_binary',
|
||||
'swftools.swfextract.binaries' => 'swf_extract_binary',
|
||||
'unoconv.binaries' => 'unoconv_binary',
|
||||
'mp4box.binaries' => 'mp4box_binary',
|
||||
'gs.binaries' => 'ghostscript_binary',
|
||||
'ffmpeg.ffmpeg.binaries' => 'ffmpeg_binary',
|
||||
'ffmpeg.ffprobe.binaries' => 'ffprobe_binary',
|
||||
'ffmpeg.ffmpeg.timeout' => 'ffmpeg_timeout',
|
||||
'ffmpeg.ffprobe.timeout' => 'ffprobe_timeout',
|
||||
'gs.timeout' => 'gs_timeout',
|
||||
'mp4box.timeout' => 'mp4box_timeout',
|
||||
'swftools.timeout' => 'swftools_timeout',
|
||||
'unoconv.timeout' => 'unoconv_timeout',
|
||||
] as $parameter => $key) {
|
||||
if ($this['conf']->has(['main', 'binaries', $key])) {
|
||||
$configuration[$parameter] = $this['conf']->get(['main', 'binaries', $key]);
|
||||
}
|
||||
}
|
||||
|
||||
$configuration['ffmpeg.threads'] = $app['conf']->get(['registry', 'executables', 'ffmpeg-threads']) ?: null;
|
||||
$configuration['imagine.driver'] = $app['conf']->get(['registry', 'executables', 'imagine-driver']) ?: null;
|
||||
|
||||
return $configuration;
|
||||
});
|
||||
$this['media-alchemyst.logger'] = $this->share(function (Application $app) {
|
||||
return $app['monolog'];
|
||||
});
|
||||
}
|
||||
|
||||
private function setupUrlGenerator()
|
||||
{
|
||||
$this['url_generator'] = $this->share($this->extend('url_generator', function ($urlGenerator, Application $app) {
|
||||
if ($app['configuration.store']->isSetup()) {
|
||||
$data = parse_url($app['conf']->get('servername'));
|
||||
|
||||
if (isset($data['scheme'])) {
|
||||
$urlGenerator->getContext()->setScheme($data['scheme']);
|
||||
}
|
||||
if (isset($data['host'])) {
|
||||
$urlGenerator->getContext()->setHost($data['host']);
|
||||
}
|
||||
}
|
||||
|
||||
return $urlGenerator;
|
||||
}));
|
||||
}
|
||||
|
||||
private function setupSwiftMailer()
|
||||
{
|
||||
$this['swiftmailer.transport'] = $this->share(function (Application $app) {
|
||||
if ($app['conf']->get(['registry', 'email', 'smtp-enabled'])) {
|
||||
$transport = new \Swift_Transport_EsmtpTransport(
|
||||
$app['swiftmailer.transport.buffer'],
|
||||
[$app['swiftmailer.transport.authhandler']],
|
||||
$app['swiftmailer.transport.eventdispatcher']
|
||||
);
|
||||
|
||||
$encryption = null;
|
||||
|
||||
if (in_array($app['conf']->get(['registry', 'email', 'smtp-secure-mode']), ['ssl', 'tls'])) {
|
||||
$encryption = $app['conf']->get(['registry', 'email', 'smtp-secure-mode']);
|
||||
}
|
||||
|
||||
$options = $app['swiftmailer.options'] = array_replace([
|
||||
'host' => $app['conf']->get(['registry', 'email', 'smtp-host']),
|
||||
'port' => $app['conf']->get(['registry', 'email', 'smtp-port']),
|
||||
'username' => $app['conf']->get(['registry', 'email', 'smtp-user']),
|
||||
'password' => $app['conf']->get(['registry', 'email', 'smtp-password']),
|
||||
'encryption' => $encryption,
|
||||
'auth_mode' => null,
|
||||
], $app['swiftmailer.options']);
|
||||
|
||||
$transport->setHost($options['host']);
|
||||
$transport->setPort($options['port']);
|
||||
// tls or ssl
|
||||
$transport->setEncryption($options['encryption']);
|
||||
|
||||
if ($app['conf']->get(['registry', 'email', 'smtp-auth-enabled'])) {
|
||||
$transport->setUsername($options['username']);
|
||||
$transport->setPassword($options['password']);
|
||||
$transport->setAuthMode($options['auth_mode']);
|
||||
}
|
||||
} else {
|
||||
$transport = new \Swift_Transport_MailTransport(
|
||||
new \Swift_Transport_SimpleMailInvoker(),
|
||||
$app['swiftmailer.transport.eventdispatcher']
|
||||
);
|
||||
}
|
||||
|
||||
return $transport;
|
||||
});
|
||||
}
|
||||
|
||||
private function setupMonolog()
|
||||
{
|
||||
$this['monolog.name'] = 'phraseanet';
|
||||
$this['monolog.handler'] = $this->share(function () {
|
||||
return new NullHandler();
|
||||
});
|
||||
$this['monolog'] = $this->share($this->extend('monolog', function (Logger $logger) {
|
||||
$logger->pushProcessor(new IntrospectionProcessor());
|
||||
|
||||
return $logger;
|
||||
}));
|
||||
}
|
||||
|
||||
private function setupEventDispatcher()
|
||||
{
|
||||
$this['dispatcher'] = $this->share(
|
||||
$this->extend('dispatcher', function ($dispatcher, Application $app) {
|
||||
//$dispatcher->addListener(KernelEvents::RESPONSE, [$app, 'addUTF8Charset'], -128);
|
||||
$dispatcher->addSubscriber($app['phraseanet.logout-subscriber']);
|
||||
$dispatcher->addSubscriber($app['phraseanet.locale-subscriber']);
|
||||
$dispatcher->addSubscriber($app['phraseanet.content-negotiation-subscriber']);
|
||||
$dispatcher->addSubscriber($app['phraseanet.maintenance-subscriber']);
|
||||
$dispatcher->addSubscriber($app['phraseanet.cookie-disabler-subscriber']);
|
||||
$dispatcher->addSubscriber($app['phraseanet.session-manager-subscriber']);
|
||||
$dispatcher->addSubscriber($app['phraseanet.record-edit-subscriber']);
|
||||
$dispatcher->addSubscriber(new PhraseaInstallSubscriber($app));
|
||||
$dispatcher->addSubscriber(new FeedEntrySubscriber($app));
|
||||
$dispatcher->addSubscriber(new RegistrationSubscriber($app));
|
||||
$dispatcher->addSubscriber(new BridgeSubscriber($app));
|
||||
$dispatcher->addSubscriber(new ExportSubscriber($app));
|
||||
$dispatcher->addSubscriber(new OrderSubscriber($app));
|
||||
$dispatcher->addSubscriber(new BasketSubscriber($app));
|
||||
$dispatcher->addSubscriber(new LazaretSubscriber($app));
|
||||
$dispatcher->addSubscriber(new ValidationSubscriber($app));
|
||||
|
||||
return $dispatcher;
|
||||
})
|
||||
);
|
||||
}
|
||||
|
||||
private function setupConstants()
|
||||
{
|
||||
if (!defined('JETON_MAKE_SUBDEF')) {
|
||||
define('JETON_MAKE_SUBDEF', 0x01);
|
||||
}
|
||||
if (!defined('JETON_WRITE_META_DOC')) {
|
||||
define('JETON_WRITE_META_DOC', 0x02);
|
||||
}
|
||||
if (!defined('JETON_WRITE_META_SUBDEF')) {
|
||||
define('JETON_WRITE_META_SUBDEF', 0x04);
|
||||
}
|
||||
if (!defined('JETON_WRITE_META')) {
|
||||
define('JETON_WRITE_META', 0x06);
|
||||
}
|
||||
}
|
||||
|
||||
private function setupCharset()
|
||||
{
|
||||
$this['charset'] = 'UTF-8';
|
||||
mb_internal_encoding($this['charset']);
|
||||
}
|
||||
}
|
||||
|
@@ -3,7 +3,7 @@
|
||||
/*
|
||||
* This file is part of Phraseanet
|
||||
*
|
||||
* (c) 2005-2014 Alchemy
|
||||
* (c) 2005-2015 Alchemy
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
@@ -12,6 +12,9 @@
|
||||
namespace Alchemy\Phrasea\Application;
|
||||
|
||||
use Alchemy\Phrasea\Application as PhraseaApplication;
|
||||
use Alchemy\Phrasea\Controller\Minifier;
|
||||
use Alchemy\Phrasea\Controller\Permalink;
|
||||
use Alchemy\Phrasea\Controller\Datafiles;
|
||||
use Alchemy\Phrasea\Core\Event\Subscriber\ApiCorsSubscriber;
|
||||
use Alchemy\Phrasea\Core\PhraseaEvents;
|
||||
use Alchemy\Phrasea\Controller\Api\Oauth2;
|
||||
@@ -51,7 +54,7 @@ return call_user_func(function ($environment = PhraseaApplication::ENV_PROD) {
|
||||
$priorities = array('application/json', 'application/yaml', 'text/yaml', 'text/javascript', 'application/javascript');
|
||||
foreach (V1::$extendedContentTypes['json'] as $priorities[]);
|
||||
foreach (V1::$extendedContentTypes['yaml'] as $priorities[]);
|
||||
$format = $app['format.negociator']->getBest($request->headers->get('accept') ,$priorities);
|
||||
$format = $app['format.negociator']->getBest($request->headers->get('accept', 'application/json') ,$priorities);
|
||||
|
||||
// throw unacceptable http error if API can not handle asked format
|
||||
if (null === $format) {
|
||||
@@ -107,7 +110,10 @@ return call_user_func(function ($environment = PhraseaApplication::ENV_PROD) {
|
||||
});
|
||||
|
||||
$app->mount('/api/oauthv2', new Oauth2());
|
||||
$app->mount('/datafiles/', new Datafiles());
|
||||
$app->mount('/api/v1', new V1());
|
||||
$app->mount('/permalink/', new Permalink());
|
||||
$app->mount('/include/minify/', new Minifier());
|
||||
|
||||
$app['dispatcher'] = $app->share($app->extend('dispatcher', function ($dispatcher, PhraseaApplication $app) {
|
||||
$dispatcher->addSubscriber(new ApiOauth2ErrorsSubscriber($app['phraseanet.exception_handler'], $app['translator']));
|
||||
|
@@ -3,7 +3,7 @@
|
||||
/*
|
||||
* This file is part of Phraseanet
|
||||
*
|
||||
* (c) 2005-2014 Alchemy
|
||||
* (c) 2005-2015 Alchemy
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
@@ -68,7 +68,7 @@ return call_user_func(function ($environment = PhraseaApplication::ENV_PROD) {
|
||||
if ($app['phraseanet.configuration-tester']->isInstalled()) {
|
||||
$app->register(new DoctrineProfilerServiceProvider());
|
||||
$app['db'] = $app->share(function (PhraseaApplication $app) {
|
||||
return $app['EM']->getConnection();
|
||||
return $app['orm.em']->getConnection();
|
||||
});
|
||||
}
|
||||
}
|
||||
|
@@ -3,7 +3,7 @@
|
||||
/*
|
||||
* This file is part of Phraseanet
|
||||
*
|
||||
* (c) 2005-2014 Alchemy
|
||||
* (c) 2005-2015 Alchemy
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
|
@@ -3,7 +3,7 @@
|
||||
/*
|
||||
* This file is part of Phraseanet
|
||||
*
|
||||
* (c) 2005-2014 Alchemy
|
||||
* (c) 2005-2015 Alchemy
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
|
@@ -3,7 +3,7 @@
|
||||
/*
|
||||
* This file is part of Phraseanet
|
||||
*
|
||||
* (c) 2005-2014 Alchemy
|
||||
* (c) 2005-2015 Alchemy
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
|
@@ -3,7 +3,7 @@
|
||||
/*
|
||||
* This file is part of Phraseanet
|
||||
*
|
||||
* (c) 2005-2014 Alchemy
|
||||
* (c) 2005-2015 Alchemy
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
|
@@ -3,7 +3,7 @@
|
||||
/*
|
||||
* This file is part of Phraseanet
|
||||
*
|
||||
* (c) 2005-2014 Alchemy
|
||||
* (c) 2005-2015 Alchemy
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
|
@@ -3,7 +3,7 @@
|
||||
/*
|
||||
* This file is part of Phraseanet
|
||||
*
|
||||
* (c) 2005-2014 Alchemy
|
||||
* (c) 2005-2015 Alchemy
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
|
@@ -3,7 +3,7 @@
|
||||
/*
|
||||
* This file is part of Phraseanet
|
||||
*
|
||||
* (c) 2005-2014 Alchemy
|
||||
* (c) 2005-2015 Alchemy
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
|
@@ -3,7 +3,7 @@
|
||||
/*
|
||||
* This file is part of Phraseanet
|
||||
*
|
||||
* (c) 2005-2014 Alchemy
|
||||
* (c) 2005-2015 Alchemy
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
|
@@ -3,7 +3,7 @@
|
||||
/*
|
||||
* This file is part of Phraseanet
|
||||
*
|
||||
* (c) 2005-2014 Alchemy
|
||||
* (c) 2005-2015 Alchemy
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
|
@@ -3,7 +3,7 @@
|
||||
/*
|
||||
* This file is part of Phraseanet
|
||||
*
|
||||
* (c) 2005-2014 Alchemy
|
||||
* (c) 2005-2015 Alchemy
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
|
@@ -3,7 +3,7 @@
|
||||
/*
|
||||
* This file is part of Phraseanet
|
||||
*
|
||||
* (c) 2005-2014 Alchemy
|
||||
* (c) 2005-2015 Alchemy
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
|
@@ -3,7 +3,7 @@
|
||||
/*
|
||||
* This file is part of Phraseanet
|
||||
*
|
||||
* (c) 2005-2014 Alchemy
|
||||
* (c) 2005-2015 Alchemy
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
|
@@ -3,7 +3,7 @@
|
||||
/*
|
||||
* This file is part of Phraseanet
|
||||
*
|
||||
* (c) 2005-2014 Alchemy
|
||||
* (c) 2005-2015 Alchemy
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
|
@@ -3,7 +3,7 @@
|
||||
/*
|
||||
* This file is part of Phraseanet
|
||||
*
|
||||
* (c) 2005-2014 Alchemy
|
||||
* (c) 2005-2015 Alchemy
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
|
@@ -3,7 +3,7 @@
|
||||
/*
|
||||
* This file is part of Phraseanet
|
||||
*
|
||||
* (c) 2005-2014 Alchemy
|
||||
* (c) 2005-2015 Alchemy
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
|
@@ -3,7 +3,7 @@
|
||||
/*
|
||||
* This file is part of Phraseanet
|
||||
*
|
||||
* (c) 2005-2014 Alchemy
|
||||
* (c) 2005-2015 Alchemy
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
|
@@ -3,7 +3,7 @@
|
||||
/*
|
||||
* This file is part of Phraseanet
|
||||
*
|
||||
* (c) 2005-2014 Alchemy
|
||||
* (c) 2005-2015 Alchemy
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
|
@@ -3,7 +3,7 @@
|
||||
/*
|
||||
* This file is part of Phraseanet
|
||||
*
|
||||
* (c) 2005-2014 Alchemy
|
||||
* (c) 2005-2015 Alchemy
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
|
@@ -3,7 +3,7 @@
|
||||
/*
|
||||
* This file is part of Phraseanet
|
||||
*
|
||||
* (c) 2005-2014 Alchemy
|
||||
* (c) 2005-2015 Alchemy
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
|
@@ -3,7 +3,7 @@
|
||||
/*
|
||||
* This file is part of Phraseanet
|
||||
*
|
||||
* (c) 2005-2014 Alchemy
|
||||
* (c) 2005-2015 Alchemy
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
|
@@ -3,7 +3,7 @@
|
||||
/*
|
||||
* This file is part of Phraseanet
|
||||
*
|
||||
* (c) 2005-2014 Alchemy
|
||||
* (c) 2005-2015 Alchemy
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
|
@@ -3,7 +3,7 @@
|
||||
/*
|
||||
* This file is part of Phraseanet
|
||||
*
|
||||
* (c) 2005-2014 Alchemy
|
||||
* (c) 2005-2015 Alchemy
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
|
@@ -3,7 +3,7 @@
|
||||
/*
|
||||
* This file is part of Phraseanet
|
||||
*
|
||||
* (c) 2005-2014 Alchemy
|
||||
* (c) 2005-2015 Alchemy
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
|
@@ -3,7 +3,7 @@
|
||||
/*
|
||||
* This file is part of Phraseanet
|
||||
*
|
||||
* (c) 2005-2014 Alchemy
|
||||
* (c) 2005-2015 Alchemy
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
|
@@ -3,7 +3,7 @@
|
||||
/*
|
||||
* This file is part of Phraseanet
|
||||
*
|
||||
* (c) 2005-2014 Alchemy
|
||||
* (c) 2005-2015 Alchemy
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
|
@@ -3,7 +3,7 @@
|
||||
/*
|
||||
* This file is part of Phraseanet
|
||||
*
|
||||
* (c) 2005-2014 Alchemy
|
||||
* (c) 2005-2015 Alchemy
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user