debian/0002755000000000000000000000000012252640445007174 5ustar debian/typo3-dummy.templates0000644000000000000000000000343212252640275013324 0ustar # These templates have been reviewed by the debian-l10n-english # team # # If modifications/additions/rewording are needed, please ask # debian-l10n-english@lists.debian.org for advice. # # Even minor modifications require translation updates and such # changes should be coordinated with translators and reviewers. Template: typo3-dummy/apache_mode Type: select __Choices: vhost, directory, none Default: directory _Description: Apache integration mode: Please choose the method that should be used for integrating the TYPO3 installation with the apache2 web server: . vhost: generates URLs with TYPO3 as part of the domain name, such as http://typo3.example.com/; directory: fits TYPO3 within the existing site, making it available at an address like http://www.example.com/cms/; none: does not configure TYPO3 automatically. The server will need manual configuration. Choose this option if you are using a web server other than apache2. Template: typo3-dummy/apache_restart Type: boolean _Description: Should apache2 be restarted after installation? Apache's configuration has been changed to include TYPO3 and activate the rewrite module. For these changes to take effect, apache2 must be reloaded. Template: typo3-dummy/old_symlink Type: note _Description: Old symlink in /etc/apache2/conf.d/ Older versions (before 4.3.0-3) of typo3-dummy installed the apache2 configuration symlink as /etc/apache2/conf.d/typo3-dummy.conf. . This has been changed and newer versions place two new symlinks into /etc/apache2/sites-available/. To prevent failures due to overlapping configuration directives you should remove the symlink typo3-dummy.conf from /etc/apache2/conf.d/ and merge its contents into one of the new configuration files. debian/mysql/0002755000000000000000000000000012252640275010342 5ustar debian/mysql/mysql0000644000000000000000000014662612252640275011447 0ustar # # TYPO3 SVN ID: $Id: tables.sql 6525 2009-11-25 11:27:34Z steffenk $ # # # Table structure for table 'be_groups' # CREATE TABLE be_groups ( uid int(11) unsigned NOT NULL auto_increment, pid int(11) unsigned DEFAULT '0' NOT NULL, tstamp int(11) unsigned DEFAULT '0' NOT NULL, title varchar(50) DEFAULT '' NOT NULL, non_exclude_fields text, explicit_allowdeny text, allowed_languages varchar(255) DEFAULT '' NOT NULL, custom_options text, db_mountpoints varchar(255) DEFAULT '' NOT NULL, pagetypes_select varchar(255) DEFAULT '' NOT NULL, tables_select text, tables_modify text, crdate int(11) unsigned DEFAULT '0' NOT NULL, cruser_id int(11) unsigned DEFAULT '0' NOT NULL, groupMods text, file_mountpoints varchar(255) DEFAULT '' NOT NULL, fileoper_perms tinyint(4) DEFAULT '0' NOT NULL, hidden tinyint(1) unsigned DEFAULT '0' NOT NULL, inc_access_lists tinyint(3) unsigned DEFAULT '0' NOT NULL, description text, lockToDomain varchar(50) DEFAULT '' NOT NULL, deleted tinyint(1) unsigned DEFAULT '0' NOT NULL, TSconfig text, subgroup varchar(255) DEFAULT '' NOT NULL, hide_in_lists tinyint(4) DEFAULT '0' NOT NULL, workspace_perms tinyint(3) DEFAULT '1' NOT NULL, PRIMARY KEY (uid), KEY parent (pid) ); # # Table structure for table 'be_sessions' # CREATE TABLE be_sessions ( ses_id varchar(32) DEFAULT '' NOT NULL, ses_name varchar(32) DEFAULT '' NOT NULL, ses_iplock varchar(39) DEFAULT '' NOT NULL, ses_hashlock int(11) DEFAULT '0' NOT NULL, ses_userid int(11) unsigned DEFAULT '0' NOT NULL, ses_tstamp int(11) unsigned DEFAULT '0' NOT NULL, ses_data longtext, ses_backuserid int(11) NOT NULL default '0', PRIMARY KEY (ses_id,ses_name) ); # # Table structure for table 'be_users' # CREATE TABLE be_users ( uid int(11) unsigned NOT NULL auto_increment, pid int(11) unsigned DEFAULT '0' NOT NULL, tstamp int(11) unsigned DEFAULT '0' NOT NULL, username varchar(50) DEFAULT '' NOT NULL, password varchar(60) DEFAULT '' NOT NULL, admin tinyint(4) unsigned DEFAULT '0' NOT NULL, usergroup varchar(255) DEFAULT '' NOT NULL, disable tinyint(1) unsigned DEFAULT '0' NOT NULL, starttime int(11) unsigned DEFAULT '0' NOT NULL, endtime int(11) unsigned DEFAULT '0' NOT NULL, lang char(2) DEFAULT '' NOT NULL, email varchar(80) DEFAULT '' NOT NULL, db_mountpoints varchar(255) DEFAULT '' NOT NULL, options tinyint(4) unsigned DEFAULT '0' NOT NULL, crdate int(11) unsigned DEFAULT '0' NOT NULL, cruser_id int(11) unsigned DEFAULT '0' NOT NULL, realName varchar(80) DEFAULT '' NOT NULL, userMods varchar(255) DEFAULT '' NOT NULL, allowed_languages varchar(255) DEFAULT '' NOT NULL, uc text, file_mountpoints varchar(255) DEFAULT '' NOT NULL, fileoper_perms tinyint(4) DEFAULT '0' NOT NULL, workspace_perms tinyint(3) DEFAULT '1' NOT NULL, lockToDomain varchar(50) DEFAULT '' NOT NULL, disableIPlock tinyint(1) unsigned DEFAULT '0' NOT NULL, deleted tinyint(1) unsigned DEFAULT '0' NOT NULL, TSconfig text, lastlogin int(10) unsigned DEFAULT '0' NOT NULL, createdByAction int(11) DEFAULT '0' NOT NULL, usergroup_cached_list varchar(255) DEFAULT '' NOT NULL, workspace_id int(11) DEFAULT '0' NOT NULL, workspace_preview tinyint(3) DEFAULT '1' NOT NULL, tx_openid_openid varchar(255) DEFAULT '' NOT NULL, PRIMARY KEY (uid), KEY parent (pid), KEY username (username) ); # # Table structure for table 'cache_extensions' # CREATE TABLE cache_extensions ( extkey varchar(60) NOT NULL default '', version varchar(10) NOT NULL default '', alldownloadcounter int(11) unsigned NOT NULL default '0', downloadcounter int(11) unsigned NOT NULL default '0', title varchar(150) NOT NULL default '', description mediumtext, state int(4) NOT NULL default '0', reviewstate int(4) NOT NULL default '0', category int(4) NOT NULL default '0', lastuploaddate int(11) unsigned NOT NULL default '0', dependencies mediumtext, authorname varchar(100) NOT NULL default '', authoremail varchar(100) NOT NULL default '', ownerusername varchar(50) NOT NULL default '', t3xfilemd5 varchar(35) NOT NULL default '', uploadcomment mediumtext, authorcompany varchar(100) NOT NULL default '', intversion int(11) NOT NULL default '0', lastversion int(3) NOT NULL default '0', lastreviewedversion int(3) NOT NULL default '0', PRIMARY KEY (extkey,version) ); # # Table structure for table 'cache_hash' # CREATE TABLE cache_hash ( id int(11) unsigned NOT NULL auto_increment, hash varchar(32) DEFAULT '' NOT NULL, content mediumblob, tstamp int(11) unsigned DEFAULT '0' NOT NULL, ident varchar(32) DEFAULT '' NOT NULL, PRIMARY KEY (id), KEY hash (hash) ) ENGINE=InnoDB; # # Table structure for table 'cachingframework_cache_hash' # CREATE TABLE cachingframework_cache_hash ( id int(11) unsigned NOT NULL auto_increment, identifier varchar(128) DEFAULT '' NOT NULL, crdate int(11) unsigned DEFAULT '0' NOT NULL, content mediumtext, lifetime int(11) unsigned DEFAULT '0' NOT NULL, PRIMARY KEY (id), KEY cache_id (identifier) ) ENGINE=InnoDB; # # Table structure for table 'cachingframework_cache_hash_tags' # CREATE TABLE cachingframework_cache_hash_tags ( id int(11) unsigned NOT NULL auto_increment, identifier varchar(128) DEFAULT '' NOT NULL, tag varchar(128) DEFAULT '' NOT NULL, PRIMARY KEY (id), KEY cache_id (identifier), KEY cache_tag (tag) ) ENGINE=InnoDB; # # Table structure for table 'cache_imagesizes' # CREATE TABLE cache_imagesizes ( md5hash varchar(32) DEFAULT '' NOT NULL, md5filename varchar(32) DEFAULT '' NOT NULL, tstamp int(11) DEFAULT '0' NOT NULL, filename varchar(255) DEFAULT '' NOT NULL, imagewidth mediumint(11) unsigned DEFAULT '0' NOT NULL, imageheight mediumint(11) unsigned DEFAULT '0' NOT NULL, PRIMARY KEY (md5filename) ) ENGINE=InnoDB; # # Table structure for table 'sys_registry' # CREATE TABLE sys_registry ( uid int(11) unsigned NOT NULL auto_increment, entry_namespace varchar(128) DEFAULT '' NOT NULL, entry_key varchar(128) DEFAULT '' NOT NULL, entry_value blob, PRIMARY KEY (uid), UNIQUE KEY entry_identifier (entry_namespace,entry_key) ); # # Table structure for table 'sys_be_shortcuts' # CREATE TABLE sys_be_shortcuts ( uid int(11) unsigned NOT NULL auto_increment, userid int(11) unsigned DEFAULT '0' NOT NULL, module_name varchar(255) DEFAULT '' NOT NULL, url text, description varchar(255) DEFAULT '' NOT NULL, sorting int(11) DEFAULT '0' NOT NULL, sc_group tinyint(4) DEFAULT '0' NOT NULL, PRIMARY KEY (uid), KEY event (userid) ); # # Table structure for table 'sys_preview' # CREATE TABLE sys_preview ( keyword varchar(32) DEFAULT '' NOT NULL, tstamp int(11) DEFAULT '0' NOT NULL, endtime int(11) DEFAULT '0' NOT NULL, config text, PRIMARY KEY (keyword) ); # # Table structure for table 'sys_filemounts' # CREATE TABLE sys_filemounts ( uid int(11) unsigned NOT NULL auto_increment, pid int(11) unsigned DEFAULT '0' NOT NULL, tstamp int(11) unsigned DEFAULT '0' NOT NULL, title varchar(30) DEFAULT '' NOT NULL, path varchar(120) DEFAULT '' NOT NULL, base tinyint(4) unsigned DEFAULT '0' NOT NULL, hidden tinyint(3) unsigned DEFAULT '0' NOT NULL, deleted tinyint(1) unsigned DEFAULT '0' NOT NULL, PRIMARY KEY (uid), KEY parent (pid) ); # # Table structure for table 'sys_workspace' # CREATE TABLE sys_workspace ( uid int(11) NOT NULL auto_increment, pid int(11) DEFAULT '0' NOT NULL, tstamp int(11) DEFAULT '0' NOT NULL, deleted tinyint(1) DEFAULT '0' NOT NULL, title varchar(30) DEFAULT '' NOT NULL, description varchar(255) DEFAULT '' NOT NULL, adminusers varchar(255) DEFAULT '' NOT NULL, members text, reviewers text, db_mountpoints varchar(255) DEFAULT '' NOT NULL, file_mountpoints varchar(255) DEFAULT '' NOT NULL, publish_time int(11) DEFAULT '0' NOT NULL, unpublish_time int(11) DEFAULT '0' NOT NULL, freeze tinyint(3) DEFAULT '0' NOT NULL, live_edit tinyint(3) DEFAULT '0' NOT NULL, review_stage_edit tinyint(3) DEFAULT '0' NOT NULL, vtypes tinyint(3) DEFAULT '0' NOT NULL, disable_autocreate tinyint(1) DEFAULT '0' NOT NULL, swap_modes tinyint(3) DEFAULT '0' NOT NULL, publish_access tinyint(3) DEFAULT '0' NOT NULL, stagechg_notification tinyint(3) DEFAULT '0' NOT NULL, PRIMARY KEY (uid), KEY parent (pid) ); # # Table structure for table 'sys_history' # CREATE TABLE sys_history ( uid int(11) unsigned NOT NULL auto_increment, sys_log_uid int(11) DEFAULT '0' NOT NULL, history_data mediumtext, fieldlist text, recuid int(11) DEFAULT '0' NOT NULL, tablename varchar(255) DEFAULT '' NOT NULL, tstamp int(11) DEFAULT '0' NOT NULL, history_files mediumtext, snapshot tinyint(4) DEFAULT '0' NOT NULL, PRIMARY KEY (uid), KEY recordident (tablename,recuid,tstamp), KEY sys_log_uid (sys_log_uid) ); # # Table structure for table 'sys_lockedrecords' # CREATE TABLE sys_lockedrecords ( uid int(11) unsigned NOT NULL auto_increment, userid int(11) unsigned DEFAULT '0' NOT NULL, tstamp int(11) unsigned DEFAULT '0' NOT NULL, record_table varchar(255) DEFAULT '' NOT NULL, record_uid int(11) DEFAULT '0' NOT NULL, record_pid int(11) DEFAULT '0' NOT NULL, username varchar(20) DEFAULT '' NOT NULL, feuserid int(11) unsigned DEFAULT '0' NOT NULL, PRIMARY KEY (uid), KEY event (userid,tstamp) ); # # Table structure for table 'sys_refindex' # CREATE TABLE sys_refindex ( hash varchar(32) DEFAULT '' NOT NULL, tablename varchar(255) DEFAULT '' NOT NULL, recuid int(11) DEFAULT '0' NOT NULL, field varchar(40) DEFAULT '' NOT NULL, flexpointer varchar(255) DEFAULT '' NOT NULL, softref_key varchar(30) DEFAULT '' NOT NULL, softref_id varchar(40) DEFAULT '' NOT NULL, sorting int(11) DEFAULT '0' NOT NULL, deleted tinyint(1) DEFAULT '0' NOT NULL, ref_table varchar(255) DEFAULT '' NOT NULL, ref_uid int(11) DEFAULT '0' NOT NULL, ref_string varchar(200) DEFAULT '' NOT NULL, PRIMARY KEY (hash), KEY lookup_rec (tablename,recuid), KEY lookup_uid (ref_table,ref_uid), KEY lookup_string (ref_string) ); # # Table structure for table 'sys_refindex_words' # CREATE TABLE sys_refindex_words ( wid int(11) DEFAULT '0' NOT NULL, baseword varchar(60) DEFAULT '' NOT NULL, PRIMARY KEY (wid) ); # # Table structure for table 'sys_refindex_rel' # CREATE TABLE sys_refindex_rel ( rid int(11) DEFAULT '0' NOT NULL, wid int(11) DEFAULT '0' NOT NULL, PRIMARY KEY (rid,wid) ); # # Table structure for table 'sys_refindex_res' # CREATE TABLE sys_refindex_res ( rid int(11) DEFAULT '0' NOT NULL, tablename varchar(255) DEFAULT '' NOT NULL, recuid int(11) DEFAULT '0' NOT NULL, PRIMARY KEY (rid) ); # # Table structure for table 'sys_log' # CREATE TABLE sys_log ( uid int(11) unsigned NOT NULL auto_increment, userid int(11) unsigned DEFAULT '0' NOT NULL, action tinyint(4) unsigned DEFAULT '0' NOT NULL, recuid int(11) unsigned DEFAULT '0' NOT NULL, tablename varchar(255) DEFAULT '' NOT NULL, recpid int(11) DEFAULT '0' NOT NULL, error tinyint(4) unsigned DEFAULT '0' NOT NULL, details varchar(255) DEFAULT '' NOT NULL, tstamp int(11) unsigned DEFAULT '0' NOT NULL, type tinyint(3) unsigned DEFAULT '0' NOT NULL, details_nr tinyint(3) unsigned DEFAULT '0' NOT NULL, IP varchar(39) DEFAULT '' NOT NULL, log_data varchar(255) DEFAULT '' NOT NULL, event_pid int(11) DEFAULT '-1' NOT NULL, workspace int(11) DEFAULT '0' NOT NULL, NEWid varchar(20) DEFAULT '' NOT NULL, PRIMARY KEY (uid), KEY event (userid,event_pid), KEY recuidIdx (recuid,uid) ) ENGINE=InnoDB; # # Table structure for table 'sys_language' # CREATE TABLE sys_language ( uid int(11) unsigned NOT NULL auto_increment, pid int(11) unsigned DEFAULT '0' NOT NULL, tstamp int(11) unsigned DEFAULT '0' NOT NULL, hidden tinyint(4) unsigned DEFAULT '0' NOT NULL, title varchar(80) DEFAULT '' NOT NULL, flag varchar(20) DEFAULT '' NOT NULL, static_lang_isocode int(11) unsigned DEFAULT '0' NOT NULL, PRIMARY KEY (uid), KEY parent (pid) ); # # Table structure for table 'sys_note' # CREATE TABLE sys_note ( uid int(11) unsigned NOT NULL auto_increment, pid int(11) unsigned DEFAULT '0' NOT NULL, deleted tinyint(3) unsigned DEFAULT '0' NOT NULL, tstamp int(11) unsigned DEFAULT '0' NOT NULL, crdate int(11) unsigned DEFAULT '0' NOT NULL, cruser int(11) unsigned DEFAULT '0' NOT NULL, author varchar(80) DEFAULT '' NOT NULL, email varchar(80) DEFAULT '' NOT NULL, subject varchar(255) DEFAULT '' NOT NULL, message text, personal tinyint(3) unsigned DEFAULT '0' NOT NULL, category tinyint(3) unsigned DEFAULT '0' NOT NULL, PRIMARY KEY (uid), KEY parent (pid) ); # # Table structure for table 'tx_extbase_cache_reflection' # CREATE TABLE tx_extbase_cache_reflection ( id int(11) unsigned NOT NULL auto_increment, identifier varchar(250) DEFAULT '' NOT NULL, crdate int(11) unsigned DEFAULT '0' NOT NULL, content mediumtext, tags mediumtext, lifetime int(11) unsigned DEFAULT '0' NOT NULL, PRIMARY KEY (id), KEY cache_id (identifier) ) ENGINE=InnoDB; # # Table structure for table 'tx_extbase_cache_reflection_tags' # CREATE TABLE tx_extbase_cache_reflection_tags ( id int(11) unsigned NOT NULL auto_increment, identifier varchar(128) DEFAULT '' NOT NULL, tag varchar(128) DEFAULT '' NOT NULL, PRIMARY KEY (id), KEY cache_id (identifier), KEY cache_tag (tag) ) ENGINE=InnoDB;# # Table structure for table 'static_tsconfig_help' # CREATE TABLE static_tsconfig_help ( uid int(11) NOT NULL auto_increment, guide int(11) DEFAULT '0' NOT NULL, md5hash varchar(32) DEFAULT '' NOT NULL, description text, obj_string varchar(255) DEFAULT '' NOT NULL, appdata blob, title varchar(255) DEFAULT '' NOT NULL, PRIMARY KEY (uid), KEY guide (guide,md5hash) ); # # Table structure for table 'sys_action' # CREATE TABLE sys_action ( uid int(11) unsigned NOT NULL auto_increment, pid int(11) unsigned DEFAULT '0' NOT NULL, tstamp int(11) unsigned DEFAULT '0' NOT NULL, crdate int(11) unsigned DEFAULT '0' NOT NULL, cruser_id int(11) unsigned DEFAULT '0' NOT NULL, sorting int(10) DEFAULT '0' NOT NULL, title varchar(255) DEFAULT '' NOT NULL, description text, type tinyint(3) unsigned DEFAULT '0' NOT NULL, t1_userprefix varchar(20) DEFAULT '' NOT NULL, t1_copy_of_user int(11) DEFAULT '0' NOT NULL, t1_allowed_groups tinytext, t2_data blob, assign_to_groups int(11) DEFAULT '0' NOT NULL, hidden tinyint(4) DEFAULT '0' NOT NULL, t1_create_user_dir tinyint(4) DEFAULT '0' NOT NULL, t3_listPid int(11) DEFAULT '0' NOT NULL, t3_tables varchar(255) DEFAULT '' NOT NULL, t4_recordsToEdit text, PRIMARY KEY (uid), KEY cruser_id (cruser_id), KEY parent (pid) ); # # Table structure for table 'sys_action_asgr_mm' # CREATE TABLE sys_action_asgr_mm ( uid_local int(11) unsigned DEFAULT '0' NOT NULL, uid_foreign int(11) unsigned DEFAULT '0' NOT NULL, sorting int(11) unsigned DEFAULT '0' NOT NULL, KEY uid_local (uid_local), KEY uid_foreign (uid_foreign) ); # # Table structure for table 'tx_dbal_debuglog' # CREATE TABLE tx_dbal_debuglog ( uid int(11) unsigned NOT NULL auto_increment, tstamp int(11) unsigned DEFAULT '0', beuser_id int(11) unsigned DEFAULT '0', script varchar(255) DEFAULT '' NOT NULL, exec_time int(11) unsigned DEFAULT '0', table_join varchar(255) DEFAULT '' NOT NULL, serdata blob, query text, errorFlag int(11) unsigned DEFAULT '0', PRIMARY KEY (uid), KEY tstamp (tstamp) ); # # Table structure for table 'tx_dbal_debuglog_where' # CREATE TABLE tx_dbal_debuglog_where ( uid int(11) unsigned NOT NULL auto_increment, tstamp int(11) unsigned DEFAULT '0', beuser_id int(11) unsigned DEFAULT '0', script varchar(255) DEFAULT '' NOT NULL, tablename varchar(255) DEFAULT '' NOT NULL, whereclause text, PRIMARY KEY (uid), KEY tstamp (tstamp) ); # # Table structure for table 'tx_openid_assoc_store'. # CREATE TABLE tx_openid_assoc_store ( uid int(11) unsigned NOT NULL auto_increment, pid int(11) unsigned DEFAULT '0' NOT NULL, crdate int(11) unsigned DEFAULT '0' NOT NULL, tstamp int(11) unsigned DEFAULT '0' NOT NULL, expires int(11) unsigned DEFAULT '0' NOT NULL, server_url varchar(2047) DEFAULT '' NOT NULL, assoc_handle varchar(255) DEFAULT '' NOT NULL, content blob, PRIMARY KEY (uid), KEY assoc_handle (assoc_handle(8)), KEY expires (expires) ) ENGINE=InnoDB; # # Table structure for table 'tx_openid_nonce_store'. # CREATE TABLE tx_openid_nonce_store ( uid int(11) unsigned NOT NULL auto_increment, pid int(11) unsigned DEFAULT '0' NOT NULL, crdate int(11) unsigned DEFAULT '0' NOT NULL, tstamp int(11) unsigned DEFAULT '0' NOT NULL, server_url varchar(2047) DEFAULT '' NOT NULL, salt char(40) DEFAULT '' NOT NULL, PRIMARY KEY (uid), UNIQUE KEY nonce (server_url(255),tstamp,salt), KEY crdate (crdate) ) ENGINE=InnoDB; # # Table structure for table 'tx_rsauth_keys' # CREATE TABLE tx_rsaauth_keys ( uid int(11) NOT NULL auto_increment, pid int(11) DEFAULT '0' NOT NULL, crdate int(11) DEFAULT '0' NOT NULL, key_value text, PRIMARY KEY (uid), KEY crdate (crdate) ); # # Table structure for extension 'rtehtmlarea' # CREATE TABLE tx_rtehtmlarea_acronym ( uid int(11) unsigned NOT NULL auto_increment, pid int(11) unsigned DEFAULT '0' NOT NULL, deleted tinyint(4) unsigned DEFAULT '0' NOT NULL, hidden tinyint(4) unsigned DEFAULT '0' NOT NULL, starttime int(11) unsigned DEFAULT '0' NOT NULL, endtime int(11) unsigned DEFAULT '0' NOT NULL, sorting int(11) unsigned DEFAULT '0' NOT NULL, sys_language_uid int(11) DEFAULT '0' NOT NULL, type tinyint(3) unsigned DEFAULT '1' NOT NULL, term varchar(255) DEFAULT '' NOT NULL, acronym varchar(255) DEFAULT '' NOT NULL, static_lang_isocode int(11) unsigned DEFAULT '0' NOT NULL, PRIMARY KEY (uid), KEY parent (pid) ); # # Table structure for table 'tx_impexp_presets' # CREATE TABLE tx_impexp_presets ( uid int(11) NOT NULL auto_increment, user_uid int(11) DEFAULT '0' NOT NULL, title varchar(255) DEFAULT '' NOT NULL, public tinyint(3) DEFAULT '0' NOT NULL, item_uid int(11) DEFAULT '0' NOT NULL, preset_data blob, PRIMARY KEY (uid), KEY lookup (item_uid) ); # # TYPO3 SVN ID: $Id: ext_tables.sql 6525 2009-11-25 11:27:34Z steffenk $ # # # Table structure for table 'cache_pages' # CREATE TABLE cache_pages ( id int(11) unsigned NOT NULL auto_increment, hash varchar(32) DEFAULT '' NOT NULL, page_id int(11) unsigned DEFAULT '0' NOT NULL, reg1 int(11) unsigned DEFAULT '0' NOT NULL, HTML mediumblob, temp_content int(1) DEFAULT '0' NOT NULL, tstamp int(11) unsigned DEFAULT '0' NOT NULL, expires int(10) unsigned DEFAULT '0' NOT NULL, cache_data mediumblob, KEY page_id (page_id), KEY sel (hash,page_id), PRIMARY KEY (id) ) ENGINE=InnoDB; # # Table structure for table 'cache_pagesection' # CREATE TABLE cache_pagesection ( page_id int(11) unsigned DEFAULT '0' NOT NULL, mpvar_hash int(11) unsigned DEFAULT '0' NOT NULL, content blob, tstamp int(11) unsigned DEFAULT '0' NOT NULL, PRIMARY KEY (page_id,mpvar_hash) ) ENGINE=InnoDB; # # Table structure for table 'cachingframework_cache_pages' # CREATE TABLE cachingframework_cache_pages ( id int(11) unsigned NOT NULL auto_increment, identifier varchar(128) DEFAULT '' NOT NULL, crdate int(11) unsigned DEFAULT '0' NOT NULL, content mediumtext, lifetime int(11) unsigned DEFAULT '0' NOT NULL, PRIMARY KEY (id), KEY cache_id (identifier) ) ENGINE=InnoDB; # # Table structure for table 'cachingframework_cache_pages_tags' # CREATE TABLE cachingframework_cache_pages_tags ( id int(11) unsigned NOT NULL auto_increment, identifier varchar(128) DEFAULT '' NOT NULL, tag varchar(128) DEFAULT '' NOT NULL, PRIMARY KEY (id), KEY cache_id (identifier), KEY cache_tag (tag) ) ENGINE=InnoDB; # # Table structure for table 'cachingframework_cache_pagesection' # CREATE TABLE cachingframework_cache_pagesection ( id int(11) unsigned NOT NULL auto_increment, identifier varchar(128) DEFAULT '' NOT NULL, crdate int(11) unsigned DEFAULT '0' NOT NULL, content mediumtext, lifetime int(11) unsigned DEFAULT '0' NOT NULL, PRIMARY KEY (id), KEY cache_id (identifier) ) ENGINE=InnoDB; # # Table structure for table 'cachingframework_cache_pagesection_tags' # CREATE TABLE cachingframework_cache_pagesection_tags ( id int(11) unsigned NOT NULL auto_increment, identifier varchar(128) DEFAULT '' NOT NULL, tag varchar(128) DEFAULT '' NOT NULL, PRIMARY KEY (id), KEY cache_id (identifier), KEY cache_tag (tag) ) ENGINE=InnoDB; # # Table structure for table 'cache_typo3temp_log' # CREATE TABLE cache_typo3temp_log ( md5hash varchar(32) DEFAULT '' NOT NULL, tstamp int(11) DEFAULT '0' NOT NULL, filename varchar(255) DEFAULT '' NOT NULL, orig_filename varchar(255) DEFAULT '' NOT NULL, PRIMARY KEY (md5hash) ) ENGINE=InnoDB; # # Table structure for table 'cache_md5params' # CREATE TABLE cache_md5params ( md5hash varchar(20) DEFAULT '' NOT NULL, tstamp int(11) DEFAULT '0' NOT NULL, type tinyint(3) DEFAULT '0' NOT NULL, params text, PRIMARY KEY (md5hash) ) ENGINE=InnoDB; # # Table structure for table 'cache_treelist' # CREATE TABLE cache_treelist ( md5hash char(32) DEFAULT '' NOT NULL, pid int(11) DEFAULT '0' NOT NULL, treelist text, tstamp int(11) DEFAULT '0' NOT NULL, expires int(11) unsigned DEFAULT '0' NOT NULL, PRIMARY KEY (md5hash) ) ENGINE=InnoDB; # # Table structure for table 'fe_groups' # CREATE TABLE fe_groups ( uid int(11) unsigned NOT NULL auto_increment, pid int(11) unsigned DEFAULT '0' NOT NULL, tstamp int(11) unsigned DEFAULT '0' NOT NULL, crdate int(11) unsigned DEFAULT '0' NOT NULL, cruser_id int(11) unsigned DEFAULT '0' NOT NULL, title varchar(50) DEFAULT '' NOT NULL, hidden tinyint(3) unsigned DEFAULT '0' NOT NULL, lockToDomain varchar(50) DEFAULT '' NOT NULL, deleted tinyint(3) unsigned DEFAULT '0' NOT NULL, description text, subgroup tinytext, TSconfig text, felogin_redirectPid tinytext, PRIMARY KEY (uid), KEY parent (pid) ); # # Table structure for table 'fe_session_data' # CREATE TABLE fe_session_data ( hash varchar(32) DEFAULT '' NOT NULL, content mediumblob, tstamp int(11) unsigned DEFAULT '0' NOT NULL, PRIMARY KEY (hash) ) ENGINE=InnoDB; # # Table structure for table 'fe_sessions' # CREATE TABLE fe_sessions ( ses_id varchar(32) DEFAULT '' NOT NULL, ses_name varchar(32) DEFAULT '' NOT NULL, ses_iplock varchar(39) DEFAULT '' NOT NULL, ses_hashlock int(11) DEFAULT '0' NOT NULL, ses_userid int(11) unsigned DEFAULT '0' NOT NULL, ses_tstamp int(11) unsigned DEFAULT '0' NOT NULL, ses_data blob, ses_permanent tinyint(1) unsigned DEFAULT '0' NOT NULL, PRIMARY KEY (ses_id,ses_name) ) ENGINE=InnoDB; # # Table structure for table 'fe_users' # CREATE TABLE fe_users ( uid int(11) unsigned NOT NULL auto_increment, pid int(11) unsigned DEFAULT '0' NOT NULL, tstamp int(11) unsigned DEFAULT '0' NOT NULL, username varchar(50) DEFAULT '' NOT NULL, password varchar(60) DEFAULT '' NOT NULL, usergroup tinytext, disable tinyint(4) unsigned DEFAULT '0' NOT NULL, starttime int(11) unsigned DEFAULT '0' NOT NULL, endtime int(11) unsigned DEFAULT '0' NOT NULL, name varchar(80) DEFAULT '' NOT NULL, address varchar(255) DEFAULT '' NOT NULL, telephone varchar(20) DEFAULT '' NOT NULL, fax varchar(20) DEFAULT '' NOT NULL, email varchar(80) DEFAULT '' NOT NULL, crdate int(11) unsigned DEFAULT '0' NOT NULL, cruser_id int(11) unsigned DEFAULT '0' NOT NULL, lockToDomain varchar(50) DEFAULT '' NOT NULL, deleted tinyint(3) unsigned DEFAULT '0' NOT NULL, uc blob, title varchar(40) DEFAULT '' NOT NULL, zip varchar(10) DEFAULT '' NOT NULL, city varchar(50) DEFAULT '' NOT NULL, country varchar(40) DEFAULT '' NOT NULL, www varchar(80) DEFAULT '' NOT NULL, company varchar(80) DEFAULT '' NOT NULL, image tinytext, TSconfig text, fe_cruser_id int(10) unsigned DEFAULT '0' NOT NULL, lastlogin int(10) unsigned DEFAULT '0' NOT NULL, is_online int(10) unsigned DEFAULT '0' NOT NULL, felogin_redirectPid tinytext, felogin_forgotHash varchar(80) default '', tx_openid_openid varchar(255) DEFAULT '' NOT NULL, PRIMARY KEY (uid), KEY parent (pid,username), KEY username (username), KEY is_online (is_online) ); # # Table structure for table 'pages_language_overlay' # CREATE TABLE pages_language_overlay ( uid int(11) NOT NULL auto_increment, pid int(11) DEFAULT '0' NOT NULL, doktype tinyint(3) unsigned DEFAULT '0' NOT NULL, t3ver_oid int(11) DEFAULT '0' NOT NULL, t3ver_id int(11) DEFAULT '0' NOT NULL, t3ver_wsid int(11) DEFAULT '0' NOT NULL, t3ver_label varchar(255) DEFAULT '' NOT NULL, t3ver_state tinyint(4) DEFAULT '0' NOT NULL, t3ver_stage tinyint(4) DEFAULT '0' NOT NULL, t3ver_count int(11) DEFAULT '0' NOT NULL, t3ver_tstamp int(11) DEFAULT '0' NOT NULL, t3_origuid int(11) DEFAULT '0' NOT NULL, tstamp int(11) unsigned DEFAULT '0' NOT NULL, crdate int(11) unsigned DEFAULT '0' NOT NULL, cruser_id int(11) unsigned DEFAULT '0' NOT NULL, sys_language_uid int(11) unsigned DEFAULT '0' NOT NULL, title varchar(255) DEFAULT '' NOT NULL, hidden tinyint(4) unsigned DEFAULT '0' NOT NULL, starttime int(11) unsigned DEFAULT '0' NOT NULL, endtime int(11) unsigned DEFAULT '0' NOT NULL, deleted tinyint(3) unsigned DEFAULT '0' NOT NULL, subtitle varchar(255) DEFAULT '' NOT NULL, nav_title varchar(255) DEFAULT '' NOT NULL, media tinytext, keywords text, description text, abstract text, author varchar(255) DEFAULT '' NOT NULL, author_email varchar(80) DEFAULT '' NOT NULL, tx_impexp_origuid int(11) DEFAULT '0' NOT NULL, l18n_diffsource mediumblob, url varchar(255) DEFAULT '' NOT NULL, urltype tinyint(4) unsigned DEFAULT '0' NOT NULL, shortcut int(10) unsigned DEFAULT '0' NOT NULL, shortcut_mode int(10) unsigned DEFAULT '0' NOT NULL, PRIMARY KEY (uid), KEY t3ver_oid (t3ver_oid,t3ver_wsid), KEY parent (pid,sys_language_uid) ); # # Table structure for table 'static_template' # CREATE TABLE static_template ( uid int(11) unsigned NOT NULL auto_increment, pid int(11) unsigned DEFAULT '0' NOT NULL, tstamp int(11) unsigned DEFAULT '0' NOT NULL, crdate int(11) unsigned DEFAULT '0' NOT NULL, title varchar(255) DEFAULT '' NOT NULL, include_static tinytext, constants text, config text, editorcfg text, description text, PRIMARY KEY (uid), KEY parent (pid) ); # # Table structure for table 'sys_domain' # CREATE TABLE sys_domain ( uid int(11) unsigned NOT NULL auto_increment, pid int(11) unsigned DEFAULT '0' NOT NULL, tstamp int(11) unsigned DEFAULT '0' NOT NULL, crdate int(11) unsigned DEFAULT '0' NOT NULL, cruser_id int(11) unsigned DEFAULT '0' NOT NULL, hidden tinyint(4) unsigned DEFAULT '0' NOT NULL, domainName varchar(80) DEFAULT '' NOT NULL, redirectTo varchar(120) DEFAULT '' NOT NULL, redirectHttpStatusCode int(4) unsigned DEFAULT '301' NOT NULL, sorting int(10) unsigned DEFAULT '0' NOT NULL, prepend_params int(10) DEFAULT '0' NOT NULL, forced tinyint(3) unsigned DEFAULT '0' NOT NULL, PRIMARY KEY (uid), KEY parent (pid) ); # # Table structure for table 'sys_template' # CREATE TABLE sys_template ( uid int(11) NOT NULL auto_increment, pid int(11) DEFAULT '0' NOT NULL, t3ver_oid int(11) DEFAULT '0' NOT NULL, t3ver_id int(11) DEFAULT '0' NOT NULL, t3ver_wsid int(11) DEFAULT '0' NOT NULL, t3ver_label varchar(255) DEFAULT '' NOT NULL, t3ver_state tinyint(4) DEFAULT '0' NOT NULL, t3ver_stage tinyint(4) DEFAULT '0' NOT NULL, t3ver_count int(11) DEFAULT '0' NOT NULL, t3ver_tstamp int(11) DEFAULT '0' NOT NULL, t3_origuid int(11) DEFAULT '0' NOT NULL, tstamp int(11) unsigned DEFAULT '0' NOT NULL, sorting int(11) unsigned DEFAULT '0' NOT NULL, crdate int(11) unsigned DEFAULT '0' NOT NULL, cruser_id int(11) unsigned DEFAULT '0' NOT NULL, title varchar(255) DEFAULT '' NOT NULL, sitetitle varchar(255) DEFAULT '' NOT NULL, hidden tinyint(4) unsigned DEFAULT '0' NOT NULL, starttime int(11) unsigned DEFAULT '0' NOT NULL, endtime int(11) unsigned DEFAULT '0' NOT NULL, root tinyint(4) unsigned DEFAULT '0' NOT NULL, clear tinyint(4) unsigned DEFAULT '0' NOT NULL, include_static tinytext, include_static_file text, constants text, config text, editorcfg text, resources text, nextLevel varchar(5) DEFAULT '' NOT NULL, description text, basedOn tinytext, deleted tinyint(3) unsigned DEFAULT '0' NOT NULL, includeStaticAfterBasedOn tinyint(4) unsigned DEFAULT '0' NOT NULL, static_file_mode tinyint(4) unsigned DEFAULT '0' NOT NULL, tx_impexp_origuid int(11) DEFAULT '0' NOT NULL, PRIMARY KEY (uid), KEY t3ver_oid (t3ver_oid,t3ver_wsid), KEY parent (pid,sorting,deleted,hidden) ); # # Table structure for table 'tt_content' # CREATE TABLE tt_content ( uid int(11) NOT NULL auto_increment, pid int(11) DEFAULT '0' NOT NULL, t3ver_oid int(11) DEFAULT '0' NOT NULL, t3ver_id int(11) DEFAULT '0' NOT NULL, t3ver_wsid int(11) DEFAULT '0' NOT NULL, t3ver_label varchar(255) DEFAULT '' NOT NULL, t3ver_state tinyint(4) DEFAULT '0' NOT NULL, t3ver_stage tinyint(4) DEFAULT '0' NOT NULL, t3ver_count int(11) DEFAULT '0' NOT NULL, t3ver_tstamp int(11) DEFAULT '0' NOT NULL, t3ver_move_id int(11) DEFAULT '0' NOT NULL, t3_origuid int(11) DEFAULT '0' NOT NULL, tstamp int(11) unsigned DEFAULT '0' NOT NULL, crdate int(11) unsigned DEFAULT '0' NOT NULL, cruser_id int(11) unsigned DEFAULT '0' NOT NULL, hidden tinyint(4) unsigned DEFAULT '0' NOT NULL, sorting int(11) unsigned DEFAULT '0' NOT NULL, CType varchar(30) DEFAULT '' NOT NULL, header varchar(255) DEFAULT '' NOT NULL, header_position varchar(6) DEFAULT '' NOT NULL, bodytext mediumtext, image text, imagewidth mediumint(11) unsigned DEFAULT '0' NOT NULL, imageorient tinyint(4) unsigned DEFAULT '0' NOT NULL, imagecaption text, imagecols tinyint(4) unsigned DEFAULT '0' NOT NULL, imageborder tinyint(4) unsigned DEFAULT '0' NOT NULL, media text, layout tinyint(3) unsigned DEFAULT '0' NOT NULL, deleted tinyint(4) unsigned DEFAULT '0' NOT NULL, cols tinyint(3) unsigned DEFAULT '0' NOT NULL, records text, pages tinytext, starttime int(11) unsigned DEFAULT '0' NOT NULL, endtime int(11) unsigned DEFAULT '0' NOT NULL, colPos tinyint(3) unsigned DEFAULT '0' NOT NULL, subheader varchar(255) DEFAULT '' NOT NULL, spaceBefore tinyint(4) unsigned DEFAULT '0' NOT NULL, spaceAfter tinyint(4) unsigned DEFAULT '0' NOT NULL, fe_group varchar(100) DEFAULT '0' NOT NULL, header_link varchar(255) DEFAULT '' NOT NULL, imagecaption_position varchar(6) DEFAULT '' NOT NULL, image_link varchar(255) DEFAULT '' NOT NULL, image_zoom tinyint(3) unsigned DEFAULT '0' NOT NULL, image_noRows tinyint(3) unsigned DEFAULT '0' NOT NULL, image_effects tinyint(3) unsigned DEFAULT '0' NOT NULL, image_compression tinyint(3) unsigned DEFAULT '0' NOT NULL, altText text, titleText text, longdescURL text, header_layout varchar(30) DEFAULT '0' NOT NULL, text_align varchar(6) DEFAULT '' NOT NULL, text_face tinyint(3) unsigned DEFAULT '0' NOT NULL, text_size tinyint(3) unsigned DEFAULT '0' NOT NULL, text_color tinyint(3) unsigned DEFAULT '0' NOT NULL, text_properties tinyint(3) unsigned DEFAULT '0' NOT NULL, menu_type varchar(30) DEFAULT '0' NOT NULL, list_type varchar(36) DEFAULT '0' NOT NULL, table_border tinyint(3) unsigned DEFAULT '0' NOT NULL, table_cellspacing tinyint(3) unsigned DEFAULT '0' NOT NULL, table_cellpadding tinyint(3) unsigned DEFAULT '0' NOT NULL, table_bgColor tinyint(3) unsigned DEFAULT '0' NOT NULL, select_key varchar(80) DEFAULT '' NOT NULL, sectionIndex tinyint(3) unsigned DEFAULT '0' NOT NULL, linkToTop tinyint(3) unsigned DEFAULT '0' NOT NULL, filelink_size tinyint(3) unsigned DEFAULT '0' NOT NULL, section_frame tinyint(3) unsigned DEFAULT '0' NOT NULL, date int(10) unsigned DEFAULT '0' NOT NULL, splash_layout varchar(30) DEFAULT '0' NOT NULL, multimedia tinytext, image_frames tinyint(3) unsigned DEFAULT '0' NOT NULL, recursive tinyint(3) unsigned DEFAULT '0' NOT NULL, imageheight mediumint(8) unsigned DEFAULT '0' NOT NULL, rte_enabled tinyint(4) DEFAULT '0' NOT NULL, sys_language_uid int(11) DEFAULT '0' NOT NULL, tx_impexp_origuid int(11) DEFAULT '0' NOT NULL, pi_flexform mediumtext, l18n_parent int(11) DEFAULT '0' NOT NULL, l18n_diffsource mediumblob, PRIMARY KEY (uid), KEY t3ver_oid (t3ver_oid,t3ver_wsid), KEY parent (pid,sorting) ); # # Table structure for table 'pages' # CREATE TABLE pages ( url varchar(255) DEFAULT '' NOT NULL, starttime int(11) unsigned DEFAULT '0' NOT NULL, endtime int(11) unsigned DEFAULT '0' NOT NULL, urltype tinyint(4) unsigned DEFAULT '0' NOT NULL, shortcut int(10) unsigned DEFAULT '0' NOT NULL, shortcut_mode int(10) unsigned DEFAULT '0' NOT NULL, no_cache int(10) unsigned DEFAULT '0' NOT NULL, fe_group varchar(100) DEFAULT '0' NOT NULL, subtitle varchar(255) DEFAULT '' NOT NULL, layout tinyint(3) unsigned DEFAULT '0' NOT NULL, target varchar(80) DEFAULT '' NOT NULL, media text, lastUpdated int(10) unsigned DEFAULT '0' NOT NULL, keywords text, cache_timeout int(10) unsigned DEFAULT '0' NOT NULL, newUntil int(10) unsigned DEFAULT '0' NOT NULL, description text, no_search tinyint(3) unsigned DEFAULT '0' NOT NULL, SYS_LASTCHANGED int(10) unsigned DEFAULT '0' NOT NULL, abstract text, module varchar(10) DEFAULT '' NOT NULL, extendToSubpages tinyint(3) unsigned DEFAULT '0' NOT NULL, author varchar(255) DEFAULT '' NOT NULL, author_email varchar(80) DEFAULT '' NOT NULL, nav_title varchar(255) DEFAULT '' NOT NULL, nav_hide tinyint(4) DEFAULT '0' NOT NULL, content_from_pid int(10) unsigned DEFAULT '0' NOT NULL, mount_pid int(10) unsigned DEFAULT '0' NOT NULL, mount_pid_ol tinyint(4) DEFAULT '0' NOT NULL, alias varchar(32) DEFAULT '' NOT NULL, l18n_cfg tinyint(4) DEFAULT '0' NOT NULL, fe_login_mode tinyint(4) DEFAULT '0' NOT NULL, uid int(11) NOT NULL auto_increment, pid int(11) DEFAULT '0' NOT NULL, t3ver_oid int(11) DEFAULT '0' NOT NULL, t3ver_id int(11) DEFAULT '0' NOT NULL, t3ver_wsid int(11) DEFAULT '0' NOT NULL, t3ver_label varchar(255) DEFAULT '' NOT NULL, t3ver_state tinyint(4) DEFAULT '0' NOT NULL, t3ver_stage tinyint(4) DEFAULT '0' NOT NULL, t3ver_count int(11) DEFAULT '0' NOT NULL, t3ver_tstamp int(11) DEFAULT '0' NOT NULL, t3ver_swapmode tinyint(4) DEFAULT '0' NOT NULL, t3ver_move_id int(11) DEFAULT '0' NOT NULL, t3_origuid int(11) DEFAULT '0' NOT NULL, tstamp int(11) unsigned DEFAULT '0' NOT NULL, sorting int(11) unsigned DEFAULT '0' NOT NULL, deleted tinyint(1) unsigned DEFAULT '0' NOT NULL, perms_userid int(11) unsigned DEFAULT '0' NOT NULL, perms_groupid int(11) unsigned DEFAULT '0' NOT NULL, perms_user tinyint(4) unsigned DEFAULT '0' NOT NULL, perms_group tinyint(4) unsigned DEFAULT '0' NOT NULL, perms_everybody tinyint(4) unsigned DEFAULT '0' NOT NULL, editlock tinyint(4) unsigned DEFAULT '0' NOT NULL, crdate int(11) unsigned DEFAULT '0' NOT NULL, cruser_id int(11) unsigned DEFAULT '0' NOT NULL, hidden tinyint(4) unsigned DEFAULT '0' NOT NULL, title varchar(255) DEFAULT '' NOT NULL, doktype tinyint(3) unsigned DEFAULT '0' NOT NULL, TSconfig text, storage_pid int(11) DEFAULT '0' NOT NULL, is_siteroot tinyint(4) DEFAULT '0' NOT NULL, php_tree_stop tinyint(4) DEFAULT '0' NOT NULL, tx_impexp_origuid int(11) DEFAULT '0' NOT NULL, PRIMARY KEY (uid), KEY t3ver_oid (t3ver_oid,t3ver_wsid), KEY parent (pid,sorting,deleted,hidden), KEY alias (alias) ); # # Table structure for table 'tx_scheduler_task' # CREATE TABLE tx_scheduler_task ( uid int(11) unsigned NOT NULL auto_increment, crdate int(11) unsigned DEFAULT '0' NOT NULL, disable tinyint(4) unsigned DEFAULT '0' NOT NULL, classname varchar(255) DEFAULT '' NOT NULL, nextexecution int(11) unsigned DEFAULT '0' NOT NULL, lastexecution_time int(11) unsigned DEFAULT '0' NOT NULL, lastexecution_failure text NOT NULL, lastexecution_context char(3) DEFAULT '' NOT NULL, serialized_task_object blob, serialized_executions blob, PRIMARY KEY (uid), KEY index_nextexecution (nextexecution) ); # # Table structure for table 'index_phash' # CREATE TABLE index_phash ( phash int(11) DEFAULT '0' NOT NULL, phash_grouping int(11) DEFAULT '0' NOT NULL, cHashParams tinyblob, data_filename varchar(255) DEFAULT '' NOT NULL, data_page_id int(11) unsigned DEFAULT '0' NOT NULL, data_page_reg1 int(11) unsigned DEFAULT '0' NOT NULL, data_page_type tinyint(3) unsigned DEFAULT '0' NOT NULL, data_page_mp varchar(255) DEFAULT '' NOT NULL, gr_list varchar(255) DEFAULT '' NOT NULL, item_type varchar(5) DEFAULT '' NOT NULL, item_title varchar(255) DEFAULT '' NOT NULL, item_description varchar(255) DEFAULT '' NOT NULL, item_mtime int(11) DEFAULT '0' NOT NULL, tstamp int(11) unsigned DEFAULT '0' NOT NULL, item_size int(11) DEFAULT '0' NOT NULL, contentHash int(11) DEFAULT '0' NOT NULL, crdate int(11) DEFAULT '0' NOT NULL, parsetime int(11) DEFAULT '0' NOT NULL, sys_language_uid int(11) DEFAULT '0' NOT NULL, item_crdate int(11) DEFAULT '0' NOT NULL, externalUrl tinyint(3) DEFAULT '0' NOT NULL, recordUid int(11) DEFAULT '0' NOT NULL, freeIndexUid int(11) DEFAULT '0' NOT NULL, freeIndexSetId int(11) DEFAULT '0' NOT NULL, PRIMARY KEY (phash), KEY phash_grouping (phash_grouping), KEY freeIndexUid (freeIndexUid) ) ENGINE=InnoDB; # # Table structure for table 'index_fulltext' # CREATE TABLE index_fulltext ( phash int(11) DEFAULT '0' NOT NULL, fulltextdata mediumtext, PRIMARY KEY (phash) ) ENGINE=InnoDB; # # Table structure for table 'index_rel' # CREATE TABLE index_rel ( phash int(11) DEFAULT '0' NOT NULL, wid int(11) DEFAULT '0' NOT NULL, count tinyint(3) unsigned DEFAULT '0' NOT NULL, first tinyint(3) unsigned DEFAULT '0' NOT NULL, freq smallint(5) unsigned DEFAULT '0' NOT NULL, flags tinyint(3) unsigned DEFAULT '0' NOT NULL, PRIMARY KEY (phash,wid), KEY wid (wid,phash) ) ENGINE=InnoDB; # # Table structure for table 'index_words' # CREATE TABLE index_words ( wid int(11) DEFAULT '0' NOT NULL, baseword varchar(60) DEFAULT '' NOT NULL, metaphone int(11) DEFAULT '0' NOT NULL, is_stopword tinyint(3) DEFAULT '0' NOT NULL, PRIMARY KEY (wid), KEY baseword (baseword,wid), KEY metaphone (metaphone,wid) ) ENGINE=InnoDB; # # Table structure for table 'index_section' # CREATE TABLE index_section ( phash int(11) DEFAULT '0' NOT NULL, phash_t3 int(11) DEFAULT '0' NOT NULL, rl0 int(11) unsigned DEFAULT '0' NOT NULL, rl1 int(11) unsigned DEFAULT '0' NOT NULL, rl2 int(11) unsigned DEFAULT '0' NOT NULL, page_id int(11) DEFAULT '0' NOT NULL, uniqid int(11) NOT NULL auto_increment, PRIMARY KEY (uniqid), KEY joinkey (phash,rl0), # KEY phash_pid (phash,page_id), KEY page_id (page_id), KEY rl0 (rl0,rl1,phash), KEY rl0_2 (rl0,phash) ) ENGINE=InnoDB; # # Table structure for table 'index_grlist' # CREATE TABLE index_grlist ( phash int(11) DEFAULT '0' NOT NULL, phash_x int(11) DEFAULT '0' NOT NULL, hash_gr_list int(11) DEFAULT '0' NOT NULL, gr_list varchar(255) DEFAULT '' NOT NULL, uniqid int(11) NOT NULL auto_increment, PRIMARY KEY (uniqid), KEY joinkey (phash,hash_gr_list), KEY phash_grouping (phash_x,hash_gr_list) ) ENGINE=InnoDB; # # Table structure for table 'index_stat_search' # CREATE TABLE index_stat_search ( uid int(11) NOT NULL auto_increment, searchstring varchar(255) DEFAULT '' NOT NULL, searchoptions blob, tstamp int(11) DEFAULT '0' NOT NULL, feuser_id int(11) unsigned DEFAULT '0' NOT NULL, cookie varchar(10) DEFAULT '' NOT NULL, IP varchar(255) DEFAULT '' NOT NULL, hits int(11) DEFAULT '0' NOT NULL, PRIMARY KEY (uid) ) ENGINE=InnoDB; # # Table structure for table 'index_debug' # CREATE TABLE index_debug ( phash int(11) DEFAULT '0' NOT NULL, debuginfo mediumtext, PRIMARY KEY (phash) ); # # Table structure for table 'index_config' # CREATE TABLE index_config ( uid int(11) NOT NULL auto_increment, pid int(11) DEFAULT '0' NOT NULL, tstamp int(11) DEFAULT '0' NOT NULL, crdate int(11) DEFAULT '0' NOT NULL, cruser_id int(11) DEFAULT '0' NOT NULL, hidden tinyint(4) DEFAULT '0' NOT NULL, starttime int(11) DEFAULT '0' NOT NULL, set_id int(11) DEFAULT '0' NOT NULL, session_data mediumtext, title varchar(255) DEFAULT '' NOT NULL, description text, type varchar(30) DEFAULT '' NOT NULL, depth int(11) unsigned DEFAULT '0' NOT NULL, table2index varchar(255) DEFAULT '' NOT NULL, alternative_source_pid int(11) unsigned DEFAULT '0' NOT NULL, get_params varchar(255) DEFAULT '' NOT NULL, fieldlist varchar(255) DEFAULT '' NOT NULL, externalUrl varchar(255) DEFAULT '' NOT NULL, indexcfgs text, chashcalc tinyint(3) unsigned DEFAULT '0' NOT NULL, filepath varchar(255) DEFAULT '' NOT NULL, extensions varchar(255) DEFAULT '' NOT NULL, timer_next_indexing int(11) DEFAULT '0' NOT NULL, timer_frequency int(11) DEFAULT '0' NOT NULL, timer_offset int(11) DEFAULT '0' NOT NULL, url_deny text, recordsbatch int(11) DEFAULT '0' NOT NULL, records_indexonchange tinyint(4) DEFAULT '0' NOT NULL, PRIMARY KEY (uid), KEY parent (pid) ); # # Table structure for table 'index_stat_word' # CREATE TABLE index_stat_word ( uid int(11) NOT NULL auto_increment, word varchar(30) DEFAULT '' NOT NULL, index_stat_search_id int(11) DEFAULT '0' NOT NULL, tstamp int(11) DEFAULT '0' NOT NULL, pageid int(11) DEFAULT '0' NOT NULL, PRIMARY KEY (uid), KEY tstamp (tstamp,word) ) ENGINE=InnoDB; LOCK TABLES `be_users` WRITE; INSERT INTO `be_users` VALUES (1,0,1288215563,'admin','5f4dcc3b5aa765d61d8327deb882cf99',1,'',0,0,0,'','','',0,1288215563,0,'','','','a:24:{s:14:\"interfaceSetup\";s:7:\"backend\";s:10:\"moduleData\";a:6:{s:12:\"alt_menu.php\";a:0:{}s:9:\"file_list\";a:0:{}s:15:\"web_txversionM1\";a:2:{s:6:\"filter\";s:1:\"1\";s:7:\"display\";s:1:\"0\";}s:8:\"tools_em\";a:4:{s:8:\"function\";s:1:\"0\";s:9:\"listOrder\";s:3:\"cat\";s:15:\"display_details\";s:1:\"1\";s:13:\"singleDetails\";s:4:\"info\";}s:9:\"menuState\";a:1:{s:11:\"modmenu_web\";i:0;}s:10:\"web_layout\";a:7:{s:8:\"tt_board\";s:1:\"0\";s:10:\"tt_address\";s:1:\"0\";s:8:\"tt_links\";s:1:\"0\";s:11:\"tt_calender\";s:1:\"0\";s:11:\"tt_products\";s:1:\"0\";s:8:\"function\";s:1:\"1\";s:8:\"language\";s:1:\"0\";}}s:19:\"thumbnailsByDefault\";i:0;s:14:\"emailMeAtLogin\";i:0;s:13:\"condensedMode\";i:0;s:10:\"noMenuMode\";i:0;s:11:\"startModule\";s:17:\"help_aboutmodules\";s:18:\"hideSubmoduleIcons\";i:0;s:8:\"helpText\";i:1;s:8:\"titleLen\";i:30;s:17:\"edit_wideDocument\";s:1:\"0\";s:18:\"edit_showFieldHelp\";s:4:\"icon\";s:8:\"edit_RTE\";s:1:\"1\";s:20:\"edit_docModuleUpload\";s:1:\"1\";s:19:\"enableFlashUploader\";s:1:\"1\";s:15:\"disableCMlayers\";i:0;s:13:\"navFrameWidth\";s:0:\"\";s:17:\"navFrameResizable\";i:0;s:15:\"resizeTextareas\";i:1;s:25:\"resizeTextareas_MaxHeight\";i:300;s:24:\"resizeTextareas_Flexible\";i:1;s:4:\"lang\";s:0:\"\";s:19:\"firstLoginTimeStamp\";i:1288215592;s:15:\"moduleSessionID\";a:4:{s:9:\"file_list\";s:32:\"23403387eed6be8b7bf232950d411f95\";s:15:\"web_txversionM1\";s:32:\"23403387eed6be8b7bf232950d411f95\";s:8:\"tools_em\";s:32:\"23403387eed6be8b7bf232950d411f95\";s:10:\"web_layout\";s:32:\"23403387eed6be8b7bf232950d411f95\";}}','',0,1,'',0,0,NULL,1288215592,0,'',0,1,''); UNLOCK TABLES; -- Now the changes to 4.5 ALTER TABLE pages ADD url_scheme tinyint(3) unsigned NOT NULL default '0'; ALTER TABLE sys_filemounts ADD sorting int(11) unsigned NOT NULL default '0'; ALTER TABLE fe_session_data ADD KEY tstamp (tstamp); ALTER TABLE fe_users ADD first_name varchar(50) NOT NULL default ''; ALTER TABLE fe_users ADD middle_name varchar(50) NOT NULL default ''; ALTER TABLE fe_users ADD last_name varchar(50) NOT NULL default ''; ALTER TABLE tt_content ADD KEY language (l18n_parent,sys_language_uid); ALTER TABLE cachingframework_cache_hash CHANGE content content mediumblob; ALTER TABLE sys_lockedrecords CHANGE username username varchar(50) default ''; ALTER TABLE sys_log CHANGE details details text; ALTER TABLE cachingframework_cache_pages CHANGE content content mediumblob; ALTER TABLE cachingframework_cache_pagesection CHANGE content content mediumblob; CREATE TABLE sys_news ( uid int(11) unsigned NOT NULL auto_increment, pid int(11) unsigned NOT NULL default '0', tstamp int(11) unsigned NOT NULL default '0', crdate int(11) unsigned NOT NULL default '0', cruser_id int(11) unsigned NOT NULL default '0', deleted tinyint(3) unsigned NOT NULL default '0', hidden tinyint(4) unsigned NOT NULL default '0', starttime int(11) unsigned NOT NULL default '0', endtime int(11) unsigned NOT NULL default '0', title varchar(255) NOT NULL default '', content mediumtext, PRIMARY KEY (uid), KEY parent (pid) ); -- beta 1 ALTER TABLE pages ADD be_layout int(10) NOT NULL default '0'; ALTER TABLE pages ADD be_layout_next_level int(10) NOT NULL default '0'; ALTER TABLE cache_extensions ADD repository int(11) unsigned NOT NULL default '1'; ALTER TABLE sys_workspace CHANGE adminusers adminusers text; ALTER TABLE tt_content CHANGE spaceBefore spaceBefore smallint(5) unsigned default '0'; ALTER TABLE tt_content CHANGE spaceAfter spaceAfter smallint(5) unsigned default '0'; ALTER TABLE cache_extensions DROP PRIMARY KEY; ALTER TABLE cache_extensions ADD PRIMARY KEY (extkey,version,repository); CREATE TABLE be_layouts ( uid int(11) NOT NULL auto_increment, pid int(11) NOT NULL default '0', t3ver_oid int(11) NOT NULL default '0', t3ver_id int(11) NOT NULL default '0', t3ver_wsid int(11) NOT NULL default '0', t3ver_label varchar(255) NOT NULL default '', t3ver_state tinyint(4) NOT NULL default '0', t3ver_stage tinyint(4) NOT NULL default '0', t3ver_count int(11) NOT NULL default '0', t3ver_tstamp int(11) NOT NULL default '0', t3ver_move_id int(11) NOT NULL default '0', t3_origuid int(11) NOT NULL default '0', tstamp int(11) unsigned NOT NULL default '0', crdate int(11) unsigned NOT NULL default '0', cruser_id int(11) unsigned NOT NULL default '0', hidden tinyint(4) unsigned NOT NULL default '0', deleted tinyint(4) NOT NULL default '0', sorting int(11) unsigned NOT NULL default '0', title varchar(255) NOT NULL default '', description text NOT NULL, config text NOT NULL, icon text NOT NULL, PRIMARY KEY (uid), KEY parent (pid), KEY t3ver_oid (t3ver_oid,t3ver_wsid) ); CREATE TABLE sys_ter ( uid int(11) unsigned NOT NULL auto_increment, title varchar(150) NOT NULL default '', description mediumtext, wsdl_url varchar(100) NOT NULL default '', mirror_url varchar(100) NOT NULL default '', lastUpdated int(11) unsigned NOT NULL default '0', extCount int(11) NOT NULL default '0', PRIMARY KEY (uid) ); -- 4.5.0+dfsg1~beta2 CREATE TABLE tx_linkvalidator_links ( uid int(11) NOT NULL auto_increment, recuid int(11) NOT NULL default '0', recpid int(11) NOT NULL default '0', headline varchar(255) NOT NULL default '', field varchar(255) NOT NULL default '', tablename varchar(255) NOT NULL default '', linktitle text, url text, urlresponse text, lastcheck int(11) NOT NULL default '0', typelinks varchar(50) NOT NULL default '', PRIMARY KEY (uid) ); ALTER TABLE tt_content ADD image_rel int(11) NOT NULL default '0'; ALTER TABLE tt_content ADD media_rel int(11) NOT NULL default '0'; ALTER TABLE pages ADD media_rel int(11) NOT NULL default '0'; ALTER TABLE pages_language_overlay ADD media_rel int(11) NOT NULL default '0'; CREATE TABLE sys_files ( uid int(11) NOT NULL auto_increment, pid int(11) NOT NULL default '0', tstamp int(11) NOT NULL default '0', crdate int(11) NOT NULL default '0', cruser_id int(11) NOT NULL default '0', sys_language_uid int(11) NOT NULL default '0', l10n_parent int(11) NOT NULL default '0', l10n_diffsource mediumtext, mount int(11) NOT NULL default '0', deleted tinyint(4) NOT NULL default '0', hidden tinyint(4) NOT NULL default '0', starttime int(11) NOT NULL default '0', endtime int(11) NOT NULL default '0', fe_group int(11) NOT NULL default '0', file_name tinytext, file_path tinytext, file_size int(11) NOT NULL default '0', file_mtime int(11) NOT NULL default '0', file_inode int(11) NOT NULL default '0', file_ctime int(11) NOT NULL default '0', file_hash tinytext, file_mime_type tinytext, file_mime_subtype tinytext, file_type tinytext, file_type_version tinytext, file_usage int(11) NOT NULL default '0', PRIMARY KEY (uid), KEY parent (pid) ); CREATE TABLE sys_files_mounts ( uid int(11) NOT NULL auto_increment, pid int(11) NOT NULL default '0', tstamp int(11) NOT NULL default '0', crdate int(11) NOT NULL default '0', cruser_id int(11) NOT NULL default '0', deleted tinyint(4) NOT NULL default '0', hidden tinyint(4) NOT NULL default '0', title varchar(50) NOT NULL default '', alias varchar(20) NOT NULL default '', storage_backend varchar(50) NOT NULL default '', backend_configuration mediumtext, PRIMARY KEY (uid), KEY parent (pid) ); CREATE TABLE sys_files_usage_mm ( uid_local int(11) NOT NULL default '0', uid_foreign int(11) NOT NULL default '0', tablenames varchar(30) NOT NULL default '', ident varchar(255) NOT NULL default '', structure_path varchar(255) NOT NULL default '', sorting int(11) NOT NULL default '0', sorting_foreign int(11) NOT NULL default '0', KEY uid_local (uid_local), KEY uid_foreign (uid_foreign) ); -- 4.5.0+dfsg1~beta3 ALTER TABLE pages CHANGE t3ver_stage t3ver_stage int(11) default '0'; ALTER TABLE pages_language_overlay CHANGE t3ver_stage t3ver_stage int(11) default '0'; ALTER TABLE sys_template CHANGE t3ver_stage t3ver_stage int(11) default '0'; ALTER TABLE tt_content CHANGE t3ver_stage t3ver_stage int(11) default '0'; ALTER TABLE be_layouts CHANGE t3ver_stage t3ver_stage int(11) default '0'; -- 4.5.0+dfsg1 ALTER TABLE pages ADD backend_layout int(10) NOT NULL default '0'; ALTER TABLE pages ADD backend_layout_next_level int(10) NOT NULL default '0'; ALTER TABLE sys_history ADD KEY recordident_1 (tablename,recuid); ALTER TABLE sys_history ADD KEY recordident_2 (tablename,tstamp); ALTER TABLE sys_history ENGINE=InnoDB; ALTER TABLE tt_content CHANGE image_link image_link text; CREATE TABLE backend_layout ( uid int(11) NOT NULL auto_increment, pid int(11) NOT NULL default '0', t3ver_oid int(11) NOT NULL default '0', t3ver_id int(11) NOT NULL default '0', t3ver_wsid int(11) NOT NULL default '0', t3ver_label varchar(255) NOT NULL default '', t3ver_state tinyint(4) NOT NULL default '0', t3ver_stage int(11) NOT NULL default '0', t3ver_count int(11) NOT NULL default '0', t3ver_tstamp int(11) NOT NULL default '0', t3ver_move_id int(11) NOT NULL default '0', t3_origuid int(11) NOT NULL default '0', tstamp int(11) unsigned NOT NULL default '0', crdate int(11) unsigned NOT NULL default '0', cruser_id int(11) unsigned NOT NULL default '0', hidden tinyint(4) unsigned NOT NULL default '0', deleted tinyint(4) NOT NULL default '0', sorting int(11) unsigned NOT NULL default '0', title varchar(255) NOT NULL default '', description text NOT NULL, config text NOT NULL, icon text NOT NULL, PRIMARY KEY (uid), KEY parent (pid), KEY t3ver_oid (t3ver_oid,t3ver_wsid) ); CREATE TABLE tx_linkvalidator_link ( uid int(11) NOT NULL auto_increment, record_uid int(11) NOT NULL default '0', record_pid int(11) NOT NULL default '0', headline varchar(255) NOT NULL default '', field varchar(255) NOT NULL default '', table_name varchar(255) NOT NULL default '', link_title text, url text, url_response text, last_check int(11) NOT NULL default '0', link_type varchar(50) NOT NULL default '', PRIMARY KEY (uid) ); -- 4.5.15+dfsg1-1 ALTER TABLE be_users CHANGE uc uc mediumtext; -- 4.5.27+dfsg1 ALTER TABLE be_users CHANGE userMods userMods text; debian/mysql/4.5.0~beta1-10000644000000000000000000000375612252640275012213 0ustar ALTER TABLE pages ADD be_layout int(10) NOT NULL default '0'; ALTER TABLE pages ADD be_layout_next_level int(10) NOT NULL default '0'; ALTER TABLE cache_extensions ADD repository int(11) unsigned NOT NULL default '1'; ALTER TABLE sys_workspace CHANGE adminusers adminusers text; ALTER TABLE tt_content CHANGE spaceBefore spaceBefore smallint(5) unsigned default '0'; ALTER TABLE tt_content CHANGE spaceAfter spaceAfter smallint(5) unsigned default '0'; ALTER TABLE cache_extensions DROP PRIMARY KEY; ALTER TABLE cache_extensions ADD PRIMARY KEY (extkey,version,repository); CREATE TABLE be_layouts ( uid int(11) NOT NULL auto_increment, pid int(11) NOT NULL default '0', t3ver_oid int(11) NOT NULL default '0', t3ver_id int(11) NOT NULL default '0', t3ver_wsid int(11) NOT NULL default '0', t3ver_label varchar(255) NOT NULL default '', t3ver_state tinyint(4) NOT NULL default '0', t3ver_stage tinyint(4) NOT NULL default '0', t3ver_count int(11) NOT NULL default '0', t3ver_tstamp int(11) NOT NULL default '0', t3ver_move_id int(11) NOT NULL default '0', t3_origuid int(11) NOT NULL default '0', tstamp int(11) unsigned NOT NULL default '0', crdate int(11) unsigned NOT NULL default '0', cruser_id int(11) unsigned NOT NULL default '0', hidden tinyint(4) unsigned NOT NULL default '0', deleted tinyint(4) NOT NULL default '0', sorting int(11) unsigned NOT NULL default '0', title varchar(255) NOT NULL default '', description text NOT NULL, config text NOT NULL, icon text NOT NULL, PRIMARY KEY (uid), KEY parent (pid), KEY t3ver_oid (t3ver_oid,t3ver_wsid) ); CREATE TABLE sys_ter ( uid int(11) unsigned NOT NULL auto_increment, title varchar(150) NOT NULL default '', description mediumtext, wsdl_url varchar(100) NOT NULL default '', mirror_url varchar(100) NOT NULL default '', lastUpdated int(11) unsigned NOT NULL default '0', extCount int(11) NOT NULL default '0', PRIMARY KEY (uid) ); debian/mysql/4.5.15+dfsg1-10000644000000000000000000000005612252640275012154 0ustar ALTER TABLE be_users CHANGE uc uc mediumtext; debian/mysql/4.5.27+dfsg1-10000644000000000000000000000006512252640275012157 0ustar ALTER TABLE be_users CHANGE userMods userMods text; debian/mysql/4.5.0+dfsg1~beta3-10000644000000000000000000000060412252640275013202 0ustar ALTER TABLE pages CHANGE t3ver_stage t3ver_stage int(11) default '0'; ALTER TABLE pages_language_overlay CHANGE t3ver_stage t3ver_stage int(11) default '0'; ALTER TABLE sys_template CHANGE t3ver_stage t3ver_stage int(11) default '0'; ALTER TABLE tt_content CHANGE t3ver_stage t3ver_stage int(11) default '0'; ALTER TABLE be_layouts CHANGE t3ver_stage t3ver_stage int(11) default '0'; debian/mysql/4.5.0+dfsg1~beta20000644000000000000000000000536512252640275013054 0ustar CREATE TABLE tx_linkvalidator_links ( uid int(11) NOT NULL auto_increment, recuid int(11) NOT NULL default '0', recpid int(11) NOT NULL default '0', headline varchar(255) NOT NULL default '', field varchar(255) NOT NULL default '', tablename varchar(255) NOT NULL default '', linktitle text, url text, urlresponse text, lastcheck int(11) NOT NULL default '0', typelinks varchar(50) NOT NULL default '', PRIMARY KEY (uid) ); ALTER TABLE tt_content ADD image_rel int(11) NOT NULL default '0'; ALTER TABLE tt_content ADD media_rel int(11) NOT NULL default '0'; ALTER TABLE pages ADD media_rel int(11) NOT NULL default '0'; ALTER TABLE pages_language_overlay ADD media_rel int(11) NOT NULL default '0'; CREATE TABLE sys_files ( uid int(11) NOT NULL auto_increment, pid int(11) NOT NULL default '0', tstamp int(11) NOT NULL default '0', crdate int(11) NOT NULL default '0', cruser_id int(11) NOT NULL default '0', sys_language_uid int(11) NOT NULL default '0', l10n_parent int(11) NOT NULL default '0', l10n_diffsource mediumtext, mount int(11) NOT NULL default '0', deleted tinyint(4) NOT NULL default '0', hidden tinyint(4) NOT NULL default '0', starttime int(11) NOT NULL default '0', endtime int(11) NOT NULL default '0', fe_group int(11) NOT NULL default '0', file_name tinytext, file_path tinytext, file_size int(11) NOT NULL default '0', file_mtime int(11) NOT NULL default '0', file_inode int(11) NOT NULL default '0', file_ctime int(11) NOT NULL default '0', file_hash tinytext, file_mime_type tinytext, file_mime_subtype tinytext, file_type tinytext, file_type_version tinytext, file_usage int(11) NOT NULL default '0', PRIMARY KEY (uid), KEY parent (pid) ); CREATE TABLE sys_files_mounts ( uid int(11) NOT NULL auto_increment, pid int(11) NOT NULL default '0', tstamp int(11) NOT NULL default '0', crdate int(11) NOT NULL default '0', cruser_id int(11) NOT NULL default '0', deleted tinyint(4) NOT NULL default '0', hidden tinyint(4) NOT NULL default '0', title varchar(50) NOT NULL default '', alias varchar(20) NOT NULL default '', storage_backend varchar(50) NOT NULL default '', backend_configuration mediumtext, PRIMARY KEY (uid), KEY parent (pid) ); CREATE TABLE sys_files_usage_mm ( uid_local int(11) NOT NULL default '0', uid_foreign int(11) NOT NULL default '0', tablenames varchar(30) NOT NULL default '', ident varchar(255) NOT NULL default '', structure_path varchar(255) NOT NULL default '', sorting int(11) NOT NULL default '0', sorting_foreign int(11) NOT NULL default '0', KEY uid_local (uid_local), KEY uid_foreign (uid_foreign) ); debian/mysql/4.5.0+dfsg10000644000000000000000000000363512252640275011736 0ustar ALTER TABLE pages ADD backend_layout int(10) NOT NULL default '0'; ALTER TABLE pages ADD backend_layout_next_level int(10) NOT NULL default '0'; ALTER TABLE sys_history ADD KEY recordident_1 (tablename,recuid); ALTER TABLE sys_history ADD KEY recordident_2 (tablename,tstamp); ALTER TABLE sys_history ENGINE=InnoDB; ALTER TABLE tt_content CHANGE image_link image_link text; CREATE TABLE backend_layout ( uid int(11) NOT NULL auto_increment, pid int(11) NOT NULL default '0', t3ver_oid int(11) NOT NULL default '0', t3ver_id int(11) NOT NULL default '0', t3ver_wsid int(11) NOT NULL default '0', t3ver_label varchar(255) NOT NULL default '', t3ver_state tinyint(4) NOT NULL default '0', t3ver_stage int(11) NOT NULL default '0', t3ver_count int(11) NOT NULL default '0', t3ver_tstamp int(11) NOT NULL default '0', t3ver_move_id int(11) NOT NULL default '0', t3_origuid int(11) NOT NULL default '0', tstamp int(11) unsigned NOT NULL default '0', crdate int(11) unsigned NOT NULL default '0', cruser_id int(11) unsigned NOT NULL default '0', hidden tinyint(4) unsigned NOT NULL default '0', deleted tinyint(4) NOT NULL default '0', sorting int(11) unsigned NOT NULL default '0', title varchar(255) NOT NULL default '', description text NOT NULL, config text NOT NULL, icon text NOT NULL, PRIMARY KEY (uid), KEY parent (pid), KEY t3ver_oid (t3ver_oid,t3ver_wsid) ); CREATE TABLE tx_linkvalidator_link ( uid int(11) NOT NULL auto_increment, record_uid int(11) NOT NULL default '0', record_pid int(11) NOT NULL default '0', headline varchar(255) NOT NULL default '', field varchar(255) NOT NULL default '', table_name varchar(255) NOT NULL default '', link_title text, url text, url_response text, last_check int(11) NOT NULL default '0', link_type varchar(50) NOT NULL default '', PRIMARY KEY (uid) ); debian/mysql/4.5.0~alpha3-10000644000000000000000000000265312252640275012362 0ustar ALTER TABLE pages ADD url_scheme tinyint(3) unsigned NOT NULL default '0'; ALTER TABLE sys_filemounts ADD sorting int(11) unsigned NOT NULL default '0'; ALTER TABLE fe_session_data ADD KEY tstamp (tstamp); ALTER TABLE fe_users ADD first_name varchar(50) NOT NULL default ''; ALTER TABLE fe_users ADD middle_name varchar(50) NOT NULL default ''; ALTER TABLE fe_users ADD last_name varchar(50) NOT NULL default ''; ALTER TABLE tt_content ADD KEY language (l18n_parent,sys_language_uid); ALTER TABLE cachingframework_cache_hash CHANGE content content mediumblob; ALTER TABLE sys_lockedrecords CHANGE username username varchar(50) default ''; ALTER TABLE sys_log CHANGE details details text; ALTER TABLE cachingframework_cache_pages CHANGE content content mediumblob; ALTER TABLE cachingframework_cache_pagesection CHANGE content content mediumblob; CREATE TABLE sys_news ( uid int(11) unsigned NOT NULL auto_increment, pid int(11) unsigned NOT NULL default '0', tstamp int(11) unsigned NOT NULL default '0', crdate int(11) unsigned NOT NULL default '0', cruser_id int(11) unsigned NOT NULL default '0', deleted tinyint(3) unsigned NOT NULL default '0', hidden tinyint(4) unsigned NOT NULL default '0', starttime int(11) unsigned NOT NULL default '0', endtime int(11) unsigned NOT NULL default '0', title varchar(255) NOT NULL default '', content mediumtext, PRIMARY KEY (uid), KEY parent (pid) ); debian/typo3-src-4.5.lintian-overrides0000644000000000000000000000111512252640275014720 0ustar # TYPO3 ships its own modified php-openid (TYPO3 specific addons) typo3-src-4.5: embedded-php-library usr/share/typo3/typo3_src-4.5/typo3/sysext/openid/lib/php-openid/Auth/OpenID.php typo3-src-4.5: embedded-php-library usr/share/typo3/typo3_src-4.5/typo3/sysext/openid/lib/php-openid/Auth/Yadis/Yadis.php # flvplayer.swf is part of TYPO3 and selfmade. typo3-src-4.5: non-free-flash usr/share/typo3/typo3_src-4.5/typo3/contrib/flashmedia/flvplayer.swf # nimbus.ttf is not shipped within debian. typo3-src-4.5: font-in-non-font-package usr/share/typo3/typo3_src-4.5/t3lib/fonts/nimbus.ttf debian/typo3-dummy.dirs0000644000000000000000000000004412252640275012263 0ustar var/lib/typo3-dummy etc/typo3-dummy debian/compat0000644000000000000000000000000212252640275010371 0ustar 7 debian/nimbus.sfd.gz0000644000000000000000000025563612252640275011626 0ustar 9ANimbusSansL-Regu.sfd[IWrFf#n꺐,vsCRvHfVSG8q2:)tW?~5S3맿ͻ_/ ͫu7o߾z7wtwoWw>իoxp?|W̟ܽ~ws c~7_;t{]|?뫯>^/qyuwWzso*n[_߼Ǐ/~?{ۋ߽Z?[vJX͗ᯮg_oWW}^'s{wmq׿oo&_}[\,#_3n_} 佟BÛo Ww}o+пo~ҿ|op/㷯}×_7uxW?:?{훟ݽy՛o/bw_vW]o~?xO/m/ޭn?^p߯cO-1_ZW-Uͳz炫~}Qcyop{7Bo7agPݮZz|۫ >ݫ;R|S W=z׷^~wiUz3|o'y v?ۻ΋u}qx~?(OjIk~ۿ~U~΃_*o#RZwՇoq쯮>{_kZJJW!:SJ/~u?vn[fooNˆW-\b//S'Yj`{xuͲ [zJסn8d*D+UY?&1<~}a^ȃJ}GqRסիX~/X?W?wœk?/MgO nOfo-_aNѮO 1%7x!rs~uNwv#;/vqʼֈ|z헿or})ZviJ[(JnhhǗ\9h&ĝeX*W6~9 ?ЈWՆWẵsGn m_q"WB'vC1YeS**B%k[>ET ]eK$zkBuw:@(mvF7ܵɝEw(ʪ= g1QQN#UJO9= o/" c7}8z}6v}?S&<ȓ:4R.b?hX*mď75vRxW2dqf=#0njvIz>-t1pe%"h(j'sKw:R P݆}Y۟6n]}8{d14}L?ٗj_6ݵ D||&]fe{3`KiZ)rMӏڟH;7 T3•%M#F /L`:!NS^`I}Vjeja]1Up asF̷ZAO37Úl2>Ԧ}rKL^A~{fgE(N]b_$+ʶ|}R.3p}soz,ip Al[Rl0jxSdJЗR^״4.#lja @1O+a7'֍>D_eNDSv0} ;T%b؛x /M>(amx˺p;~$Mۍ*!7`2]B[H&l9nfcoMg2+QiW10@izw.[c'>JOS6ps%6҈G1t"GNƣ9 㕞1p8ߤ:=M {T(M[0!$`` صi"pIZ459V'6/Qˣl~\Ü䔮6>^{[W+|J\Oj晓["w>aSsxv:@ sGUK@BC9ۃq΄Ve[,,\9}V].Tqh0XӡEG^2}9*T⧬:,Ē%겄qxHW«f R0E첅?J׷JKOV޵A*4֯MV4pbZN@.5lo`ZqFhD=q#r( F ׯ֯bUU{6nL–B/N† aN& D{@(8U8cLr=OVwֹʑcuێļN;6wj\6iOLXkk,zO R3V04՗4@}a [)Fpnr 0WX?cVCˇ'J U3b}ޗR'W>!£ē\^`dM !$hީGq6 5!1 {7nckx] 46'V9>(skc ޳&35=L|y {^Kƶ} ϋ)ޡ dwoFɏfGJCt"!^aNz2;96˸a_O5Zu R9=T:U46j@Bķ/Ϟ(-6DHxI qE`֪h ($ }@C >(:: A/[ndfYqg9m"vƅj]\Xu[[ߚ`VAZ،Z$%j+7 aD@֘ iNӑZ!Nx16|acUlOB >t3my x.-a!dV~] a2Dkst)5X?޾}YK\r|OH< BVV{Xp2 kykֲ}B@^CSR~Bm.E<~znǯmOtSpw{+_8YVf;dX!,">7nCF) :ғU_&Ϛ2[yoǧW>}9?ߜfE.?9T'IqJ%XyCW{XW'շ>eùƻŠc0C+BGs;k 9iNیp1Rt9R ~RK`!ZSE£SI)@ lt$SI1wF`b1A腭ZQ& PQ@@0dvD\]$ jtns9P}giÓGEc}0xwǷ{7y$d^\gۇ0Bn}dp1]w5O\Ⱥi=%rA47/rgmU;QA*}3~TK(a&%̅4`AG~tZtjh_'pݾ.1g˜~{<['MDEv5"`m!e> ƶX)ˈDm s.i5š5|_-#AF:e[0I) ."9H !qX{PHXh6qJO>Bb"H?d,Yd{!Aa b l @ eA=Vel+'Xَ}m-55d侸/r f9{Tt եa1 ֥Blr:j./p[GA*|0?.3%ou:ws+yqD֊t,Llll/r\:ۯn}ts RT.s)nsSIsA}nxIAJ]0Q&UTy,,=Yr*֎MApB 4z1O3)eWWva>(#Л1ʵS]v Z .imtX?ۯn}sVI.$X8=hهT֬ ̂%/"I$J^g* W@6i2`~). io's;DzhHni»Ж~+?24HnIbN*R5+:U;ȌIì/nP>ʁtD rFuA"]un  le^`+6,HNI*$֍`(WI& lnt KCap+lcWD29AZa$7@tӍN78\Q^Ѷ֣ 9!ĦNJX#%\s(y ՕŽCkFepwml%y[=k,H,MGb['Kע_&L̫yYt4nfX^m.,__km &jvuW$,&.ETC ##R)+F:D A0tvD`ETÌ+ġёJK|b,T0IX?8q6^3VYa|$8bJy`pBirǍw swm#Y^ynMH~*E9QHT}Fݹko8osnDaZj4FMqrR![>eD+=LqJ "TnNTNTu\lzƹ/oBҕftѪ)Ê!iHKD& CVMAtoba?ɳFco;S钀J.Nh;XVK^$in]+ž6Y$Ŕ襡$=70?EN.Ho: s(/>)[!PrXH%;+ovɚ7G@G*!~V~GXK/NY]_K!4I 9s.&n ~G-ɇe|U$6b=wsDrSĜ!F]BmqZgS ͐!Y BZ)_}@(8eʲ09{fC^IԹN0e$g+{7E1P!lr#dʍy0z@3ϩ`ax4l[U#bj; D65^3b<3AWCaP 5^[l?t7mq"3seh45ܗ*Jg6 "4! ۜϮc3_ǣf,^s><+qY,75!Xrg02󲤱e3hI8l*`SMQWK/H1-&±-`6֜dNLT} 9f~8EVVˑsXsdQw^6)?)>pH+}KEU9k])1Q.|* S#P95&i'1Spԩ29UV^92='7[]aCP< ()!6)EהªfE4`_X DYnp]?h0LDFi)`Y86 ׉٠Q>>ArTKZ tW$ EADm9P؈{~l.ҪQ~H&s yHl-ҋ7#1 Pƚ,6">6L4Yl jϵz@9s'w}pn4ΤT?erl": 郅Q%Δ>n#a%)%2^;+' m.x:i?:ڧE>ge_͒W~Z!N2Kns\v5iikB,e΂uuU{ZS` ,v״w#ڃ21ĥ@d3+0/XjW`d>H+qsd-<ȜiЧ^Fs./k׳7W>k,AS>,qdȬӖ3('#8X5Pdn65B%4amZڙS,O+Գ.n,MOkڷ;_6}ykkrĨ@z n"l0ȂdZuv9O#eUnu3KݟPH.Uślz #j"Xs"IBQp5-EGt ,$֙7TH0 ,}Qg/\6V;δ W馮R7ۄ<b'3$vYU.HЩٖWF deZ7)ɚXCi ?@E^S 9a:K(GAD0@Jѩ1g[ `C=A,f]й"e@Z +3R:,U5A"QQ)t@@ 4 jr |Lѕձe#)_*1gْ]tC*X7KzLk n 󆨏@Tj*1c]xmh88E5LKO0kϘ4⣲ W.Hu@I+HPژJ?WzuUV-E)j$9XXTHp̀&/#m8H%jٛVAju{vtV8/;e*'~T->m$"Y~Wx.Z CxɣAZ=?+V~2A YimRUzi5j̾fMܗ B`)YNJnI߇ X&@WA +3Fp"ͦ21"|ZRyvŪ-Aͷ`3O)) `^#ȁTg1A8U*OU}<֗6k/f5I; JdCYcR]$vӴcfZ.s&6ђ]d ֒@Q1s٥ۃnbC) ذ-a(m";88%s`/ =t:B{?`q( ԝW6{cib4+dX165uC=eY'mfEZ͘B+=t2fXDKP7I)$*1\!fmMRY!(ޡ!iie")ɶЃ@ p)kx)l`ā۞CbH,?0zuAؖã_8Nr9YӃ:*@X ,MHۛL - ;>D@I sq:@ ‘t ܏蠜}81K "p0b Pӈ%<ƕy@?ÕV$[\[>cg\8Jh F4~ ZKa@8qs51rD л` }kvzh4GRwf cuLR98br(R)sYGf8@BE(5U1e"$K"]!6~KpQiok@BK_ﵖxX$ +6K]B|L銖(b=Z"?VVv덨ۣYU~1DkY*,s/E`,UNsR?;&5.GiGp!Y҄M d3Q ~L= |m\!Z-44gOSR42;fMheRDkDPP㶅V8}ޒMUgo~ضQ򧽲𪴁 |.uŶ≁je-ҕ1_[uu9th_'ĭ}It֑"ii\kcie[[(+ks{sγAr7VaMWv.D{hʿvzX+ ir'ڮ.fJVW!o67_2Aj_Ǡ0ۋP F(,(}t5m8\gWƗy-Mtz afG(1lO*H"jpDiKׅz! hGCsuddc3Ԍ:3UƂ?fnouD~l%n],?.i<.@= .@.v fCO9LrG2ic c{{/n؈ !й qߴ̊OZ+g8 T{;- js+w*(GTYjҴ,AAҹ @Xɢ#f^6v-v.TlY{\ hJ4ָCCysv  ̾S;~{0qo}98@<.h$,ڃOT8wHM7'9VJ9}ԭ)KU?]:SbcTi)-]'6jb5ɰ΄)aXgBΰHWA]Ł"!܌yMapha_-t[/΋Ap'PDQ`W/*Wɩmd;3qi$_\*AsTSzbNޘ4=<`뫓}]|*CGEϺw| & Uc(hhϧ6Kv;#%pM:+:5돸l %IC7O ŴS+YVc{s}XUpWxY.b'cS /* K$=Vxi1 'ZW:}|&¬ZktE:e@f#'iHxcXE<1^6{z{>w0eGק(=*mTart 5YsGZ߆}kUGWuO%IiTĈ+E Cct`aRBNdZ DXe=,U2E^s&f- Ȓm\9ՌLilsZ4esLn%uvfr_] j,E|kDůY&[/Eʂ̦1w Ujf";jp5գ^S%A4i%C!1"jj& pP*FBfHdʣH6&^4ԍY>ݤx'dka0 C2Vې- NȕLL^hēOԛ+[#!dw8& `ߪkL*!K.I";^܄TmYwJh1jc@*Q}20eV y{1o&X/㠁L )ҫ̂ @.٧2quڧۅ;{#1,LoRyעpJYEKE^R&*Ou?LrŽM>/n9_@8#u>K^1i6vNe޾CN]8k}2~U٤ 9%j;S*h1c`u]rK>T ECT5+SJd?ٔg'M#* PbWg-$U^d"5j;˭4Πӡ;:z{~Zea5_o҂gШ~ o']mn4ɥf>Oǹ/2ewNw,WP[8E9gS:N::ع]J //8d135z]]T$]`(!A_8o3qP;,RM9܍H&LE ?\-Ba =CX:,^YBxv~Oo$/ KL$tu⏇y] \aE dpն| ]軄,);]eIǨZ}wv*g(c2$ AaQ ?x黚  7+˙%Jf!FVeAOСҧxMiUVS@ɯXrd,T0zpde7s_r+DI*Ym}Y>Up! *dkn]ǜšvĺ=50\ I?k 2'ʲرv` [OSy5[b hr:U8qYhb تT^ ͈`A.j J  u`N{UbI<׬] .0\f i J^sA(gݴr>&Ek47#eŤA{1"!@W+SE7\~Ks6ǴyԇP٩fl7>:6V}S 礱ObO#c ҄!kk‰9viQ3C ӭ|M4|6e㠎 N)ZP]) >i2FXbS^ˡFIiE ( s,W1m[ :l?/7w_uǪCddJ ڻ`Ƶۤ`dpMDB}NzTET@ [hA ]R5,[vˀ7 i*} _%"x(b†R& T3` G)а(Ncܤb"n1F2bf < W}Pi+J4?,2¾dʓʙZ6B q%ƃNK>W'GX3< s c stظ y\3b5 smH)Lɒ3Jx8"nN$v'OXD) di+rkŘh=2!4ZBXČ NAe}8]2b2" 1a VN.~qB `8 /=Rw' : VUVU%LO 4ˆjJdCmg#$\ pC̔gIcw6O&,{W B!ʺpwYJC qVzK^Whfx 0a=ߝr؟7IbH-b~\c $jBuUF1e t |uÛ#@rD%`:,,'>}_2o7 J.ȴ.jdҍce*m74ai*zNDtW>貐%+XehMLAh" BMJHT5h]Q1D8V=9߫_UAdc-yN4ܜ,a1!vVLyo&ZPa^H\p%sszMIo{*S:MD,v^'C E"¯H ť/m`>ca`Ġ2N`:!t_#z]JF#ae <$,mBIx󩗐0 DQ j@[h (@Ū)$cbeU53jlW+wdf:i轎,(QA &9jqVKYlk#okK& ,Ols,ѭD@頢VQR4ieD%h ѢbQӄEH8YϲD^ѐ Dpܧ#q4f"qkQ * k-Odڠ;>Wtׁߚ n 1s$%Ņ Ҥ(-NWCrxY=|7nD5Dm])0 =;냫yl;Xl__##Xk?8琠i#/*przəQ>WQЫX+>F<gJVZAbQ6k@0)`^,]'lP! Xsȁz?%LF^ژfsHvD3eBEQ4GV6%hOtS5 .JY &|x21h_j"0b08:RHfZ*'1}Y(%8I :-aUyKbi0 G<7;}c'NS~ō[TKI6lł1 IO6MtQ{i[Obc,eOW#ϞD*]? 7ƾ-t-)El3-<5YtNw i z .-O %kk^;jm}ڐ>ڡK7u:Rlخ GhȰ] 5\NUᅞ[lnM9I"5IqLIBqJseУ q}'`4 Sܰ]%T49{ l Ňhp#58L. |I H2\t{J$8/(q#.)F\qc%ň#.9Avb u`_QBiF+_<>o.{Iɮyɿyo?}+TwW_Inư حQ "vu~9AdN[֣͚g#aܞ;᰿X븿ج)aR(ͳYS6fͳYl֕͊YPZ9EBn#ڔXe2?;w<YܝXaY= 95>fɱ@ )D7B9YOd_( <ТNeӥ"LjthŐJ wg8rKGalqt =#1Ow5wР < 4͜${viHan?iAk1$:g1 5^q+9L?hV|Wz!\ohYU3t?%Oé*,1ey y":@8*5&qM1؈Q3ْzay f}%OFtPXJ"P 6 X`ڦ,mHd%Jl4ٵh|B֘ٯ( =yv߿x0]޷>^4Cv63=A 2~gMlc++Ѥ5~4"tFC|A+Yd!sqs 5L-7z3O`,MԆ˛4֤X44o#nTaaOz%i賚=mPNA.#V}!o28U$h23i8kJTZuHeuLu4U(<g< 72hci4ҲhC8B2!U0"Fg/yYXQXy]x?Ӹxj(b/T$jžv嫬I/6YjFZ,_)=wwo0ф8};e'1H ƭCwp܁k88͑8{/~?ObXky 3:waKkJιyw'CvZ;LyD?}|<@#̄9OĮJq|Q!k zzD ֒D!I[#ʉLXAA4\;-~}=)M tG:> "|v!Y)%IQPȐoEJXdkg zx&<ʞ_Xxs ]`Xӛm-ԇfaR͇f?b}S jJ4yÚj~.Z"@ǮA5KmE8 5`|yz :'a C뼇! eM;cGC>| 2=oU>j 7AJ'Χۇ!׊|8vmy>?$p$$H=2#g@^_SE:m)n(kY`_Cl$1KfgĝȺAșK (BfᖶE7T| O 7JtceѠ.=u =+VO%K1B暁aT`%Lj #(X]S|w+BIQ A |\5ۦAg֪xXƓ"E<J.11MU\fw]^-۫p7c#`d%KO4.8.zWCW u}27^;~'Xn !+kC?WTaA/@yXw CJ4x.*c\X!t4A 岙aF=(߾z}?uHqHYk4qP_.Up*X'A(G  N~G9hא06gq&iF0; Aʓ@j zb^o<]vphEjLsmR oL@`ar*R+im PƼbv[BfH:`DTUmR4* Qϑ%B(qm^ +ۙMA?CIHpɺ]ʞ@v:37ww}5,6rAb!ܰ8殠#m[^&!H.MNȪgecj}=㪍'Z08e۹USzMWR87:L.,z/roY[3q)''?|z޽yİ"%3"J\ 5,N07wQ<%#y#c“CO5߿CT/]9 KA`)%(X1.S! 5k&6H4*!-yC!L/԰%s`l2ꈽ8˵aUnZ#XU@$<`aN&vVWx"Qnptr @ ߖ"Z[L3ڧgKFc-%n|t^47(c 'c^XS.Ԋ"Q6}KQ#BO$zA@IH; e8űȌN`Ob;s.r@mCZ?f߆P#f.{;Zf6ũ 5X)jQ'HyQl}:q4#cTK='}P~jWo߼8p!S(FLHػ"cͫ(o2p nS l& Ke P!ѧ8bQ VTC1HٲӒJD4&uưH\VFLW}&gI"TJ@ hb< "KJG(BcL q$ &OfZx0"9n٪= *"3^3A AoJ`Y8l(SE,/e`!sqXGqPPUMO$7\>B,$̟m}Y_ңmBm^y@Jerŝy%EtxhV t]ogLX[:ylۇ-. 0揔``.;zNF nKLh/9@p)A*4DhĄ͕1b=iCSΙU:I*X.>Dnz ! R T\_ *HAS>C[<=HѝO'.>x,=SeI\##JV5%AZc( F1No]c4&$xI@*7oG߾=@e-1aaŀaOPMfMoK)ӜO%d'2{&]`>T*eEQ򓂕:-$5f *b&}E-k(_1r18Q1VQa 2P@ A9{)J )=WތaC O:} D,yzV*5 \ Zi[FW6X8 M`VDֈ-C5\@ac!K!+W /e-gm\]ynyN&Ct*ؑt_D[v""r3…'"Nl_H`N=|46-"r0Zkkk˨ʕs,D E@8,ſ}m1$)G,4f%e2˒#v)B`\!-bnxƬܸ3840ȁб{Aܠ2hS{{a) tI3"VWa:(a(3vK׷޾zBL/’7 IyOqP A!Jw.oX\Kb ( a 74}#[9D&YNgfD!WM;7‘;C-K0XDzrdh}Ѳű+ho5U bRMSպY=(XnM -LBlNs7ԉ-8–Vʰ#>B u3ÎPRAX~rXTf%l=t'=Tt?Y~ lsW+ӀHRP<NNj KS踉%5dD! 88RaXUC_h !r hM*ܨ ʁaIk׃$V;b^oz}Auv>bs1QjҞ|#2\$ڵ֐r@$F]!~I*"!WL[NRУKe:d6 "9,`oru\Ryr"<>11jSE j f9Pm_8Z+WQ7,˪vFu۪5J.YYQ&^,.EN\4R?`k0pMFa6#σ,a:p~r6Qg˖pAP0!2cF~zNEяZI,P1]1Cr B CDYqk쥷̙?gOd$$r&,GSYYk# 7gҡTV% #Y-< &&8$??iJm2ߐTtlI 6}鳘@$(;L6(A,Nfn~.%<0G\~mYh7(됷LgA~}w aHnWHذY Pf'$fCF] _ЃZiN B{@[xco-DwKDtXpDoc~,$Gy- ?l'RB#HGƽC3 \o: 0\^R0g#N>L(xK2 ։U 3u1s t;-+wo=?rSPuhp;11(HrP+ZcbQʞ? mZ:Ye5 Ii*ߦ'g~@WBKe,]:0,6XšPˢYq-L 7ì ]zP4 &fդ,rsC}—xy?ݷl$XMdmktYb vOx~N>XDi.5( t5Ӯymn)X9?}DvOG^W E%k3_>P/1xcN埉zʼn0.)=9|{މVzz '3 r׳g8Dz@q*.a73e<8@ȓ_>tԉx0S\ZR>O=`FNrsv EeW`/}4P}if5Nܼ^ U1~,{hs%"l{`svɟ*ҿ~HwZC?RkA{Q#6׊zş*~Dҏb#/5mF.Ri8VõG'_TF  OSt RS?Nq%(:aL~|'U<Ώ#D"!=:g2e&7L*,B8(t?y7] J X(PG_DEHo\9H#ǝUnZ=fKD͚ E$ huB+X 0XK$uBK2/{g !Bk=s7Z+l= 7ڬ06;HYb-p2.?T2#Ukx}]8(qMs:jpAtXu1no,lؿdm=QFg{e[%a ܆гqB]?!-d@?x6MEhR6!d #Y& l ,"&0X Rvspwz0lV$(meH&ђ4lFOl{fÕm2DdX@l3ۄ8506Mٜ=Ɛ 9VBOo? !EJ\R@$ сu؏bOYyozgQYfL #,#ŸxϜ'p#$iR`H9.{ZŇiO`ssA#+3vƬtTbeA8:Z:JMX*Eَ*1V$*TJ|NȚIb=TR 띈]TؖJ#36Q)>U,- C<YTT$USA0Id*C9M#*ň^<~t^z$3- iɸ.FI}]<"Qk>O d=Ϳ{ H,31i#|BNzJ@HqE,%3b)iIEftCYЈ<\O&{ ƨN^^02\za>+I@Vg1'ي`*^kUDEl ϽpBѽ-,9us QL7h:pE!nMB !W,:Hhphg|T A`[, C܄֒>/ yE$~G,W#Wyf@glH3.lMӦK7oӞXpBA"&$r4jMBT9dYl]mbkإ\ k J5Zw̿/>LN.C"+"wa Y/Tb@7HEF&\9i5_*"45DߡB1X-,x.@x(bR4m2M";drVg&e_JYʑΚtFpykϰ=Tl5hI3VB2 4<@_)А¬%%CXQ*1"IllqT, j-RK](%Bu-/9NZ!vT|)\+\y8}NN3Ca7KT3e!=`PcQe+~1((xբLBp Zz!fb3Yt b1#u.?1C9>!fD(86b&\dݙ3-!aony(}=fexfZr Ţ/ qLj4!_rޛ~_T )SaA^6^x:9pƷ\Q߀J+E!kơAcy(PñBh6g#<.3̕ҁ9W1)c;k@+9_%XAq[jBB^G|i6ݹ=zHhX3tGolϬqYw+Kyyәv<Ě[WHgzGdpDڂ੎ 3j=dE0+Gۂ8&9n]β˙؆݃ZY k: h\G؈5tWm>f!#HE‹G /"W"RxS› `)z,HA8vpfE ) Rx޴hI)|(Rx]H,#4zrcnq-nDr]os#~^7G5f̳s2ޗaY/jC%f*i Rvujgyc~*_;w2-_$q5|"Lem yt}Xܐei`V/ lu\Iy4&R4s`5/%8\C\ԣEt\}y)u>.8ay){4,Mpk?ܞnJj\ߞ+;mjހռyV X7`e 3Vv*=}"Fǻj#.謍]qTӧ-4hv#SW_TgUg ,On R>^"&' &z m9unΖfɧ]߾}ubZ΍k&4- @Ev,z X:];eBMn+ ܾf.llJ;\yHb!bjvvW\ iBp\ w-Zk翞p-l;.(*w |V~ :ʞ#`W:{Aێu.-l~8OK(갆n]L#PDẐtNӌ]yrz>nz Mʦ̚}g? { 55rL+IT(%P نQBCa 2hpE*dxPFZpˊ&TeU!۠6=g0SKN< /1*^ Do"^`h CYZY(PPʰP z@]|<Ô:3 1/]ź_m2#x- ]&F }4F}'1.Ep7>d| &r?b=Ճ9p"mv Hg9 SjM+~EaRee?]DhIj7p`֟Agޓ)ג}g߽(#pEP(ϓqm[x:>8;+Zߙ16 !f՘诨Eẉ:X ,Pѻ{WsPbUb|U_>O?idWQבٺPڑy`MDdӅWm#JIyy`sJ,u9UM|7P# "H+=KAG#j#ZY}!є*(0'x&:H*}_~Hlܜ y<$PC&0r"nl~d uo $Ox3Is=< Hd*m%x~]nJljmlGK3#æKpY6]HeQƼec6 ͔y1^?3癿DStW'|Cc:?-o| [V(v`( 8_οk+5f") e)%aI|bM]0Ղ "eh#t*1F QF;kMnFh%@S1 ׼xyX.h Ae1"ϻ^?;WIPkY4΀:.=ZBBh25|D$aFd +a/4~:L!:S@ޱ*ERGRҨVoYԊZӃ'%9  uC:\ +!ɺA!G!Xwş.`  G )_#GhA3Bz ¸!n]'Bz!]@Ze҅ڊ 1!=*B:@n>]Wp !R~B+2k3呙۰#VK؍~vInrc7]0v^B2v.K|8?'imsRKYY{R$M0hEx*@&n͜.s7 G:p3tyb)E!D,yv)ixzV$.%&k,S(*oWCG;Nھ6bc }yǠ(Ŧ.4XVx:;:bP pRoy]}<#q)P{ӌET8j2Ƨ^v+ ܢ`FTf&3~[Kv]Qc Pmh%lk(d)̔.y]C;oՂ#M }x. J4EUCgÐFeT$SJ%Zb+@cȤ2'a [Xq>Osv=w{:/I˝Tǝysy$ 9!{|;%.GvvL`d.>vPw1x0?S veۚ#0ڎd֟y'gN1=zx;\/ tq fmppaI@Lή̫?u^=im}FG<'7(cT0 |#*.p%VOqZNOq"/021i?h C*9a3"a1|,>n2>YAl؍, v}7Nu]XKދyV!X 狨 ZЍ2ֆkkAZ~XP~0dͱ&I<N[p{=glvH N?Ku֘:!5oZVjv>!+gO"p9rK.rh±#u UCJsMQU-}}\P 瘜u`> +|H~JJ`Xs"[)P]HX1a R}-<1;(w3, PΐusT a]| ORmG)"ܵo~F0791_IuF:cn 3]axxDn[88{ƳDӿSv~덨cUcUu*[os\3w(M[T9,i7Ãw 󀃴h8w`:Dlˈ:sn w!c] b^y]/6@Zv{sٗMoY<k%Ԣ aOdXʹMֈމ{'!*Y/G?sC:7~TOcG.NE;'9P5h^~Ryg{耙/͊5 >,PJ;?(5H?m/0|16@gZPm.%|RZT&ZcggWIEᰎXLR)H+T8 {hBID&TTH&4>QTOl^(O$EjMhx}bS}">Q U'ţ ' {hBzig'ʕC< S/?^ӻ_}էCIeAEjz]({MuH3v U3.Iv>R2P[ C>R2/ |dKz$P%QaRQe\1YP@x$ Y9_ݧґO[. h"lzͿ>|zaZq:~ !Ʃ6g[=~/_ \+vg\>>cޱc{NJe+;烸2 s/קP1в-pA$V: l\plx`>(}PXa/־(}QX`퓃Cp 7t;aTIUa/f.`hA@UBt aӄ7'?=R]!>,Ipѷ%+8i5r `pD/*S ާ>/ιPDXeK7pń;6>U >l_hR\nߒ* 5Ȏ35&}<|I}dOh^}B(/` , 93uHV]"l.OI3~+Z̤Ե\|X^t&pä!u<'%~H}-.'!gOt9yvgtzu\Rt8$|nG4]<Y2_H|Id!P,~>4!TIbA{ܠ S\<<1/NB񔙲i*EkL^Qe6~5Ln4>.#@A,Vļޮ&?M>c'̐)b'Lg@ (O4(wި3 Drr `؋GT!ބNNrrrʽmqy4^>2c}{^)cΛ/OJ;E vgދu~2e|ĸXPvy~ *8D̡XP8 <<ɖoNeeDl I(LL4[fnPЌɱ1Yήiߚ|a1)q9NɆDŽ&R-\Fm!v7DGJśS>*Uˑg$"sl3,qhmHD,hzJĔpĩDyH19Q 8ñtschNNH3ƺ$^6'ٴb_0fӝ; =tl.c<'=r {h2 Lcgc7=>(q7A ufy6$/Bkrg@:'؞iyӠD'C@Ptk=B* Q}!PJ?r:GС#s(rՁ=a(Km͝z,^cg0iO1Lz9&i&|pg"$'У@0=hK ^kGta3ݞt;)|xd>Bm5sns(WA5t*̷l(k$Wĭf[3ůf$[3kFkFY̿$3SɧSIÄRSʿ0ŧz/k_.*<\t8+)8ʱuu<S̞,~؆[Ծ:߻P@ge0KFs Gx7xOaVB)U (`Np-s"F|{1Fo助qEs?py*+P5+;KqCѡ6כ^M"|X:mK&"] p\{lKPrIX!}s OAl7 Xm+,v&nu}&p2= %v< ZQ\D4Y$ Vw# E&GD;yZ vp+"w_zA_D#ԈŽG>1Xui9&*:` l$L'=?op*6Bɲ0DG°I,Y(*jO;9褂d 0^~tYBF.P݁r= 6-RrP+StQi'mBj/Ig/_}b~T@1t {ϳ8 jV n>ao`>տx|LF'V5(Ux(k}μ! Wf4Sgq خHY)]ukHd4,7}6*ޒSz>u3FR#xd,$2K3 IwW_Gx ӒtPNRYb|DdFq_bkkMEpP{Uf\ Q#EkNJkߚ!XMu\tg}nH&b"`P,FZ"IӘ'o' 8%01tgG,6;1;H`u S>ƌs-0 @kƾ<\ia d2`q+8S +,|*G 8`m]D9]L} 3VXFc$䮣8V]rLl!L $QQǜQظ+]R DÅVG."YWu8˯;}IPIA{Acezﬣ.GYuom ړxIoӇΆ29\qz˺B4Y=#k \9vZ%lO 6Qa?ׁ&a]u3q搉}X$x~9ΡW ӶS0-Vv 0",`*>J1'M3m@Hqznm n3&ʝIP(Qe:b"8*8PѓF&X) 0 6 Etȱ` X4+)\5z#I.߿o80}?.V׮EcL+s\FGM2hR9Cfa zRxp^0lGCh6*F{4?ߟlv%p)UQF8E(H7=SRM72y! Uro?>Wr0oAFTd+EDm[K4J{`7AWvܠ7Kifx)wK*"ǛDD"5y&I$ dw墎l5AXhpp!/?|=G<ݍ:#$H:`9g@! @勍Y1&b/" =RaF\Bg*K7V,%GltQa~|҃@CJYZiQĦZk×_ &fdlB% he6`*e̺(e`G<mMgfxlRݱP[e;˼`$@9sa ~5[>Q}~ΜigCfn* PLkvF^N`sŒ* |SɄ.˔Mָ֢qx l <33/+AvTp>?r?j7Fؚ ]@ ?c'`CAb6ںDWC~ZJ|'&ͬ7CcE0el(fCİ 7⒙o|s"{9Y#&F4"hH0o;+IY2rWvٴyK=[BzF"șw54x)eZ֓򞺨u#y~6n>"˚7P+o,'ܑsL50@1Pͱ:6.uXfL$Z1D'1UʓAÏС o積 ͢)ϢH4aS?,{ }J,v91 eϗQ_m$P΁o`/93)LJz.~n^UHA0'5I~<1C ! hH*yVe'IiGbfoeCY ?]>u3w F=e TGMت 4]F{t۲7Rȳ$qHE~"ʮ{.$!j^.9PK9IAP04ئ5uVzhidD:kC`)wM0qNP (Egz8!d/a1Gð`F~@ FЮT /jҦ|jrë?)w<0va$Uqm;7a+{WVݻ m<T*xC \SvbOQifa'pɍ::2zF:#̿Gx'&wz@^K]RN`pl9ջ1r/w pzF'FLuĔoQo lJ}gUBC( ~)s^6fۜ8q<9YOBFЬKB:DTZ> X=Pc@X5XjWzzl.ĘԷpjاd7_N2ӶBIө`oz\*[ 'Fi"Ά\j!FF:tHRDB\bv|X1"&P%I C)1ĿF(ܘۀk/iNV٨,K,a?31hL>#Z>3ce`%Aj1(8T2vcزz@ph&ԓ Q#]O8iQD7AO2`ӨϤiT,@caY<yٮ$U0.Vo{gBY ~X'Ƈۯ|܅/dn9##A|Ȉ BB O$wd(PD0]ܛ%=Lfu#DQ {dD@Դ.82QN:kFF`7d^ \x$H(d50.? $ĕ 1 "&L (ef8hhSi+LFS@GKcWG 5tC$$V mVΥpxB aq=DW!iq8{Ϸ>9uTRJ4.i-1bA7 s4OգInفޣ1)W i˴ML5}Bz%P%QolKcl{ST (i1P;T lZJJB~8*KF 39OgdˍǺg0yK4ߺ=Nnӯ?ܾY+۟Ԭ\qtd!<- z~F,G^Q-4gtnzZJz-'s TTr7t#]IVĜ:qׅN2+Xc_C-ܲ>Qn `XxbOD|H4jPWodf`OhHI4,MX߽frǜbEzt@ *DZo𱕘H} vX+U]yY0.K3=v;Іj<0ģ:uW! n%S[W?=!Na Zz%mIEbo7|,LT'˓/%$ s٭ʣQp ]OMFhalvjEzWU\zy04B ,k^',6h^dWuX:Xq,tWR6U`0JD _$NIN,Սx,L%0Uٖ 4Fhp;*B96)ɃF,X[[T`-k]*@sK"1,zK- $8al4{7CYK,,3 !e yz~x_ vA8ՕnSXQ8ܔT"E{Ƨuwe |Jt-Ԙʓ9=*Y%׀"|ZLB{Ates Rhh8fb) GIA_]m.H ؐaCF =6 b`*#v̒a4%WoLځXoV] EΉe$1;/3lB7L"8N c? P !vGr۫bo Q$$b5APsMe"wK4vH?t10:B~<X#j)u1D #Y^bZ`FwfExm\46M'/@bex$rrn!>KtzewU݂jX#;5.s -HO! nayI9X B|9!YA[D¸Ɓ7 ?d` eLfHD´R's0j2;RpZ,hDXXyNb@@IQD&+\X(hvȬObV|4,Q(VF8gRCdݥLs'$S>cAp|NPOC=y0,Ԫ})Sؑ{~{T~O{=n~/wVL~?ifa=5فULk^fPPws&3zf Zj2^HJ?82!F콿 v5rKp>@fr ]}K}$Ȑ‘țUCJL;厯pKwh&i4>4Ikѩ 'a^(7n'g ~wv_;Ky x,1\4WDTRzqxBk^W?&W885DfL#i:͈K1,ƔEI|N;2ܙ+ o! q)8#1fv ])׃ļޮy'=5s~+JH]wW\W$YVS|$_tEP C3 .mٴp\1rp1z7qF1hZt u6j"dk)x1V M5C$.1ع+=DE{t5/5I^^vKweK""x%iYo)\Vm3<)$3Ib>*J`).D[a܇X}aQP5{@UP[(1wiK:"Q#ŷNi !d0 È/ i+N~p3H.JԜ)fޤ#H_] 4Æ! QGgQQpgQQp|5+2*.00'QKƑT.ɠ7&ѯŇK~$ N?Bla 9kZ.[͔ՙf\58q$̂SN {i h τvŒ;y1/X#[alxxh#x\muu0҂k롵jv'Yz?i>gEMU$ưt  v?a\j1gÑp!TQv=@z]g]ڛwܣ3 -!7CDѷQaF;LY,p,pDC,vP"mC}7^bR"Dk3a"ª0RF+\Lb2<7KE b5Gm~^LՍgΧ0 YGGfT?KրkifIaV0 T@Nxu|-WNΟboޕG8Vˑ2{:Dy[A$xJ+o&OY֮Lς2q'i/]id1vHl$. 7Q?`e7ʠlH Shꦀ/u 90 -1  ]L=( *+{'q 1Wb&` YMVːȿgOnnmbAŝ@xi KaRύޠa 0g}2sg=!#Ke Z2̝+r/OEsY4 z{\i-3/r[,BYе1FT!'Vȼ2iXH6bM7sh(\ǕҸ ܺ` $ttGb|)e6OE ƖDJg·+üRѩ1q@aAh˖}C hLӛ≃-7jL%Urb 01)8u, 4.h)Zښ31t -asfRyIl RTR ݧ2P6KļLaWJ?0XC\mM{!.ҩWҹ o-J1OBRg*oA։ihUz"`Z1RNקlK=EXX xҁ#y0ΧLA`ѡ0qK(sM %:/US=CTU:rDqS=_Z?ežK2A=Sɏ)B 힦49P~р4D~m>h8 >Ůb Ǵt$fElu4A&9N$9p`4Z5S JC;0H&B_coPm&2 &p^@Ub[โ]p=Hl$+y\?GfNz} D=\$O x÷*]lNy' 12q>|p$=J;D wJ{?)YC48с48xQLpҢ7?R3fҞ:T 2{j<]yIO[pFX8GjQDfp_"V*i|d@jE]PÔUtzRʻfNd)30: At9VX"r{^h[ҶzXI0 @4yI{"N3]#)ΗN`Z.@ǟ? DlhʗRѸ%q ߁AfU:[[D#Nq V!V2(rca"2׃%R8-YsfHIrvC!G{ ZV ,|a,fD};&)D/pd3. x);!DVK/jGWB\PfZKG|`,a2gg`AХpӣp*CV@R@{zcM Ӫ#5fRץ9N mfo6PdEaMv/zsXWӺړXҗ F[&z\%$=:3 t TD+WC4kvjv,DzNtA|3wԒqG2Wq}@'σ*[el&wF$B3z$a:+]BZpұ/1 ra8s9$jL/nnzҡeUxpD5a;],ȩc`+Nu޴g"?ayY/X ADyC#,`>,I-R "PM\R +hS0U&qa"ܥ4Wd3N1ӛi#1Vz3fƳ3D쾵ό1|QYBYԦHծZD(ԢQ&+D)77YIݸYTxX80P'ǂ nn, 9 F|j#F/Fj +n#ZC 6m5Q.⺤dq ۩ي"YX|7搌0%6X"/|՚Mt+\Va}9(I߃jxaKm-ez,pIwtB9P넺U:ƚVn)2 缤S~?F t&"MJTjt{"L C23[iJb-UE6ӊ s7ܙť I)଒=SdVM HFn j"HQ}zNy:@e. zҟ op&tw9aV6Z)X[t})c` s{3 Y3 |<Kh/%pem>FMnrqD&TIK]̊,1w\[cK(qYwb>~/@Ut !*B]y@q9Ke`k)NI(#@E 1*fUC ; DVcԡbQf~ql༎@Ϋ~NNI0EXYLw֞Iv0Vmi\FpԐ81_-5x#/Q :1l#g'-R@wεɳZZ<{TSv-mah{M]KAV`QT2;h4ieYJ+x$cwRsgm0<d,:.9&j9qF e-oiURc-xUeVzѾ9[u`5c90Ì ^>Ui p NKaiV V eɨkL-[< 'hУ5S 3ݬ ajTxpc{F"|W&3ga^?O=T3$R-iC9Yr^F‰|4Sg<r JULѫ0EV#e<f D[fHQ.?t1և&z=I䝗Y(!C1;+ [%mvØmϕֈ=K |qR%vƣ1HZFxv]YmUEg֜O u!X 6ʕLG"z?Ÿ!]rVXdielcD +Y{ӰJ;HO|U"ZU:f9Im 2 ~H)`.CT|ng  E̓Zk?s( ZSکd~GWPV&>urdyw՝ule0NO,| +uB±wrz?&F@W wqVafX1]z-E&65 Ʈ~0vL~57vb&ą'{=oo/ퟃ=p'9b 10$P,IJkCKt'mQ#r@u5X( T R41Wʰ Eh i$db윝݋5AȈ @*KiKZ1 m}KQ+gt:4}SW3)Q# s`鰽!/ .GZ2\Vx0 s=BO .`]`jB/GZr,j-gNl(ꖨ8x$FFw&m,S.]j bk&t,pp L2 %'Vs%pTޫ0s932q)o,HCGԗ#?VH)HuFV5 j^"ЎCNEmD.dEX^o˘'ף6S!KlUmО%B]Qha`ډTMߞ@J҄lF[ݸOcnn;®y޸ڮ^،"anS!K݌UqGWg)|>z >(>(>Q|>v=x p^+9 N zx%[S1:ӳf9(P6dYznռ_Jbq?"$NѲ>(Mx!+Iml+l]K-DoR3Aj * 1"VnPhX /b"Qcs #G n 4rG 2d\@@@&b S"'\#(mZ169pX׿~q9X 3JǓ.7{$Rr`l?,vIVYcjtծ. 5p|-ty-tP-?]2F@ׂb^oP܊%Ob:؆T,Gފa2-R=&TdC 88"{tdLHfkaԣS1nhj>[9#\^[",84hLHi21  /roz6\h9xaM{ `?\Q(2n(od~ UZ\Oh=aH-=VjDamչ9J"GiM][`H>up6_~!%}0t'@a[g8B7P%HAc{鯊)xOin~5~vbLe7bv bd` -`уI7DHyi7'c 6CںEɛ]xػFXN9v>BVža_ù)&AAl'ns|v$tF]i R)}ǪSX̸9fMq+'"#&ȴ5t&[㙆 Ԯn=۷g u nU˞nNˎVM<zk3lCX-fYL8KRS%T`U(ḥY`(jQjQޢfi.IPISI4Iv&eMg7)nRݤxIv-WlT%ʐJG|uHVm[N39k_`pGt2ҝ=g-y~ޞ"f_^DQڽb,cBUKX}Oܖ.Ԕ4pYOѪ\mR44}Zere%"ѯbW%8PWzVy^Ջ5z pBkP=p e406EpfJEǺ{]pY %` 6b"ׄDB rMmh9I¦IuSGG6,ɏFn< z rl4gH8*|NB\]bPPk_tlH9NǼü3R38uQҬYꕒҙ٤ ,4$:eϔjPeς!.ά5N)sMxLYWhmf5Z4˸Uvob`ZzpЁb[Խ<RC&S{3<0 >EpF9jOg ./o KcRהM*T5Uk}g|[f1Npӄq2NSq2Nӌq~f#@n,H!Z!`Ɗbs U{8oTT V+֐xl!qYC\:nBs X8ҕ9`ZVs܄XX*.ĤxM3rE-'[$d?j7$=޺a^Hv.F˰\e(ke牧2dHT]*N"_?crzh]h]Z#;|ica h^B-G`Jbci5x(2‘t p\ G$!Ulc x\`C[x"^x0/|+ v/*%$/{.K6``o~0?/^kr'/KYG`|)&g_,S Ӌ?? &o}7L^gyq ބ0\r m2hܮ4i_v@= |% {|dTMc̠@`vIB-(EMcHD-rn Π@~r  jF$+ČLx?YzW@xe'JHe0Wy a !u ;q<κ ,p*\~#+篩+7PPG+s1dq@luI PK&)I`nh!I?cNj e0c *`X & $=7,]H-"'PwĨwWd¶Ivax;kqMsG츸-[K^n|7T䠤)q?B}H*dYJPۈ\[jA:rw6[IOD2ɸKfo<+/n,g }sOGymTj\8JsD_=Lp^)18lǻ%yS95B ʭٜ!"γqd(DPכ+gn/($5*Xx ?cL^B\vƴ?jr](R=vGn( Aoop/(h]a[ibj u'+=ڑ:eq8WT}d8& `0&0' RE"MbtT18-Fb*ƩejnD;ZXd>M hۖW"_ax$7}{*̟7ͳc%6AmfV1l,rP$ IJu7$[14o1@*vo(P5HӰXb0 KxK7Q{rE<(8>cߕFY7Jz~ ^/3F\T?J\g1x)uR^WjQI)U%)d_eTu1ZQ,Kխj$zjl*KiMSw^': F̊%pE7_2&Þܑ<>dl:GNɈ[À|r8iRaD=,˦)`fnmQӤ$UIk@nJ6dׄ:IR:-YUVcKoٮˣԑS^$zA'ӍFZ9e@{K e9bXOs t ,F Jo=i:֜='p$ ڍE OE;MO7߿`MJ^5Jh~ZŬxܜgj3Acn wV(hkaCm$[v'lG8Vޫ6?o(E>O²ŘzY$&501 b6¶rS`դBvyEJ9Z$pb `2)L**L 7w/h3$ҼPn ``=I` ~"}Ǘ4J|K}\%~Ș=T+9serN* tp#~.##s+s$M%3)9 gϤ=Q"X;X֑ f5fEdl:38ȼ'͢ >RqM#bڎ,[eWf++@b֕!'@!RdE&AL +Q⥦4&%N+*4Ȩ`H**"B,Dx\2'+yPesDZ;!wKCA+2QٽRS}5|W_cy4mLZ=roH(>3Uc ǞL7 &^kxZ͓=@9oNK4 MPJ""߉nd]#NG&qqi3Kn1U 7tt0Q4thha|Ӿ+ѵ|12`Nݧ+?HrNAm&Qo_OXƯvzK:og=uTAڻ@祛9תQ oq<άʑ*/y{mSu_H 5Z=b]cO|a@M 'wD2vKP8VʩTj5[H@޾kN]1CKxWHi4ѱn޵K:60$'Z4(lJ :Y|eAj^gAi}U#ծk8'Ic) !T>@0//fPDBsƻ_^{~9:% =L-,x1ʞ>f!2 /"u C.cUr(^5$FQ*GUwn=XM)!f^{nPs!L4L#ͭFg"&1w D֕Q:c4|5y%ŷz(e4h'bk+,X"?!eGk?TgQ{p7w:$ahL?( ~S@AoyaT}2շ(VշpK4]5vEYQE9,MY3G }DGݐ%}Ye裌V:ّCa(EEħG({pM> ü~ڥ|XZ0@8K` DmSĒQC.> *oVzli ߼{ym$}<0sdϝ1g,km ХuO s!cE\^1zK-0_iڵOWڿY`SE|A Sxoʔ9~Y~vV 120Q}  lm[ECTEfJ h` b4 gBMlgAM5[@x-0Mc` ZL[X:Rh$`IFEeMެfd7 ?6cR9q~t0ӣpExP2xP0xP[AAA~n~3xP1xP\AqeUm'xP2xP5xP]Ac& Wb7SY/\Sf->Y4|ڤT#^H=zۑşy!޷$nq|D)^ -yb蘁$4J5NUCEhd0b vΑ K̽V |oMu ~MX[[7G#Ea?FW-Vo_9nDGۥwםj`}OOg޿{eٵ`%o][ 3*(Atdy NTǓ5A`"֠쐩n^6ӎeMDžIÀ/hSӧv-g>g1&hP%ziڱ0HAF3,S* P/q<Ah r$kº+k"\xU{-  0p;HB1{p'!*q˨DSD"K" 1]^b hfMY 6{ֳl*П!b^j0&zBpc3|$SO?< Dտb$V5ZT>]X{.06i#v"-\>sNpz.NJVA%5'U' `(W[MZ$ ̸.A>e )l%uUUGcQJϾ܄D5_ VJ orXM*#G fdzYJ_* ]At-PQ7T:쪂ݫ(UnV%402 #IS[{pe |QQw 0u@9JtN'-9SMOI ;$Ϫ'Ɠ;SYs-mLOK ffŝoLmxcv$<' 1u>~E%)~Kn Pʻ tTèLUeueD:Sƈw@2~N+n(hwq'd̢fڬKR6%I =c" &dD[~2oYt?ǵ)n}a,qAPx4p< f'TpE_M܊z8N[M5=&xHtjNDYo))j:bTӉj:FPG.!!G6D_$OA\wq-#}u\K-q-ȸNZWM8W}ɇOH)&'I@"1)3cxTd&@"?ᑒbSR2L $@(nIGgGJEaJ#Ɏhaz)ل:΀r<Ø1]-Z:6 WO3̃1X2N| bA<.a#fТXol Z3m[`E}ub82' jE9&0$(IȎ9 Z 4qv,02Ї>+)3|svTrx'{U=3,O7{/y7 1*.Ydp CiC\ q~tjlɇ{Ϭ f.) h|P#r' %t?o%}8ߦ];|R!(%bTg`ޭ:# FB*I0(W?U1hcLvNC%y܍BFޗm sP,?dt19]^!)rvt6PʋfP[L0/mz$ ۙo<#.LJZc9GeTHil ĕeapV{ #^f~d^cGU0Q($hPҢmFNb1h5Kz+R'׏mldSba۞ Y(ɢe vlJ n|Q%EDVUUu 3O"%+/a$T:p&6Yߋ dq凜SA tɵ&9,F+ĥ"SĥBfק(R!NBԧHǦSjh)s  ?DR^}wԂ)\PR阂nIYTI#ԁeRo/aɟ4@ > ͒kBZ ԕ,2 jҮQh2ŷJ">DXQ2/e oj%~@?X4$YSI$0Rc=~ H? O; &06{4H$z 0ߛ Q} kARv_XNu%e*dO/RgV0>򒡗 ĝGM^۟gfB mz^xUQPFR;%|9 y :[0otyEP[*#cn%lZ,t~ۆQ}R_{k_3#RJG-,F?ގyL|sZ›##:P,$Z$ 6`42 s܋M>WsxF?ގy,r Hp8l $s  5tHEd^pLB2꩙BEې /6.Xq1]}E0q]?Dm Lu4-ׅ$Fd7ӄ ѰtD4JOsۅ OƋA;vrj)4Tp @J~|B-jH$N"Id+)7liD ٪I"[|bj"(Koq+2"}v:M{Q^ZAE^j\YVcdfᯣ']Τ^N)aP!X)-7:EM,օ5ROT#6{^q^c{$0"H}b]hX03=օÕU0mu!q|&\uޑ2i&6eQxyQ J/G6 $퉞\V!G}(ŤX WEk#_Q,0􎑧(8 86?TJHlpmweu[ pd%PR\onx\0iUE y06#t= LH2Pdk~~(>D,] %*En!ѪkO"g-|1֠/4AN\DnGnGX!41Eŭ͝Hf U*)%}#a`f F- Gw/{Ex\Ac^y0`Y0=!QrZT=&ZQe]1ER'XQ_Bt/'d{7/)K㄄/o=0V6A /\+1A 53`R[ j >;\AɇqLE$ʢ6X)dIc,JT!9D#u O`;B.͋A+["nc+>͟+h@H+R-P}7 E V|*3b<4@TsCf0}ʼn2rHNYgMX.yIsQIK&f)@ĉ|%3PQW^ 23 oqGދ^e쭼3.O:zpj 1i,-j1ƘY1crjn^̘kO%!9qNJZ+ 4 w[]w=cY ݃ er{V$t5-\l9θ آPq{y dGDx\b(GD6.;Tn0`ĕ) O`|p}X(a^\9U8dL}:w7g"u 0ڡnF^eA!Ar~iz_z$]o,Dw<3OӒ: &JNS}%xQ_Z XH< \L(SyA{J|#-ul}eǠ N&gH_"tk\Ca8M&48mO v>w`bN72upʠo$VOrۋrPz;'(a{Mb9e+ 4&{-1~QYVFPIN1NDȈՌZIQyF̎RWm҈__"8@.3'S8nK[u /(vBt1 il"ŽmМsC~kȆ'ǔB?@Nr'Q6q\z'Ir7po0(R<^ [hE,*GنI]<"1IME$-" OKEF$H!LC!LC28n^ lu5Ʋ5FL4rw%,rêH^CAQ+P$=uW3d N=va4yj}F ס|aU څH6N:=9-it_-PBN\L, ȲHیVP4a5Si%mY !8g}DV:[ܸĢa.ݚzTX|2vht#I6>QZ7kc1[ߘHH 2 q8#K\[[XKHY "+roKN_UU ' h'YّeCgsl.)BYz r&8Ga[ϸMTEd;Sg{-\ s#E!==G=')klp8bD1g)e.^B(xe/ާ$mo FT|XY%7b۩kY{'$܏iYf=-5U#ٷ@ qNDxE< (k8q7>y~ӛ {'c2,1&m?~?/"e}/T}67P)cIVֵH}os1#H=8/adI6+'0 R8#‰Z [xa/!{Q@ ͘)C.u`@Mg#$`<qTb*G'SWWr{[`1ƭ `@ˠ!Y?`Q6h^XJG`nsR؃~ \џjwgګh3 `~B݇*'30ϐ\Ѱ&ZΤz%O *MR]/:DG:Q"9o+"&[`n"Uԓ|BDv0`Q]8ơ|y' &(S8&qt"8&R!CXɼ]ݥci[o/$۠P{8Gykzmv&v -gZh^Tӎyvn7XN-țɾ5~%RHv||ṏ됵d\X |}͌gfݟ^T4#~-E N.Q~RXFFKT#8K^_%tz4PbG;z9ݍLH+N G3gS fILN&`|MO k0n,9=&lh: KK҄$N'uEe1)ćpbeS֠P7Yg-L33 hD x)f.5v(N{,ST&hQNqz#K?i䎃'`p[=dSm`οy?QDF#ixt qd G_1di`E6ԈՖm G5=5gϡ΅2M2hgN C̠0;I2#˛l5͹A29n:{tS%NgMpG<6z 6 T7:; F~JI+F&(+of#RMi~}w>*ZeE$9lzR'+Q6޶q3K"7jK%z&j>lɉFR6Ml^nDz˥Ո&s#OV9_7w^q #K>Ζ7-w4Oa5bs2?D)-҉$a+Fn?%acc_xѿ'3k|a_÷? j׮Kr/R+|~-68ss^1lA:6!Jgצ¯mQ'aߞ>#?oX2 Gv5bͪ(~Pvg *ue1p'ۃO`[Y ^",},RL8+ NJVb l9Rt&~Bb3bqk*ri\UvBgwbLG^)qk2J~? |s]e`Gq?d {N>l?b+?qkqE)xRT()xHVíX[mHBڢe(jk`!bjp`wvC9JGE $m#!1NxQYZ'2A@H#Xi<\,es4UuSK)S$<:zuA2bX;k]+]OnHg4Ш@2r YeO\6Hphr1\vv(WF";0}#(^~#_Hr Kanܘnvt IR? ;4sǠ$j}qB@'E u '==Á5)DceV BVFFr70Oq{څY^gNv79`Tx*:t;ݹl{?yoSi|Ҡq~lI`8+AC /[ƘTWN+Zg0] Ii h&ІcC;$Y9^4U&2_nhߗXɗB̆fIZWy3b^8HϭYkUi*ŷYΟ"5ЛB.T@8؟O,GeZ7態hۤ ƑΛU7" 9n~p,[U0 W(;:$py7phkƹ@l -=忟jmr:p7*zaZ4Y8աSG1μi@65=5{{{ϾG]x~~~ǩqww/~'~' ww£ο\EjH2I趸DUߏ!9Qʹ(Wq%&u"dM{yi{]ֶ~L6Z*N|)&ry"ۃpn@up3zc/翿~퇿-3sۗ"E4mα.?^j n39L]75HI ":ʼIyFGDR&P~ gð@ ;=;4+э픾#xbn#CVp{ݥZV*>mj>1+a6uR6۴7kx éSD0 s$Qr&FmMVND1&} nՒbQM&x%RgȈ,9%-~S%7xQ/5eCh*RloHp/0C`)M/J`:Y +{{.RG=G=Q=W"rT}<7>#aH8㪴*KuA='1 =8Oi=~|y2>N:xyTMLsw_U]"DliᎢ7Xح>XBk`P7 !@Sn62D8'R#'9r.OBzϏ/3 `ݠGj$h폫YG@KFsDDcI[#09ޝSx@DKEw!!#/ ^S<B.SNPFN͍0BRTGF? JXT 4 h\:NP|0r+WT/,x>O> k>v zA+(z{v%@$4Rñ=ZH73G0S$,AK<Ti^io0VTi,yIkfJ+/QsT*< Obݥ82pԼ JK$9!ݫ&Ͼ}ї}ն/C n n%83'Q%@&4i o쩑K@6'6GFAQ?Ҥ:B v2 XKzl>"fmYjؐNJܚcW,$@*3i(%(86x qRZ^$3=*]tu=hc4n HX`,'fh l uv hȉ )wRhq-EYH jt ֝Gh$^Y,8yزM^> ¸,|ǥ|etཱྀ (d 2q2{ 7bgu y>6< o s=" +ֳ CREuBg azv?MbiSΝCiLևQ6H;3_& &ML1+@y&4k~c$8vnE0$BdKx'U `/oJk!=yxܑ5ZǤoAB"ci̖e2bF^ܑ+sY,<amt $֯Jn%wV.uVeR H/^5-X'[hLaU Oid9E܄./[n\n.tmT|KM`B$ ib\uBݲm;Mj)"4 /PA%|w?kʬD~RԴ+Toc1yDKcwb4qM.k:yq-6SBxL Og%\T!ǭKC'bAzDdp/Z!g(\oz Y%w&1TE5 #'/)1þ^ausFʐ>C =5"qTܽHs2()dRzI}Teq._*GD!ߕl׆,ŝ^vtA#{j2!on %>{c>q%NDnn|YL<%⼔n$ʔCIyOp$-Sn)q7bBG"8%J~gK t=qvԥ6QE 4aO͊}T>+>+>sji,8ϊϒ>˚>s>S I.Iaw,}kms(@p1N LaJ_d(>G'- T(\[4pvN2 Y_'M?e(ܙ;^hʁ2eBl_uP1BWɱn,L!?:KxSLu6fuI28nq-K!{-$Rd@S(3Nn )YD&i>BȄNsBK~#jND:,.RNcA:`d~mdϪ0f *=[e%Et;4Y9(ާf{{[=-ˢ"{ۙv9 /.'4%Wr] 7|=&u::2<˜s{͝Z(î#2uid`kcq4wۥ_gOaKّmv/ FO ۜmS*b,7gޫZ]jao4tV9sFp$b Z]OgNv 9isI%W" fˬF%I>z N&vLXpNj|ވ7-r:K|daNqh^t7ߊ*yr[9R0RAe5%'[C>mwF N`³/Hn灆?Ԫe9J2?_a5e/O/LCgkơ'$|7_/IY `Oy^[F@%5!zt%+ ī I" a[ )[F'^mg܂rlMޕnWAZ_@\#xTea؀5`,4ޚl7F$uB8.57Nim&|ck.EM /Ex%*g{1_tPB yqznزwԱzFvP|ZF1W@6)|ny"?:~ > xͮV= -QE M\‚ׇUX̡֧1̓XkX%.“WPXT?ZGGȥLP&6V]6 tҼh#0ǣ7P:tvigNgIgyA7A떴}tttgYgYgiA{AΠ7gbtttg~A{A{Aem]m]tttgUgAgaAG̠wpݶ7F/f_؋z<qq`<Xl>f6>y +%"';ls힆| ) fˇ<ԹSKBSF:;dオց5/u +һmsmc؟F͆6O~1aan6-ce\O YQ"~mX9'q"~ǢJYȸM( =0SDybaɿx"Xmbh$ti"w9W]. 'BsA;lN|J>˰~:A@mP"r}um{ MU)}'GO3AҬk"+$i VX5[R!>3vsl$S覉T\p bU;iA?^-g?"诉ձhbȍ{;Ҙ[d9d@VbSJ-k|_fj&A0:DMʑbo7Kw| |^h~g5q`}@".0U'8[ood i! !*yh$ԥƕ&{R} CP@2X1U=ڥ ԙ&<|p(Sd~A#kR) o|ه6|eF2WGul;Q2%ԃyri/򉵿$T_PWio>{-\}>[D5'8/`rd&Uq@0G$9v(Zs0 m/ܪ-2fKeՖۄMVMA͘ZF9Y7@%$KT3cdp{fUV`L aB)qw_WYa`VIi#rcۓms12LhH1֖'wĬޑ{8ڽ0h Qb#ڻQg`p4J<3[hWZFI]2#N"4>hX0'*e~ t"C%IQc!bԁgO'jB+1؝Pg l" b{cQ+݌Ec@բ1#J#ǜcđ) MNA^AkPǐc(*01嚁K/9]Z< 9WROT|L1J4}Kٳ3z 酉yGzH/@z&H/BnIGzeH/G!Yw:ZVt6#Ï CƐ3ˢR)ҋH/WfW3+eAz1WCʉ H/|⬽_;- ܤ@^'ҋ!M<~|;f BƨԲ^Q9{^2OeUd7JTuB0Tצ}@G·pqEpEhƾ{=8~c} 94Ri @J[5,#}Se˜6&Z`VF ~Ȃ݁4FqjaS'K'k9~Βoapӯ7U[G~Lap=cGZQc$@<ǝ,It4$"L"yC#F+h|ndojX ^ 0ewa61ZM DZ^gcLH%B/FkEq)sUfhp,V#QwO?a Ϣ?GDXh"$P)P0*iA=p*[jƫsاh1p>fU37~;Ndnpx7 -.IG`Y"ϲ)i=9mi=(K ]nENٝ%PWׅ*xYQyY@u2si,MxY|^l; c v^ ø / :/ .Sl;/~ۃM4 RP"4pײbifâQ ̭Q#??Xhl. {BM>u6[;؞گѫ:\DL}j}kLXIB|X.3+s.>Rï*Kg4iz2\Գ2mx(i6АA& 6`F4,zlZu$uhl9k!99<x8L'P)dϟh>nAUs0(ƚ-XkI'"^<{EDo0\ETw |t7goRmCєߍEL4\$PB{Ņ>MW,IkQ@+H{cu9L?EcV$L^ M8Q(*`@6N7h~~+!JI:WSFxxKۥ/|ufX\8d8Vˌn?& 6\|o&ƳxvO6dn+@{aāSKP‡~$zY \p%d u,9ݓS%ɸH},e vs`ѣ< 0BN` yv7ؠG W"+ [Ҙxc3ZuաB1Wl@s}H d~!^ T(kBGE;oۂl$HPchݫBDb5YI4ޚЀiŪB)" 桍\NL^k+$tu[ZծOQ݃4eq\Biߔ~C nk4Y^mm4z7Pk;dXSK o۠eA}RΌMeO&jk">{ Wp9Q|~k(ZvAMyv N~ߧ.y|0jGC}x_ĺwŭL:2duY ǥ@C3NLYuxYsDqJPԤlV:jCj>Q*^*t?~ʡ?[^9N`@VpLe+9h 1%Jj\5*ĵNC)/僘L6n $b=kC˴IZ.dԮ•U{,br,X¯" Y1D1YI|WpC[gPgu,d8:%Ȳu\tm@BUm/h$t(*l08:$y^#xB ½MBrf>߅ڥoēphx y<rqO ֫{}KV:OqnACX+M|4V>f)3u ۸M|b3c3CJ>f\njC0 '3̬EiBa62ǬiS^fRҀH^&^腗79/=c=_o. >T vKkcѯNnTDJͳR냁j}|_]9={~vtȳ;K`VR <>B| R} 3 %M?LFaRGlj}-%n_zk$f,YI,NF?zۼFVc [c$RH C {|JϦߗjm"iૃMI- F17TĿp Kc]u٨dlTڟ.F0YHLs.Z˖Q$FfƸƨ˖PA]6(uRYM,Blt0CE'.-貱>l]64;X?6@'e@Re">lܚ.Ǐ7 cϞ@S`MK)˻miBK_`YՀ!ـ3 ^rΆ!I2(IsxGB]\Om򻟴m(HQu% ΐjOkz/$>>r⣺ԇĊ"mT#<7F>2֢ͽ@-4fW98K'=sZrheiܴ4m[ɃYQO}=NF`CҶ(FjD#chMsM^MjQ]jim"/t\h5@kAo?* Hvk"9W @3f4IltoVn|d+x_.&In-[dоdqm + :1M>Լ/I( y@ϱPo@mvr>]@kAd,m>]I^V3\_FI. x#{m%=PPI@vv{{<w3GyK3)*ß]$lo'e&t,70q0& jE,$C@Ӱ*#h:xk]AS51ڟ LL co PYj,NM%Q+Ǣe-N &Ej3Ѵŗ\;Û_ͥÛ?wxsep1װ1tǙAaHk"=V$Aq.&I_!v+߂3[p]S*aakCh:w _ _P T7 (:0Pvi#P?۝# 9ߵҩmGNHgc jjŨQc I |Eu3:dG88bE6` 5AD} n1&p 8SM $<+Sx`Zy̾S4zO'|">{#|Oz7)wawT]Prk[,X +wIe wxռu1Dw޴!Z0л]E[G;лvz7UAE z͎ލMT` qBSBL|qzGX XaNr?),ўw4ZɎ45&16ӎٿb}p̢9ߨaF>ݮ/Xק0t[A/M=(3 *Z,4<#Z2%Bpgs۟=7Mpm`n">Hd_[sKݟz-Ω6œj Ihm;LԑzD6M7N?zK{}%[ɖ|Å?;X[N̜y͜9SZfμd8$ mΜE͜yɜAgb2giL3d!ٝJk,N3’dΐ^ S|-k,١w dXfߞLZ\2iW`G2iO64yL<~i?>" =H*b1k˱CAe'åq~1\gBKZܪ=‹zr7rǃ$%]*AT-'7@H^P`w,~' v}Y S#ST14q<66G;&- Qϓ>|MW ןX~YFr*=HƷ8{O+8^~'#e-Wĩ 둃.|Vah0zA}z^,wPTC,jy=GD5^/a<ɨ,$v B\_@y*cKaeAU}}x'B4 i /u46X~.JMHi3^.p_uJ\Aʥ߆u#}+eԩ=BebVʳON1<_2+-<ޑԐqBtNTPӃ݅Wr'$1@X&@x^ dq:~^ q'ݨRa 0w0BL9Tw@AjHGXM䶟+uQ-3VfZ9?*~g'Y$IT0YīW?Y$ɦ'u?"~`;.IQ88?TdOLj;ʤhEbޓLڇ>J8]+.i/dKZ`nՍa{ sώvj_ǻ!-6T Khn_XJH D:4!y!G6G"]?i/,f,fA;@5ošDԻ-j6Gs8yuqxNY'o~#YVѲR%=h·jwe{l=4?n)л`㴑:C26yFPh×v 5nKҨ.`4БD#F#Be6Q>ne R 2 [hURR=m<_G \%Zk i Jt*4ľ&Y A" pX'9sp>Jd~QzHU~ 5P]kKE:@Z ;1 x &%Hޫ&s+x" "td5任 o`9ې0o2E1ޗrC",V0oQy& 9EPHr`لVn0|HHȁ\5@j C=:Temkx}9 7[#GUHI$m ( Q% vW򊣣-8(mr3_˯XԾ/ "7MI#P Ko. Ko,ӛ_z`@)a?C}$4v;\ !ź'mԗ拂v56eO-= AaCApJ]p V ui(t dzy)V9 Wo7VN.D5\ؖQW!HT:"~lrڞc5Kr +又C89pito.tlS%z@ vP < 1#ddOZ&*B"JjqGZ p;@#p4[y,nCR,'{[Bsq`iמ%'×JVmH9xjit%zSu>ųP(ˬl2!A䔹e K>`TSůl"7/OuL4 ͮ~a6t1!*Q7X4b̀^ t3gIda>Joyz>l#d8 _z>K9R,XLPds 5VZuk9h^k gRzxy.G >Jfd_}G.n`֙߿^+pp! W Y3_*s+j+H)7p5p9 W Wɺ ኚS C 3\=u/Õ OGtpb7 t=.3^`S `- ~f>Jń=[%7?зwAxds+k+kƫ/02^nxxEx955WьW֌W3^ixExEx9UWՌb#54zƋ4.ѤW^A^^^~Nz$~z ΂f,CC`8OO\OuE3=\?"oСG,C>UlPdFvFNwN4ohۖ<3Y"4UZU-!rRw}A}6け2LǾg I777ΦG̺C/(O4 -WnxO~¥/3}S-$@x! [0E| 1 Z(aA&C-_l9=s GQK!qZwoqp` Y*,S.Eu$d9wi=b SB!kŇHB6ma|抑X6iǢ0IĢ=T󱱍|쑪:4oxv/debian/typo3-database.prerm0000644000000000000000000000022112252640275013055 0ustar #!/bin/sh set -e #set -x . /usr/share/debconf/confmodule . /usr/share/dbconfig-common/dpkg/prerm.mysql dbc_go typo3-database $@ #DEBHELPER# debian/typo3-dummy.config0000644000000000000000000000121612252640275012571 0ustar #!/bin/sh set -e #set -x . /usr/share/debconf/confmodule if [ -f /usr/share/dbconfig-common/dpkg/frontend.config.mysql ]; then . /usr/share/dbconfig-common/dpkg/frontend.config.mysql dbc_dbtypes=mysql dbc_dbuser=typo3-database dbc_dbname=typo3database dbc_first_version=4.3.0 dbc_go typo3-dummy $@ fi db_input medium typo3-dummy/apache_mode || true db_go db_get typo3-dummy/apache_mode if [ "$RET" = "vhost" -o "$RET" = "directory" ]; then if [ -L /etc/apache2/conf.d/typo3-dummy.conf ]; then db_input high typo3-dummy/old_symlink || true db_go fi db_input medium typo3-dummy/apache_restart || true db_go fi debian/typo3-dummy.lintian-overrides0000644000000000000000000000020512252640275014757 0ustar typo3-dummy: non-standard-dir-perm typo3-dummy: non-standard-file-perm typo3-dummy: init.d-script-does-not-implement-optional-option debian/typo3-src-4.5.install0000644000000000000000000000020412252640275012726 0ustar build/svg.htc usr/share/typo3/typo3_src-4.5/typo3/contrib/websvg/ build/svg.js usr/share/typo3/typo3_src-4.5/typo3/contrib/websvg/ debian/typo3-database.dirs0000644000000000000000000000011112252640275012667 0ustar etc/typo3-database usr/share/dbconfig-common/data/typo3-database/install debian/typo3-dummy.cron.d0000644000000000000000000000024012252640275012503 0ustar */5 * * * * www-data if [ -f /var/lib/typo3-dummy/typo3/cli_dispatch.phpsh ]; then /usr/bin/php5 /var/lib/typo3-dummy/typo3/cli_dispatch.phpsh scheduler ; fi debian/typo3.links0000644000000000000000000000006312252640275011312 0ustar /usr/share/doc/typo3-src-4.5 usr/share/doc/typo3 debian/typo3-dummy.prerm0000644000000000000000000000022712252640275012452 0ustar #!/bin/sh set -e #set -x . /usr/share/debconf/confmodule . /usr/share/dbconfig-common/dpkg/frontend.prerm.mysql dbc_go typo3-dummy $@ #DEBHELPER# debian/copyright0000644000000000000000000007303712252640275011140 0ustar Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ Upstream-Name: typo3 Upstream-Contact: http://www.typo3.org Source: http://typo3.org/download/packages/ Files: debian/* Copyright: 2003, Michael Stucki 2004-2005, Christian Leutloff 2006-2012, Christian Welzel License: GPL-2 Files: debian/contrib/player/* Copyright: 2010 Martin Laine License: MIT Files: debian/contrib/flvplayer/* Copyright: 2003-2010 Kasper Skaarhoj (kasperYYYY@typo3.com) License: GPL-2 Files: debian/contrib/modernizr/* Copyright: 2009-2010, Faruk Ateş License: MIT or BSD Files: debian/contrib/websvg/* Copyright: James Hight, Rick Masters, Google Inc. License: Apache-2.0 Files: fileadmin/* t3lib/* typo3conf/* typo3temp/* uploads/* typo3/classes/* typo3/ext/* typo3/gfx/* typo3/interfaces/* typo3/install/* typo3/js/* typo3/mod/* typo3/stylesheets/* typo3/sysext/* typo3/templates/* typo3/* ChangeLog GPL.txt index.php LICENSE.txt README.txt clear.gif _.htaccess INSTALL.txt NEWS.txt RELEASE_NOTES.txt Copyright: 2003-2010 Kasper Skaarhoj (kasperYYYY@typo3.com) License: GPL-2 Files: t3lib/mail/class.t3lib_mail_rfc822addressesparser.php Copyright: 2001-2010, Richard Heyes License: BSD Files: t3lib/js/extjs/ux/ext.resizable.js Copyright: Nigel White License: LGPL-3 Files: t3lib/js/extjs/ux/ext.ux.tabclosemenu.js t3lib/js/extjs/ux/Ext.grid.RowExpander.js t3lib/js/extjs/ux/Ext.app.SearchField.js Copyright: 2006-2010, Ext JS, LLC. License: GPL-2 Files: typo3/sysext/adodb/adodb/* Copyright: 2000-2004, John Lim License: BSD or LGPL-2.1 Files: typo3/sysext/rtehtmlarea/htmlarea/* Copyright: 2002-2004, interactivetools.com, inc. 2003-2004, dynarch.com License: All rights reserved. . Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: . 1) Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. . 2) 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. . 3) Neither the name of interactivetools.com, inc. nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. . THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 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. Files: t3lib/fonts/nimbus.ttf Copyright: 1999, (URW)++ Design & Development 2001-2002, Cyrillic glyphs added by Valek Filippov License: GPL-2 nimbus.ttf was downloaded as n019003l.ttf from . nimbus.sfd.gz was downladed as NimbusSansL-Regu.sfd from Files: t3lib/fonts/vera.ttf Copyright: 2003, Bitstream, Inc. License: Bitstream Vera Fonts Copyright . The fonts have a generous copyright, allowing derivative works (as long as "Bitstream" or "Vera" are not in the names), and full redistribution (so long as they are not *sold* by themselves). They can be be bundled, redistributed and sold with any software. . The fonts are distributed under the following copyright: . Copyright ========= . Copyright (c) 2003 by Bitstream, Inc. All Rights Reserved. Bitstream Vera is a trademark of Bitstream, Inc. . Permission is hereby granted, free of charge, to any person obtaining a copy of the fonts accompanying this license ("Fonts") and associated documentation files (the "Font Software"), to reproduce and distribute the Font Software, including without limitation the rights to use, copy, merge, publish, distribute, and/or sell copies of the Font Software, and to permit persons to whom the Font Software is furnished to do so, subject to the following conditions: . The above copyright and trademark notices and this permission notice shall be included in all copies of one or more of the Font Software typefaces. . The Font Software may be modified, altered, or added to, and in particular the designs of glyphs or characters in the Fonts may be modified and additional glyphs or characters may be added to the Fonts, only if the fonts are renamed to names not containing either the words "Bitstream" or the word "Vera". . This License becomes null and void to the extent applicable to Fonts or Font Software that has been modified and is distributed under the "Bitstream Vera" names. . The Font Software may be sold as part of a larger software package but no copy of one or more of the Font Software typefaces may be sold by itself. . THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL BITSTREAM OR THE GNOME FOUNDATION BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM OTHER DEALINGS IN THE FONT SOFTWARE. . Except as contained in this notice, the names of Gnome, the Gnome Foundation, and Bitstream Inc., shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Font Software without prior written authorization from the Gnome Foundation or Bitstream Inc., respectively. For further information, contact: fonts at gnome dot org. Files: typo3/sysext/t3editor/* Copyright: 2007-2008, Tobias Liebig License: GPL-2 Files: typo3/contrib/codemirror/* Copyright: 2007-2010, Marijn Haverbeke License: ZLIB Files: typo3/contrib/codemirror/contrib/lua/* Copyright: 2009, Franciszek Wawrzak License: All rights reserved. . This software is provided for use in connection with the CodeMirror suite of modules and utilities, hosted and maintained at http://codemirror.net/. . Redistribution and use of this software 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. . 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. Files: typo3/contrib/codemirror/contrib/ometa/* Copyright: 2007-2009, Marijn Haverbeke License: ZLIB Files: typo3/contrib/codemirror/contrib/php/* Copyright: 2008-2009, Yahoo! Inc. License: All rights reserved. . This software is provided for use in connection with the CodeMirror suite of modules and utilities, hosted and maintained at http://codemirror.net/. . Redistribution and use of this software 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 Yahoo! Inc. nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission of Yahoo! Inc. . 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. Files: typo3/contrib/codemirror/contrib/plsql/* Copyright: 2010, Peter Raganitsch License: ZLIB Files: typo3/contrib/codemirror/contrib/python/* Copyright: 2009, Timothy Farrell License: All rights reserved. . This software is provided for use in connection with the CodeMirror suite of modules and utilities, hosted and maintained at http://codemirror.net/. . Redistribution and use of this software 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. . 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. Files: typo3/contrib/codemirror/contrib/scheme/* Copyright: 2010 Danny Yoo License: ZLIB Files: typo3/contrib/codemirror/contrib/sql/* Copyright: 2009, John Benediktsson License: ZLIB Files: typo3/contrib/websvg/* Copyright: James Hight, Rick Masters, Google Inc. License: Apache-2.0 Files: typo3/contrib/RemoveXSS/* Copyright: Travis Puderbaugh , Jigal van Hemert License: This code is public domain, you are free to do whatever you want with it, including adding it to your own project which can be under any license. Files: typo3/contrib/pear/data/HTTP_Request2/public-suffix-list.php Copyright: 2007, Jo Hermans License: MPL or GPL-2 or LGPL-2.1 Files: typo3/contrib/pear/HTTP/Request2/* typo3/contrib/pear/HTTP/Request2.php Copyright: 2008-2011, Alexey Borzov License: BSD Files: typo3/contrib/pear/Net/URL2.php Copyright: 2007-2009, Peytz & Co. A/S License: BSD Files: typo3/contrib/pear/PEAR/* Copyright: 1997-2009, Tomas V. V. Cox , Hans Lellelid , Bertrand Mansion , Greg Beaver License: BSD Files: typo3/sysext/openid/lib/php-openid/* Copyright: License: Apache-2.0 Files: typo3/gfx/magnifier.png typo3/gfx/lightning.png Copyright: 2006, Mark James License: CC-BY These icons are retrieved from the "Silk" icon set of Mark James, which can be found at http://famfamfam.com/lab/icons/silk/. This set is distributed under a Creative Commons Attribution 3.0 License. The license can be found at http://creativecommons.org/licenses/by/3.0/. Files: typo3/contrib/extjs/* Copyright: 2006-2008, Ext JS, LLC License: Open Source License ------------------------------------------------------------------------------------------ Ext is licensed under the terms of the Open Source GPL 3.0 license. http://www.gnu.org/licenses/gpl.html . There are several FLOSS exceptions available for use with this release for open source applications that are distributed under a license other than the GPL. . TYPO3 makes use of this FLOSS exception. * Open Source License Exception for Applications http://extjs.com/products/floss-exception.php * Open Source License Exception for Development http://extjs.com/products/ux-exception.php . Commercial License ------------------------------------------------------------------------------------------ This is the appropriate option if you are creating proprietary applications and you are not prepared to distribute and share the source code of your application under the GPL v3 license. Please visit http://extjs.com/license for more details. . OEM / Reseller License ------------------------------------------------------------------------------------------ For more details, please visit: http://extjs.com/license. -- This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. Files: typo3/contrib/flashmedia/qtobject/* Copyright: 2004, Geoff Stearns License: MIT Files: typo3/sysext/rsaauth/resources/jsbn/* Copyright: 2003-2005, Tom Wu License: All rights reserved. . Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: . The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. . THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. . IN NO EVENT SHALL TOM WU BE LIABLE FOR ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. . In addition, the following condition applies: . All redistributions must retain an intact copy of this copyright notice and disclaimer. Files: typo3/contrib/flashmedia/player.swf Copyright: 2010 Martin Laine License: MIT Files: typo3/sysext/rtehtmlarea/htmlarea/plugins/InsertSmiley/smileys/* Copyright: License: MPL Files: typo3/contrib/modernizr/* Copyright: 2009-2010, Faruk Ateş License: MIT or BSD Files: typo3/contrib/idna/* Copyright: 2004-2011 phlyLabs Berlin, http://phlylabs.de License: LGPL-2.1 Files: typo3/contrib/videojs/video-js/* Copyright: 2010, Zencoder, Inc. License: LGPL-3 Files: typo3/contrib/flowplayer/* Copyright: License: GPL-3 Files: typo3/contrib/flowplayer/flowplayer.audio/* Copyright: 2008-2009, Flowplayer Oy License: MIT Files: typo3/contrib/flowplayer/flowplayer.captions/* Copyright: 2009, Flowplayer Ltd License: MIT Files: typo3/contrib/flowplayer/flowplayer.content/* Copyright: 2008-2009, Flowplayer Oy License: MIT Files: typo3/contrib/flowplayer/lib/corelib/* Copyright: 2005, Adobe Systems Incorporated License: Adobe Systems Incorporated grants to you a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license, to reproduce, prepare derivative works of, publicly display, publicly perform, and distribute this source code and such derivative works in source or object code form without any attribution requirements. . The name "Adobe Systems Incorporated" must not be used to endorse or promote products derived from the source code without prior written permission. . You agree to indemnify, hold harmless and defend Adobe Systems Incorporated from and against any loss, damage, claims or lawsuits, including attorney's fees that arise or result from your use or distribution of the source code. . THIS SOURCE CODE IS PROVIDED "AS IS" AND "WITH ALL FAULTS", WITHOUT ANY TECHNICAL SUPPORT OR ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. ALSO, THERE IS NO WARRANTY OF NON-INFRINGEMENT, TITLE OR QUIET ENJOYMENT. IN NO EVENT SHALL MACROMEDIA OR ITS SUPPLIERS 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 SOURCE CODE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. License: ZLIB This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this software. . Permission is granted to anyone to use this software for any purpose, including commercial applications, and to alter it and redistribute it freely, subject to the following restrictions: . 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. . 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. . 3. This notice may not be removed or altered from any source distribution. License: GPL-2 This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. . This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. . You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA X-Comment: On Debian GNU/Linux systems, the complete text of the GNU General Public License can be found in the /usr/share/common-licenses/GPL-2 file. License: GPL-3 On Debian GNU/Linux systems, the complete text of the GNU General Public License 3 can be found in the /usr/share/common-licenses/GPL-3 file. License: MIT Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: . The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. . THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. License: LGPL-2.1 On Debian GNU/Linux systems, the complete text of the GNU Lesser General Public License 2.1 can be found in the /usr/share/common-licenses/LGPL-2.1 file. License: LGPL-3 On Debian GNU/Linux systems, the complete text of the GNU Lesser General Public License 3 can be found in the /usr/share/common-licenses/LGPL-3 file. License: Apache-2.0 On Debian GNU/Linux systems, the complete text of the Apache License Version 2.0 can be found in the /usr/share/common-licenses/Apache-2.0 file. License: MPL A SOURCE CODE VERSION OF CERTAIN THUNDERBIRD E-MAIL FUNCTIONALITY THAT YOU MAY USE, MODIFY AND DISTRIBUTE IS AVAILABLE TO YOU FREE-OF-CHARGE FROM WWW.MOZILLA.ORG UNDER THE MOZILLA PUBLIC LICENSE and other open source software licenses. The accompanying executable code version of Mozilla Thunderbird and related documentation (the "Product") is made available to you under the terms of this MOZILLA THUNDERBIRD END-USER SOFTWARE LICENSE AGREEMENT (THE "AGREEMENT"). BY CLICKING THE "ACCEPT" BUTTON, OR BY INSTALLING OR USING THE MOZILLA THUNDERBIRD E-MAIL CLIENT, YOU ARE CONSENTING TO BE BOUND BY THE AGREEMENT. IF YOU DO NOT AGREE TO THE TERMS AND CONDITIONS OF THIS AGREEMENT, DO NOT CLICK THE "ACCEPT" BUTTON, AND DO NOT INSTALL OR USE ANY PART OF THE MOZILLA THUNDERBIRD E-MAIL CLIENT. DURING THE MOZILLA THUNDERBIRD INSTALLATION PROCESS, AND AT LATER TIMES, YOU MAY BE GIVEN THE OPTION OF INSTALLING ADDITIONAL COMPONENTS FROM THIRD-PARTY SOFTWARE PROVIDERS. THE INSTALLATION AND USE OF THOSE THIRD-PARTY COMPONENTS MAY BE GOVERNED BY ADDITIONAL LICENSE AGREEMENTS. 1. LICENSE GRANT. The Mozilla Foundation grants you a non-exclusive license to use the executable code version of the Product. This Agreement will also govern any software upgrades provided by Mozilla that replace and/or supplement the original Product, unless such upgrades are accompanied by a separate license, in which case the terms of that license will govern. 2. TERMINATION. If you breach this Agreement your right to use the Product will terminate immediately and without notice, but all provisions of this Agreement except the License Grant (Paragraph 1) will survive termination and continue in effect. Upon termination, you must destroy all copies of the Product. 3. PROPRIETARY RIGHTS. Portions of the Product are available in source code form under the terms of the Mozilla Public License and other open source licenses (collectively, "Open Source Licenses") at http://www.mozilla.org. Nothing in this Agreement will be construed to limit any rights granted under the Open Source Licenses. Subject to the foregoing, Mozilla, for itself and on behalf of its licensors, hereby reserves all intellectual property rights in the Product, except for the rights expressly granted in this Agreement. You may not remove or alter any trademark, logo, copyright or other proprietary notice in or on the Product. This license does not grant you any right to use the trademarks, service marks or logos of Mozilla or its licensors. 4. DISCLAIMER OF WARRANTY. THE PRODUCT IS PROVIDED "AS IS" WITH ALL FAULTS. TO THE EXTENT PERMITTED BY LAW, MOZILLA AND MOZILLA'S LICENSORS HEREBY DISCLAIM ALL WARRANTIES, WHETHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION WARRANTIES THAT THE PRODUCT IS FREE OF DEFECTS, MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE AND NON-INFRINGING. YOU BEAR ENTIRE RISK AS TO SELECTING THE PRODUCT FOR YOUR PURPOSES AND AS TO THE QUALITY AND PERFORMANCE OF THE PRODUCT. THIS LIMITATION WILL APPLY NOTWITHSTANDING THE FAILURE OF ESSENTIAL PURPOSE OF ANY REMEDY. SOME JURISDICTIONS DO NOT ALLOW THE EXCLUSION OR LIMITATION OF IMPLIED WARRANTIES, SO THIS DISCLAIMER MAY NOT APPLY TO YOU. 5. LIMITATION OF LIABILITY. EXCEPT AS REQUIRED BY LAW, MOZILLA AND ITS DIRECTORS, LICENSORS, CONTRIBUTORS AND AGENTS (COLLECTIVELY, THE "MOZILLA GROUP") WILL NOT BE LIABLE FOR ANY INDIRECT, SPECIAL, INCIDENTAL, CONSEQUENTIAL OR EXEMPLARY DAMAGES ARISING OUT OF OR IN ANY WAY RELATING TO THIS AGREEMENT OR THE USE OF OR INABILITY TO USE THE PRODUCT, INCLUDING WITHOUT LIMITATION DAMAGES FOR LOSS OF GOODWILL, WORK STOPPAGE, LOST PROFITS, LOSS OF DATA, AND COMPUTER FAILURE OR MALFUNCTION, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES AND REGARDLESS OF THE THEORY (CONTRACT, TORT OR OTHERWISE) UPON WHICH SUCH CLAIM IS BASED. THE MOZILLA GROUP'S COLLECTIVE LIABILITY UNDER THIS AGREEMENT WILL NOT EXCEED THE GREATER OF $500 (FIVE HUNDRED DOLLARS) AND THE FEES PAID BY YOU UNDER THIS LICENSE (IF ANY). SOME JURISDICTIONS DO NOT ALLOW THE EXCLUSION OR LIMITATION OF INCIDENTAL, CONSEQUENTIAL OR SPECIAL DAMAGES, SO THIS EXCLUSION AND LIMITATION MAY NOT APPLY TO YOU. 6. EXPORT CONTROLS. This license is subject to all applicable export restrictions. You must comply with all export and import laws and restrictions and regulations of any United States or foreign agency or authority relating to the Product and its use. 7. U.S. GOVERNMENT END-USERS. The Product is a "commercial item," as that term is defined in 48 C.F.R. 2.101, consisting of "commercial computer software" and "commercial computer software documentation," as such terms are used in 48 C.F.R. 12.212 (Sept. 1995) and 48 C.F.R. 227.7202 (June 1995). Consistent with 48 C.F.R. 12.212, 48 C.F.R. 27.405(b)(2) (June 1998) and 48 C.F.R. 227.7202, all U.S. Government End Users acquire the Product with only those rights as set forth herein. 8. MISCELLANEOUS. (a) This Agreement constitutes the entire agreement between Mozilla and you concerning the subject matter hereof, and it may only be modified by a written amendment signed by an authorized executive of Mozilla. (b) Except to the extent applicable law, if any, provides otherwise, this Agreement will be governed by the laws of the state of California, U.S.A., excluding its conflict of law provisions. (c) This Agreement will not be governed by the United Nations Convention on Contracts for the International Sale of Goods. (d) If any part of this Agreement is held invalid or unenforceable, that part will be construed to reflect the parties' original intent, and the remaining portions will remain in full force and effect. (e) A waiver by either party of any term or condition of this Agreement or any breach thereof, in any one instance, will not waive such term or condition or any subsequent breach thereof. (f) Except as required by law, the controlling language of this Agreement is English. (g) You may assign your rights under this Agreement to any party that consents to, and agrees to be bound by, its terms; the Mozilla Foundation may assign its rights under this Agreement without condition. (h) This Agreement will be binding upon and will inure to the benefit of the parties, their successors and permitted assigns. License: BSD Redistribution and use in source and binary forms, with or withoutmodification, are permitted provided that the following conditionsare met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 2. 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. 3. The name of the author may not be used to endorse or promote products derived from this software without specific prior written permission. . THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. debian/apache-vhost.conf0000644000000000000000000001050512252640275012425 0ustar # Configuration for the apache web server -*- apache -*- # To use TYPO3 as a VirtualHost customize the following section ServerName typo3.example.com ServerAdmin webmaster@example.com DocumentRoot /var/lib/typo3-dummy ErrorLog /var/log/apache2/typo3.com-error.log CustomLog /var/log/apache2/typo3.com-access.log combined DirectoryIndex index.php index.html # TYPO3 needs files shared between different instances. These are # symlinked into the document root directory. The following # directive enables that apache follows the symlinks. Disable directory # listing globally. Options +FollowSymLinks -Indexes # disable .htaccess, because it slows down apache AllowOverride None Order allow,deny Allow from all ### Begin: PHP optimisation ### # enable PHP processing for files ending with .php AddType application/x-httpd-php .php # Maximum allowed size for uploaded files (PHP defaults to 2MB) php_admin_value upload_max_filesize 10M php_admin_value post_max_size 10M php_admin_value upload_tmp_dir /var/run/typo3-dummy # Maximum amount of memory a script may consume (PHP defaults to 8MB) # You may want to set this higher as 48 mb if you have problems # getting the extension manager to work. php_admin_value memory_limit 48M # Maximum amount of time a script my consume # You may want to set this higher as 30 seconds if you have problems # getting the extension manager to work. # php_admin_value max_execution_time 90 # list of directories where require(), include() and fopen_with_path() look for files php_admin_value include_path /var/lib/typo3-dummy/:/usr/share/typo3/typo3_src-4.5/:.:/usr/share/php:/usr/share/pear php_admin_value sendmail_path "/var/lib/typo3-dummy/execdir/sendmail -t -i" # Limit the files that can be opened by PHP to the specified directory-tree(s) php_admin_value open_basedir /var/run/typo3-dummy/:/var/lib/typo3-dummy/:/usr/share/typo3/:/etc/typo3-dummy/:/usr/share/fonts/truetype/ttf-bitstream-vera/:/usr/share/javascript/prototype/:/usr/share/javascript/scriptaculous/:/usr/share/php/adodb/:/usr/share/php/Swift/:/usr/share/javascript/swfupload/:/usr/share/javascript/swfobject/ # The PHP developers recommend disabling this feature. Do that. # It's deprecated and is likely to be unsupported in future # versions of PHP. php_flag allow_call_time_pass_reference off # TYPO3 works fine with register_globals turned off. # This is highly recommended! php_flag register_globals off # PHP may not declare the argv & argc variables (that would # contain the GET information). # TYPO3 doesn't need this, so just turn it off. php_flag register_argc_argv off # Magic quotes for runtime-generated data (data from SQL, exec(), etc.) php_flag magic_quotes_gpc off # Order in which PHP registers GET, POST, Cookie and Built-in variables php_value variables_order GPCS ### End: PHP optimisation ### ### Begin: Rewrite stuff ### # Enable URL rewriting RewriteEngine On # To assist in debugging rewriting, you could use these lines # DON'T enable it for production! #RewriteLog /var/log/apache/rewrite.log #RewriteLogLevel 9 # Stop rewrite processing if we are in the typo3/ directory RewriteRule ^/(typo3|typo3temp|typo3conf|t3lib|fileadmin|uploads)/ - [L] # Redirect http://mysite/cms/typo3 to http://mysite/cms/typo3/index_re.php # and stop the rewrite processing RewriteRule ^/typo3$ /typo3/index_re.php [L] # If the file/symlink/directory does not exist => Redirect to index.php RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-l # Main URL rewriting. RewriteRule .* /index.php [L] ### End: Rewrite stuff ### debian/changelog0000644000000000000000000010421412252640275011047 0ustar typo3-src (4.5.32+dfsg1-1) unstable; urgency=medium * New upstream release: - fixes: "TYPO3-CORE-SA-2013-004: Multiple Vulnerabilities in TYPO3 CMS" (Closes: #731999) -- Christian Welzel Fri, 13 Dec 2013 20:08:14 +0100 typo3-src (4.5.30+dfsg1-2) unstable; urgency=low * Reworked typo3-dummy.postinst and typo3-dummy.postrm (Closes: 714888). * Added mysql-client to dependency list of typo3-dummy. -- Christian Welzel Thu, 21 Sep 2013 23:08:14 +0200 typo3-src (4.5.30+dfsg1-1) unstable; urgency=low * New upstream release. -- Christian Welzel Thu, 21 Sep 2013 22:08:14 +0200 typo3-src (4.5.29+dfsg1-1) unstable; urgency=medium * New upstream release: - fixes: "TYPO3-CORE-SA-2013-002: Cross-Site Scripting and Remote Code Execution Vulnerability in TYPO3 Core" (Closes: 720194) * Import of sources of 2.0.4.6 of 1pixelout audio player from http://subversion.assembla.com/svn/1pixelout/audio-player/tags/2.0.4.6. * Changed audio player license (GPL-2 -> MIT). -- Christian Welzel Wed, 21 Aug 2013 22:08:14 +0200 typo3-src (4.5.27+dfsg1-3) unstable; urgency=low * Added italian translation (Closes: #712400) -- Christian Welzel Thu, 20 Jun 2013 11:26:36 +0200 typo3-src (4.5.27+dfsg1-2) unstable; urgency=low * Fix detection of apache 2.2 (Closes: #710512). -- Christian Welzel Tue, 04 Jun 2013 20:13:56 +0200 typo3-src (4.5.27+dfsg1-1) unstable; urgency=low * New upstream release. * Removed patch for wheezy patch level version. * Removed patch for TYPO3-SA-2013-001 (integrated into upstream). * Removed patch for TYPO3-CORE-SA-2012-004 (integrated into upstream). * Set standards version to 3.9.4. * Removed DM-Upload-Allowed header. * Removed access to /lib/init/vars.sh from typo3-dummy.init. * Added database schema change for typo3 bug 16762. -- Christian Welzel Thu, 30 May 2013 17:37:22 +0200 typo3-src (4.5.19+dfsg1-5) unstable; urgency=low * Added patch for TYPO3-SA-2013-001. (Closes: #702574) * Set patch level version to -pl.4.5.25. -- Christian Welzel Fri, 08 Mar 2013 17:02:05 +0100 typo3-src (4.5.19+dfsg1-4.1) unstable; urgency=low * Non-maintainer upload. * Fix "copyright file missing after upgrade (policy 12.5)": replace directory with symlink in typo3.postinst. Thanks Andreas Beckmann for the bug report and the template for the fix. (Closes: #698631) -- gregor herrmann Mon, 28 Jan 2013 21:23:03 +0100 typo3-src (4.5.19+dfsg1-4) unstable; urgency=medium * Added patch for regression introduced by TYPO3-SA-2012-5-patch. * Set patch level version to -pl.4.5.22. -- Christian Welzel Tue, 13 Nov 2012 12:04:00 +0100 typo3-src (4.5.19+dfsg1-3) unstable; urgency=medium * Added patch for TYPO3-SA-2012-5 (Closes: #692775) * Set patch level version to -pl.4.5.21. -- Christian Welzel Thu, 08 Nov 2012 22:04:00 +0100 typo3-src (4.5.19+dfsg1-2) unstable; urgency=low * Added rsaauth and saltedpasswords to the list of installed extensions and change owner and permissions of generated localconf.php in postinst. (Closes: 689329) -- Christian Welzel Wed, 10 Oct 2012 15:09:57 +0200 typo3-src (4.5.19+dfsg1-1) unstable; urgency=high * New upstream release: - fixes: "TYPO3 Security Bulletin TYPO3-CORE-SA-2012-004: Several Vulnerabilities in TYPO3 Core" (Closes: 685011) -- Christian Welzel Wed, 15 Aug 2012 22:40:03 +0200 typo3-src (4.5.17+dfsg1-1) unstable; urgency=low * New upstream release. * Added all linked external resources to open_basedir. * Increased max_post_size to match upload_max_filesize (both 10M now) * Removed PHP safe_mode options as they are removed from PHP 5.4 (and cause errors with external resources and the TYPO3 compressor) * Removed E_STRICT patch for PHP 5.4 (applied upstream). -- Christian Welzel Thu, 05 Jul 2012 22:40:03 +0200 typo3-src (4.5.16+dfsg3-1) unstable; urgency=low * Remove jslint.js because of non free license. -- Christian Welzel Mon, 28 May 2012 16:56:48 +0200 typo3-src (4.5.16+dfsg2-1) unstable; urgency=low * Cleanup of build target. * Removes embeded swfupload and adds depend on libjs-swfupload. * Moved source code for multimedia players from patches to debian/contrib/ * Moved source code for modernizr from patches to debian/contrib/ * Remove typo3/contrib/extjs/resources/charts.swf because of missing source. * Added source of typo3/contrib/svgweb. * Build svgweb javascript from source. * Make get-orig-source use gzip -9. -- Christian Welzel Sat, 26 May 2012 09:40:17 +0200 typo3-src (4.5.16+dfsg1-1) unstable; urgency=low * New upstream release. * Fixed upstream version mangling for alpha/beta/rc upstream packages. * Added DM-Upload-Allowed: yes * Removed 0001-BUGFIX-Pagetree-broken-due-to-JavaScript-exception.patch (applied upstream). -- Christian Welzel Tue, 22 May 2012 17:00:53 +0200 typo3-src (4.5.15+dfsg1-2) unstable; urgency=low * Install localconf.php as localconf.php_template, and create localconf.php from it at install time. (Closes: 666237) * Added support for apache2.4, protected apache2.2 commands by check for apache2.2-common. (Closes: 669793, 618381) * Updated README.debian files. (Closes: 614140) -- Christian Welzel Sun, 22 Apr 2012 14:54:15 +0200 typo3-src (4.5.15+dfsg1-1) unstable; urgency=medium * New upstream release: - fixes: "TYPO3 Security Bulletin TYPO3-CORE-SA-2012-002: Cross-Site Scripting Vulnerability in TYPO3 Core" (Closes: 669158) * Database update for field uc in be_users. * Added bugfix patch for TYPO3 bug #36238. * Added patch for errors with PHP 5.4 * Move Homepage field to source package. * Added Vcs-Git, changed Vcs-Browser to point to github * changed Homepage field to typo3.org * Cleanup of watch file. * Added comments to lintian overrides. * Raised compat level to 7. * Deleted typo3-src-4.5.examples because its empty. * Removed numbering from patches, changed order to alphabetical. * Changed index.html files to print warning about directory listing only, not redirect anymore. * Disable directory listing globally in apache config. -- Christian Welzel Sat, 21 Apr 2012 12:32:23 +0200 typo3-src (4.5.14+dfsg1-1) unstable; urgency=high * New upstream release: - fixes: "TYPO3 Security Bulletin TYPO3-CORE-SA-2012-001: Several Vulnerabilities in TYPO3 Core" (Closes: 666074) * Package descriptions rewritten * Reworked copyright file * Add RSA-Auth to default configuration * Fix description of patch 05-add-source-for-mediaplayer-swfs.patch * Added source for modernizr and and swfupload as debian-patches * Added target "get-orig-source" to rules to fetch upstream blankpackage.zip file and repack it to .tar.gz * Removed find-sql target from rules * Added target prepare-source to rules * Adopted watch file for zip download * Added note about creation of source package to README.source * Changed depend from ttf-dejavu to ttf-bitstream-vera. Adjusted symlink of vera.tff accordingly. * Refreshed patches for removed "dummy" directory. * Bumped standards version to 3.9.3 * Added description to patches 07 and 08. -- Christian Welzel Wed, 28 Mar 2012 15:47:41 +0200 typo3-src (4.5.13+dfsg1-1) unstable; urgency=low * New upstream release. * Added Dutch debconf translation (Closes: 661129) * Ported patch 06-fix-im-command.patch to new class.t3lib_utility_command.php * Added description to patches * Removed embedded copy of swfobject, added depends on libjs-swfobject * Remove .gitignore from linkvalidator subfolder * Added lintian override typo3-dummy: init.d-script-does-not-implement-optional-option * Added lintian override for typo3-src-4.5: font-in-non-font-package (nimbus.ttf) * Rewritten short description of binary package typo3. -- Christian Welzel Sat, 17 Mar 2012 13:44:38 +0100 typo3-src (4.5.11+dfsg1-1) unstable; urgency=low * New upstream release. * Changed symlink of prototype.js to point to prototype-1.js instead of prototype-1.6.js (Closes: 651128) -- Christian Welzel Sat, 11 Feb 2012 21:51:10 +0100 typo3-src (4.5.10+dfsg1-1) unstable; urgency=medium * New upstream release: - fixes regression introduced with last update. -- Christian Welzel Sat, 24 Dec 2011 14:00:00 +0100 typo3-src (4.5.9+dfsg1-1) unstable; urgency=high * New upstream release: - fixes: "TYPO3 Security Bulletin TYPO3-CORE-SA-2011-004: Remote Code Execution in TYPO3 Core" (Closes: #652365) -- Christian Welzel Fri, 16 Dec 2011 20:00:00 +0100 typo3-src (4.5.8+dfsg1-1) unstable; urgency=medium * New upstream release. * Adopted patch 02-dummy-defaults.patch to new localconf.php. * Removed unused lintian override "embedded-php-library". * Added build-arch to build-indep rules. * Raised standards version to 3.9.2 -- Christian Welzel Thu, 13 Dec 2011 20:00:00 +0100 typo3-src (4.5.6+dfsg1-1) unstable; urgency=high * New upstream release: - fixes: "TYPO3 Security Bulletin TYPO3-CORE-SA-2011-002: Potential SQL injection vulnerability in TYPO3 Core" (Closes: 641682) - fixes: "TYPO3 Security Bulletin TYPO3-CORE-SA-2011-003: Improper error handling could lead to cache flooding in TYPO3 Core" (Closes: 641683) -- Christian Welzel Thu, 15 Sep 2011 10:00:00 +0100 typo3-src (4.5.4+dfsg1-1) unstable; urgency=high * New upstream release: - fixes: "TYPO3 Security Bulletin TYPO3-CORE-SA-2011-001: Multiple vulnerabilities in TYPO3 Core" (Closes: 635937) * Adopted patch 02-dummy-defaults.patch to new localconf.php. * Removed typo3-dummy.examples, because its empty now. -- Christian Welzel Fri, 29 Jul 2011 20:00:00 +0100 typo3-src (4.5.3+dfsg1-1) unstable; urgency=low * New upstream release. * Patches refreshed. * debian/rules: set correct permissions for cron script. -- Christian Welzel Wed, 1 Jun 2011 22:00:00 +0100 typo3-src (4.5.2+dfsg1-1) unstable; urgency=low * New upstream release. * Moved php5-xcache to Recommends and added php-apc as alternative. * Removed 07-fix-beforeWrap-of-TMENU.patch (now included in upstream). * Removed swiftmailer from typo3/contrib, added depend on libphp-swiftmailer. * Added /usr/share/php/Swift/ to open_basedir in apache config. -- Christian Welzel Wed, 2 Mar 2011 22:00:00 +0100 typo3-src (4.5.0+dfsg1-3) unstable; urgency=low * Fix spelling error (Closes: 611482) * Add patch to enable beforeWrap on TMENU (Closes: 606740) -- Christian Welzel Sun, 30 Jan 2011 22:00:00 +0100 typo3-src (4.5.0+dfsg1-2) unstable; urgency=low * Fix encoding of Swedish debconf translation (Christian Perrier ). * Removed mistakenly doubled content in mysql file (Closes: 611386). * Add apache2.2-common to recommends. (Closes: #611387) -- Christian Welzel Sat, 29 Jan 2011 14:00:00 +0100 typo3-src (4.5.0+dfsg1-1) unstable; urgency=low * New upstream release. * Removed dummy/misc from rules and typo3-src.examples because its missing in upstream. * Removed plupload from copyright and rules (removed by upstream). -- Christian Welzel Sat, 15 Jan 2011 14:00:00 +0100 typo3-src (4.5.0+dfsg1~beta3-1) experimental; urgency=low * New upstream release. * Removed patch for TYPO3-SA-2010-022 (fixed by upstream now). * Added patch 06-fix-im-command.patch to fix a wrong command quoting (Closes: 606738) * Added php5-suhosin to Recommends. -- Christian Welzel Wed, 05 Jan 2011 22:00:00 +0100 typo3-src (4.5.0+dfsg1~beta2-3) experimental; urgency=high * Fixed regression bug imported by last version. (Closes: 607577) -- Christian Welzel Tue, 21 Dec 2010 22:00:00 +0100 typo3-src (4.5.0+dfsg1~beta2-2) experimental; urgency=high * Ported some security fixes from TYPO3 4.4.5 to this version - fixes: "TYPO3 Security Bulletin TYPO3-SA-2010-022: Multiple vulnerabilities in TYPO3 Core" (Closes: 607286) -- Christian Welzel Thu, 16 Dec 2010 22:00:00 +0100 typo3-src (4.5.0+dfsg1~beta2-1) experimental; urgency=low * New upstream release. * Added source for player.swf and flvplayer.swf (see #591969). -- Christian Welzel Fri, 02 Dec 2010 22:00:00 +0200 typo3-src (4.5.0+dfsg1~beta1-1) experimental; urgency=low * Removed typo3/contrib/jsmin/jsmin.php because of non free license (Closes: 602250) * Added notice about license of qtobject.js to copyright file. * Added README.source. * Corrected watch file. * Added rule "dfsg" to rules to remove non free files. -- Christian Welzel Fri, 26 Nov 2010 22:00:00 +0200 typo3-src (4.5.0~beta1-1) experimental; urgency=low * New upstream release. * Merged typo3-src and typo3-dummy source packages. * Fixed spelling error in control (Closes: 598816) * Added lintian override for "embedded-php-library" on "libnusoap-php" because of customized nusoap in these packages (see 529581) * Added japanese translation (Closes: 599088) * Reorganized and updated changelog. Uses DEP-5 format now. * localconf.php: - raised memory limit to 64MB - disabled donation window - set search path for binaries - disabled deprecation logging * Moved mysql sql file to own directory and added upgrade sql to 4.5. * Added backend user "admin"/"password" to mysql/mysql. * Added generation of encryption key to typo3-dummy.postinst. -- Christian Welzel Mon, 18 Nov 2010 22:00:00 +0200 typo3-src (4.3.8-1) unstable; urgency=medium * New upstream release: - fixes a regression introduced during last upstream release. -- Christian Welzel Wed, 13 Oct 2010 22:00:00 +0200 typo3-src (4.3.7-1) unstable; urgency=high * New upstream release: - fixes: "TYPO3 Security Bulletin TYPO3-SA-2010-020: Multiple vulnerabilities in TYPO3 Core" (Closes: 599334) * raised standards version to 3.9.1 -- Christian Welzel Fri, 08 Oct 2010 22:00:00 +0200 typo3-src (4.3.5-1) unstable; urgency=high * New upstream release: - Fixes some regressions introduced in 4.3.4 -- Christian Welzel Fri, 06 Aug 2010 22:00:00 +0200 typo3-src (4.3.4-1) unstable; urgency=high * New upstream release: - fixes "TYPO3 Security Bulletin TYPO3-SA-2010-012: Multiple vulnerabilities in TYPO3 Core" (Closes: 590719) * fixed spelling error in typo3-src-4.3.README.Debian (Closes: 588518) * added debian/source/include-binaries with content "nimbus.sfd.gz". * raised standards version to 3.9.0 -- Christian Welzel Wed, 28 Jul 2010 22:00:00 +0200 typo3-src (4.3.3-2) unstable; urgency=low * Moved source format from "1.0" to "3.0 (quilt)". * Removed README.source. * Removed dpatch system. * Moved debian/patches/00list to debian/patches/series, modified it. * Moved debian/patches/*.dpatch to debian/patches/*.patch, removed dpatch specific code. * Changed dependency "libapache2-mod-php5 | php5-cgi" to "php5" * Moved nimbus.sfd.gz.uuencoded to nimbus.sfd.gz. -- Christian Welzel Wed, 05 May 2010 17:27:41 +0200 typo3-src (4.3.3-1) unstable; urgency=medium * New upstream release: - fixes "TYPO3 Security Bulletin TYPO3-SA-2010-008: Remote Command Execution in TYPO3 Core" (Closes: 577993) * Added file debian/source/format with "1.0" as content. -- Christian Welzel Thu, 22 Apr 2010 22:00:00 +0100 typo3-src (4.3.2-1) unstable; urgency=high * New upstream release: - fixes "TYPO3 Security Bulletin TYPO3-SA-2010-004: Multiple vulnerabilities in TYPO3 Core" (Closes: 571151) -- Christian Welzel Wed, 24 Feb 2010 22:00:00 +0100 typo3-src (4.3.1-2) unstable; urgency=low * fixed wrong link to prototype javascript library (Closes: 561095) * raised standards version to 3.8.4 -- Christian Welzel Sat, 13 Feb 2010 15:00:00 +0100 typo3-src (4.3.1-1) unstable; urgency=high * New upstream release: - fixes "TYPO3 Security Bulletin TYPO3-SA-2010-001: Authentication Bypass in TYPO3 Core" (Closes: 567163) * fixed spelling error in typo3-database.README.Debian. -- Christian Welzel Fri, 29 Jan 2010 18:00:00 +0100 typo3-src (4.3.0-1) unstable; urgency=low * New upstream release. * Fixed "dpkg-gencontrol: Warnung: relation > is deprecated: use >> or >=". * debian/rules: Added target find-sql to get a list of important sql-files. (needed for maintainance only) * debian/mysql: SQL commands for populating mysql don't include help texts anymore, to make the package smaller. They can be imported with the TYPO3 database-assistant. -- Christian Welzel Thu, 03 Dec 2009 22:00:00 +0100 typo3-src (4.3.0~beta2-1) experimental; urgency=high * New upstream release. - fixes "TYPO3 Security Bulletin TYPO3-SA-2009-016: Multiple vulnerabilities in TYPO3 Core" (Closes: 552020) -- Christian Welzel Thu, 22 Oct 2009 22:00:00 +0100 typo3-src (4.3.0~beta1-1) experimental; urgency=low * New upstream release. * Raised standards version to 3.8.3. * Added lintian override for non-free-flash error. The flvplayer.swf is based on the GPL licensed anarchy player. * Added README.source. Texts points to dpatchs README.source. * Added version mangling to watch file (Closes: 539489) * Added license of typo3/contrib/flashmedia/player.swf to "copyright". -- Christian Welzel Mon, 12 Oct 2009 22:00:00 +0100 typo3-src (4.3.0~alpha3-1) experimental; urgency=low * New upstream release. * Raised standards version to 3.8.1. * Raised compat version to 5. * Added dephelper depends. * Moved homepage to header field. * Added lintian override for embedded-php-library in open-id (the version shipped is a stripped down and patched version for TYPO3). * Added README file for typo3-database. -- Christian Welzel Sun, 07 Jun 2009 20:00:00 +0100 typo3-src (4.3.0~alpha2-1) experimental; urgency=low * New upstream release. * Degraded binary package typo3 to a meta package. * Added new binary package typo3-database. * Dependency cleanup for the binary package typo3-src. * Some cleanup in README files. * Rewritten long description. * Added debian/mysql, a manually created database dump of an empty TYPO3 DB. * Integrated dbconfig-common in maintenance mode. -- Christian Welzel Sun, 22 Mar 2009 20:00:00 +0100 typo3-src (4.2.10-1) unstable; urgency=high * New upstream release. - fixes "TYPO3 Security Bulletin TYPO3-SA-2009-016: Multiple vulnerabilities in TYPO3 Core" (Closes: 552020) -- Christian Welzel Thu, 22 Oct 2009 22:00:00 +0100 typo3-src (4.2.9-1) unstable; urgency=low * New upstream release. -- Christian Welzel Mon, 12 Oct 2009 22:00:00 +0100 typo3-src (4.2.8-1) unstable; urgency=low * New upstream release. -- Christian Welzel Sat, 04 Jul 2009 17:00:00 +0100 typo3-src (4.2.6-1) unstable; urgency=high * New upstream release. - fixes TYPO3 Security Bulletin TYPO3-SA-2009-002: Information disclosure and XSS vulnerabilities in TYPO3 (Closes: 514713) -- Christian Welzel Mon, 10 Feb 2009 12:00:00 +0100 typo3-src (4.2.5-1) unstable; urgency=medium * New upstream release. - fixes a serious bug in session handling with not logged in FE-Users. -- Christian Welzel Mon, 26 Jan 2009 20:00:00 +0100 typo3-src (4.2.4-1) unstable; urgency=high * New upstream release. - fixes TYPO3 Security Bulletin TYPO3-SA-2009-001: Multiple vulnerabilities in TYPO3 Core (Closes: 512608) * Updated package description. * Updated copyright file to list the license of two icons. -- Christian Welzel Thu, 22 Jan 2009 12:00:00 +0100 typo3-src (4.2.3-1) unstable; urgency=high * New upstream release. - fixes XSS vulnerability in Typo3 backendmodul "fileadmin" (Closes: 505324) - fixes XSS vulnerability in Typo3 sysext "felogin" (Closes: 505325) - fixes the passwords are not changeable bug in the backend (Closes: 505326) * added dependency on libjs-scriptaculous -- Christian Welzel Tue, 11 Nov 2008 20:00:00 +0100 typo3-src (4.2.2-1) unstable; urgency=low * New upstream release. -- Christian Welzel Wed, 25 Jun 2008 20:00:00 +0100 typo3-src (4.2.1-3) unstable; urgency=low * Fixed versioned dependency on libjs-prototype -- Christian Welzel Wed, 25 Jun 2008 20:00:00 +0100 typo3-src (4.2.1-2) unstable; urgency=low * Moved libjs-prototype from Recommends-field do Depends-field. -- Christian Welzel Sun, 22 Jun 2008 11:00:00 +0100 typo3-src (4.2.1-1) unstable; urgency=low * New upstream release. - Support for php4 has been dropped. * cleaned typo3.README.Debian and typo3-src-4.2.README.Debian * some fixes to debian/rules * Depend on libjs-prototype for prototype.js (Closes: 475282) * Raised stardards version to 3.8.0 -- Christian Welzel Fri, 20 Jun 2008 22:00:00 +0100 typo3-src (4.1.7-1) unstable; urgency=high [ Christian Welzel ] * New upstream release - fixes TYPO3-20080611-1: Multiple vulnerabilities in TYPO3 Core (Closes: #485814) [ Holger Levsen ] * Change recommends from gs to ghostscript. * Remove obsolete overrides for linda, which is obsolete itself. * Fix spelling error in description. -- Christian Welzel Wed, 11 Jun 2008 15:00:00 +0100 typo3-src (4.1.6-1) unstable; urgency=low * New upstream release. * Dependency changed from ttf-bitstream-vera to ttf-dejavu (Closes: 461294) -- Christian Welzel Sun, 09 Mar 2008 10:00:00 +0100 typo3-src (4.1.5-1) unstable; urgency=medium * New upstream release (Closes: 454265). -- Christian Welzel Fri, 14 Dec 2007 20:00:00 +0100 typo3-src (4.1.4-1) unstable; urgency=low * New upstream release. - Fixes a low-severity SQL injection in the modfunc2 of indexed_search * t3lib/fonts/readme.txt is now patched by dpatch. * nimbus.sfd.gz added to debian diff (perl encoded). * copying of linda overides slightly changed. * added watch file. * unreleased. -- Christian Welzel Thu, 13 Dec 2007 21:00:00 +0100 typo3-src (4.1.2+debian-1) unstable; urgency=low * New upstream release. - Several improvements to avoid security issues by 3rd party extensions. * Added linda overrides. * Fixed some whitespaces in t3lib/fonts/readme.txt. -- Christian Welzel Wed, 18 Jul 2007 14:00:00 +0100 typo3-src (4.1.1+debian-1) unstable; urgency=low * New upstream release. - Fixes problem with rtehtmlarea and Mozilla Firefox 2.0.0.3 -- Christian Welzel Wed, 04 Apr 2007 14:00:00 +0100 typo3-src (4.1.0+debian-1) unstable; urgency=low * New upstream release. -- Christian Welzel Tue, 20 Mar 2007 09:00:00 +0100 typo3-src (4.0.5+debian-1) unstable; urgency=low * New upstream release. - Fixes "TYPO3 Security Bulletin TYPO3-20070221-1: Email header injection" * Removed t3lib_div-PHP52.dpatch (now integrated by upstream) * Fixed typo and added note to typo3.README.Debian (Closes: 405577) -- Christian Welzel Thu, 22 Feb 2007 21:00:00 +0100 typo3-src (4.0.4+debian-2) unstable; urgency=low * Added t3lib_div-PHP52.dpatch to fix crash of PHP 5.2.0 -- Christian Welzel Fri, 22 Dec 2006 12:00:00 +0100 typo3-src (4.0.4+debian-1) unstable; urgency=high * New upstream release. - Fixed security problem in rtehtmlarea extension. (Closes: 403906) -- Christian Welzel Sat, 20 Dec 2006 23:35:41 +0100 typo3-src (4.0.3+debian-1) unstable; urgency=low * New upstream release. * added some comments on memory usage and further help to README.Debian. (Closes: 403114) * Changed ownership of /usr/share/typo3/typo3_src-4.0 to root:www-data. * Dropped depend on imagemagick. Use graphicsmagick (better results). -- Christian Welzel Sat, 16 Dec 2006 23:05:41 +0100 typo3-src (4.0.2+debian-1) unstable; urgency=low * Depend on ttf-bitstream-vera for vera.ttf (Closes: 374141) * Repackaged source.tgz to include source and license of nimbus.ttf. (Closes: 374137) * Removed the creation of "latest"-link; typo3-dummy has hardcoded sourcedir. -- Christian Welzel Mon, 24 Nov 2006 12:37:00 +0200 typo3-src (4.0.2-3) unstable; urgency=low * Do not depend on gs. This violate the policy. Recommend it. * Removed suggestion of typo3-site-installer. * Changed recommendation of mysql-server-4.1 to mysql-server. * Changed recommendation of graphicsmagick-im-compat | imagemagick to graphicsmagick | graphicsmagick-imagemagick-compat | imagemagick -- Christian Welzel Mon, 23 Nov 2006 19:37:00 +0200 typo3-src (4.0.2-2) unstable; urgency=low * Do not depend on php-mysql. Recommendation is enough. * moved phpX-cgi to Depends as another alternative (Typo3 and PHP in fcgid) * added phpX-xcache to Recommends -- Christian Welzel Mon, 21 Oct 2006 19:37:00 +0200 typo3-src (4.0.2-1) unstable; urgency=low * New maintainer (Closes: #388766). * New upstream release (Closes: #341709): - fixed by upstream: Remote command execution, arbitrary file viewing [CVE-2006-0327] (Closes: #364351). - fixed by upstream: Mail forms can be used to send spam (Closes: #364350). * removed recommendation of eaccelerator (Closes: #377821). * removed dep on non existing ooo_extract (Closes: #310776). * added alternative dep on php-cgi (Closes: #311277). * added alternative dep on php5 (Closes: #366533). -- Christian Welzel Mon, 18 Sep 2006 12:37:00 +0200 typo3-src (3.7.0-8) unstable; urgency=low * debian/control: depend on MySQL > 4.0.18 to allow the usage of the versioning extension -- Christian Leutloff Wed, 11 May 2005 18:07:56 +0200 typo3-src (3.7.0-7) unstable; urgency=low * debian/typo3.README.Debian: started new section with common pitfalls -- Christian Leutloff Mon, 9 May 2005 09:56:37 +0200 typo3-src (3.7.0-7) unstable; urgency=low * debian/control: modified dependencies according to Michael Stucki * debian/typo3.README.Debian: mention packages source for eaccelerator and graphicsmagick -- Christian Leutloff Fri, 6 May 2005 14:57:06 +0200 typo3-src (3.7.0-6) unstable; urgency=low * debian/typo3-src-3.7.prerm: can not remove the symlink maintained by this package * debian/typo3-src-3.7.postinst: reworked * debian/typo3-src-3.7.README.Debian: updated to version 3.7 -- Christian Leutloff Wed, 4 May 2005 21:48:04 +0200 typo3-src (3.7.0-5) unstable; urgency=low * debian/control: added dependency to libapache2-mod-php4 | libapache-mod-php4 (thanks to Thomas Barth) * typo3.README.Debian: clarified some points -- Christian Leutloff Wed, 4 May 2005 16:25:52 +0200 typo3-src (3.7.0-4) unstable; urgency=low * control: added depned on postfix as an alternative to exim * added TODO file * typo3.README.Debian: concentrated now all the TYPO3 specific remarks in this single file and added references in the READMEs of the other packages * renamed packages from typo3-db-dummy to typo3-dummy -- Christian Leutloff Wed, 4 May 2005 07:45:12 +0200 typo3-src (3.7.0-3) unstable; urgency=low * typo3.README.Debian: more improvements through doing a step by step validation -- Christian Leutloff Fri, 22 Apr 2005 18:40:27 +0200 typo3-src (3.7.0-2) unstable; urgency=low * polish package documention in typo3 -- Christian Leutloff Mon, 11 Apr 2005 19:18:00 +0200 typo3-src (3.7.0-1) unstable; urgency=low * un-do package split because the way choosen was to simple -- Christian Leutloff Tue, 23 Nov 2004 21:13:46 +0100 typo3-src (3.7.0-0.2) experimental; urgency=low * Add dependency on libgd2-xpm (>= 2.0.28-2), as mentioned by renedustmann@maxx2.de in news:typo3.install.debian on 13.08.2004 to be a working combination. * add provides typo3-frontend/typo3-backend -- Christian Leutloff Thu, 4 Nov 2004 10:51:32 +0100 typo3-src (3.7.0-0.1) experimental; urgency=low * NMU, working towards inclusion into the Debian main archive * update to new upstream version * updated to Standards 3.6.1 * packaging reworked: split package in frontend and backend to allow installation of frontend only servers (as mentioned in the Typo3-Book) * packaging reworked: Undoing the "Move everything from /usr/share/typo3 to /var/lib/typo3 This solves all problems we had with symlinks. However, I think it is not really FHS-conform, so I'm still not happy with that." from 3.5.0-3 to be FHS and Debian conform. * manage "lastest" symlink in postinst and prerm * change package priority from extra to optional -- Christian Leutloff Wed, 3 Nov 2004 19:43:08 +0100 typo3-src (3.5.0-7) experimental; urgency=low * typo3-site-installer: complete rewrite * typo3-site-installer: added 2 more options (-a, -g) * the source of TYPO3 now belongs to root.root (was root.www-data) * example localconf.php: now using the im_noFramePrepended option * typo3-site-installer: manpage update * typo3-base now depends on apache or httpd (provided by apache-ssl, etc.) -- Michael Stucki Mon, 20 Oct 2003 23:00:24 +0200 typo3-src (3.5.0-6) experimental; urgency=low * removed dependency for apache and php4 in typo3-base * typo3-site-installer: one more bugfix in sed command -- Michael Stucki Tue, 16 Sep 2003 01:07:37 +0200 typo3-src (3.5.0-5) experimental; urgency=low * typo3-site-installer: Added README.Debian / removed obsolete documentation * Added a manpage for typo3-site-installer (thanks to Edelhard Becker) * typo3-site-installer.sh was renamed to typo3-site-installer * typo3-site-installer: accepts abolute paths now * typo3-site-installer: compatibility bugfix in sed command -- Michael Stucki Mon, 16 Jun 2003 18:11:53 +0100 typo3-src (3.5.0-4) experimental; urgency=low * Fixes in typo3-base preinst script * typo3-site-installer does no more need to download a dummysite archive -- Michael Stucki Thu, 5 Jun 2003 17:42:08 +0100 typo3-src (3.5.0-3) experimental; urgency=low * Added a localconf.php example * Added a new package "typo3-site-installer" that contains a little install helper * Added a new package "typo3-env" which depends on all needed components. "typo3-base" only recommends them, since you could still run your server without them. However it's easier to to an 'apt-get install typo3-env' since apt wouldn't worry about the recommendations else. * Fix wrong PHP short tags: ' ' Thu, 5 Jun 2003 02:07:28 +0100 typo3-src (3.5.0-2) experimental; urgency=low * Change ownership of /var/lib/typo3 to www-data (webserver could not write global extensions before) * Fix problem with some missing files by adding symlinks in /var/lib/typo3/ (this is only a workaround, I am not happy with this solution...) -- Michael Stucki Wed, 26 Mar 2003 15:40:44 +0100 typo3-src (3.5.0-1) experimental; urgency=low * New upstream release * Move /var/cache/typo3 to /var/lib/typo3 (this was wrong, since extensions are not really cache files...) -- Michael Stucki Sat, 22 Feb 2003 17:16:24 +0100 typo3-src (3.5b5-5) experimental; urgency=low * Alter contents of debian/executables * Update TODO notes * Move typo3/ext to /var/cache/typo3//ext (keep read-only for now) * t3lib/config_default.php: Change 'TTFdpi' from 72 to 96 -- Michael Stucki Tue, 11 Feb 2003 13:39:04 +0100 typo3-src (3.5b5-4) experimental; urgency=low * Update TODO notes * Move typo3/temp to /var/cache/typo3//temp * Do some code cleanup in debian/rules -- Michael Stucki Thu, 6 Feb 2003 19:57:37 +0100 typo3-src (3.5b5-3) experimental; urgency=low * Fix some dependencies -- Michael Stucki Thu, 6 Feb 2003 05:39:51 +0100 typo3-src (3.5b5-2) experimental; urgency=low * Add a note in README.Debian about how to use this package at all * Fix Lintian complains: Small changes in copyright file * Add recommendation for php4-cgi (used by some direct_mail scripts) * Fix Lintian complains: Change ownership of /typo3/temp from root to www-data; remove write permission for group * Fix permissions for executable scripts * Add symlink that points to latest source installation -- Michael Stucki Sat, 1 Feb 2003 05:14:52 +0100 typo3-src (3.5b5-1) experimental; urgency=low * Initial Release. -- Michael Stucki Fri, 31 Jan 2003 12:31:54 +0100 debian/rules0000755000000000000000000001354312252640275010261 0ustar #!/usr/bin/make -f # Uncomment this to turn on verbose mode. # export DH_VERBOSE=1 # SOURCEVERSION:=$(shell dpkg-parsechangelog | sed -rne 's,^Source: typo3-src(-.+),\1,p') SOURCEVERSION:=-4.5 PACKAGENAME:=typo3_src$(SOURCEVERSION) SOURCEPACKAGE:=typo3-src$(SOURCEVERSION) T3SRCDIR:=usr/share/typo3/$(PACKAGENAME) SOURCEINSTALLDIR:=debian/$(SOURCEPACKAGE)/$(T3SRCDIR) DOCROOTDIR=debian/typo3-dummy/var/lib/typo3-dummy ETCDIR=debian/typo3-dummy/etc/typo3-dummy MAIN_TGZ_VERSION:=$(shell dpkg-parsechangelog | sed -rne 's,^Version: ([^+]+).*,\1,p') SUB_TGZ_VERSION:=$(shell dpkg-parsechangelog | sed -rne 's,^Version: (.*)\+dfsg1~([^-]+).*,\2,p') SUB2_TGZ_VERSION:=$(shell dpkg-parsechangelog | sed -rne 's,^Version: (.*)\+dfsg1([^-]+).*,\2,p') ORIG_DIR:=$(SOURCEPACKAGE)_$(MAIN_TGZ_VERSION)+dfsg1$(SUB2_TGZ_VERSION) BLANK_DIR:=blankpackage-$(MAIN_TGZ_VERSION)$(SUB_TGZ_VERSION) ORIGTAR:=$(SOURCEPACKAGE)_$(MAIN_TGZ_VERSION)$(SUB_TGZ_VERSION).orig.tar DEBTAR:=$(SOURCEPACKAGE)_$(MAIN_TGZ_VERSION)+dfsg1$(SUB2_TGZ_VERSION).orig.tar clean: dh_testdir dh_testroot dh_clean debconf-updatepo rm -f $(SOURCEINSTALLDIR)/t3lib/fonts/nimbus.sfd.gz rm -rf build build_pre: dh_testdir mkdir -p build build: build_pre build/svg.swf build/svg.js build/svg.htc install: build dh_testdir dh_testroot dh_prep dh_installdirs dh_install cp -r index.php t3lib typo3 $(SOURCEINSTALLDIR) cp debian/nimbus.sfd.gz $(SOURCEINSTALLDIR)/t3lib/fonts cp typo3conf/localconf.php $(ETCDIR)/localconf.php_template #set correct permissions for cron script chmod a+x $(SOURCEINSTALLDIR)/typo3/cleaner_check.sh \ $(SOURCEINSTALLDIR)/typo3/cleaner_fix.sh \ $(SOURCEINSTALLDIR)/typo3/cli_dispatch.phpsh #remove additional license files rm -f $(SOURCEINSTALLDIR)/typo3/LICENSE.txt rm -f $(SOURCEINSTALLDIR)/typo3/sysext/rtehtmlarea/htmlarea/HTMLAREA_LICENSE.txt rm -f $(SOURCEINSTALLDIR)/typo3/sysext/rtehtmlarea/htmlarea/plugins/InsertSmiley/smileys/mozilla_public_license.txt rm -f $(SOURCEINSTALLDIR)/typo3/sysext/adodb/adodb/license.txt rm -f $(SOURCEINSTALLDIR)/typo3/sysext/t3editor/LICENSE rm -f $(SOURCEINSTALLDIR)/typo3/sysext/openid/lib/php-openid/COPYING rm -f $(SOURCEINSTALLDIR)/typo3/sysext/rsaauth/resources/jsbn/LICENSE rm -f $(SOURCEINSTALLDIR)/typo3/contrib/codemirror/LICENSE rm -f $(SOURCEINSTALLDIR)/typo3/contrib/codemirror/contrib/lua/LICENSE rm -f $(SOURCEINSTALLDIR)/typo3/contrib/codemirror/contrib/ometa/LICENSE rm -f $(SOURCEINSTALLDIR)/typo3/contrib/codemirror/contrib/php/LICENSE rm -f $(SOURCEINSTALLDIR)/typo3/contrib/codemirror/contrib/plsql/LICENSE rm -f $(SOURCEINSTALLDIR)/typo3/contrib/codemirror/contrib/python/LICENSE rm -f $(SOURCEINSTALLDIR)/typo3/contrib/codemirror/contrib/scheme/LICENSE rm -f $(SOURCEINSTALLDIR)/typo3/contrib/codemirror/contrib/sql/LICENSE rm -f $(SOURCEINSTALLDIR)/typo3/contrib/extjs/LICENSE.txt rm -f $(SOURCEINSTALLDIR)/typo3/contrib/flashmedia/player.license.txt rm -f $(SOURCEINSTALLDIR)/typo3/contrib/modernizr/LICENSE.txt # remove files linked to by later steps in build (dependencies) rm -f $(SOURCEINSTALLDIR)/t3lib/fonts/vera.ttf rm -rf $(SOURCEINSTALLDIR)/typo3/sysext/adodb/adodb # fix other stuff rm -f $(SOURCEINSTALLDIR)/typo3/sysext/linkvalidator/.gitignore binary-indep: build install dh_testdir dh_testroot dh_lintian dh_installdebconf dh_installchangelogs -Ntypo3 -A ChangeLog dh_installcron dh_installdocs -Ntypo3 -A RELEASE_NOTES.txt README.txt NEWS.txt dh_installexamples dh_installinit dh_link dh_compress -Ntypo3 dh_fixperms chown -hR root:www-data $(SOURCEINSTALLDIR) chown -hR www-data:www-data $(DOCROOTDIR) chown www-data:www-data $(ETCDIR)/localconf.php_template find $(DOCROOTDIR) -type d -print0 | xargs -0 chmod 0750 find $(DOCROOTDIR) -type f -print0 | xargs -0 chmod 0640 chmod 600 $(ETCDIR)/localconf.php_template dh_installdeb dh_shlibdeps dh_gencontrol dh_md5sums dh_builddeb build-arch: build build-indep: build get-orig-source: # get source uscan --no-conf --force-download --rename --repack --download-current-version --destdir=. # unpack and rename mkdir -p _unpack tar -xzf $(ORIGTAR).gz -C _unpack mv _unpack/$(BLANK_DIR) _unpack/$(ORIG_DIR) # remove dfsg non complient files rm -f _unpack/$(ORIG_DIR)/typo3/contrib/jsmin/jsmin.php rm -f _unpack/$(ORIG_DIR)/typo3/sysext/em/res/js/ux/jslint.js # remove embedded libraries rm -rf _unpack/$(ORIG_DIR)/typo3/contrib/swiftmailer rm -rf _unpack/$(ORIG_DIR)/typo3/contrib/prototype rm -rf _unpack/$(ORIG_DIR)/typo3/contrib/scriptaculous rm -rf _unpack/$(ORIG_DIR)/typo3/contrib/flashmedia/swfobject rm -rf _unpack/$(ORIG_DIR)/typo3/contrib/swfupload rm -rf _unpack/$(ORIG_DIR)/typo3/contrib/extjs/resources/charts.swf rm -rf _unpack/$(ORIG_DIR)/typo3/contrib/extjs/resources/expressinstall.swf # repack tar -cf - -C _unpack $(ORIG_DIR) | gzip -9 - > $(DEBTAR).gz rm -rf _unpack prepare-source: dh_testdir mv $(ORIGTAR).gz ../ mv $(DEBTAR).gz ../ tar --strip-components 1 -C . -xzf ../$(DEBTAR).gz # Build architecture-dependent files here. binary-arch: build install binary: binary-indep binary-arch .PHONY: build clean binary-indep binary-arch binary install RELEASE_NAME= RELEASE_NUMBER=$(shell svnversion) COMPILER_CONSTANTS=--define BUILD::releaseName,\'$(RELEASE_NAME)\' --define BUILD::releaseNumber,\'$(RELEASE_NUMBER)\' build/svg.swf: debian/contrib/websvg/src/org/svgweb/SVGViewerWeb.as debian/contrib/websvg/src/org/svgweb/core/*.as debian/contrib/websvg/src/org/svgweb/nodes/*.as debian/contrib/websvg/src/org/svgweb/utils/*.as debian/contrib/websvg/src/org/svgweb/smil/*.as # cd debian/contrib/websvg/src/org/svgweb && as3compile $(COMPILER_CONSTANTS) -o ../../../../../build/svg.swf -I ../../ SVGViewerWeb.as build/svg.js: debian/contrib/websvg/src/svg.js yui-compressor --type js --preserve-semi -o build/svg.js debian/contrib/websvg/src/svg.js build/svg.htc: debian/contrib/websvg/src/svg.htc cp debian/contrib/websvg/src/svg.htc build/svg.htc debian/typo3-database.README.Debian0000644000000000000000000000552012252640275014055 0ustar TYPO3 for Debian ----------------- WHAT IS THIS PACKAGE FOR? ========================= This package contains an empty TYPO3 database structure and provides a dependency to the mysql server package. Q: Why did you make another package and didn't use typo3-dummy as before? A: The problem with integrating the database dependency into typo3-dummy is that all people who want to use this package are forced to install a full mysql server. But as everyone knows the database can/should be installed on a separate server to get some level of load balancing. Thats why typo3-database was created and typo3-dummy only suggests its installation. This way the packages can be installed on different machines without pulling too much into the systems. Q: Why do you provide an empty database? TYPO3 can create that itself. A: Yeah, i know. But using the mechanisms of TYPO3 means, that the user does not have a working installation of TYPO3 after installing these packages. He has to enter the install tool and to configure the database by hand. This can be a bit challanging for new users, so i want to make the installation of TYPO3 as simple as possible and provide an empty database. LOCAL INSTALLATION ================== The local installation is really trival: * first step: install this package before typo3-dummy and answer the questions during installation like this: 1) Configure the database typo3-database with dbconfig-common? YES. 2) Enter the password for the database system administration account. 3) Choose a new password for the TYPO3 database account. Thats all. The install script now creates a new database user "typo3-database" with your chosen password and imports the database dump into the database. * second step: install the package typo3-dummy and anwser the only question for the password with your chosen one from above. The install script now checks whether the password is correct or not, and if it is correct the connection parameters are saved for later use. You are done. REMOTE INSTALLATION =================== The remote installation is similar to the local one but has a third step to accomplish. * first step: install this package on the remote (database) machine, before you install typo3-dummy. Follow the steps 1-3 from above. * second step: install the package typo3-dummy and anwser the only question for the password with your chosen one from above. Note, that you cannot choose the database host here, this is done next. * third step: reconfigure typo3-dummy using the priority "low": > dpkg-reconfigure --priority=low --force typo3-dummy Now you can answer a lot of question regarding your remote machine. You are done. PS: Make sure, your firewalls let you access the remote database! Feel free to send me your package-specific comments or suggestions. Have fun! -- Christian Welzel , Sun, 07 Jun 2009 23:00:00 debian/typo3-dummy.init0000644000000000000000000000213112252640275012264 0ustar #! /bin/sh ### BEGIN INIT INFO # Provides: typo3-dummy # Required-Start: $remote_fs # Required-Stop: $remote_fs # Default-Start: 2 3 4 5 # Default-Stop: 0 1 6 # Short-Description: Creates /var/run/typo3-dummy # Description: Creates /var/run/typo3-dummy which is used as temporary # file upload folder for PHP and TYPO3 ### END INIT INFO # Author: Christian Welzel # PATH should only include /usr/* if it runs after the mountnfs.sh script PATH=/bin:/usr/bin DESC="Typo3 upload directory creation" NAME=typo3-dummy SCRIPTNAME=/etc/init.d/$NAME TMPDIR=/var/run/typo3-dummy # Load the VERBOSE setting and other rcS variables test -f /etc/default/rcS && . /etc/default/rcS # Define LSB log_* functions. # Depend on lsb-base (>= 3.0-6) to ensure that this file is present. . /lib/lsb/init-functions case "$1" in start) [ "$VERBOSE" != no ] && log_daemon_msg "Starting $DESC" "$NAME" if [ ! -d $TMPDIR ]; then mkdir $TMPDIR chown -hR www-data:www-data $TMPDIR chmod -R 0750 $TMPDIR fi ;; stop|restart|force-reload|*) ;; esac : debian/patches/0002755000000000000000000000000012252640275010624 5ustar debian/patches/remove-jsmin-dfsg.patch0000644000000000000000000000237012252640275015201 0ustar ## 04-remove-jsmin-dfsg.patch by Christian Welzel ## ## DP: remove invocation code of jsmin, which is not dfsg compliant ## DP: and therefore removed during packaging. --- typo3-src-4.5.3+dfsg1.orig/t3lib/class.t3lib_div.php +++ typo3-src-4.5.3+dfsg1/t3lib/class.t3lib_div.php @@ -2903,16 +2903,17 @@ * @return string Minified script or source string if error happened */ public static function minifyJavaScript($script, &$error = '') { - require_once(PATH_typo3 . 'contrib/jsmin/jsmin.php'); - try { - $error = ''; - $script = trim(JSMin::minify(str_replace(CR, '', $script))); - } - catch (JSMinException $e) { - $error = 'Error while minifying JavaScript: ' . $e->getMessage(); - self::devLog($error, 't3lib_div', 2, - array('JavaScript' => $script, 'Stack trace' => $e->getTrace())); - } +# require_once(PATH_typo3 . 'contrib/jsmin/jsmin.php'); +# try { +# $error = ''; +# $script = trim(JSMin::minify(str_replace(CR, '', $script))); + $script = trim($script); +# } +# catch (JSMinException $e) { +# $error = 'Error while minifying JavaScript: ' . $e->getMessage(); +# self::devLog($error, 't3lib_div', 2, +# array('JavaScript' => $script, 'Stack trace' => $e->getTrace())); +# } return $script; } debian/patches/series0000644000000000000000000000020712252640275012036 0ustar dummy-defaults.patch dummy-addindexpages.patch fix-im-command.patch fontsreadme.patch remove-jslint-dfsg.patch remove-jsmin-dfsg.patch debian/patches/dummy-defaults.patch0000644000000000000000000001556412252640275014616 0ustar ## 02-dummy-defaults.patch by Christian Welzel ## ## DP: provide some default values for Debian systems --- typo3-src-4.5.8+dfsg1.orig/typo3conf/localconf.php +++ typo3-src-4.5.8+dfsg1/typo3conf/localconf.php @@ -8,10 +8,150 @@ // Default password is "joh316" : $TYPO3_CONF_VARS['BE']['installToolPassword'] = 'bacb98acf97e0b6112b1d1b650b84971'; -$TYPO3_CONF_VARS['EXT']['extList'] = 'info,perm,func,filelist,about,version,tsconfig_help,context_help,extra_page_cm_options,impexp,sys_note,tstemplate,tstemplate_ceditor,tstemplate_info,tstemplate_objbrowser,tstemplate_analyzer,func_wizards,wizard_crpages,wizard_sortpages,lowlevel,install,belog,beuser,aboutmodules,setup,taskcenter,info_pagetsconfig,viewpage,rtehtmlarea,css_styled_content,t3skin,t3editor,reports,felogin'; +$TYPO3_CONF_VARS['EXT']['extList'] = 'cms,lang,sv,em,fal,list,tsconfig_help,context_help,extra_page_cm_options,impexp,sys_note,tstemplate,tstemplate_ceditor,tstemplate_info,tstemplate_objbrowser,tstemplate_analyzer,func_wizards,wizard_crpages,wizard_sortpages,lowlevel,install,belog,beuser,aboutmodules,setup,taskcenter,info_pagetsconfig,viewpage,rtehtmlarea,css_styled_content,t3skin,t3editor,reports,info,perm,func,filelist,about,cshmanual,opendocs,recycler,scheduler,linkvalidator,pagetree,rsaauth,saltedpasswords'; $typo_db_extTableDef_script = 'extTables.php'; +$debian_config = '/etc/typo3-dummy/debian-db.php'; +if(is_file($debian_config) && is_readable($debian_config)) { + include_once($debian_config); + + $typo_db_username = $dbuser; + $typo_db_password = $dbpass; + $typo_db = $dbname; + $typo_db_host = $dbserver; + if(empty($typo_db_host)) $typo_db_host = 'localhost'; +} + +// Use the memcached server for speeding up TYPO3, set next line to '1' to enable the framework +$TYPO3_CONF_VARS['SYS']['useCachingFramework'] = '0'; +$TYPO3_CONF_VARS['SYS']['caching']['cacheBackendAssignments'] = array( + 'cache_hash' => array( + 'backend' => 't3lib_cache_backend_File', + 'options' => array( + ) + ), + 'cache_pages' => array( + 'backend' => 't3lib_cache_backend_Memcached', + 'options' => array( + 'servers' => array('localhost:11211'), + ) + ), + 'cache_pagesection' => array( + 'backend' => 't3lib_cache_backend_Memcached', + 'options' => array( + 'servers' => array('localhost:11211'), + ) +# 'backend' => 't3lib_cache_backend_Db', +# 'options' => array( +# 'cacheTable' => 'cache_pagesection', +# ) + ) +); + ## INSTALL SCRIPT EDIT POINT TOKEN - all lines after this points may be changed by the install script! +// configure login forms to use rsa security level +$TYPO3_CONF_VARS['FE']['loginSecurityLevel'] = "rsa"; +$TYPO3_CONF_VARS['BE']['loginSecurityLevel'] = "rsa"; +$TYPO3_CONF_VARS['EXT']['extConf']['saltedpasswords'] = 'a:2:{s:3:"FE.";a:2:{s:7:"enabled";s:1:"1";s:21:"saltedPWHashingMethod";s:28:"tx_saltedpasswords_salts_md5";}s:3:"BE.";a:2:{s:7:"enabled";s:1:"1";s:21:"saltedPWHashingMethod";s:28:"tx_saltedpasswords_salts_md5";}}'; + +// encryption key. set is to a long unique string. +$TYPO3_CONF_VARS['SYS']['encryptionKey'] = '###ENCKEY###'; + +// If safe_mode is activated with TYPO3, disable use of +// external programs +// typo3-dummy provides links to the most important external programs in +// /var/lib/typo3-dummy/execdir, so exec() function is enabled by default. +$TYPO3_CONF_VARS["BE"]["disable_exec_function"] = '0'; + +// TYPO3 prefers the use of GIF-files and most likely your visitors on +// your website does too as not all browsers support PNG yet. +$TYPO3_CONF_VARS["GFX"]["gdlib_png"] = '1'; + +// set this true to get some better results in GIFBUILDER +$TYPO3_CONF_VARS['GFX']['png_truecolor'] = '1'; + +// enabling the use of gdblib2 for image processing +$TYPO3_CONF_VARS["GFX"]["gdlib_2"] = '1'; + +// last versions of imagemagick renamed combine to composite. It will +// be set by basic configuration automatically. +$TYPO3_CONF_VARS["GFX"]["im_combine_filename"] = 'combine'; + +// This value should be set to 1 if imagemagick version is greater +// than 5.2 +$TYPO3_CONF_VARS["GFX"]["im_negate_mask"] = '1'; + +$TYPO3_CONF_VARS["GFX"]["im_imvMaskState"] = '1'; + +$TYPO3_CONF_VARS["GFX"]["im_mask_temp_ext_gif"] = '1'; + +// The value should be 0 if the version of imagemagick is greater than +// 5, otherwise the creation of effects is getting too slow +$TYPO3_CONF_VARS["GFX"]["im_no_effects"] = '1'; + +$TYPO3_CONF_VARS["GFX"]["im_v5effects"] = '1'; + +// Path to the imagemagick manipulation tools like convert, +// composite and identify +$TYPO3_CONF_VARS["GFX"]["im_path"] = '/var/lib/typo3-dummy/execdir/'; +$TYPO3_CONF_VARS['GFX']["im_path_lzw"] = '/var/lib/typo3-dummy/execdir/'; + +// Set Value to 1 if version of ImageMagick is greater than 4.9 +$TYPO3_CONF_VARS["GFX"]["im_version_5"] = 'gm'; + +// This variable can be empty if ImageMagick is compiled with LZW. +// Otherwise you have to set the path to LZW +//$TYPO3_CONF_VARS["GFX"]["im_path_lzw"] = ''; + +// Image file formats that should be accepted by Typo3 +$TYPO3_CONF_VARS["GFX"]["imagefile_ext"] = 'gif,jpg,jpeg,tif,bmp,pcx,tga,png,pdf'; + +$TYPO3_CONF_VARS["GFX"]["im_noFramePrepended"] = '1'; + +// Enables the preview of images to make the choice more easy +$TYPO3_CONF_VARS["GFX"]["thumbnails"] = '1'; + +// Preview of images in png or gif format. +// Should be the same as "gdlib_png" +$TYPO3_CONF_VARS["GFX"]["thumbnails_png"] = '1'; + +// Check freetype quicktest in the basic configuration if text is +// exceeding the image borders. If yes, you are using Freetype 2 and +// need to set TTFdpi to 96 dpi +$TYPO3_CONF_VARS["GFX"]["TTFdpi"] = '96'; + +// set memory limit to 48 mb. +// You may want to set this limit higher to get the extension manager working. +$TYPO3_CONF_VARS['SYS']['setMemoryLimit'] = '64'; + +// Defines which of these PHP-features to use for various Charset conversing +// functions in t3lib_cs. +$TYPO3_CONF_VARS['SYS']['t3lib_cs_convMethod'] = 'iconv'; + +// Force TYPO3 to use utf-8 in frontend and backend +$TYPO3_CONF_VARS['BE']['forceCharset'] = 'utf-8'; + +// Let TYPO3 init mysql to use utf-8 connections +$TYPO3_CONF_VARS['SYS']['setDBinit'] = 'SET NAMES utf8;'; + +// The list of file extensions to be considered as images +$TYPO3_CONF_VARS['GFX']['imagefile_ext'] = 'gif,jpg,jpeg,tif,bmp,pcx,tga,png,swf,pdf,ai'; + +// Track images generated by imagemagick in the database (prevents double image rendering) +$TYPO3_CONF_VARS['GFX']['enable_typo3temp_db_tracking'] = '1'; + +// Set compat level to current version +$TYPO3_CONF_VARS['SYS']['compat_version'] = '4.5'; + +// disable the donate now! popup window +$TYPO3_CONF_VARS['BE']['allowDonateWindow'] = '0'; + +// define search path for binaries +$TYPO3_CONF_VARS['SYS']['binPath'] = '/var/lib/typo3-dummy/execdir/'; + +// disable logging of deprecated functions +$TYPO3_CONF_VARS['SYS']['enableDeprecationLog'] = ''; + ?> \ No newline at end of file debian/patches/fontsreadme.patch0000644000000000000000000000104612252640275014153 0ustar ## 01-fontsreadme.dpatch by Christian Welzel ## ## DP: Adds debian copyright notice to readme.txt of t3lib/fonts. --- typo3-src-4.3.4.orig/t3lib/fonts/readme.txt +++ typo3-src-4.3.4/t3lib/fonts/readme.txt @@ -32,6 +32,9 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 02110-1301, USA. +On Debian systems, the complete text of the GNU General +Public License can be found in `/usr/share/common-licenses/GPL'. + ******************************************************************************* debian/patches/fix-im-command.patch0000644000000000000000000000206112252640275014447 0ustar ## 06-fix-im-command.patch by Christian Welzel ## ## DP: fix the command used to quote the imagemagick command for shell invocation. --- typo3.orig/t3lib/utility/class.t3lib_utility_command.php +++ typo3/t3lib/utility/class.t3lib_utility_command.php @@ -86,7 +86,7 @@ setlocale(LC_CTYPE, $GLOBALS['TYPO3_CONF_VARS']['SYS']['systemLocale']); } $originalPath = $path . 'gm' . $isExt; - $path = escapeshellarg($originalPath); + $path = escapeshellcmd($originalPath); if ($GLOBALS['TYPO3_CONF_VARS']['SYS']['UTF8filesystem']) { setlocale(LC_CTYPE, $currentLocale); } @@ -105,7 +105,7 @@ setlocale(LC_CTYPE, $GLOBALS['TYPO3_CONF_VARS']['SYS']['systemLocale']); } $originalPath = $path . (($command == 'composite') ? $combineScript : $command) . $isExt; - $path = escapeshellarg($originalPath); + $path = escapeshellcmd($originalPath); if ($GLOBALS['TYPO3_CONF_VARS']['SYS']['UTF8filesystem']) { setlocale(LC_CTYPE, $currentLocale); } @@ -147,4 +147,4 @@ } -?> \ No newline at end of file +?> debian/patches/remove-jslint-dfsg.patch0000644000000000000000000000406012252640275015362 0ustar From: Christian Welzel Date: Mon, 28 Mai 2012 12:26:57 +0200 Subject: Remove jsmin.js Description: remove invocation code of jslint.js, which is not dfsg compliant and therefore removed during packaging. --- typo3.orig/typo3/sysext/em/classes/class.tx_em_extensionmanager.php +++ typo3/typo3/sysext/em/classes/class.tx_em_extensionmanager.php @@ -116,7 +116,6 @@ .x-btn-download { background-image:url(' . $iconsGfxPath . 'down.gif) !important;} .x-btn-undo { background-image:url(' . $this->resPath . 'icons/arrow_undo.png) !important;} .x-btn-redo { background-image:url(' . $this->resPath . 'icons/arrow_redo.png) !important;} - .x-btn-jslint { background-image:url(' . $this->resPath . 'icons/jslint.gif) !important;} .x-btn-indent { background-image:url(' . $this->resPath . 'icons/text_indent.png) !important;} '); @@ -215,7 +214,6 @@ $this->pageRenderer->addJsFile($this->resPath . 'js/ux/filter/ListFilter.js'); $this->pageRenderer->addJsFile($this->resPath . 'js/ux/filter/NumericFilter.js'); $this->pageRenderer->addJsFile($this->resPath . 'js/ux/filter/StringFilter.js'); - $this->pageRenderer->addJsFile($this->resPath . 'js/ux/jslint.js'); //Scripts $this->pageRenderer->addJsFile($this->resPath . 'js/em_layouts.js'); --- typo3.orig/typo3/sysext/em/res/js/em_files.js +++ typo3/typo3/sysext/em/res/js/em_files.js @@ -315,6 +315,7 @@ this.highlightEditor.codeMirrorEditor.reindent(); } }, +/* { iconCls: 'x-btn-jslint', tooltip: TYPO3.lang.cmd_jslint, @@ -343,6 +344,7 @@ } } }, +*/ '->', { xtype: 'tbtext', @@ -422,11 +424,11 @@ centerPanel.redoButton.enable(); centerPanel.indentButton.enable(); centerPanel.diffButton.disable(); - if (node.attributes.ext == 'js') { - centerPanel.jslintButton.enable(); - } else { - centerPanel.jslintButton.disable(); - } +// if (node.attributes.ext == 'js') { +// centerPanel.jslintButton.enable(); +// } else { +// centerPanel.jslintButton.disable(); +// } }, this); }, debian/patches/dummy-addindexpages.patch0000644000000000000000000001145412252640275015601 0ustar ## 03-dummy-addindexpages.patch by Christian Welzel ## ## DP: add some missing html pages to protect against directory listing --- /dev/null +++ typo3/fileadmin/index.html @@ -0,0 +1,9 @@ + + + + Directory listing not allowed! + + + The listing of files of this directory is not allowed. + + --- typo3.orig/fileadmin/_temp_/index.html +++ typo3/fileadmin/_temp_/index.html @@ -1,7 +1,9 @@ - - + Directory listing not allowed! - \ No newline at end of file + + The listing of files of this directory is not allowed. + + --- /dev/null +++ typo3/fileadmin/user_upload/index.html @@ -0,0 +1,9 @@ + + + + Directory listing not allowed! + + + The listing of files of this directory is not allowed. + + --- /dev/null +++ typo3/fileadmin/user_upload/_temp_/index.html @@ -0,0 +1,9 @@ + + + + Directory listing not allowed! + + + The listing of files of this directory is not allowed. + + --- /dev/null +++ typo3/typo3conf/ext/index.html @@ -0,0 +1,9 @@ + + + + Directory listing not allowed! + + + The listing of files of this directory is not allowed. + + --- /dev/null +++ typo3/typo3conf/l10n/index.html @@ -0,0 +1,9 @@ + + + + Directory listing not allowed! + + + The listing of files of this directory is not allowed. + + --- /dev/null +++ typo3/typo3temp/cs/index.html @@ -0,0 +1,9 @@ + + + + Directory listing not allowed! + + + The listing of files of this directory is not allowed. + + --- /dev/null +++ typo3/typo3temp/GB/index.html @@ -0,0 +1,9 @@ + + + + Directory listing not allowed! + + + The listing of files of this directory is not allowed. + + --- /dev/null +++ typo3/typo3temp/index.html @@ -0,0 +1,9 @@ + + + + Directory listing not allowed! + + + The listing of files of this directory is not allowed. + + --- /dev/null +++ typo3/typo3temp/llxml/index.html @@ -0,0 +1,9 @@ + + + + Directory listing not allowed! + + + The listing of files of this directory is not allowed. + + --- /dev/null +++ typo3/typo3temp/pics/index.html @@ -0,0 +1,9 @@ + + + + Directory listing not allowed! + + + The listing of files of this directory is not allowed. + + --- /dev/null +++ typo3/typo3temp/temp/index.html @@ -0,0 +1,9 @@ + + + + Directory listing not allowed! + + + The listing of files of this directory is not allowed. + + --- typo3.orig/uploads/index.html +++ typo3/uploads/index.html @@ -1,7 +1,9 @@ - - + Directory listing not allowed! - \ No newline at end of file + + The listing of files of this directory is not allowed. + + --- /dev/null +++ typo3/uploads/media/index.html @@ -0,0 +1,9 @@ + + + + Directory listing not allowed! + + + The listing of files of this directory is not allowed. + + --- /dev/null +++ typo3/uploads/pics/index.html @@ -0,0 +1,9 @@ + + + + Directory listing not allowed! + + + The listing of files of this directory is not allowed. + + --- /dev/null +++ typo3/uploads/tf/index.html @@ -0,0 +1,9 @@ + + + + Directory listing not allowed! + + + The listing of files of this directory is not allowed. + + debian/apache-directory.conf0000644000000000000000000001011312252640275013261 0ustar # Configuration for the apache web server -*- apache -*- # Define the package aliases. The following directive defines the # /TYPO3root as /cms. If this is changed, search for # /cms and adapt the found directives appropriate. Alias /cms /var/lib/typo3-dummy DirectoryIndex index.php index.html # TYPO3 needs files shared between different instances. These are # symlinked into the document root directory. The following # directive enables that apache follows the symlinks. Disable directory # listing globally. Options +FollowSymLinks -Indexes # disable .htaccess, because it slows down apache AllowOverride None Order allow,deny Allow from all ### Begin: PHP optimisation ### # enable PHP processing for files ending with .php AddType application/x-httpd-php .php # Maximum allowed size for uploaded files (PHP defaults to 2MB) php_admin_value upload_max_filesize 10M php_admin_value post_max_size 10M php_admin_value upload_tmp_dir /var/run/typo3-dummy # Maximum amount of memory a script may consume (PHP defaults to 8MB) # You may want to set this higher as 48 mb if you have problems # getting the extension manager to work. php_admin_value memory_limit 48M # Maximum amount of time a script my consume # You may want to set this higher as 30 seconds if you have problems # getting the extension manager to work. # php_admin_value max_execution_time 90 # list of directories where require(), include() and fopen_with_path() look for files php_admin_value include_path /var/lib/typo3-dummy/:/usr/share/typo3/typo3_src-4.5/:.:/usr/share/php:/usr/share/pear php_admin_value sendmail_path "/var/lib/typo3-dummy/execdir/sendmail -t -i" # Limit the files that can be opened by PHP to the specified directory-tree(s) php_admin_value open_basedir /var/run/typo3-dummy/:/var/lib/typo3-dummy/:/usr/share/typo3/:/etc/typo3-dummy/:/usr/share/fonts/truetype/ttf-bitstream-vera/:/usr/share/javascript/prototype/:/usr/share/javascript/scriptaculous/:/usr/share/php/adodb/:/usr/share/php/Swift/:/usr/share/javascript/swfupload/:/usr/share/javascript/swfobject/ # The PHP developers recommend disabling this feature. Do that. # It's deprecated and is likely to be unsupported in future # versions of PHP. php_flag allow_call_time_pass_reference off # TYPO3 works fine with register_globals turned off. # This is highly recommended! php_flag register_globals off # PHP may not declare the argv & argc variables (that would # contain the GET information). # TYPO3 doesn't need this, so just turn it off. php_flag register_argc_argv off # Magic quotes for runtime-generated data (data from SQL, exec(), etc.) php_flag magic_quotes_gpc off # Order in which PHP registers GET, POST, Cookie and Built-in variables php_value variables_order GPCS ### End: PHP optimisation ### ### Begin: Rewrite stuff ### # Enable URL rewriting RewriteEngine On # Stop rewrite processing if we are in the typo3/ directory RewriteRule ^/cms/(typo3|typo3temp|typo3conf|t3lib|fileadmin|uploads)/ - [L] # Redirect http://mysite/cms/typo3 to http://mysite/cms/typo3/index_re.php # and stop the rewrite processing RewriteRule ^/cms/typo3$ /cms/typo3/index_re.php [L] # If the file/symlink/directory does not exist => Redirect to index.php RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-l # Main URL rewriting. RewriteRule .* /cms/index.php [L] ### End: Rewrite stuff ### debian/source/0002755000000000000000000000000012252640275010475 5ustar debian/source/format0000644000000000000000000000001512252640275011702 0ustar 3.0 (quilt) debian/source/include-binaries0000644000000000000000000000020112252640275013624 0ustar debian/nimbus.sfd.gz debian/changelog-old-typo3-dummy.gz debian/contrib/player/player.fla debian/contrib/flvplayer/flvplayer.fla debian/watch0000644000000000000000000000020212252640275010216 0ustar version=3 opts="dversionmangle=s/\+dfsg1[~]*//,uversionmangle=s/([a-z]+\d+)$/~$1/" \ http://sf.net/typo3/blankpackage-(.*)\.zip debian/README.source0000644000000000000000000000464112252640275011357 0ustar typo3-src (4.5.16+dfsg3-1) * typo3/sysext/em/res/js/ux/jslint.js contains code that is under a non free license -> DFSG #6 "No Discrimination Against Fields of Endeavor". This file has been removed from orig.tgz and the only files refencing it (typo3/sysext/em/classes/class.tx_em_extensionmanager.php and typo3/sysext/em/res/js/em_files.js) have been patched to not use it anymore. -- Christian Welzel Mon, 28 May 2012 17:00:00 +0200 typo3-src (4.5.16+dfsg2-1) * remove typo3/contrib/extjs/resources/charts.swf during repacking because we have no source for it. * Added source code of typo3/contrib/websvg from svn repository of svgweb at http://svgweb.googlecode.com/svn/trunk at revision 1232. Unfortunately the version used by upstream cannot determined by an embedded version number but has to be researched by comparing file sizes in the svgweb distribution zip and this package. These match in the svgweb-2010-08-30-Owlephant.zip which is based on r1232 according to the wiki page http://code.google.com/p/svgweb/wiki/ReleaseNotes. -- Christian Welzel Wed, 25 Mai 2012 22:00:00 +0200 typo3-src (4.5.14+dfsg1-1) * base of this package is now the blankpackage.zip of TYPO3 instead of the tar.gz. This simplifies package building because dummy has not to be integrated anymore. Use debian/rules get-orig-source to download and repack the source package. * Running debian/rules get-orig-source also removes embedded code copies during repacking step. -- Christian Welzel Thu, 5 Jan 2011 22:00:00 +0200 typo3-src (4.5.0+dfsg1~beta2-1) * added source of player.swf and flvplayer.swf. Source was taken from: - player.swf: http://tools.assembla.com/svn/1pixelout/audio-player/tags/1.2.3/source/ - flvplayer.swf: http://forge.typo3.org/projects/typo3v4-core/repository/show/trunk/typo3/contrib/flashmedia/src/ -- Christian Welzel Fri, 02 Dec 2010 22:00:00 +0200 typo3-src (4.3.8+dfsg1-1) * typo3/contrib/jsmin/jsmin.php contains code that is under a non free license -> DFSG #6 "No Discrimination Against Fields of Endeavor". This file has been removed from orig.tgz and the only file refencing it (typo3-src-4.3.8/t3lib/class.t3lib_div.php) has been patched to not use it anymore. -- Christian Welzel Fri, 26 Nov 2010 22:00:00 +0200 debian/typo3-database.config0000644000000000000000000000034012252640275013177 0ustar #!/bin/sh set -e #set -x . /usr/share/debconf/confmodule if [ -f /usr/share/dbconfig-common/dpkg/config.mysql ]; then . /usr/share/dbconfig-common/dpkg/config.mysql dbc_first_version=4.3.0 dbc_go typo3-database $@ fi debian/typo3.postinst0000644000000000000000000000030512252640275012054 0ustar #!/bin/sh set -e DOCDIR=/usr/share/doc/typo3 DOCLINK=typo3-src-4.5 if [ -d $DOCDIR ] && [ ! -L $DOCDIR ] ; then if rmdir $DOCDIR 2>/dev/null; then ln -sf $DOCLINK $DOCDIR fi fi #DEBHELPER# debian/typo3-database.install0000644000000000000000000000135212252640275013404 0ustar debian/mysql/mysql usr/share/dbconfig-common/data/typo3-database/install debian/mysql/4.5.0~alpha3-1 usr/share/dbconfig-common/data/typo3-database/upgrade/mysql debian/mysql/4.5.0~beta1-1 usr/share/dbconfig-common/data/typo3-database/upgrade/mysql debian/mysql/4.5.0+dfsg1~beta2 usr/share/dbconfig-common/data/typo3-database/upgrade/mysql debian/mysql/4.5.0+dfsg1~beta3-1 usr/share/dbconfig-common/data/typo3-database/upgrade/mysql debian/mysql/4.5.0+dfsg1 usr/share/dbconfig-common/data/typo3-database/upgrade/mysql debian/mysql/4.5.15+dfsg1-1 usr/share/dbconfig-common/data/typo3-database/upgrade/mysql debian/mysql/4.5.27+dfsg1-1 usr/share/dbconfig-common/data/typo3-database/upgrade/mysql debian/typo3-database.postrm0000644000000000000000000000066012252640275013263 0ustar #!/bin/sh set -e #set -x if [ -f /usr/share/debconf/confmodule ]; then . /usr/share/debconf/confmodule fi if [ -f /usr/share/dbconfig-common/dpkg/postrm.mysql ]; then . /usr/share/dbconfig-common/dpkg/postrm.mysql dbc_go typo3-database $@ fi if [ "$1" = "purge" ]; then rm -f /etc/typo3-database/debian-db.php if which ucf >/dev/null 2>&1; then ucf --purge /etc/typo3-database/debian-db.php fi fi #DEBHELPER# debian/typo3-dummy.links0000644000000000000000000000117612252640275012451 0ustar var/lib/typo3-dummy/typo3_src/t3lib var/lib/typo3-dummy/t3lib var/lib/typo3-dummy/typo3_src/typo3 var/lib/typo3-dummy/typo3 usr/share/typo3/typo3_src-4.5 var/lib/typo3-dummy/typo3_src etc/typo3-dummy/localconf.php var/lib/typo3-dummy/typo3conf/localconf.php /usr/bin/convert var/lib/typo3-dummy/execdir/convert /usr/bin/composite var/lib/typo3-dummy/execdir/composite /usr/bin/identify var/lib/typo3-dummy/execdir/identify /usr/bin/gm var/lib/typo3-dummy/execdir/gm /usr/sbin/sendmail var/lib/typo3-dummy/execdir/sendmail debian/contrib/0002755000000000000000000000000012252640275010635 5ustar debian/contrib/websvg/0002755000000000000000000000000012252640275012132 5ustar debian/contrib/websvg/src/0002755000000000000000000000000012252640275012721 5ustar debian/contrib/websvg/src/org/0002755000000000000000000000000012252640275013510 5ustar debian/contrib/websvg/src/org/svgweb/0002755000000000000000000000000012252640275015005 5ustar debian/contrib/websvg/src/org/svgweb/SVGViewerFlex.as0000644000000000000000000000203112252640275017764 0ustar /* Copyright (c) 2009 by contributors: * James Hight (http://labs.zavoo.com/) * Richard R. Masters Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package org.svgweb { import org.svgweb.nodes.SVGSVGNode; import mx.core.UIComponent; public class SVGViewerFlex extends UIComponent { public var viewer:SVGViewerFlash; public function SVGViewerFlex() { super(); viewer = new SVGViewerFlash(); this.addChild(viewer); } } } debian/contrib/websvg/src/org/svgweb/core/0002755000000000000000000000000012252640275015735 5ustar debian/contrib/websvg/src/org/svgweb/core/SVGTimedNode.as0000644000000000000000000006300412252640275020513 0ustar /* Copyright (c) 2009 by contributors: * James Hight (http://labs.zavoo.com/) * Richard R. Masters Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package org.svgweb.core { import org.svgweb.core.SVGNode; import org.svgweb.nodes.SVGSVGNode; import org.svgweb.nodes.SVGVideoNode; import org.svgweb.utils.SVGUnits; import org.svgweb.events.SVGEvent; import org.svgweb.smil.TimeSpec; import org.svgweb.smil.EventTimeSpec; import org.svgweb.smil.IndefiniteTimeSpec; import org.svgweb.smil.OffsetTimeSpec; import org.svgweb.smil.WallclockTimeSpec; import flash.events.Event; import flash.events.MouseEvent; import flash.net.URLRequest; import flash.utils.getTimer; /** * * SVGTimedNode is a node with timing parameters. * * The timing model is implemented according to SMIL Animation: * http://www.w3.org/TR/smil-animation/ * * * SVGTimedNode has parameters which specify TimeSpecs (time specifications) * (begin times or event to begin on, end times or events, etc). * * An instance list of begin times and end times is maintained to handle * keeping track of instances created from static configuration and * dynamic events. * * Begin TimeSpecs are static time offsets or patterns that match events. * begin instances are created either when parsed [static offsets ('5s')] * or when events occur [timebase or syncbase time specs (e.g. 'foo.begin', * 'bar.click')]. * * The SVGTimedNode progresses along when it receives events of type * _SVGDocTimeUpdate which indicates the timeline has progressed forward to a * new timestamp (the next frame). At this point, events are fired for transitions * between states, until no further transitions are left to perform up * to the current time. The begin and end times are removed from the * instance lists as they are processed. * * * **/ public class SVGTimedNode extends SVGNode { protected const INDEFINITE:uint = uint.MAX_VALUE; protected var lastDocTime:Number = -1; protected var currentRepeatIndex:Number = -1; protected var eachRepeatDuration:Number; // dur protected var repeatCount:Number; // repeatCount protected var repeatCountSpecified:Boolean = false; protected var allRepeatsDuration:Number; // repeatDuration protected var repeatDurSpecified:Boolean = false; protected var minIntervalDuration:Number; // min protected var maxIntervalDuration:Number; // max protected var beginTimeSpecs:Array = new Array(); // begin protected var endTimeSpecs:Array = new Array(); // end protected var beginTimes:Array = new Array(); // begin time instances protected var endTimes:Array = new Array(); // end time instances protected var pastBeginTimes:Array = new Array(); protected var pastEndTimes:Array = new Array(); protected var active:Boolean = false; // active time interval protected var neverStarted:Boolean = true; protected var restart:String = "always"; protected var scheduledDuration:Number; // currentBeginTime,currentEndTime define the current active interval // when inactive, they define the most recent active interval protected var currentBeginTime:Number = -1; protected var currentEndTime:Number = INDEFINITE; public function SVGTimedNode(svgRoot:SVGSVGNode, xml:XML, original:SVGNode = null):void { super(svgRoot, xml, original); } override protected function onAddedToStage(event:Event):void { super.onAddedToStage(event); svgRoot.addEventListener(SVGEvent.SVGLoad, onSVGLoad); svgRoot.addEventListener(SVGEvent._SVGDocTimeUpdate, onSVGDocTimeUpdate); svgRoot.addEventListener(SVGEvent._SVGDocTimeSeek, onSVGDocTimeSeek); } override protected function onRemovedFromStage(event:Event):void { svgRoot.removeEventListener(SVGEvent.SVGLoad, onSVGLoad); svgRoot.removeEventListener(SVGEvent._SVGDocTimeUpdate, onSVGDocTimeUpdate); svgRoot.removeEventListener(SVGEvent._SVGDocTimeSeek, onSVGDocTimeSeek); super.onRemovedFromStage(event); } protected function onSVGLoad(evt:Event):void { initialize(); } override protected function onAdded():void { // If we have been added to the SVG tree AFTER it has already been // loaded, then we need to immediately initialize ourselves if (this.svgRoot && this.svgRoot.isLoaded()) { initialize(); } } protected function initialize():void { // Process the timing parameters parseParameters(); } override protected function drawNode(event:Event = null):void { if (this is SVGVideoNode) { return super.drawNode(event); } topSprite.visible = false; if ( (topSprite.parent != null) && (this._invalidDisplay) ) { this._invalidDisplay = false; if (this._xml != null) { if (!this._parsedChildren) { this.parseChildren(); this._parsedChildren = true; } } topSprite.removeEventListener(Event.ENTER_FRAME, drawNode); } if (!this._initialRenderDone && topSprite.parent) { this._initialRenderDone = true; this.svgRoot.renderFinished(); } } protected function onSVGDocTimeUpdate(event:Event):void { lastDocTime = SVGEvent(event).docTime; var beginInstance:Number; var endInstance:Number; // Keep looping as long as there is work being done. There may // be a backlog of work that needs to be processed. while (true) { beginInstance = getBeginInstance(); endInstance = getEndInstance(); if (!this.active) { // If not active, process begin instances. // Is the next begin instance ready to run? if (beginInstance <= lastDocTime) { // If restart is 'never', do not start more than one // interval. if ( (restart!="never") || neverStarted) { timeIntervalStarted(beginInstance); this.active = true; } // Whether we started or not, we have processed this // instance and so we move on to the next. pastBeginTimes.unshift(beginTimes.shift()); } else break; // be sure to break anytime we need to wait } else { // Time interval is active, process end instances. // Discard moot events. These may exist if created // with a negative time offset or if the document // is seeked. // Discard all endTimes up to currentBeginTime. while (endInstance < currentBeginTime) { endInstance = nextEndInstance(); } // Discard all beginTimes up to currentBeginTime. while (beginInstance < currentBeginTime) { beginInstance = nextBeginInstance(); } // Check for an end before (or at?) the next begin. var tmpEnd:Number = Math.min(endInstance, currentEndTime); if ( (tmpEnd <= lastDocTime) && (tmpEnd <= beginInstance)) { // If the end instance came first, then it is the // end time we are using. if (endInstance <= currentEndTime) { pastEndTimes.unshift(endTimes.shift()); } processRepeatIntervals(tmpEnd); timeIntervalEnded(tmpEnd); this.active = false; } else { //check for a restart if (beginInstance <= lastDocTime) { if (beginInstance >= currentBeginTime) { processRepeatIntervals(beginInstance); if (restart == "always") { timeIntervalEnded(beginInstance); timeIntervalStarted(beginInstance); //this.active = true; } } pastBeginTimes.unshift(beginTimes.shift()); } else break; // be sure to break anytime we need to wait } } } if (this.active) processRepeatIntervals(lastDocTime); } protected function onSVGDocTimeSeek(event:Event):void { //this.dbg("docTimeSeek: documentTime: " + SVGEvent(event).docTime); // To simplify this, we just start over and reprocess instances // up to the current time. TODO: We should keep track of // what time we have seeked to in order to avoid dispatching // events for events which end up in the past. while (pastBeginTimes.length > 0) { beginTimes.unshift(pastBeginTimes.shift()); } beginTimes.sort(Array.NUMERIC); while (pastEndTimes.length > 0) { endTimes.unshift(pastEndTimes.shift()); } endTimes.sort(Array.NUMERIC); } // These are hooks that animations can use to trigger a redraw that would // not otherwise occur when there are no remaining active animations. protected function timeIntervalStarted(docTime:Number):void { currentBeginTime = docTime; if (scheduledDuration == INDEFINITE) currentEndTime = INDEFINITE; else currentEndTime = currentBeginTime + scheduledDuration; currentRepeatIndex = 0; neverStarted = false; var svgEvent:SVGEvent = new SVGEvent(SVGEvent._SVGAnimBegin); svgEvent.setDocTime(docTime); this.dispatchEvent(svgEvent); repeatIntervalStarted(currentBeginTime); // starts media } protected function timeIntervalEnded(docTime:Number):void { currentEndTime = docTime; var svgEvent:SVGEvent = new SVGEvent(SVGEvent._SVGAnimEnd); svgEvent.setDocTime(docTime); this.dispatchEvent(svgEvent); } /* if active docseek back to currentBeginTime else seek to earliest begin instance (forward or back) else do a begin at current doctime */ public function getHyperlinkDocTime():Number { if (this.active) { return currentBeginTime; } var minTime:Number = INDEFINITE; for (var i:uint=0; i < pastBeginTimes.length; i++) { if (pastBeginTimes[i] < minTime) { minTime = pastBeginTimes[i]; } } for (i=0; i < beginTimes.length; i++) { if (beginTimes[i] < minTime) { minTime = beginTimes[i]; } } if (minTime != INDEFINITE) { return minTime; } else { return this.svgRoot.getDocTime(); } } protected function repeatIntervalStarted(docTime:Number):void { if (currentRepeatIndex > 0) { var svgEvent:SVGEvent = new SVGEvent(SVGEvent._SVGAnimRepeat); svgEvent.setDocTime(docTime); this.dispatchEvent(svgEvent); } } protected function repeatIntervalEnded(docTime:Number):void { } /** * * Parsing Methods * **/ protected function parseParameters():void { parseEachRepeatDuration(); // duration parseRepeatCount(); // repeatCount parseAllRepeatsDuration(); // repeatDuration parseMinIntervalDuration(); // min parseMaxIntervalDuration(); // max parseRestart(); // restart parseEndTimeSpecs(); // end parseBeginTimeSpecs(); // begin setScheduledDuration(); } /** * * Parse the 'begin' parameter. * **/ protected function parseBeginTimeSpecs():void { // If no begin is specified, the spec says the default is zero var begin:String = this.getAttribute('begin', '0'); var timeSpecStrings:Array = begin.split(/;/); var timeSpecIndex:uint =0; for each(var timeSpecString:String in timeSpecStrings) { var timeSpec:TimeSpec = TimeSpec.parseTimeSpec("begin", timeSpecString, this); beginTimeSpecs.push(timeSpec); // Simple offsets can resolve an interval right away if (timeSpec is OffsetTimeSpec) { addBeginInstance(OffsetTimeSpec(timeSpec).getOffset()); } if (timeSpec is EventTimeSpec) { var targetNode:SVGNode = this.svgRoot.getNode(EventTimeSpec(timeSpec).nodeID); if (targetNode) { switch (EventTimeSpec(timeSpec).eventType) { case SVGEvent._SVGAnimBegin: case SVGEvent._SVGAnimEnd: case SVGEvent._SVGAnimRepeat: targetNode.addEventListener(EventTimeSpec(timeSpec).eventType, EventTimeSpec(timeSpec).handleEvent); break; default: targetNode.topSprite.addEventListener(EventTimeSpec(timeSpec).eventType, EventTimeSpec(timeSpec).handleEvent); break; } } } timeSpecIndex++; } } /** * * Parse the 'end' parameter. * Note that the 'end' parameter refers to the end of * all the repeat cycles. * **/ protected function parseEndTimeSpecs():void { // If no end is specified, the spec says the default is indefinite var endString:String = this.getAttribute('end', 'indefinite'); var timeSpecStrings:Array = endString.split(/;/); for each(var timeSpecString:String in timeSpecStrings) { var timeSpec:TimeSpec = TimeSpec.parseTimeSpec("end", timeSpecString, this); if (timeSpec) { endTimeSpecs.push(timeSpec); if (timeSpec is OffsetTimeSpec) { addEndInstance(OffsetTimeSpec(timeSpec).getOffset()); } if (timeSpec is EventTimeSpec) { var targetNode:SVGNode = this.svgRoot.getNode(EventTimeSpec(timeSpec).nodeID); if (targetNode) { switch (EventTimeSpec(timeSpec).eventType) { case SVGEvent._SVGAnimBegin: case SVGEvent._SVGAnimEnd: case SVGEvent._SVGAnimRepeat: targetNode.addEventListener(EventTimeSpec(timeSpec).eventType, EventTimeSpec(timeSpec).handleEvent); break; default: targetNode.topSprite.addEventListener(EventTimeSpec(timeSpec).eventType, EventTimeSpec(timeSpec).handleEvent); break; } } } } } } protected function parseEachRepeatDuration():void { // If no duration is specified, the spec says the default is indefinite var durationString:String = this.getAttribute('dur', 'indefinite'); if (durationString == 'media' || durationString == 'indefinite') { this.eachRepeatDuration = INDEFINITE; } else { this.eachRepeatDuration = SVGUnits.parseTimeVal(durationString); } } protected function parseRepeatCount():void { // If no repeat is specified, the spec says the default is one var repeatCountString:String = this.getAttribute('repeatCount', null); repeatCountSpecified = repeatCountString != null; this.repeatCount = 1; if (repeatCountSpecified) { if (repeatCountString == 'indefinite') { this.repeatCount = INDEFINITE; } else { this.repeatCount = SVGUnits.parseNum(repeatCountString); } } } protected function parseAllRepeatsDuration():void { // repeatDuration parsed as allRepeatsDuration var allRepeatsDurationString:String = this.getAttribute('repeatDur', null); repeatDurSpecified = allRepeatsDurationString != null; if (repeatDurSpecified) { if (allRepeatsDurationString == 'indefinite') { allRepeatsDuration = INDEFINITE; } else { allRepeatsDuration = SVGUnits.parseTimeVal(allRepeatsDurationString); } if (repeatCountSpecified && (eachRepeatDuration != INDEFINITE)) { allRepeatsDuration = Math.min(this.allRepeatsDuration, eachRepeatDuration*repeatCount); } } else allRepeatsDuration = eachRepeatDuration; } protected function parseMinIntervalDuration():void { var minString:String = this.getAttribute('min', '0'); if (minString == 'media') { this.minIntervalDuration = 0; } else { this.minIntervalDuration = SVGUnits.parseTimeVal(minString); if (isNaN(this.minIntervalDuration)) { this.minIntervalDuration = 0; } else { this.minIntervalDuration = Math.max(0, this.minIntervalDuration); } } } protected function parseMaxIntervalDuration():void { var maxString:String = this.getAttribute('max', 'indefinite'); if ( (maxString == 'indefinite') || (maxString == 'media')) { this.maxIntervalDuration = INDEFINITE; } else { this.maxIntervalDuration = SVGUnits.parseTimeVal(maxString); if (isNaN(this.maxIntervalDuration) || (this.maxIntervalDuration < this.minIntervalDuration)) { this.maxIntervalDuration = INDEFINITE; } } } protected function parseRestart():void { this.restart = this.getAttribute('restart', 'always'); } /** * Called when a node is created after page load with XML content * added as a child. Forces a parse. */ override public function forceParse():void { if (this._xml != null) { this.parseParameters(); super.forceParse(); } } public function addBeginInstanceEvent(event:Event, offset:Number):void { var docTime:Number; if (event is SVGEvent) docTime = SVGEvent(event).docTime; else docTime = this.svgRoot.getDocTime(); addBeginInstance(docTime + offset); } public function addEndInstanceEvent(event:Event, offset:Number):void { var docTime:Number; if (event is SVGEvent) docTime = SVGEvent(event).docTime; else docTime = this.svgRoot.getDocTime(); addEndInstance(docTime + offset); } public function addBeginInstance(docTime:Number):void { beginTimes.push(docTime); beginTimes.sort(Array.NUMERIC); } public function addEndInstance(docTime:Number):void { endTimes.push(docTime); endTimes.sort(Array.NUMERIC); } protected function getBeginInstance():Number { if (beginTimes.length > 0) return(beginTimes[0]); return(INDEFINITE); } protected function nextBeginInstance():Number { pastBeginTimes.unshift(beginTimes.shift()); return(getBeginInstance()); } protected function getEndInstance():Number { if (endTimes.length > 0) return(endTimes[0]); return(INDEFINITE); } protected function nextEndInstance():Number { pastEndTimes.unshift(endTimes.shift()); return(getEndInstance()); } protected function setScheduledDuration():void { if (repeatDurSpecified) scheduledDuration = allRepeatsDuration; else if ((eachRepeatDuration == INDEFINITE) || (repeatCount == INDEFINITE)) scheduledDuration = INDEFINITE; else scheduledDuration = eachRepeatDuration * repeatCount; scheduledDuration = Math.min(maxIntervalDuration, scheduledDuration); scheduledDuration = Math.max(minIntervalDuration, scheduledDuration); } private function processRepeatIntervals(docTime:Number):void { while (currentRepeatIndex < getRepeatIndex(docTime)) { var currentRepeatStartTime:Number = this.currentBeginTime + currentRepeatIndex * this.eachRepeatDuration; if (currentRepeatIndex >= 0) { repeatIntervalEnded(currentRepeatStartTime); } repeatIntervalStarted(currentRepeatStartTime); currentRepeatIndex++; } } protected function getRepeatIndex(docTime:Number):Number { // current active interval or most recently completed interval if (this.eachRepeatDuration == INDEFINITE) return 0; docTime = Math.min(docTime, this.currentEndTime); var repeatIndex:Number; repeatIndex = Math.floor( (docTime - currentBeginTime) / this.eachRepeatDuration); var currentRepeatStartTime:Number = this.currentBeginTime + repeatIndex * this.eachRepeatDuration; var repeatRunTime:Number = docTime - currentRepeatStartTime; if (repeatRunTime == 0 && repeatIndex > 0) { return repeatIndex -1; } else { return repeatIndex; } } protected function getRepeatIntervalFraction(docTime:Number):Number { // current active interval or most recently completed interval if (this.eachRepeatDuration == INDEFINITE) return 0; docTime = Math.min(docTime, this.currentEndTime); var currentRepeatStartTime:Number = this.currentBeginTime + this.getRepeatIndex(docTime) * this.eachRepeatDuration; var repeatRunTime:Number = docTime - currentRepeatStartTime; return Math.min(1.0, repeatRunTime / eachRepeatDuration); } public function beginElement():Boolean { return beginElementAt(0); } public function beginElementAt(offset:Number):Boolean { // XXX return value doesn't account for processing of pending time instances var docTime:Number = this.svgRoot.getDocTime() + offset; if (docTime < currentBeginTime) return(false); // negative offset could cause this addBeginInstance(docTime); return ( (restart=="always") || (!this.active && ( (restart!="never") || neverStarted))); } public function endElement():Boolean { return endElementAt(0); } public function endElementAt(offset:Number):Boolean { // XXX return value doesn't account for processing of pending time instances var docTime:Number = this.svgRoot.getDocTime(); if ( (docTime + offset) < currentBeginTime) return(false); // negative offset could cause this addEndInstance(docTime + offset); return this.active; } } } debian/contrib/websvg/src/org/svgweb/core/SVGSprite.as0000755000000000000000000000177512252640275020123 0ustar /* Copyright (c) 2009 by contributors: * James Hight (http://labs.zavoo.com/) * Richard R. Masters * Google Inc. (Brad Neuberg -- http://codinginparadise.org) Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package org.svgweb.core { import flash.display.Sprite; import org.svgweb.core.SVGNode; public class SVGSprite extends Sprite { public var svgNode:SVGNode; public function SVGSprite(ownerSVGNode:SVGNode) { this.svgNode = ownerSVGNode;; super(); } } } debian/contrib/websvg/src/org/svgweb/core/SVGViewer.as0000644000000000000000000001151512252640275020104 0ustar package org.svgweb.core { import org.svgweb.nodes.SVGSVGNode; import flash.display.Sprite; import flash.events.ContextMenuEvent; import flash.events.Event; import flash.events.EventDispatcher; import flash.events.IOErrorEvent; import flash.events.SecurityErrorEvent; import flash.net.URLLoader; import flash.net.URLRequest; import flash.ui.ContextMenu; import flash.ui.ContextMenuItem; import flash.net.navigateToURL; public class SVGViewer extends Sprite { public var svgRoot:SVGSVGNode; // flag that indicates whether this viewer is in the middle of a // suspendRedraw operation public var isSuspended:Boolean = false; protected var urlLoader:URLLoader; protected var context:ContextMenu; public function SVGViewer() { customizeContextMenu(); XML.ignoreProcessingInstructions = false; XML.ignoreComments = false; super(); } public function loadURL(url:String):void { urlLoader = new URLLoader(); urlLoader.load(new URLRequest(url)); urlLoader.addEventListener(Event.COMPLETE, onComplete); urlLoader.addEventListener(IOErrorEvent.IO_ERROR, onIOError); urlLoader.addEventListener(SecurityErrorEvent.SECURITY_ERROR, onSecurityError); } protected function onComplete(event:Event):void { xml = new XML(urlLoader.data); urlLoader = null; } protected function onIOError(event:IOErrorEvent):void { trace("IOError: " + event.text); urlLoader = null; } protected function onSecurityError(event:SecurityErrorEvent):void { trace("SecurityError: " + event.text); urlLoader = null; } public function getWidth():Number { return 0; } public function getHeight():Number { return 0; } public function set xml(value:XML):void { if (svgRoot != null) { this.removeChild(svgRoot.topSprite); } svgRoot = new SVGSVGNode(null, value, null, this); this.addChild(svgRoot.topSprite); } public function get xml():XML { return this.svgRoot.xml; } public function handleScript(script:String):void { } public function addActionListener(eventType:String, target:EventDispatcher):void { } public function removeActionListener(eventType:String, target:EventDispatcher):void { } public function customizeContextMenu():void { context = new ContextMenu(); // Compiler constants are used to specify the release name and // release number. If the release name is not specified, none // will be shown. If the release number is not specified, the // SVN revision of this source file is shown var releaseName:String = ''+BUILD::releaseName; if (releaseName.length!=0) releaseName += ' '; var releaseNumber:String = ''+BUILD::releaseNumber; if (releaseNumber.length == 0) releaseNumber = "$Rev: 1183 $".replace(/[^0-9]/g, ""); var itemAbout:ContextMenuItem = new ContextMenuItem("About SVG Web (" + releaseName + "r" + releaseNumber + ")"); var itemBug:ContextMenuItem = new ContextMenuItem("Report Issue with SVG Web "); itemAbout.addEventListener(ContextMenuEvent.MENU_ITEM_SELECT, aboutSVGWeb); itemBug.addEventListener(ContextMenuEvent.MENU_ITEM_SELECT, reportBug); this.contextMenu = context; this.contextMenu.customItems.push(itemAbout); this.contextMenu.customItems.push(itemBug); function aboutSVGWeb():void { navigateToURL(new URLRequest("http://code.google.com/p/svgweb/")); } function reportBug():void { navigateToURL(new URLRequest("http://code.google.com/p/svgweb/issues/list")); } } public function debug(debugMessage:String):void { } public function error(message:String):void { this.debug(message); } /** Functions for profiling. */ public function start(subject:String, subjectStarted:String = null):void { } /** Functions for profiling. */ public function end(subject:String, subjectStarted:String = null):void { } /** Functions for profiling. */ public function increment(subject:String, amount:int):void { } } } debian/contrib/websvg/src/org/svgweb/core/SVGGradient.as0000644000000000000000000001513112252640275020376 0ustar /* Copyright (c) 2009 by contributors: * James Hight (http://labs.zavoo.com/) * Richard R. Masters * Google Inc. (Brad Neuberg -- http://codinginparadise.org) Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package org.svgweb.core { import org.svgweb.nodes.SVGSVGNode; import org.svgweb.nodes.SVGStopNode; import org.svgweb.utils.SVGUnits; import flash.display.DisplayObject; import flash.display.SpreadMethod; import flash.geom.Matrix; public class SVGGradient extends SVGNode { public function SVGGradient(svgRoot:SVGSVGNode, xml:XML = null, original:SVGNode = null):void { super(svgRoot, xml, original); } public function beginGradientFill(node:SVGNode):void { } public function lineGradientStyle(node:SVGNode, line_alpha:Number = 1):void { } public function getSpreadMethod():String { var spreadMethod:String = SpreadMethod.PAD; var attr:String = this.getAttribute('spreadMethod'); if (attr == 'reflect') { spreadMethod = SpreadMethod.REFLECT; } else if (attr == 'repeat') { spreadMethod = SpreadMethod.REPEAT; } return spreadMethod; } public function getStopData(node:SVGNode, line_alpha:Number = 1):Object { var href:String = this.getAttribute("href"); if (href) { href = href.substr(1); var node:SVGNode = this.svgRoot.getNode(href); if (node is SVGGradient) { return SVGGradient(node).getStopData(node, line_alpha); } } var stopData:Object = new Object(); var colors:Array = new Array(); var ratios:Array = new Array(); var alphas:Array = new Array(); var color:String; var ratio:String; var alpha:String; var ratioNum:Number; var match:Array; var child:SVGNode; var currentRatio:Number; for (var i:uint = 0; i < svgChildren.length; i++) { child = svgChildren[i]; if (child is SVGStopNode) { if (child.id) { this.svgRoot.addReference(node, child.id); } color = SVGStopNode(child).getStyleOrAttr('stop-color', 'black'); if (color == 'currentColor') { color = this.getStyleOrAttr('color'); } ratio = SVGStopNode(child).getStyleOrAttr('offset', '0'); alpha = SVGStopNode(child).getStyleOrAttr('stop-opacity', 1); match = ratio.match(/([^%]+)%/s); if (match) { ratioNum = 255 * (SVGUnits.parseNum(match[1]) / 100); } else { ratioNum = 255 * SVGUnits.parseNum(ratio); } colors.push(SVGUnits.getColor(color)); ratios.push(ratioNum); alphas.push(SVGUnits.parseNum(alpha) * line_alpha); } } stopData['colors'] = colors; stopData['ratios'] = ratios; stopData['alphas'] = alphas; return stopData; } /** * * This method supports href inheritence of attributes from base nodes of the same type. * **/ override protected function _getAttribute(name:String, defaultValue:* = null, inherit:Boolean = true, applyAnimations:Boolean = true, useStyle:Boolean = false):* { var value:String = super._getAttribute(name, defaultValue, inherit, applyAnimations, useStyle); if (value !== null) { return value; } var href:String = this._xml.@xlink::href; if (!href || href == '') { href = this._xml.@href; } if (href && href !== '') { href = href.replace(/^#/,''); var baseNode:SVGNode = this.svgRoot.getNode(href); if (baseNode) { // Return value from href base node, perhaps recursively. // XXX possible circular reference problem. return baseNode.getStyleOrAttr(name, null, false, applyAnimations); } else { // Href is not (yet) parsed, just return value for this node return value; } } else { // No href, just return value for this node return value; } } /** * * This method supports href inheritence of styles from base nodes of the same type. * **/ override protected function _getStyle(name:String):String { var value:String = super._getStyle(name); if (value != null) { return value; } var href:String = this._xml.@xlink::href; if (!href || href=='') { href = this._xml.@href; } if (href && href != '') { href = href.replace(/^#/,''); var baseNode:SVGNode = this.svgRoot.getNode(href); if (baseNode) { // Return value from href base node, perhaps recursively. // XXX possible circular reference problem. value = baseNode.getStyle(name); return value; } else { // Href is not (yet) parsed return value; } } else { // No href return value; } } } } debian/contrib/websvg/src/org/svgweb/core/SVGNode.as0000755000000000000000000027605112252640275017543 0ustar /* Copyright (c) 2009 by contributors: * James Hight (http://labs.zavoo.com/) * Richard R. Masters * Google Inc. (Brad Neuberg -- http://codinginparadise.org) Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package org.svgweb.core { import org.svgweb.core.SVGViewer; import org.svgweb.SVGViewerWeb; import org.svgweb.nodes.*; import org.svgweb.utils.SVGUnits; import flash.display.CapsStyle; import flash.display.DisplayObject; import flash.display.JointStyle; import flash.display.LineScaleMode; import flash.display.Shape; import flash.display.Sprite; import flash.events.Event; import flash.events.EventDispatcher; import flash.events.MouseEvent; import flash.geom.Matrix; import flash.geom.Rectangle; import flash.utils.getDefinitionByName; import flash.utils.getQualifiedClassName; /** Base node extended by all other SVG Nodes **/ public class SVGNode extends EventDispatcher { public static const ATTRIBUTES_NOT_INHERITED:Array = ['id', 'x', 'y', 'width', 'height', 'rotate', 'transform', 'gradientTransform', 'opacity', 'mask', 'clip-path', 'href', 'target', 'viewBox', 'preserveAspectRatio']; public static const INVALID_ATTR_NONE:uint = 0; public static const INVALID_ATTR_OPACITY:uint = 1; public static const INVALID_ATTR_TRANSFORM:uint = 2; public static const INVALID_ATTR_VISIBILITY:uint = 4; public static const INVALID_ATTR_DISPLAY:uint = 8; public namespace xlink = 'http://www.w3.org/1999/xlink'; public namespace svg = 'http://www.w3.org/2000/svg'; public namespace aaa = 'http://www.w3.org/XML/1998/namespace'; public var svgRoot:SVGSVGNode = null; public var svgParent:SVGNode = null; public var svgChildren:Array = new Array(); public var svgClipPathMask:SVGNode = null; public var isMask:Boolean = false; //Used for gradients public var xMin:Number; public var xMax:Number; public var yMin:Number; public var yMax:Number; protected var _parsedChildren:Boolean = false; public var _initialRenderDone:Boolean = false; protected var _firstX:Boolean = true; protected var _firstY:Boolean = true; protected var _xml:XML; protected var _invalidDisplay:Boolean = false; protected var _invalidAttribute:uint = INVALID_ATTR_NONE; protected var _id:String = null; protected var _graphicsCommands:Array; protected var _styles:Object; protected var original:SVGNode; protected var _isClone:Boolean = false; protected var _clones:Array = new Array(); protected var animations:Array = new Array(); // cache the matrix to aid any zooming and panning operations // later protected var _lastVBMatrix:Matrix; /** * * To handle certain flash quirks, and to support certain SVG features, * the implementation of one SVG node is split into one to four * Sprites which perform the functions of transforming, clipping, and drawing. * Here are the specific functions performed by each sprite: * * topSprite: * * top sprite, used display list handling (parent/child relationships) * * handles the transform attribute * * mouse, stage, frame events * * handles visibility * * is the parent of the clip-path mask * * has mask set to 'default' mask (top level bounding box) * * clipSprite: * * has mask set to 'clip-path' mask * * drawSprite: * * handles all graphics access * * handles x,y,rotate,opacity attributes * * filters added here * * viewBoxSprite: * * handles viewBox transform * * parent of SVG children * */ public var topSprite:SVGSprite; public var clipSprite:SVGSprite; public var drawSprite:SVGSprite; public var viewBoxSprite:SVGSprite; /** * Constructor * * @param xml XML object containing the SVG document. @default null * * @return void. */ public function SVGNode(svgRoot:SVGSVGNode, xml:XML = null, original:SVGNode = null):void { this.svgRoot = svgRoot; this.xml = xml; if (original) { this.original = original; this._isClone = true; } if (topSprite) { topSprite.addEventListener(Event.ADDED_TO_STAGE, onAddedToStage); topSprite.addEventListener(Event.REMOVED_FROM_STAGE, onRemovedFromStage); } //increment('SVGNode_Constructor', new Date().getTime() - t); } public function createSVGSprites():void { topSprite = new SVGSprite(this); // This handle strange gradient bugs with negative transforms // by separating the transform from the drawing object if ( getAttribute('transform') != "" || getStyleOrAttr('clip-path') != "" ) { clipSprite = new SVGSprite(this); topSprite.addChild(clipSprite); } else { clipSprite = topSprite; } // If the object has a gaussian filter, flash will blur the object mask, // even if the mask is not drawn with a blur. This is not correct rendering. // So, we use a stub parent object to hold the mask, in order to isolate the // mask from the filter. A child is created for drawing and the // filter is applied to the child. // FIXME: Currently x and y are on the drawSprite. Try to move // to transform sprite. if ( getStyleOrAttr('clip-path') != "" || getAttribute('x') != "" || getAttribute('y') != "" ) { drawSprite = new SVGSprite(this); clipSprite.addChild(drawSprite); } else { drawSprite = clipSprite; } // If the object has a viewBox, the resulting transform should only apply to the // children of the object, so create a child sprite to hold the transform. // If the object is a text node, we put the TextField on the drawSprite instead of // the viewBoxSprite because it is simpler all children of viewBoxSprite are SVGSprites. if ( getAttribute('viewBox') != "" || (this is SVGSVGNode) || (this is SVGTextNode) ) { viewBoxSprite = new SVGSprite(this); drawSprite.addChild(viewBoxSprite); } else { viewBoxSprite = drawSprite; } } /** * Parse the SVG XML. * This handles creation of child nodes. **/ protected function parseChildren():void { var text:String = ''; for each (var childXML:XML in this._xml.children()) { if (childXML.nodeKind() == 'element') { // If we support text values then set them if (this.hasText()) { if (childXML.localName() == '__text' && childXML.children().length() > 0) { // for the SVGViewerWeb we use a nested // SVGDOMTextNode to store the actual value; this // class is necessary so that we can do text // node detection in the browser and have a unique // GUID per DOM text node text += childXML.children().toString(); } } var newChildNode:SVGNode = this.parseNode(childXML); if (!newChildNode) { continue; } this.addSVGChild(newChildNode); } else if (childXML.nodeKind() == 'text' && this.hasText()) { text = this._xml.text().toString(); } } if (this.hasText()) { this.setText(text); } } public function parseNode(childXML:XML):SVGNode { var childNode:SVGNode = null; var nodeName:String = childXML.localName(); nodeName = nodeName.toLowerCase(); switch(nodeName) { case "a": childNode = new SVGANode(this.svgRoot, childXML); break; case "animate": childNode = new SVGAnimateNode(this.svgRoot, childXML); break; case "animatemotion": childNode = new SVGAnimateMotionNode(this.svgRoot, childXML); break; case "animatecolor": childNode = new SVGAnimateColorNode(this.svgRoot, childXML); break; case "animatetransform": childNode = new SVGAnimateTransformNode(this.svgRoot, childXML); break; case "audio": childNode = new SVGAudioNode(this.svgRoot, childXML); break; case "circle": childNode = new SVGCircleNode(this.svgRoot, childXML); break; case "clippath": childNode = new SVGClipPathNode(this.svgRoot, childXML); break; case "desc": childNode = new SVGDescNode(this.svgRoot, childXML); break; case "defs": childNode = new SVGDefsNode(this.svgRoot, childXML); break; case "ellipse": childNode = new SVGEllipseNode(this.svgRoot, childXML); break; case "filter": childNode = new SVGFilterNode(this.svgRoot, childXML); break; case "font": childNode = new SVGFontNode(this.svgRoot, childXML); break; case "font-face": childNode = new SVGFontFaceNode(this.svgRoot, childXML); break; case "g": childNode = new SVGGroupNode(this.svgRoot, childXML); break; case "glyph": childNode = new SVGGlyphNode(this.svgRoot, childXML); break; case "image": childNode = new SVGImageNode(this.svgRoot, childXML); break; case "line": childNode = new SVGLineNode(this.svgRoot, childXML); break; case "lineargradient": childNode = new SVGLinearGradient(this.svgRoot, childXML); break; case "mask": childNode = new SVGMaskNode(this.svgRoot, childXML); break; case "metadata": childNode = new SVGMetadataNode(this.svgRoot, childXML); break; case "missing-glyph": childNode = new SVGMissingGlyphNode(this.svgRoot, childXML); break; case "pattern": childNode = new SVGPatternNode(this.svgRoot, childXML); break; case "polygon": childNode = new SVGPolygonNode(this.svgRoot, childXML); break; case "polyline": childNode = new SVGPolylineNode(this.svgRoot, childXML); break; case "path": childNode = new SVGPathNode(this.svgRoot, childXML); break; case "radialgradient": childNode = new SVGRadialGradient(this.svgRoot, childXML); break; case "rect": childNode = new SVGRectNode(this.svgRoot, childXML); break; case "script": childNode = new SVGScriptNode(this.svgRoot, childXML); break; case "set": childNode = new SVGSetNode(this.svgRoot, childXML); break; case "stop": childNode = new SVGStopNode(this.svgRoot, childXML); break; case "svg": childNode = new SVGSVGNode(this.svgRoot, childXML, null, this.svgRoot.viewer); break; case "symbol": childNode = new SVGSymbolNode(this.svgRoot, childXML); break; case "text": childNode = new SVGTextNode(this.svgRoot, childXML); break; case "title": childNode = new SVGTitleNode(this.svgRoot, childXML); break; case "tspan": childNode = new SVGTspanNode(this.svgRoot, childXML); break; case "use": childNode = new SVGUseNode(this.svgRoot, childXML); break; case "video": childNode = new SVGVideoNode(this.svgRoot, childXML); break; case "__text": /** These are fake text nodes necessary for integration with the browser through JavaScript. */ childNode = new SVGDOMTextNode(this.svgRoot, childXML); break; case "null": break; default: trace("Unknown Element: " + nodeName); childNode = new SVGUnknownNode(this.svgRoot, childXML); break; } return childNode; } /** * Called when a node is created after page load with XML content * added as a child. Forces a parse. */ public function forceParse():void { if (this._xml != null && !this._parsedChildren) { this.parseChildren(); for (var i:uint = 0; i < this.svgChildren.length; i++) { var child:SVGNode = this.svgChildren[i]; child.forceParse(); } this._parsedChildren = true; } } /** * Triggers on ENTER_FRAME event * Redraws node graphics if _invalidDisplay == true **/ protected function drawNode(event:Event = null):void { if ( this.topSprite.parent != null && this._invalidDisplay) { // are we in the middle of a suspendRedraw operation? if (this.svgRoot.viewer && this.svgRoot.viewer.isSuspended) { return; } //var t:int; //var pieceTime:int; this._invalidDisplay = false; if (this._xml != null) { //t = new Date().getTime(); //pieceTime = new Date().getTime(); drawSprite.graphics.clear(); //increment('drawNode_graphics.clear', new Date().getTime() - pieceTime); //pieceTime = new Date().getTime(); if (!this._parsedChildren) { this.parseChildren(); this._parsedChildren = true; } //increment('drawNode_parseChildren', new Date().getTime() - pieceTime); // sets x, y, rotate, and opacity //pieceTime = new Date().getTime(); this.setAttributes(); //increment('drawNode_setAttributes', new Date().getTime() - pieceTime); //pieceTime = new Date().getTime(); if (this.getStyleOrAttr('visibility') == 'hidden') { // SVG spec says visibility='hidden' should fully draw // the shape with full stroke widths, etc., // just make it invisible. It also states that // all children should be invisible _unless_ they // explicitly have a visibility set to 'visible'. this.setVisibility('hidden'); } else { //increment('drawNode_getStyleOrAttr(visibility)', new Date().getTime() - pieceTime); //pieceTime = new Date().getTime(); this.setVisibility('visible'); //increment('drawNode_setVisibility', new Date().getTime() - pieceTime); } //pieceTime = new Date().getTime(); if (this.getStyleOrAttr('display', null, false) == 'none') { this.topSprite.visible = false; } else { //increment('drawNode_getStyleOrAttr(display)', new Date().getTime() - pieceTime); this.topSprite.visible = true; } // Continue to draw even if display="none". Animation of // display attribute independent of drawNode() relies on the // correct drawing state //pieceTime = new Date().getTime(); // nodes get an implicit mask of their height and width if (this is SVGSVGNode) { this.applyDefaultMask(); } //increment('drawNode_applyDefaultMask', new Date().getTime() - pieceTime); //pieceTime = new Date().getTime(); this.generateGraphicsCommands(); //increment('drawNode_generateGraphicsCommands', new Date().getTime() - pieceTime); //pieceTime = new Date().getTime(); this.transformNode(); //increment('drawNode_transformNode', new Date().getTime() - pieceTime); //pieceTime = new Date().getTime(); this.draw(); //increment('drawNode_draw', new Date().getTime() - pieceTime); //pieceTime = new Date().getTime(); this.applyClipPathMask(); //increment('drawNode_applyClipPathMask', new Date().getTime() - pieceTime); //pieceTime = new Date().getTime(); this.applyViewBox(); //increment('drawNode_applyViewBox', new Date().getTime() - pieceTime); //pieceTime = new Date().getTime(); this.setupFilters(); //increment('drawNode_setupFilters', new Date().getTime() - pieceTime); } //pieceTime = new Date().getTime(); topSprite.removeEventListener(Event.ENTER_FRAME, drawNode); //increment('drawNode_removeEventListener', new Date().getTime() - pieceTime); //pieceTime = new Date().getTime(); if (this.xml.@id) { //increment('drawNode_xml.@id', new Date().getTime() - pieceTime); //pieceTime = new Date().getTime(); this.svgRoot.invalidateReferers(this.xml.@id); //increment('drawNode_invalidateReferers', new Date().getTime() - pieceTime); } //pieceTime = new Date().getTime(); if (getPatternAncestor() != null) { //increment('drawNode_getPatternAncestor', new Date().getTime() - pieceTime); //pieceTime = new Date().getTime(); this.svgRoot.invalidateReferers(getPatternAncestor().id); //increment('drawNode_invalidateReferers', new Date().getTime() - pieceTime); } //increment('drawNodeTOTAL', new Date().getTime() - t); } if (!this._initialRenderDone && this.topSprite.parent) { this.attachEventListeners(); this._initialRenderDone = true; this.svgRoot.renderFinished(); } } protected function setAttributes():void { this.loadAttribute('x'); this.loadAttribute('y'); this.loadAttribute('rotate','rotation'); this.loadAttribute('opacity', 'alpha', true); if (this.getStyleOrAttr('pointer-events') == 'none') { topSprite.mouseEnabled = false; topSprite.mouseChildren = false; } else { topSprite.mouseEnabled = true; topSprite.mouseChildren = true; } } /** * Load an XML attribute into the current node * * @param name Name of the XML attribute to load * @param field Name of the node field to set. If null, the name attribute will be used as the field attribute. * @param applyStyle Boolean Optional parameter that controls whether we * will look in this node's style value if the given name is not in * the node's attribute list. Defaults to false. **/ protected function loadAttribute(name:String, field:String = null, applyStyle:Boolean = false):void { if (field == null) { field = name; } var tmp:String = this.getStyleOrAttr(name); if (tmp != null) { switch (name) { case 'x': drawSprite[field] = SVGUnits.parseNumPct(tmp, this.getWidth()); break; case 'y': drawSprite[field] = SVGUnits.parseNumPct(tmp, this.getHeight()); break; case 'rotate': drawSprite[field] = SVGUnits.parseNum(tmp); break; case 'opacity': drawSprite[field] = SVGUnits.parseNum(tmp); break; } } } /** Sets this node and all its children to the given visibility value. If a child has an explicit visibility setting then that is retained independent of what we set here. @param visible - If 'visible', sets this node to be visible. The value 'hidden' will hide it. @param recursive - Internal variable. Should not set. */ protected function setVisibility(visible:String, recursive:Boolean = false):void { // FIXME: Turn this into an iterative rather than a recursive // method //this.dbg('setVisibility, this='+this.xml.localName()+', visible='+visible+', recursive='+recursive); // ignore if we have our own visibility value and we are a recursive // call if (recursive && (this.getStyleOrAttr('visibility', null, false) != null)) { return; } if (drawSprite) { if (visible == 'visible') { drawSprite.alpha = SVGUnits.parseNum(this.getStyleOrAttr('opacity')); } else { drawSprite.alpha = 0; } } // set on all our children // ??? setting alpha on the node affects all the children // setting alpha = 0 means all children are hidden, regardless // of their own alpha values var child:SVGNode; for (var i:uint = 0; i < this.svgChildren.length; i++) { child = this.svgChildren[i]; child.setVisibility(visible, true); } } // and nodes get an implicit mask of their height and width public function applyDefaultMask():void { if ( (this is SVGImageNode && this.getAttribute('width') != null && this.getAttribute('height') != null ) || this is SVGSVGNode ) { if (topSprite.mask == null) { var myMask:Shape = new Shape(); topSprite.parent.addChild(myMask); topSprite.mask = myMask; } if (topSprite.mask is Shape) { Shape(topSprite.mask).graphics.clear(); Shape(topSprite.mask).graphics.beginFill(0x000000); Shape(topSprite.mask).transform.matrix=topSprite.transform.matrix.clone(); drawSprite.graphics.clear(); drawSprite.graphics.beginFill(0x000000, 0); var canvasWidth:Number; var canvasHeight:Number; if (this.topSprite.parent is SVGViewerWeb) { var clipMode:String= SVGViewerWeb(this.topSprite.parent).getClipMode(); //this.dbg(" clip mode: "+ clipMode); switch (clipMode) { case 'height': canvasWidth = SVGViewer(this.topSprite.parent).getWidth(); canvasHeight = this.getHeight(); break; case 'neither': canvasWidth = SVGViewer(this.topSprite.parent).getWidth(); canvasHeight = SVGViewer(this.topSprite.parent).getHeight(); break; case 'width': canvasWidth = this.getWidth(); canvasHeight = SVGViewer(this.topSprite.parent).getHeight(); break; default: this.dbg("invalid clip mode: "+ clipMode); case 'both': canvasWidth = this.getWidth(); canvasHeight = this.getHeight(); break; } } else { canvasWidth = this.getWidth(); canvasHeight = this.getHeight(); } Shape(topSprite.mask).graphics.drawRect(drawSprite.x, drawSprite.y, canvasWidth, canvasHeight); Shape(topSprite.mask).graphics.endFill(); // Draw an invisible rect to receive mouse events. drawSprite.graphics.drawRect(drawSprite.x, drawSprite.y, canvasWidth, canvasHeight); drawSprite.graphics.endFill(); } } } /** * Called to generate AS3 graphics commands from the SVG instructions **/ protected function generateGraphicsCommands():void { this._graphicsCommands = new Array(); } /** * Perform transformations defined by the transform attribute **/ public function transformNode():void { topSprite.transform.matrix = new Matrix(); this.loadAttribute('x'); this.loadAttribute('y'); // Tspan x,y replaces the parent text x,y instead of // offsetting the parent like every other node. // However, if the x or y is not specified, then use the parent. if (this is SVGTspanNode) { if (this.getAttribute('x',null) != null) { drawSprite.x = drawSprite.x - this.svgParent.getAttribute('x',0); } if (this.getAttribute('y',null) != null) { drawSprite.y = drawSprite.y - this.svgParent.getAttribute('y',0); } } this.loadAttribute('rotate', 'rotation'); // Apply transform attribute var trans:String = this.getAttribute('transform'); if (trans) { topSprite.transform.matrix = this.parseTransform(trans, topSprite.transform.matrix.clone()); } var animResult:Array = this.getAllAnimsTransform(); var animMatrix:Matrix = animResult[0]; var isAdditive:Boolean = animResult[1]; if (animMatrix != null) { // See Issue 311: Tranforms must be applied in correct order // and must account for additive attribute. if (isAdditive) { var newMatrix:Matrix = topSprite.transform.matrix.clone(); animMatrix.concat(newMatrix); } topSprite.transform.matrix = animMatrix; } } public function parseTransform(trans:String, baseMatrix:Matrix = null):Matrix { if (!baseMatrix) { baseMatrix = new Matrix(); } if (trans != null) { var transArray:Array = trans.match(/\S+\(.*?\)/sg); transArray.reverse(); for each(var tran:String in transArray) { var tranArray:Array = tran.split('(',2); if (tranArray.length == 2) { var command:String = String(tranArray[0]); var args:String = String(tranArray[1]); args = args.replace(')',''); args = args.replace(/\s+/sg,","); //Replace spaces with a comma args = args.replace(/,{2,}/sg,","); // Remove any extra commas args = args.replace(/^,/, ''); //Remove leading comma args = args.replace(/,$/, ''); //Remove trailing comma var argsArray:Array = args.split(','); var nodeMatrix:Matrix = new Matrix(); switch (command) { case "matrix": if (argsArray.length == 6) { nodeMatrix.a = argsArray[0]; nodeMatrix.b = argsArray[1]; nodeMatrix.c = argsArray[2]; nodeMatrix.d = argsArray[3]; nodeMatrix.tx = argsArray[4]; nodeMatrix.ty = argsArray[5]; } break; case "translate": if (argsArray.length == 1) { nodeMatrix.tx = argsArray[0]; } else if (argsArray.length == 2) { nodeMatrix.tx = argsArray[0]; nodeMatrix.ty = argsArray[1]; } break; case "scale": if (argsArray.length == 1) { nodeMatrix.a = argsArray[0]; nodeMatrix.d = argsArray[0]; } else if (argsArray.length == 2) { nodeMatrix.a = argsArray[0]; nodeMatrix.d = argsArray[1]; } break; case "skewX": nodeMatrix.c = Math.tan(argsArray[0] * Math.PI / 180.0); break; case "skewY": nodeMatrix.b = Math.tan(argsArray[0] * Math.PI / 180.0); break; case "rotate": if (argsArray.length == 3) { nodeMatrix.translate(-argsArray[1], -argsArray[2]); nodeMatrix.rotate(Number(argsArray[0])* Math.PI / 180.0); nodeMatrix.translate(argsArray[1], argsArray[2]); } else { nodeMatrix.rotate(Number(argsArray[0])* Math.PI / 180.0); } break; default: //this.dbg('Unknown Transformation: ' + command); } baseMatrix.concat(nodeMatrix); } } } return baseMatrix; } protected function draw():void { for each (var command:Array in this._graphicsCommands) { switch(command[0]) { case "PATH": this.nodeBeginFill(); drawSprite.graphics.drawPath(command[1].commands, command[1].data, command[1].winding); this.nodeEndFill(); break; case "LINE": this.nodeBeginFill(); drawSprite.graphics.moveTo(command[1], command[2]); drawSprite.graphics.lineTo(command[3], command[4]); this.nodeEndFill(); break; case "RECT": this.nodeBeginFill(); if (command.length == 5) { drawSprite.graphics.drawRect(command[1], command[2],command[3], command[4]); } else { drawSprite.graphics.drawRoundRect(command[1], command[2],command[3], command[4], command[5], command[6]); } this.nodeEndFill(); break; case "CIRCLE": this.nodeBeginFill(); drawSprite.graphics.drawCircle(command[1], command[2], command[3]); this.nodeEndFill(); break; case "ELLIPSE": this.nodeBeginFill(); drawSprite.graphics.drawEllipse(command[1], command[2],command[3], command[4]); this.nodeEndFill(); break; } } } /** * Called at the start of drawing an SVG element. * Sets fill and stroke styles **/ protected function nodeBeginFill():void { //Fill var color_and_alpha:Array = [0, 0]; var color_core:Number = 0; var color_alpha:Number = 0; var fill_alpha:Number = 0; var fill:String = this.getStyleOrAttr('fill'); // draw even if visibility = "hidden". May be required for // pointer-events. Animation of visibility attribute independent of // drawNode() relies on the correct drawing state var matches:Array = fill.match(/url\(#([^\)]+)\)/si); if (matches != null && matches.length > 0) { var fillName:String = matches[1]; this.svgRoot.addReference(this, fillName); var fillNode:SVGNode = this.svgRoot.getNode(fillName); if (!fillNode) { // this happens normally //this.dbg("Gradient " + fillName + " not (yet?) available for " + this.xml.@id); } if (fillNode is SVGGradient) { SVGGradient(fillNode).beginGradientFill(this); } else if (fillNode is SVGPatternNode) { SVGPatternNode(fillNode).beginPatternFill(this); } } else { if (fill == 'currentColor') { fill = this.getStyleOrAttr('color'); } // Still may draw for fill 'none' in order to get mouse events. if (fill != 'none') { color_and_alpha = SVGUnits.getColorAndAlpha(fill); color_core = color_and_alpha[0]; color_alpha = color_and_alpha[1]; fill_alpha = SVGUnits.parseNum( this.getStyleOrAttr('fill-opacity') ) * color_alpha; } var pointerEvents:String = this.getStyleOrAttr('pointer-events', 'visiblePainted'); // Begin fill if there is a fill set, or if we need an invisible fill to get mouse events if ( (fill != 'none' && getStyleOrAttr('visibility') != 'hidden') || (pointerEvents == 'all') ) { drawSprite.graphics.beginFill(color_core, fill_alpha); } } nodeBeginStroke(); } protected function nodeBeginStroke():void { var shapeRendering:String = this.getStyle('shape-rendering'); //Stroke var line_color:Number; var line_alpha:Number; var line_width:Number; var stroke:String = this.getStyleOrAttr('stroke', 'black'); if ( (stroke == 'none') || (stroke == '') || (this.getStyleOrAttr('visibility') == 'hidden') ) { line_alpha = 0; line_color = 0; line_width = 0; } else { if (stroke == 'currentColor') { stroke = this.getStyleOrAttr('color'); } line_color = SVGUnits.parseNum(SVGUnits.getColor(stroke)); line_alpha = SVGUnits.parseNum(this.getStyleOrAttr('stroke-opacity')); line_width = SVGUnits.parseNum(this.getStyleOrAttr('stroke-width')); } var capsStyle:String = this.getStyleOrAttr('stroke-linecap'); if (capsStyle == 'round'){ capsStyle = CapsStyle.ROUND; } else if (capsStyle == 'square'){ capsStyle = CapsStyle.SQUARE; } else { capsStyle = CapsStyle.NONE; } var jointStyle:String = this.getStyleOrAttr('stroke-linejoin'); if (jointStyle == 'round'){ jointStyle = JointStyle.ROUND; } else if (jointStyle == 'bevel'){ jointStyle = JointStyle.BEVEL; } else { // Issue 437: "Slow rendering with mitered corners" // http://code.google.com/p/svgweb/issues/detail?id=437 // The SVG default is to use mitered joins, but this is _extremely_ slow on // Flash for some edge cases; using the Flash default joint style // is much faster, by about two orders of magnitude for certain // SVG files. if (shapeRendering == 'optimizeSpeed' || shapeRendering == 'auto'){ // The SVG standard says that 'auto' on the shape-rendering property should // optimize correctness over speed. However, we go against the // standard for SVG Web on this point for two reasons: // * If a developer uses shape-rendering: optimizeSpeed for native // SVG renderers, such as Firefox, the visual quality is very // degraded -- there is no way to specify that only one renderer // should be optimized for speed. // * The effect on performance is _huge_ for the Flash SVG Web // renderer. jointStyle = JointStyle.ROUND; } else { jointStyle = JointStyle.MITER; } } var miterLimit:String = this.getStyleOrAttr('stroke-miterlimit'); if (miterLimit == null) { miterLimit = '4'; } drawSprite.graphics.lineStyle(line_width, line_color, line_alpha, false, LineScaleMode.NORMAL, capsStyle, jointStyle, SVGUnits.parseNum(miterLimit)); // draw even if visibility = "hidden". May be required for // pointer-events. Animation of visibility attribute independent of // drawNode() relies on the correct drawing state if ( (stroke != 'none') && (stroke != '') ) { var strokeMatches:Array = stroke.match(/url\(#([^\)]+)\)/si); if (strokeMatches != null && strokeMatches.length > 0) { var strokeName:String = strokeMatches[1]; this.svgRoot.addReference(this, strokeName); var strokeNode:SVGNode = this.svgRoot.getNode(strokeName); if (!strokeNode) { // this happens normally //this.dbg("stroke gradient " + strokeName + " not (yet?) available for " + this.xml.@id); } if (strokeNode is SVGGradient) { SVGGradient(strokeNode).lineGradientStyle(this, line_alpha); } } } } /** * Called at the end of drawing an SVG element **/ protected function nodeEndFill():void { drawSprite.graphics.endFill(); } /** * Check value of x against _minX and _maxX, * Update values when appropriate **/ protected function setXMinMax(value:Number):void { if (_firstX) { _firstX = false; this.xMax = value; this.xMin = value; return; } if (value < this.xMin) { this.xMin = value; } if (value > this.xMax) { this.xMax = value; } } /** * Check value of y against _minY and _maxY, * Update values when appropriate **/ protected function setYMinMax(value:Number):void { if (_firstY) { _firstY = false; this.yMax = value; this.yMin = value; return; } if (value < this.yMin) { this.yMin = value; } if (value > this.yMax) { this.yMax = value; } } public function applyViewBox():void { // Apply viewbox transform var viewBox:String = this.getAttribute('viewBox'); var preserveAspectRatio:String = this.getAttribute('preserveAspectRatio'); if ( (viewBox != null) || (preserveAspectRatio != null) ) { var newMatrix:Matrix = new Matrix(); if (preserveAspectRatio == null) { preserveAspectRatio = 'xMidYMid meet'; } /** * Canvas, the viewport **/ var canvasWidth:Number; var canvasHeight:Number; if (topSprite.parent is SVGViewerWeb) { canvasWidth = SVGViewerWeb(topSprite.parent).getWidth(); canvasHeight = SVGViewerWeb(topSprite.parent).getHeight(); } else { canvasWidth = this.getWidth(); canvasHeight = this.getHeight(); } /** * Viewbox **/ var viewX:Number; var viewY:Number; var viewWidth:Number; var viewHeight:Number; if (viewBox != null) { viewBox = viewBox.replace(/,/sg," "); //Replace commas with spaces var points:Array = viewBox.split(/\s+/); //Split by white space viewX = SVGUnits.parseNum(points[0]); viewY = SVGUnits.parseNum(points[1]); viewWidth = SVGUnits.parseNum(points[2]); viewHeight = SVGUnits.parseNum(points[3]); } else { viewX = 0; viewY = 0; viewWidth = canvasWidth; viewHeight = canvasHeight; } var oldAspectRes:Number = viewWidth / viewHeight; var newAspectRes:Number = canvasWidth / canvasHeight; var cropWidth:Number; var cropHeight:Number; var alignMode:String = preserveAspectRatio.substr(0,8); var meetOrSlice:String = 'meet'; if (preserveAspectRatio.indexOf('slice') != -1) { meetOrSlice = 'slice'; } /** * Handle Scaling **/ if (alignMode == 'none') { // stretch to fit viewport width and height cropWidth = canvasWidth; cropHeight = canvasHeight; } else { if (meetOrSlice == 'meet') { // shrink to fit inside viewport if (newAspectRes > oldAspectRes) { cropWidth = canvasHeight * oldAspectRes; cropHeight = canvasHeight; } else { cropWidth = canvasWidth; cropHeight = canvasWidth / oldAspectRes; } } else { // meetOrSlice == 'slice' // Expand to cover viewport. if (newAspectRes > oldAspectRes) { cropWidth = canvasWidth; cropHeight = canvasWidth / oldAspectRes; } else { cropWidth = canvasHeight * oldAspectRes; cropHeight = canvasHeight; } } } var scaleX:Number = cropWidth / viewWidth; var scaleY:Number = cropHeight / viewHeight; newMatrix.translate(-viewX, -viewY); newMatrix.scale(scaleX, scaleY); /** * Handle Alignment **/ var borderX:Number; var borderY:Number; var translateX:Number; var translateY:Number; if (alignMode != 'none') { translateX=0; translateY=0; var xAlignMode:String = alignMode.substr(0,4); switch (xAlignMode) { case 'xMin': break; case 'xMax': translateX = canvasWidth - cropWidth; break; case 'xMid': default: borderX = canvasWidth - cropWidth; translateX = borderX / 2.0; break; } var yAlignMode:String = alignMode.substr(4,4); switch (yAlignMode) { case 'YMin': break; case 'YMax': translateY = canvasHeight - cropHeight; break; case 'YMid': default: borderY = canvasHeight - cropHeight; translateY = borderY / 2.0; break; } newMatrix.translate(translateX, translateY); } // cache the matrix to efficiently aid any zooming and // panning operations later this._lastVBMatrix = newMatrix.clone(); // apply any zoom and pan values that might be in effect // if we are the SVG root tag if (this is SVGSVGNode && this.svgParent == null) { newMatrix.translate(this.svgRoot.currentTranslate.x, this.svgRoot.currentTranslate.y); newMatrix.scale(this.svgRoot.currentScale, this.svgRoot.currentScale); } viewBoxSprite.transform.matrix = newMatrix; } } protected function applyClipPathMask():void { var attr:String; var match:Array; var node:SVGNode; var matrix:Matrix; attr = this.getStyleOrAttr('mask'); if (!attr) { attr = this.getStyleOrAttr('clip-path'); } if (attr) { match = attr.match(/url\(\s*#(.*?)\s*\)/si); if (match.length == 2) { attr = match[1]; node = this.svgRoot.getNode(attr); if (svgClipPathMask == node) { return; } this.removeMask(); if (node) { svgClipPathMask = node; var newMask:SVGNode = node.clone(); newMask.isMask = true; addSVGChildMask(newMask); clipSprite.mask = newMask.topSprite; newMask.topSprite.visible = true; clipSprite.cacheAsBitmap = true; // We need to cacheAsBitmap for group and path nodes // to fix a strange problem with a path on line 336 // of samples/svg-files/juanmontoya_lingerie.svg // Without cacheAsBitmap, this path is not clipped by the // group node mask on line 329. // Issue 345: cacheAsBitmap should only be used when // necessary due to its large memory consumption. if (this is SVGPathNode || this is SVGGroupNode) { newMask.topSprite.cacheAsBitmap = true; } } } } else { this.removeMask(); } } protected function removeMask():void { if (clipSprite != topSprite && clipSprite.mask) { clipSprite.mask.parent.removeChild(clipSprite.mask); clipSprite.mask = null; svgClipPathMask = null; } } /** * Add any assigned filters to node **/ protected function setupFilters():void { var filterName:String = this.getStyleOrAttr('filter'); if ( (filterName != null) && (filterName != '') && (filterName != 'none') ) { var matches:Array = filterName.match(/url\(#([^\)]+)\)/si); if (matches.length > 0) { filterName = matches[1]; var filterNode:SVGNode = this.svgRoot.getNode(filterName); if (filterNode) { drawSprite.filters = SVGFilterNode(filterNode).getFilters(this); } else { //this.dbg("filter " + filterName + " not (yet?) available for " + this.xml.@id); // xxx add reference } } } } protected function attachEventListeners():void { var action:String; action = this.getAttribute('onclick', null, false); if (action) { this.svgRoot.addActionListener(MouseEvent.CLICK, drawSprite); } action = this.getAttribute('onmousedown', null, false); if (action) { this.svgRoot.addActionListener(MouseEvent.MOUSE_DOWN, drawSprite); } action = this.getAttribute('onmouseup', null, false); if (action) { this.svgRoot.addActionListener(MouseEvent.MOUSE_UP, drawSprite); } action = this.getAttribute('onmousemove', null, false); if (action) { this.svgRoot.addActionListener(MouseEvent.MOUSE_MOVE, drawSprite); } action = this.getAttribute('onmouseover', null, false); if (action) { this.svgRoot.addActionListener(MouseEvent.MOUSE_OVER, drawSprite); } action = this.getAttribute('onmouseout', null, false); if (action) { this.svgRoot.addActionListener(MouseEvent.MOUSE_OUT, drawSprite); } } /* * Node registration triggered by stage add / remove */ // FIXME: Move to child add/remove because the node may // not be added to the stage. protected function onAddedToStage(event:Event):void { this.registerSelf(); if (this.original) { this.original.registerClone(this); } } protected function onRemovedFromStage(event:Event):void { topSprite.removeEventListener(Event.ENTER_FRAME, drawNode); this.unregisterSelf(); if (this.original) { this.original.unregisterClone(this); } } protected function registerSelf():void { if (this._isClone || (getMaskAncestor() != null)) { return; } this.svgRoot.registerGUID(this); var id:String = this.getAttribute('id'); if (id == _id) { return; } if (_id) { this.svgRoot.unregisterNode(this); } if (id && id != "") { _id = id; this.svgRoot.registerNode(this); } } protected function unregisterSelf():void { if (this._isClone || (getMaskAncestor() != null)) { return; } this.svgRoot.unregisterGUID(this); if (this._id) { this.svgRoot.unregisterNode(this); _id = null; } } /* * Attribute Handling */ /** * Gets an XML attribute from this node * * @param name XML attribute to retrieve from SVG XML. * @param defaultValue Default value to return if this attribute is * not defined. Defaults to null. * @param inherit Whether to look up the inheritance chain if this * property is inherited. Defaults to true. * @param applyAnimations Boolean, optional, defaults to true. Controls * whether we apply any SMIL animations that might be in flight to the * attribute. If false, then we return the base actual set value on * this node without reference to any animation changes. * @param applyStyle Boolean, optional, defaults to false. Controls whether * we get and set values from this node's style values as well as its * attribute values. If false, then we don't check or set a given * attribute name against the style value. * * @return Returns the XML attribute value, or the defaultValue. **/ public function getAttribute(name:String, defaultValue:* = null, inherit:Boolean = true, applyAnimations:Boolean = true, applyStyle:Boolean = false):* { var value:String = this._getAttribute(name, defaultValue, inherit, applyAnimations, applyStyle); if (value !== null && value != 'inherit') { return value; } if (value == "inherit") { value = null; } if (ATTRIBUTES_NOT_INHERITED.indexOf(name) != -1) { if (defaultValue == null) { if (name == 'opacity') { return '1'; } // default fall through } return defaultValue; } if (inherit && (this.svgParent != null)) { return SVGNode(this.svgParent).getAttribute(name, defaultValue, true, applyAnimations, applyStyle); } return defaultValue; } /** * * This method retrieves the attribute from the current node only and is * used as a helper for getAttribute, which has css parent inheritance logic. * **/ protected function _getAttribute(name:String, defaultValue:* = null, inherit:Boolean = true, applyAnimations:Boolean = true, applyStyle:Boolean = false):* { var value:String; // If we are rendering a mask, then use a simple black fill. if (this.getMaskAncestor() != null) { if ( (name == 'opacity') || (name == 'fill-opacity') || (name == 'stroke-width') || (name == 'stroke-opacity') ) { return '1'; } if (name == 'fill') { return 'black'; } if (name == 'stroke') { return 'none'; } if (name == 'filter') { return 'none'; } } if (applyAnimations) { value = getAnimAttribute(name, defaultValue, inherit, applyStyle); if (value !== null) { return value; } } if (name == "href") { //this._xml@href handled normally value = this._xml.@xlink::href; if (value !== null && (value != "")) { return value; } } if (name == "base") { value = this._xml.@aaa::base; if (value !== null && (value != "")) { return value; } } // If node is the top level of a clone, // check for an override value from the parent. if (this.original && (this.svgParent is SVGUseNode)) { // node already implements x, y, and transform if (name != 'x' && name != 'y' && name != 'transform') { value = this.svgParent._getAttribute(name, null, false, true, true); if (value !== null) { return value; } } } if (applyStyle && _styles.hasOwnProperty(name)) { return (_styles[name]); } var xmlList:XMLList = this._xml.attribute(name); if (xmlList.length() > 0) { return xmlList[0].toString(); } return null; } public function getStyleOrAttr(name:String, defaultValue:* = null, inherit:Boolean = true, applyAnimations:Boolean = true):* { return getAttribute(name, defaultValue, inherit, applyAnimations, true); } // process all animations public function getAnimAttribute(name:String, defaultValue:* = null, inherit:Boolean = true, useStyle:Boolean = false):String { var animation:SVGAnimateNode; // transform is handled by getAllAnimsTransforms if (name == "transform") return null; var foundAnimation:Boolean = false; for each(animation in animations) { if (animation.getAttributeName() == name) { foundAnimation = true; break; } } if (!foundAnimation) return null; var isAdditive:Boolean = true; // Start with base value var baseVal:String = getAttribute(name, defaultValue, inherit, false, useStyle); var isPath:Boolean = name=='d'; var animVal:Number; if (baseVal) { animVal = SVGUnits.parseNum(baseVal); } else if (!isPath) { animVal= 0; } // Handle discrete string values var discreteStringVal:String; var isColor:Boolean = (baseVal != null) && !isPath && SVGUnits.isColor(baseVal); var animValString:String = null; // XXX This should sort by priority (activation order) // Add or replace with animations for each(animation in animations) { if ( animation.getAttributeName() == name && animation.isEffective() ) { animValString = animation.getAnimValue(); if (animValString == null) continue; // null is an error, or !isEffective isColor = !isPath && (isColor || SVGUnits.isColor(animValString)); if (animation.isAdditive()) { if (isColor) { animVal = SVGUnits.addColors(animVal, SVGUnits.parseNum(animValString)); } else if (!isPath) { animVal = animVal + SVGUnits.parseNum(animValString); } } else { if (isPath || isNaN(animVal = SVGUnits.parseNum(animValString))) { discreteStringVal = animValString; } } } } if (animValString == null) //no animations return baseVal; if (discreteStringVal) { return discreteStringVal; } else { if (isColor) { return SVGUnits.colorString(animVal); } else { return String(animVal); } } } /** * Compute cumulative animation transform. **/ public function getAllAnimsTransform():Array { var animTransform:Matrix= new Matrix(); var isAdditive:Boolean = true; // Issues 254, 311 and 331 are relevant to transform ordering. // The additive attribute is processed in order of appearance. var animsToApply:Array = new Array(); for each(var animation:SVGAnimateNode in animations) { if (animation is SVGAnimateTransformNode && animation.isEffective()) { var transAnim:SVGAnimateTransformNode = SVGAnimateTransformNode(animation); if (!transAnim.isAdditive()) { isAdditive=false; animsToApply = new Array(); } animsToApply.push(transAnim); } } // Transform animations are applied in reverse order of appearance. var animReverse:Array=animsToApply.reverse(); for each (transAnim in animReverse) { animTransform.concat(transAnim.getAnimTransform()); } return [ animTransform, isAdditive ]; } public function setAttribute(name:String, value:String, attrNamespace:String = null):void { if (name == "style") { this._xml.@style = value; this.parseStyle(); } if (attrNamespace != null) { // namespaced attribute, such as xlink:href var ns:Namespace = new Namespace(attrNamespace); this.xml.@ns::[name] = value.toString(); } else { this._xml.@[name] = value; } handleAttrChange(name, value, attrNamespace); } public function handleAttrChange(name:String, value:String, attrNamespace:String = null):void { switch (name) { case 'onclick': case 'onmousedown': case 'onmousemove': case 'onmouseout': case 'onmouseover': case 'onmouseup': case 'onmousedown': this.attachEventListeners(); break; case 'transform': case 'viewBox': case 'x': case 'y': case 'rotation': this.transformNode(); this.applyViewBox(); break; case 'pointer-events': if (value == 'none') { topSprite.mouseEnabled = false; topSprite.mouseChildren = false; } else { topSprite.mouseEnabled = true; topSprite.mouseChildren = true; } break; default: this.invalidateDisplay(); if ( (name == 'display' || name == 'visibility') || (name == 'style' && value != null && ( value.indexOf('visibility') != -1 || value.indexOf('display') != -1 )) || (this is SVGGroupNode || this is SVGTextNode) ) { this.invalidateChildren(); } break; } this.updateClones(); if (getClipPathAncestor() != null) { getClipPathAncestor().updateClones(); } if (getPatternAncestor() != null) { this.svgRoot.invalidateReferers(getPatternAncestor().id); } } /** Sets a style attribute in the style="" string. Note that this * leaves XML attributes alone. For examle, if you set * the fill style to 'red', the XML fill attribute will remain with * its old value. **/ public function setStyle(name:String, value:String):void { //this.dbg('setStyle, name='+name+', value='+value); this._styles[name] = value; this.updateStyle(); this.parseStyle(); handleAttrChange(name, value, null); } /** Gets a style attribute from the style="" string. Note that this * leaves XML attributes alone. For examle, if you set * the fill style to 'red', the XML fill attribute will remain with * its old value. Note that style values do not reflect changes * that might apply due to SMIL animations; use getAttribute to * an attribute that might have come into existence as part of a * SMIL animation. * * @param name The style name, such as fill or stroke-width. Dashed * style names will automatically be converted into camel case. * @param defaultValue The default value to return if none is present. * Defaults to null. * @param inherit Whether to look up the inheritance chain if this * property is inherited. Defaults to true. * * @return The style value, or null if it is not present. **/ public function getStyle(name:String, defaultValue:* = null, inherit:Boolean = true):* { var value:String = this._getStyle(name); if (value !== null) { return value; } if (_styles.hasOwnProperty(name)) { value = _styles[name]; } if (value == "inherit") { value = null; } if (value !== null) { return value; } if (inherit && this.svgParent) { return this.svgParent.getStyle(name, defaultValue, inherit); } return defaultValue; } /** This method retrieves the style from the current node only and is * used as a helper for getStyle. **/ protected function _getStyle(name:String):String { var value:String; // If we are rendering a mask, then use a simple black fill. if (this.getMaskAncestor() != null) { if ( (name == 'opacity') || (name == 'fill-opacity') || (name == 'stroke-width') || (name == 'stroke-opacity') ) { return '1'; } if (name == 'fill') { return 'black'; } if (name == 'stroke') { return 'none'; } if (name == 'filter') { return null; } } if (this.original && (this.svgParent is SVGUseNode)) { //Node is the top level of a clone //Check for an override value from the parent value = this.svgParent.getStyle(name, null, false); if (value !== null) { return value; } } if (_styles.hasOwnProperty(name)) { return (_styles[name]); } return null; } private function parseStyle():void { //Get styling from XML attribute 'style' _styles = new Object(); var xmlList:XMLList = this._xml.attribute('style'); if (xmlList.length() > 0) { var styleString:String = xmlList[0].toString(); // only one style value given, with no trailing semicolon? if (this._xml.@style.length() && styleString.indexOf(';') == -1) { // update our internal string to be correct moving forward this._xml.@style = styleString + ';'; styleString += ';'; } var styles:Array = styleString.split(';'); for each(var style:String in styles) { var styleSet:Array = style.split(':'); if (styleSet.length == 2) { var attrName:String = SVGUnits.trim(styleSet[0]); var attrValue:String = SVGUnits.trim(styleSet[1]); this._styles[attrName] = attrValue; } } } } /** * Update style attribute from _styles * * **/ private function updateStyle():void { var newStyleString:String = ''; for (var key:String in this._styles) { newStyleString += key + ':' + this._styles[key] + ';'; } this._xml.@style = newStyleString; } /** * Returns true if this node can have text children. Subclasses * should override this if they want to have text node children. */ public function hasText():Boolean { return false; } /** * Returns any text content this node might have as a child. */ public function getText():String { return this._xml.text().toString(); } /** * Sets any text content this node might have as a child. */ public function setText(newValue:String):void { // subclasses should implement this if they want to have text throw new Error("Unimplemented"); } public function onRegisterFont(fontFamily:String):void { } /** * Force a redraw of a node **/ public function invalidateDisplay():void { if (this._invalidDisplay == false && topSprite) { this._invalidDisplay = true; topSprite.addEventListener(Event.ENTER_FRAME, drawNode); if (this._invalidAttribute) { // if _invalidAttribute is already set then reset to prevent // repeat processing performed by drawNode. this._invalidAttribute = INVALID_ATTR_NONE; } } } public function invalidateChildren():void { var child:SVGNode; for (var i:uint = 0; i < viewBoxSprite.numChildren; i++) { var node:DisplayObject = viewBoxSprite.getChildAt(i); if (!(node is SVGSprite)) { // Issue 391: // "Get Jessyink demo working on SVG Web" // http://code.google.com/p/svgweb/issues/detail?id=391 continue; } child = SVGSprite(node).svgNode; child.invalidateDisplay(); child.invalidateChildren(); } } // This is called when the element has not rendered yet. // TODO: When possible, compute the bounds without rendering. public function getBounds():Rectangle { return new Rectangle(0,0,0,0); } public function invalidateAttribute(attributeName:String):void { if (!this.topSprite || !this.topSprite.parent || this._invalidDisplay) return; var attr:uint = INVALID_ATTR_NONE; switch (attributeName) { case 'transform': case 'viewBox': case 'x': case 'y': case 'rotation': attr = INVALID_ATTR_TRANSFORM; break; case 'opacity' : attr = INVALID_ATTR_OPACITY; break; case 'visibility' : attr = INVALID_ATTR_VISIBILITY; break; case 'display' : attr = INVALID_ATTR_DISPLAY; break; default: this.invalidateDisplay(); this.invalidateChildren(); break; } if (attr != INVALID_ATTR_NONE) { if (this._invalidAttribute == INVALID_ATTR_NONE) { topSprite.addEventListener(Event.ENTER_FRAME, invalidateAttributeHandler); } this._invalidAttribute |= attr; } } public function invalidateAttributeHandler(event:Event):void { // are we in the middle of a suspendRedraw operation? if (this.svgRoot.viewer && this.svgRoot.viewer.isSuspended) { return; } this.topSprite.removeEventListener(Event.ENTER_FRAME, invalidateAttributeHandler); if (this._invalidAttribute != INVALID_ATTR_NONE) { if (this._invalidAttribute & INVALID_ATTR_DISPLAY) { if (this.getStyleOrAttr('display') == 'none') { this.topSprite.visible = false; } else { this.topSprite.visible = true; } } if (this._invalidAttribute & INVALID_ATTR_OPACITY) { if (this.drawSprite) this.drawSprite.alpha = SVGUnits.parseNum(this.getStyleOrAttr('opacity')); } if (this._invalidAttribute & INVALID_ATTR_VISIBILITY) { if (this.getStyleOrAttr('visibility') == 'hidden') { this.setVisibility('hidden'); } else { this.setVisibility('visible'); } } if (this._invalidAttribute & INVALID_ATTR_TRANSFORM) { if (this is SVGSVGNode) { this.loadAttribute('x'); this.loadAttribute('y'); this.applyDefaultMask(); } this.transformNode(); this.applyViewBox(); } this._invalidAttribute = INVALID_ATTR_NONE; } } /* * Clone Handlers */ public function clone():SVGNode { var nodeClass:Class = getDefinitionByName(getQualifiedClassName(this)) as Class; var newXML:XML = this._xml.copy(); var node:SVGNode = new nodeClass(this.svgRoot, newXML, this) as SVGNode; return node; } public function registerClone(clone:SVGNode):void { if (this._clones.indexOf(clone) == -1) { this._clones.push(clone); } } public function unregisterClone(clone:SVGNode):void { var index:int = this._clones.indexOf(clone); if (index > -1) { this._clones = this._clones.splice(index, 1); } } protected function updateClones():void { for (var i:uint = 0; i < this._clones.length; i++) { SVGNode(this._clones[i]).xml = this._xml.copy(); } } public function get isClone():Boolean { return this._isClone; } /* * Animations */ public function addAnimation(animation:SVGAnimateNode):void { if (animations.indexOf(animation) == -1) { animations.push(animation); } } public function removeAnimation(animation:SVGAnimateNode):void { if (animations.indexOf(animation) != -1) { animations.splice(animations.indexOf(animation), 1); } } /* * Misc Functions */ public function getWidth():Number { var parentWidth:Number=0; if (topSprite.parent is SVGViewer) { parentWidth = SVGViewer(topSprite.parent).getWidth(); } if (this.svgParent != null) { parentWidth = this.svgParent.getWidth(); } if (this.getAttribute('width') != null) { return SVGUnits.parseNumPct(this.getAttribute('width'), parentWidth); } // defaults to 100% return parentWidth; } public function getHeight():Number { var parentHeight:Number=0; if (topSprite.parent is SVGViewer) { parentHeight=SVGViewer(topSprite.parent).getHeight(); } if (this.svgParent is SVGNode) { parentHeight=this.svgParent.getHeight(); } if (this.getAttribute('height') != null) { return SVGUnits.parseNumPct(this.getAttribute('height'), parentHeight); } // defaults to 100% return parentHeight; } /** Appends an SVGNode both to our display list as well as to our * XML. **/ public function appendSVGChild(child:SVGNode):SVGNode { this._xml.appendChild(child._xml); this.addSVGChildAt(child, svgChildren.length); this.invalidateDisplay(); return child; } public function removeSVGChild(node:SVGNode):SVGNode { // Remove from svg list. var i:uint; for (i = 0; i < this.svgChildren.length; i++) { if (this.svgChildren[i] == node) { this.svgChildren.splice(i, 1); break; } } node.svgParent = null; // unregister the element this.svgRoot.unregisterNode(node); // if we are dealing with a fake text node, change our // text node contents if (node is SVGDOMTextNode && this.hasText()) { this.setText(null); } // remove from our XML children for (i = 0; i < this._xml.children().length(); i++) { if (this._xml.children()[i].@__guid == node._xml.@__guid) { delete this._xml.children()[i]; break; } } // Remove from flash list. if ( node.topSprite ) { var child:DisplayObject; for (i = 0; i < viewBoxSprite.numChildren; i++) { child = viewBoxSprite.getChildAt(i); if (child == node.topSprite) { viewBoxSprite.removeChild(child); } } this.invalidateDisplay(); } node.onRemoved(); return node; } /** * Adds newChild before refChild. Position is the position of refChild * to add newChild before. */ public function insertSVGBefore(position:int, newChild:SVGNode, refChild:SVGNode):void { //this.dbg('insertSVGBefore, position='+position+', newChild='+newChild+', refChild='+refChild); // update our XML this._xml.insertChildBefore(refChild.xml, newChild.xml); newChild.svgParent = this; this.svgChildren.splice(position, 0, newChild); if (newChild.topSprite) { // Adjust display list position for missing // DOM text nodes. var displayPosition:int = position; var i:uint; for (i = 0; i < position; i++) { if (this.svgChildren[i] is SVGDOMTextNode) { displayPosition--; } } viewBoxSprite.addChildAt(newChild.topSprite, displayPosition); this.invalidateDisplay(); } newChild.onAdded(); } public function addSVGChildAt(child:SVGNode, index:int):SVGNode { // update XML if (child is SVGDOMTextNode) { if (this.hasText()) { this.setText(child.xml.text()); } } else { if (index == (this._xml.children().length() - 1)) { this._xml.appendChild(child.xml); } else { var insertBefore:XML = this._xml.children()[index]; this._xml.insertChildBefore(insertBefore, child.xml); } } child.svgParent = this; this.svgChildren.splice(index, 0, child); // update our Flash display list if (child.topSprite) { // Adjust display list position for missing // DOM text nodes. var displayIndex:uint = index; var i:uint; for (i = 0; i < index; i++) { if (this.svgChildren[i] is SVGDOMTextNode) { displayIndex--; } } viewBoxSprite.addChildAt(child.topSprite, displayIndex); } child.onAdded(); return child; } /** * Called when a node is added to its parent. */ protected function onAdded():void { } /** * Called when a node is removed from its parent. */ protected function onRemoved():void { } /** * Remove all child nodes **/ protected function clearSVGChildren():void { this.svgChildren = new Array(); while (viewBoxSprite && viewBoxSprite.numChildren) { viewBoxSprite.removeChildAt(0); } } public function getMaskAncestor():SVGNode { var node:SVGNode = this; if ( node && node.isMask) return node; while (node && !(node is SVGSVGNode)) { node=node.svgParent; if (node && node.isMask) return node; } return null; } public function getPatternAncestor():SVGPatternNode { var node:SVGNode = this; while (node && !(node is SVGSVGNode)) { node=node.svgParent; if (node is SVGPatternNode) return SVGPatternNode(node); } return null; } public function getClipPathAncestor():SVGClipPathNode { var node:SVGNode = this; while (node && !(node is SVGSVGNode)) { node=node.svgParent; if (node is SVGClipPathNode) return SVGClipPathNode(node); } return null; } public function addSVGChild(child:SVGNode):void { child.svgParent = this; this.svgChildren.push(child); if (child.topSprite) { this.viewBoxSprite.addChild(child.topSprite); child.svgRoot.renderPending(); } child.onAdded(); } public function addSVGChildMask(child:SVGNode):void { child.svgParent = this; topSprite.addChild(child.topSprite); child.svgRoot.renderPending(); } /** * Getters / Setters **/ public function set xml(xml:XML):void { _xml = xml; if (this.viewBoxSprite) { this.clearSVGChildren(); } this._parsedChildren = false; this.parseStyle(); if (!this.viewBoxSprite) { this.createSVGSprites(); } this.invalidateDisplay(); this.updateClones(); } public function get xml():XML { return this._xml; } public function get id():String { var id:String = this._xml.@id; return id; } public function get guid():String { return this._xml.@__guid; } public function nsQualify(name:String, nameNS:Namespace):String { var n:int; var scopeNS:Namespace; for (n = 0; n < this.svgRoot._xml.inScopeNamespaces().length; n++) { scopeNS = this.svgRoot._xml.inScopeNamespaces()[n]; if (scopeNS.prefix == "" && scopeNS.uri == nameNS.uri) { return name; } } for (n = 0; n < this.svgRoot._xml.inScopeNamespaces().length; n++) { scopeNS = this.svgRoot._xml.inScopeNamespaces()[n]; if (scopeNS.uri == nameNS.uri) { return (scopeNS.prefix + ":" + name); } } return name; } public function getAttrs():String { var attrsString:String =""; var attrsNamesList:XMLList = xml.@*; for (var i:int = 0; i < attrsNamesList.length(); i++) { attrsString=attrsString.concat(' ', nsQualify(attrsNamesList[i].localName(),Namespace(attrsNamesList[i].namespace())), '=', '"',this._xml.@[attrsNamesList[i].name()],'"'); } return attrsString; } public function getNameSpaces():String { var namespString:String =""; for (var i:int = 0; i < this._xml.inScopeNamespaces().length; i++) { var namesp:Namespace = this._xml.inScopeNamespaces()[i]; if (namesp.prefix == "") { namespString=namespString.concat(' xmlns', '=', '"',namesp.uri,'"'); } else { namespString=namespString.concat(' xmlns:', namesp.prefix, '=', '"',namesp.uri,'"'); } } return namespString; } public function getXMLTree(indent:uint, includeOuterTag:Boolean):String { var i:uint; var xmlString:String=""; var myTag:String=""; // Cloned glyphs are artificial. Skip them. if (this is SVGGlyphNode && this.original) { return ""; } myTag = nsQualify(this._xml.localName(), this._xml.namespace()); if (this.svgChildren.length > 0) { // Open Outer tag if (includeOuterTag && !(this is SVGDOMTextNode)) { for (i = 0; i < indent; i++) { xmlString=xmlString.concat(' '); } if (this.topSprite.parent is SVGViewer) { xmlString = xmlString.concat('<', myTag, this.getNameSpaces(), this.getAttrs(), '>\n'); } else { xmlString = xmlString.concat('<', myTag, this.getAttrs(), '>\n'); } } // Children for (i = 0; i < this.svgChildren.length; i++) { xmlString = xmlString.concat(this.svgChildren[i].getXMLTree(indent+ (includeOuterTag ? 2 : 0), true)); } // Close Outer Tag if (includeOuterTag && !(this is SVGDOMTextNode)) { for (i = 0; i < indent; i++) { xmlString=xmlString.concat(' '); } xmlString = xmlString.concat('\n'); } } else { if (this is SVGDOMTextNode) { if (SVGDOMTextNode(this).nodeValue) { xmlString = xmlString.concat(SVGDOMTextNode(this).nodeValue); } } else if (this is SVGScriptNode) { var content:String; if (this._xml.children().length() > 0) { content = this._xml.children()[0].text().toString(); xmlString = xmlString.concat('<', myTag, this.getAttrs(), '>\n', content, '\n'); } else { xmlString = xmlString.concat('<', myTag, this.getAttrs(), '/>\n'); } } else { if (includeOuterTag) { for (i = 0; i < indent; i++) { xmlString=xmlString.concat(' '); } xmlString = xmlString.concat('<', myTag, this.getAttrs(), '/>\n'); } } } return xmlString; } public function get invalidDisplay():Boolean { return this._invalidDisplay; } public function dbg(debugString:String):void { this.svgRoot.debug(debugString); } public function err(errorString:String):void { this.svgRoot.error(errorString); } /** Functions for profiling. */ public function start(subject:String, subjectStarted:String = null):void { this.svgRoot.start(subject, subjectStarted); } /** Functions for profiling. */ public function end(subject:String, subjectStarted:String = null):void { this.svgRoot.end(subject, subjectStarted); } /** Functions for profiling. */ public function increment(subject:String, amount:int):void { this.svgRoot.increment(subject, amount); } /* For Performance Testing public function countTree():Array { var nodeCount:Number = 1; var spriteCount:Number = 0; var domTextNodeCount:Number = 0; if (this is SVGDOMTextNode) { domTextNodeCount++; } else { spriteCount = 1; if (clipSprite != topSprite) { spriteCount++; } if (drawSprite != clipSprite) { spriteCount++; } if (viewBoxSprite != drawSprite) { spriteCount++; } } var child:SVGNode; for (var i:uint = 0; i < this.svgChildren.length; i++) { child = this.svgChildren[i]; var counts:Array = child.countTree(); nodeCount += counts[0]; spriteCount += counts[1]; domTextNodeCount += counts[2]; } return [ nodeCount, spriteCount, domTextNodeCount ]; } */ } } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������debian/contrib/websvg/src/org/svgweb/nodes/���������������������������������������������������������0002755�0000000�0000000�00000000000�12252640275�016115� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������debian/contrib/websvg/src/org/svgweb/nodes/SVGRectNode.as�������������������������������������������0000755�0000000�0000000�00000004467�12252640275�020541� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* Copyright (c) 2009 by contributors: * James Hight (http://labs.zavoo.com/) * Richard R. Masters Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package org.svgweb.nodes { import org.svgweb.core.SVGNode; import org.svgweb.utils.SVGUnits; public class SVGRectNode extends SVGNode { public function SVGRectNode(svgRoot:SVGSVGNode, xml:XML, original:SVGNode = null):void { super(svgRoot, xml, original); } /** * Generate graphics commands to draw a rectangle **/ protected override function generateGraphicsCommands():void { this._graphicsCommands = new Array(); var widthStr:String = this.getAttribute('width','0'); var heightStr:String = this.getAttribute('height','0'); var width:Number = SVGUnits.parseNumPct(widthStr, getWidth()); var height:Number = SVGUnits.parseNumPct(heightStr, getHeight()); var rx:String = this.getAttribute('rx'); var ry:String = this.getAttribute('ry'); if ((rx != null) && (ry == null)) { ry = rx; } if ((ry != null) && (rx == null)) { rx = ry; } //x & y loaded in setAttributes() if (rx != null) { this._graphicsCommands.push(['RECT', 0, 0, width, height, (SVGUnits.parseNum(rx) * 2), SVGUnits.parseNum(ry) * 2]); } else { this._graphicsCommands.push(['RECT', 0, 0, width, height]); } //Width/height calculations for gradients this.setXMinMax(0); this.setYMinMax(0); this.setXMinMax(width); this.setYMinMax(height); } } } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������debian/contrib/websvg/src/org/svgweb/nodes/SVGAnimateColorNode.as�����������������������������������0000755�0000000�0000000�00000001651�12252640275�022211� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* Copyright (c) 2009 by contributors: * James Hight (http://labs.zavoo.com/) * Richard R. Masters Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package org.svgweb.nodes { import org.svgweb.core.SVGNode; public class SVGAnimateColorNode extends SVGAnimateNode { public function SVGAnimateColorNode(svgRoot:SVGSVGNode, xml:XML, original:SVGNode = null):void { super(svgRoot, xml, original); } } } ���������������������������������������������������������������������������������������debian/contrib/websvg/src/org/svgweb/nodes/SVGMissingGlyphNode.as�����������������������������������0000644�0000000�0000000�00000001657�12252640275�022254� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* Copyright (c) 2009 by contributors: * James Hight (http://labs.zavoo.com/) * Richard R. Masters Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package org.svgweb.nodes { import org.svgweb.core.SVGNode; public class SVGMissingGlyphNode extends SVGGlyphNode { public function SVGMissingGlyphNode(svgRoot:SVGSVGNode, xml:XML, original:SVGNode = null):void { super(svgRoot, xml, original); } } } ���������������������������������������������������������������������������������debian/contrib/websvg/src/org/svgweb/nodes/SVGFontFaceNode.as���������������������������������������0000644�0000000�0000000�00000003060�12252640275�021312� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* Copyright (c) 2009 by contributors: * James Hight (http://labs.zavoo.com/) * Richard R. Masters Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package org.svgweb.nodes { import org.svgweb.core.SVGNode; import flash.events.Event; import flash.display.DisplayObject; public class SVGFontFaceNode extends SVGNode { public function SVGFontFaceNode(svgRoot:SVGSVGNode, xml:XML, original:SVGNode = null):void { super(svgRoot, xml, original); } override protected function onAddedToStage(event:Event):void { if (this.getParentFont()) { this.getParentFont().setFontFaceName(this.getStyleOrAttr('font-family')); } super.onAddedToStage(event); } public function getParentFont():SVGFontNode { var node:SVGNode = this; while (node && !(node is SVGSVGNode)) { node=node.svgParent; if (node is SVGFontNode) return SVGFontNode(node); } return null; } } } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������debian/contrib/websvg/src/org/svgweb/nodes/SVGFontNode.as�������������������������������������������0000644�0000000�0000000�00000005142�12252640275�020536� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* Copyright (c) 2009 by contributors: * James Hight (http://labs.zavoo.com/) * Richard R. Masters Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package org.svgweb.nodes { import org.svgweb.core.SVGNode; import org.svgweb.nodes.SVGGlyphNode; public class SVGFontNode extends SVGNode { protected var glyphs:Array = new Array(); protected var missingGlyph:SVGMissingGlyphNode; protected var fontFaceName:String = ""; protected var unitsPerEm:Number; public function SVGFontNode(svgRoot:SVGSVGNode, xml:XML, original:SVGNode = null):void { super(svgRoot, xml, original); } public function registerGlyph(glyph:SVGGlyphNode):void { if (glyph is SVGMissingGlyphNode) { this.missingGlyph = SVGMissingGlyphNode(glyph); } else { this.glyphs[glyph.getUnicode()] = glyph; } } public function unregisterGlyph(glyph:SVGGlyphNode):void { delete this.glyphs[glyph.getUnicode()]; } public function getGlyph(unicode:String):SVGGlyphNode { if (this.glyphs.hasOwnProperty(unicode)) { return this.glyphs[unicode]; } else { return this.missingGlyph; } } public function setFontFaceName(fontFace:String):void { this.fontFaceName = fontFace; this.svgRoot.registerFont(this); } public function getFontFaceName():String { return this.fontFaceName; } override protected function parseChildren():void { super.parseChildren(); unitsPerEm = 1000.0; var i:uint; for (i=0; i node does not use the x and y attributes. (However, it does honor the transform attribute.) // However, if the node is being referenced by a node, then x and y are transferred to as // an equivalent transform. override protected function loadAttribute(name:String, field:String = null, useStyle:Boolean = false):void { // Group nodes with opacity need to use the layer blend mode to make it work. // We only do this when necessary because this consumes resources. if (name == 'opacity') { if (SVGUnits.parseNum(this.getStyleOrAttr(name)) < 1.0) { topSprite.blendMode = BlendMode.LAYER; } else { topSprite.blendMode = BlendMode.NORMAL; } } if ( (name == 'x' || name == 'y') && !(this.svgParent is SVGUseNode) ) { return; } else { super.loadAttribute(name, field, useStyle); } } } } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������debian/contrib/websvg/src/org/svgweb/nodes/SVGStopNode.as�������������������������������������������0000755�0000000�0000000�00000001620�12252640275�020555� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* Copyright (c) 2009 by contributors: * James Hight (http://labs.zavoo.com/) * Richard R. Masters Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package org.svgweb.nodes { import org.svgweb.core.SVGNode; public class SVGStopNode extends SVGNode { public function SVGStopNode(svgRoot:SVGSVGNode, xml:XML, original:SVGNode = null):void { super(svgRoot, xml, original); } } } ����������������������������������������������������������������������������������������������������������������debian/contrib/websvg/src/org/svgweb/nodes/SVGClipPathNode.as���������������������������������������0000755�0000000�0000000�00000002653�12252640275�021343� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* Copyright (c) 2009 by contributors: * James Hight (http://labs.zavoo.com/) * Richard R. Masters Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package org.svgweb.nodes { import org.svgweb.core.SVGNode; public class SVGClipPathNode extends SVGNode { public function SVGClipPathNode(svgRoot:SVGSVGNode, xml:XML, original:SVGNode = null):void { super(svgRoot, xml, original); } /** * Override parent function to do nothing **/ override protected function draw():void { topSprite.visible = false; //Do Nothing } /** * Override parent function to do nothing except create a blank _graphicsCommands array **/ override protected function generateGraphicsCommands():void { //Do Nothing this._graphicsCommands = new Array(); } } } �������������������������������������������������������������������������������������debian/contrib/websvg/src/org/svgweb/nodes/SVGLineNode.as�������������������������������������������0000755�0000000�0000000�00000004105�12252640275�020520� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* Copyright (c) 2009 by contributors: * James Hight (http://labs.zavoo.com/) * Richard R. Masters Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package org.svgweb.nodes { import org.svgweb.core.SVGNode; import org.svgweb.utils.SVGUnits; public class SVGLineNode extends SVGNode { public function SVGLineNode(svgRoot:SVGSVGNode, xml:XML, original:SVGNode = null):void { super(svgRoot, xml, original); } /** * Generate graphics commands to draw a line **/ protected override function generateGraphicsCommands():void { this._graphicsCommands = new Array(); var x1String:String = this.getAttribute('x1', '0'); var x1:Number = SVGUnits.parseNumPct(x1String, this.svgParent.getWidth()); var y1String:String = this.getAttribute('y1', '0'); var y1:Number = SVGUnits.parseNumPct(y1String, this.svgParent.getHeight()); var x2String:String = this.getAttribute('x2', '0'); var x2:Number = SVGUnits.parseNumPct(x2String, this.svgParent.getWidth()); var y2String:String = this.getAttribute('y2', '0'); var y2:Number = SVGUnits.parseNumPct(y2String, this.svgParent.getHeight()); //Width/height calculations for gradients this.setXMinMax(x1); this.setYMinMax(x2); this.setXMinMax(y1); this.setYMinMax(y2); this._graphicsCommands.push(['LINE', x1, y1, x2, y2]); } } } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������debian/contrib/websvg/src/org/svgweb/nodes/SVGRadialGradient.as�������������������������������������0000755�0000000�0000000�00000020612�12252640275�021676� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* Copyright (c) 2009 by contributors: * James Hight (http://labs.zavoo.com/) * Richard R. Masters Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package org.svgweb.nodes { import org.svgweb.core.SVGNode; import org.svgweb.core.SVGGradient; import org.svgweb.utils.SVGUnits; import flash.events.Event; import flash.geom.Matrix; import flash.display.GradientType; import flash.display.InterpolationMethod; public class SVGRadialGradient extends SVGGradient { private var focalLen:Number=0; public function SVGRadialGradient(svgRoot:SVGSVGNode, xml:XML, original:SVGNode = null):void { super(svgRoot, xml, original); } override public function beginGradientFill(node:SVGNode):void { var stopData:Object = this.getStopData(node); var spreadMethod:String = this.getSpreadMethod(); var matrix:Matrix = this.getMatrix(node); if (stopData.colors.length > 0) { //Don't fill if there are no stops node.drawSprite.graphics.beginGradientFill(GradientType.RADIAL, stopData.colors, stopData.alphas, stopData.ratios, matrix, spreadMethod, InterpolationMethod.RGB, this.focalLen); } } override public function lineGradientStyle(node:SVGNode, line_alpha:Number = 1):void { var stopData:Object = this.getStopData(node, line_alpha); var spreadMethod:String = this.getSpreadMethod(); var matrix:Matrix = this.getMatrix(node); if (stopData.colors.length > 0) { //Don't fill if there are no stops node.drawSprite.graphics.lineGradientStyle(GradientType.RADIAL, stopData.colors, stopData.alphas, stopData.ratios, matrix, spreadMethod, InterpolationMethod.RGB, this.focalLen); } } public function getMatrix(node:SVGNode):Matrix { var dx:Number; var dy:Number; var angle:Number; var matrGrTr:Matrix = this.parseTransform(this.getAttribute('gradientTransform')); var gradientUnits:String = this.getAttribute('gradientUnits', 'objectBoundingBox', false); if (node is SVGCircleNode) { var xy:Array = SVGCircleNode(node).getCircleXY(); var objectX:Number = xy[0]; var objectY:Number = xy[1]; } else if (node is SVGEllipseNode) { xy = SVGEllipseNode(node).getEllipseXY(); objectX = xy[0]; objectY = xy[1]; } else { var xString:String = node.getAttribute('x', '0', false); var yString:String = node.getAttribute('y', '0', false); objectX = Math.round(SVGUnits.parseNumPct(xString, node.svgParent.getWidth())); objectY = Math.round(SVGUnits.parseNumPct(yString, node.svgParent.getHeight())); } var cxString:String = this.getAttribute('cx', '50%', false); var cyString:String = this.getAttribute('cy', '50%', false); var fxString:String = this.getAttribute('fx', cxString, false); var fyString:String = this.getAttribute('fy', cyString, false); var rString:String = this.getAttribute('r', '50%', false); /* See the comment in SVGLinearGradient.getMatrix() for an explanation of the matrix calculations. */ var matr:Matrix= new Matrix(); if (gradientUnits == 'userSpaceOnUse') { var cx:Number = Math.round(SVGUnits.parseNumPct(cxString, node.svgParent.getWidth())); var cy:Number = Math.round(SVGUnits.parseNumPct(cyString, node.svgParent.getHeight())); var fx:Number = Math.round(SVGUnits.parseNumPct(fxString, node.svgParent.getWidth())); var fy:Number = Math.round(SVGUnits.parseNumPct(fyString, node.svgParent.getHeight())); var r:Number = Math.round(SVGUnits.parseNumPct(rString, node.svgParent.getWidth())); var sx:Number = r*2 / 1638.4; var sy:Number = r*2 / 1638.4; dx = fx - cx; dy = fy - cy; angle = Math.atan2(dy, dx); this.focalLen = Math.sqrt(dx*dx + dy*dy) / r; matr.scale(sx, sy); matr.rotate(angle); matr.translate(cx, cy); if (matrGrTr != null) { matr.concat(matrGrTr); } if (!(node is SVGCircleNode) && !(node is SVGEllipseNode)) { matr.translate(-objectX, -objectY); } return matr; } else { // objectBoundingBox units // Get node height and width in user space var w:Number = node.xMax - node.xMin; var h:Number = node.yMax - node.yMin; // Get the gradient position and area if (cxString.search('%') > -1) { cx = SVGUnits.parseNum(cxString) / 100; } else { cx = SVGUnits.parseNum(cxString); } if (cyString.search('%') > -1) { cy = SVGUnits.parseNum(cyString) / 100; } else { cy = SVGUnits.parseNum(cyString); } if (fxString.search('%') > -1) { fx = SVGUnits.parseNum(fxString) / 100; } else { fx = SVGUnits.parseNum(fxString); } if (fyString.search('%') > -1) { fy = SVGUnits.parseNum(fyString) / 100; } else { fy = SVGUnits.parseNum(fyString); } if (rString.search('%') > -1) { r = SVGUnits.parseNum(rString) / 100; } else { r = SVGUnits.parseNum(rString); } // Scale from flash gradient size (819.2) to bounding box size (.5) matr.scale(.5/819.2, .5/819.2); // Rotate to the angle of the SVG vector in boundingBox units dx = fx - cx; dy = fy - cy; angle = Math.atan2(dy, dx); matr.rotate(angle); this.focalLen = Math.sqrt(dx*dx + dy*dy) / r; // Move to the center of the bounding box matr.translate(.5, .5); // Scale the size of flash vector (.5) to the size of the SVG vector in boundingBox units (r) matr.scale(r/.5, r/.5); // Scale from objectBoundingBox units to user space matr.scale(w, h); // Move to the starting gradient position in user space matr.translate(w*(cx-r), h*(cy-r)); // Now apply the gradientMatrix, if specified // xxx needs testing if (matrGrTr != null) matr.concat(matrGrTr); // A special adjustment is needed for these elements for unknown reasons. // These adjustment were determined empirically. See Issues 349 and 371. if (node is SVGCircleNode || node is SVGEllipseNode) { matr.translate(objectX, objectY); } if (node is SVGPathNode) { matr.translate(node.xMin, node.yMin); } return matr; } } } } ����������������������������������������������������������������������������������������������������������������������debian/contrib/websvg/src/org/svgweb/nodes/SVGMaskNode.as�������������������������������������������0000755�0000000�0000000�00000002145�12252640275�020526� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* Copyright (c) 2009 by contributors: * James Hight (http://labs.zavoo.com/) * Richard R. Masters Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package org.svgweb.nodes { import org.svgweb.core.SVGNode; public class SVGMaskNode extends SVGNode { public function SVGMaskNode(svgRoot:SVGSVGNode, xml:XML, original:SVGNode = null):void { super(svgRoot, xml, original); } override protected function draw():void { //Node should not be visible //Only acts as a data holder topSprite.visible = false; } } } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������debian/contrib/websvg/src/org/svgweb/nodes/SVGEllipseNode.as����������������������������������������0000755�0000000�0000000�00000004735�12252640275�021237� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* Copyright (c) 2009 by contributors: * James Hight (http://labs.zavoo.com/) * Richard R. Masters Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package org.svgweb.nodes { import org.svgweb.core.SVGNode; import org.svgweb.utils.SVGUnits; public class SVGEllipseNode extends SVGNode { public function SVGEllipseNode(svgRoot:SVGSVGNode, xml:XML, original:SVGNode = null):void { super(svgRoot, xml, original); } /** * Generate graphics commands to draw an ellipse **/ override protected function generateGraphicsCommands():void { this._graphicsCommands = new Array(); var cx:Number = this.getAttribute('cx',0); var cy:Number = this.getAttribute('cy',0); var rx:Number = this.getAttribute('rx',0); var ry:Number = this.getAttribute('ry',0); //Width/height calculations for gradients this.setXMinMax(cx - rx); this.setXMinMax(cx + rx); this.setYMinMax(cy - ry); this.setYMinMax(cy + ry); if (rx != 0 && ry != 0) { this._graphicsCommands.push(['ELLIPSE', (cx - rx), (cy - ry), (rx * 2), (ry * 2)]); } } public function getEllipseXY():Array { var cxString:String = this.getAttribute('cx', '0'); var cx:Number = SVGUnits.parseNumPct(cxString, svgParent.getWidth()); var cyString:String = this.getAttribute('cy', '0'); var cy:Number = SVGUnits.parseNumPct(cyString, svgParent.getHeight()); var rxString:String = this.getAttribute('rx','0'); var rx:Number = SVGUnits.parseNumPct(rxString, svgParent.getWidth()); var ryString:String = this.getAttribute('ry','0'); var ry:Number = SVGUnits.parseNumPct(ryString, svgParent.getWidth()); return [ cx - rx, cy - ry ]; } } } �����������������������������������debian/contrib/websvg/src/org/svgweb/nodes/SVGSVGNode.as��������������������������������������������0000755�0000000�0000000�00000054214�12252640275�020276� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* Copyright (c) 2009 by contributors: * James Hight (http://labs.zavoo.com/) * Richard R. Masters * Google Inc. (Brad Neuberg -- http://codinginparadise.org) Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package org.svgweb.nodes { import org.svgweb.core.SVGNode; import org.svgweb.core.SVGViewer; import org.svgweb.events.SVGEvent; import flash.geom.Matrix; import flash.display.Sprite; import flash.events.Event; import flash.utils.getTimer; import org.svgweb.utils.ImageLoader; public class SVGSVGNode extends SVGNode { protected var parentSVGRoot:SVGSVGNode = null; private var _pendingRenderCount:int; protected var firedOnLoad:Boolean = false; protected var loadTime:int = -1; // milliseconds protected var scaleModeParam:String = 'svg_all'; private var _idLookup:Object; private var _guidLookup:Object; protected var _referersById:Object; protected var _fonts:Object; protected var fontListeners:Array = new Array(); public var title:String; public var viewer:SVGViewer; public var currentScale:Number = 1; public var currentTranslate:Object = {x: 0, y: 0}; public var imageCache:Object = new Object(); private var lastFrameTime:uint = getTimer(); private var totalFrameTime:uint = 0; private var frameCount:uint = 0; /** If this file was loaded from a URL, such as samples/scimitar.svg, then objectURL points to the relative path from which it was fetched, such as 'samples/' */ public var objectURL:String = ''; /** Same as objectURL, but the relative path from the containing HTML page. */ public var pageURL:String = ''; public function SVGSVGNode(svgRoot:SVGSVGNode = null, xml:XML = null, original:SVGNode = null, viewer:SVGViewer = null, objectURL:String = '', pageURL:String = ''):void { this.viewer = viewer; this.objectURL = objectURL; this.pageURL = pageURL; if (svgRoot) { this.parentSVGRoot = svgRoot; } super(this, xml, original); } public override function set xml(value:XML):void { default xml namespace = svg; this._idLookup = new Object(); this._guidLookup = new Object(); this._referersById = new Object(); this._fonts = new Object(); super.xml = value; // If this is the top SVG element, then start the render tracking process. if (this.parentSVGRoot == null) { if (this.xml) { if (this.xml.@id) { this._idLookup[this.xml.@id] = this; } this._guidLookup[this.xml.@__guid] = this; } this._pendingRenderCount = 1; } } protected override function onAddedToStage(event:Event):void { super.onAddedToStage(event); if (!this.parentSVGRoot) { topSprite.addEventListener(Event.ENTER_FRAME, updateAnimations); } } protected override function onRemovedFromStage(event:Event):void { if (!this.parentSVGRoot) { topSprite.removeEventListener(Event.ENTER_FRAME, updateAnimations); } super.onRemovedFromStage(event); } public function getDocTime():Number { if (this.parentSVGRoot) { return this.parentSVGRoot.getDocTime(); } else { return (getTimer() - this.loadTime) / 1000.0; } } protected function updateAnimations(event:Event):void { /* Frame Counter if (this.lastFrameTime > 0) { this.totalFrameTime += (getTimer() - this.lastFrameTime); this.frameCount++; if (this.frameCount % 10 == 0) { this.dbg("last frame time: " + (getTimer() - this.lastFrameTime) + "ms, avg time: " + (this.totalFrameTime/this.frameCount) + "ms avg rate: " + (1000.0/(this.totalFrameTime/this.frameCount)) + " frames/sec"); this.totalFrameTime = 0; this.frameCount = 0; } } this.lastFrameTime=getTimer(); */ // Nothing to do while the document is loading if (this.loadTime == -1) { return; } var svgEvent:SVGEvent = new SVGEvent(SVGEvent._SVGDocTimeUpdate); svgEvent.setDocTime( (getTimer() - this.loadTime) / 1000.0 ); this.dispatchEvent(svgEvent); } public function seekToDocTime(docTime:Number):void { if (this.parentSVGRoot) { this.parentSVGRoot.seekToDocTime(docTime); } else { this.loadTime = getTimer() - docTime*1000.0; var svgEvent:SVGEvent = new SVGEvent(SVGEvent._SVGDocTimeSeek); svgEvent.setDocTime(docTime); this.dispatchEvent(svgEvent); } } override public function getStyle(name:String, defaultValue:* = null, inherit:Boolean = false):* { var value:String = super.getStyle(name, null, false); if (value) { return value; } if ((name == 'opacity') || (name == 'fill-opacity') || (name == 'stroke-opacity') || (name == 'stroke-width')) { return '1'; } if (name == 'fill') { return 'black'; } if (name == 'stroke') { return 'none'; } // Provide defaults for the various rendering hints. if (name == 'shape-rendering' || name == 'color-rendering' || name == 'text-rendering' || name == 'image-rendering') { return 'auto'; } return defaultValue; } override public function getAttribute(name:String, defaultValue:* = null, inherit:Boolean = true, applyAnimations:Boolean = true, useStyle:Boolean = false):* { var value:String = this._getAttribute(name, defaultValue, inherit, applyAnimations, useStyle); if (value !== null) { return value; } if (ATTRIBUTES_NOT_INHERITED.indexOf(name) != -1) { if (defaultValue == null) { if (name == 'opacity') { return '1'; } // default fall through } return defaultValue; } if (inherit && (this.svgParent != null)) { return this.svgParent.getAttribute(name, defaultValue, inherit, applyAnimations, useStyle); } if ((name == 'opacity') || (name == 'fill-opacity') || (name == 'stroke-opacity') || (name == 'stroke-width')) { return '1'; } if (name == 'fill') { return 'black'; } if (name == 'stroke') { return 'none'; } if (name == 'visibility') { return 'visible'; } if (name == 'display') { return 'inline'; } return defaultValue; } override public function handleAttrChange(name:String, value:String, attrNamespace:String = null):void { super.handleAttrChange(name, value, attrNamespace); if (name == 'x' || name == 'y') { this.applyDefaultMask(); } } override protected function loadAttribute(name:String, field:String = null, applyStyle:Boolean = false):void { // Issue 226: Topmost tag ignores x and y if (topSprite.parent is SVGViewer && (name == 'x' || name == 'y') ) { return; } else { super.loadAttribute(name, field, applyStyle); } } // The following functions track the number of elements that have a redraw // pending. When the count reaches zero, the onLoad handler can be called. // // The overall count starts at one to account for the top SVG element. This is done // in the set xml handler above. // Other elements increment the count when they are added. This is done // by an override of addChild in SVGNode. // Every element decrements the count when rendering is complete. This is done // by drawNode in SVGNode. public function renderPending():void { if (this.parentSVGRoot) { this.parentSVGRoot.renderPending(); } else { this._pendingRenderCount++; } } public function renderFinished():void { if (this.parentSVGRoot) { this.parentSVGRoot.renderFinished(); } else { this._pendingRenderCount--; if (this._pendingRenderCount == 0) { if (!this.firedOnLoad) { this.firedOnLoad = true; this.handleOnLoad(); } } if (this._pendingRenderCount < 0 && !this.firedOnLoad) { this.dbg("error: pendingRenderCount count negative: " + this._pendingRenderCount); } } } public function registerNode(node:SVGNode):void { if (this.parentSVGRoot) { this.parentSVGRoot.registerNode(node); } else { registerID(node); registerGUID(node); } } public function isLoaded():Boolean { if (parentSVGRoot) { return parentSVGRoot.isLoaded(); } else { return firedOnLoad; } } override public function addEventListener (type:String, listener:Function, useCapture:Boolean = false, priority:int = 0, useWeakReference:Boolean = false):void { if (parentSVGRoot && (type == SVGEvent.SVGLoad || type == SVGEvent._SVGDocTimeUpdate || type == SVGEvent._SVGDocTimeSeek)) { parentSVGRoot.addEventListener(type, listener, useCapture, priority, useWeakReference); } else { super.addEventListener(type, listener, useCapture, priority, useWeakReference); } } override public function removeEventListener (type:String, listener:Function, useCapture:Boolean = false):void { if (parentSVGRoot && (type == SVGEvent.SVGLoad || type == SVGEvent._SVGDocTimeUpdate || type == SVGEvent._SVGDocTimeSeek)) { parentSVGRoot.removeEventListener(type, listener, useCapture); } else { super.removeEventListener(type, listener, useCapture); } } public function unregisterNode(node:SVGNode):void { if (this.parentSVGRoot) { this.parentSVGRoot.unregisterNode(node); } else { unregisterID(node); unregisterGUID(node); } } public function registerID(node:SVGNode):void { if (parentSVGRoot) { parentSVGRoot.registerID(node); } else if (node.id) { _idLookup[node.id] = node; } } public function unregisterID(node:SVGNode):void { if (parentSVGRoot) { parentSVGRoot.unregisterID(node); } else if (node.id) { delete _idLookup[node.id]; } } public function registerGUID(node:SVGNode):void { if (parentSVGRoot) { parentSVGRoot.registerGUID(node); } else { _guidLookup[node.guid] = node; } } public function unregisterGUID(node:SVGNode):void { if (parentSVGRoot) { parentSVGRoot.unregisterGUID(node); } else { delete _guidLookup[node.guid]; } } override protected function registerSelf():void { super.registerSelf(); if (parentSVGRoot) { parentSVGRoot.registerNode(this); } } override protected function unregisterSelf():void { super.unregisterSelf(); if (parentSVGRoot) { parentSVGRoot.unregisterNode(this); parentSVGRoot = null; } } /** * * If this object depends on another object, then we can * register our interest in being invalidated when the * dependency object is redrawn. * * The node references referenceId. * An array of nodes that reference the referenceId is created. * **/ public function addReference(node:SVGNode, referencedId:String):void { if (this.parentSVGRoot) { this.parentSVGRoot.addReference(node, referencedId); } else { if (!this._referersById[referencedId]) { this._referersById[referencedId]= new Array(); } if (this._referersById[referencedId].lastIndexOf(node) == -1) { this._referersById[referencedId].push(node); } } } public function deleteReference(node:SVGNode, referencedId:String):void { if (this.parentSVGRoot) { this.parentSVGRoot.deleteReference(node, referencedId); } else { if (this._referersById[referencedId]) { if (this._referersById[referencedId].lastIndexOf(node) != -1) { delete this._referersById[referencedId][this._referersById[referencedId].lastIndexOf(node)]; } } } } public function invalidateReferers(id:String):void { if (this.parentSVGRoot) { this.parentSVGRoot.invalidateReferers(id); } else { //this.svgRoot.debug("Invalidating referers to " + id); if (this._referersById[id]) { var referers:Array = this._referersById[id]; for (var refererIdx:String in referers) { referers[refererIdx].invalidateDisplay(); } } } } public function getNode(name:String):SVGNode { if (this.parentSVGRoot) { return this.parentSVGRoot.getNode(name); } else if (_idLookup.hasOwnProperty(name)) { return _idLookup[name]; } return null; } public function getNodeByGUID(guid:String):SVGNode { if (parentSVGRoot) { return parentSVGRoot.getNodeByGUID(guid); } else if (_guidLookup.hasOwnProperty(guid)) { return _guidLookup[guid]; } return null; } /** * * Fonts * **/ public function registerFont(font:SVGFontNode):void { if (this.parentSVGRoot) { this.parentSVGRoot.registerFont(font); } else { _fonts[font.getFontFaceName()] = font; for each(var node:SVGNode in fontListeners) { node.onRegisterFont(font.getFontFaceName()); } } } public function unregisterFont(font:SVGFontNode):void { if (this.parentSVGRoot) { this.parentSVGRoot.unregisterFont(font); } else { delete _fonts[font.getFontFaceName()]; } } public function getFont(fontFace:String):SVGFontNode { if (this.parentSVGRoot) { return this.parentSVGRoot.getFont(fontFace); } else { return _fonts[fontFace]; } } public function registerFontListener(node:SVGNode):void { if (this.parentSVGRoot) { this.parentSVGRoot.registerFontListener(node); } else { fontListeners.push(node); } } public function unregisterFontListener(node:SVGNode):void { if (this.parentSVGRoot) { this.parentSVGRoot.unregisterFontListener(node); } else { if (fontListeners.lastIndexOf(node) != -1) { delete fontListeners[fontListeners.lastIndexOf(node)]; } } } public function handleScript(script:String):void { if (this.parentSVGRoot) { this.parentSVGRoot.handleScript(script); } else if (topSprite.parent is SVGViewer) { SVGViewer(topSprite.parent).handleScript(script); } } public function loadImage(imageHref:String, imageNode:SVGImageNode):void { if (this.parentSVGRoot) { this.parentSVGRoot.loadImage(imageHref, imageNode); } else { if (!this.imageCache[imageHref]) { this.imageCache[imageHref] = new ImageLoader(imageHref); } this.imageCache[imageHref].addListener(imageNode); } } public function handleOnLoad():void { if (this.parentSVGRoot) { this.parentSVGRoot.handleOnLoad(); } else { this.loadTime = getTimer(); var svgEvent:SVGEvent = new SVGEvent(SVGEvent.SVGLoad); this.dispatchEvent(svgEvent); } } public function addActionListener(eventType:String, target:Sprite):void { if (this.parentSVGRoot) { this.parentSVGRoot.addActionListener(eventType, target); } else if (topSprite.parent is SVGViewer) { SVGViewer(topSprite.parent).addActionListener(eventType, target); } } public function removeActionListener(eventType:String, target:Sprite):void { if (this.parentSVGRoot) { this.parentSVGRoot.removeActionListener(eventType, target); } else if (topSprite.parent is SVGViewer) { SVGViewer(topSprite.parent).removeActionListener(eventType, target); } } public function zoomAndPan():void { var m:Matrix; // do we have a cached viewBox matrix that we've already applied? if (this._lastVBMatrix) { m = this._lastVBMatrix.clone(); } else { m = new Matrix(); } m.translate(this.currentTranslate.x, this.currentTranslate.y); m.scale(this.currentScale, this.currentScale); viewBoxSprite.transform.matrix = m; } public function debug(debugString:String):void { if (this.parentSVGRoot) { this.parentSVGRoot.debug(debugString); } else if (topSprite.parent is SVGViewer) { SVGViewer(topSprite.parent).debug(debugString); } } public function error(message:String):void { if (this.parentSVGRoot) { this.parentSVGRoot.error(message); } else if (topSprite.parent is SVGViewer) { SVGViewer(topSprite.parent).error(message); } } /** Functions for profiling. */ override public function start(subject:String, subjectStarted:String = null):void { if (this.parentSVGRoot) { this.parentSVGRoot.start(subject, subjectStarted); } else if (topSprite.parent is SVGViewer) { SVGViewer(topSprite.parent).start(subject, subjectStarted); } } /** Functions for profiling. */ override public function end(subject:String, subjectStarted:String = null):void { if (this.parentSVGRoot) { this.parentSVGRoot.end(subject, subjectStarted); } else if (topSprite.parent is SVGViewer) { SVGViewer(topSprite.parent).end(subject, subjectStarted); } } /** Functions for profiling. */ override public function increment(subject:String, amount:int):void { if (this.parentSVGRoot) { this.parentSVGRoot.increment(subject, amount); } else if (topSprite.parent is SVGViewer) { SVGViewer(topSprite.parent).increment(subject, amount); } } } } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������debian/contrib/websvg/src/org/svgweb/nodes/SVGANode.as����������������������������������������������0000755�0000000�0000000�00000004174�12252640275�020017� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* Copyright (c) 2009 by contributors: * James Hight (http://labs.zavoo.com/) * Richard R. Masters Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package org.svgweb.nodes { import org.svgweb.core.SVGNode; import org.svgweb.core.SVGTimedNode; import flash.events.MouseEvent; import flash.net.URLRequest; public class SVGANode extends SVGNode { public var url:String; public var target:String; public function SVGANode(svgRoot:SVGSVGNode, xml:XML = null, original:SVGNode = null):void { super(svgRoot, xml, original); drawSprite.buttonMode = true; } override protected function generateGraphicsCommands():void { url = this._xml.@xlink::href; target = this._xml.@target; if (!target) { target = '_self'; } } override protected function attachEventListeners():void { super.attachEventListeners(); drawSprite.addEventListener(MouseEvent.CLICK, onMouseClick); } private function onMouseClick(event:MouseEvent):void { if (url.match(/^#/)) { var timedNodeId:String = url.substr(1); var node:SVGNode = this.svgRoot.getNode(timedNodeId); if (node is SVGTimedNode) { this.svgRoot.seekToDocTime(SVGTimedNode(node).getHyperlinkDocTime()); } } else { var urlRequest:URLRequest = new URLRequest(url); flash.net.navigateToURL(urlRequest, target); } } } } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������debian/contrib/websvg/src/org/svgweb/nodes/SVGAnimateTransformNode.as�������������������������������0000755�0000000�0000000�00000026206�12252640275�023111� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* Copyright (c) 2009 by contributors: * Richard R. Masters Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package org.svgweb.nodes { import org.svgweb.core.SVGNode; import org.svgweb.utils.SVGUnits; import flash.geom.Matrix; public class SVGAnimateTransformNode extends SVGAnimateNode { protected var typeParameter:String; protected var animMatrix:Matrix; public function SVGAnimateTransformNode(svgRoot:SVGSVGNode, xml:XML, original:SVGNode = null):void { super(svgRoot, xml, original); } override public function getAnimValue():String { return null; } public function getAnimTransform():Matrix { var parts:Array; var fromX:String; var fromY:String; var fromXVal:Number; var fromYVal:Number; var transformMatrix:Matrix; var toX:String; var toY:String; var toXVal:Number; var toYVal:Number; var animX:Number; var animY:Number; if (attributeName != "transform") { return null; } if (typeParameter == null) { return null; } if (!isEffective()) return(null); if (frozen) return animMatrix; frozen = !this.active; var repeatFraction:Number = getRepeatIntervalFraction(lastDocTime); var fromString:String; var toString:String; var keyTimeIndex:Number = 0; var keyTimeFraction:Number = repeatFraction; if (valuesParameter != null) { keyTimeIndex = getKeyTimeIndex(repeatFraction); keyTimeFraction = getKeyTimeFraction(repeatFraction); fromString = getKeyTimeValue(keyTimeIndex); toString = getKeyTimeValue(keyTimeIndex + 1); } else { fromString = fromParameter; toString = toParameter; } var keyTimeSpline:String = getKeyTimeSpline(keyTimeIndex); fromString = fromString.replace(/,/sg," "); //Replace commas with spaces toString = toString.replace(/,/sg," "); //Replace commas with spaces if (typeParameter == "translate") { // Parse From parts = SVGUnits.trim(fromString).split(/\s+/); fromX = parts[0]; fromY = "0"; if (parts.length == 2) { fromY = parts[1]; } fromXVal = SVGUnits.parseNum(fromX); fromYVal = SVGUnits.parseNum(fromY); // Parse To parts = SVGUnits.trim(toString).split(/\s+/); toX = parts[0]; toY = "0"; if (parts.length == 2) { toY = parts[1]; } toXVal = SVGUnits.parseNum(toX); toYVal = SVGUnits.parseNum(toY); animX = interpolate(fromXVal, toXVal, keyTimeFraction, keyTimeSpline); animY = interpolate(fromYVal, toYVal, keyTimeFraction, keyTimeSpline); transformMatrix = new Matrix(); transformMatrix.translate(animX, animY); animMatrix = transformMatrix; return transformMatrix; // XXX create a matrix directly //return parseTransform("translate("+animX+","+animY+")"); } if (typeParameter == "scale") { // Parse From parts = SVGUnits.trim(fromString).split(/\s+/); fromX = parts[0]; fromY = parts[0]; if (parts.length == 2) { fromY = parts[1]; } fromXVal = SVGUnits.parseNum(fromX); fromYVal = SVGUnits.parseNum(fromY); // Parse To parts = SVGUnits.trim(toString).split(/\s+/); toX = parts[0]; toY = parts[0]; if (parts.length == 2) { toY = parts[1]; } toXVal = SVGUnits.parseNum(toX); toYVal = SVGUnits.parseNum(toY); animX = interpolate(fromXVal, toXVal, keyTimeFraction, keyTimeSpline); animY = interpolate(fromYVal, toYVal, keyTimeFraction, keyTimeSpline); transformMatrix = new Matrix(); transformMatrix.scale(animX, animY); animMatrix = transformMatrix; return transformMatrix; } if (typeParameter == "rotate") { var toCX:String = "0"; var toCY:String = "0"; // Parse From parts = SVGUnits.trim(fromString).split(/\s+/); var fromAngleString:String = parts[0]; var fromCXString:String = "0"; var fromCYString:String = "0"; if (parts.length >= 2) { fromCXString = parts[1]; } if (parts.length >= 3) { fromCYString = parts[2]; } var fromAngleVal:Number = SVGUnits.parseNum(fromAngleString); var fromCXVal:Number = SVGUnits.parseNum(fromCXString); var fromCYVal:Number = SVGUnits.parseNum(fromCYString); // Parse To parts = SVGUnits.trim(toString).split(/\s+/); var toAngleString:String = parts[0]; var toCXString:String = "0"; var toCYString:String = "0"; if (parts.length >= 2) { toCXString = parts[1]; } if (parts.length >= 3) { toCYString = parts[2]; } var toAngleVal:Number = SVGUnits.parseNum(toAngleString); var toCXVal:Number = SVGUnits.parseNum(toCXString); var toCYVal:Number = SVGUnits.parseNum(toCYString); var animAngle:Number = interpolate(fromAngleVal, toAngleVal, keyTimeFraction, keyTimeSpline); var animCX:Number = interpolate(fromCXVal, toCXVal, keyTimeFraction, keyTimeSpline); var animCY:Number = interpolate(fromCYVal, toCYVal, keyTimeFraction, keyTimeSpline); transformMatrix = new Matrix(); transformMatrix.translate(-animCX, -animCY); transformMatrix.rotate(animAngle * Math.PI / 180.0); transformMatrix.translate(animCX, animCY); animMatrix = transformMatrix; return transformMatrix; } // XXX not implemented if (typeParameter == "skewX") { animMatrix.identity(); return new Matrix(); } // XXX not implemented if (typeParameter == "skewY") { animMatrix.identity(); return new Matrix(); } return null; } public function getTransformType():String { return typeParameter; } override protected function parseParameters():void { this.parseTypeParameter(); super.parseParameters(); } protected function parseTypeParameter():void { typeParameter = this.getAttribute('type', null); } override protected function parseFromParameter():void { fromParameter = this.getAttribute('from', null); if (fromParameter == null) { if (attributeName != null) { if (typeParameter == "translate") { fromParameter = "0 0" } if (typeParameter == "scale") { fromParameter = "1 1" } if (typeParameter == "rotate") { fromParameter = "0" } if (typeParameter == "skewX") { fromParameter = "0" } if (typeParameter == "skewY") { fromParameter = "0" } } } } static protected function getParameterValues(param:String):Array { var parts:Array; var values:Array = new Array(); parts = SVGUnits.trim(param).split(/\s+/); for each (var part:String in parts) { values.push(SVGUnits.parseNum(part)); } return(values); } override protected function parseByParameter():void { if (toParameter != null) return; // ignore by if there is a to if (valuesParameter != null) return; // ignore if valuesParameter byParameter = this.getAttribute('by', null); if (byParameter == null) return; // XXX error checks for invalid parameters var fromValues:Array = getParameterValues(fromParameter); var byValues:Array = getParameterValues(byParameter); // convert by into a to value if ((typeParameter == "translate") || (typeParameter == "scale")) { if (fromValues.length == 1) fromValues.push(fromValues[0]); if (byValues.length == 1) byValues.push(byValues[0]); toParameter = String(fromValues[0] + byValues[0]) + " " + String(fromValues[1] + byValues[1]); return; } if (typeParameter == "rotate") { byValues[0] += fromValues[0]; //angle // copy from if by is missing for (var i:uint = byValues.length; i < fromValues.length; i++) { byValues.push(fromValues[i]); } toParameter = String(byValues[0]); if (byValues.length == 3) toParameter += " " + String(byValues[1]) + " " + String(byValues[2]); return; } if ((typeParameter == "skewX") || (typeParameter == "skewY")) { toParameter = String(fromValues[0] + byValues[0]); return; } } } } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������debian/contrib/websvg/src/org/svgweb/nodes/SVGImageNode.as������������������������������������������0000755�0000000�0000000�00000030454�12252640275�020661� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* Copyright (c) 2009 by contributors: * James Hight (http://labs.zavoo.com/) * Richard R. Masters Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package org.svgweb.nodes { import org.svgweb.utils.Base64; import org.svgweb.core.SVGNode; import org.svgweb.utils.SVGUnits; import flash.display.Bitmap; import flash.display.BitmapData; import flash.display.DisplayObject; import flash.display.Loader; import flash.display.LoaderInfo; import flash.events.Event; import flash.geom.Matrix; import flash.geom.Rectangle; import flash.geom.Point; import flash.utils.ByteArray; public class SVGImageNode extends SVGNode { protected var bitmap:Bitmap; protected var bitmapData:BitmapData; protected var clipRect:Rectangle; public var imageWidth:Number = 0; public var imageHeight:Number = 0; public function SVGImageNode(svgRoot:SVGSVGNode, xml:XML, original:SVGNode = null):void { super(svgRoot, xml, original); } override protected function drawNode(event:Event=null):void { if ( (topSprite.parent != null) && (this._invalidDisplay) ) { this._invalidDisplay = false; topSprite.removeEventListener(Event.ENTER_FRAME, drawNode); if (!this._parsedChildren) { this.parseChildren(); this._parsedChildren = true; } this.setAttributes(); this.transformNode(); if (this.bitmap == null) { this.loadImage(); } else { finishDrawNode(); } } } private function finishDrawNode():void { this.applyClipPathMask(); this.applyViewBox(); this.applyDefaultMask(); this._invalidDisplay = false; if (getPatternAncestor() != null) { this.svgRoot.invalidateReferers(getPatternAncestor().id); } if (!this._initialRenderDone && topSprite.parent) { this.attachEventListeners(); this._initialRenderDone = true; this.svgRoot.renderFinished(); } } protected function loadImage():void { var imageHref:String = this.getAttribute('href'); if (!imageHref) { return; } // For data: href, decode the base 64 image and load it if (imageHref.match(/^data:[a-z\/]*;base64,/)) { var base64String:String = imageHref.replace(/^data:[a-z\/]*;base64,/, ''); var byteArray:ByteArray = Base64.decode(base64String); loadBytes(byteArray); return; } var xmlBase:String = this.getAttribute('base'); if (xmlBase && xmlBase != '') { imageHref = xmlBase + imageHref; } // must have width and height to create bitmap if ( (this.getAttribute('width') != null) && (this.getAttribute('height') != null) ) { this.svgRoot.loadImage(imageHref, this); } } /** * Load image byte array * Used to support data: href. **/ private function loadBytes(byteArray:ByteArray):void { var loader:Loader = new Loader(); loader.contentLoaderInfo.addEventListener( Event.COMPLETE, onBytesLoaded ); loader.loadBytes( byteArray ); } /** * Display image bitmap once bytes have loaded * Used to support data: href. **/ private function onBytesLoaded(event:Event):void { var content:DisplayObject = LoaderInfo( event.target ).content; bitmapData = new BitmapData( content.width, content.height, true, 0x00000000 ); bitmapData.draw( content ); this.onImageLoaded(bitmapData); } public function onImageLoaded(bitmapData:BitmapData):void { this.imageWidth = bitmapData.width; this.imageHeight = bitmapData.height; clipRect = this.getClipRect(); if (clipRect) { this.bitmapData = new BitmapData( clipRect.width, clipRect.height, false, 0x00000000 ); this.bitmapData.copyPixels(bitmapData, clipRect, new Point(0,0)); bitmap = new Bitmap( this.bitmapData ); bitmap.x = clipRect.left; bitmap.y = clipRect.top; } else { bitmap = new Bitmap( bitmapData ); } this.bitmapData = null; bitmap.opaqueBackground = null; bitmap.smoothing = true; if (this.getStyleOrAttr('display', null, false) == 'none') { this.topSprite.visible = false; } else { this.topSprite.visible = true; } drawSprite.addChild(bitmap); this.finishDrawNode(); } // This is used for an optimization when there is a rectangular clipping area. // The rectangle is relative to the image. protected function getClipRect():Rectangle { var attr:String; var match:Array; var node:SVGNode; attr = this.getStyleOrAttr('mask'); if (!attr) { attr = this.getAttribute('clip-path'); } if (attr) { match = attr.match(/url\(\s*#(.*?)\s*\)/si); if (match.length == 2) { attr = match[1]; node = this.svgRoot.getNode(attr); // One simple clipping shape? if (node && node.svgChildren.length == 1) { // Is it a rectangle? if (node.svgChildren[0] is SVGRectNode) { var clip:SVGRectNode=SVGRectNode(node.svgChildren[0]); // Subtract the current position from the clip to get the // image position return new Rectangle(SVGUnits.parseNumPct(clip.getStyleOrAttr('x'), this.getWidth()) - SVGUnits.parseNumPct(this.getStyleOrAttr('x'), this.getWidth()), SVGUnits.parseNumPct(clip.getStyleOrAttr('y'), this.getHeight()) - SVGUnits.parseNumPct(this.getStyleOrAttr('y'), this.getHeight()), SVGUnits.parseNumPct(clip.getStyleOrAttr('width'), this.getWidth()), SVGUnits.parseNumPct(clip.getStyleOrAttr('height'), this.getHeight())); } } } } return null; } public function onImageError():void { if (!this._initialRenderDone && topSprite.parent) { this.attachEventListeners(); this._initialRenderDone = true; this.svgRoot.renderFinished(); } } override public function handleAttrChange(name:String, value:String, attrNamespace:String = null):void { super.handleAttrChange(name, value, attrNamespace); if (name == 'href') { if (this.bitmap) { this.drawSprite.removeChild(this.bitmap); this.bitmap = null; } } if (name == 'x' || name == 'y') { this.applyDefaultMask(); } if (name == 'display' && value == 'none') { this.topSprite.visible = false; } else { this.topSprite.visible = true; } } override public function applyViewBox():void { // applyViewBox should not happen until the image is loaded. if (this.bitmap == null) { return; } var canvasWidth:Number = this.getWidth(); var canvasHeight:Number = this.getHeight(); if ( (canvasWidth > 0) && (canvasHeight > 0)) { var cropWidth:Number; var cropHeight:Number; var oldAspectRes:Number = this.imageWidth / this.imageHeight; var newAspectRes:Number = canvasWidth / canvasHeight; var preserveAspectRatio:String = this.getAttribute('preserveAspectRatio', 'xMidYMid meet'); var alignMode:String = preserveAspectRatio.substr(0,8); var meetOrSlice:String = 'meet'; if (preserveAspectRatio.indexOf('slice') != -1) { meetOrSlice = 'slice'; } if (alignMode == 'none') { // stretch to fit viewport width and height cropWidth = canvasWidth; cropHeight = canvasHeight; } else { if (meetOrSlice == 'meet') { // shrink to fit inside viewport if (newAspectRes > oldAspectRes) { cropWidth = canvasHeight * oldAspectRes; cropHeight = canvasHeight; } else { cropWidth = canvasWidth; cropHeight = canvasWidth / oldAspectRes; } } else { // meetOrSlice == 'slice' // Expand to cover viewport. if (newAspectRes > oldAspectRes) { cropWidth = canvasWidth; cropHeight = canvasWidth / oldAspectRes; } else { cropWidth = canvasHeight * oldAspectRes; cropHeight = canvasHeight; } } } this.bitmap.scaleX = cropWidth / this.imageWidth; this.bitmap.scaleY = cropHeight / this.imageHeight; var borderX:Number; var borderY:Number; var translateX:Number; var translateY:Number; if (alignMode != 'none') { translateX=0; translateY=0; var xAlignMode:String = alignMode.substr(0,4); switch (xAlignMode) { case 'xMin': break; case 'xMax': translateX = canvasWidth - cropWidth; break; case 'xMid': default: borderX = canvasWidth - cropWidth; translateX = borderX / 2.0; break; } var yAlignMode:String = alignMode.substr(4,4); switch (yAlignMode) { case 'YMin': break; case 'YMax': translateY = canvasHeight - cropHeight; break; case 'YMid': default: borderY = canvasHeight - cropHeight; translateY = borderY / 2.0; break; } this.bitmap.x = translateX; this.bitmap.y = translateY; } if (clipRect) { this.bitmap.x += clipRect.left; this.bitmap.y += clipRect.top; } } } } } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������debian/contrib/websvg/src/org/svgweb/nodes/SVGDescNode.as�������������������������������������������0000644�0000000�0000000�00000004106�12252640275�020505� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* Copyright (c) 2008 James Hight Copyright (c) 2008 Richard R. Masters Copyright (c) 2009 Google Inc. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ package org.svgweb.nodes { import org.svgweb.core.SVGNode; import org.svgweb.nodes.SVGSVGNode; public class SVGDescNode extends SVGNode { /** * Hold node's text if any is present. **/ protected var _text:String = null; public function SVGDescNode(svgRoot:SVGSVGNode, xml:XML):void { super(svgRoot, xml); } override public function hasText():Boolean { return true; } override public function setText(newValue:String):void { this._text = newValue; } override public function getText():String { return this._text; } override protected function draw():void { //Do Nothing } override protected function generateGraphicsCommands():void { this._graphicsCommands = new Array(); //Do Nothing } } } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������debian/contrib/websvg/src/org/svgweb/nodes/SVGCircleNode.as�����������������������������������������0000755�0000000�0000000�00000004665�12252640275�021045� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* Copyright (c) 2009 by contributors: * James Hight (http://labs.zavoo.com/) * Richard R. Masters Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package org.svgweb.nodes { import org.svgweb.core.SVGNode; import org.svgweb.utils.SVGUnits; public class SVGCircleNode extends SVGNode { public function SVGCircleNode(svgRoot:SVGSVGNode, xml:XML, original:SVGNode = null):void { super(svgRoot, xml, original); } /** * Generate graphics commands to draw a circle **/ protected override function generateGraphicsCommands():void { this._graphicsCommands = new Array(); var cxString:String = this.getAttribute('cx', '0'); var cx:Number = SVGUnits.parseNumPct(cxString, svgParent.getWidth()); var cyString:String = this.getAttribute('cy', '0'); var cy:Number = SVGUnits.parseNumPct(cyString, svgParent.getHeight()); var rString:String = this.getAttribute('r','0'); var r:Number = SVGUnits.parseNumPct(rString, svgParent.getWidth()); //Width/height calculations for gradients this.setXMinMax(cx - r); this.setXMinMax(cx + r); this.setYMinMax(cy - r); this.setYMinMax(cy + r); if (r != 0) { this._graphicsCommands.push(['CIRCLE', cx, cy, r]); } } public function getCircleXY():Array { var cxString:String = this.getAttribute('cx', '0'); var cx:Number = SVGUnits.parseNumPct(cxString, svgParent.getWidth()); var cyString:String = this.getAttribute('cy', '0'); var cy:Number = SVGUnits.parseNumPct(cyString, svgParent.getHeight()); var rString:String = this.getAttribute('r','0'); var r:Number = SVGUnits.parseNumPct(rString, svgParent.getWidth()); return [ cx - r, cy - r ]; } } } ���������������������������������������������������������������������������debian/contrib/websvg/src/org/svgweb/nodes/SVGLinearGradient.as�������������������������������������0000755�0000000�0000000�00000027560�12252640275�021725� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* Copyright (c) 2009 by contributors: * James Hight (http://labs.zavoo.com/) * Richard R. Masters * Google Inc. (Brad Neuberg -- http://codinginparadise.org) Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package org.svgweb.nodes { import org.svgweb.core.SVGNode; import org.svgweb.core.SVGGradient; import org.svgweb.utils.SVGUnits; import flash.geom.Matrix; import flash.display.GradientType; import flash.display.InterpolationMethod; public class SVGLinearGradient extends SVGGradient { public function SVGLinearGradient(svgRoot:SVGSVGNode, xml:XML, original:SVGNode = null):void { super(svgRoot, xml, original); } override public function beginGradientFill(node:SVGNode):void { var w:Number = node.xMax - node.xMin; var h:Number = node.yMax - node.yMin; if ((w == 0) || (h == 0)) { //We don't fill an object with area == 0 return; } var stopData:Object = this.getStopData(node); var spreadMethod:String = this.getSpreadMethod(); var matrix:Matrix = this.getMatrix(node); if (stopData.colors.length == 1) { //Solid color fill node.drawSprite.graphics.beginFill(stopData.colors[stopData.colors.length-1], stopData.alphas[stopData.colors.length-1]); } else if (stopData.colors.length > 0) { //Don't fill if there are no stops node.drawSprite.graphics.beginGradientFill(GradientType.LINEAR, stopData.colors, stopData.alphas, stopData.ratios, matrix, spreadMethod, InterpolationMethod.RGB); } } override public function lineGradientStyle(node:SVGNode, line_alpha:Number = 1):void { var stopData:Object = this.getStopData(node, line_alpha); var spreadMethod:String = this.getSpreadMethod(); var matrix:Matrix = this.getMatrix(node); if (stopData.colors.length == 1) { //Solid color fill node.drawSprite.graphics.lineStyle(node.getStyleOrAttr('stroke-width'), stopData.colors[stopData.colors.length-1], stopData.alphas[stopData.colors.length-1]); } else if (stopData.colors.length > 0) { //Don't fill if there are no stops node.drawSprite.graphics.lineGradientStyle(GradientType.LINEAR, stopData.colors, stopData.alphas, stopData.ratios, matrix, spreadMethod, InterpolationMethod.RGB); } } protected function getMatrix(node:SVGNode):Matrix { var dx:Number; var dy:Number; var angle:Number; var matrGrTr:Matrix = this.parseTransform(this.getAttribute('gradientTransform')); var gradientUnits:String = this.getAttribute('gradientUnits', 'objectBoundingBox', false); if (node is SVGCircleNode) { var xy:Array = SVGCircleNode(node).getCircleXY(); var xString:Number = xy[0].toString(); var yString:Number = xy[1].toString(); } else { xString = node.getAttribute('x', '0', false); yString = node.getAttribute('y', '0', false); } var x1String:String = this.getAttribute('x1', '0%', false); var x2String:String = this.getAttribute('x2', '100%', false); var y1String:String = this.getAttribute('y1', '0%', false); var y2String:String = this.getAttribute('y2', '0%', false); var objectX:Number = Math.round(SVGUnits.parseNumPct(xString, node.svgParent.getWidth())); var objectY:Number = Math.round(SVGUnits.parseNumPct(yString, node.svgParent.getHeight())); /* Flash requires us to pass it a matrix that converts from virtual flash gradient area into the display gradient area. Flash provides a utility function createGradientBox that takes an object width and height and produces an appropriate matrix for typical usage. It also takes an angle parameter. Since SVG does not specify an angle, you have to calculate it from the x1,y1,x2,y2 attributes. However, if you pass that angle to createGradientBox, it performs the rotation before scaling when calculating its matrix. If the scaling is non uniform, it skews the resulting gradient from the desired angle. Therefore, we have to calculate the gradient matrix manually. Now we have entered undocumented black magic. Credit for some understanding of this started here: http://www.half-serious.com/swf/format/gradients/index.html Actually, the virtual flash gradient is represented by an area in 2D coordinate space spanning -819.2 to 819.2 on both axis, where -819.2 represents a stop value of 0 and 819.2 represents a stop value of 1.0. These values were determined from experimentation. The starting gradient orientation goes from the left side of this box to the right side. If you think of the flash gradient as a vector that goes from stop value 0 to 1, then its origin is -819.2, 0 and its end point is 819.2, 0 in the standard flash gradient area. For gradientUnits userSpaceOnUse: To produce a matrix that converts from flash space to SVG space, we will imagine a vector going from the center of the flash space to the maximum x value (from 0,0 to 819.2,0). This represents a vector perpendicular to the gradient stripes and going from stop value .5 to 1. We will imagine the equivalent SVG vector in SVG space, which starts at the halfway point between x1,y1 and x2,y2 and goes to x2,y2. So, if we create a matrix that converts from that flash vector to the SVG gradient vector, then we will have the appropriate gradient matrix that flash wants. For gradientUnits objectBoundingBox: To produce a matrix that converts from flash space to SVG space, we will imagine a vector going from the center of the flash space to the maximum x value (from 0,0 to 819.2,0). We will imagine the equivalent SVG vector in objectBoundingBox units where the units span from 0,0 to 1,1. Then the vector is converted from objectBoundingBox units to user space units. */ var matr:Matrix= new Matrix(); if (gradientUnits == 'userSpaceOnUse') { var x1:Number = Math.round(SVGUnits.parseNumPct(x1String, node.svgParent.getWidth())); var y1:Number = Math.round(SVGUnits.parseNumPct(y1String, node.svgParent.getHeight())); var x2:Number = Math.round(SVGUnits.parseNumPct(x2String, node.svgParent.getWidth())); var y2:Number = Math.round(SVGUnits.parseNumPct(y2String, node.svgParent.getHeight())); var gradientWidth:Number = Math.abs(x2 - x1); var gradientHeight:Number = Math.abs(y2 - y1); // The length of the flash vector (819.2) is scaled to the length of the equivalent SVG vector var sx:Number = (Math.sqrt(gradientWidth*gradientWidth+gradientHeight*gradientHeight) / 2) / 819.2; var sy:Number = 1; matr.scale(sx, sy); // Now compute the angle of the SVG vector and rotate to that angle dx = x2 - x1; dy = y2 - y1; angle = Math.atan2(dy, dx); matr.rotate(angle); // Now we have the correct length and orientation, now move the // vector to the center of the svg gradient box var tx:Number = (x1 + x2) / 2; var ty:Number = (y1 + y2) / 2; matr.translate(tx, ty); // Now apply the gradientMatrix, if specified // xxx needs testing if (matrGrTr != null) matr.concat(matrGrTr); // Finally, we need to move the matrix to the right screen location. // The flash gradient was positioned relative to the object. // SVG has specified its vector in user space. Now that we // are in SVG user space, we can make this adjustment. matr.translate(-objectX, -objectY); return matr; } else { // objectBoundingBox units // Get node height and width in user space var w:Number = node.xMax - node.xMin; var h:Number = node.yMax - node.yMin; // Get gradient coordinates in objectBoundingBox units if (x1String.search('%') > -1) { x1 = SVGUnits.parseNum(x1String) / 100; } else { x1 = SVGUnits.parseNum(x1String); } if (y1String.search('%') > -1) { y1 = SVGUnits.parseNum(y1String) / 100; } else { y1 = SVGUnits.parseNum(y1String); } if (x2String.search('%') > -1) { x2 = SVGUnits.parseNum(x2String) / 100; } else { x2 = SVGUnits.parseNum(x2String); } if (y2String.search('%') > -1) { y2 = SVGUnits.parseNum(y2String) / 100; } else { y2 = SVGUnits.parseNum(y2String); } // Scale from flash gradient area to bounding box matr.scale(1/1638.4, 1/1638.4); // Move to the center of the bounding box matr.translate(.5, .5); // Scale the vector to the size of the SVG vector in boundingBox units dx = x2 - x1; dy = y2 - y1; matr.scale(Math.sqrt(dx*dx + dy*dy), 1); // Rotate to the angle of the SVG vector in boundingBox units angle = Math.atan2(dy, dx); matr.rotate(angle); // Scale from objectBoundingBox units to user space matr.scale(w, h); // Move to the starting gradient position in user space matr.translate(x1 * w, y1 * h); // Now apply the gradientMatrix, if specified // xxx needs testing if (matrGrTr != null) matr.concat(matrGrTr); // A special adjustment is needed for circles for unknown reasons. // This adjustment was determined empirically. See Issues 349 and 371. if (node is SVGCircleNode) { matr.translate(objectX, objectY); } return matr; } } } } ������������������������������������������������������������������������������������������������������������������������������������������������debian/contrib/websvg/src/org/svgweb/nodes/SVGPatternNode.as����������������������������������������0000644�0000000�0000000�00000007253�12252640275�021252� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* Copyright (c) 2009 by contributors: * James Hight (http://labs.zavoo.com/) * Richard R. Masters Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package org.svgweb.nodes { import org.svgweb.core.SVGNode; import org.svgweb.utils.SVGUnits; import flash.display.BitmapData; import flash.events.Event; import flash.geom.Matrix; public class SVGPatternNode extends SVGNode { public function SVGPatternNode(svgRoot:SVGSVGNode, xml:XML = null, original:SVGNode = null) { super(svgRoot, xml, original); } override protected function drawNode(event:Event = null):void { topSprite.visible = false; if ( (topSprite.parent != null) && (this._invalidDisplay) ) { this._invalidDisplay = false; if (this._xml != null) { if (!this._parsedChildren) { this.parseChildren(); this._parsedChildren = true; } } topSprite.removeEventListener(Event.ENTER_FRAME, drawNode); } if (!this._initialRenderDone && topSprite.parent) { this._initialRenderDone = true; this.svgRoot.renderFinished(); } } public function beginPatternFill(node:SVGNode):void { var patternWidth:int = topSprite.width; var patternHeight:int = topSprite.height; var tmp:String = this.getAttribute('width'); if (tmp) { patternWidth = SVGUnits.parseNum(tmp); } tmp = this.getAttribute('height'); if (tmp) { patternHeight = SVGUnits.parseNum(tmp); } var patternX:Number = SVGUnits.parseNum(this.getAttribute('x')); var patternY:Number = SVGUnits.parseNum(this.getAttribute('y')); var matrix:Matrix tmp = this.getAttribute('patternTransform'); if (tmp) { matrix = this.parseTransform(tmp, matrix); } else { matrix = new Matrix(); } matrix.concat(drawSprite.transform.concatenatedMatrix); var nodeMatrix:Matrix = node.drawSprite.transform.concatenatedMatrix; nodeMatrix.invert(); matrix.concat(nodeMatrix); matrix.translate(patternX, patternY); if ( (patternWidth > 0) && (patternHeight > 0) ) { var bitmapData:BitmapData = new BitmapData(patternWidth, patternHeight); bitmapData.draw(this.targetPattern().topSprite); node.drawSprite.graphics.beginBitmapFill(bitmapData, matrix); } this.svgRoot.addReference(node, this.targetPattern().id); } public function targetPattern():SVGPatternNode { var href:String = this.getAttribute("href"); if (href) { href = href.substr(1); var node:SVGNode = this.svgRoot.getNode(href); if (node is SVGPatternNode) { return SVGPatternNode(node).targetPattern(); } } return this; } } } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������debian/contrib/websvg/src/org/svgweb/nodes/SVGAnimateNode.as����������������������������������������0000755�0000000�0000000�00000060303�12252640275�021211� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* Copyright (c) 2009 by contributors: * James Hight (http://labs.zavoo.com/) * Richard R. Masters Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package org.svgweb.nodes { import org.svgweb.utils.SVGUnits; import org.svgweb.utils.PathParser; import org.svgweb.core.SVGNode; import org.svgweb.core.SVGTimedNode; import org.svgweb.smil.TimeSpec; import org.svgweb.smil.SplineInterpolator; import org.svgweb.events.SVGEvent; import flash.events.Event; public class SVGAnimateNode extends SVGTimedNode { protected var targetNode:SVGNode; protected var attributeName:String; protected var calcModeParameter:String; protected var fromParameter:String; protected var toParameter:String; protected var byParameter:String; protected var valuesParameter:String; protected var keyTimesParameter:String; protected var keySplinesParameter:String; protected var fillParameter:String; protected var accumulateParameter:String; protected var additiveParameter:String; protected var keyTimes:Array; protected var keySplines:Array; protected var numKeyTimes:uint; protected var _isAdditive:Boolean = false; protected var isAccumulative:Boolean = false; protected var animValue:String; protected var frozen:Boolean = false; protected var doInvalidate:Boolean = true; public function SVGAnimateNode(svgRoot:SVGSVGNode, xml:XML, original:SVGNode = null):void { super(svgRoot, xml, original); } override protected function onSVGDocTimeUpdate(event:Event):void { if (!targetNode) { parseParameters(); } super.onSVGDocTimeUpdate(event); // allow descendents to skip this code below // primarily SVGSetNode if (!doInvalidate) return; // Depending on the type of animation, trigger a redraw // or a lesser update if (targetNode && this.active) { targetNode.invalidateAttribute(attributeName); } } override protected function initialize():void { super.initialize(); if (!targetNode) { this.parseParameters(); } } override protected function onRemovedFromStage(event:Event):void { if (targetNode) { targetNode.removeAnimation(this); } super.onRemovedFromStage(event); } public function getAnimValue():String { if (this.isEffective()) { if (frozen) { return animValue; } frozen = !this.active; var repeatFraction:Number = getRepeatIntervalFraction(lastDocTime); var fromString:String; var toString:String; var keyTimeIndex:Number = getKeyTimeIndex(repeatFraction); var keyTimeSpline:String = getKeyTimeSpline(keyTimeIndex); var keyTimeThreshold:Number = 0.5; if (valuesParameter != null) { var keyTimeFraction:Number = getKeyTimeFraction(repeatFraction); fromString = getKeyTimeValue(keyTimeIndex); toString = getKeyTimeValue(keyTimeIndex + 1); keyTimeThreshold = 1.0; } else { keyTimeFraction = repeatFraction; fromString = getFromParameter(); toString = toParameter; keyTimeThreshold = 0.5; } if ( (fromString == "inherit") || (toString == "inherit")) { var inheritedValue:String = null; if (targetNode && targetNode.svgParent != null) { inheritedValue = targetNode.svgParent.getAttribute(attributeName, null, true, true); } if (fromString == "inherit") fromString = inheritedValue; if (toString == "inherit") toString = inheritedValue; frozen = false; // force recalculation based on inherited value } // don't continue if null values if ( (fromString == null) || (toString == null)) { animValue = null; return null; } if(attributeName == 'd') { animValue = getPathAnimValue(fromString, toString, keyTimeFraction, keyTimeThreshold, keyTimeSpline); } else { animValue = getSingleAnimValue(fromString, toString, keyTimeFraction, keyTimeThreshold, keyTimeSpline); } return animValue; } return null; } protected function getPathAnimValue(fromString:String, toString:String, keyTimeFraction:Number, keyTimeThreshold:Number, keyTimeSpline:String):String { var from:Array = PathParser.parseSVGPath(fromString); var to:Array = PathParser.parseSVGPath(toString); var fromLength:int = from.length; var toLength:int = to.length; var result:String = ''; for(var pos:int = 0; pos < fromLength && pos < toLength; ) { var command:String = from[pos++]; var segs:int = 0; switch(command) { case "M": case "m": segs = 2; break; case "A": case "a": segs = 7; break; case "C": case "c": segs = 6; break; case "S": case "s": case "Q": case "q": segs = 4; break; case "T": case "t": case "L": case "l": segs = 2; break; case "H": case "h": case "V": case "v": segs = 1; break; default: trace("Unknown Segment Type in Anim Value: " + command); case "Z": case "z": segs = 0; break; } result += command; for (var seg:int = 0; seg < segs; seg++) { result += getSingleAnimValue(from[pos + seg], to[pos + seg], keyTimeFraction, keyTimeThreshold, keyTimeSpline) + ' '; } pos += segs; } return result; } protected function getSingleAnimValue(fromString:String, toString:String, keyTimeFraction:Number, keyTimeThreshold:Number, keyTimeSpline:String):String { var previousCount:int; var fromVal:Number; var toVal:Number; var result:String; if (calcModeParameter == "discrete") { if (accumulateParameter == "sum") { // assume additive attribute fromVal = SVGUnits.parseNum(fromString); toVal = SVGUnits.parseNum(toString); previousCount = getRepeatIndex(lastDocTime); if (previousCount > 0) { // XXX For "values", should use the last value, not to // XXX complications also from "inherit" - need to keep a running total? fromVal += toVal * previousCount; toVal += toVal * previousCount; } if (keyTimeFraction >= keyTimeThreshold) { result = String(toVal); } else { result = String(fromVal); } } else { if (keyTimeFraction >= keyTimeThreshold) { result = toString; } else { result = fromString; } } return result; } // from here, everything should be numbers fromVal = SVGUnits.parseNum(fromString); toVal = SVGUnits.parseNum(toString); var isColor:Boolean = false; if (SVGUnits.isColor(fromString) && SVGUnits.isColor(toString) ) { isColor = true; } var animVal:Number; if (accumulateParameter == "sum") { previousCount = getRepeatIndex(lastDocTime); if (previousCount > 0) { // XXX For "values", should use the last value, not to fromVal += toVal * previousCount; toVal += toVal * previousCount; } animVal = interpolate(fromVal, toVal, keyTimeFraction, keyTimeSpline, isColor); } else { animVal = interpolate(fromVal, toVal, keyTimeFraction, keyTimeSpline, isColor); } if (isColor) { // convert animVal to color string value result = SVGUnits.colorString(animVal); } else { result = String(animVal); } return result; } // Which key time does the repeatFraction fall at? public function getKeyTimeIndex(repeatFraction:Number):uint { var i:uint; for (i=1; i < keyTimes.length; i++) { if (repeatFraction < SVGUnits.parseNum(keyTimes[i])) { return i-1; } } return keyTimes.length - 2; } public function getKeyTimeSpline(keyTimeIndex:uint):String { try{ if (keySplines[keyTimeIndex] is String) { return keySplines[keyTimeIndex]; } else { return "0 0 1 1"; } } catch (e:Error) { } return "0 0 1 1"; } // At what fraction of the key time duration does the repeatFraction fall at? public function getKeyTimeFraction(repeatFraction:Number):Number { var keyIndex:uint = getKeyTimeIndex(repeatFraction); var startVal:Number = keyTimes[keyIndex]; var endVal:Number = keyTimes[keyIndex+1]; if (endVal == startVal) return 0; return (repeatFraction - startVal) / (endVal - startVal); } public function getKeyTimeValue(keyTimeIndex:uint):String { var parts:Array = valuesParameter.split(/;/); return SVGUnits.trim(parts[keyTimeIndex]); } public function isEffective():Boolean { if (this.active || (!neverStarted && (fillParameter == "freeze"))) return true; return false; } override protected function timeIntervalStarted(docTime:Number):void { super.timeIntervalStarted(docTime); frozen = false; if (!targetNode) { parseParameters(); } if (targetNode) { targetNode.invalidateAttribute(attributeName); } } override protected function timeIntervalEnded(docTime:Number):void { super.timeIntervalEnded(docTime); targetNode.invalidateAttribute(attributeName); } protected function interpolate(fromVal:Number, toVal:Number, fraction:Number, keySpline:String, isColor:Boolean = false):Number { if (isColor) { var fromR : Number = uint(fromVal) >> 16; var fromG : Number = ( uint(fromVal) >> 8 ) & 0xff; var fromB : Number = uint(fromVal) & 0xff; var toR : Number = uint(toVal) >> 16; var toG : Number = ( uint(toVal) >> 8 ) & 0xff; var toB : Number = uint(toVal) & 0xff; var animR:Number = fromR + (toR - fromR) * fraction; var animG:Number = fromG + (toG - fromG) * fraction; var animB:Number = fromB + (toB - fromB) * fraction; return ( (uint(animR) << 16) + (uint(animG) << 8) + uint(animB)); } else { if (calcModeParameter == "linear" || (calcModeParameter == "spline" && keySpline == "0 0 1 1")) { return fromVal + (toVal - fromVal) * fraction; } if (calcModeParameter == "spline") { var splinedFraction:Number = splineInterpolate(fraction, keySpline); return fromVal + (toVal - fromVal) * splinedFraction; } if (calcModeParameter == "paced") { return fromVal + (toVal - fromVal) * fraction; } } return fromVal + (toVal - fromVal) * fraction; } protected function splineInterpolate(fraction:Number, keySpline:String):Number { var interpolator:Object = SplineInterpolator.getSplineInterpolator(keySpline, this); return interpolator.interpolate(fraction, this); } public function getAttributeName():String { return attributeName; } override protected function parseParameters():void { super.parseParameters(); parseAttributeNameParameter(); parseHrefParameter(); parseValuesParameter(); parseFromParameter(); parseToParameter(); parseByParameter(); parseKeyTimesParameter(); parseKeySplinesParameter(); parseFillParameter(); parseCalcModeParameter(); parseAccumulateParameter(); parseAdditiveParameter(); } protected function parseHrefParameter():void { var targetID:String = this._xml.@xlink::href; if (targetID) { if (targetID.match(/^#/)) { targetID = targetID.substr(1); targetNode = this.svgRoot.getNode(targetID); } } else { targetID = this._xml.@targetElement; if (targetID) { targetNode = this.svgRoot.getNode(targetID); } else { targetNode = this.svgParent; } } if (targetNode) { targetNode.addAnimation(this); } } protected function parseFromParameter():void { fromParameter = this._getAttribute('from', null, false, false, false); // process null and 'inherit' at getAnimValue } protected function parseToParameter():void { toParameter = this._getAttribute('to', null, false, false, false); // process 'inherit' at getAnimValue } protected function parseByParameter():void { if (toParameter != null) return; // ignore by if there is a to if (valuesParameter != null) return; //ignore if valuesParameter // by - only to be used with attributes that support addition byParameter = this.getAttribute('by', null); // convert into a from-to if (byParameter != null) { if ( (fromParameter == null) || (fromParameter == "inherit")) { if (SVGUnits.isColor(byParameter)) fromParameter = "#000000"; else fromParameter = "0"; toParameter = byParameter; _isAdditive = true; // added to underlying value at getAnimValue } else { // XXX byParameter could be "inherit" if (SVGUnits.isColor(fromParameter)) { var fromVal:Number = SVGUnits.getColor(fromParameter); var byVal:Number = SVGUnits.getColor(byParameter); var toVal:Number = SVGUnits.addColors(SVGUnits.getColor(fromParameter), SVGUnits.getColor(byParameter)); toParameter = SVGUnits.colorString(toVal); } else { toParameter = String(SVGUnits.parseNum(fromParameter) + SVGUnits.parseNum(byParameter)); // assuming additive } } } } protected function parseValuesParameter():void { valuesParameter = this.getAttribute('values', null); } protected function parseKeyTimesParameter():void { keyTimesParameter = this.getAttribute('keyTimes', null); var numValues:uint; if (valuesParameter != null) { var values:Array = valuesParameter.split(";"); numValues = values.length; } else { numValues = 2; } // XXX for calcMode="paced", key times should be computed // such that the distance between key times is proportional // to the distance between their corresponding values. // If there is a values parameter, then we should // make sure there are key times for every value if (keyTimesParameter == null) { keyTimes = new Array(); keyTimes.push("0"); } else { keyTimes = keyTimesParameter.split(/;/); } if (keyTimes.length < numValues) { var numTimesToAdd:uint = numValues - keyTimes.length; var lastValueAdded:Number = SVGUnits.parseNum(keyTimes[keyTimes.length-1]); var span:Number = 1.0 - lastValueAdded; for (var i:uint=1; i <= numTimesToAdd; i++) { keyTimes.push(String(lastValueAdded + span/numTimesToAdd)); lastValueAdded += span/numTimesToAdd; } } } protected function parseKeySplinesParameter():void { keySplinesParameter = this.getAttribute('keySplines', null); if (keySplinesParameter == null) { keySplines = new Array(); } else { keySplines = keySplinesParameter.split(/;/); } } protected function parseAttributeNameParameter():void { attributeName = this.getAttribute('attributeName', null); } protected function parseFillParameter():void { fillParameter = this.getAttribute('fill', 'remove'); } protected function parseAdditiveParameter():void { additiveParameter = this.getAttribute('additive', 'replace'); if (additiveParameter == "sum") { _isAdditive = true; } } public function isAdditive():Boolean { return _isAdditive; } protected function parseAccumulateParameter():void { accumulateParameter = this.getAttribute('accumulate', 'none'); } protected function parseCalcModeParameter():void { calcModeParameter = this.getAttribute('calcMode', 'linear'); // check if calcModeParamter should be discrete // (also set accumulateParamter to none) if ( valuesParameter != null) { // If there is one numeric value then assume numeric // if there is one string value, assume discrete var values:Array = valuesParameter.split(";"); for each (var strValue:String in values) { if (strValue == "inherit") { if (targetNode && targetNode.svgParent != null) strValue = targetNode.svgParent.getAttribute(attributeName, null, true, false); if (strValue == null) strValue = "inherit"; } if (attributeName == 'd' || SVGUnits.isColor(strValue)) { return; } var keyVal:Number = parseInt(strValue); if (isNaN(keyVal) || keyVal > int.MAX_VALUE || keyVal < int.MIN_VALUE) { calcModeParameter = "discrete"; accumulateParameter = "none"; return; } } } else { // If the values are not colors // and the values are not numeric, then they are disrete strings var paramString:String; if (fromParameter != null) { paramString = fromParameter; if (paramString == "inherit") { if (targetNode && targetNode.svgParent != null) paramString = targetNode.svgParent.getAttribute(attributeName, null, true, false); if (paramString == null) paramString = "inherit"; } if (attributeName != 'd' && !SVGUnits.isColor(paramString)) { var fromVal:Number = parseInt(paramString); if ( isNaN(fromVal) || fromVal > int.MAX_VALUE || fromVal < int.MIN_VALUE ) { calcModeParameter = "discrete"; accumulateParameter = "none"; } } } if (toParameter != null) { paramString = toParameter; if (paramString == "inherit") { if (targetNode && targetNode.svgParent != null) paramString = targetNode.svgParent.getAttribute(attributeName, null, true, false); if (paramString == null) paramString = "inherit"; } if (attributeName != 'd' && !SVGUnits.isColor(paramString)) { var toVal:Number = parseInt(paramString); if ( isNaN(toVal) || toVal > int.MAX_VALUE || toVal < int.MIN_VALUE ) { calcModeParameter = "discrete"; accumulateParameter = "none"; } } } } } protected function getFromParameter():String { var result:String = fromParameter; if (result != null) return result; else if (targetNode) { // not specified result = targetNode.getAttribute(attributeName, null, false, false, false); } if (result==null) { if (ATTRIBUTES_NOT_INHERITED.indexOf(attributeName) != -1) { // return(getDefaultValue(attributeName)); return null; } result = "inherit"; } return result; } override public function handleAttrChange(name:String, value:String, attrNamespace:String = null):void { // override to avoid drawing done in SVGNode.handleAttrChange() } } } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������debian/contrib/websvg/src/org/svgweb/nodes/SVGDOMTextNode.as����������������������������������������0000644�0000000�0000000�00000004570�12252640275�021120� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* Copyright (c) 2009 Google Inc. Portions Copyright (c) 2009 Rick Masters Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ package org.svgweb.nodes { import org.svgweb.core.SVGNode; import org.svgweb.nodes.SVGSVGNode; /** This class is necessary for representing DOM Text Nodes in a way that we can 'track' over time and lookup by GUID when SVG Web is used in conjunction with browser JavaScript integration. We represent our DOM text nodes as a DOM element named '__text' with a _guid attribute set to a unique GUID and a __fakeTextNode attribute set to 'true'. Our actual text content is stored as a DOM Text Node as a child of ourselves. */ public class SVGDOMTextNode extends SVGNode { public var nodeValue:String = null; public function SVGDOMTextNode(svgRoot:SVGSVGNode, xml:XML):void { super(svgRoot, xml); this.nodeValue = xml.text(); // Since we are not added to stage, register here. this.registerSelf(); } override public function createSVGSprites():void { //Do Nothing } override protected function draw():void { //Do Nothing } override protected function generateGraphicsCommands():void { this._graphicsCommands = new Array(); //Do Nothing } } } ����������������������������������������������������������������������������������������������������������������������������������������debian/contrib/websvg/src/org/svgweb/nodes/SVGScriptNode.as�����������������������������������������0000644�0000000�0000000�00000003173�12252640275�021076� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* Copyright (c) 2009 by contributors: * James Hight (http://labs.zavoo.com/) * Richard R. Masters Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package org.svgweb.nodes { import org.svgweb.SVGViewerWeb; import org.svgweb.core.SVGNode; import flash.events.Event; public class SVGScriptNode extends SVGNode { public function SVGScriptNode(svgRoot:SVGSVGNode, xml:XML=null, original:SVGNode=null) { super(svgRoot, xml, original); } override protected function drawNode(event:Event = null):void { this.topSprite.removeEventListener(Event.ENTER_FRAME, drawNode); //Don't reset _invalidDisplay //This way drawNode is only called once //this._invalidDisplay = false; var content:String; if (this._xml.children().length() > 0) { content = this._xml.children()[0].text().toString(); this.svgRoot.handleScript(content); } this.topSprite.visible = false; this.svgRoot.renderFinished(); } } } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������debian/contrib/websvg/src/org/svgweb/nodes/SVGMetadataNode.as���������������������������������������0000644�0000000�0000000�00000001712�12252640275�021347� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* Copyright (c) 2009 by contributors: * James Hight (http://labs.zavoo.com/) * Richard R. Masters Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package org.svgweb.nodes { import org.svgweb.core.SVGNode; import flash.events.Event; public class SVGMetadataNode extends SVGNode { public function SVGMetadataNode(svgRoot:SVGSVGNode, xml:XML = null, original:SVGNode = null) { super(svgRoot, xml, original); } } } ������������������������������������������������������debian/contrib/websvg/src/org/svgweb/nodes/SVGAudioNode.as������������������������������������������0000755�0000000�0000000�00000005724�12252640275�020702� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* Copyright (c) 2009 by contributors: * James Hight (http://labs.zavoo.com/) * Richard R. Masters Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package org.svgweb.nodes { import org.svgweb.core.SVGNode; import org.svgweb.core.SVGTimedNode; import flash.events.Event; import flash.events.ProgressEvent; import flash.events.IOErrorEvent; import flash.net.URLRequest; import flash.media.Sound; import flash.media.SoundChannel; public class SVGAudioNode extends SVGTimedNode { protected var sound:Sound; protected var channel:SoundChannel; public function SVGAudioNode(svgRoot:SVGSVGNode, xml:XML, original:SVGNode = null):void { super(svgRoot, xml, original); } override protected function onAddedToStage(event:Event):void { super.onAddedToStage(event); // Get the sound location var audioHref:String = this.getAttribute('href'); if (!audioHref) { return; } // Prepend the xml:base var xmlBase:String = this.getAttribute('base'); if (xmlBase && xmlBase != '') { audioHref = xmlBase + audioHref; } else if (this.svgRoot.objectURL && audioHref.length > 0 && audioHref.charAt(0) != '/') { // If no xml:base, expand the URL relative to the location of // the SVG file itself audioHref = this.svgRoot.objectURL + audioHref; } // Load the sound var mySoundReq:URLRequest = new URLRequest(audioHref); sound = new Sound(); sound.addEventListener(ProgressEvent.PROGRESS, progressHandler); sound.addEventListener(IOErrorEvent.IO_ERROR, ioErrorHandler); sound.load(mySoundReq); } protected function progressHandler(event:ProgressEvent):void { if (this.eachRepeatDuration == INDEFINITE) { this.eachRepeatDuration = sound.length; } } protected function ioErrorHandler(event:IOErrorEvent):void { } override protected function repeatIntervalStarted(docTime:Number):void { super.repeatIntervalStarted(docTime); channel = sound.play(0); } override protected function repeatIntervalEnded(docTime:Number):void { super.repeatIntervalEnded(docTime); channel.stop(); } } } ��������������������������������������������debian/contrib/websvg/src/org/svgweb/nodes/SVGPolylineNode.as���������������������������������������0000755�0000000�0000000�00000005655�12252640275�021437� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* Copyright (c) 2009 by contributors: * James Hight (http://labs.zavoo.com/) * Richard R. Masters Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package org.svgweb.nodes { import org.svgweb.utils.SVGUnits; import org.svgweb.core.SVGNode; import flash.display.GraphicsPath; import flash.display.GraphicsPathWinding; public class SVGPolylineNode extends SVGNode { public function SVGPolylineNode(svgRoot:SVGSVGNode, xml:XML, original:SVGNode = null):void { super(svgRoot, xml, original); } /** * Generate graphics commands to draw a polyline **/ protected override function generateGraphicsCommands():void { this._graphicsCommands = new Array(); var fillRule:String = this.getStyleOrAttr('fill-rule', 'nonzero'); var path:GraphicsPath = new GraphicsPath(new Vector.(), new Vector.(), fillRule=='evenodd' ? GraphicsPathWinding.EVEN_ODD : GraphicsPathWinding.NON_ZERO); var pointsString:String = SVGUnits.trim(this.getAttribute('points','')); pointsString = pointsString.replace(/\s+/sg,","); //Replace spaces with a comma pointsString = pointsString.replace(/,{2,}/sg,","); // Remove any extra commas pointsString = pointsString.replace(/^,/, ''); //Remove leading comma pointsString = pointsString.replace(/,$/, ''); //Remove trailing comma var points:Array = pointsString.split(','); var pX:Number; var pY:Number; for (var i:int = 0; i < points.length; i += 2) { pX = points[i]; pY = points[i + 1]; if (i == 0) { path.moveTo(pX, pY); } else { path.lineTo(pX, pY); } // If at the end, push the drawing command if (i == (points.length - 2)) { this._graphicsCommands.push(['PATH', path]); } //Width/height calculations for gradients this.setXMinMax(pX); this.setYMinMax(pY); } } } } �����������������������������������������������������������������������������������debian/contrib/websvg/src/org/svgweb/nodes/SVGSymbolNode.as�����������������������������������������0000755�0000000�0000000�00000004300�12252640275�021073� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* Copyright (c) 2009 by contributors: * James Hight (http://labs.zavoo.com/) * Richard R. Masters Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package org.svgweb.nodes { import flash.events.Event; import org.svgweb.core.SVGNode; /** * Contains drawing instructions used by SVGUseNode * It is not rendered directly **/ public class SVGSymbolNode extends SVGNode { public function SVGSymbolNode(svgRoot:SVGSVGNode, xml:XML, original:SVGNode = null):void { super(svgRoot, xml, original); } override protected function drawNode(event:Event = null):void { // If this symbol has a reference to an original definition, // then it is being used and should be drawn. if (this.original) { super.drawNode(event); return; } else { // If the symbol is just a definition, then it should not be drawn. topSprite.visible = false; if ( (topSprite.parent != null) && (this._invalidDisplay) ) { this._invalidDisplay = false; if (this._xml != null) { if (!this._parsedChildren) { this.parseChildren(); this._parsedChildren = true; } } topSprite.removeEventListener(Event.ENTER_FRAME, drawNode); } if (!this._initialRenderDone && topSprite.parent) { this._initialRenderDone = true; this.svgRoot.renderFinished(); } } } } } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������debian/contrib/websvg/src/org/svgweb/nodes/SVGTspanNode.as������������������������������������������0000755�0000000�0000000�00000001650�12252640275�020720� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* Copyright (c) 2009 by contributors: * James Hight (http://labs.zavoo.com/) * Richard R. Masters Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package org.svgweb.nodes { import org.svgweb.core.SVGNode; public class SVGTspanNode extends SVGTextNode { public function SVGTspanNode(svgRoot:SVGSVGNode, xml:XML, original:SVGNode = null):void { super(svgRoot, xml, original); } } } ����������������������������������������������������������������������������������������debian/contrib/websvg/src/org/svgweb/nodes/SVGGlyphNode.as������������������������������������������0000644�0000000�0000000�00000006224�12252640275�020715� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* Copyright (c) 2009 by contributors: * James Hight (http://labs.zavoo.com/) * Richard R. Masters Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package org.svgweb.nodes { import org.svgweb.core.SVGNode; import flash.events.Event; import flash.display.DisplayObject; public class SVGGlyphNode extends SVGPathNode { protected var parentFont:SVGFontNode; public function SVGGlyphNode(svgRoot:SVGSVGNode, xml:XML = null, original:SVGNode = null) { super(svgRoot, xml, original); } override protected function onAddedToStage(event:Event):void { if (original) { parentFont = SVGGlyphNode(original).getParentFont(); } else { parentFont = this.getParentFont(); } // If we are the master glyph (not a clone used by a text node) // then register with the parent font. if (original == null && parentFont) { parentFont.registerGlyph(this); } super.onAddedToStage(event); } override protected function onRemovedFromStage(event:Event):void { if (original == null && parentFont) { parentFont.unregisterGlyph(this); } super.onRemovedFromStage(event); } override protected function drawNode(event:Event = null):void { super.drawNode(event); // If this is a instantiated glyph, then notify the text node parent // that we have rendered (and are ready to be displayed). if (original && this.svgParent) { SVGTextNode(this.svgParent).onDrawGlyph(this); } } public function getUnicode():String { return this.getAttribute('unicode'); } public function getParentFont():SVGFontNode { var node:SVGNode = this; while (node && !(node is SVGSVGNode)) { node=node.svgParent; if (node && node is SVGFontNode) return SVGFontNode(node); } return null; } override public function clone():SVGNode { var node:SVGNode = super.clone(); generateGraphicsCommands(); SVGGlyphNode(node).setGraphicsCommands(_graphicsCommands); return node; } protected override function generateGraphicsCommands():void { if (this._graphicsCommands == null) { super.generateGraphicsCommands(); } } public function setGraphicsCommands(cmds:Array):void { _graphicsCommands = cmds; } } } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������debian/contrib/websvg/src/org/svgweb/nodes/SVGDefsNode.as�������������������������������������������0000755�0000000�0000000�00000003432�12252640275�020514� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* Copyright (c) 2009 by contributors: * James Hight (http://labs.zavoo.com/) * Richard R. Masters Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package org.svgweb.nodes { import org.svgweb.core.SVGNode; import flash.events.Event; /** * Contains drawing instructions used by SVGUseNode * It is not rendered directly **/ public class SVGDefsNode extends SVGNode { public function SVGDefsNode(svgRoot:SVGSVGNode, xml:XML, original:SVGNode = null):void { super(svgRoot, xml, original); } override protected function drawNode(event:Event = null):void { topSprite.visible = false; if ( (topSprite.parent != null) && (this._invalidDisplay) ) { this._invalidDisplay = false; if (this._xml != null) { if (!this._parsedChildren) { this.parseChildren(); this._parsedChildren = true; } } topSprite.removeEventListener(Event.ENTER_FRAME, drawNode); } if (!this._initialRenderDone && topSprite.parent) { this._initialRenderDone = true; this.svgRoot.renderFinished(); } } } } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������debian/contrib/websvg/src/org/svgweb/nodes/SVGPathNode.as�������������������������������������������0000755�0000000�0000000�00000036045�12252640275�020535� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* Copyright (c) 2009 by contributors: * James Hight (http://labs.zavoo.com/) * Richard R. Masters Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package org.svgweb.nodes { import org.svgweb.utils.EllipticalArc; import org.svgweb.utils.PathParser; import org.svgweb.core.SVGNode; import flash.display.GraphicsPath; import flash.display.GraphicsPathWinding; public class SVGPathNode extends SVGNode { private var currentX:Number; private var currentY:Number; private var startX:Number; private var startY:Number; private var lastCurveControlX:Number; private var lastCurveControlY:Number; private var path:GraphicsPath; public function SVGPathNode(svgRoot:SVGSVGNode, xml:XML, original:SVGNode = null):void { super(svgRoot, xml, original); } protected override function generateGraphicsCommands():void { //var startTime:int = new Date().getTime(); //var pieceTime:int; this._graphicsCommands = new Array(); //pieceTime = new Date().getTime(); var d:String = this.getAttribute('d'); if (d == null) return; // space ' ' glyph can have missing path. var szSegs:Array = PathParser.parseSVGPath(d); //increment('generateGraphicsCommands_normalizeSVGData', (new Date().getTime() - pieceTime)); var fillRule:String = this.getStyleOrAttr('fill-rule', 'nonzero'); this.path = new GraphicsPath(new Vector.(), new Vector.(), fillRule=='evenodd' ? GraphicsPathWinding.EVEN_ODD : GraphicsPathWinding.NON_ZERO); var command:String; var lineAbs:Boolean; var isAbs:Boolean; var firstMove:Boolean = true; var loopTime:int = new Date().getTime(); var szSegsLength:int = szSegs.length; for(var pos:int = 0; pos < szSegsLength; ) { command = szSegs[pos++]; isAbs = false; switch(command) { case "M": isAbs = true; case "m": lineAbs = isAbs; if (firstMove) { //If first move is 'm' treat as absolute isAbs = true; firstMove = false; } this.moveTo(szSegs[pos++],szSegs[pos++], isAbs); while (!isNaN(Number(szSegs[pos])) && pos < szSegsLength) { this.line(szSegs[pos++], szSegs[pos++], lineAbs); } break; case "A": isAbs = true; case "a": do { this.ellipticalArc(szSegs[pos++],szSegs[pos++],szSegs[pos++], szSegs[pos++],szSegs[pos++],szSegs[pos++],szSegs[pos++],isAbs); } while (!isNaN(Number(szSegs[pos])) && pos < szSegsLength); break; case "C": isAbs = true; case "c": do { this.cubicBezier(szSegs[pos++],szSegs[pos++],szSegs[pos++], szSegs[pos++],szSegs[pos++],szSegs[pos++],isAbs); } while (!isNaN(Number(szSegs[pos])) && pos < szSegsLength); break; case "S": isAbs = true; case "s": do { this.cubicBezierSmooth(szSegs[pos++],szSegs[pos++],szSegs[pos++],szSegs[pos++],isAbs); } while (!isNaN(Number(szSegs[pos])) && pos < szSegsLength); break; case "Q": isAbs = true; case "q": do { this.quadraticBezier(szSegs[pos++],szSegs[pos++],szSegs[pos++],szSegs[pos++],isAbs); } while (!isNaN(Number(szSegs[pos])) && pos < szSegsLength); break; case "T": isAbs = true; case "t": do { this.quadraticBezierSmooth(szSegs[pos++],szSegs[pos++],isAbs); } while (!isNaN(Number(szSegs[pos])) && pos < szSegsLength); break; case "L": isAbs = true; case "l": do { this.line(szSegs[pos++],szSegs[pos++],isAbs); } while (!isNaN(Number(szSegs[pos])) && pos < szSegsLength); break; case "H": isAbs = true; case "h": do { this.lineHorizontal(szSegs[pos++],isAbs); } while (!isNaN(Number(szSegs[pos])) && pos < szSegsLength); break; case "V": isAbs = true; case "v": do { this.lineVertical(szSegs[pos++],isAbs); } while (!isNaN(Number(szSegs[pos])) && pos < szSegsLength); break; case "Z": isAbs = true; case "z": this.closePath(); while (!isNaN(Number(szSegs[pos])) && pos < szSegsLength) { this.line(szSegs[pos++], szSegs[pos++], isAbs); } break; default: trace("Unknown Segment Type: " + command); break; } } this._graphicsCommands.push(['PATH', this.path]); //increment('generateGraphicsCommands_totalLoop', (new Date().getTime() - loopTime)); //increment('generateGraphicsCommands_path', (new Date().getTime() - startTime)); } private function closePath():void { this.path.lineTo(this.startX, this.startY); this.currentX = this.startX; this.currentY = this.startY; } private function moveTo(x:Number, y:Number, isAbs:Boolean):void { if (!isAbs) { x += this.currentX; y += this.currentY; } this.path.moveTo(x, y); this.currentX = x; this.currentY = y; this.startX = x; this.startY = y; this.lastCurveControlX = this.currentX; this.lastCurveControlY = this.currentY; this.setXMinMax(x); this.setYMinMax(y); } private function lineHorizontal(x:Number, isAbs:Boolean):void { var y:Number = this.currentY; if (!isAbs) { x += this.currentX; isAbs = true; } this.line(x,y,isAbs); } private function lineVertical(y:Number, isAbs:Boolean):void { var x:Number = this.currentX; if (!isAbs) { y += this.currentY; isAbs = true; } this.line(x,y,isAbs); } private function line(x:Number, y:Number, isAbs:Boolean):void { if (isAbs) { this.currentX = x; this.currentY = y; } else { this.currentX += x; this.currentY += y; } this.path.lineTo(this.currentX, this.currentY); this.lastCurveControlX = this.currentX; this.lastCurveControlY = this.currentY; this.setXMinMax(this.currentX); this.setYMinMax(this.currentY); } private function ellipticalArc(rx:Number, ry:Number, xAxisRotation:Number, largeArcFlag:Number, sweepFlag:Number, x:Number, y:Number, isAbs:Boolean):void { if (!isAbs) { x += this.currentX; y += this.currentY; } EllipticalArc.drawArc(rx, ry, xAxisRotation, Boolean(largeArcFlag), Boolean(sweepFlag), x, y, this.currentX, this.currentY, this.path); this.currentX = x; this.currentY = y; this.lastCurveControlX = this.currentX; this.lastCurveControlY = this.currentY; this.setXMinMax(rx); this.setYMinMax(ry); this.setXMinMax(x); this.setYMinMax(y); } private function quadraticBezierSmooth(x:Number, y:Number, isAbs:Boolean):void { var x1:Number = this.currentX + (this.currentX - this.lastCurveControlX); var y1:Number = this.currentY + (this.currentY - this.lastCurveControlY); if (!isAbs) { x+= this.currentX; y+= this.currentY; isAbs = true; } this.quadraticBezier(x1, y1, x, y, isAbs); } private function quadraticBezier(x1:Number, y1:Number, x:Number, y:Number, isAbs:Boolean):void { if (!isAbs) { x1 += this.currentX; y1 += this.currentY; x += this.currentX; y+= this.currentY; } this.path.curveTo(x1, y1, x, y); this.currentX = x; this.currentY = y; this.lastCurveControlX = x1; this.lastCurveControlY = y1; this.setXMinMax(x); this.setYMinMax(y); this.setXMinMax(x1); this.setYMinMax(y1); } private function cubicBezierSmooth(x2:Number, y2:Number, x:Number, y:Number, isAbs:Boolean):void { var x1:Number = this.currentX + (this.currentX - this.lastCurveControlX); var y1:Number = this.currentY + (this.currentY - this.lastCurveControlY); if (!isAbs) { x2 += this.currentX; y2 += this.currentY; x+= this.currentX; y+= this.currentY; isAbs = true; } this.cubicBezier(x1, y1, x2, y2, x, y, isAbs); } private function cubicBezier(x1:Number, y1:Number, x2:Number, y2:Number, x:Number, y:Number, isAbs:Boolean):void { if (!isAbs) { x1 += this.currentX; y1 += this.currentY; x2 += this.currentX; y2 += this.currentY; x += this.currentX; y += this.currentY; } var P0:Object = {x:this.currentX, y:this.currentY}; var P1:Object = {x:x1, y:y1}; var P2:Object = {x:x2, y:y2}; var P3:Object = {x:x, y:y}; /* A portion of code from Bezier_lib.as by Timothee Groleau */ // calculates the useful base points var PA:Object = getPointOnSegment(P0, P1, 3/4); var PB:Object = getPointOnSegment(P3, P2, 3/4); // get 1/16 of the [P3, P0] segment var dx:Number = (P3.x - P0.x)/16; var dy:Number = (P3.y - P0.y)/16; // calculates control point 1 var Pc_1:Object = getPointOnSegment(P0, P1, 3/8); // calculates control point 2 var Pc_2:Object = getPointOnSegment(PA, PB, 3/8); Pc_2.x -= dx; Pc_2.y -= dy; // calculates control point 3 var Pc_3:Object = getPointOnSegment(PB, PA, 3/8); Pc_3.x += dx; Pc_3.y += dy; // calculates control point 4 var Pc_4:Object = getPointOnSegment(P3, P2, 3/8); // calculates the 3 anchor points var Pa_1:Object = getMiddle(Pc_1, Pc_2); var Pa_2:Object = getMiddle(PA, PB); var Pa_3:Object = getMiddle(Pc_3, Pc_4); // draw the four quadratic subsegments this.path.curveTo(Pc_1.x, Pc_1.y, Pa_1.x, Pa_1.y); this.path.curveTo(Pc_2.x, Pc_2.y, Pa_2.x, Pa_2.y); this.path.curveTo(Pc_3.x, Pc_3.y, Pa_3.x, Pa_3.y); this.path.curveTo(Pc_4.x, Pc_4.y, P3.x, P3.y); this.currentX = x; this.currentY = y; this.lastCurveControlX = x2; this.lastCurveControlY = y2; //Width/height calculations for gradients this.setXMinMax(Pc_1.x); this.setYMinMax(Pc_1.y); this.setXMinMax(Pa_1.x); this.setYMinMax(Pa_1.y); this.setXMinMax(Pc_2.x); this.setYMinMax(Pc_2.y); this.setXMinMax(Pa_2.x); this.setYMinMax(Pa_2.y); this.setXMinMax(Pc_3.x); this.setYMinMax(Pc_3.y); this.setXMinMax(Pa_3.x); this.setYMinMax(Pa_3.y); this.setXMinMax(Pc_4.x); this.setYMinMax(Pc_4.y); this.setXMinMax(P3.x); this.setYMinMax(P3.y); } private function getMiddle(P0:Object, P1:Object):Object { /* A portion of code from Bezier_lib.as by Timothee Groleau */ return {x: ((P0.x + P1.x) / 2), y: ((P0.y + P1.y) / 2)}; } private function getPointOnSegment(P0:Object, P1:Object, ratio:Number):Object { /* A portion of code from Bezier_lib.as by Timothee Groleau */ return {x: (P0.x + ((P1.x - P0.x) * ratio)), y: (P0.y + ((P1.y - P0.y) * ratio))}; } } } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������debian/contrib/websvg/src/org/svgweb/nodes/SVGSetNode.as��������������������������������������������0000755�0000000�0000000�00000002735�12252640275�020373� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* Copyright (c) 2009 by contributors: * James Hight (http://labs.zavoo.com/) * Richard R. Masters Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package org.svgweb.nodes { import org.svgweb.core.SVGNode; public class SVGSetNode extends SVGAnimateNode { public function SVGSetNode(svgRoot:SVGSVGNode, xml:XML, original:SVGNode = null):void { super(svgRoot, xml, original); doInvalidate = false; } override public function getAnimValue():String { if (isEffective()) { if (this.toParameter == "inherit") { var inheritedValue:String = null; if (targetNode.svgParent != null) { inheritedValue = targetNode.svgParent.getAttribute(attributeName, null, true, true); } return inheritedValue; } return this.toParameter; } return null; } } } �����������������������������������debian/contrib/websvg/src/org/svgweb/nodes/SVGPolygonNode.as����������������������������������������0000755�0000000�0000000�00000006111�12252640275�021257� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* Copyright (c) 2009 by contributors: * James Hight (http://labs.zavoo.com/) * Richard R. Masters Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package org.svgweb.nodes { import org.svgweb.utils.SVGUnits; import org.svgweb.core.SVGNode; import flash.display.GraphicsPath; import flash.display.GraphicsPathWinding; public class SVGPolygonNode extends SVGNode { public function SVGPolygonNode(svgRoot:SVGSVGNode, xml:XML, original:SVGNode = null):void { super(svgRoot, xml, original); } /** * Generate graphics commands to draw a polygon **/ protected override function generateGraphicsCommands():void { this._graphicsCommands = new Array(); var fillRule:String = this.getStyleOrAttr('fill-rule', 'nonzero'); var path:GraphicsPath = new GraphicsPath(new Vector.(), new Vector.(), fillRule=='evenodd' ? GraphicsPathWinding.EVEN_ODD : GraphicsPathWinding.NON_ZERO); var pointsString:String = SVGUnits.trim(this.getAttribute('points','')); pointsString = pointsString.replace(/\s+/sg,","); //Replace spaces with a comma pointsString = pointsString.replace(/,{2,}/sg,","); // Remove any extra commas pointsString = pointsString.replace(/^,/, ''); //Remove leading comma pointsString = pointsString.replace(/,$/, ''); //Remove trailing comma var points:Array = pointsString.split(','); var pX:Number; var pY:Number; var firstX:Number; var firstY:Number; for (var i:int = 0; i < points.length; i += 2) { pX = points[i]; pY = points[i + 1]; if (i == 0) { firstX = pX; firstY = pY; path.moveTo(pX, pY); } else { path.lineTo(pX, pY); } // If at the end, push the drawing command if (i == (points.length - 2)) { path.lineTo(firstX, firstY); this._graphicsCommands.push(['PATH', path]); } //Width/height calculations for gradients this.setXMinMax(pX); this.setYMinMax(pY); } } } } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������debian/contrib/websvg/src/org/svgweb/nodes/SVGUnknownNode.as����������������������������������������0000644�0000000�0000000�00000003301�12252640275�021262� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* Copyright (c) 2009 by contributors: * James Hight (http://labs.zavoo.com/) * Richard R. Masters * Google Inc. (Brad Neuberg -- http://codinginparadise.org) Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package org.svgweb.nodes { import org.svgweb.core.SVGNode; import org.svgweb.nodes.SVGSVGNode; public class SVGUnknownNode extends SVGNode { public function SVGUnknownNode(svgRoot:SVGSVGNode, xml:XML):void { super(svgRoot, xml); } override public function hasText():Boolean { return true; } override public function setText(newValue:String):void { this._xml.setChildren(newValue); } /** * Get any child text (not text inside child nodes). Also parse * unknown child nodes. **/ override protected function parseChildren():void { super.parseChildren(); } override protected function draw():void { //Do Nothing } override protected function generateGraphicsCommands():void { this._graphicsCommands = new Array(); //Do Nothing } } } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������debian/contrib/websvg/src/org/svgweb/nodes/SVGVideoNode.as������������������������������������������0000755�0000000�0000000�00000010100�12252640275�020667� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* Copyright (c) 2009 by contributors: * James Hight (http://labs.zavoo.com/) * Richard R. Masters Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package org.svgweb.nodes { import org.svgweb.core.SVGNode; import org.svgweb.core.SVGTimedNode; import org.svgweb.utils.SVGUnits; import flash.events.Event; import flash.events.NetStatusEvent; import flash.net.NetConnection; import flash.net.NetStream; import flash.media.Video; public class SVGVideoNode extends SVGTimedNode { protected var video:Video; protected var netStream:NetStream; protected var videoHref:String; public function SVGVideoNode(svgRoot:SVGSVGNode, xml:XML, original:SVGNode = null):void { super(svgRoot, xml, original); } override protected function onAddedToStage(event:Event):void { super.onAddedToStage(event); var connection:NetConnection = new NetConnection(); connection.connect(null); netStream = new NetStream(connection); netStream.addEventListener(NetStatusEvent.NET_STATUS, handleNetEvent); // See http://www.adobe.com/devnet/flash/quickstart/metadata_cue_points/ function onMetaDataHandler(meta:Object):void { //this.dbg("meta: " + meta); } netStream.client = {onMetaData:onMetaDataHandler}; var _width:Number = SVGUnits.parseNum(this.getAttribute('width', '0')); var _height:Number = SVGUnits.parseNum(this.getAttribute('height', '0')); video = new Video(_width, _height); video.attachNetStream(netStream); this.viewBoxSprite.addChild(video); } protected function handleNetEvent(status:NetStatusEvent):void { //this.dbg("netevent: " + status.info.code); if (status.info.level == 'error') { this.err("Video error for " + videoHref + ": " + status.info.code); } } override protected function setAttributes():void { super.setAttributes(); if (video) { video.width = SVGUnits.parseNum(this.getAttribute('width', '0')); video.height = SVGUnits.parseNum(this.getAttribute('height', '0')); } } override protected function repeatIntervalStarted(docTime:Number):void { super.repeatIntervalStarted(docTime); // Get the video location videoHref = this.getAttribute('href'); if (!videoHref) { return; } // Prepend the xml:base var xmlBase:String = this.getAttribute('base'); if (xmlBase && xmlBase != '') { videoHref = xmlBase + videoHref; } else if (this.svgRoot.pageURL && videoHref.length > 0 && videoHref.charAt(0) != '/' && new RegExp("^[^:]+:/").test(videoHref) == false) { // If no xml:base, expand the URL relative to the location of // the containing HTML page; NetStream resolves everything // relative to the SWF file itself videoHref = this.svgRoot.pageURL + this.svgRoot.objectURL + videoHref; } if (netStream) { netStream.play(videoHref); } } override protected function repeatIntervalEnded(docTime:Number):void { super.repeatIntervalEnded(docTime); if (netStream) { netStream.pause(); } } } } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������debian/contrib/websvg/src/org/svgweb/nodes/SVGTextNode.as�������������������������������������������0000755�0000000�0000000�00000043504�12252640275�020563� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* Copyright (c) 2009 by contributors: * James Hight (http://labs.zavoo.com/) * Richard R. Masters * Google Inc. (Brad Neuberg -- http://codinginparadise.org) Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package org.svgweb.nodes { import org.svgweb.SVGViewerWeb; import org.svgweb.core.SVGNode; import org.svgweb.utils.SVGUnits; import flash.display.Sprite; import flash.display.DisplayObject; import flash.events.Event; import flash.geom.Matrix; import flash.text.TextField; import flash.text.TextFieldAutoSize; import flash.text.TextFormat; import flash.text.TextLineMetrics; import flash.filters.GlowFilter; /** SVG Text element node **/ public class SVGTextNode extends SVGNode { /** * Hold text path node if text follows a path **/ private var _textPath:SVGNode = null; /** * TextFields to render nodes text **/ private var _textFields:Array = null; private var _svgFont:SVGFontNode; private var _text:String = ''; protected var newGlyphs:Array = null; protected var newViewBoxSprite:Sprite = new Sprite(); protected var lastGlyph:SVGNode; public function SVGTextNode(svgRoot:SVGSVGNode, xml:XML, original:SVGNode = null):void { super(svgRoot, xml, original); } protected override function onAddedToStage(event:Event):void { super.onAddedToStage(event); svgRoot.registerFontListener(this); } protected override function onRemovedFromStage(event:Event):void { svgRoot.unregisterFontListener(this); super.onRemovedFromStage(event); } override public function onRegisterFont(fontFamily:String):void { if (fontFamily == this.getStyleOrAttr('font-family')) { invalidateDisplay(); } } /** * Need to recreate child glyphs when redrawing text **/ override public function invalidateDisplay():void { super.invalidateDisplay(); // Need to recreate child glyphs when redrawing text this._parsedChildren = false; } override public function hasText():Boolean { return true; } override public function setText(newValue:String):void { //this.dbg('setText, newValue='+newValue); this._xml.setChildren(newValue); this._text = newValue; } protected function removeOldTextFields():void { var i:int = 0; var child:Object; while (i < this.drawSprite.numChildren) { child = this.drawSprite.getChildAt(i); if (child is TextField) this.drawSprite.removeChildAt(i); else i++; } } protected function removeGlyphClone(glyph:SVGGlyphNode):void { glyph.svgParent = null; // unregister the element this.svgRoot.unregisterNode(glyph); // Remove from flash list. if ( glyph.topSprite ) { var child:DisplayObject; var i:int = 0; for (i = 0; i < viewBoxSprite.numChildren; i++) { child = viewBoxSprite.getChildAt(i); if (child == glyph.topSprite) { viewBoxSprite.removeChild(child); } } } } protected function removeOldSVGFontGlyphs():void { var i:int = 0; while (i < this.svgChildren.length) { if (this.svgChildren[i] is SVGGlyphNode) { this.removeGlyphClone(this.svgChildren[i]); this.svgChildren.splice(i, 1); } else i++ } } protected function addTextFieldChunk(chunk:String, startPos:Object, currentPos:Object, fontFamily:String, fontSizeNum:Number, textAnchor:String, fontWeight:String, fill:String):void { var textField:TextField = new TextField(); textField.text = chunk; textField.autoSize = TextFieldAutoSize.LEFT; var textFormat:TextFormat = new TextFormat(); if (fontWeight != null && fontWeight != 'normal') { textFormat.bold = true; } if (fontFamily != null) { fontFamily = fontFamily.replace(/'/g, ''); textFormat.font = fontFamily; } // choose a (nominal) size var nomSize:Number = 100.0; textFormat.size = nomSize; var fontScale:Number = fontSizeNum / nomSize; // used to scale the TextField to produce the correct size if (fill != null) { textFormat.color = SVGUnits.getColor(fill); } textField.setTextFormat(textFormat); var textLineMetrics:TextLineMetrics = textField.getLineMetrics(0); // apply text anchor var advance:Number = 0.0; // add to current text position var x:Number; var y:Number; switch (textAnchor) { case 'middle': x = - textField.width/2.0; advance = textLineMetrics.width * fontScale / 2.0; break; case 'end': x = 2.0 - textField.width; // advance = 0.0 break; default: //'start' x = -2.0; //gutter advance = textLineMetrics.width * fontScale; break; } y = -textLineMetrics.ascent - 2.0; // reposition the TextField to account for scaling and offset from startPos textField.y = fontScale * y + (currentPos.y - startPos.y); textField.x = fontScale * x + (currentPos.x - startPos.x); // scale the TextField to the required size textField.scaleX = fontScale; textField.scaleY = fontScale; // add textField to _textFields _textFields.push(textField); // update current text position currentPos.x += advance; } protected function addSVGFontChunk(chunk:String, startPos:Object, currentPos:Object, fontSizeNum:Number, textAnchor:String, fill:String):void { var i:uint; var chunkWidth:Number = 0.0; var glyphChar:String; var glyph:SVGGlyphNode; // calculate the width of the chunk for (i = 0; i < chunk.length; i++) { glyphChar = chunk.charAt(i); glyph = this._svgFont.getGlyph(glyphChar); chunkWidth += SVGUnits.parseNum(glyph.getAttribute('horiz-adv-x')); } var startOffsetX:Number = 0.0; var advance:Number = 0.0; var fontScale:Number = fontSizeNum / _svgFont.getUnitsPerEm(); // apply text anchor switch (textAnchor) { case 'middle': startOffsetX = - chunkWidth / 2.0; advance = chunkWidth / 2.0; break; case 'end': startOffsetX = -chunkWidth; // advance = 0.0; break; default: //'start' // startOffsetX = 0.0 advance = chunkWidth; break; } //Add a glyph for each character in the text chunk var glyphX:Number = startOffsetX + (currentPos.x - startPos.x) / fontScale; var glyphY:Number = -(currentPos.y - startPos.y) / fontScale; for (i = 0; i < chunk.length; i++) { glyphChar = chunk.charAt(i); glyph = this._svgFont.getGlyph(glyphChar); var glyphClone:SVGNode = glyph.clone(); if (fill !=null) { glyphClone.setAttribute('fill', fill); } glyphClone.setAttribute('transform', 'scale(' + fontScale + ') scale(1,-1)'); glyphClone.setAttribute('x', String(glyphX)); glyphClone.setAttribute('y', String(glyphY)); glyphX += SVGUnits.parseNum(glyph.getAttribute('horiz-adv-x')); glyphClone.topSprite.visible=false; newGlyphs.push(glyphClone); addSVGChild(glyphClone); lastGlyph=glyphClone; } // update current text position currentPos.x += chunkWidth * fontScale; } /** * Get any child text (not text inside child nodes) * If this node has any text create a TextField at this._textField * Call SVGNode.parse() **/ override protected function parseChildren():void { var i:uint; super.parseChildren(); //Check for SVGFont var fontFamily:String = this.getStyleOrAttr('font-family'); this._svgFont = this.svgRoot.getFont(fontFamily); if (this._svgFont != null) { removeOldTextFields(); _textFields = new Array(); newGlyphs = new Array(); } else { removeOldSVGFontGlyphs(); newGlyphs = new Array(); _textFields = new Array(); } var fontSize:String = this.getStyleOrAttr('font-size'); var fontSizeNum:Number = 12.0; // default if (fontSize != null) { fontSizeNum = SVGUnits.parseNum(fontSize); //Font size can be in user units, pixels (px), or points (pt); if no //measurement type given defaults to user units if (SVGUnits.getType(fontSize) == SVGUnits.PT) { fontSizeNum = SVGUnits.pointsToPixels(fontSizeNum); } } var fill:String = this.getStyleOrAttr('fill'); if (fill == 'currentColor') { fill = this.getStyleOrAttr('color'); } var fontWeight:String = this.getStyleOrAttr('font-weight'); var textAnchor:String = this.getStyleOrAttr('text-anchor'); var currentNode:SVGNode = this; while (textAnchor == 'inherit') { if (currentNode.svgParent != null) { currentNode = currentNode.svgParent; textAnchor = currentNode.getStyleOrAttr('text-anchor'); } else { textAnchor = null; } } // process text chunks var glyphXOffsets:Array = new Array(); var xString:String = super.getAttribute('x', '0'); xString = xString.replace(/,/sg," "); //Replace commas with spaces glyphXOffsets = xString.split(/\s+/); var glyphYOffsets:Array = new Array(); var yString:String = super.getAttribute('y', '0'); yString = yString.replace(/,/sg," "); //Replace commas with spaces glyphYOffsets = yString.split(/\s+/); var startGlyphX:Number = glyphXOffsets[0]; var startGlyphY:Number = glyphYOffsets[0]; // startPos is the x,y position assigned to drawSprite at setAttributes() // all positioning of TextFields or glyphClones is set relative to startPos var startPos:Object = {x:startGlyphX, y:startGlyphY}; var currentPos:Object = {x:startGlyphX, y:startGlyphY}; // Current Text Position var numChunks:int = Math.max(glyphXOffsets.length, glyphYOffsets.length); numChunks = Math.min(numChunks, this._text.length); var chunk:String = ""; for (i=0; i < numChunks; i++) { if (i < glyphXOffsets.length) { currentPos.x = Number(glyphXOffsets[i]); } if (i < glyphYOffsets.length) { currentPos.y = Number(glyphYOffsets[i]); } if (i == numChunks-1) { // lastchunk chunk = this._text.slice(i); } else { // single glyph chunk = this._text.charAt(i); } if (this._svgFont != null) addSVGFontChunk(chunk, startPos, currentPos, fontSizeNum, textAnchor, fill); else addTextFieldChunk(chunk, startPos, currentPos, fontFamily, fontSizeNum, textAnchor, fontWeight, fill); } } public function onDrawGlyph(glyph:SVGNode):void { // when they are ready, unhide the new characters, // and remove the old if (glyph == lastGlyph && newGlyphs != null) { for (var i:uint=0; i < this.svgChildren.length; i++) { if (this.svgChildren[i] is SVGGlyphNode) { if (newGlyphs.indexOf(this.svgChildren[i]) == -1) { removeGlyphClone(this.svgChildren[i]); this.svgChildren.splice(i, 1); i--; } else { this.svgChildren[i].topSprite.visible=true; } } } newGlyphs = null; } } override public function handleAttrChange(name:String, value:String, attrNamespace:String = null):void { super.handleAttrChange(name, value, attrNamespace); if (this._svgFont == null && name == 'transform' && isSkewed() ) { invalidateDisplay(); } } public function isSkewed():Boolean { // Issue 158: Native fonts do not display if skewed or // rotated. So, we need to use the rotationZ=0 trick // to convert to a bitmap, otherwise the text disappears. // Note we need to check the parents for transforms also. var svgNode:SVGNode = this; var concatMatrix:Matrix = new Matrix(); var oldMatrix:Matrix; while (svgNode) { if (svgNode.getAttribute('transform') != null) { oldMatrix = this.parseTransform(svgNode.getAttribute('transform')); oldMatrix.concat(concatMatrix); concatMatrix = oldMatrix; } if (svgNode is SVGSVGNode) { break; } svgNode = svgNode.svgParent; } return (concatMatrix.b != 0 || concatMatrix.c != 0); } override public function getAttribute(name:String, defaultValue:* = null, inherit:Boolean = true, applyAnimations:Boolean = true, useStyle:Boolean = false):* { if (name == 'stroke-width' && this._svgFont != null) { // Relevant to SVG Fonts only var fontSize:String = this.getStyleOrAttr('font-size'); var fontSizeNum:Number = SVGUnits.parseNum(fontSize); var strokeWidthStr:String = super.getAttribute(name, defaultValue, inherit, true, true); var strokeWidth:Number = SVGUnits.parseNum(strokeWidthStr); strokeWidth = strokeWidth * (1024 / fontSizeNum); return String(strokeWidth); } else if ( (name == "x" || name == "y") ) { var xString:String = super.getAttribute(name, defaultValue, inherit, applyAnimations, false); if (xString != null) { xString = xString.replace(/,/sg," "); //Replace commas with spaces if (xString.split(/\s+/).length >= 2) { return xString.split(/\s+/)[0]; } else { return xString; } } else { return xString; } } else { return super.getAttribute(name, defaultValue, inherit, applyAnimations, useStyle); } } override protected function draw():void { super.draw(); removeOldTextFields(); var isSkewed:Boolean = isSkewed(); // add the new textFields if (_textFields != null) { for (var i:uint=0; i 1) { var elem:XML; for each(elem in list) { blurXML=elem; } } else { blurXML=XML(list); } var svgNode:SVGNode = objectToFilter; var concatMatrix:Matrix = new Matrix(); var oldMatrix:Matrix; while (svgNode) { if (svgNode.getAttribute('transform') != null) { oldMatrix = this.parseTransform(svgNode.getAttribute('transform')); oldMatrix.concat(concatMatrix); concatMatrix = oldMatrix; } if (svgNode is SVGSVGNode) { break; } svgNode = svgNode.svgParent; } var stdDeviation:String = blurXML.@stdDeviation.toString(); var stdDeviationX:String; var stdDeviationY:String; if (stdDeviation == null) { stdDeviationX = stdDeviationY = '4'; } else { var values:Array = stdDeviation.split(/\s+/); if (values.length > 1) { stdDeviationX = values[0]; stdDeviationY = values[1]; } else { stdDeviationX = stdDeviationY = values[0]; } } var blurAmountX:Number = SVGUnits.parseNum(stdDeviationX); var blurAmountY:Number = SVGUnits.parseNum(stdDeviationY); blurAmountX = blurAmountX * concatMatrix.a; blurAmountY = blurAmountY * concatMatrix.a; nodeFilters.push(new BlurFilter(blurAmountX*1.5, blurAmountY*1.5, 8)); } return nodeFilters; } } } ���������������������������������������������������������������������������������������������������debian/contrib/websvg/src/org/svgweb/tests/���������������������������������������������������������0002755�0000000�0000000�00000000000�12252640275�016147� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������debian/contrib/websvg/src/org/svgweb/tests/anim1.svg������������������������������������������������0000755�0000000�0000000�00000011652�12252640275�017703� 0����������������������������������������������������������������������������������������������������ustar �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������� begins at "2s; 5s" "rectToBegin1.click" "6s;rectToBegin2.click" "-1s; 8s; 12s" Click me (rectToBegin1) to start second rect Click me (rectToBegin2) to start third rect Click me (rectToSeek1) to seek to doc start (anim of top rect) Click me (rectToSeek2) to seek to animation of left rect Click me (rectToSeek3) to seek to animation of right rect ��������������������������������������������������������������������������������������debian/contrib/websvg/src/org/svgweb/tests/svgflextest.mxml�����������������������������������������0000644�0000000�0000000�00000001405�12252640275�021422� 0����������������������������������������������������������������������������������������������������ustar �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������� private function myInit():void { // The FlashVars var obj:Object = Application.application.parameters; var item:String; for (item in obj) { if (item == "loadURL") { svgflex.viewer.loadURL(obj[item]); } } // An alternative to the above is to set the xml directly: // svgflex.viewer.xml = new XML("<svg></svg>"); } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������debian/contrib/websvg/src/org/svgweb/tests/preserveAspectRatio.svg����������������������������������0000644�0000000�0000000�00000007724�12252640275�022672� 0����������������������������������������������������������������������������������������������������ustar �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������� "> "> "> ]> Example PreserveAspectRatio - illustrates preserveAspectRatio attribute SVG to fit &Smile; Viewport 1 &Viewport1; Viewport 2 &Viewport2; --------------- meet --------------- xMin*&Viewport1; &Smile; xMid*&Viewport1; &Smile; xMax*&Viewport1; &Smile; ---------- meet ---------- *YMin&Viewport2; &Smile; *YMid&Viewport2; &Smile; *YMax&Viewport2; &Smile; ---------- slice ---------- xMin*&Viewport2; &Smile; xMid*&Viewport2; &Smile; xMax*&Viewport2; &Smile; --------------- slice --------------- *YMin&Viewport1; &Smile; *YMid&Viewport1; &Smile; *YMax&Viewport1; &Smile; ��������������������������������������������debian/contrib/websvg/src/org/svgweb/tests/SVGViewerFlashTest.as������������������������������������0000644�0000000�0000000�00000003024�12252640275�022130� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* Copyright (c) 2009 by contributors: * James Hight (http://labs.zavoo.com/) * Richard R. Masters Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package org.svgweb.tests { import org.svgweb.SVGViewerFlash; import flash.display.Sprite; [SWF(frameRate="40", width="800", height="600")] public class SVGViewerFlashTest extends Sprite { private var svgImage:SVGViewerFlash; public function SVGViewerFlashTest() { super(); svgImage = new SVGViewerFlash(); this.addChild(svgImage); svgImage.xml = new XML('' + ''); } } } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������debian/contrib/websvg/src/org/svgweb/tests/lineargradient4.svg��������������������������������������0000644�0000000�0000000�00000002666�12252640275�021754� 0����������������������������������������������������������������������������������������������������ustar �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������� ��������������������������������������������������������������������������debian/contrib/websvg/src/org/svgweb/tests/pencil.svg�����������������������������������������������0000644�0000000�0000000�00000017723�12252640275�020152� 0����������������������������������������������������������������������������������������������������ustar �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������� image/svg+xml ���������������������������������������������debian/contrib/websvg/src/org/svgweb/tests/gaussian1.svg��������������������������������������������0000644�0000000�0000000�00000025532�12252640275�020570� 0����������������������������������������������������������������������������������������������������ustar �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������� ����������������������������������������������������������������������������������������������������������������������������������������������������������������������debian/contrib/websvg/src/org/svgweb/tests/pservers-grad-03-b-anim.svg������������������������������0000755�0000000�0000000�00000014156�12252640275�023045� 0����������������������������������������������������������������������������������������������������ustar �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������� Test that the viewer can handle the xlink:href attribute on patterns. There are two rectangles with a pattern fill made up of 4 rectangles. The pattern definition of the lower one references the pattern definition of the upper one, using the xlink:href attribute. Because the particular way that the patterns and rectangles are defined in this test case, the two fills will appear the same - the rectangles are positioned on pattern-size boundaries, so that the offsets into the pattern at the left edges of the respective rectangles is identical. The rendered picture should match the reference image, except for possible variations in the labelling text (per CSS2 rules). pservers-grad-03-b Test that the viewer can handle the xlink:href attribute on patterns. Pattern fill animation. Referencing pattern fill below. $Revision: 1.6 $ ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������debian/contrib/websvg/src/org/svgweb/tests/paths-data-09-t.svg��������������������������������������0000755�0000000�0000000�00000012560�12252640275�021412� 0����������������������������������������������������������������������������������������������������ustar �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������� Verify the basic capability to handle the 'path' element, and its data attribute (d) in combination with the straight-line path commands. Two pairs of concentric equilateral triangles are drawn using m and z. No l commands are used in this test as they are implied after an m or z command. The shapes are identical, with one stroked and one filled. The fill-mode default of "even-odd" means that the inner triangle is hollow. The rendered picture should match the reference image exactly, except for possible variations in the labelling text (per CSS2 rules). The test uses the 'path' element, as well as basic fill (solid primary colors), stroke (black 1-pixel lines), font-family (Arial) and font-size properties. paths-data-09-t Test that viewer has the basic capability to handle the <path> element and data (d) attribute in combination with the moveto and closepath commands - m and z. Lines drawn with commands: m and z $Revision: 1.11 $ ������������������������������������������������������������������������������������������������������������������������������������������������debian/contrib/websvg/src/org/svgweb/tests/mouseEvents.svg������������������������������������������0000644�0000000�0000000�00000002634�12252640275�021210� 0����������������������������������������������������������������������������������������������������ustar �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������� ����������������������������������������������������������������������������������������������������debian/contrib/websvg/src/org/svgweb/tests/anim2.svg������������������������������������������������0000755�0000000�0000000�00000012477�12252640275�017712� 0����������������������������������������������������������������������������������������������������ustar �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������� begins at "2s; 5s" "rectToBegin1.click" "6s;rectToBegin2.click" "-1s; 8s; 12s" Click me (rectToBegin1) to start second rect Click me (rectToBegin2) to start third rect Click me (rectToSeek1) to seek to doc start (anim of top rect) Click me (rectToSeek2) to seek to animation of left rect Click me (rectToSeek3) to seek to animation of right rect �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������debian/contrib/websvg/src/org/svgweb/tests/lineargradient1.svg��������������������������������������0000644�0000000�0000000�00000006071�12252640275�021743� 0����������������������������������������������������������������������������������������������������ustar �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������debian/contrib/websvg/src/org/svgweb/tests/smile.svg������������������������������������������������0000644�0000000�0000000�00000001470�12252640275�020001� 0����������������������������������������������������������������������������������������������������ustar �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������� "> "> "> ]> &Smile; ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������debian/contrib/websvg/src/org/svgweb/tests/clippath.svg���������������������������������������������0000644�0000000�0000000�00000004536�12252640275�020502� 0����������������������������������������������������������������������������������������������������ustar �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������� ������������������������������������������������������������������������������������������������������������������������������������������������������������������debian/contrib/websvg/src/org/svgweb/tests/anim3.svg������������������������������������������������0000755�0000000�0000000�00000010246�12252640275�017703� 0����������������������������������������������������������������������������������������������������ustar �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������� begin="2s; 7s" dur="4s" from="0" to="300" fill="freeze" begin="2s; 7s" dur="4s" values="0;300" fill="freeze" begin="2s; 7s" dur="4s" values="0;300" keySplines=".5 0 .5 1" fill="freeze" begin="2s; 7s" dur="4s" values="0;100;300" keyTimes="0;0.5;1.0" fill="freeze" begin="2s; 7s" dur="4s" values="0;100;300" keyTimes="0;0.5;1.0" keySplines=".5 0 .5 1;1 0 .25 .25" fill="freeze" Click me (rectToSeek1) to seek to doc start (anim of top rect) ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������debian/contrib/websvg/src/org/svgweb/tests/gaussian3.svg��������������������������������������������0000644�0000000�0000000�00000004302�12252640275�020562� 0����������������������������������������������������������������������������������������������������ustar �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������� ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������debian/contrib/websvg/src/org/svgweb/tests/image.svg������������������������������������������������0000644�0000000�0000000�00000001423�12252640275�017750� 0����������������������������������������������������������������������������������������������������ustar �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������� ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������debian/contrib/websvg/src/org/svgweb/tests/gaussian2.svg��������������������������������������������0000644�0000000�0000000�00000003763�12252640275�020573� 0����������������������������������������������������������������������������������������������������ustar �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������� �������������debian/contrib/websvg/src/org/svgweb/tests/radialgradient1.svg��������������������������������������0000644�0000000�0000000�00000006371�12252640275�021730� 0����������������������������������������������������������������������������������������������������ustar �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������debian/contrib/websvg/src/org/svgweb/tests/paths-data-08-t.svg��������������������������������������0000755�0000000�0000000�00000013000�12252640275�021377� 0����������������������������������������������������������������������������������������������������ustar �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������� Verify the basic capability to handle the 'path' element, and its data attribute (d) in combination with the straight-line path commands. Two pairs of concentric equilateral triangles are drawn using M and Z. No L commands are used in this test as they are implied after an M or Z command. The shapes are identical, with one stroked and one filled. The fill-mode default of "even-odd" means that the inner triangle is hollow. The rendered picture should match the reference image exactly, except for possible variations in the labelling text (per CSS2 rules). The test uses the 'path' element, as well as basic fill (solid primary colors), stroke (black 1-pixel lines), font-family (Arial) and font-size properties. paths-data-08-t Test that viewer has the basic capability to handle the <path> element and data (d) attribute in combination with the moveto and closepath commands - M and Z. Lines drawn with commands: M and Z stroked filled $Revision: 1.11 $ debian/contrib/websvg/src/org/svgweb/tests/lineargradient2.svg��������������������������������������0000644�0000000�0000000�00000006114�12252640275�021742� 0����������������������������������������������������������������������������������������������������ustar �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������� ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������debian/contrib/websvg/src/org/svgweb/tests/video1.svg�����������������������������������������������0000755�0000000�0000000�00000012376�12252640275�020071� 0����������������������������������������������������������������������������������������������������ustar �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������� begin="2s; 7s" dur="4s" from="0" to="300" fill="freeze" begin="2s; 7s" dur="4s" values="0;300" fill="freeze" begin="2s; 7s" dur="4s" values="0;300" keySplines=".5 0 .5 1" fill="freeze" begin="2s; 7s" dur="4s" values="0;100;300" keyTimes="0;0.5;1.0" fill="freeze" begin="2s; 7s" dur="4s" values="0;100;300" keyTimes="0;0.5;1.0" keySplines=".5 0 .5 1;1 0 .25 .25" fill="freeze" Click me (rectToSeek1) to seek to doc start (anim of top rect) ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������debian/contrib/websvg/src/org/svgweb/tests/lineargradient3.svg��������������������������������������0000644�0000000�0000000�00000002715�12252640275�021746� 0����������������������������������������������������������������������������������������������������ustar �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������� ���������������������������������������������������debian/contrib/websvg/src/org/svgweb/tests/circles1.svg���������������������������������������������0000644�0000000�0000000�00000001246�12252640275�020376� 0����������������������������������������������������������������������������������������������������ustar �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������� ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������debian/contrib/websvg/src/org/svgweb/utils/���������������������������������������������������������0002755�0000000�0000000�00000000000�12252640275�016145� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������debian/contrib/websvg/src/org/svgweb/utils/PathParser.as��������������������������������������������0000644�0000000�0000000�00000012531�12252640275�020543� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* Copyright (c) 2009 by contributors: * James Hight (http://labs.zavoo.com/) * Richard R. Masters Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package org.svgweb.utils { public class PathParser { /** * Normalize SVG Path Data into an array we can work with. */ public static function parseSVGPath(data:String):Array { // NOTE: This code is very performance sensitive and was // a bottleneck affecting page load; rewritten to not use // regular expressions as well as other tricks that were shown // to be faster (like caching data.length, parsing right into // an array instead of an intermediate string, etc.). // Be careful when changing this code without seeing what the // performance is before and after. See // Issue 229 for details: // "Speedup page load time of MichaelN's static map page on IE" // http://code.google.com/p/svgweb/issues/detail?id=229 //var totalTime:int = new Date().getTime(); data = SVGUnits.trim(data); // In the algorithm below, we are doing a few things. It is // unfortunately complicated but it was found to be the primary // bottleneck when dealing with lots of PATH statements. // We use the charCode since as a number it is much faster than // dealing with strings. We test the value against the Unicode // values for the numerical and alphabetical ranges for our // commands, which is fast. We also order our IF statements from // most common (numbers) to least common (letter commands). Testing // also paradoxically found that simply building up another // string is much faster than having an intermediate array; arrays // in ActionScript are very slow, and the final split() method // is very fast at producing an array we can work with var results:String = ''; var dataLength:int = data.length; // found to be faster var c:String; var code:Number; var i:int = 0; while (i < dataLength) { code = data.charCodeAt(i); // from most common to least common encountered if ((code >= 48 && code <= 57) || code == 45 || code == 46 || code == 43) { // start of a number 0..9, -, ., + var period:Number = 46; // used to terminate on encountering a second '.' // a sequence like 1.234.456 or 1..2 is valid // equvalent to 1.234 .567 or 1. .2 do { if (code == 46) period = 34; // change to '"' so loop stops on next '.' results += data.charAt(i); i++; code = data.charCodeAt(i); } while (code && ((code >= 48 && code <= 57) || code == period)); // check for exponent e or E // assume never have a number starting with -e or .e or +e if (code && (code == 101 || code == 69)) { results += 'e'; i++; code = data.charCodeAt(i); if (code && (code == 43 || code == 45)) { // optional +/- results += data.charAt(i); i++; code = data.charCodeAt(i); } while (code && (code >= 48 && code <= 57)) { // collect a digit-sequence results += data.charAt(i); i++; code = data.charCodeAt(i); } } results += ','; } else if (code == 44 || code == 32 || code == 10 || code == 13) { // just ignore delimiters since we are adding in our own // in the correct places i++; } else if (code >= 65 && code <= 122) { // A-Z and a-z results += data.charAt(i) + ','; i++; } else { // unknown/unexpected character i++; } } // remove trailing comma, but outside of big loop above if (results.charAt(results.length - 1) == ',') { results = results.substring(0, results.length - 1); } return results.split(','); } } } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������debian/contrib/websvg/src/org/svgweb/utils/SVGUnits.as����������������������������������������������0000755�0000000�0000000�00000044604�12252640275�020165� 0����������������������������������������������������������������������������������������������������ustar �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������� /* Copyright (c) 2009 by contributors: * Google Inc. (Brad Neuberg -- http://codinginparadise.org) * James Hight (http://labs.zavoo.com/) * Richard R. Masters Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package org.svgweb.utils { import flash.system.Capabilities; public class SVGUnits { static public var UNKNOWN:Number = 0; static public var USER:Number = 1; /* User coordinates */ // CSS Unit Types static public var EM:Number = 2; static public var EX:Number = 3; static public var PX:Number = 4; static public var PT:Number = 5; static public var PC:Number = 6; static public var CM:Number = 7; static public var MM:Number = 8; static public var IN:Number = 9; static public var PERCENT:Number = 10; /* Relative percentage; ex: 50% */ /** * Determines the type of unit given, such as pixels, points, ems, etc. * * @param String to check for unit type. * * @returns Null if none if the available types, otherwise returns one * of the static constants on this class such as SVGUnits.PX, SVGUnits.PT, * etc. **/ static public function getType(unit:*):int { if (unit === null || unit === undefined || unit === '') { return UNKNOWN; } // FIXME: Handle negative values; the spec says implementations // don't have to handle them but should convert them into a usable // form if (/em\s*$/.test(unit)) { return SVGUnits.EM; } else if (/ex\s*$/.test(unit)) { return SVGUnits.EX; } else if (/px\s*$/.test(unit)) { return SVGUnits.PX; } else if (/pt\s*$/.test(unit)) { return SVGUnits.PT; } else if (/pc\s*$/.test(unit)) { return SVGUnits.PC; } else if (/cm\s*$/.test(unit)) { return SVGUnits.CM; } else if (/mm\s*$/.test(unit)) { return SVGUnits.MM; } else if (/in\s*$/.test(unit)) { return SVGUnits.IN; } else if (/^\s*[0-9]+\s*$/.test(unit)) { return SVGUnits.USER; } else if (/^\s*[0-9]+%\s*$/.test(unit)) { return SVGUnits.PERCENT; } else { return UNKNOWN; } } /** * Converts a given point value to it's pixel equivalent. * * @param Numeric point value to be converted. * * @return Numeric pixel value. **/ static public function pointsToPixels(num:Number):Number { return num * (Capabilities.screenDPI / 72); } // Convert number to seconds static public function parseTimeVal(timeVal:String):Number { if (timeVal.indexOf("ms") != -1) { return SVGUnits.parseNum(timeVal) / 1000; } else { return SVGUnits.parseNum(timeVal); } } /** * Object of colors by name **/ static public var colors:Object = {}; colors.blue=0x0000ff; colors.green=0x008000; colors.red=0xff0000; colors.aliceblue=0xf0f8ff; colors.antiquewhite=0xfaebd7; colors.aqua=0x00ffff; colors.aquamarine=0x7fffd4; colors.azure=0xf0ffff; colors.beige=0xf5f5dc; colors.bisque=0xffe4c4; colors.black=0x000000; colors.blanchedalmond=0xffebcd; colors.blueviolet=0x8a2be2; colors.brown= 0xa52a2a; colors.burlywood = 0xdeb887; colors.cadetblue = 0x5f9ea0; colors.chartreuse = 0x7fff00; colors.chocolate = 0xd2691e; colors.coral= 0xff7f50; colors.cornflowerblue = 0x6495ed; colors.cornsilk = 0xfff8dc; colors.crimson = 0xdc143c; colors.cyan = 0x00ffff; colors.darkblue = 0x00008b; colors.darkcyan = 0x008b8b; colors.darkgoldenrod = 0xb8860b; colors.darkgray = 0xa9a9a9; colors.darkgreen = 0x006400; colors.darkgrey = 0xa9a9a9; colors.darkkhaki = 0xbdb76b; colors.darkmagenta = 0x8b008b; colors.darkolivegreen = 0x556b2f; colors.darkorange = 0xff8c00; colors.darkorchid = 0x9932cc; colors.darkred = 0x8b0000; colors.darksalmon = 0xe9967a; colors.darkseagreen = 0x8fbc8f; colors.darkslateblue = 0x483d8b; colors.darkslategray = 0x2f4f4f; colors.darkslategrey = 0x2f4f4f; colors.darkturquoise = 0x00ced1; colors.darkviolet = 0x9400d3; colors.deeppink = 0xff1493; colors.deepskyblue = 0x00bfff; colors.dimgray = 0x696969; colors.dimgrey = 0x696969; colors.dodgerblue = 0x1e90ff; colors.firebrick = 0xb22222; colors.floralwhite = 0xfffaf0; colors.forestgreen = 0x228b22; colors.fuchsia = 0xff00ff; colors.gainsboro = 0xdcdcdc; colors.ghostwhite = 0xf8f8ff; colors.gold = 0xffd700; colors.goldenrod = 0xdaa520; colors.gray = 0x808080; colors.grey = 0x808080; colors.greenyellow = 0xadff2f; colors.honeydew = 0xf0fff0; colors.hotpink = 0xff69b4; colors.indianred = 0xcd5c5c; colors.indigo = 0x4b0082; colors.ivory = 0xfffff0; colors.khaki = 0xf0e68c; colors.lavender = 0xe6e6fa; colors.lavenderblush = 0xfff0f5; colors.lawngreen = 0x7cfc00; colors.lemonchiffon = 0xfffacd; colors.lightblue = 0xadd8e6; colors.lightcoral = 0xf08080; colors.lightcyan = 0xe0ffff; colors.lightgoldenrodyellow = 0xfafad2; colors.lightgray = 0xd3d3d3; colors.lightgreen = 0x90ee90; colors.lightgrey = 0xd3d3d3; colors.lightpink = 0xffb6c1; colors.lightsalmon = 0xffa07a; colors.lightseagreen = 0x20b2aa; colors.lightskyblue = 0x87cefa; colors.lightslategray = 0x778899; colors.lightslategrey = 0x778899; colors.lightsteelblue = 0xb0c4de; colors.lightyellow = 0xffffe0; colors.lime = 0x00ff00; colors.limegreen = 0x32cd32; colors.linen = 0xfaf0e6; colors.magenta = 0xff00ff; colors.maroon = 0x800000; colors.mediumaquamarine = 0x66cdaa; colors.mediumblue = 0x0000cd; colors.mediumorchid = 0xba55d3; colors.mediumpurple = 0x9370db; colors.mediumseagreen = 0x3cb371; colors.mediumslateblue = 0x7b68ee; colors.mediumspringgreen = 0x00fa9a; colors.mediumturquoise = 0x48d1cc; colors.mediumvioletred = 0xc71585; colors.midnightblue = 0x191970; colors.mintcream = 0xf5fffa; colors.mistyrose = 0xffe4e1; colors.moccasin = 0xffe4b5; colors.navajowhite = 0xffdead; colors.navy = 0x000080; colors.oldlace = 0xfdf5e6; colors.olive = 0x808000; colors.olivedrab = 0x6b8e23; colors.orange = 0xffa500; colors.orangered = 0xff4500; colors.orchid = 0xda70d6; colors.palegoldenrod = 0xeee8aa; colors.palegreen = 0x98fb98; colors.paleturquoise = 0xafeeee; colors.palevioletred = 0xdb7093; colors.papayawhip = 0xffefd5; colors.peachpuff = 0xffdab9; colors.peru = 0xcd853f; colors.pink = 0xffc0cb; colors.plum = 0xdda0dd; colors.powderblue = 0xb0e0e6; colors.purple = 0x800080; colors.rosybrown = 0xbc8f8f; colors.royalblue = 0x4169e1; colors.saddlebrown = 0x8b4513; colors.salmon = 0xfa8072; colors.sandybrown = 0xf4a460; colors.seagreen = 0x2e8b57; colors.seashell = 0xfff5ee; colors.sienna = 0xa0522d; colors.silver = 0xc0c0c0; colors.skyblue = 0x87ceeb; colors.slateblue = 0x6a5acd; colors.slategray = 0x708090; colors.slategrey = 0x708090; colors.snow = 0xfffafa; colors.springgreen = 0x00ff7f; colors.steelblue = 0x4682b4; colors.tan = 0xd2b48c; colors.teal = 0x008080; colors.thistle = 0xd8bfd8; colors.tomato = 0xff6347; colors.turquoise = 0x40e0d0; colors.violet = 0xee82ee; colors.wheat = 0xf5deb3; colors.white = 0xffffff; colors.whitesmoke = 0xf5f5f5; colors.yellow = 0xffff00; colors.yellowgreen = 0x9acd32; static public function rgbToNumber (r:uint, g:uint, b:uint):Number { return (r << 16) | (g << 8) | (b); } /** * Get the number value of a color string * * @param color String value of a color ('black', '#ff0000', etc...) * * @return [ Numeric value of color , opacity ] **/ static public function getColor(color:String):Number { var r:int = 0; var g:int = 0; var b:int = 0; if (color != null) { color=color.replace(/ /g, ""); if(color.match(/^#/)) { // #456 is short for #445566 if (color.length == 4) { var rval:String, gval:String, bval:String; rval = color.substr(1,1) + color.substr(1,1); gval = color.substr(2,1) + color.substr(2,1); bval = color.substr(3,1) + color.substr(3,1); color = "#" + rval + gval + bval; } color = color.replace('#', '0x'); return parseInt(color); } else if ( (color.indexOf("rgb") != -1) || color.indexOf("RGB") != -1) { var str:Array = color.replace(/\s|rgb\(|\)/gi, "").split(","); if (str[0].match(/%/)) { str[0]=str[0].replace(/%/g, ""); r = str[0]; r = r * 255 / 100; } else { r = str[0]; } if (str[1].match(/%/)) { str[1]=str[1].replace(/%/g, ""); g = str[1]; g = g * 255 / 100; } else { g = str[1]; } if (str[2].match(/%/)) { str[2]=str[2].replace(/%/g, ""); b = str[2]; b = b * 255 / 100; } else { b = str[2]; } return rgbToNumber(r, g, b); } else if (colors.hasOwnProperty(color)) { return colors[color]; } else { return Number(color); } } return 0x000000; } static public function getColorAndAlpha(color:String):Array { var r:int = 0; var g:int = 0; var b:int = 0; var a:Number = 0.0; var str:Array; if (color != null) { color=color.replace(/\s/g, ""); if(color.match(/^#/)) { // #456 is short for #445566 if (color.length == 4) { var rval:String, gval:String, bval:String; rval = color.substr(1,1) + color.substr(1,1); gval = color.substr(2,1) + color.substr(2,1); bval = color.substr(3,1) + color.substr(3,1); color = "#" + rval + gval + bval; } color = color.replace('#', '0x'); return [ parseInt(color), 1.0 ]; } else if(color.indexOf("rgba") != -1) { str = color.replace(/\s|rgba\(|\)/g, "").split(","); if (str[0].match(/%/)) { str[0]=str[0].replace(/%/g, ""); r = str[0]; r = r * 255 / 100; } else { r = str[0]; } if (str[1].match(/%/)) { str[1]=str[1].replace(/%/g, ""); g = str[1]; g = g * 255 / 100; } else { g = str[1]; } if (str[2].match(/%/)) { str[2]=str[2].replace(/%/g, ""); b = str[2]; b = b * 255 / 100; } else { b = str[2]; } if (str[3].match(/%/)) { str[3]=str[3].replace(/%/g, ""); a = str[3]; a = a / 100.0; } else { a = str[3]; } return [ rgbToNumber(r, g, b), a ]; } else if(color.indexOf("rgb") != -1) { str = color.replace(/\s|rgb\(|\)/g, "").split(","); if (str[0].match(/%/)) { str[0]=str[0].replace(/%/g, ""); r = str[0]; r = r * 255 / 100; } else { r = str[0]; } if (str[1].match(/%/)) { str[1]=str[1].replace(/%/g, ""); g = str[1]; g = g * 255 / 100; } else { g = str[1]; } if (str[2].match(/%/)) { str[2]=str[2].replace(/%/g, ""); b = str[2]; b = b * 255 / 100; } else { b = str[2]; } return [ rgbToNumber(r, g, b), 1.0 ]; } else if (colors.hasOwnProperty(color)) { return [ colors[color], 1.0 ]; } else { return [ Number(color), 1.0 ]; } } return [ 0x000000, 0.0 ]; } /** * Remove the numeric value of string will all characters removed except '0-9', '.', and '-' * * @param String to be cleaned * * @return Numeric value of string will all characters removed except '0-9', '.', and '-' **/ static public function parseNum(num:*):Number { if (num == null) { return 0; } var numString:String = String(num); if (isColor(numString)) { return SVGUnits.getColor(numString); } numString = numString.replace(/[^0-9\.\-eE]+/sig,''); return Number(numString); } static public function isColor(colorString:String):Boolean { if ( colorString.match(/^#/) || (colorString.indexOf("rgb") != -1) || (colors.hasOwnProperty(colorString)) ) { return true; } else { return false; } } // the second parameter is the maximum value to be used for percent values static public function parseNumPct(numParam:*, max:Number):Number { var numString:String = String(numParam); if (numString.match(/%/)) { numString=numString.replace(/%/g, ""); var num:Number = SVGUnits.parseNum(numString); num = num * max / 100; return num; } else { return SVGUnits.parseNum(numString); } } static public function trim(string:String):String { if (string) { return string.replace(/^\s+/s, '').replace(/\s+$/s, ''); } return string; } // convert a number into a color string value static public function colorString(colorVal:Number):String { var color:String = colorVal.toString(16); while (color.length < 6) { color = "0" + color; } if (color.length > 6) color.slice(color.length-6, color.length); color = "#" + color; return color; } static public function addColors(a:Number, b:Number):Number { var aR : uint = uint(a) >> 16; var aG : uint = ( uint(a) >> 8 ) & 0xff; var aB : uint = uint(a) & 0xff; var bR : uint = Math.min(aR + ( (uint(b) >> 16) & 0xff), 0xff); var bG : uint = Math.min(aG + ( (uint(b) >> 8 ) & 0xff), 0xff); var bB : uint = Math.min(aB + (uint(b) & 0xff), 0xff); return (bR << 16) | (bG << 8) | bB; } } } ����������������������������������������������������������������������������������������������������������������������������debian/contrib/websvg/src/org/svgweb/utils/EllipticalArc.as�����������������������������������������0000755�0000000�0000000�00000021334�12252640275�021206� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* Copyright (c) 2009 by contributors: * James Hight (http://labs.zavoo.com/) * Richard R. Masters Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package org.svgweb.utils { import flash.display.GraphicsPath; /** * Functions from degrafa * com.degrafa.geometry.utilities.ArcUtils **/ public class EllipticalArc { /** * @private **/ private static function computeSvgArc(rx:Number, ry:Number,angle:Number,largeArcFlag:Boolean,sweepFlag:Boolean, x:Number,y:Number,LastPointX:Number, LastPointY:Number):Object { //store before we do anything with it var xAxisRotation:Number = angle; // Compute the half distance between the current and the final point var dx2:Number = (LastPointX - x) / 2.0; var dy2:Number = (LastPointY - y) / 2.0; // Convert angle from degrees to radians angle = degressToRadius(angle); var cosAngle:Number = Math.cos(angle); var sinAngle:Number = Math.sin(angle); //Compute (x1, y1) var x1:Number = (cosAngle * dx2 + sinAngle * dy2); var y1:Number = (-sinAngle * dx2 + cosAngle * dy2); // Ensure radii are large enough rx = Math.abs(rx); ry = Math.abs(ry); var Prx:Number = rx * rx; var Pry:Number = ry * ry; var Px1:Number = x1 * x1; var Py1:Number = y1 * y1; // check that radii are large enough var radiiCheck:Number = Px1/Prx + Py1/Pry; if (radiiCheck > 1) { rx = Math.sqrt(radiiCheck) * rx; ry = Math.sqrt(radiiCheck) * ry; Prx = rx * rx; Pry = ry * ry; } //Compute (cx1, cy1) var sign:Number = (largeArcFlag == sweepFlag) ? -1 : 1; var sq:Number = ((Prx*Pry)-(Prx*Py1)-(Pry*Px1)) / ((Prx*Py1)+(Pry*Px1)); sq = (sq < 0) ? 0 : sq; var coef:Number = (sign * Math.sqrt(sq)); var cx1:Number = coef * ((rx * y1) / ry); var cy1:Number = coef * -((ry * x1) / rx); //Compute (cx, cy) from (cx1, cy1) var sx2:Number = (LastPointX + x) / 2.0; var sy2:Number = (LastPointY + y) / 2.0; var cx:Number = sx2 + (cosAngle * cx1 - sinAngle * cy1); var cy:Number = sy2 + (sinAngle * cx1 + cosAngle * cy1); //Compute the angleStart (angle1) and the angleExtent (dangle) var ux:Number = (x1 - cx1) / rx; var uy:Number = (y1 - cy1) / ry; var vx:Number = (-x1 - cx1) / rx; var vy:Number = (-y1 - cy1) / ry; var p:Number var n:Number //Compute the angle start n = Math.sqrt((ux * ux) + (uy * uy)); p = ux; sign = (uy < 0) ? -1.0 : 1.0; var angleStart:Number = radiusToDegress(sign * Math.acos(p / n)); // Compute the angle extent n = Math.sqrt((ux * ux + uy * uy) * (vx * vx + vy * vy)); p = ux * vx + uy * vy; sign = (ux * vy - uy * vx < 0) ? -1.0 : 1.0; var angleExtent:Number = radiusToDegress(sign * Math.acos(p / n)); if(!sweepFlag && angleExtent > 0) { angleExtent -= 360; } else if (sweepFlag && angleExtent < 0) { angleExtent += 360; } angleExtent %= 360; angleStart %= 360; //return Object({x:LastPointX,y:LastPointY,startAngle:angleStart,arc:angleExtent,radius:rx,yRadius:ry,xAxisRotation:xAxisRotation}); return Object({x:LastPointX,y:LastPointY,startAngle:angleStart,arc:angleExtent,radius:rx,yRadius:ry,xAxisRotation:xAxisRotation, cx:cx,cy:cy}); } /** * @private * Convert degrees to radians **/ private static function degressToRadius(angle:Number):Number{ return angle*(Math.PI/180); } /** * @private * Convert radiansToDegrees **/ private static function radiusToDegress(angle:Number):Number{ return angle*(180/Math.PI); } /** * @private * Create quadratic circle graphics commands from an elliptical arc **/ private static function drawEllipticalArc(x:Number, y:Number, startAngle:Number, arc:Number, radius:Number, yRadius:Number, xAxisRotation:Number, path:GraphicsPath):void { // Circumvent drawing more than is needed if (Math.abs(arc)>360) { arc = 360; } // Draw in a maximum of 45 degree segments. First we calculate how many // segments are needed for our arc. var segs:Number = Math.ceil(Math.abs(arc)/45); // Now calculate the sweep of each segment var segAngle:Number = arc/segs; var theta:Number = degressToRadius(segAngle); var angle:Number = degressToRadius(startAngle); // Draw as 45 degree segments if (segs>0) { var beta:Number = degressToRadius(xAxisRotation); var sinbeta:Number = Math.sin(beta); var cosbeta:Number = Math.cos(beta); var cx:Number; var cy:Number; var x1:Number; var y1:Number; // Loop for drawing arc segments for (var i:int = 0; i 4 ascii characters // //Place three bytes in a 24bit holder //Read 6 bits at at time //Use "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/" as a lookup table to build string //Repeat process //zero pad the end if bytes not a multiple of 3 //Add a "=" at the end for each padded byte static public function encode(value:ByteArray):String { var data:String = ""; var count:uint = 0; var charCount:uint = 0; for (var i:uint = 0; i < value.length; i++) { var byte:uint; count++; charCount++; if (count == 1) { byte = value[i] >> 2; data += lookupTable[byte]; byte = (value[i] & 0x03) << 4; } else if (count == 2) { byte = byte | (value[i] >> 4); data += lookupTable[byte]; byte = (value[i] & 0x0f) << 2; } else if (count == 3) { byte = byte | (value[i] >> 6); data += lookupTable[byte]; byte = value[i] & 0x3f; data += lookupTable[byte]; count = 0; } if (charCount == 64) { data += "\n"; charCount = 0; } } if (count == 1) { data += lookupTable[byte]; data += "=="; } else if (count == 2) { data += lookupTable[byte]; data += "="; } return data; } static public function decode(value:String):ByteArray { //4 ascii characters => 3 bytes if (reverseLookupTable == null) { createReverseLookupTable(); } var data:ByteArray = new ByteArray(); var tmp:uint; var count:uint = 0; var char:String; var byte:uint; for (var i:uint = 0; i < value.length; i++) { char = value.charAt(i); if (char == "=") { data.length--; break; } if (!reverseLookupTable.hasOwnProperty(char)) { continue; } byte = reverseLookupTable[char]; count++; if (count == 1) { data[data.position] = byte << 2; } else if (count == 2) { data[data.position] = data[data.position] | byte >> 4; data.position++; data[data.position] = byte << 4; } else if (count == 3) { data[data.position] = data[data.position] | byte >> 2; data.position++ data[data.position] = byte << 6; } else if (count == 4) { data[data.position] = data[data.position] | byte; data.position++ count = 0; } } data.position = 0; return data; } private static function createReverseLookupTable():void { reverseLookupTable = new Object(); for (var i:uint; i < lookupTable.length; i++) { reverseLookupTable[lookupTable[i]] = i; } } } } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������debian/contrib/websvg/src/org/svgweb/utils/ImageLoader.as�������������������������������������������0000644�0000000�0000000�00000011001�12252640275�020632� 0����������������������������������������������������������������������������������������������������ustar �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������� /* Copyright (c) 2009 by contributors: * Google Inc. (Brad Neuberg -- http://codinginparadise.org) * James Hight (http://labs.zavoo.com/) * Richard R. Masters Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package org.svgweb.utils { import org.svgweb.nodes.SVGImageNode; import flash.utils.ByteArray; import flash.display.Bitmap; import flash.display.BitmapData; import flash.display.DisplayObject; import flash.display.Loader; import flash.display.LoaderInfo; import flash.events.Event; import flash.events.IOErrorEvent; import flash.events.SecurityErrorEvent; import flash.net.URLLoader; import flash.net.URLLoaderDataFormat; import flash.net.URLRequest; public class ImageLoader { protected var imageHref:String; protected var listeners:Array = new Array(); private var urlLoader:URLLoader; private var bitmapData:BitmapData; public function ImageLoader(imageHref:String):void { this.imageHref = imageHref; } public function addListener(listener:SVGImageNode):void { this.listeners.push(listener); // started loading? if (urlLoader) { // loaded finished already? if (bitmapData) { listeners[listeners.length-1].onImageLoaded(bitmapData); } } else { // start loading urlLoader = new URLLoader(); urlLoader.dataFormat = URLLoaderDataFormat.BINARY; urlLoader.addEventListener(Event.COMPLETE, onURLLoaderComplete); urlLoader.addEventListener(IOErrorEvent.IO_ERROR, onError); urlLoader.addEventListener(SecurityErrorEvent.SECURITY_ERROR, onError); try { urlLoader.load(new URLRequest(imageHref)); } catch (e:Error) { for (var i:uint=0; i < listeners.length; i++) { listeners[i].onImageError(); } listener.dbg("svgweb:flash:URLLoader.load:"+e); } return; } } private function onError(event:IOErrorEvent):void { urlLoader = null; for (var i:uint=0; i < listeners.length; i++) { listeners[i].onImageError(); } } private function onURLLoaderComplete( event:Event ):void { try { var bytes:ByteArray = ByteArray(urlLoader.data); this.loadBytes(bytes); } catch(e:Error) { for (var i:uint=0; i < listeners.length; i++) { listeners[i].onImageError(); } } urlLoader = null; } /** * Load image byte array * Used to support data: href. **/ private function loadBytes(byteArray:ByteArray):void { var loader:Loader = new Loader(); loader.contentLoaderInfo.addEventListener( Event.COMPLETE, onBytesLoaded ); try { loader.loadBytes( byteArray ); } catch(e:Error) { for (var i:uint=0; i < listeners.length; i++) { listeners[i].onImageError(); } } } /** * Display image bitmap once bytes have loaded * Used to support data: href. **/ private function onBytesLoaded( event:Event ) :void { var content:DisplayObject = LoaderInfo( event.target ).content; bitmapData = new BitmapData( content.width, content.height, true, 0x00000000 ); bitmapData.draw( content ); for (var i:uint=0; i < listeners.length; i++) { listeners[i].onImageLoaded(bitmapData); } } } } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������debian/contrib/websvg/src/org/svgweb/SVGViewerWeb.as������������������������������������������������0000755�0000000�0000000�00000163151�12252640275�017621� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* Copyright (c) 2009 by contributors: * James Hight (http://labs.zavoo.com/) * Richard R. Masters * Google Inc. (Brad Neuberg - http://codinginparadise.org) Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ /* SVGViewer is a flash sprite which is the parent for a tree of SVGNodes which are sprites initialized from XML. The top most SVGNode is an SVGSVGNode. The xml is parsed and xml children are walked when the object is rendered. Child SVGNodes are added and when they are rendered, their xml is walked and so on. */ package org.svgweb { import org.svgweb.core.SVGNode; import org.svgweb.core.SVGSprite; import org.svgweb.core.SVGTimedNode; import org.svgweb.core.SVGViewer; import org.svgweb.nodes.SVGSVGNode; import org.svgweb.nodes.SVGGroupNode; import org.svgweb.nodes.SVGDOMTextNode; import org.svgweb.events.SVGEvent; import org.svgweb.utils.SVGUnits; import flash.display.Sprite; import flash.display.StageScaleMode; import flash.display.StageAlign; import flash.display.LoaderInfo; import flash.events.Event; import flash.events.EventDispatcher; import flash.events.MouseEvent; import flash.events.KeyboardEvent; import flash.events.IOErrorEvent; import flash.events.SecurityErrorEvent; import flash.events.ContextMenuEvent; import flash.external.ExternalInterface; import flash.geom.Matrix; import flash.geom.Rectangle; import flash.geom.Point; import flash.net.URLLoader; import flash.net.URLRequest; import flash.text.TextField; import flash.ui.ContextMenu; import flash.ui.ContextMenuItem; import flash.utils.setTimeout; [SWF(frameRate="40", width="2048", height="1024")] /** * Web container for the SVG Renderer **/ public class SVGViewerWeb extends SVGViewer { private var js_handler:String = ''; private var js_uniqueId:String = ''; private var js_guidLookup:Object = {}; protected var svgIdParam:String = ""; public var clipModeParam:String = "useNone"; protected var scriptSentToJS:Boolean = false; protected var xmlString:String; protected var renderStartTime:Number; protected var debugEnabled:Boolean = true; protected var objectWidth:Number; protected var objectHeight:Number; // The delimiter we use when passing arguments between Flash and // JavaScript; performance testing showed this to be an important // bottleneck, so we do various tricks to make it fast protected var DELIMITER:String = '__SVG__DELIMIT'; // The delimiter between each method that we have bunched up for later // execution during a suspendRedraw session; used for unsuspendRedrawAll protected var METHOD_DELIMITER:String = '__SVG__METHOD__DELIMIT'; // If we send over a DocumentFragment, we represent these internally // using the tag <__document__fragment> followed by all of the nested // DocumentFragment children protected var DOCUMENT_FRAGMENT:String = '__document__fragment'; public function SVGViewerWeb():void { this.setupJavaScriptInterface(); //this.debug('SVGViewerWeb constructor'); this.addEventListener(Event.ADDED_TO_STAGE, onAddedToStage); stage.addEventListener(Event.RESIZE, handleResize); stage.addEventListener(KeyboardEvent.KEY_DOWN, handleAction); super(); } protected function onAddedToStage(event:Event = null):void { this.removeEventListener(Event.ADDED_TO_STAGE, onAddedToStage); this.stage.align = StageAlign.TOP_LEFT; this.stage.scaleMode = StageScaleMode.NO_SCALE; this.processHTMLParameters(); } /** * process html parameters **/ protected function processHTMLParameters():void { var paramsObj:Object = LoaderInfo(this.root.loaderInfo).parameters; var svgURLParam:String = ""; var sourceTypeParam:String = ""; var item:String; for (item in paramsObj) { if (item == "clipMode") { this.clipModeParam = paramsObj[item]; } if (item == "sourceType") { sourceTypeParam = paramsObj[item]; } if (item == "svgURL") { svgURLParam = paramsObj[item]; } if (item == "svgId") { this.svgIdParam = paramsObj[item]; } } // notify browser javascript that we are loaded try { var result:Object = ExternalInterface.call( this.js_handler + "onMessage", this.msgToString( { type: 'event', eventType: 'onFlashLoaded', uniqueId: this.js_uniqueId } )); } catch(error:SecurityError) { var debugstr:String = "Security Error on ExternalInterface.call(...). "; if (this.root.loaderInfo.loaderURL.substring(0,4) == "file") { debugstr += "This is expected when loaded from a local file."; } this.debug(debugstr); } } /** * Load methods. **/ protected function setSVGString(xmlStringParam:String, objectURL:String = '', pageURL:String = '', ignoreWhiteSpace:Boolean = false):void { //start('setSVGString'); // FIXME: TODO: Respect the ignoreWhiteSpace setting this.xmlString = SVGViewerWeb.expandEntities(xmlStringParam); var dataXML:XML = new XML(this.xmlString); while(this.numChildren) { this.removeChildAt(0); } svgRoot = new SVGSVGNode(null, dataXML, null, this, objectURL, pageURL); // See comment in handleRootSVGLoad() if ( (this.xmlString.indexOf("/mg) ) { var parts:Array = myMatch.match(/.*/m); entityMap[parts[1]]=parts[2]; } for (var myEntity:String in entityMap) { xmlString = xmlString.split("&" + myEntity + ";").join(entityMap[myEntity]); } return xmlString; } /** * JavaScript interface setup **/ protected function setupJavaScriptInterface():void { var paramsObj:Object = LoaderInfo(this.root.loaderInfo).parameters; // process the parameters to get the unique id var item:String; for (item in paramsObj) { if (item == "uniqueId") { this.js_uniqueId = paramsObj[item]; this.js_handler = 'svgweb.handlers["' + this.js_uniqueId + '"].'; } if (item == "debug") { if (paramsObj[item] == 'true') { this.debugEnabled = true; } else { this.debugEnabled = false; } } } try { // Performance testing found that Flash/JS communication is a // primary bottleneck; two things were found to make this // faster when calling from JS to Flash: // 1) pass giant strings instead of complex objects // over the boundry, and 2) minimize our own custom // marshaling code on both sides. Having separate methods for // each exposed method makes our marshaling code much simpler, // aiding performance. // When calling from Flash back to JS, we turn all things // into Strings instead of Objects as well; however, we // route everything on that side through an onMessage() method // on the JS side since we found we don't need to optimize that // into separate methods yet. ExternalInterface.addCallback("jsHandleLoad", js_handleLoad); ExternalInterface.addCallback("jsHandleResize", js_handleResize); ExternalInterface.addCallback("jsSuspendRedraw", js_suspendRedraw); ExternalInterface.addCallback("jsUnsuspendRedrawAll", js_unsuspendRedrawAll); ExternalInterface.addCallback("jsInsertBefore", js_insertBefore); ExternalInterface.addCallback("jsAddChildAt", js_addChildAt); ExternalInterface.addCallback("jsRemoveChild", js_removeChild); ExternalInterface.addCallback("jsAddEventListener", js_addEventListener); ExternalInterface.addCallback("jsRemoveEventListener", js_removeEventListener); ExternalInterface.addCallback("jsSetText", js_setText); ExternalInterface.addCallback("jsSetAttribute", js_setAttribute); ExternalInterface.addCallback("jsGetAttribute", js_getAttribute); ExternalInterface.addCallback("jsAppendChild", js_appendChild); ExternalInterface.addCallback("jsGetScreenCTM", js_getScreenCTM); ExternalInterface.addCallback("jsGetBBox", js_getBBox); ExternalInterface.addCallback("jsMatrixInvert", js_matrixInvert); ExternalInterface.addCallback("jsSetCurrentScale", js_setCurrentScale); ExternalInterface.addCallback("jsSetCurrentTranslate", js_setCurrentTranslate); ExternalInterface.addCallback("jsRemoveAttribute", js_removeAttribute); ExternalInterface.addCallback("jsBeginElementAt", js_beginElementAt); ExternalInterface.addCallback("jsEndElementAt", js_endElementAt); } catch(error:SecurityError) { var debugstr:String = "Security Error on ExternalInterface.addCallback(...). "; if (this.root.loaderInfo.loaderURL.substring(0,4) == "file") { debugstr += "This is expected when loaded from a local file."; } this.debug(debugstr); } } override public function customizeContextMenu():void { var outerthis:SVGViewerWeb = this; super.customizeContextMenu(); // View Source Custom Menu Item var itemViewSource:ContextMenuItem = new ContextMenuItem("View SVG Source"); itemViewSource.addEventListener(ContextMenuEvent.MENU_ITEM_SELECT, viewSource); this.contextMenu.customItems.push(itemViewSource); function viewSource():void { try { ExternalInterface.call(outerthis.js_handler + "onMessage", outerthis.msgToString({ type: 'viewsource' }) ); } catch(error:SecurityError) { } } // View Source Dynamic Custom Menu Item var itemViewSourceDynamic:ContextMenuItem = new ContextMenuItem("View SVG Source - Dynamic"); itemViewSourceDynamic.addEventListener(ContextMenuEvent.MENU_ITEM_SELECT, viewSourceDynamic); this.contextMenu.customItems.push(itemViewSourceDynamic); function viewSourceDynamic():void { try { var dynamicXMLString:String = outerthis.svgRoot.getXMLTree(0, true); // backslashes seem to interfere with flash to javascript interface. escape them. dynamicXMLString=dynamicXMLString.replace(/\\/g, '&#92;'); ExternalInterface.call(outerthis.js_handler + "onMessage", outerthis.msgToString( { type: 'viewsourceDynamic', source: dynamicXMLString } )); } catch(error:SecurityError) { } } } /** * Stringifies the object we send back and forth between Flash and JavaScript. * Performance testing found that sending strings between Flash and JS is * about twice as fast as sending objects. **/ protected function msgToString(msg:Object):String { var result:Array = []; for (var i:String in msg) { result.push(i + ':' + msg[i]); } // we use a custom delimiter (__SVG__DELIMIT) instead of commas, since // the message might have an XML payload or commas already return result.join('__SVG__DELIMIT'); } /** * Event handlers from SVG Nodes **/ protected function handleRootSVGLoad():void { //this.debug("render time for " + this.js_uniqueId + ": " + ( (new Date()).valueOf() - this.renderStartTime) + "ms"); // FIXME: Hack. If we are hidden due to the presence of animations, // then we do not unhide until 200ms into the document time. This // provides enough time for the first frame of rendering caused // by animations to occur. Currently, the entire tree is first // parsed and progressively rendered, without animation effects, // because animations may not be parsed yet. Once animations are // parsed, they cause new frames to be rendered. These frames // should be rendered before anything is visible because the // animation effects may have been scheduled to begin at time zero // and rendering without them could be bad, like when objects are // rendered which would be invisible if animation was working. // Since it is difficult to determine exactly when the first // "correct" frames have rendered, we just wait a "long time". // A better solution than the 200ms delay is to figure out all the // elements that should be rendered with animation effects at frame // zero, and unhide exactly when all of these elements have // completed rendering initially with animation effects. // We would start that tracking here, because the SVGLoad event // signals the end of parsing. var outerthis:SVGViewer=this; setTimeout(function ():void { outerthis.visible = true }, 200); var onLoadHandler:String = ''; if (this.svgRoot.xml.@onload) { onLoadHandler = this.svgRoot.xml.@onload; } try { ExternalInterface.call(this.js_handler + "onMessage", this.msgToString( { type: 'event', eventType: "onRenderingFinished", width: this.svgRoot.getWidth(), height: this.svgRoot.getHeight(), uniqueId: this.js_uniqueId, onLoad: onLoadHandler } )); } catch(error:SecurityError) { } //var counts:Array = this.svgRoot.countTree(); //this.debug(" Nodes: " + counts[0] + // " DOMText Nodes: " + counts[2] + // " Sprites: " + counts[1] + // " Avg Sprites: " + counts[1]/counts[0]); } override public function handleScript(script:String):void { // TODO: FIXME: Scripts should be batched up in the order they // are in the document and sent over all at once. This will become // more important as we support external scripts which load // asynchronously; we don't want these to arrive at different times // and get executed in the wrong order. if (!this.scriptSentToJS) { // strip off starting SCRIPT cruft; example:

* For more information on how splines are used to interpolate, refer to the * SMIL specification at http://w3c.org. *

* This class provides one simple built-in facility for non-linear * interpolation. Applications are free to define their own Interpolator * implementation and use that instead when particular non-linear * effects are desired. * * @author Chet * * Ported to ActionScript by Rick Masters * */ public class SplineInterpolator { // Note: (x0,y0) and (x1,y1) are implicitly (0, 0) and (1,1) respectively private var x1:Number, y1:Number, x2:Number, y2:Number; private var lengths:Array = new Array(); static protected var cachedSplines:Object = new Object(); static public function getSplineInterpolator(keySpline:String, node:SVGNode):Object { keySpline = keySpline.replace(/,/sg," "); //Replace commas with spaces if (cachedSplines[keySpline] is SplineInterpolator) { return cachedSplines[keySpline]; } else { var points:Array = keySpline.split(/\s+/);//Split by white space var x1:Number = SVGUnits.parseNum(points[0]); var y1:Number = SVGUnits.parseNum(points[1]); var x2:Number = SVGUnits.parseNum(points[2]); var y2:Number = SVGUnits.parseNum(points[3]); cachedSplines[keySpline] = new SplineInterpolator(x1,y1,x2,y2,node); return cachedSplines[keySpline]; } } /** * Creates a new instance of SplineInterpolator with the control points * defined by (x1, y1) and (x2, y2). The anchor points are implicitly * defined as (0, 0) and (1, 1). * * @throws IllegalArgumentException This exception is thrown when values * beyond the allowed [0,1] range are passed in */ public function SplineInterpolator(x1:Number,y1:Number, x2:Number,y2:Number,node:SVGNode) { var lengthItem:LengthItem; this.x1 = x1; this.y1 = y1; this.x2 = x2; this.y2 = y2; // Now contruct the array of all lengths to t in [0, 1.0] var prevX:Number = 0.0; var prevY:Number = 0.0; var prevLength:Number = 0.0; // cumulative length for (var t:Number = 0.01; t <= 1.0; t += .01) { var xy:Point = getXY(t); var length:Number = prevLength + Math.sqrt( (xy.x - prevX) * (xy.x - prevX) + (xy.y - prevY) * (xy.y - prevY)); lengthItem = new LengthItem(length, t); lengths.push(lengthItem); prevLength = length; prevX = xy.x; prevY = xy.y; } // Now calculate the fractions so that we can access the lengths // array with values in [0,1]. prevLength now holds the total // length of the spline. for (var i:Number = 0; i < lengths.length; ++i) { lengthItem = lengths[i]; lengthItem.setFraction(prevLength); } } /** * Calculates the XY point for a given t value. * * The general spline equation is: * x = b0*x0 + b1*x1 + b2*x2 + b3*x3 * y = b0*y0 + b1*y1 + b2*y2 + b3*y3 * where: * b0 = (1-t)^3 * b1 = 3 * t * (1-t)^2 * b2 = 3 * t^2 * (1-t) * b3 = t^3 * We know that (x0,y0) == (0,0) and (x1,y1) == (1,1) for our splines, * so this simplifies to: * x = b1*x1 + b2*x2 + b3 * y = b1*x1 + b2*x2 + b3 * @param t parametric value for spline calculation */ private function getXY(t:Number):Point { var xy:Point; var invT:Number = (1 - t); var b1:Number = 3 * t * (invT * invT); var b2:Number = 3 * (t * t) * invT; var b3:Number = t * t * t; xy = new Point( (b1 * x1) + (b2 * x2) + b3, (b1 * y1) + (b2 * y2) + b3); return xy; } /** * Utility function: When we are evaluating the spline, we only care * about the Y values. See {@link getXY getXY} for the details. */ private function getY(t:Number):Number { var xy:Point; var invT:Number = (1 - t); var b1:Number = 3 * t * (invT * invT); var b2:Number = 3 * (t * t) * invT; var b3:Number = t * t * t; return (b1 * y1) + (b2 * y2) + b3; } /** * Given a fraction of time along the spline (which we can interpret * as the length along a spline), return the interpolated value of the * spline. We first calculate the t value for the length (by doing * a lookup in our array of previousloy calculated values and then * linearly interpolating between the nearest values) and then * calculate the Y value for this t. * @param lengthFraction Fraction of time in a given time interval. * @return interpolated fraction between 0 and 1 */ public function interpolate(lengthFraction:Number, node:SVGNode):Number { // TODO: speed this up with binary search var interpolatedT:Number = 1.0; var prevT:Number = 0.0; var prevLength:Number = 0.0; //return lengthFraction; for (var i:Number = 0; i < lengths.length; ++i) { var lengthItem:LengthItem = lengths[i]; var fraction:Number = lengthItem.getFraction(); var t:Number = lengthItem.getT(); if (lengthFraction <= fraction) { // answer lies between last item and this one var proportion:Number = (lengthFraction - prevLength) / (fraction - prevLength); interpolatedT = prevT + proportion * (t - prevT); return getY(interpolatedT); } prevLength = fraction; prevT = t; } return getY(interpolatedT); } } } debian/contrib/websvg/src/org/svgweb/smil/WallclockTimeSpec.as0000755000000000000000000000154112252640275021645 0ustar /* Copyright (c) 2009 by contributors: * Richard R. Masters Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package org.svgweb.smil { public class WallclockTimeSpec extends TimeSpec { protected var timeSpecString:String; public function WallclockTimeSpec(timeSpecString:String) { this.timeSpecString = timeSpecString; } } } debian/contrib/websvg/src/org/svgweb/SVGViewerFlash.as0000644000000000000000000000247012252640275020132 0ustar /* Copyright (c) 2009 by contributors: * James Hight (http://labs.zavoo.com/) * Richard R. Masters Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package org.svgweb { import org.svgweb.core.SVGViewer; public class SVGViewerFlash extends SVGViewer { public function SVGViewerFlash() { super(); } override public function getWidth():Number { if (parent) { return parent.width; } else { return stage.stageWidth; } } override public function getHeight():Number { if (parent) { return parent.height; } else { return stage.stageHeight; } } } } debian/contrib/websvg/src/svg.js0000644000000000000000000123432312252640275014064 0ustar /* Copyright (c) 2009 Google Inc. (Brad Neuberg, http://codinginparadise.org) Portions Copyright (c) 2009 Rick Masters Portions Copyright (c) 2009 Others (see COPYING.txt for details on third party code) Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /** SVG Web brings SVG to browsers that don't have it, such as on Internet Explorer, using Flash. SVG Web supports both static and dynamic SVG files scripted by JavaScript, giving the 'illusion' that SVG is truly supported by a browser. This means that JavaScript in the same page 'sees' the SVG as a real-part of the browser and can script it using the standard DOM, even when we are emulating SVG support using Flash. SVG Web targets SVG 1.1 Full. SVG Web brings SVG support from roughly a ~30% installed base to close to 100% with a library that is roughly 70K in size, giving developers a retained mode API for applications where the HTML5 Canvas tag's immediate mode API might not be appropriate, such as where DOM tracking, import/export, acessibility, and scalable vector images are needed. Retained and immediate mode graphics APIs have different tradeoffs and are appropriate for different use-cases. From a high-level SVG Web consists of two types of handlers, either the NativeHandler which uses the native SVG browser support if present (Firefox, Safari, etc.) or the FlashHandler which uses Flash and various JavaScript tricks to provide SVG support. The entry point for the system is the static JavaScript singleton 'svgweb' class. This does many things, including: ensuring SVG Web is loaded before the window onload event fires; waiting for the onDOMContentLoaded event to fire; grabbing any SVG either directly embedded into a page or embedded using the OBJECT tag; normalizing and cleaning up our SVG; and finally determining the capabilities of the platform and creating the correct handler. At this point the svgweb class hands off work to the specific handler created (NativeHandler or FlashHandler). The handlers and the svgweb singleton depend on a few support classes and methods to get their job done, including: * Utility functions such as 'extend', 'hitch', and 'mixin' to make defining JavaScript classes and callbacks be a bit more compact and readable. Other utility functions include methods such as 'parseXML', 'xpath', and 'xhrObj' to ease cross-browser XML, XPath, and XHR handling, respectively * RenderConfig class - Helps determine the rendering capabilities of the browser and whether the page itself is overriding and forcing a particular render handler, such as through a META tag or query variables. * FlashInfo class - Helps determine whether Flash is installed, and if so, which version. * FlashInserter class - Inserts our Flash into the page in a consistent way. Moving on, the NativeHandler and FlashHandler decompose as follows. Let's start with the NativeHandler, since its the most straightforward. The NativeHandler essentially shims through and uses the native browser support. For various reasons, however, the NativeHandler must still patch various parts of the browser's SVG implementation to provide a consistent SVG experience where reasonable. We are careful to do this minimally and only where absolutely necessary; we don't, for example, attempt to shim in SMIL support on Firefox as that would be overkill. Some reasons for the patching we do need include: * Firefox, for example, does not support setting SVG style values using the standard HTML idiom, such as myCircle.style.fill = 'red'. SVG Web adds this in for consistency. * Some browsers have various bugs that are serious enough that a simple patch on SVG Web's part can make life simpler for programmers. * While SVG Web mostly supports the SVG standard, some small divergences are necessary to accomodate various limitations that the FlashHandler requires; we patch the native SVG implementation to match these divergences in order to have API consistency between all the handlers for end-developers. The FlashHandler is more complicated, obviously. It essentially consists of a Flash portion plus JavaScript to simulate native support. Note that we support having the FlashHandler do its magic not only on Internet Explorer but Safari, Firefox, and Chrome as well. This is useful for two reasons: it significantly aides debugging and testing of the FlashHandler and also makes it possible to optionally use the FlashHandler to 'go beyond' the native capabilities of a browser if needed. For the FlashHandler let's begin with the Flash side. All of the Flash is written in ActionScript 3 and is located in src/org/svgweb. Much of the Flash side consists of ActionScript classes that essentially simulate and render all the various SVG node types, such as SVGCircleNode.as for the SVG Circle tag. The entry point for the Flash is the org.svgweb.SVGViewerWeb class, which mediates all interaction between the JavaScript and Flash side of things. The JavaScript invokes various methods on the SVGViewerWeb class to get things done, and the Flash messages back various things, such as rendering being done, events, etc. We use Flash's ExternalInterface to do this communication but things are more complex unfortunately due to this part of the system being one of the primary bottlenecks, requiring complicated optimizations. See the SVGViewerWeb class for details on this aspect. The FlashHandler uses the Flash side to do its rendering, but it also must handle two other significant cases: * handle disconnected nodes (i.e. nodes not attached to anything yet) * give the illusion of a real DOM and hand back SVG nodes that 'feel real' Various design constraints require that the JavaScript side be relatively sophisticated and also do tracking, rather than pushing everything to the Flash ActionScript. The first primary reason includes the fact that essentially only basic strings and types are pushed over the Flash/JS boundry, rather than object references -- this is difficult since SVG is essentially a tree, making it hard to do operations on specific nodes. The second primary reason has to do with dealing with disconnected trees, since you can build up a complicated DOM tree that is not attached to any rendered document and therefore has no Flash associated with it. Generally patching the browser is taboo. Since SVG Web is an emulation environment rather than a new API we must patch the browser to give the illusion of a real SVG implementation. We attempt to do this without impacting or slowing down non-SVG use-cases. Methods such as getElementById, getElementsByTagNameNS, or createElementNS are patched in to short-circuit for the non-SVG cases. The real magic, though, begins when these methods are called for SVG nodes. Instead of returning real DOM nodes we actually return 'fake' DOM nodes. Looking through this file you will see various 'fake' DOM implementations preceded with underscores, such as _Node, _Element, _Document, _DocumentFragment, etc. These JavaScript classes basically implement the DOM interfaces, such as nodeName, appendChild, childNodes, etc. When an external developer 'calls' on one of our fake SVG nodes, they are actually interacting with a fake JavaScript class rather than a real DOM node; we just work to give the illusion that it's a real DOM class. Inside our fake SVG DOM node classes, we track each node with a __guid that helps us do tracking and registration with the Flash side. If you change the property of an SVG Circle, for example, we would simply send the __guid over to Flash and the new values. Using the __guid essentially gives us the object references we don't get with Flash's ExternalInterface. Every fake node also keeps an internal reference to it's parsed XML so that it can change and store the values on the JavaScript side as well. Some complexity is involved in also tracking DOM TextNodes stored in our SVG tree so that we can consistently return the 'same' DOM TextNode when fetched rather than searching by text value, which would fail if there are many DOM TextNodes with the same value. To handle this we internally store DOM TextNodes as a node called '__text' and add a tracking __guid. This adds some internal complexity but allows external developers to have what feels more like a real DOM. In some ways you can think of the FlashHandler as having a 'peer node' on its side for each SVG node rendered on the Flash side. We obviously don't want to do this for every node, however, which would slow down page load and bloat memory, so we only create our FlashHandler's JavaScript fake 'peer node' on demand when fetched through the DOM, such as through getElementById or by calling childNodes or firstChild on an SVG DOM node. Once fetched the first time we cache our JavaScript fake peer class ready to be re-served on demand again. Let's look at the fake SVG nodes we return to developers to interact with. On modern browsers we can easily simulate magic getters and setters such as myCircle.style.fill = 'red' or someGroup.childNodes[0] using facilities like __defineGetter__. On those browsers when you call someGroup.childNodes[0], for example, our magic getter would get invoked; we would see if a fake peer JavaScript node exists for this and return it if so, and if not, we would create it on-demand and return it. On IE, however, we have to get our magic getters and setters and propery change events using a different mechanism, known as Microsoft Behaviors. Microsoft Behaviors, or HTCs (HTML Components) are a powerful but relatively esoteric browser technology that have been around since IE 5.0. They essentially allow JavaScript to tie directly into Internet Explorer's rendering engine and add new tags. They are defined in an HTC file, in our case svg.htc. HTCs give us the hooks we need to define magic getters and setters for IE as well as gives us something called onpropertychange necessary to support style accesses like myGroup.style.fillColor = 'green'. On IE, whenever we return a result that a developer will manipulate, such as the results of getElementsByTagNameNS, we instead return our HTC proxy node -- you will see methods such as node._getProxyNode() in the source that returns our standard JavaScript _Node or _Element class on all browsers but IE, where we return our HTC node instead. If you look at the svg.htc file you will see that it has very little code in it. This is for two reasons: * The primary performance bottleneck for HTCs is the amount of code they have; limiting their code has a huge affect on memory and performance * We want to have a similar architecture for the FlashHandler independent of the browser to ease maintenence. For this reason a given HTC node delegates all of its work to its 'fake node', which would be the _Node or _Element that it is tracking. You will see calls such as node._getFakeNode() in the source which gets our fake JavaScript class to work with. For example, if you called node.appendChild(someNode), internally we would call someNode._getFakeNode() to make sure we have our JavaScript _Node or _Element class and not the HTC node. Now we can work with our fake SVG node in a consistent way. @author Brad Neuberg (http://codinginparadise.org) */ (function(){ // hide everything externally to avoid name collisions // expose namespaces globally to ease developer authoring window.svgns = 'http://www.w3.org/2000/svg'; window.xlinkns = 'http://www.w3.org/1999/xlink'; // Firefox and Safari will incorrectly turn our internal parsed XML // for the Flash Handler into actual SVG nodes, causing issues. This is // a workaround to prevent this problem. svgnsFake = 'urn:__fake__internal__namespace'; // browser detection adapted from Dojo var isOpera = false, isSafari = false, isMoz = false, isIE = false, isAIR = false, isKhtml = false, isFF = false, isXHTML = false, isChrome = false; function _detectBrowsers() { var n = navigator, dua = n.userAgent, dav = n.appVersion, tv = parseFloat(dav); if (dua.indexOf('Opera') >= 0) { isOpera = tv; } // safari detection derived from: // http://developer.apple.com/internet/safari/faq.html#anchor2 // http://developer.apple.com/internet/safari/uamatrix.html var index = Math.max(dav.indexOf('WebKit'), dav.indexOf('Safari'), 0); if (index) { // try to grab the explicit Safari version first. If we don't get // one, look for 419.3+ as the indication that we're on something // "Safari 3-ish". Lastly, default to "Safari 2" handling. isSafari = parseFloat(dav.split('Version/')[1]) || (parseFloat(dav.substr(index + 7)) > 419.3) ? 3 : 2; } if (dua.indexOf('AdobeAIR') >= 0) { isAIR = 1; } if (dav.indexOf('Konqueror') >= 0 || isSafari) { isKhtml = tv; } if (dua.indexOf('Gecko') >= 0 && !isKhtml) { isMoz = tv; } if (isMoz) { isFF = parseFloat(dua.split('Firefox/')[1]) || undefined; } if (document.all && !isOpera) { isIE = parseFloat(dav.split('MSIE ')[1]) || undefined; } if (dua.indexOf('Chrome') >= 0) { isChrome = 1; } // compatMode deprecated on IE8 in favor of documentMode if (document.documentMode) { isStandardsMode = (document.documentMode > 5); } else { isStandardsMode = (document.compatMode == 'CSS1Compat'); } // are we in an XHTML page? if (document.contentType == 'application/xhtml+xml') { /* FF */ isXHTML = true; } else if (typeof XMLDocument != 'undefined' && document.constructor == XMLDocument) { /* Safari */ isXHTML = true; } } _detectBrowsers(); // end browser detection // be able to have debug output when there is no Firebug // see if debugging is turned on function doDebugging() { var debug = false; var scripts = document.getElementsByTagName('script'); for (var i = 0; i < scripts.length; i++) { if (/svg(?:\-uncompressed)?\.js/.test(scripts[i].src)) { var debugSetting = scripts[i].getAttribute('data-debug'); debug = (debugSetting === 'true' || debugSetting === true) ? true : false; } } return debug; } var debug = doDebugging(); if (typeof console == 'undefined' || !console.log) { var queue = []; console = {}; if (!debug) { console.log = function() {}; } else { console.log = function(msg) { var body = null; var delay = false; // IE can sometimes throw an exception if document.body is accessed // before the document is fully loaded try { body = document.getElementsByTagName('body')[0]; } catch (exp) { delay = true; } // IE will sometimes have the body object but we can get the dreaded // "Operation Aborted" error if we try to do an appendChild on it; a // workaround is that the doScroll method will throw an exception before // we can truly use the body element so we can detect this before // any "Operation Aborted" errors if (isIE) { try { document.documentElement.doScroll('left'); } catch (exp) { delay = true; } } if (delay) { queue.push(msg); return; } var p; while (queue.length) { var oldMsg = queue.shift(); p = document.createElement('p'); p.appendChild(document.createTextNode(oldMsg)); body.appendChild(p); } // display new message now p = document.createElement('p'); p.appendChild(document.createTextNode(msg)); body.appendChild(p); }; // IE has an unfortunate issue; under some situations calling // document.body.appendChild can throw an Operation Aborted error, // such as when there are many SVG OBJECTs on a page. This is a workaround // to print out any queued messages until the page has truly loaded. if (isIE) { function flushQueue() { while (queue.length) { var oldMsg = queue.shift(); p = document.createElement('p'); p.appendChild(document.createTextNode(oldMsg)); document.body.appendChild(p); } } var debugInterval = window.setInterval(function() { if (document.readyState == 'complete') { flushQueue(); window.clearTimeout(debugInterval); } }, 50); } } } // end debug output methods /* Quick way to define prototypes that take up less space and result in smaller file size; much less verbose than standard foobar.prototype.someFunc = function() lists. @param f Function object/constructor to add to. @param addMe Object literal that contains the properties/methods to add to f's prototype. */ function extend(f, addMe) { for (var i in addMe) { f.prototype[i] = addMe[i]; } } /** Mixes an object literal of properties into some instance. Good for things that mimic 'static' properties. @param f Function object/contructor to add to @param addMe Object literal that contains the properties/methods to add to f. */ function mixin(f, addMe) { for (var i in addMe) { f[i] = addMe[i]; } } /** Utility function to do XPath cross browser. @param doc Either HTML or XML document to work with. @param context DOM node context to restrict the xpath executing against; can be null, which defaults to doc.documentElement. @param expr String XPath expression to execute. @param namespaces Optional; an array that contains prefix to namespace lookups; see the _getNamespaces() methods in this file for how this data structure is setup. @returns Array with results, empty array if there are none. */ function xpath(doc, context, expr, namespaces) { if (!context) { context = doc.documentElement; } if (typeof XPathEvaluator != 'undefined') { // non-IE browsers var evaluator = new XPathEvaluator(); var resolver = doc.createNSResolver(context); var result = evaluator.evaluate(expr, context, resolver, 0, null); var found = createNodeList(), current; while (current = result.iterateNext()) { found.push(current); } return found; } else { // IE doc.setProperty('SelectionLanguage', 'XPath'); if (namespaces) { var allNamespaces = ''; // IE throws an error if the same namespace is present multiple times, // so remove duplicates var foundNamespace = {}; for (var i = 0; i < namespaces.length; i++) { var namespaceURI = namespaces[i]; var prefix = namespaces['_' + namespaceURI]; // seen before? if (!foundNamespace['_' + namespaceURI]) { if (prefix == 'xmlns') { allNamespaces += 'xmlns="' + namespaceURI + '" '; } else { allNamespaces += 'xmlns:' + prefix + '="' + namespaceURI + '" '; } foundNamespace['_' + namespaceURI] = namespaceURI; } } doc.setProperty('SelectionNamespaces', allNamespaces); } var found = context.selectNodes(expr); if (found === null || typeof found == 'undefined') { found = createNodeList(); } // found is not an Array; it is a NodeList -- turn it into an Array var results = createNodeList(); for (var i = 0; i < found.length; i++) { results.push(found[i]); } return results; } } /** Parses the given XML string and returns the document object. @param xml XML String to parse. @param preserveWhiteSpace Whether to parse whitespace in the XML document into their own nodes. Defaults to false. Controls Internet Explorer's XML parser only. @returns XML DOM document node. */ var parseXMLCache = {}; function parseXML(xml, preserveWhiteSpace) { if (preserveWhiteSpace === undefined) { preserveWhiteSpace = false; } // Issue 421: Reuse XML ActiveX object on Internet Explorer // http://code.google.com/p/svgweb/issues/detail?id=421 var cachedXML = parseXMLCache[preserveWhiteSpace + xml]; if (cachedXML) { return cachedXML.cloneNode(true); } var xmlDoc; if (typeof DOMParser != 'undefined') { // non-IE browsers // parse the SVG using an XML parser var parser = new DOMParser(); try { xmlDoc = parser.parseFromString(xml, 'application/xml'); } catch (e) { throw e; } var root = xmlDoc.documentElement; if (root.nodeName == 'parsererror') { throw new Error('There is a bug in your SVG: ' + (new XMLSerializer().serializeToString(root))); } } else { // IE // only use the following two MSXML parsers: // http://blogs.msdn.com/xmlteam/archive/2006/10/23/using-the-right-version-of-msxml-in-internet-explorer.aspx var versions = [ 'Msxml2.DOMDocument.6.0', 'Msxml2.DOMDocument.3.0' ]; var xmlDoc; for (var i = 0; i < versions.length; i++) { try { xmlDoc = new ActiveXObject(versions[i]); if (xmlDoc) { break; } } catch (e) {} } if (!xmlDoc) { throw new Error('Unable to instantiate XML parser'); } try { xmlDoc.preserveWhiteSpace = preserveWhiteSpace; // IE will attempt to resolve external DTDs (i.e. the SVG DTD) unless // we add the following two flags xmlDoc.resolveExternals = false; xmlDoc.validateOnParse = false; // MSXML 6 breaking change (Issue 138): // http://code.google.com/p/sgweb/issues/detail?id=138 xmlDoc.setProperty('ProhibitDTD', false); xmlDoc.async = 'false'; var successful = xmlDoc.loadXML(xml); if (!successful || xmlDoc.parseError.errorCode !== 0) { throw new Error(xmlDoc.parseError.reason); } } catch (e) { console.log(e.message); throw new Error('Unable to parse SVG: ' + e.message); } } // cache parsed XML to speed up performance (Issue 421) try { parseXMLCache[preserveWhiteSpace + xml] = xmlDoc.cloneNode(true); } catch (e) { // Opera at v10.10 cannot clone a Document } return xmlDoc; } /** Transforms the given node and all of its children into an XML string, suitable for us to send over to Flash for adding to the document. @param node Either a real DOM node to turn into a string or one of our fake _Node or _Elements. @param namespaces Optional. A namespace lookup table that we will use to add our namespace declarations onto the serialized XML. @returns XML String suitable for sending to Flash. */ function xmlToStr(node, namespaces) { var nodeXML = (node._nodeXML || node); var xml; if (typeof XMLSerializer != 'undefined') { // non-IE browsers xml = (new XMLSerializer().serializeToString(nodeXML)); } else { xml = nodeXML.xml; } // Firefox and Safari will incorrectly turn our internal parsed XML // for the Flash Handler into actual SVG nodes, causing issues. We added // a fake SVG namespace earlier to prevent this from happening; remove that // now xml = xml.replace(/urn\:__fake__internal__namespace/g, svgns); // add our namespace declarations var nsString = ''; if (xml.indexOf('xmlns=') == -1) { nsString = 'xmlns="' + svgns + '" '; } if (namespaces) { for (var i = 0; i < namespaces.length; i++) { var uri = namespaces[i]; var prefix = namespaces['_' + uri]; // ignore our fake SVG namespace string if (uri == svgnsFake) { uri = svgns; } var newNS; if (prefix != 'xmlns') { newNS = 'xmlns:' + prefix + '="' + uri + '"'; } else { newNS = 'xmlns' + '="' + uri + '"'; } // FIXME: Will this break if single quotes are used around namespace // declaration? if (xml.indexOf(newNS) == -1) { nsString += newNS + ' '; } } } xml = xml.replace(/<([^ ]+)/, '<$1 ' + nsString + ' '); return xml; } /* Useful for closures and event handlers. Instead of having to do this: var self = this; window.onload = function(){ self.init(); } you can do this: window.onload = hitch(this, 'init'); @param context The instance to bind this method to. @param method A string method name or function object to run on context. */ function hitch(context, method) { if (typeof method == 'string') { method = context[method]; } // this method shows up in the style string on IE's HTC object since we // use it to extend the HTC element's style object with methods like // item(), setProperty(), etc., so we want to keep it short. The performance // of an HTC/Microsoft Behavior is very sensitive to the length of its // JavaScript methods so we want to keep them short. return function() { return method.apply(context, (arguments.length) ? arguments : []); }; } /* Internet Explorer's list of standard XHR PROGIDS. */ var XHR_PROGIDS = [ 'MSXML2.XMLHTTP.6.0', 'MSXML2.XMLHTTP.3.0', 'MSXML2.XMLHTTP', 'Microsoft.XMLHTTP' ]; /* Standard way to grab XMLHttpRequest object. */ function xhrObj() { if (typeof XMLHttpRequest != 'undefined') { return new XMLHttpRequest(); } else if (ActiveXObject) { var xhr = null; var i; // save the good PROGID for quicker access next time for (i = 0; i < XHR_PROGIDS.length && !xhr; ++i) { try { xhr = new ActiveXObject(XHR_PROGIDS[i]); } catch(e) {} } if (!xhr) { throw new Error('XMLHttpRequest object not available on this platform'); } return xhr; } } // We just use an autoincrement counter to ensure uniqueness for our node // tracking, which is fine for our situation and produces much smaller GUIDs; // GUIDs are used to track individual SVG nodes between our JavaScript and // Flash. var guidCounter = 0; function guid() { return '_' + guidCounter++; } /** Our singleton object that acts as the primary entry point for the library. Gets exposed globally as 'svgweb'. */ function SVGWeb() { //start('SVGWeb_constructor'); // is SVG Web being hosted cross-domain? this._setXDomain(); // grab any configuration that might exist on where our library resources // are this.libraryPath = this._getLibraryPath(); // see if there is an optional HTC filename being used, such as svg-htc.php; // these are used to have the server automatically send the correct MIME // type for HTC files without having to fiddle with MIME type settings this.htcFilename = this._getHTCFilename(); // prepare IE by inserting special markup into the page to have the HTC // be available if (isIE) { FlashHandler._prepareBehavior(this.libraryPath, this.htcFilename); } // make sure we can intercept onload listener registration to delay onload // until we are done with our internal machinery this._interceptOnloadListeners(); // wait for our page's DOM content to be available this._initDOMContentLoaded(); //end('SVGWeb_constructor'); } extend(SVGWeb, { // path to find library resources libraryPath: './', // RenderConfig object of which renderer (native or Flash) to use config: null, pageLoaded: false, handlers: [], totalLoaded: 0, /** Every element (including text nodes) has a unique GUID. This lookup table allows us to go from a GUID taken from an XML node to a fake node (_Element or _Node) that might have been instantiated already. */ _guidLookup: [], /** Onload page load listeners. */ _loadListeners: [], /** A data structure that we used to keep track of removed nodes, necessary so we can clean things up and prevent memory leaks on IE on page unload. Unfortunately we have to keep track of this at the global 'svgweb' level rather than on individual handlers because a removed node might have never been associated with a real DOM or a real handler. */ _removedNodes: [], /** Used to lookup namespaces **/ _allSVGNamespaces: [], /** Adds an event listener to know when both the page, the internal SVG machinery, and any SVG SCRIPTS or OBJECTS are finished loading. @param listener Function that will get called when page and all embedded SVG is loaded and rendered. @param fromObject Optional. If true, then we are calling this from inside an SVG OBJECT file. @param objectWindow Optional. Provided when called from inside an SVG OBJECT file; this is the window object inside the SVG OBJECT. */ addOnLoad: function(listener, fromObject, objectWindow) { if (fromObject) { // addOnLoad called from an SVG file embedded with OBJECT var obj = objectWindow.frameElement; // if we are being called from an SVG OBJECT tag and are the Flash // renderer than just execute the onload listener now since we know // the SVG file is done rendering. if (fromObject && this.getHandlerType() == 'flash') { listener.apply(objectWindow); } else { // NOTE: some browsers will fire the onload of the SVG file _before_ our // NativeHandler is done (Firefox); others will do it the opposite way // (Safari). We set variables pointing between the OBJECT and its // NativeHandler to handle this. if (obj._svgHandler) { // NativeHandler already constructed obj._svgHandler._onObjectLoad(listener, objectWindow); } else { // NativeHandler not constructed yet; store a reference for later // handling obj._svgWindow = objectWindow; obj._svgFunc = listener; } } } else { // normal addOnLoad request from containing HTML page this._loadListeners.push(listener); } // fire the onsvgload event immediately if the page was done // loading earlier if (this.pageLoaded) { this._fireOnLoad(); } }, /** Returns a string for the given handler for this platform, 'flash' if flash is being used or 'native' if the native capabilities are being used. */ getHandlerType: function() { if (this.renderer == FlashHandler) { return 'flash'; } else if (this.renderer == NativeHandler) { return 'native'; } }, /** Appends a dynamically created SVG OBJECT or SVG root to the page. See the section "Dynamically Creating and Removing SVG OBJECTs and SVG Roots" in the User Guide for details. @node Either an 'object' created with document.createElement('object', true) or an SVG root created with document.createElementNS(svgns, 'svg') @parent An HTML DOM parent to attach our SVG OBJECT or SVG root to. This DOM parent must already be attached to the visible DOM. */ appendChild: function(node, parent) { //console.log('appendChild, node='+node+', parent='+parent); if (node.nodeName.toLowerCase() == 'object' && node.getAttribute('type') == 'image/svg+xml') { // dynamically created OBJECT tag for an SVG file this.totalSVG++; this._svgObjects.push(node); if (this.getHandlerType() == 'native') { node.onload = node.onsvgload; parent.appendChild(node); } var placeHolder = node; if (this.getHandlerType() == 'flash') { // register onloads if (node.onsvgload) { node.addEventListener('SVGLoad', node.onsvgload, false); } // Turn our OBJECT into a place-holder DIV attached to the DOM, // copying over our properties; this will get replaced by the // Flash OBJECT. We need to do this because we need a real element // in the DOM to 'replace' later on for IE which uses outerHTML, // and the DIV will act as that place-holder element. var div = document._createElement('div'); for (var j = 0; j < node.attributes.length; j++) { var attr = node.attributes[j]; var attrName = attr.nodeName; var attrValue = attr.nodeValue; // trim out 'empty' attributes with no value if (!attrValue && attrValue !== 'true') { continue; } div.setAttribute(attrName, attrValue); } parent.appendChild(div); // copy over internal event listener info div._onloadListeners = node._onloadListeners; placeHolder = div; } // now handle this SVG OBJECT var objID = this._processSVGObject(placeHolder); // add the ID to our original SVG OBJECT node as a private member; // we will later use this if svgweb.removeChild is called to remove // the node in order to remove the SVG OBJECT from our // handler._svgObjects array node._objID = objID; } else if (node.nodeName.toLowerCase() == 'svg') { // dynamic SVG root this.totalSVG++; // copy over any node.onsvgload listener if (node.onsvgload) { node.addEventListener('SVGLoad', node.onsvgload, false); } if (isIE && node._fakeNode) { node = node._fakeNode; } // serialize SVG into a string var svgStr = xmlToStr(node); // nest the SVG into a SCRIPT tag and add to the page; we do this // so that we hit the same code path for dynamic SVG roots as you would // get if the SCRIPT + SVG were already in the page on page load var svgScript = document.createElement('script'); svgScript.type = 'image/svg+xml'; if (!isXHTML) { // NOTE: only script.text works for IE; other ways of changing value // throws 'Unknown Runtime Error' on that wonderful browser svgScript.text = svgStr; } else { // XHTML; no innerHTML here svgScript.appendChild(document.createTextNode(svgStr)); } this._svgScripts.push(svgScript); parent.appendChild(svgScript); // preserve our SVGLoad addEventListeners on the script object svgScript._onloadListeners = node._detachedListeners /* flash renderer */ || node._onloadListeners /* native */; // now process the SVG as we would normal SVG embedded into the page // with a SCRIPT tag this._processSVGScript(svgScript); } }, /** Removes a dynamically created SVG OBJECT or SVG root to the page. See the section "Dynamically Creating and Removing SVG OBJECTs and SVG Roots" for details. @node OBJECT or EMBED tag for the SVG OBJECT to remove. @parent The parent of the node to remove. */ removeChild: function(node, parent) { //console.log('svgweb.removeChild, node='+node.nodeName+', parent='+parent.nodeName); var name = node.nodeName.toLowerCase(); var nodeID, nodeHandler; if (name == 'object' || name == 'embed' || name == 'svg') { this.totalSVG = this.totalSVG == 0 ? 0 : this.totalSVG - 1; this.totalLoaded = this.totalLoaded == 0 ? 0 : this.totalLoaded - 1; // remove from our list of handlers nodeID = node.getAttribute('id'); nodeHandler = this.handlers[nodeID]; var newHandlers = []; for (var i = 0; i < this.handlers.length; i++) { var currentHandler = this.handlers[i]; if (currentHandler != nodeHandler) { newHandlers[currentHandler.id] = currentHandler; newHandlers.push(currentHandler); } } this.handlers = newHandlers; } if (name == 'object' || name == 'embed') { // nodeHandler might not have a fake 'document' object; this can happen // if loading of the SVG OBJECT is 'interrupted' by a rapid removeChild // before it ever had a chance to even finish loading. If there is no // fake document then skip trying to remove timing functions and event // handlers below if (this.getHandlerType() == 'flash' && nodeHandler.document && nodeHandler.document.defaultView) { // remove any setTimeout or setInterval functions that might have // been registered inside this object; see _SVGWindow.setTimeout // for details var iframeWin = nodeHandler.document.defaultView; if (iframeWin._intervalIDs) { for (var i = 0; i < iframeWin._intervalIDs.length; i++) { iframeWin.clearInterval(iframeWin._intervalIDs[i]); } } if (iframeWin._timeoutIDs) { for (var i = 0; i < iframeWin._timeoutIDs.length; i++) { iframeWin.clearTimeout(iframeWin._timeoutIDs[i]); } } // remove keyboard event handlers; we added a record of these for // exactly this reason in _Node.addEventListener() for (var i = 0; i < nodeHandler._keyboardListeners.length; i++) { var l = nodeHandler._keyboardListeners[i]; if (isIE) { document.detachEvent('onkeydown', l); } else { // we aren't sure whether the event listener is a useCapture or // not; just try to remove both document.removeEventListener('keydown', l, true); document.removeEventListener('keydown', l, false); } } } // remove the original SVG OBJECT node from our handlers._svgObjects // array var objID; if (typeof node._objID != 'undefined') { // native handler objID = node._objID; } else if (typeof node.contentDocument != 'undefined') { // IE // node is a Flash node; get a reference to our fake _Document // and then use that to get our Flash Handler objID = node.contentDocument._handler.id; } else { objID = node._handler.id; } for (var i = 0; i < svgweb._svgObjects.length; i++) { if (svgweb._svgObjects[i]._objID === objID) { svgweb._svgObjects.splice(i, 1); break; } } // remove from the page parent.removeChild(node); if (this.getHandlerType() == 'flash') { // delete the HTC container and all HTC nodes that belong to this // SVG OBJECT var container = document.getElementById('__htc_container'); if (container) { for (var i = 0; i < container.childNodes.length; i++) { var child = container.childNodes[i]; if (typeof child.ownerDocument != 'undefined' && child.ownerDocument == nodeHandler._svgObject.document) { if (typeof child._fakeNode != 'undefined' && typeof child._fakeNode._htcNode != 'undefined') { child._fakeNode._htcNode = null; } child._fakeNode = null; child._handler = null; container.removeChild(child); } } } // clear out the guidLookup table for nodes that belong to this // SVG OBJECT for (var guid in svgweb._guidLookup) { var child = svgweb._guidLookup[guid]; if (child._fake && child.ownerDocument === nodeHandler.document) { delete svgweb._guidLookup[guid]; } } // remove various properties to prevent IE memory leaks nodeHandler.flash.contentDocument = null; nodeHandler.flash = null; nodeHandler._xml = null; // nodeHandler.window might not be present if this SVG OBJECT is being // removed before it was even finished loading if (nodeHandler.window) { nodeHandler.window._scope = null; nodeHandler.window = null; } var svgObj = nodeHandler._svgObject; var svgDoc = svgObj.document; svgDoc._nodeById = null; svgDoc._xml = null; svgDoc.defaultView = null; svgDoc.documentElement = null; svgDoc.rootElement = null; svgDoc.defaultView = null; svgDoc = null; svgObj._svgNode = null; svgObj._handler = null; if (iframeWin) { iframeWin._setTimeout = null; iframeWin.setTimeout = null; iframeWin._setInterval = null; iframeWin.setInterval = null; } nodeHandler._svgObject = null; svgObj = null; nodeHandler = null; iframeWin = null; } // end if (this.getHandlerType() == 'flash') } else if (name == 'svg') { // dynamicly created SVG roots // remove the original SVG SCRIPT node from our handlers._svgScripts // array for (var i = 0; i < svgweb._svgScripts.length; i++) { if (svgweb._svgScripts[i] == nodeHandler._scriptNode) { svgweb._svgScripts.splice(i, 1); break; } } if (isIE && this.getHandlerType() == 'flash' && node._fakeNode) { node = node._fakeNode; } // remove from the page var removeMe; if (this.getHandlerType() == 'native') { removeMe = node; } else { removeMe = node._handler.flash; } // IE will sometimes throw an exception if we don't do this on a timeout if (!isIE) { parent.removeChild(removeMe); } else { // FIXME: Analyze whether this will sometimes lead to race conditions; // I haven't found any and could not find another workaround on IE window.setTimeout( function(parent, removeMe) { return function() { parent.removeChild(removeMe); // IE memory leaks parent = null; removeMe = null; } }(parent, removeMe) /* prevent IE closure memory leaks */, 1); } if (this.getHandlerType() == 'flash') { // indicate we are unattached node._setUnattached(); // clear out the guidLookup table for nodes that belong to this // SVG root for (var guid in svgweb._guidLookup) { var child = svgweb._guidLookup[guid]; if (child._fake && child._getFakeNode() === nodeHandler) { delete svgweb._guidLookup[guid]; } } // remove various properties to prevent IE memory leaks nodeHandler._scriptNode = null; nodeHandler.flash.documentElement = null; nodeHandler.flash = null; nodeHandler._xml = null; nodeHandler = null; } // end if (this.getHandlerType() == 'flash') } }, /** Sets up an onContentLoaded listener */ _initDOMContentLoaded: function() { // code adapted from Dean Edwards/Matthias Miller/John Resig/others var self = this; if (document.addEventListener) { // DOMContentLoaded natively supported on Opera 9/Mozilla/Safari 3 document.addEventListener('DOMContentLoaded', function() { self._onDOMContentLoaded(); }, false); } else { // Internet Explorer // id is set to be __ie__svg__onload rather than __ie_onload so // we don't have name collisions with other scripts using this // code as well document.write(' @param win The owner window to patch. @param doc The owner document to work with. Note that there are different possible ways script code might get into a patched window.addEventListener: If it is called during onload or script tag code, then the script is likely patched to run __svgHandler.window.addEventListener where __svgHandler.window is a fake _SVGWindow object with a fake addEventListener. If the script gets a hold of the real window object, it calls in the patched 'real window' method. The following code is the code that patches the real window. */ NativeHandler._patchSvgFileAddEventListener = function(win, doc) { var _addEventListener = win.addEventListener; win.addEventListener = function(type, listener, useCapture) { if (type.toLowerCase() != 'svgload') { _addEventListener(type, listener, useCapture); } else { if (typeof listener == 'object') { listener.handleEvent.call(listener, undefined); } else { listener(); } } } win.__defineGetter__('onsvgload', function() { return this.__onsvgload; }); win.__defineSetter__('onsvgload', function(listener) { this.__onsvgload = listener; this.addEventListener('SVGLoad', listener, false); }); }; // end of static singleton functions // methods that every NativeHandler instance has extend(NativeHandler, { /** Has this handler kick off its work. */ start: function() { //console.log('start'); if (this.type == 'object') { this._handleObject(); } else if (this.type == 'script') { this._handleScript(); } }, /** Handles SVG embedded into the page with a SCRIPT tag. */ _handleScript: function() { // build up a list of namespaces, used by our patched getElementsByTagNameNS this._namespaces = this._getNamespaces(); // replace the SCRIPT node with some actual SVG this._processSVGScript(this._xml, this._svgString, this._scriptNode); // indicate that we are done this._loaded = true; svgweb._handleDone(this.id, 'script', this); }, /** Handles SVG embedded into the page with an OBJECT tag. */ _handleObject: function() { //console.log('handleObject'); // needed so that Firefox doesn't display scroll bars on SVG content // (Issue 164: http://code.google.com/p/svgweb/issues/detail?id=164) // FIXME: Will this cause issues if someone wants to override default // overflow behavior? this._objNode.style.overflow = 'hidden'; // make the object visible again this._objNode.style.visibility = 'visible'; // at this point we wait for our SVG OBJECTs to call svgweb.addOnLoad // so we can know they have loaded. Some browsers however will fire the // onload of the SVG file _before_ our NativeHandler is done depending // on whether they are loading from the cache or not; others will do it the // opposite way (Safari). If the onload was fired and therefore // svgweb.addOnLoad was called, then we stored a reference to the SVG file's // Window object there. if (this._objNode._svgWindow) { this._onObjectLoad(this._objNode._svgFunc, this._objNode._svgWindow); } else { // if SVG Window isn't there, then we need to wait for svgweb.addOnLoad // to get called by the SVG file itself. Store a reference to ourselves // to be used there. this._objNode._svgHandler = this; // if this is a purely static SVG file and it's the only one on the page // then we need to manually see when it loads for Firefox; Safari // correctly fires our onload listener but not Firefox. // Issue 219: "body.onload not fired for SVG OBJECT" // http://code.google.com/p/svgweb/issues/detail?id=219 var self = this; // Our OBJECT node could have come about in two ways: // * It was dynamically created with createElement - in this case // make sure to call the original, unpatched version of // addEventListener (notice that it is _addEventListener below)! We // patched this in NativeHandler._patchAddEventListener(). // * It was in the markup of the page on page load - use the standard // unpatched addEventListener var loadFunc = function() { // svgweb.removeChild might have been called before we are fired if (!self._objNode.contentDocument) { return; } var win = self._objNode.contentDocument.defaultView; self._onObjectLoad(self._objNode._svgFunc, win); }; if (this._objNode._addEventListener) { this._objNode._addEventListener('load', loadFunc, false); } else { this._objNode.addEventListener('load', loadFunc, false); } } }, /** Called by svgweb.addOnLoad() or our NativeHandler function constructor after an SVG OBJECT has loaded to tell us that we have loaded. We require that script writers manually tell us when they have loaded; see 'Knowing When Your SVG Is Loaded' section in the documentation. @param func The actual onload function to fire inside the SVG file (i.e. this is the function the end developer wants run when the SVG file is done loading). @param win The Window object inside the SVG OBJECT */ _onObjectLoad: function(func, win) { //console.log('onObjectLoad'); // we might have already been called before if (this._loaded) { return; // nothing to do } // flag that we are loaded this._loaded = true; // patch various browser objects to correct some browser bugs and // to have more consistency between the Flash and Native handlers var doc = win.document; NativeHandler._patchBrowserObjects(win, doc); // make the SVG root currentTranslate property work like the FlashHandler, // which slightly diverges from the standard due to limitations of IE var root = doc.rootElement; if (root) { this._patchCurrentTranslate(root); } // expose the svgns and xlinkns variables inside in the SVG files // Window object win.svgns = svgns; win.xlinkns = xlinkns; // build up list of namespaces so that getElementsByTagNameNS works with // foreign namespaces this._namespaces = this._getNamespaces(doc); // execute the actual SVG onload that the developer wants run if (func) { func.apply(win); } // execute any cached onload listeners that might been registered with // addEventListener on the SVG OBJECT for (var i = 0; this._objNode._onloadListeners && i < this._objNode._onloadListeners.length; i++) { func = this._objNode._onloadListeners[i]; func.apply(this._objNode); } // try to fire the page-level onload event; the svgweb object will check // to make sure all SVG OBJECTs are loaded svgweb._fireOnLoad(); }, /** Inserts the SVG back into the HTML page with the correct namespace. */ _processSVGScript: function(xml, svgString, scriptNode) { var importedSVG = document.importNode(xml.documentElement, true); scriptNode.parentNode.replaceChild(importedSVG, scriptNode); this._svgRoot = importedSVG; // make the SVG root currentTranslate property work like the FlashHandler, // which slightly diverges from the standard due to limitations of IE this._patchCurrentTranslate(this._svgRoot); }, /** Extracts any namespaces we might have, creating a prefix/namespaceURI lookup table. NOTE: We only support namespace declarations on the root SVG node for now. @param doc Optional. If present, then we retrieve the list of namespaces from the SVG inside of the object. This is the document object inside the SVG file. @returns An object that associates prefix to namespaceURI, and vice versa. */ _getNamespaces: function(doc) { var results = []; var attrs; if (doc) { attrs = doc.documentElement.attributes; } else { attrs = this._xml.documentElement.attributes; } for (var i = 0; i < attrs.length; i++) { var attr = attrs[i]; if (/^xmlns:?(.*)$/.test(attr.nodeName)) { var m = attr.nodeName.match(/^xmlns:?(.*)$/); var prefix = (m[1] ? m[1] : 'xmlns'); var namespaceURI = attr.nodeValue; // don't add duplicates if (!results['_' + prefix]) { results['_' + prefix] = namespaceURI; results['_' + namespaceURI] = prefix; results.push(namespaceURI); } } } return results; }, /** We patch native browsers to use our getter/setter syntax for currentTranslate (we have to use formal methods like currentTranslate.setX() for the Flash renderer instead of currentTranslate.x = 3 due to limitations in Internet Explorer) @root The SVG Root on which we are going to patch the currentTranslate property. */ _patchCurrentTranslate: function(root) { //console.log('patchCurrentTranslate, root='+root); // we have to unfortunately do this at runtime for each SVG OBJECT // since for Firefox/Native the SVGPoint prototype doesn't seem to correctly // extend the currentTranslate property; Safari likes us to extend // the prototype which DOES work there (and FF doesn't), while FF wants // us to extend the actual currentTranslate instance (which Safari // doesn't like) var t; if (typeof SVGRoot != 'undefined') { // FF t = root.currentTranslate; } else if (typeof root.currentTranslate.__proto__ != 'undefined') { // Safari t = root.currentTranslate.__proto__; } else if (typeof SVGPoint != 'undefined') { // Opera // Issue 358: // "Opera throws exception on patch to currentTranslate" // http://code.google.com/p/svgweb/issues/detail?id=358 t = SVGPoint.prototype; } t.setX = function(newValue) { return this.x = newValue; } t.getX = function() { return this.x; } t.setY = function(newValue) { return this.y = newValue; } t.getY = function() { return this.y; } // custom extension in SVG Web to aid performance for Flash renderer t.setXY = function(newValue1, newValue2) { this.x = newValue1; this.y = newValue2; } } }); /** Utility class that helps us keep track of any suspendRedraw operations that might be in effect. The FlashHandler.sendToFlash() method is the primary point at which we check to see if things are suspended; if they are, then we batch them up internally. When things are unsuspended we send them all over in one shot to Flash. @param handler The handler associated with this _RedrawManager */ function _RedrawManager(handler) { this._handler = handler; // we batch all the methods and messages into an array this._batch = []; // the next available suspend ID; we increment this each time so we don't // get duplicate suspend IDs this._nextID = 1; // array of our suspend IDs this._ids = []; // a lookup table going from suspend ID to a window.setTimeout ID this._timeoutIDs = {}; } extend(_RedrawManager, { /** Returns true if redrawing is suspended. */ isSuspended: function() { return (this._ids.length > 0); }, /** Batches up the given Flash method and message for later execution when things are unsuspended. @param method Flash method to invoke @param message Message to send to Flash method. */ batch: function(method, message) { // turn into a single string this._batch.push(method + ':' + message); }, suspendRedraw: function(ms, notifyFlash) { if (ms === undefined) { throw 'Not enough arguments to suspendRedraw'; } if (notifyFlash === undefined) { notifyFlash = true; } // generate an ID var id = this._nextID; /* technically should be unsigned long */ this._nextID++; // kick off a timer to cancel if not unsuspended by developer in time var self = this; var timeoutID = window.setTimeout(function() { self.unsuspendRedraw(id); delete self._timeoutIDs['_' + id]; }, ms); // store an entry this._ids.push(id); this._timeoutIDs['_' + id] = timeoutID; // tell Flash to stop rendering // there is a chance that suspendRedraw is called while the page // is unloading from a setTimout interval; surround everything with a // try/catch block to prevent an exception from blocking page unload if (notifyFlash) { try { this._handler.flash.jsSuspendRedraw(); } catch (exp) { console.log("suspendRedraw exception: " + exp); } } return id; }, unsuspendRedraw: function(id, notifiedFlash) { if (notifiedFlash === undefined) { notifiedFlash = true; } var idx = -1; for (var i = 0; i < this._ids.length; i++) { if (this._ids[i] == id) { idx = i; break; } } if (idx == -1) { throw 'Unknown id passed to unsuspendRedraw: ' + id; } // clear timeout if still in effect if (this._timeoutIDs['_' + id] != undefined) { window.clearTimeout(this._timeoutIDs['_' + id]); } // clear entry this._ids.splice(idx, 1); delete this._timeoutIDs['_' + id]; // other suspendRedraws in effect or nothing to do? // Even if the length is zero, if flash was notified of the suspension // then it needs to be notified of the unsuspension. If the caller // knows flash was never notified of the suspension, they pass notifyFlash=false // and we are free to exit here if there is no suspended work. if (this.isSuspended() || (this._batch.length == 0 && !notifiedFlash)) { return; } // Send over everything to Flash now. We call jsUnsuspendRedrawAll and // send over everything as a giant string. This string is setup as follows. // method:message__SVG__METHOD__DELIMIT // Basically, we have the method name, followed by a colon, followed // by the message to send to that method (which might have __SVG__DELIMITs // in it). Each method is separated by the __SVG__METHOD__DELIMIT // delimiter. var sendMe = this._batch.join('__SVG__METHOD__DELIMIT'); this._batch = []; // there is a chance that unsuspendRedraw is called while the page // is unloading from a setTimout interval; surround everything with a // try/catch block to prevent an exception from blocking page unload try { this._handler.flash.jsUnsuspendRedrawAll(sendMe); } catch (exp) { console.log('unsuspendRedraw exception: ' + exp); } }, unsuspendRedrawAll: function() { for (var i = 0; i < this._ids.length; i++) { this.unsuspendRedraw(this._ids[i]); } }, forceRedraw: function() { // not implemented } }); /* The SVG 1.1 spec requires DOM Level 2 Core and Events support. DOM Level 2 Core spec: http://www.w3.org/TR/DOM-Level-2-Core/ DOM Level 2 Events spec: http://www.w3.org/TR/DOM-Level-2-Events/events.html#Events-Registration-interfaces The following DOM 2 Core interfaces are not supported: NamedNodeMap, Attr, Text, Comment, CDATASection, DocumentType, Notation, Entity, EntityReference, ProcessingInstruction We underscore our DOM interface names below so that they don't collide with the browser's implementations of these (for example, Firefox exposes the DOMException, Node, etc. interfaces as well) */ function _DOMImplementation() {} extend(_DOMImplementation, { hasFeature: function(feature /* String */, version /* String */) /* Boolean */ { // TODO } // Note: createDocumentType and createDocument left out }); // Note: Only element, text nodes, document nodes, and document fragment nodes // are supported for now. We don't parse and retain comments, processing // instructions, etc. CDATA nodes are turned into text nodes. function _Node(nodeName, nodeType, prefix, namespaceURI, nodeXML, handler) { if (nodeName === undefined && nodeType === undefined) { // prototype subclassing return; } this.nodeName = nodeName; this._nodeXML = nodeXML; this._handler = handler; this._listeners = {}; this._detachedListeners = []; this.fake = true; // Firefox and Safari will incorrectly turn our internal parsed XML // for the Flash Handler into actual SVG nodes, causing issues. This is // a workaround to prevent this problem. if (namespaceURI == svgnsFake) { namespaceURI = svgns; } // handle nodes that were created with createElementNS but are not yet // attached to the document yet if (nodeType == _Node.ELEMENT_NODE && !this._nodeXML) { // build up an empty XML node for this element var xml = '\n'; if (namespaceURI == svgns && !prefix) { // we use a fake namespace for SVG to prevent Firefox and Safari // from incorrectly making these XML nodes real SVG objects! xml += '<' + nodeName + ' xmlns="' + svgnsFake + '"/>'; } else { xml += '<' + nodeName + ' xmlns:' + prefix + '="' + namespaceURI + '"/>'; } this._nodeXML = parseXML(xml).documentElement; } else if (nodeType == _Node.DOCUMENT_FRAGMENT_NODE) { var xml = '\n' + '<__document__fragment>'; this._nodeXML = parseXML(xml).documentElement; } // handle guid tracking if (nodeType != _Node.DOCUMENT_NODE && this._nodeXML) { if (!this._nodeXML.getAttribute('__guid')) { this._nodeXML.setAttribute('__guid', guid()); } this._guid = this._nodeXML.getAttribute('__guid'); // store a reference to the new node so that later fetching of this // node will respect object equality svgweb._guidLookup['_' + this._guid] = this; } if (nodeType == _Node.ELEMENT_NODE) { if (nodeName.indexOf(':') != -1) { this.localName = nodeName.match(/^[^:]*:(.*)$/)[1]; } else { this.localName = nodeName; } } if (nodeType) { this.nodeType = nodeType; } else { this.nodeType = _Node.ELEMENT_NODE; } if (nodeType == _Node.ELEMENT_NODE || nodeType == _Node.DOCUMENT_NODE || nodeType == _Node.DOCUMENT_FRAGMENT_NODE) { this.prefix = prefix; this.namespaceURI = namespaceURI; this._nodeValue = null; } else if (nodeType == _Node.TEXT_NODE) { // We store the actual text node value as a child of our 'fake' DOM // Element. We have to use a DOM Element so that we have access to // setAttribute to store a fake __guid attribute to track the text node. this._nodeValue = this._nodeXML.firstChild.nodeValue; // browsers return null instead of undefined; match their behavior this.prefix = null; this.namespaceURI = null; if (this._nodeValue === undefined) { this._nodeValue = null; } } // even when not attached native behavior for ownerDocument is to be // set to 'document' this.ownerDocument = document; // if we are an SVG OBJECT set to our fake pseudo _Document if (this._handler && this._handler.type == 'object') { this.ownerDocument = this._handler.document; } // create empty stub methods for certain methods to help IE's HTC be // smaller, which has a very strong affect on performance if (isIE) { this._createEmptyMethods(); } this._childNodes = this._createChildNodes(); // we use an XML Element rather than an XML Text Node to 'track' our // text nodes; indicate as such using an attribute if (nodeType == _Node.TEXT_NODE) { this._nodeXML.setAttribute('__fakeTextNode', true); } // prepare the getter and setter magic for non-IE browsers if (!isIE) { this._defineNodeAccessors(); } else if (isIE && this.nodeType != _Node.DOCUMENT_NODE) { // If we are IE, we must use a behavior in order to get onpropertychange // and override core DOM methods. We only do this for normal SVG elements // and DocumentFragments and not for the DOCUMENT element. this._createHTC(); } } mixin(_Node, { ELEMENT_NODE: 1, TEXT_NODE: 3, DOCUMENT_NODE: 9, DOCUMENT_FRAGMENT_NODE: 11 // Note: many other node types left out here }); extend(_Node, { /* Event listeners; this is an object hashtable that keys the event name, such as 'mousedown', with an array of functions to execute when this event happens. This second level array is also used as an object hashtable to associate the function + useCapture with the listener so that we can implement removeListener at a later point. We only add to this table if the node is attached to the DOM. Example: _listeners['mousedown'] --> array of listeners _listeners['mousedown'][0] --> first mousedown listener, a function _listeners['mousedown']['_' + someListener + ':' + useCapture] --> getting listener by function reference for mouse down event */ _listeners: null, /* An array that we use to store addEventListener requests for detached nodes, where each array entry is an object literal with the following values: type - The type of the event listener - The function object to execute useCapture - Whether to use capturing or not. */ _detachedListeners: null, insertBefore: function(newChild /* _Node */, refChild /* _Node */) { //console.log('insertBefore, newChild='+newChild.id+', refChild='+refChild.id); if (this.nodeType != _Node.ELEMENT_NODE && this.nodeType != _Node.DOCUMENT_FRAGMENT_NODE) { throw 'Not supported'; } // Issue 296: existing child should not be added again if (newChild.parentNode) { newChild.parentNode.removeChild(newChild); } // if the children are DOM nodes, turn them into _Node or _Element // references newChild = this._getFakeNode(newChild); refChild = this._getFakeNode(refChild); // flag that indicates that the child is a _DocumentFragment (keeps // the overall code smaller); we have to treat these differently since // we are importing all of the DocumentFragment's children rather than // just one new child var isFragment = (newChild.nodeType == _Node.DOCUMENT_FRAGMENT_NODE); var fragmentChildren; if (isFragment) { fragmentChildren = newChild._getChildNodes(true /* get fake nodes */); } // are we an empty DocumentFragment? if (isFragment && fragmentChildren.length == 0) { // nothing to do newChild._reset(); // clean out DocumentFragment return newChild._getProxyNode(); } // get an index position for where refChild is var findResults = this._findChild(refChild); if (findResults === null) { // TODO: Throw the correct DOM error instead throw new Error('Invalid child passed to insertBefore'); } var position = findResults.position; // import the newChild or all of the _DocumentFragment children into // ourselves, insert it into our XML, and process the newChild and all // its descendants var importMe = []; if (isFragment) { for (var i = 0; i < fragmentChildren.length; i++) { importMe.push(fragmentChildren[i]); } } else { importMe.push(newChild); } for (var i = 0; i < importMe.length; i++) { var importedNode = this._importNode(importMe[i], false); this._nodeXML.insertBefore(importedNode, refChild._nodeXML); this._processAppendedChildren(importMe[i], this, this._attached); } // inform Flash about the change if (this._attached && this._passThrough) { var xmlString = FlashHandler._encodeFlashData( xmlToStr(newChild, this._handler.document._namespaces)); this._handler.sendToFlash('jsInsertBefore', [ refChild._guid, this._guid, position, xmlString ]); } if (!isIE) { // _childNodes is an object literal instead of an array // to support getter/setter magic for Safari for (var i = 0; i < importMe.length; i++) { this._defineChildNodeAccessor(this._childNodes.length); this._childNodes.length++; } } // clear out the child if it is a DocumentFragment if (newChild.nodeType == _Node.DOCUMENT_FRAGMENT_NODE) { newChild._reset(); } else { newChild._attached = this._attached; } return newChild._getProxyNode(); }, replaceChild: function(newChild /* _Node */, oldChild /* _Node */) { //console.log('replaceChild, newChild='+newChild.nodeName+', oldChild='+oldChild.nodeName); if (this.nodeType != _Node.ELEMENT_NODE && this.nodeType != _Node.DOCUMENT_FRAGMENT_NODE) { throw 'Not supported'; } // Issue 296: existing child should not be added again if (newChild.parentNode) { newChild.parentNode.removeChild(newChild); } // the children could be DOM nodes; turn them into something we can // work with, such as _Nodes or _Elements newChild = this._getFakeNode(newChild); oldChild = this._getFakeNode(oldChild); // flag that indicates that the child is a _DocumentFragment (keeps // the overall code smaller); we have to treat these differently since // we are importing all of the DocumentFragment's children rather than // just one new child var isFragment = (newChild.nodeType == _Node.DOCUMENT_FRAGMENT_NODE); var fragmentChildren; if (isFragment) { fragmentChildren = newChild._getChildNodes(true /* get fake nodes */); } // are we an empty DocumentFragment? if (isFragment && fragmentChildren.length == 0) { // nothing to do newChild._reset(); // clean out DocumentFragment return newChild._getProxyNode(); } // in our XML, find the index position of where oldChild used to be var findResults = this._findChild(oldChild); if (findResults === null) { // TODO: Throw the correct DOM error instead throw new Error('Invalid child passed to replaceChild'); } var position = findResults.position; // remove oldChild this.removeChild(oldChild); // import the newChild or all of the _DocumentFragment children into // ourselves, insert it into our XML, and process the newChild and all // its descendants var importMe = []; if (isFragment) { for (var i = 0; i < fragmentChildren.length; i++) { importMe.push(fragmentChildren[i]); } } else { importMe.push(newChild); } if (!isIE) { for (var i = 0; i < importMe.length; i++) { // _childNodes is an object literal instead of an array // to support getter/setter magic for Safari this._defineChildNodeAccessor(this._childNodes.length); this._childNodes.length++; } } var addToEnd = false; if (position >= this._nodeXML.childNodes.length) { addToEnd = true; } var insertAt = position; for (var i = 0; i < importMe.length; i++) { // import newChild into ourselves, telling importNode not to do an // appendChild since we will handle things ourselves manually later on var importedNode = this._importNode(importMe[i], false); // now bring the imported child into our XML where the oldChild used to be if (addToEnd) { // old node was at the end -- just do an appendChild this._nodeXML.appendChild(importedNode); } else { // old node is somewhere in the middle or beginning; jump one ahead // from the old position and do an insertBefore var placeBefore = this._nodeXML.childNodes[insertAt]; this._nodeXML.insertBefore(importedNode, placeBefore); insertAt++; } } // tell Flash about the newly inserted child if (this._attached && this._passThrough) { var xmlString = FlashHandler._encodeFlashData( xmlToStr(newChild, this._handler.document._namespaces)); this._handler.sendToFlash('jsAddChildAt', [ this._guid, position, xmlString ]); } // now process the newChild's node this._processAppendedChildren(newChild, this, this._attached); // recursively set the removed node to be unattached and to not // pass through changes to Flash anymore oldChild._setUnattached(); // track this removed node so we can clean it up on page unload svgweb._removedNodes.push(oldChild._getProxyNode()); // clear out the child if it is a DocumentFragment if (newChild.nodeType == _Node.DOCUMENT_FRAGMENT_NODE) { newChild._reset(); } else { newChild._attached = this._attached; } return oldChild._getProxyNode(); }, removeChild: function(child /* _Node or DOM Node */) { //console.log('removeChild, child='+child.nodeName+', this='+this.nodeName); if (this.nodeType != _Node.ELEMENT_NODE && this.nodeType != _Node.DOCUMENT_FRAGMENT_NODE) { throw 'Not supported'; } if (child.nodeType != _Node.ELEMENT_NODE && child.nodeType != _Node.TEXT_NODE) { throw 'Not supported'; } // the child could be a DOM node; turn it into something we can // work with, such as a _Node or _Element child = this._getFakeNode(child); // remove child from our list of XML var findResults = this._findChild(child); if (findResults === null) { // TODO: Throw the correct DOM error instead throw new Error('Invalid child passed to removeChild'); } var position = findResults.position; this._nodeXML.removeChild(findResults.nodeXML); // remove from our nodeById lookup table if (child.nodeType == _Node.ELEMENT_NODE) { var childID = child._getId(); if (childID && this._attached) { this._handler.document._nodeById['_' + childID] = undefined; } } // TODO: FIXME: Note that we don't remove the node from the GUID lookup // table; this is because developers might still be working with the // node while detached, and we want object equality to hold. This means // that memory will grow over time however. Find a good solution to this // issue without having to have the complex unattached child node structure // we had before. //svgweb._guidLookup['_' + child._guid] = undefined; // persist event listeners if this node is later reattached child._persistEventListeners(); // remove the getter/setter for this childNode for non-IE browsers if (!isIE) { // just remove the last getter/setter, since they all resolve // to a dynamic function anyway delete this._childNodes[this._childNodes.length - 1]; this._childNodes.length--; } else { // for IE, remove from _childNodes data structure this._childNodes.splice(position, 1); } // inform Flash about the change if (this._attached && this._passThrough) { this._handler.sendToFlash('jsRemoveChild', [ child._guid ]); } // recursively set the removed node to be unattached and to not // pass through changes to Flash anymore child._setUnattached(); // track this removed node so we can clean it up on page unload svgweb._removedNodes.push(child._getProxyNode()); return child._getProxyNode(); }, /** Appends the given child. The child can either be _Node, an actual DOM Node, or a Text DOM node created through document.createTextNode. We return either a _Node or an HTC reference depending on the browser. */ appendChild: function(child /* _Node or DOM Node */) { //console.log('appendChild, child='+child.nodeName+', this.nodeName='+this.nodeName); if (this.nodeType != _Node.ELEMENT_NODE && this.nodeType != _Node.DOCUMENT_FRAGMENT_NODE) { throw 'Not supported'; } // Issue 296: existing child should not be added again if (child.parentNode) { child.parentNode.removeChild(child); } // the child could be a DOM node; turn it into something we can // work with, such as a _Node or _Element child = this._getFakeNode(child); // flag that indicates that the child is a _DocumentFragment (keeps // the overall code smaller); we have to treat these differently since // we are importing all of the DocumentFragment's children rather than // just one new child var isFragment = (child.nodeType == _Node.DOCUMENT_FRAGMENT_NODE); var fragmentChildren; if (isFragment) { fragmentChildren = child._getChildNodes(true /* get fake nodes */); } // are we an empty DocumentFragment? if (isFragment && fragmentChildren.length == 0) { // nothing to do child._reset(); // clean out DocumentFragment return child._getProxyNode(); } // add the child's XML to our own if (isFragment) { for (var i = 0; i < fragmentChildren.length; i++) { this._importNode(fragmentChildren[i]); } } else { this._importNode(child); } if (isIE) { // _childNodes is a real array on IE rather than an object literal // like other browsers if (isFragment) { for (var i = 0; i < fragmentChildren.length; i++) { this._childNodes.push(fragmentChildren[i]._htcNode); } } else { this._childNodes.push(child._htcNode); } } else { // _childNodes is an object literal instead of an array // to support getter/setter magic for Safari if (isFragment) { for (var i = 0; i < fragmentChildren.length; i++) { this._defineChildNodeAccessor(this._childNodes.length); this._childNodes.length++; } } else { this._defineChildNodeAccessor(this._childNodes.length); this._childNodes.length++; } } // serialize this node and all its children into an XML string and // send that over to Flash if (this._attached && this._passThrough) { // note that if the child is a DocumentFragment that we simply send // the <__document__fragment> tag over to Flash so it knows what it is // dealing with var xmlString = FlashHandler._encodeFlashData( xmlToStr(child, this._handler.document._namespaces)); this._handler.sendToFlash('jsAppendChild', [ this._guid, xmlString ]); } // process the children (cache important info, add a handler, etc.) this._processAppendedChildren(child, this, this._attached); // clear out the child if it is a DocumentFragment if (child.nodeType == _Node.DOCUMENT_FRAGMENT_NODE) { child._reset(); } else { child._attached = this._attached; } return child._getProxyNode(); }, hasChildNodes: function() /* Boolean */ { return (this._getChildNodes().length > 0); }, // Note: cloneNode and normalize not supported isSupported: function(feature /* String */, version /* String */) { if (version == '2.0') { if (feature == 'Core') { // NOTE: There are a number of things we don't yet support in Core, // but we support the bulk of it return true; } else if (feature == 'Events' || feature == 'UIEvents' || feature == 'MouseEvents') { // NOTE: We plan on supporting most of these interfaces, but not // all of them return true; } } else { return false; } }, hasAttributes: function() /* Boolean */ { if (this.nodeType == _Node.ELEMENT_NODE) { for (var i in this._attributes) { // if this is an XMLNS declaration, don't consider it a valid // attribute for hasAttributes if (/^_xmlns/i.test(i)) { continue; } // if there is an ID attribute, but it's one of our randomly generated // ones, then don't consider this a valid attribute for hasAttributes if (i == '_id' && /^__svg__random__/.test(this._attributes[i])) { continue; } // ignore our internal __guid and __fakeTextNode attributes; // note that we have an extra _ before our attribute name when we // store it internally, so __guid becomes ___guid if (i == '___guid' && /^__guid/.test(this._attributes[i])) { continue; } if (i == '___fakeTextNode' && /^__fakeTextNode/.test(this._attributes[i])) { continue; } // our attributes start with an underscore if (/^_.*/.test(i) && this._attributes.hasOwnProperty(i)) { return true; } } return false; } else { return false; } }, /* DOM Level 2 EventTarget interface methods. Note: dispatchEvent not supported. Technically as well this interface should not appear on SVG elements that don't have any event dispatching, such as the SVG DESC element, but in our implementation they still appear. We also don't support the useCapture feature for addEventListener and removeEventListener. */ /* @param _adding Internal boolean flag used when we are adding this node to a real DOM, so that we can replay and send our addEventListener request over to Flash. */ addEventListener: function(type, listener /* Function */, useCapture, _adding /* Internal -- Boolean */) { //console.log('addEventListener, type='+type+', listener='+listener+', useCapture='+useCapture+', _adding='+_adding); // NOTE: capturing not supported if (this.nodeType != _Node.ELEMENT_NODE && this.nodeType != _Node.TEXT_NODE && (this.nodeType != _Node.DOCUMENT_NODE || type != 'keydown')) { throw 'Not supported'; } if (!_adding && !this._attached) { // add to a list of event listeners that will get truly registered when // we get attached in _Node._processAppendedChildren() this._detachedListeners.push({ type: type, listener: listener, useCapture: useCapture }); return; } // add to our list of event listeners if (this._listeners[type] === undefined) { this._listeners[type] = []; } this._listeners[type].push({ type: type, listener: listener, useCapture: useCapture }); this._listeners[type]['_' + listener.toString() + ':' + useCapture] = listener; if (type == 'keydown') { this._handler.addKeyboardListener(type, listener, useCapture); } this._handler.sendToFlash('jsAddEventListener', [ this._guid, type ]); }, removeEventListener: function(type, listener /* Function */, useCapture) { // NOTE: capturing not supported if (this.nodeType != _Node.ELEMENT_NODE && this.nodeType != _Node.TEXT_NODE) { throw 'Not supported'; } var pos; if (!this._attached) { // remove from our list of event listeners that we keep around until // _Node._processAppendedChildren() is called pos = this._findListener(this._detachedListeners, type, listener, useCapture); if (pos !== null) { delete this._detachedListeners[pos]; } return; } // remove from our list of event listeners pos = this._findListener(this._listeners, type, listener, useCapture); if (pos !== null) { // FIXME: Ensure that if identical listeners are added twice that they collapse to // just one entry or else this will fail to delete more than the first one. delete this._listeners[pos]; delete this._listeners[type]['_' + listener.toString() + ':' + useCapture]; } if (type == 'keydown') { // FIXME: We really need to remove keypress logic from being handled by us pos = this._findListener(this._keyboardListeners, type, listener, useCapture); if (pos !== null) { // FIXME: Ensure that if identical listeners are added twice that they collapse to // just one entry or else this will fail to delete more than the first one. delete this._keyboardListeners[pos]; } } this._handler.sendToFlash('jsRemoveEventListener', [ this._guid, type ]); }, getScreenCTM: function() { var msg = this._handler.sendToFlash('jsGetScreenCTM', [ this._guid ]); msg = this._handler._stringToMsg(msg); return new _SVGMatrix(new Number(msg.a), new Number(msg.b), new Number(msg.c), new Number(msg.d), new Number(msg.e), new Number(msg.f), this._handler); }, getCTM: function() { return this.getScreenCTM(); }, /** Clones the given node. @param deepClone Whether this is a shallow clone or a deep clone copying all of our children. */ cloneNode: function(deepClone) { //console.log('cloneNode, ns='+this.namespaceURI+', nodeName='+this.nodeName); var clone; // if we are a non-SVG, non-HTML node, such as a namespaced node inside // of an SVG metadata node, handle this a bit differently if (this.nodeType == _Node.ELEMENT_NODE && this.namespaceURI != svgns) { clone = new _Element(this.nodeName, this.prefix, this.namespaceURI); } else if (this.nodeType == _Node.ELEMENT_NODE) { clone = document.createElementNS(this.namespaceURI, this.nodeName); } else if (this.nodeType == _Node.TEXT_NODE) { clone = document.createTextNode(this._nodeValue, true); } else if (this.nodeType == _Node.DOCUMENT_FRAGMENT_NODE) { clone = document.createDocumentFragment(true); } else { throw 'cloneNode not supported for nodeType: ' + this.nodeType; } clone = this._getFakeNode(clone); // copy over our attributes var attrs = this._nodeXML.attributes; for (var i = 0; i < attrs.length; i++) { var attr = attrs.item(i); // IE doesn't have localName or prefix; they are munged together var m = attr.name.match(/([^:]+):?(.*)/); var ns = attr.namespaceURI; // Safari doesn't like setting xmlns declarations with createAttributeNS; // we have to do it this way unfortunately if (isSafari && attr.name.indexOf('xmlns') != -1) { clone._nodeXML.setAttribute(attr.name, attr.nodeValue); } else { // browsers other than Safari // IE doesn't have namespace aware setAttribute methods var attrNode; var doc = clone._nodeXML.ownerDocument; if (isIE) { attrNode = doc.createNode(2, attr.name, ns); } else { attrNode = doc.createAttributeNS(ns, attr.name); } attrNode.nodeValue = attr.nodeValue; if (isIE) { clone._nodeXML.setAttributeNode(attrNode); } else { clone._nodeXML.setAttributeNodeNS(attrNode); } } } // make sure our XML has our correct new cloned GUID clone._nodeXML.setAttribute('__guid', clone._guid); // for IE, copy over cached style values if (isIE) { var copyStyle = this._htcNode.style; for (var i = 0; i < copyStyle.length; i++) { var styleName = copyStyle.item(i); var styleValue = copyStyle.getPropertyValue(styleName); // bump the length on our real style object and on our fake one clone._htcNode.style.length++; clone.style.length++; // add the new style to our real style object and ignore style // changes temporarily so we don't end up in an infinite loop of // asynchronous style updates from onpropertychange events clone.style._ignoreStyleChanges = true; clone._htcNode.style[styleName] = styleValue; clone.style._ignoreStyleChanges = false; } } // update internal attributes table as well on the clone if (clone.nodeType == _Node.ELEMENT_NODE) { clone._importAttributes(clone, clone._nodeXML); } // clone each of the children and add them if (deepClone && (clone.nodeType == _Node.ELEMENT_NODE || clone.nodeType == _Node.DOCUMENT_FRAGMENT_NODE)) { var children = this._getChildNodes(); for (var i = 0; i < children.length; i++) { var childClone = children[i].cloneNode(true); clone.appendChild(childClone); } } // make sure our ownerDocument is right clone.ownerDocument = this.ownerDocument; return clone._getProxyNode(); }, toString: function() { if (this.namespaceURI == svgns) { return '[_SVG' + this.localName.charAt(0).toUpperCase() + this.localName.substring(1) + ']'; } else if (this.prefix) { return '[' + this.prefix + ':' + this.localName + ']'; } else if (this.localName) { return '[' + this.localName + ']'; } else { return '[' + this.nodeName + ']'; } }, /** Adds an event cross platform. @param obj Obj to add event to. @param type String type of event. @param fn Function to execute when event happens. */ _addEvent: function(obj, type, fn) { if (obj.addEventListener) { obj.addEventListener(type, fn, false); } else if (obj.attachEvent) { // IE obj['e'+type+fn] = fn; // do a trick to prevent closure over ourselves, which can lead to // IE memory leaks obj[type+fn] = (function(obj, type, fn) { return function(){ obj['e'+type+fn](window.event) }; })(obj, type, fn); obj.attachEvent('on'+type, obj[type+fn]); } }, // NOTE: technically the following attributes should be read-only, // raising DOMExceptions if set, but for simplicity we make them // simple JS properties instead. If set nothing will happen. nodeName: null, nodeType: null, ownerDocument: null, /* Document or _Document depending on context. */ namespaceURI: null, localName: null, prefix: null, /* Note: in the DOM 2 spec this is settable but not for us */ // getter/setter attribute methods // nodeValue defined as getter/setter // textContent and data defined as getters/setters for TEXT_NODES // childNodes defined as getter/setter _getParentNode: function() { if (this.nodeType == _Node.DOCUMENT_NODE || this.nodeType == _Node.DOCUMENT_FRAGMENT_NODE) { return null; } // are we the root SVG node when being embedded by an SVG SCRIPT? // If _handler is not set, this element is a detached svg element. if (this._attached && this._handler && this._getProxyNode() == this._handler.document.rootElement) { if (this._handler.type == 'script') { return this._handler.flash.parentNode; } else if (this._handler.type == 'object') { // if we are the root SVG node and are embedded by an SVG OBJECT, then // our parent is a #document object return this._handler.document; } } var parentXML = this._nodeXML.parentNode; // unattached nodes might have an XML document as their parentNode if (parentXML === null || parentXML.nodeType == _Node.DOCUMENT_NODE) { return null; } var node = FlashHandler._getNode(parentXML, this._handler); this._getFakeNode(node)._attached = this._attached; return node; }, _getFirstChild: function() { if (this.nodeType == _Node.TEXT_NODE) { return null; } var childXML = this._nodeXML.firstChild; if (childXML === null) { return null; } var node = FlashHandler._getNode(childXML, this._handler); this._getFakeNode(node)._attached = this._attached; return node; }, _getLastChild: function() { if (this.nodeType == _Node.TEXT_NODE) { return null; } var childXML = this._nodeXML.lastChild; if (childXML === null) { return null; } var node = FlashHandler._getNode(childXML, this._handler); this._getFakeNode(node)._attached = this._attached; return node; }, _getPreviousSibling: function() { if (this.nodeType == _Node.DOCUMENT_NODE || this.nodeType == _Node.DOCUMENT_FRAGMENT_NODE) { return null; } // are we the root SVG object when being embedded by an SVG SCRIPT? // If _handler is not set, this element is a nested svg element. if (this._attached && this._handler && this._getProxyNode() == this._handler.document.rootElement && this._handler.type == 'script') { var sibling = this._handler.flash.previousSibling; // is our previous sibling also an SVG object? if (sibling && sibling.nodeType == 1 && sibling.className && sibling.className.indexOf('embedssvg') != -1) { var rootID = sibling.getAttribute('id').replace('_flash', ''); var node = svgweb.handlers[rootID].document.documentElement; return node._getProxyNode(); } else { return sibling; } } var siblingXML = this._nodeXML.previousSibling; // unattached nodes will sometimes have an XML Processing Instruction // as their previous node (type=7) if (siblingXML === null || siblingXML.nodeType == 7) { return null; } var node = FlashHandler._getNode(siblingXML, this._handler); this._getFakeNode(node)._attached = this._attached; return node; }, _getNextSibling: function() { if (this.nodeType == _Node.DOCUMENT_NODE || this.nodeType == _Node.DOCUMENT_FRAGMENT_NODE) { return null; } // are we the root SVG object when being embedded by an SVG SCRIPT? // If _handler is not set, this element is a nested svg element. if (this._attached && this._handler && this._getProxyNode() == this._handler.document.rootElement && this._handler.type == 'script') { var sibling = this._handler.flash.nextSibling; // is our previous sibling also an SVG object? if (sibling && sibling.nodeType == 1 && sibling.className && sibling.className.indexOf('embedssvg') != -1) { var id = sibling.getAttribute('id').replace('_flash', ''); var node = this._handler.document._nodeById['_' + id]; return node._getProxyNode(); } else { return sibling; } } var siblingXML = this._nodeXML.nextSibling; if (siblingXML === null) { return null; } var node = FlashHandler._getNode(siblingXML, this._handler); this._getFakeNode(node)._attached = this._attached; return node; }, // Note: 'attributes' property not supported since we don't support // Attribute DOM Node types // TODO: It would be nice to support the ElementTraversal spec here as well // since it cuts down on code size: // http://www.w3.org/TR/ElementTraversal/ /** A flag used to supress events to flash. **/ _passThrough: true, /** The attached flag indicates whether this node is attached to a live DOM yet. For example, if you call createElementNS, you can set values on this node before actually appending it using appendChild to a node that is connected to the actual visible DOM, ready to be rendered. */ _attached: false, /** A flag we put on our _Nodes and _Elements to indicate they are fake; useful if someone wants to 'break' the abstraction and see if a node is a real DOM node or not (which won't have this flag). */ _fake: true, /** Do the getter/setter magic for our attributes for non-IE browsers. */ _defineNodeAccessors: function() { // readonly properties this.__defineGetter__('parentNode', hitch(this, this._getParentNode)); this.__defineGetter__('firstChild', hitch(this, this._getFirstChild)); this.__defineGetter__('lastChild', hitch(this, this._getLastChild)); this.__defineGetter__('previousSibling', hitch(this, this._getPreviousSibling)); this.__defineGetter__('nextSibling', hitch(this, this._getNextSibling)); // childNodes array -- define and execute an inline function so that we // only get closure over the 'self' variable rather than all the // __defineGetter__ calls above. Note that we are forced to have our // childNodes variable be an object literal rather than array, since this // is the only way we can do getter/setter magic on each indexed position // for Safari. this.__defineGetter__('childNodes', (function(self) { return function() { return self._childNodes; }; })(this)); // We represent Text nodes internally using XML Element nodes in order // to support tracking; just set our child nodes to be zero to simulate // Text nodes having no children if (this.nodeName == '#text') { this._childNodes.length = 0; } else { var children = this._nodeXML.childNodes; this._childNodes.length = children.length; for (var i = 0; i < children.length; i++) { // do the defineGetter in a different method so the closure gets // formed correctly (closures can be tricky in loops if you are not // careful); we also need the defineChildNodeAccessor method anyway // since we need the ability to individually define new accessors // at a later point (such as in insertBefore(), for example). this._defineChildNodeAccessor(i); } } // read/write properties if (this.nodeType == _Node.TEXT_NODE) { this.__defineGetter__('data', (function(self) { return function() { return self._nodeValue; }; })(this)); this.__defineSetter__('data', (function(self) { return function(newValue) { return self._setNodeValue(newValue); }; })(this)); this.__defineGetter__('textContent', (function(self) { return function() { return self._nodeValue; }; })(this)); this.__defineSetter__('textContent', (function(self) { return function(newValue) { return self._setNodeValue(newValue); }; })(this)); } else { // ELEMENT and DOCUMENT nodes // Firefox and Safari return '' for textContent for non-text nodes; // mimic this behavior this.__defineGetter__('textContent', (function() { return function() { return ''; }; })()); } this.__defineGetter__('nodeValue', (function(self) { return function() { return self._nodeValue; }; })(this)); this.__defineSetter__('nodeValue', (function(self) { return function(newValue) { return self._setNodeValue(newValue); }; })(this)); }, /** Creates a getter/setter for a childNode at the given index position. We define each one in a separate function so that we don't pull the wrong things into our closure. See _defineNodeAccessors() for details. */ _defineChildNodeAccessor: function(i) { var self = this; this._childNodes.__defineGetter__(i, function() { var childXML = self._nodeXML.childNodes[i]; var node = FlashHandler._getNode(childXML, self._handler); node._attached = self._attached; return node; }); }, /** For IE we have to do some tricks that are a bit different than the other browsers; we can't know when a particular indexed member is called, such as childNodes[1], so instead we return the entire _childNodes array; what is nice is that IE applies the indexed lookup _after_ we've returned things, so this works. This requires us to instantiate all the children, however, when childNodes is called. This method is called by the HTC file. @param returnFakeNodes Optional. If true, then we return our fake nodes; if false, then we return the HTC proxy for IE. Defaults to false. @returns An array of either the HTC proxies for our nodes if IE, or an array of _Element and _Nodes for other browsers. */ _getChildNodes: function(returnFakeNodes) { if (!isIE) { return this._childNodes; } if (returnFakeNodes === undefined) { returnFakeNodes = false; } // NOTE: for IE we return a real full Array, while for other browsers // our _childNodes array is an object literal in order to do // our __defineGetter__ magic in _defineNodeAccessors. It turns out // that on IE a full array can be returned from the getter, and _then_ // the index can get applied (i.e. our array is returned, and then // [2] might get applied to that array). var results = createNodeList(); // We represent our text nodes using an XML Element node instead of an // XML Text node in order to do tracking; we store our actual text value // as a further XML Text node child. Don't return this though. if (this.nodeName == '#text') { return results; } if (this._nodeXML.childNodes.length == this._childNodes.length && !returnFakeNodes) { // we've already processed our childNodes before return this._childNodes; } else { for (var i = 0; i < this._nodeXML.childNodes.length; i++) { var childXML = this._nodeXML.childNodes[i]; var node = FlashHandler._getNode(childXML, this._handler); node._fakeNode._attached = this._attached; if (returnFakeNodes) { node = node._fakeNode; } results.push(node); } this._childNodes = results; return results; } }, /** If we are IE, we must use an HTC behavior in order to get onpropertychange and override core DOM methods. */ _createHTC: function() { //console.log('createHTC'); // we store our HTC nodes into a hidden container located in the // BODY of the document; either get it now or create one on demand if (!this._htcContainer) { this._htcContainer = document.getElementById('__htc_container'); if (!this._htcContainer) { // NOTE: Strangely, onpropertychange does _not_ fire for HTC elements // that are in the HEAD of the document, which is where we used // to put the htc_container. Instead, we have to put it into the BODY // of the document and position it offscreen. var body = document.getElementsByTagName('body')[0]; var c = document.createElement('div'); c.id = '__htc_container'; // NOTE: style.display = 'none' does not work c.style.position = 'absolute'; c.style.top = '-5000px'; c.style.left = '-5000px'; body.appendChild(c); this._htcContainer = c; } } // now store our HTC UI node into this container; we will intercept // all calls through the HTC, and implement all the real behavior // inside ourselves (inside _Element) // Note: we do svg: even if we are dealing with a non-SVG node on IE, // such as sodipodi:namedview; this is necessary so that our svg.htc // file gets invoked for all these nodes, which is by necessity bound to // the svg: namespace var htcNode = document.createElement('svg:' + this.nodeName); htcNode._fakeNode = this; htcNode._handler = this._handler; this._htcContainer.appendChild(htcNode); this._htcNode = htcNode; }, _setNodeValue: function(newValue) { //console.log('setNodeValue, newValue='+newValue); if (this.nodeType != _Node.TEXT_NODE) { return newValue; } this._nodeValue = newValue; // we store the real text value as a child of our fake text node, // which is actually a DOM Element so that we can do tracking this._nodeXML.firstChild.nodeValue = newValue; if (this._attached && this._passThrough) { var flashStr = FlashHandler._encodeFlashData(newValue); var parentGUID = this._nodeXML.parentNode.getAttribute('__guid'); this._handler.sendToFlash('jsSetText', [ parentGUID, this._guid, flashStr ]); } return newValue; }, /** For functions like appendChild, insertBefore, removeChild, etc. outside callers can pass in DOM nodes, etc. This function turns this into something we can work with, such as a _Node or _Element. */ _getFakeNode: function(node) { if (!node) { node = this; } // Was an HTC node passed in for IE? If so, get its _Node if (isIE && node._fakeNode) { node = node._fakeNode; } return node; }, /** We do a bunch of work in this method in order to append a child to ourselves, including: Walking over the child and all of it's children; setting it's handler; setting that it is both attached and can pass through it's values; informing Flash about the newly created element; and updating our list of namespaces if there is a node with a new namespace in the appended children. This method gets called recursively for the child and all of it's children. @param child _Node to work with. @param parent The parent of this child. @param attached Boolean on whether we are attached or not yet. */ _processAppendedChildren: function(child, parent, attached) { //console.log('processAppendedChildren, this.nodeName='+this.nodeName+', child.nodeName='+child.nodeName+', attached='+attached); // walk the DOM from the child using an iterative algorithm, which was // found to be faster than a recursive one; for each node visited we will // store some important reference information var current; var suspendID; if (child.nodeType == _Node.DOCUMENT_FRAGMENT_NODE) { current = this._getFakeNode(child._getFirstChild()); } else { current = child; } // turn on suspendRedraw so adding our event handlers happens in one go if (attached) { suspendID = this._handler._redrawManager.suspendRedraw(10000, false); } while (current) { //console.log('current, nodeName='+current.nodeName); // visit this node var currentXML = current._nodeXML; // set its handler current._handler = this._handler; // store a reference to our node so we can return it in the future var id = currentXML.getAttribute('id'); if (attached && current.nodeType == _Node.ELEMENT_NODE && id) { this._handler.document._nodeById['_' + id] = current; } // set the ownerDocument based on how we were embedded if (attached) { if (this._handler.type == 'script') { current.ownerDocument = document; } else if (this._handler.type == 'object') { current.ownerDocument = this._handler.document; } current._attached = true; // register and send over any event listeners that were added while // this node was detached for (var i = 0; i < current._detachedListeners.length; i++) { var addMe = current._detachedListeners[i]; if (addMe) { current.addEventListener(addMe.type, addMe.listener, addMe.useCapture, true); } } current._detachedListeners = []; } // now continue visiting other nodes var lastVisited = current; var children = current._getChildNodes(); var next = (children && children.length > 0) ? children[0] : null; if (next) { current = next; if (isIE) { current = current._fakeNode; } } while (!next && current) { if (current != child) { next = current._getNextSibling(); if (next) { current = next; if (isIE) { current = current._fakeNode; } break; } } if (current == child) { current = null; } else { current = current._getParentNode(); if (current && isIE) { current = current._fakeNode; } // Do not traverse non-elements or retrace up past the root if (current && ((current.nodeType != 1) || (current._handler && current._getProxyNode() == current._handler.document.rootElement ))) { current = null; } } } } // turn off suspendRedraw. all event handlers should shoot through now if (attached) { this._handler._redrawManager.unsuspendRedraw(suspendID, false); } }, /** Imports the given child and all it's children's XML into our XML. @param child _Node to import. @param doAppend Optional. Boolean on whether to actually append the child once it is imported. Useful for functions such as replaceChild that want to do this manually. Defaults to true if not specified. @returns The imported node. */ _importNode: function(child, doAppend) { //console.log('importNode, child='+child.nodeName+', doAppend='+doAppend); if (typeof doAppend == 'undefined') { doAppend = true; } // try to import the node into our _Document's XML object var doc; if (this._attached) { doc = this._handler.document._xml; } else { doc = this._nodeXML.ownerDocument; } // IE does not support document.importNode, even on XML documents, // so we have to define it ourselves. // Adapted from ALA article: // http://www.alistapart.com/articles/crossbrowserscripting var importedNode; if (typeof doc.importNode == 'undefined') { // import the node for IE importedNode = document._importNodeFunc(doc, child._nodeXML, true); } else { // non-IE browsers importedNode = doc.importNode(child._nodeXML, true); } // complete the import into ourselves if (doAppend) { this._nodeXML.appendChild(importedNode); } // replace all of the children's XML with our copy of it now that it // is imported child._importChildXML(importedNode); return importedNode; }, /** Recursively replaces the XML inside of our children with the given new XML to ensure that each node's reference to it's own internal _nodeXML pointer all points to the same tree, but in different locations. Called after we are importing a node into ourselves with appendChild. */ _importChildXML: function(newXML) { this._nodeXML = newXML; var children = this._getChildNodes(); for (var i = 0; i < children.length; i++) { var currentChild = children[i]; if (isIE && currentChild._fakeNode) { // IE currentChild = currentChild._fakeNode; } currentChild._nodeXML = this._nodeXML.childNodes[i]; currentChild._importChildXML(this._nodeXML.childNodes[i]); } }, /** Tries to find the given child in our list of child nodes. @param child A _Node or _Element to search for in our list of childNodes. @param ignoreTextNodes Optional, defaults to false. If true, then we ignore any text nodes when looking for the child, as if all we have are element nodes. @returns Null if nothing found, otherwise an object literal with 2 values: position The index position of where the child is located. nodeXML The found XML node. If the child is not found then null is returned instead. */ _findChild: function(child, ignoreTextNodes) { //console.log('findChild, child='+child.nodeName); if (ignoreTextNodes === undefined) { ignoreTextNodes = false; } var results = {}; var elementIndex = 0; for (var i = 0; i < this._nodeXML.childNodes.length; i++) { var currentXML = this._nodeXML.childNodes[i]; if (currentXML.nodeType != _Node.ELEMENT_NODE && currentXML.nodeType != _Node.TEXT_NODE) { // FIXME: What about CDATA nodes? // FIXME: If there are other kinds of nodes, how does this impact // our elementIndex variable? continue; } // skip text nodes? if (ignoreTextNodes && (currentXML.getAttribute('__fakeTextNode') || currentXML.nodeType == _Node.TEXT_NODE)) { continue; } if (currentXML.nodeType == _Node.ELEMENT_NODE) { elementIndex++; } if (currentXML.nodeType == _Node.ELEMENT_NODE && currentXML.getAttribute('__guid') == child._guid) { results.position = (ignoreTextNodes) ? elementIndex : i; results.nodeXML = currentXML; return results; } } return null; }, /** After a node is unattached, such as through a removeChild, this method recursively sets _attached to false on this node and all of its children. */ _setUnattached: function() { // set each child to be unattached var children = this._getChildNodes(); for (var i = 0; i < children.length; i++) { var child = children[i]; if (isIE) { child = child._fakeNode; } child._setUnattached(); } this._attached = false; this._handler = null; }, /** When we return results to external callers, such as appendChild, we can return one of our fake _Node or _Elements. However, for IE, we have to return the HTC 'proxy' through which callers manipulate things. The HTC is what allows us to override core DOM methods and know when property and style changes have happened, for example. */ _getProxyNode: function() { if (!isIE) { return this; } else { // for IE, the developer will manipulate things through the UI/HTC // proxy facade so that we can know about property changes, etc. return this._htcNode; } }, /** Creates our childNodes data structure in a different way for different browsers. We have this in a separate method so that we avoid forming a closure of elements that could lead to a memory leak in IE. */ _createChildNodes: function() { var childNodes; if (!isIE) { // NOTE: we make _childNodes an object literal instead of an Array; if // it is an array we can't do __defineGetter__ on each index position on // Safari childNodes = {}; // add the item() method from NodeList to our childNodes instance childNodes.item = function(index) { if (index >= this.length) { return null; // DOM Level 2 spec says return null } else { return this[index]; } }; } else { // IE childNodes = createNodeList(); } return childNodes; }, // the following getters and setters for textContent and data are called // by the HTC; we put them here to minimize the size of the HTC which // has a very strong correlation with performance _getTextContent: function() { if (this.nodeType == _Node.TEXT_NODE) { return this._nodeValue; } else { return ''; // Firefox and Safari return empty strings for .textContent } }, _setTextContent: function(newValue) { if (this.nodeType == _Node.TEXT_NODE) { return this._setNodeValue(newValue); } else { return ''; // Firefox and Safari return empty strings for .textContent } }, _getData: function() { if (this.nodeType == _Node.TEXT_NODE) { return this._nodeValue; } else { return undefined; } }, _setData: function(newValue) { if (this.nodeType == _Node.TEXT_NODE) { return this._setNodeValue(newValue); } else { return undefined; } }, /** For Internet Explorer, the length of the script in our HTC is a major determinant in the amount of time it takes to create a new HTC element. In order to minimize the size of this code, we have many 'no-op' implementations of some methods so that we can just safely call them from the HTC without checking the type of the node inside the HTC. */ _createEmptyMethods: function() { if (this.nodeType == _Node.TEXT_NODE) { this.getAttribute = this.getAttributeNS = this.setAttribute = this.setAttributeNS = this.removeAttribute = this.removeAttributeNS = this.hasAttribute = this.hasAttributeNS = this.getElementsByTagNameNS = this._getId = this._setId = this._getX = this._getY = this._getWidth = this._getHeight = this._getCurrentScale = this._setCurrentScale = this._getCurrentTranslate = this.createSVGRect = this.createSVGPoint = function() { return undefined; }; } }, /** When a node is removed from the DOM, we make sure that all of its event listener information (and all of the event info for its children) is persisted if it is later reattached to the DOM. */ _persistEventListeners: function() { // persist all the listeners for ourselves for (var eventType in this._listeners) { for (var i = 0; i < this._listeners[eventType].length; i++) { var l = this._listeners[eventType][i]; this._detachedListeners.push({ type: l.type, listener: l.listener, useCapture: l.useCapture }); } } this._listeners = []; // visit each of our children var children = this._getChildNodes(); for (var i = 0; i < children.length; i++) { var c = children[i]; if (c._fakeNode) { // IE c = c._fakeNode; } c._persistEventListeners(); } }, /** Finds a listener in the given listenerArray using the given type, listener, and useCapture values, returning the index position. Returns null the listener is not found. */ _findListener: function(listenerArray, type, listener, useCapture) { for (var i = 0; i < listenerArray.length; i++) { var l = listenerArray[i]; if (l.listener == listener && l.type == type && l.useCapture == useCapture) { return i; } } return null; } }); /** Our DOM Element for each SVG node. @param nodeName The node name, such as 'rect' or 'sodipodi:namedview'. @param prefix The namespace prefix, such as 'svg' or 'sodipodi'. @param namespaceURI The namespace URI. If undefined, defaults to null. @param nodeXML The parsed XML DOM node for this element. @param handler The FlashHandler rendering this node. element 'pass through' and cause changes in the Flash renderer. */ function _Element(nodeName, prefix, namespaceURI, nodeXML, handler) { if (nodeName === undefined && namespaceURI === undefined && nodeXML === undefined && handler === undefined) { // prototype subclassing return; } // superclass constructor _Node.apply(this, [nodeName, _Node.ELEMENT_NODE, prefix, namespaceURI, nodeXML, handler]); // setup our attributes this._attributes = {}; this._attributes['_id'] = ''; // default id is empty string on FF and Safari this._importAttributes(this, this._nodeXML); // define our accessors if we are not IE; IE does this by using the HTC // file rather than doing it here if (!isIE) { this._defineAccessors(); } if (this.namespaceURI == svgns) { // track .style changes; if (isIE && this._attached && this._handler && this._handler.type == 'script' && this.nodeName == 'svg') { // do nothing now -- if we are IE and are being embedded with an // SVG SCRIPT tag, don't setup the style object for the SVG root now; we // do that later in _SVGSVGElement } else { this.style = new _Style(this); } // handle style changes for HTCs if (isIE && this._attached && this._handler && this._handler.type == 'script' && this.nodeName == 'svg') { // do nothing now - if we are IE we delay creating the style property // until later in _SVGSVGElement } else if (isIE) { this.style._ignoreStyleChanges = false; } } } // subclasses _Node _Element.prototype = new _Node; extend(_Element, { getAttribute: function(attrName) /* String */ { return this.getAttributeNS(null, attrName, true); }, /** Namespace aware function to get an attribute from a node. @param ns The namespace. @param localName The local name of the attribute, without the prefix. Note, though, that Webkit and Firefox allow the prefix form to be passed in as well, which will cause a namespace lookup to happen. @param _forceNull Internal boolean flag used by our fake getAttribute() method. Needed to match the native browser behavior of returning attributes that don't exist; see the comment near the end of the function for details. */ getAttributeNS: function(ns, localName, _forceNull) /* String */ { //console.log('getAttributeNS, ns='+ns+', localName='+localName+', this.nodeName='+this.nodeName); var value; // ignore internal __guid property if (ns == null && localName == '__guid') { return null; } // Make sure we are attached and aren't in the middle of a // suspendRedraw operation. if (this._attached && this._passThrough && !this._handler._redrawManager.isSuspended()) { value = this._handler.sendToFlash('jsGetAttribute', [ this._guid, false, false, ns, localName, true ]); } else { if (!isIE) { value = this._nodeXML.getAttributeNS(ns, localName); } else if (isIE) { // IE has no getAttributeNS if (!ns) { value = this._nodeXML.getAttribute(localName); } else { // IE has funky namespace support; we possibly have no prefix at this // point so we will have to enumerate all attributes to find the one // we want for (var i = 0; i < this._nodeXML.attributes.length; i++) { var attr = this._nodeXML.attributes.item(i); // IE has no localName property; it munges the prefix:localName // together var attrName = new String(attr.name).match(/[^:]*:?(.*)/)[1]; if (attr.namespaceURI && attr.namespaceURI == ns && attrName == localName) { value = attr.nodeValue; break; } } } } } // id property is special; we return an empty string instead of null // to mimic native behavior on Firefox and Safari if (ns == 'null' && localName == 'id' && !value) { return ''; } // Firefox and Webkit both return null when getAttribute() is called // on unknown element, but return '' when getAttributeNS() is called // on empty element; match this behavior. We pass in a boolean // '_forceNull' flag when calling getAttributeNS from our own fake // getAttribute method. if (value === undefined || value === null || /^[ ]*$/.test(value)) { return (_forceNull) ? null : ''; } return value; }, removeAttribute: function(name) /* void */ { /* throws DOMException */ this.removeAttributeNS(null, name); }, removeAttributeNS: function(ns, localName) /* void */ { /* throws DOMException */ //console.log('removeAttributeNS, ns='+ns+', localName='+localName); // if id then change node lookup table (only if we are attached to // the DOM however) if (localName == 'id' && this._attached && this.namespaceURI == svgns) { var doc = this._handler.document; var elementId = this._nodeXML.getAttribute('id'); // old lookup doc._nodeById['_' + elementId] = undefined; } // we might not be able to get a prefix to namespace mapping if we are // disconnected; loop through our attributes until we find the matching // attribute node var attrNode; if (!ns) { attrNode = this._nodeXML.getAttributeNode(localName); } else { for (var i = 0; i < this._nodeXML.attributes.length; i++) { var current = this._nodeXML.attributes.item(i); // IE has no localName property; it munges the prefix:localName // together var m = new String(current.name).match(/([^:]+:)?(.*)/); var prefix, attrName; if (current.name.indexOf(':') != -1) { prefix = m[1]; attrName = m[2]; } else { attrName = m[1]; } if (current.namespaceURI && current.namespaceURI == ns && attrName == localName) { attrNode = current; break; } } } if (!attrNode) { console.log('No attribute node found for: ' + localName + ' in the namespace: ' + ns); return; } // remove from our XML this._nodeXML.removeAttributeNode(attrNode); // remove from our attributes list var qName = localName; if (ns) { qName = prefix + ':' + localName; } this._attributes['_' + qName] = undefined; // send to Flash if (this._attached && this._passThrough) { this._handler.sendToFlash('jsRemoveAttribute', [ this._guid, ns, localName ]); } }, setAttribute: function(attrName, attrValue /* String */) /* void */ { //console.log('setAttribute, attrName='+attrName+', attrValue='+attrValue); this.setAttributeNS(null, attrName, attrValue); }, setAttributeNS: function(ns, qName, attrValue /* String */) /* void */ { //console.log('setAttributeNS, ns='+ns+', qName='+qName+', attrValue='+attrValue+', this.nodeName='+this.nodeName); // Issue 428: // "setAttribute gives error for undefined or null attribute value // (Flash renderer)" // http://code.google.com/p/svgweb/issues/detail?id=428 if (attrValue === null || typeof attrValue == 'undefined') { attrValue = ''; } // parse out local name of attribute var localName = qName; if (qName.indexOf(':') != -1) { localName = qName.split(':')[1]; } // if id then change node lookup table (only if we are attached to // the DOM however) if (this._attached && qName == 'id') { var doc = this._handler.document; var elementId = this._nodeXML.getAttribute('id'); // old lookup doc._nodeById['_' + elementId] = undefined; if (elementId === 0 || elementId) { // new lookup doc._nodeById['_' + attrValue] = this; } } /* Safari has a wild bug; If you have an element inside of a clipPath with a style string: Then calling setAttribute('style', '') on our nodeXML causes the browser to crash! The workaround is to temporarily remove nodes that have a clipPath parent, set their style, then reattach them (!) */ if (isSafari && localName == 'style' && this._nodeXML.parentNode !== null && this._nodeXML.parentNode.nodeName == 'clipPath') { // save our XML position information for later re-inserting var addBeforeXML = this._nodeXML.nextSibling; var origParent = this._nodeXML.parentNode; // remove the node and set style; doing this prevents crash when // setting style string this._nodeXML.parentNode.removeChild(this._nodeXML); this._nodeXML.setAttribute('style', attrValue); // re-attach ourselves before our old sibling if (addBeforeXML) { origParent.insertBefore(this._nodeXML, addBeforeXML); } else { // node was at end originally origParent.appendChild(this._nodeXML); } } else { // we are an attrname other than style, or on a non-Safari browser // update our XML if (ns && isIE) { // MSXML has its own custom funky way of dealing with namespaces, // so we have to do it this way var attrNode = this._nodeXML.ownerDocument.createNode(2, qName, ns); attrNode.nodeValue = attrValue; this._nodeXML.setAttributeNode(attrNode); } else if (isIE) { this._nodeXML.setAttribute(qName, attrValue); } else { this._nodeXML.setAttributeNS(ns, qName, attrValue); } } // If this is a namespace attribute, add it to the global // list of SVG related namespaces so that we know whether // to create fake elements or native elements for that // namespace. See Issue 507. if (/^xmlns:?(.*)$/.test(qName)) { var m = qName.match(/^xmlns:?(.*)$/); var prefix = (m[1] ? m[1] : 'xmlns'); var namespaceURI = attrValue; // don't add duplicates if (!svgweb._allSVGNamespaces['_' + prefix]) { svgweb._allSVGNamespaces['_' + prefix] = namespaceURI; svgweb._allSVGNamespaces['_' + namespaceURI] = prefix; } } // update our internal set of attributes this._attributes['_' + qName] = attrValue; // send to Flash if (this._attached && this._passThrough) { var flashStr = FlashHandler._encodeFlashData(attrValue); this._handler.sendToFlash('jsSetAttribute', [ this._guid, false, ns, localName, flashStr ]); } }, hasAttribute: function(localName) /* Boolean */ { return this.hasAttributeNS(null, localName); }, hasAttributeNS: function(ns, localName) /* Boolean */ { //console.log('hasAttributeNS, ns='+ns+', localName='+localName); if (!ns && !isIE) { return this._nodeXML.hasAttribute(localName); } else { if (!isIE) { return this._nodeXML.hasAttributeNS(ns, localName); } else { // IE doesn't have hasAttribute or hasAttributeNS var attrNode = null; for (var i = 0; i < this._nodeXML.attributes.length; i++) { var current = this._nodeXML.attributes.item(i); // IE has no localName property; it munges the prefix:localName // together var m = new String(current.name).match(/(?:[^:]+:)?(.*)/); var attrName = m[1]; var currentNS = current.namespaceURI; if (currentNS == '') { // IE returns null namespace as '' currentNS = null; } if (ns == currentNS && attrName == localName) { attrNode = current; break; } } return (attrNode != null); } } }, getElementsByTagNameNS: function(ns, localName) /* _NodeList */ { //console.log('_Element.getElementsByTagNameNS, ns='+ns+', localName='+localName); var results = createNodeList(); var matches; // DOM Level 2 spec details: // if ns is null or '', return elements that have no namespace // if ns is '*', match all namespaces // if localName is '*', match all tags in the given namespace if (ns == '') { ns = null; } // we internally have to mess with the SVG namespace a bit to avoid // an issue with Firefox and Safari if (ns == svgns) { ns = svgnsFake; } // get DOM nodes with the given tag name if (this._nodeXML.getElementsByTagNameNS) { // non-IE browsers results = this._nodeXML.getElementsByTagNameNS(ns, localName); } else { // IE // we use XPath instead of xml.getElementsByTagName because some versions // of MSXML have namespace glitches with xml.getElementsByTagName // (Issue 183: http://code.google.com/p/svgweb/issues/detail?id=183) // and the namespace aware xml.getElementsByTagNameNS is not supported var namespaces = null; if (this._attached) { namespaces = this._handler.document._namespaces; } // figure out prefix var prefix = 'xmlns'; if (ns && ns != '*' && namespaces) { prefix = namespaces['_' + ns]; if (prefix === undefined) { return createNodeList(); // empty [] } } // determine correct xpath query; // MSXML incorrectly evaluates XPath expressions on the _whole_ XML DOM // document rather than restricting things to our context. In order to // provide support for contextual getElementsByTagNameNS we use the // following 'hack': we get all of our nodes, but then do a node test // along the ancestor axis to make sure we are rooted under the // node that has the GUID of our context var query; if (ns == '*' && localName == '*') { query = "//*[ancestor::*[@__guid = '" + this._guid + "']]"; } else if (ns == '*') { // NOTE: IE does not support wild carding just the namespace; see // http://svgweb.googlecode.com/svn/trunk/docs/UserManual.html#known_issues6 // for details query = "//*[namespace-uri()='*' and local-name()='" + localName + "'" + " and ancestor::*[@__guid = '" + this._guid + "']]"; } else if (localName == '*') { query = "//*[namespace-uri()='" + ns + "'" + " and ancestor::*[@__guid = '" + this._guid + "']]"; } else { // Wonderful IE bug: some versions of MSXML don't seem to 'see' // the default XML namespace with XPath, forcing you to pretend like // an element has no namespace: '//circle' // _Other_ versions of MSXML won't work like this, and _do_ see the // default namespace, forcing you to fully specify it: // //*[namespace-uri()='http://my-namespace' and local-name()='circle'] // To accomodate these we run both and use an XPath Union Operator // to combine the results. One is the MSXML default in Windows XP, // the other is an updated MSXML component installed by // Microsoft Office. query = "//" + localName + "[ancestor::*[@__guid = '" + this._guid + "']]" + "| //*[namespace-uri()='" + ns + "' and local-name()='" + localName + "'" + " and ancestor::*[@__guid = '" + this._guid + "']]"; } matches = xpath(this._nodeXML.ownerDocument, this._nodeXML, query, namespaces); if (matches !== null && matches !== undefined && matches.length > 0) { for (var i = 0; i < matches.length; i++) { // IE will incorrectly return the context node under some // conditions; filter that out if (matches[i] === this._nodeXML) { continue; } results.push(matches[i]); } } } // When doing wildcards on local name and namespace text nodes // can also sometimes be included; filter them out if ((ns == '*' || ns == svgnsFake) && localName == '*') { var temp = []; for (var i = 0; i < results.length; i++) { if (results[i].nodeType == _Node.ELEMENT_NODE && results[i].nodeName != '__text') { temp.push(results[i]); } } results = temp; } // now create or fetch _Elements representing these DOM nodes var nodes = createNodeList(); for (var i = 0; i < results.length; i++) { var elem = FlashHandler._getNode(results[i], this._handler); this._getFakeNode(elem)._attached = true; nodes.push(elem); } return nodes; }, beginElement: function() { this.beginElementAt(0); }, endElement: function() { this.endElementAt(0); }, beginElementAt: function(offset) { if (this._attached && this._passThrough) { this._handler.sendToFlash('jsBeginElementAt', [ this._guid, offset ]); } }, endElementAt: function(offset) { if (this._attached && this._passThrough) { this._handler.sendToFlash('jsEndElementAt', [ this._guid, offset ]); } }, /* Note: DOM Level 2 getAttributeNode, setAttributeNode, removeAttributeNode, getElementsByTagName, getAttributeNodeNS, setAttributeNodeNS not supported */ // SVGStylable interface style: null, /** Note: technically should be read only; _Style instance */ _setClassName: function(className) { // TODO: Implement }, // Note: we return a normal String instead of an SVGAnimatedString // as dictated by the SVG 1.1 standard _getClassName: function() { // TODO: Implement }, // Note: getPresentationAttribute not supported // SVGTransformable; takes an _SVGTransform _setTransform: function(transform) { // TODO: Implement }, // Note: we return a JS Array of _SVGTransforms instead of an // SVGAnimatedTransformList as dictated by the SVG 1.1 standard _getTransform: function() /* readonly; returns Array */ { // TODO: Implement }, // SVGFitToViewBox // Note: only supported for root SVG element for now _getViewBox: function() { /* readonly; SVGRect */ // Note: We return an _SVGRect instead of an SVGAnimatedRect as dictated // by the SVG 1.1 standard // TODO: Implement }, // SVGElement _getId: function() { // note: all attribute names are prefixed with _ to prevent attribute names // starting numbers from being interpreted as array indexes if (this._attributes['_id']) { return this._attributes['_id']; } else { // id property is special; we return empty string instead of null // to mimic native behavior on Firefox and Safari return ''; } }, _setId: function(id) { return this.setAttribute('id', id); }, ownerSVGElement: null, /* Note: technically readonly */ // not supported: xmlbase, viewportElement // SVGSVGElement and SVGUseElement readonly _getX: function() { /* SVGAnimatedLength */ var value = this._trimMeasurement(this.getAttribute('x')); return new _SVGAnimatedLength(new _SVGLength(new Number(value))); }, _getY: function() { /* SVGAnimatedLength */ var value = this._trimMeasurement(this.getAttribute('y')); return new _SVGAnimatedLength(new _SVGLength(new Number(value))); }, _getWidth: function() { /* SVGAnimatedLength */ var value = this._trimMeasurement(this.getAttribute('width')); return new _SVGAnimatedLength(new _SVGLength(new Number(value))); }, _getHeight: function() { /* SVGAnimatedLength */ var value = this._trimMeasurement(this.getAttribute('height')); return new _SVGAnimatedLength(new _SVGLength(new Number(value))); }, _getCurrentScale: function() { /* float */ return this._currentScale; }, _setCurrentScale: function(newScale /* float */) { if (newScale !== this._currentScale) { this._currentScale = newScale; this._handler.sendToFlash('jsSetCurrentScale', [ newScale ]); } return newScale; }, _getCurrentTranslate: function() { /* SVGPoint */ return this._currentTranslate; }, createSVGPoint: function() { return new _SVGPoint(0, 0); }, createSVGRect: function() { return new _SVGRect(0, 0, 0, 0); }, getBBox: function() { var msg = this._handler.sendToFlash('jsGetBBox', [ this._guid ]); msg = this._handler._stringToMsg(msg); return new _SVGRect(new Number(msg.x), new Number(msg.y), new Number(msg.width), new Number(msg.height)); }, /** Extracts the unit value and trims off the measurement type. For example, if you pass in 14px, this method will return 14. Null will return null. */ _trimMeasurement: function(value) { if (value !== null) { value = value.replace(/[a-z]/gi, ''); } return value; }, // many attributes and methods from these two interfaces not here // defacto non-standard attributes _getInnerHTML: function() { // TODO: Implement; NativeHandler will require this as well, since // innerHTML not natively supported there }, _setInnerHTML: function(newValue) { // TODO: Implement; NativeHandler will require this as well, since // innerHTML not natively supported there }, // SVG 1.1 inline event attributes: // http://www.w3.org/TR/SVG/script.html#EventAttributes // Note: Technically not all elements have all these events; also // technically the SVG spec requires us to support the DOM Mutation // Events, which we do not. // We use this array to build up our getters and setters . // TODO: Gauge the performance impact of making this dynamic _allEvents: [ 'onfocusin', 'onfocusout', 'onactivate', 'onclick', 'onmousedown', 'onmouseup', 'onmouseover', 'onmousemove', 'onmouseout', 'onload', 'onunload', 'onabort', 'onerror', 'onresize', 'onscroll', 'onzoom', 'onbegin', 'onend', 'onrepeat' ], _handleEvent: function(evt) { // called from the IE HTC when an event is fired, as well as from // one of our getter/setters for non-IE browsers }, _prepareEvents: function() { // for non-IE browsers, make the getter/setter magic using the // _allEvents array }, // SVGTests, SVGLangSpace, SVGExternalResourcesRequired // not supported // contains any attribute set with setAttribute; object literal of // name/value pairs _attributes: null, // copies the attributes from the XML DOM node into target _importAttributes: function(target, nodeXML) { for (var i = 0; i < nodeXML.attributes.length; i++) { var attr = nodeXML.attributes[i]; this._attributes['_' + attr.nodeName] = attr.nodeValue; } }, /** Does all the getter/setter magic for attributes, so that external callers can do something like myElement.innerHTML = 'foobar' or myElement.id = 'test' and our getters and setters will intercept these to do the correct behavior with the Flash viewer.*/ _defineAccessors: function() { var props; var self = this; // innerHTML /* // TODO: Not implemented yet this.__defineGetter__('innerHTML', function() { return self._getInnerHTML(); }); this.__defineSetter__('innerHTML', function(newValue) { return self._setInnerHTML(newValue); }); */ // SVGSVGElement and SVGUseElement readyonly props if (this.nodeName == 'svg' || this.nodeName == 'use') { this.__defineGetter__('x', function() { return self._getX(); }); this.__defineGetter__('y', function() { return self._getY(); }); this.__defineGetter__('width', function() { return self._getWidth(); }); this.__defineGetter__('height', function() { return self._getHeight(); }); } if (this.nodeName == 'svg') { // TODO: Ensure that currentTranslate and currentScale only show up // on root SVG node and not nested SVG nodes this.__defineGetter__('currentTranslate', function() { return self._getCurrentTranslate(); }); this.__defineGetter__('currentScale', function() { return self._getCurrentScale(); }); this.__defineSetter__('currentScale', function(newScale) { return self._setCurrentScale(newScale); }); } // id property this.__defineGetter__('id', hitch(this, this._getId)); this.__defineSetter__('id', hitch(this, this._setId)); }, /** @param prop String property name, such as 'x'. @param readWrite Boolean on whether the property is both read and write; if false then read only. */ _defineAccessor: function(prop, readWrite) { var self = this; var getMethod = function() { return self.getAttribute(prop); }; this.__defineGetter__(prop, getMethod); if (readWrite) { var setMethod = function(newValue) { return self.setAttribute(prop, newValue); }; this.__defineSetter__(prop, setMethod); } } }); /** The DOM DocumentFragment API. @param doc The document that produced this _DocumentFragment. Either the global, browser native 'document' or a fake _Document if this was created in the context of an SVG OBJECT. */ function _DocumentFragment(doc) { // superclass constructor _Node.apply(this, ['#document-fragment', _Node.DOCUMENT_FRAGMENT_NODE, null, null, null, null]); this.ownerDocument = doc; } // subclasses _Node _DocumentFragment.prototype = new _Node; extend(_DocumentFragment, { /** 'Resets' a _DocumentFragment so it can be reused. Basically removes all of it's children. */ _reset: function() { // delete all the XML children; using a while() loop works better than // for() since the # of childNodes will change out from under us as we // remove children. while (this._nodeXML.firstChild) { this._nodeXML.removeChild(this._nodeXML.firstChild); } this._childNodes = this._createChildNodes(); if (!isIE) { this._defineNodeAccessors(); } // NOTE: we never remove the DocumentFragment from the svgweb._guidLookup // table or the HTC node for this DocumentFragment; this is because we // must make it possible to reuse the DocumentFragment. This could cause // a memory leak issue over time however. } }); /** Not an official DOM interface; used so that we can track changes to the CSS style property of an Element @param element The _Element that this Style is attached to. */ function _Style(element) { this._element = element; this._setup(); } // we use this array to build up getters and setters to watch any changes for // any of these styles. Note: Technically we shouldn't have all of these for // every element, since some SVG elements won't have specific kinds of // style properties, like the DESC element having a font-size. _Style._allStyles = [ 'font', 'fontFamily', 'fontSize', 'fontSizeAdjust', 'fontStretch', 'fontStyle', 'fontVariant', 'fontWeight', 'direction', 'letterSpacing', 'textDecoration', 'unicodeBidi', 'wordSpacing', 'clip', 'color', 'cursor', 'display', 'overflow', 'visibility', 'clipPath', 'clipRule', 'mask', 'opacity', 'enableBackground', 'filter', 'floodColor', 'floodOpacity', 'lightingColor', 'stopColor', 'stopOpacity', 'pointerEvents', 'colorInterpolation', 'colorInterpolationFilters', 'colorProfile', 'colorRendering', 'fill', 'fillOpacity', 'fillRule', 'imageRendering', 'marker', 'markerEnd', 'markerMid', 'markerStart', 'shapeRendering', 'stroke', 'strokeDasharray', 'strokeDashoffset', 'strokeLinecap', 'strokeLinejoin', 'strokeMiterlimit', 'strokeOpacity', 'strokeWidth', 'textRendering', 'alignmentBaseline', 'baselineShift', 'dominantBaseline', 'glyphOrientationHorizontal', 'glyphOrientationVertical', 'kerning', 'textAnchor', 'writingMode' ]; // the root SVGSVGElement has a few extra styles possible since it is nested // into an HTML context _Style._allRootStyles = [ 'border', 'verticalAlign', 'backgroundColor', 'top', 'right', 'bottom', 'left', 'position', 'width', 'height', 'margin', 'marginTop', 'marginBottom', 'marginRight', 'marginLeft', 'padding', 'paddingTop', 'paddingBottom', 'paddingLeft', 'paddingRight', 'borderTopWidth', 'borderRightWidth', 'borderBottomWidth', 'borderLeftWidth', 'borderTopColor', 'borderRightColor', 'borderBottomColor', 'borderLeftColor', 'borderTopStyle', 'borderRightStyle', 'borderBottomStyle', 'borderLeftStyle', 'zIndex', 'overflowX', 'overflowY', 'float', 'clear' ]; extend(_Style, { /** Flag that indicates that the HTC should ignore any property changes due to style changes. Used when we are internally making style changes. */ _ignoreStyleChanges: true, /** Initializes our magic getters and setters for non-IE browsers. For IE we set our initial style values on the HTC. */ _setup: function() { // Handle an edge-condition: the SVG spec requires us to support // style="" strings that might have uppercase style names, measurements, // etc. Normalize these here before continuing. this._normalizeStyle(); // now handle browser-specific initialization if (!isIE) { // setup getter/setter magic for non-IE browsers for (var i = 0; i < _Style._allStyles.length; i++) { var styleName = _Style._allStyles[i]; this._defineAccessor(styleName); } // root SVGSVGElement nodes have some extra properties from being in an // HTML context // If _handler is not set, this element is a nested svg element. if (this._element._handler && this._element._getProxyNode() == this._element._handler.document.rootElement) { for (var i = 0; i < _Style._allRootStyles.length; i++) { var styleName = _Style._allRootStyles[i]; this._defineAccessor(styleName); } } // CSSStyleDeclaration properties this.__defineGetter__('length', hitch(this, this._getLength)); } else { // Internet Explorer setup var htcStyle = this._element._htcNode.style; // parse style string var parsedStyle = this._fromStyleString(); // loop through each one, setting it on our HTC's style object for (var i = 0; i < parsedStyle.length; i++) { var styleName = this._toCamelCase(parsedStyle[i].styleName); var styleValue = parsedStyle[i].styleValue; // Issue 485: Cannot set textAlign style on IE try { htcStyle[styleName] = styleValue; } catch (exp) { console.log('The following exception occurred setting style.' + styleName + ' on IE: ' + (exp.message || exp)); } } // set initial values for style.length htcStyle.length = 0; // expose .length property on our custom _Style object to aid it // being used internally this.length = 0; // set CSSStyleDeclaration methods to our implementation htcStyle.item = hitch(this, this.item); htcStyle.setProperty = hitch(this, this.setProperty); htcStyle.getPropertyValue = hitch(this, this.getPropertyValue); // start paying attention to style change events on the HTC node this._changeListener = hitch(this, this._onPropertyChange); this._element._htcNode.attachEvent('onpropertychange', this._changeListener); } }, /** Defines the getter and setter for a single style, such as 'display'. */ _defineAccessor: function(styleName) { var self = this; this.__defineGetter__(styleName, function() { return self._getStyleAttribute(styleName); }); this.__defineSetter__(styleName, function(styleValue) { return self._setStyleAttribute(styleName, styleValue); }); }, _setStyleAttribute: function(styleName, styleValue) { //console.log('setStyleAttribute, styleName='+styleName+', styleValue='+styleValue); // Note: .style values and XML attributes have separate values. The XML // attributes always have precedence over any style values. // convert camel casing (i.e. strokeWidth becomes stroke-width) var stylePropName = this._fromCamelCase(styleName); // change our XML style string value // parse style string first var parsedStyle = this._fromStyleString(); // is our style name there? var foundStyle = false; for (var i = 0; i < parsedStyle.length; i++) { if (parsedStyle[i].styleName === stylePropName) { parsedStyle[i].styleValue = styleValue; foundStyle = true; break; } } // if we didn't find it above add it if (!foundStyle) { parsedStyle.push({ styleName: stylePropName, styleValue: styleValue }); } // now turn the style back into a string and set it on our XML and // internal list of attribute values var styleString = this._toStyleString(parsedStyle); this._element._nodeXML.setAttribute('style', styleString); this._element._attributes['_style'] = styleString; // for IE, update our HTC style object; we can't do magic getters for // those so have to update and cache the values if (isIE) { var htcStyle = this._element._htcNode.style; // never seen before; bump our style length if (!foundStyle) { htcStyle.length++; this.length++; } // update style value on HTC node so that when the value is fetched // it is correct; ignoreStyleChanges during this or we will get into // an infinite loop this._ignoreStyleChanges = true; htcStyle[styleName] = styleValue; this._ignoreStyleChanges = false; } // tell Flash about the change if (this._element._attached && this._element._passThrough) { var flashStr = FlashHandler._encodeFlashData(styleValue); this._element._handler.sendToFlash('jsSetAttribute', [ this._element._guid, true, null, stylePropName, flashStr ]); } }, _getStyleAttribute: function(styleName) { //console.log('getStyleAttribute, styleName='+styleName); // convert camel casing (i.e. strokeWidth becomes stroke-width) var stylePropName = this._fromCamelCase(styleName); if (this._element._attached && this._element._passThrough && !this._element._handler._redrawManager.isSuspended()) { var value = this._element._handler.sendToFlash('jsGetAttribute', [ this._element._guid, true, false, null, stylePropName, false ]); return value; } else { // not attached yet; have to parse it from our local value var parsedStyle = this._fromStyleString(); for (var i = 0; i < parsedStyle.length; i++) { if (parsedStyle[i].styleName === stylePropName) { return parsedStyle[i].styleValue; } } return null; } }, /** Parses our style string into an array, where each array entry is an object literal with the 'styleName' and 'styleValue', such as: results[0].styleName results[0].styleValue etc. If there are no results an empty array is returned. */ _fromStyleString: function() { var styleValue = this._element._nodeXML.getAttribute('style'); if (styleValue === null || styleValue === undefined) { return []; } var baseStyles; if (styleValue.indexOf(';') == -1) { // only one style value given, with no trailing semicolon baseStyles = [ styleValue ]; } else { baseStyles = styleValue.split(/\s*;\s*/); // last style is empty due to split() if (!baseStyles[baseStyles.length - 1]) { baseStyles = baseStyles.slice(0, baseStyles.length - 1); } } var results = []; for (var i = 0; i < baseStyles.length; i++) { var style = baseStyles[i]; var styleSet = style.split(':'); if (styleSet.length == 2) { var attrName = styleSet[0]; var attrValue = styleSet[1]; // trim leading whitespace attrName = attrName.replace(/^\s+/, ''); attrValue = attrValue.replace(/^\s+/, ''); var entry = { styleName: attrName, styleValue: attrValue }; results.push(entry); } } return results; }, /** Turns a parsed style into a string. @param parsedStyle An array where each entry is an object literal with two values, 'styleName' and 'styleValue'. Uses same data structure returned from fromStyleString() method above. */ _toStyleString: function(parsedStyle) { var results = ''; for (var i = 0; i < parsedStyle.length; i++) { results += parsedStyle[i].styleName + ': '; results += parsedStyle[i].styleValue + ';'; if (i != (parsedStyle.length - 1)) { results += ' '; } } return results; }, /** Transforms a camel case style name, such as strokeWidth, into it's dash equivalent, such as stroke-width. */ _fromCamelCase: function(styleName) { return styleName.replace(/([A-Z])/g, '-$1').toLowerCase(); }, /** Transforms a dash style name, such as stroke-width, into it's camel case equivalent, such as strokeWidth. */ _toCamelCase: function(stylePropName) { if (stylePropName.indexOf('-') == -1) { return stylePropName; } var results = ''; var sections = stylePropName.split('-'); results += sections[0]; for (var i = 1; i < sections.length; i++) { results += sections[i].charAt(0).toUpperCase() + sections[i].substring(1); } return results; }, // CSSStyleDeclaration interface methods and properties // TODO: removeProperty not supported yet setProperty: function(stylePropName, styleValue, priority) { // TODO: priority not supported for now; not sure if it even makes // sense in this context // convert from dash style to camel casing (i.e. stroke-width becomes // strokeWidth var styleName = this._toCamelCase(stylePropName); this._setStyleAttribute(styleName, styleValue); return styleValue; }, getPropertyValue: function(stylePropName) { // convert from dash style to camel casing (i.e. stroke-width becomes // strokeWidth var styleName = this._toCamelCase(stylePropName); return this._getStyleAttribute(styleName); }, item: function(index) { // parse style string var parsedStyle = this._fromStyleString(); // TODO: Throw exception if index is greater than length of style rules return parsedStyle[index].styleName; }, // NOTE: We don't support cssText for now. The reason why is that // IE has a style.cssText property already on our HTC nodes. This // property incorrectly includes some of our custom internal code, // such as 'length' as well as both versions of certain camel cased // properties (like stroke-width and strokeWidth). There is no way // currently known to work around this. The property is not that important // anyway so it won't currently be supported. _getLength: function() { // parse style string var parsedStyle = this._fromStyleString(); return parsedStyle.length; }, /** Handles an edge-condition: the SVG spec requires us to support style="" strings that might have uppercase style names, measurements, etc. We normalize these to lower-case in this method. */ _normalizeStyle: function() { // style="" attribute? // NOTE: IE doesn't support nodeXML.hasAttribute() if (!this._element._nodeXML.getAttribute('style')) { return; } // no uppercase letters? if (!/[A-Z]/.test(this._element._nodeXML.getAttribute('style'))) { return; } // parse style into it's components var parsedStyle = this._fromStyleString(); for (var i = 0; i < parsedStyle.length; i++) { parsedStyle[i].styleName = parsedStyle[i].styleName.toLowerCase(); // don't lowercase url() values if (parsedStyle[i].styleValue.indexOf('url(') == -1) { parsedStyle[i].styleValue = parsedStyle[i].styleValue.toLowerCase(); } } // turn back into a string var results = ''; for (var i = 0; i < parsedStyle.length; i++) { results += parsedStyle[i].styleName + ': ' + parsedStyle[i].styleValue + '; '; } // remove trailing space if (results.charAt(results.length - 1) == ' ') { results = results.substring(0, results.length - 1); } // change our style value; however, don't pass this through to Flash // because Flash might not even know about our existence yet, because we // are still being run from the _Element constructor this._element._passThrough = false; this._element.setAttribute('style', results); this._element._passThrough = true; }, /** For Internet Explorer, this method is called whenever a propertychange event fires on the HTC. */ _onPropertyChange: function() { // watch to see when anyone changes a 'style' property so we // can mirror it in the Flash control if (this._ignoreStyleChanges) { return; } var prop = window.event.propertyName; if (prop && /^style\./.test(prop) && prop != 'style.length') { // extract the style name and value var styleName = prop.match(/^style\.(.*)$/)[1]; var styleValue = this._element._htcNode.style[styleName]; // tell Flash and our fake node about our style change this._setStyleAttribute(styleName, styleValue); } } }); /** An OBJECT tag that is embedding an SVG element. This class encapsulates how we actually do the work of embedding this into the page (such as internally transforming the SVG OBJECT into a Flash one). @param svgNode The SVG OBJECT node to work with. @param handler The FlashHandler that owns us. */ function _SVGObject(svgNode, handler) { this._handler = handler; this._svgNode = svgNode; this._scriptsToExec = []; // flags to know when the SWF file (and on IE the HTC file) are done loading this._htcLoaded = false; this._swfLoaded = false; // handle any onload event listeners that might be present for // dynamically created OBJECT tags; this._svgNode._listeners is an array // we expose through our custom document.createElement('object', true) -- // the 'true' actually flags us to do things like this for (var i = 0; this._svgNode._onloadListeners && i < this._svgNode._onloadListeners.length; i++) { // wrap each of the listeners so that its 'this' object // correctly refers to the Flash OBJECT if used inside the listener // function; we use an outer function to prevent closure from // incorrectly happening, and then return an inner function inside // of this that correctly makes the 'this' object be our Flash // OBJECT rather than the global window object var wrappedListener = (function(handler, listener) { return function() { //console.log('_SVGObject, wrappedListener, handler='+handler+', listener='+listener); listener.apply(handler.flash); }; })(this._handler, this._svgNode._onloadListeners[i]); // pass values into function svgweb.addOnLoad(wrappedListener); } // start fetching the HTC file in the background if (isIE) { this._loadHTC(); } // fetch the SVG URL now and start processing. // Note: unfortunately we must use the 'src' attribute instead of the // standard 'data' attribute for IE. On certain installations of IE // with some security patches IE will display a gold security bar indicating // that some URLs were blocked; on others IE will attempt to download the // file pointed to by the 'data' attribute. Note that using the 'src' // attribute is a divergence from the standard, but it solves both issues. this.url = this._svgNode.getAttribute('src'); if (!this.url) { this.url = this._svgNode.getAttribute('data'); } // success function var successFunc = hitch(this, function(svgStr) { // clean up and parse our SVG this._handler._origSVG = svgStr; var results = svgweb._cleanSVG(svgStr, true, false); this._svgString = results.svg; this._xml = results.xml; // create our document objects this.document = new _Document(this._xml, this._handler); this._handler.document = this.document; // insert our Flash and replace the SVG OBJECT tag var nodeXML = this._xml.documentElement; // save any custom PARAM tags that might be nested inside our SVG OBJECT this._savedParams = this._getPARAMs(this._svgNode); // now insert the Flash this._handler._inserter = new FlashInserter('object', this._xml.documentElement, this._svgNode, this._handler); // wait for Flash to finish loading; see _onFlashLoaded() in this class // for further execution after the Flash asynchronous process is done }); if (this.url.substring(0, 5) == 'data:') { successFunc(this.url.substring(this.url.indexOf(',')+1)); } else { this._fetchURL(this.url, successFunc, hitch(this, this._fallback)); } } extend(_SVGObject, { /** An array of strings, where each string is an SVG SCRIPT tag embedded in an external SVG file. This is when SVG is embedded with an OBJECT. */ _scriptsToExec: null, /** * UTF-8 data encode / decode * http://www.webtoolkit.info/ **/ _utf8encode : function (string) { string = string.replace(/\r\n/g,"\n"); var utftext = ""; for (var n = 0; n < string.length; n++) { var c = string.charCodeAt(n); if (c < 128) { utftext += String.fromCharCode(c); } else if ((c > 127) && (c < 2048)) { utftext += escape(String.fromCharCode((c >> 6) | 192)); utftext += escape(String.fromCharCode((c & 63) | 128)); } else { utftext += escape(String.fromCharCode((c >> 12) | 224)); utftext += escape(String.fromCharCode(((c >> 6) & 63) | 128)); utftext += escape(String.fromCharCode((c & 63) | 128)); } } return utftext; }, _fetchURL: function(url, onSuccess, onFailure) { var req = xhrObj(); // bust the cache for IE since IE's XHR GET requests are wonky if (isIE) { url = this._utf8encode(url); url += (url.indexOf('?') == -1) ? '?' : '&'; url += new Date().getTime(); } req.onreadystatechange = function() { if (req.readyState == 4) { if (req.status == 200) { // done onSuccess(req.responseText); } else { // error onFailure(req.status + ': ' + req.statusText); } req = null; } }; req.open('GET', url, true); req.send(null); }, _fallback: function(error) { console.log('onError (fallback), error='+error); // TODO: Implement }, _loadHTC: function() { // if IE, force the HTC file to asynchronously load with a dummy element; // we want to do the async operation now so that external API users don't // get hit with the async nature of the HTC file first loading when they // make a sync call; we will send the SVG over to the Flash _after_ the // HTC file is done loading. this._dummyNode = document.createElement('svg:__force__load'); this._dummyNode._handler = this._handler; // find out when the content is ready // NOTE: we do this here instead of inside the HTC file using an // internal oncontentready event in order to make the HTC file faster // and use less memory. Note also that 'oncontentready' is not available // outside HTC files, only 'onreadystatechange' is available. this._readyStateListener = hitch(this, this._onHTCLoaded); // cleanup later this._dummyNode.attachEvent('onreadystatechange', this._readyStateListener); var head = document.getElementsByTagName('head')[0]; // NOTE: as _soon_ as we append the dummy element the HTC file will // get called, branching control, so code after this call will not // get run in the sequence expected head.appendChild(this._dummyNode); // wait for HTC to load }, _onFlashLoaded: function(msg) { //console.log('_SVGObject, onFlashLoaded, msg='+this._handler.debugMsg(msg)); // store a reference to our Flash object this._handler.flash = document.getElementById(this._handler.flashID); // copy any custom developer PARAM tags on the original SVG OBJECT // over to the Flash element so that SVG scripts can programmatically // access them; we saved these earlier in the _SVGObject constructor if (this._savedParams.length) { for (var i = 0; i < this._savedParams.length; i++) { var param = this._savedParams[i]; this._handler.flash.appendChild(param); param = null; } this._savedParams = null; } // expose top and parent attributes on Flash OBJECT this._handler.flash.top = this._handler.flash.parent = window; // flag that the SWF is loaded; if not IE, send everything over to Flash; // if IE, make sure the HTC file is done loading this._swfLoaded = true; if (!isIE || this._htcLoaded) { this._onEverythingLoaded(); } }, _onHTCLoaded: function() { //console.log('_SVGObject, onHTCLoaded'); // We added a 'dummy' HTC node to the page when we first instantiated our // _SVGObject; this was so that the HTC part of the architecture is primed // and loaded and ready to go, so later on when someone does a // synchronous createElement() to create an SVG node the HTC behavior is // already loaded and ready to do it's magic. Now that the HTC file is // loaded we want to remove the dummy element created earlier. // can't use htcNode.parentNode to get the parent and remove the child // since we override that inside svg.htc var head = document.getElementsByTagName('head')[0]; head.removeChild(this._dummyNode); // cleanup our event handler this._dummyNode.detachEvent('onreadystatechange', this._readyStateListener); // prevent IE memory leaks this._dummyNode = null; head = null; // flag that we are loaded; send things over to Flash if the SWF is loaded this._htcLoaded = true; if (this._swfLoaded) { this._onEverythingLoaded(); } }, _onEverythingLoaded: function() { //console.log('_SVGObject, onEverythingLoaded'); var size = this._handler._inserter._determineSize(); this._handler.sendToFlash('jsHandleLoad', [ /* objectURL */ this._getRelativeTo('object'), /* pageURL */ this._getRelativeTo('page'), /* objectWidth */ size.pixelsWidth, /* objectHeight */ size.pixelsHeight, /* ignoreWhiteSpace */ false, /* svgString */ this._svgString ]); }, _onRenderingFinished: function(msg) { //console.log('_SVGObject, onRenderingFinished, id='+this._handler.id // + ', msg='+this._handler.debugMsg(msg)); // we made the SVG hidden before to avoid scrollbars on IE; make visible // now this._handler.flash.style.visibility = 'visible'; // create the documentElement and rootElement and set them to our SVG // root element var rootXML = this._xml.documentElement; var rootID = rootXML.getAttribute('id'); var root = new _SVGSVGElement(rootXML, null, null, this._handler); var doc = this._handler.document; doc.documentElement = root._getProxyNode(); doc.rootElement = root._getProxyNode(); // add to our lookup tables so that fetching this node in the future works doc._nodeById['_' + rootID] = root; // add our contentDocument property // TODO: This should be doc._getProxyNode(), but Issue 227 needs to be // addressed first: // http://code.google.com/p/svgweb/issues/detail?id=227 if (isIE) { // this workaround will prevent Issue 140: // "SVG OBJECT.contentDocument does not work when DOCTYPE specified // inside of HTML file itself" // http://code.google.com/p/svgweb/issues/detail?id=140 this._handler.flash.setAttribute('contentDocument', null); } this._handler.flash.contentDocument = doc; // FIXME: NOTE: unfortunately we can't support the getSVGDocument() method; // Firefox throws an error when we try to override it: // 'Trying to add unsupported property on scriptable plugin object!' // this._handler.flash.getSVGDocument = function() { // return this.contentDocument; // }; // create a pseudo window element this._handler.window = new _SVGWindow(this._handler); // our fake document object should point to our fake window object doc.defaultView = this._handler.window; FlashHandler._patchFakeObjects(doc.defaultView, doc); // add our onload handler to the list of scripts to execute at the // beginning var onload = rootXML.getAttribute('onload'); if (onload) { // we want 'this' inside of the onload handler to point to our // SVG root; the 'document.documentElement' will get rewritten later by // the _executeScript() method to point to our fake SVG root instead var defineEvtCode = 'var evt = { target: document.getElementById("' + root.getAttribute('id') + '") ,' + 'currentTarget: document.getElementById("' + root.getAttribute('id') + '") ,' + 'preventDefault: function() { this.returnValue=false; }' + '};'; onload = ';(function(){' + defineEvtCode + onload + '}).apply(document.documentElement);'; this._scriptsToExec.push(onload); } // now execute any scripts embedded into the SVG file; we turn all // the scripts into one giant block and run them together so that // global functions can 'see' and call each other var finalScript = ''; for (var i = 0; i < this._scriptsToExec.length; i++) { finalScript += this._scriptsToExec[i] + '\n'; } this._executeScript(finalScript); // indicate that we are done this._handler._loaded = true; this._handler.fireOnLoad(this._handler.id, 'object'); }, /** Relative URLs inside of SVG need to expand against something (i.e. such as having an SVG Audio tag with a relative URL). This method figures out what that relative URL should be. We send this over to Flash when rendering things so Flash knows what to expand against. @param toWhat - String that controls what we use for the relative URL. If "object" given, we use the URL to the SVG OBJECT; if "page" given, we determine things relative to the page itself. */ _getRelativeTo: function(toWhat) { var results = ''; if (toWhat == 'object') { // strip off scheme and hostname, then match just path portion var pathname = this.url.replace(/[^:]*:\/\/[^\/]*/).match(/\/?[^\?\#]*/)[0]; if (pathname && pathname.length > 0 && pathname.indexOf('/') != -1) { // snip off any filename after a final slash results = pathname.replace(/\/([^\/]*)$/, '/'); } } else { var pathname = window.location.pathname.toString(); if (pathname && pathname.length > 0 && pathname.indexOf('/') != -1) { // snip off any filename after a final slash results = pathname.replace(/\/([^\/]*)$/, '/'); } } return results; }, /** Executes a SCRIPT block inside of an SVG file. We essentially rewrite the references in this script to point to our Flash Handler instead, create an invisible iframe that will act as the 'global' object, and then write the script into the iframe as a new SCRIPT block. @param script String with script to execute. */ _executeScript: function(script) { // Create an iframe that we will use to 'silo' and execute our // code, which will act as a place for globals to be defined without // clobbering globals on the HTML document's window or from other // embedded SVG files. This is necessary so that setTimeouts and // setIntervals will work later on, for example. // create an iframe and attach it offscreen var iframe = document.createElement('iframe'); iframe.setAttribute('src', 'about:blank'); iframe.style.position = 'absolute'; iframe.style.top = '-1000px'; iframe.style.left = '-1000px'; var body = document.getElementsByTagName('body')[0]; body.appendChild(iframe); // get the iframes document object; IE differs on how to get this var iframeDoc = (iframe.contentDocument) ? iframe.contentDocument : iframe.contentWindow.document; // set the document.defaultView to the iframe's real Window object; // note that IE doesn't support defaultView var iframeWin = iframe.contentWindow; this._handler.document.defaultView = iframeWin; // Create a script with the proper environment. script = this._sandboxedScript(script); // Add code to set back an eval function we can use for further execution. // Code adapted from blog post by YuppY: // http://dean.edwards.name/weblog/2006/11/sandbox/ script = script + ';if (__svgHandler) __svgHandler.sandbox_eval = ' + (isIE ? 'window.eval;' : 'function(scriptCode) { return window.eval(scriptCode) };'); if (isOpera) { var _win = this; // Opera 10.53 just kills this event thread (see test_js2.html), // so we switch to a new execution context to buy more time on a // more appropriate thread. var timeoutFunc = setTimeout((function(_handlerwin, iframeWin, script) { return function() { // Opera 10.53 hangs on creating the script tag (see // test_js2.html), so try running the code this way. iframeWin.eval.apply(iframeWin, [script]); _handlerwin._fireOnload(); }; })(this._handler.window, iframeWin, script), 1); } else { // now insert the script into the iframe to execute it in a siloed way iframeDoc.write(''); iframeDoc.close(); // execute any addEventListener(onloads) that might have been // registered this._handler.window._fireOnload(); } }, _sandboxedScript: function(script) { // expose the handler as a global object at the top of the script; // expose the svgns and xlinkns variables; and override the setTimeout // and setInterval functions for the iframe where we will execute things // so we can clear out all timing functions if the SVG OBJECT is later // removed with a call to svgweb.removeChild var addToTop = 'var __svgHandler = top.svgweb.handlers["' + this._handler.id + '"];\n' + 'window.svgns = "' + svgns + '";\n' + 'window.xlinkns = "' + xlinkns + '";\n'; var timeoutOverride = 'window._timeoutIDs = [];\n' + 'window._setTimeout = window.setTimeout;\n' + 'window.setTimeout = \n' + ' (function() {\n' + ' return function(f, ms) {\n' + ' var timeID = window._setTimeout(f, ms);\n' + ' window._timeoutIDs.push(timeID);\n' + ' return timeID;\n' + ' };\n' + ' })();\n'; var intervalOverride = 'window._intervalIDs = [];\n' + 'window._setInterval = window.setInterval;\n' + 'window.setInterval = \n' + ' (function() {\n' + ' return function(f, ms) {\n' + ' var timeID = window._setInterval(f, ms);\n' + ' window._intervalIDs.push(timeID);\n' + ' return timeID;\n' + ' };\n' + ' })();\n'; script = addToTop + timeoutOverride + intervalOverride + '\n\n' + script; // change any calls to top.document or top.window, to a temporary different // string to avoid collisions when we transform next script = script.replace(/top\.document/g, 'top.DOCUMENT'); script = script.replace(/top\.window/g, 'top.WINDOW'); // intercept any calls to 'document.' or 'window.' inside of a string; // transform to this to a different temporary token so we can handle // it differently (i.e. we will put backslashes around certain portions: // top.svgweb.handlers[\"svg2\"].document for example) // change any calls to the document object to point to our Flash Handler // instead; avoid variable names that have the word document in them, // and pick up document* used with different endings script = script.replace(/(^|[^A-Za-z0-9_])document(\.|'|"|\,| |\))/g, '$1__svgHandler.document$2'); // change some calls to the window object to point to our fake window // object instead script = script.replace(/window\.(location|addEventListener|onload|frameElement)/g, '__svgHandler.window.$1'); // change back any of our top.document or top.window calls to be // their original lower case (we uppercased them earlier so that we // wouldn't incorrectly transform them) script = script.replace(/top\.DOCUMENT/g, 'top.document'); script = script.replace(/top\.WINDOW/g, 'top.window'); return script; }, /** Developers can nest custom PARAM tags inside our SVG OBJECT in order to pass parameters into their SVG file. This function gets these, and makes a clone of them suitable for us to re-attach and use in the future. @param svgNode The SVG OBJECT DOM node. @returns An array of cloned PARAM objects. If none, then the array has zero length. */ _getPARAMs: function(svgNode) { var params = []; for (var i = 0; i < svgNode.childNodes.length; i++) { var child = svgNode.childNodes[i]; if (child.nodeName.toUpperCase() == 'PARAM') { params.push(child.cloneNode(false)); } } return params; } }); /** A fake window object that we provide for SVG files to use internally. @param handler The Flash Handler assigned to this fake window object. */ function _SVGWindow(handler) { this._handler = handler; this.fake = true; // helps to detect fake abstraction this.frameElement = this._handler.flash; this.location = this._createLocation(); this.alert = window.alert; this.top = this.parent = window; this._onloadListeners = []; } extend(_SVGWindow, { addEventListener: function(type, listener, capture) { if (type.toLowerCase() == 'svgload' || type.toLowerCase() == 'load') { this._onloadListeners.push(listener); } }, _fireOnload: function() { //console.log('_SVGWindow._fireOnLoad'); for (var i = 0; i < this._onloadListeners.length; i++) { try { this._onloadListeners[i](); } catch (exp) { console.log('The following exception occurred from an SVG onload ' + 'listener: ' + (exp.message || exp)); } } // if there is an inline window.onload execute that now if (this.onload) { try { this.onload(); } catch (exp) { console.log('The following exception occurred from an SVG onload ' + 'listener: ' + (exp.message || exp)); } } }, /** Creates a fake window.location object. @param fakeLocation A full window.location object (i.e. it has .port, .hash, etc.) used for testing purposes to give a fake value to the containing HTML page's window.location value. */ _createLocation: function(fakeLocation) { var loc = {}; var url = this._handler._svgObject.url; var windowLocation; if (fakeLocation) { windowLocation = fakeLocation; } else { windowLocation = window.location; } // Bypass parsing data: URLs. if (/^data:/.test(url)) { loc.href = url; loc.toString = function() { return this.href; }; return loc; } // expand URL // first, see if this url is fully expanded already if (/^http/.test(url)) { // nothing to do } else if (url.charAt(0) == '/') { // ex: /embed1.svg url = windowLocation.protocol + '//' + windowLocation.host + url; } else { // fully relative, such as embed1.svg // get the pathname of the page we are on, clearing out everything after // the last slash if (windowLocation.pathname.indexOf('/') == -1) { url = windowLocation.protocol + '//' + windowLocation.host + '/' + url; } else { var relativeTo = windowLocation.pathname; // walk the string in reverse removing characters until we hit a slash for (var i = relativeTo.length - 1; i >= 0; i--) { if (relativeTo.charAt(i) == '/') { break; } relativeTo = relativeTo.substring(0, i); } url = windowLocation.protocol + '//' + windowLocation.host + relativeTo + url; } } // parse URL // FIXME: NOTE: href, search, and pathname should be URL-encoded; the others // should be URL-decoded // match 1 - protocol // match 2 - hostname // match 3 - port // match 4 - pathname // match 5 - search // match 6 - hash var results = url.match(/^(https?:)\/\/([^\/:]*):?([0-9]*)([^\?#]*)([^#]*)(#.*)?$/); loc.protocol = (results[1]) ? results[1] : windowLocation.href; if (loc.protocol.charAt(loc.protocol.length - 1) != ':') { loc.protocol += ':'; } loc.hostname = results[2]; // NOTE: browsers natively drop the port if its not explicitly specified loc.port = ''; if (results[3]) { loc.port = results[3]; } // is the URL and the containing page at different domains? var sameDomain = true; if (loc.protocol != windowLocation.protocol || loc.hostname != windowLocation.hostname || (loc.port && loc.port != windowLocation.port)) { sameDomain = false; } if (sameDomain && !loc.port) { loc.port = windowLocation.port; } if (loc.port) { loc.host = loc.hostname + ':' + loc.port; } else { loc.host = loc.hostname; } loc.pathname = (results[4]) ? results[4] : ''; loc.search = (results[5]) ? results[5] : ''; loc.hash = (results[6]) ? results[6] : ''; loc.href = loc.protocol + '//' + loc.host + loc.pathname + loc.search + loc.hash; loc.toString = function() { return this.protocol + '//' + this.host + this.pathname + this.search + this.hash; }; return loc; } }); /** Utility helper class that will generate the correct HTML for a Flash OBJECT and embed it into a page. Broken out so that both _SVGObject and _SVGSVGElement can use it in different contexts. @param embedType Either the string 'script' when embedding SVG into a page using the SCRIPT tag or 'object' if embedding SVG into a page using the OBJECT tag. @param nodeXML The parsed XML for the root SVG element, used for sizing, background, color, etc. @param replaceMe If embedType is 'script', this is the SCRIPT node to replace. If embedType is 'object', then this is the SVG OBJECT node. @param handler The FlashHandler that will be associated with this Flash object. */ function FlashInserter(embedType, nodeXML, replaceMe, handler) { this._embedType = embedType; this._nodeXML = nodeXML; this._replaceMe = replaceMe; this._handler = handler; this._parentNode = replaceMe.parentNode; // Get width and height from object tag, if present. if (this._embedType == 'object') { this._explicitWidth = this._replaceMe.getAttribute('width'); this._explicitHeight = this._replaceMe.getAttribute('height'); } this._setupFlash(); } extend(FlashInserter, { _setupFlash: function() { // determine various information we need to display this object var size = this._determineSize(); var background = this._determineBackground(); var style = this._determineStyle(); var className = this._determineClassName(); var customAttrs = this._determineCustomAttrs(); // setup our ID; if we are embedded with a SCRIPT tag, we use the ID from // the SVG ROOT tag; if we are embedded with an OBJECT tag, then we // simply make the Flash have the exact same ID as the OBJECT we are // replacing var elementID; if (this._embedType == 'script') { elementID = this._nodeXML.getAttribute('id'); this._handler.flashID = elementID + '_flash'; } else if (this._embedType == 'object') { elementID = this._replaceMe.getAttribute('id'); this._handler.flashID = elementID; } // get a Flash object and insert it into our document var flash = this._createFlash(size, elementID, background, style, className, customAttrs); this._insertFlash(flash); // wait for the Flash file to finish loading }, /** Inserts the Flash object into the page. @param flash Flash HTML string. If this is an XHTML page, then this is an EMBED object already instantiated and ready to insert into the page. @returns The Flash DOM object. */ _insertFlash: function(flash) { if (!isIE) { var flashObj; if (!isXHTML) { // no innerHTML in XHTML land // do a trick to turn the Flash HTML string into an actual DOM object // unfortunately this doesn't work on IE; on IE the Flash is immediately // loaded when we do div.innerHTML even though we aren't attached // to the document! var div = document.createElement('div'); div.innerHTML = flash; flashObj = div.childNodes[0]; div.removeChild(flashObj); // at this point we have the OBJECT tag; ExternalInterface communication // won't work on Firefox unless we get the EMBED tag itself for (var i = 0; i < flashObj.childNodes.length; i++) { var check = flashObj.childNodes[i]; if (check.nodeName.toUpperCase() == 'EMBED') { flashObj = check; break; } } } else if (isXHTML) { /* XHTML */ // 'flash' is an EMBED object already created for us by createFlash(); // no innerHTML in this environment so we can't instantiate from // a string: // Issue 312: Odd error when using within XHTML document: // works with Firefox, does not work with any other browser // http://code.google.com/p/svgweb/issues/detail?id=312 flashObj = flash; } // now insert the EMBED tag into the document this._replaceMe.parentNode.replaceChild(flashObj, this._replaceMe); return flashObj; } else { // IE // NOTE 1: as _soon_ as we make this call the Flash will load, even // before the rest of this method has finished. The Flash can // therefore finish loading before anything after the next statement // has run, so be careful of timing bugs. // NOTE 2: IE requires that we have this on a slight timeout, or we // will get the following issue on IE 7: when the SWF and HTC files are // loaded from the browser's cache (i.e. the second time a page loads // by using ctrl-R), loading the HTC and SWF file from the same 'thread' // of control causes an IE bug where the SWF never loads. The one // second timeout gets both files loading on separate 'threads' of // control. var self = this; window.setTimeout(function() { self._replaceMe.outerHTML = flash; self = null; // IE memory leaks }, 1); } }, /** Determines a width and height for the parsed SVG XML. Returns an object literal with two values, width and height. It is worth noting that pixels in this function and generally in javascript land refer to "unzoomed" pixels. An object has a css width value and that unit system does not change due to browser zooming. Flash knows the object size in real screen pixels, so it will account for the zoom mismatch. It does not know the javascript land units, so we must tell it. That is mainly why we are always calculating the pixel values here (from percent values, if necessary). */ _determineSize: function() { var parentWidth = this._parentNode.clientWidth; var parentHeight = this._parentNode.clientHeight; // If parentHeight is zero, then the object was sized with a % // object height and the parent height is not known. // We should use aspect ratio for sizing the object height. // Subsequent resizing of the object may result in a valid // parent height, but in this case, we should stick to our earlier // determination that the image should rely on aspect ratio to size // the object height. if (parentHeight == 0) { this.invalidParentHeight = true; } /* IE7 quirk */ if (parentWidth == 0) { parentWidth = this._parentNode.offsetWidth; } if (!isSafari) { parentWidth -= this._getMargin(this._parentNode, 'margin-left'); parentWidth -= this._getMargin(this._parentNode, 'margin-right'); parentHeight -= this._getMargin(this._parentNode, 'margin-top'); parentHeight -= this._getMargin(this._parentNode, 'margin-bottom'); } if (isStandardsMode) { return this._getStandardsSize(parentWidth, parentHeight); } else { return this._getQuirksSize(parentWidth, parentHeight); } }, _getQuirksSize: function(parentWidth, parentHeight) { var pixelsWidth, pixelsHeight; /** In the case of script or where an svg object has a height percent and the svg image has a height percent, then the height of the parent is not used and the viewBox aspect resolution is used. However, in certain circumstances, the % of the parent height is used. That circumstance is when the embed type is script and parentHeight is > 0 and if it is in a div with height. Here, we look for a parent div, and if we do not find one, then we default to clientHeight. */ if (this._embedType == 'script') { var grandParent = this._parentNode; while (grandParent && grandParent.style) { // If a grandparent is a div, the parent height is ok. if (grandParent.nodeName.toLowerCase() == 'div') { // ?? may need to check for valid height break; } // If we get to the body without div, ignore parent height. if (grandParent.nodeName.toLowerCase() == 'body') { // See Issue 276. Images with position: fixed // scale into the viewport. if (this._nodeXML.getAttribute('style') && this._nodeXML.getAttribute('style').indexOf('fixed') != -1) { if (window.innerHeight && window.innerHeight > 0) { parentHeight = window.innerHeight; } else if (document.documentElement && document.documentElement.clientHeight && document.documentElement.clientHeight > 0) { parentHeight = document.documentElement.clientHeight; } else { parentHeight = document.body.clientHeight; } this.invalidParentHeight = false; } else { // Issue 233: Default to viewBox this.invalidParentHeight = true; parentHeight = 0; } break; } grandParent = grandParent.parentNode; } } // Calculate the object width and size starting with // the width and height from the object tag. // // If this is script embed type, the algorithm will perform as // an object tag with neither width nor height specified. // var objWidth = this._explicitWidth; var objHeight = this._explicitHeight; var xmlWidth = this._nodeXML.getAttribute('width'); if (xmlWidth && xmlWidth.indexOf('%') == -1) { // strip 'px' if present xmlWidth = parseInt(xmlWidth).toString(); } var xmlHeight = this._nodeXML.getAttribute('height'); if (xmlHeight && xmlHeight.indexOf('%') == -1) { // strip 'px' if present xmlHeight = parseInt(xmlHeight).toString(); } if (objWidth && objHeight) { // calculate width in pixels if (objWidth.indexOf('%') != -1) { pixelsWidth = parentWidth * parseInt(objWidth) / 100; } else { pixelsWidth = objWidth; } // calculate height in pixels if (objHeight.indexOf('%') != -1) { if (parentHeight > 0) { pixelsHeight = parentHeight * parseInt(objHeight) / 100; } else { console.log('SVGWeb: unhandled resize scenario.'); parentHeight = 200; } } else { pixelsHeight = objHeight; } return {width: objWidth, height: pixelsHeight, pixelsWidth: pixelsWidth, pixelsHeight: pixelsHeight, clipMode: this._nodeXML.getAttribute('viewBox') ? 'neither' : 'both'}; } var viewBox, boxWidth, boxHeight; if (objWidth) { // estimate the width that will be used for percents if (objWidth.indexOf('%') != -1) { pixelsWidth = parentWidth * parseInt(objWidth) / 100; } else { pixelsWidth = objWidth; } if (this._nodeXML.getAttribute('viewBox')) { // If width and height are both specified on the SVG file in pixels, // then the height is calculated based on the object width and the // aspect ratio between the svg height and width. // The viewBox scales into resulting area (honoring preserveAspectRatio). // SVG height and width are not using in actual rendering. if (xmlWidth && xmlWidth.indexOf('%') == -1 && xmlHeight && xmlHeight.indexOf('%') == -1) { objHeight = pixelsWidth * (xmlHeight / xmlWidth); } else { viewBox = this._nodeXML.getAttribute('viewBox').split(/\s+|,/); boxWidth = viewBox[2]; boxHeight = viewBox[3]; objHeight = pixelsWidth * (boxHeight / boxWidth); } return {width: objWidth, height: objHeight, pixelsWidth: pixelsWidth, pixelsHeight: objHeight, clipMode: 'neither'}; } else { if (xmlWidth && xmlWidth.indexOf('%') == -1 && xmlHeight && xmlHeight.indexOf('%') == -1) { objHeight = pixelsWidth * (xmlHeight / xmlWidth); } else { if (xmlHeight && xmlHeight.indexOf('%') == -1) { objHeight = xmlHeight; } else { objHeight = 150; } } return {width: objWidth, height: objHeight, pixelsWidth: pixelsWidth, pixelsHeight: objHeight, clipMode: 'both'}; } } if (objHeight) { if (objHeight.indexOf('%') != -1) { pixelsHeight = parentHeight * parseInt(objHeight) / 100; } else { pixelsHeight = objHeight; } if (this._nodeXML.getAttribute('viewBox')) { // If width and height are both specified on the SVG file in pixels, // then the object width is calculated based on the object height and the // aspect ratio between the svg height and width. if (xmlWidth && xmlWidth.indexOf('%') == -1 && xmlHeight && xmlHeight.indexOf('%') == -1) { objWidth = pixelsHeight * (xmlWidth / xmlHeight); } else { viewBox = this._nodeXML.getAttribute('viewBox').split(/\s+|,/); boxWidth = viewBox[2]; boxHeight = viewBox[3]; objWidth = pixelsHeight * (boxWidth / boxHeight); } return {width: objWidth, height: objHeight, pixelsWidth: objWidth, pixelsHeight: pixelsHeight, clipMode: 'neither'}; } else { // No viewbox, use svg width for object size if (xmlWidth && xmlWidth.indexOf('%') == -1 && xmlHeight && xmlHeight.indexOf('%') == -1) { objWidth = pixelsHeight * (xmlWidth / xmlHeight); pixelsWidth = objWidth; } else { if (xmlWidth) { objWidth = xmlWidth; } else { objWidth = "100%"; } // estimate the width that will be used for percents if (objWidth.indexOf('%') != -1) { pixelsWidth = parentWidth * parseInt(objWidth) / 100; } else { pixelsWidth = objWidth; } } // Also use svg width for svg clipping return {width: objWidth, height: objHeight, pixelsWidth: pixelsWidth, pixelsHeight: pixelsHeight, clipMode: 'both'}; } } // If we are here, neither object height nor width were specified. // Use the svg width if (xmlWidth) { objWidth = xmlWidth; } else { objWidth = "100%"; } // Calculate the width that will be used for percents. if (objWidth.indexOf('%') != -1) { pixelsWidth = parentWidth * parseInt(objWidth) / 100; } else { pixelsWidth = objWidth; } // Height pixels are used directly. if (xmlHeight && xmlHeight.indexOf('%') == -1) { objHeight = xmlHeight; return {width: objWidth, height: objHeight, pixelsWidth: pixelsWidth, pixelsHeight: objHeight, clipMode: this._nodeXML.getAttribute('viewBox') ? 'neither' : 'both'}; } else { // The height is a % or missing. Check for viewBox. if (this._nodeXML.getAttribute('viewBox')) { // Issue 276 if (this._embedType == 'script' && (xmlHeight == null || xmlHeight.indexOf('%') != -1) && !this.invalidParentHeight) { if (xmlHeight == null) { xmlHeight = "100%"; } if (objHeight == null) { objHeight = "100%"; } pixelsHeight = parentHeight * parseInt(xmlHeight) / 100; return {width: objWidth, height: pixelsHeight, pixelsWidth: pixelsWidth, pixelsHeight: pixelsHeight, clipMode: 'neither'}; } var viewBox = this._nodeXML.getAttribute('viewBox').split(/\s+|,/); var boxWidth = viewBox[2]; var boxHeight = viewBox[3]; objHeight = pixelsWidth * (boxHeight / boxWidth); return {width: objWidth, height: objHeight, pixelsWidth: pixelsWidth, pixelsHeight: objHeight, clipMode: 'neither'}; } else { objHeight = 150; return {width: objWidth, height: objHeight, pixelsWidth: pixelsWidth, pixelsHeight: objHeight, clipMode: 'both'}; } } }, _getStandardsSize: function(parentWidth, parentHeight) { var pixelsWidth, pixelsHeight; // Calculate the object width and size starting with // the width and height from the object tag. // // If this is script embed type, the algorithm will perform as // an object tag with neither width nor height specified. // var objWidth = this._explicitWidth; var objHeight = this._explicitHeight; var xmlWidth = this._nodeXML.getAttribute('width'); if (xmlWidth && xmlWidth.indexOf('%') == -1) { // strip 'px' if present xmlWidth = parseInt(xmlWidth).toString(); } var xmlHeight = this._nodeXML.getAttribute('height'); if (xmlHeight && xmlHeight.indexOf('%') == -1) { // strip 'px' if present xmlHeight = parseInt(xmlHeight).toString(); } if (objWidth && !objHeight) { return this._getQuirksSize(parentWidth, parentHeight); } if (!objWidth && !objHeight) { return this._getQuirksSize(parentWidth, parentHeight); } if (!objWidth && objHeight) { if (xmlWidth) { objWidth = xmlWidth; } else { objWidth = '100%'; } // calculate width in pixels if (objWidth.indexOf('%') != -1) { pixelsWidth = parentWidth * parseInt(objWidth) / 100; } else { pixelsWidth = objWidth; } // Use object height pixels, if specified. if (objHeight.indexOf('%') == -1) { pixelsHeight = objHeight; // If width and height are both specified on the SVG file in pixels, // then the object width is calculated based on the object height and the // aspect ratio between the svg height and width. if (xmlWidth && xmlWidth.indexOf('%') == -1 && xmlHeight && xmlHeight.indexOf('%') == -1) { objWidth = objHeight * (xmlWidth / xmlHeight); pixelsWidth = objWidth; } else { if (this._nodeXML.getAttribute('viewBox')) { viewBox = this._nodeXML.getAttribute('viewBox').split(/\s+|,/); boxWidth = viewBox[2]; boxHeight = viewBox[3]; objWidth = pixelsHeight * (boxWidth / boxHeight); pixelsWidth = objWidth; } } return {width: objWidth, height: objHeight, pixelsWidth: pixelsWidth, pixelsHeight: objHeight, clipMode: this._nodeXML.getAttribute('viewBox') ? 'neither' : 'both'}; } else { if (xmlHeight && xmlHeight.indexOf('%') == -1) { pixelsHeight = xmlHeight; } else { if (this._nodeXML.getAttribute('viewBox')) { viewBox = this._nodeXML.getAttribute('viewBox').split(/\s+|,/); boxWidth = viewBox[2]; boxHeight = viewBox[3]; pixelsHeight = pixelsWidth * (boxHeight / boxWidth); } else { pixelsHeight = 150; } } return {width: objWidth, height: pixelsHeight, pixelsWidth: pixelsWidth, pixelsHeight: pixelsHeight, clipMode: this._nodeXML.getAttribute('viewBox') ? 'neither' : 'both'}; } } if (objWidth && objHeight) { // calculate width in pixels if (objWidth.indexOf('%') != -1) { pixelsWidth = parentWidth * parseInt(objWidth) / 100; } else { pixelsWidth = objWidth; } // Use object height pixels, if specified. if (objHeight.indexOf('%') == -1) { return {width: objWidth, height: objHeight, pixelsWidth: pixelsWidth, pixelsHeight: objHeight, clipMode: this._nodeXML.getAttribute('viewBox') ? 'neither' : 'both'}; } else { if (xmlWidth && xmlWidth.indexOf('%') == -1 && // If width and height are both specified on the SVG file in pixels, // then the height is calculated based on the object width and the // aspect ratio between the svg height and width. xmlHeight && xmlHeight.indexOf('%') == -1) { pixelsHeight = pixelsWidth * (xmlHeight / xmlWidth); return {width: objWidth, height: pixelsHeight, pixelsWidth: pixelsWidth, pixelsHeight: pixelsHeight, clipMode: 'neither'}; } else { if (!this.invalidParentHeight) { // If parent height is "valid", use it. pixelsHeight = parentHeight * parseInt(objHeight) / 100; return {width: objWidth, height: pixelsHeight, pixelsWidth: pixelsWidth, pixelsHeight: pixelsHeight, clipMode: 'neither'}; } else { // Default to viewbox aspect resolution if (this._nodeXML.getAttribute('viewBox')) { viewBox = this._nodeXML.getAttribute('viewBox').split(/\s+|,/); boxWidth = viewBox[2]; boxHeight = viewBox[3]; objHeight = pixelsWidth * (boxHeight / boxWidth); return {width: objWidth, height: objHeight, pixelsWidth: pixelsWidth, pixelsHeight: objHeight, clipMode: 'neither'}; } else { if (xmlHeight && xmlHeight.indexOf('%') == -1) { pixelsHeight = xmlHeight; } else { pixelsHeight = 150; } return {width: objWidth, height: pixelsHeight, pixelsWidth: pixelsWidth, pixelsHeight: pixelsHeight, clipMode: 'both'}; } } } } } }, // http://www.quirksmode.org/dom/getstyles.html _getMargin: function(node,styleProp) { var y; if (node.currentStyle) y = parseInt(node.currentStyle[styleProp]); else if (window.getComputedStyle) y = parseInt(document.defaultView.getComputedStyle(node,null).getPropertyValue(styleProp)); if (y) return y; else return 0; }, /** Determines the background coloring. Returns an object literal with two values, 'color' with a color or null and 'transparent' with a boolean. */ _determineBackground: function() { var transparent = false; var color = null; // NOTE: CSS 2.1 spec says background does not get inherited, and we don't // support external CSS style rules for now; we also only support // 'background-color' property and not 'background' CSS property for // setting the background color. var style = this._nodeXML.getAttribute('style'); if (style && style.indexOf('background-color') != -1) { var m = style.match(/background\-color:\s*([^;]*)/); if (m) { color = m[1]; } } if (color === null) { // no background color specified transparent = true; } return {color: color, transparent: transparent}; }, /** Determines what the style should be on the SVG root element, copying over any styles the user has placed inline and defaulting certain styles. We will bring these over to the Flash object. @returns Style string ready to copy over to Flash object. */ _determineStyle: function() { var style = this._nodeXML.getAttribute('style'); if (!style) { style = ''; } // IE sometimes leaves off trailing semicolon of style values if (style.length > 0 && style.charAt(style.length - 1) != ';') { style += ';'; } // SVG spec says default display value for SVG root element is // inline if (this._embedType == 'script' && style.indexOf('display:') == -1) { style += 'display: inline;'; } // SVG spec says SVG by default should have overflow: none if (this._embedType == 'script' && style.indexOf('overflow:') == -1) { style += 'overflow: hidden;'; } return style; }, /** Determines a class name for the Flash object; we simply copy over any class names on the SVG root object to aid in external styling. @returns Class name string. Returns '' if there is none. */ _determineClassName: function() { var className = this._nodeXML.getAttribute('class'); if (!className) { return 'embedssvg'; } else { return className + ' embedssvg'; } }, /** The developer might have added custom attributes on to the place holder we are replacing for SVG OBJECTs; copy those over and make sure they show up on the Flash OBJECT as well. */ _determineCustomAttrs: function() { var results = []; if (this._embedType == 'object') { var node = this._replaceMe; // we use a fake object to determine potential default attributes that // we don't want to copy over to our Flash object var commonObj = document._createElement('object'); for (var j = 0; j < node.attributes.length; j++) { var attr = node.attributes[j]; var attrName = attr.nodeName; var attrValue = attr.nodeValue; // trim out 'empty' attributes with no value if (!attrValue && attrValue !== 'true') { continue; } // trim out anything that is on a common OBJECT so we don't have // overlap if (commonObj.getAttribute(attrName)) { continue; } // trim out other OBJECT overrides as well as some custom attributes // we might have added earlier in the OBJECT creation process // (_listeners, addEventListener, etc.) if (/^(id|name|width|height|data|class|style|codebase|type|_listeners|addEventListener|onload)$/.test(attrName)) { continue; } results.push({attrName: attrName.toString(), attrValue: attrValue.toString()}); } } return results; }, /** Creates a Flash object that embeds the Flash SVG Viewer. @param size Object literal with width and height. @param elementID The ID of either the SVG ROOT object or of an SVG OBJECT. @param background Object literal with background color and transparent boolean. @param style Style string to copy onto Flash object. @param className The class name to copy into the Flash object. @param customAttrs Array of custom attributes that the developer might have put on their SVG OBJECT; each entry in the array is an object literal with attrName and attrValue as the keys. @returns Flash object as HTML string. If the page is an XHTML page, then we return an EMBED tag already instantiated and ready to insert; this is because we do not have innerHTML on XHTML pages. */ _createFlash: function(size, elementID, background, style, className, customAttrs) { var flashVars = 'uniqueId=' + encodeURIComponent(elementID) + '&sourceType=string' + '&clipMode=' + size.clipMode + '&debug=true' + '&svgId=' + encodeURIComponent(elementID); var src; if (this._isXDomain) { src = svgweb.xDomainURL + 'svg.swf'; } else { src = svgweb.libraryPath + 'svg.swf'; } var protocol = window.location.protocol; if (protocol.charAt(protocol.length - 1) == ':') { protocol = protocol.substring(0, protocol.length - 1); } var flash; if (isXHTML) { // XHTML environments have no innerHTML flash = document.createElement('embed'); flash.setAttribute('src', src); flash.setAttribute('quality', 'high'); // FIXME: Will this logic test break if the color is black? if (background.color) { flash.setAttribute('bgcolor', background.color); } if (background.transparent) { flash.setAttribute('wmode', 'transparent'); } flash.setAttribute('width', size.width); flash.setAttribute('height', size.height); flash.setAttribute('id', this._handler.flashID); flash.setAttribute('name', this._handler.flashID); flash.setAttribute('swLiveConnect', 'true'); flash.setAttribute('allowScriptAccess', 'always'); flash.setAttribute('type', 'application/x-shockwave-flash'); flash.setAttribute('FlashVars', flashVars); flash.setAttribute('pluginspage', protocol + '://www.macromedia.com/go/getflashplayer'); flash.setAttribute('style', style); flash.setAttribute('className', className); for (var i = 0; i < customAttrs.length; i++) { flash.setAttribute(customAttrs[i].attrName, customAttrs[i].attrValue); } } else { // normal text/html environment var customAttrStr = ''; for (var i = 0; i < customAttrs.length; i++) { customAttrStr += ' ' + customAttrs[i].attrName + '="' + customAttrs[i].attrValue + '"'; } flash = '\n ' + '\n ' + '\n ' + '\n ' + '\n ' // FIXME: Will this logic test break if the color is black? + (background.color ? '\n ' : '') + (background.transparent ? '' + '\n ' : '') + '' + ''; } return flash; } }); /** SVG Root element. @param nodeXML A parsed XML node object that is the SVG root node. @param svgString The full SVG as a string. Null if this SVG root element is being embedded by an SVG OBJECT. @param scriptNode The script node that contains this SVG. Null if this SVG root element is being embedded by an SVG OBJECT. @param handler The FlashHandler that we are a part of. */ function _SVGSVGElement(nodeXML, svgString, scriptNode, handler) { this._attached = true; // superclass constructor _Element.apply(this, ['svg', null, svgns, nodeXML, handler]); this._nodeXML = nodeXML; this._svgString = svgString; this._scriptNode = scriptNode; // flash that we use to know whether the HTC and SWF files are loaded this._htcLoaded = false; this._swfLoaded = false; // add to our nodeByID lookup table so that fetching this node in the // future works if (this._handler.type == 'script') { var rootID = this._nodeXML.getAttribute('id'); var doc = this._handler.document; doc._nodeById['_' + rootID] = this; } this._currentScale = 1; this._currentTranslate = this._createCurrentTranslate(); // when being embedded by a SCRIPT element, the _SVGSVGElement class // takes over inserting the Flash and HTC elements so that we have // something visible on the screen; when being embedded by an SVG OBJECT // we don't do this since the OBJECT tag itself is what is visible on the // screen if (isIE && this._handler.type == 'script') { // slot in our suspendRedraw/unsuspendRedraw methods this._addRedrawMethods(); // track .style changes this.style = new _Style(this); // find out when the content is ready // NOTE: we do this here instead of inside the HTC file using an // internal oncontentready event in order to make the HTC file faster // and use less memory. Note also that 'oncontentready' is not available // outside HTC files, only 'onreadystatechange' is available. this._readyStateListener = hitch(this, this._onHTCLoaded); // cleanup later this._htcNode.attachEvent('onreadystatechange', this._readyStateListener); // now wait for the HTC file to load for the SVG root element; // continue inserting our Flash object below as well so that the HTC // file and SWF file load in parallel for better overall performance } else if (isIE && this._handler.type == 'object') { // slot in our suspendRedraw/unsuspendRedraw methods this._addRedrawMethods(); } if (this._handler.type == 'script') { // insert the Flash this._handler._inserter = new FlashInserter('script', this._nodeXML, this._scriptNode, this._handler); } } // subclasses _Element _SVGSVGElement.prototype = new _Element; extend(_SVGSVGElement, { // SVGSVGElement // NOTE: there are properties and methods from SVGSVGElement not defined // or implemented here; see // http://www.w3.org/TR/SVG/struct.html#InterfaceSVGSVGElement // for full list // TODO: Implement the functions below suspendRedraw: function(ms /* unsigned long */) /* unsigned long */ { return this._handler._redrawManager.suspendRedraw(ms); }, unsuspendRedraw: function(id /* unsigned long */) /* void */ /* throws DOMException */ { this._handler._redrawManager.unsuspendRedraw(id); }, unsuspendRedrawAll: function() /* void */ { this._handler._redrawManager.unsuspendRedrawAll(); }, forceRedraw: function() /* void */ { // not implemented }, // end SVGSVGElement // SVGLocatable // TODO: Implement the following properties nearestViewportElement: null, /* readonly SVGElement */ farthestViewportElement: null, /* readonly SVGElement */ // TODO: Implement the following methods getTransformToElement: function(element /* SVGElement */) /* SVGMatrix */ { /* throws SVGException */ }, // end of SVGLocatable /** Called when the Microsoft Behavior HTC file is loaded. */ _onHTCLoaded: function() { //console.log('onHTCLoaded'); //end('HTCLoading'); //start('onHTCLoaded'); // cleanup our event handler this._htcNode.detachEvent('onreadystatechange', this._readyStateListener); // pay attention to style changes now in the HTC this.style._ignoreStyleChanges = false; //end('onHTCLoaded'); // indicate that the HTC is loaded; see if Flash is loaded this._htcLoaded = true; if (this._swfLoaded) { this._onEverythingLoaded(); } // TODO: we are not handling dynamically created nodes yet }, /** Called when the Flash SWF file has been loaded. Note that this doesn't include the SVG being rendered -- at this point we haven't even sent the SVG to the Flash file for rendering yet. */ _onFlashLoaded: function(msg) { //end('SWFLoading'); //start('onFlashLoaded'); // the Flash object is done loading //console.log('_onFlashLoaded'); // store a reference to our Flash object this._handler.flash = document.getElementById(this._handler.flashID); // for non-IE browsers we are ready to go; for IE, see if the HTC is done // loading yet this._swfLoaded = true; if (!isIE || this._htcLoaded) { this._onEverythingLoaded(); } //end('onFlashLoaded'); }, /** Called when the Flash is loaded initially, as well as the HTC file for IE. */ _onEverythingLoaded: function() { //console.log('_onEverythingLoaded'); // send the SVG over to Flash now //start('firstSendToFlash'); //start('jsHandleLoad'); var size = this._handler._inserter._determineSize(); this._handler.sendToFlash('jsHandleLoad', [ /* objectURL */ this._getRelativeTo('object'), /* pageURL */ this._getRelativeTo('page'), /* objectWidth */ size.pixelsWidth, /* objectHeight */ size.pixelsHeight, /* ignoreWhiteSpace */ true, /* svgString */ this._svgString ]); //end('jsHandleLoad'); }, /** The Flash is finished rendering. */ _onRenderingFinished: function(msg) { //end('firstSendToFlash'); //start('onRenderingFinished'); //console.log('onRenderingFinished'); if (this._handler.type == 'script') { // expose the root SVG element as 'documentElement' on the EMBED // or OBJECT tag for SVG SCRIPT embed as a utility property for // developers to descend down into the SVG root tag // (see Known Issues and Errata for details) this._handler.flash.documentElement = this._getProxyNode(); } // set the ownerDocument based on how we are embedded if (this._attached) { if (this._handler.type == 'script') { this.ownerDocument = document; } else if (this._handler.type == 'object') { this.ownerDocument = this._handler.document; } } this._handler.document.rootElement = this._getProxyNode(); var elementId = this._nodeXML.getAttribute('id'); this._handler._loaded = true; //end('onRenderingFinished'); this._handler.fireOnLoad(elementId, 'script'); }, /** Relative URLs inside of SVG need to expand against something (i.e. such as having an SVG Audio tag with a relative URL). This method figures out what that relative URL should be. We send this over to Flash when rendering things so Flash knows what to expand against. */ _getRelativeTo: function() { var results = ''; var pathname = window.location.pathname.toString(); if (pathname && pathname.length > 0 && pathname.indexOf('/') != -1) { // snip off any filename after a final slash results = pathname.replace(/\/([^\/]*)$/, '/'); } return results; }, /** Adds the various suspendRedraw/unsuspendRedraw methods to our HTC proxy for IE. We do it here for two reasons: so that we don't have to bloat the size of the HTC file which has a large affect on performance, and so that these methods don't show up for SVG nodes that aren't the root SVG node. */ _addRedrawMethods: function() { // add methods inside of fresh closures to prevent IE memory leaks this._htcNode.suspendRedraw = (function() { return function(ms) { return this._fakeNode.suspendRedraw(ms); }; })(); this._htcNode.unsuspendRedraw = (function() { return function(id) { return this._fakeNode.unsuspendRedraw(id); }; })(); this._htcNode.unsuspendRedrawAll = (function() { return function() { return this._fakeNode.unsuspendRedrawAll(); }; })(); this._htcNode.forceRedraw = (function() { return function() { return this._fakeNode.forceRedraw(); }; })(); }, /** Sets up our currentTranslate property to pass over any changes on the X and Y values over to Flash. */ _createCurrentTranslate: function() { var p = new _SVGPoint(0, 0, true /* formalAccessor */, hitch(this, this._updateCurrentTranslate)); return p; }, _updateCurrentTranslate: function(type, newValue1, newValue2) { if (type == 'xy') { this._handler.sendToFlash('jsSetCurrentTranslate', [ 'xy', newValue1, newValue2 ]); } else { this._handler.sendToFlash('jsSetCurrentTranslate', [ type, newValue1 ]); } } }); /** Represent a Document object for manipulating the SVG document. @param xml Parsed XML for the SVG. @param handler The FlashHandler this document is a part of. */ function _Document(xml, handler) { // superclass constructor _Node.apply(this, ['#document', _Node.DOCUMENT_NODE, null, null, xml, handler], svgns); this._xml = xml; this._handler = handler; this._nodeById = {}; this._namespaces = this._getNamespaces(); this.implementation = new _DOMImplementation(); if (this._handler.type == 'script') { this.defaultView = window; } else if (this._handler.type == 'object') { // we set the document.defaultView in _SVGObject._executeScript() once // we create the iframe that we execute our script into } } // subclasses _Node _Document.prototype = new _Node; extend(_Document, { /** Stores a lookup from a node's ID to it's _Element or _Node representation. An object literal. */ _nodeById: null, /* Note: technically these 2 properties should be read-only and throw a DOMException when set. For simplicity we make them simple JS properties; if set, nothing will happen. Also note that we don't support the 'doctype' property. */ implementation: null, documentElement: null, createElementNS: function(ns, qname) /* _Element */ { var prefix = this._namespaces['_' + ns]; if (prefix == 'xmlns' || !prefix) { // default SVG namespace // If this is a new namespace, we may have to assume the // prefix from the qname if (qname.indexOf(':') != -1) { prefix=qname.substring(0, qname.indexOf(':')) } else { prefix = null; } } var node = new _Element(qname, prefix, ns, undefined, this._handler); return node._getProxyNode(); }, createTextNode: function(data /* DOM Text Node */) /* _Node */ { // We create a DOM Element node to represent this text node. We do this // so that we can track the text node over time to register changes to // it and so on. We must use a DOM Element node so that we have access // to the setAttribute method in order to store data on the XML DOM node. // This is due to a limitation on Internet Explorer where you can not // store 'expandos' on XML node objects (i.e. you can't add custom // properties). We store the actual data as a DOM Text Node of our DOM // Element. Note that since we have no handler yet we simply use a default // XML document object (_unattachedDoc) to create things for now. var doc = FlashHandler._unattachedDoc; var nodeXML; if (isIE) { // no createElementNS available nodeXML = doc.createElement('__text'); } else { nodeXML = doc.createElementNS(svgnsFake, '__text'); } nodeXML.appendChild(doc.createTextNode(data)); var textNode = new _Node('#text', _Node.TEXT_NODE, null, null, nodeXML, this._handler); textNode._nodeValue = data; textNode.ownerDocument = this; return textNode._getProxyNode(); }, createDocumentFragment: function(forSVG) { return new _DocumentFragment(this)._getProxyNode(); }, getElementById: function(id) /* _Element */ { // XML parser does not have getElementById, due to id mapping in XML // issues; use XPath instead var results = xpath(this._xml, null, '//*[@id="' + id + '"]'); var nodeXML, node; if (results.length) { nodeXML = results[0]; } else { return null; } // create or get an _Element for this XML DOM node for node node = FlashHandler._getNode(nodeXML, this._handler); this._getFakeNode(node)._attached = true; return node; }, /** NOTE: on IE we don't support calls like the following: getElementsByTagNameNS(*, 'someTag'); We do support: getElementsByTagNameNS('*', '*'); getElementsByTagNameNS('someNameSpace', '*'); getElementsByTagNameNS(null, 'someTag'); */ getElementsByTagNameNS: function(ns, localName) /* _NodeList of _Elements */ { //console.log('document.getElementsByTagNameNS, ns='+ns+', localName='+localName); // we might be a dynamically created SVG script node that is not done // loading yet if (this._handler.type == 'script' && !this._handler._loaded) { return []; } var results = this.rootElement.getElementsByTagNameNS(ns, localName); // Make sure to include root SVG node in our results if that is what // is asked for! if (ns == svgns && localName == 'svg') { results.push(this.rootElement); } return results; }, // Note: createDocumentFragment, createComment, createCDATASection, // createProcessingInstruction, createAttribute, createEntityReference, // importNode, createElement, getElementsByTagName, // createAttributeNS not supported /** Extracts any namespaces we might have, creating a prefix/namespaceURI lookup table. NOTE: We only support namespace declarations on the root SVG node for now. @returns An object that associates prefix to namespaceURI, and vice versa. */ _getNamespaces: function() { var results = []; var attrs = this._xml.documentElement.attributes; for (var i = 0; i < attrs.length; i++) { var attr = attrs[i]; if (/^xmlns:?(.*)$/.test(attr.nodeName)) { var m = attr.nodeName.match(/^xmlns:?(.*)$/); var prefix = (m[1] ? m[1] : 'xmlns'); var namespaceURI = attr.nodeValue; // don't add duplicates if (!results['_' + prefix]) { results['_' + prefix] = namespaceURI; results['_' + namespaceURI] = prefix; results.push(namespaceURI); } } } return results; } }); // We don't create a NodeList class due to the complexity of subclassing // the Array object cross browser. Instead, we simply patch in the item() // method to a normal Array object function createNodeList() { var results = []; results.item = function(i) { if (i >= this.length) { return null; // DOM Level 2 spec says return null } else { return this[i]; } } return results; } // We don't have an actual DOM CharacterData type for now. We just return // a String object with the 'data' property patched in, since that is what // is most commonly accessed function createCharacterData(data) { var results = (data !== undefined) ? new String(data) : new String(); results.data = results.toString(); return results; } // End DOM Level 2 Core/Events support // SVG DOM interfaces // Note: where the spec returns an SVGNumber or SVGString we just return // the JavaScript base type instead. Note that in general also instead of // returning the many SVG List types, such as SVGPointList, we just // return standard JavaScript Arrays. For SVGAngle we also // just return a JS Number for now. function _SVGMatrix(a /** All Numbers */, b, c, d, e, f, _handler) { this.a = a; this.b = b; this.c = c; this.d = d; this.e = e; this.f = f; this._handler = _handler; } extend(_SVGMatrix, { // all functions return _SVGMatrix // TODO: Implement the following methods multiply: function(secondMatrix /* _SVGMatrix */ ) {}, inverse: function() { var msg =this._handler.sendToFlash('jsMatrixInvert', [ this.a, this.b, this.c, this.d, this.e, this.f ]); msg = this._handler._stringToMsg(msg); return new _SVGMatrix(new Number(msg.a), new Number(msg.b), new Number(msg.c), new Number(msg.d), new Number(msg.e), new Number(msg.f), this._handler); }, translate: function(x /* Number */, y /* Number */) {}, scale: function(scaleFactor /* Number */) {}, scaleNonUniform: function(scaleFactorX /* Number */, scaleFactorY /* Number */) {}, rotate: function(angle /* Number */) {}, rotateFromVector: function(x, y) {}, flipX: function() {}, flipY: function() {}, skewX: function(angle) {}, skewY: function(angle) {} }); // Note: Most of the functions on SVGLength not supported for now function _SVGLength(/* Number */ value) { this.value = value; } // Note: We only support _SVGAnimatedLength because that is what Firefox // and Safari return, and we want to have parity. Only baseVal works for now function _SVGAnimatedLength(/* _SVGLength */ value) { this.baseVal = value; this.animVal = undefined; // not supported for now } function _SVGTransform(type, matrix, angle) { this.type = type; this.matrix = matrix; this.angle = angle; } mixin(_SVGTransform, { SVG_TRANSFORM_UNKNOWN: 0, SVG_TRANSFORM_MATRIX: 1, SVG_TRANSFORM_TRANSLATE: 2, SVG_TRANSFORM_SCALE: 3, SVG_TRANSFORM_ROTATE: 4, SVG_TRANSFORM_SKEWX: 5, SVG_TRANSFORM_SKEWY: 6 }); extend(_SVGTransform, { // Note: the following 3 should technically be readonly type: null, /* one of the constants above */ matrix: null, /* _SVGMatrix */ angle: null, /* float */ // TODO: Implement the following methods setMatrix: function(matrix /* SVGMatrix */) {}, setTranslate: function(tx /* float */, ty /* float */) {}, setScale: function(sx /* float */, sy /* float */) {}, setRotate: function(angle /* float */, cx /* float */, cy /* float */) {}, setSkewX: function(angle /* float */) {}, setSkewY: function(angle /* float */) {} }); /** SVGPoint class. @formalAccessors - Optional boolean that controls whether we force the class to have formal get and set method to handle limitations in IE, such as getX. Defaults to false. @callback - Optional Function. Called when a setter is called. Given the following arguments: 'x', 'y', or 'xy' on what is being set followed by the new value(s) */ function _SVGPoint(x, y, formalAccessors, callback) { if (formalAccessors === undefined) { formalAccessors = false; } this._formalAccessors = formalAccessors; this.x = x; this.y = y; if (formalAccessors) { this.setX = hitch(this, function(newValue) { this.x = newValue; callback('x', newValue); }); this.getX = hitch(this, function() { return this.x; }); this.setY = hitch(this, function(newValue) { this.y = newValue; callback('y', newValue); }); this.getY = hitch(this, function() { return this.y; }); this.setXY = hitch(this, function(newX, newY) { this.x = newX; this.y = newY; callback('xy', newX, newY); }); } } extend(_SVGPoint, { matrixTransform: function(m) { return new _SVGPoint( m.a * this.x + m.c * this.y + m.e, m.b * this.x + m.d * this.y + m.f, this._formalAccessors); } }); // SVGRect function _SVGRect(x, y, width, height) { this.x = x; this.y = y; this.width = width; this.height = height; } // end SVG DOM interfaces /* Other DOM interfaces specified by SVG 1.1: * SVG 1.1 spec requires DOM 2 Views support, which we do not implement: http://www.w3.org/TR/DOM-Level-2-Views/ * SVG 1.1 spec has the DOM traversal and range APIs as optional; these are not supported * Technically we need to support certain DOM Level 2 CSS interfaces: http://www.w3.org/TR/DOM-Level-2-Style/css.html We support some (anything that should be on an SVG Element), but the following interfaces are not supported: CSSStyleSheet, CSSRuleList, CSSRule, CSSStyleRule, CSSMediaRule, CSSFontFaceRule, CSSPageRule, CSSImportRule, CSSCharsetRule, CSSUnknownRule, CSSStyleDeclaration, CSSValue, CSSPrimitiveValue, CSSValueList, RGBColor, Rect, Counter, ViewCSS (getComputedStyle), DocumentCSS, DOMImplementationCSS, none of the CSS 2 Extended Interfaces * There are many SVG DOM interfaces we don't support */ window.svgweb = new SVGWeb(); // kicks things off // hide internal implementation details inside of a closure })(); // Uncomment when doing performance profiling /* window.timer = {}; function start(subject, subjectStarted) { //console.log('start('+subject+','+subjectStarted+')'); if (subjectStarted && !ifStarted(subjectStarted)) { //console.log(subjectStarted + ' not started yet so returning for ' + subject); return; } //console.log('storing time for ' + subject); window.timer[subject] = {start: new Date().getTime()}; } function end(subject, subjectStarted) { //console.log('end('+subject+','+subjectStarted+')'); if (subjectStarted && !ifStarted(subjectStarted)) { //console.log(subjectStarted + ' not started yet so returning for ' + subject); return; } if (!window.timer[subject]) { console.log('Unknown subject: ' + subject); return; } window.timer[subject].end = new Date().getTime(); //console.log('at end, storing total time: ' + total(subject)); } function increment(subject, amount) { if (!window.timer[subject]) { window.timer[subject] = {incremented: true, total: 0}; } window.timer[subject].total += amount; } function total(subject) { if (!window.timer[subject]) { console.log('Unknown subject: ' + subject); return; } var t = window.timer[subject]; if (t.incremented) { return t.total; } else if (t) { return t.end - t.start; } else { return null; } } function ifStarted(subject) { for (var i in window.timer) { var t = window.timer[i]; if (i == subject && t.start !== undefined && t.end === undefined) { return true; } } return false; } function report() { for (var i in window.timer) { var t = total(i); if (t !== null) { console.log(i + ': ' + t + 'ms'); } } } */ // End of performance profiling functions debian/contrib/websvg/src/svg.htc0000644000000000000000000002042512252640275014221 0ustar debian/contrib/player/0002755000000000000000000000000012252640275012131 5ustar debian/contrib/player/classes/0002755000000000000000000000000012252640275013566 5ustar debian/contrib/player/classes/Progress.as0000644000000000000000000000303112252640275015712 0ustar import mx.utils.Delegate; class Progress extends MovieClip { public var bar_mc:MovieClip; public var track_mc:MovieClip; public var border_mc:MovieClip; private var _movingHead:Boolean; private var _maxPos:Number; public var addListener:Function; public var removeListener:Function; private var broadcastMessage:Function; /** * Constructor */ function Progress() { AsBroadcaster.initialize(this); this.bar_mc._width = 0; _movingHead = false; this.track_mc.onPress = Delegate.create(this, function() { this._movingHead = true; this._moveProgressBar(); }); this.track_mc.onMouseMove = Delegate.create(this, function() { if(this._movingHead) this._moveProgressBar(); }); this.track_mc.onRelease = this.track_mc.onReleaseOutside = Delegate.create(this, function() { this.broadcastMessage("onMoveHead", this.bar_mc._width / this.track_mc._width); this._movingHead = false; }); } public function updateProgress(played:Number):Void { if(!_movingHead) bar_mc._width = Math.round(played * track_mc._width); } public function setMaxValue(maxValue:Number):Void { _maxPos = maxValue * this.track_mc._width; } public function resize(newWidth:Number):Void { this.track_mc._width = newWidth - 2; this.border_mc._width = newWidth; } private function _moveProgressBar():Void { var newPos:Number = this._xmouse - 1; if(newPos < 0) newPos = 0; else if(newPos > _maxPos) newPos = _maxPos; this.bar_mc._width = newPos; } }debian/contrib/player/classes/Volume.as0000644000000000000000000000704412252640275015365 0ustar import mx.utils.Delegate; class Volume extends MovieClip { public var icon_mc:MovieClip; public var control_mc:MovieClip; public var background_mc:MovieClip; public var button_mc:MovieClip; public var realWidth:Number; private var _settingVolume:Boolean; private var _initialMaskPos:Number; public var addListener:Function; public var removeListener:Function; private var broadcastMessage:Function; private var _clearID:Number; private var _rtl:Boolean = false; /** * Constructor */ function Volume() { AsBroadcaster.initialize(this); control_mc._alpha = 0; this.button_mc._visible = false; icon_mc._alpha = 100; _settingVolume = false; _initialMaskPos = this.control_mc.mask_mc._x; this.realWidth = this.background_mc._width; this.button_mc.onPress = Delegate.create(this, function() { this._settingVolume = true; this._moveVolumeBar(); }); this.button_mc.onMouseMove = Delegate.create(this, function() { if(this._settingVolume) { this._moveVolumeBar(); this.broadcastMessage("onSetVolume", this._getValue(), false); } }); this.button_mc.onRelease = this.button_mc.onReleaseOutside = Delegate.create(this, function() { this._settingVolume = false; this._moveVolumeBar(); this.broadcastMessage("onSetVolume", this._getValue(), true); }); } /** * Updates volume */ public function update(volume:Number):Void { if(!_settingVolume) this.control_mc.mask_mc._x = _initialMaskPos + Math.round(this.control_mc.track_mc._width * volume / 100); } private function _moveVolumeBar():Void { if(this.control_mc.track_mc._xmouse > this.control_mc.track_mc._width) this.control_mc.mask_mc._x = _initialMaskPos + this.control_mc.track_mc._width; else if(this.control_mc.track_mc._xmouse < 0) this.control_mc.mask_mc._x = _initialMaskPos; else this.control_mc.mask_mc._x = _initialMaskPos + this.control_mc.track_mc._xmouse; } /** * Returns the current position of the volume slider as a percentage * @return number between 0 and 100 */ private function _getValue():Number { return Math.round((this.control_mc.mask_mc._x - _initialMaskPos) / this.control_mc.track_mc._width * 100); } public function toggleControl(toggle:Boolean, immediate:Boolean):Void { clearInterval(_clearID); if(toggle) _clearID = setInterval(this, "_animate", 41, 100, 0, _rtl ? 11 : 6); else _clearID = setInterval(this, "_animate", 41, 0, 100, _rtl ? 21 : 16); } private function _animate(targetControl:Number, targetIcon:Number, targetIconX:Number):Void { var dAlphaControl:Number = targetControl - control_mc._alpha; var dAlphaIcon:Number = targetIcon - icon_mc._alpha; var dAlphaIconX:Number = targetIconX - icon_mc._x; var speed:Number = 0.3; dAlphaControl = dAlphaControl * speed; dAlphaIcon = dAlphaIcon * speed; dAlphaIconX = dAlphaIconX * speed; // Stop animation when we are at less than a pixel from the target if(Math.abs(dAlphaControl) < 1) { // Position the control element to the exact target position control_mc._alpha = targetControl; icon_mc._alpha = targetIcon; icon_mc._x = targetIconX; button_mc._visible = (control_mc._alpha == 100); clearInterval(_clearID); return; } control_mc._alpha += dAlphaControl; icon_mc._alpha += dAlphaIcon; icon_mc._x += dAlphaIconX; } public function flip():Void { _rtl = true; this.background_mc._rotation = 180; this.background_mc._y = this.background_mc._height; this.background_mc._x = this.background_mc._width; this.control_mc._x += 2; this.icon_mc._x += 2; } }debian/contrib/player/classes/Display.as0000644000000000000000000000626512252640275015527 0ustar import mx.utils.Delegate; class Display extends MovieClip { public var message_txt:TextField; public var time_txt:TextField; private var _ticker:Ticker; private var _messages:Array; private var _currentSlot:Number; private var _newWidth:Number; /** * Constructor */ function Display() { // Initialise message storage _messages = new Array(); _currentSlot = 0; // Initialise and start ticker _ticker = new Ticker(this.message_txt); _ticker.start(); } /** * Load the next message in the queue */ private function next():Void { _currentSlot = (++_currentSlot == _messages.length) ? 0 : _currentSlot; _update(); } /** * Sets the text in the given message slot * @param text the message * @param slot the slot to store it in (integer 0-n) */ public function setText(text:String, slot:Number, forceDisplay:Boolean):Void { if(forceDisplay == undefined) forceDisplay = false; var update:Boolean = false; if(_currentSlot == slot && _messages[slot] != text) update = true; if(forceDisplay && _messages[slot] != text) { _currentSlot = slot; update = true; } _messages[slot] = text; // Only update display if currently viewing the updated slot and it has changed if(update) _update(); } /** * Sets the time display * @param ms the time to display in milliseconds */ public function setTime(ms:Number, isRemaining:Boolean) { var timeDisplay:String = (isRemaining && ms > 0)?"-":""; this.time_txt.text = timeDisplay + _formatTime(ms); this.resize(); } /** * Clears all messages */ public function clear():Void { _messages = new Array(); _currentSlot = 0; this.message_txt.text = ""; this.time_txt.text = ""; _ticker.reset(); } /** * Resizes display * @param newWidth the new display width */ public function resize(newWidth:Number):Void { if(newWidth != undefined) _newWidth = newWidth; var newMessageWidth = _newWidth; newMessageWidth -= ((this.time_txt.text.length > 5) ? 50: 38); this.message_txt._width = newMessageWidth; this.time_txt._x = _newWidth - this.time_txt._width + 1; } /** * Updates the display and resets the ticker */ private function _update():Void { this.message_txt.text = _messages[_currentSlot]; _ticker.reset(); } private function _formatTime(ms:Number):String { var trkTimeInfo:Date = new Date(); var seconds:Number, minutes:Number, hours:Number; var result:String; // Populate a date object (to convert from ms to hours/minutes/seconds) trkTimeInfo.setSeconds(int(ms/1000)); trkTimeInfo.setMinutes(int((ms/1000)/60)); trkTimeInfo.setHours(int(((ms/1000)/60)/60)); // Get the values from date object seconds = trkTimeInfo.getSeconds(); minutes = trkTimeInfo.getMinutes(); hours = trkTimeInfo.getHours(); // Build position string result = seconds.toString(); if(seconds < 10) result = "0" + result; result = ":" + result; result = minutes.toString() + result; if(hours > 0) { if(minutes < 10) result = "0" + result; result = ":" + result; result = hours.toString() + result; } return result; } }debian/contrib/player/classes/net/0002755000000000000000000000000012252640275014354 5ustar debian/contrib/player/classes/net/onepixelout/0002755000000000000000000000000012252640275016727 5ustar debian/contrib/player/classes/net/onepixelout/audio/0002755000000000000000000000000012252640275020030 5ustar debian/contrib/player/classes/net/onepixelout/audio/Player.as0000644000000000000000000002512412252640275021613 0ustar import net.onepixelout.audio.*; import mx.utils.Delegate; /** * The definitive AS2 mp3 player from 1 Pixel Out * @author Martin Laine */ class net.onepixelout.audio.Player { private var _playlist:Playlist; // Current loaded playlist private var _playhead:Sound; // The player head private var _volume:Number; // For fading volume when pausing private var _fadeVolume:Number; private var _fadeClearID:Number; // State private var _state:Number; // State constants static public var NOTFOUND:Number = -1; static public var STOPPED:Number = 1; static public var PAUSED:Number = 2; static public var PLAYING:Number = 3; private var _isBuffering:Boolean; private var _isConnecting:Boolean; private var _duration:Number; // Current track duration (in ms) private var _position:Number; // Current track position (in ms) private var _loaded:Number; // Percentage of track loaded (0 to 1) private var _played:Number; // Percentage of track played (0 to 1) private var _recordedPosition:Number; // When paused, play head position is stored here private var _startPlaying:Boolean; // Buffering detection variables private var _playCounter:Number; private var _lastPosition:Number; private var _clearID:Number; // In case we need to stop the periodical function private var _delayID:Number; // For calling a method with a delay private var broadcastMessage:Function; public var addListener:Function; public var removeListener:Function; // Options structure private var _options:Object = { playerID:"", initialVolume:60, enableCycling:true, syncVolumes:true, checkPolicy:false, bufferTime:5 }; /** * Constructor * @param options these get written to the internal _options structure */ function Player(options:Object) { AsBroadcaster.initialize(this); // Write options to internal options structure if(options != undefined) _setOptions(options); // Initialise properties _volume = _options.initialVolume; _state = STOPPED; _reset(); // Run watcher every 10ms _clearID = setInterval(this, "_watch", 50); } /** * Writes options object to internal options struct * @param options */ private function _setOptions(options:Object):Void { for(var key:String in options) _options[key] = options[key]; } /** * Resets player */ private function _reset():Void { _duration = 0; _position = 0; _loaded = 0; _played = 0; _isBuffering = false; _isConnecting = false; _recordedPosition = 0; _startPlaying = false; _lastPosition = 0; _playCounter = 0; } /** * Starts the player */ public function play(trackIndex:Number, broadcast:Boolean):Void { // If already playing, do nothing if(_state == PLAYING && _playlist.getCurrentIndex() == trackIndex) return; if(broadcast == undefined) broadcast = true; // Tell anyone interested that the player has stopped if(broadcast) broadcastMessage("onPlay"); if (_playlist.length > 1 && trackIndex != undefined && _playlist.getCurrentIndex() != trackIndex) { this.stop(false); var currentTrack:Track = _playlist.getAtPosition(trackIndex); } else { var currentTrack:Track = _playlist.getCurrent(); } // Load current track and get reference to the sound object _playhead = currentTrack.load(_options.checkPolicy); _setBufferTime(_recordedPosition); // Setup onSoundComplete event if(_playhead.onSoundComplete == undefined) _playhead.onSoundComplete = Delegate.create(this, next); if(_state == STOPPED) _isConnecting = true; _state = PLAYING; this.setVolume(); _playhead.start(Math.floor(_recordedPosition / 1000)); // Update stats now (don't wait for watcher to kick in) _updateStats(); } /** * Pauses the player */ public function pause():Void { // Pause button is also play button when player is paused if(_state == PAUSED) { this.play(); return; } // If player isn't playing, do nothing if(_state < PLAYING) return; // Start a fade out _fadeVolume = _volume; _fadeClearID = setInterval(this, "_fadeOut", 50); _state = PAUSED; } /** * Stops the player (also pauses download) */ public function stop(broadcast:Boolean):Void { if(broadcast == undefined) broadcast = true; // Tell anyone interested that the player has stopped if(broadcast) broadcastMessage("onStop"); // Stop playhead and unload track (stops download); _playhead.stop(); this.getCurrentTrack().unLoad(); _playhead = null; _state = STOPPED; _reset(); } /** * Moves player head to a new position * @param newPosition a number between 0 and 1 */ public function moveHead(newHeadPosition:Number):Void { // Ignore if player is not playing or paused if(_state < PAUSED) return; var newPosition:Number = _duration * newHeadPosition; // Player in paused state: simply record the new position if(_state == PAUSED) _recordedPosition = newPosition; else { // Otherwise, stop player, calculate new buffer time and restart player _playhead.stop(); _setBufferTime(newPosition); _playhead.start(Math.floor(newPosition / 1000)); } // Update stats now (don't wait for watcher to kick in) _updateStats(); } /** * Moves to next track in playlist * If player is playing, start the track */ public function next():Void { var startPlaying:Boolean = (_state == PLAYING || _state == NOTFOUND); if(_playlist.next() != null && startPlaying) { this.stop(false); this.play(); } else this.stop(true); } /** * Moves to previous track in playlist * If player is playing, start the track */ public function previous():Void { var startPlaying:Boolean = (_state == PLAYING); if(_playlist.previous() != null && startPlaying) { this.stop(false); this.play(); } else this.stop(false); } /** * Sets the player volume * @param newVolume number between 0 and 100 * @param broadcast if true, a setvolume message is broadcast to any other players to synchronise volumes */ public function setVolume(newVolume:Number, broadcast:Boolean):Void { clearInterval(_delayID); //if(broadcast == undefined) broadcast = false; // If we have a new value for volume, set it if(newVolume != undefined) _volume = newVolume; // Set the player volume if(_state > STOPPED) _playhead.setVolume(_volume); } /** * Returns a snapshot of the current state of the player * @return a structure of values describing the current state */ public function getState():Object { var result:Object = new Object(); result.state = _state; result.buffering = _isBuffering; result.connecting = _isConnecting; result.loaded = _loaded; result.played = _played; result.duration = _duration; result.position = _position; result.volume = _volume; result.trackIndex = _playlist.getCurrentIndex(); result.hasNext = _playlist.hasNext(); result.hasPrevious = _playlist.hasPrevious(); result.trackCount = _playlist.length; result.trackInfo = this.getCurrentTrack().getInfo(); return result; } /** * Fades player out */ private function _fadeOut():Void { _fadeVolume -= 20; if(_fadeVolume <= 20) { clearInterval(_fadeClearID); _recordedPosition = _playhead.position; _playhead.stop(); } else _playhead.setVolume(_fadeVolume); } /** * Updates playhead statistics (loaded, played, duration and position) * Also triggers track information update (when ID3 is available) */ private function _updateStats():Void { if(_state > STOPPED && _playhead.getBytesTotal() > 0) { // Flash has started downloading the file _isConnecting = false; // Get current track var currentTrack:Track = this.getCurrentTrack(); // If current track is fully loaded, no need to calculate loaded and duration if(currentTrack.isFullyLoaded()) { _loaded = 1; _duration = _playhead.duration; } else { _loaded = _playhead.getBytesLoaded() / _playhead.getBytesTotal(); // Get real duration because the sound is fully loaded if(_loaded == 1) _duration = _playhead.duration; // Get duration from ID3 tag else if(_playhead.id3.TLEN != undefined) _duration = parseInt(_playhead.id3.TLEN); // This is an estimate else _duration = (1 / _loaded) * _playhead.duration; } // Update position and played values if playhead is reading if(_playhead.position > 0) { _position = _playhead.position; _played = _position / _duration; } // Update track info if ID3 tags are available if(!currentTrack.isID3Loaded() && _playhead.id3.songname.length > 0) { currentTrack.setInfo(); broadcastMessage("onMetaData"); } } } /** * Watches player state. This method is run periodically (see constructor) */ private function _watch():Void { // Get current track var currentTrack:Track = this.getCurrentTrack(); // If the mp3 file doesn't exit if(_state > NOTFOUND && !currentTrack.exists()) { // Reset player _reset(); _state = NOTFOUND; return; } // Update statistics _updateStats(); // Buffering detection if(_state == PLAYING) { if(++_playCounter == 2) { _playCounter = 0; _isBuffering = (_position == _lastPosition); _lastPosition = _position; } } } public function isBuffering():Boolean { return _isBuffering; } public function isConnecting():Boolean { return _isConnecting; } /** * Sets the buffer time to a maximum of 5 seconds (or whatever the bufferTime option is set to). * * @param newPosition Position of playhead */ private function _setBufferTime(newPosition:Number):Void { // No buffering needed if file is fully loaded if(this.getCurrentTrack().isFullyLoaded()) { _root._soundbuftime = 0; return; } // Otherwise, look at how much audio is playable and set buffer accordingly var currentBuffer:Number = Math.round(((_loaded * _duration) - newPosition) / 1000); if(currentBuffer >= _options.bufferTime) _root._soundbuftime = 0; else _root._soundbuftime = _options.bufferTime - currentBuffer; } /** * Loads a list of mp3 files onto a playlist * @param trackFileList */ public function loadPlaylist(trackFileList:String, titleList:String, artistList:String):Void { //if(titleList == undefined) titleList = ""; //if(artistList == undefined) artistList = ""; _playlist = new Playlist(_options.enableCycling); _playlist.loadFromList(trackFileList, titleList, artistList); _reset(); } /** * Returns the number of tracks in the playlist * @return the number of tracks */ public function getTrackCount():Number { return _playlist.length; } /** * Returns current track from the playlist * @return the current track object */ public function getCurrentTrack():Track { return _playlist.getCurrent(); } }debian/contrib/player/classes/net/onepixelout/audio/Playlist.as0000644000000000000000000000576012252640275022164 0ustar import net.onepixelout.audio.Track; class net.onepixelout.audio.Playlist { private var _tracks:Array; private var _currentTrackIndex:Number; public var length:Number; static private var _cyclingEnabled:Boolean = true; public function Playlist(enableCycling:Boolean) { _tracks = new Array(); _currentTrackIndex = 0; this.length = 0; if(enableCycling != undefined) _cyclingEnabled = enableCycling; } public function loadFromList(trackList:String, titleList:String, artistList:String):Void { var trackArray:Array = trackList.split(","); if(titleList == undefined) titleList = ""; if(artistList == undefined) artistList = ""; var titleArray:Array = (titleList.length == 0) ? new Array() : titleList.split(","); var artistArray:Array = (artistList.length == 0) ? new Array() : artistList.split(","); var newTrack:Track; for(var i:Number = 0;i < trackArray.length;i++) { newTrack = new Track(trackArray[i]); if(i < titleArray.length) { newTrack.setTitle(titleArray[i]); //newTrack.setArtist(""); } if(i < artistArray.length) newTrack.setArtist(artistArray[i]); this.addTrack(newTrack); } } public function loadFromXML(listXML:XML):Void { var tracks:Array = listXML.firstChild.childNodes; for(var i:Number = 0;i < tracks.length;i++) { addTrack(new Track(_getNodeValue(tracks[i], "src"), _getNodeValue(tracks[i], "title"), _getNodeValue(tracks[i], "artist"))); } } private function _getNodeValue(root:XMLNode, nodeName:String):String { nodeName = nodeName.toLowerCase(); for(var i:Number = 0;root.childNodes.length;i++) { if(root.childNodes[i].nodeName.toLowerCase() == nodeName) { return root.childNodes[i].firstChild.nodeValue; } } return null; } public function getCurrent():Track { return _tracks[_currentTrackIndex]; } public function getCurrentIndex():Number { return _currentTrackIndex; } public function hasNext():Boolean { return (_currentTrackIndex < length-1); } public function next():Track { if(this.hasNext()) return _tracks[++_currentTrackIndex]; else if(_cyclingEnabled) { _currentTrackIndex = 0; return _tracks[0]; } else return null; } public function hasPrevious():Boolean { return (_currentTrackIndex > 0); } public function previous():Track { if(this.hasPrevious()) return _tracks[--_currentTrackIndex]; else if(_cyclingEnabled) { _currentTrackIndex = length-1; return _tracks[_currentTrackIndex]; } else return null; } public function getAtPosition(position:Number):Track { if(position >= 0 && position < length) { _currentTrackIndex = position; return _tracks[position]; } else return null; } public function addTrack(track:Track):Void { _tracks.push(track); length = _tracks.length; } public function removeAt(position:Number):Void { _tracks.splice(position, 1); length = _tracks.length; } }debian/contrib/player/classes/net/onepixelout/audio/Track.as0000644000000000000000000000447612252640275021432 0ustar import mx.utils.Delegate; /** * Track object. Apart from containing song information such as * title, artist etc, it contains the actual Sound object so we * don't load a track twice. */ class net.onepixelout.audio.Track { private var _src:String; // URL to mp3 file private var _soundObject:Sound; // Sound object used to load sound private var _isLoaded:Boolean; // TRUE = file is loaded into soundObject private var _isFullyLoaded:Boolean; // TRUE = file is fully loaded into soundObject private var _notFound:Boolean; // TRUE = file doesn't exist private var _id3Loaded:Boolean; // TRUE = ID3 tags already loaded private var _id3Tags:Object; // All ID3 tag information (direct link to ID3 structure of sound object) function Track(src:String, title:String, artist:String) { _soundObject = new Sound(); _src = src; _isLoaded = false; _isFullyLoaded = false; _id3Loaded = false; _notFound = false; _id3Tags = {}; _id3Tags.location = _src; _id3Tags.title = title; _id3Tags.artist = artist; } public function setTitle(title:String):Void { _id3Tags.title = title; } public function setArtist(artist:String):Void { _id3Tags.artist = artist; } public function load(checkPolicy:Boolean):Sound { if(!_isLoaded) { _soundObject.onLoad = Delegate.create(this, function(success) { this._notFound = !success; this._isFullyLoaded = success; }); _soundObject.checkPolicyFile = checkPolicy; _soundObject.loadSound(_src, true); this._isLoaded = true; } return _soundObject; } /** * Deletes sound object if not fully loaded (stops download) */ public function unLoad():Void { if(!_isFullyLoaded) { delete _soundObject; _isLoaded = false; _soundObject = new Sound(); } } public function isFullyLoaded():Boolean { return _isFullyLoaded; } public function isLoaded():Boolean { return _isLoaded; } public function exists():Boolean { return !_notFound; } public function isID3Loaded():Boolean { return _id3Loaded; } public function setInfo():Void { _id3Tags.album = _soundObject.id3.album; if (_id3Tags.title == undefined) _id3Tags.title = _soundObject.id3.songname; if (_id3Tags.artist == undefined) _id3Tags.artist = _soundObject.id3.artist; _id3Loaded = true; } public function getInfo():Object { return _id3Tags; } }debian/contrib/player/classes/Ticker.as0000644000000000000000000000271512252640275015337 0ustar class Ticker { private var _textField:TextField; private var _clearID:Number; private var _direction:String; private var _options:Object; function Ticker(textField:TextField, options:Object) { _direction = "fw"; _textField = textField; _clearID = null; _options = { pause:6000, interval:25, increment:1 }; if(typeof options == "Object") this.setOptions(options); } public function setOptions(options:Object):Void { for(var key:String in options) _options[key] = options[key]; } public function start():Void { _clearID = setInterval(this, "_start", _options.pause); } public function reset():Void { clearInterval(_clearID); _textField.hscroll = 0; start(); } private function _start():Void { if(_textField.maxhscroll == 0) return; clearInterval(_clearID); _clearID = setInterval(this, "_scroll", _options.interval); } private function _scroll():Void { if(_direction == "fw" && _textField.hscroll == _textField.maxhscroll) { _direction = "bw"; clearInterval(_clearID); _clearID = setInterval(this, "_start", _options.pause); return; } else if(_direction == "bw" && _textField.hscroll == 0) { _direction = "fw"; clearInterval(_clearID); _clearID = setInterval(this, "_start", _options.pause); return; } if(_direction == "fw" ) _textField.hscroll += _options.increment; else _textField.hscroll -= _options.increment; } }debian/contrib/player/classes/Control.as0000644000000000000000000000376112252640275015540 0ustar class Control extends MovieClip { public var play_mc:MovieClip; public var pause_mc:MovieClip; public var background_mc:MovieClip; public var initialState:String; public var realWidth:Number; public var state:String; public var addListener:Function; public var removeListener:Function; private var broadcastMessage:Function; /** * Constructor */ function Control() { AsBroadcaster.initialize(this); if(this.state == "play") this.pause_mc._visible = false; else this.play_mc._visible = false; this.realWidth = this.background_mc._width; background_mc.hover_mc._visible = play_mc.hover_mc._visible = pause_mc.hover_mc._visible = false; } function onRollOver() { _switch(true); } function onRollOut() { _switch(false); } function onReleaseOutside() { _switch(false); } function onRelease() { this.toggle(true); } private function _switch(toggle:Boolean):Void { if(this.state == "play") this.play_mc.hover_mc._visible = toggle; if(this.state == "pause") this.pause_mc.hover_mc._visible = toggle; this.background_mc.hover_mc._visible = toggle; } public function toggle(broadcast:Boolean):Void { if(broadcast == undefined) broadcast = false; if(this.state == "play") { if(broadcast) broadcastMessage("onPlay"); this.play_mc._visible = false; this.play_mc.hover_mc._visible = false; this.pause_mc._visible = true; this.state = "pause"; } else { if(broadcast) broadcastMessage("onPause"); this.pause_mc._visible = false; this.pause_mc.hover_mc._visible = false; this.play_mc._visible = true; this.state = "play"; } } public function flip():Void { this.background_mc._rotation = 180; this.background_mc._y = this.background_mc._height; this.background_mc._x = this.background_mc._width; //this.play_mc._rotation = 180; //this.play_mc._y += this.play_mc._height; this.play_mc._x = 14; this.pause_mc._x = 13; } }debian/contrib/player/classes/Loading.as0000644000000000000000000000076112252640275015472 0ustar class Loading extends MovieClip { public var bar_mc:MovieClip; public var track_mc:MovieClip; /** * Constructor */ function Loading() { this.bar_mc._width = 0; } public function update(loaded:Number):Void { this.bar_mc._width = Math.round(loaded * this.track_mc._width); } public function resize(newWidth:Number):Void { var change:Number = newWidth / this.track_mc._width; this.track_mc._width = newWidth; this.bar_mc._width *= change; } }debian/contrib/player/classes/Application.as0000644000000000000000000005231712252640275016364 0ustar import net.onepixelout.audio.*; import flash.external.ExternalInterface; class Application { // Audio Player private static var _player:Player; // UI Elements private static var masked_mc:MovieClip; private static var background_mc:MovieClip; private static var progress_mc:MovieClip; private static var loading_mc:MovieClip; private static var next_mc:MovieClip; private static var previous_mc:MovieClip; private static var mask_mc:MovieClip; private static var display_mc:MovieClip; private static var control_mc:MovieClip; private static var volume_mc:MovieClip; // State variables private static var _state:Number; private static var CLOSED:Number = 0; private static var CLOSING:Number = 1; private static var OPENING:Number = 2; private static var OPEN:Number = 3; // Interval ID for animation private static var _clearID:Number; // List of color keys private static var _colorKeys:Array = ["bg","leftbg","lefticon","voltrack","volslider","rightbg","rightbghover","righticon","righticonhover","text","track","border","loader","tracker","skip"]; // Holds the current colour scheme (initialise with default colour scheme) private static var _colorScheme:Object = { bg:0xE5E5E5, leftbg:0xCCCCCC, lefticon:0x333333, voltrack:0xF2F2F2, volslider:0x666666, rightbg:0xB4B4B4, rightbghover:0x999999, righticon:0x333333, righticonhover:0xFFFFFF, skip:0x666666, text:0x333333, track:0xFFFFFF, border:0xCCCCCC, loader:0x009900, tracker:0xDDDDDD }; // Options structure private static var _options:Object = { playerID:"", encode:false, autostart:false, loop:false, animation:true, remaining:false, noinfo:false, killdownload:false, checkpolicy:false, demomode:false, bufferTime:5, volume:60, rtl:false }; // A list for javascript listeners private static var listeners:Array = []; /** * Starts app * @param sourceFile a list of mp3 files to play * @param options a structure of options */ public static function start(sourceFile:String, options:Object):Void { if(options != undefined) _setOptions(options); trace(_options.playerID); if(!_options.demomode && _options.encode) sourceFile = _sixBitDecode(sourceFile); if(!_options.demomode) { var playerParams:Object = new Object(); playerParams.initialVolume = _options.volume; playerParams.bufferTime = _options.bufferTime; playerParams.enableCycling = _options.loop; playerParams.playerID = _options.playerID; playerParams.checkPolicy = _options.checkpolicy; // Create audio player instance and load playlist _player = new Player(playerParams); var trackTitles:String = (_options.titles != undefined) ? _options.titles : ""; var trackArtists:String = (_options.artists != undefined) ? _options.artists : ""; _player.loadPlaylist(sourceFile, trackTitles, trackArtists); if(!_options.demomode) _player.addListener(Application); } // Initial player state _state = CLOSED; if(_options.demomode || !_options.animation || _options.autostart) _state = OPEN; _setStage(); _setColors(true); if (ExternalInterface.available) { ExternalInterface.addCallback("load", Application, Application.ei_loadFile); ExternalInterface.addCallback("close", Application, Application.ei_closePlayer); ExternalInterface.addCallback("open", Application, Application.ei_openPlayer); ExternalInterface.addCallback("setVolume", Application, Application.ei_setVolume); //add event listeners for js ExternalInterface.addCallback("addListener", Application, Application.addJSListener); ExternalInterface.addCallback("removeListener", Application, Application.removeJSListener); // Ask any other existing players for the current volume var newVolume:Number = Number(ExternalInterface.call("AudioPlayer.getVolume", _options.playerID)); if (newVolume > -1) { _player.setVolume(newVolume, true); } } // Start player automatically if requested if(!_options.demomode && _options.autostart) onPlay(); setInterval(_update, 100); // Notification that the app has loaded//started if (ExternalInterface.available) { ExternalInterface.call("onWPPlayerReady", _options.playerID); } } /** * Writes options object to internal options struct * @param options */ private static function _setOptions(options:Object):Void { for(var key:String in options) _options[key] = options[key]; _options.playerID = _sanitize(_options.playerID); } /** * Initial stage setup * Adds elements to stage and links up various listeners */ private static function _setStage():Void { // Align UI to left and make sure it isn't scaled Stage.align = "L"; Stage.scaleMode = "noScale"; // Add elements to stage // Depth counter var nextDepth:Number = _root.getNextHighestDepth(); // Masked elements masked_mc = _root.createEmptyMovieClip("masked_mc", nextDepth++); background_mc = masked_mc.attachMovie("Background", "background_mc", 0); progress_mc = masked_mc.attachMovie("Progress", "progress_mc", 1); progress_mc.addListener(Application); loading_mc = masked_mc.attachMovie("Loading", "loading_mc", 2); // Next and previous buttons (if needed) if(_options.demomode || _player.getTrackCount() > 1) { next_mc = masked_mc.attachMovie("Toggle", "next_mc", 3); previous_mc = masked_mc.attachMovie("Toggle", "previous_mc", 4); // Make it point the other way previous_mc._rotation = -180; if(!_options.demomode) { // Add event handlers next_mc.onRelease = function() { Application._player.next(); // Reset time display Application.display_mc.setTime(0); }; previous_mc.onRelease = function() { Application._player.previous(); // Reset time display Application.display_mc.setTime(0); }; } } // Mask mask_mc = _root.attachMovie("Mask", "mask_mc", nextDepth++); masked_mc.setMask(mask_mc); mask_mc._width = 8; // Text display display_mc = _root.attachMovie("Display", "display_mc", nextDepth++); if(_state == CLOSED) display_mc._visible = false; // Volume control volume_mc = _root.attachMovie("Volume", "volume_mc", nextDepth++); volume_mc.addListener(Application); // Play/pause control control_mc = _root.attachMovie("Control", "control_mc", nextDepth++, { state:_options.autostart ? "pause" : "play" }); control_mc.addListener(Application); // Align and resize elements to the stage _alignAndResize(); if(_options.demomode) { control_mc.toggle(); volume_mc.toggleControl(true); volume_mc.update(_options.volume); progress_mc.updateProgress(0.3); loading_mc.update(0.6); display_mc.setText("1 Pixel Out: Demo Mode", 0, true); display_mc.setTime(356560, _options.remaining); previous_mc._alpha = 50; } // Set stage listener in case the stage is resized Stage.addListener(Application); } /** * Positions and resizes elements on the stage */ private static function _alignAndResize():Void { // ------------------------------------------------------------ // Align elements background_mc._x = volume_mc.realWidth - 7; var trackCount = _player.getTrackCount(); progress_mc._x = volume_mc.realWidth + 4; if(_options.demomode || trackCount > 1) progress_mc._x += 8; progress_mc._y = 2; loading_mc._x = volume_mc.realWidth + 4; if(_options.demomode || trackCount > 1) loading_mc._x += 8; loading_mc._y = 20; if(_options.demomode || trackCount > 1) { next_mc._x = Stage.width - 43; next_mc._y = 12; previous_mc._x = volume_mc.realWidth + 6; previous_mc._y = 12; } mask_mc._x = volume_mc.realWidth - 7; display_mc._x = volume_mc.realWidth + 6; if(_options.demomode || trackCount > 1) display_mc._x += 8; display_mc._y = 2; // Control element alignment depends on whether player is open or closed if(_state == CLOSED) control_mc._x = volume_mc.realWidth - 6; else control_mc._x = Stage.width - control_mc.realWidth; // RTL if(_options.rtl) { control_mc.flip(); volume_mc.flip(); volume_mc._x = Stage.width - volume_mc.realWidth; background_mc._x = control_mc.realWidth - 7; progress_mc._x = control_mc.realWidth + 4; if(_options.demomode || trackCount > 1) progress_mc._x += 4; progress_mc._y = 2; loading_mc._x = control_mc.realWidth + 4; if(_options.demomode || trackCount > 1) loading_mc._x += 4; loading_mc._y = 20; if(_options.demomode || trackCount > 1) { next_mc._x = Stage.width - 52; next_mc._y = 12; previous_mc._x = control_mc.realWidth + 2; previous_mc._y = 12; } mask_mc._rotation = 180; mask_mc._y = mask_mc._height; mask_mc._x = volume_mc._x + 7; display_mc._x = control_mc.realWidth + 6; if(_options.demomode || trackCount > 1) display_mc._x += 4; display_mc._y = 2; // Control element alignment depends on whether player is open or closed if(_state == CLOSED) control_mc._x = volume_mc._x - control_mc.realWidth + 6; else control_mc._x = 0; } // ------------------------------------------------------------ // Resize elements // Available space between volume and control elements var availSpace:Number = Stage.width - (control_mc.realWidth + volume_mc.realWidth); background_mc._width = availSpace + 14; // Only resize mask if player is open if(_state == OPEN) mask_mc._width = availSpace + 14; if(_options.demomode || trackCount > 1) availSpace -= 12; // Call resize methods on composite elements progress_mc.resize(availSpace - 8); loading_mc.resize(availSpace - 8); display_mc.resize(availSpace - 12); } /** * Applies colour scheme to player * @param force if true, don't check _root.setcolors */ private static function _setColors(force:Boolean):Void { var i:Number; var colorValue:String; if (!force && !_root.setcolors) { return; } // Update colour scheme from root variables (set via javascript) for (i = 0;i < _colorKeys.length;i++) { if (_root[_colorKeys[i]] != undefined) { // Handle missing '0x' prefixes colorValue = _root[_colorKeys[i]]; if (colorValue.indexOf("0x") == -1) { colorValue = "0x" + colorValue; } _colorScheme[_colorKeys[i]] = colorValue; } } _root.setcolors = 0; // Map colours to player elements var colorTransforms:Array = [ { target:background_mc, color:_colorScheme.bg }, { target:volume_mc.background_mc, color:_colorScheme.leftbg }, { target:volume_mc.icon_mc, color:_colorScheme.lefticon }, { target:volume_mc.control_mc.track_mc, color:_colorScheme.voltrack }, { target:volume_mc.control_mc.bar_mc, color:_colorScheme.volslider }, { target:control_mc.background_mc.normal_mc, color:_colorScheme.rightbg }, { target:control_mc.background_mc.hover_mc, color:_colorScheme.rightbghover }, { target:control_mc.play_mc.normal_mc, color:_colorScheme.righticon }, { target:control_mc.play_mc.hover_mc, color:_colorScheme.righticonhover }, { target:control_mc.pause_mc.normal_mc, color:_colorScheme.righticon }, { target:control_mc.pause_mc.hover_mc, color:_colorScheme.righticonhover }, { target:loading_mc.bar_mc, color:_colorScheme.loader }, { target:loading_mc.track_mc, color:_colorScheme.track }, { target:progress_mc.track_mc, color:_colorScheme.track }, { target:progress_mc.bar_mc, color:_colorScheme.tracker }, { target:progress_mc.border_mc, color:_colorScheme.border }, { target:next_mc, color:_colorScheme.skip }, { target:previous_mc, color:_colorScheme.skip }, { target:display_mc.message_txt, color:_colorScheme.text }, { target:display_mc.time_txt, color:_colorScheme.text } ]; // Apply colours var tempColor:Color; for(i = 0;i CLOSING) closePlayer(); // Hide volume control volume_mc.toggleControl(false); // Toggle play button state (only if it's in pause state) if (control_mc.state == "pause") control_mc.toggle(); // forward any relevent calls to js listeners forward("STOP"); } /** * onPause event handler */ public static function onPause():Void { // Tell any other players to stop playing (don't want no cacophony do we?) if (ExternalInterface.available) { ExternalInterface.call("AudioPlayer.onStop", _options.playerID); } _player.pause(); // Hide volume control volume_mc.toggleControl(false); // If player is open and animation is enabled, close the player if(_state > CLOSING && _options.animation) closePlayer(); // forward any relevent calls to js listeners forward("PAUSE"); } /** * onMoveHead event handler * @param newPositon number form 0 to 1 */ public static function onMoveHead(newPosition:Number):Void { _player.moveHead(newPosition); } /** * onSetVolume event handler */ public static function onSetVolume(volume:Number, final:Boolean):Void { if(final == undefined) final = true; // Set the volume and force a broadcast of the changed volume _player.setVolume(volume, final); // Tell any other players that the volume has changed if (ExternalInterface.available && final) { ExternalInterface.call("AudioPlayer.syncVolumes", _options.playerID, volume); } } /** * onMetaData event handler * called from Player.as by broadcastmessage */ public static function onMetaData():Void { var tempObj:Object = _player.getState(); forward("METADATA", tempObj.trackInfo); } // ------------------------------------------------------------ // Open / close animation /** * Starts open animation */ public static function openPlayer():Void { _state = OPENING; var targetPosition:Number = _options.rtl ? 0 : Stage.width - control_mc.realWidth; if(_clearID != null) clearInterval(_clearID); _clearID = setInterval(_animate, 40, targetPosition); } /** * Starts close animation */ public static function closePlayer():Void { _state = CLOSING; // Hide text display (doesn't work under a mask) display_mc._visible = false; var targetPosition:Number = _options.rtl ? volume_mc._x - control_mc.realWidth + 6 : volume_mc.realWidth - 6; if(_clearID != null) clearInterval(_clearID); _clearID = setInterval(_animate, 40, targetPosition); } /** * Moves control element to the given target position (with easing) * @param targetX target position of control element */ private static function _animate(targetX:Number):Void { var dx:Number = targetX - control_mc._x; var speed:Number = 0.5; dx = dx * speed; // Stop animation when we are at less than a pixel from the target if(Math.abs(dx) < 1) { // Position the control element to the exact target position control_mc._x = targetX; if(_options.rtl) mask_mc._width -= (dx*2); else mask_mc._width += (dx*2); clearInterval(_clearID); if(_state == OPENING) { // Show text display display_mc._visible = true; _state = OPEN; } else{ _state = CLOSED; } return; } control_mc._x += dx; if(_options.rtl) mask_mc._width -= dx; else mask_mc._width += dx; } // ------------------------------------------------------------ // Periodical update method /** * General periodical update method. It performs the following: * Updates various UI element states (volume, control, progress bar and loading bar) */ private static function _update():Void { // Set colour scheme at runtime _setColors(false); if(_options.demomode) { return; } // Get player state (head positions, stats etc) var playerState:Object = _player.getState(); // Update volume control state volume_mc.update(playerState.volume); // Enable / disable control button control_mc.enabled = true; // Update progress bar if necessary if(playerState.state != Player.PAUSED) progress_mc.updateProgress(playerState.played); // Tell progress bar how far it can go progress_mc.setMaxValue(playerState.loaded); // Update loading bar state loading_mc.update(playerState.loaded); if(playerState.trackCount > 1) { next_mc.enabled = playerState.hasNext; previous_mc.enabled = playerState.hasPrevious; if(playerState.hasNext) next_mc._alpha = 100; else next_mc._alpha = 50; if(playerState.hasPrevious) previous_mc._alpha = 100; else previous_mc._alpha = 50; } var trackNumber:String = ""; // Update text display switch(playerState.state) { case Player.NOTFOUND: if(playerState.trackCount > 1) trackNumber = (playerState.trackIndex + 1) + " - "; display_mc.setText(trackNumber + "File not found", 0); display_mc.setTime(0); break; default: var message = ""; if(playerState.connecting) message = "Connecting..."; else { if(!_options.noinfo && playerState.trackCount > 1) message = (playerState.trackIndex + 1) + ": "; if(playerState.buffering) message += "Buffering..."; else if(!_options.noinfo) { if(playerState.trackInfo.artist.length > 0 || playerState.trackInfo.title.length > 0) { if(playerState.trackInfo.artist.length > 0) message += playerState.trackInfo.artist + " - "; message += playerState.trackInfo.title; } else message = "Track #" + (playerState.trackIndex + 1); } } display_mc.setText(message, 0, true); display_mc.setTime(_options.remaining ? playerState.duration - playerState.position : playerState.position, _options.remaining); break; } } /** * Decodes a 6-bit encoded string * Thanks to mattiasdh (mattias_d@excite.com) for this * http://modxcms.com/forums/index.php/topic,9340.0.html * @param source the string to decode * @return the decoded string */ private static function _sixBitDecode(sourceStr) { var ntexto = ""; var nntexto = ""; var codeKey = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789_-" var charCode, charChar, charCodeBin, i; for(i=0; i= 97 && ascii <= 122) || "0123456789-_:.".indexOf(char) != -1) { result += char; } } return result; } } debian/contrib/player/Audio Player.flp0000644000000000000000000000236512252640275015116 0ustar  debian/contrib/player/player.fla0000644000000000000000000006111312252640275014111 0ustar PKb:B d player.xflPROXY-CS5PKb:BLIBRARY/PKb:B META-INF/PKb:Bs;DOMDocument.xmlY[o8~@ٗVwڙJi)FꪪV̌#䲿~. M^|>V.hxLqƔ4ɊwY{4~qo-hL]7W7- V /BjqrӄksؑD0zO"_ lUs?k0U%<9LR8 T|R6Z=㼔Mr|&JWU b1ӵzB1ZUBoQi5\Jp$I8*)A\ 8sWnb,;#U#Eg eiV ?gx/HL8Y.Ӂ~^RzX1J <].Ƅ|s>P* )j NӦ2*(s& N0?en/֪ȴ^KU{풢?~NAcyp!(pVY~'B[c7Һ^i@Y#sՏ(E mK3Q\51fW4 o.}{iٽu &O4)ol}h`?kCێo9hE[ӳfm:J5%xNǴWxݶytѱ'Cb# 3 1F]aKƃ䀈4gu'GxBFDôp=ẖgِ!x\, <#3[7×: ޏZ=зV&pJWb~>ܶDbߍD m/MxLH01$L,=۟drہϷEA*6N[CI)CbDrH\4¼5no \ȭ`$; &X`vΨnq`z}$8yt}k5C, pۖ9Ň,N>`^s 0;7\QS>Fh} pNj"1tAm<<ŵSa3B}Bx)|ARkk-ʙfK&7UXmf$E|DIhv{[5ل҃DQ鐬5$+Y(A!iu 5ZS9Nx%=֒ v;6ۺ%YL%6@nֱhILݒ$}Ƴ`W,7;!H({hBG TNб՗1KdGGVh9_J|*^PJ-81$09L%y#PWȒ3R1!s qv8>cQ~UyNr+mvb\5ͳ[{Ц ,?6,ajj~Ip~hR>':a?hرv]da[bblhz%KQٞńOӓ(śŅ7R L#+3 o核#(Μ=zX{fk#~PKb:B^?< META-INF/metadata.xmlXn0)v㄄T,٪iSc j}] s$@VMX/9Η)&w4c: bKhy4"w v4Qe\Z15u(S;KW 8IF&".Pd@tMM74n^Op#,a bdSnA("*RٚPF ̓$='iqEV(fR9F$\"I[悜gNFqd$ ȇ!f3p%!pnt <}l"ڼT(#QGH1d*~Ԁ{F#ZTц֤H`z17lOևt>4sƽ@u/|bN,¹4 .T}oL^ԉ"xr>FkʒyF{+p֜ǻfITv7*2/z9y@4 Gw וjÏס{1qL6NgP-wvh vdGFEݣ| z}bO"`k~Gap{SobRN;s=X}~{+jmR&dzd/pFS^XԷa{?o)9}c6{?w} #Cn.N pɆb{m:Zc}'>Op{l?4o'I$r9DޕH}Gc¹ PKb:BMK`5PublishSettings.xmlYoۼ޿av6i\^ܼSv} JJQvҿ~w|Hi2,>-x<҃EJ]! e꜋ȉѲCsrҹ# s= ZAZDi&4}1I<Jf)6l~4KD׌+?)5+WCFgUfku[{VTǠK!jkr0 ڲ2 Xվ  aG(H#faVvwS}9a_R觰bڃ08+H91Dwߋc~H2)Cћeڣ08D9ՕDO$*7]͞Kat~Q .j1\${nK-D6uwt@Sw!w pzd GD炉jikmys '67w"'>5D[@}hDC6Oͭɽvt)xh+{ܲ\Xlqp.-q jΤ:[5k jh*Rt.kר ؘj lnh, ۠\jI0)O~0RvV 6|3sÙXӼBM\Nf =IjN7hTn e)a9ٽ 1E + ЙVEs~Os<=:gӷN1blY %]ב&&[3Y%%@ܤ'6nCuy3^&ൔϙ<n)`4 `VDܒfdLIPL-#S)(I]3e ՈlS䲎;C-؜Ny};9:IIT>I'*; ei"X!m>$-I~%><&WoA= 2N JZ5L;|}Qrt+B ؉hjNn4 -Ysxᖪ`YSS׬9D&W 0ȘsG퓳:`A17chV ;˚ԓI2%7p5}Dj,(PBK;MGo&j:Q#8yb5qŮ *Vup|4*]O4*ut|uFqn [Fd|M/38J"CA,qZôX?5*YښR">o]`?:B9\8`*G,R>b.%iI׽7?÷27PKb:BMobileSettings.xmlPKb:BLIBRARY/Control elements/PKb:BLIBRARY/Loading elements/PKb:BLIBRARY/Progress elements/PKb:BLIBRARY/Volume elements/PKb:BLIBRARY/Background.xmluTMo0pb TPiw[UZzث&bpd; 6&)!f<όS|iS,[OGzBnPE ydҤ-)ƈVykꕢA]m\ hIC3 Fx6H8kwdC_:gA-tDm5לJdIsN6gfC%՜ d/D镨l*?57HI{o5ڍٚf-_/NNTaۇ-ӯ}J)((7jC%*(ʝҐҐKS)vڊv4ѓ)Ĩ^19-Г[@]0r.ffB-Y7p@`(!qEa8KI:t/'p2^kOum2ufӚ~Z]e)6Wz`f31>ڮqu^MH/EѻRt;][; PKb:BFό 'LIBRARY/Control elements/Background.xmlTˎ0+,w=12YQ4H@Ge*uWfƱ^aVƺ9|WZNdKevVDt掱vl6/tl!7BYU:d(T HtvysD+g$ !,ȓ R"pCDCWI'CCՅI ܮc!a:be7oI*ߴsusL@nw ð?DELS,# F4%WwG؉P 4(`lcVi39J-5> 0HK0u^H'6&wm+gdl%' ao%Rƕʼ.օTO/ɝ8WY;UrEۇN#aiNuOzC~Zig 8.R{Nw]c40JP0\k973AbK2Csʅ#€7|.Xc3Րj]nQG\.X1Zl zaCEs׬x-Y$|,KGݭae 9ej^\ ApZF!Pw0؇\o4J* )\gťXPQ ^rɳ3wJܞ>~WI UҼT#~? 9*Juήݒ>d*o-혏c8{JٽBs*ۓ)VU}o[ PKb:B#O O/LIBRARY/Control elements/Control background.xmlTM0WL옰dmTE=T$X1H# RiyϞן묭6R4utjxwZ:qHE^eUtF:gгFBRXAPӊ%EZI`uzdž[%u7ZV OA#*g.%0@oUmoR>ͻ~bJ踴kY"a fFxk^1kf7fkynB5тL5߬uA.T ifP8ZLx7ȵ|4IKe5.Rj;%CZYx_ɲ3\0R!vD@V4p@NCF 1aD[1B8*fRaƷ~5YUCqwŬl }j.>% 8#j1Xx;:0 xY |ēvϚx;{W;wQ,40pz趭]a9b\c9^PKb:By="LIBRARY/Control elements/Pause.xmlTM0WXy1a +H@WVr¤Xulj; dzkK43o|=ee:䉖39Rٻ18cl۵v6?Xo*@ohluTlI7d(CL'Z9% 9(g/,r,?{iԇQ2_}KՅIa*L-wP[5v^Hϐ5Wܺ^L:Π;a?D~įfkd^M9k!c'rB7#TjMee,3W+JR-5vy4&Jx{ƥUXH##rfUz?j )  r!=cF["Z~iUhmĥL̈́pe3mrVOZ(w #8eCLo)JqPkcaꢐNlePפ:46bGbׯRýϔK#5GQF8I4E0+W#®oxT*,__Q˘B䗈YPKb:BF o)LIBRARY/Control elements/Pause button.xmlTKs0W(90irI34SrU4#@lǤ\}|߮vImqVdž(i kxCv5i=mmACMVz;ANJ\ hqCR[%8JIvRjFx ޷_B y' 1,2ǪN ,*GߍS~&(,ՖLaշ" ج!׳(F[b-ο7lc'Bnn@{A)eYeZUPNPռA+s˔=mI)!Kz*᥿F6`yɤY~mM4y'ߜ3Z>FLXh ec퇶jN#N+;?zVY.Ófb7O2$h=ܜu1{zi X:%}PKb:BZ !LIBRARY/Control elements/Play.xmlT]o0}߯|E  X5:ion5fSI 2_}ϹG?|YEAATnoEB7mvѮi:. F(ʀVUF|S2]}.}-D:- H(@9˞$?P"p!F0o:ŝ%V&v3m1)R͡FMryD_!oZgsz-rvhw{}J_#ߔ]l }Ihi9kEsHh kOMRXb 01ُ %< ڥ1[B)H®~V4 TjJ"xeZHZ:UȐs#=+kSp'zBkybAƔ:jCΎpY#Ktb+4&aᵭ~.h~P}& V!/]KϏBֹm;gJHZjHfn]IiG\`VCophe{z`aPr+j5?An,hQ " 1 a0u"  juxmZ7fְFU~XwPe')ZF>eθ8hOqj:""&]2<-nB㈺87[!7o.&/^PKb:BxLIBRARY/Display.xmlV]o0}WXyq&k;5&JDE :oMqҔ_ϵcIHT{bVVR4'4fsCnvVk~@,ˬdR*3۪C"M!l݈`$iHoe'/mFd%U1!'ƥ|ΘǶ. QfGS{O7 fl8)`h??3SI jI 3T}=W%}_X/uA4ˢ !'7b ]pҏNHq|vgs!WL4nPKb:B8%Jn$LIBRARY/Loading elements/Loading.xmlTˎ0+,w=q0$#2R4*LH Ǧ3ꢛɆǹs.>eزJ!/]?nmSzAd-YI4ʌa: hRe$BT`$ibu0E^$9[ۖ' vf&(;oGQ;aD7VUt#*B&q]}Vl@h<-W8jZsj*MtI-Wʃ:` @=͚䟊zWܐК3Aȥ"u^5VG{I7ZC Flu oúQ2+{ z-Cr٨/~NPKb:BFv(LIBRARY/Loading elements/Loading bar.xmlTQo0~߯pbC*:H&>Ձ#X38%HMi4w}wN/6EnXhѩ~:iƘ!18>RHDiHlE@y Jkbt:`BPʖjxKQZZw;Z&cF܊Xd8~\Bz0JMi2~`czp jILx͡p.dAQEjVR[gX30zPz4F?[ Reky[c:q][I6il2}*ΏxW)ز"Z1 gȕB yZS)W]#vP$b2Lo #RvC9t]ͽ'woCيgd|Jm)7~6\6&\N^xJ7~5fPKb:B*%*LIBRARY/Loading elements/Loading track.xmlT[o0~߯p*C%˺hHIKj: F?_R)9|;9~-clL *^ˇd \+y@h+48D,_ӊܱZ*R(Qˀ͒ySCMAP&pސ+@9h$Ji̞}ɷeq3 !N4DS醨uRqdPrΝʔ7- #R- $ģhﵸY/OĊU?8:M;rrBv[97.̮u7"4MTwB:NUWa/Y WJv.jDC}g>K-"UF"*鑼^P/K/#*RRP)崤{-r* `Z9w>$@[фJkV1g Aġ;s&SoZ/o@9+cǣ z\W'"JYEB/~6fGί҅̌AVZs$IV]Y Sa2յfʨ#&-&&)1vc!Kx~4xÑ+]&=B#:N!oMk'v<v_zE4_X}h}X| ob~oڹ7ӬW͓m,`b/: Axl+-z`9&wc=z6U5t|7- 8y\#HmjoMW=uncr5:8ܵ>:}=="tK~PKb:B H> &LIBRARY/Progress elements/Progress.xmlUK0WX8VIVd.ۨH*T2NLm#¿8޴Uog|r/o.K12,Ge. Xj1GBۭ9R-Hu=}2&K/Ep(CS9gN"sRf,J.1rVMZ FJD0]? :nu(HbEsR}Fب #3uȱjz#-7*a1@˘ fa>WTmmǵNWƅj3-,s!a7ȷܜ4І5Srɚ> 40v@avCT${\?eJHSxy pR@gFfg/r5 g`-t&pYK^* l|72UJTvOx@ΉPUMș@0{g;˺;bYO{*eG^ydm3̓VI7/Շ9U `OPKb:B#5*LIBRARY/Progress elements/Progress bar.xmlTMo0pg|JzmEuaNU'AD߉CR`̛y>nLk֬DRTxZ 9Nɳj#m;vd{VUph^꒜ QEK߲IbҊ HJ%Fd#J6/HGXP`੤B>vA~a/4yYaY+ߞFb1דꟾ!j^2+ itQ'häqbVg;eeq1R-#މVA>SBBB2u uG96Ffi@ m<0;dɞR2@X,jy6K%?5N)m+\o/;H0瘌 E‚ 1r-チn(g&6O5<؏;U5=,dM Pg[GY6rvCot¾ `|`򄬐#X2 37Lę=\]gH>5K>PKb:Bz(,LIBRARY/Progress elements/Progress track.xmlTn0W qҀt3m4HMI$`R?~R"A{#y=eSIjY#p% nK7Ŋ6B FFl$(+F$xD@I#qUB/)FdcD2r1\T ;̚~%-Xy[Ҋ2Q4Q8Nv@"iMmrY!MmLێqvAP)ϲsJUEE^HXNLlLmJOa;9"~ƫWK%WxMtzؕ S[ry`^F%-O]_ׁ `G0ԩ,!b|ȓ >w:@5sc= ?3L5Mbg{NlL€#Ho=1_7ƣ(or{N6ty d7'$APKb:B7JLIBRARY/Toggle.xmlUMo0p`%TҢFJҒ V GIC  {a}̼ ^~b!T QV8zHv%Ւl!gqyYiZ& 7QVMY,.JZr)á%[nhF+dT:9Vy)+58S|ܨEVy[S"/Uv2AYc2~ɲT3Zw2i;*EM9=7 'df[rٻm1Y)(BN&R&+ü)h`ȨN댙WunjDƎx]mVl-㇑/+!յIt>Ly. PkދnKӉC d']H/uWΨ`xo#gd<Š]|9cnHO5 7oFw|r-:\ ߸FT1zbË`Q jJU l_Gm"*95gB*:(7A88.jKkh10aMW9 7:PKb:BBA1&LIBRARY/Volume elements/Background.xml}TM0W89lV5Rʪ'Lbq &)Ǟ7olnҦ RWf1+uxDt:y'ff{Z)jEBU\l nx4?PNKZ}'NcCK `>2jqM8 @>l+l:tk2߹ZmD F"Xx, ࣈcF?} RU,R[ioJQ4Tr܇ \~ $ >JOC%uX3g(ϔ:i!uvJ*b>h/@o\6^3[\tOԷ2 XK$;AX&ShQewc?4.o4É1p\f2q ';Xۋuk0ώ nRsPW(.˰uzS辤m햾usYE#ٰNV| PKb:B>0 LIBRARY/Volume elements/Bar.xmlW]o0}߯0K+uNhuVդ1M{ `J44E2>p|}ȝ|05:/Y/uxys8,G?Rٺn\{4题b4׉0\ mtMN+Od0ݗ]p,>Hu֤63)mV7M6jp4S]ϷzydJuP,eJ.hF&˵Br$MUB>&S;ļ0ExﯮMU6P*獵={I]V Vwh[/B$ôW;W 'oN ֚i5 ϼ-wZlqc і#??o:늵KgD#)B)wcr$2my@h€#!Y#!@Bq3b  Frl&Sڐ,|'T p1N/c2,|3涜Xup1K" :m6Pmq{kĤ׋N@Ǫewc;sN' Zxx{TCjȽjK&e7b|Z())脝,I 4q FX2A <]="B)tkS);%DZȆ|K&$Y\Ut7AVd{ށU[+X2AI8Y> &K&s?ٸ_/5: B<:ޟ]Gϰ>uA]% B ȓb{<7_\8n<3ylߛ~߿^V§PKb:Bkh-=i #LIBRARY/Volume elements/Control.xmlUˎ0+,wMАE"h]XBy`Ԫb瞣dti(e1vR({aiaxha P,7P"}ɡ# cW=h%8艕pht4*;?5A@Ej~2;Y ":aQl~#g6µrWV1SACaڼ?j:"g'PsP[z1Fj`j6k\`Xqx! yP)44;z7^V/†┩s=~5Pkop_}auzPKb:B# LIBRARY/Volume elements/Icon.xmluTM0Wxs0򵂽tiJe[IbG R~|v`8Ğy3į7Y[mXkVs%j|V<{τN'4d#-^+Magʣ2/9- F5XIqbU֊sYckrķ_J};POG6i+bߜ\Vy JodKΊ"ZgH#a0r>wϚ=u&IpQG/ X ^3c ~\Kd9pA[֨t owv\ 2>GiF)Ǧu Uȵ|PiuRG.9P?EѕpdٞR2@X*$ռ +~X6A2\nE_`PͤkL7ɨE*Y{| *;hF6>OGz%-gt 2{5QpőU|DbL^p ۊwMKفLJΏo/&d/PKb:B9hQC LIBRARY/Volume elements/Mask.xmluTn0W86.HV*j Ū(_ۀ)ahZ7eo$/>Y-|lyB}c YlǑħ*L*Kz~ cjF.>ó0C|3ާsٙ}R2!0%SWa(W1&|r4.^r;[|zY?PKb:B!I !LIBRARY/Volume elements/Track.xmlWn:+R(NeuHP:VZ(eĀ?CHpЋ?|UZ]b뗯:} E]s~>=.ӭ̓/ٮ]*EjEm;vI.cd.wuRO#_N+z$q+ 5߄/շoW0.yqtsZ|5 ;hقWןf4$g[ʼ͗0D3m&noov wv %}LaLw1BwD|;{9_~gA]8'-sPKb:BR "LIBRARY/Volume elements/Volume.xmlV[o0~߯$K+RimTit&8±;vH:mm:;qt-JL,+Ц\l O!:XwHv.XAϸ4ʔk!M@35gA Ʌ$-X+Q 1 &!ǽeg z .}ܬc?lu$P &5LIBRARY/Progress elements/Progress.xmlPKb:B#5*08LIBRARY/Progress elements/Progress bar.xmlPKb:Bz(,:LIBRARY/Progress elements/Progress track.xmlPKb:B7J=LIBRARY/Toggle.xmlPKb:BBA1&l?LIBRARY/Volume elements/Background.xmlPKb:B>0 ALIBRARY/Volume elements/Bar.xmlPKb:Bkh-=i #ELIBRARY/Volume elements/Control.xmlPKb:B# HLIBRARY/Volume elements/Icon.xmlPKb:B9hQC kJLIBRARY/Volume elements/Mask.xmlPKb:B!I !LLIBRARY/Volume elements/Track.xmlPKb:BR "QPLIBRARY/Volume elements/Volume.xmlPKb:BMVVSbin/SymDepend.cachePKb:BVmimetypePK&&G $Wdebian/contrib/flvplayer/0002755000000000000000000000000012252640275012641 5ustar debian/contrib/flvplayer/flvplayer.fla0000644000000000000000000040000012252640275015321 0ustar ࡱ> FRp|YrRASH^|`ContentsCaPage 1Symbol 1533 BG  KNDqEH$JcLMtOQoPTWX^daefgjklmnprsuwxyz{|}~Rp|YrRASHMm`Contents aPage 1Symbol 1533 BG  KN !"#%&(D)*+,-./0123456789:;<=>?@AUEH$JcLMtOQoPTWVYX^Z[\]_dbahefgjiklmnpuwxyz{|}~R'IvR'IvSymbol 115#!Media 17YSymbol 155Symbol 156 )cSymbol 140Symbol 139!Symbol 138DSymbol 137"NC CDocumentPagePage 1Scene 1@I  Symbol 160controlsVolumeMuteb0I6Symbol 144! nSymbol 142 Symbol 141bSymbol 149d DSymbol 3D Symbol 155 displayImageb0I6+2D5Symbol 1IDSymbol 152'Symbol 1513Symbol 150p0Symbol 148  Symbol 153 displayBackb0I6|DB Symbol 11D Symbol 152 displayTitleb0I6)fDfSymbol 12D SSymbol 147\Symbol 146 PSymbol 145*Symbol 154&6ymbol 151 displayMaskb0I6yeDSymbol 12D Symbol 150displayEQStripesb0I6D  linkOCPicText (@ _sans333(tf?)Y textOPCPicPage CPicLayer CPicFrame CPicShaSymbol 1aD Symbol 148controlsVolumeIconb0I6DbSymbol 1ǽD Symbol 147controlsProgressb0I6"Dm/Symbol 1`D1 Layer 1OOublishPNGProperties::1OOCPicPage CPicLayer CPicFrame?I Layer 1OO Symbol 146controlsVolumeBarb0I6D,Symbol 1D Symbol 145controlsVolumeb0I6D)Symbol 1D Symbol 154controlsFullscreenb0I6D %jwFLVPlayer Clips/controlsVolume copyd D Symbol 144 controlsNextb0I6J D%Symbol 1#d D Symbol 142 controlsPrevb0I6J DSymbol 1*d D Symbol 141 controlsPlayb0I6J DvSymbol 1DSPPSPdSPd8SPP$SP Symbol 149 controlsPauseb0I6J D#jwMp3player clips/controlsPlay copyH?PE SymboSPd$SPdSPSP$SP?8 Layer 1OOPPCPicPage CPicLayer CPicFrameY< ff'@@0000/X000(1(/?Jl 140playlistButtonb0I6D\Symbol 1%D Symbol 139playlistButtonBackb0I6D6Symbol 1$D Symbol 138playlistButtonGlowb0I6cDSymbol 1D Symbol 137playlistButtonLinkb0I6DSymbol 1D Symbol 136 displayEQMaskb0I6DSymbol 1D Symbol 135displayEQStripesTopb0I6D Symbol 1D Symbol 134displayEQStripesBottomb0I6      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOQRSTUVWXYZ[]^_`abcdefghijklmnoqrstuvwxyz{|}~Dl Symbol 1+D Symbol 133 displayEQb0I6DSymbol 1jD Symbol 132 displayGlowb0I6DSymbol 1j3DSymbol 132KSymbol 131EISymbol 130@!Symbol 129:X Symbol 131 playlistGlowb0I6DSymbol 1D Symbol 130backb0I6D$Symbol 1D Symbol 129controlsFullscreenIconb0I6>D Symbol 1d D Symbol 128controlsVolumeMaskb0I6D.Symbol 1D Symbol 120playlistxb0I6RDmSymbol 1%D Symbol 93 t3FLVPlayer]Z0I5 jwFLVPlayerSymbol 1 IW Symbol 112controlsPlayIconpb0I6J D.:singleflvplayer.flaplayBut( B. BY9D Symbol 127controlsPrevIconb0I6uJ D_ playBut copyI Symbol 143controlsNextIconb0I6nJ D>controlsPVButtonPrev copy"d D Symbol 113controlsPauseIconqb0I6gJ D.:singleflvplayer.flapauseButC. BYId D Symbol 114controlsProgressLoadrb0I6sD1.:singleflvplayer.fla percentBarRC. B2[d D Symbol 115controlsProgressTimesb0I6D 2.:singleflvplayer.fla progressBarxC. Bi[d D Symbol 162controlsFSIconb0I6j+E (..:flash_flv_player/source/flvplayer.fla jwFLVPlayer Clips/controlsFSIconrPEj+E rPE Symbol 161controlsVolume copyb0I6%+E6(..:flash_flv_player/source/flvplayer.fla%jwFLVPlayer Clips/controlsVolume copysPE%+E6I Symbol 163colorBarHE.(..:flash_flv_player/source/flvplayer.flacolorBar:EHE.:ECMediaVideoStreamMedia 17 displayVideo3Db0I6UDxhhhhhlegacyLineSpacing0PropSheet::ActiveTab1085%PublishFormatProperties::htmlFileNameflvplayer.html"PublishHtmlProperties::StartPaused0 PublishRNWKProperties::speed256K0!PublishGifProperties::PaletteNameVector::AS3 Package PathsPublishFormatProperties::jpeg0PublishHtmlProperties::Loop1PublishProfileProperties::nameDefaultVector::Debugging Permitted0"PublishQTProperties::MatchMovieDim1 PublishQTProperties::AlphaOption PublishQTProperties::LayerOptionVector::UseNetwork0Vector::DocumentClass4PublishHtmlProperties::UsingDefaultAlternateFilename1PublishHtmlProperties::Units0%PublishHtmlProperties::showTagWarnMsg1Vector::External Player&PublishRNWKProperties::singleRateAudio0&PublishRNWKProperties::speedSingleISDN0$PublishPNGProperties::OptimizeColors1PublishQTProperties::Width240Vector::ScriptStuckDelay15%PublishFormatProperties::projectorMac0'PublishFormatProperties::gifDefaultName1&PublishFormatProperties::flashFileName flvplayer.swfVector::Package Paths Vector::Compress Movie1#PublishRNWKProperties::flashBitRate1200%PublishRNWKProperties::mediaCopyright(c) 2000PublishGifProperties::Smooth1Vector::AS3ExportFrame1Vector::Invisible Layer1PublishFormatProperties::html0$PublishFormatProperties::pngFileName flvplayer.png(PublishHtmlProperties::VerticalAlignment1PublishHtmlProperties::Quality4Vector::FireFox0"PublishRNWKProperties::exportAudio1 PublishRNWKProperties::speed384K0!PublishRNWKProperties::exportSMIL1"PublishGifProperties::DitherOption-PublishFormatProperties::generatorDefaultName1!PublishHtmlProperties::DeviceFont1Vector::Override Sounds0'PublishRNWKProperties::mediaDescription"PublishPNGProperties::FilterOptionPublishFormatProperties::gif0(PublishFormatProperties::jpegDefaultName1(PublishFormatProperties::rnwkDefaultName1*PublishFormatProperties::generatorFileName flvplayer.swtVector::Template02PublishHtmlProperties::VersionDetectionIfAvailable0*PublishHtmlProperties::HorizontalAlignment1"PublishHtmlProperties::DisplayMenu1Vector::Protect0Vector::Quality80PublishJpegProperties::DPI4718592PublishGifProperties::Interlace0"PublishGifProperties::DitherSolids0PublishPNGProperties::Smooth1PublishPNGProperties::BitDepth24-bit with AlphaPublishQTProperties::Flatten1Vector::AS3Optimize1#PublishFormatProperties::qtFileName flvplayer.movPublishRNWKProperties::speed28K1!PublishRNWKProperties::mediaTitle$PublishRNWKProperties::mediaKeywordsPublishGifProperties::Width240PublishGifProperties::Loop1PublishFormatProperties::flash1PublishJpegProperties::Quality80$PublishRNWKProperties::realVideoRate100000$PublishRNWKProperties::speedDualISDN0#PublishGifProperties::MatchMovieDim1#PublishGifProperties::PaletteOption"PublishPNGProperties::DitherOption0PublishFormatProperties::projectorMacDefaultName1'PublishFormatProperties::pngDefaultName1-PublishFormatProperties::projectorWinFileName flvplayer.exePublishHtmlPrC CDocumentPagePage 1Scene 1@I  Symbol 160controlsVolumeMuteb0I6Symbol 128 4cSymbol 120$)Symbol 93SSymbol 112%$.Symbol 127Symbol 1435Symbol 113 9Symbol 114g  !"#%&'(*+,-./012356789;<=>?ABCDFGHIJLMNOPQRSTUVWXYZ[\]^`abcdefghijklmnopqrstuwxyz{|~Symbol 160*xSymbol 162(+Symbol 161Symbol 163w<??I Layer 1OPPPPPPPPPPPCPicPage CPicLayer CPicFramef3Z@@1M00000X'XX0 |||||hh|hT|T|TTT|TThThT|T|ThT|TCPicPage CPicLayer CPicFramex<<?, Layer 1pe@<b%"00%0@?d Layer 1OOPPPPPPPPPTTThThhhThhT|T|||T||TTTTTTTTTTTTTTTTTTTTTTTT?m backOO CPicSpriteyxq3icn<component metaDataFetched='true' schemaCPicPage CPicLayer CPicFrameY< ff'@@0000/(X0001(/?D backCPicPage CPicLayer CPicFrame CPicShapeo4p@?k Layer 1OOPubloperties::showBitrateDlUrl='' schemaOperation='' sceneRootLabel='Scene 1' oldCopiedComponentPath='31.87.1'> </component> ?w icon3CopiedComponentPCPicPage CPicLayer CPicFrame333(x<?Q; Layer 1OCPicPage CPicLayer CPicFrame?\ CPicSprite 2P3((((((((PP(P(<(<( ( (<( CPicPage CPicLayer CPicFrame CPicShape$SP8SPSPnt> ?Q pauseOPPPPPPPPPPPPPPPPPPPPPPPPPPPPP<P<(<(<P<(<PPP<P<PP<(((( ( <<( <<<CPicPage CPicLayer CPicFrame CPicSprite` SvideoBgN<component metaDataFetched='true' schemaUrl='' schemaOperation='' sceneRootLabel='Scene 1' oldCopiedComponentPath='31.78'> </component>  imageClipQ<component metaDataFetched='true' schemaUrl='' schemaOperation='' sceneRootLabel='Scene 1' oldCopiedComponentPath='31.81'> </component> CPicVideoStream ` videoDispoperties::Align0!PublishProfileProperties::version1Vector::Package Export Frame1$PublishJpegProperties::MatchMovieDim1#PublishPNGProperties::MatchMovieDim1#PublishPNGProperties::PaletteOptionVector::Export Swc0)PublishFormatProperties::flashDefaultName1%PublishFormatProperties::jpegFileName flvplayer.jpgPublishHtmlProperties::Width240PublishHtmlProperties::Height198Vector::Omit Trace Actions0Vector::Debugging Password"PublishJpegProperties::Progressive0"PublishlayCPicText (o@@ _sans(playTextdZ clickImageV<component metaDataFetched='true' schemaUrl='' schemaOperation='' sceneRootLabel='Scene 1' oldCopiedComponentPath='31.86'> </component> ?N displayOU e;colorBarS<component metaDataFPNGProperties::DitherSolids0#PublishQTProperties::PlayEveryFrame0Vector::UseAS3Namespace1Vector::AS3Coach1Vector::AS3AutoDeclare0PublishFormatProperties::png0PublishFormatProperties::rnwk0(PublishFormatProperties::htmlDefaultName1-PublishFormatProperties::projectorMacFileName flvplayer.app2PublishHtmlProperties::UsingDefaultContentFilename1!PublishHtmlProperties::WindowMode2'PublishHtmlProperties::TemplateFileNameQC:\Users\steffen\AppData\Local\Adobe\Flash CS3\de\Configuration\HTML\Default.htmlVector::TopDown0Vector::DeviceSound0PublishJpegProperties::Size0PublishGifProperties::Height198PublishPNGProperties::Interlace0"PublishFormatProperties::generator0&PublishHtmlProperties::ContentFilenameflvplayer_content.html(PublishHtmlProperties::AlternateFilenameflvplayer_alternate.html+PublishHtmlProperties::OwnAlternateFilenameVector::Report0PublishRNWKProperties::speed56K1PublishGifProperties::LoopCount'PublishGifProperties::TransparentOptionPublishGifProperties::MaxColors255%PublishPNGProperties::RemoveGradients0PublishQTProperties::Height198Vector::AS3Strict0PublishFormatProperties::qt0Vector::Stream Compress7Vector::Event Format0Vector::Version8"Puetched='true' schemaUrl='' schemaOperation='' sceneRootLabel='Scene 1' oldCopiedComponentPath='31.83'> </component> ?| colorblishRNWKProperties::audioFormat0$PublishGifProperties::OptimizeColors10PublishFormatProperties::projectorWinDefaultName1PublishHtmlProperties::Scale0Vector::Event Compress7Vector::ActionScriptVersion2PublishJpegProperties::Height19xY@PPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPCPicPage CPicLayer CPicFramepP00p? Layer 1OOPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPCPicPage CPicLayer CPicFrame f0pPPP0p1p? Layer 1OOPPPPPPPPPPPPPPPPPPPPPPPPPCPicPage CPicLayer CPicFrame(x(x'?8 PublishRNWKProperties::speed512K0%PublishGifProperties::RemoveGradients0PublishPNGProperties::Width240PublishPNGProperties::Height198Vector::StreamUse8kSampleRate0Vector::EventUse8kSampleRate0&PublishFormatProperties::qtDefaultNameOPPPPPPPPPPPPPPPPPPCPicPage CPicLayer CPicFrame CPicSprite 3button<component metaDataFetched='true' schemaUrl='' schemaOperation='' sceneRootLabel='Scene 1' oldCopiedComponentPath=''> </cCplayButD<component metaDataFetched='true' schemaUrl='' schemaOperation='' sceneRootLabel='Scene 1' oldCopiedComponentPath='31.68'> </component> DTe volumeBarF<component metaDataFetched='true' schemaUrl='' schemaOperation='' sceneRootLabel='Scene 1' oldCopiedComponentPath='31.70'> </component> h7 hO progressBarG<component metaDataFetched='true' schemaUrl='' schemaOperation='' sceneRootLabel='Scene 1' oldCopiedComponentPath='31.71'> </component> kpauseButI<component metaDataFetched='true' schemaUrl='' schemaOperation='' sceneRootLabel='Scene 1' oldCopiedComponentPath='31.73'> </component> tT:FSButW<component metaDataFetched='true' schemaUrl='' schemaOperation='' sceneRootLabel='Scene 1' oldCopiedComponentPath='31.87'> </co1$PublishFormatProperties::gifFileName flvplayer.gif"PublishHtmlProperties::VersionInfoO9,0,45,0;8,0,24,0;7,0,14,0;6,0,79,0;5,0,58,0;4,0,32,0;3,0,8,0;2,0,1,12;1,0,0,1;Vector::Stream Format0PublishJpegProperties::Width240"PublishRNWKProperties::exportFlash1&PublishRNWKProperties::showBitrateDlog1(PublishRNWKProperties::speedCorporateLAN0"PublishRNWKProperties::mediaAuthorPublishGifProperties::Animated0&PublishGifProperties::TransparentAlpha128!PublishPNGProperties::Transparemponent> %vWvWvvvWvCCCWWWWWWWWWWWWWWWvvvWWvWvWWvWWWWCCCWWWWWWWWWWWWCCWWCWWWWWWWWWWCCCCCCWWWWWWCCCCCC?*] controlsO?HN#include "flvplayer.as" scriptO]X flvplayer<component metaDataFetched='true' schemaUrl='' schemaOperation='' sceneRootLabel='Scene 1' oldCopiedComponentPath='31'> </component> ?o mp3playerO?xg? p stop();  scriptsO DSymbol 3D Symbol 155 displayImageb0I6+2D5Symbol 1ID Symbol 153 displayBackb0I6|DB Symbol 11D Symbol 152 displayTitleb0I6)fDfSymbol 12D SOO CPicSpriteOdp2icn<component metaDataFetched='true' schemaUrl='' schemaOperation='' sceneRootLabel='Scene 1' oldCopiedComponentPath='31.68.2'> </component> ? CPicPage CPicLayer CPicFrameY<0 ff'@@000X0X000?6 backOO CPicSpabel='Scene 1' oldCopiedComponentPath=''> </component> ? icon3PPPPPPPPPP play3 CPicFrameCPicPage CPicLayer CPicFrameY<f3[@@f0000^000(?e backOO CPicSpriteddicn<component metaDataFetched='true' schemaUrl='' schemaOperation='' sceneRootLabel='Scene 1' oldCopiedComponentPath='31.70.7'> </component> ?' icon3 FUdmute<component metaDataFetched='true' schemaUrl='' schemaOperation='' sceneRootLabel='Scene 1' oldCopiedComponentPath='31.70.8'> </component> ?rP muteOO Pf( back<component metaDataFetched='true' schemaUrl='' schemaOperation='' sceneRootLabel='Scene 1' oldCopiedComponentPath='31.70.6'> </component> ?K backO P':front<component metaDataFetched='true' schemaUrl='' schemaOperation='' sceneRootLabel='Scene 1' oldCopiedComponentPath='31.70.5'> </component> ?yR frontO PdBYmask<component metaDataFetched='true' schemaUrl='' schemaOperation='' sceneRootLabel='Scene 1' oldCopiedComponentPath='31.70.4'> </component> ?YM maskO icFrameCPicPage CPicLayer CPicFrame 000H?M Layer 23(0p1؀ h0101(@0`x؀d P2(<<? Layer 1OOComCPicPage CPicLayer CPicFrameY< f'@@f003?2 backOO CPicSprite #ddrKloa<component metaDataFetched='true' schemaUrl='' schemaO backOO CPicSpritedq dicn<component metaDataFetched='true' schemaUrl='' schemaOperation='' sceneRootLabel='Scene 1' oldCopiedComponentPath='31.73.1'> </component0!PublishPNGProperties::PaletteName*PublishQTProperties::UseQTSoundCompression0PublishQTProperties::Looping0%PublishFormatProperties::defaultNames1%PublishFormatProperties::projectorWin0%PublishFormatProperties::rnwkFileNameflvplayer.smil,PublishHtmlProperties::UsingOwnAlternateFile0PublishPNGProperties::MaxColors255%PublishQTProperties::ControllerOption0"PublishQTProperties::PausedAtStart0 CColorDef,,,3P,fP0,PH,P`,Px,3,33(,3f<0,3CH,3F`,3Hx,f0,f30,ff(0,f5H,f<`,f@x,,3330,,3,33x,f3d0,3]H,3Z`,3Xx,33,3330,3f3PPH,33Px`,33Px,33P,f30,f33PH,ff3(PH,f3<x`,f3Cx,f3F,,fff`?q Layer 1OOPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPCPicPage CPicLayer CPicFrame@& J X3` 0'0a 0?UN shadeOOx'0'1(0'1(0'30'10'1P0'300'1P0'10'10'10'10'30'10'3@0'10'1P0'10'300'1(0'1(0'3p0'1(0'1(0'300'30'1(0'10'10'1P0'? lines3CPicPage CPicLayer CPicFrame 1OOPPPPPPPPPPPPPPPPCPicPage CPicLayer CPicFrameCPicPage CPicLayer CPicFrame$!p00$0 ?8* Layer 1OOCPicTexCPicPage CPicLayer CPicFrameCPicText  (( _sansdtf?( Layercomponent metaDataFetched='true' schemaUrl='' schemaOperation='' 1OOperation='' sceneRootLabel='Scene 1' oldCopiedComponentPath='31.71.3'> </component> ?j load3   es ptme<ymbol 151 displayMaskb0I6yeDSymbol 12D Symbol 150displayEQStripesb0I6D Symbol 1aD Symbol 148controlsVolumeIconb0I6DbSymbol 1ǽDpevU@ 00.0@?[4 Layer 1OOPPPPPPPPPPPPPPPPPPPPPPPPPPPPP?y timeOPPPPPPPPPPPPPPPPPPPPPCPicPage CPicLayer CPicFrame CPicShapez oq0<0^0?9 Layer 23 Z0>̀v(P? Symbol 147controlsProgressb0I6"Dm/Symbol 1`D Symbol 146controlsVolumeBarb0I6D,Symbol 1D Symbol 145controlsVolumeb0I6D)Symbol 1D Symbol 154controlsFullscreenb0I6D %jwFLVPlayer Clips/controlsVolume copyd D Symbol 144 controlsNextb0I6J D%Symbol 1#d D Symbol 142 controlsPrevb0I6J DSymbol 1*d D,,f0,3f0,ffx0,fkH,fd`,f`x,3f0,33fPH,3ffxPH,3fdx`,3f]x,3fZ,ff0,f3fPH,fff`,ffP0x,ffPx,ffP,,,,H,3H,fH,xH,̙n`,hx,3H,33x`,3fx`,3xx`,3̙kx,3d,fH,f3x`,ff0x,fx0x,f̙dx,f],,,,`,3`,f`,`,x`,px,3`,33x,3fx,3x,3xx,3n,f`,f3x,ffx,fx,fxx,fk,,,,x,3x,fx,x,x,xx,3x,33,3f,3,3,3x,fx,f3,ff,f,f,fx,,x,,H,3 H,fH,(H,2`,8x,`,3 `,f`,̙`,(`,0x,x,3x,fx,x, x,(x,,Px,,3H,33x`,f3x`,3(x`,35x,3<,3`,33x,f3 x,̙3x,3(x,32,3x,33,f3 ,3,3,3(,,x,,fH,3fx`,ff0x,f(0x,f<x,fC,f`,3fx,ffx,̙fx,f(x,f5,fx,3f,ff,f ,f,f(,,(x,,H,3x`,f0x,,̙PP,P,`,3x,fx,̙P,̙(P,<,x,3,f,,̙,(,,xx,,`,3x,fx,P,xP,d,`,3x,fx,̙P,,P,x,3,f,,,(,,x,,x,3,f,,,x,x,3,f,̙,,x,x,3,fCPicPage CPicLayer CPicFrame% 000%?r Layer sceneRootLabel='Scene 1' oldCopiedComponentPath='31.71.5'> </component> CPicPage CPicLayer CPicFrame CPicSha,,,, ,,,,,,f`zf,*],,,,z,},:t3FLVPlayer Clipsb0I6"PublishQTProperties::QTSndSettingsCQTAudioSettingsh  BSaved by Adobe Flash Windows 9.0 build 494 timecount = 1239540648p1PublishFormatProperties::jpeg0PublishQTProperties::Width240$Publis Symbol 141 controlsPlayb0I6J DvSymbol 1D Symbol 149 controlsPauseb0I6J D#jwMp3player clips/controlsPlay copyH?PE Symbol 140playlistButtonb0I6D\Symbol 1%D Symbol 139playlistButtonBackb0I6D6Symbol 136cSymbol 135}9Symbol 134vSymbol 133_Symbol 1$D Symbol 138playlistButtonGlowb0I6cDSymbol 1D Symbol 137playlistButtonLinkb0I6DSymbol 1D Symbol 136 displayEQMaskb0I6DSymbol 1D Symbol 135displayEQStripesTopb0I6D Symbol 1D Symbol 134displayEQStripesBottomb0I6Dl Symbol 1+D Symbol 133 displayEQb0I6DSymbol 1jD Symbol 132 displayGlowb0I6DSymbol 1j3D Symbol 131 playlistGlowb0I6DSymbol 1D Symbol 130backb0I6D$Symbol 1D Symbol 129controlsFullscreenIconb0I6>D Symbol 1d D Symbol 128controlsVolumeMaskb0I6D.Symbol 1D Symbol 120playlistxb0I6RDmSymbol 1%D Symbol 93 t3FLVPlayer]Z0I5 jwFLVPlayerSymbol 1 IW Symbol 1/ Layer 1OPPPPPPPCPicPage CPicLayer CPicFrame(x2P3FF<<  F<F<<<FFF<F<  <<<12controlsPlayIconpb0I6J D.:singleflvplayer.flaplayBut( B. BY9D Symbol 127controlsPrevIconb0I6uJ D_ playBut copyI Symbol 143controlsNextIconb0I6nJ D>controlsPVButtonPrev copy"d D Symbol 113controlsPauseIconqb0I6gJ D.:singleflvplayer.flapauseButC. BYId D Symbol 114controlsProgressLoadrb0I6sD1.:singleflvplayer.fla percentBarRC. B2[d D Symbol 115controlsProgressTimesb0I6D 2.:singleflvplayer.fla progressBarxC. Bi[d D Symbol 162controlsFSIconb0I6j+E (..:flash_flv_player/source/flvplayer.fla jwFLVPlayer Clips/controlsFSIconrPEj+E rPE Symbol 161controlsVolume copyb0I6%+E6(..:flash_flv_player/source/flvplayer.fla%jwFLVPlayer Clips/controlsVolume copysPE%+E6I Symbol 163colorBarHE.(..:flash_flv_player/source/flvplayer.flacolorBar:EHE.:ECMediaVideoStreamMedia 17 displayVideo3Db0I6UDxhhhhhlegacyLineSpacing0PropSheet::ActiveTab1085Vector::AS3 Package Paths!PublishGifProperties::PaletteName PublishRNWKProperties::speed256K0"PublishHtmlProperties::StartPaused0%PublishFormatProperties::htmlFileNameflvplayer.htmlVector::UseNetwork0 PublishQTProperties::LayerOption PublishQTProperties::AlphaOption"PublishQTProperties::MatchMovieDim1Vector::Debugging Permitted0PublishProfileProperties::nameDefaultPublishHtmlProperties::Loop1PublishFormatProperties::jpeg0PublishQTProperties::Width240$PublishPNGProperties::OptimizeColors1&PublishRNWKProperties::speedSingleISDN0&PublishRNWKProperties::singleRateAudio0Vector::External Player%PublishHtmlProperties::showTagWarnMsg1PublishHtmlProperties::Units04PublishHtmlProperties::UsingDefaultAlternateFilename1Vector::DocumentClassPublishGifProperties::Smooth1%PublishRNWKProperties::mediaCopyright(c) 2000#PublishRNWKProperties::flashBitRate1200Vector::Compress Movie1Vector::Package Paths &PublishFormatProperties::flasomponent> ?XS btnOPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPCPicPage CPicLayer CPicFrame CPicShape^20 0L0? </component> ?b top3 lXpmask<component metaDataFetched='true' schemaUrl='' schemaOperation='' sceneRootLabel='Scene 1' oldCopiedComponentPath=''> </component> ?+ maskOPPPPPPPPPPPPPPPPPPPPPPPPCPicPage CPicLayer CPicFrame333$p0$1Pp0$1p0$1xp0$1(p0$1p0$3p0$?( Layer 1OOPPPPPPPPPPPPPPPCPicPage CPicLayer CPicFrame$0p0$1 </component> ?M backOO 6glow<component metaDataFetched='true' schemaUrl='' schemaOperation='' sceneRootLabel='Scene 1' oldCopiedComponentPath=''> </component> ?o glow3X<link<component metaDataFetched='true' schemaUrl='' schemaOperation='' sceneRootLabel='Scene 1' oldCopiedComponentPath=''> </component> ?0blishPNGProperties::BitDepth24-bit with AlphaPublishPNGProperties::Smooth1"PublishGifProperties::DitherSolids0PublishGifProperties::Interlace0PublishJpegProperties::DPI4718592Vector::Quality80Vector::Protect0"PublishHtmlProperties::DisplayMenu1*PublishHtmlProperties::HorizontalAlignment12PublishHtmlProperties::VersionDetectionIfAvailable0Vector::Template0*PublishFormatProperties::generatorFileName flvplayer.swt(PublishFormatProperties::rnwkDefaultName1(PublishFormatProperties::jpegDefaultName1PublishFormatProperties::gif0PublishGifProperties::Loop1PublishGifProperties::Width240$PublishRNWKProperties::mediaKeywords!PublishRNWKProperties::mediaTitlePublishRNWKProperties::speed28K1#PublishFormatProperties::qtFileName flvplayer.movVector::AS3Optimize1"PublishPNGProperties::DitherOption#PublishGifProperties::PaletteOption#PublishGifProperties::MatchMovieDim1$PublishRNWKProperties::speedDualISDN0$PublishRNWKProperties::realVideoRate100000PublishJpegProperties::Quality80PublishFormatProperties::flash1#PublishPNGProperties::PaletteOption#PublishPNGProperties::MatchMovieDim1$PublishJpegProperties::MatchMovieDim1Vector::Package Export Frame1!PublishProfileProperties::version1PublishHtmlProperties::Align0-PublishFormatProperties::projectorWinFileName flvplayer.exe'PublishFormatProperties::pngDefaultName10PublishFormatProperties::projectorMacDefaultName1#PublishQTProperties::PlayEveryFrame0"PubliritedC icn<component metaDataFetched='true' schemaUrl='' schemaOperation='' sceneRootLabel='Scene 1' oldCopiedComponentPath=''> </component> ?H prev3PPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPCPicPage CPicLayer CPicFrameY< f'0@@f'@@'0X00X0000? backOO CPicSpriteduicn<component metaDataFetched='true' schemaUrl='' schemaOperation='' sceneRootLabel='Scene 1' oldCopiedComponentPath=''> </component> ?8 next3PPPPPPPPPPPPPPPPPPCPicPage CPicLayer CPicFrameY<f3[@@f0000X0X0?vK backOO CPicSpritedd_zicn<component metaDataFetched='true' schemaUrl='' schemaOperation='' sceneRootLshPNGProperties::DitherSolids0"PublishJpegProperties::Progressive0Vector::Debugging PasswordVector::Omit Trace Actions0PublishHtmlProperties::Height198PublishHtmlProperties::Width240%PublishFormatProperties::jpegFileName flvplayer.jpg)PublishFormatProperties::flashDefaultName1Vector::Export Swc0PublishPNGProperties::Interlace0PublishGifProperties::Height198PublishJpegProperties::Size0Vector::DeviceSound0Vector::TopDown0'PublishHtmlProperties::TemplateFileNameQC:\Users\steffen\AppData\Local\Adobe\Flash CS3\de\Configuration\HTML\Default.html!PublishHtmlProperties::WindowMode22PublishHtmlProperties::UsingDefaultContentFilename1-PublishFormatProperties::projectorMacFileName flvplayer.app(PublishFormatProperties::htmlDefaultName1PublishFormatProperties::rnwk0PublishFormatProperties::png0Vector::AS3AutoDeclare0Vector::AS3Coach1Vector::UseAS3Namespace1PublishQTProperties::Height198%PublishPNGProperties::RemoveGradients0PublishGifProperties::MaxColors255'PublishGifProperties::TransparentOptionPublishGifProperties::LoopCountPublishRNWKProperties::speed56K1Vector::Report0+PublishHtmlProperties::OwnAlternateFilename(PublishHtmlProperties::AlternateFilenameflvplayer_alternate.html&PublishHtmlProperties::ContentFilenameflvplayer_content.html"PublishFormatProperties::generator0$PublishGifProperties::OptimizeColors1"PublishRNWKProperties::audioFormat0Vector::Version8Vector::Event Format0Vector::Stream Compress7PublishFormatProperties::qt0Vector::AS3Strict0Vector::EventUse8kSampleRate0Vector::StreamUse8kSampleRate0PublishPNGProperties::Height198PublishPNGProperties::Width240%PublishGifProperties::RemoveGradients0 PublishRNWKProperties::speed512K0PublishJpegProperties::Height198Vector::ActionScriptVersion2Vector::Event Compress7PublishHtmlProperties::Scale00PublishFormatProperties::projectorWinDefaultName1PublishQTProperties::Looping0*PublishQTProperties::UseQTSoundCompression0!PublishPNGProperties::PaletteName!PublishPNGProperties::Transparent0&PublishGifProperties::TransparentAlpha128PublishGifProperties::Animated0"PublishRNWKProperties::mediaAuthor(PublishRNWKProperties::speedCorporateLAN0&PublishRNWKProperties::showBitrateDlog1"PublishRNWKProperties::exportFlash1PublishJpegProperties::Width240Vector::Stream Format0"PublishHtmlProperties::VersionInfoO9,0,45,0;8,0,24,0;7,0,14,0;6,0,79,0;5,0,58,0;4,0,32,0;3,0,8,0;2,0,1,12;1,0,0,1;$PublishFormatProperties::gifFileName flvplayer.gif&PublishFormatProperties::qtDefaultName1"PublishQTProperties::PausedAtStart0%PublishQTProperties::ControllerOption0PublishPNGProperties::MaxColors255,PublishHtmlProperties::UsingOwnAlternateFile0%PublishFormatProperties::rnwkFileNameflvplayer.smil%PublishFormatProperties::projectorWin0%PublishFormatProperties::defaultNames1 CColorDef,,,3P,fP0,PH,P`,Px,3CPicPage CPicLayer CPicFrame CPicSprite$ bottom<component metaDataFetched='true' schemaUrl='' schemaOperation='' sceneRootLabel='Scene 1' oldCopiedComponentPath=''> </component> $ x`top<component metaDataFetched='true' schemaUrl='' schemaOperation='' sceneRootLabel='Scene 1' oldCopiedComponentPath=''> </component> ?yz Layer,33(,3f<0,3CH,3F`,3Hx,f0,f30,ff(0,f5H,f<`,f@x,,3330,,3,33x,f3d0,3]H,3Z`,3Xx,33,3330,3f3PPH,33Px`,33Px,33P,f30,f33PH,ff3(PH,f3<x`,f3Cx,f3F,,fff`,,f0,3f0,ffx0,fkH,fd`,f`x,3f0,33fPH,3ffxPH,3fdx`,3f]x,3fZ,ff0,f3fPH,fff`,ffP0x,ffPx,ffP,,,,H,3H,fH,xH,̙n`,hx,3H,33x`,3fx`,3xx`,3̙kx,3d,fH,f3x`,ff0x,fx0x,f̙dx,f],,,,`,3`,f`,`,x`,px,3`,33x,3fx,3x,3xx,3n,f`,f3x,ffx,fx,fxx,fk,,,,x,3x,fx,x,x,xx,3x,33,3f,3,3,3x,fx,f3,ff,f,f,fx,,x,,H,3 H,fH,(H,2`,8x,`,3 `,f`,̙`,(`,0x,x,3x,fx,x, x,(x,,Px,,3H,33x`,f3x`,3(x`,35x,3<,3`,33x,f3 x,̙3x,3(x,32,3x,33,f3 ,3,3,3(,,x,,fH,3fx`,ff0x,f(0x,f<x,fC,f`,3fx,ffx,̙fx,f(x,f5,fx,3f,ff,f ,f,f(,,(x,,H,3x`,f0x,,̙PP,P,`,3x,fx,̙P,̙(P,<,x,3,f,,̙,(,,xx,,`,3x,fx,P,xP,d,`,3x,fx,̙P,,P,x,3,f,,,(,,x,,x,3,f,,,x,x,3,f,̙,,x,x,3,f,,,, ,,,,,,f`zf,*],,,,z,},=|zt3FLVPlayer Clipsb0I6"PublishQTProperties::QTSndSettingsCQTAudioSettingsh  BSaved by Adobe Flash Windows 9.0 build 494 timecount = 1288945031debian/contrib/flvplayer/flvplayer.as0000644000000000000000000002227212252640275015175 0ustar //-------------------------------------------------------------------------- // initial variables that might be useful to change //-------------------------------------------------------------------------- // Stage variables Stage.scaleMode = "noScale"; Stage.align = "TL"; // Add link to rightclick menu var newMenu:ContextMenu = new ContextMenu(); newMenu.hideBuiltInItems(); newMenu.customItems.push(new ContextMenuItem("TYPO3 Media Player...",goTo)); this.menu = newMenu; function goTo() { getURL("http://typo3.org"); }; //_root.allowFullScreen = "true"; var screenMode:String = 'normal'; function fullScreen() { if(screenMode == 'normal') { Stage["displayState"] = "fullScreen"; screenMode = 'full'; } else { Stage["displayState"] = "normal"; screenMode = 'normal'; } } var stageSize:Object = new Object(); stageSize.onResize = function() { w = Stage.width; h = Stage.height; setDims(w,h); } Stage.addListener(stageSize); if(_root.previewSeek == 'true') { makePre = true; } else { makePre = false; } // toggle for which file to play if none was set in html // you can change the 'test.flv' in your filename if(!_root.file) { file = "video.flv"; } else { file = _root.file; } // toggle for autostarting the video // you can change the 'true' in 'false' if(_root.autoPlay == "true") { autoStart = true; } else { autoStart = false; } if(!_root.smoothing) { smoothing = true; } else { smoothing = _root.smoothing; } if(!_root.deblocking) { deblocking = 5; } else { deblocking = _root.deblocking; } if(!_root.volume) { volume = 80; } else { volume = _root.volume; } if(!_root.prebuffer) { prebuffer = 5; } else { prebuffer = _root.prebuffer; } if(!_root.preview || _root.preview == "true") { preview = true; } if(!_root.previewSeek) { previewSeek = 0.1 } else { previewSeek = _root.previewSeek } if (!_root.clickAlpha) { clickAlpha = 65; } else { clickAlpha = _root.clickAlpha; } if (!_root.clickText) { clickText = ""; } else { clickText = _root.clickText; } // toggle for the width and height of the video // you can change them to the width and height you want w = Stage.width; h = Stage.height; //-------------------------------------------------------------------------- // stream setup and functions //-------------------------------------------------------------------------- // create and set netstream nc = new NetConnection(); nc.connect(null); ns = new NetStream(nc); ns.setBufferTime(2); // create and set sound object this.createEmptyMovieClip("snd", 0); snd.attachAudio(ns); audio = new Sound(snd); //attach videodisplay videoDisplay.attachVideo(ns); // Retrieve duration meta data from netstream ns.onMetaData = function(obj) { this.totalTime = obj.duration; // these three lines were used for automatically sizing // it is now done by sizing the video to stage dimensions // if(obj.height > 0 && obj.height < Stage.height-20) { // setDims(obj.width, obj.height); // } }; // retrieve status messages from netstream ns.onStatus = function(object) { if(object.code == "NetStream.Play.Stop") { // rewind and pause on when movie is finished ns.seek(0); if(_root.repeat == "true") { return; } if(preview) { ns.seek(previewSeek); } ns.pause(); playBut._visible = true; pauseBut._visible = false; if (!preview) { videoDisplay._visible = false; } showClick(true); } if (info.code == "NetStream.Buffer.Full") { if(makePre) { ns.seek(previewSeek); makePre = false; } } }; //-------------------------------------------------------------------------- // controlbar functionality //-------------------------------------------------------------------------- function showClick(show) { if (show) { if (_root.click) { if (!alignedClick) { clickImage.loadMovie(_root.click); clickImage._alpha = clickAlpha; } clickImage._visible = true; } else { playText.text = clickText; } } else { if (playText.text.length) { playText.text = ""; } if (clickImage._visible) { clickImage._visible = false; } } } // play the movie and hide playbutton function playMovie() { if(!isStarted) { audio.setVolume(volume); ns.setBufferTime(prebuffer); ns.play(file); isStarted = true; } else { showClick(false); ns.pause(); } pauseBut._visible = true; playBut._visible = false; videoDisplay._visible = true; } // pause the movie and hide pausebutton function pauseMovie() { ns.pause(); playBut._visible = true; pauseBut._visible = false; }; // video click action videoBg.onPress = function() { if(pauseBut._visible == false) { playMovie(); } else { pauseMovie(); } }; // pause button action pauseBut.onPress = function() { pauseMovie(); }; // play button action playBut.onPress = function() { playMovie(); }; // file load progress progressBar.onEnterFrame = function() { if (isStarted) { loaded = this._parent.ns.bytesLoaded; total = this._parent.ns.bytesTotal; if (loaded == total && loaded > 1000) { this.loa._xscale = 100; delete this.onEnterFrame; } else { this.loa._xscale = int(loaded/total*100); } } }; // play progress function progressBar.tme.onEnterFrame = function() { if (isStarted) { this._xscale = ns.time/ns.totalTime*100; if (bufferPercent != -1) { if (!bufferPercent) { showClick(false); } bufferPercent = int(ns.bufferLength/ns.bufferTime*100); if (bufferPercent >= 100) { playText.text = ""; bufferPercent = -1; } else { playText.text = "buffering .. " + bufferPercent + "%"; } } } else if (inPreview && ns.time > 0) { ns.close(); inPreview = false; } if (clickImage._width && !alignedClick) { clickImage._x = (videoDisplay._width - clickImage._width) / 2; clickImage._y = (videoDisplay._height - clickImage._height) / 2; alignedClick = true; } }; // start playhead scrubbing progressBar.loa.onPress = function() { this.onEnterFrame = function() { scl = (this._xmouse/this._width)*(this._xscale/100)*(this._xscale/100); if(scl < 0.02) { scl = 0; } ns.seek(scl*ns.totalTime); if (isStarted) { showClick(false); } }; }; // stop playhead scrubbing progressBar.loa.onRelease = progressBar.loa.onReleaseOutside = function () { delete this.onEnterFrame; pauseBut._visible == false ? videoDisplay.pause() : null; }; // fullscreen if(_root.allowFullScreen == "true") { FSBut.onPress = function() { fullScreen(); }; } else if (_root.fs == "true") { FSBut.onPress = function() { getURL("javascript: history.go(-1)"); }; } // volume scrubbing volumeBar.back.onPress = function() { this.onEnterFrame = function() { var xm = this._xmouse; if(xm>=0 && xm <= 20) { this._parent.mask._width = this._xmouse; this._parent._parent.audio.setVolume(this._xmouse*5); } }; } volumeBar.back.onRelease = volumeBar.back.onReleaseOutside = function() { delete this.onEnterFrame; } volumeBar.icn.onPress = function() { if (volumeBar.mute._visible) { setVolume(volume); } else { volume = audio.getVolume(); setVolume(0); } } function setVolume(vol) { audio.setVolume(vol); volumeBar.mask._width = vol/5; if (vol > 0 && volumeBar.mute._visible) { volumeBar.mute._visible = false; } else if (!vol && !volumeBar.mute._visible) { volumeBar.mute._visible = true; } } setVolume(volume); //-------------------------------------------------------------------------- // resize and position all items //-------------------------------------------------------------------------- function setDims(w,h) { // set videodisplay dimensions videoDisplay._width = videoBg._width = w; videoDisplay._height = videoBg._height = h-20; playText1._x = w/2-120; playText1._y = h/2-20; playText2._x = playText1._x + 1; playText2._y = playText1._y + 1; // resize the controlbar items .. if(_root.fs == "true") { colorBar._y = playBut._y = pauseBut._y = progressBar._y = FSBut._y = volumeBar._y = h-30; playBut._x = pauseBut._x = colorBar._x = w/2-150; colorBar._width = 300; colorBar._alpha = 25; progressBar._x = w/2-133; progressBar._width = 228; FSBut._x = w/2+95; volumeBar._x = w/2+112; videoDisplay._height = h; } else { colorBar._y = playBut._y = pauseBut._y = progressBar._y = FSBut._y = volumeBar._y = h-18; progressBar._width = w-56; colorBar._width = w; volumeBar._x = w-38; if(_root.allowFullScreen == "true") { FSBut._visible = true; progressBar._width -=17; FSBut._x = w-55; } else { FSBut._visible = false; } } } // here you can ovverride the dimensions of the video setDims(w,h); //-------------------------------------------------------------------------- // all done ? start the movie ! //-------------------------------------------------------------------------- // start playing the movie // if no autoStart it searches for a placeholder jpg // and hides the pauseBut pauseBut._visible = false; videoDisplay.smoothing = smoothing; videoDisplay.deblocking = deblocking; if (autoStart == true) { playMovie(); } else { showClick(true); if (preview) { inPreview = true; audio.setVolume(0); ns.play(file); ns.seek(previewSeek); } else { if(_root.image) { imageStr = _root.image; } else { imageStr = file.substring(0,file.length-3)+"jpg"; if (imageStr.substring(0,2) == "..") { imageStr = imageStr.substring(3); } } imageClip.loadMovie(imageStr); } } debian/contrib/modernizr/0002755000000000000000000000000012252640275012646 5ustar debian/contrib/modernizr/modernizr.js0000644000000000000000000010157612252640275015225 0ustar /*! * Modernizr v1.6 * http://www.modernizr.com * * Developed by: * - Faruk Ates http://farukat.es/ * - Paul Irish http://paulirish.com/ * * Copyright (c) 2009-2010 * Dual-licensed under the BSD or MIT licenses. * http://www.modernizr.com/license/ */ /* * Modernizr is a script that detects native CSS3 and HTML5 features * available in the current UA and provides an object containing all * features with a true/false value, depending on whether the UA has * native support for it or not. * * Modernizr will also add classes to the element of the page, * one for each feature it detects. If the UA supports it, a class * like "cssgradients" will be added. If not, the class name will be * "no-cssgradients". This allows for simple if-conditionals in your * CSS, giving you fine control over the look & feel of your website. * * @author Faruk Ates * @author Paul Irish * @copyright (c) 2009-2010 Faruk Ates. * @contributor Ben Alman */ window.Modernizr = (function(window,doc,undefined){ var version = '1.6', ret = {}, /** * !! DEPRECATED !! * * enableHTML5 is a private property for advanced use only. If enabled, * it will make Modernizr.init() run through a brief while() loop in * which it will create all HTML5 elements in the DOM to allow for * styling them in Internet Explorer, which does not recognize any * non-HTML4 elements unless created in the DOM this way. * * enableHTML5 is ON by default. * * The enableHTML5 toggle option is DEPRECATED as per 1.6, and will be * replaced in 2.0 in lieu of the modular, configurable nature of 2.0. */ enableHTML5 = true, docElement = doc.documentElement, /** * Create our "modernizr" element that we do most feature tests on. */ mod = 'modernizr', m = doc.createElement( mod ), m_style = m.style, /** * Create the input element for various Web Forms feature tests. */ f = doc.createElement( 'input' ), smile = ':)', tostring = Object.prototype.toString, // List of property values to set for css tests. See ticket #21 prefixes = ' -webkit- -moz- -o- -ms- -khtml- '.split(' '), // Following spec is to expose vendor-specific style properties as: // elem.style.WebkitBorderRadius // and the following would be incorrect: // elem.style.webkitBorderRadius // Webkit ghosts their properties in lowercase but Opera & Moz do not. // Microsoft foregoes prefixes entirely <= IE8, but appears to // use a lowercase `ms` instead of the correct `Ms` in IE9 // More here: http://github.com/Modernizr/Modernizr/issues/issue/21 domPrefixes = 'Webkit Moz O ms Khtml'.split(' '), ns = {'svg': 'http://www.w3.org/2000/svg'}, tests = {}, inputs = {}, attrs = {}, classes = [], featurename, // used in testing loop // todo: consider using http://javascript.nwbox.com/CSSSupport/css-support.js instead testMediaQuery = function(mq){ var st = document.createElement('style'), div = doc.createElement('div'), ret; st.textContent = mq + '{#modernizr{height:3px}}'; (doc.head || doc.getElementsByTagName('head')[0]).appendChild(st); div.id = 'modernizr'; docElement.appendChild(div); ret = div.offsetHeight === 3; st.parentNode.removeChild(st); div.parentNode.removeChild(div); return !!ret; }, /** * isEventSupported determines if a given element supports the given event * function from http://yura.thinkweb2.com/isEventSupported/ */ isEventSupported = (function(){ var TAGNAMES = { 'select':'input','change':'input', 'submit':'form','reset':'form', 'error':'img','load':'img','abort':'img' }; function isEventSupported(eventName, element) { element = element || document.createElement(TAGNAMES[eventName] || 'div'); eventName = 'on' + eventName; // When using `setAttribute`, IE skips "unload", WebKit skips "unload" and "resize", whereas `in` "catches" those var isSupported = (eventName in element); if (!isSupported) { // If it has no `setAttribute` (i.e. doesn't implement Node interface), try generic element if (!element.setAttribute) { element = document.createElement('div'); } if (element.setAttribute && element.removeAttribute) { element.setAttribute(eventName, ''); isSupported = typeof element[eventName] == 'function'; // If property was created, "remove it" (by setting value to `undefined`) if (typeof element[eventName] != 'undefined') { element[eventName] = undefined; } element.removeAttribute(eventName); } } element = null; return isSupported; } return isEventSupported; })(); // hasOwnProperty shim by kangax needed for Safari 2.0 support var _hasOwnProperty = ({}).hasOwnProperty, hasOwnProperty; if (typeof _hasOwnProperty !== 'undefined' && typeof _hasOwnProperty.call !== 'undefined') { hasOwnProperty = function (object, property) { return _hasOwnProperty.call(object, property); }; } else { hasOwnProperty = function (object, property) { /* yes, this can give false positives/negatives, but most of the time we don't care about those */ return ((property in object) && typeof object.constructor.prototype[property] === 'undefined'); }; } /** * set_css applies given styles to the Modernizr DOM node. */ function set_css( str ) { m_style.cssText = str; } /** * set_css_all extrapolates all vendor-specific css strings. */ function set_css_all( str1, str2 ) { return set_css(prefixes.join(str1 + ';') + ( str2 || '' )); } /** * contains returns a boolean for if substr is found within str. */ function contains( str, substr ) { return (''+str).indexOf( substr ) !== -1; } /** * test_props is a generic CSS / DOM property test; if a browser supports * a certain property, it won't return undefined for it. * A supported CSS property returns empty string when its not yet set. */ function test_props( props, callback ) { for ( var i in props ) { if ( m_style[ props[i] ] !== undefined && ( !callback || callback( props[i], m ) ) ) { return true; } } } /** * test_props_all tests a list of DOM properties we want to check against. * We specify literally ALL possible (known and/or likely) properties on * the element including the non-vendor prefixed one, for forward- * compatibility. */ function test_props_all( prop, callback ) { var uc_prop = prop.charAt(0).toUpperCase() + prop.substr(1), props = (prop + ' ' + domPrefixes.join(uc_prop + ' ') + uc_prop).split(' '); return !!test_props( props, callback ); } /** * Tests */ tests['flexbox'] = function() { /** * set_prefixed_value_css sets the property of a specified element * adding vendor prefixes to the VALUE of the property. * @param {Element} element * @param {string} property The property name. This will not be prefixed. * @param {string} value The value of the property. This WILL be prefixed. * @param {string=} extra Additional CSS to append unmodified to the end of * the CSS string. */ function set_prefixed_value_css(element, property, value, extra) { property += ':'; element.style.cssText = (property + prefixes.join(value + ';' + property)).slice(0, -property.length) + (extra || ''); } /** * set_prefixed_property_css sets the property of a specified element * adding vendor prefixes to the NAME of the property. * @param {Element} element * @param {string} property The property name. This WILL be prefixed. * @param {string} value The value of the property. This will not be prefixed. * @param {string=} extra Additional CSS to append unmodified to the end of * the CSS string. */ function set_prefixed_property_css(element, property, value, extra) { element.style.cssText = prefixes.join(property + ':' + value + ';') + (extra || ''); } var c = doc.createElement('div'), elem = doc.createElement('div'); set_prefixed_value_css(c, 'display', 'box', 'width:42px;padding:0;'); set_prefixed_property_css(elem, 'box-flex', '1', 'width:10px;'); c.appendChild(elem); docElement.appendChild(c); var ret = elem.offsetWidth === 42; c.removeChild(elem); docElement.removeChild(c); return ret; }; // On the S60 and BB Storm, getContext exists, but always returns undefined // http://github.com/Modernizr/Modernizr/issues/issue/97/ tests['canvas'] = function() { var elem = doc.createElement( 'canvas' ); return !!(elem.getContext && elem.getContext('2d')); }; tests['canvastext'] = function() { return !!(ret['canvas'] && typeof doc.createElement( 'canvas' ).getContext('2d').fillText == 'function'); }; tests['webgl'] = function(){ var elem = doc.createElement( 'canvas' ); try { if (elem.getContext('webgl')){ return true; } } catch(e){ } try { if (elem.getContext('experimental-webgl')){ return true; } } catch(e){ } return false; }; /* * The Modernizr.touch test only indicates if the browser supports * touch events, which does not necessarily reflect a touchscreen * device, as evidenced by tablets running Windows 7 or, alas, * the Palm Pre / WebOS (touch) phones. * * Additionally, Chrome (desktop) used to lie about its support on this, * but that has since been rectified: http://crbug.com/36415 * * We also test for Firefox 4 Multitouch Support. * * For more info, see: http://modernizr.github.com/Modernizr/touch.html */ tests['touch'] = function() { return ('ontouchstart' in window) || testMediaQuery('@media ('+prefixes.join('touch-enabled),(')+'modernizr)'); }; /** * geolocation tests for the new Geolocation API specification. * This test is a standards compliant-only test; for more complete * testing, including a Google Gears fallback, please see: * http://code.google.com/p/geo-location-javascript/ * or view a fallback solution using google's geo API: * http://gist.github.com/366184 */ tests['geolocation'] = function() { return !!navigator.geolocation; }; // Per 1.6: // This used to be Modernizr.crosswindowmessaging but the longer // name has been deprecated in favor of a shorter and property-matching one. // The old API is still available in 1.6, but as of 2.0 will throw a warning, // and in the first release thereafter disappear entirely. tests['postmessage'] = function() { return !!window.postMessage; }; // Web SQL database detection is tricky: // In chrome incognito mode, openDatabase is truthy, but using it will // throw an exception: http://crbug.com/42380 // We can create a dummy database, but there is no way to delete it afterwards. // Meanwhile, Safari users can get prompted on any database creation. // If they do, any page with Modernizr will give them a prompt: // http://github.com/Modernizr/Modernizr/issues/closed#issue/113 // We have chosen to allow the Chrome incognito false positive, so that Modernizr // doesn't litter the web with these test databases. As a developer, you'll have // to account for this gotcha yourself. tests['websqldatabase'] = function() { var result = !!window.openDatabase; /* if (result){ try { result = !!openDatabase( mod + "testdb", "1.0", mod + "testdb", 2e4); } catch(e) { } } */ return result; }; // Vendors have inconsistent prefixing with the experimental Indexed DB: // - Firefox is shipping indexedDB in FF4 as moz_indexedDB // - Webkit's implementation is accessible through webkitIndexedDB // We test both styles. tests['indexedDB'] = function(){ for (var i = -1, len = domPrefixes.length; ++i < len; ){ var prefix = domPrefixes[i].toLowerCase(); if (window[prefix + '_indexedDB'] || window[prefix + 'IndexedDB']){ return true; } } return false; }; // documentMode logic from YUI to filter out IE8 Compat Mode // which false positives. tests['hashchange'] = function() { return isEventSupported('hashchange', window) && ( document.documentMode === undefined || document.documentMode > 7 ); }; // Per 1.6: // This used to be Modernizr.historymanagement but the longer // name has been deprecated in favor of a shorter and property-matching one. // The old API is still available in 1.6, but as of 2.0 will throw a warning, // and in the first release thereafter disappear entirely. tests['history'] = function() { return !!(window.history && history.pushState); }; tests['draganddrop'] = function() { return isEventSupported('drag') && isEventSupported('dragstart') && isEventSupported('dragenter') && isEventSupported('dragover') && isEventSupported('dragleave') && isEventSupported('dragend') && isEventSupported('drop'); }; tests['websockets'] = function(){ return ('WebSocket' in window); }; // http://css-tricks.com/rgba-browser-support/ tests['rgba'] = function() { // Set an rgba() color and check the returned value set_css( 'background-color:rgba(150,255,150,.5)' ); return contains( m_style.backgroundColor, 'rgba' ); }; tests['hsla'] = function() { // Same as rgba(), in fact, browsers re-map hsla() to rgba() internally, // except IE9 who retains it as hsla set_css('background-color:hsla(120,40%,100%,.5)' ); return contains( m_style.backgroundColor, 'rgba' ) || contains( m_style.backgroundColor, 'hsla' ); }; tests['multiplebgs'] = function() { // Setting multiple images AND a color on the background shorthand property // and then querying the style.background property value for the number of // occurrences of "url(" is a reliable method for detecting ACTUAL support for this! set_css( 'background:url(//:),url(//:),red url(//:)' ); // If the UA supports multiple backgrounds, there should be three occurrences // of the string "url(" in the return value for elem_style.background return new RegExp("(url\\s*\\(.*?){3}").test(m_style.background); }; // In testing support for a given CSS property, it's legit to test: // elem.style[styleName] !== undefined // If the property is supported it will return an empty string, // if unsupported it will return undefined. // We'll take advantage of this quick test and skip setting a style // on our modernizr element, but instead just testing undefined vs // empty string. // The legacy set_css_all calls will remain in the source // (however, commented) for clarity, yet functionally they are // no longer needed. tests['backgroundsize'] = function() { return test_props_all( 'backgroundSize' ); }; tests['borderimage'] = function() { // set_css_all( 'border-image:url(m.png) 1 1 stretch' ); return test_props_all( 'borderImage' ); }; // Super comprehensive table about all the unique implementations of // border-radius: http://muddledramblings.com/table-of-css3-border-radius-compliance tests['borderradius'] = function() { // set_css_all( 'border-radius:10px' ); return test_props_all( 'borderRadius', '', function( prop ) { return contains( prop, 'orderRadius' ); }); }; tests['boxshadow'] = function() { // set_css_all( 'box-shadow:#000 1px 1px 3px' ); return test_props_all( 'boxShadow' ); }; // Note: FF3.0 will false positive on this test tests['textshadow'] = function(){ return doc.createElement('div').style.textShadow === ''; }; tests['opacity'] = function() { // Browsers that actually have CSS Opacity implemented have done so // according to spec, which means their return values are within the // range of [0.0,1.0] - including the leading zero. set_css_all( 'opacity:.5' ); return contains( m_style.opacity, '0.5' ); }; tests['cssanimations'] = function() { // set_css_all( 'animation:"animate" 2s ease 2', 'position:relative' ); return test_props_all( 'animationName' ); }; tests['csscolumns'] = function() { // set_css_all( 'column-count:3' ); return test_props_all( 'columnCount' ); }; tests['cssgradients'] = function() { /** * For CSS Gradients syntax, please see: * http://webkit.org/blog/175/introducing-css-gradients/ * https://developer.mozilla.org/en/CSS/-moz-linear-gradient * https://developer.mozilla.org/en/CSS/-moz-radial-gradient * http://dev.w3.org/csswg/css3-images/#gradients- */ var str1 = 'background-image:', str2 = 'gradient(linear,left top,right bottom,from(#9f9),to(white));', str3 = 'linear-gradient(left top,#9f9, white);'; set_css( (str1 + prefixes.join(str2 + str1) + prefixes.join(str3 + str1)).slice(0,-str1.length) ); return contains( m_style.backgroundImage, 'gradient' ); }; tests['cssreflections'] = function() { // set_css_all( 'box-reflect:right 1px' ); return test_props_all( 'boxReflect' ); }; tests['csstransforms'] = function() { // set_css_all( 'transform:rotate(3deg)' ); return !!test_props([ 'transformProperty', 'WebkitTransform', 'MozTransform', 'OTransform', 'msTransform' ]); }; tests['csstransforms3d'] = function() { // set_css_all( 'perspective:500' ); var ret = !!test_props([ 'perspectiveProperty', 'WebkitPerspective', 'MozPerspective', 'OPerspective', 'msPerspective' ]); // Webkit’s 3D transforms are passed off to the browser's own graphics renderer. // It works fine in Safari on Leopard and Snow Leopard, but not in Chrome (yet?). // As a result, Webkit typically recognizes the syntax but will sometimes throw a false // positive, thus we must do a more thorough check: if (ret){ // Webkit allows this media query to succeed only if the feature is enabled. // "@media (transform-3d),(-o-transform-3d),(-moz-transform-3d),(-ms-transform-3d),(-webkit-transform-3d),(modernizr){ ... }" ret = testMediaQuery('@media ('+prefixes.join('transform-3d),(')+'modernizr)'); } return ret; }; tests['csstransitions'] = function() { // set_css_all( 'transition:all .5s linear' ); return test_props_all( 'transitionProperty' ); }; // @font-face detection routine by Diego Perini // http://javascript.nwbox.com/CSSSupport/ tests['fontface'] = function(){ var sheet, head = doc.head || doc.getElementsByTagName('head')[0] || docElement, style = doc.createElement("style"), impl = doc.implementation || { hasFeature: function() { return false; } }; style.type = 'text/css'; head.insertBefore(style, head.firstChild); sheet = style.sheet || style.styleSheet; // removing it crashes IE browsers //head.removeChild(style); var supportAtRule = impl.hasFeature('CSS2', '') ? function(rule) { if (!(sheet && rule)) return false; var result = false; try { sheet.insertRule(rule, 0); result = !(/unknown/i).test(sheet.cssRules[0].cssText); sheet.deleteRule(sheet.cssRules.length - 1); } catch(e) { } return result; } : function(rule) { if (!(sheet && rule)) return false; sheet.cssText = rule; return sheet.cssText.length !== 0 && !(/unknown/i).test(sheet.cssText) && sheet.cssText .replace(/\r+|\n+/g, '') .indexOf(rule.split(' ')[0]) === 0; }; // DEPRECATED - allow for a callback ret._fontfaceready = function(fn){ fn(ret.fontface); }; return supportAtRule('@font-face { font-family: "font"; src: "font.ttf"; }'); }; // These tests evaluate support of the video/audio elements, as well as // testing what types of content they support. // // We're using the Boolean constructor here, so that we can extend the value // e.g. Modernizr.video // true // Modernizr.video.ogg // 'probably' // // Codec values from : http://github.com/NielsLeenheer/html5test/blob/9106a8/index.html#L845 // thx to NielsLeenheer and zcorpan // Note: in FF 3.5.1 and 3.5.0, "no" was a return value instead of empty string. // Modernizr does not normalize for that. tests['video'] = function() { var elem = doc.createElement('video'), bool = !!elem.canPlayType; if (bool){ bool = new Boolean(bool); bool.ogg = elem.canPlayType('video/ogg; codecs="theora"'); // Workaround required for IE9, which doesn't report video support without audio codec specified. // bug 599718 @ msft connect var h264 = 'video/mp4; codecs="avc1.42E01E'; bool.h264 = elem.canPlayType(h264 + '"') || elem.canPlayType(h264 + ', mp4a.40.2"'); bool.webm = elem.canPlayType('video/webm; codecs="vp8, vorbis"'); } return bool; }; tests['audio'] = function() { var elem = doc.createElement('audio'), bool = !!elem.canPlayType; if (bool){ bool = new Boolean(bool); bool.ogg = elem.canPlayType('audio/ogg; codecs="vorbis"'); bool.mp3 = elem.canPlayType('audio/mpeg;'); // Mimetypes accepted: // https://developer.mozilla.org/En/Media_formats_supported_by_the_audio_and_video_elements // http://bit.ly/iphoneoscodecs bool.wav = elem.canPlayType('audio/wav; codecs="1"'); bool.m4a = elem.canPlayType('audio/x-m4a;') || elem.canPlayType('audio/aac;'); } return bool; }; // Both localStorage and sessionStorage are // tested via the `in` operator because otherwise Firefox will // throw an error: https://bugzilla.mozilla.org/show_bug.cgi?id=365772 // if cookies are disabled // They require try/catch because of possible firefox configuration: // http://github.com/Modernizr/Modernizr/issues#issue/92 // FWIW miller device resolves to [object Storage] in all supporting browsers // except for IE who does [object Object] // IE8 Compat mode supports these features completely: // http://www.quirksmode.org/dom/html5.html tests['localstorage'] = function() { try { return ('localStorage' in window) && window.localStorage !== null; } catch(e) { return false; } }; tests['sessionstorage'] = function() { try { return ('sessionStorage' in window) && window.sessionStorage !== null; } catch(e){ return false; } }; tests['webWorkers'] = function () { return !!window.Worker; }; tests['applicationcache'] = function() { return !!window.applicationCache; }; // Thanks to Erik Dahlstrom tests['svg'] = function(){ return !!doc.createElementNS && !!doc.createElementNS(ns.svg, "svg").createSVGRect; }; tests['inlinesvg'] = function() { var div = document.createElement('div'); div.innerHTML = ''; return (div.firstChild && div.firstChild.namespaceURI) == ns.svg; }; // Thanks to F1lt3r and lucideer // http://github.com/Modernizr/Modernizr/issues#issue/35 tests['smil'] = function(){ return !!doc.createElementNS && /SVG/.test(tostring.call(doc.createElementNS(ns.svg,'animate'))); }; tests['svgclippaths'] = function(){ // Possibly returns a false positive in Safari 3.2? return !!doc.createElementNS && /SVG/.test(tostring.call(doc.createElementNS(ns.svg,'clipPath'))); }; // input features and input types go directly onto the ret object, bypassing the tests loop. // Hold this guy to execute in a moment. function webforms(){ // Run through HTML5's new input attributes to see if the UA understands any. // We're using f which is the element created early on // Mike Taylr has created a comprehensive resource for testing these attributes // when applied to all input types: // http://miketaylr.com/code/input-type-attr.html // spec: http://www.whatwg.org/specs/web-apps/current-work/multipage/the-input-element.html#input-type-attr-summary ret['input'] = (function(props) { for (var i = 0,len=props.length;i element, if it exists: docElement.className=docElement.className.replace(/\bno-js\b/,'') + ' js'; // Add the new classes to the element. docElement.className += ' ' + classes.join( ' ' ); return ret; })(this,this.document); debian/control0000644000000000000000000001327412252640275010605 0ustar Source: typo3-src Section: web Priority: optional Maintainer: Christian Welzel Build-Depends: debhelper (>= 7), po-debconf, swftools, yui-compressor Standards-Version: 3.9.4 Homepage: http://www.typo3.org Vcs-Git: git://github.com/sir-gawain/debian-typo3.git Vcs-Browser: https://github.com/sir-gawain/debian-typo3 Package: typo3-src-4.5 Architecture: all Depends: libjs-swfobject, libjs-prototype (>=1.6.0), libjs-scriptaculous (>=1.8.1), libjs-swfupload, libphp-adodb (>=5.07), libphp-swiftmailer (>=4.0.6), ttf-bitstream-vera, ${misc:Depends} Recommends: exim4 | mail-transport-agent, graphicsmagick, php5, php5-cli, php5-gd, php5-mysql, php5-xcache | php-apc, typo3-database, typo3-dummy Suggests: catdoc, ghostscript, php5-curl, ppthtml, unrtf, xlhtml, xpdf-utils Description: web content management system (core) TYPO3 is a free Open Source content management system for enterprise purposes on the web and in intranets. It offers full flexibility and extendability while featuring an accomplished set of ready-made interfaces, functions and modules. . The most important key features of TYPO3 are: * Simple creation of multi language websites with fallback to a default language * Handling of multi domain websites within a single page tree * Multi user backend editing with complete GUI customisation using an advanced ACL system * An integrated workflow management system based on an multi step architecture with editor and supervisor privileges * Unlimited redefinition of the rendering process using the build-in TypoScript configuration interface or the plugin API * Thousands of plugins are available in the online TYPO3 extension repository . This package provides the core engine of TYPO3, often called The Source. Package: typo3-database Architecture: all Depends: mysql-server, dbconfig-common (>= 1.8.39), debconf, ${misc:Depends} Recommends: typo3-dummy, typo3-src-4.5 Description: web content management system (database) TYPO3 is a free Open Source content management system for enterprise purposes on the web and in intranets. It offers full flexibility and extendability while featuring an accomplished set of ready-made interfaces, functions and modules. . The most important key features of TYPO3 are: * Simple creation of multi language websites with fallback to a default language * Handling of multi domain websites within a single page tree * Multi user backend editing with complete GUI customisation using an advanced ACL system * An integrated workflow management system based on an multi step architecture with editor and supervisor privileges * Unlimited redefinition of the rendering process using the build-in TypoScript configuration interface or the plugin API * Thousands of plugins are available in the online TYPO3 extension repository . This package provides the basic structure and some predefined datasets of a TYPO3 database. You should install this package on the host you intend to run the TYPO3 database on. Package: typo3-dummy Architecture: all Depends: exim4 | mail-transport-agent, dbconfig-common, debconf, graphicsmagick, lsb-base (>= 3.0-6), mysql-client, php5, php5-cli, php5-gd, php5-mysql, typo3-src-4.5, ${misc:Depends} Recommends: apache2 | http, catdoc, ghostscript, memcached, php5-curl, php5-memcache, php5-suhosin, php5-xcache | php-apc, ppthtml, typo3-database, unrtf, xlhtml, xpdf-utils Description: web content management system (basic site structure) TYPO3 is an enterprise-level content management system for use on the web and in intranets. It is flexible, extensible, and well supplied with ready-made interfaces, functions, and modules. . Its key features are: * simple creation of multi-language websites with fallback to a default language; * handling of multi-domain websites within a single page tree; * multi-user backend editing via a completely customizable GUI using an advanced ACL system; * an integrated workflow management system based on a multi-tier architecture with editor and supervisor privileges; * unlimited redefinition of the rendering process using the built-in TypoScript configuration interface or the plugin API; * thousands of plugins available in the online TYPO3 extension repository. . This package provides the basic directory structure to start a fresh website based on TYPO3. It includes scripts to register the site in Apache, with a default configuration intended for single vhost installations. TYPO3 can also be configured to work with several vhosts and a single src-dir, but such setups require some manual configuration. Package: typo3 Architecture: all Depends: typo3-database, typo3-dummy, typo3-src-4.5, ${misc:Depends} Description: web content management system (meta) TYPO3 is a free Open Source content management system for enterprise purposes on the web and in intranets. It offers full flexibility and extendability while featuring an accomplished set of ready-made interfaces, functions and modules. . The most important key features of TYPO3 are: * Simple creation of multi language websites with fallback to a default language * Handling of multi domain websites within a single page tree * Multi user backend editing with complete GUI customisation using an advanced ACL system * An integrated workflow management system based on an multi step architecture with editor and supervisor privileges * Unlimited redefinition of the rendering process using the build-in TypoScript configuration interface or the plugin API * Thousands of plugins are available in the online TYPO3 extension repository . This package is a metapackage and depends on all TYPO3 packages that are necessary to build a local running TYPO3 installation. debian/typo3-src-4.5.README.Debian0000644000000000000000000001262612252640275013411 0ustar TYPO3 for Debian ---------------- This package provides the core of the TYPO3 installation for Debian. INFORMATION ABOUT THE TYPO3 FILESYSTEM STRUCTURE ================================================ A Unix TYPO3 installation consists of two parts: 1) The "source" package 2) The "dummy" package The dummy package contains the skeleton directory structure for a TYPO3 installation and a symlink ('typo3_src') to the location of the source package which contains all the PHP files, images, JavaScript files, etc. that TYPO3 needs to run. In other words: You can have several TYPO3 installations with just one source package. A typical directory structure looks like this: /usr/share/typo3/typo3_src-4.3/ # the core files for 4.3 /usr/share/typo3/typo3_src-4.5/ # the core files for 4.5 /var/www/installation1/ # dummy package for TYPO3 4.3 ./typo3_src --> /usr/share/typo3/typo3_src-4.3/ # a symlink to the 4.3 core ./typo3conf/ ./typo3temp/ ./fileadmin/ ./.../ /var/www/installation2/ # dummy package for TYPO3 4.5 ./typo3_src --> /usr/share/typo3/typo3_src-4.5/ # a symlink to the 4.5 core ./typo3conf/ ./typo3temp/ ./fileadmin/ ./.../ As you see, the two TYPO3-installations (possibly with different domains) can use the same TYPO3 source package. You can even change the source package simply be changing the symlink inside the installation directory. UPGRADE A TYPO3 INSTALLATION ============================ For upgrading a TYPO3 installation you have to do the following: 1) install the new core package (typo3-src-*) 2) install the new database package (typo3-database), which will prompt you to update the mysql database. 3) change the symbolic link typo3_src to the new core directory. 4) enable and enter the install tool of TYPO3 and use the TYPO3 update wizard to set the compat version of TYPO3 to the new version. If you don't take this step, TYPO3 will run in an emulation mode, emulating the behaviour of the old version. WHAT SHOULD YOU DO IF YOU HAVE A PROBLEM? ========================================= Here are some typical pitfalls: 1 - Error message '/var/lib/typo3*/typo3conf/localconf.php is missing' is displayed in your browser This is normally a symptom for not setting all the file to the right user and group. Execute the typo3-site-installer to fix the permissions at it is described above. 2 - Check the symlink "typo3_src" in the directory which should point to the source directory, e.g. # file /var/lib/typo3-dummy/typo3_src /var/lib/typo3-dummy/typo3_src: symlink to `/usr/share/typo3/typo3_src-4.5' WHAT SHOULD YOU DO IF PROBLEM STILL REMAINS? ============================================ TYPO3 is a powerful and complex professional application. When you start out there will be many things you don't understand, or that don't seem to make sense. There is a widely used mailing list (more information on typo3.org) where many experienced users and developers lurk... they are always willing to help, provided you followed these steps BEFORE you ask your question: 1 - Read all available documentation carefully 2 - Read all available documentation again 3 - Search the mailing list archive carefully 4 - If you still can't figure it out - ask the list...: - Debian specific: news://news.netfielders.de/typo3.install.debian - Newsgroup: news://news.netfielders.de/ - Mailing lists: http://lists.netfielders.de/ When posting to one of the lists, see the following guidelines... - Be polite Always include the version of used TYPO3 and server environment (phpinfo())... note that this is available within the TYPO3 Install Tool - Be as specific and clear as possible - questions like "my TYPO3 installation does not work - what can I do???" will be ignored. Although English may not be your first language, if those reading your posting can't understand it, you won't get the help you need - If you are really having a tough time getting something working, stay cool and don't criticise or flame. Problems are normally caused by lack of research into the documentation, or misunderstanding, not because of bugs. Be logical about your troubleshooting, and you'll get there 5 - If you have identified a bug, related to the packing report it to Debian Bug Tracking System, e.g. using a tool like reportbug. 6 - If you have identified a genuine new bug, report it at http://forge.typo3.org/projects/typo3v4-core/issues Please be aware that if you ask questions that are answered in the available documentation, you may not get a reply, or any help from the developers or any experienced users! We are aware that there is still some work to be done on the documentation, and the platform for user support... please forgive us for not having all these gaps filled. If you feel that some information is missing, hard to find or just plain wrong, or you have a suggestion on improving TYPO3 or the "support services", please let us know so that we can do what is necessary. You could also volunteer to help with the work! (c) Nigel Jackson, Ingmar Schlecht Unix related additions made by Michael Stucki and some Wiki users: http://wiki.typo3.org/index.php/Tgz-INSTALL.txt Debian specific additions mady by Christian Leutloff and Christian Welzel -- Christian Welzel , Sun, 22 Apr 2012 20:00:00 debian/changelog-old-typo3-dummy.gz0000644000000000000000000000613512252640275014452 0ustar oPLchangelog-old-typo3-dummyZnF?OP3)9%5E+Jژ_%e89b73HYE8 cq;ͬ,9vw{YO#=+L‡ >Etx%eľ'WZ %B̵JV瞹u,XcYY̜qEiȣ0Mfnîe+WS\ g/`#8 9]xRirTΛ>b!c'ā]DtpO͵`y]I}?Rɭf<ǮZV8|U!խKT蒮BRX+QIqXc V#L摑g IL&u"550sEP:f4 _K]E]㦨KM(OY0dYw;`NrydzC(b:UV]搴)̂ )KC&chOȁ>Bc,1NԱ9¾UJj*ޥ-nGJ\r˨6\z0_z_~7ݼeMD{0֕EحY(^ +! j %q^2o!g v.3$ײd^tT!'`h¸`Z {s1o^Gق4`D{VyN9 RT_3hZ9[$HeJ 2+(t& I $)X\{ l +TL'dKw26l2ڔ5*:ZrFY4o?4|*;; :s&CPB_ZYz)Ca<siU AY2SE ^!DnQC)ř9ځ6 l-l$S`FC h=J̫is"bjpA Xd@HS؏lba+ D;1dr)S1Zu5 mDL'Q{bu oA7+wюU0Ñæ 8a 5 a"*kx i`D\>r9pT[꼫.tE +QZnzl1Aۙ `a mn+ 9:Nա{`muw TR"y]LVAHש 9. 먐Aܼp. ;SXc*;n\LA[aA? ]e=U?K¸N>^!ƢaH̛M8\UL+7L&0OjLYJ_ka4:`4cg?~֎FlQcݵn*Ǝ`48Uli !uC=)7xF9`>VFa trB],3-繄|.whx/wWsw횬 (fT4 OQ0~+l6#ﮈSU>,]:UQ=ӏzP(7vꍢʳxv;IĄpFGn7ɡEdk`W3-+)jaz;c_ 3"*mEvH'85Tv=VUBraI5lu`}IE0 3]Ea72d|t|p߯D zψt8E6⍺ HGcKAs5ox?B Ī+׆ͱJRK[ 2B9rZ!L%D'r=ւP7<옇 ^rxkJ]˰e:iC꯴lztPoTTM_5>MƦ4KbI\tTJuSj,w8WDO V[zh;vs;M0fG +pWnPg Hۍп玠Կy~.LG@K4Thn6IEfUdƎ|*>}ѹ?-xy8?/*L#Pl!6hܣrVn%]`[եa%?߸ v $\Ƴ ۇ:U 2_p*T5\ <* Vo2U{g ]bb$YpF}.GڊOC$A͡sDxڡ}њ8 AgӍs ֯ ><`dEQdݝ͐!]?Kȭdbé?{*…Eˍݏgog&4ɫփwW{U(<}`Ӧw}.5zsBs,>{Ҵ0 f"Dcun0Ҵ\2X\4K͐o&A@B1~ -5"їpOB`N{ef߻pi)~C9gf3~۫Y䖎^/_E_ݝ%mj?A_$Tvt[#)u o2 &dPG@6{ łP}/dev/null | awk '{print $3}' || true) if [ "$COMMON_STATE" = "installed" ] || [ "$COMMON_STATE" = "unpacked" ] ; then APACHE_22=1 fi if [ -e /usr/share/apache2/apache2-maintscript-helper ] ; then APACHE_24=1 CONF=".conf" . /usr/share/apache2/apache2-maintscript-helper fi if [ -f /usr/share/debconf/confmodule ]; then . /usr/share/debconf/confmodule fi if [ -f /usr/share/dbconfig-common/dpkg/frontend.postrm.mysql ]; then . /usr/share/dbconfig-common/dpkg/frontend.postrm.mysql dbc_go typo3-dummy $@ fi if [ "$1" = "purge" ]; then rm -f /etc/typo3-dummy/debian-db.php if which ucf >/dev/null 2>&1; then ucf --purge /etc/typo3-dummy/debian-db.php fi rm -f /etc/typo3-dummy/localconf.php if [ -d $T3CONFDIR ] ; then rm -f $T3CONFDIR/temp_CACHED* fi fi case "$1" in "remove"|"purge" ) for confdir in sites-available conf-available; do if [ -f /etc/apache2/$confdir/typo3-dummy-directory$CONF -o -L /etc/apache2/$confdir/typo3-dummy-directory$CONF ]; then if [ -n "$APACHE_24" ] ; then apache2_invoke dissite typo3-dummy-directory elif [ -n "$APACHE_22" ] ; then a2dissite typo3-dummy-directory fi fi rm -f /etc/apache2/$confdir/typo3-dummy-directory$CONF if [ -f /etc/apache2/$confdir/typo3-dummy-vhost$CONF -o -L /etc/apache2/$confdir/typo3-dummy-vhost$CONF ]; then if [ -n "$APACHE_24" ] ; then apache2_invoke dissite typo3-dummy-vhost elif [ -n "$APACHE_22" ] ; then a2dissite typo3-dummy-vhost fi fi rm -f /etc/apache2/$confdir/typo3-dummy-vhost$CONF done ;; esac #DEBHELPER# debian/typo3-dummy.postinst0000644000000000000000000000676712252640275013227 0ustar #!/bin/bash set -e #set -x PACKAGE=typo3-dummy T3CONFDIR=/var/lib/$PACKAGE/typo3conf APACHE_22= APACHE_24= CONF= COMMON_STATE=$(dpkg-query -f '${Status}' -W 'apache2.2-common' 2>/dev/null | awk '{print $3}' || true) if [ "$COMMON_STATE" = "installed" ] || [ "$COMMON_STATE" = "unpacked" ] ; then APACHE_22=1 fi if [ -e /usr/share/apache2/apache2-maintscript-helper ] ; then APACHE_24=1 CONF=".conf" . /usr/share/apache2/apache2-maintscript-helper fi if [ "$1" = "configure" ] ; then # Cleanup old links if [ -L /etc/apache2/sites-available/typo3-dummy-directory -a ! -e /etc/apache2/sites-available/typo3-dummy-directory$CONF ]; then mv /etc/apache2/sites-available/typo3-dummy-directory /etc/apache2/sites-available/typo3-dummy-directory$CONF fi if [ -L /etc/apache2/conf-available/typo3-dummy-directory -a -L /etc/apache2/sites-available/typo3-dummy-directory$CONF ]; then rm /etc/apache2/conf-available/typo3-dummy-directory fi if [ -L /etc/apache2/sites-available/typo3-dummy-vhost -a ! -e /etc/apache2/sites-available/typo3-dummy-vhost$CONF ]; then mv /etc/apache2/sites-available/typo3-dummy-vhost /etc/apache2/sites-available/typo3-dummy-vhost$CONF fi if [ -L /etc/apache2/conf-available/typo3-dummy-vhost -a -L /etc/apache2/sites-available/typo3-dummy-vhost$CONF ]; then rm /etc/apache2/conf-available/typo3-dummy-vhost fi fi if [ "$1" = "configure" ] ; then if [ -d $T3CONFDIR ] ; then rm -f $T3CONFDIR/temp_CACHED* fi for confdir in sites-available; do if [ -d /etc/apache2/$confdir -a ! -f /etc/apache2/$confdir/typo3-dummy-directory$CONF -a ! -L /etc/apache2/$confdir/typo3-dummy-directory$CONF ]; then ln -s /etc/typo3-dummy/apache-directory.conf /etc/apache2/$confdir/typo3-dummy-directory$CONF fi if [ -d /etc/apache2/$confdir -a ! -f /etc/apache2/$confdir/typo3-dummy-vhost$CONF -a ! -L /etc/apache2/$confdir/typo3-dummy-vhost$CONF ]; then ln -s /etc/typo3-dummy/apache-vhost.conf /etc/apache2/$confdir/typo3-dummy-vhost$CONF fi done fi if [ ! -e /etc/typo3-dummy/localconf.php ]; then cp /etc/typo3-dummy/localconf.php_template /etc/typo3-dummy/localconf.php # genarate a random encryption key and set in into localconf.php KEY=$(tr -cd '[:alnum:]' < /dev/urandom | fold -w 96 | head -n 1) sed -i 's/###ENCKEY###/'$KEY'/g' /etc/typo3-dummy/localconf.php chown www-data:www-data /etc/typo3-dummy/localconf.php chmod 0600 /etc/typo3-dummy/localconf.php fi # do database handling . /usr/share/debconf/confmodule . /usr/share/dbconfig-common/dpkg/frontend.postinst.mysql dbc_first_version=4.3.0 dbc_generate_include_owner=www-data:www-data dbc_generate_include=php:/etc/typo3-dummy/debian-db.php dbc_go typo3-dummy $@ db_get typo3-dummy/apache_mode if [ "$RET" = "vhost" ]; then if [ -n "$APACHE_24" ] ; then apache2_invoke ensite typo3-dummy-vhost elif [ -n "$APACHE_22" ] ; then a2ensite typo3-dummy-vhost fi fi if [ "$RET" = "directory" ]; then if [ -n "$APACHE_24" ] ; then apache2_invoke ensite typo3-dummy-directory elif [ -n "$APACHE_22" ] ; then a2ensite typo3-dummy-directory fi fi if [ "$RET" = "vhost" -o "$RET" = "directory" ]; then if [ -n "$APACHE_24" ] ; then apache2_invoke enmod rewrite elif [ -n "$APACHE_22" ] ; then a2enmod rewrite fi db_get typo3-dummy/apache_restart if [ "$RET" = "true" ]; then if [ -n "$APACHE_22" ] ; then apache2ctl restart fi fi fi #DEBHELPER# debian/gbp.conf0000644000000000000000000000066312252640275010617 0ustar [DEFAULT] builder = debuild -i\.git -I\.git cleaner = fakeroot debian/rules clean pristine-tar = True upstream-branch=upstream-4.5 debian-branch=typo3-4.5 [git-buildpackage] export-dir = ../build-area/ tarball-dir = ../tarballs/ upstream-branch=upstream-4.5 debian-branch=typo3-4.5 [git-import-orig] dch = False upstream-branch=upstream-4.5 debian-branch=typo3-4.5 [git-dch] multimaint = False git-author = True git-log=--no-merges debian/typo3-src-4.5.dirs0000644000000000000000000000003612252640275012224 0ustar usr/share/typo3/typo3_src-4.5 debian/typo3-dummy.install0000644000000000000000000000023012252640275012765 0ustar index.php clear.gif fileadmin/ typo3temp/ uploads/ typo3conf/ var/lib/typo3-dummy debian/apache-directory.conf debian/apache-vhost.conf etc/typo3-dummy debian/typo3-dummy.README.Debian0000644000000000000000000000447712252640275013456 0ustar typo3-dummy for Debian ---------------------- The required steps to install the database with TYPO3 are described in /usr/share/doc/typo3-database/README.Debian. That file contains additional information, too. URIs of the backend ------------------- Depending on the method of integration you choose during installation, the TYPO3 backend is either available under http://[typo3.your.domain]/typo3 or http://[www.domain.name]/cms/typo3 Situations of time out or out-of-memory --------------------------------------- If you encounter situations during work where TYPO3/PHP complains about a skript timeout or insufficient memory, you can tune the following parameters to fix the problems: * In /etc/typo3-dummy/localconf.php look for the line $TYPO3_CONF_VARS['SYS']['setMemoryLimit'] = '48'; and adjust the memory limit to a higher value. * In /etc/typo3-dummy/apache-*.conf look for the line php_admin_value memory_limit 48M and adjust the memory limit to a higher value. * In /etc/typo3-dummy/apache-*.conf look for the line # php_admin_value max_execution_time 90 and remove the '#' and adjust the time limit to a higher value. Don't forget to restart your apache to make the changes active. TYPO3-Scheduler --------------- The new TYPO3 scheduler extension is based on a cron task. You can find the task in /etc/cron.d/typo3-dummy. Adjust the interval of the task to your own needs. The default is 5 minutes. See the scheduler extension manual for futher information. Enable the usage of cache framework ----------------------------------- To make use of the new cache framework change the following line in /etc/typo3-dummy/localconf.php: $TYPO3_CONF_VARS['SYS']['useCachingFramework'] = '0'; to $TYPO3_CONF_VARS['SYS']['useCachingFramework'] = '1'; Better performance for memcached -------------------------------- In his blog Dmitry Dulepov proposed this settings for memcached to get some more performance out of memcached: memcache.allow_failover 1 memcache.chunk_size 32768 memcache.default_port 11211 memcache.hash_function fnv memcache.hash_strategy consistent memcache.max_failover_attempts 20 See http://dmitry-dulepov.com/article/how-to-enable-memcached-cache-in-typo3-43.html for the original post. -- Christian Welzel , Mon, 05 Dec 2009 23:00:00 debian/po/0002755000000000000000000000000012252640445007612 5ustar debian/po/pt.po0000644000000000000000000001051612252640275010577 0ustar # Translation of typo3-dummy debconf messages do Portuguese # Copyright (C) 2010 the typo3-dummy's copyright holder # This file is distributed under the same license as the typo3-dummy package. # # Américo Monteiro , 2010. msgid "" msgstr "" "Project-Id-Version: typo3-dummy 4.3.0-4\n" "Report-Msgid-Bugs-To: typo3-dummy@packages.debian.org\n" "POT-Creation-Date: 2010-06-20 22:03+0200\n" "PO-Revision-Date: 2010-06-25 00:50+0100\n" "Last-Translator: Américo Monteiro \n" "Language-Team: Portuguese \n" "Language: Portuguese\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "X-Generator: Lokalize 1.0\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" #. Type: select #. Choices #: ../typo3-dummy.templates:2001 msgid "vhost" msgstr "vhost" #. Type: select #. Choices #: ../typo3-dummy.templates:2001 msgid "directory" msgstr "directório" #. Type: select #. Choices #: ../typo3-dummy.templates:2001 msgid "none" msgstr "nenhum" #. Type: select #. Description #: ../typo3-dummy.templates:2002 msgid "Apache integration mode:" msgstr "Modo de integração do Apache:" #. Type: select #. Description #: ../typo3-dummy.templates:2002 msgid "" "Please choose the method that should be used for integrating the TYPO3 " "installation with the apache2 web server:" msgstr "" "Por favor escolha o método que deve ser usado para integrar a instalação do " "TYPO3 com o servidor web apache2:" #. Type: select #. Description #: ../typo3-dummy.templates:2002 msgid "" " vhost: generates URLs with TYPO3 as part of the domain name, such\n" " as http://typo3.example.com/;\n" " directory: fits TYPO3 within the existing site, making it available\n" " at an address like http://www.example.com/cms/;\n" " none: does not configure TYPO3 automatically. The server will\n" " need manual configuration. Choose this option if you are\n" " using a web server other than apache2." msgstr "" " vhost: gera URLs com TYPO3 como parte do nome de domínio, assim\n" " como http://typo3.exemplo.com/;\n" " directório: arruma o TYPO3 dentro do site existente, tornando-o disponível\n" " em um endereço como http://www.exemplo.com/cms/;\n" " nenhum: não configura o TYPO3 automaticamente. O servidor irá\n" " precisar de configuração manual. Escolha esta opção se está a\n" " usar um servidor web que não o apache2." #. Type: boolean #. Description #: ../typo3-dummy.templates:3001 msgid "Should apache2 be restarted after installation?" msgstr "Deve o apache2 ser reiniciado após a instalação?" #. Type: boolean #. Description #: ../typo3-dummy.templates:3001 msgid "" "Apache's configuration has been changed to include TYPO3 and activate the " "rewrite module. For these changes to take effect, apache2 must be reloaded." msgstr "" "A configuração do apache foi alterada para incluir o TYPO3 e activar o " "módulo de re-escrita. Para estas alterações terem efeito, o apache2 tem de " "ser reiniciado." #. Type: note #. Description #: ../typo3-dummy.templates:4001 msgid "Old symlink in /etc/apache2/conf.d/" msgstr "Link simbólico antigo em /etc/apache2/conf.d/" #. Type: note #. Description #: ../typo3-dummy.templates:4001 msgid "" "Older versions (before 4.3.0-3) of typo3-dummy installed the apache2 " "configuration symlink as /etc/apache2/conf.d/typo3-dummy.conf." msgstr "" "Outras versões (anteriores ao 4.3.0-3) do typo3-dummy instalaram o link " "simbólico de configuração do apache2 como /etc/apache2/conf.d/typo3-dummy." "conf." #. Type: note #. Description #: ../typo3-dummy.templates:4001 msgid "" "This has been changed and newer versions place two new symlinks into /etc/" "apache2/sites-available/. To prevent failures due to overlapping " "configuration directives you should remove the symlink typo3-dummy.conf " "from /etc/apache2/conf.d/ and merge its contents into one of the new " "configuration files." msgstr "" "Isto foi alterado e as versões mais recentes colocam dois novos links " "simbólicos em /etc/apache2/sites-available/. Para prevenir falhas devidas a " "directórios de configuração sobrepostos, você deve remover o link simbólico " "typo3-dummy.conf de /etc/apache2/conf.d/ e fundir o seu conteúdo em um dos " "novos ficheiros de configuração." debian/po/sv.po0000644000000000000000000001036712252640275010610 0ustar # Translation of typo3-dummy debconf template to Swedish # Copyright (C) 2010 Martin Bagge # This file is distributed under the same license as the typo3-dummy package. # # Martin Bagge , 2010 msgid "" msgstr "" "Project-Id-Version: typo3-dummy\n" "Report-Msgid-Bugs-To: typo3-dummy@packages.debian.org\n" "POT-Creation-Date: 2010-06-20 22:03+0200\n" "PO-Revision-Date: 2010-06-23 09:09+0100\n" "Last-Translator: Martin Bagge / brother \n" "Language-Team: Swedish \n" "Language: sv\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=utf-8\n" "Content-Transfer-Encoding: 8bit\n" "X-Poedit-Language: Swedish\n" "X-Poedit-Country: Sweden\n" #. Type: select #. Choices #: ../typo3-dummy.templates:2001 msgid "vhost" msgstr "vhost" #. Type: select #. Choices #: ../typo3-dummy.templates:2001 msgid "directory" msgstr "katalog" #. Type: select #. Choices #: ../typo3-dummy.templates:2001 msgid "none" msgstr "ingen" #. Type: select #. Description #: ../typo3-dummy.templates:2002 msgid "Apache integration mode:" msgstr "Läge för integrering med Apache:" #. Type: select #. Description #: ../typo3-dummy.templates:2002 msgid "" "Please choose the method that should be used for integrating the TYPO3 " "installation with the apache2 web server:" msgstr "" "Ange vilken metod som ska användas för integreringen av TYPO3-installationen " "med webbservern apache2." #. Type: select #. Description #: ../typo3-dummy.templates:2002 msgid "" " vhost: generates URLs with TYPO3 as part of the domain name, such\n" " as http://typo3.example.com/;\n" " directory: fits TYPO3 within the existing site, making it available\n" " at an address like http://www.example.com/cms/;\n" " none: does not configure TYPO3 automatically. The server will\n" " need manual configuration. Choose this option if you are\n" " using a web server other than apache2." msgstr "" " vhost: skapar URL:ar med TYPO3 som en del av domän-\n" " namnet, ex. http://typo3.example.com/.\n" " katalog: placerar TYPO3 i en existerande webbplats, tillgängliggör\n" " den på en adress likt http://www.example.com/cms/.\n" " ingen: gör inga automatiska inställningar för TYPO3 alls. Servern\n" " kommer att behöva manuell handpåläggning för inställningar.\n" " Välj detta alternativ om du använder en annan webbserver än\n" " apache2." #. Type: boolean #. Description #: ../typo3-dummy.templates:3001 msgid "Should apache2 be restarted after installation?" msgstr "Ska apache2 startas om efter installationen?" #. Type: boolean #. Description #: ../typo3-dummy.templates:3001 msgid "" "Apache's configuration has been changed to include TYPO3 and activate the " "rewrite module. For these changes to take effect, apache2 must be reloaded." msgstr "" "TYPO3-inställningarna och modulen \"rewrite\" för apache2 har installerats. " "För att tillse att dessa ändringar aktiveras måste apache2 laddas om." #. Type: note #. Description #: ../typo3-dummy.templates:4001 msgid "Old symlink in /etc/apache2/conf.d/" msgstr "Gammal symlänk i /etc/apache2/conf.d/" #. Type: note #. Description #: ../typo3-dummy.templates:4001 msgid "" "Older versions (before 4.3.0-3) of typo3-dummy installed the apache2 " "configuration symlink as /etc/apache2/conf.d/typo3-dummy.conf." msgstr "" "Äldre versioner (före 4.3.0-3) av typo3-dummy installerade apache2-" "inställningarna som en symlänk via etc/apache2/conf.d/typo3-dummy.conf." #. Type: note #. Description #: ../typo3-dummy.templates:4001 msgid "" "This has been changed and newer versions place two new symlinks into /etc/" "apache2/sites-available/. To prevent failures due to overlapping " "configuration directives you should remove the symlink typo3-dummy.conf " "from /etc/apache2/conf.d/ and merge its contents into one of the new " "configuration files." msgstr "" "Detta har ändrats och nyare versioner placerar två nya symlänkar i /etc/" "apache2/sites-available/. För att förhindra fel på grund av överlappande " "direktiv ska du ta bort den äldre symlänken typo3-dummy.conf från /etc/" "apache2/conf.d/ och överföra dess innehåll i en av de nya " "inställningsfilerna." debian/po/nl.po0000644000000000000000000001024212252640275010561 0ustar # Dutch translation of typo3-src debconf templates. # Copyright (C) 2012 THE PACKAGE'S COPYRIGHT HOLDER # This file is distributed under the same license as the typo3-src package. # Jeroen Schot , 2012. # msgid "" msgstr "" "Project-Id-Version: typo3-src 4.5.11+dfsg1-1\n" "Report-Msgid-Bugs-To: typo3-dummy@packages.debian.org\n" "POT-Creation-Date: 2010-06-20 22:03+0200\n" "PO-Revision-Date: 2012-02-24 12:33+0100\n" "Last-Translator: Jeroen Schot \n" "Language-Team: Debian l10n Dutch \n" "Language: nl\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" #. Type: select #. Choices #: ../typo3-dummy.templates:2001 msgid "vhost" msgstr "vhost" #. Type: select #. Choices #: ../typo3-dummy.templates:2001 msgid "directory" msgstr "map" #. Type: select #. Choices #: ../typo3-dummy.templates:2001 msgid "none" msgstr "niet" #. Type: select #. Description #: ../typo3-dummy.templates:2002 msgid "Apache integration mode:" msgstr "Apache-integratie:" #. Type: select #. Description #: ../typo3-dummy.templates:2002 msgid "" "Please choose the method that should be used for integrating the TYPO3 " "installation with the apache2 web server:" msgstr "" "Op welke manier moet TYPO3 worden geïntegreerd met de apache2-webserver?" #. Type: select #. Description #: ../typo3-dummy.templates:2002 msgid "" " vhost: generates URLs with TYPO3 as part of the domain name, such\n" " as http://typo3.example.com/;\n" " directory: fits TYPO3 within the existing site, making it available\n" " at an address like http://www.example.com/cms/;\n" " none: does not configure TYPO3 automatically. The server will\n" " need manual configuration. Choose this option if you are\n" " using a web server other than apache2." msgstr "" " vhost: Genereert URL's met TYPO3 als onderdeel van de domeinnaam zoals\n" " http://typo3.example.com.\n" " map: Plaatst TYPO3 onder een bestaande website, waarbij het beschikbaar\n" " wordt gemaakt op een adres zoals http://www.example.com/cms/.\n" " niet: Configureert TYPO3 niet automatisch. De server zal handmatige\n" " configuratie vereisen. Kies deze optie als u geen apache2 gebruikt\n" " maar een andere webserver." #. Type: boolean #. Description #: ../typo3-dummy.templates:3001 msgid "Should apache2 be restarted after installation?" msgstr "Wilt u apache2 na de installatie herstarten?" #. Type: boolean #. Description #: ../typo3-dummy.templates:3001 msgid "" "Apache's configuration has been changed to include TYPO3 and activate the " "rewrite module. For these changes to take effect, apache2 must be reloaded." msgstr "" "Apache's configuratie is aangepast zodat TYPO3 toegevoegd en de rewrite-" "modules geactiveerd is. Om deze veranderingen door te voeren moet apache2 " "herladen worden." #. Type: note #. Description #: ../typo3-dummy.templates:4001 msgid "Old symlink in /etc/apache2/conf.d/" msgstr "Oude symbolische koppeling in /etc/apache2/conf.d/" #. Type: note #. Description #: ../typo3-dummy.templates:4001 msgid "" "Older versions (before 4.3.0-3) of typo3-dummy installed the apache2 " "configuration symlink as /etc/apache2/conf.d/typo3-dummy.conf." msgstr "" "Oudere versies (voor 4.3.0-3) van typo3-dummy installeerden de symbolische " "koppeling van de apache2-configuratie als /etc/apache2/conf.d/typo3-dummy." "conf." #. Type: note #. Description #: ../typo3-dummy.templates:4001 msgid "" "This has been changed and newer versions place two new symlinks into /etc/" "apache2/sites-available/. To prevent failures due to overlapping " "configuration directives you should remove the symlink typo3-dummy.conf " "from /etc/apache2/conf.d/ and merge its contents into one of the new " "configuration files." msgstr "" "Dit is veranderd en nieuwere versies plaatste twee nieuwe symbolische " "koppelingen in /etc/apache2/sites-available/. Om storingen door overlappende " "configuratie-opdrachten te voorkomen dient u de symbolische koppeling typo3-" "dummy.conf te verwijderen uit /etc/apache2/conf.d/ en zijn inhoud " "samenvoegen met een van de nieuwe configuratiebestanden." debian/po/fr.po0000644000000000000000000001065312252640275010565 0ustar # Translation of typo3-dummy debconf templates to French # Copyright (C) 2010 Debian French l10n team # This file is distributed under the same license as the typo3-dummy package. # # David Prévot , 2010. msgid "" msgstr "" "Project-Id-Version: typo3-dummy 4.0.2-2\n" "Report-Msgid-Bugs-To: typo3-dummy@packages.debian.org\n" "POT-Creation-Date: 2010-06-20 11:47-0400\n" "PO-Revision-Date: 2010-06-17 17:20-0400\n" "Last-Translator: David Prévot \n" "Language-Team: French \n" "Language: fr\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "X-Generator: Lokalize 1.0\n" "Plural-Forms: nplurals=2; plural=(n > 1);\n" #. Type: select #. Choices #: ../typo3-dummy.templates:2001 msgid "vhost" msgstr "hôte virtuel" #. Type: select #. Choices #: ../typo3-dummy.templates:2001 msgid "directory" msgstr "répertoire" #. Type: select #. Choices #: ../typo3-dummy.templates:2001 msgid "none" msgstr "aucune" #. Type: select #. Description #: ../typo3-dummy.templates:2002 msgid "Apache integration mode:" msgstr "Méthode d'intégration à Apache :" #. Type: select #. Description #: ../typo3-dummy.templates:2002 msgid "" "Please choose the method that should be used for integrating the TYPO3 " "installation with the apache2 web server:" msgstr "" "Veuillez choisir la méthode à utiliser pour intégrer l'installation de TYPO3 " "au serveur web Apache 2 :" #. Type: select #. Description #: ../typo3-dummy.templates:2002 msgid "" " vhost: generates URLs with TYPO3 as part of the domain name, such\n" " as http://typo3.example.com/;\n" " directory: fits TYPO3 within the existing site, making it available\n" " at an address like http://www.example.com/cms/;\n" " none: does not configure TYPO3 automatically. The server will\n" " need manual configuration. Choose this option if you are\n" " using a web server other than apache2." msgstr "" "hôte virtuel : crée des URL avec TYPO3 dans le nom de domaine,\n" " comme http://typo3.example.com/ ;\n" " répertoire : intègre TYPO3 au site existant, le rendant accessible\n" " à une adresse comme http://www.example.com/cms/ ;\n" " aucune : ne configure pas TYPO3 automatiquement. Le serveur\n" " devra être configuré manuellement. Choisir cette option\n" " pour utiliser un serveur web différent d'Apache 2." #. Type: boolean #. Description #: ../typo3-dummy.templates:3001 msgid "Should apache2 be restarted after installation?" msgstr "Apache 2 doit-il être redémarré après l'installation ?" #. Type: boolean #. Description #: ../typo3-dummy.templates:3001 msgid "" "Apache's configuration has been changed to include TYPO3 and activate the " "rewrite module. For these changes to take effect, apache2 must be reloaded." msgstr "" "TYPO3 a été intégré à la configuration d'Apache 2, et le module rewrite a " "été activé. Pour rendre ces modifications effectives, la configuration " "d'Apache 2 doit être rechargée." #. Type: note #. Description #: ../typo3-dummy.templates:4001 msgid "Old symlink in /etc/apache2/conf.d/" msgstr "Ancien lien symbolique dans /etc/apache2/conf.d/" #. Type: note #. Description #: ../typo3-dummy.templates:4001 msgid "" "Older versions (before 4.3.0-3) of typo3-dummy installed the apache2 " "configuration symlink as /etc/apache2/conf.d/typo3-dummy.conf." msgstr "" "Les anciennes versions (antérieures à 4.3.0-3) de typo3-dummy ajoutaient le " "lien symbolique /etc/apache2/conf.d/typo3-dummy.conf à la configuration " "d'Apache 2." #. Type: note #. Description #: ../typo3-dummy.templates:4001 msgid "" "This has been changed and newer versions place two new symlinks into /etc/" "apache2/sites-available/. To prevent failures due to overlapping " "configuration directives you should remove the symlink typo3-dummy.conf " "from /etc/apache2/conf.d/ and merge its contents into one of the new " "configuration files." msgstr "" "Ce comportement a été modifié et les dernières versions ajoutent deux liens " "symboliques à /etc/apache2/sites-available/. Pour éviter les erreurs dues au " "chevauchement des instructions de configuration, vous devriez enlever le " "lien symbolique typo3-dummy.conf de /etc/apache2/conf.d/ et fusionner son " "contenu dans l'un des nouveaux fichiers de configuration." debian/po/ru.po0000644000000000000000000001164412252640275010605 0ustar # translation of ru.po to Russian # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER # This file is distributed under the same license as the PACKAGE package. # # Yuri Kozlov , 2010. msgid "" msgstr "" "Project-Id-Version: typo3-dummy 4.3.0-4\n" "Report-Msgid-Bugs-To: typo3-dummy@packages.debian.org\n" "POT-Creation-Date: 2010-06-20 22:03+0200\n" "PO-Revision-Date: 2010-06-23 22:01+0400\n" "Last-Translator: Yuri Kozlov \n" "Language-Team: Russian \n" "Language: \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "X-Generator: KBabel 1.11.4\n" "Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n" "%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n" #. Type: select #. Choices #: ../typo3-dummy.templates:2001 msgid "vhost" msgstr "vhost" #. Type: select #. Choices #: ../typo3-dummy.templates:2001 msgid "directory" msgstr "каталог" #. Type: select #. Choices #: ../typo3-dummy.templates:2001 msgid "none" msgstr "нет" #. Type: select #. Description #: ../typo3-dummy.templates:2002 msgid "Apache integration mode:" msgstr "Способ встраивания в Apache:" #. Type: select #. Description #: ../typo3-dummy.templates:2002 msgid "" "Please choose the method that should be used for integrating the TYPO3 " "installation with the apache2 web server:" msgstr "" "Выберите метод, который нужно использовать для настройки TYPO3 в веб-сервере " "apache2:" #. Type: select #. Description #: ../typo3-dummy.templates:2002 msgid "" " vhost: generates URLs with TYPO3 as part of the domain name, such\n" " as http://typo3.example.com/;\n" " directory: fits TYPO3 within the existing site, making it available\n" " at an address like http://www.example.com/cms/;\n" " none: does not configure TYPO3 automatically. The server will\n" " need manual configuration. Choose this option if you are\n" " using a web server other than apache2." msgstr "" " vhost: сгенерировать URLы с TYPO3 как часть доменного имени,\n" " например http://typo3.example.com/;\n" " каталог: поместить TYPO3 в текущий сайт, сделав его доступным\n" " по адресу подобному http://www.example.com/cms/;\n" " нет: не настраивать автоматически TYPO3. Сервер нужно будет\n" " настроить вручную. Выберите этот пункт, если используете\n" " веб-сервер не apache2." #. Type: boolean #. Description #: ../typo3-dummy.templates:3001 msgid "Should apache2 be restarted after installation?" msgstr "Перезапустить apache2 после установки?" #. Type: boolean #. Description #: ../typo3-dummy.templates:3001 msgid "" "Apache's configuration has been changed to include TYPO3 and activate the " "rewrite module. For these changes to take effect, apache2 must be reloaded." msgstr "" "Для включения TYPO3 настройка apache была изменена и был активирован модуль " "rewrite. Чтобы эти изменения начали действовать, apache2 нужно перезапустить." #. Type: note #. Description #: ../typo3-dummy.templates:4001 msgid "Old symlink in /etc/apache2/conf.d/" msgstr "Старая символьная ссылка в /etc/apache2/conf.d/" #. Type: note #. Description #: ../typo3-dummy.templates:4001 msgid "" "Older versions (before 4.3.0-3) of typo3-dummy installed the apache2 " "configuration symlink as /etc/apache2/conf.d/typo3-dummy.conf." msgstr "" "Старые версии (до 4.3.0-3) пакета typo3-dummy устанавливали в apache2 " "символьную ссылку на файл настройки как /etc/apache2/conf.d/typo3-dummy.conf." #. Type: note #. Description #: ../typo3-dummy.templates:4001 msgid "" "This has been changed and newer versions place two new symlinks into /etc/" "apache2/sites-available/. To prevent failures due to overlapping " "configuration directives you should remove the symlink typo3-dummy.conf " "from /etc/apache2/conf.d/ and merge its contents into one of the new " "configuration files." msgstr "" "В новых версиях так больше не делается, в них есть две символьные ссылки в /" "etc/apache2/sites-available/. Чтобы избежать ошибок от перекрывания указаний " "настройки вам нужно удалить символьную ссылку typo3-dummy.conf из /etc/" "apache2/conf.d/ и объединить содержимое файла с одним из новых файлов " "настройки." debian/po/it.po0000644000000000000000000001056712252640275010576 0ustar # Italian translation of typo3 debconf messages # Copyright (C) 2013 Beatrice Torracca # This file is distributed under the same license as the typo3-dummy package. # Beatrice Torracca , 2013. msgid "" msgstr "" "Project-Id-Version: typo3\n" "Report-Msgid-Bugs-To: typo3-dummy@packages.debian.org\n" "POT-Creation-Date: 2010-06-20 22:03+0200\n" "PO-Revision-Date: 2013-06-02 16:03+0200\n" "Last-Translator: Beatrice Torracca \n" "Language-Team: Italian \n" "Language: it\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" "X-Generator: Virtaal 0.7.1\n" #. Type: select #. Choices #: ../typo3-dummy.templates:2001 msgid "vhost" msgstr "vhost" #. Type: select #. Choices #: ../typo3-dummy.templates:2001 msgid "directory" msgstr "directory" #. Type: select #. Choices #: ../typo3-dummy.templates:2001 msgid "none" msgstr "nessuna" #. Type: select #. Description #: ../typo3-dummy.templates:2002 msgid "Apache integration mode:" msgstr "Modalità di integrazione con Apache:" #. Type: select #. Description #: ../typo3-dummy.templates:2002 msgid "" "Please choose the method that should be used for integrating the TYPO3 " "installation with the apache2 web server:" msgstr "" "Scegliere il metodo che deve essere usato per integrare l'installazione di " "TYPO3 con il server web apache2:" #. Type: select #. Description #: ../typo3-dummy.templates:2002 msgid "" " vhost: generates URLs with TYPO3 as part of the domain name, such\n" " as http://typo3.example.com/;\n" " directory: fits TYPO3 within the existing site, making it available\n" " at an address like http://www.example.com/cms/;\n" " none: does not configure TYPO3 automatically. The server will\n" " need manual configuration. Choose this option if you are\n" " using a web server other than apache2." msgstr "" " vhost: genera URL con TYPO3 come parte del nome di dominio, come\n" " http://typo3.example.com/;\n" " directory: incorpora TYPO3 all'interno del sito esistente,\n" " rendendolo disponibile ad un indirizzo del tipo\n" " http://www.example.com/cms/;\n" " nessuna: non configura TYPO3 automaticamente. Sarà necessaria la\n" " configurazione manuale del server. Scegliere questa\n" " opzione se si sta usando un server web diverso da apache2." #. Type: boolean #. Description #: ../typo3-dummy.templates:3001 msgid "Should apache2 be restarted after installation?" msgstr "Riavviare apache2 dopo l'installazione?" #. Type: boolean #. Description #: ../typo3-dummy.templates:3001 msgid "" "Apache's configuration has been changed to include TYPO3 and activate the " "rewrite module. For these changes to take effect, apache2 must be reloaded." msgstr "" "La configurazione di Apache è stata modificata in modo da includere TYPO3 e " "attivare il modulo per la riscrittura. Affinché queste modifiche abbiano " "effetto è necessario ricaricare apache2." #. Type: note #. Description #: ../typo3-dummy.templates:4001 msgid "Old symlink in /etc/apache2/conf.d/" msgstr "Vecchio collegamento simbolico in /etc/apache2/conf.d/" #. Type: note #. Description #: ../typo3-dummy.templates:4001 msgid "" "Older versions (before 4.3.0-3) of typo3-dummy installed the apache2 " "configuration symlink as /etc/apache2/conf.d/typo3-dummy.conf." msgstr "" "Versioni più vecchie (precedenti la 4.3.0-3) di typo3-dummy installavano il " "collegamento simbolico per apache2 come " "/etc/apache2/conf.d/typo3-dummy.conf." #. Type: note #. Description #: ../typo3-dummy.templates:4001 msgid "" "This has been changed and newer versions place two new symlinks into /etc/" "apache2/sites-available/. To prevent failures due to overlapping " "configuration directives you should remove the symlink typo3-dummy.conf " "from /etc/apache2/conf.d/ and merge its contents into one of the new " "configuration files." msgstr "" "Questo comportamento è stato cambiato e le versioni più recenti mettono due " "nuovi collegamenti simbolici in /etc/apache2/sites-available/. Per evitare " "malfunzionamenti a causa di direttive di configurazione sovrapposte, si deve " "rimuovere il collegamento simbolico typo3-dummy.conf da " "/etc/apache2/conf.d/ e riunire il suo contenuto in uno dei nuovi file di " "configurazione." debian/po/templates.pot0000644000000000000000000000541212252640275012335 0ustar # SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER # This file is distributed under the same license as the PACKAGE package. # FIRST AUTHOR , YEAR. # #, fuzzy msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: typo3-dummy@packages.debian.org\n" "POT-Creation-Date: 2010-06-20 22:03+0200\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" "Language: \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=CHARSET\n" "Content-Transfer-Encoding: 8bit\n" #. Type: select #. Choices #: ../typo3-dummy.templates:2001 msgid "vhost" msgstr "" #. Type: select #. Choices #: ../typo3-dummy.templates:2001 msgid "directory" msgstr "" #. Type: select #. Choices #: ../typo3-dummy.templates:2001 msgid "none" msgstr "" #. Type: select #. Description #: ../typo3-dummy.templates:2002 msgid "Apache integration mode:" msgstr "" #. Type: select #. Description #: ../typo3-dummy.templates:2002 msgid "" "Please choose the method that should be used for integrating the TYPO3 " "installation with the apache2 web server:" msgstr "" #. Type: select #. Description #: ../typo3-dummy.templates:2002 msgid "" " vhost: generates URLs with TYPO3 as part of the domain name, such\n" " as http://typo3.example.com/;\n" " directory: fits TYPO3 within the existing site, making it available\n" " at an address like http://www.example.com/cms/;\n" " none: does not configure TYPO3 automatically. The server will\n" " need manual configuration. Choose this option if you are\n" " using a web server other than apache2." msgstr "" #. Type: boolean #. Description #: ../typo3-dummy.templates:3001 msgid "Should apache2 be restarted after installation?" msgstr "" #. Type: boolean #. Description #: ../typo3-dummy.templates:3001 msgid "" "Apache's configuration has been changed to include TYPO3 and activate the " "rewrite module. For these changes to take effect, apache2 must be reloaded." msgstr "" #. Type: note #. Description #: ../typo3-dummy.templates:4001 msgid "Old symlink in /etc/apache2/conf.d/" msgstr "" #. Type: note #. Description #: ../typo3-dummy.templates:4001 msgid "" "Older versions (before 4.3.0-3) of typo3-dummy installed the apache2 " "configuration symlink as /etc/apache2/conf.d/typo3-dummy.conf." msgstr "" #. Type: note #. Description #: ../typo3-dummy.templates:4001 msgid "" "This has been changed and newer versions place two new symlinks into /etc/" "apache2/sites-available/. To prevent failures due to overlapping " "configuration directives you should remove the symlink typo3-dummy.conf " "from /etc/apache2/conf.d/ and merge its contents into one of the new " "configuration files." msgstr "" debian/po/da.po0000644000000000000000000001024412252640275010536 0ustar # Danish translation typo3-dummy. # Copyright (c) 2010 typo3-dummy & nedenstående oversættere. # This file is distributed under the same license as the typo3-dummy package. # Joe Hansen , 2010. # msgid "" msgstr "" "Project-Id-Version: typo3-dummy\n" "Report-Msgid-Bugs-To: typo3-dummy@packages.debian.org\n" "POT-Creation-Date: 2010-06-20 22:03+0200\n" "PO-Revision-Date: 2010-07-07 17:34+0000\n" "Last-Translator: Joe Hansen \n" "Language-Team: Danish \n" "Language: da\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" #. Type: select #. Choices #: ../typo3-dummy.templates:2001 msgid "vhost" msgstr "vhost" #. Type: select #. Choices #: ../typo3-dummy.templates:2001 msgid "directory" msgstr "mappe" #. Type: select #. Choices #: ../typo3-dummy.templates:2001 msgid "none" msgstr "ingen" #. Type: select #. Description #: ../typo3-dummy.templates:2002 msgid "Apache integration mode:" msgstr "Apacheintegrationstilstand:" #. Type: select #. Description #: ../typo3-dummy.templates:2002 msgid "" "Please choose the method that should be used for integrating the TYPO3 " "installation with the apache2 web server:" msgstr "" "Vælg venligst metoden som skal bruges til integrering af TYPO3-" "installationen med apache2-internetserveren:" #. Type: select #. Description #: ../typo3-dummy.templates:2002 msgid "" " vhost: generates URLs with TYPO3 as part of the domain name, such\n" " as http://typo3.example.com/;\n" " directory: fits TYPO3 within the existing site, making it available\n" " at an address like http://www.example.com/cms/;\n" " none: does not configure TYPO3 automatically. The server will\n" " need manual configuration. Choose this option if you are\n" " using a web server other than apache2." msgstr "" " vhost: genererer URL'er med TYPO3 som en del af domænenavnet, såsom\n" " http://typo3.example.com/;\n" " directory: tilpasser TYPO3 indenfor den eksisterende side, hvilket gør den " "tilgængelig\n" " på en adresse som http://www.example.com/cms/;\n" " none: konfigurer ikke TYPO3 automatisk. Serveren vil\n" " kræve en manuel konfiguration. Vælg denne indstilling hvis du " "bruger\n" " en internetserver forskellig fra apache2." #. Type: boolean #. Description #: ../typo3-dummy.templates:3001 msgid "Should apache2 be restarted after installation?" msgstr "Skal apache2 genstartes efter installation?" #. Type: boolean #. Description #: ../typo3-dummy.templates:3001 msgid "" "Apache's configuration has been changed to include TYPO3 and activate the " "rewrite module. For these changes to take effect, apache2 must be reloaded." msgstr "" "Apaches konfiguration er blevet ændret, så den inkluderer TYPO3 og aktiverer " "genskrivmodulet. For at disse ændringer kan træde i kraft skal apache2 " "genindlæses." #. Type: note #. Description #: ../typo3-dummy.templates:4001 msgid "Old symlink in /etc/apache2/conf.d/" msgstr "Gammel symbolsk henvisning i /etc/apache2/conf.d/" #. Type: note #. Description #: ../typo3-dummy.templates:4001 msgid "" "Older versions (before 4.3.0-3) of typo3-dummy installed the apache2 " "configuration symlink as /etc/apache2/conf.d/typo3-dummy.conf." msgstr "" "Ældre version (før 4.3.0-3) af typo3-dummy installerede den symbolske " "henvisning for apache som /etc/apache27conf.d/typo3-dummy.conf." #. Type: note #. Description #: ../typo3-dummy.templates:4001 msgid "" "This has been changed and newer versions place two new symlinks into /etc/" "apache2/sites-available/. To prevent failures due to overlapping " "configuration directives you should remove the symlink typo3-dummy.conf " "from /etc/apache2/conf.d/ and merge its contents into one of the new " "configuration files." msgstr "" "Dette er blevet ændret og nyere versioner placerer to nye symbolske " "henvisninger i /etc/apache2/sites-available/. For at forhindre fejl på grund " "af overlappende konfigurationsdirektiver skal du fjerne den symbolske " "henvisning typo3-dummy.conf fra /etc/apache2/conf.d/ og flette dens indhold " "ind i en af de nye konfigurationsfiler." debian/po/de.po0000644000000000000000000001050112252640275010536 0ustar # German translation of typo3-dummy. # Copyright (C) 2003-2006 Kaspar Skaarhoj. # This file is distributed under the same license as the typo3-dummy package. # Chris Leick , 2010. # msgid "" msgstr "" "Project-Id-Version: typo3-dummy 4.3.0-4\n" "Report-Msgid-Bugs-To: typo3-dummy@packages.debian.org\n" "POT-Creation-Date: 2010-06-20 22:03+0200\n" "PO-Revision-Date: 2010-06-23 12:47+0200\n" "Last-Translator: Chris Leick \n" "Language-Team: German \n" "Language: de\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" #. Type: select #. Choices #: ../typo3-dummy.templates:2001 msgid "vhost" msgstr "Vhost" #. Type: select #. Choices #: ../typo3-dummy.templates:2001 msgid "directory" msgstr "Verzeichnis" #. Type: select #. Choices #: ../typo3-dummy.templates:2001 msgid "none" msgstr "keine" #. Type: select #. Description #: ../typo3-dummy.templates:2002 msgid "Apache integration mode:" msgstr "Apache-Integrationsmodus:" #. Type: select #. Description #: ../typo3-dummy.templates:2002 msgid "" "Please choose the method that should be used for integrating the TYPO3 " "installation with the apache2 web server:" msgstr "" "Bitte wählen Sie die Methode, die für die Integration der TYPO3-Installation " "mit dem Apache2-Webserver benutzt werden soll:" #. Type: select #. Description #: ../typo3-dummy.templates:2002 msgid "" " vhost: generates URLs with TYPO3 as part of the domain name, such\n" " as http://typo3.example.com/;\n" " directory: fits TYPO3 within the existing site, making it available\n" " at an address like http://www.example.com/cms/;\n" " none: does not configure TYPO3 automatically. The server will\n" " need manual configuration. Choose this option if you are\n" " using a web server other than apache2." msgstr "" " Vhost: erstellt URLs mit TYPO3 als Teil des Domain-Namens, wie\n" " beispielsweise http://typo3.beispiel.com/;\n" " Verzeichnis: passt TYPO3 innerhalb einer existierenden Site ein und macht\n" " es unter einer Adresse, wie http://www.beispiel.com/cms/\n" " verfügbar;\n" " keine: konfiguriert TYPO3 nicht automatisch. Der Server wird eine\n" " manuelle Konfiguration benötigen. Benutzen Sie diese Option,\n" " falls Sie einen anderen Webserver als Apache2 benutzen." #. Type: boolean #. Description #: ../typo3-dummy.templates:3001 msgid "Should apache2 be restarted after installation?" msgstr "Soll Apache2 nach der Installation neu gestartet werden?" #. Type: boolean #. Description #: ../typo3-dummy.templates:3001 msgid "" "Apache's configuration has been changed to include TYPO3 and activate the " "rewrite module. For these changes to take effect, apache2 must be reloaded." msgstr "" "Apaches Konfiguration wurde geändert, um TYPO3 einzufügen und das »Rewrite«-" "Modul zu aktivieren. Damit diese Änderungen wirksam werden, muss Apache2 neu " "geladen werden." #. Type: note #. Description #: ../typo3-dummy.templates:4001 msgid "Old symlink in /etc/apache2/conf.d/" msgstr "Alter symbolischer Verweis in /etc/apache2/conf.d/" #. Type: note #. Description #: ../typo3-dummy.templates:4001 msgid "" "Older versions (before 4.3.0-3) of typo3-dummy installed the apache2 " "configuration symlink as /etc/apache2/conf.d/typo3-dummy.conf." msgstr "" "Alte Versionen (vor 4.3.0-3) von Typo3-dummy installierten den symbolischen " "Apache2-Konfigurationsverweis als /etc/apache2/conf.d/typo3-dummy.conf." #. Type: note #. Description #: ../typo3-dummy.templates:4001 msgid "" "This has been changed and newer versions place two new symlinks into /etc/" "apache2/sites-available/. To prevent failures due to overlapping " "configuration directives you should remove the symlink typo3-dummy.conf " "from /etc/apache2/conf.d/ and merge its contents into one of the new " "configuration files." msgstr "" "Dies wurde geändert und neuere Versionen platzieren zwei neue symbolische " "Verweise in /etc/apache2/sites-available/. Um einen Misserfolg infolge des " "Überschneidens von Konfigurationsdirektiven zu vermeiden, sollten Sie den " "symbolischen Verweis typo3-dummy.conf aus /etc/apache2/conf.d/ entfernen und " "dessen Inhalte in einer der neuen Konfigurationsdateien zusammenführen." debian/po/cs.po0000644000000000000000000001024412252640275010557 0ustar # Czech translation of PO debconf template for package typo3-dummy. # Copyright (C) 2010 Michal Simunek # This file is distributed under the same license as the typo3-dummy package. # Michal Simunek , 2010. # msgid "" msgstr "" "Project-Id-Version: typo3-dummy 4.3.0-4\n" "Report-Msgid-Bugs-To: typo3-dummy@packages.debian.org\n" "POT-Creation-Date: 2010-06-20 22:03+0200\n" "PO-Revision-Date: 2010-06-26 17:04+0200\n" "Last-Translator: Michal Simunek \n" "Language-Team: Czech \n" "Language: cs\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" #. Type: select #. Choices #: ../typo3-dummy.templates:2001 msgid "vhost" msgstr "vhost" #. Type: select #. Choices #: ../typo3-dummy.templates:2001 msgid "directory" msgstr "adresář" #. Type: select #. Choices #: ../typo3-dummy.templates:2001 msgid "none" msgstr "žádný" #. Type: select #. Description #: ../typo3-dummy.templates:2002 msgid "Apache integration mode:" msgstr "Režim začlenění do Apache:" #. Type: select #. Description #: ../typo3-dummy.templates:2002 msgid "" "Please choose the method that should be used for integrating the TYPO3 " "installation with the apache2 web server:" msgstr "" "Zvolte si prosím způsob, který se má použít pro začlenění instalace TYPO3 do " "webového serveru apache2:" #. Type: select #. Description #: ../typo3-dummy.templates:2002 msgid "" " vhost: generates URLs with TYPO3 as part of the domain name, such\n" " as http://typo3.example.com/;\n" " directory: fits TYPO3 within the existing site, making it available\n" " at an address like http://www.example.com/cms/;\n" " none: does not configure TYPO3 automatically. The server will\n" " need manual configuration. Choose this option if you are\n" " using a web server other than apache2." msgstr "" " vhost: vytvoří URL adresy s TYPO3 jako částí domény, jako\n" " je http://typo3.example.com/;\n" " adresář: připojí TYPO3 k existujícímu webu, bude dostupný\n" " na adrese, jako je http://www.example.com/cms/;\n" " žádný: TYPO3 se automaticky nenastaví. Server bude\n" " třeba nastavit ručně. Tuto možnost zvolte, pokud\n" " používáte jiný webový server než apache2." #. Type: boolean #. Description #: ../typo3-dummy.templates:3001 msgid "Should apache2 be restarted after installation?" msgstr "Má se po instalaci restartovat apache2?" #. Type: boolean #. Description #: ../typo3-dummy.templates:3001 msgid "" "Apache's configuration has been changed to include TYPO3 and activate the " "rewrite module. For these changes to take effect, apache2 must be reloaded." msgstr "" "Nastavení Apache bylo změněno, aby zahrnovalo TYPO3 a byl aktivován modul " "rewrite. Aby se tyto změny projevili, apache2 musí být restartován." #. Type: note #. Description #: ../typo3-dummy.templates:4001 msgid "Old symlink in /etc/apache2/conf.d/" msgstr "Původní symbolický odkaz v /etc/apache2/conf.d/" #. Type: note #. Description #: ../typo3-dummy.templates:4001 msgid "" "Older versions (before 4.3.0-3) of typo3-dummy installed the apache2 " "configuration symlink as /etc/apache2/conf.d/typo3-dummy.conf." msgstr "" "Starší verze typo3-dummy (před 4.3.0-3) instalovaly symbolický odkaz pro " "nastavení apache2 do /etc/apache2/conf.d/typo3-dummy.conf." #. Type: note #. Description #: ../typo3-dummy.templates:4001 msgid "" "This has been changed and newer versions place two new symlinks into /etc/" "apache2/sites-available/. To prevent failures due to overlapping " "configuration directives you should remove the symlink typo3-dummy.conf " "from /etc/apache2/conf.d/ and merge its contents into one of the new " "configuration files." msgstr "" "To bylo změněno a novější verze přidávají dva nové symbolické odkazy do /etc/" "apache2/sites-available/. Abyste předešli selháním v důsledku souběžných " "direktiv nastavení, měli byste z /etc/apache2/conf.d/ odstranit symbolický " "odkaz typo3-dummy.conf a jeho obsah připojit do jednoho z nových souborů s " "nastavením." debian/po/es.po0000644000000000000000000001206712252640275010566 0ustar # typo3-dummy po-debconf translation to Spanish # Copyright (C) 2010 Software in the Public Interest # This file is distributed under the same license as the typo3-dummy package. # # Changes: # - Initial translation # Francisco Javier Cuadrado , 2010 # # Traductores, si no conocen el formato PO, merece la pena leer la # documentación de gettext, especialmente las secciones dedicadas a este # formato, por ejemplo ejecutando: # info -n '(gettext)PO Files' # info -n '(gettext)Header Entry' # # Equipo de traducción al español, por favor lean antes de traducir # los siguientes documentos: # # - El proyecto de traducción de Debian al español # http://www.debian.org/intl/spanish/ # especialmente las notas y normas de traducción en # http://www.debian.org/intl/spanish/notas # # - La guía de traducción de po's de debconf: # /usr/share/doc/po-debconf/README-trans # o http://www.debian.org/intl/l10n/po-debconf/README-trans # msgid "" msgstr "" "Project-Id-Version: typo3-dummy 4.3.0-4\n" "Report-Msgid-Bugs-To: typo3-dummy@packages.debian.org\n" "POT-Creation-Date: 2010-06-20 22:03+0200\n" "PO-Revision-Date: 2010-06-22 20:09+0100\n" "Last-Translator: Francisco Javier Cuadrado \n" "Language-Team: Debian l10n Spanish \n" "Language: \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" #. Type: select #. Choices #: ../typo3-dummy.templates:2001 msgid "vhost" msgstr "vhost" #. Type: select #. Choices #: ../typo3-dummy.templates:2001 msgid "directory" msgstr "directorio" #. Type: select #. Choices #: ../typo3-dummy.templates:2001 msgid "none" msgstr "ninguno" #. Type: select #. Description #: ../typo3-dummy.templates:2002 msgid "Apache integration mode:" msgstr "Modo de integración de apache:" #. Type: select #. Description #: ../typo3-dummy.templates:2002 msgid "" "Please choose the method that should be used for integrating the TYPO3 " "installation with the apache2 web server:" msgstr "" "Escoja el método que se debería utilizar para la integración de TYPO3 con el " "servidor web apache2:" #. Type: select #. Description #: ../typo3-dummy.templates:2002 msgid "" " vhost: generates URLs with TYPO3 as part of the domain name, such\n" " as http://typo3.example.com/;\n" " directory: fits TYPO3 within the existing site, making it available\n" " at an address like http://www.example.com/cms/;\n" " none: does not configure TYPO3 automatically. The server will\n" " need manual configuration. Choose this option if you are\n" " using a web server other than apache2." msgstr "" " vhost: genera URL con TYPO3 como parte del nombre del dominio,\n" " como «http://typo3.ejemplo.com/».\n" " directorio: ajusta TYPO3 en el sitio existente, haciéndolo disponible\n" " en una dirección como «http://www.ejemplo.com/cms/».\n" " ninguno: no configura TYPO3 automáticamente. El servidor deberá\n" " configurarse manualmente. Escoja esta opción si está utilizando\n" " un servidor web distinto a apache2." #. Type: boolean #. Description #: ../typo3-dummy.templates:3001 msgid "Should apache2 be restarted after installation?" msgstr "¿Se debería reiniciar apache2 después de la instalación?" #. Type: boolean #. Description #: ../typo3-dummy.templates:3001 msgid "" "Apache's configuration has been changed to include TYPO3 and activate the " "rewrite module. For these changes to take effect, apache2 must be reloaded." msgstr "" "La configuración de apache ha cambiado para incluir TYPO3 y activar el " "módulo «rewrite». Para que estos cambios tengan efecto, se debe recargar " "apache2." #. Type: note #. Description #: ../typo3-dummy.templates:4001 msgid "Old symlink in /etc/apache2/conf.d/" msgstr "Enlace simbólico antiguo en «/etc/apache2/conf.d/»" #. Type: note #. Description #: ../typo3-dummy.templates:4001 msgid "" "Older versions (before 4.3.0-3) of typo3-dummy installed the apache2 " "configuration symlink as /etc/apache2/conf.d/typo3-dummy.conf." msgstr "" "Las versiones antiguas (antes de la 4.3.0-3) de typo3-dummy instalaban el " "enlace simbólico a la configuración de apache como «/etc/apache2/conf.d/" "typo3-dummy.conf»." #. Type: note #. Description #: ../typo3-dummy.templates:4001 msgid "" "This has been changed and newer versions place two new symlinks into /etc/" "apache2/sites-available/. To prevent failures due to overlapping " "configuration directives you should remove the symlink typo3-dummy.conf " "from /etc/apache2/conf.d/ and merge its contents into one of the new " "configuration files." msgstr "" "Esto ha cambiado y las nuevas versiones tienen dos enlaces simbólicos nuevos " "en «/etc/apache2/sites-available/». Para evitar fallos debidos a la " "solapación de las directivas de configuración debería eliminar el enlace " "simbólico de «typo3-dummy.conf» del directorio «/etc/apache2/conf.d/» y unir " "el contenido de ambos en uno de los nuevos archivos de configuración." debian/po/ja.po0000644000000000000000000001101612252640275010542 0ustar # Copyright (C) 2010 Christian Welzel # This file is distributed under the same license as the typo3-dummy package. # Hideki Yamane , 2010. # msgid "" msgstr "" "Project-Id-Version: typo3-dummy 4.3.0-4\n" "Report-Msgid-Bugs-To: typo3-dummy@packages.debian.org\n" "POT-Creation-Date: 2010-06-20 22:03+0200\n" "PO-Revision-Date: 2010-09-22 08:04+0900\n" "Last-Translator: Hideki Yamane \n" "Language-Team: Japanese \n" "Language: Japanese\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" #. Type: select #. Choices #: ../typo3-dummy.templates:2001 msgid "vhost" msgstr "仮想ホスト" #. Type: select #. Choices #: ../typo3-dummy.templates:2001 msgid "directory" msgstr "ディレクトリ" #. Type: select #. Choices #: ../typo3-dummy.templates:2001 msgid "none" msgstr "設定しない" #. Type: select #. Description #: ../typo3-dummy.templates:2002 msgid "Apache integration mode:" msgstr "apache への統合方法:" #. Type: select #. Description #: ../typo3-dummy.templates:2002 msgid "" "Please choose the method that should be used for integrating the TYPO3 " "installation with the apache2 web server:" msgstr "" "apache2 ウェブサーバに対して TYPO3 のインストールを統合する方法を選んでください:" #. Type: select #. Description #: ../typo3-dummy.templates:2002 msgid "" " vhost: generates URLs with TYPO3 as part of the domain name, such\n" " as http://typo3.example.com/;\n" " directory: fits TYPO3 within the existing site, making it available\n" " at an address like http://www.example.com/cms/;\n" " none: does not configure TYPO3 automatically. The server will\n" " need manual configuration. Choose this option if you are\n" " using a web server other than apache2." msgstr "" " 仮想ホスト: http://typo3.example.com/ のように TYPO3 をドメイン名の一部\n" " として URL を生成します。\n" " ディレクトリ: TYPO3 を既存のサイトに合わせて http://www.example.com/cms/ \n" " のようなアドレスで利用できるようにします。\n" " 設定しない: TYPO3 を自動的には設定しません。サーバは手動で設定が必要です。\n" " apache2 以外のウェブサーバを利用している場合はこのオプション\n" " を選んでください" #. Type: boolean #. Description #: ../typo3-dummy.templates:3001 msgid "Should apache2 be restarted after installation?" msgstr "インストール後に apache2 を再起動しますか?" #. Type: boolean #. Description #: ../typo3-dummy.templates:3001 msgid "" "Apache's configuration has been changed to include TYPO3 and activate the " "rewrite module. For these changes to take effect, apache2 must be reloaded." msgstr "" "Apache の設定は TYPO3 を含めて rewrite モジュールを有効にするように変更されました。" "これらの変更を有効にするには、apache2 の設定を再読み込みする必要があります。" #. Type: note #. Description #: ../typo3-dummy.templates:4001 msgid "Old symlink in /etc/apache2/conf.d/" msgstr "/etc/apache2/conf.d/ 中の古いシンボリックリンク" #. Type: note #. Description #: ../typo3-dummy.templates:4001 msgid "" "Older versions (before 4.3.0-3) of typo3-dummy installed the apache2 " "configuration symlink as /etc/apache2/conf.d/typo3-dummy.conf." msgstr "" "(4.3.0-3 より前の) 古いバージョンの typo3-dummy は apache2 の設定シンボリック" "リンクを /etc/apache2/conf.d/typo3-dummy.conf としてインストールしていました。" #. Type: note #. Description #: ../typo3-dummy.templates:4001 msgid "" "This has been changed and newer versions place two new symlinks into /etc/" "apache2/sites-available/. To prevent failures due to overlapping " "configuration directives you should remove the symlink typo3-dummy.conf " "from /etc/apache2/conf.d/ and merge its contents into one of the new " "configuration files." msgstr "" "この動作は変更され、新しいバージョンでは 2 つのシンボリックリンクを /etc/" "apache2/sites-available/ に配置するようになりました。設定ディレクティブの上書" "きによる失敗を防ぐため、/etc/apache2/conf.d/ からシンボリックリンク typo3-" "dummy.conf を削除し、内容を新しい設定ファイルのどちらかにマージする必要が" "あります。" debian/po/POTFILES.in0000644000000000000000000000006112252640275011363 0ustar [type: gettext/rfc822deb] typo3-dummy.templates debian/typo3-src-4.5.links0000644000000000000000000000164512252640275012412 0ustar /usr/share/fonts/truetype/ttf-bitstream-vera/Vera.ttf usr/share/typo3/typo3_src-4.5/t3lib/fonts/vera.ttf /usr/share/javascript/prototype/prototype-1.js usr/share/typo3/typo3_src-4.5/typo3/contrib/prototype/prototype.js /usr/share/javascript/scriptaculous usr/share/typo3/typo3_src-4.5/typo3/contrib/scriptaculous /usr/share/php/adodb usr/share/typo3/typo3_src-4.5/typo3/sysext/adodb/adodb /usr/share/php/Swift usr/share/typo3/typo3_src-4.5/typo3/contrib/swiftmailer /usr/share/javascript/swfupload usr/share/typo3/typo3_src-4.5/typo3/contrib/swfupload /usr/share/javascript/swfobject usr/share/typo3/typo3_src-4.5/typo3/contrib/flashmedia/swfobject /usr/share/javascript/swfobject/expressInstall.swf usr/share/typo3/typo3_src-4.5/typo3/contrib/extjs/resources/expressinstall.swf