diff options
| author | czaks <marcin@6irc.net> | 2013-08-05 06:03:40 -0400 |
|---|---|---|
| committer | czaks <marcin@6irc.net> | 2013-08-05 06:03:40 -0400 |
| commit | a84c4510fccfdc0cfb6f187633daea10dc70f326 (patch) | |
| tree | 6077f5211196ae40cac0184bb7cc67b81d320b0b | |
| parent | 33c7abf11f3a9b5c0964a2d7a25533c2849dbc78 (diff) | |
| parent | a8327c3a37fd22d2aa5d63061c9d3eaa30ae425a (diff) | |
Merge branch 'master' of github.com:vichan-devel/Tinyboard
Conflicts:
js/post-hider.js
252 files changed, 22330 insertions, 4836 deletions
@@ -17,16 +17,21 @@ license. It is written in PHP and has few dependencies. Requirements ------------ 1. PHP >= 5.2.5 -2. [mbstring](http://www.php.net/manual/en/mbstring.installation.php) - (--enable-mbstring) -3. [PHP-GD](http://php.net/manual/en/book.image.php) -4. [PHP-PDO](http://php.net/manual/en/book.pdo.php) - (only MySQL is supported at the moment) +2. MySQL server +3. [mbstring](http://www.php.net/manual/en/mbstring.installation.php) +4. [PHP GD](http://www.php.net/manual/en/intro.image.php) +5. [PHP PDO](http://www.php.net/manual/en/intro.pdo.php) We try to make sure Tinyboard is compatible with all major web servers and operating systems. Tinyboard does not include an Apache ```.htaccess``` file nor does it need one. +### Recommended +1. PHP >= 5.3 +2. MySQL server >= 5.5.3 +3. ImageMagick or command-line version (```convert``` and ```identify```) +4. [APC (Alternative PHP Cache)](http://php.net/manual/en/book.apc.php), [XCache](http://xcache.lighttpd.net/) or [Memcached](http://www.php.net/manual/en/intro.memcached.php) + Contributing ------------ You can contribute to Tinyboard by: @@ -65,7 +70,7 @@ find support from a variety of sources: * Documentation can be found [here](http://tinyboard.org/docs/). * You can join Tinyboard's IRC channel for support and general queries: [irc.datnode.net #tinyboard](irc://irc.datnode.net/tinyboard). -* You can find enterprise-grade support at [tinyboard.org](http://tinyboard.org/#support). +* You may find help at [tinyboard.org](http://tinyboard.org/#help). License -------- @@ -1,7 +1,7 @@ <?php require_once 'inc/functions.php'; checkBan(); - print "<html><head>Banned?</head><body>"; - print "<h1>Nie jestes zbanowany.</h1>"; + print "<!doctype html><html><head><meta charset='utf-8'><title>"._("Banned?")."</title></head><body>"; + print "<h1>"._("You are not banned.")."</h1>"; print "</body></html>"; ?> diff --git a/imgcaptcha_im.php b/imgcaptcha_im.php deleted file mode 100644 index 152d92ad..00000000 --- a/imgcaptcha_im.php +++ /dev/null @@ -1,7 +0,0 @@ -<?php - require_once("inc/functions.php"); - require_once("inc/imgcaptcha.php"); - $t = $_GET["cr"]; - header("Content-Type: image/png"); - generateImage($t); -?> diff --git a/imgcaptcha_p.php b/imgcaptcha_p.php deleted file mode 100644 index 9543dc6c..00000000 --- a/imgcaptcha_p.php +++ /dev/null @@ -1,5 +0,0 @@ -<?php - require_once("inc/functions.php"); - require_once("inc/imgcaptcha.php"); - print generateCaptchaHash(); -?> diff --git a/inc/anti-bot.php b/inc/anti-bot.php index bf29b3cb..fde97096 100644 --- a/inc/anti-bot.php +++ b/inc/anti-bot.php @@ -182,12 +182,12 @@ function _create_antibot($board, $thread) { $antibot = new AntiBot(array($board, $thread)); - query('DELETE FROM `antispam` WHERE `expires` < UNIX_TIMESTAMP()') or error(db_error()); + query('DELETE FROM ``antispam`` WHERE `expires` < UNIX_TIMESTAMP()') or error(db_error()); if ($thread) - $query = prepare('UPDATE `antispam` SET `expires` = UNIX_TIMESTAMP() + :expires WHERE `board` = :board AND `thread` = :thread AND `expires` IS NULL'); + $query = prepare('UPDATE ``antispam`` SET `expires` = UNIX_TIMESTAMP() + :expires WHERE `board` = :board AND `thread` = :thread AND `expires` IS NULL'); else - $query = prepare('UPDATE `antispam` SET `expires` = UNIX_TIMESTAMP() + :expires WHERE `board` = :board AND `thread` IS NULL AND `expires` IS NULL'); + $query = prepare('UPDATE ``antispam`` SET `expires` = UNIX_TIMESTAMP() + :expires WHERE `board` = :board AND `thread` IS NULL AND `expires` IS NULL'); $query->bindValue(':board', $board); if ($thread) @@ -195,7 +195,7 @@ function _create_antibot($board, $thread) { $query->bindValue(':expires', $config['spam']['hidden_inputs_expire']); $query->execute() or error(db_error($query)); - $query = prepare('INSERT INTO `antispam` VALUES (:board, :thread, :hash, UNIX_TIMESTAMP(), NULL, 0)'); + $query = prepare('INSERT INTO ``antispam`` VALUES (:board, :thread, :hash, UNIX_TIMESTAMP(), NULL, 0)'); $query->bindValue(':board', $board); $query->bindValue(':thread', $thread); $query->bindValue(':hash', $antibot->hash()); @@ -248,7 +248,7 @@ function checkSpam(array $extra_salt = array()) { if ($hash != $_hash) return true; - $query = prepare('SELECT `passed` FROM `antispam` WHERE `hash` = :hash'); + $query = prepare('SELECT `passed` FROM ``antispam`` WHERE `hash` = :hash'); $query->bindValue(':hash', $hash); $query->execute() or error(db_error($query)); if ((($passed = $query->fetchColumn(0)) === false) || ($passed > $config['spam']['hidden_inputs_max_pass'])) { @@ -260,7 +260,7 @@ function checkSpam(array $extra_salt = array()) { } function incrementSpamHash($hash) { - $query = prepare('UPDATE `antispam` SET `passed` = `passed` + 1 WHERE `hash` = :hash'); + $query = prepare('UPDATE ``antispam`` SET `passed` = `passed` + 1 WHERE `hash` = :hash'); $query->bindValue(':hash', $hash); $query->execute() or error(db_error($query)); } diff --git a/inc/config.php b/inc/config.php index 6860ba42..54b60bf3 100644 --- a/inc/config.php +++ b/inc/config.php @@ -29,45 +29,53 @@ * General/misc settings * ======================= */ - // Blotter -- the simple version. - //$config['blotter'] = 'This is an important announcement!'; - - // Automatically check if a newer version of Tinyboard is available when an administrator logs in + + // Global announcement -- the very simple version. + // This used to be wrongly named $config['blotter'] (still exists as an alias). + // $config['global_message'] = 'This is an important announcement!'; + $config['blotter'] = &$config['global_message']; + + // Automatically check if a newer version of Tinyboard is available when an administrator logs in. $config['check_updates'] = true; // How often to check for updates $config['check_updates_time'] = 43200; // 12 hours - - // Shows some extra information at the bottom of pages. Good for debugging development. + + // Shows some extra information at the bottom of pages. Good for development/debugging. $config['debug'] = false; - // For development purposes. Turns 'display_errors' on. Not recommended for production. + // For development purposes. Displays (and "dies" on) all errors and warnings. Turn on with the above. $config['verbose_errors'] = true; - - // Directory where temporary files will be created. Not really used much yet except for some experimental stuff. + + // Directory where temporary files will be created. $config['tmp'] = sys_get_temp_dir(); - + // The HTTP status code to use when redirecting. http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html // Can be either 303 "See Other" or 302 "Found". (303 is more correct but both should work.) + // There is really no reason for you to ever need to change this. $config['redirect_http'] = 303; - - // A small file in the main directory indicating that the script has been ran and the board(s) have been generated. - // This keeps the script from querying the database and causing strain when not needed. + + // A tiny text file in the main directory indicating that the script has been ran and the board(s) have + // been generated. This keeps the script from querying the database and causing strain when not needed. $config['has_installed'] = '.installed'; - + // Use syslog() for logging all error messages and unauthorized login attempts. $config['syslog'] = false; - + // Use `host` via shell_exec() to lookup hostnames, avoiding query timeouts. May not work on your system. // Requires safe_mode to be disabled. $config['dns_system'] = false; + // When executing most command-line tools (such as `convert` for ImageMagick image processing), add this + // to the environment path (seperated by :). + $config['shell_path'] = '/usr/local/bin'; + /* * ==================== * Database settings * ==================== */ - - // SQL driver ("mysql", "pgsql", "sqlite", "dblib", etc) - // http://www.php.net/manual/en/pdo.drivers.php + + // Database driver (http://www.php.net/manual/en/pdo.drivers.php) + // Only MySQL is supported by Tinyboard at the moment, sorry. $config['db']['type'] = 'mysql'; // Hostname or IP address $config['db']['server'] = 'localhost'; @@ -76,63 +84,77 @@ $config['db']['password'] = ''; // Tinyboard database $config['db']['database'] = ''; + // Table prefix + $config['db']['prefix'] = ''; // Use a persistent connection (experimental) $config['db']['persistent'] = false; // Anything more to add to the DSN string (eg. port=xxx;foo=bar) - $config['db']['dsn'] = 'charset=UTF8'; + $config['db']['dsn'] = ''; // Timeout duration in seconds (not all drivers support this) $config['db']['timeout'] = 5; - + /* * ==================== * Cache settings * ==================== */ - - $config['cache']['enabled'] = false; - // $config['cache']['enabled'] = 'memcached'; - // $config['cache']['enabled'] = 'redis'; - // $config['cache']['enabled'] = 'apc'; - // $config['cache']['enabled'] = 'xcache'; - - // Timeout for cached objects such as posts and HTML - $config['cache']['timeout'] = 43200; // 12 hours - - // Optional prefix if you're running multiple Tinyboard instances on the same machine + + /* + * On top of the static file caching system, you can enable the additional caching system which is + * designed to minimize SQL queries and can significantly increase speed when posting or using the + * moderator interface. APC is the recommended method of caching. + * + * http://tinyboard.org/docs/index.php?p=Config/Cache + */ + + $config['cache']['enabled'] = false; + // $config['cache']['enabled'] = 'xcache'; + // $config['cache']['enabled'] = 'apc'; + // $config['cache']['enabled'] = 'memcached'; + // $config['cache']['enabled'] = 'redis'; + + // Timeout for cached objects such as posts and HTML. + $config['cache']['timeout'] = 60 * 60 * 48; // 48 hours + + // Optional prefix if you're running multiple Tinyboard instances on the same machine. $config['cache']['prefix'] = ''; - - // Memcached servers to use - http://www.php.net/manual/en/memcached.addservers.php + + // Memcached servers to use. Read more: http://www.php.net/manual/en/memcached.addservers.php $config['cache']['memcached'] = array( array('localhost', 11211) ); // Redis server to use. Location, port, password, database id. - // Note that Tinyboard may clear the database at times, so you may want to pick a - // database id just for Tinyboard to use. + // Note that Tinyboard may clear the database at times, so you may want to pick a database id just for + // Tinyboard to use. $config['cache']['redis'] = array('localhost', 6379, '', 1); - + /* * ==================== * Cookie settings * ==================== */ - - // Used for moderation login + + // Used for moderation login. $config['cookies']['mod'] = 'mod'; + // Used for communicating with Javascript; telling it when posts were successful. - // Rebuild Javascript file after changing this value or it won't work. $config['cookies']['js'] = 'serv'; - // Cookies "path". Defaults to $config['root']. If $config['root'] is a URL, you need to set this. Should be '/' or '/board/', depending on your installation. + + // Cookies path. Defaults to $config['root']. If $config['root'] is a URL, you need to set this. Should + // be '/' or '/board/', depending on your installation. // $config['cookies']['path'] = '/'; // Where to set the 'path' parameter to $config['cookies']['path'] when creating cookies. Recommended. $config['cookies']['jail'] = true; - // How long should the cookies last (in seconds) - $config['cookies']['expire'] = 15778463; //6 months - // Make this something long and random for security + + // How long should the cookies last (in seconds). Defines how long should moderators should remain logged + // in (0 = browser session). + $config['cookies']['expire'] = 60 * 60 * 24 * 30 * 6; // ~6 months + + // Make this something long and random for security. $config['cookies']['salt'] = 'abcdefghijklmnopqrstuvwxyz09123456789!@#$%^&*()'; - // How long should moderators should remain logged in (0=browser session) (in seconds) - $config['mod']['expire'] = 15778463; //6 months - // Used to salt secure tripcodes (##trip) and poster IDs (if enabled) + + // Used to salt secure tripcodes ("##trip") and poster IDs (if enabled). $config['secure_trip_salt'] = ')(*&^%$#@!98765432190zyxwvutsrqponmlkjihgfedcba'; /* @@ -140,22 +162,29 @@ * Flood/spam settings * ==================== */ - - // How many seconds between each post + + // Minimum time between between each post by the same IP address. $config['flood_time'] = 10; - // How many seconds between each post with exactly the same content and same IP + // Minimum time between between each post with the exact same content AND same IP address. $config['flood_time_ip'] = 120; - // Same as above but different IP address + // Same as above but by a different IP address. (Same content, not necessarily same IP address.) $config['flood_time_same'] = 30; - - // DNS blacklists (DNSBL) http://tinyboard.org/docs/?p=Config/DNSBL - - // http://www.sectoor.de/tor.php - $config['dnsbl'][] = array('tor.dnsbl.sectoor.de', 1); // Tor exit servers - + + /* + * To further prevent spam and abuse, you can use DNS blacklists (DNSBL). A DNSBL is a list of IP + * addresses published through the Internet Domain Name Service (DNS) either as a zone file that can be + * used by DNS server software, or as a live DNS zone that can be queried in real-time. + * + * Read more: http://tinyboard.org/docs/?p=Config/DNSBL + */ + + // Prevents most Tor exit nodes from making posts. Recommended, as a lot of abuse comes from Tor because + // of the strong anonymity associated with it. + $config['dnsbl'][] = array('tor.dnsbl.sectoor.de', 1); + // http://www.sorbs.net/using.shtml // $config['dnsbl'][] = array('dnsbl.sorbs.net', array(2, 3, 4, 5, 6, 7, 8, 9)); - + // http://www.projecthoneypot.org/httpbl.php // $config['dnsbl'][] = array('<your access key>.%.dnsbl.httpbl.org', function($ip) { // $octets = explode('.', $ip); @@ -170,11 +199,10 @@ // // return true; // }, 'dnsbl.httpbl.org'); // hide our access key - - + // Skip checking certain IP addresses against blacklists (for troubleshooting or whatever) $config['dnsbl_exceptions'][] = '127.0.0.1'; - + /* * Introduction to Tinyboard's spam filter: * @@ -194,14 +222,17 @@ * See also: http://tinyboard.org/docs/?p=Your_request_looks_automated * */ - - // Number of hidden fields to generate + + // Number of hidden fields to generate. $config['spam']['hidden_inputs_min'] = 4; $config['spam']['hidden_inputs_max'] = 12; + // How many times can a "hash" be used to post? $config['spam']['hidden_inputs_max_pass'] = 12; + // How soon after regeneration do hashes expire (in seconds)? $config['spam']['hidden_inputs_expire'] = 60 * 60 * 3; // three hours + // These are fields used to confuse the bots. Make sure they aren't actually used by Tinyboard, or it won't work. $config['spam']['hidden_input_names'] = array( 'user', @@ -215,6 +246,7 @@ 'text', 'message' ); + // Always update this when adding new valid fields to the post form, or EVERYTHING WILL BE DETECTED AS SPAM! $config['spam']['valid_inputs'] = array( 'hash', @@ -233,56 +265,18 @@ 'embed', 'recaptcha_challenge_field', 'recaptcha_response_field', - 'imgcaptcha_hash', - 'imgcaptcha_verify', 'spoiler', - 'quick-reply' + 'quick-reply', + 'page' ); - - // Custom flood filters. Detect flood attacks and reject new posts if there's a positive match. - // See http://tinyboard.org/wiki/index.php?title=Flood_filters for more information. - //$config['flood_filters'][] = array( - // 'condition' => array( - // // 100 posts in the past 5 minutes (~20 p/m) - // 'posts_in_past_x_minutes' => array(100, 5) - // ), - // // Don't allow the user to post - // 'action' => 'reject', - // // Display this message - // 'message' => 'Your post has been rejected on the suspicion of a flood attack on this board.' - //); - - // Another filter - //$config['flood_filters'][] = array( - // 'condition' => array( - // // 10 new empty threads in the past 2 minutes - // 'threads_with_no_replies_in_past_x_minutes' => array(10, 2), - // // Allow replies, but not new threads (ie. reject topics only). - // 'OP' => true - // ), - // 'action' => 'reject', - // 'message' => 'Your post has been rejected on the suspicion of a flood attack on this board (too many new threads); post a reply instead.' - //); - - // Enable reCaptcha to make spam even harder + + // Enable reCaptcha to make spam even harder. Rarely necessary. $config['recaptcha'] = false; + // Public and private key pair from https://www.google.com/recaptcha/admin/create $config['recaptcha_public'] = '6LcXTcUSAAAAAKBxyFWIt2SO8jwx4W7wcSMRoN3f'; $config['recaptcha_private'] = '6LcXTcUSAAAAAOGVbVdhmEM1_SyRF4xTKe8jbzf_'; - - $config['imgcaptcha'] = false; - $config['imgcaptcha_key'] = "cos losowego"; // max 32 znaki - $config['imgcaptcha_list'] = "/sciezka/do/pliku.txt"; - $config['imgcaptcha_images'] = "/sciezka/do/obrazkow"; // without a slash at the end - $config['imgcaptcha_question'] = "Was ist das?"; - $config['imgcaptcha_time_limit'] = 90; // Kapcza wazna przez 90 sekund po wejsciu - $config['imgcaptcha_filler'] = "/plik/kliknijmie.png"; - $config['imgcaptcha_width'] = 128; - $config['imgcaptcha_height'] = 96; - // JESLI DODAJESZ IMGKAPCZE, NIE ZAPOMNIJ O TYM - // Wymagane tez jQuery - o tam, nizej. - //$config['additional_javascript'][] = 'js/imgcaptcha.js'; /* * ==================== * Post settings @@ -293,100 +287,156 @@ $config['force_body'] = false; // Do you need a body for new threads? $config['force_body_op'] = true; - // Strip superfluous new lines at the end of a post - $config['strip_superfluous_returns'] = true; // Require an image for threads? $config['force_image_op'] = true; - - // Max body length + + // Strip superfluous new lines at the end of a post. + $config['strip_superfluous_returns'] = true; + // Strip combining characters from Unicode strings (eg. "Zalgo"). + $config['strip_combining_chars'] = true; + + // Maximum post body length. $config['max_body'] = 1800; - // Amount of post lines to show on the index page + // Maximum number of post body lines to show on the index page. $config['body_truncate'] = 15; - // Amount of characters to show on the index page + // Maximum number of characters to show on the index page. $config['body_truncate_char'] = 2500; - - // Typically spambots try to post a lot of links. Refuse a post with X standalone links? + + // Typically spambots try to post many links. Refuse a post with X links? $config['max_links'] = 20; - // Maximum number of cites per post (protects against abuse) + // Maximum number of cites per post (prevents abuse, as more citations mean more database queries). $config['max_cites'] = 45; - // Maximum number of cross-board links/cites per post + // Maximum number of cross-board links/citations per post. $config['max_cross'] = $config['max_cites']; - + // Track post citations (>>XX). Rebuilds posts after a cited post is deleted, removing broken links. - // A little more database load. + // Puts a little more load on the database. $config['track_cites'] = true; - - // Maximum filename length (will be truncated) + + // Maximum filename length (will be truncated). $config['max_filename_len'] = 255; - // Maximum filename length to display (the rest can be viewed upon mouseover) + // Maximum filename length to display (the rest can be viewed upon mouseover). $config['max_filename_display'] = 30; - - // How long before you can delete a post after posting, in seconds. + + // How long after posting should you have to wait before being able to delete that post? (In seconds.) $config['delete_time'] = 10; - // Reply limit (stops bumping thread when this is reached) + // Reply limit (stops bumping thread when this is reached). $config['reply_limit'] = 250; - - // Image hard limit (stops allowing new image replies when this is reached if not zero) + + // Image hard limit (stops allowing new image replies when this is reached if not zero). $config['image_hard_limit'] = 0; - // Reply hard limit (stops allowing new replies when this is reached if not zero) + // Reply hard limit (stops allowing new replies when this is reached if not zero). $config['reply_hard_limit'] = 0; - - // Strip repeating characters when making hashes + + $config['robot_enable'] = false; + // Strip repeating characters when making hashes. $config['robot_strip_repeating'] = true; - - // Enable mutes - // Tinyboard uses ROBOT9000's original 2^x implementation + // Enabled mutes? Tinyboard uses ROBOT9000's original 2^x implementation where x is the number of times + // you have been muted in the past. $config['robot_mute'] = true; - // How many mutes x hours ago to include in the algorithm + // How long before Tinyboard forgets about a mute? $config['robot_mute_hour'] = 336; // 2 weeks - // If you want to alter the algorithm a bit. Default value is 2. n^x - $config['robot_mute_multiplier'] = 2; - $config['robot_mute_descritpion'] = 'You have been muted for unoriginal content.'; - - // Automatically convert things like "..." to Unicode characters ("…") + // If you want to alter the algorithm a bit. Default value is 2. + $config['robot_mute_multiplier'] = 2; // (n^x where x is the number of previous mutes) + $config['robot_mute_descritpion'] = _('You have been muted for unoriginal content.'); + + // Automatically convert things like "..." to Unicode characters ("…"). $config['auto_unicode'] = true; - // Whether to turn URLs into functional links + // Whether to turn URLs into functional links. $config['markup_urls'] = true; - // Prefix those functional links with some other url, for example some service for hiding referers - // (eg. 'http://www.nullrefer.com/?', or 'http://anonym.to/?'), a pay-per-view exit page, etc. - $config['url_ads'] = ''; - - // Wordfilters are used to automatically replace certain words/phrases with something else. + + // Optional URL prefix for links (eg. "http://anonym.to/?"). + $config['link_prefix'] = ''; + $config['url_ads'] = &$config['link_prefix']; // leave alias + + // A wordfilter (sometimes referred to as just a "filter" or "censor") automatically scans users’ posts + // as they are submitted and changes or censors particular words or phrases. + // For a normal string replacement: - // $config['wordfilters'][] = array('cat', 'dog'); - + // $config['wordfilters'][] = array('cat', 'dog'); // Advanced raplcement (regular expressions): - // $config['wordfilters'][] = array('/cat/', 'dog', true); // 'true' means it's a regular expression - - // Always act as if they had typed "noko" in the email field no mattter what + // $config['wordfilters'][] = array('/ca[rt]/', 'dog', true); // 'true' means it's a regular expression + + // Always act as if the user had typed "noko" into the email field. $config['always_noko'] = false; - - // Custom tripcodes. The below example makes a tripcode - // of "#test123" evaluate to "!HelloWorld" + + // Example: Custom tripcodes. The below example makes a tripcode of "#test123" evaluate to "!HelloWorld". // $config['custom_tripcode']['#test123'] = '!HelloWorld'; + // Example: Custom secure tripcode. // $config['custom_tripcode']['##securetrip'] = '!!somethingelse'; - - // Optional spoiler images + + // Allow users to mark their image as a "spoiler" when posting. The thumbnail will be replaced with a + // static spoiler image instead (see $config['spoiler_image']). $config['spoiler_images'] = false; - - + // With the following, you can disable certain superfluous fields or enable "forced anonymous". - + // When true, all names will be set to $config['anonymous']. $config['field_disable_name'] = false; - // When true, no email will be able to be set. + // When true, there will be no email field. $config['field_disable_email'] = false; - // When true, no subject will be able to be set. + // When true, there will be no subject field. $config['field_disable_subject'] = false; - // When true, no subject will be able to be set in replies. + // When true, there will be no subject field for replies. $config['field_disable_reply_subject'] = false; // When true, a blank password will be used for files (not usable for deletion). $config['field_disable_password'] = false; - - // Require users to see the ban page at least once for a ban even if it has since expired? - $config['require_ban_view'] = false; - + + // Require users to see the ban page at least once for a ban even if it has since expired. + $config['require_ban_view'] = true; + + /* + * Custom filters detect certain posts and reject/ban accordingly. They are made up of a + * condition and an action (for when ALL conditions are met). As every single post has to + * be put through each filter, having hundreds probably isn’t ideal as it could slow things down. + * + * Read more: http://tinyboard.org/docs/index.php?p=Config/Filters + * + * This used to be named $config['flood_filters'] (still exists as an alias). + */ + + // An example of blocking an imaginary known spammer, who keeps posting a reply with the name "surgeon", + // ending his posts with "regards, the surgeon" or similar. + // $config['filters'][] = array( + // 'condition' => array( + // 'name' => '/^surgeon$/', + // 'body' => '/regards,\s+(the )?surgeon$/i', + // 'OP' => false + // ), + // 'action' => 'reject', + // 'message' => 'Go away, spammer.' + // ); + + // Same as above, but issuing a 3-hour ban instead of just reject the post. + // $config['filters'][] = array( + // 'condition' => array( + // 'name' => '/^surgeon$/', + // 'body' => '/regards,\s+(the )?surgeon$/i', + // 'OP' => false + // ), + // 'action' => 'ban', + // 'expires' => 60 * 60 * 3, // 3 hours + // 'reason' => 'Go away, spammer.' + // ); + + // PHP 5.3+ (anonymous functions) + // There is also a "custom" condition, making the possibilities of this feature pretty much endless. + // This is a bad example, because there is already a "name" condition built-in. + // $config['filters'][] = array( + // 'condition' => array( + // 'body' => '/h$/i', + // 'OP' => false, + // 'custom' => function($post) { + // if($post['name'] == 'Anonymous') + // return true; + // else + // return false; + // } + // ), + // 'action' => 'reject' + // ); + /* * ==================== * Markup settings @@ -394,122 +444,160 @@ */ // "Wiki" markup syntax ($config['wiki_markup'] in pervious versions): - $config['markup'][] = array("/'''(.+?)'''/", "<strong>\$1</strong>"); - $config['markup'][] = array("/''(.+?)''/", "<em>\$1</em>"); - $config['markup'][] = array("/\*\*(.+?)\*\*/", "<span class=\"spoiler\">\$1</span>"); - $config['markup'][] = array("/^[ |\t]*==(.+?)==[ |\t]*$/m", "<span class=\"heading\">\$1</span>"); - - // Highlight PHP code wrapped in <code> tags (PHP 5.3.0+) + $config['markup'][] = array("/'''([^<]+?)'''/", "<strong>\$1</strong>"); + $config['markup'][] = array("/''([^<]+?)''/", "<em>\$1</em>"); + $config['markup'][] = array("/\*\*([^<]+?)\*\*/", "<span class=\"spoiler\">\$1</span>"); + $config['markup'][] = array("/^[ |\t]*==([^<]+?)==[ |\t]*$/m", "<span class=\"heading\">\$1</span>"); + + // Highlight PHP code wrapped in <code> tags (PHP 5.3+) // $config['markup'][] = array( // '/^<code>(.+)<\/code>/ms', // function($matches) { // return highlight_string(html_entity_decode($matches[1]), true); // } // ); - + /* * ==================== * Image settings * ==================== */ - - // For resizing, max thumbnail size + + // For resizing, maximum thumbnail dimensions. $config['thumb_width'] = 255; $config['thumb_height'] = 255; - // Max thumbnail size for thread images + // Maximum thumbnail dimensions for thread (OP) images. $config['thumb_op_width'] = 255; $config['thumb_op_height'] = 255; - - // Thumbnail extension, empty for inherited (png recommended) + + // Thumbnail extension ("png" recommended). Leave this empty if you want the extension to be inherited + // from the uploaded file. $config['thumb_ext'] = 'png'; - - // EXPERIMENTAL: - // Maximum amount of frames to resize (more frames means more processing power). "1" means no animated thumbnails. - // Requires $config['thumb_ext'] to be 'gif' $config['imagick'] to be enabled. + + // Maximum amount of animated GIF frames to resize (more frames can mean more processing power). A value + // of "1" means thumbnails will not be animated. Requires $config['thumb_ext'] to be 'gif' (or blank) and + // $config['thumb_method'] to be 'imagick', 'convert', or 'convert+gifsicle'. This value is not + // respected by 'convert'; will just resize all frames if this is > 1. $config['thumb_keep_animation_frames'] = 1; - - // Thumbnailing method: - // - 'gd' PHP GD (default). Only handles the most basic image formats (GIF, JPEG, PNG). - // This is a prerequisite for Tinyboard no matter what method you choose. - // - 'imagick' PHP's ImageMagick bindings. Fast and efficient, supporting many image formats. - // A few minor bugs. http://pecl.php.net/package/imagick - // - 'convert' The command line version of ImageMagick (`convert`). Fixes most of the bugs in - // PHP Imagick. - // - 'convert+gifsicle' Same as above, with the exception of using `gifsicle` (command line application) - // instead of `convert` for resizing gifs. It's faster and resulting animated gifs - // have less artifacts than if resized with ImageMagick. - + + /* + * Thumbnailing method: + * + * 'gd' PHP GD (default). Only handles the most basic image formats (GIF, JPEG, PNG). + * GD is a prerequisite for Tinyboard no matter what method you choose. + * + * 'imagick' PHP's ImageMagick bindings. Fast and efficient, supporting many image formats. + * A few minor bugs. http://pecl.php.net/package/imagick + * + * 'convert' The command line version of ImageMagick (`convert`). Fixes most of the bugs in + * PHP Imagick. `convert` produces the best still thumbnails and is highly recommended. + * + * 'gm' GraphicsMagick (`gm`) is a fork of ImageMagick with many improvements. It is more + * efficient and gets thumbnailing done using fewer resources. + * + * 'convert+gifscale' + * OR 'gm+gifsicle' Same as above, with the exception of using `gifsicle` (command line application) + * instead of `convert` for resizing GIFs. It's faster and resulting animated + * thumbnails have less artifacts than if resized with ImageMagick. + */ $config['thumb_method'] = 'gd'; + // $config['thumb_method'] = 'convert'; + + // Command-line options passed to ImageMagick when using `convert` for thumbnailing. Don't touch the + // placement of "%s" and "%d". + $config['convert_args'] = '-size %dx%d %s -thumbnail %dx%d -auto-orient +profile "*" %s'; + + // Strip EXIF metadata from JPEG files. + $config['strip_exif'] = false; + // Use the command-line `exiftool` tool to strip EXIF metadata without decompressing/recompressing JPEGs. + // Ignored when $config['redraw_image'] is true. This is also used to adjust the Orientation tag when + // $config['strip_exif'] is false and $config['convert_manual_orient'] is true. + $config['use_exiftool'] = false; - // Regular expression to check for IE MIME type detection XSS exploit. To disable, comment the line out - // https://github.com/savetheinternet/Tinyboard/issues/20 - $config['ie_mime_type_detection'] = '/<(?:body|head|html|img|plaintext|pre|script|table|title|a href|channel|scriptlet)/i'; + // Redraw the image to strip any excess data (commonly ZIP archives) WARNING: This might strip the + // animation of GIFs, depending on the chosen thumbnailing method. It also requires recompressing + // the image, so more processing power is required. + $config['redraw_image'] = false; - // Allowed image file extensions + // Automatically correct the orientation of JPEG files using -auto-orient in `convert`. This only works + // when `convert` or `gm` is selected for thumbnailing. Again, requires more processing power because + // this basically does the same thing as $config['redraw_image']. (If $config['redraw_image'] is enabled, + // this value doesn't matter as $config['redraw_image'] attempts to correct orientation too.) + $config['convert_auto_orient'] = false; + + // Is your version of ImageMagick or GraphicsMagick old? Older versions may not include the -auto-orient + // switch. This is a manual replacement for that switch. This is independent from the above switch; + // -auto-orrient is applied when thumbnailing too. + $config['convert_manual_orient'] = false; + + // Regular expression to check for an XSS exploit with IE 6 and 7. To disable, set to false. + // Details: https://github.com/savetheinternet/Tinyboard/issues/20 + $config['ie_mime_type_detection'] = '/<(?:body|head|html|img|plaintext|pre|script|table|title|a href|channel|scriptlet)/i'; + + // Allowed image file extensions. $config['allowed_ext'][] = 'jpg'; $config['allowed_ext'][] = 'jpeg'; $config['allowed_ext'][] = 'bmp'; $config['allowed_ext'][] = 'gif'; $config['allowed_ext'][] = 'png'; // $config['allowed_ext'][] = 'svg'; - - // Allowed additional file extensions (not images; downloadable files) + + // Allowed additional file extensions (not images; downloadable files). // $config['allowed_ext_files'][] = 'txt'; // $config['allowed_ext_files'][] = 'zip'; - - // An alternative function for generating a filename, instead of the default UNIX timestamp. - // http://tinyboard.org/wiki/index.php?title=Filenames - // $config['filename_func'] = 'some_function_you_have_created'; - - // Non-image file icons + + // An alternative function for generating image filenames, instead of the default UNIX timestamp. + // $config['filename_func'] = function($post) { + // return sprintf("%s", time() . substr(microtime(), 2, 3)); + // }; + + // Thumbnail to use for the non-image file uploads. $config['file_icons']['default'] = 'file.png'; $config['file_icons']['zip'] = 'zip.png'; - - // Thumbnail to use for the downloadable files (not images) + // Example: Custom thumbnail for certain file extension. + // $config['file_icons']['extension'] = 'some_file.png'; + + // Location of above images. $config['file_thumb'] = 'static/%s'; - // Thumbnail to use for spoiler images + // Location of thumbnail to use for spoiler images. $config['spoiler_image'] = 'static/spoiler.png'; - - // Thumbnail quality (compression level), from 0 to 9 - $config['thumb_quality'] = 8; - - // When a thumbnailed image is going to be the same (in dimension), just copy the entire file and use that as a thumbnail instead of resizing/redrawing + // Location of thumbnail to use for deleted images. + // $config['image_deleted'] = 'static/deleted.png'; + + // When a thumbnailed image is going to be the same (in dimension), just copy the entire file and use + // that as a thumbnail instead of resizing/redrawing. $config['minimum_copy_resize'] = false; - - // Store image hash in the database for r9k-like boards implementation soon - // Function name for hashing + + // Image hashing function. There's really no reason to change this. // sha1_file, md5_file, etc. You can also define your own similar function. $config['file_hash'] = 'sha1_file'; - - // Maximum image upload size in bytes - $config['max_filesize'] = 10*1024*1024; // 10MB - // Maximum image dimensions + + // Maximum image upload size in bytes. + $config['max_filesize'] = 10 * 1024 * 1024; // 10MB + // Maximum image dimensions. $config['max_width'] = 10000; - $config['max_height'] = $config['max_width']; // 1:1 - // Reject duplicate image uploads + $config['max_height'] = $config['max_width']; + // Reject duplicate image uploads. $config['image_reject_repost'] = true; - // Reject duplicate image uploads within the same thread. Doesn't change anything if image_reject_repost is true. + // Reject duplicate image uploads within the same thread. Doesn't change anything if + // $config['image_reject_repost'] is true. $config['image_reject_repost_in_thread'] = false; - - // Display the aspect ratio in a post's file info + + // Display the aspect ratio of uploaded files. $config['show_ratio'] = false; - // Display the file's original filename + // Display the file's original filename. $config['show_filename']= true; - // Image identification buttons using regex.info/exif, tineye and google images + // Display image identification links using regex.info/exif, TinEye and Google Images. $config['image_identification'] = false; - - // Redraw the image using GD functions to strip any excess data (commonly ZIP archives) - // WARNING: Currently strips animated GIFs too - $config['redraw_image'] = false; - + /* * ==================== * Board settings * ==================== */ - // Maximum amount of threads to display on a given page. + // Maximum amount of threads to display per page. $config['threads_per_page'] = 10; // Maximum number of pages. Content past the last page is automatically purged. $config['max_pages'] = 10; @@ -518,14 +606,14 @@ // Same as above, but for stickied threads. $config['threads_preview_sticky'] = 1; - // Name of the boards. Usually '/%s/' (/b/, /mu/, etc) - // $config['board_abbreviation'] - BOARD_TITLE + // How to display the URI of boards. Usually '/%s/' (/b/, /mu/, etc). This doesn't change the URL. Find + // $config['board_path'] if you wish to change the URL. $config['board_abbreviation'] = '/%s/'; - - // The default name (ie. Anonymous) + + // The default name (ie. Anonymous). $config['anonymous'] = 'Anonymous'; - - // How many reports you can create in the same request. + + // Number of reports you can create at once. $config['report_limit'] = 3; // Attention Whoring Bar @@ -537,82 +625,96 @@ * Display settings * ==================== */ - - // Locale (en, ru_RU.UTF-8, fi_FI.UTF-8, pl_PL.UTF-8) - $config['locale'] = 'en'; - - // Timezone + + // Tinyboard has been translated into a few langauges. See inc/locale for available translations. + $config['locale'] = 'en'; // (en, ru_RU.UTF-8, fi_FI.UTF-8, pl_PL.UTF-8) + + // Timezone to use for displaying dates/tiems. $config['timezone'] = 'America/Los_Angeles'; - - // The format string passed to strftime() for post times + // The format string passed to strftime() for displaying dates. // http://www.php.net/manual/en/function.strftime.php $config['post_date'] = '%m/%d/%y (%a) %H:%M:%S'; - // Same as above, but used for "you are banned' pages. $config['ban_date'] = '%A %e %B, %Y'; - - // The names on the post buttons. (On most imageboards, these are both "Post") - $config['button_newtopic'] = 'New Topic'; - $config['button_reply'] = 'New Reply'; - - // Assign each poster in a thread a unique ID, shown by "ID: {id}" before the post number. + + // The names on the post buttons. (On most imageboards, these are both just "Post"). + $config['button_newtopic'] = _('New Topic'); + $config['button_reply'] = _('New Reply'); + + // Assign each poster in a thread a unique ID, shown by "ID: xxxxx" before the post number. $config['poster_ids'] = false; - // Number of characters in the poster ID (maximum is 40) + // Number of characters in the poster ID (maximum is 40). $config['poster_id_length'] = 5; - - // Show thread subject in page title? + + // Show thread subject in page title. $config['thread_subject_in_title'] = false; - - // Page footer - $config['footer'][] = 'All trademarks, copyrights, comments, and images on this page are owned by and are the responsibility of their respective parties.'; - - // Characters used to generate a random password (with Javascript) + + // Additional lines added to the footer of all pages. + $config['footer'][] = _('All trademarks, copyrights, comments, and images on this page are owned by and are the responsibility of their respective parties.'); + + // Characters used to generate a random password (with Javascript). $config['genpassword_chars'] = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()_+'; - - // Optional banner at the top of every page. + + // Optional banner image at the top of every page. // $config['url_banner'] = '/banner.php'; - // Banner dimensions are also optional. As the banner loads after the rest of the page, everything - // may be shifted down a few pixels when it does. Making the banner a fixed size will prevent this. + // Banner dimensions are also optional. As the banner loads after the rest of the page, everything may be + // shifted down a few pixels when it does. Making the banner a fixed size will prevent this. // $config['banner_width'] = 300; // $config['banner_height'] = 100; - - // Custom stylesheets available. The prefix for each stylesheet URI is defined below. - $config['stylesheets']['Yotsuba B'] = ''; // default + + // Custom stylesheets available for the user to choose. See the "stylesheets/" folder for a list of + // available stylesheets (or create your own). + $config['stylesheets']['Yotsuba B'] = ''; // Default; there is no additional/custom stylesheet for this. $config['stylesheets']['Yotsuba'] = 'yotsuba.css'; // $config['stylesheets']['Futaba'] = 'futaba.css'; - + // $config['stylesheets']['Dark'] = 'dark.css'; + // The prefix for each stylesheet URI. Defaults to $config['root']/stylesheets/ // $config['uri_stylesheets'] = 'http://static.example.org/stylesheets/'; - - // The default stylesheet to use + + // The default stylesheet to use. $config['default_stylesheet'] = array('Yotsuba B', $config['stylesheets']['Yotsuba B']); - - // Boardlinks - // You can group, order and place the boardlist at the top of every page, using the following template. - //$config['boards'] = array( - // array('a', 'b'), - // array('c', 'd', 'e', 'f', 'g'), - // array('h', 'i', 'j'), - // array('k', array('l', 'm')), - // array('status' => 'http://status.example.org/') - //); - - // Categories - // Required for the Categories theme. - //$config['categories'] = array( - // 'Group Name' => array('a', 'b', 'c'), - // 'Another Group' => array('d') - //); - - // Custom_categories - // Optional for the Categories theme. array of name => (title, url) groups for categories with non-board links. - //$config['custom_categories'] = array( - // 'Links' => array( - // 'Tinyboard' => 'http://tinyboard.org', - // 'Donate' => 'donate.html' - // ) - //); - + + // Make stylesheet selections board-specific. + $config['stylesheets_board'] = false; + + // Use Font-Awesome for displaying lock and pin icons, instead of the images in static/. + // http://fortawesome.github.io/Font-Awesome/icon/pushpin/ + // http://fortawesome.github.io/Font-Awesome/icon/lock/ + $config['font_awesome'] = true; + $config['font_awesome_css'] = 'stylesheets/font-awesome/css/font-awesome.min.css'; + + /* + * For lack of a better name, “boardlinks” are those sets of navigational links that appear at the top + * and bottom of board pages. They can be a list of links to boards and/or other pages such as status + * blogs and social network profiles/pages. + * + * "Groups" in the boardlinks are marked with square brackets. Tinyboard allows for infinite recursion + * with groups. Each array() in $config['boards'] represents a new square bracket group. + */ + + // $config['boards'] = array( + // array('a', 'b'), + // array('c', 'd', 'e', 'f', 'g'), + // array('h', 'i', 'j'), + // array('k', array('l', 'm')), + // array('status' => 'http://status.example.org/') + // ); + + // Board categories. Only used in the "Categories" theme. + // $config['categories'] = array( + // 'Group Name' => array('a', 'b', 'c'), + // 'Another Group' => array('d') + // ); + // Optional for the Categories theme. This is an array of name => (title, url) groups for categories + // with non-board links. + // $config['custom_categories'] = array( + // 'Links' => array( + // 'Tinyboard' => 'http://tinyboard.org', + // 'Donate' => 'donate.html' + // ) + // ); + // Automatically remove unnecessary whitespace when compiling HTML files from templates. $config['minify_html'] = true; @@ -622,28 +724,31 @@ * ==================== */ - // Additional Javascript files to include on board index and thread pages. + // Additional Javascript files to include on board index and thread pages. See js/ for available scripts. $config['additional_javascript'][] = 'js/inline-expanding.js'; // $config['additional_javascript'][] = 'js/local-time.js'; - - // Some scripts require jQuery. Check the comments in script files to see what's needed. + + // Some scripts require jQuery. Check the comments in script files to see what's needed. When enabling + // jQuery, you should first empty the array so that "js/query.min.js" can be the first, and then re-add + // "js/inline-expanding.js" or else the inline-expanding script might not interact properly with other + // scripts. + // $config['additional_javascript'] = array(); // $config['additional_javascript'][] = 'js/jquery.min.js'; + // $config['additional_javascript'][] = 'js/inline-expanding.js'; // $config['additional_javascript'][] = 'js/auto-reload.js'; + // $config['additional_javascript'][] = 'js/post-hover.js'; + // $config['additional_javascript'][] = 'js/style-select.js'; + + // Where these script files are located on the web. Defaults to $config['root']. + // $config['additional_javascript_url'] = 'http://static.example.org/tinyboard-javascript-stuff/'; - // Enable hiding posts. Remember to put this AFTER jQuery. - // $config['additional_javascript'][] = 'js/post-hider.js'; - - // Where these script files are located on the web (defaults to $config['root']). - // $config['additional_javascript_url'] = '/js/'; - // Compile all additional scripts into one file ($config['file_script']) instead of including them seperately. $config['additional_javascript_compile'] = false; - - // Minify Javascript using http://code.google.com/p/minify/ + + // Minify Javascript using http://code.google.com/p/minify/. $config['minify_js'] = false; - // Allows js/quick-reply.js to work - // This will make your imageboard more vulnerable to flood attacks. + // Allows js/quick-reply.js to work. This could make your imageboard more vulnerable to flood attacks. $config['quick_reply'] = false; /* @@ -651,12 +756,12 @@ * Video embedding * ==================== */ - - // Enable embedding (see below) + + // Enable embedding (see below). $config['enable_embedding'] = false; - + // Custom embedding (YouTube, vimeo, etc.) - // It's very important that you match the full string (with ^ and $) or things will not work correctly. + // It's very important that you match the entire input (with ^ and $) or things will not work correctly. $config['embedding'] = array( array( '/^https?:\/\/(\w+\.)?youtube\.com\/watch\?v=([a-zA-Z0-9\-_]{10,11})(&.+)?$/i', @@ -683,17 +788,17 @@ '<object style="float: left;margin: 10px 20px;" width="148" height="44"><param name="movie" value="http://vocaroo.com/player.swf?playMediaID=$2&autoplay=0"></param><param name="wmode" value="transparent"></param><embed src="http://vocaroo.com/player.swf?playMediaID=$2&autoplay=0" width="148" height="44" wmode="transparent" type="application/x-shockwave-flash"></embed></object>' ) ); - - // Embedding width and height + + // Embedding width and height. $config['embed_width'] = 300; $config['embed_height'] = 246; - + /* * ==================== * Error messages * ==================== */ - + // Error messages $config['error']['lurk'] = _('Lurk some more before posting.'); $config['error']['bot'] = _('You look like a bot.'); @@ -734,7 +839,7 @@ $config['error']['mime_exploit'] = _('MIME type detection XSS exploit (IE) detected; post discarded.'); $config['error']['invalid_embed'] = _('Couldn\'t make sense of the URL of the video you tried to embed.'); $config['error']['captcha'] = _('You seem to have mistyped the verification.'); - + // Moderator errors $config['error']['toomanyunban'] = _('You are only allowed to unban %s users at a time. You tried to unban %u users.'); $config['error']['invalid'] = _('Invalid username and/or password.'); @@ -757,88 +862,89 @@ * Directory/file settings * ========================= */ - + // The root directory, including the trailing slash, for Tinyboard. - // examples: '/', 'http://boards.chan.org/', '/chan/' + // Examples: '/', 'http://boards.chan.org/', '/chan/'. if (isset($_SERVER['REQUEST_URI'])) - $config['root'] = (str_replace('\\', '/', dirname($_SERVER['REQUEST_URI'])) == '/' ? '/' : str_replace('\\', '/', dirname($_SERVER['REQUEST_URI'])) . '/'); + $config['root'] = str_replace('\\', '/', dirname($_SERVER['REQUEST_URI'])) == '/' ? '/' : str_replace('\\', '/', dirname($_SERVER['REQUEST_URI'])) . '/'; else $config['root'] = '/'; // CLI mode - // The scheme and domain. This is needed to get absolute URL of some page (for instance image - // identification buttons). If you use the CLI tools, it would be wise to override this setting. - $config['domain'] = (isset ($_SERVER['HTTPS']) && $_SERVER['HTTPS'] != 'off') ? "https://" : "http://"; - $config['domain'] .= isset ($_SERVER['HTTP_HOST']) ? $_SERVER['HTTP_HOST'] : 'localhost'; - + // The scheme and domain. This is used to get the site's absolute URL (eg. for image identification links). + // If you use the CLI tools, it would be wise to override this setting. + $config['domain'] = (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] != 'off') ? 'https://' : 'http://'; + $config['domain'] .= isset($_SERVER['HTTP_HOST']) ? $_SERVER['HTTP_HOST'] : 'localhost'; + // If for some reason the folders and static HTML index files aren't in the current working direcotry, // enter the directory path here. Otherwise, keep it false. $config['root_file'] = false; - + + // Location of files. $config['file_index'] = 'index.html'; $config['file_page'] = '%d.html'; $config['file_mod'] = 'mod.php'; $config['file_post'] = 'post.php'; $config['file_script'] = 'main.js'; - - // Board directory, followed by a forward-slash (/). (%s is board abbreviation) + + // Board directory, followed by a forward-slash (/). $config['board_path'] = '%s/'; - + // Misc directories. $config['dir']['img'] = 'src/'; $config['dir']['thumb'] = 'thumb/'; $config['dir']['res'] = 'res/'; - // For load balancing, having a seperate server (and domain/subdomain) for serving static content is possible. - // This can either be a directory or a URL (eg. http://static.example.org/) - //$config['dir']['static'] = $config['root'] . 'static/'; - // Where to store the .html templates. This folder and templates must exist or fatal errors will be thrown. + + // For load balancing, having a seperate server (and domain/subdomain) for serving static content is + // possible. This can either be a directory or a URL. Defaults to $config['root'] . 'static/'. + // $config['dir']['static'] = 'http://static.example.org/'; + + // Where to store the .html templates. This folder and the template files must exist. $config['dir']['template'] = getcwd() . '/templates'; - // For the themes (homepages, etc.) + // Location of Tinyboard "themes". $config['dir']['themes'] = getcwd() . '/templates/themes'; - // Same as above, but a URI (accessable by web interface, not locally) + // Same as above, but a URI (accessable by web interface). $config['dir']['themes_uri'] = 'templates/themes'; - // Homepage directory + // Home directory. Used by themes. $config['dir']['home'] = ''; - - // Static images - // These can be URLs OR base64 (data URI scheme) - //$config['image_sticky'] = $config['dir']['static'] . 'sticky.gif'; - //$config['image_locked'] = $config['dir']['static'] . 'locked.gif'; - //$config['image_bumplocked'] = $config['dir']['static'] . 'sage.gif'; - //$config['image_deleted'] = $config['dir']['static'] . 'deleted.'; - //$config['image_zip'] = $config['dir']['static'] . 'zip.'; - - // If you want to put images and other dynamic-static stuff on another (preferably cookieless) domain, you can use this: - // This will override $config['root'] and $config['dir']['...'] directives. - // "%s" will get replaced with $board['dir'], which usually includes a trailing slash. To avoid double slashes, you don't need - // to put a slash after %s + + // Static images. These can be URLs OR base64 (data URI scheme). These are only used if + // $config['font_awesome'] is false (default). + // $config['image_sticky'] = 'static/sticky.gif'; + // $config['image_locked'] = 'static/locked.gif'; + // $config['image_bumplocked'] = 'static/sage.gif'. + + // If you want to put images and other dynamic-static stuff on another (preferably cookieless) domain. + // This will override $config['root'] and $config['dir']['...'] directives. "%s" will get replaced with + // $board['dir'], which includes a trailing slash. // $config['uri_thumb'] = 'http://images.example.org/%sthumb/'; // $config['uri_img'] = 'http://images.example.org/%ssrc/'; - - // Set custom locations for stylesheets, scripts and maybe a banner. - // This can be good for load balancing across multiple servers or hostnames. + + // Set custom locations for stylesheets and the main script file. This can be used for load balancing + // across multiple servers or hostnames. // $config['url_stylesheet'] = 'http://static.example.org/style.css'; // main/base stylesheet // $config['url_javascript'] = 'http://static.example.org/main.js'; + + // Website favicon. // $config['url_favicon'] = '/favicon.gif'; + // EXPERIMENTAL: Try not to build pages when we shouldn't have to. + $config['try_smarter'] = false; + /* * ==================== * Mod settings * ==================== */ - - // Limit how many bans can be removed via the ban list. (Set too -1 to remove limit.) - $config['mod']['unban_limit'] = 5; - - // Whether or not to lock moderator sessions to the IP address that was logged in with. + + // Limit how many bans can be removed via the ban list. Set to -1 for no limit. + $config['mod']['unban_limit'] = -1; + + // Whether or not to lock moderator sessions to IP addresses. This makes cookie theft ineffective. $config['mod']['lock_ip'] = true; - - // The page that is first shown when a moderator logs in. Defaults to the dashboard. + + // The page that is first shown when a moderator logs in. Defaults to the dashboard (?/). $config['mod']['default'] = '/'; - - // Don't even display MySQL password to administrators (in the configuration page). - $config['mod']['never_reveal_password'] = true; - - // Mod links (full HTML) - // Correspond to above permission directives + + // Mod links (full HTML). $config['mod']['link_delete'] = '[D]'; $config['mod']['link_ban'] = '[B]'; $config['mod']['link_bandelete'] = '[B&D]'; @@ -853,85 +959,98 @@ $config['mod']['link_bumpunlock'] = '[-Sage]'; $config['mod']['link_editpost'] = '[Edit]'; $config['mod']['link_move'] = '[Move]'; - - // Moderator capcodes + + // Moderator capcodes. $config['capcode'] = ' <span class="capcode">## %s</span>'; - - // Custom capcodes, by example: - // "## Custom" becomes lightgreen, italic and bold + + // "## Custom" becomes lightgreen, italic and bold: //$config['custom_capcode']['Custom'] ='<span class="capcode" style="color:lightgreen;font-style:italic;font-weight:bold"> ## %s</span>'; - - // "## Mod" makes everything purple, including the name and tripcode + + // "## Mod" makes everything purple, including the name and tripcode: //$config['custom_capcode']['Mod'] = array( // '<span class="capcode" style="color:purple"> ## %s</span>', // 'color:purple', // Change name style; optional // 'color:purple' // Change tripcode style; optional //); - - // "## Admin" makes everything red and bold, including the name and tripcode + + // "## Admin" makes everything red and bold, including the name and tripcode: //$config['custom_capcode']['Admin'] = array( // '<span class="capcode" style="color:red;font-weight:bold"> ## %s</span>', // 'color:red;font-weight:bold', // Change name style; optional // 'color:red;font-weight:bold' // Change tripcode style; optional //); - - // Enable IP range bans (eg. "127.*.0.1", "127.0.0.*", and "12*.0.0.1" all match "127.0.0.1"). - // A little more load on the database + + // Enable IP range bans (eg. "127.*.0.1", "127.0.0.*", and "12*.0.0.1" all match "127.0.0.1"). Puts a + // little more load on the database $config['ban_range'] = true; - - // Enable CDIR netmask bans (eg. "10.0.0.0/8" for 10.0.0.0.0 - 10.255.255.255). Useful for stopping persistent spammers. - // Again, a little more database load. + + // Enable CDIR netmask bans (eg. "10.0.0.0/8" for 10.0.0.0.0 - 10.255.255.255). Useful for stopping + // persistent spammers and ban evaders. Again, a little more database load. $config['ban_cidr'] = true; - - // Do a DNS lookup on IP addresses to get their hostname on the IP summary page + + // How often (minimum) to purge the ban list of expired bans (which have been seen). Only works when + // $config['cache'] is enabled and working. + $config['purge_bans'] = 60 * 60 * 12; // 12 hours + + // Do DNS lookups on IP addresses to get their hostname for the moderator IP pages (?/IP/x.x.x.x). $config['mod']['dns_lookup'] = true; - // How many recent posts, per board, to show in the IP summary page + // How many recent posts, per board, to show in ?/IP/x.x.x.x. $config['mod']['ip_recentposts'] = 5; - - // How many posts to display on the reports page + + // Number of posts to display on the reports page. $config['mod']['recent_reports'] = 10; - - // How many actions to show per page in the moderation log + // Number of actions to show per page in the moderation log. $config['mod']['modlog_page'] = 350; - // How many bans to show per page in the ban list + // Number of bans to show per page in the ban list. $config['mod']['banlist_page'] = 350; - - // Number of news entries to display per page + // Number of news entries to display per page. $config['mod']['news_page'] = 40; - - // Number of results to dispaly per page + // Number of results to display per page. $config['mod']['search_page'] = 200; - - // How many entries to show per page in the moderator noticeboard + // Number of entries to show per page in the moderator noticeboard. $config['mod']['noticeboard_page'] = 50; - // Number of entries to summarize and display on the dashboard + // Number of entries to summarize and display on the dashboard. $config['mod']['noticeboard_dashboard'] = 5; - - // Default public ban message - $config['mod']['default_ban_message'] = 'USER WAS BANNED FOR THIS POST'; - // What to append to the post for public bans ("%s" is the message) + + // Check public ban message by default. + $config['mod']['check_ban_message'] = false; + // Default public ban message. In public ban messages, %length% is replaced with "for x days" or + // "permanently" (with %LENGTH% being the uppercase equivalent). + $config['mod']['default_ban_message'] = _('USER WAS BANNED FOR THIS POST'); + // $config['mod']['default_ban_message'] = 'USER WAS BANNED %LENGTH% FOR THIS POST'; + // HTML to append to post bodies for public bans messages (where "%s" is the message). $config['mod']['ban_message'] = '<span class="public_ban">(%s)</span>'; - - // When moving a thread to another board and choosing to keep a "shadow thread", an automated post (with a capcode) will - // be made, linking to the new location for the thread. "%s" will be replaced with a standard cross-board post citation (>>>/board/xxx) + + // When moving a thread to another board and choosing to keep a "shadow thread", an automated post (with + // a capcode) will be made, linking to the new location for the thread. "%s" will be replaced with a + // standard cross-board post citation (>>>/board/xxx) $config['mod']['shadow_mesage'] = 'Moved to %s.'; // Capcode to use when posting the above message. $config['mod']['shadow_capcode'] = 'Mod'; - // Name to use when posting the above message. If false, the default board name will be used. If something else, that will be used. + // Name to use when posting the above message. If false, $config['anonymous'] will be used. $config['mod']['shadow_name'] = false; - - // Wait indefinitely when rebuilding everything + + // PHP time limit for ?/rebuild. A value of 0 should cause PHP to wait indefinitely. $config['mod']['rebuild_timelimit'] = 0; - - // PM snippet (for ?/inbox) length in characters + + // PM snippet (for ?/inbox) length in characters. $config['mod']['snippet_length'] = 75; - - // Edit raw HTML in posts by default + + // Edit raw HTML in posts by default. $config['mod']['raw_html_default'] = false; - - // Automatically dismiss all reports regarding a thread when it is locked + + // Automatically dismiss all reports regarding a thread when it is locked. $config['mod']['dismiss_reports_on_lock'] = true; - + + // Replace ?/config with a simple text editor for editing inc/instance-config.php. + $config['mod']['config_editor_php'] = false; + +/* + * ==================== + * Mod permissions + * ==================== + */ + // Probably best not to change these: if (!defined('JANITOR')) { define('JANITOR', 0, true); @@ -939,31 +1058,24 @@ define('ADMIN', 2, true); define('DISABLED', 3, true); } - -/* - * ==================== - * Mod permissions - * ==================== - */ - - // Capcode permissions + + // Capcode permissions. $config['mod']['capcode'] = array( // JANITOR => array('Janitor'), - MOD => array('Mod'), + MOD => array('Mod'), ADMIN => true ); - + // Example: Allow mods to post with "## Moderator" as well // $config['mod']['capcode'][MOD][] = 'Moderator'; - // Example: Allow janitors to post with any capcode // $config['mod']['capcode'][JANITOR] = true; - - // Set any of the below to "DISABLED" to make them unavailable for everyone. - + + // Set any of the below to "DISABLED" to make them unavailable for everyone. + // Don't worry about per-board moderators. Let all mods moderate any board. $config['mod']['skip_per_board'] = false; - + /* Post Controls */ // View IP addresses $config['mod']['show_ip'] = MOD; @@ -1002,8 +1114,8 @@ // Bypass flood check $config['mod']['flood'] = ADMIN; // Raw HTML posting - $config['mod']['rawhtml'] = MOD; - + $config['mod']['rawhtml'] = ADMIN; + /* Administration */ // View the report queue $config['mod']['reports'] = JANITOR; @@ -1015,8 +1127,8 @@ $config['mod']['view_banlist'] = MOD; // View the username of the mod who made a ban $config['mod']['view_banstaff'] = MOD; - // If the moderator doesn't fit the $config['mod']['view_banstaff''] (previous) permission, - // show him just a "?" instead. Otherwise, it will be "Mod" or "Admin" + // If the moderator doesn't fit the $config['mod']['view_banstaff''] (previous) permission, show him just + // a "?" instead. Otherwise, it will be "Mod" or "Admin". $config['mod']['view_banquestionmark'] = false; // Show expired bans in the ban list (they are kept in cache until the culprit returns) $config['mod']['view_banexpired'] = true; @@ -1048,8 +1160,10 @@ $config['mod']['createusers'] = ADMIN; // View the moderation log $config['mod']['modlog'] = ADMIN; - // View relevant moderation log entries on IP address pages (ie. ban history, etc.) - // Warning: Can be pretty resource exhaustive if your mod logs are huge. + // View IP addresses of other mods in ?/log + $config['mod']['show_ip_modlog'] = ADMIN; + // View relevant moderation log entries on IP address pages (ie. ban history, etc.) Warning: Can be + // pretty resource intensive if your mod logs are huge. $config['mod']['modlog_ip'] = MOD; // Create a PM (viewing mod usernames) $config['mod']['create_pm'] = JANITOR; @@ -1059,6 +1173,9 @@ $config['mod']['rebuild'] = ADMIN; // Search through posts, IP address notes and bans $config['mod']['search'] = JANITOR; + // Allow searching posts (can be used with board configuration file to disallow searching through a + // certain board) + $config['mod']['search_posts'] = JANITOR; // Read the moderator noticeboard $config['mod']['noticeboard'] = JANITOR; // Post to the moderator noticeboard @@ -1075,15 +1192,70 @@ $config['mod']['news_custom'] = ADMIN; // Delete news entries $config['mod']['news_delete'] = ADMIN; - - // View the current configuration - $config['mod']['show_config'] = ADMIN; + // Execute un-filtered SQL queries on the database (?/debug/sql) + $config['mod']['debug_sql'] = DISABLED; // Edit the current configuration (via web interface) $config['mod']['edit_config'] = ADMIN; + + // Config editor permissions + $config['mod']['config'] = array( + JANITOR => false, + MOD => false, + ADMIN => false, + DISABLED => false, + ); + + // Disable the following configuration variables from being changed via ?/config. The following default + // banned variables are considered somewhat dangerous. + $config['mod']['config'][DISABLED] = array( + 'mod>config', + 'mod>config_editor_php', + 'convert_args', + 'db>password', + ); - // Execute un-filtered SQL queries on the database (?/debug/sql) - $config['mod']['debug_sql'] = DISABLED; + $config['mod']['config'][JANITOR] = array( + '!', // Allow editing ONLY the variables listed (in this case, nothing). + ); + + $config['mod']['config'][MOD] = array( + '!', // Allow editing ONLY the variables listed (plus that in $config['mod']['config'][JANITOR]). + 'global_message', + ); + + // Example: Disallow ADMIN from editing (and viewing) $config['db']['password']. + // $config['mod']['config'][ADMIN] = array( + // 'db>password', + // ); + // Example: Allow ADMIN to edit anything other than $config['db'] + // (and $config['mod']['config'][DISABLED]). + // $config['mod']['config'][ADMIN] = array( + // 'db', + // ); + +/* + * ==================== + * Public post search + * ==================== + */ + $config['search'] = array(); + + // Enable the search form + $config['search']['enable'] = false; + + // Maximal number of queries per IP address per minutes + $config['search']['queries_per_minutes'] = Array(15, 2); + + // Global maximal number of queries per minutes + $config['search']['queries_per_minutes_all'] = Array(50, 2); + + // Limit of search results + $config['search']['search_limit'] = 100; + + // Boards for searching + //$config['search']['boards'] = array('a', 'b', 'c', 'd', 'e'); + /* * ==================== * Events (PHP 5.3.0+) @@ -1095,7 +1267,7 @@ // event_handler('post', function($post) { // // do something // }); - + // event_handler('post', function($post) { // // do something else // @@ -1108,35 +1280,50 @@ * Other/uncategorized * ==================== */ - - // Meta keywords. It's probably best to include these in per-board configurations. - //$config['meta_keywords'] = 'chan,anonymous discussion,imageboard,tinyboard'; - - // Link imageboard to your Google Analytics account to track users and provide marketing insights. + + // Meta keywords. It's probably best to include these in per-board configurations. + // $config['meta_keywords'] = 'chan,anonymous discussion,imageboard,tinyboard'; + + // Link imageboard to your Google Analytics account to track users and provide traffic insights. // $config['google_analytics'] = 'UA-xxxxxxx-yy'; // Keep the Google Analytics cookies to one domain -- ga._setDomainName() // $config['google_analytics_domain'] = 'www.example.org'; - - // If you use Varnish, Squid, or any similar caching reverse-proxy in front of Tinyboard, - // you can configure Tinyboard to PURGE files when they're written to - //$config['purge'] = array( - // array('127.0.0.1', 80) - // array('127.0.0.1', 80, 'example.org') - //); - // Connection timeout, in seconds + + // If you use Varnish, Squid, or any similar caching reverse-proxy in front of Tinyboard, you can + // configure Tinyboard to PURGE files when they're written to. + // $config['purge'] = array( + // array('127.0.0.1', 80) + // array('127.0.0.1', 80, 'example.org') + // ); + + // Connection timeout for $config['purge'], in seconds. $config['purge_timeout'] = 3; - - // Remote servers - // http://tinyboard.org/wiki/index.php?title=Multiple_Servers - //$config['remote']['static'] = array( - // 'host' => 'static.example.org', - // 'auth' => array( - // 'method' => 'plain', - // 'username' => 'username', - // 'password' => 'password!123' - // ), - // 'type' => 'scp' - //); - - // Complex regular expression to catch URLs + + // Additional mod.php?/ pages. Look in inc/mod/pages.php for help. + // $config['mod']['custom_pages']['/something/(\d+)'] = function($id) { + // global $config; + // if (!hasPermission($config['mod']['something'])) + // error($config['error']['noaccess']); + // // ... + // }; + + // Example: Add links to dashboard (will all be in a new "Other" category). + // $config['mod']['dashboard_links']['Something'] = '?/something'; + + // Remote servers. I'm not even sure if this code works anymore. It might. Haven't tried it in a while. + // $config['remote']['static'] = array( + // 'host' => 'static.example.org', + // 'auth' => array( + // 'method' => 'plain', + // 'username' => 'username', + // 'password' => 'password!123' + // ), + // 'type' => 'scp' + // ); + + // Regex for board URIs. Don't add "`" character or any Unicode that MySQL can't handle. 58 characters + // is the absolute maximum, because MySQL cannot handle table names greater than 64 characters. + $config['board_regex'] = '[0-9a-zA-Z$_\x{0080}-\x{FFFF}]{1,58}'; + + // Complex regular expression to catch URLs. $config['url_regex'] = '/' . '(https?|ftp):\/\/' . '(([\w\-]+\.)+[a-zA-Z]{2,6}|\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})' . '(:\d+)?' . '(\/([\w\-~.#\/?=&;:+%!*\[\]@$\'()+,|\^]+)?)?' . '/'; diff --git a/inc/database.php b/inc/database.php index a0edd1fb..24959d0c 100644 --- a/inc/database.php +++ b/inc/database.php @@ -51,12 +51,16 @@ function sql_open() { try { $options = array( PDO::ATTR_TIMEOUT => $config['db']['timeout'], - PDO::MYSQL_ATTR_INIT_COMMAND => 'SET NAMES utf8', PDO::MYSQL_ATTR_USE_BUFFERED_QUERY => true ); if ($config['db']['persistent']) $options[PDO::ATTR_PERSISTENT] = true; - return $pdo = new PDO($dsn, $config['db']['user'], $config['db']['password'], $options); + $pdo = new PDO($dsn, $config['db']['user'], $config['db']['password'], $options); + if (mysql_version() >= 50503) + query('SET NAMES utf8mb4') or error(db_error()); + else + query('SET NAMES utf8') or error(db_error()); + return $pdo; } catch(PDOException $e) { $message = $e->getMessage(); @@ -65,13 +69,26 @@ function sql_open() { $message = str_replace($config['db']['password'], '<em>hidden</em>', $message); // Print error - error('Database error: ' . $message); + error(_('Database error: ') . $message); } } +// 5.6.10 becomes 50610 +function mysql_version() { + global $pdo; + + $version = $pdo->getAttribute(PDO::ATTR_SERVER_VERSION); + $v = explode('.', $version); + if (count($v) != 3) + return false; + return (int) sprintf("%02d%02d%02d", $v[0], $v[1], $v[2]); +} + function prepare($query) { global $pdo, $debug, $config; + $query = preg_replace('/``('.$config['board_regex'].')``/u', '`' . $config['db']['prefix'] . '$1`', $query); + sql_open(); if ($config['debug']) @@ -83,6 +100,8 @@ function prepare($query) { function query($query) { global $pdo, $debug, $config; + $query = preg_replace('/``('.$config['board_regex'].')``/u', '`' . $config['db']['prefix'] . '$1`', $query); + sql_open(); if ($config['debug']) { @@ -102,14 +121,14 @@ function query($query) { return $pdo->query($query); } -function db_error($PDOStatement=null) { - global $pdo; +function db_error($PDOStatement = null) { + global $pdo, $db_error; if (isset($PDOStatement)) { - $err = $PDOStatement->errorInfo(); - return $err[2]; + $db_error = $PDOStatement->errorInfo(); + return $db_error[2]; } - $err = $pdo->errorInfo(); - return $err[2]; + $db_error = $pdo->errorInfo(); + return $db_error[2]; } diff --git a/inc/display.php b/inc/display.php index fe8bb048..18eeb1f6 100644 --- a/inc/display.php +++ b/inc/display.php @@ -25,6 +25,7 @@ function doBoardListPart($list, $root) { $body = ''; foreach ($list as $board) { if (is_array($board)) + // $body .= ' [' . doBoardListPart($board, $root) . '] '; $body .= ' <span class="sub">[' . doBoardListPart($board, $root) . ']</span> '; else { if (($key = array_search($board, $list)) && gettype($key) == 'string') { @@ -56,8 +57,8 @@ function createBoardlist($mod=false) { ); } -function error($message, $priority = true) { - global $board, $mod, $config; +function error($message, $priority = true, $debug_stuff = false) { + global $board, $mod, $config, $db_error; if ($config['syslog'] && $priority !== false) { // Use LOG_NOTICE instead of LOG_ERR or LOG_WARNING because most error message are not significant. @@ -68,18 +69,22 @@ function error($message, $priority = true) { // Running from CLI die('Error: ' . $message . "\n"); } + + if ($config['debug'] && isset($db_error)) { + $debug_stuff = array_combine(array('SQLSTATE', 'Error code', 'Error message'), $db_error); + } die(Element('page.html', array( - 'config'=>$config, - 'title'=>'Error', - 'subtitle'=>'An error has occured.', - 'body'=>'<center>' . - '<h2>' . _($message) . '</h2>' . - (isset($board) ? - "<p><a href=\"" . $config['root'] . - ($mod ? $config['file_mod'] . '?/' : '') . - $board['dir'] . $config['file_index'] . "\">Go back</a>.</p>" : '') . - '</center>' + 'config' => $config, + 'title' => _('Error'), + 'subtitle' => _('An error has occured.'), + 'body' => Element('error.html', array( + 'config' => $config, + 'message' => $message, + 'mod' => $mod, + 'board' => isset($board) ? $board : false, + 'debug' => is_array($debug_stuff) ? str_replace("\n", ' ', utf8tohtml(print_r($debug_stuff, true))) : utf8tohtml($debug_stuff) + )) ))); } @@ -207,7 +212,7 @@ function truncate($body, $url, $max_lines = false, $max_chars = false) { $body = preg_replace('/&[^;]*$/', '', $body); } - $body .= '<span class="toolong">Post too long. Click <a href="' . $url . '">here</a> to view the full text.</span>'; + $body .= '<span class="toolong">'.sprintf(_('Post too long. Click <a href="%s">here</a> to view the full text.'), $url).'</span>'; } return $body; @@ -235,7 +240,7 @@ function bidi_cleanup($str){ function secure_link_confirm($text, $title, $confirm_message, $href) { global $config; - return '<a onclick="if (event.which==2) return true;if (confirm(\'' . htmlentities(addslashes($confirm_message)) . '\')) document.location=\'?/' . htmlentities(addslashes($href . '/' . make_secure_link_token($href))) . '\';return false;" title="' . htmlentities($title) . '" href="?/' . $href . '">' . $text . '</a>'; + return '<a onclick="if (event.which==2) return true;if (confirm(\'' . htmlentities(addslashes($confirm_message)) . '\')) document.location=\'?/' . htmlspecialchars(addslashes($href . '/' . make_secure_link_token($href))) . '\';return false;" title="' . htmlentities($title) . '" href="?/' . $href . '">' . $text . '</a>'; } function secure_link($href) { return $href . '/' . make_secure_link_token($href); @@ -299,7 +304,7 @@ class Post { // Fix internal links // Very complicated regex $this->body = preg_replace( - '/<a((([a-zA-Z]+="[^"]+")|[a-zA-Z]+=[a-zA-Z]+|\s)*)href="' . preg_quote($config['root'], '/') . '(' . sprintf(preg_quote($config['board_path'], '/'), '\w+') . ')/', + '/<a((([a-zA-Z]+="[^"]+")|[a-zA-Z]+=[a-zA-Z]+|\s)*)href="' . preg_quote($config['root'], '/') . '(' . sprintf(preg_quote($config['board_path'], '/'), $config['board_regex']) . ')/u', '<a $1href="?/$4', $this->body ); @@ -318,31 +323,31 @@ class Post { // Delete if (hasPermission($config['mod']['delete'], $board['uri'], $this->mod)) - $built .= ' ' . secure_link_confirm($config['mod']['link_delete'], 'Delete', 'Are you sure you want to delete this?', $board['uri'] . '/delete/' . $this->id); + $built .= ' ' . secure_link_confirm($config['mod']['link_delete'], 'Delete', 'Are you sure you want to delete this?', $board['dir'] . 'delete/' . $this->id); // Delete all posts by IP if (hasPermission($config['mod']['deletebyip'], $board['uri'], $this->mod)) - $built .= ' ' . secure_link_confirm($config['mod']['link_deletebyip'], 'Delete all posts by IP', 'Are you sure you want to delete all posts by this IP address?', $board['uri'] . '/deletebyip/' . $this->id); + $built .= ' ' . secure_link_confirm($config['mod']['link_deletebyip'], 'Delete all posts by IP', 'Are you sure you want to delete all posts by this IP address?', $board['dir'] . 'deletebyip/' . $this->id); // Delete all posts by IP (global) if (hasPermission($config['mod']['deletebyip_global'], $board['uri'], $this->mod)) - $built .= ' ' . secure_link_confirm($config['mod']['link_deletebyip_global'], 'Delete all posts by IP across all boards', 'Are you sure you want to delete all posts by this IP address, across all boards?', $board['uri'] . '/deletebyip/' . $this->id . '/global'); + $built .= ' ' . secure_link_confirm($config['mod']['link_deletebyip_global'], 'Delete all posts by IP across all boards', 'Are you sure you want to delete all posts by this IP address, across all boards?', $board['dir'] . 'deletebyip/' . $this->id . '/global'); // Ban if (hasPermission($config['mod']['ban'], $board['uri'], $this->mod)) - $built .= ' <a title="Ban" href="?/' . $board['uri'] . '/ban/' . $this->id . '">' . $config['mod']['link_ban'] . '</a>'; + $built .= ' <a title="'._('Ban').'" href="?/' . $board['dir'] . 'ban/' . $this->id . '">' . $config['mod']['link_ban'] . '</a>'; // Ban & Delete if (hasPermission($config['mod']['bandelete'], $board['uri'], $this->mod)) - $built .= ' <a title="Ban & Delete" href="?/' . $board['uri'] . '/ban&delete/' . $this->id . '">' . $config['mod']['link_bandelete'] . '</a>'; + $built .= ' <a title="'._('Ban & Delete').'" href="?/' . $board['dir'] . 'ban&delete/' . $this->id . '">' . $config['mod']['link_bandelete'] . '</a>'; // Delete file (keep post) if (!empty($this->file) && hasPermission($config['mod']['deletefile'], $board['uri'], $this->mod)) - $built .= ' ' . secure_link_confirm($config['mod']['link_deletefile'], 'Delete file', 'Are you sure you want to delete this file?', $board['uri'] . '/deletefile/' . $this->id); + $built .= ' ' . secure_link_confirm($config['mod']['link_deletefile'], _('Delete file'), _('Are you sure you want to delete this file?'), $board['dir'] . 'deletefile/' . $this->id); // Edit post if (hasPermission($config['mod']['editpost'], $board['uri'], $this->mod)) - $built .= ' <a title="Edit post" href="?/' . $board['uri'] . '/edit' . ($config['mod']['raw_html_default'] ? '_raw' : '') . '/' . $this->id . '">' . $config['mod']['link_editpost'] . '</a>'; + $built .= ' <a title="'._('Edit post').'" href="?/' . $board['dir'] . 'edit' . ($config['mod']['raw_html_default'] ? '_raw' : '') . '/' . $this->id . '">' . $config['mod']['link_editpost'] . '</a>'; if (!empty($built)) $built = '<span class="controls">' . $built . '</span>'; @@ -398,7 +403,7 @@ class Thread { // Fix internal links // Very complicated regex $this->body = preg_replace( - '/<a((([a-zA-Z]+="[^"]+")|[a-zA-Z]+=[a-zA-Z]+|\s)*)href="' . preg_quote($config['root'], '/') . '(' . sprintf(preg_quote($config['board_path'], '/'), '\w+') . ')/', + '/<a((([a-zA-Z]+="[^"]+")|[a-zA-Z]+=[a-zA-Z]+|\s)*)href="' . preg_quote($config['root'], '/') . '(' . sprintf(preg_quote($config['board_path'], '/'), $config['board_regex']) . ')/u', '<a $1href="?/$4', $this->body ); @@ -419,54 +424,54 @@ class Thread { // Mod controls (on posts) // Delete if (hasPermission($config['mod']['delete'], $board['uri'], $this->mod)) - $built .= ' ' . secure_link_confirm($config['mod']['link_delete'], 'Delete', 'Are you sure you want to delete this?', $board['uri'] . '/delete/' . $this->id); + $built .= ' ' . secure_link_confirm($config['mod']['link_delete'], _('Delete'), _('Are you sure you want to delete this?'), $board['dir'] . 'delete/' . $this->id); // Delete all posts by IP if (hasPermission($config['mod']['deletebyip'], $board['uri'], $this->mod)) - $built .= ' ' . secure_link_confirm($config['mod']['link_deletebyip'], 'Delete all posts by IP', 'Are you sure you want to delete all posts by this IP address?', $board['uri'] . '/deletebyip/' . $this->id); + $built .= ' ' . secure_link_confirm($config['mod']['link_deletebyip'], _('Delete all posts by IP'), _('Are you sure you want to delete all posts by this IP address?'), $board['dir'] . 'deletebyip/' . $this->id); // Delete all posts by IP (global) if (hasPermission($config['mod']['deletebyip_global'], $board['uri'], $this->mod)) - $built .= ' ' . secure_link_confirm($config['mod']['link_deletebyip_global'], 'Delete all posts by IP across all boards', 'Are you sure you want to delete all posts by this IP address, across all boards?', $board['uri'] . '/deletebyip/' . $this->id . '/global'); + $built .= ' ' . secure_link_confirm($config['mod']['link_deletebyip_global'], _('Delete all posts by IP across all boards'), _('Are you sure you want to delete all posts by this IP address, across all boards?'), $board['dir'] . 'deletebyip/' . $this->id . '/global'); // Ban if (hasPermission($config['mod']['ban'], $board['uri'], $this->mod)) - $built .= ' <a title="Ban" href="?/' . $board['uri'] . '/ban/' . $this->id . '">' . $config['mod']['link_ban'] . '</a>'; + $built .= ' <a title="'._('Ban').'" href="?/' . $board['dir'] . 'ban/' . $this->id . '">' . $config['mod']['link_ban'] . '</a>'; // Ban & Delete if (hasPermission($config['mod']['bandelete'], $board['uri'], $this->mod)) - $built .= ' <a title="Ban & Delete" href="?/' . $board['uri'] . '/ban&delete/' . $this->id . '">' . $config['mod']['link_bandelete'] . '</a>'; + $built .= ' <a title="'._('Ban & Delete').'" href="?/' . $board['dir'] . 'ban&delete/' . $this->id . '">' . $config['mod']['link_bandelete'] . '</a>'; // Delete file (keep post) if (!empty($this->file) && $this->file != 'deleted' && hasPermission($config['mod']['deletefile'], $board['uri'], $this->mod)) - $built .= ' ' . secure_link_confirm($config['mod']['link_deletefile'], 'Delete file', 'Are you sure you want to delete this file?', $board['uri'] . '/deletefile/' . $this->id); + $built .= ' ' . secure_link_confirm($config['mod']['link_deletefile'], _('Delete file'), _('Are you sure you want to delete this file?'), $board['dir'] . 'deletefile/' . $this->id); // Sticky if (hasPermission($config['mod']['sticky'], $board['uri'], $this->mod)) if ($this->sticky) - $built .= ' <a title="Make thread not sticky" href="?/' . secure_link($board['uri'] . '/unsticky/' . $this->id) . '">' . $config['mod']['link_desticky'] . '</a>'; + $built .= ' <a title="'._('Make thread not sticky').'" href="?/' . secure_link($board['dir'] . 'unsticky/' . $this->id) . '">' . $config['mod']['link_desticky'] . '</a>'; else - $built .= ' <a title="Make thread sticky" href="?/' . secure_link($board['uri'] . '/sticky/' . $this->id) . '">' . $config['mod']['link_sticky'] . '</a>'; + $built .= ' <a title="'._('Make thread sticky').'" href="?/' . secure_link($board['dir'] . 'sticky/' . $this->id) . '">' . $config['mod']['link_sticky'] . '</a>'; if (hasPermission($config['mod']['bumplock'], $board['uri'], $this->mod)) if ($this->bumplocked) - $built .= ' <a title="Allow thread to be bumped" href="?/' . secure_link($board['uri'] . '/bumpunlock/' . $this->id) . '">' . $config['mod']['link_bumpunlock'] . '</a>'; + $built .= ' <a title="'._('Allow thread to be bumped').'" href="?/' . secure_link($board['dir'] . 'bumpunlock/' . $this->id) . '">' . $config['mod']['link_bumpunlock'] . '</a>'; else - $built .= ' <a title="Prevent thread from being bumped" href="?/' . secure_link($board['uri'] . '/bumplock/' . $this->id) . '">' . $config['mod']['link_bumplock'] . '</a>'; + $built .= ' <a title="'._('Prevent thread from being bumped').'" href="?/' . secure_link($board['dir'] . 'bumplock/' . $this->id) . '">' . $config['mod']['link_bumplock'] . '</a>'; // Lock if (hasPermission($config['mod']['lock'], $board['uri'], $this->mod)) if ($this->locked) - $built .= ' <a title="Unlock thread" href="?/' . secure_link($board['uri'] . '/unlock/' . $this->id) . '">' . $config['mod']['link_unlock'] . '</a>'; + $built .= ' <a title="'._('Unlock thread').'" href="?/' . secure_link($board['dir'] . 'unlock/' . $this->id) . '">' . $config['mod']['link_unlock'] . '</a>'; else - $built .= ' <a title="Lock thread" href="?/' . secure_link($board['uri'] . '/lock/' . $this->id) . '">' . $config['mod']['link_lock'] . '</a>'; + $built .= ' <a title="'._('Lock thread').'" href="?/' . secure_link($board['dir'] . 'lock/' . $this->id) . '">' . $config['mod']['link_lock'] . '</a>'; if (hasPermission($config['mod']['move'], $board['uri'], $this->mod)) - $built .= ' <a title="Move thread to another board" href="?/' . $board['uri'] . '/move/' . $this->id . '">' . $config['mod']['link_move'] . '</a>'; + $built .= ' <a title="'._('Move thread to another board').'" href="?/' . $board['dir'] . 'move/' . $this->id . '">' . $config['mod']['link_move'] . '</a>'; // Edit post if (hasPermission($config['mod']['editpost'], $board['uri'], $this->mod)) - $built .= ' <a title="Edit post" href="?/' . $board['uri'] . '/edit' . ($config['mod']['raw_html_default'] ? '_raw' : '') . '/' . $this->id . '">' . $config['mod']['link_editpost'] . '</a>'; + $built .= ' <a title="'._('Edit post').'" href="?/' . $board['dir'] . 'edit' . ($config['mod']['raw_html_default'] ? '_raw' : '') . '/' . $this->id . '">' . $config['mod']['link_editpost'] . '</a>'; if (!empty($built)) $built = '<span class="controls op">' . $built . '</span>'; diff --git a/inc/filters.php b/inc/filters.php index 524d37cf..cd512821 100644 --- a/inc/filters.php +++ b/inc/filters.php @@ -81,7 +81,7 @@ class Filter { else $all_boards = false; - $query = prepare("INSERT INTO `bans` VALUES (NULL, :ip, :mod, :set, :expires, :reason, :board, 0)"); + $query = prepare("INSERT INTO ``bans`` VALUES (NULL, :ip, :mod, :set, :expires, :reason, :board, 0)"); $query->bindValue(':ip', $_SERVER['REMOTE_ADDR']); $query->bindValue(':mod', -1); $query->bindValue(':set', time()); @@ -132,10 +132,10 @@ class Filter { function do_filters(array $post) { global $config; - if (!isset($config['flood_filters'])) + if (!isset($config['filters'])) return; - foreach ($config['flood_filters'] as $arr) { + foreach ($config['filters'] as $arr) { $filter = new Filter($arr); if ($filter->check($post)) $filter->action(); diff --git a/inc/functions.php b/inc/functions.php index fe1e254c..2e487eed 100644 --- a/inc/functions.php +++ b/inc/functions.php @@ -25,14 +25,14 @@ loadConfig(); function loadConfig() { global $board, $config, $__ip, $debug, $__version; - + $error = function_exists('error') ? 'error' : 'basic_error_function_because_the_other_isnt_loaded_yet'; - + reset_events(); - + if (!isset($_SERVER['REMOTE_ADDR'])) $_SERVER['REMOTE_ADDR'] = '0.0.0.0'; - + $arrays = array( 'db', 'cache', @@ -41,7 +41,7 @@ function loadConfig() { 'dir', 'mod', 'spam', - 'flood_filters', + 'filters', 'wordfilters', 'custom_capcode', 'custom_tripcode', @@ -55,43 +55,44 @@ function loadConfig() { 'stylesheets', 'additional_javascript', 'markup', - 'custom_pages' + 'custom_pages', + 'dashboard_links' ); - + $config = array(); foreach ($arrays as $key) { $config[$key] = array(); } - + require 'inc/config.php'; if (!file_exists('inc/instance-config.php')) $error('Tinyboard is not configured! Create inc/instance-config.php.'); - + require 'inc/instance-config.php'; - + if (isset($board['dir']) && file_exists($board['dir'] . '/config.php')) { require $board['dir'] . '/config.php'; } - + if (!isset($__version)) $__version = file_exists('.installed') ? trim(file_get_contents('.installed')) : false; $config['version'] = $__version; - + if ($config['debug']) { if (!isset($debug)) { - $debug = array('sql' => array(), 'purge' => array(), 'cached' => array(), 'write' => array()); + $debug = array('sql' => array(), 'exec' => array(), 'purge' => array(), 'cached' => array(), 'write' => array()); $debug['start'] = microtime(true); } } - + date_default_timezone_set($config['timezone']); - - if (!isset($config['blotter'])) - $config['blotter'] = false; - + + if (!isset($config['global_message'])) + $config['global_message'] = false; + if (!isset($config['post_url'])) $config['post_url'] = $config['root'] . $config['file_post']; - + if (!isset($config['referer_match'])) if (isset($_SERVER['HTTP_HOST'])) { $config['referer_match'] = '/^' . @@ -99,28 +100,28 @@ function loadConfig() { 'https?:\/\/' . $_SERVER['HTTP_HOST']) . preg_quote($config['root'], '/') . '(' . - str_replace('%s', '\w+', preg_quote($config['board_path'], '/')) . + str_replace('%s', $config['board_regex'], preg_quote($config['board_path'], '/')) . '(' . preg_quote($config['file_index'], '/') . '|' . str_replace('%d', '\d+', preg_quote($config['file_page'])) . ')?' . '|' . - str_replace('%s', '\w+', preg_quote($config['board_path'], '/')) . + str_replace('%s', $config['board_regex'], preg_quote($config['board_path'], '/')) . preg_quote($config['dir']['res'], '/') . str_replace('%d', '\d+', preg_quote($config['file_page'], '/')) . '|' . preg_quote($config['file_mod'], '/') . '\?\/.+' . - ')([#?](.+)?)?$/i'; + ')([#?](.+)?)?$/ui'; } else { // CLI mode $config['referer_match'] = '//'; } if (!isset($config['cookies']['path'])) $config['cookies']['path'] = &$config['root']; - + if (!isset($config['dir']['static'])) $config['dir']['static'] = $config['root'] . 'static/'; - + if (!isset($config['image_sticky'])) $config['image_sticky'] = $config['dir']['static'] . 'sticky.gif'; if (!isset($config['image_locked'])) @@ -129,50 +130,50 @@ function loadConfig() { $config['image_bumplocked'] = $config['dir']['static'] . 'sage.gif'; if (!isset($config['image_deleted'])) $config['image_deleted'] = $config['dir']['static'] . 'deleted.png'; - if (!isset($config['image_zip'])) - $config['image_zip'] = $config['dir']['static'] . 'zip.png'; - + if (!isset($config['uri_thumb'])) $config['uri_thumb'] = $config['root'] . $board['dir'] . $config['dir']['thumb']; elseif (isset($board['dir'])) $config['uri_thumb'] = sprintf($config['uri_thumb'], $board['dir']); - + if (!isset($config['uri_img'])) $config['uri_img'] = $config['root'] . $board['dir'] . $config['dir']['img']; elseif (isset($board['dir'])) $config['uri_img'] = sprintf($config['uri_img'], $board['dir']); - + if (!isset($config['uri_stylesheets'])) $config['uri_stylesheets'] = $config['root'] . 'stylesheets/'; - + if (!isset($config['url_stylesheet'])) $config['url_stylesheet'] = $config['uri_stylesheets'] . 'style.css'; if (!isset($config['url_javascript'])) $config['url_javascript'] = $config['root'] . $config['file_script']; if (!isset($config['additional_javascript_url'])) $config['additional_javascript_url'] = $config['root']; - + if ($config['root_file']) { chdir($config['root_file']); } if ($config['verbose_errors']) { + set_error_handler('verbose_error_handler'); error_reporting(E_ALL); - ini_set('display_errors', 1); + ini_set('display_errors', true); + ini_set('html_errors', false); } - + // Keep the original address to properly comply with other board configurations if (!isset($__ip)) $__ip = $_SERVER['REMOTE_ADDR']; - + // ::ffff:0.0.0.0 if (preg_match('/^\:\:(ffff\:)?(\d+\.\d+\.\d+\.\d+)$/', $__ip, $m)) $_SERVER['REMOTE_ADDR'] = $m[2]; - + if (_setlocale(LC_ALL, $config['locale']) === false) { $error('The specified locale (' . $config['locale'] . ') does not exist on your platform!'); } - + if (extension_loaded('gettext')) { bindtextdomain('tinyboard', './inc/locale'); bind_textdomain_codeset('tinyboard', 'UTF-8'); @@ -182,11 +183,11 @@ function loadConfig() { _bind_textdomain_codeset('tinyboard', 'UTF-8'); _textdomain('tinyboard'); } - - + + if ($config['syslog']) openlog('tinyboard', LOG_ODELAY, LOG_SYSLOG); // open a connection to sysem logger - + if ($config['recaptcha']) require_once 'inc/lib/recaptcha/recaptchalib.php'; if ($config['cache']['enabled']) @@ -196,12 +197,12 @@ function loadConfig() { function basic_error_function_because_the_other_isnt_loaded_yet($message, $priority = true) { global $config; - + if ($config['syslog'] && $priority !== false) { // Use LOG_NOTICE instead of LOG_ERR or LOG_WARNING because most error message are not significant. _syslog($priority !== true ? $priority : LOG_NOTICE, $message); } - + // Yes, this is horrible. die('<!DOCTYPE html><html><head><title>Error</title>' . '<style type="text/css">' . @@ -234,17 +235,28 @@ function _syslog($priority, $message) { } } +function verbose_error_handler($errno, $errstr, $errfile, $errline) { + if (error_reporting() == 0) + return false; // Looks like this warning was suppressed by the @ operator. + error(utf8tohtml($errstr), true, array( + 'file' => $errfile . ':' . $errline, + 'errno' => $errno, + 'error' => $errstr, + 'backtrace' => array_slice(debug_backtrace(), 1) + )); +} + function create_antibot($board, $thread = null) { require_once dirname(__FILE__) . '/anti-bot.php'; - + return _create_antibot($board, $thread); } function rebuildThemes($action, $board = false) { // List themes - $query = query("SELECT `theme` FROM `theme_settings` WHERE `name` IS NULL AND `value` IS NULL") or error(db_error()); + $query = query("SELECT `theme` FROM ``theme_settings`` WHERE `name` IS NULL AND `value` IS NULL") or error(db_error()); - while ($theme = $query->fetch()) { + while ($theme = $query->fetch(PDO::FETCH_ASSOC)) { rebuildTheme($theme['theme'], $action, $board); } } @@ -270,19 +282,19 @@ function rebuildTheme($theme, $action, $board = false) { if (file_exists($config['dir']['themes'] . '/' . $_theme . '/theme.php')) { require_once $config['dir']['themes'] . '/' . $_theme . '/theme.php'; - + $theme['build_function']($action, themeSettings($_theme), $board); } } function themeSettings($theme) { - $query = prepare("SELECT `name`, `value` FROM `theme_settings` WHERE `theme` = :theme AND `name` IS NOT NULL"); + $query = prepare("SELECT `name`, `value` FROM ``theme_settings`` WHERE `theme` = :theme AND `name` IS NOT NULL"); $query->bindValue(':theme', $theme); $query->execute() or error(db_error($query)); $settings = array(); - while ($s = $query->fetch()) { + while ($s = $query->fetch(PDO::FETCH_ASSOC)) { $settings[$s['name']] = $s['value']; } @@ -295,26 +307,30 @@ function sprintf3($str, $vars, $delim = '%') { $replaces[$delim . $k . $delim] = $v; } return str_replace(array_keys($replaces), - array_values($replaces), $str); + array_values($replaces), $str); +} + +function mb_substr_replace($string, $replacement, $start, $length) { + return mb_substr($string, 0, $start) . $replacement . mb_substr($string, $start + $length); } function setupBoard($array) { global $board, $config; - + $board = array( 'uri' => $array['uri'], 'title' => $array['title'], 'subtitle' => $array['subtitle'] ); - + // older versions $board['name'] = &$board['title']; - + $board['dir'] = sprintf($config['board_path'], $board['uri']); $board['url'] = sprintf($config['board_abbreviation'], $board['uri']); - + loadConfig(); - + if (!file_exists($board['dir'])) @mkdir($board['dir'], 0777) or error("Couldn't create " . $board['dir'] . ". Check permissions.", true); if (!file_exists($board['dir'] . $config['dir']['img'])) @@ -329,6 +345,11 @@ function setupBoard($array) { } function openBoard($uri) { + global $config, $build_pages; + + if ($config['try_smarter']) + $build_pages = array(); + $board = getBoardInfo($uri); if ($board) { setupBoard($board); @@ -343,12 +364,12 @@ function getBoardInfo($uri) { if ($config['cache']['enabled'] && ($board = cache::get('board_' . $uri))) { return $board; } - - $query = prepare("SELECT * FROM `boards` WHERE `uri` = :uri LIMIT 1"); + + $query = prepare("SELECT * FROM ``boards`` WHERE `uri` = :uri LIMIT 1"); $query->bindValue(':uri', $uri); $query->execute() or error(db_error($query)); - - if ($board = $query->fetch()) { + + if ($board = $query->fetch(PDO::FETCH_ASSOC)) { if ($config['cache']['enabled']) cache::set('board_' . $uri, $board); return $board; @@ -366,17 +387,25 @@ function boardTitle($uri) { function purge($uri) { global $config, $debug; - + + // Fix for Unicode + $uri = rawurlencode($uri); + + $noescape = "/!~*()+:"; + $noescape = preg_split('//', $noescape); + $noescape_url = array_map("rawurlencode", $noescape); + $uri = str_replace($noescape_url, $noescape, $uri); + if (preg_match($config['referer_match'], $config['root']) && isset($_SERVER['REQUEST_URI'])) { $uri = (str_replace('\\', '/', dirname($_SERVER['REQUEST_URI'])) == '/' ? '/' : str_replace('\\', '/', dirname($_SERVER['REQUEST_URI'])) . '/') . $uri; } else { $uri = $config['root'] . $uri; } - + if ($config['debug']) { $debug['purge'][] = $uri; } - + foreach ($config['purge'] as &$purge) { $host = &$purge[0]; $port = &$purge[1]; @@ -394,11 +423,11 @@ function purge($uri) { function file_write($path, $data, $simple = false, $skip_purge = false) { global $config, $debug; - + if (preg_match('/^remote:\/\/(.+)\:(.+)$/', $path, $m)) { if (isset($config['remote'][$m[1]])) { require_once 'inc/remote.php'; - + $remote = new Remote($config['remote'][$m[1]]); $remote->write($data, $m[2]); return; @@ -406,31 +435,31 @@ function file_write($path, $data, $simple = false, $skip_purge = false) { error('Invalid remote server: ' . $m[1]); } } - + if (!$fp = fopen($path, $simple ? 'w' : 'c')) error('Unable to open file for writing: ' . $path); - + // File locking if (!$simple && !flock($fp, LOCK_EX)) { error('Unable to lock file: ' . $path); } - + // Truncate file if (!$simple && !ftruncate($fp, 0)) error('Unable to truncate file: ' . $path); - + // Write data if (($bytes = fwrite($fp, $data)) === false) error('Unable to write to file: ' . $path); - + // Unlock if (!$simple) flock($fp, LOCK_UN); - + // Close if (!fclose($fp)) error('Unable to close file: ' . $path); - + if (!$skip_purge && isset($config['purge'])) { // Purge cache if (basename($path) == $config['file_index']) { @@ -445,23 +474,23 @@ function file_write($path, $data, $simple = false, $skip_purge = false) { } purge($path); } - + if ($config['debug']) { $debug['write'][] = $path . ': ' . $bytes . ' bytes'; } - + event('write', $path); } function file_unlink($path) { global $config, $debug; - + if ($config['debug']) { if (!isset($debug['unlink'])) $debug['unlink'] = array(); $debug['unlink'][] = $path; } - + $ret = @unlink($path); if (isset($config['purge']) && $path[0] != '/' && isset($_SERVER['HTTP_HOST'])) { // Purge cache @@ -477,121 +506,121 @@ function file_unlink($path) { } purge($path); } - + event('unlink', $path); - + return $ret; } function hasPermission($action = null, $board = null, $_mod = null) { global $config; - + if (isset($_mod)) $mod = &$_mod; else global $mod; - + if (!is_array($mod)) return false; - + if (isset($action) && $mod['type'] < $action) return false; - + if (!isset($board) || $config['mod']['skip_per_board']) return true; - + if (!isset($mod['boards'])) return false; - + if (!in_array('*', $mod['boards']) && !in_array($board, $mod['boards'])) return false; - + return true; } function listBoards() { global $config; - + if ($config['cache']['enabled'] && ($boards = cache::get('all_boards'))) return $boards; - - $query = query("SELECT * FROM `boards` ORDER BY `uri`") or error(db_error()); + + $query = query("SELECT * FROM ``boards`` ORDER BY `uri`") or error(db_error()); $boards = $query->fetchAll(); - + if ($config['cache']['enabled']) cache::set('all_boards', $boards); - + return $boards; } function checkFlood($post) { global $board, $config; - - $query = prepare(sprintf("SELECT * FROM `posts_%s` WHERE (`ip` = :ip AND `time` >= :floodtime) OR (`ip` = :ip AND `body` != '' AND `body` = :body AND `time` >= :floodsameiptime) OR (`body` != '' AND `body` = :body AND `time` >= :floodsametime) LIMIT 1", $board['uri'])); + + $query = prepare(sprintf("SELECT * FROM ``posts_%s`` WHERE (`ip` = :ip AND `time` >= :floodtime) OR (`ip` = :ip AND `body` != '' AND `body` = :body AND `time` >= :floodsameiptime) OR (`body` != '' AND `body` = :body AND `time` >= :floodsametime) LIMIT 1", $board['uri'])); $query->bindValue(':ip', $_SERVER['REMOTE_ADDR']); $query->bindValue(':body', $post['body']); $query->bindValue(':floodtime', time()-$config['flood_time'], PDO::PARAM_INT); $query->bindValue(':floodsameiptime', time()-$config['flood_time_ip'], PDO::PARAM_INT); $query->bindValue(':floodsametime', time()-$config['flood_time_same'], PDO::PARAM_INT); $query->execute() or error(db_error($query)); - - $flood = (bool)$query->fetch(); - + + $flood = (bool) $query->fetch(PDO::FETCH_ASSOC); + if (event('check-flood', $post)) return true; - + return $flood; } function until($timestamp) { $difference = $timestamp - time(); if ($difference < 60) { - return $difference . ' second' . ($difference != 1 ? 's' : ''); + return $difference . ' ' . ngettext('second', 'seconds', $difference); } elseif ($difference < 60*60) { - return ($num = round($difference/(60))) . ' minute' . ($num != 1 ? 's' : ''); + return ($num = round($difference/(60))) . ' ' . ngettext('minute', 'minutes', $num); } elseif ($difference < 60*60*24) { - return ($num = round($difference/(60*60))) . ' hour' . ($num != 1 ? 's' : ''); + return ($num = round($difference/(60*60))) . ' ' . ngettext('hour', 'hours', $num); } elseif ($difference < 60*60*24*7) { - return ($num = round($difference/(60*60*24))) . ' day' . ($num != 1 ? 's' : ''); + return ($num = round($difference/(60*60*24))) . ' ' . ngettext('day', 'days', $num); } elseif ($difference < 60*60*24*365) { - return ($num = round($difference/(60*60*24*7))) . ' week' . ($num != 1 ? 's' : ''); + return ($num = round($difference/(60*60*24*7))) . ' ' . ngettext('week', 'weeks', $num); } - return ($num = round($difference/(60*60*24*365))) . ' year' . ($num != 1 ? 's' : ''); + return ($num = round($difference/(60*60*24*365))) . ' ' . ngettext('year', 'years', $num); } function ago($timestamp) { $difference = time() - $timestamp; if ($difference < 60) { - return $difference . ' second' . ($difference != 1 ? 's' : ''); + return $difference . ' ' . ngettext('second', 'seconds', $difference); } elseif ($difference < 60*60) { - return ($num = round($difference/(60))) . ' minute' . ($num != 1 ? 's' : ''); + return ($num = round($difference/(60))) . ' ' . ngettext('minute', 'minutes', $num); } elseif ($difference < 60*60*24) { - return ($num = round($difference/(60*60))) . ' hour' . ($num != 1 ? 's' : ''); + return ($num = round($difference/(60*60))) . ' ' . ngettext('hour', 'hours', $num); } elseif ($difference < 60*60*24*7) { - return ($num = round($difference/(60*60*24))) . ' day' . ($num != 1 ? 's' : ''); + return ($num = round($difference/(60*60*24))) . ' ' . ngettext('day', 'days', $num); } elseif ($difference < 60*60*24*365) { - return ($num = round($difference/(60*60*24*7))) . ' week' . ($num != 1 ? 's' : ''); + return ($num = round($difference/(60*60*24*7))) . ' ' . ngettext('week', 'weeks', $num); } - return ($num = round($difference/(60*60*24*365))) . ' year' . ($num != 1 ? 's' : ''); + return ($num = round($difference/(60*60*24*365))) . ' ' . ngettext('year', 'years', $num); } function displayBan($ban) { global $config; - + if (!$ban['seen']) { - $query = prepare("UPDATE `bans` SET `seen` = 1 WHERE `id` = :id"); + $query = prepare("UPDATE ``bans`` SET `seen` = 1 WHERE `id` = :id"); $query->bindValue(':id', $ban['id'], PDO::PARAM_INT); $query->execute() or error(db_error($query)); } - + $ban['ip'] = $_SERVER['REMOTE_ADDR']; - + // Show banned page and exit die( Element('page.html', array( - 'title' => 'Banned!', + 'title' => _('Banned!'), 'config' => $config, 'body' => Element('banned.html', array( 'config' => $config, @@ -603,29 +632,29 @@ function displayBan($ban) { function checkBan($board = 0) { global $config; - + if (!isset($_SERVER['REMOTE_ADDR'])) { // Server misconfiguration return; } - + if (event('check-ban', $board)) return true; - - $query = prepare("SELECT `set`, `expires`, `reason`, `board`, `seen`, `bans`.`id` FROM `bans` WHERE (`board` IS NULL OR `board` = :board) AND `ip` = :ip ORDER BY `expires` IS NULL DESC, `expires` DESC, `expires` DESC LIMIT 1"); + + $query = prepare("SELECT `set`, `expires`, `reason`, `board`, `seen`, ``bans``.`id` FROM ``bans`` WHERE (`board` IS NULL OR `board` = :board) AND `ip` = :ip ORDER BY `expires` IS NULL DESC, `expires` DESC, `expires` DESC LIMIT 1"); $query->bindValue(':ip', $_SERVER['REMOTE_ADDR']); $query->bindValue(':board', $board); $query->execute() or error(db_error($query)); if ($query->rowCount() < 1 && $config['ban_range']) { - $query = prepare("SELECT `set`, `expires`, `reason`, `board`, `seen`, `bans`.`id` FROM `bans` WHERE (`board` IS NULL OR `board` = :board) AND :ip LIKE REPLACE(REPLACE(`ip`, '%', '!%'), '*', '%') ESCAPE '!' ORDER BY `expires` IS NULL DESC, `expires` DESC LIMIT 1"); + $query = prepare("SELECT `set`, `expires`, `reason`, `board`, `seen`, ``bans``.`id` FROM ``bans`` WHERE (`board` IS NULL OR `board` = :board) AND :ip LIKE REPLACE(REPLACE(`ip`, '%', '!%'), '*', '%') ESCAPE '!' ORDER BY `expires` IS NULL DESC, `expires` DESC LIMIT 1"); $query->bindValue(':ip', $_SERVER['REMOTE_ADDR']); $query->bindValue(':board', $board); $query->execute() or error(db_error($query)); } - + if ($query->rowCount() < 1 && $config['ban_cidr'] && !isIPv6()) { // my most insane SQL query yet - $query = prepare("SELECT `set`, `expires`, `reason`, `board`, `seen`, `bans`.`id` FROM `bans` WHERE (`board` IS NULL OR `board` = :board) + $query = prepare("SELECT `set`, `expires`, `reason`, `board`, `seen`, ``bans``.`id` FROM ``bans`` WHERE (`board` IS NULL OR `board` = :board) AND ( `ip` REGEXP '^(\[0-9]+\.\[0-9]+\.\[0-9]+\.\[0-9]+\)\/(\[0-9]+)$' AND @@ -638,78 +667,88 @@ function checkBan($board = 0) { $query->bindValue(':board', $board); $query->execute() or error(db_error($query)); } - - if ($ban = $query->fetch()) { + + if ($ban = $query->fetch(PDO::FETCH_ASSOC)) { if ($ban['expires'] && $ban['expires'] < time()) { // Ban expired - $query = prepare("DELETE FROM `bans` WHERE `id` = :id"); + $query = prepare("DELETE FROM ``bans`` WHERE `id` = :id"); $query->bindValue(':id', $ban['id'], PDO::PARAM_INT); $query->execute() or error(db_error($query)); - + if ($config['require_ban_view'] && !$ban['seen']) { displayBan($ban); } - + return; } - + displayBan($ban); } - + // I'm not sure where else to put this. It doesn't really matter where; it just needs to be called every now and then to keep the ban list tidy. purge_bans(); } // No reason to keep expired bans in the database (except those that haven't been viewed yet) function purge_bans() { - $query = prepare("DELETE FROM `bans` WHERE `expires` IS NOT NULL AND `expires` < :time AND `seen` = 1"); + global $config; + + if ($config['cache']['enabled'] && $last_time_purged = cache::get('purged_bans_last')) { + if (time() - $last_time_purged < $config['purge_bans'] ) + return; + } + + $query = prepare("DELETE FROM ``bans`` WHERE `expires` IS NOT NULL AND `expires` < :time AND `seen` = 1"); $query->bindValue(':time', time()); $query->execute() or error(db_error($query)); + + if ($config['cache']['enabled']) + cache::set('purged_bans_last', time()); } function threadLocked($id) { global $board; - + if (event('check-locked', $id)) return true; - - $query = prepare(sprintf("SELECT `locked` FROM `posts_%s` WHERE `id` = :id AND `thread` IS NULL LIMIT 1", $board['uri'])); + + $query = prepare(sprintf("SELECT `locked` FROM ``posts_%s`` WHERE `id` = :id AND `thread` IS NULL LIMIT 1", $board['uri'])); $query->bindValue(':id', $id, PDO::PARAM_INT); $query->execute() or error(db_error()); - - if (!$post = $query->fetch()) { + + if (($locked = $query->fetchColumn()) === false) { // Non-existant, so it can't be locked... return false; } - - return (bool)$post['locked']; + + return (bool)$locked; } function threadSageLocked($id) { global $board; - + if (event('check-sage-locked', $id)) return true; - - $query = prepare(sprintf("SELECT `sage` FROM `posts_%s` WHERE `id` = :id AND `thread` IS NULL LIMIT 1", $board['uri'])); + + $query = prepare(sprintf("SELECT `sage` FROM ``posts_%s`` WHERE `id` = :id AND `thread` IS NULL LIMIT 1", $board['uri'])); $query->bindValue(':id', $id, PDO::PARAM_INT); $query->execute() or error(db_error()); - - if (!$post = $query->fetch()) { + + if (($sagelocked = $query->fetchColumn()) === false) { // Non-existant, so it can't be locked... return false; } - - return (bool) $post['sage']; + + return (bool)$sagelocked; } function threadExists($id) { global $board; - - $query = prepare(sprintf("SELECT 1 FROM `posts_%s` WHERE `id` = :id AND `thread` IS NULL LIMIT 1", $board['uri'])); + + $query = prepare(sprintf("SELECT 1 FROM ``posts_%s`` WHERE `id` = :id AND `thread` IS NULL LIMIT 1", $board['uri'])); $query->bindValue(':id', $id, PDO::PARAM_INT); $query->execute() or error(db_error()); - + if ($query->rowCount()) { return true; } @@ -719,71 +758,71 @@ function threadExists($id) { function post(array $post) { global $pdo, $board; - $query = prepare(sprintf("INSERT INTO `posts_%s` (`id`, `thread`, `subject`, `email`, `name`, `trip`, `capcode`, `body`, `body_nomarkup`, `time`, `bump`, `thumb`, `thumbwidth`, `thumbheight`, `file`, `filewidth`, `fileheight`, `filesize`, `filename`, `filehash`, `password`, `ip`, `sticky`, `locked`, `sage`, `embed`) VALUES ( NULL, :thread, :subject, :email, :name, :trip, :capcode, :body, :body_nomarkup, :time, :time, :thumb, :thumbwidth, :thumbheight, :file, :width, :height, :filesize, :filename, :filehash, :password, :ip, :sticky, :locked, 0, :embed)", $board['uri'])); - + $query = prepare(sprintf("INSERT INTO ``posts_%s`` VALUES ( NULL, :thread, :subject, :email, :name, :trip, :capcode, :body, :body_nomarkup, :time, :time, :thumb, :thumbwidth, :thumbheight, :file, :width, :height, :filesize, :filename, :filehash, :password, :ip, :sticky, :locked, 0, :embed)", $board['uri'])); + // Basic stuff if (!empty($post['subject'])) { $query->bindValue(':subject', $post['subject']); } else { $query->bindValue(':subject', NULL, PDO::PARAM_NULL); } - + if (!empty($post['email'])) { $query->bindValue(':email', $post['email']); } else { $query->bindValue(':email', NULL, PDO::PARAM_NULL); } - + if (!empty($post['trip'])) { $query->bindValue(':trip', $post['trip']); } else { $query->bindValue(':trip', NULL, PDO::PARAM_NULL); } - + $query->bindValue(':name', $post['name']); $query->bindValue(':body', $post['body']); $query->bindValue(':body_nomarkup', $post['body_nomarkup']); $query->bindValue(':time', isset($post['time']) ? $post['time'] : time(), PDO::PARAM_INT); $query->bindValue(':password', $post['password']); $query->bindValue(':ip', isset($post['ip']) ? $post['ip'] : $_SERVER['REMOTE_ADDR']); - + if ($post['op'] && $post['mod'] && isset($post['sticky']) && $post['sticky']) { $query->bindValue(':sticky', 1, PDO::PARAM_INT); } else { $query->bindValue(':sticky', 0, PDO::PARAM_INT); } - + if ($post['op'] && $post['mod'] && isset($post['locked']) && $post['locked']) { $query->bindValue(':locked', 1, PDO::PARAM_INT); } else { $query->bindValue(':locked', 0, PDO::PARAM_INT); } - + if ($post['mod'] && isset($post['capcode']) && $post['capcode']) { $query->bindValue(':capcode', $post['capcode'], PDO::PARAM_INT); } else { $query->bindValue(':capcode', NULL, PDO::PARAM_NULL); } - + if (!empty($post['embed'])) { $query->bindValue(':embed', $post['embed']); } else { $query->bindValue(':embed', NULL, PDO::PARAM_NULL); } - + if ($post['op']) { // No parent thread, image $query->bindValue(':thread', null, PDO::PARAM_NULL); } else { $query->bindValue(':thread', $post['thread'], PDO::PARAM_INT); } - + if ($post['has_file']) { $query->bindValue(':thumb', $post['thumb']); $query->bindValue(':thumbwidth', $post['thumbwidth'], PDO::PARAM_INT); $query->bindValue(':thumbheight', $post['thumbheight'], PDO::PARAM_INT); $query->bindValue(':file', $post['file']); - + if (isset($post['width'], $post['height'])) { $query->bindValue(':width', $post['width'], PDO::PARAM_INT); $query->bindValue(':height', $post['height'], PDO::PARAM_INT); @@ -791,7 +830,7 @@ function post(array $post) { $query->bindValue(':width', null, PDO::PARAM_NULL); $query->bindValue(':height', null, PDO::PARAM_NULL); } - + $query->bindValue(':filesize', $post['filesize'], PDO::PARAM_INT); $query->bindValue(':filename', $post['filename']); $query->bindValue(':filehash', $post['filehash']); @@ -806,22 +845,25 @@ function post(array $post) { $query->bindValue(':filename', null, PDO::PARAM_NULL); $query->bindValue(':filehash', null, PDO::PARAM_NULL); } - + if (!$query->execute()) { undoImage($post); error(db_error($query)); } - + return $pdo->lastInsertId(); } function bumpThread($id) { - global $board; - + global $config, $board, $build_pages; + if (event('bump', $id)) return true; - - $query = prepare(sprintf("UPDATE `posts_%s` SET `bump` = :time WHERE `id` = :id AND `thread` IS NULL", $board['uri'])); + + if ($config['try_smarter']) + $build_pages[] = thread_find_page($id); + + $query = prepare(sprintf("UPDATE ``posts_%s`` SET `bump` = :time WHERE `id` = :id AND `thread` IS NULL", $board['uri'])); $query->bindValue(':time', time(), PDO::PARAM_INT); $query->bindValue(':id', $id, PDO::PARAM_INT); $query->execute() or error(db_error($query)); @@ -830,34 +872,34 @@ function bumpThread($id) { // Remove file from post function deleteFile($id, $remove_entirely_if_already=true) { global $board, $config; - - $query = prepare(sprintf("SELECT `thread`,`thumb`,`file` FROM `posts_%s` WHERE `id` = :id LIMIT 1", $board['uri'])); + + $query = prepare(sprintf("SELECT `thread`,`thumb`,`file` FROM ``posts_%s`` WHERE `id` = :id LIMIT 1", $board['uri'])); $query->bindValue(':id', $id, PDO::PARAM_INT); $query->execute() or error(db_error($query)); - if (!$post = $query->fetch()) + if (!$post = $query->fetch(PDO::FETCH_ASSOC)) error($config['error']['invalidpost']); - + if ($post['file'] == 'deleted' && !$post['thread']) return; // Can't delete OP's image completely. - - $query = prepare(sprintf("UPDATE `posts_%s` SET `thumb` = NULL, `thumbwidth` = NULL, `thumbheight` = NULL, `filewidth` = NULL, `fileheight` = NULL, `filesize` = NULL, `filename` = NULL, `filehash` = NULL, `file` = :file WHERE `id` = :id", $board['uri'])); + + $query = prepare(sprintf("UPDATE ``posts_%s`` SET `thumb` = NULL, `thumbwidth` = NULL, `thumbheight` = NULL, `filewidth` = NULL, `fileheight` = NULL, `filesize` = NULL, `filename` = NULL, `filehash` = NULL, `file` = :file WHERE `id` = :id", $board['uri'])); if ($post['file'] == 'deleted' && $remove_entirely_if_already) { // Already deleted; remove file fully $query->bindValue(':file', null, PDO::PARAM_NULL); } else { // Delete thumbnail file_unlink($board['dir'] . $config['dir']['thumb'] . $post['thumb']); - + // Delete file file_unlink($board['dir'] . $config['dir']['img'] . $post['file']); - + // Set file to 'deleted' $query->bindValue(':file', 'deleted', PDO::PARAM_INT); } - + $query->bindValue(':id', $id, PDO::PARAM_INT); $query->execute() or error(db_error($query)); - + if ($post['thread']) buildThread($post['thread']); else @@ -867,50 +909,50 @@ function deleteFile($id, $remove_entirely_if_already=true) { // rebuild post (markup) function rebuildPost($id) { global $board; - - $query = prepare(sprintf("SELECT `body_nomarkup`, `thread` FROM `posts_%s` WHERE `id` = :id", $board['uri'])); + + $query = prepare(sprintf("SELECT `body_nomarkup`, `thread` FROM ``posts_%s`` WHERE `id` = :id", $board['uri'])); $query->bindValue(':id', $id, PDO::PARAM_INT); $query->execute() or error(db_error($query)); - - if ((!$post = $query->fetch()) || !$post['body_nomarkup']) + + if ((!$post = $query->fetch(PDO::FETCH_ASSOC)) || !$post['body_nomarkup']) return false; - + markup($body = &$post['body_nomarkup']); - - $query = prepare(sprintf("UPDATE `posts_%s` SET `body` = :body WHERE `id` = :id", $board['uri'])); + + $query = prepare(sprintf("UPDATE ``posts_%s`` SET `body` = :body WHERE `id` = :id", $board['uri'])); $query->bindValue(':body', $body); $query->bindValue(':id', $id, PDO::PARAM_INT); $query->execute() or error(db_error($query)); - + buildThread($post['thread'] ? $post['thread'] : $id); - + return true; } // Delete a post (reply or thread) function deletePost($id, $error_if_doesnt_exist=true, $rebuild_after=true) { global $board, $config; - + // Select post and replies (if thread) in one query - $query = prepare(sprintf("SELECT `id`,`thread`,`thumb`,`file` FROM `posts_%s` WHERE `id` = :id OR `thread` = :id", $board['uri'])); + $query = prepare(sprintf("SELECT `id`,`thread`,`thumb`,`file` FROM ``posts_%s`` WHERE `id` = :id OR `thread` = :id", $board['uri'])); $query->bindValue(':id', $id, PDO::PARAM_INT); $query->execute() or error(db_error($query)); - + if ($query->rowCount() < 1) { if ($error_if_doesnt_exist) error($config['error']['invalidpost']); else return false; } - + $ids = array(); - + // Delete posts and maybe replies - while ($post = $query->fetch()) { + while ($post = $query->fetch(PDO::FETCH_ASSOC)) { if (!$post['thread']) { // Delete thread HTML page file_unlink($board['dir'] . $config['dir']['res'] . sprintf($config['file_page'], $post['id'])); - - $antispam_query = prepare('DELETE FROM `antispam` WHERE `board` = :board AND `thread` = :thread'); + + $antispam_query = prepare('DELETE FROM ``antispam`` WHERE `board` = :board AND `thread` = :thread'); $antispam_query->bindValue(':board', $board['uri']); $antispam_query->bindValue(':thread', $post['id']); $antispam_query->execute() or error(db_error($antispam_query)); @@ -926,19 +968,19 @@ function deletePost($id, $error_if_doesnt_exist=true, $rebuild_after=true) { // Delete file file_unlink($board['dir'] . $config['dir']['img'] . $post['file']); } - + $ids[] = (int)$post['id']; - + } - - $query = prepare(sprintf("DELETE FROM `posts_%s` WHERE `id` = :id OR `thread` = :id", $board['uri'])); + + $query = prepare(sprintf("DELETE FROM ``posts_%s`` WHERE `id` = :id OR `thread` = :id", $board['uri'])); $query->bindValue(':id', $id, PDO::PARAM_INT); $query->execute() or error(db_error($query)); - - $query = prepare("SELECT `board`, `post` FROM `cites` WHERE `target_board` = :board AND (`target` = " . implode(' OR `target` = ', $ids) . ")"); + + $query = prepare("SELECT `board`, `post` FROM ``cites`` WHERE `target_board` = :board AND (`target` = " . implode(' OR `target` = ', $ids) . ")"); $query->bindValue(':board', $board['uri']); $query->execute() or error(db_error($query)); - while ($cite = $query->fetch()) { + while ($cite = $query->fetch(PDO::FETCH_ASSOC)) { if ($board['uri'] != $cite['board']) { if (!isset($tmp_board)) $tmp_board = $board['uri']; @@ -946,11 +988,11 @@ function deletePost($id, $error_if_doesnt_exist=true, $rebuild_after=true) { } rebuildPost($cite['post']); } - + if (isset($tmp_board)) openBoard($tmp_board); - - $query = prepare("DELETE FROM `cites` WHERE (`target_board` = :board AND `target` = :id) OR (`board` = :board AND `post` = :id)"); + + $query = prepare("DELETE FROM ``cites`` WHERE (`target_board` = :board AND `target` = :id) OR (`board` = :board AND `post` = :id)"); $query->bindValue(':board', $board['uri']); $query->bindValue(':id', $id, PDO::PARAM_INT); $query->execute() or error(db_error($query)); @@ -958,83 +1000,95 @@ function deletePost($id, $error_if_doesnt_exist=true, $rebuild_after=true) { if (isset($rebuild) && $rebuild_after) { buildThread($rebuild); } - + return true; } function clean() { global $board, $config; $offset = round($config['max_pages']*$config['threads_per_page']); - + // I too wish there was an easier way of doing this... - $query = prepare(sprintf("SELECT `id` FROM `posts_%s` WHERE `thread` IS NULL ORDER BY `sticky` DESC, `bump` DESC LIMIT :offset, 9001", $board['uri'])); + $query = prepare(sprintf("SELECT `id` FROM ``posts_%s`` WHERE `thread` IS NULL ORDER BY `sticky` DESC, `bump` DESC LIMIT :offset, 9001", $board['uri'])); $query->bindValue(':offset', $offset, PDO::PARAM_INT); - + $query->execute() or error(db_error($query)); - while ($post = $query->fetch()) { + while ($post = $query->fetch(PDO::FETCH_ASSOC)) { deletePost($post['id']); } } +function thread_find_page($thread) { + global $config, $board; + + $query = query(sprintf("SELECT `id` FROM ``posts_%s`` WHERE `thread` IS NULL ORDER BY `sticky` DESC, `bump` DESC", $board['uri'])) or error(db_error($query)); + $threads = $query->fetchAll(PDO::FETCH_COLUMN); + if (($index = array_search($thread, $threads)) === false) + return false; + return floor(($config['threads_per_page'] + $index) / $config['threads_per_page']); +} + function index($page, $mod=false) { global $board, $config, $debug; $body = ''; $offset = round($page*$config['threads_per_page']-$config['threads_per_page']); - - $query = prepare(sprintf("SELECT * FROM `posts_%s` WHERE `thread` IS NULL ORDER BY `sticky` DESC, `bump` DESC LIMIT :offset,:threads_per_page", $board['uri'])); + + $query = prepare(sprintf("SELECT * FROM ``posts_%s`` WHERE `thread` IS NULL ORDER BY `sticky` DESC, `bump` DESC LIMIT :offset,:threads_per_page", $board['uri'])); $query->bindValue(':offset', $offset, PDO::PARAM_INT); $query->bindValue(':threads_per_page', $config['threads_per_page'], PDO::PARAM_INT); $query->execute() or error(db_error($query)); - - if ($query->rowcount() < 1 && $page > 1) + + if ($page == 1 && $query->rowCount() < $config['threads_per_page']) + $board['thread_count'] = $query->rowCount(); + + if ($query->rowCount() < 1 && $page > 1) return false; - $threads = array(); - while ($th = $query->fetch()) { + while ($th = $query->fetch(PDO::FETCH_ASSOC)) { $thread = new Thread( $th['id'], $th['subject'], $th['email'], $th['name'], $th['trip'], $th['capcode'], $th['body'], $th['time'], $th['thumb'], $th['thumbwidth'], $th['thumbheight'], $th['file'], $th['filewidth'], $th['fileheight'], $th['filesize'], $th['filename'], $th['ip'], $th['sticky'], $th['locked'], $th['sage'], $th['embed'], $mod ? '?/' : $config['root'], $mod ); - + if ($config['cache']['enabled'] && $cached = cache::get("thread_index_{$board['uri']}_{$th['id']}")) { $replies = $cached['replies']; $omitted = $cached['omitted']; } else { - $posts = prepare(sprintf("SELECT * FROM `posts_%s` WHERE `thread` = :id ORDER BY `id` DESC LIMIT :limit", $board['uri'])); + $posts = prepare(sprintf("SELECT * FROM ``posts_%s`` WHERE `thread` = :id ORDER BY `id` DESC LIMIT :limit", $board['uri'])); $posts->bindValue(':id', $th['id']); $posts->bindValue(':limit', ($th['sticky'] ? $config['threads_preview_sticky'] : $config['threads_preview']), PDO::PARAM_INT); $posts->execute() or error(db_error($posts)); - + $replies = array_reverse($posts->fetchAll(PDO::FETCH_ASSOC)); - + if (count($replies) == ($th['sticky'] ? $config['threads_preview_sticky'] : $config['threads_preview'])) { $count = numPosts($th['id']); $omitted = array('post_count' => $count['replies'], 'image_count' => $count['images']); } else { $omitted = false; } - + if ($config['cache']['enabled']) cache::set("thread_index_{$board['uri']}_{$th['id']}", array( 'replies' => $replies, 'omitted' => $omitted, )); } - + $num_images = 0; foreach ($replies as $po) { if ($po['file']) $num_images++; - + $thread->add(new Post( $po['id'], $th['id'], $po['subject'], $po['email'], $po['name'], $po['trip'], $po['capcode'], $po['body'], $po['time'], $po['thumb'], $po['thumbwidth'], $po['thumbheight'], $po['file'], $po['filewidth'], $po['fileheight'], $po['filesize'], $po['filename'], $po['ip'], $po['embed'], $mod ? '?/' : $config['root'], $mod) ); } - + if ($omitted) { $thread->omitted = $omitted['post_count'] - ($th['sticky'] ? $config['threads_preview_sticky'] : $config['threads_preview']); $thread->omitted_images = $omitted['image_count'] - $num_images; @@ -1043,7 +1097,7 @@ function index($page, $mod=false) { $threads[] = $thread; $body .= $thread->build(true); } - + return array( 'board' => $board, 'body' => $body, @@ -1056,10 +1110,10 @@ function index($page, $mod=false) { function getPageButtons($pages, $mod=false) { global $config, $board; - + $btn = array(); $root = ($mod ? '?/' : $config['root']) . $board['dir']; - + foreach ($pages as $num => $page) { if (isset($page['selected'])) { // Previous button @@ -1073,7 +1127,7 @@ function getPageButtons($pages, $mod=false) { : sprintf($config['file_page'], $num) ); - + $btn['prev'] = '<form action="' . ($mod ? '' : $root . $loc) . '" method="get">' . ($mod ? '<input type="hidden" name="status" value="301" />' . @@ -1081,13 +1135,13 @@ function getPageButtons($pages, $mod=false) { :'') . '<input type="submit" value="' . _('Previous') . '" /></form>'; } - + if ($num == count($pages) - 1) { // There is no next page. $btn['next'] = _('Next'); } else { $loc = ($mod ? '?/' . $board['uri'] . '/' : '') . sprintf($config['file_page'], $num + 2); - + $btn['next'] = '<form action="' . ($mod ? '' : $root . $loc) . '" method="get">' . ($mod ? '<input type="hidden" name="status" value="301" />' . @@ -1097,21 +1151,24 @@ function getPageButtons($pages, $mod=false) { } } } - + return $btn; } function getPages($mod=false) { global $board, $config; - - // Count threads - $query = query(sprintf("SELECT COUNT(`id`) as `num` FROM `posts_%s` WHERE `thread` IS NULL", $board['uri'])) or error(db_error()); - - $count = current($query->fetch()); + + if (isset($board['thread_count'])) { + $count = $board['thread_count']; + } else { + // Count threads + $query = query(sprintf("SELECT COUNT(*) FROM ``posts_%s`` WHERE `thread` IS NULL", $board['uri'])) or error(db_error()); + $count = $query->fetchColumn(); + } $count = floor(($config['threads_per_page'] + $count - 1) / $config['threads_per_page']); - + if ($count < 1) $count = 1; - + $pages = array(); for ($x=0;$x<$count && $x<$config['max_pages'];$x++) { $pages[] = array( @@ -1119,107 +1176,106 @@ function getPages($mod=false) { 'link' => $x==0 ? ($mod ? '?/' : $config['root']) . $board['dir'] . $config['file_index'] : ($mod ? '?/' : $config['root']) . $board['dir'] . sprintf($config['file_page'], $x+1) ); } - + return $pages; } function makerobot($body) { global $config; $body = strtolower($body); - + // Leave only letters $body = preg_replace('/[^a-z]/i', '', $body); // Remove repeating characters if ($config['robot_strip_repeating']) $body = preg_replace('/(.)\\1+/', '$1', $body); - + return sha1($body); } function checkRobot($body) { if (empty($body) || event('check-robot', $body)) return true; - + $body = makerobot($body); - $query = prepare("SELECT 1 FROM `robot` WHERE `hash` = :hash LIMIT 1"); + $query = prepare("SELECT 1 FROM ``robot`` WHERE `hash` = :hash LIMIT 1"); $query->bindValue(':hash', $body); $query->execute() or error(db_error($query)); - - if ($query->fetch()) { + + if ($query->fetchColumn()) { return true; } // Insert new hash - $query = prepare("INSERT INTO `robot` VALUES (:hash)"); + $query = prepare("INSERT INTO ``robot`` VALUES (:hash)"); $query->bindValue(':hash', $body); $query->execute() or error(db_error($query)); + return false; } // Returns an associative array with 'replies' and 'images' keys function numPosts($id) { global $board; - $query = prepare(sprintf("SELECT COUNT(*) as `num` FROM `posts_%s` WHERE `thread` = :thread UNION ALL SELECT COUNT(*) FROM `posts_%s` WHERE `file` IS NOT NULL AND `thread` = :thread", $board['uri'], $board['uri'])); + $query = prepare(sprintf("SELECT COUNT(*) FROM ``posts_%s`` WHERE `thread` = :thread UNION ALL SELECT COUNT(*) FROM ``posts_%s`` WHERE `file` IS NOT NULL AND `thread` = :thread", $board['uri'], $board['uri'])); $query->bindValue(':thread', $id, PDO::PARAM_INT); $query->execute() or error(db_error($query)); - - $num_posts = $query->fetch(); - $num_posts = $num_posts['num']; - $num_images = $query->fetch(); - $num_images = $num_images['num']; - + + $num_posts = $query->fetchColumn(); + $num_images = $query->fetchColumn(); + return array('replies' => $num_posts, 'images' => $num_images); } function muteTime() { global $config; - + if ($time = event('mute-time')) return $time; - + // Find number of mutes in the past X hours - $query = prepare("SELECT COUNT(*) as `count` FROM `mutes` WHERE `time` >= :time AND `ip` = :ip"); + $query = prepare("SELECT COUNT(*) FROM ``mutes`` WHERE `time` >= :time AND `ip` = :ip"); $query->bindValue(':time', time()-($config['robot_mute_hour']*3600), PDO::PARAM_INT); $query->bindValue(':ip', $_SERVER['REMOTE_ADDR']); $query->execute() or error(db_error($query)); - - $result = $query->fetch(); - if ($result['count'] == 0) return 0; - return pow($config['robot_mute_multiplier'], $result['count']); + + if (!$result = $query->fetchColumn()) + return 0; + return pow($config['robot_mute_multiplier'], $result); } function mute() { // Insert mute - $query = prepare("INSERT INTO `mutes` VALUES (:ip, :time)"); + $query = prepare("INSERT INTO ``mutes`` VALUES (:ip, :time)"); $query->bindValue(':time', time(), PDO::PARAM_INT); $query->bindValue(':ip', $_SERVER['REMOTE_ADDR']); $query->execute() or error(db_error($query)); - + return muteTime(); } function checkMute() { global $config, $debug; - + if ($config['cache']['enabled']) { // Cached mute? if (($mute = cache::get("mute_${_SERVER['REMOTE_ADDR']}")) && ($mutetime = cache::get("mutetime_${_SERVER['REMOTE_ADDR']}"))) { error(sprintf($config['error']['youaremuted'], $mute['time'] + $mutetime - time())); } } - + $mutetime = muteTime(); if ($mutetime > 0) { // Find last mute time - $query = prepare("SELECT `time` FROM `mutes` WHERE `ip` = :ip ORDER BY `time` DESC LIMIT 1"); + $query = prepare("SELECT `time` FROM ``mutes`` WHERE `ip` = :ip ORDER BY `time` DESC LIMIT 1"); $query->bindValue(':ip', $_SERVER['REMOTE_ADDR']); $query->execute() or error(db_error($query)); - - if (!$mute = $query->fetch()) { + + if (!$mute = $query->fetch(PDO::FETCH_ASSOC)) { // What!? He's muted but he's not muted... return; } - + if ($mute['time'] + $mutetime > time()) { if ($config['cache']['enabled']) { cache::set("mute_${_SERVER['REMOTE_ADDR']}", $mute, $mute['time'] + $mutetime - time()); @@ -1235,20 +1291,29 @@ function checkMute() { } function buildIndex() { - global $board, $config; - + global $board, $config, $build_pages; + $pages = getPages(); - $antibot = create_antibot($board['uri']); + if (!$config['try_smarter']) + $antibot = create_antibot($board['uri']); $api = new Api(); $catalog = array(); - $page = 1; - while ($page <= $config['max_pages'] && $content = index($page)) { + for ($page = 1; $page <= $config['max_pages']; $page++) { $filename = $board['dir'] . ($page == 1 ? $config['file_index'] : sprintf($config['file_page'], $page)); - + + if ($config['try_smarter'] && isset($build_pages) && count($build_pages) && !in_array($page, $build_pages) && is_file($filename)) + continue; + $content = index($page); + if (!$content) + break; + + if ($config['try_smarter']) { + $antibot = create_antibot($board['uri'], 0 - $page); + $content['current_page'] = $page; + } $antibot->reset(); - $content['pages'] = $pages; $content['pages'][$page-1]['selected'] = true; $content['btn'] = getPageButtons($content['pages']); @@ -1284,65 +1349,66 @@ function buildIndex() { function buildJavascript() { global $config; - + $stylesheets = array(); foreach ($config['stylesheets'] as $name => $uri) { $stylesheets[] = array( 'name' => addslashes($name), 'uri' => addslashes((!empty($uri) ? $config['uri_stylesheets'] : '') . $uri)); } - - // Check if we have translation for the javascripts; if yes, we add it to additional javascripts - list($pure_locale) = explode(".", $config['locale']); - if (file_exists ($jsloc = "inc/locale/".$pure_locale."/LC_MESSAGES/javascript.js")) { - array_unshift($config['additional_javascript'], $jsloc); - } $script = Element('main.js', array( 'config' => $config, 'stylesheets' => $stylesheets )); + + // Check if we have translation for the javascripts; if yes, we add it to additional javascripts + list($pure_locale) = explode(".", $config['locale']); + if (file_exists ($jsloc = "inc/locale/$pure_locale/LC_MESSAGES/javascript.js")) { + $script = file_get_contents($jsloc) . "\n\n" . $script; + } + if ($config['additional_javascript_compile']) { foreach ($config['additional_javascript'] as $file) { $script .= file_get_contents($file); } } - + if ($config['minify_js']) { require_once 'inc/lib/minify/JSMin.php'; $script = JSMin::minify($script); } - + file_write($config['file_script'], $script); } function checkDNSBL() { global $config; - - + + if (isIPv6()) return; // No IPv6 support yet. - + if (!isset($_SERVER['REMOTE_ADDR'])) return; // Fix your web server configuration - + if (in_array($_SERVER['REMOTE_ADDR'], $config['dnsbl_exceptions'])) return; - + $ipaddr = ReverseIPOctets($_SERVER['REMOTE_ADDR']); - + foreach ($config['dnsbl'] as $blacklist) { if (!is_array($blacklist)) $blacklist = array($blacklist); - + if (($lookup = str_replace('%', $ipaddr, $blacklist[0])) == $blacklist[0]) $lookup = $ipaddr . '.' . $blacklist[0]; - + if (!$ip = DNS($lookup)) continue; // not in list - + $blacklist_name = isset($blacklist[2]) ? $blacklist[2] : $blacklist[0]; - + if (!isset($blacklist[1])) { // If you're listed at all, you're blocked. error(sprintf($config['error']['dnsbl'], $blacklist_name)); @@ -1371,7 +1437,7 @@ function ReverseIPOctets($ip) { function wordfilters(&$body) { global $config; - + foreach ($config['wordfilters'] as $filter) { if (isset($filter[2]) && $filter[2]) { $body = preg_replace($filter[0], $filter[1], $body); @@ -1383,52 +1449,98 @@ function wordfilters(&$body) { function quote($body, $quote=true) { global $config; - + $body = str_replace('<br/>', "\n", $body); - + $body = strip_tags($body); - + $body = preg_replace("/(^|\n)/", '$1>', $body); - + $body .= "\n"; - + if ($config['minify_html']) $body = str_replace("\n", '
', $body); - + return $body; } function markup_url($matches) { global $config, $markup_urls; - + $url = $matches[1]; $after = $matches[2]; - + $markup_urls[] = $url; - - return '<a target="_blank" rel="nofollow" href="'. $config['url_ads'] . $url . '">' . $url . '</a>' . $after; + + return '<a target="_blank" rel="nofollow" href="'. $config['link_prefix'] . $url . '">' . $url . '</a>' . $after; } function unicodify($body) { $body = str_replace('...', '…', $body); $body = str_replace('<--', '←', $body); $body = str_replace('-->', '→', $body); - + // En and em- dashes are rendered exactly the same in // most monospace fonts (they look the same in code // editors). $body = str_replace('---', '—', $body); // em dash $body = str_replace('--', '–', $body); // en dash - + return $body; } function markup(&$body, $track_cites = false) { global $board, $config, $markup_urls; - + $body = str_replace("\r", '', $body); $body = utf8tohtml($body); - + + if (preg_match_all('@<tinyboard ([\w\s]+)>(.+?)</tinyboard>@us', $body, $modifiers, PREG_SET_ORDER | PREG_OFFSET_CAPTURE)) { + $skip_chars = 0; + $body_tmp = $body; + $end_markup = false; + + foreach ($modifiers as $modifier) { + // preg_match_all is not multibyte-safe + foreach ($modifier as &$match) { + $match[1] = mb_strlen(substr($body_tmp, 0, $match[1])); + } + + $modifier['type'] = $modifier[1][0]; + $modifier['content'] = $modifier[2][0]; + + if ($modifier['type'] == 'ban message') { + // Public ban message + $replacement = sprintf($config['mod']['ban_message'], html_entity_decode($modifier['content'])); + if ($end_markup) { + $body .= $replacement; + } + } elseif ($modifier['type'] == 'raw html') { + $body = html_entity_decode($modifier['content']); + $replacement = ''; + $end_markup = true; + } elseif (preg_match('/^escape /', $modifier['type'])) { + // Escaped (not a real modifier) + $replacement = '<tinyboard ' . substr($modifier['type'], strlen('escape ')) . '>' . $modifier['content'] . '</tinyboard>'; + } else { + // Unknown + $replacement = ''; + } + + if (!$end_markup) { + $body = mb_substr_replace($body, $replacement, $modifier[0][1] + $skip_chars, mb_strlen($modifier[0][0])); + $skip_chars += mb_strlen($replacement) - mb_strlen($modifier[0][0]); + } + } + + if ($end_markup) { + return array(); + } + } + + if (mysql_version() < 50503) + $body = mb_encode_numericentity($body, array(0x010000, 0xffffff, 0, 0xffffff), 'UTF-8'); + foreach ($config['markup'] as $markup) { if (is_string($markup[1])) { $body = preg_replace($markup[0], $markup[1], $body); @@ -1436,88 +1548,108 @@ function markup(&$body, $track_cites = false) { $body = preg_replace_callback($markup[0], $markup[1], $body); } } - + if ($config['markup_urls']) { $markup_urls = array(); - + $body = preg_replace_callback( '/((?:https?:\/\/|ftp:\/\/|irc:\/\/)[^\s<>()"]+?(?:\([^\s<>()"]*?\)[^\s<>()"]*?)*)((?:\s|<|>|"|\.||\]|!|\?|,|,|")*(?:[\s<>()"]|$))/', 'markup_url', $body, -1, $num_links); - + if ($num_links > $config['max_links']) error($config['error']['toomanylinks']); } - + if ($config['auto_unicode']) { $body = unicodify($body); - + if ($config['markup_urls']) { foreach ($markup_urls as &$url) { $body = str_replace(unicodify($url), $url, $body); } } } - + // replace tabs with 8 spaces $body = str_replace("\t", ' ', $body); - + $tracked_cites = array(); - + // Cites - if (isset($board) && preg_match_all('/(^|\s)>>(\d+?)([\s,.)?]|$)/m', $body, $cites)) { + if (isset($board) && preg_match_all('/(^|\s)>>(\d+?)([\s,.)?]|$)/m', $body, $cites, PREG_SET_ORDER | PREG_OFFSET_CAPTURE)) { if (count($cites[0]) > $config['max_cites']) { error($config['error']['toomanycites']); } - - for ($index=0;$index<count($cites[0]);$index++) { - $cite = $cites[2][$index]; - $query = prepare(sprintf("SELECT `thread`,`id` FROM `posts_%s` WHERE `id` = :id LIMIT 1", $board['uri'])); + + $skip_chars = 0; + $body_tmp = $body; + + foreach ($cites as $matches) { + $cite = $matches[2][0]; + $query = prepare(sprintf("SELECT `thread`,`id` FROM ``posts_%s`` WHERE `id` = :id LIMIT 1", $board['uri'])); $query->bindValue(':id', $cite); $query->execute() or error(db_error($query)); - - if ($post = $query->fetch()) { + + // preg_match_all is not multibyte-safe + foreach ($matches as &$match) { + $match[1] = mb_strlen(substr($body_tmp, 0, $match[1])); + } + + if ($post = $query->fetch(PDO::FETCH_ASSOC)) { $replacement = '<a onclick="highlightReply(\''.$cite.'\');" href="' . $config['root'] . $board['dir'] . $config['dir']['res'] . ($post['thread']?$post['thread']:$post['id']) . '.html#' . $cite . '">' . '>>' . $cite . '</a>'; - $body = str_replace($cites[0][$index], $cites[1][$index] . $replacement . $cites[3][$index], $body); - + + $body = mb_substr_replace($body, $matches[1][0] . $replacement . $matches[3][0], $matches[0][1] + $skip_chars, mb_strlen($matches[0][0])); + $skip_chars += mb_strlen($matches[1][0] . $replacement . $matches[3][0]) - mb_strlen($matches[0][0]); + if ($track_cites && $config['track_cites']) $tracked_cites[] = array($board['uri'], $post['id']); } } } - + // Cross-board linking - if (preg_match_all('/(^|\s)>>>\/([\w.+]+?)\/(\d+)?([\s,.)?]|$)/m', $body, $cites)) { + if (preg_match_all('/(^|\s)>>>\/(' . $config['board_regex'] . 'f?)\/(\d+)?([\s,.)?]|$)/um', $body, $cites, PREG_SET_ORDER | PREG_OFFSET_CAPTURE)) { if (count($cites[0]) > $config['max_cites']) { error($config['error']['toomanycross']); } - - for ($index=0;$index<count($cites[0]);$index++) { - $_board = $cites[2][$index]; - $cite = @$cites[3][$index]; - + + $skip_chars = 0; + $body_tmp = $body; + + foreach ($cites as $matches) { + $_board = $matches[2][0]; + $cite = @$matches[3][0]; + + // preg_match_all is not multibyte-safe + foreach ($matches as &$match) { + $match[1] = mb_strlen(substr($body_tmp, 0, $match[1])); + } + // Temporarily store board information because it will be overwritten $tmp_board = $board['uri']; - + // Check if the board exists, and load settings if (openBoard($_board)) { if ($cite) { - $query = prepare(sprintf("SELECT `thread`,`id` FROM `posts_%s` WHERE `id` = :id LIMIT 1", $board['uri'])); + $query = prepare(sprintf("SELECT `thread`,`id` FROM ``posts_%s`` WHERE `id` = :id LIMIT 1", $board['uri'])); $query->bindValue(':id', $cite); $query->execute() or error(db_error($query)); - - if ($post = $query->fetch()) { + + if ($post = $query->fetch(PDO::FETCH_ASSOC)) { $replacement = '<a onclick="highlightReply(\''.$cite.'\');" href="' . $config['root'] . $board['dir'] . $config['dir']['res'] . ($post['thread']?$post['thread']:$post['id']) . '.html#' . $cite . '">' . '>>>/' . $_board . '/' . $cite . '</a>'; - $body = str_replace($cites[0][$index], $cites[1][$index] . $replacement . $cites[4][$index], $body); - + + $body = mb_substr_replace($body, $matches[1][0] . $replacement . $matches[4][0], $matches[0][1] + $skip_chars, mb_strlen($matches[0][0])); + $skip_chars += mb_strlen($matches[1][0] . $replacement . $matches[4][0]) - mb_strlen($matches[0][0]); + if ($track_cites && $config['track_cites']) $tracked_cites[] = array($board['uri'], $post['id']); } @@ -1526,47 +1658,99 @@ function markup(&$body, $track_cites = false) { $config['root'] . $board['dir'] . $config['file_index'] . '">' . '>>>/' . $_board . '/' . '</a>'; - $body = str_replace($cites[0][$index], $cites[1][$index] . $replacement . $cites[4][$index], $body); + $body = mb_substr_replace($body, $matches[1][0] . $replacement . $matches[4][0], $matches[0][1] + $skip_chars, mb_strlen($matches[0][0])); + $skip_chars += mb_strlen($matches[1][0] . $replacement . $matches[4][0]) - mb_strlen($matches[0][0]); } } - + // Restore main board settings openBoard($tmp_board); } } - + $body = preg_replace("/^\s*>.*$/m", '<span class="quote">$0</span>', $body); - + if ($config['strip_superfluous_returns']) $body = preg_replace('/\s+$/', '', $body); - + $body = preg_replace("/\n/", '<br/>', $body); - + return $tracked_cites; } +function escape_markup_modifiers($string) { + return preg_replace('@<tinyboard ([\w\s]+)>@m', '<tinyboard escape $1>', $string); +} + function utf8tohtml($utf8) { return htmlspecialchars($utf8, ENT_NOQUOTES, 'UTF-8'); } -function buildThread($id, $return=false, $mod=false) { - global $board, $config; +function ordutf8($string, &$offset) { + $code = ord(substr($string, $offset,1)); + if ($code >= 128) { // otherwise 0xxxxxxx + if ($code < 224) + $bytesnumber = 2; // 110xxxxx + else if ($code < 240) + $bytesnumber = 3; // 1110xxxx + else if ($code < 248) + $bytesnumber = 4; // 11110xxx + $codetemp = $code - 192 - ($bytesnumber > 2 ? 32 : 0) - ($bytesnumber > 3 ? 16 : 0); + for ($i = 2; $i <= $bytesnumber; $i++) { + $offset ++; + $code2 = ord(substr($string, $offset, 1)) - 128; //10xxxxxx + $codetemp = $codetemp*64 + $code2; + } + $code = $codetemp; + } + $offset += 1; + if ($offset >= strlen($string)) + $offset = -1; + return $code; +} + +function strip_combining_chars($str) { + $chars = preg_split('//u', $str, -1, PREG_SPLIT_NO_EMPTY); + $str = ''; + foreach ($chars as $char) { + $o = 0; + $ord = ordutf8($char, $o); + + if ($ord >= 768 && $ord <= 879) + continue; + + if ($ord >= 7616 && $ord <= 7679) + continue; + + if ($ord >= 8400 && $ord <= 8447) + continue; + + if ($ord >= 65056 && $ord <= 65071) + continue; + + $str .= $char; + } + return $str; +} + +function buildThread($id, $return = false, $mod = false) { + global $board, $config, $build_pages; $id = round($id); - + if (event('build-thread', $id)) return; - + if ($config['cache']['enabled'] && !$mod) { // Clear cache cache::delete("thread_index_{$board['uri']}_{$id}"); cache::delete("thread_{$board['uri']}_{$id}"); } - - $query = prepare(sprintf("SELECT * FROM `posts_%s` WHERE (`thread` IS NULL AND `id` = :id) OR `thread` = :id ORDER BY `thread`,`id`", $board['uri'])); + + $query = prepare(sprintf("SELECT * FROM ``posts_%s`` WHERE (`thread` IS NULL AND `id` = :id) OR `thread` = :id ORDER BY `thread`,`id`", $board['uri'])); $query->bindValue(':id', $id, PDO::PARAM_INT); $query->execute() or error(db_error($query)); - - while ($post = $query->fetch()) { + + while ($post = $query->fetch(PDO::FETCH_ASSOC)) { if (!isset($thread)) { $thread = new Thread( $post['id'], $post['subject'], $post['email'], $post['name'], $post['trip'], $post['capcode'], $post['body'], $post['time'], @@ -1581,11 +1765,11 @@ function buildThread($id, $return=false, $mod=false) { ); } } - + // Check if any posts were found if (!isset($thread)) error($config['error']['nonexistant']); - + $body = Element('thread.html', array( 'board' => $board, 'thread' => $thread, @@ -1595,9 +1779,12 @@ function buildThread($id, $return=false, $mod=false) { 'mod' => $mod, 'antibot' => $mod ? false : create_antibot($board['uri'], $id), 'boardlist' => createBoardlist($mod), - 'return' => ($mod ? '?' . $board['url'] . $config['file_index'] : $config['root'] . $board['uri'] . '/' . $config['file_index']) + 'return' => ($mod ? '?' . $board['url'] . $config['file_index'] : $config['root'] . $board['dir'] . $config['file_index']) )); + if ($config['try_smarter'] && !$mod) + $build_pages[] = thread_find_page($id); + if ($return) return $body; @@ -1628,35 +1815,35 @@ function buildThread($id, $return=false, $mod=false) { function poster_id($ip, $thread) { global $config; - + if ($id = event('poster-id', $ip, $thread)) return $id; - + // Confusing, hard to brute-force, but simple algorithm return substr(sha1(sha1($ip . $config['secure_trip_salt'] . $thread) . $config['secure_trip_salt']), 0, $config['poster_id_length']); } function generate_tripcode($name) { global $config; - + if ($trip = event('tripcode', $name)) return $trip; - + if (!preg_match('/^([^#]+)?(##|#)(.+)$/', $name, $match)) return array($name); - + $name = $match[1]; $secure = $match[2] == '##'; $trip = $match[3]; - + // convert to SHIT_JIS encoding $trip = mb_convert_encoding($trip, 'Shift_JIS', 'UTF-8'); - + // generate salt $salt = substr($trip . 'H..', 1, 2); - $salt = preg_replace('/[^\.-z]/', '.', $salt); + $salt = preg_replace('/[^.-z]/', '.', $salt); $salt = strtr($salt, ':;<=>?@[\]^_`', 'ABCDEFGabcdef'); - + if ($secure) { if (isset($config['custom_tripcode']["##{$trip}"])) $trip = $config['custom_tripcode']["##{$trip}"]; @@ -1668,10 +1855,10 @@ function generate_tripcode($name) { else $trip = '!' . substr(crypt($trip, $salt), -10); } - + return array($name, $trip); } - + // Highest common factor function hcf($a, $b){ $gcd = 1; @@ -1697,41 +1884,41 @@ function fraction($numerator, $denominator, $sep) { $gcf = hcf($numerator, $denominator); $numerator = $numerator / $gcf; $denominator = $denominator / $gcf; - + return "{$numerator}{$sep}{$denominator}"; } function getPostByHash($hash) { global $board; - $query = prepare(sprintf("SELECT `id`,`thread` FROM `posts_%s` WHERE `filehash` = :hash", $board['uri'])); + $query = prepare(sprintf("SELECT `id`,`thread` FROM ``posts_%s`` WHERE `filehash` = :hash", $board['uri'])); $query->bindValue(':hash', $hash, PDO::PARAM_STR); $query->execute() or error(db_error($query)); - - if ($post = $query->fetch()) { + + if ($post = $query->fetch(PDO::FETCH_ASSOC)) { return $post; } - + return false; } function getPostByHashInThread($hash, $thread) { global $board; - $query = prepare(sprintf("SELECT `id`,`thread` FROM `posts_%s` WHERE `filehash` = :hash AND ( `thread` = :thread OR `id` = :thread )", $board['uri'])); + $query = prepare(sprintf("SELECT `id`,`thread` FROM ``posts_%s`` WHERE `filehash` = :hash AND ( `thread` = :thread OR `id` = :thread )", $board['uri'])); $query->bindValue(':hash', $hash, PDO::PARAM_STR); $query->bindValue(':thread', $thread, PDO::PARAM_INT); $query->execute() or error(db_error($query)); - - if ($post = $query->fetch()) { + + if ($post = $query->fetch(PDO::FETCH_ASSOC)) { return $post; } - + return false; } function undoImage(array $post) { if (!$post['has_file']) return; - + if (isset($post['file'])) file_unlink($post['file']); if (isset($post['thumb'])) @@ -1740,48 +1927,70 @@ function undoImage(array $post) { function rDNS($ip_addr) { global $config; - + if ($config['cache']['enabled'] && ($host = cache::get('rdns_' . $ip_addr))) { return $host; } - + if (!$config['dns_system']) { $host = gethostbyaddr($ip_addr); } else { - $resp = shell_exec('host -W 1 ' . $ip_addr); + $resp = shell_exec_error('host -W 1 ' . $ip_addr); if (preg_match('/domain name pointer ([^\s]+)$/', $resp, $m)) $host = $m[1]; else $host = $ip_addr; } - + if ($config['cache']['enabled']) cache::set('rdns_' . $ip_addr, $host, 3600); - + return $host; } function DNS($host) { global $config; - + if ($config['cache']['enabled'] && ($ip_addr = cache::get('dns_' . $host))) { return $ip_addr; } - + if (!$config['dns_system']) { $ip_addr = gethostbyname($host); if ($ip_addr == $host) $ip_addr = false; } else { - $resp = shell_exec('host -W 1 ' . $host); + $resp = shell_exec_error('host -W 1 ' . $host); if (preg_match('/has address ([^\s]+)$/', $resp, $m)) $ip_addr = $m[1]; else $ip_addr = false; } - + if ($config['cache']['enabled']) cache::set('dns_' . $host, $ip_addr, 3600); - + return $ip_addr; } + +function shell_exec_error($command, $suppress_stdout = false) { + global $config, $debug; + + if ($config['debug']) + $start = microtime(true); + + $return = trim(shell_exec('PATH="' . escapeshellcmd($config['shell_path']) . ':$PATH";' . + $command . ' 2>&1 ' . ($suppress_stdout ? '> /dev/null ' : '') . '&& echo "TB_SUCCESS"')); + $return = preg_replace('/TB_SUCCESS$/', '', $return); + + if ($config['debug']) { + $time = round((microtime(true) - $start) * 1000, 2) . 'ms'; + $debug['exec'][] = array( + 'command' => $command, + 'time' => '~' . $time, + 'response' => $return ? $return : null + ); + } + + return $return === 'TB_SUCCESS' ? false : $return; +} diff --git a/inc/ic-encrypt.php b/inc/ic-encrypt.php deleted file mode 100644 index 5d73126b..00000000 --- a/inc/ic-encrypt.php +++ /dev/null @@ -1,37 +0,0 @@ -<?php -// Z internetow. -class Encryption { - public function safe_b64encode($string) { - $data = base64_encode($string); - $data = str_replace(array('+','/','='),array('-','_',''),$data); - return $data; - } - - public function safe_b64decode($string) { - $data = str_replace(array('-','_'),array('+','/'),$string); - $mod4 = strlen($data) % 4; - if ($mod4) { - $data .= substr('====', $mod4); - } - return base64_decode($data); - } - - public function encode($key, $value){ - if(!$value){return false;} - $text = $value; - $iv_size = mcrypt_get_iv_size(MCRYPT_RIJNDAEL_256, MCRYPT_MODE_ECB); - $iv = mcrypt_create_iv($iv_size, MCRYPT_RAND); - $crypttext = mcrypt_encrypt(MCRYPT_RIJNDAEL_256, $key, $text, MCRYPT_MODE_ECB, $iv); - return trim($this->safe_b64encode($crypttext)); - } - - public function decode($key, $value){ - if(!$value){return false;} - $crypttext = $this->safe_b64decode($value); - $iv_size = mcrypt_get_iv_size(MCRYPT_RIJNDAEL_256, MCRYPT_MODE_ECB); - $iv = mcrypt_create_iv($iv_size, MCRYPT_RAND); - $decrypttext = mcrypt_decrypt(MCRYPT_RIJNDAEL_256, $key, $crypttext, MCRYPT_MODE_ECB, $iv); - return trim($decrypttext); - } -} -?> diff --git a/inc/image.php b/inc/image.php index 8c9e380e..9c4bbef4 100644 --- a/inc/image.php +++ b/inc/image.php @@ -11,7 +11,7 @@ if (realpath($_SERVER['SCRIPT_FILENAME']) == str_replace('\\', '/', __FILE__)) { class Image { public $src, $format, $image, $size; - public function __construct($src, $format = false) { + public function __construct($src, $format = false, $size = false) { global $config; $this->src = $src; @@ -19,7 +19,7 @@ class Image { if ($config['thumb_method'] == 'imagick') { $classname = 'ImageImagick'; - } elseif ($config['thumb_method'] == 'convert' || $config['thumb_method'] == 'convert+gifsicle') { + } elseif (in_array($config['thumb_method'], array('convert', 'convert+gifsicle', 'gm', 'gm+gifsicle'))) { $classname = 'ImageConvert'; } else { $classname = 'Image' . strtoupper($this->format); @@ -28,7 +28,7 @@ class Image { } } - $this->image = new $classname($this); + $this->image = new $classname($this, $size); if (!$this->image->valid()) { $this->delete(); @@ -44,8 +44,6 @@ class Image { public function resize($extension, $max_width, $max_height) { global $config; - - $gifsicle = false; if ($config['thumb_method'] == 'imagick') { $classname = 'ImageImagick'; @@ -54,6 +52,13 @@ class Image { } elseif ($config['thumb_method'] == 'convert+gifsicle') { $classname = 'ImageConvert'; $gifsicle = true; + } elseif ($config['thumb_method'] == 'gm') { + $classname = 'ImageConvert'; + $gm = true; + } elseif ($config['thumb_method'] == 'gm+gifsicle') { + $classname = 'ImageConvert'; + $gm = true; + $gifsicle = true; } else { $classname = 'Image' . strtoupper($extension); if (!class_exists($classname)) { @@ -81,11 +86,8 @@ class Image { $height = $max_height; } - if ($gifsicle) { - $thumb->gifsicle = 1; - } $thumb->_resize($this->image->image, $width, $height); - + return $thumb; } @@ -120,10 +122,15 @@ class ImageBase extends ImageGD { return (bool)$this->image; } - public function __construct($img) { + public function __construct($img, $size = false) { if (method_exists($this, 'init')) $this->init(); + if ($size && $size[0] > 0 && $size[1] > 0) { + $this->width = $size[0]; + $this->height = $size[1]; + } + if ($img !== false) { $this->src = $img->src; $this->from(); @@ -175,6 +182,10 @@ class ImageImagick extends ImageBase { } } public function to($src) { + global $config; + if ($config['strip_exif']) { + $this->image->stripImage(); + } if (preg_match('/\.gif$/i', $src)) $this->image->writeImages($src, true); else @@ -225,18 +236,37 @@ class ImageImagick extends ImageBase { class ImageConvert extends ImageBase { - public $width, $height, $temp, $gifsicle; + public $width, $height, $temp, $gm = false, $gifsicle = false; public function init() { global $config; + if ($config['thumb_method'] == 'gm' || $config['thumb_method'] == 'gm+gifsicle') + $this->gm = true; + if ($config['thumb_method'] == 'convert+gifsicle' || $config['thumb_method'] == 'gm+gifsicle') + $this->gifsicle = true; + $this->temp = false; } - public function from() { - $size = trim(shell_exec('identify -format "%w %h" ' . escapeshellarg($this->src . '[0]'))); - if (preg_match('/^(\d+) (\d+)$/', $size, $m)) { - $this->width = $m[1]; - $this->height = $m[2]; + public function get_size($src, $try_gd_first = true) { + if ($try_gd_first) { + if ($size = @getimagesize($src)) + return $size; + } + $size = shell_exec_error(($this->gm ? 'gm ' : '') . 'identify -format "%w %h" ' . escapeshellarg($src . '[0]')); + if (preg_match('/^(\d+) (\d+)$/', $size, $m)) + return array($m[1], $m[2]); + return false; + } + public function from() { + if ($this->width > 0 && $this->height > 0) { + $this->image = true; + return; + } + $size = $this->get_size($this->src, false); + if ($size) { + $this->width = $size[0]; + $this->height = $size[1]; $this->image = true; } else { @@ -245,9 +275,22 @@ class ImageConvert extends ImageBase { } } public function to($src) { + global $config; + if (!$this->temp) { - // $config['redraw_image'] - shell_exec('convert ' . escapeshellarg($this->src) . ' ' . escapeshellarg($src)); + if ($config['strip_exif']) { + if($error = shell_exec_error(($this->gm ? 'gm ' : '') . 'convert ' . + escapeshellarg($this->src) . ' -auto-orient -strip ' . escapeshellarg($src))) { + $this->destroy(); + error('Failed to redraw image!', null, $error); + } + } else { + if($error = shell_exec_error(($this->gm ? 'gm ' : '') . 'convert ' . + escapeshellarg($this->src) . ' -auto-orient ' . escapeshellarg($src))) { + $this->destroy(); + error('Failed to redraw image!', null, $error); + } + } } else { rename($this->temp, $src); chmod($src, 0664); @@ -272,24 +315,119 @@ class ImageConvert extends ImageBase { } $this->temp = tempnam($config['tmp'], 'imagick'); - - $quality = $config['thumb_quality'] * 10; + + $config['thumb_keep_animation_frames'] = (int)$config['thumb_keep_animation_frames']; if ($this->format == 'gif' && ($config['thumb_ext'] == 'gif' || $config['thumb_ext'] == '') && $config['thumb_keep_animation_frames'] > 1) { if ($this->gifsicle) { - if (shell_exec("gifsicle --unoptimize -O2 --resize {$this->width}x{$this->height} < " . - escapeshellarg($this->src . '') . " > " . escapeshellarg($this->temp)) || !file_exists($this->temp)) - error('Failed to resize image!'); - } - else { - if (shell_exec("convert -background transparent -filter Point -sample {$this->width}x{$this->height} +antialias -quality {$quality} " . - escapeshellarg($this->src . '') . " " . escapeshellarg($this->temp)) || !file_exists($this->temp)) - error('Failed to resize image!'); + if (($error = shell_exec_error("gifsicle -w --unoptimize -O2 --resize {$this->width}x{$this->height} < " . + escapeshellarg($this->src . '') . " \"#0-{$config['thumb_keep_animation_frames']}\" -o " . + escapeshellarg($this->temp), true)) || !file_exists($this->temp)) + error('Failed to resize image!', null, $error); + } else { + if ($config['convert_manual_orient'] && ($this->format == 'jpg' || $this->format == 'jpeg')) + $convert_args = str_replace('-auto-orient', ImageConvert::jpeg_exif_orientation($this->src), $config['convert_args']); + elseif ($config['convert_manual_orient']) + $convert_args = str_replace('-auto-orient', '', $config['convert_args']); + else + $convert_args = &$config['convert_args']; + if (($error = shell_exec_error(($this->gm ? 'gm ' : '') . 'convert ' . + sprintf($convert_args, + $this->width, + $this->height, + escapeshellarg($this->src), + $this->width, + $this->height, + escapeshellarg($this->temp)))) || !file_exists($this->temp)) + error('Failed to resize image!', null, $error); + if ($size = $this->get_size($this->temp)) { + $this->width = $size[0]; + $this->height = $size[1]; + } } } else { - if (shell_exec("convert -background transparent -flatten -filter Point -scale {$this->width}x{$this->height} +antialias -quality {$quality} " . - escapeshellarg($this->src . '[0]') . " " . escapeshellarg($this->temp)) || !file_exists($this->temp)) - error('Failed to resize image!'); + if ($config['convert_manual_orient'] && ($this->format == 'jpg' || $this->format == 'jpeg')) + $convert_args = str_replace('-auto-orient', ImageConvert::jpeg_exif_orientation($this->src), $config['convert_args']); + elseif ($config['convert_manual_orient']) + $convert_args = str_replace('-auto-orient', '', $config['convert_args']); + else + $convert_args = &$config['convert_args']; + if (($error = shell_exec_error(($this->gm ? 'gm ' : '') . 'convert ' . + sprintf($convert_args, + $this->width, + $this->height, + escapeshellarg($this->src . '[0]'), + $this->width, + $this->height, + escapeshellarg($this->temp)))) || !file_exists($this->temp)) + error('Failed to resize image!', null, $error); + if ($size = $this->get_size($this->temp)) { + $this->width = $size[0]; + $this->height = $size[1]; + } + } + } + + // For when -auto-orient doesn't exist (older versions) + static public function jpeg_exif_orientation($src, $exif = false) { + if (!$exif) { + $exif = @exif_read_data($src); + if (!isset($exif['Orientation'])) + return false; + } + switch($exif['Orientation']) { + case 1: + // Normal + return false; + case 2: + // 888888 + // 88 + // 8888 + // 88 + // 88 + + return '-flop'; + case 3: + + // 88 + // 88 + // 8888 + // 88 + // 888888 + + return '-flip -flop'; + case 4: + // 88 + // 88 + // 8888 + // 88 + // 888888 + + return '-flip'; + case 5: + // 8888888888 + // 88 88 + // 88 + + return '-rotate 90 -flop'; + case 6: + // 88 + // 88 88 + // 8888888888 + + return '-rotate 90'; + case 7: + // 88 + // 88 88 + // 8888888888 + + return '-rotate "-90" -flop'; + case 8: + // 8888888888 + // 88 88 + // 88 + + return '-rotate "-90"'; } } } @@ -300,7 +438,7 @@ class ImagePNG extends ImageBase { } public function to($src) { global $config; - imagepng($this->image, $src, $config['thumb_quality']); + imagepng($this->image, $src); } public function resize() { $this->GD_create(); @@ -313,7 +451,7 @@ class ImagePNG extends ImageBase { class ImageGIF extends ImageBase { public function from() { - $this->image = @imagecreatefromgif ($this->src); + $this->image = @imagecreatefromgif($this->src); } public function to($src) { imagegif ($this->image, $src); diff --git a/inc/imgcaptcha.php b/inc/imgcaptcha.php deleted file mode 100644 index ab6db68f..00000000 --- a/inc/imgcaptcha.php +++ /dev/null @@ -1,136 +0,0 @@ -<?php - // Wiem, ze ten kod to czysta ohyda. Coz. - require_once("inc/functions.php"); - require_once("inc/ic-encrypt.php"); - - global $config; - - function getImages() { - global $config; - $lines = explode("\n",file_get_contents($config["imgcaptcha_list"])); - for($i=0;$i<count($lines);$i++) { $lines[$i] = explode(",",$lines[$i]); } - return $lines; - } - function getIPath($img) { - global $config; - return $config["imgcaptcha_images"] . "/" . $img; - } - function pickImage($lines) { - $src = FALSE; - while($src == FALSE) { - $pick = rand(0,count($lines)-1); - if($lines[$pick][0] != "") $src = imagecreatefrompng(getIPath($lines[$pick][0])); - } - imagedestroy($src); - return $pick; - } - function ncfix($a) { - if($a>255) { return 255; } - if($a<0) { return 0; } - return $a; - } - function randString($length, $charset='ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+=') - { - $str = ''; - $count = strlen($charset); - while ($length--) { - $str .= $charset[rand(0, $count-1)]; - } - return $str; - } - function generateCaptchaHash() { - global $config; - $lines = getImages(); - $pick = pickImage($lines); - $enctext = $pick . ",," . time() . ",," . $_SERVER["REMOTE_ADDR"] . ",," . randString(12); - $converter = new Encryption; - return $converter->encode($config["imgcaptcha_key"],$enctext); - } - function ic_verifyHash($enctext, $output) { - global $config; - //print "VERIFY: " . $enctext . " " . $output . "<br>"; - $converter = new Encryption; - $dectext = explode(",,",$converter->decode($config["imgcaptcha_key"],$enctext)); - if(count($dectext)<4) return true; - $lines = getImages(); - $pick = $dectext[0]; - $time = time()-$dectext[1]; - if($time>$config["imgcaptcha_time_limit"]) return true; - $lp = $lines[$pick]; - for($i=1;$i<count($lp);$i++) { - if(strcasecmp($lp[$i],$output)==0) return false; - } - return true; - } - function getPick($enctext) - { - global $config; - $converter = new Encryption; - $dectext = explode(",,",$converter->decode($config["imgcaptcha_key"],$enctext)); - if(count($dectext)<=1) return; //SC - $lines = getImages(); - return $dectext[0]; - } - function generateImage($enctext) - { - global $config; - $lines = getImages(); - $pick = getPick($enctext); - if(!isset($lines[$pick])) return; //SC - $src = imagecreatefrompng(getIPath($lines[$pick][0])); - if($src == FALSE) return; //SC - $maxc = 8; - $icw = $config["imgcaptcha_width"]; - $ich = $config["imgcaptcha_height"]; - $dst = imagecreatetruecolor($icw,$ich); - $srcxm = imagesx($src)-$icw; - $srcym = imagesy($src)-$ich; - $srcx = rand(0,$srcxm-1); - $srcy = rand(0,$srcym-1); - imagecopy($dst,$src,0,0,$srcx,$srcy,$icw,$ich); - - // Obfuscation step 1 - imagecopymergegray($dst,$dst,0,0,0,0,$icw,$ich,rand(20,45)); - // Obfuscation step 1.5 - for($i=0;$i<8;$i++) { - $w = rand(5,10); $h = rand(5,10); - $x = rand(0,$icw-1-$w); $y = rand(0,$ich-1-$h); - $x2 = rand(0,$icw-1); $y2 = rand(0,$ich-1); - imagefilledrectangle($dst,$x,$y,$x+$w,$y+$h,imagecolorat($dst,$x2,$y2)); - } - for($i=0;$i<5;$i++) { - $w = rand(20,40); $h = rand(20,40); - $x = rand(0,$icw-1-$w); $y = rand(0,$ich-1-$h); - imagecopymergegray($dst,$dst,$x,$y,$x,$y,$w,$h,0); - } - // Obfuscation step 2 - for($i=0;$i<$icw*$ich;$i++) { - $x = $i%$icw; $y = $i/$icw; - $c = imagecolorat($dst,$x,$y); - if(rand(0,4) == 2) { $nc = $c ^ rand(0,16777215); } - else { $nc = imagecolorat($dst,rand(0,$icw-1),rand(0,$ich-1)); } - if(rand(18,24)!=21 and $c != 0 and $c != 0xFF00FF) - { - $nc = ncfix(($c&0xFF) + rand(-16,16)) | ncfix((($c>>8)&0xFF) + rand(-8,8))<<8 | ncfix((($c>>16)&0xFF) + rand(-32,32))<<16; - $nc1 = $nc&0xFF ^ ($nc>>8)&0xFF ^ ($nc>>16)&0xFF; - } else { - $nc1 = $nc&0xFF; - if($nc1>($maxc*25)) $nc1 = $nc % ($maxc*25); - } - $nc2 = $nc1 | $nc1<<8 | $nc1<<16; - if(rand(0,1)==0) $nc2=$nc; - imagesetpixel($dst,$x,$y,$nc2); - } - // Obfuscation step 3 - for($i=0;$i<rand(10,30);$i++) { - $x1 = rand(0,$icw-1); $x2 = rand(0,$icw-1); $y1 = rand(0,$ich-1); $y2 = rand(0,$ich-1); - $color = imagecolorallocate($dst, rand(0,$maxc)*25, rand(0,$maxc)*25, rand(0,$maxc)*25); - imageline($dst,$x1,$y1,$x2,$y2,$color); - } - - imagepng($dst); - } - //header('Content-Type: image/png'); - //$t = generateCaptchaHash(); - //generateImage($t); -?> diff --git a/inc/lib/Twig/Autoloader.php b/inc/lib/Twig/Autoloader.php index a93b8caf..7007d315 100644 --- a/inc/lib/Twig/Autoloader.php +++ b/inc/lib/Twig/Autoloader.php @@ -12,28 +12,30 @@ /** * Autoloads Twig classes. * - * @package twig - * @author Fabien Potencier <fabien@symfony.com> + * @author Fabien Potencier <fabien@symfony.com> */ class Twig_Autoloader { /** * Registers Twig_Autoloader as an SPL autoloader. + * + * @param Boolean $prepend Whether to prepend the autoloader or not. */ - static public function register() + public static function register($prepend = false) { - ini_set('unserialize_callback_func', 'spl_autoload_call'); - spl_autoload_register(array(new self, 'autoload')); + if (version_compare(phpversion(), '5.3.0', '>=')) { + spl_autoload_register(array(new self, 'autoload'), true, $prepend); + } else { + spl_autoload_register(array(new self, 'autoload')); + } } /** * Handles autoloading of classes. * - * @param string $class A class name. - * - * @return boolean Returns true if the class has been loaded + * @param string $class A class name. */ - static public function autoload($class) + public static function autoload($class) { if (0 !== strpos($class, 'Twig')) { return; diff --git a/inc/lib/Twig/Compiler.php b/inc/lib/Twig/Compiler.php index db2e8de4..99aecbcc 100644 --- a/inc/lib/Twig/Compiler.php +++ b/inc/lib/Twig/Compiler.php @@ -13,8 +13,7 @@ /** * Compiles a node to PHP code. * - * @package twig - * @author Fabien Potencier <fabien@symfony.com> + * @author Fabien Potencier <fabien@symfony.com> */ class Twig_Compiler implements Twig_CompilerInterface { @@ -22,6 +21,10 @@ class Twig_Compiler implements Twig_CompilerInterface protected $source; protected $indentation; protected $env; + protected $debugInfo; + protected $sourceOffset; + protected $sourceLine; + protected $filename; /** * Constructor. @@ -31,6 +34,12 @@ class Twig_Compiler implements Twig_CompilerInterface public function __construct(Twig_Environment $env) { $this->env = $env; + $this->debugInfo = array(); + } + + public function getFilename() + { + return $this->filename; } /** @@ -56,8 +65,8 @@ class Twig_Compiler implements Twig_CompilerInterface /** * Compiles a node. * - * @param Twig_NodeInterface $node The node to compile - * @param integer $indent The current indentation + * @param Twig_NodeInterface $node The node to compile + * @param integer $indentation The current indentation * * @return Twig_Compiler The current compiler instance */ @@ -65,8 +74,15 @@ class Twig_Compiler implements Twig_CompilerInterface { $this->lastLine = null; $this->source = ''; + $this->sourceOffset = 0; + // source code starts at 1 (as we then increment it when we encounter new lines) + $this->sourceLine = 1; $this->indentation = $indentation; + if ($node instanceof Twig_Node_Module) { + $this->filename = $node->getAttribute('filename'); + } + $node->compile($this); return $this; @@ -86,7 +102,7 @@ class Twig_Compiler implements Twig_CompilerInterface /** * Adds a raw string to the compiled code. * - * @param string $string The string + * @param string $string The string * * @return Twig_Compiler The current compiler instance */ @@ -113,6 +129,11 @@ class Twig_Compiler implements Twig_CompilerInterface return $this; } + /** + * Appends an indentation to the current PHP code after compilation. + * + * @return Twig_Compiler The current compiler instance + */ public function addIndentation() { $this->source .= str_repeat(' ', $this->indentation * 4); @@ -123,7 +144,7 @@ class Twig_Compiler implements Twig_CompilerInterface /** * Adds a quoted string to the compiled code. * - * @param string $string The string + * @param string $value The string * * @return Twig_Compiler The current compiler instance */ @@ -137,19 +158,27 @@ class Twig_Compiler implements Twig_CompilerInterface /** * Returns a PHP representation of a given value. * - * @param mixed $value The value to convert + * @param mixed $value The value to convert * * @return Twig_Compiler The current compiler instance */ public function repr($value) { if (is_int($value) || is_float($value)) { + if (false !== $locale = setlocale(LC_NUMERIC, 0)) { + setlocale(LC_NUMERIC, 'C'); + } + $this->raw($value); - } else if (null === $value) { + + if (false !== $locale) { + setlocale(LC_NUMERIC, $locale); + } + } elseif (null === $value) { $this->raw('null'); - } else if (is_bool($value)) { + } elseif (is_bool($value)) { $this->raw($value ? 'true' : 'false'); - } else if (is_array($value)) { + } elseif (is_array($value)) { $this->raw('array('); $i = 0; foreach ($value as $key => $value) { @@ -178,17 +207,35 @@ class Twig_Compiler implements Twig_CompilerInterface public function addDebugInfo(Twig_NodeInterface $node) { if ($node->getLine() != $this->lastLine) { - $this->lastLine = $node->getLine(); $this->write("// line {$node->getLine()}\n"); + + // when mbstring.func_overload is set to 2 + // mb_substr_count() replaces substr_count() + // but they have different signatures! + if (((int) ini_get('mbstring.func_overload')) & 2) { + // this is much slower than the "right" version + $this->sourceLine += mb_substr_count(mb_substr($this->source, $this->sourceOffset), "\n"); + } else { + $this->sourceLine += substr_count($this->source, "\n", $this->sourceOffset); + } + $this->sourceOffset = strlen($this->source); + $this->debugInfo[$this->sourceLine] = $node->getLine(); + + $this->lastLine = $node->getLine(); } return $this; } + public function getDebugInfo() + { + return $this->debugInfo; + } + /** * Indents the generated code. * - * @param integer $indent The number of indentation to add + * @param integer $step The number of indentation to add * * @return Twig_Compiler The current compiler instance */ @@ -202,18 +249,19 @@ class Twig_Compiler implements Twig_CompilerInterface /** * Outdents the generated code. * - * @param integer $indent The number of indentation to remove + * @param integer $step The number of indentation to remove * * @return Twig_Compiler The current compiler instance */ public function outdent($step = 1) { - $this->indentation -= $step; - - if ($this->indentation < 0) { - throw new Twig_Error('Unable to call outdent() as the indentation would become negative'); + // can't outdent by more steps than the current indentation level + if ($this->indentation < $step) { + throw new LogicException('Unable to call outdent() as the indentation would become negative'); } + $this->indentation -= $step; + return $this; } } diff --git a/inc/lib/Twig/CompilerInterface.php b/inc/lib/Twig/CompilerInterface.php index 0a13edf2..e293ec91 100644 --- a/inc/lib/Twig/CompilerInterface.php +++ b/inc/lib/Twig/CompilerInterface.php @@ -12,24 +12,24 @@ /** * Interface implemented by compiler classes. * - * @package twig - * @author Fabien Potencier <fabien@symfony.com> + * @author Fabien Potencier <fabien@symfony.com> + * @deprecated since 1.12 (to be removed in 2.0) */ interface Twig_CompilerInterface { /** * Compiles a node. * - * @param Twig_NodeInterface $node The node to compile + * @param Twig_NodeInterface $node The node to compile * * @return Twig_CompilerInterface The current compiler instance */ - function compile(Twig_NodeInterface $node); + public function compile(Twig_NodeInterface $node); /** * Gets the current PHP code after compilation. * * @return string The PHP code */ - function getSource(); + public function getSource(); } diff --git a/inc/lib/Twig/Environment.php b/inc/lib/Twig/Environment.php index b91c80c5..3afa73d6 100644 --- a/inc/lib/Twig/Environment.php +++ b/inc/lib/Twig/Environment.php @@ -12,12 +12,11 @@ /** * Stores the Twig configuration. * - * @package twig - * @author Fabien Potencier <fabien@symfony.com> + * @author Fabien Potencier <fabien@symfony.com> */ class Twig_Environment { - const VERSION = '1.2.0'; + const VERSION = '1.13.1'; protected $charset; protected $loader; @@ -36,6 +35,7 @@ class Twig_Environment protected $functions; protected $globals; protected $runtimeInitialized; + protected $extensionInitialized; protected $loadedTemplates; protected $strictVariables; protected $unaryOperators; @@ -43,23 +43,23 @@ class Twig_Environment protected $templateClassPrefix = '__TwigTemplate_'; protected $functionCallbacks; protected $filterCallbacks; + protected $staging; /** * Constructor. * * Available options: * - * * debug: When set to `true`, the generated templates have a __toString() - * method that you can use to display the generated nodes (default to - * false). + * * debug: When set to true, it automatically set "auto_reload" to true as + * well (default to false). * - * * charset: The charset used by the templates (default to utf-8). + * * charset: The charset used by the templates (default to UTF-8). * * * base_template_class: The base template class to use for generated * templates (default to Twig_Template). * * * cache: An absolute path where to store the compiled templates, or - * false to disable compilation cache (default) + * false to disable compilation cache (default). * * * auto_reload: Whether to reload the template is the original source changed. * If you don't provide the auto_reload option, it will be @@ -68,14 +68,18 @@ class Twig_Environment * * strict_variables: Whether to ignore invalid variables in templates * (default to false). * - * * autoescape: Whether to enable auto-escaping (default to true); + * * autoescape: Whether to enable auto-escaping (default to html): + * * false: disable auto-escaping + * * true: equivalent to html + * * html, js: set the autoescaping to one of the supported strategies + * * PHP callback: a PHP callback that returns an escaping strategy based on the template "filename" * * * optimizations: A flag that indicates which optimizations to apply * (default to -1 which means that all optimizations are enabled; - * set it to 0 to disable) + * set it to 0 to disable). * - * @param Twig_LoaderInterface $loader A Twig_LoaderInterface instance - * @param array $options An array of options + * @param Twig_LoaderInterface $loader A Twig_LoaderInterface instance + * @param array $options An array of options */ public function __construct(Twig_LoaderInterface $loader = null, $options = array()) { @@ -88,26 +92,27 @@ class Twig_Environment 'charset' => 'UTF-8', 'base_template_class' => 'Twig_Template', 'strict_variables' => false, - 'autoescape' => true, + 'autoescape' => 'html', 'cache' => false, 'auto_reload' => null, 'optimizations' => -1, ), $options); $this->debug = (bool) $options['debug']; - $this->charset = $options['charset']; + $this->charset = strtoupper($options['charset']); $this->baseTemplateClass = $options['base_template_class']; $this->autoReload = null === $options['auto_reload'] ? $this->debug : (bool) $options['auto_reload']; - $this->extensions = array( - 'core' => new Twig_Extension_Core(), - 'escaper' => new Twig_Extension_Escaper((bool) $options['autoescape']), - 'optimizer' => new Twig_Extension_Optimizer($options['optimizations']), - ); $this->strictVariables = (bool) $options['strict_variables']; $this->runtimeInitialized = false; $this->setCache($options['cache']); $this->functionCallbacks = array(); $this->filterCallbacks = array(); + + $this->addExtension(new Twig_Extension_Core()); + $this->addExtension(new Twig_Extension_Escaper($options['autoescape'])); + $this->addExtension(new Twig_Extension_Optimizer($options['optimizations'])); + $this->extensionInitialized = false; + $this->staging = new Twig_Extension_Staging(); } /** @@ -250,13 +255,14 @@ class Twig_Environment /** * Gets the template class associated with the given string. * - * @param string $name The name for which to calculate the template class name + * @param string $name The name for which to calculate the template class name + * @param integer $index The index if it is an embedded template * * @return string The template class name */ - public function getTemplateClass($name) + public function getTemplateClass($name, $index = null) { - return $this->templateClassPrefix.md5($this->loader->getCacheKey($name)); + return $this->templateClassPrefix.md5($this->getLoader()->getCacheKey($name)).(null === $index ? '' : '_'.$index); } /** @@ -283,15 +289,27 @@ class Twig_Environment } /** + * Displays a template. + * + * @param string $name The template name + * @param array $context An array of parameters to pass to the template + */ + public function display($name, array $context = array()) + { + $this->loadTemplate($name)->display($context); + } + + /** * Loads a template by name. * - * @param string $name The template name + * @param string $name The template name + * @param integer $index The index if it is an embedded template * * @return Twig_TemplateInterface A template instance representing the given template name */ - public function loadTemplate($name) + public function loadTemplate($name, $index = null) { - $cls = $this->getTemplateClass($name); + $cls = $this->getTemplateClass($name, $index); if (isset($this->loadedTemplates[$cls])) { return $this->loadedTemplates[$cls]; @@ -299,10 +317,10 @@ class Twig_Environment if (!class_exists($cls, false)) { if (false === $cache = $this->getCacheFilename($name)) { - eval('?>'.$this->compileSource($this->loader->getSource($name), $name)); + eval('?>'.$this->compileSource($this->getLoader()->getSource($name), $name)); } else { - if (!is_file($cache) || ($this->isAutoReload() && !$this->loader->isFresh($name, filemtime($cache)))) { - $this->writeCacheFile($cache, $this->compileSource($this->loader->getSource($name), $name)); + if (!is_file($cache) || ($this->isAutoReload() && !$this->isTemplateFresh($name, filemtime($cache)))) { + $this->writeCacheFile($cache, $this->compileSource($this->getLoader()->getSource($name), $name)); } require_once $cache; @@ -316,6 +334,30 @@ class Twig_Environment return $this->loadedTemplates[$cls] = new $cls($this); } + /** + * Returns true if the template is still fresh. + * + * Besides checking the loader for freshness information, + * this method also checks if the enabled extensions have + * not changed. + * + * @param string $name The template name + * @param timestamp $time The last modification time of the cached template + * + * @return Boolean true if the template is fresh, false otherwise + */ + public function isTemplateFresh($name, $time) + { + foreach ($this->extensions as $extension) { + $r = new ReflectionObject($extension); + if (filemtime($r->getFileName()) > $time) { + return false; + } + } + + return $this->getLoader()->isFresh($name, $time); + } + public function resolveTemplate($names) { if (!is_array($names)) { @@ -510,6 +552,10 @@ class Twig_Environment */ public function getLoader() { + if (null === $this->loader) { + throw new LogicException('You must set a loader first.'); + } + return $this->loader; } @@ -520,7 +566,7 @@ class Twig_Environment */ public function setCharset($charset) { - $this->charset = $charset; + $this->charset = strtoupper($charset); } /** @@ -580,16 +626,28 @@ class Twig_Environment */ public function addExtension(Twig_ExtensionInterface $extension) { + if ($this->extensionInitialized) { + throw new LogicException(sprintf('Unable to register extension "%s" as extensions have already been initialized.', $extension->getName())); + } + $this->extensions[$extension->getName()] = $extension; } /** * Removes an extension by name. * + * This method is deprecated and you should not use it. + * * @param string $name The extension name + * + * @deprecated since 1.12 (to be removed in 2.0) */ public function removeExtension($name) { + if ($this->extensionInitialized) { + throw new LogicException(sprintf('Unable to remove extension "%s" as extensions have already been initialized.', $name)); + } + unset($this->extensions[$name]); } @@ -622,51 +680,58 @@ class Twig_Environment */ public function addTokenParser(Twig_TokenParserInterface $parser) { - if (null === $this->parsers) { - $this->getTokenParsers(); + if ($this->extensionInitialized) { + throw new LogicException('Unable to add a token parser as extensions have already been initialized.'); } - $this->parsers->addTokenParser($parser); + $this->staging->addTokenParser($parser); } /** * Gets the registered Token Parsers. * - * @return Twig_TokenParserInterface[] An array of Twig_TokenParserInterface instances + * @return Twig_TokenParserBrokerInterface A broker containing token parsers */ public function getTokenParsers() { - if (null === $this->parsers) { - $this->parsers = new Twig_TokenParserBroker; - foreach ($this->getExtensions() as $extension) { - $parsers = $extension->getTokenParsers(); - foreach($parsers as $parser) { - if ($parser instanceof Twig_TokenParserInterface) { - $this->parsers->addTokenParser($parser); - } else if ($parser instanceof Twig_TokenParserBrokerInterface) { - $this->parsers->addTokenParserBroker($parser); - } else { - throw new Twig_Error_Runtime('getTokenParsers() must return an array of Twig_TokenParserInterface or Twig_TokenParserBrokerInterface instances'); - } - } - } + if (!$this->extensionInitialized) { + $this->initExtensions(); } return $this->parsers; } /** + * Gets registered tags. + * + * Be warned that this method cannot return tags defined by Twig_TokenParserBrokerInterface classes. + * + * @return Twig_TokenParserInterface[] An array of Twig_TokenParserInterface instances + */ + public function getTags() + { + $tags = array(); + foreach ($this->getTokenParsers()->getParsers() as $parser) { + if ($parser instanceof Twig_TokenParserInterface) { + $tags[$parser->getTag()] = $parser; + } + } + + return $tags; + } + + /** * Registers a Node Visitor. * * @param Twig_NodeVisitorInterface $visitor A Twig_NodeVisitorInterface instance */ public function addNodeVisitor(Twig_NodeVisitorInterface $visitor) { - if (null === $this->visitors) { - $this->getNodeVisitors(); + if ($this->extensionInitialized) { + throw new LogicException('Unable to add a node visitor as extensions have already been initialized.', $extension->getName()); } - $this->visitors[] = $visitor; + $this->staging->addNodeVisitor($visitor); } /** @@ -676,11 +741,8 @@ class Twig_Environment */ public function getNodeVisitors() { - if (null === $this->visitors) { - $this->visitors = array(); - foreach ($this->getExtensions() as $extension) { - $this->visitors = array_merge($this->visitors, $extension->getNodeVisitors()); - } + if (!$this->extensionInitialized) { + $this->initExtensions(); } return $this->visitors; @@ -689,16 +751,25 @@ class Twig_Environment /** * Registers a Filter. * - * @param string $name The filter name - * @param Twig_FilterInterface $visitor A Twig_FilterInterface instance + * @param string|Twig_SimpleFilter $name The filter name or a Twig_SimpleFilter instance + * @param Twig_FilterInterface|Twig_SimpleFilter $filter A Twig_FilterInterface instance or a Twig_SimpleFilter instance */ - public function addFilter($name, Twig_FilterInterface $filter) + public function addFilter($name, $filter = null) { - if (null === $this->filters) { - $this->loadFilters(); + if (!$name instanceof Twig_SimpleFilter && !($filter instanceof Twig_SimpleFilter || $filter instanceof Twig_FilterInterface)) { + throw new LogicException('A filter must be an instance of Twig_FilterInterface or Twig_SimpleFilter'); } - $this->filters[$name] = $filter; + if ($name instanceof Twig_SimpleFilter) { + $filter = $name; + $name = $filter->getName(); + } + + if ($this->extensionInitialized) { + throw new LogicException(sprintf('Unable to add filter "%s" as extensions have already been initialized.', $name)); + } + + $this->staging->addFilter($name, $filter); } /** @@ -709,18 +780,31 @@ class Twig_Environment * * @param string $name The filter name * - * @return Twig_Filter|false A Twig_Filter instance or false if the filter does not exists + * @return Twig_Filter|false A Twig_Filter instance or false if the filter does not exist */ public function getFilter($name) { - if (null === $this->filters) { - $this->loadFilters(); + if (!$this->extensionInitialized) { + $this->initExtensions(); } if (isset($this->filters[$name])) { return $this->filters[$name]; } + foreach ($this->filters as $pattern => $filter) { + $pattern = str_replace('\\*', '(.*?)', preg_quote($pattern, '#'), $count); + + if ($count) { + if (preg_match('#^'.$pattern.'$#', $name, $matches)) { + array_shift($matches); + $filter->setArguments($matches); + + return $filter; + } + } + } + foreach ($this->filterCallbacks as $callback) { if (false !== $filter = call_user_func($callback, $name)) { return $filter; @@ -738,29 +822,43 @@ class Twig_Environment /** * Gets the registered Filters. * + * Be warned that this method cannot return filters defined with registerUndefinedFunctionCallback. + * * @return Twig_FilterInterface[] An array of Twig_FilterInterface instances + * + * @see registerUndefinedFilterCallback */ - protected function loadFilters() + public function getFilters() { - $this->filters = array(); - foreach ($this->getExtensions() as $extension) { - $this->filters = array_merge($this->filters, $extension->getFilters()); + if (!$this->extensionInitialized) { + $this->initExtensions(); } + + return $this->filters; } /** * Registers a Test. * - * @param string $name The test name - * @param Twig_TestInterface $visitor A Twig_TestInterface instance + * @param string|Twig_SimpleTest $name The test name or a Twig_SimpleTest instance + * @param Twig_TestInterface|Twig_SimpleTest $test A Twig_TestInterface instance or a Twig_SimpleTest instance */ - public function addTest($name, Twig_TestInterface $test) + public function addTest($name, $test = null) { - if (null === $this->tests) { - $this->getTests(); + if (!$name instanceof Twig_SimpleTest && !($test instanceof Twig_SimpleTest || $test instanceof Twig_TestInterface)) { + throw new LogicException('A test must be an instance of Twig_TestInterface or Twig_SimpleTest'); } - $this->tests[$name] = $test; + if ($name instanceof Twig_SimpleTest) { + $test = $name; + $name = $test->getName(); + } + + if ($this->extensionInitialized) { + throw new LogicException(sprintf('Unable to add test "%s" as extensions have already been initialized.', $name)); + } + + $this->staging->addTest($name, $test); } /** @@ -770,29 +868,55 @@ class Twig_Environment */ public function getTests() { - if (null === $this->tests) { - $this->tests = array(); - foreach ($this->getExtensions() as $extension) { - $this->tests = array_merge($this->tests, $extension->getTests()); - } + if (!$this->extensionInitialized) { + $this->initExtensions(); } return $this->tests; } /** + * Gets a test by name. + * + * @param string $name The test name + * + * @return Twig_Test|false A Twig_Test instance or false if the test does not exist + */ + public function getTest($name) + { + if (!$this->extensionInitialized) { + $this->initExtensions(); + } + + if (isset($this->tests[$name])) { + return $this->tests[$name]; + } + + return false; + } + + /** * Registers a Function. * - * @param string $name The function name - * @param Twig_FunctionInterface $function A Twig_FunctionInterface instance + * @param string|Twig_SimpleFunction $name The function name or a Twig_SimpleFunction instance + * @param Twig_FunctionInterface|Twig_SimpleFunction $function A Twig_FunctionInterface instance or a Twig_SimpleFunction instance */ - public function addFunction($name, Twig_FunctionInterface $function) + public function addFunction($name, $function = null) { - if (null === $this->functions) { - $this->loadFunctions(); + if (!$name instanceof Twig_SimpleFunction && !($function instanceof Twig_SimpleFunction || $function instanceof Twig_FunctionInterface)) { + throw new LogicException('A function must be an instance of Twig_FunctionInterface or Twig_SimpleFunction'); } - $this->functions[$name] = $function; + if ($name instanceof Twig_SimpleFunction) { + $function = $name; + $name = $function->getName(); + } + + if ($this->extensionInitialized) { + throw new LogicException(sprintf('Unable to add function "%s" as extensions have already been initialized.', $name)); + } + + $this->staging->addFunction($name, $function); } /** @@ -803,18 +927,31 @@ class Twig_Environment * * @param string $name function name * - * @return Twig_Function|false A Twig_Function instance or false if the function does not exists + * @return Twig_Function|false A Twig_Function instance or false if the function does not exist */ public function getFunction($name) { - if (null === $this->functions) { - $this->loadFunctions(); + if (!$this->extensionInitialized) { + $this->initExtensions(); } if (isset($this->functions[$name])) { return $this->functions[$name]; } + foreach ($this->functions as $pattern => $function) { + $pattern = str_replace('\\*', '(.*?)', preg_quote($pattern, '#'), $count); + + if ($count) { + if (preg_match('#^'.$pattern.'$#', $name, $matches)) { + array_shift($matches); + $function->setArguments($matches); + + return $function; + } + } + } + foreach ($this->functionCallbacks as $callback) { if (false !== $function = call_user_func($callback, $name)) { return $function; @@ -829,27 +966,53 @@ class Twig_Environment $this->functionCallbacks[] = $callable; } - protected function loadFunctions() + /** + * Gets registered functions. + * + * Be warned that this method cannot return functions defined with registerUndefinedFunctionCallback. + * + * @return Twig_FunctionInterface[] An array of Twig_FunctionInterface instances + * + * @see registerUndefinedFunctionCallback + */ + public function getFunctions() { - $this->functions = array(); - foreach ($this->getExtensions() as $extension) { - $this->functions = array_merge($this->functions, $extension->getFunctions()); + if (!$this->extensionInitialized) { + $this->initExtensions(); } + + return $this->functions; } /** * Registers a Global. * + * New globals can be added before compiling or rendering a template; + * but after, you can only update existing globals. + * * @param string $name The global name * @param mixed $value The global value */ public function addGlobal($name, $value) { - if (null === $this->globals) { - $this->getGlobals(); + if ($this->extensionInitialized || $this->runtimeInitialized) { + if (null === $this->globals) { + $this->globals = $this->initGlobals(); + } + + /* This condition must be uncommented in Twig 2.0 + if (!array_key_exists($name, $this->globals)) { + throw new LogicException(sprintf('Unable to add global "%s" as the runtime or the extensions have already been initialized.', $name)); + } + */ } - $this->globals[$name] = $value; + if ($this->extensionInitialized || $this->runtimeInitialized) { + // update the value + $this->globals[$name] = $value; + } else { + $this->staging->addGlobal($name, $value); + } } /** @@ -859,25 +1022,46 @@ class Twig_Environment */ public function getGlobals() { + if (!$this->runtimeInitialized && !$this->extensionInitialized) { + return $this->initGlobals(); + } + if (null === $this->globals) { - $this->globals = array(); - foreach ($this->getExtensions() as $extension) { - $this->globals = array_merge($this->globals, $extension->getGlobals()); - } + $this->globals = $this->initGlobals(); } return $this->globals; } /** + * Merges a context with the defined globals. + * + * @param array $context An array representing the context + * + * @return array The context merged with the globals + */ + public function mergeGlobals(array $context) + { + // we don't use array_merge as the context being generally + // bigger than globals, this code is faster. + foreach ($this->getGlobals() as $key => $value) { + if (!array_key_exists($key, $context)) { + $context[$key] = $value; + } + } + + return $context; + } + + /** * Gets the registered unary Operators. * * @return array An array of unary operators */ public function getUnaryOperators() { - if (null === $this->unaryOperators) { - $this->initOperators(); + if (!$this->extensionInitialized) { + $this->initExtensions(); } return $this->unaryOperators; @@ -890,24 +1074,121 @@ class Twig_Environment */ public function getBinaryOperators() { - if (null === $this->binaryOperators) { - $this->initOperators(); + if (!$this->extensionInitialized) { + $this->initExtensions(); } return $this->binaryOperators; } - protected function initOperators() + public function computeAlternatives($name, $items) + { + $alternatives = array(); + foreach ($items as $item) { + $lev = levenshtein($name, $item); + if ($lev <= strlen($name) / 3 || false !== strpos($item, $name)) { + $alternatives[$item] = $lev; + } + } + asort($alternatives); + + return array_keys($alternatives); + } + + protected function initGlobals() + { + $globals = array(); + foreach ($this->extensions as $extension) { + $extGlob = $extension->getGlobals(); + if (!is_array($extGlob)) { + throw new UnexpectedValueException(sprintf('"%s::getGlobals()" must return an array of globals.', get_class($extension))); + } + + $globals[] = $extGlob; + } + + $globals[] = $this->staging->getGlobals(); + + return call_user_func_array('array_merge', $globals); + } + + protected function initExtensions() { + if ($this->extensionInitialized) { + return; + } + + $this->extensionInitialized = true; + $this->parsers = new Twig_TokenParserBroker(); + $this->filters = array(); + $this->functions = array(); + $this->tests = array(); + $this->visitors = array(); $this->unaryOperators = array(); $this->binaryOperators = array(); - foreach ($this->getExtensions() as $extension) { - $operators = $extension->getOperators(); - if (!$operators) { - continue; + foreach ($this->extensions as $extension) { + $this->initExtension($extension); + } + $this->initExtension($this->staging); + } + + protected function initExtension(Twig_ExtensionInterface $extension) + { + // filters + foreach ($extension->getFilters() as $name => $filter) { + if ($name instanceof Twig_SimpleFilter) { + $filter = $name; + $name = $filter->getName(); + } elseif ($filter instanceof Twig_SimpleFilter) { + $name = $filter->getName(); + } + + $this->filters[$name] = $filter; + } + + // functions + foreach ($extension->getFunctions() as $name => $function) { + if ($name instanceof Twig_SimpleFunction) { + $function = $name; + $name = $function->getName(); + } elseif ($function instanceof Twig_SimpleFunction) { + $name = $function->getName(); + } + + $this->functions[$name] = $function; + } + + // tests + foreach ($extension->getTests() as $name => $test) { + if ($name instanceof Twig_SimpleTest) { + $test = $name; + $name = $test->getName(); + } elseif ($test instanceof Twig_SimpleTest) { + $name = $test->getName(); } + $this->tests[$name] = $test; + } + + // token parsers + foreach ($extension->getTokenParsers() as $parser) { + if ($parser instanceof Twig_TokenParserInterface) { + $this->parsers->addTokenParser($parser); + } elseif ($parser instanceof Twig_TokenParserBrokerInterface) { + $this->parsers->addTokenParserBroker($parser); + } else { + throw new LogicException('getTokenParsers() must return an array of Twig_TokenParserInterface or Twig_TokenParserBrokerInterface instances'); + } + } + + // node visitors + foreach ($extension->getNodeVisitors() as $visitor) { + $this->visitors[] = $visitor; + } + + // operators + if ($operators = $extension->getOperators()) { if (2 !== count($operators)) { throw new InvalidArgumentException(sprintf('"%s::getOperators()" does not return a valid operators array.', get_class($extension))); } @@ -919,20 +1200,25 @@ class Twig_Environment protected function writeCacheFile($file, $content) { - if (!is_dir(dirname($file))) { - mkdir(dirname($file), 0777, true); + $dir = dirname($file); + if (!is_dir($dir)) { + if (false === @mkdir($dir, 0777, true) && !is_dir($dir)) { + throw new RuntimeException(sprintf("Unable to create the cache directory (%s).", $dir)); + } + } elseif (!is_writable($dir)) { + throw new RuntimeException(sprintf("Unable to write in the cache directory (%s).", $dir)); } $tmpFile = tempnam(dirname($file), basename($file)); if (false !== @file_put_contents($tmpFile, $content)) { // rename does not work on Win32 before 5.2.6 if (@rename($tmpFile, $file) || (@copy($tmpFile, $file) && unlink($tmpFile))) { - chmod($file, 0644); + @chmod($file, 0666 & ~umask()); return; } } - throw new Twig_Error_Runtime(sprintf('Failed to write cache file "%s".', $file)); + throw new RuntimeException(sprintf('Failed to write cache file "%s".', $file)); } } diff --git a/inc/lib/Twig/Error.php b/inc/lib/Twig/Error.php index ed0836c4..72d91a98 100644 --- a/inc/lib/Twig/Error.php +++ b/inc/lib/Twig/Error.php @@ -12,8 +12,24 @@ /** * Twig base exception. * - * @package twig - * @author Fabien Potencier <fabien@symfony.com> + * This exception class and its children must only be used when + * an error occurs during the loading of a template, when a syntax error + * is detected in a template, or when rendering a template. Other + * errors must use regular PHP exception classes (like when the template + * cache directory is not writable for instance). + * + * To help debugging template issues, this class tracks the original template + * name and line where the error occurred. + * + * Whenever possible, you must set these information (original template name + * and line number) yourself by passing them to the constructor. If some or all + * these information are not available from where you throw the exception, then + * this class will guess them automatically (when the line number is set to -1 + * and/or the filename is set to null). As this is a costly operation, this + * can be disabled by passing false for both the filename and the line number + * when creating a new instance of this class. + * + * @author Fabien Potencier <fabien@symfony.com> */ class Twig_Error extends Exception { @@ -25,6 +41,15 @@ class Twig_Error extends Exception /** * Constructor. * + * Set both the line number and the filename to false to + * disable automatic guessing of the original template name + * and line number. + * + * Set the line number to -1 to enable its automatic guessing. + * Set the filename to null to enable its automatic guessing. + * + * By default, automatic guessing is enabled. + * * @param string $message The error message * @param integer $lineno The template line where the error occurred * @param string $filename The template file name where the error occurred @@ -32,22 +57,23 @@ class Twig_Error extends Exception */ public function __construct($message, $lineno = -1, $filename = null, Exception $previous = null) { - if (-1 === $lineno || null === $filename) { - list($lineno, $filename) = $this->findTemplateInfo(null !== $previous ? $previous : $this, $lineno, $filename); + if (version_compare(PHP_VERSION, '5.3.0', '<')) { + $this->previous = $previous; + parent::__construct(''); + } else { + parent::__construct('', 0, $previous); } $this->lineno = $lineno; $this->filename = $filename; + + if (-1 === $this->lineno || null === $this->filename) { + $this->guessTemplateInfo(); + } + $this->rawMessage = $message; $this->updateRepr(); - - if (version_compare(PHP_VERSION, '5.3.0', '<')) { - $this->previous = $previous; - parent::__construct($this->message); - } else { - parent::__construct($this->message, 0, $previous); - } } /** @@ -104,13 +130,21 @@ class Twig_Error extends Exception $this->updateRepr(); } + public function guess() + { + $this->guessTemplateInfo(); + $this->updateRepr(); + } + /** * For PHP < 5.3.0, provides access to the getPrevious() method. * - * @param string $method The method name - * @param array $arguments The parameters to be passed to the method + * @param string $method The method name + * @param array $arguments The parameters to be passed to the method * * @return Exception The previous exception or null + * + * @throws BadMethodCallException */ public function __call($method, $arguments) { @@ -131,11 +165,16 @@ class Twig_Error extends Exception $dot = true; } - if (null !== $this->filename) { - $this->message .= sprintf(' in %s', json_encode($this->filename)); + if ($this->filename) { + if (is_string($this->filename) || (is_object($this->filename) && method_exists($this->filename, '__toString'))) { + $filename = sprintf('"%s"', $this->filename); + } else { + $filename = json_encode($this->filename); + } + $this->message .= sprintf(' in %s', $filename); } - if ($this->lineno >= 0) { + if ($this->lineno && $this->lineno >= 0) { $this->message .= sprintf(' at line %d', $this->lineno); } @@ -144,52 +183,57 @@ class Twig_Error extends Exception } } - protected function findTemplateInfo(Exception $e, $currentLine, $currentFile) + protected function guessTemplateInfo() { - if (!function_exists('token_get_all')) { - return array($currentLine, $currentFile); + $template = null; + + if (version_compare(phpversion(), '5.3.6', '>=')) { + $backtrace = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS | DEBUG_BACKTRACE_PROVIDE_OBJECT); + } else { + $backtrace = debug_backtrace(); } - $traces = $e->getTrace(); - foreach ($traces as $i => $trace) { - if (!isset($trace['class']) || 'Twig_Template' === $trace['class']) { - continue; + foreach ($backtrace as $trace) { + if (isset($trace['object']) && $trace['object'] instanceof Twig_Template && 'Twig_Template' !== get_class($trace['object'])) { + if (null === $this->filename || $this->filename == $trace['object']->getTemplateName()) { + $template = $trace['object']; + } } + } - $r = new ReflectionClass($trace['class']); - if (!$r->implementsInterface('Twig_TemplateInterface')) { - continue; - } + // update template filename + if (null !== $template && null === $this->filename) { + $this->filename = $template->getTemplateName(); + } - if (!is_file($r->getFilename())) { - // probably an eval()'d code - return array($currentLine, $currentFile); - } + if (null === $template || $this->lineno > -1) { + return; + } - if (0 === $i) { - $line = $e->getLine(); - } else { - $line = isset($traces[$i - 1]['line']) ? $traces[$i - 1]['line'] : -log(0); - } + $r = new ReflectionObject($template); + $file = $r->getFileName(); - $tokens = token_get_all(file_get_contents($r->getFilename())); - $templateline = -1; - $template = null; - foreach ($tokens as $token) { - if (isset($token[2]) && $token[2] >= $line) { - return array($templateline, $template); + $exceptions = array($e = $this); + while (($e instanceof self || method_exists($e, 'getPrevious')) && $e = $e->getPrevious()) { + $exceptions[] = $e; + } + + while ($e = array_pop($exceptions)) { + $traces = $e->getTrace(); + while ($trace = array_shift($traces)) { + if (!isset($trace['file']) || !isset($trace['line']) || $file != $trace['file']) { + continue; } - if (T_COMMENT === $token[0] && null === $template && preg_match('#/\* +(.+) +\*/#', $token[1], $match)) { - $template = $match[1]; - } elseif (T_COMMENT === $token[0] && preg_match('#^//\s*line (\d+)\s*$#', $token[1], $match)) { - $templateline = $match[1]; + foreach ($template->getDebugInfo() as $codeLine => $templateLine) { + if ($codeLine <= $trace['line']) { + // update template line + $this->lineno = $templateLine; + + return; + } } } - - return array($currentLine, $template); } - - return array($currentLine, $currentFile); } } diff --git a/inc/lib/Twig/Error/Loader.php b/inc/lib/Twig/Error/Loader.php index 418a7760..68efb574 100644 --- a/inc/lib/Twig/Error/Loader.php +++ b/inc/lib/Twig/Error/Loader.php @@ -12,9 +12,20 @@ /** * Exception thrown when an error occurs during template loading. * - * @package twig - * @author Fabien Potencier <fabien@symfony.com> + * Automatic template information guessing is always turned off as + * if a template cannot be loaded, there is nothing to guess. + * However, when a template is loaded from another one, then, we need + * to find the current context and this is automatically done by + * Twig_Template::displayWithErrorHandling(). + * + * This strategy makes Twig_Environment::resolveTemplate() much faster. + * + * @author Fabien Potencier <fabien@symfony.com> */ class Twig_Error_Loader extends Twig_Error { + public function __construct($message, $lineno = -1, $filename = null, Exception $previous = null) + { + parent::__construct($message, false, false, $previous); + } } diff --git a/inc/lib/Twig/Error/Runtime.php b/inc/lib/Twig/Error/Runtime.php index 8a387fa8..8b6ceddb 100644 --- a/inc/lib/Twig/Error/Runtime.php +++ b/inc/lib/Twig/Error/Runtime.php @@ -13,8 +13,7 @@ /** * Exception thrown when an error occurs at runtime. * - * @package twig - * @author Fabien Potencier <fabien@symfony.com> + * @author Fabien Potencier <fabien@symfony.com> */ class Twig_Error_Runtime extends Twig_Error { diff --git a/inc/lib/Twig/Error/Syntax.php b/inc/lib/Twig/Error/Syntax.php index a2650c36..0f5c5792 100644 --- a/inc/lib/Twig/Error/Syntax.php +++ b/inc/lib/Twig/Error/Syntax.php @@ -13,8 +13,7 @@ /** * Exception thrown when a syntax error occurs during lexing or parsing of a template. * - * @package twig - * @author Fabien Potencier <fabien@symfony.com> + * @author Fabien Potencier <fabien@symfony.com> */ class Twig_Error_Syntax extends Twig_Error { diff --git a/inc/lib/Twig/ExistsLoaderInterface.php b/inc/lib/Twig/ExistsLoaderInterface.php new file mode 100644 index 00000000..ce434765 --- /dev/null +++ b/inc/lib/Twig/ExistsLoaderInterface.php @@ -0,0 +1,28 @@ +<?php + +/* + * This file is part of Twig. + * + * (c) 2009 Fabien Potencier + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/** + * Adds an exists() method for loaders. + * + * @author Florin Patan <florinpatan@gmail.com> + * @deprecated since 1.12 (to be removed in 2.0) + */ +interface Twig_ExistsLoaderInterface +{ + /** + * Check if we have the source code of a template, given its name. + * + * @param string $name The name of the template to check if we can load + * + * @return boolean If the template source code is handled by this loader or not + */ + public function exists($name); +} diff --git a/inc/lib/Twig/ExpressionParser.php b/inc/lib/Twig/ExpressionParser.php index b4fc5d5d..9cf19344 100644 --- a/inc/lib/Twig/ExpressionParser.php +++ b/inc/lib/Twig/ExpressionParser.php @@ -18,8 +18,7 @@ * @see http://www.engr.mun.ca/~theo/Misc/exp_parsing.htm * @see http://en.wikipedia.org/wiki/Operator-precedence_parser * - * @package twig - * @author Fabien Potencier <fabien@symfony.com> + * @author Fabien Potencier <fabien@symfony.com> */ class Twig_ExpressionParser { @@ -89,9 +88,19 @@ class Twig_ExpressionParser { while ($this->parser->getStream()->test(Twig_Token::PUNCTUATION_TYPE, '?')) { $this->parser->getStream()->next(); - $expr2 = $this->parseExpression(); - $this->parser->getStream()->expect(Twig_Token::PUNCTUATION_TYPE, ':', 'The ternary operator must have a default value'); - $expr3 = $this->parseExpression(); + if (!$this->parser->getStream()->test(Twig_Token::PUNCTUATION_TYPE, ':')) { + $expr2 = $this->parseExpression(); + if ($this->parser->getStream()->test(Twig_Token::PUNCTUATION_TYPE, ':')) { + $this->parser->getStream()->next(); + $expr3 = $this->parseExpression(); + } else { + $expr3 = new Twig_Node_Expression_Constant('', $this->parser->getCurrentToken()->getLine()); + } + } else { + $this->parser->getStream()->next(); + $expr2 = $expr; + $expr3 = $this->parseExpression(); + } $expr = new Twig_Node_Expression_Conditional($expr, $expr2, $expr3, $this->parser->getCurrentToken()->getLine()); } @@ -143,31 +152,67 @@ class Twig_ExpressionParser break; case Twig_Token::NUMBER_TYPE: - case Twig_Token::STRING_TYPE: $this->parser->getStream()->next(); $node = new Twig_Node_Expression_Constant($token->getValue(), $token->getLine()); break; + case Twig_Token::STRING_TYPE: + case Twig_Token::INTERPOLATION_START_TYPE: + $node = $this->parseStringExpression(); + break; + default: if ($token->test(Twig_Token::PUNCTUATION_TYPE, '[')) { $node = $this->parseArrayExpression(); } elseif ($token->test(Twig_Token::PUNCTUATION_TYPE, '{')) { $node = $this->parseHashExpression(); } else { - throw new Twig_Error_Syntax(sprintf('Unexpected token "%s" of value "%s"', Twig_Token::typeToEnglish($token->getType(), $token->getLine()), $token->getValue()), $token->getLine()); + throw new Twig_Error_Syntax(sprintf('Unexpected token "%s" of value "%s"', Twig_Token::typeToEnglish($token->getType(), $token->getLine()), $token->getValue()), $token->getLine(), $this->parser->getFilename()); } } return $this->parsePostfixExpression($node); } + public function parseStringExpression() + { + $stream = $this->parser->getStream(); + + $nodes = array(); + // a string cannot be followed by another string in a single expression + $nextCanBeString = true; + while (true) { + if ($stream->test(Twig_Token::STRING_TYPE) && $nextCanBeString) { + $token = $stream->next(); + $nodes[] = new Twig_Node_Expression_Constant($token->getValue(), $token->getLine()); + $nextCanBeString = false; + } elseif ($stream->test(Twig_Token::INTERPOLATION_START_TYPE)) { + $stream->next(); + $nodes[] = $this->parseExpression(); + $stream->expect(Twig_Token::INTERPOLATION_END_TYPE); + $nextCanBeString = true; + } else { + break; + } + } + + $expr = array_shift($nodes); + foreach ($nodes as $node) { + $expr = new Twig_Node_Expression_Binary_Concat($expr, $node, $node->getLine()); + } + + return $expr; + } + public function parseArrayExpression() { $stream = $this->parser->getStream(); $stream->expect(Twig_Token::PUNCTUATION_TYPE, '[', 'An array element was expected'); - $elements = array(); + + $node = new Twig_Node_Expression_Array(array(), $stream->getCurrent()->getLine()); + $first = true; while (!$stream->test(Twig_Token::PUNCTUATION_TYPE, ']')) { - if (!empty($elements)) { + if (!$first) { $stream->expect(Twig_Token::PUNCTUATION_TYPE, ',', 'An array element must be followed by a comma'); // trailing ,? @@ -175,21 +220,24 @@ class Twig_ExpressionParser break; } } + $first = false; - $elements[] = $this->parseExpression(); + $node->addElement($this->parseExpression()); } $stream->expect(Twig_Token::PUNCTUATION_TYPE, ']', 'An opened array is not properly closed'); - return new Twig_Node_Expression_Array($elements, $stream->getCurrent()->getLine()); + return $node; } public function parseHashExpression() { $stream = $this->parser->getStream(); $stream->expect(Twig_Token::PUNCTUATION_TYPE, '{', 'A hash element was expected'); - $elements = array(); + + $node = new Twig_Node_Expression_Array(array(), $stream->getCurrent()->getLine()); + $first = true; while (!$stream->test(Twig_Token::PUNCTUATION_TYPE, '}')) { - if (!empty($elements)) { + if (!$first) { $stream->expect(Twig_Token::PUNCTUATION_TYPE, ',', 'A hash value must be followed by a comma'); // trailing ,? @@ -197,19 +245,33 @@ class Twig_ExpressionParser break; } } + $first = false; - if (!$stream->test(Twig_Token::STRING_TYPE) && !$stream->test(Twig_Token::NUMBER_TYPE)) { + // a hash key can be: + // + // * a number -- 12 + // * a string -- 'a' + // * a name, which is equivalent to a string -- a + // * an expression, which must be enclosed in parentheses -- (1 + 2) + if ($stream->test(Twig_Token::STRING_TYPE) || $stream->test(Twig_Token::NAME_TYPE) || $stream->test(Twig_Token::NUMBER_TYPE)) { + $token = $stream->next(); + $key = new Twig_Node_Expression_Constant($token->getValue(), $token->getLine()); + } elseif ($stream->test(Twig_Token::PUNCTUATION_TYPE, '(')) { + $key = $this->parseExpression(); + } else { $current = $stream->getCurrent(); - throw new Twig_Error_Syntax(sprintf('A hash key must be a quoted string or a number (unexpected token "%s" of value "%s"', Twig_Token::typeToEnglish($current->getType(), $current->getLine()), $current->getValue()), $current->getLine()); + + throw new Twig_Error_Syntax(sprintf('A hash key must be a quoted string, a number, a name, or an expression enclosed in parentheses (unexpected token "%s" of value "%s"', Twig_Token::typeToEnglish($current->getType(), $current->getLine()), $current->getValue()), $current->getLine(), $this->parser->getFilename()); } - $key = $stream->next()->getValue(); $stream->expect(Twig_Token::PUNCTUATION_TYPE, ':', 'A hash key must be followed by a colon (:)'); - $elements[$key] = $this->parseExpression(); + $value = $this->parseExpression(); + + $node->addElement($value, $key); } $stream->expect(Twig_Token::PUNCTUATION_TYPE, '}', 'An opened hash is not properly closed'); - return new Twig_Node_Expression_Array($elements, $stream->getCurrent()->getLine()); + return $node; } public function parsePostfixExpression($node) @@ -234,43 +296,56 @@ class Twig_ExpressionParser public function getFunctionNode($name, $line) { - $args = $this->parseArguments(); switch ($name) { case 'parent': + $args = $this->parseArguments(); if (!count($this->parser->getBlockStack())) { - throw new Twig_Error_Syntax('Calling "parent" outside a block is forbidden', $line); + throw new Twig_Error_Syntax('Calling "parent" outside a block is forbidden', $line, $this->parser->getFilename()); } - if (!$this->parser->getParent()) { - throw new Twig_Error_Syntax('Calling "parent" on a template that does not extend another one is forbidden', $line); + if (!$this->parser->getParent() && !$this->parser->hasTraits()) { + throw new Twig_Error_Syntax('Calling "parent" on a template that does not extend nor "use" another template is forbidden', $line, $this->parser->getFilename()); } return new Twig_Node_Expression_Parent($this->parser->peekBlockStack(), $line); case 'block': - return new Twig_Node_Expression_BlockReference($args->getNode(0), false, $line); + return new Twig_Node_Expression_BlockReference($this->parseArguments()->getNode(0), false, $line); case 'attribute': + $args = $this->parseArguments(); if (count($args) < 2) { - throw new Twig_Error_Syntax('The "attribute" function takes at least two arguments (the variable and the attribute)', $line); + throw new Twig_Error_Syntax('The "attribute" function takes at least two arguments (the variable and the attributes)', $line, $this->parser->getFilename()); } return new Twig_Node_Expression_GetAttr($args->getNode(0), $args->getNode(1), count($args) > 2 ? $args->getNode(2) : new Twig_Node_Expression_Array(array(), $line), Twig_TemplateInterface::ANY_CALL, $line); default: - if (null !== $alias = $this->parser->getImportedFunction($name)) { - return new Twig_Node_Expression_GetAttr($alias['node'], new Twig_Node_Expression_Constant($alias['name'], $line), $args, Twig_TemplateInterface::METHOD_CALL, $line); + if (null !== $alias = $this->parser->getImportedSymbol('function', $name)) { + $arguments = new Twig_Node_Expression_Array(array(), $line); + foreach ($this->parseArguments() as $n) { + $arguments->addElement($n); + } + + $node = new Twig_Node_Expression_MethodCall($alias['node'], $alias['name'], $arguments, $line); + $node->setAttribute('safe', true); + + return $node; } - return new Twig_Node_Expression_Function($name, $args, $line); + $args = $this->parseArguments(true); + $class = $this->getFunctionNodeClass($name, $line); + + return new $class($name, $args, $line); } } public function parseSubscriptExpression($node) { - $token = $this->parser->getStream()->next(); + $stream = $this->parser->getStream(); + $token = $stream->next(); $lineno = $token->getLine(); - $arguments = new Twig_Node(); + $arguments = new Twig_Node_Expression_Array(array(), $lineno); $type = Twig_TemplateInterface::ANY_CALL; if ($token->getValue() == '.') { - $token = $this->parser->getStream()->next(); + $token = $stream->next(); if ( $token->getType() == Twig_Token::NAME_TYPE || @@ -280,20 +355,60 @@ class Twig_ExpressionParser ) { $arg = new Twig_Node_Expression_Constant($token->getValue(), $lineno); - if ($this->parser->getStream()->test(Twig_Token::PUNCTUATION_TYPE, '(')) { + if ($stream->test(Twig_Token::PUNCTUATION_TYPE, '(')) { $type = Twig_TemplateInterface::METHOD_CALL; - $arguments = $this->parseArguments(); - } else { - $arguments = new Twig_Node(); + foreach ($this->parseArguments() as $n) { + $arguments->addElement($n); + } } } else { - throw new Twig_Error_Syntax('Expected name or number', $lineno); + throw new Twig_Error_Syntax('Expected name or number', $lineno, $this->parser->getFilename()); + } + + if ($node instanceof Twig_Node_Expression_Name && null !== $this->parser->getImportedSymbol('template', $node->getAttribute('name'))) { + if (!$arg instanceof Twig_Node_Expression_Constant) { + throw new Twig_Error_Syntax(sprintf('Dynamic macro names are not supported (called on "%s")', $node->getAttribute('name')), $token->getLine(), $this->parser->getFilename()); + } + + $node = new Twig_Node_Expression_MethodCall($node, 'get'.$arg->getAttribute('value'), $arguments, $lineno); + $node->setAttribute('safe', true); + + return $node; } } else { $type = Twig_TemplateInterface::ARRAY_CALL; - $arg = $this->parseExpression(); - $this->parser->getStream()->expect(Twig_Token::PUNCTUATION_TYPE, ']'); + // slice? + $slice = false; + if ($stream->test(Twig_Token::PUNCTUATION_TYPE, ':')) { + $slice = true; + $arg = new Twig_Node_Expression_Constant(0, $token->getLine()); + } else { + $arg = $this->parseExpression(); + } + + if ($stream->test(Twig_Token::PUNCTUATION_TYPE, ':')) { + $slice = true; + $stream->next(); + } + + if ($slice) { + if ($stream->test(Twig_Token::PUNCTUATION_TYPE, ']')) { + $length = new Twig_Node_Expression_Constant(null, $token->getLine()); + } else { + $length = $this->parseExpression(); + } + + $class = $this->getFilterNodeClass('slice', $token->getLine()); + $arguments = new Twig_Node(array($arg, $length)); + $filter = new $class($node, new Twig_Node_Expression_Constant('slice', $token->getLine()), $arguments, $token->getLine()); + + $stream->expect(Twig_Token::PUNCTUATION_TYPE, ']'); + + return $filter; + } + + $stream->expect(Twig_Token::PUNCTUATION_TYPE, ']'); } return new Twig_Node_Expression_GetAttr($node, $arg, $arguments, $type, $lineno); @@ -315,10 +430,12 @@ class Twig_ExpressionParser if (!$this->parser->getStream()->test(Twig_Token::PUNCTUATION_TYPE, '(')) { $arguments = new Twig_Node(); } else { - $arguments = $this->parseArguments(); + $arguments = $this->parseArguments(true); } - $node = new Twig_Node_Expression_Filter($node, $name, $arguments, $token->getLine(), $tag); + $class = $this->getFilterNodeClass($name->getAttribute('value'), $token->getLine()); + + $node = new $class($node, $name, $arguments, $token->getLine(), $tag); if (!$this->parser->getStream()->test(Twig_Token::PUNCTUATION_TYPE, '|')) { break; @@ -330,17 +447,62 @@ class Twig_ExpressionParser return $node; } - public function parseArguments() + /** + * Parses arguments. + * + * @param Boolean $namedArguments Whether to allow named arguments or not + * @param Boolean $definition Whether we are parsing arguments for a function definition + */ + public function parseArguments($namedArguments = false, $definition = false) { $args = array(); $stream = $this->parser->getStream(); - $stream->expect(Twig_Token::PUNCTUATION_TYPE, '(', 'A list of arguments must be opened by a parenthesis'); + $stream->expect(Twig_Token::PUNCTUATION_TYPE, '(', 'A list of arguments must begin with an opening parenthesis'); while (!$stream->test(Twig_Token::PUNCTUATION_TYPE, ')')) { if (!empty($args)) { $stream->expect(Twig_Token::PUNCTUATION_TYPE, ',', 'Arguments must be separated by a comma'); } - $args[] = $this->parseExpression(); + + if ($definition) { + $token = $stream->expect(Twig_Token::NAME_TYPE, null, 'An argument must be a name'); + $value = new Twig_Node_Expression_Name($token->getValue(), $this->parser->getCurrentToken()->getLine()); + } else { + $value = $this->parseExpression(); + } + + $name = null; + if ($namedArguments && $stream->test(Twig_Token::OPERATOR_TYPE, '=')) { + $token = $stream->next(); + if (!$value instanceof Twig_Node_Expression_Name) { + throw new Twig_Error_Syntax(sprintf('A parameter name must be a string, "%s" given', get_class($value)), $token->getLine(), $this->parser->getFilename()); + } + $name = $value->getAttribute('name'); + + if ($definition) { + $value = $this->parsePrimaryExpression(); + + if (!$this->checkConstantExpression($value)) { + throw new Twig_Error_Syntax(sprintf('A default value for an argument must be a constant (a boolean, a string, a number, or an array).'), $token->getLine(), $this->parser->getFilename()); + } + } else { + $value = $this->parseExpression(); + } + } + + if ($definition) { + if (null === $name) { + $name = $value->getAttribute('name'); + $value = new Twig_Node_Expression_Constant(null, $this->parser->getCurrentToken()->getLine()); + } + $args[$name] = $value; + } else { + if (null === $name) { + $args[] = $value; + } else { + $args[$name] = $value; + } + } } $stream->expect(Twig_Token::PUNCTUATION_TYPE, ')', 'A list of arguments must be closed by a parenthesis'); @@ -353,7 +515,7 @@ class Twig_ExpressionParser while (true) { $token = $this->parser->getStream()->expect(Twig_Token::NAME_TYPE, null, 'Only variables can be assigned to'); if (in_array($token->getValue(), array('true', 'false', 'none'))) { - throw new Twig_Error_Syntax(sprintf('You cannot assign a value to "%s"', $token->getValue()), $token->getLine()); + throw new Twig_Error_Syntax(sprintf('You cannot assign a value to "%s"', $token->getValue()), $token->getLine(), $this->parser->getFilename()); } $targets[] = new Twig_Node_Expression_AssignName($token->getValue(), $token->getLine()); @@ -379,4 +541,60 @@ class Twig_ExpressionParser return new Twig_Node($targets); } + + protected function getFunctionNodeClass($name, $line) + { + $env = $this->parser->getEnvironment(); + + if (false === $function = $env->getFunction($name)) { + $message = sprintf('The function "%s" does not exist', $name); + if ($alternatives = $env->computeAlternatives($name, array_keys($env->getFunctions()))) { + $message = sprintf('%s. Did you mean "%s"', $message, implode('", "', $alternatives)); + } + + throw new Twig_Error_Syntax($message, $line, $this->parser->getFilename()); + } + + if ($function instanceof Twig_SimpleFunction) { + return $function->getNodeClass(); + } + + return $function instanceof Twig_Function_Node ? $function->getClass() : 'Twig_Node_Expression_Function'; + } + + protected function getFilterNodeClass($name, $line) + { + $env = $this->parser->getEnvironment(); + + if (false === $filter = $env->getFilter($name)) { + $message = sprintf('The filter "%s" does not exist', $name); + if ($alternatives = $env->computeAlternatives($name, array_keys($env->getFilters()))) { + $message = sprintf('%s. Did you mean "%s"', $message, implode('", "', $alternatives)); + } + + throw new Twig_Error_Syntax($message, $line, $this->parser->getFilename()); + } + + if ($filter instanceof Twig_SimpleFilter) { + return $filter->getNodeClass(); + } + + return $filter instanceof Twig_Filter_Node ? $filter->getClass() : 'Twig_Node_Expression_Filter'; + } + + // checks that the node only contains "constant" elements + protected function checkConstantExpression(Twig_NodeInterface $node) + { + if (!($node instanceof Twig_Node_Expression_Constant || $node instanceof Twig_Node_Expression_Array)) { + return false; + } + + foreach ($node as $n) { + if (!$this->checkConstantExpression($n)) { + return false; + } + } + + return true; + } } diff --git a/inc/lib/Twig/Extension.php b/inc/lib/Twig/Extension.php index ac289cb4..931fc033 100644 --- a/inc/lib/Twig/Extension.php +++ b/inc/lib/Twig/Extension.php @@ -82,9 +82,9 @@ abstract class Twig_Extension implements Twig_ExtensionInterface } /** - * Returns a list of global functions to add to the existing list. + * Returns a list of global variables to add to the existing list. * - * @return array An array of global functions + * @return array An array of global variables */ public function getGlobals() { diff --git a/inc/lib/Twig/Extension/Core.php b/inc/lib/Twig/Extension/Core.php index a4153245..e68687b4 100644 --- a/inc/lib/Twig/Extension/Core.php +++ b/inc/lib/Twig/Extension/Core.php @@ -14,6 +14,83 @@ if (!defined('ENT_SUBSTITUTE')) { */ class Twig_Extension_Core extends Twig_Extension { + protected $dateFormats = array('F j, Y H:i', '%d days'); + protected $numberFormat = array(0, '.', ','); + protected $timezone = null; + + /** + * Sets the default format to be used by the date filter. + * + * @param string $format The default date format string + * @param string $dateIntervalFormat The default date interval format string + */ + public function setDateFormat($format = null, $dateIntervalFormat = null) + { + if (null !== $format) { + $this->dateFormats[0] = $format; + } + + if (null !== $dateIntervalFormat) { + $this->dateFormats[1] = $dateIntervalFormat; + } + } + + /** + * Gets the default format to be used by the date filter. + * + * @return array The default date format string and the default date interval format string + */ + public function getDateFormat() + { + return $this->dateFormats; + } + + /** + * Sets the default timezone to be used by the date filter. + * + * @param DateTimeZone|string $timezone The default timezone string or a DateTimeZone object + */ + public function setTimezone($timezone) + { + $this->timezone = $timezone instanceof DateTimeZone ? $timezone : new DateTimeZone($timezone); + } + + /** + * Gets the default timezone to be used by the date filter. + * + * @return DateTimeZone The default timezone currently in use + */ + public function getTimezone() + { + if (null === $this->timezone) { + $this->timezone = new DateTimeZone(date_default_timezone_get()); + } + + return $this->timezone; + } + + /** + * Sets the default format to be used by the number_format filter. + * + * @param integer $decimal The number of decimal places to use. + * @param string $decimalPoint The character(s) to use for the decimal point. + * @param string $thousandSep The character(s) to use for the thousands separator. + */ + public function setNumberFormat($decimal, $decimalPoint, $thousandSep) + { + $this->numberFormat = array($decimal, $decimalPoint, $thousandSep); + } + + /** + * Get the default format used by the number_format filter. + * + * @return array The arguments for number_format() + */ + public function getNumberFormat() + { + return $this->numberFormat; + } + /** * Returns the token parser instance to add to the existing list. * @@ -34,6 +111,9 @@ class Twig_Extension_Core extends Twig_Extension new Twig_TokenParser_From(), new Twig_TokenParser_Set(), new Twig_TokenParser_Spaceless(), + new Twig_TokenParser_Flush(), + new Twig_TokenParser_Do(), + new Twig_TokenParser_Embed(), ); } @@ -46,40 +126,53 @@ class Twig_Extension_Core extends Twig_Extension { $filters = array( // formatting filters - 'date' => new Twig_Filter_Function('twig_date_format_filter'), - 'format' => new Twig_Filter_Function('sprintf'), - 'replace' => new Twig_Filter_Function('twig_strtr'), + new Twig_SimpleFilter('date', 'twig_date_format_filter', array('needs_environment' => true)), + new Twig_SimpleFilter('date_modify', 'twig_date_modify_filter', array('needs_environment' => true)), + new Twig_SimpleFilter('format', 'sprintf'), + new Twig_SimpleFilter('replace', 'strtr'), + new Twig_SimpleFilter('number_format', 'twig_number_format_filter', array('needs_environment' => true)), + new Twig_SimpleFilter('abs', 'abs'), // encoding - 'url_encode' => new Twig_Filter_Function('twig_urlencode_filter'), - 'json_encode' => new Twig_Filter_Function('twig_jsonencode_filter'), + new Twig_SimpleFilter('url_encode', 'twig_urlencode_filter'), + new Twig_SimpleFilter('json_encode', 'twig_jsonencode_filter'), + new Twig_SimpleFilter('convert_encoding', 'twig_convert_encoding'), // string filters - 'title' => new Twig_Filter_Function('twig_title_string_filter', array('needs_environment' => true)), - 'capitalize' => new Twig_Filter_Function('twig_capitalize_string_filter', array('needs_environment' => true)), - 'upper' => new Twig_Filter_Function('strtoupper'), - 'lower' => new Twig_Filter_Function('strtolower'), - 'striptags' => new Twig_Filter_Function('strip_tags'), + new Twig_SimpleFilter('title', 'twig_title_string_filter', array('needs_environment' => true)), + new Twig_SimpleFilter('capitalize', 'twig_capitalize_string_filter', array('needs_environment' => true)), + new Twig_SimpleFilter('upper', 'strtoupper'), + new Twig_SimpleFilter('lower', 'strtolower'), + new Twig_SimpleFilter('striptags', 'strip_tags'), + new Twig_SimpleFilter('trim', 'trim'), + new Twig_SimpleFilter('nl2br', 'nl2br', array('pre_escape' => 'html', 'is_safe' => array('html'))), // array helpers - 'join' => new Twig_Filter_Function('twig_join_filter'), - 'reverse' => new Twig_Filter_Function('twig_reverse_filter'), - 'length' => new Twig_Filter_Function('twig_length_filter', array('needs_environment' => true)), - 'sort' => new Twig_Filter_Function('twig_sort_filter'), - 'merge' => new Twig_Filter_Function('twig_array_merge'), + new Twig_SimpleFilter('join', 'twig_join_filter'), + new Twig_SimpleFilter('split', 'twig_split_filter'), + new Twig_SimpleFilter('sort', 'twig_sort_filter'), + new Twig_SimpleFilter('merge', 'twig_array_merge'), + new Twig_SimpleFilter('batch', 'twig_array_batch'), + + // string/array filters + new Twig_SimpleFilter('reverse', 'twig_reverse_filter', array('needs_environment' => true)), + new Twig_SimpleFilter('length', 'twig_length_filter', array('needs_environment' => true)), + new Twig_SimpleFilter('slice', 'twig_slice', array('needs_environment' => true)), + new Twig_SimpleFilter('first', 'twig_first', array('needs_environment' => true)), + new Twig_SimpleFilter('last', 'twig_last', array('needs_environment' => true)), // iteration and runtime - 'default' => new Twig_Filter_Function('twig_default_filter'), - 'keys' => new Twig_Filter_Function('twig_get_array_keys_filter'), + new Twig_SimpleFilter('default', '_twig_default_filter', array('node_class' => 'Twig_Node_Expression_Filter_Default')), + new Twig_SimpleFilter('keys', 'twig_get_array_keys_filter'), // escaping - 'escape' => new Twig_Filter_Function('twig_escape_filter', array('needs_environment' => true, 'is_safe_callback' => 'twig_escape_filter_is_safe')), - 'e' => new Twig_Filter_Function('twig_escape_filter', array('needs_environment' => true, 'is_safe_callback' => 'twig_escape_filter_is_safe')), + new Twig_SimpleFilter('escape', 'twig_escape_filter', array('needs_environment' => true, 'is_safe_callback' => 'twig_escape_filter_is_safe')), + new Twig_SimpleFilter('e', 'twig_escape_filter', array('needs_environment' => true, 'is_safe_callback' => 'twig_escape_filter_is_safe')), ); if (function_exists('mb_get_info')) { - $filters['upper'] = new Twig_Filter_Function('twig_upper_filter', array('needs_environment' => true)); - $filters['lower'] = new Twig_Filter_Function('twig_lower_filter', array('needs_environment' => true)); + $filters[] = new Twig_SimpleFilter('upper', 'twig_upper_filter', array('needs_environment' => true)); + $filters[] = new Twig_SimpleFilter('lower', 'twig_lower_filter', array('needs_environment' => true)); } return $filters; @@ -93,29 +186,33 @@ class Twig_Extension_Core extends Twig_Extension public function getFunctions() { return array( - 'range' => new Twig_Function_Function('range'), - 'constant' => new Twig_Function_Function('constant'), - 'cycle' => new Twig_Function_Function('twig_cycle'), + new Twig_SimpleFunction('range', 'range'), + new Twig_SimpleFunction('constant', 'twig_constant'), + new Twig_SimpleFunction('cycle', 'twig_cycle'), + new Twig_SimpleFunction('random', 'twig_random', array('needs_environment' => true)), + new Twig_SimpleFunction('date', 'twig_date_converter', array('needs_environment' => true)), + new Twig_SimpleFunction('include', 'twig_include', array('needs_environment' => true, 'needs_context' => true, 'is_safe' => array('all'))), ); } /** - * Returns a list of filters to add to the existing list. + * Returns a list of tests to add to the existing list. * - * @return array An array of filters + * @return array An array of tests */ public function getTests() { return array( - 'even' => new Twig_Test_Function('twig_test_even'), - 'odd' => new Twig_Test_Function('twig_test_odd'), - 'defined' => new Twig_Test_Function('twig_test_defined'), - 'sameas' => new Twig_Test_Function('twig_test_sameas'), - 'none' => new Twig_Test_Function('twig_test_none'), - 'null' => new Twig_Test_Function('twig_test_none'), - 'divisibleby' => new Twig_Test_Function('twig_test_divisibleby'), - 'constant' => new Twig_Test_Function('twig_test_constant'), - 'empty' => new Twig_Test_Function('twig_test_empty'), + new Twig_SimpleTest('even', null, array('node_class' => 'Twig_Node_Expression_Test_Even')), + new Twig_SimpleTest('odd', null, array('node_class' => 'Twig_Node_Expression_Test_Odd')), + new Twig_SimpleTest('defined', null, array('node_class' => 'Twig_Node_Expression_Test_Defined')), + new Twig_SimpleTest('sameas', null, array('node_class' => 'Twig_Node_Expression_Test_Sameas')), + new Twig_SimpleTest('none', null, array('node_class' => 'Twig_Node_Expression_Test_Null')), + new Twig_SimpleTest('null', null, array('node_class' => 'Twig_Node_Expression_Test_Null')), + new Twig_SimpleTest('divisibleby', null, array('node_class' => 'Twig_Node_Expression_Test_Divisibleby')), + new Twig_SimpleTest('constant', null, array('node_class' => 'Twig_Node_Expression_Test_Constant')), + new Twig_SimpleTest('empty', 'twig_test_empty'), + new Twig_SimpleTest('iterable', 'twig_test_iterable'), ); } @@ -129,15 +226,15 @@ class Twig_Extension_Core extends Twig_Extension return array( array( 'not' => array('precedence' => 50, 'class' => 'Twig_Node_Expression_Unary_Not'), - '-' => array('precedence' => 50, 'class' => 'Twig_Node_Expression_Unary_Neg'), - '+' => array('precedence' => 50, 'class' => 'Twig_Node_Expression_Unary_Pos'), + '-' => array('precedence' => 500, 'class' => 'Twig_Node_Expression_Unary_Neg'), + '+' => array('precedence' => 500, 'class' => 'Twig_Node_Expression_Unary_Pos'), ), array( - 'b-and' => array('precedence' => 5, 'class' => 'Twig_Node_Expression_Binary_BitwiseAnd', 'associativity' => Twig_ExpressionParser::OPERATOR_LEFT), - 'b-xor' => array('precedence' => 5, 'class' => 'Twig_Node_Expression_Binary_BitwiseXor', 'associativity' => Twig_ExpressionParser::OPERATOR_LEFT), - 'b-or' => array('precedence' => 5, 'class' => 'Twig_Node_Expression_Binary_BitwiseOr', 'associativity' => Twig_ExpressionParser::OPERATOR_LEFT), 'or' => array('precedence' => 10, 'class' => 'Twig_Node_Expression_Binary_Or', 'associativity' => Twig_ExpressionParser::OPERATOR_LEFT), 'and' => array('precedence' => 15, 'class' => 'Twig_Node_Expression_Binary_And', 'associativity' => Twig_ExpressionParser::OPERATOR_LEFT), + 'b-or' => array('precedence' => 16, 'class' => 'Twig_Node_Expression_Binary_BitwiseOr', 'associativity' => Twig_ExpressionParser::OPERATOR_LEFT), + 'b-xor' => array('precedence' => 17, 'class' => 'Twig_Node_Expression_Binary_BitwiseXor', 'associativity' => Twig_ExpressionParser::OPERATOR_LEFT), + 'b-and' => array('precedence' => 18, 'class' => 'Twig_Node_Expression_Binary_BitwiseAnd', 'associativity' => Twig_ExpressionParser::OPERATOR_LEFT), '==' => array('precedence' => 20, 'class' => 'Twig_Node_Expression_Binary_Equal', 'associativity' => Twig_ExpressionParser::OPERATOR_LEFT), '!=' => array('precedence' => 20, 'class' => 'Twig_Node_Expression_Binary_NotEqual', 'associativity' => Twig_ExpressionParser::OPERATOR_LEFT), '<' => array('precedence' => 20, 'class' => 'Twig_Node_Expression_Binary_Less', 'associativity' => Twig_ExpressionParser::OPERATOR_LEFT), @@ -146,6 +243,7 @@ class Twig_Extension_Core extends Twig_Extension '<=' => array('precedence' => 20, 'class' => 'Twig_Node_Expression_Binary_LessEqual', 'associativity' => Twig_ExpressionParser::OPERATOR_LEFT), 'not in' => array('precedence' => 20, 'class' => 'Twig_Node_Expression_Binary_NotIn', 'associativity' => Twig_ExpressionParser::OPERATOR_LEFT), 'in' => array('precedence' => 20, 'class' => 'Twig_Node_Expression_Binary_In', 'associativity' => Twig_ExpressionParser::OPERATOR_LEFT), + '..' => array('precedence' => 25, 'class' => 'Twig_Node_Expression_Binary_Range', 'associativity' => Twig_ExpressionParser::OPERATOR_LEFT), '+' => array('precedence' => 30, 'class' => 'Twig_Node_Expression_Binary_Add', 'associativity' => Twig_ExpressionParser::OPERATOR_LEFT), '-' => array('precedence' => 30, 'class' => 'Twig_Node_Expression_Binary_Sub', 'associativity' => Twig_ExpressionParser::OPERATOR_LEFT), '~' => array('precedence' => 40, 'class' => 'Twig_Node_Expression_Binary_Concat', 'associativity' => Twig_ExpressionParser::OPERATOR_LEFT), @@ -155,7 +253,6 @@ class Twig_Extension_Core extends Twig_Extension '%' => array('precedence' => 60, 'class' => 'Twig_Node_Expression_Binary_Mod', 'associativity' => Twig_ExpressionParser::OPERATOR_LEFT), 'is' => array('precedence' => 100, 'callable' => array($this, 'parseTestExpression'), 'associativity' => Twig_ExpressionParser::OPERATOR_LEFT), 'is not' => array('precedence' => 100, 'callable' => array($this, 'parseNotTestExpression'), 'associativity' => Twig_ExpressionParser::OPERATOR_LEFT), - '..' => array('precedence' => 110, 'class' => 'Twig_Node_Expression_Binary_Range', 'associativity' => Twig_ExpressionParser::OPERATOR_LEFT), '**' => array('precedence' => 200, 'class' => 'Twig_Node_Expression_Binary_Power', 'associativity' => Twig_ExpressionParser::OPERATOR_RIGHT), ), ); @@ -169,13 +266,35 @@ class Twig_Extension_Core extends Twig_Extension public function parseTestExpression(Twig_Parser $parser, $node) { $stream = $parser->getStream(); - $name = $stream->expect(Twig_Token::NAME_TYPE); + $name = $stream->expect(Twig_Token::NAME_TYPE)->getValue(); $arguments = null; if ($stream->test(Twig_Token::PUNCTUATION_TYPE, '(')) { - $arguments = $parser->getExpressionParser()->parseArguments(); + $arguments = $parser->getExpressionParser()->parseArguments(true); } - return new Twig_Node_Expression_Test($node, $name->getValue(), $arguments, $parser->getCurrentToken()->getLine()); + $class = $this->getTestNodeClass($parser, $name, $node->getLine()); + + return new $class($node, $name, $arguments, $parser->getCurrentToken()->getLine()); + } + + protected function getTestNodeClass(Twig_Parser $parser, $name, $line) + { + $env = $parser->getEnvironment(); + $testMap = $env->getTests(); + if (!isset($testMap[$name])) { + $message = sprintf('The test "%s" does not exist', $name); + if ($alternatives = $env->computeAlternatives($name, array_keys($env->getTests()))) { + $message = sprintf('%s. Did you mean "%s"', $message, implode('", "', $alternatives)); + } + + throw new Twig_Error_Syntax($message, $line, $parser->getFilename()); + } + + if ($testMap[$name] instanceof Twig_SimpleTest) { + return $testMap[$name]->getNodeClass(); + } + + return $testMap[$name] instanceof Twig_Test_Node ? $testMap[$name]->getClass() : 'Twig_Node_Expression_Test'; } /** @@ -192,18 +311,77 @@ class Twig_Extension_Core extends Twig_Extension /** * Cycles over a value. * - * @param ArrayAccess|array $values An array or an ArrayAccess instance - * @param integer $i The cycle value + * @param ArrayAccess|array $values An array or an ArrayAccess instance + * @param integer $position The cycle position * * @return string The next value in the cycle */ -function twig_cycle($values, $i) +function twig_cycle($values, $position) { if (!is_array($values) && !$values instanceof ArrayAccess) { return $values; } - return $values[$i % count($values)]; + return $values[$position % count($values)]; +} + +/** + * Returns a random value depending on the supplied parameter type: + * - a random item from a Traversable or array + * - a random character from a string + * - a random integer between 0 and the integer parameter + * + * @param Twig_Environment $env A Twig_Environment instance + * @param Traversable|array|integer|string $values The values to pick a random item from + * + * @throws Twig_Error_Runtime When $values is an empty array (does not apply to an empty string which is returned as is). + * + * @return mixed A random value from the given sequence + */ +function twig_random(Twig_Environment $env, $values = null) +{ + if (null === $values) { + return mt_rand(); + } + + if (is_int($values) || is_float($values)) { + return $values < 0 ? mt_rand($values, 0) : mt_rand(0, $values); + } + + if ($values instanceof Traversable) { + $values = iterator_to_array($values); + } elseif (is_string($values)) { + if ('' === $values) { + return ''; + } + if (null !== $charset = $env->getCharset()) { + if ('UTF-8' != $charset) { + $values = twig_convert_encoding($values, 'UTF-8', $charset); + } + + // unicode version of str_split() + // split at all positions, but not after the start and not before the end + $values = preg_split('/(?<!^)(?!$)/u', $values); + + if ('UTF-8' != $charset) { + foreach ($values as $i => $value) { + $values[$i] = twig_convert_encoding($value, $charset, 'UTF-8'); + } + } + } else { + return $values[mt_rand(0, strlen($values) - 1)]; + } + } + + if (!is_array($values)) { + return $values; + } + + if (0 === count($values)) { + throw new Twig_Error_Runtime('The random function cannot pick from an empty array.'); + } + + return $values[array_rand($values, 1)]; } /** @@ -213,44 +391,143 @@ function twig_cycle($values, $i) * {{ post.published_at|date("m/d/Y") }} * </pre> * + * @param Twig_Environment $env A Twig_Environment instance + * @param DateTime|DateInterval|string $date A date + * @param string $format A format + * @param DateTimeZone|string $timezone A timezone + * + * @return string The formatted date + */ +function twig_date_format_filter(Twig_Environment $env, $date, $format = null, $timezone = null) +{ + if (null === $format) { + $formats = $env->getExtension('core')->getDateFormat(); + $format = $date instanceof DateInterval ? $formats[1] : $formats[0]; + } + + if ($date instanceof DateInterval) { + return $date->format($format); + } + + return twig_date_converter($env, $date, $timezone)->format($format); +} + +/** + * Returns a new date object modified + * + * <pre> + * {{ post.published_at|date_modify("-1day")|date("m/d/Y") }} + * </pre> + * + * @param Twig_Environment $env A Twig_Environment instance + * @param DateTime|string $date A date + * @param string $modifier A modifier string + * + * @return DateTime A new date object + */ +function twig_date_modify_filter(Twig_Environment $env, $date, $modifier) +{ + $date = twig_date_converter($env, $date, false); + $date->modify($modifier); + + return $date; +} + +/** + * Converts an input to a DateTime instance. + * + * <pre> + * {% if date(user.created_at) < date('+2days') %} + * {# do something #} + * {% endif %} + * </pre> + * + * @param Twig_Environment $env A Twig_Environment instance * @param DateTime|string $date A date - * @param string $format A format * @param DateTimeZone|string $timezone A timezone * - * @return string The formatter date + * @return DateTime A DateTime instance */ -function twig_date_format_filter($date, $format = 'F j, Y H:i', $timezone = null) +function twig_date_converter(Twig_Environment $env, $date = null, $timezone = null) { - if (!$date instanceof DateTime) { - if (ctype_digit((string) $date)) { - $date = new DateTime('@'.$date); - $date->setTimezone(new DateTimeZone(date_default_timezone_get())); - } else { - $date = new DateTime($date); - } + // determine the timezone + if (!$timezone) { + $defaultTimezone = $env->getExtension('core')->getTimezone(); + } elseif (!$timezone instanceof DateTimeZone) { + $defaultTimezone = new DateTimeZone($timezone); + } else { + $defaultTimezone = $timezone; } - if (null !== $timezone) { - if (!$timezone instanceof DateTimeZone) { - $timezone = new DateTimeZone($timezone); + if ($date instanceof DateTime) { + $date = clone $date; + if (false !== $timezone) { + $date->setTimezone($defaultTimezone); } - $date->setTimezone($timezone); + return $date; + } + + $asString = (string) $date; + if (ctype_digit($asString) || (!empty($asString) && '-' === $asString[0] && ctype_digit(substr($asString, 1)))) { + $date = '@'.$date; } - return $date->format($format); + $date = new DateTime($date, $defaultTimezone); + if (false !== $timezone) { + $date->setTimezone($defaultTimezone); + } + + return $date; +} + +/** + * Number format filter. + * + * All of the formatting options can be left null, in that case the defaults will + * be used. Supplying any of the parameters will override the defaults set in the + * environment object. + * + * @param Twig_Environment $env A Twig_Environment instance + * @param mixed $number A float/int/string of the number to format + * @param integer $decimal The number of decimal points to display. + * @param string $decimalPoint The character(s) to use for the decimal point. + * @param string $thousandSep The character(s) to use for the thousands separator. + * + * @return string The formatted number + */ +function twig_number_format_filter(Twig_Environment $env, $number, $decimal = null, $decimalPoint = null, $thousandSep = null) +{ + $defaults = $env->getExtension('core')->getNumberFormat(); + if (null === $decimal) { + $decimal = $defaults[0]; + } + + if (null === $decimalPoint) { + $decimalPoint = $defaults[1]; + } + + if (null === $thousandSep) { + $thousandSep = $defaults[2]; + } + + return number_format((float) $number, $decimal, $decimalPoint, $thousandSep); } /** - * URL encodes a string. + * URL encodes a string as a path segment or an array as a query string. * - * @param string $url A URL - * @param bool $raw true to use rawurlencode() instead of urlencode + * @param string|array $url A URL or an array of query parameters + * @param bool $raw true to use rawurlencode() instead of urlencode * * @return string The URL encoded value */ function twig_urlencode_filter($url, $raw = false) { + if (is_array($url)) { + return http_build_query($url, '', '&'); + } + if ($raw) { return rawurlencode($url); } @@ -260,7 +537,7 @@ function twig_urlencode_filter($url, $raw = false) if (version_compare(PHP_VERSION, '5.3.0', '<')) { /** - * JSON encodes a PHP variable. + * JSON encodes a variable. * * @param mixed $value The value to encode. * @param integer $options Not used on PHP 5.2.x @@ -279,7 +556,7 @@ if (version_compare(PHP_VERSION, '5.3.0', '<')) { } } else { /** - * JSON encodes a PHP variable. + * JSON encodes a variable. * * @param mixed $value The value to encode. * @param integer $options Bitmask consisting of JSON_HEX_QUOT, JSON_HEX_TAG, JSON_HEX_AMP, JSON_HEX_APOS, JSON_NUMERIC_CHECK, JSON_PRETTY_PRINT, JSON_UNESCAPED_SLASHES, JSON_FORCE_OBJECT @@ -324,13 +601,73 @@ function _twig_markup2string(&$value) function twig_array_merge($arr1, $arr2) { if (!is_array($arr1) || !is_array($arr2)) { - throw new Twig_Error_Runtime('The merge filter only work with arrays or hashes.'); + throw new Twig_Error_Runtime('The merge filter only works with arrays or hashes.'); } return array_merge($arr1, $arr2); } /** + * Slices a variable. + * + * @param Twig_Environment $env A Twig_Environment instance + * @param mixed $item A variable + * @param integer $start Start of the slice + * @param integer $length Size of the slice + * @param Boolean $preserveKeys Whether to preserve key or not (when the input is an array) + * + * @return mixed The sliced variable + */ +function twig_slice(Twig_Environment $env, $item, $start, $length = null, $preserveKeys = false) +{ + if ($item instanceof Traversable) { + $item = iterator_to_array($item, false); + } + + if (is_array($item)) { + return array_slice($item, $start, $length, $preserveKeys); + } + + $item = (string) $item; + + if (function_exists('mb_get_info') && null !== $charset = $env->getCharset()) { + return mb_substr($item, $start, null === $length ? mb_strlen($item, $charset) - $start : $length, $charset); + } + + return null === $length ? substr($item, $start) : substr($item, $start, $length); +} + +/** + * Returns the first element of the item. + * + * @param Twig_Environment $env A Twig_Environment instance + * @param mixed $item A variable + * + * @return mixed The first element of the item + */ +function twig_first(Twig_Environment $env, $item) +{ + $elements = twig_slice($env, $item, 0, 1, false); + + return is_string($elements) ? $elements[0] : current($elements); +} + +/** + * Returns the last element of the item. + * + * @param Twig_Environment $env A Twig_Environment instance + * @param mixed $item A variable + * + * @return mixed The last element of the item + */ +function twig_last(Twig_Environment $env, $item) +{ + $elements = twig_slice($env, $item, -1, 1, false); + + return is_string($elements) ? $elements[0] : current($elements); +} + +/** * Joins the values to a string. * * The separator between elements is an empty string per default, you can define it with the optional parameter. @@ -350,30 +687,55 @@ function twig_array_merge($arr1, $arr2) */ function twig_join_filter($value, $glue = '') { + if ($value instanceof Traversable) { + $value = iterator_to_array($value, false); + } + return implode($glue, (array) $value); } /** - * Returns the value or the default value when it is undefined or empty. + * Splits the string into an array. * * <pre> + * {{ "one,two,three"|split(',') }} + * {# returns [one, two, three] #} * - * {{ var.foo|default('foo item on var is not defined') }} + * {{ "one,two,three,four,five"|split(',', 3) }} + * {# returns [one, two, "three,four,five"] #} * + * {{ "123"|split('') }} + * {# returns [1, 2, 3] #} + * + * {{ "aabbcc"|split('', 2) }} + * {# returns [aa, bb, cc] #} * </pre> * - * @param mixed $value A value - * @param mixed $default The default value + * @param string $value A string + * @param string $delimiter The delimiter + * @param integer $limit The limit * - * @param mixed The value or the default value; + * @return array The split string as an array */ -function twig_default_filter($value, $default = '') +function twig_split_filter($value, $delimiter, $limit = null) +{ + if (empty($delimiter)) { + return str_split($value, null === $limit ? 1 : $limit); + } + + return null === $limit ? explode($delimiter, $value) : explode($delimiter, $value, $limit); +} + +// The '_default' filter is used internally to avoid using the ternary operator +// which costs a lot for big contexts (before PHP 5.4). So, on average, +// a function call is cheaper. +function _twig_default_filter($value, $default = '') { if (twig_test_empty($value)) { return $default; - } else { - return $value; } + + return $value; } /** @@ -405,23 +767,43 @@ function twig_get_array_keys_filter($array) } /** - * Reverses an array. + * Reverses a variable. * - * @param array|Traversable $array An array or a Traversable instance + * @param Twig_Environment $env A Twig_Environment instance + * @param array|Traversable|string $item An array, a Traversable instance, or a string + * @param Boolean $preserveKeys Whether to preserve key or not * - * return array The array reversed + * @return mixed The reversed input */ -function twig_reverse_filter($array) +function twig_reverse_filter(Twig_Environment $env, $item, $preserveKeys = false) { - if (is_object($array) && $array instanceof Traversable) { - return array_reverse(iterator_to_array($array)); + if (is_object($item) && $item instanceof Traversable) { + return array_reverse(iterator_to_array($item), $preserveKeys); } - if (!is_array($array)) { - return array(); + if (is_array($item)) { + return array_reverse($item, $preserveKeys); } - return array_reverse($array); + if (null !== $charset = $env->getCharset()) { + $string = (string) $item; + + if ('UTF-8' != $charset) { + $item = twig_convert_encoding($string, 'UTF-8', $charset); + } + + preg_match_all('/./us', $item, $matches); + + $string = implode('', array_reverse($matches[0])); + + if ('UTF-8' != $charset) { + $string = twig_convert_encoding($string, $charset, 'UTF-8'); + } + + return $string; + } + + return strrev((string) $item); } /** @@ -440,78 +822,151 @@ function twig_sort_filter($array) function twig_in_filter($value, $compare) { if (is_array($compare)) { - return in_array($value, $compare); + return in_array($value, $compare, is_object($value)); } elseif (is_string($compare)) { + if (!strlen($value)) { + return empty($compare); + } + return false !== strpos($compare, (string) $value); - } elseif (is_object($compare) && $compare instanceof Traversable) { - return in_array($value, iterator_to_array($compare, false)); + } elseif ($compare instanceof Traversable) { + return in_array($value, iterator_to_array($compare, false), is_object($value)); } return false; } /** - * Replaces placeholders in a string. - * - * <pre> - * {{ "I like %this% and %that%."|replace({'%this%': foo, '%that%': "bar"}) }} - * </pre> - * - * @param string $pattern A string - * @param string $replacements The values for the placeholders - * - * @return string The string where the placeholders have been replaced - */ -function twig_strtr($pattern, $replacements) -{ - return str_replace(array_keys($replacements), array_values($replacements), $pattern); -} - -/** * Escapes a string. * - * @param Twig_Environment $env A Twig_Environment instance - * @param string $string The value to be escaped - * @param string $type The escaping strategy - * @param string $charset The charset + * @param Twig_Environment $env A Twig_Environment instance + * @param string $string The value to be escaped + * @param string $strategy The escaping strategy + * @param string $charset The charset + * @param Boolean $autoescape Whether the function is called by the auto-escaping feature (true) or by the developer (false) */ -function twig_escape_filter(Twig_Environment $env, $string, $type = 'html', $charset = null) +function twig_escape_filter(Twig_Environment $env, $string, $strategy = 'html', $charset = null, $autoescape = false) { - if (is_object($string) && $string instanceof Twig_Markup) { + if ($autoescape && $string instanceof Twig_Markup) { return $string; } - if (!is_string($string) && !(is_object($string) && method_exists($string, '__toString'))) { - return $string; + if (!is_string($string)) { + if (is_object($string) && method_exists($string, '__toString')) { + $string = (string) $string; + } else { + return $string; + } } if (null === $charset) { $charset = $env->getCharset(); } - switch ($type) { + switch ($strategy) { + case 'html': + // see http://php.net/htmlspecialchars + + // Using a static variable to avoid initializing the array + // each time the function is called. Moving the declaration on the + // top of the function slow downs other escaping strategies. + static $htmlspecialcharsCharsets = array( + 'ISO-8859-1' => true, 'ISO8859-1' => true, + 'ISO-8859-15' => true, 'ISO8859-15' => true, + 'utf-8' => true, 'UTF-8' => true, + 'CP866' => true, 'IBM866' => true, '866' => true, + 'CP1251' => true, 'WINDOWS-1251' => true, 'WIN-1251' => true, + '1251' => true, + 'CP1252' => true, 'WINDOWS-1252' => true, '1252' => true, + 'KOI8-R' => true, 'KOI8-RU' => true, 'KOI8R' => true, + 'BIG5' => true, '950' => true, + 'GB2312' => true, '936' => true, + 'BIG5-HKSCS' => true, + 'SHIFT_JIS' => true, 'SJIS' => true, '932' => true, + 'EUC-JP' => true, 'EUCJP' => true, + 'ISO8859-5' => true, 'ISO-8859-5' => true, 'MACROMAN' => true, + ); + + if (isset($htmlspecialcharsCharsets[$charset])) { + return htmlspecialchars($string, ENT_QUOTES | ENT_SUBSTITUTE, $charset); + } + + if (isset($htmlspecialcharsCharsets[strtoupper($charset)])) { + // cache the lowercase variant for future iterations + $htmlspecialcharsCharsets[$charset] = true; + + return htmlspecialchars($string, ENT_QUOTES | ENT_SUBSTITUTE, $charset); + } + + $string = twig_convert_encoding($string, 'UTF-8', $charset); + $string = htmlspecialchars($string, ENT_QUOTES | ENT_SUBSTITUTE, 'UTF-8'); + + return twig_convert_encoding($string, $charset, 'UTF-8'); + case 'js': // escape all non-alphanumeric characters // into their \xHH or \uHHHH representations if ('UTF-8' != $charset) { - $string = _twig_convert_encoding($string, 'UTF-8', $charset); + $string = twig_convert_encoding($string, 'UTF-8', $charset); } - if (null === $string = preg_replace_callback('#[^\p{L}\p{N} ]#u', '_twig_escape_js_callback', $string)) { + if (0 == strlen($string) ? false : (1 == preg_match('/^./su', $string) ? false : true)) { throw new Twig_Error_Runtime('The string to escape is not a valid UTF-8 string.'); } + $string = preg_replace_callback('#[^a-zA-Z0-9,\._]#Su', '_twig_escape_js_callback', $string); + if ('UTF-8' != $charset) { - $string = _twig_convert_encoding($string, $charset, 'UTF-8'); + $string = twig_convert_encoding($string, $charset, 'UTF-8'); } return $string; - case 'html': - return htmlspecialchars($string, ENT_QUOTES | ENT_SUBSTITUTE, $charset); + case 'css': + if ('UTF-8' != $charset) { + $string = twig_convert_encoding($string, 'UTF-8', $charset); + } + + if (0 == strlen($string) ? false : (1 == preg_match('/^./su', $string) ? false : true)) { + throw new Twig_Error_Runtime('The string to escape is not a valid UTF-8 string.'); + } + + $string = preg_replace_callback('#[^a-zA-Z0-9]#Su', '_twig_escape_css_callback', $string); + + if ('UTF-8' != $charset) { + $string = twig_convert_encoding($string, $charset, 'UTF-8'); + } + + return $string; + + case 'html_attr': + if ('UTF-8' != $charset) { + $string = twig_convert_encoding($string, 'UTF-8', $charset); + } + + if (0 == strlen($string) ? false : (1 == preg_match('/^./su', $string) ? false : true)) { + throw new Twig_Error_Runtime('The string to escape is not a valid UTF-8 string.'); + } + + $string = preg_replace_callback('#[^a-zA-Z0-9,\.\-_]#Su', '_twig_escape_html_attr_callback', $string); + + if ('UTF-8' != $charset) { + $string = twig_convert_encoding($string, $charset, 'UTF-8'); + } + + return $string; + + case 'url': + // hackish test to avoid version_compare that is much slower, this works unless PHP releases a 5.10.* + // at that point however PHP 5.2.* support can be removed + if (PHP_VERSION < '5.3.0') { + return str_replace('%7E', '~', rawurlencode($string)); + } + + return rawurlencode($string); default: - throw new Twig_Error_Runtime(sprintf('Invalid escape type "%s".', $type)); + throw new Twig_Error_Runtime(sprintf('Invalid escaping strategy "%s" (valid ones: html, js, url, css, and html_attr).', $strategy)); } } @@ -521,28 +976,26 @@ function twig_escape_filter_is_safe(Twig_Node $filterArgs) foreach ($filterArgs as $arg) { if ($arg instanceof Twig_Node_Expression_Constant) { return array($arg->getAttribute('value')); - } else { - return array(); } - break; + return array(); } return array('html'); } -if (function_exists('iconv')) { - function _twig_convert_encoding($string, $to, $from) +if (function_exists('mb_convert_encoding')) { + function twig_convert_encoding($string, $to, $from) { - return iconv($from, $to, $string); + return mb_convert_encoding($string, $to, $from); } -} elseif (function_exists('mb_convert_encoding')) { - function _twig_convert_encoding($string, $to, $from) +} elseif (function_exists('iconv')) { + function twig_convert_encoding($string, $to, $from) { - return mb_convert_encoding($string, $to, $from); + return iconv($from, $to, $string); } } else { - function _twig_convert_encoding($string, $to, $from) + function twig_convert_encoding($string, $to, $from) { throw new Twig_Error_Runtime('No suitable convert encoding function (use UTF-8 as your encoding or install the iconv or mbstring extension).'); } @@ -554,22 +1007,98 @@ function _twig_escape_js_callback($matches) // \xHH if (!isset($char[1])) { - return '\\x'.substr('00'.bin2hex($char), -2); + return '\\x'.strtoupper(substr('00'.bin2hex($char), -2)); + } + + // \uHHHH + $char = twig_convert_encoding($char, 'UTF-16BE', 'UTF-8'); + + return '\\u'.strtoupper(substr('0000'.bin2hex($char), -4)); +} + +function _twig_escape_css_callback($matches) +{ + $char = $matches[0]; + + // \xHH + if (!isset($char[1])) { + $hex = ltrim(strtoupper(bin2hex($char)), '0'); + if (0 === strlen($hex)) { + $hex = '0'; + } + + return '\\'.$hex.' '; } // \uHHHH - $char = _twig_convert_encoding($char, 'UTF-16BE', 'UTF-8'); + $char = twig_convert_encoding($char, 'UTF-16BE', 'UTF-8'); + + return '\\'.ltrim(strtoupper(bin2hex($char)), '0').' '; +} + +/** + * This function is adapted from code coming from Zend Framework. + * + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) + * @license http://framework.zend.com/license/new-bsd New BSD License + */ +function _twig_escape_html_attr_callback($matches) +{ + /* + * While HTML supports far more named entities, the lowest common denominator + * has become HTML5's XML Serialisation which is restricted to the those named + * entities that XML supports. Using HTML entities would result in this error: + * XML Parsing Error: undefined entity + */ + static $entityMap = array( + 34 => 'quot', /* quotation mark */ + 38 => 'amp', /* ampersand */ + 60 => 'lt', /* less-than sign */ + 62 => 'gt', /* greater-than sign */ + ); + + $chr = $matches[0]; + $ord = ord($chr); + + /** + * The following replaces characters undefined in HTML with the + * hex entity for the Unicode replacement character. + */ + if (($ord <= 0x1f && $chr != "\t" && $chr != "\n" && $chr != "\r") || ($ord >= 0x7f && $ord <= 0x9f)) { + return '�'; + } + + /** + * Check if the current character to escape has a name entity we should + * replace it with while grabbing the hex value of the character. + */ + if (strlen($chr) == 1) { + $hex = strtoupper(substr('00'.bin2hex($chr), -2)); + } else { + $chr = twig_convert_encoding($chr, 'UTF-16BE', 'UTF-8'); + $hex = strtoupper(substr('0000'.bin2hex($chr), -4)); + } + + $int = hexdec($hex); + if (array_key_exists($int, $entityMap)) { + return sprintf('&%s;', $entityMap[$int]); + } + + /** + * Per OWASP recommendations, we'll use hex entities for any other + * characters where a named entity does not exist. + */ - return '\\u'.substr('0000'.bin2hex($char), -4); + return sprintf('&#x%s;', $hex); } // add multibyte extensions if possible if (function_exists('mb_get_info')) { /** - * Returns the length of a PHP variable. + * Returns the length of a variable. * * @param Twig_Environment $env A Twig_Environment instance - * @param mixed $thing A PHP variable + * @param mixed $thing A variable * * @return integer The length of the value */ @@ -648,13 +1177,12 @@ if (function_exists('mb_get_info')) { } } // and byte fallback -else -{ +else { /** - * Returns the length of a PHP variable. + * Returns the length of a variable. * * @param Twig_Environment $env A Twig_Environment instance - * @param mixed $thing A PHP variable + * @param mixed $thing A variable * * @return integer The length of the value */ @@ -693,154 +1221,135 @@ else /* used internally */ function twig_ensure_traversable($seq) { - if (is_array($seq) || (is_object($seq) && $seq instanceof Traversable)) { + if ($seq instanceof Traversable || is_array($seq)) { return $seq; - } else { - return array(); } + + return array(); } /** - * Checks that a variable points to the same memory address than another one. + * Checks if a variable is empty. * * <pre> - * {% if foo.attribute is sameas(false) %} - * the foo attribute really is the ``false`` PHP value + * {# evaluates to true if the foo variable is null, false, or the empty string #} + * {% if foo is empty %} + * {# ... #} * {% endif %} * </pre> * - * @param mixed $value A PHP variable - * @param mixed $test The PHP variable to test against + * @param mixed $value A variable * - * @return Boolean true if the values are the same, false otherwise + * @return Boolean true if the value is empty, false otherwise */ -function twig_test_sameas($value, $test) +function twig_test_empty($value) { - return $value === $test; -} + if ($value instanceof Countable) { + return 0 == count($value); + } -/** - * Checks that a variable is null. - * - * <pre> - * {{ var is none }} - * </pre> - * - * @param mixed $value a PHP variable. - * - * @return Boolean true if the value is null, false otherwise - */ -function twig_test_none($value) -{ - return null === $value; + return '' === $value || false === $value || null === $value || array() === $value; } /** - * Checks if a variable is divisible by a number. + * Checks if a variable is traversable. * * <pre> - * {% if loop.index is divisibleby(3) %} + * {# evaluates to true if the foo variable is an array or a traversable object #} + * {% if foo is traversable %} + * {# ... #} + * {% endif %} * </pre> * - * @param integer $value A PHP value - * @param integer $num A number + * @param mixed $value A variable * - * @return Boolean true if the value is divisible by the number, false otherwise + * @return Boolean true if the value is traversable */ -function twig_test_divisibleby($value, $num) +function twig_test_iterable($value) { - return 0 == $value % $num; + return $value instanceof Traversable || is_array($value); } /** - * Checks if a number is even. - * - * <pre> - * {{ var is even }} - * </pre> + * Renders a template. * - * @param integer $value An integer + * @param string $template The template to render + * @param array $variables The variables to pass to the template + * @param Boolean $with_context Whether to pass the current context variables or not + * @param Boolean $ignore_missing Whether to ignore missing templates or not + * @param Boolean $sandboxed Whether to sandbox the template or not * - * @return Boolean true if the value is even, false otherwise + * @return string The rendered template */ -function twig_test_even($value) +function twig_include(Twig_Environment $env, $context, $template, $variables = array(), $withContext = true, $ignoreMissing = false, $sandboxed = false) { - return $value % 2 == 0; -} + if ($withContext) { + $variables = array_merge($context, $variables); + } -/** - * Checks if a number is odd. - * - * <pre> - * {{ var is odd }} - * </pre> - * - * @param integer $value An integer - * - * @return Boolean true if the value is odd, false otherwise - */ -function twig_test_odd($value) -{ - return $value % 2 == 1; -} + if ($isSandboxed = $sandboxed && $env->hasExtension('sandbox')) { + $sandbox = $env->getExtension('sandbox'); + if (!$alreadySandboxed = $sandbox->isSandboxed()) { + $sandbox->enableSandbox(); + } + } -/** - * Checks if a variable is the exact same value as a constant. - * - * <pre> - * {% if post.status is constant('Post::PUBLISHED') %} - * the status attribute is exactly the same as Post::PUBLISHED - * {% endif %} - * </pre> - * - * @param mixed $value A PHP value - * @param mixed $constant The constant to test against - * - * @return Boolean true if the value is the same as the constant, false otherwise - */ -function twig_test_constant($value, $constant) -{ - return constant($constant) === $value; + try { + return $env->resolveTemplate($template)->render($variables); + } catch (Twig_Error_Loader $e) { + if (!$ignoreMissing) { + throw $e; + } + } + + if ($isSandboxed && !$alreadySandboxed) { + $sandbox->disableSandbox(); + } } /** - * Checks if a variable is defined in the current context. - * - * <pre> - * {# defined works with variable names #} - * {% if foo is defined %} - * {# ... #} - * {% endif %} - * </pre> + * Provides the ability to get constants from instances as well as class/global constants. * - * @param mixed $name A PHP variable - * @param array $context The current context + * @param string $constant The name of the constant + * @param null|object $object The object to get the constant from * - * @return Boolean true if the value is defined, false otherwise + * @return string */ -function twig_test_defined($name, $context) +function twig_constant($constant, $object = null) { - return array_key_exists($name, $context); + if (null !== $object) { + $constant = get_class($object).'::'.$constant; + } + + return constant($constant); } /** - * Checks if a variable is empty. - * - * <pre> - * {# evaluates to true if the foo variable is null, false, or the empty string #} - * {% if foo is empty %} - * {# ... #} - * {% endif %} - * </pre> + * Batches item. * - * @param mixed $value A PHP variable + * @param array $items An array of items + * @param integer $size The size of the batch + * @param string $fill A string to fill missing items * - * @return Boolean true if the value is empty, false otherwise + * @return array */ -function twig_test_empty($value) +function twig_array_batch($items, $size, $fill = null) { - if ($value instanceof Countable) { - return 0 == count($value); + if ($items instanceof Traversable) { + $items = iterator_to_array($items, false); } - return false === $value || (empty($value) && '0' != $value); + + $size = ceil($size); + + $result = array_chunk($items, $size, true); + + if (null !== $fill) { + $last = count($result) - 1; + $result[$last] = array_merge( + $result[$last], + array_fill(0, $size - count($result[$last]), $fill) + ); + } + + return $result; } diff --git a/inc/lib/Twig/Extension/Debug.php b/inc/lib/Twig/Extension/Debug.php new file mode 100644 index 00000000..e3a85bfe --- /dev/null +++ b/inc/lib/Twig/Extension/Debug.php @@ -0,0 +1,71 @@ +<?php + +/* + * This file is part of Twig. + * + * (c) 2011 Fabien Potencier + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ +class Twig_Extension_Debug extends Twig_Extension +{ + /** + * Returns a list of global functions to add to the existing list. + * + * @return array An array of global functions + */ + public function getFunctions() + { + // dump is safe if var_dump is overridden by xdebug + $isDumpOutputHtmlSafe = extension_loaded('xdebug') + // false means that it was not set (and the default is on) or it explicitly enabled + && (false === ini_get('xdebug.overload_var_dump') || ini_get('xdebug.overload_var_dump')) + // false means that it was not set (and the default is on) or it explicitly enabled + // xdebug.overload_var_dump produces HTML only when html_errors is also enabled + && (false === ini_get('html_errors') || ini_get('html_errors')) + || 'cli' === php_sapi_name() + ; + + return array( + new Twig_SimpleFunction('dump', 'twig_var_dump', array('is_safe' => $isDumpOutputHtmlSafe ? array('html') : array(), 'needs_context' => true, 'needs_environment' => true)), + ); + } + + /** + * Returns the name of the extension. + * + * @return string The extension name + */ + public function getName() + { + return 'debug'; + } +} + +function twig_var_dump(Twig_Environment $env, $context) +{ + if (!$env->isDebug()) { + return; + } + + ob_start(); + + $count = func_num_args(); + if (2 === $count) { + $vars = array(); + foreach ($context as $key => $value) { + if (!$value instanceof Twig_Template) { + $vars[$key] = $value; + } + } + + var_dump($vars); + } else { + for ($i = 2; $i < $count; $i++) { + var_dump(func_get_arg($i)); + } + } + + return ob_get_clean(); +} diff --git a/inc/lib/Twig/Extension/Escaper.php b/inc/lib/Twig/Extension/Escaper.php index 43ae1113..c9a7f68e 100644 --- a/inc/lib/Twig/Extension/Escaper.php +++ b/inc/lib/Twig/Extension/Escaper.php @@ -10,11 +10,11 @@ */ class Twig_Extension_Escaper extends Twig_Extension { - protected $autoescape; + protected $defaultStrategy; - public function __construct($autoescape = true) + public function __construct($defaultStrategy = 'html') { - $this->autoescape = $autoescape; + $this->setDefaultStrategy($defaultStrategy); } /** @@ -45,13 +45,44 @@ class Twig_Extension_Escaper extends Twig_Extension public function getFilters() { return array( - 'raw' => new Twig_Filter_Function('twig_raw_filter', array('is_safe' => array('all'))), + new Twig_SimpleFilter('raw', 'twig_raw_filter', array('is_safe' => array('all'))), ); } - public function isGlobal() + /** + * Sets the default strategy to use when not defined by the user. + * + * The strategy can be a valid PHP callback that takes the template + * "filename" as an argument and returns the strategy to use. + * + * @param mixed $defaultStrategy An escaping strategy + */ + public function setDefaultStrategy($defaultStrategy) + { + // for BC + if (true === $defaultStrategy) { + $defaultStrategy = 'html'; + } + + $this->defaultStrategy = $defaultStrategy; + } + + /** + * Gets the default strategy to use when not defined by the user. + * + * @param string $filename The template "filename" + * + * @return string The default strategy to use for the template + */ + public function getDefaultStrategy($filename) { - return $this->autoescape; + // disable string callables to avoid calling a function named html or js, + // or any other upcoming escaping strategy + if (!is_string($this->defaultStrategy) && is_callable($this->defaultStrategy)) { + return call_user_func($this->defaultStrategy, $filename); + } + + return $this->defaultStrategy; } /** @@ -74,4 +105,3 @@ function twig_raw_filter($string) { return $string; } - diff --git a/inc/lib/Twig/Extension/Staging.php b/inc/lib/Twig/Extension/Staging.php new file mode 100644 index 00000000..8ab0f459 --- /dev/null +++ b/inc/lib/Twig/Extension/Staging.php @@ -0,0 +1,113 @@ +<?php + +/* + * This file is part of Twig. + * + * (c) 2012 Fabien Potencier + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/** + * Internal class. + * + * This class is used by Twig_Environment as a staging area and must not be used directly. + * + * @author Fabien Potencier <fabien@symfony.com> + */ +class Twig_Extension_Staging extends Twig_Extension +{ + protected $functions = array(); + protected $filters = array(); + protected $visitors = array(); + protected $tokenParsers = array(); + protected $globals = array(); + protected $tests = array(); + + public function addFunction($name, $function) + { + $this->functions[$name] = $function; + } + + /** + * {@inheritdoc} + */ + public function getFunctions() + { + return $this->functions; + } + + public function addFilter($name, $filter) + { + $this->filters[$name] = $filter; + } + + /** + * {@inheritdoc} + */ + public function getFilters() + { + return $this->filters; + } + + public function addNodeVisitor(Twig_NodeVisitorInterface $visitor) + { + $this->visitors[] = $visitor; + } + + /** + * {@inheritdoc} + */ + public function getNodeVisitors() + { + return $this->visitors; + } + + public function addTokenParser(Twig_TokenParserInterface $parser) + { + $this->tokenParsers[] = $parser; + } + + /** + * {@inheritdoc} + */ + public function getTokenParsers() + { + return $this->tokenParsers; + } + + public function addGlobal($name, $value) + { + $this->globals[$name] = $value; + } + + /** + * {@inheritdoc} + */ + public function getGlobals() + { + return $this->globals; + } + + public function addTest($name, $test) + { + $this->tests[$name] = $test; + } + + /** + * {@inheritdoc} + */ + public function getTests() + { + return $this->tests; + } + + /** + * {@inheritdoc} + */ + public function getName() + { + return 'staging'; + } +} diff --git a/inc/lib/Twig/Extension/StringLoader.php b/inc/lib/Twig/Extension/StringLoader.php new file mode 100644 index 00000000..20f3f994 --- /dev/null +++ b/inc/lib/Twig/Extension/StringLoader.php @@ -0,0 +1,64 @@ +<?php + +/* + * This file is part of Twig. + * + * (c) 2012 Fabien Potencier + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ +class Twig_Extension_StringLoader extends Twig_Extension +{ + /** + * {@inheritdoc} + */ + public function getFunctions() + { + return array( + new Twig_SimpleFunction('template_from_string', 'twig_template_from_string', array('needs_environment' => true)), + ); + } + + /** + * {@inheritdoc} + */ + public function getName() + { + return 'string_loader'; + } +} + +/** + * Loads a template from a string. + * + * <pre> + * {{ include(template_from_string("Hello {{ name }}")) }} + * </pre> + * + * @param Twig_Environment $env A Twig_Environment instance + * @param string $template A template as a string + * + * @return Twig_Template A Twig_Template instance + */ +function twig_template_from_string(Twig_Environment $env, $template) +{ + static $loader; + + if (null === $loader) { + $loader = new Twig_Loader_String(); + } + + $current = $env->getLoader(); + $env->setLoader($loader); + try { + $template = $env->loadTemplate($template); + } catch (Exception $e) { + $env->setLoader($current); + + throw $e; + } + $env->setLoader($current); + + return $template; +} diff --git a/inc/lib/Twig/ExtensionInterface.php b/inc/lib/Twig/ExtensionInterface.php index f8b232a5..f189e9d9 100644 --- a/inc/lib/Twig/ExtensionInterface.php +++ b/inc/lib/Twig/ExtensionInterface.php @@ -12,8 +12,7 @@ /** * Interface implemented by extension classes. * - * @package twig - * @author Fabien Potencier <fabien@symfony.com> + * @author Fabien Potencier <fabien@symfony.com> */ interface Twig_ExtensionInterface { @@ -24,61 +23,61 @@ interface Twig_ExtensionInterface * * @param Twig_Environment $environment The current Twig_Environment instance */ - function initRuntime(Twig_Environment $environment); + public function initRuntime(Twig_Environment $environment); /** * Returns the token parser instances to add to the existing list. * * @return array An array of Twig_TokenParserInterface or Twig_TokenParserBrokerInterface instances */ - function getTokenParsers(); + public function getTokenParsers(); /** * Returns the node visitor instances to add to the existing list. * * @return array An array of Twig_NodeVisitorInterface instances */ - function getNodeVisitors(); + public function getNodeVisitors(); /** * Returns a list of filters to add to the existing list. * * @return array An array of filters */ - function getFilters(); + public function getFilters(); /** * Returns a list of tests to add to the existing list. * * @return array An array of tests */ - function getTests(); + public function getTests(); /** * Returns a list of functions to add to the existing list. * * @return array An array of functions */ - function getFunctions(); + public function getFunctions(); /** * Returns a list of operators to add to the existing list. * * @return array An array of operators */ - function getOperators(); + public function getOperators(); /** - * Returns a list of global functions to add to the existing list. + * Returns a list of global variables to add to the existing list. * - * @return array An array of global functions + * @return array An array of global variables */ - function getGlobals(); + public function getGlobals(); /** * Returns the name of the extension. * * @return string The extension name */ - function getName(); + public function getName(); } diff --git a/inc/lib/Twig/Extensions/Extension/I18n.php b/inc/lib/Twig/Extensions/Extension/I18n.php index 1f795490..bc6a05bd 100644 --- a/inc/lib/Twig/Extensions/Extension/I18n.php +++ b/inc/lib/Twig/Extensions/Extension/I18n.php @@ -28,7 +28,7 @@ class Twig_Extensions_Extension_I18n extends Twig_Extension public function getFilters() { return array( - 'trans' => new Twig_Filter_Function('gettext'), + new Twig_SimpleFilter('trans', 'gettext'), ); } diff --git a/inc/lib/Twig/Extensions/Extension/Tinyboard.php b/inc/lib/Twig/Extensions/Extension/Tinyboard.php index 61cf9fc9..727d5d2c 100644 --- a/inc/lib/Twig/Extensions/Extension/Tinyboard.php +++ b/inc/lib/Twig/Extensions/Extension/Tinyboard.php @@ -9,24 +9,23 @@ class Twig_Extensions_Extension_Tinyboard extends Twig_Extension */ public function getFilters() { - return Array( - 'filesize' => new Twig_Filter_Function('format_bytes'), - 'truncate' => new Twig_Filter_Function('twig_truncate_filter'), - 'truncate_body' => new Twig_Filter_Function('truncate'), - 'extension' => new Twig_Filter_Function('twig_extension_filter'), - 'sprintf' => new Twig_Filter_Function('sprintf'), - 'capcode' => new Twig_Filter_Function('capcode'), - 'hasPermission' => new Twig_Filter_Function('twig_hasPermission_filter'), - 'date' => new Twig_Filter_Function('twig_date_filter'), - 'poster_id' => new Twig_Filter_Function('poster_id'), - 'remove_whitespace' => new Twig_Filter_Function('twig_remove_whitespace_filter'), - 'count' => new Twig_Filter_Function('count'), - 'ago' => new Twig_Filter_Function('ago'), - 'until' => new Twig_Filter_Function('until'), - 'split' => new Twig_Filter_Function('twig_split_filter'), - 'push' => new Twig_Filter_Function('twig_push_filter'), - 'bidi_cleanup' => new Twig_Filter_Function('bidi_cleanup'), - 'addslashes' => new Twig_Filter_Function('addslashes') + return array( + new Twig_SimpleFilter('filesize', 'format_bytes'), + new Twig_SimpleFilter('truncate', 'twig_truncate_filter'), + new Twig_SimpleFilter('truncate_body', 'truncate'), + new Twig_SimpleFilter('extension', 'twig_extension_filter'), + new Twig_SimpleFilter('sprintf', 'sprintf'), + new Twig_SimpleFilter('capcode', 'capcode'), + new Twig_SimpleFilter('hasPermission', 'twig_hasPermission_filter'), + new Twig_SimpleFilter('date', 'twig_date_filter'), + new Twig_SimpleFilter('poster_id', 'poster_id'), + new Twig_SimpleFilter('remove_whitespace', 'twig_remove_whitespace_filter'), + new Twig_SimpleFilter('count', 'count'), + new Twig_SimpleFilter('ago', 'ago'), + new Twig_SimpleFilter('until', 'until'), + new Twig_SimpleFilter('push', 'twig_push_filter'), + new Twig_SimpleFilter('bidi_cleanup', 'bidi_cleanup'), + new Twig_SimpleFilter('addslashes', 'addslashes') ); } @@ -37,12 +36,12 @@ class Twig_Extensions_Extension_Tinyboard extends Twig_Extension */ public function getFunctions() { - return Array( - 'time' => new Twig_Filter_Function('time'), - 'floor' => new Twig_Filter_Function('floor'), - 'timezone' => new Twig_Filter_Function('twig_timezone_function'), - 'hiddenInputs' => new Twig_Filter_Function('hiddenInputs'), - 'hiddenInputsHash' => new Twig_Filter_Function('hiddenInputsHash'), + return array( + new Twig_SimpleFunction('time', 'time'), + new Twig_SimpleFunction('floor', 'floor'), + new Twig_SimpleFunction('timezone', 'twig_timezone_function'), + new Twig_SimpleFunction('hiddenInputs', 'hiddenInputs'), + new Twig_SimpleFunction('hiddenInputsHash', 'hiddenInputsHash'), ); } @@ -61,10 +60,6 @@ function twig_timezone_function() { return 'Z'; } -function twig_split_filter($str, $delim) { - return explode($delim, $str); -} - function twig_push_filter($array, $value) { array_push($array, $value); return $array; @@ -83,9 +78,9 @@ function twig_hasPermission_filter($mod, $permission, $board = null) { } function twig_extension_filter($value, $case_insensitive = true) { - $ext = substr($value, strrpos($value, '.') + 1); + $ext = mb_substr($value, mb_strrpos($value, '.') + 1); if($case_insensitive) - $ext = strtolower($ext); + $ext = mb_strtolower($ext); return $ext; } @@ -96,11 +91,11 @@ function twig_sprintf_filter( $value, $var) { function twig_truncate_filter($value, $length = 30, $preserve = false, $separator = '…') { if (mb_strlen($value) > $length) { if ($preserve) { - if (false !== ($breakpoint = strpos($value, ' ', $length))) { + if (false !== ($breakpoint = mb_strpos($value, ' ', $length))) { $length = $breakpoint; } } - return substr($value, 0, $length) . $separator; + return mb_substr($value, 0, $length) . $separator; } return $value; } diff --git a/inc/lib/Twig/Extensions/Node/Trans.php b/inc/lib/Twig/Extensions/Node/Trans.php index 18087e77..e7dc1ca8 100644 --- a/inc/lib/Twig/Extensions/Node/Trans.php +++ b/inc/lib/Twig/Extensions/Node/Trans.php @@ -94,22 +94,25 @@ class Twig_Extensions_Node_Trans extends Twig_Node ; } - $compiler->raw(');'); + $compiler->raw(");\n"); } } protected function compileString(Twig_NodeInterface $body) { - if ($body instanceof Twig_Node_Expression_Name || $body instanceof Twig_Node_Expression_Constant) { + if ($body instanceof Twig_Node_Expression_Name || $body instanceof Twig_Node_Expression_Constant || $body instanceof Twig_Node_Expression_TempName) { return array($body, array()); } $vars = array(); - if (count($body)) { $msg = ''; foreach ($body as $node) { + if (get_class($node) === 'Twig_Node' && $node->getNode(0) instanceof Twig_Node_SetTemp) { + $node = $node->getNode(1); + } + if ($node instanceof Twig_Node_Print) { $n = $node->getNode('expr'); while ($n instanceof Twig_Node_Expression_Filter) { @@ -127,4 +130,4 @@ class Twig_Extensions_Node_Trans extends Twig_Node return array(new Twig_Node(array(new Twig_Node_Expression_Constant(trim($msg), $body->getLine()))), $vars); } -} +}
\ No newline at end of file diff --git a/inc/lib/Twig/Extensions/TokenParser/Trans.php b/inc/lib/Twig/Extensions/TokenParser/Trans.php index 5b2d93b6..4a0fad41 100644 --- a/inc/lib/Twig/Extensions/TokenParser/Trans.php +++ b/inc/lib/Twig/Extensions/TokenParser/Trans.php @@ -43,12 +43,12 @@ class Twig_Extensions_TokenParser_Trans extends Twig_TokenParser return new Twig_Extensions_Node_Trans($body, $plural, $count, $lineno, $this->getTag()); } - public function decideForFork($token) + public function decideForFork(Twig_Token $token) { return $token->test(array('plural', 'endtrans')); } - public function decideForEnd($token) + public function decideForEnd(Twig_Token $token) { return $token->test('endtrans'); } @@ -77,4 +77,4 @@ class Twig_Extensions_TokenParser_Trans extends Twig_TokenParser throw new Twig_Error_Syntax(sprintf('The text to be translated with "trans" can only contain references to simple variables'), $lineno); } } -} +}
\ No newline at end of file diff --git a/inc/lib/Twig/Filter.php b/inc/lib/Twig/Filter.php index 9595a1a8..5cfbb662 100644 --- a/inc/lib/Twig/Filter.php +++ b/inc/lib/Twig/Filter.php @@ -12,12 +12,15 @@ /** * Represents a template filter. * - * @package twig - * @author Fabien Potencier <fabien@symfony.com> + * Use Twig_SimpleFilter instead. + * + * @author Fabien Potencier <fabien@symfony.com> + * @deprecated since 1.12 (to be removed in 2.0) */ -abstract class Twig_Filter implements Twig_FilterInterface +abstract class Twig_Filter implements Twig_FilterInterface, Twig_FilterCallableInterface { protected $options; + protected $arguments = array(); public function __construct(array $options = array()) { @@ -25,9 +28,21 @@ abstract class Twig_Filter implements Twig_FilterInterface 'needs_environment' => false, 'needs_context' => false, 'pre_escape' => null, + 'preserves_safety' => null, + 'callable' => null, ), $options); } + public function setArguments($arguments) + { + $this->arguments = $arguments; + } + + public function getArguments() + { + return $this->arguments; + } + public function needsEnvironment() { return $this->options['needs_environment']; @@ -47,12 +62,20 @@ abstract class Twig_Filter implements Twig_FilterInterface if (isset($this->options['is_safe_callback'])) { return call_user_func($this->options['is_safe_callback'], $filterArgs); } + } - return array(); + public function getPreservesSafety() + { + return $this->options['preserves_safety']; } public function getPreEscape() { return $this->options['pre_escape']; } + + public function getCallable() + { + return $this->options['callable']; + } } diff --git a/inc/lib/Twig/Filter/Function.php b/inc/lib/Twig/Filter/Function.php index 1de078b2..ad374a55 100644 --- a/inc/lib/Twig/Filter/Function.php +++ b/inc/lib/Twig/Filter/Function.php @@ -12,8 +12,10 @@ /** * Represents a function template filter. * - * @package twig - * @author Fabien Potencier <fabien@symfony.com> + * Use Twig_SimpleFilter instead. + * + * @author Fabien Potencier <fabien@symfony.com> + * @deprecated since 1.12 (to be removed in 2.0) */ class Twig_Filter_Function extends Twig_Filter { @@ -21,6 +23,8 @@ class Twig_Filter_Function extends Twig_Filter public function __construct($function, array $options = array()) { + $options['callable'] = $function; + parent::__construct($options); $this->function = $function; diff --git a/inc/lib/Twig/Filter/Method.php b/inc/lib/Twig/Filter/Method.php index d831e0f2..63c8c3be 100644 --- a/inc/lib/Twig/Filter/Method.php +++ b/inc/lib/Twig/Filter/Method.php @@ -12,15 +12,20 @@ /** * Represents a method template filter. * - * @package twig - * @author Fabien Potencier <fabien@symfony.com> + * Use Twig_SimpleFilter instead. + * + * @author Fabien Potencier <fabien@symfony.com> + * @deprecated since 1.12 (to be removed in 2.0) */ class Twig_Filter_Method extends Twig_Filter { - protected $extension, $method; + protected $extension; + protected $method; public function __construct(Twig_ExtensionInterface $extension, $method, array $options = array()) { + $options['callable'] = array($extension, $method); + parent::__construct($options); $this->extension = $extension; diff --git a/inc/lib/Twig/Filter/Node.php b/inc/lib/Twig/Filter/Node.php new file mode 100644 index 00000000..8744c5e0 --- /dev/null +++ b/inc/lib/Twig/Filter/Node.php @@ -0,0 +1,39 @@ +<?php + +/* + * This file is part of Twig. + * + * (c) 2011 Fabien Potencier + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/** + * Represents a template filter as a node. + * + * Use Twig_SimpleFilter instead. + * + * @author Fabien Potencier <fabien@symfony.com> + * @deprecated since 1.12 (to be removed in 2.0) + */ +class Twig_Filter_Node extends Twig_Filter +{ + protected $class; + + public function __construct($class, array $options = array()) + { + parent::__construct($options); + + $this->class = $class; + } + + public function getClass() + { + return $this->class; + } + + public function compile() + { + } +} diff --git a/inc/lib/Twig/FilterCallableInterface.php b/inc/lib/Twig/FilterCallableInterface.php new file mode 100644 index 00000000..145534df --- /dev/null +++ b/inc/lib/Twig/FilterCallableInterface.php @@ -0,0 +1,23 @@ +<?php + +/* + * This file is part of Twig. + * + * (c) 2012 Fabien Potencier + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/** + * Represents a callable template filter. + * + * Use Twig_SimpleFilter instead. + * + * @author Fabien Potencier <fabien@symfony.com> + * @deprecated since 1.12 (to be removed in 2.0) + */ +interface Twig_FilterCallableInterface +{ + public function getCallable(); +} diff --git a/inc/lib/Twig/FilterInterface.php b/inc/lib/Twig/FilterInterface.php index 4ac19ceb..5319ecc9 100644 --- a/inc/lib/Twig/FilterInterface.php +++ b/inc/lib/Twig/FilterInterface.php @@ -12,8 +12,10 @@ /** * Represents a template filter. * - * @package twig - * @author Fabien Potencier <fabien@symfony.com> + * Use Twig_SimpleFilter instead. + * + * @author Fabien Potencier <fabien@symfony.com> + * @deprecated since 1.12 (to be removed in 2.0) */ interface Twig_FilterInterface { @@ -22,13 +24,19 @@ interface Twig_FilterInterface * * @return string The PHP code for the filter */ - function compile(); + public function compile(); + + public function needsEnvironment(); + + public function needsContext(); + + public function getSafe(Twig_Node $filterArgs); - function needsEnvironment(); + public function getPreservesSafety(); - function needsContext(); + public function getPreEscape(); - function getSafe(Twig_Node $filterArgs); + public function setArguments($arguments); - function getPreEscape(); + public function getArguments(); } diff --git a/inc/lib/Twig/Function.php b/inc/lib/Twig/Function.php index 1197924a..b5ffb2b0 100644 --- a/inc/lib/Twig/Function.php +++ b/inc/lib/Twig/Function.php @@ -12,21 +12,35 @@ /** * Represents a template function. * - * @package twig - * @author Fabien Potencier <fabien@symfony.com> + * Use Twig_SimpleFunction instead. + * + * @author Fabien Potencier <fabien@symfony.com> + * @deprecated since 1.12 (to be removed in 2.0) */ -abstract class Twig_Function implements Twig_FunctionInterface +abstract class Twig_Function implements Twig_FunctionInterface, Twig_FunctionCallableInterface { protected $options; + protected $arguments = array(); public function __construct(array $options = array()) { $this->options = array_merge(array( 'needs_environment' => false, 'needs_context' => false, + 'callable' => null, ), $options); } + public function setArguments($arguments) + { + $this->arguments = $arguments; + } + + public function getArguments() + { + return $this->arguments; + } + public function needsEnvironment() { return $this->options['needs_environment']; @@ -49,4 +63,9 @@ abstract class Twig_Function implements Twig_FunctionInterface return array(); } + + public function getCallable() + { + return $this->options['callable']; + } } diff --git a/inc/lib/Twig/Function/Function.php b/inc/lib/Twig/Function/Function.php index 3237d8c5..d1e1b96a 100644 --- a/inc/lib/Twig/Function/Function.php +++ b/inc/lib/Twig/Function/Function.php @@ -13,8 +13,10 @@ /** * Represents a function template function. * - * @package twig - * @author Arnaud Le Blanc <arnaud.lb@gmail.com> + * Use Twig_SimpleFunction instead. + * + * @author Arnaud Le Blanc <arnaud.lb@gmail.com> + * @deprecated since 1.12 (to be removed in 2.0) */ class Twig_Function_Function extends Twig_Function { @@ -22,6 +24,8 @@ class Twig_Function_Function extends Twig_Function public function __construct($function, array $options = array()) { + $options['callable'] = $function; + parent::__construct($options); $this->function = $function; diff --git a/inc/lib/Twig/Function/Method.php b/inc/lib/Twig/Function/Method.php index 7328566e..67039a95 100644 --- a/inc/lib/Twig/Function/Method.php +++ b/inc/lib/Twig/Function/Method.php @@ -13,15 +13,20 @@ /** * Represents a method template function. * - * @package twig - * @author Arnaud Le Blanc <arnaud.lb@gmail.com> + * Use Twig_SimpleFunction instead. + * + * @author Arnaud Le Blanc <arnaud.lb@gmail.com> + * @deprecated since 1.12 (to be removed in 2.0) */ class Twig_Function_Method extends Twig_Function { - protected $extension, $method; + protected $extension; + protected $method; public function __construct(Twig_ExtensionInterface $extension, $method, array $options = array()) { + $options['callable'] = array($extension, $method); + parent::__construct($options); $this->extension = $extension; diff --git a/inc/lib/Twig/Function/Node.php b/inc/lib/Twig/Function/Node.php new file mode 100644 index 00000000..06a0d0db --- /dev/null +++ b/inc/lib/Twig/Function/Node.php @@ -0,0 +1,39 @@ +<?php + +/* + * This file is part of Twig. + * + * (c) 2011 Fabien Potencier + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/** + * Represents a template function as a node. + * + * Use Twig_SimpleFunction instead. + * + * @author Fabien Potencier <fabien@symfony.com> + * @deprecated since 1.12 (to be removed in 2.0) + */ +class Twig_Function_Node extends Twig_Function +{ + protected $class; + + public function __construct($class, array $options = array()) + { + parent::__construct($options); + + $this->class = $class; + } + + public function getClass() + { + return $this->class; + } + + public function compile() + { + } +} diff --git a/inc/lib/Twig/FunctionCallableInterface.php b/inc/lib/Twig/FunctionCallableInterface.php new file mode 100644 index 00000000..0aab4f5e --- /dev/null +++ b/inc/lib/Twig/FunctionCallableInterface.php @@ -0,0 +1,23 @@ +<?php + +/* + * This file is part of Twig. + * + * (c) 2012 Fabien Potencier + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/** + * Represents a callable template function. + * + * Use Twig_SimpleFunction instead. + * + * @author Fabien Potencier <fabien@symfony.com> + * @deprecated since 1.12 (to be removed in 2.0) + */ +interface Twig_FunctionCallableInterface +{ + public function getCallable(); +} diff --git a/inc/lib/Twig/FunctionInterface.php b/inc/lib/Twig/FunctionInterface.php index ccc9fd93..67f4f89c 100644 --- a/inc/lib/Twig/FunctionInterface.php +++ b/inc/lib/Twig/FunctionInterface.php @@ -13,8 +13,10 @@ /** * Represents a template function. * - * @package twig - * @author Arnaud Le Blanc <arnaud.lb@gmail.com> + * Use Twig_SimpleFunction instead. + * + * @author Arnaud Le Blanc <arnaud.lb@gmail.com> + * @deprecated since 1.12 (to be removed in 2.0) */ interface Twig_FunctionInterface { @@ -23,11 +25,15 @@ interface Twig_FunctionInterface * * @return string The PHP code for the function */ - function compile(); + public function compile(); + + public function needsEnvironment(); + + public function needsContext(); - function needsEnvironment(); + public function getSafe(Twig_Node $filterArgs); - function needsContext(); + public function setArguments($arguments); - function getSafe(Twig_Node $filterArgs); + public function getArguments(); } diff --git a/inc/lib/Twig/Lexer.php b/inc/lib/Twig/Lexer.php index 868a814e..000b038e 100644 --- a/inc/lib/Twig/Lexer.php +++ b/inc/lib/Twig/Lexer.php @@ -13,8 +13,7 @@ /** * Lexes a template string. * - * @package twig - * @author Fabien Potencier <fabien@symfony.com> + * @author Fabien Potencier <fabien@symfony.com> */ class Twig_Lexer implements Twig_LexerInterface { @@ -24,21 +23,28 @@ class Twig_Lexer implements Twig_LexerInterface protected $lineno; protected $end; protected $state; + protected $states; protected $brackets; - protected $env; protected $filename; protected $options; - protected $operatorRegex; + protected $regexes; + protected $position; + protected $positions; + protected $currentVarBlockLine; - const STATE_DATA = 0; - const STATE_BLOCK = 1; - const STATE_VAR = 2; + const STATE_DATA = 0; + const STATE_BLOCK = 1; + const STATE_VAR = 2; + const STATE_STRING = 3; + const STATE_INTERPOLATION = 4; - const REGEX_NAME = '/[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*/A'; - const REGEX_NUMBER = '/[0-9]+(?:\.[0-9]+)?/A'; - const REGEX_STRING = '/"([^"\\\\]*(?:\\\\.[^"\\\\]*)*)"|\'([^\'\\\\]*(?:\\\\.[^\'\\\\]*)*)\'/As'; - const PUNCTUATION = '()[]{}?:.,|'; + const REGEX_NAME = '/[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*/A'; + const REGEX_NUMBER = '/[0-9]+(?:\.[0-9]+)?/A'; + const REGEX_STRING = '/"([^#"\\\\]*(?:\\\\.[^#"\\\\]*)*)"|\'([^\'\\\\]*(?:\\\\.[^\'\\\\]*)*)\'/As'; + const REGEX_DQ_STRING_DELIM = '/"/A'; + const REGEX_DQ_STRING_PART = '/[^#"\\\\]*(?:(?:\\\\.|#(?!\{))[^#"\\\\]*)*/As'; + const PUNCTUATION = '()[]{}?:.,|'; public function __construct(Twig_Environment $env, array $options = array()) { @@ -49,14 +55,28 @@ class Twig_Lexer implements Twig_LexerInterface 'tag_block' => array('{%', '%}'), 'tag_variable' => array('{{', '}}'), 'whitespace_trim' => '-', + 'interpolation' => array('#{', '}'), ), $options); + + $this->regexes = array( + 'lex_var' => '/\s*'.preg_quote($this->options['whitespace_trim'].$this->options['tag_variable'][1], '/').'\s*|\s*'.preg_quote($this->options['tag_variable'][1], '/').'/A', + 'lex_block' => '/\s*(?:'.preg_quote($this->options['whitespace_trim'].$this->options['tag_block'][1], '/').'\s*|\s*'.preg_quote($this->options['tag_block'][1], '/').')\n?/A', + 'lex_raw_data' => '/('.preg_quote($this->options['tag_block'][0].$this->options['whitespace_trim'], '/').'|'.preg_quote($this->options['tag_block'][0], '/').')\s*(?:end%s)\s*(?:'.preg_quote($this->options['whitespace_trim'].$this->options['tag_block'][1], '/').'\s*|\s*'.preg_quote($this->options['tag_block'][1], '/').')/s', + 'operator' => $this->getOperatorRegex(), + 'lex_comment' => '/(?:'.preg_quote($this->options['whitespace_trim'], '/').preg_quote($this->options['tag_comment'][1], '/').'\s*|'.preg_quote($this->options['tag_comment'][1], '/').')\n?/s', + 'lex_block_raw' => '/\s*(raw|verbatim)\s*(?:'.preg_quote($this->options['whitespace_trim'].$this->options['tag_block'][1], '/').'\s*|\s*'.preg_quote($this->options['tag_block'][1], '/').')/As', + 'lex_block_line' => '/\s*line\s+(\d+)\s*'.preg_quote($this->options['tag_block'][1], '/').'/As', + 'lex_tokens_start' => '/('.preg_quote($this->options['tag_variable'][0], '/').'|'.preg_quote($this->options['tag_block'][0], '/').'|'.preg_quote($this->options['tag_comment'][0], '/').')('.preg_quote($this->options['whitespace_trim'], '/').')?/s', + 'interpolation_start' => '/'.preg_quote($this->options['interpolation'][0], '/').'\s*/A', + 'interpolation_end' => '/\s*'.preg_quote($this->options['interpolation'][1], '/').'/A', + ); } /** * Tokenizes a source code. * - * @param string $code The source code - * @param string $filename A unique identifier for the source code + * @param string $code The source code + * @param string $filename A unique identifier for the source code * * @return Twig_TokenStream A token stream instance */ @@ -74,7 +94,13 @@ class Twig_Lexer implements Twig_LexerInterface $this->end = strlen($this->code); $this->tokens = array(); $this->state = self::STATE_DATA; + $this->states = array(); $this->brackets = array(); + $this->position = -1; + + // find all token starts in one go + preg_match_all($this->regexes['lex_tokens_start'], $this->code, $matches, PREG_OFFSET_CAPTURE); + $this->positions = $matches; while ($this->cursor < $this->end) { // dispatch to the lexing functions depending @@ -91,6 +117,14 @@ class Twig_Lexer implements Twig_LexerInterface case self::STATE_VAR: $this->lexVar(); break; + + case self::STATE_STRING: + $this->lexString(); + break; + + case self::STATE_INTERPOLATION: + $this->lexInterpolation(); + break; } } @@ -110,77 +144,66 @@ class Twig_Lexer implements Twig_LexerInterface protected function lexData() { - $pos = $this->end; - $append = ''; - - // Find the first token after the cursor - foreach (array('tag_comment', 'tag_variable', 'tag_block') as $type) { - $tmpPos = strpos($this->code, $this->options[$type][0], $this->cursor); - if (false !== $tmpPos && $tmpPos < $pos) { - $trimBlock = false; - $append = ''; - $pos = $tmpPos; - $token = $this->options[$type][0]; - if (strpos($this->code, $this->options['whitespace_trim'], $pos) === ($pos + strlen($token))) { - $trimBlock = true; - $append = $this->options['whitespace_trim']; - } - } - } - // if no matches are left we return the rest of the template as simple text token - if ($pos === $this->end) { + if ($this->position == count($this->positions[0]) - 1) { $this->pushToken(Twig_Token::TEXT_TYPE, substr($this->code, $this->cursor)); $this->cursor = $this->end; + return; } + // Find the first token after the current cursor + $position = $this->positions[0][++$this->position]; + while ($position[1] < $this->cursor) { + if ($this->position == count($this->positions[0]) - 1) { + return; + } + $position = $this->positions[0][++$this->position]; + } + // push the template text first - $text = $textContent = substr($this->code, $this->cursor, $pos - $this->cursor); - if (true === $trimBlock) { + $text = $textContent = substr($this->code, $this->cursor, $position[1] - $this->cursor); + if (isset($this->positions[2][$this->position][0])) { $text = rtrim($text); } $this->pushToken(Twig_Token::TEXT_TYPE, $text); - $this->moveCursor($textContent.$token.$append); + $this->moveCursor($textContent.$position[0]); - switch ($token) { + switch ($this->positions[1][$this->position][0]) { case $this->options['tag_comment'][0]: $this->lexComment(); break; case $this->options['tag_block'][0]: // raw data? - if (preg_match('/\s*raw\s*'.preg_quote($this->options['tag_block'][1], '/').'/As', $this->code, $match, null, $this->cursor)) { + if (preg_match($this->regexes['lex_block_raw'], $this->code, $match, null, $this->cursor)) { $this->moveCursor($match[0]); - $this->lexRawData(); - $this->state = self::STATE_DATA; + $this->lexRawData($match[1]); // {% line \d+ %} - } else if (preg_match('/\s*line\s+(\d+)\s*'.preg_quote($this->options['tag_block'][1], '/').'/As', $this->code, $match, null, $this->cursor)) { + } elseif (preg_match($this->regexes['lex_block_line'], $this->code, $match, null, $this->cursor)) { $this->moveCursor($match[0]); $this->lineno = (int) $match[1]; - $this->state = self::STATE_DATA; } else { $this->pushToken(Twig_Token::BLOCK_START_TYPE); - $this->state = self::STATE_BLOCK; + $this->pushState(self::STATE_BLOCK); + $this->currentVarBlockLine = $this->lineno; } break; case $this->options['tag_variable'][0]: $this->pushToken(Twig_Token::VAR_START_TYPE); - $this->state = self::STATE_VAR; + $this->pushState(self::STATE_VAR); + $this->currentVarBlockLine = $this->lineno; break; } } protected function lexBlock() { - $trimTag = preg_quote($this->options['whitespace_trim'].$this->options['tag_block'][1], '/'); - $endTag = preg_quote($this->options['tag_block'][1], '/'); - - if (empty($this->brackets) && preg_match('/\s*(?:'.$trimTag.'\s*|\s*'.$endTag.')\n?/A', $this->code, $match, null, $this->cursor)) { + if (empty($this->brackets) && preg_match($this->regexes['lex_block'], $this->code, $match, null, $this->cursor)) { $this->pushToken(Twig_Token::BLOCK_END_TYPE); $this->moveCursor($match[0]); - $this->state = self::STATE_DATA; + $this->popState(); } else { $this->lexExpression(); } @@ -188,13 +211,10 @@ class Twig_Lexer implements Twig_LexerInterface protected function lexVar() { - $trimTag = preg_quote($this->options['whitespace_trim'].$this->options['tag_variable'][1], '/'); - $endTag = preg_quote($this->options['tag_variable'][1], '/'); - - if (empty($this->brackets) && preg_match('/\s*'.$trimTag.'\s*|\s*'.$endTag.'/A', $this->code, $match, null, $this->cursor)) { + if (empty($this->brackets) && preg_match($this->regexes['lex_var'], $this->code, $match, null, $this->cursor)) { $this->pushToken(Twig_Token::VAR_END_TYPE); $this->moveCursor($match[0]); - $this->state = self::STATE_DATA; + $this->popState(); } else { $this->lexExpression(); } @@ -207,12 +227,12 @@ class Twig_Lexer implements Twig_LexerInterface $this->moveCursor($match[0]); if ($this->cursor >= $this->end) { - throw new Twig_Error_Syntax(sprintf('Unexpected end of file: Unclosed "%s"', $this->state === self::STATE_BLOCK ? 'block' : 'variable')); + throw new Twig_Error_Syntax(sprintf('Unclosed "%s"', $this->state === self::STATE_BLOCK ? 'block' : 'variable'), $this->currentVarBlockLine, $this->filename); } } // operators - if (preg_match($this->getOperatorRegex(), $this->code, $match, null, $this->cursor)) { + if (preg_match($this->regexes['operator'], $this->code, $match, null, $this->cursor)) { $this->pushToken(Twig_Token::OPERATOR_TYPE, $match[0]); $this->moveCursor($match[0]); } @@ -223,7 +243,11 @@ class Twig_Lexer implements Twig_LexerInterface } // numbers elseif (preg_match(self::REGEX_NUMBER, $this->code, $match, null, $this->cursor)) { - $this->pushToken(Twig_Token::NUMBER_TYPE, ctype_digit($match[0]) ? (int) $match[0] : (float) $match[0]); + $number = (float) $match[0]; // floats + if (ctype_digit($match[0]) && $number <= PHP_INT_MAX) { + $number = (int) $match[0]; // integers lower than the maximum + } + $this->pushToken(Twig_Token::NUMBER_TYPE, $number); $this->moveCursor($match[0]); } // punctuation @@ -252,35 +276,80 @@ class Twig_Lexer implements Twig_LexerInterface $this->pushToken(Twig_Token::STRING_TYPE, stripcslashes(substr($match[0], 1, -1))); $this->moveCursor($match[0]); } + // opening double quoted string + elseif (preg_match(self::REGEX_DQ_STRING_DELIM, $this->code, $match, null, $this->cursor)) { + $this->brackets[] = array('"', $this->lineno); + $this->pushState(self::STATE_STRING); + $this->moveCursor($match[0]); + } // unlexable else { throw new Twig_Error_Syntax(sprintf('Unexpected character "%s"', $this->code[$this->cursor]), $this->lineno, $this->filename); } } - protected function lexRawData() + protected function lexRawData($tag) { - if (!preg_match('/'.preg_quote($this->options['tag_block'][0], '/').'\s*endraw\s*'.preg_quote($this->options['tag_block'][1], '/').'/s', $this->code, $match, PREG_OFFSET_CAPTURE, $this->cursor)) { - throw new Twig_Error_Syntax(sprintf('Unexpected end of file: Unclosed "block"')); + if (!preg_match(str_replace('%s', $tag, $this->regexes['lex_raw_data']), $this->code, $match, PREG_OFFSET_CAPTURE, $this->cursor)) { + throw new Twig_Error_Syntax(sprintf('Unexpected end of file: Unclosed "%s" block', $tag), $this->lineno, $this->filename); } + $text = substr($this->code, $this->cursor, $match[0][1] - $this->cursor); - $this->pushToken(Twig_Token::TEXT_TYPE, $text); $this->moveCursor($text.$match[0][0]); + + if (false !== strpos($match[1][0], $this->options['whitespace_trim'])) { + $text = rtrim($text); + } + + $this->pushToken(Twig_Token::TEXT_TYPE, $text); } protected function lexComment() { - $commentEndRegex = '/(?:'.preg_quote($this->options['whitespace_trim'], '/') - .preg_quote($this->options['tag_comment'][1], '/').'\s*|' - .preg_quote($this->options['tag_comment'][1], '/').')\n?/s'; - - if (!preg_match($commentEndRegex, $this->code, $match, PREG_OFFSET_CAPTURE, $this->cursor)) { + if (!preg_match($this->regexes['lex_comment'], $this->code, $match, PREG_OFFSET_CAPTURE, $this->cursor)) { throw new Twig_Error_Syntax('Unclosed comment', $this->lineno, $this->filename); } $this->moveCursor(substr($this->code, $this->cursor, $match[0][1] - $this->cursor).$match[0][0]); } + protected function lexString() + { + if (preg_match($this->regexes['interpolation_start'], $this->code, $match, null, $this->cursor)) { + $this->brackets[] = array($this->options['interpolation'][0], $this->lineno); + $this->pushToken(Twig_Token::INTERPOLATION_START_TYPE); + $this->moveCursor($match[0]); + $this->pushState(self::STATE_INTERPOLATION); + + } elseif (preg_match(self::REGEX_DQ_STRING_PART, $this->code, $match, null, $this->cursor) && strlen($match[0]) > 0) { + $this->pushToken(Twig_Token::STRING_TYPE, stripcslashes($match[0])); + $this->moveCursor($match[0]); + + } elseif (preg_match(self::REGEX_DQ_STRING_DELIM, $this->code, $match, null, $this->cursor)) { + + list($expect, $lineno) = array_pop($this->brackets); + if ($this->code[$this->cursor] != '"') { + throw new Twig_Error_Syntax(sprintf('Unclosed "%s"', $expect), $lineno, $this->filename); + } + + $this->popState(); + ++$this->cursor; + } + } + + protected function lexInterpolation() + { + $bracket = end($this->brackets); + if ($this->options['interpolation'][0] === $bracket[0] && preg_match($this->regexes['interpolation_end'], $this->code, $match, null, $this->cursor)) { + array_pop($this->brackets); + $this->pushToken(Twig_Token::INTERPOLATION_END_TYPE); + $this->moveCursor($match[0]); + $this->popState(); + } else { + $this->lexExpression(); + } + } + protected function pushToken($type, $value = '') { // do not push empty text tokens @@ -299,10 +368,6 @@ class Twig_Lexer implements Twig_LexerInterface protected function getOperatorRegex() { - if (null !== $this->operatorRegex) { - return $this->operatorRegex; - } - $operators = array_merge( array('='), array_keys($this->env->getUnaryOperators()), @@ -317,12 +382,27 @@ class Twig_Lexer implements Twig_LexerInterface // an operator that ends with a character must be followed by // a whitespace or a parenthesis if (ctype_alpha($operator[$length - 1])) { - $regex[] = preg_quote($operator, '/').'(?=[ ()])'; + $regex[] = preg_quote($operator, '/').'(?=[\s()])'; } else { $regex[] = preg_quote($operator, '/'); } } - return $this->operatorRegex = '/'.implode('|', $regex).'/A'; + return '/'.implode('|', $regex).'/A'; + } + + protected function pushState($state) + { + $this->states[] = $this->state; + $this->state = $state; + } + + protected function popState() + { + if (0 === count($this->states)) { + throw new Exception('Cannot pop state without a previous state'); + } + + $this->state = array_pop($this->states); } } diff --git a/inc/lib/Twig/LexerInterface.php b/inc/lib/Twig/LexerInterface.php index 02233849..4b83f81b 100644 --- a/inc/lib/Twig/LexerInterface.php +++ b/inc/lib/Twig/LexerInterface.php @@ -12,18 +12,18 @@ /** * Interface implemented by lexer classes. * - * @package twig - * @author Fabien Potencier <fabien@symfony.com> + * @author Fabien Potencier <fabien@symfony.com> + * @deprecated since 1.12 (to be removed in 2.0) */ interface Twig_LexerInterface { /** * Tokenizes a source code. * - * @param string $code The source code - * @param string $filename A unique identifier for the source code + * @param string $code The source code + * @param string $filename A unique identifier for the source code * * @return Twig_TokenStream A token stream instance */ - function tokenize($code, $filename = null); + public function tokenize($code, $filename = null); } diff --git a/inc/lib/Twig/Loader/Array.php b/inc/lib/Twig/Loader/Array.php index e8dc1605..89087aea 100644 --- a/inc/lib/Twig/Loader/Array.php +++ b/inc/lib/Twig/Loader/Array.php @@ -17,10 +17,9 @@ * source code of the template). If you don't want to see your cache grows out of * control, you need to take care of clearing the old cache file by yourself. * - * @package twig - * @author Fabien Potencier <fabien@symfony.com> + * @author Fabien Potencier <fabien@symfony.com> */ -class Twig_Loader_Array implements Twig_LoaderInterface +class Twig_Loader_Array implements Twig_LoaderInterface, Twig_ExistsLoaderInterface { protected $templates; @@ -47,18 +46,15 @@ class Twig_Loader_Array implements Twig_LoaderInterface */ public function setTemplate($name, $template) { - $this->templates[$name] = $template; + $this->templates[(string) $name] = $template; } /** - * Gets the source code of a template, given its name. - * - * @param string $name The name of the template to load - * - * @return string The template source code + * {@inheritdoc} */ public function getSource($name) { + $name = (string) $name; if (!isset($this->templates[$name])) { throw new Twig_Error_Loader(sprintf('Template "%s" is not defined.', $name)); } @@ -67,14 +63,19 @@ class Twig_Loader_Array implements Twig_LoaderInterface } /** - * Gets the cache key to use for the cache for a given template name. - * - * @param string $name The name of the template to load - * - * @return string The cache key + * {@inheritdoc} + */ + public function exists($name) + { + return isset($this->templates[(string) $name]); + } + + /** + * {@inheritdoc} */ public function getCacheKey($name) { + $name = (string) $name; if (!isset($this->templates[$name])) { throw new Twig_Error_Loader(sprintf('Template "%s" is not defined.', $name)); } @@ -83,13 +84,15 @@ class Twig_Loader_Array implements Twig_LoaderInterface } /** - * Returns true if the template is still fresh. - * - * @param string $name The template name - * @param timestamp $time The last modification time of the cached template + * {@inheritdoc} */ public function isFresh($name, $time) { + $name = (string) $name; + if (!isset($this->templates[$name])) { + throw new Twig_Error_Loader(sprintf('Template "%s" is not defined.', $name)); + } + return true; } } diff --git a/inc/lib/Twig/Loader/Chain.php b/inc/lib/Twig/Loader/Chain.php index 48dd8b84..1f1cf065 100644 --- a/inc/lib/Twig/Loader/Chain.php +++ b/inc/lib/Twig/Loader/Chain.php @@ -12,11 +12,11 @@ /** * Loads templates from other loaders. * - * @package twig - * @author Fabien Potencier <fabien@symfony.com> + * @author Fabien Potencier <fabien@symfony.com> */ -class Twig_Loader_Chain implements Twig_LoaderInterface +class Twig_Loader_Chain implements Twig_LoaderInterface, Twig_ExistsLoaderInterface { + private $hasSourceCache = array(); protected $loaders; /** @@ -40,61 +40,100 @@ class Twig_Loader_Chain implements Twig_LoaderInterface public function addLoader(Twig_LoaderInterface $loader) { $this->loaders[] = $loader; + $this->hasSourceCache = array(); } /** - * Gets the source code of a template, given its name. - * - * @param string $name The name of the template to load - * - * @return string The template source code + * {@inheritdoc} */ public function getSource($name) { + $exceptions = array(); foreach ($this->loaders as $loader) { + if ($loader instanceof Twig_ExistsLoaderInterface && !$loader->exists($name)) { + continue; + } + try { return $loader->getSource($name); } catch (Twig_Error_Loader $e) { + $exceptions[] = $e->getMessage(); } } - throw new Twig_Error_Loader(sprintf('Template "%s" is not defined.', $name)); + throw new Twig_Error_Loader(sprintf('Template "%s" is not defined (%s).', $name, implode(', ', $exceptions))); } /** - * Gets the cache key to use for the cache for a given template name. - * - * @param string $name The name of the template to load - * - * @return string The cache key + * {@inheritdoc} + */ + public function exists($name) + { + $name = (string) $name; + + if (isset($this->hasSourceCache[$name])) { + return $this->hasSourceCache[$name]; + } + + foreach ($this->loaders as $loader) { + if ($loader instanceof Twig_ExistsLoaderInterface) { + if ($loader->exists($name)) { + return $this->hasSourceCache[$name] = true; + } + + continue; + } + + try { + $loader->getSource($name); + + return $this->hasSourceCache[$name] = true; + } catch (Twig_Error_Loader $e) { + } + } + + return $this->hasSourceCache[$name] = false; + } + + /** + * {@inheritdoc} */ public function getCacheKey($name) { + $exceptions = array(); foreach ($this->loaders as $loader) { + if ($loader instanceof Twig_ExistsLoaderInterface && !$loader->exists($name)) { + continue; + } + try { return $loader->getCacheKey($name); } catch (Twig_Error_Loader $e) { + $exceptions[] = get_class($loader).': '.$e->getMessage(); } } - throw new Twig_Error_Loader(sprintf('Template "%s" is not defined.', $name)); + throw new Twig_Error_Loader(sprintf('Template "%s" is not defined (%s).', $name, implode(' ', $exceptions))); } /** - * Returns true if the template is still fresh. - * - * @param string $name The template name - * @param timestamp $time The last modification time of the cached template + * {@inheritdoc} */ public function isFresh($name, $time) { + $exceptions = array(); foreach ($this->loaders as $loader) { + if ($loader instanceof Twig_ExistsLoaderInterface && !$loader->exists($name)) { + continue; + } + try { return $loader->isFresh($name, $time); } catch (Twig_Error_Loader $e) { + $exceptions[] = get_class($loader).': '.$e->getMessage(); } } - throw new Twig_Error_Loader(sprintf('Template "%s" is not defined.', $name)); + throw new Twig_Error_Loader(sprintf('Template "%s" is not defined (%s).', $name, implode(' ', $exceptions))); } } diff --git a/inc/lib/Twig/Loader/Filesystem.php b/inc/lib/Twig/Loader/Filesystem.php index be348aa3..f9211cbd 100644 --- a/inc/lib/Twig/Loader/Filesystem.php +++ b/inc/lib/Twig/Loader/Filesystem.php @@ -12,10 +12,9 @@ /** * Loads template from the filesystem. * - * @package twig - * @author Fabien Potencier <fabien@symfony.com> + * @author Fabien Potencier <fabien@symfony.com> */ -class Twig_Loader_Filesystem implements Twig_LoaderInterface +class Twig_Loader_Filesystem implements Twig_LoaderInterface, Twig_ExistsLoaderInterface { protected $paths; protected $cache; @@ -25,44 +24,64 @@ class Twig_Loader_Filesystem implements Twig_LoaderInterface * * @param string|array $paths A path or an array of paths where to look for templates */ - public function __construct($paths) + public function __construct($paths = array()) { - $this->setPaths($paths); + if ($paths) { + $this->setPaths($paths); + } } /** * Returns the paths to the templates. * + * @param string $namespace A path namespace + * * @return array The array of paths where to look for templates */ - public function getPaths() + public function getPaths($namespace = '__main__') + { + return isset($this->paths[$namespace]) ? $this->paths[$namespace] : array(); + } + + /** + * Returns the path namespaces. + * + * The "__main__" namespace is always defined. + * + * @return array The array of defined namespaces + */ + public function getNamespaces() { - return $this->paths; + return array_keys($this->paths); } /** * Sets the paths where templates are stored. * - * @param string|array $paths A path or an array of paths where to look for templates + * @param string|array $paths A path or an array of paths where to look for templates + * @param string $namespace A path namespace */ - public function setPaths($paths) + public function setPaths($paths, $namespace = '__main__') { if (!is_array($paths)) { $paths = array($paths); } - $this->paths = array(); + $this->paths[$namespace] = array(); foreach ($paths as $path) { - $this->addPath($path); + $this->addPath($path, $namespace); } } /** * Adds a path where templates are stored. * - * @param string $path A path where to look for templates + * @param string $path A path where to look for templates + * @param string $namespace A path name + * + * @throws Twig_Error_Loader */ - public function addPath($path) + public function addPath($path, $namespace = '__main__') { // invalidate the cache $this->cache = array(); @@ -71,15 +90,37 @@ class Twig_Loader_Filesystem implements Twig_LoaderInterface throw new Twig_Error_Loader(sprintf('The "%s" directory does not exist.', $path)); } - $this->paths[] = $path; + $this->paths[$namespace][] = rtrim($path, '/\\'); } /** - * Gets the source code of a template, given its name. + * Prepends a path where templates are stored. * - * @param string $name The name of the template to load + * @param string $path A path where to look for templates + * @param string $namespace A path name * - * @return string The template source code + * @throws Twig_Error_Loader + */ + public function prependPath($path, $namespace = '__main__') + { + // invalidate the cache + $this->cache = array(); + + if (!is_dir($path)) { + throw new Twig_Error_Loader(sprintf('The "%s" directory does not exist.', $path)); + } + + $path = rtrim($path, '/\\'); + + if (!isset($this->paths[$namespace])) { + $this->paths[$namespace][] = $path; + } else { + array_unshift($this->paths[$namespace], $path); + } + } + + /** + * {@inheritdoc} */ public function getSource($name) { @@ -87,11 +128,7 @@ class Twig_Loader_Filesystem implements Twig_LoaderInterface } /** - * Gets the cache key to use for the cache for a given template name. - * - * @param string $name The name of the template to load - * - * @return string The cache key + * {@inheritdoc} */ public function getCacheKey($name) { @@ -99,18 +136,36 @@ class Twig_Loader_Filesystem implements Twig_LoaderInterface } /** - * Returns true if the template is still fresh. - * - * @param string $name The template name - * @param timestamp $time The last modification time of the cached template + * {@inheritdoc} + */ + public function exists($name) + { + $name = (string) $name; + if (isset($this->cache[$name])) { + return true; + } + + try { + $this->findTemplate($name); + + return true; + } catch (Twig_Error_Loader $exception) { + return false; + } + } + + /** + * {@inheritdoc} */ public function isFresh($name, $time) { - return filemtime($this->findTemplate($name)) < $time; + return filemtime($this->findTemplate($name)) <= $time; } protected function findTemplate($name) { + $name = (string) $name; + // normalize name $name = preg_replace('#/{2,}#', '/', strtr($name, '\\', '/')); @@ -120,13 +175,28 @@ class Twig_Loader_Filesystem implements Twig_LoaderInterface $this->validateName($name); - foreach ($this->paths as $path) { + $namespace = '__main__'; + if (isset($name[0]) && '@' == $name[0]) { + if (false === $pos = strpos($name, '/')) { + throw new Twig_Error_Loader(sprintf('Malformed namespaced template name "%s" (expecting "@namespace/template_name").', $name)); + } + + $namespace = substr($name, 1, $pos - 1); + + $name = substr($name, $pos + 1); + } + + if (!isset($this->paths[$namespace])) { + throw new Twig_Error_Loader(sprintf('There are no registered paths for namespace "%s".', $namespace)); + } + + foreach ($this->paths[$namespace] as $path) { if (is_file($path.'/'.$name)) { return $this->cache[$name] = $path.'/'.$name; } } - throw new Twig_Error_Loader(sprintf('Unable to find template "%s" (looked into: %s).', $name, implode(', ', $this->paths))); + throw new Twig_Error_Loader(sprintf('Unable to find template "%s" (looked into: %s).', $name, implode(', ', $this->paths[$namespace]))); } protected function validateName($name) @@ -135,6 +205,7 @@ class Twig_Loader_Filesystem implements Twig_LoaderInterface throw new Twig_Error_Loader('A template name cannot contain NUL bytes.'); } + $name = ltrim($name, '/'); $parts = explode('/', $name); $level = 0; foreach ($parts as $part) { diff --git a/inc/lib/Twig/Loader/String.php b/inc/lib/Twig/Loader/String.php index 26eb0096..8ad9856c 100644 --- a/inc/lib/Twig/Loader/String.php +++ b/inc/lib/Twig/Loader/String.php @@ -12,22 +12,21 @@ /** * Loads a template from a string. * + * This loader should only be used for unit testing as it has many limitations + * (for instance, the include or extends tag does not make any sense for a string + * loader). + * * When using this loader with a cache mechanism, you should know that a new cache * key is generated each time a template content "changes" (the cache key being the * source code of the template). If you don't want to see your cache grows out of * control, you need to take care of clearing the old cache file by yourself. * - * @package twig - * @author Fabien Potencier <fabien@symfony.com> + * @author Fabien Potencier <fabien@symfony.com> */ -class Twig_Loader_String implements Twig_LoaderInterface +class Twig_Loader_String implements Twig_LoaderInterface, Twig_ExistsLoaderInterface { /** - * Gets the source code of a template, given its name. - * - * @param string $name The name of the template to load - * - * @return string The template source code + * {@inheritdoc} */ public function getSource($name) { @@ -35,11 +34,15 @@ class Twig_Loader_String implements Twig_LoaderInterface } /** - * Gets the cache key to use for the cache for a given template name. - * - * @param string $name The name of the template to load - * - * @return string The cache key + * {@inheritdoc} + */ + public function exists($name) + { + return true; + } + + /** + * {@inheritdoc} */ public function getCacheKey($name) { @@ -47,10 +50,7 @@ class Twig_Loader_String implements Twig_LoaderInterface } /** - * Returns true if the template is still fresh. - * - * @param string $name The template name - * @param timestamp $time The last modification time of the cached template + * {@inheritdoc} */ public function isFresh($name, $time) { diff --git a/inc/lib/Twig/LoaderInterface.php b/inc/lib/Twig/LoaderInterface.php index f0bd3a5b..927786d1 100644 --- a/inc/lib/Twig/LoaderInterface.php +++ b/inc/lib/Twig/LoaderInterface.php @@ -12,34 +12,41 @@ /** * Interface all loaders must implement. * - * @package twig - * @author Fabien Potencier <fabien@symfony.com> + * @author Fabien Potencier <fabien@symfony.com> */ interface Twig_LoaderInterface { /** * Gets the source code of a template, given its name. * - * @param string $name The name of the template to load + * @param string $name The name of the template to load * * @return string The template source code + * + * @throws Twig_Error_Loader When $name is not found */ - function getSource($name); + public function getSource($name); /** * Gets the cache key to use for the cache for a given template name. * - * @param string $name The name of the template to load + * @param string $name The name of the template to load * * @return string The cache key + * + * @throws Twig_Error_Loader When $name is not found */ - function getCacheKey($name); + public function getCacheKey($name); /** * Returns true if the template is still fresh. * * @param string $name The template name * @param timestamp $time The last modification time of the cached template + * + * @return Boolean true if the template is fresh, false otherwise + * + * @throws Twig_Error_Loader When $name is not found */ - function isFresh($name, $time); + public function isFresh($name, $time); } diff --git a/inc/lib/Twig/Markup.php b/inc/lib/Twig/Markup.php index c1a1469c..69871fcb 100644 --- a/inc/lib/Twig/Markup.php +++ b/inc/lib/Twig/Markup.php @@ -12,20 +12,26 @@ /** * Marks a content as safe. * - * @package twig - * @author Fabien Potencier <fabien@symfony.com> + * @author Fabien Potencier <fabien@symfony.com> */ -class Twig_Markup +class Twig_Markup implements Countable { protected $content; + protected $charset; - public function __construct($content) + public function __construct($content, $charset) { $this->content = (string) $content; + $this->charset = $charset; } public function __toString() { return $this->content; } + + public function count() + { + return function_exists('mb_get_info') ? mb_strlen($this->content, $this->charset) : strlen($this->content); + } } diff --git a/inc/lib/Twig/Node.php b/inc/lib/Twig/Node.php index 22e65d45..931b4635 100644 --- a/inc/lib/Twig/Node.php +++ b/inc/lib/Twig/Node.php @@ -13,10 +13,9 @@ /** * Represents a node in the AST. * - * @package twig - * @author Fabien Potencier <fabien@symfony.com> + * @author Fabien Potencier <fabien@symfony.com> */ -class Twig_Node implements Twig_NodeInterface, Countable, IteratorAggregate +class Twig_Node implements Twig_NodeInterface { protected $nodes; protected $attributes; @@ -134,12 +133,12 @@ class Twig_Node implements Twig_NodeInterface, Countable, IteratorAggregate * * @param string The attribute name * - * @return mixed The attribute value + * @return mixed The attribute value */ public function getAttribute($name) { if (!array_key_exists($name, $this->attributes)) { - throw new Twig_Error_Runtime(sprintf('Attribute "%s" does not exist for Node "%s".', $name, get_class($this))); + throw new LogicException(sprintf('Attribute "%s" does not exist for Node "%s".', $name, get_class($this))); } return $this->attributes[$name]; @@ -188,7 +187,7 @@ class Twig_Node implements Twig_NodeInterface, Countable, IteratorAggregate public function getNode($name) { if (!array_key_exists($name, $this->nodes)) { - throw new Twig_Error_Runtime(sprintf('Node "%s" does not exist for Node "%s".', $name, get_class($this))); + throw new LogicException(sprintf('Node "%s" does not exist for Node "%s".', $name, get_class($this))); } return $this->nodes[$name]; diff --git a/inc/lib/Twig/Node/AutoEscape.php b/inc/lib/Twig/Node/AutoEscape.php index a0c2ee6d..8f190e0b 100644 --- a/inc/lib/Twig/Node/AutoEscape.php +++ b/inc/lib/Twig/Node/AutoEscape.php @@ -18,8 +18,7 @@ * * If autoescaping is disabled, then the value is false. * - * @package twig - * @author Fabien Potencier <fabien@symfony.com> + * @author Fabien Potencier <fabien@symfony.com> */ class Twig_Node_AutoEscape extends Twig_Node { diff --git a/inc/lib/Twig/Node/Block.php b/inc/lib/Twig/Node/Block.php index 5548ad06..50eb67ed 100644 --- a/inc/lib/Twig/Node/Block.php +++ b/inc/lib/Twig/Node/Block.php @@ -13,8 +13,7 @@ /** * Represents a block node. * - * @package twig - * @author Fabien Potencier <fabien@symfony.com> + * @author Fabien Potencier <fabien@symfony.com> */ class Twig_Node_Block extends Twig_Node { diff --git a/inc/lib/Twig/Node/BlockReference.php b/inc/lib/Twig/Node/BlockReference.php index 53f6287c..013e369e 100644 --- a/inc/lib/Twig/Node/BlockReference.php +++ b/inc/lib/Twig/Node/BlockReference.php @@ -13,8 +13,7 @@ /** * Represents a block call node. * - * @package twig - * @author Fabien Potencier <fabien@symfony.com> + * @author Fabien Potencier <fabien@symfony.com> */ class Twig_Node_BlockReference extends Twig_Node implements Twig_NodeOutputInterface { diff --git a/inc/lib/Twig/Node/Body.php b/inc/lib/Twig/Node/Body.php new file mode 100644 index 00000000..3ffb1342 --- /dev/null +++ b/inc/lib/Twig/Node/Body.php @@ -0,0 +1,19 @@ +<?php + +/* + * This file is part of Twig. + * + * (c) 2011 Fabien Potencier + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/** + * Represents a body node. + * + * @author Fabien Potencier <fabien@symfony.com> + */ +class Twig_Node_Body extends Twig_Node +{ +} diff --git a/inc/lib/Twig/Node/Do.php b/inc/lib/Twig/Node/Do.php new file mode 100644 index 00000000..c528066b --- /dev/null +++ b/inc/lib/Twig/Node/Do.php @@ -0,0 +1,38 @@ +<?php + +/* + * This file is part of Twig. + * + * (c) 2011 Fabien Potencier + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/** + * Represents a do node. + * + * @author Fabien Potencier <fabien@symfony.com> + */ +class Twig_Node_Do extends Twig_Node +{ + public function __construct(Twig_Node_Expression $expr, $lineno, $tag = null) + { + parent::__construct(array('expr' => $expr), array(), $lineno, $tag); + } + + /** + * Compiles the node to PHP. + * + * @param Twig_Compiler A Twig_Compiler instance + */ + public function compile(Twig_Compiler $compiler) + { + $compiler + ->addDebugInfo($this) + ->write('') + ->subcompile($this->getNode('expr')) + ->raw(";\n") + ; + } +} diff --git a/inc/lib/Twig/Node/Embed.php b/inc/lib/Twig/Node/Embed.php new file mode 100644 index 00000000..4c9456dc --- /dev/null +++ b/inc/lib/Twig/Node/Embed.php @@ -0,0 +1,38 @@ +<?php + +/* + * This file is part of Twig. + * + * (c) 2012 Fabien Potencier + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/** + * Represents an embed node. + * + * @author Fabien Potencier <fabien@symfony.com> + */ +class Twig_Node_Embed extends Twig_Node_Include +{ + // we don't inject the module to avoid node visitors to traverse it twice (as it will be already visited in the main module) + public function __construct($filename, $index, Twig_Node_Expression $variables = null, $only = false, $ignoreMissing = false, $lineno, $tag = null) + { + parent::__construct(new Twig_Node_Expression_Constant('not_used', $lineno), $variables, $only, $ignoreMissing, $lineno, $tag); + + $this->setAttribute('filename', $filename); + $this->setAttribute('index', $index); + } + + protected function addGetTemplate(Twig_Compiler $compiler) + { + $compiler + ->write("\$this->env->loadTemplate(") + ->string($this->getAttribute('filename')) + ->raw(', ') + ->string($this->getAttribute('index')) + ->raw(")") + ; + } +} diff --git a/inc/lib/Twig/Node/Expression.php b/inc/lib/Twig/Node/Expression.php index 13b170e5..a7382e7d 100644 --- a/inc/lib/Twig/Node/Expression.php +++ b/inc/lib/Twig/Node/Expression.php @@ -13,8 +13,7 @@ /** * Abstract class for all nodes that represents an expression. * - * @package twig - * @author Fabien Potencier <fabien@symfony.com> + * @author Fabien Potencier <fabien@symfony.com> */ abstract class Twig_Node_Expression extends Twig_Node { diff --git a/inc/lib/Twig/Node/Expression/Array.php b/inc/lib/Twig/Node/Expression/Array.php index 2d860823..1da785fe 100644 --- a/inc/lib/Twig/Node/Expression/Array.php +++ b/inc/lib/Twig/Node/Expression/Array.php @@ -10,9 +10,54 @@ */ class Twig_Node_Expression_Array extends Twig_Node_Expression { + protected $index; + public function __construct(array $elements, $lineno) { parent::__construct($elements, array(), $lineno); + + $this->index = -1; + foreach ($this->getKeyValuePairs() as $pair) { + if ($pair['key'] instanceof Twig_Node_Expression_Constant && ctype_digit((string) $pair['key']->getAttribute('value')) && $pair['key']->getAttribute('value') > $this->index) { + $this->index = $pair['key']->getAttribute('value'); + } + } + } + + public function getKeyValuePairs() + { + $pairs = array(); + + foreach (array_chunk($this->nodes, 2) as $pair) { + $pairs[] = array( + 'key' => $pair[0], + 'value' => $pair[1], + ); + } + + return $pairs; + } + + public function hasElement(Twig_Node_Expression $key) + { + foreach ($this->getKeyValuePairs() as $pair) { + // we compare the string representation of the keys + // to avoid comparing the line numbers which are not relevant here. + if ((string) $key == (string) $pair['key']) { + return true; + } + } + + return false; + } + + public function addElement(Twig_Node_Expression $value, Twig_Node_Expression $key = null) + { + if (null === $key) { + $key = new Twig_Node_Expression_Constant(++$this->index, $value->getLine()); + } + + array_push($this->nodes, $key, $value); } /** @@ -24,16 +69,16 @@ class Twig_Node_Expression_Array extends Twig_Node_Expression { $compiler->raw('array('); $first = true; - foreach ($this->nodes as $name => $node) { + foreach ($this->getKeyValuePairs() as $pair) { if (!$first) { $compiler->raw(', '); } $first = false; $compiler - ->repr($name) + ->subcompile($pair['key']) ->raw(' => ') - ->subcompile($node) + ->subcompile($pair['value']) ; } $compiler->raw(')'); diff --git a/inc/lib/Twig/Node/Expression/AssignName.php b/inc/lib/Twig/Node/Expression/AssignName.php index 67f12509..2ddea78c 100644 --- a/inc/lib/Twig/Node/Expression/AssignName.php +++ b/inc/lib/Twig/Node/Expression/AssignName.php @@ -19,6 +19,10 @@ class Twig_Node_Expression_AssignName extends Twig_Node_Expression_Name */ public function compile(Twig_Compiler $compiler) { - $compiler->raw(sprintf('$context[\'%s\']', $this->getAttribute('name'))); + $compiler + ->raw('$context[') + ->string($this->getAttribute('name')) + ->raw(']') + ; } } diff --git a/inc/lib/Twig/Node/Expression/Binary/FloorDiv.php b/inc/lib/Twig/Node/Expression/Binary/FloorDiv.php index e86b1ea0..7fbd0556 100644 --- a/inc/lib/Twig/Node/Expression/Binary/FloorDiv.php +++ b/inc/lib/Twig/Node/Expression/Binary/FloorDiv.php @@ -17,9 +17,9 @@ class Twig_Node_Expression_Binary_FloorDiv extends Twig_Node_Expression_Binary */ public function compile(Twig_Compiler $compiler) { - $compiler->raw('floor('); + $compiler->raw('intval(floor('); parent::compile($compiler); - $compiler->raw(')'); + $compiler->raw('))'); } public function operator(Twig_Compiler $compiler) diff --git a/inc/lib/Twig/Node/Expression/BlockReference.php b/inc/lib/Twig/Node/Expression/BlockReference.php index 174d9097..647196eb 100644 --- a/inc/lib/Twig/Node/Expression/BlockReference.php +++ b/inc/lib/Twig/Node/Expression/BlockReference.php @@ -13,8 +13,7 @@ /** * Represents a block call node. * - * @package twig - * @author Fabien Potencier <fabien@symfony.com> + * @author Fabien Potencier <fabien@symfony.com> */ class Twig_Node_Expression_BlockReference extends Twig_Node_Expression { diff --git a/inc/lib/Twig/Node/Expression/Call.php b/inc/lib/Twig/Node/Expression/Call.php new file mode 100644 index 00000000..87b62deb --- /dev/null +++ b/inc/lib/Twig/Node/Expression/Call.php @@ -0,0 +1,178 @@ +<?php + +/* + * This file is part of Twig. + * + * (c) 2012 Fabien Potencier + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ +abstract class Twig_Node_Expression_Call extends Twig_Node_Expression +{ + protected function compileCallable(Twig_Compiler $compiler) + { + $callable = $this->getAttribute('callable'); + + $closingParenthesis = false; + if ($callable) { + if (is_string($callable)) { + $compiler->raw($callable); + } elseif (is_array($callable) && $callable[0] instanceof Twig_ExtensionInterface) { + $compiler->raw(sprintf('$this->env->getExtension(\'%s\')->%s', $callable[0]->getName(), $callable[1])); + } else { + $type = ucfirst($this->getAttribute('type')); + $compiler->raw(sprintf('call_user_func_array($this->env->get%s(\'%s\')->getCallable(), array', $type, $this->getAttribute('name'))); + $closingParenthesis = true; + } + } else { + $compiler->raw($this->getAttribute('thing')->compile()); + } + + $this->compileArguments($compiler); + + if ($closingParenthesis) { + $compiler->raw(')'); + } + } + + protected function compileArguments(Twig_Compiler $compiler) + { + $compiler->raw('('); + + $first = true; + + if ($this->hasAttribute('needs_environment') && $this->getAttribute('needs_environment')) { + $compiler->raw('$this->env'); + $first = false; + } + + if ($this->hasAttribute('needs_context') && $this->getAttribute('needs_context')) { + if (!$first) { + $compiler->raw(', '); + } + $compiler->raw('$context'); + $first = false; + } + + if ($this->hasAttribute('arguments')) { + foreach ($this->getAttribute('arguments') as $argument) { + if (!$first) { + $compiler->raw(', '); + } + $compiler->string($argument); + $first = false; + } + } + + if ($this->hasNode('node')) { + if (!$first) { + $compiler->raw(', '); + } + $compiler->subcompile($this->getNode('node')); + $first = false; + } + + if ($this->hasNode('arguments') && null !== $this->getNode('arguments')) { + $callable = $this->hasAttribute('callable') ? $this->getAttribute('callable') : null; + + $arguments = $this->getArguments($callable, $this->getNode('arguments')); + + foreach ($arguments as $node) { + if (!$first) { + $compiler->raw(', '); + } + $compiler->subcompile($node); + $first = false; + } + } + + $compiler->raw(')'); + } + + protected function getArguments($callable, $arguments) + { + $parameters = array(); + $named = false; + foreach ($arguments as $name => $node) { + if (!is_int($name)) { + $named = true; + $name = $this->normalizeName($name); + } elseif ($named) { + throw new Twig_Error_Syntax(sprintf('Positional arguments cannot be used after named arguments for %s "%s".', $this->getAttribute('type'), $this->getAttribute('name'))); + } + + $parameters[$name] = $node; + } + + if (!$named) { + return $parameters; + } + + if (!$callable) { + throw new LogicException(sprintf('Named arguments are not supported for %s "%s".', $this->getAttribute('type'), $this->getAttribute('name'))); + } + + // manage named arguments + if (is_array($callable)) { + $r = new ReflectionMethod($callable[0], $callable[1]); + } elseif (is_object($callable) && !$callable instanceof Closure) { + $r = new ReflectionObject($callable); + $r = $r->getMethod('__invoke'); + } else { + $r = new ReflectionFunction($callable); + } + + $definition = $r->getParameters(); + if ($this->hasNode('node')) { + array_shift($definition); + } + if ($this->hasAttribute('needs_environment') && $this->getAttribute('needs_environment')) { + array_shift($definition); + } + if ($this->hasAttribute('needs_context') && $this->getAttribute('needs_context')) { + array_shift($definition); + } + if ($this->hasAttribute('arguments') && null !== $this->getAttribute('arguments')) { + foreach ($this->getAttribute('arguments') as $argument) { + array_shift($definition); + } + } + + $arguments = array(); + $pos = 0; + foreach ($definition as $param) { + $name = $this->normalizeName($param->name); + + if (array_key_exists($name, $parameters)) { + if (array_key_exists($pos, $parameters)) { + throw new Twig_Error_Syntax(sprintf('Arguments "%s" is defined twice for %s "%s".', $name, $this->getAttribute('type'), $this->getAttribute('name'))); + } + + $arguments[] = $parameters[$name]; + unset($parameters[$name]); + } elseif (array_key_exists($pos, $parameters)) { + $arguments[] = $parameters[$pos]; + unset($parameters[$pos]); + ++$pos; + } elseif ($param->isDefaultValueAvailable()) { + $arguments[] = new Twig_Node_Expression_Constant($param->getDefaultValue(), -1); + } elseif ($param->isOptional()) { + break; + } else { + throw new Twig_Error_Syntax(sprintf('Value for argument "%s" is required for %s "%s".', $name, $this->getAttribute('type'), $this->getAttribute('name'))); + } + } + + foreach (array_keys($parameters) as $name) { + throw new Twig_Error_Syntax(sprintf('Unknown argument "%s" for %s "%s".', $name, $this->getAttribute('type'), $this->getAttribute('name'))); + } + + return $arguments; + } + + protected function normalizeName($name) + { + return strtolower(preg_replace(array('/([A-Z]+)([A-Z][a-z])/', '/([a-z\d])([A-Z])/'), array('\\1_\\2', '\\1_\\2'), $name)); + } +} diff --git a/inc/lib/Twig/Node/Expression/ExtensionReference.php b/inc/lib/Twig/Node/Expression/ExtensionReference.php index cb4efad0..00ac6701 100644 --- a/inc/lib/Twig/Node/Expression/ExtensionReference.php +++ b/inc/lib/Twig/Node/Expression/ExtensionReference.php @@ -12,8 +12,7 @@ /** * Represents an extension call node. * - * @package twig - * @author Fabien Potencier <fabien@symfony.com> + * @author Fabien Potencier <fabien@symfony.com> */ class Twig_Node_Expression_ExtensionReference extends Twig_Node_Expression { diff --git a/inc/lib/Twig/Node/Expression/Filter.php b/inc/lib/Twig/Node/Expression/Filter.php index 101e6df0..207b062a 100644 --- a/inc/lib/Twig/Node/Expression/Filter.php +++ b/inc/lib/Twig/Node/Expression/Filter.php @@ -9,7 +9,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ -class Twig_Node_Expression_Filter extends Twig_Node_Expression +class Twig_Node_Expression_Filter extends Twig_Node_Expression_Call { public function __construct(Twig_NodeInterface $node, Twig_Node_Expression_Constant $filterName, Twig_NodeInterface $arguments, $lineno, $tag = null) { @@ -19,54 +19,18 @@ class Twig_Node_Expression_Filter extends Twig_Node_Expression public function compile(Twig_Compiler $compiler) { $name = $this->getNode('filter')->getAttribute('value'); - if (false === $filter = $compiler->getEnvironment()->getFilter($name)) { - throw new Twig_Error_Syntax(sprintf('The filter "%s" does not exist', $name), $this->getLine()); - } - - $node = $this->getNode('node'); - - // The default filter is intercepted when the filtered value - // is a name (like obj) or an attribute (like obj.attr) - // In such a case, it's compiled to {{ obj is defined ? obj|default('bar') : 'bar' }} - if ('default' === $name && ($node instanceof Twig_Node_Expression_Name || $node instanceof Twig_Node_Expression_GetAttr)) { - $compiler - ->raw('((') - ->subcompile(new Twig_Node_Expression_Test($node, 'defined', new Twig_Node(), $this->getLine())) - ->raw(') ? (') - ; - - $this->compileFilter($compiler, $filter); - - $compiler->raw(') : ('); - - if ($this->getNode('arguments')->hasNode(0)) { - $compiler->subcompile($this->getNode('arguments')->getNode(0)); - } else { - $compiler->string(''); - } - - $compiler->raw('))'); - } else { - $this->compileFilter($compiler, $filter); - } - } - - protected function compileFilter(Twig_Compiler $compiler, Twig_FilterInterface $filter) - { - $compiler - ->raw($filter->compile().'(') - ->raw($filter->needsEnvironment() ? '$this->env, ' : '') - ->raw($filter->needsContext() ? '$context, ' : '') - ->subcompile($this->getNode('node')) - ; + $filter = $compiler->getEnvironment()->getFilter($name); - foreach ($this->getNode('arguments') as $node) { - $compiler - ->raw(', ') - ->subcompile($node) - ; + $this->setAttribute('name', $name); + $this->setAttribute('type', 'filter'); + $this->setAttribute('thing', $filter); + $this->setAttribute('needs_environment', $filter->needsEnvironment()); + $this->setAttribute('needs_context', $filter->needsContext()); + $this->setAttribute('arguments', $filter->getArguments()); + if ($filter instanceof Twig_FilterCallableInterface || $filter instanceof Twig_SimpleFilter) { + $this->setAttribute('callable', $filter->getCallable()); } - $compiler->raw(')'); + $this->compileCallable($compiler); } } diff --git a/inc/lib/Twig/Node/Expression/Filter/Default.php b/inc/lib/Twig/Node/Expression/Filter/Default.php new file mode 100644 index 00000000..1827c888 --- /dev/null +++ b/inc/lib/Twig/Node/Expression/Filter/Default.php @@ -0,0 +1,43 @@ +<?php + +/* + * This file is part of Twig. + * + * (c) 2011 Fabien Potencier + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/** + * Returns the value or the default value when it is undefined or empty. + * + * <pre> + * {{ var.foo|default('foo item on var is not defined') }} + * </pre> + * + * @author Fabien Potencier <fabien@symfony.com> + */ +class Twig_Node_Expression_Filter_Default extends Twig_Node_Expression_Filter +{ + public function __construct(Twig_NodeInterface $node, Twig_Node_Expression_Constant $filterName, Twig_NodeInterface $arguments, $lineno, $tag = null) + { + $default = new Twig_Node_Expression_Filter($node, new Twig_Node_Expression_Constant('default', $node->getLine()), $arguments, $node->getLine()); + + if ('default' === $filterName->getAttribute('value') && ($node instanceof Twig_Node_Expression_Name || $node instanceof Twig_Node_Expression_GetAttr)) { + $test = new Twig_Node_Expression_Test_Defined(clone $node, 'defined', new Twig_Node(), $node->getLine()); + $false = count($arguments) ? $arguments->getNode(0) : new Twig_Node_Expression_Constant('', $node->getLine()); + + $node = new Twig_Node_Expression_Conditional($test, $default, $false, $node->getLine()); + } else { + $node = $default; + } + + parent::__construct($node, $filterName, $arguments, $lineno, $tag); + } + + public function compile(Twig_Compiler $compiler) + { + $compiler->subcompile($this->getNode('node')); + } +} diff --git a/inc/lib/Twig/Node/Expression/Function.php b/inc/lib/Twig/Node/Expression/Function.php index 3f457199..3e1f6b55 100644 --- a/inc/lib/Twig/Node/Expression/Function.php +++ b/inc/lib/Twig/Node/Expression/Function.php @@ -8,7 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ -class Twig_Node_Expression_Function extends Twig_Node_Expression +class Twig_Node_Expression_Function extends Twig_Node_Expression_Call { public function __construct($name, Twig_NodeInterface $arguments, $lineno) { @@ -17,33 +17,19 @@ class Twig_Node_Expression_Function extends Twig_Node_Expression public function compile(Twig_Compiler $compiler) { - $function = $compiler->getEnvironment()->getFunction($this->getAttribute('name')); - if (false === $function) { - throw new Twig_Error_Syntax(sprintf('The function "%s" does not exist', $this->getAttribute('name')), $this->getLine()); - } - - $compiler - ->raw($function->compile().'(') - ->raw($function->needsEnvironment() ? '$this->env' : '') - ; - - if ($function->needsContext()) { - $compiler->raw($function->needsEnvironment() ? ', $context' : '$context'); - } + $name = $this->getAttribute('name'); + $function = $compiler->getEnvironment()->getFunction($name); - $first = true; - foreach ($this->getNode('arguments') as $node) { - if (!$first) { - $compiler->raw(', '); - } else { - if ($function->needsEnvironment() || $function->needsContext()) { - $compiler->raw(', '); - } - $first = false; - } - $compiler->subcompile($node); + $this->setAttribute('name', $name); + $this->setAttribute('type', 'function'); + $this->setAttribute('thing', $function); + $this->setAttribute('needs_environment', $function->needsEnvironment()); + $this->setAttribute('needs_context', $function->needsContext()); + $this->setAttribute('arguments', $function->getArguments()); + if ($function instanceof Twig_FunctionCallableInterface || $function instanceof Twig_SimpleFunction) { + $this->setAttribute('callable', $function->getCallable()); } - $compiler->raw(')'); + $this->compileCallable($compiler); } } diff --git a/inc/lib/Twig/Node/Expression/GetAttr.php b/inc/lib/Twig/Node/Expression/GetAttr.php index eb9e6050..81a9b137 100644 --- a/inc/lib/Twig/Node/Expression/GetAttr.php +++ b/inc/lib/Twig/Node/Expression/GetAttr.php @@ -11,43 +11,43 @@ */ class Twig_Node_Expression_GetAttr extends Twig_Node_Expression { - public function __construct(Twig_Node_Expression $node, Twig_Node_Expression $attribute, Twig_NodeInterface $arguments, $type, $lineno) + public function __construct(Twig_Node_Expression $node, Twig_Node_Expression $attribute, Twig_Node_Expression_Array $arguments, $type, $lineno) { - parent::__construct(array('node' => $node, 'attribute' => $attribute, 'arguments' => $arguments), array('type' => $type), $lineno); + parent::__construct(array('node' => $node, 'attribute' => $attribute, 'arguments' => $arguments), array('type' => $type, 'is_defined_test' => false, 'ignore_strict_check' => false, 'disable_c_ext' => false), $lineno); } public function compile(Twig_Compiler $compiler) { - $compiler->raw('$this->getAttribute('); - - if ($this->hasAttribute('is_defined_test') && $compiler->getEnvironment()->isStrictVariables()) { - $compiler->subcompile(new Twig_Node_Expression_Filter( - $this->getNode('node'), - new Twig_Node_Expression_Constant('default', $this->getLine()), - new Twig_Node(), - $this->getLine() - )); + if (function_exists('twig_template_get_attributes') && !$this->getAttribute('disable_c_ext')) { + $compiler->raw('twig_template_get_attributes($this, '); } else { - $compiler->subcompile($this->getNode('node')); + $compiler->raw('$this->getAttribute('); + } + + if ($this->getAttribute('ignore_strict_check')) { + $this->getNode('node')->setAttribute('ignore_strict_check', true); } - $compiler - ->raw(', ') - ->subcompile($this->getNode('attribute')) - ->raw(', array(') - ; + $compiler->subcompile($this->getNode('node')); + + $compiler->raw(', ')->subcompile($this->getNode('attribute')); + + if (count($this->getNode('arguments')) || Twig_TemplateInterface::ANY_CALL !== $this->getAttribute('type') || $this->getAttribute('is_defined_test') || $this->getAttribute('ignore_strict_check')) { + $compiler->raw(', ')->subcompile($this->getNode('arguments')); + + if (Twig_TemplateInterface::ANY_CALL !== $this->getAttribute('type') || $this->getAttribute('is_defined_test') || $this->getAttribute('ignore_strict_check')) { + $compiler->raw(', ')->repr($this->getAttribute('type')); + } + + if ($this->getAttribute('is_defined_test') || $this->getAttribute('ignore_strict_check')) { + $compiler->raw(', '.($this->getAttribute('is_defined_test') ? 'true' : 'false')); + } - foreach ($this->getNode('arguments') as $node) { - $compiler - ->subcompile($node) - ->raw(', ') - ; + if ($this->getAttribute('ignore_strict_check')) { + $compiler->raw(', '.($this->getAttribute('ignore_strict_check') ? 'true' : 'false')); + } } - $compiler - ->raw('), ') - ->repr($this->getAttribute('type')) - ->raw($this->hasAttribute('is_defined_test') ? ', true' : ', false') - ->raw(')'); + $compiler->raw(')'); } } diff --git a/inc/lib/Twig/Node/Expression/MethodCall.php b/inc/lib/Twig/Node/Expression/MethodCall.php new file mode 100644 index 00000000..620b02bf --- /dev/null +++ b/inc/lib/Twig/Node/Expression/MethodCall.php @@ -0,0 +1,41 @@ +<?php + +/* + * This file is part of Twig. + * + * (c) 2012 Fabien Potencier + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ +class Twig_Node_Expression_MethodCall extends Twig_Node_Expression +{ + public function __construct(Twig_Node_Expression $node, $method, Twig_Node_Expression_Array $arguments, $lineno) + { + parent::__construct(array('node' => $node, 'arguments' => $arguments), array('method' => $method, 'safe' => false), $lineno); + + if ($node instanceof Twig_Node_Expression_Name) { + $node->setAttribute('always_defined', true); + } + } + + public function compile(Twig_Compiler $compiler) + { + $compiler + ->subcompile($this->getNode('node')) + ->raw('->') + ->raw($this->getAttribute('method')) + ->raw('(') + ; + $first = true; + foreach ($this->getNode('arguments')->getKeyValuePairs() as $pair) { + if (!$first) { + $compiler->raw(', '); + } + $first = false; + + $compiler->subcompile($pair['value']); + } + $compiler->raw(')'); + } +} diff --git a/inc/lib/Twig/Node/Expression/Name.php b/inc/lib/Twig/Node/Expression/Name.php index fceda2b7..3b8fae01 100644 --- a/inc/lib/Twig/Node/Expression/Name.php +++ b/inc/lib/Twig/Node/Expression/Name.php @@ -11,31 +11,78 @@ */ class Twig_Node_Expression_Name extends Twig_Node_Expression { + protected $specialVars = array( + '_self' => '$this', + '_context' => '$context', + '_charset' => '$this->env->getCharset()', + ); + public function __construct($name, $lineno) { - parent::__construct(array(), array('name' => $name), $lineno); + parent::__construct(array(), array('name' => $name, 'is_defined_test' => false, 'ignore_strict_check' => false, 'always_defined' => false), $lineno); } public function compile(Twig_Compiler $compiler) { - static $specialVars = array( - '_self' => '$this', - '_context' => '$context', - '_charset' => '$this->env->getCharset()', - ); - $name = $this->getAttribute('name'); - if ($this->hasAttribute('is_defined_test')) { - if (isset($specialVars[$name])) { + if ($this->getAttribute('is_defined_test')) { + if ($this->isSpecial()) { $compiler->repr(true); } else { $compiler->raw('array_key_exists(')->repr($name)->raw(', $context)'); } - } elseif (isset($specialVars[$name])) { - $compiler->raw($specialVars[$name]); + } elseif ($this->isSpecial()) { + $compiler->raw($this->specialVars[$name]); + } elseif ($this->getAttribute('always_defined')) { + $compiler + ->raw('$context[') + ->string($name) + ->raw(']') + ; } else { - $compiler->raw(sprintf('$this->getContext($context, \'%s\')', $name)); + // remove the non-PHP 5.4 version when PHP 5.3 support is dropped + // as the non-optimized version is just a workaround for slow ternary operator + // when the context has a lot of variables + if (version_compare(phpversion(), '5.4.0RC1', '>=')) { + // PHP 5.4 ternary operator performance was optimized + $compiler + ->raw('(isset($context[') + ->string($name) + ->raw(']) ? $context[') + ->string($name) + ->raw('] : ') + ; + + if ($this->getAttribute('ignore_strict_check') || !$compiler->getEnvironment()->isStrictVariables()) { + $compiler->raw('null)'); + } else { + $compiler->raw('$this->getContext($context, ')->string($name)->raw('))'); + } + } else { + $compiler + ->raw('$this->getContext($context, ') + ->string($name) + ; + + if ($this->getAttribute('ignore_strict_check')) { + $compiler->raw(', true'); + } + + $compiler + ->raw(')') + ; + } } } + + public function isSpecial() + { + return isset($this->specialVars[$this->getAttribute('name')]); + } + + public function isSimple() + { + return !$this->isSpecial() && !$this->getAttribute('is_defined_test'); + } } diff --git a/inc/lib/Twig/Node/Expression/Parent.php b/inc/lib/Twig/Node/Expression/Parent.php index 5689fe45..dcf618c0 100644 --- a/inc/lib/Twig/Node/Expression/Parent.php +++ b/inc/lib/Twig/Node/Expression/Parent.php @@ -13,14 +13,13 @@ /** * Represents a parent node. * - * @package twig - * @author Fabien Potencier <fabien@symfony.com> + * @author Fabien Potencier <fabien@symfony.com> */ class Twig_Node_Expression_Parent extends Twig_Node_Expression { public function __construct($name, $lineno, $tag = null) { - parent::__construct(array(), array('name' => $name), $lineno, $tag); + parent::__construct(array(), array('output' => false, 'name' => $name), $lineno, $tag); } /** @@ -30,10 +29,19 @@ class Twig_Node_Expression_Parent extends Twig_Node_Expression */ public function compile(Twig_Compiler $compiler) { - $compiler - ->raw("\$this->renderParentBlock(") - ->string($this->getAttribute('name')) - ->raw(", \$context, \$blocks)") - ; + if ($this->getAttribute('output')) { + $compiler + ->addDebugInfo($this) + ->write("\$this->displayParentBlock(") + ->string($this->getAttribute('name')) + ->raw(", \$context, \$blocks);\n") + ; + } else { + $compiler + ->raw("\$this->renderParentBlock(") + ->string($this->getAttribute('name')) + ->raw(", \$context, \$blocks)") + ; + } } } diff --git a/inc/lib/Twig/Node/Expression/TempName.php b/inc/lib/Twig/Node/Expression/TempName.php new file mode 100644 index 00000000..e6b058e8 --- /dev/null +++ b/inc/lib/Twig/Node/Expression/TempName.php @@ -0,0 +1,26 @@ +<?php + +/* + * This file is part of Twig. + * + * (c) 2011 Fabien Potencier + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ +class Twig_Node_Expression_TempName extends Twig_Node_Expression +{ + public function __construct($name, $lineno) + { + parent::__construct(array(), array('name' => $name), $lineno); + } + + public function compile(Twig_Compiler $compiler) + { + $compiler + ->raw('$_') + ->raw($this->getAttribute('name')) + ->raw('_') + ; + } +} diff --git a/inc/lib/Twig/Node/Expression/Test.php b/inc/lib/Twig/Node/Expression/Test.php index ef35df6b..639f501a 100644 --- a/inc/lib/Twig/Node/Expression/Test.php +++ b/inc/lib/Twig/Node/Expression/Test.php @@ -8,7 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ -class Twig_Node_Expression_Test extends Twig_Node_Expression +class Twig_Node_Expression_Test extends Twig_Node_Expression_Call { public function __construct(Twig_NodeInterface $node, $name, Twig_NodeInterface $arguments = null, $lineno) { @@ -17,44 +17,16 @@ class Twig_Node_Expression_Test extends Twig_Node_Expression public function compile(Twig_Compiler $compiler) { - $testMap = $compiler->getEnvironment()->getTests(); - if (!isset($testMap[$this->getAttribute('name')])) { - throw new Twig_Error_Syntax(sprintf('The test "%s" does not exist', $this->getAttribute('name')), $this->getLine()); - } - $name = $this->getAttribute('name'); - $node = $this->getNode('node'); - - // defined is a special case - if ('defined' === $name) { - if ($node instanceof Twig_Node_Expression_Name || $node instanceof Twig_Node_Expression_GetAttr) { - $node->setAttribute('is_defined_test', true); - $compiler->subcompile($node); - $node->removeAttribute('is_defined_test'); - } else { - throw new Twig_Error_Syntax('The "defined" test only works with simple variables', $this->getLine()); - } - return; - } - - $compiler - ->raw($testMap[$name]->compile().'(') - ->subcompile($node) - ; - - if (null !== $this->getNode('arguments')) { - $compiler->raw(', '); - - $max = count($this->getNode('arguments')) - 1; - foreach ($this->getNode('arguments') as $i => $arg) { - $compiler->subcompile($arg); + $test = $compiler->getEnvironment()->getTest($name); - if ($i != $max) { - $compiler->raw(', '); - } - } + $this->setAttribute('name', $name); + $this->setAttribute('type', 'test'); + $this->setAttribute('thing', $test); + if ($test instanceof Twig_TestCallableInterface || $test instanceof Twig_SimpleTest) { + $this->setAttribute('callable', $test->getCallable()); } - $compiler->raw(')'); + $this->compileCallable($compiler); } } diff --git a/inc/lib/Twig/Node/Expression/Test/Constant.php b/inc/lib/Twig/Node/Expression/Test/Constant.php new file mode 100644 index 00000000..de55f5f5 --- /dev/null +++ b/inc/lib/Twig/Node/Expression/Test/Constant.php @@ -0,0 +1,46 @@ +<?php + +/* + * This file is part of Twig. + * + * (c) 2011 Fabien Potencier + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/** + * Checks if a variable is the exact same value as a constant. + * + * <pre> + * {% if post.status is constant('Post::PUBLISHED') %} + * the status attribute is exactly the same as Post::PUBLISHED + * {% endif %} + * </pre> + * + * @author Fabien Potencier <fabien@symfony.com> + */ +class Twig_Node_Expression_Test_Constant extends Twig_Node_Expression_Test +{ + public function compile(Twig_Compiler $compiler) + { + $compiler + ->raw('(') + ->subcompile($this->getNode('node')) + ->raw(' === constant(') + ; + + if ($this->getNode('arguments')->hasNode(1)) { + $compiler + ->raw('get_class(') + ->subcompile($this->getNode('arguments')->getNode(1)) + ->raw(')."::".') + ; + } + + $compiler + ->subcompile($this->getNode('arguments')->getNode(0)) + ->raw('))') + ; + } +} diff --git a/inc/lib/Twig/Node/Expression/Test/Defined.php b/inc/lib/Twig/Node/Expression/Test/Defined.php new file mode 100644 index 00000000..247b2e23 --- /dev/null +++ b/inc/lib/Twig/Node/Expression/Test/Defined.php @@ -0,0 +1,54 @@ +<?php + +/* + * This file is part of Twig. + * + * (c) 2011 Fabien Potencier + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/** + * Checks if a variable is defined in the current context. + * + * <pre> + * {# defined works with variable names and variable attributes #} + * {% if foo is defined %} + * {# ... #} + * {% endif %} + * </pre> + * + * @author Fabien Potencier <fabien@symfony.com> + */ +class Twig_Node_Expression_Test_Defined extends Twig_Node_Expression_Test +{ + public function __construct(Twig_NodeInterface $node, $name, Twig_NodeInterface $arguments = null, $lineno) + { + parent::__construct($node, $name, $arguments, $lineno); + + if ($node instanceof Twig_Node_Expression_Name) { + $node->setAttribute('is_defined_test', true); + } elseif ($node instanceof Twig_Node_Expression_GetAttr) { + $node->setAttribute('is_defined_test', true); + + $this->changeIgnoreStrictCheck($node); + } else { + throw new Twig_Error_Syntax('The "defined" test only works with simple variables', $this->getLine()); + } + } + + protected function changeIgnoreStrictCheck(Twig_Node_Expression_GetAttr $node) + { + $node->setAttribute('ignore_strict_check', true); + + if ($node->getNode('node') instanceof Twig_Node_Expression_GetAttr) { + $this->changeIgnoreStrictCheck($node->getNode('node')); + } + } + + public function compile(Twig_Compiler $compiler) + { + $compiler->subcompile($this->getNode('node')); + } +} diff --git a/inc/lib/Twig/Node/Expression/Test/Divisibleby.php b/inc/lib/Twig/Node/Expression/Test/Divisibleby.php new file mode 100644 index 00000000..0aceb530 --- /dev/null +++ b/inc/lib/Twig/Node/Expression/Test/Divisibleby.php @@ -0,0 +1,33 @@ +<?php + +/* + * This file is part of Twig. + * + * (c) 2011 Fabien Potencier + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/** + * Checks if a variable is divisible by a number. + * + * <pre> + * {% if loop.index is divisibleby(3) %} + * </pre> + * + * @author Fabien Potencier <fabien@symfony.com> + */ +class Twig_Node_Expression_Test_Divisibleby extends Twig_Node_Expression_Test +{ + public function compile(Twig_Compiler $compiler) + { + $compiler + ->raw('(0 == ') + ->subcompile($this->getNode('node')) + ->raw(' % ') + ->subcompile($this->getNode('arguments')->getNode(0)) + ->raw(')') + ; + } +} diff --git a/inc/lib/Twig/Node/Expression/Test/Even.php b/inc/lib/Twig/Node/Expression/Test/Even.php new file mode 100644 index 00000000..d7853e89 --- /dev/null +++ b/inc/lib/Twig/Node/Expression/Test/Even.php @@ -0,0 +1,32 @@ +<?php + +/* + * This file is part of Twig. + * + * (c) 2011 Fabien Potencier + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/** + * Checks if a number is even. + * + * <pre> + * {{ var is even }} + * </pre> + * + * @author Fabien Potencier <fabien@symfony.com> + */ +class Twig_Node_Expression_Test_Even extends Twig_Node_Expression_Test +{ + public function compile(Twig_Compiler $compiler) + { + $compiler + ->raw('(') + ->subcompile($this->getNode('node')) + ->raw(' % 2 == 0') + ->raw(')') + ; + } +} diff --git a/inc/lib/Twig/Node/Expression/Test/Null.php b/inc/lib/Twig/Node/Expression/Test/Null.php new file mode 100644 index 00000000..1c83825a --- /dev/null +++ b/inc/lib/Twig/Node/Expression/Test/Null.php @@ -0,0 +1,31 @@ +<?php + +/* + * This file is part of Twig. + * + * (c) 2011 Fabien Potencier + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/** + * Checks that a variable is null. + * + * <pre> + * {{ var is none }} + * </pre> + * + * @author Fabien Potencier <fabien@symfony.com> + */ +class Twig_Node_Expression_Test_Null extends Twig_Node_Expression_Test +{ + public function compile(Twig_Compiler $compiler) + { + $compiler + ->raw('(null === ') + ->subcompile($this->getNode('node')) + ->raw(')') + ; + } +} diff --git a/inc/lib/Twig/Node/Expression/Test/Odd.php b/inc/lib/Twig/Node/Expression/Test/Odd.php new file mode 100644 index 00000000..421c19e8 --- /dev/null +++ b/inc/lib/Twig/Node/Expression/Test/Odd.php @@ -0,0 +1,32 @@ +<?php + +/* + * This file is part of Twig. + * + * (c) 2011 Fabien Potencier + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/** + * Checks if a number is odd. + * + * <pre> + * {{ var is odd }} + * </pre> + * + * @author Fabien Potencier <fabien@symfony.com> + */ +class Twig_Node_Expression_Test_Odd extends Twig_Node_Expression_Test +{ + public function compile(Twig_Compiler $compiler) + { + $compiler + ->raw('(') + ->subcompile($this->getNode('node')) + ->raw(' % 2 == 1') + ->raw(')') + ; + } +} diff --git a/inc/lib/Twig/Node/Expression/Test/Sameas.php b/inc/lib/Twig/Node/Expression/Test/Sameas.php new file mode 100644 index 00000000..b48905ee --- /dev/null +++ b/inc/lib/Twig/Node/Expression/Test/Sameas.php @@ -0,0 +1,29 @@ +<?php + +/* + * This file is part of Twig. + * + * (c) 2011 Fabien Potencier + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/** + * Checks if a variable is the same as another one (=== in PHP). + * + * @author Fabien Potencier <fabien@symfony.com> + */ +class Twig_Node_Expression_Test_Sameas extends Twig_Node_Expression_Test +{ + public function compile(Twig_Compiler $compiler) + { + $compiler + ->raw('(') + ->subcompile($this->getNode('node')) + ->raw(' === ') + ->subcompile($this->getNode('arguments')->getNode(0)) + ->raw(')') + ; + } +} diff --git a/inc/lib/Twig/Node/Flush.php b/inc/lib/Twig/Node/Flush.php new file mode 100644 index 00000000..0467ddce --- /dev/null +++ b/inc/lib/Twig/Node/Flush.php @@ -0,0 +1,36 @@ +<?php + +/* + * This file is part of Twig. + * + * (c) 2011 Fabien Potencier + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/** + * Represents a flush node. + * + * @author Fabien Potencier <fabien@symfony.com> + */ +class Twig_Node_Flush extends Twig_Node +{ + public function __construct($lineno, $tag) + { + parent::__construct(array(), array(), $lineno, $tag); + } + + /** + * Compiles the node to PHP. + * + * @param Twig_Compiler A Twig_Compiler instance + */ + public function compile(Twig_Compiler $compiler) + { + $compiler + ->addDebugInfo($this) + ->write("flush();\n") + ; + } +} diff --git a/inc/lib/Twig/Node/For.php b/inc/lib/Twig/Node/For.php index eb204e28..d1ff371d 100644 --- a/inc/lib/Twig/Node/For.php +++ b/inc/lib/Twig/Node/For.php @@ -13,14 +13,21 @@ /** * Represents a for node. * - * @package twig - * @author Fabien Potencier <fabien@symfony.com> + * @author Fabien Potencier <fabien@symfony.com> */ class Twig_Node_For extends Twig_Node { + protected $loop; + public function __construct(Twig_Node_Expression_AssignName $keyTarget, Twig_Node_Expression_AssignName $valueTarget, Twig_Node_Expression $seq, Twig_Node_Expression $ifexpr = null, Twig_NodeInterface $body, Twig_NodeInterface $else = null, $lineno, $tag = null) { - parent::__construct(array('key_target' => $keyTarget, 'value_target' => $valueTarget, 'seq' => $seq, 'ifexpr' => $ifexpr, 'body' => $body, 'else' => $else), array('with_loop' => true), $lineno, $tag); + $body = new Twig_Node(array($body, $this->loop = new Twig_Node_ForLoop($lineno, $tag))); + + if (null !== $ifexpr) { + $body = new Twig_Node_If(new Twig_Node(array($ifexpr, $body)), null, $lineno, $tag); + } + + parent::__construct(array('key_target' => $keyTarget, 'value_target' => $valueTarget, 'seq' => $seq, 'body' => $body, 'else' => $else), array('with_loop' => true, 'ifexpr' => null !== $ifexpr), $lineno, $tag); } /** @@ -53,7 +60,7 @@ class Twig_Node_For extends Twig_Node ->write(");\n") ; - if (null === $this->getNode('ifexpr')) { + if (!$this->getAttribute('ifexpr')) { $compiler ->write("if (is_array(\$context['_seq']) || (is_object(\$context['_seq']) && \$context['_seq'] instanceof Countable)) {\n") ->indent() @@ -68,6 +75,10 @@ class Twig_Node_For extends Twig_Node } } + $this->loop->setAttribute('else', null !== $this->getNode('else')); + $this->loop->setAttribute('with_loop', $this->getAttribute('with_loop')); + $this->loop->setAttribute('ifexpr', $this->getAttribute('ifexpr')); + $compiler ->write("foreach (\$context['_seq'] as ") ->subcompile($this->getNode('key_target')) @@ -75,47 +86,7 @@ class Twig_Node_For extends Twig_Node ->subcompile($this->getNode('value_target')) ->raw(") {\n") ->indent() - ; - - if (null !== $this->getNode('ifexpr')) { - $compiler - ->write("if (!(") - ->subcompile($this->getNode('ifexpr')) - ->raw(")) {\n") - ->indent() - ->write("continue;\n") - ->outdent() - ->write("}\n\n") - ; - } - - $compiler->subcompile($this->getNode('body')); - - if (null !== $this->getNode('else')) { - $compiler->write("\$context['_iterated'] = true;\n"); - } - - if ($this->getAttribute('with_loop')) { - $compiler - ->write("++\$context['loop']['index0'];\n") - ->write("++\$context['loop']['index'];\n") - ->write("\$context['loop']['first'] = false;\n") - ; - - if (null === $this->getNode('ifexpr')) { - $compiler - ->write("if (isset(\$context['loop']['length'])) {\n") - ->indent() - ->write("--\$context['loop']['revindex0'];\n") - ->write("--\$context['loop']['revindex'];\n") - ->write("\$context['loop']['last'] = 0 === \$context['loop']['revindex0'];\n") - ->outdent() - ->write("}\n") - ; - } - } - - $compiler + ->subcompile($this->getNode('body')) ->outdent() ->write("}\n") ; @@ -136,6 +107,6 @@ class Twig_Node_For extends Twig_Node $compiler->write('unset($context[\'_seq\'], $context[\'_iterated\'], $context[\''.$this->getNode('key_target')->getAttribute('name').'\'], $context[\''.$this->getNode('value_target')->getAttribute('name').'\'], $context[\'_parent\'], $context[\'loop\']);'."\n"); // keep the values set in the inner context for variables defined in the outer context - $compiler->write("\$context = array_merge(\$_parent, array_intersect_key(\$context, \$_parent));\n"); + $compiler->write("\$context = array_intersect_key(\$context, \$_parent) + \$_parent;\n"); } } diff --git a/inc/lib/Twig/Node/ForLoop.php b/inc/lib/Twig/Node/ForLoop.php new file mode 100644 index 00000000..b8841583 --- /dev/null +++ b/inc/lib/Twig/Node/ForLoop.php @@ -0,0 +1,55 @@ +<?php + +/* + * This file is part of Twig. + * + * (c) 2011 Fabien Potencier + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/** + * Internal node used by the for node. + * + * @author Fabien Potencier <fabien@symfony.com> + */ +class Twig_Node_ForLoop extends Twig_Node +{ + public function __construct($lineno, $tag = null) + { + parent::__construct(array(), array('with_loop' => false, 'ifexpr' => false, 'else' => false), $lineno, $tag); + } + + /** + * Compiles the node to PHP. + * + * @param Twig_Compiler A Twig_Compiler instance + */ + public function compile(Twig_Compiler $compiler) + { + if ($this->getAttribute('else')) { + $compiler->write("\$context['_iterated'] = true;\n"); + } + + if ($this->getAttribute('with_loop')) { + $compiler + ->write("++\$context['loop']['index0'];\n") + ->write("++\$context['loop']['index'];\n") + ->write("\$context['loop']['first'] = false;\n") + ; + + if (!$this->getAttribute('ifexpr')) { + $compiler + ->write("if (isset(\$context['loop']['length'])) {\n") + ->indent() + ->write("--\$context['loop']['revindex0'];\n") + ->write("--\$context['loop']['revindex'];\n") + ->write("\$context['loop']['last'] = 0 === \$context['loop']['revindex0'];\n") + ->outdent() + ->write("}\n") + ; + } + } + } +} diff --git a/inc/lib/Twig/Node/If.php b/inc/lib/Twig/Node/If.php index aa12efbe..4296a8d6 100644 --- a/inc/lib/Twig/Node/If.php +++ b/inc/lib/Twig/Node/If.php @@ -13,8 +13,7 @@ /** * Represents an if node. * - * @package twig - * @author Fabien Potencier <fabien@symfony.com> + * @author Fabien Potencier <fabien@symfony.com> */ class Twig_Node_If extends Twig_Node { diff --git a/inc/lib/Twig/Node/Import.php b/inc/lib/Twig/Node/Import.php index a327411d..99efc091 100644 --- a/inc/lib/Twig/Node/Import.php +++ b/inc/lib/Twig/Node/Import.php @@ -12,8 +12,7 @@ /** * Represents an import node. * - * @package twig - * @author Fabien Potencier <fabien@symfony.com> + * @author Fabien Potencier <fabien@symfony.com> */ class Twig_Node_Import extends Twig_Node { diff --git a/inc/lib/Twig/Node/Include.php b/inc/lib/Twig/Node/Include.php index 467749b5..ed4a3751 100644 --- a/inc/lib/Twig/Node/Include.php +++ b/inc/lib/Twig/Node/Include.php @@ -13,8 +13,7 @@ /** * Represents an include node. * - * @package twig - * @author Fabien Potencier <fabien@symfony.com> + * @author Fabien Potencier <fabien@symfony.com> */ class Twig_Node_Include extends Twig_Node implements Twig_NodeOutputInterface { @@ -39,21 +38,46 @@ class Twig_Node_Include extends Twig_Node implements Twig_NodeOutputInterface ; } + $this->addGetTemplate($compiler); + + $compiler->raw('->display('); + + $this->addTemplateArguments($compiler); + + $compiler->raw(");\n"); + + if ($this->getAttribute('ignore_missing')) { + $compiler + ->outdent() + ->write("} catch (Twig_Error_Loader \$e) {\n") + ->indent() + ->write("// ignore missing template\n") + ->outdent() + ->write("}\n\n") + ; + } + } + + protected function addGetTemplate(Twig_Compiler $compiler) + { if ($this->getNode('expr') instanceof Twig_Node_Expression_Constant) { $compiler ->write("\$this->env->loadTemplate(") ->subcompile($this->getNode('expr')) - ->raw(")->display(") + ->raw(")") ; } else { $compiler ->write("\$template = \$this->env->resolveTemplate(") ->subcompile($this->getNode('expr')) ->raw(");\n") - ->write('$template->display(') + ->write('$template') ; } + } + protected function addTemplateArguments(Twig_Compiler $compiler) + { if (false === $this->getAttribute('only')) { if (null === $this->getNode('variables')) { $compiler->raw('$context'); @@ -71,18 +95,5 @@ class Twig_Node_Include extends Twig_Node implements Twig_NodeOutputInterface $compiler->subcompile($this->getNode('variables')); } } - - $compiler->raw(");\n"); - - if ($this->getAttribute('ignore_missing')) { - $compiler - ->outdent() - ->write("} catch (Twig_Error_Loader \$e) {\n") - ->indent() - ->write("// ignore missing template\n") - ->outdent() - ->write("}\n\n") - ; - } } } diff --git a/inc/lib/Twig/Node/Macro.php b/inc/lib/Twig/Node/Macro.php index 9f95570f..89910618 100644 --- a/inc/lib/Twig/Node/Macro.php +++ b/inc/lib/Twig/Node/Macro.php @@ -12,8 +12,7 @@ /** * Represents a macro node. * - * @package twig - * @author Fabien Potencier <fabien@symfony.com> + * @author Fabien Potencier <fabien@symfony.com> */ class Twig_Node_Macro extends Twig_Node { @@ -29,43 +28,67 @@ class Twig_Node_Macro extends Twig_Node */ public function compile(Twig_Compiler $compiler) { - $arguments = array(); - foreach ($this->getNode('arguments') as $argument) { - $arguments[] = '$'.$argument->getAttribute('name').' = null'; + $compiler + ->addDebugInfo($this) + ->write(sprintf("public function get%s(", $this->getAttribute('name'))) + ; + + $count = count($this->getNode('arguments')); + $pos = 0; + foreach ($this->getNode('arguments') as $name => $default) { + $compiler + ->raw('$_'.$name.' = ') + ->subcompile($default) + ; + + if (++$pos < $count) { + $compiler->raw(', '); + } } $compiler - ->addDebugInfo($this) - ->write(sprintf("public function get%s(%s)\n", $this->getAttribute('name'), implode(', ', $arguments)), "{\n") - ->indent() - ->write("\$context = array_merge(\$this->env->getGlobals(), array(\n") + ->raw(")\n") + ->write("{\n") ->indent() ; - foreach ($this->getNode('arguments') as $argument) { + if (!count($this->getNode('arguments'))) { + $compiler->write("\$context = \$this->env->getGlobals();\n\n"); + } else { $compiler - ->write('') - ->string($argument->getAttribute('name')) - ->raw(' => $'.$argument->getAttribute('name')) - ->raw(",\n") + ->write("\$context = \$this->env->mergeGlobals(array(\n") + ->indent() + ; + + foreach ($this->getNode('arguments') as $name => $default) { + $compiler + ->write('') + ->string($name) + ->raw(' => $_'.$name) + ->raw(",\n") + ; + } + + $compiler + ->outdent() + ->write("));\n\n") ; } $compiler - ->outdent() - ->write("));\n\n") + ->write("\$blocks = array();\n\n") ->write("ob_start();\n") ->write("try {\n") ->indent() ->subcompile($this->getNode('body')) ->outdent() - ->write("} catch(Exception \$e) {\n") + ->write("} catch (Exception \$e) {\n") ->indent() ->write("ob_end_clean();\n\n") ->write("throw \$e;\n") ->outdent() ->write("}\n\n") - ->write("return ob_get_clean();\n") + ->write("return ('' === \$tmp = ob_get_clean()) ? '' : new Twig_Markup(\$tmp, \$this->env->getCharset());\n") ->outdent() ->write("}\n\n") ; diff --git a/inc/lib/Twig/Node/Module.php b/inc/lib/Twig/Node/Module.php index 9b8c55e3..585048b8 100644 --- a/inc/lib/Twig/Node/Module.php +++ b/inc/lib/Twig/Node/Module.php @@ -13,14 +13,19 @@ /** * Represents a module node. * - * @package twig - * @author Fabien Potencier <fabien@symfony.com> + * @author Fabien Potencier <fabien@symfony.com> */ class Twig_Node_Module extends Twig_Node { - public function __construct(Twig_NodeInterface $body, Twig_Node_Expression $parent = null, Twig_NodeInterface $blocks, Twig_NodeInterface $macros, Twig_NodeInterface $traits, $filename) + public function __construct(Twig_NodeInterface $body, Twig_Node_Expression $parent = null, Twig_NodeInterface $blocks, Twig_NodeInterface $macros, Twig_NodeInterface $traits, $embeddedTemplates, $filename) { - parent::__construct(array('parent' => $parent, 'body' => $body, 'blocks' => $blocks, 'macros' => $macros, 'traits' => $traits), array('filename' => $filename), 1); + // embedded templates are set as attributes so that they are only visited once by the visitors + parent::__construct(array('parent' => $parent, 'body' => $body, 'blocks' => $blocks, 'macros' => $macros, 'traits' => $traits), array('filename' => $filename, 'index' => null, 'embedded_templates' => $embeddedTemplates), 1); + } + + public function setIndex($index) + { + $this->setAttribute('index', $index); } /** @@ -31,13 +36,21 @@ class Twig_Node_Module extends Twig_Node public function compile(Twig_Compiler $compiler) { $this->compileTemplate($compiler); + + foreach ($this->getAttribute('embedded_templates') as $template) { + $compiler->subcompile($template); + } } protected function compileTemplate(Twig_Compiler $compiler) { + if (!$this->getAttribute('index')) { + $compiler->write('<?php'); + } + $this->compileClassHeader($compiler); - if (count($this->getNode('blocks')) || count($this->getNode('traits'))) { + if (count($this->getNode('blocks')) || count($this->getNode('traits')) || null === $this->getNode('parent') || $this->getNode('parent') instanceof Twig_Node_Expression_Constant) { $this->compileConstructor($compiler); } @@ -57,29 +70,31 @@ class Twig_Node_Module extends Twig_Node $this->compileIsTraitable($compiler); + $this->compileDebugInfo($compiler); + $this->compileClassFooter($compiler); } protected function compileGetParent(Twig_Compiler $compiler) { + if (null === $this->getNode('parent')) { + return; + } + $compiler ->write("protected function doGetParent(array \$context)\n", "{\n") ->indent() ->write("return ") ; - if (null === $this->getNode('parent')) { - $compiler->raw("false"); + if ($this->getNode('parent') instanceof Twig_Node_Expression_Constant) { + $compiler->subcompile($this->getNode('parent')); } else { - if ($this->getNode('parent') instanceof Twig_Node_Expression_Constant) { - $compiler->subcompile($this->getNode('parent')); - } else { - $compiler - ->raw("\$this->env->resolveTemplate(") - ->subcompile($this->getNode('parent')) - ->raw(")") - ; - } + $compiler + ->raw("\$this->env->resolveTemplate(") + ->subcompile($this->getNode('parent')) + ->raw(")") + ; } $compiler @@ -91,21 +106,25 @@ class Twig_Node_Module extends Twig_Node protected function compileDisplayBody(Twig_Compiler $compiler) { - $compiler->write("\$context = array_merge(\$this->env->getGlobals(), \$context);\n\n"); $compiler->subcompile($this->getNode('body')); if (null !== $this->getNode('parent')) { - $compiler->write("\$this->getParent(\$context)->display(\$context, array_merge(\$this->blocks, \$blocks));\n"); + if ($this->getNode('parent') instanceof Twig_Node_Expression_Constant) { + $compiler->write("\$this->parent"); + } else { + $compiler->write("\$this->getParent(\$context)"); + } + $compiler->raw("->display(\$context, array_merge(\$this->blocks, \$blocks));\n"); } } protected function compileClassHeader(Twig_Compiler $compiler) { $compiler - ->write("<?php\n\n") + ->write("\n\n") // if the filename contains */, add a blank to avoid a PHP parse error ->write("/* ".str_replace('*/', '* /', $this->getAttribute('filename'))." */\n") - ->write('class '.$compiler->getEnvironment()->getTemplateClass($this->getAttribute('filename'))) + ->write('class '.$compiler->getEnvironment()->getTemplateClass($this->getAttribute('filename'), $this->getAttribute('index'))) ->raw(sprintf(" extends %s\n", $compiler->getEnvironment()->getBaseTemplateClass())) ->write("{\n") ->indent() @@ -120,6 +139,17 @@ class Twig_Node_Module extends Twig_Node ->write("parent::__construct(\$env);\n\n") ; + // parent + if (null === $this->getNode('parent')) { + $compiler->write("\$this->parent = false;\n\n"); + } elseif ($this->getNode('parent') instanceof Twig_Node_Expression_Constant) { + $compiler + ->write("\$this->parent = \$this->env->loadTemplate(") + ->subcompile($this->getNode('parent')) + ->raw(");\n\n") + ; + } + $countTraits = count($this->getNode('traits')); if ($countTraits) { // traits @@ -151,18 +181,32 @@ class Twig_Node_Module extends Twig_Node } } - $compiler - ->write("\$this->blocks = array_merge(\n") - ->indent() - ; + if ($countTraits > 1) { + $compiler + ->write("\$this->traits = array_merge(\n") + ->indent() + ; + + for ($i = 0; $i < $countTraits; $i++) { + $compiler + ->write(sprintf("\$_trait_%s_blocks".($i == $countTraits - 1 ? '' : ',')."\n", $i)) + ; + } - for ($i = 0; $i < $countTraits; $i++) { $compiler - ->write(sprintf("\$_trait_%s_blocks,\n", $i)) + ->outdent() + ->write(");\n\n") + ; + } else { + $compiler + ->write("\$this->traits = \$_trait_0_blocks;\n\n") ; } $compiler + ->write("\$this->blocks = array_merge(\n") + ->indent() + ->write("\$this->traits,\n") ->write("array(\n") ; } else { @@ -250,11 +294,21 @@ class Twig_Node_Module extends Twig_Node // only contains blocks and use statements. $traitable = null === $this->getNode('parent') && 0 === count($this->getNode('macros')); if ($traitable) { - if (!count($nodes = $this->getNode('body'))) { - $nodes = new Twig_Node(array($this->getNode('body'))); + if ($this->getNode('body') instanceof Twig_Node_Body) { + $nodes = $this->getNode('body')->getNode(0); + } else { + $nodes = $this->getNode('body'); + } + + if (!count($nodes)) { + $nodes = new Twig_Node(array($nodes)); } foreach ($nodes as $node) { + if (!count($node)) { + continue; + } + if ($node instanceof Twig_Node_Text && ctype_space($node->getAttribute('data'))) { continue; } @@ -268,16 +322,31 @@ class Twig_Node_Module extends Twig_Node } } + if ($traitable) { + return; + } + $compiler ->write("public function isTraitable()\n", "{\n") ->indent() ->write(sprintf("return %s;\n", $traitable ? 'true' : 'false')) ->outdent() + ->write("}\n\n") + ; + } + + protected function compileDebugInfo(Twig_Compiler $compiler) + { + $compiler + ->write("public function getDebugInfo()\n", "{\n") + ->indent() + ->write(sprintf("return %s;\n", str_replace("\n", '', var_export(array_reverse($compiler->getDebugInfo(), true), true)))) + ->outdent() ->write("}\n") ; } - public function compileLoadTemplate(Twig_Compiler $compiler, $node, $var) + protected function compileLoadTemplate(Twig_Compiler $compiler, $node, $var) { if ($node instanceof Twig_Node_Expression_Constant) { $compiler diff --git a/inc/lib/Twig/Node/Print.php b/inc/lib/Twig/Node/Print.php index 766725ff..b0c41d1d 100644 --- a/inc/lib/Twig/Node/Print.php +++ b/inc/lib/Twig/Node/Print.php @@ -13,8 +13,7 @@ /** * Represents a node that outputs an expression. * - * @package twig - * @author Fabien Potencier <fabien@symfony.com> + * @author Fabien Potencier <fabien@symfony.com> */ class Twig_Node_Print extends Twig_Node implements Twig_NodeOutputInterface { diff --git a/inc/lib/Twig/Node/Sandbox.php b/inc/lib/Twig/Node/Sandbox.php index cbfcb411..8cf3ed44 100644 --- a/inc/lib/Twig/Node/Sandbox.php +++ b/inc/lib/Twig/Node/Sandbox.php @@ -12,8 +12,7 @@ /** * Represents a sandbox node. * - * @package twig - * @author Fabien Potencier <fabien@symfony.com> + * @author Fabien Potencier <fabien@symfony.com> */ class Twig_Node_Sandbox extends Twig_Node { diff --git a/inc/lib/Twig/Node/SandboxedModule.php b/inc/lib/Twig/Node/SandboxedModule.php index 36d9f198..be1f5daa 100644 --- a/inc/lib/Twig/Node/SandboxedModule.php +++ b/inc/lib/Twig/Node/SandboxedModule.php @@ -13,8 +13,7 @@ /** * Represents a module node. * - * @package twig - * @author Fabien Potencier <fabien@symfony.com> + * @author Fabien Potencier <fabien@symfony.com> */ class Twig_Node_SandboxedModule extends Twig_Node_Module { @@ -24,7 +23,9 @@ class Twig_Node_SandboxedModule extends Twig_Node_Module public function __construct(Twig_Node_Module $node, array $usedFilters, array $usedTags, array $usedFunctions) { - parent::__construct($node->getNode('body'), $node->getNode('parent'), $node->getNode('blocks'), $node->getNode('macros'), $node->getNode('traits'), $node->getAttribute('filename'), $node->getLine(), $node->getNodeTag()); + parent::__construct($node->getNode('body'), $node->getNode('parent'), $node->getNode('blocks'), $node->getNode('macros'), $node->getNode('traits'), $node->getAttribute('embedded_templates'), $node->getAttribute('filename'), $node->getLine(), $node->getNodeTag()); + + $this->setAttribute('index', $node->getAttribute('index')); $this->usedFilters = $usedFilters; $this->usedTags = $usedTags; @@ -33,9 +34,7 @@ class Twig_Node_SandboxedModule extends Twig_Node_Module protected function compileDisplayBody(Twig_Compiler $compiler) { - if (null === $this->getNode('parent')) { - $compiler->write("\$this->checkSecurity();\n"); - } + $compiler->write("\$this->checkSecurity();\n"); parent::compileDisplayBody($compiler); } @@ -45,7 +44,7 @@ class Twig_Node_SandboxedModule extends Twig_Node_Module parent::compileDisplayFooter($compiler); $compiler - ->write("protected function checkSecurity() {\n") + ->write("protected function checkSecurity()\n", "{\n") ->indent() ->write("\$this->env->getExtension('sandbox')->checkSecurity(\n") ->indent() @@ -54,16 +53,6 @@ class Twig_Node_SandboxedModule extends Twig_Node_Module ->write(!$this->usedFunctions ? "array()\n" : "array('".implode('\', \'', $this->usedFunctions)."')\n") ->outdent() ->write(");\n") - ; - - if (null !== $this->getNode('parent')) { - $compiler - ->raw("\n") - ->write("\$this->parent->checkSecurity();\n") - ; - } - - $compiler ->outdent() ->write("}\n\n") ; diff --git a/inc/lib/Twig/Node/SandboxedPrint.php b/inc/lib/Twig/Node/SandboxedPrint.php index 77730d8c..73dfaa96 100644 --- a/inc/lib/Twig/Node/SandboxedPrint.php +++ b/inc/lib/Twig/Node/SandboxedPrint.php @@ -17,8 +17,7 @@ * and if the sandbox is enabled, we need to check that the __toString() * method is allowed if 'article' is an object. * - * @package twig - * @author Fabien Potencier <fabien@symfony.com> + * @author Fabien Potencier <fabien@symfony.com> */ class Twig_Node_SandboxedPrint extends Twig_Node_Print { diff --git a/inc/lib/Twig/Node/Set.php b/inc/lib/Twig/Node/Set.php index 9913664f..4c9c16ce 100644 --- a/inc/lib/Twig/Node/Set.php +++ b/inc/lib/Twig/Node/Set.php @@ -12,8 +12,7 @@ /** * Represents a set node. * - * @package twig - * @author Fabien Potencier <fabien@symfony.com> + * @author Fabien Potencier <fabien@symfony.com> */ class Twig_Node_Set extends Twig_Node { @@ -67,7 +66,7 @@ class Twig_Node_Set extends Twig_Node $compiler->subcompile($this->getNode('names'), false); if ($this->getAttribute('capture')) { - $compiler->raw(" = new Twig_Markup(ob_get_clean())"); + $compiler->raw(" = ('' === \$tmp = ob_get_clean()) ? '' : new Twig_Markup(\$tmp, \$this->env->getCharset())"); } } @@ -87,9 +86,9 @@ class Twig_Node_Set extends Twig_Node } else { if ($this->getAttribute('safe')) { $compiler - ->raw("new Twig_Markup(") + ->raw("('' === \$tmp = ") ->subcompile($this->getNode('values')) - ->raw(")") + ->raw(") ? '' : new Twig_Markup(\$tmp, \$this->env->getCharset())") ; } else { $compiler->subcompile($this->getNode('values')); diff --git a/inc/lib/Twig/Node/SetTemp.php b/inc/lib/Twig/Node/SetTemp.php new file mode 100644 index 00000000..3bdd1cb7 --- /dev/null +++ b/inc/lib/Twig/Node/SetTemp.php @@ -0,0 +1,35 @@ +<?php + +/* + * This file is part of Twig. + * + * (c) 2011 Fabien Potencier + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +class Twig_Node_SetTemp extends Twig_Node +{ + public function __construct($name, $lineno) + { + parent::__construct(array(), array('name' => $name), $lineno); + } + + public function compile(Twig_Compiler $compiler) + { + $name = $this->getAttribute('name'); + $compiler + ->addDebugInfo($this) + ->write('if (isset($context[') + ->string($name) + ->raw('])) { $_') + ->raw($name) + ->raw('_ = $context[') + ->repr($name) + ->raw(']; } else { $_') + ->raw($name) + ->raw("_ = null; }\n") + ; + } +} diff --git a/inc/lib/Twig/Node/Spaceless.php b/inc/lib/Twig/Node/Spaceless.php index 46013466..7555fa0f 100644 --- a/inc/lib/Twig/Node/Spaceless.php +++ b/inc/lib/Twig/Node/Spaceless.php @@ -14,8 +14,7 @@ * * It removes spaces between HTML tags. * - * @package twig - * @author Fabien Potencier <fabien@symfony.com> + * @author Fabien Potencier <fabien@symfony.com> */ class Twig_Node_Spaceless extends Twig_Node { diff --git a/inc/lib/Twig/Node/Text.php b/inc/lib/Twig/Node/Text.php index 0c1c0928..21bdcea1 100644 --- a/inc/lib/Twig/Node/Text.php +++ b/inc/lib/Twig/Node/Text.php @@ -13,8 +13,7 @@ /** * Represents a text node. * - * @package twig - * @author Fabien Potencier <fabien@symfony.com> + * @author Fabien Potencier <fabien@symfony.com> */ class Twig_Node_Text extends Twig_Node implements Twig_NodeOutputInterface { diff --git a/inc/lib/Twig/NodeInterface.php b/inc/lib/Twig/NodeInterface.php index 165aed4d..f0ef7258 100644 --- a/inc/lib/Twig/NodeInterface.php +++ b/inc/lib/Twig/NodeInterface.php @@ -12,19 +12,19 @@ /** * Represents a node in the AST. * - * @package twig - * @author Fabien Potencier <fabien@symfony.com> + * @author Fabien Potencier <fabien@symfony.com> + * @deprecated since 1.12 (to be removed in 2.0) */ -interface Twig_NodeInterface +interface Twig_NodeInterface extends Countable, IteratorAggregate { /** * Compiles the node to PHP. * * @param Twig_Compiler A Twig_Compiler instance */ - function compile(Twig_Compiler $compiler); + public function compile(Twig_Compiler $compiler); - function getLine(); + public function getLine(); - function getNodeTag(); + public function getNodeTag(); } diff --git a/inc/lib/Twig/NodeOutputInterface.php b/inc/lib/Twig/NodeOutputInterface.php index 71839569..22172c09 100644 --- a/inc/lib/Twig/NodeOutputInterface.php +++ b/inc/lib/Twig/NodeOutputInterface.php @@ -12,8 +12,7 @@ /** * Represents a displayable node in the AST. * - * @package twig - * @author Fabien Potencier <fabien@symfony.com> + * @author Fabien Potencier <fabien@symfony.com> */ interface Twig_NodeOutputInterface { diff --git a/inc/lib/Twig/NodeTraverser.php b/inc/lib/Twig/NodeTraverser.php index 1e82b032..28cba1ad 100644 --- a/inc/lib/Twig/NodeTraverser.php +++ b/inc/lib/Twig/NodeTraverser.php @@ -14,8 +14,7 @@ * * It visits all nodes and their children and call the given visitor for each. * - * @package twig - * @author Fabien Potencier <fabien@symfony.com> + * @author Fabien Potencier <fabien@symfony.com> */ class Twig_NodeTraverser { diff --git a/inc/lib/Twig/NodeVisitor/Escaper.php b/inc/lib/Twig/NodeVisitor/Escaper.php index 049ce96a..cc4b3d71 100644 --- a/inc/lib/Twig/NodeVisitor/Escaper.php +++ b/inc/lib/Twig/NodeVisitor/Escaper.php @@ -12,18 +12,18 @@ /** * Twig_NodeVisitor_Escaper implements output escaping. * - * @package twig - * @author Fabien Potencier <fabien@symfony.com> + * @author Fabien Potencier <fabien@symfony.com> */ class Twig_NodeVisitor_Escaper implements Twig_NodeVisitorInterface { protected $statusStack = array(); protected $blocks = array(); - protected $safeAnalysis; protected $traverser; + protected $defaultStrategy = false; + protected $safeVars = array(); - function __construct() + public function __construct() { $this->safeAnalysis = new Twig_NodeVisitor_SafeAnalysis(); } @@ -34,14 +34,21 @@ class Twig_NodeVisitor_Escaper implements Twig_NodeVisitorInterface * @param Twig_NodeInterface $node The node to visit * @param Twig_Environment $env The Twig environment instance * - * @param Twig_NodeInterface The modified node + * @return Twig_NodeInterface The modified node */ public function enterNode(Twig_NodeInterface $node, Twig_Environment $env) { - if ($node instanceof Twig_Node_AutoEscape) { + if ($node instanceof Twig_Node_Module) { + if ($env->hasExtension('escaper') && $defaultStrategy = $env->getExtension('escaper')->getDefaultStrategy($node->getAttribute('filename'))) { + $this->defaultStrategy = $defaultStrategy; + } + $this->safeVars = array(); + } elseif ($node instanceof Twig_Node_AutoEscape) { $this->statusStack[] = $node->getAttribute('value'); } elseif ($node instanceof Twig_Node_Block) { $this->statusStack[] = isset($this->blocks[$node->getAttribute('name')]) ? $this->blocks[$node->getAttribute('name')] : $this->needEscaping($env); + } elseif ($node instanceof Twig_Node_Import) { + $this->safeVars[] = $node->getNode('var')->getAttribute('name'); } return $node; @@ -53,11 +60,14 @@ class Twig_NodeVisitor_Escaper implements Twig_NodeVisitorInterface * @param Twig_NodeInterface $node The node to visit * @param Twig_Environment $env The Twig environment instance * - * @param Twig_NodeInterface The modified node + * @return Twig_NodeInterface The modified node */ public function leaveNode(Twig_NodeInterface $node, Twig_Environment $env) { - if ($node instanceof Twig_Node_Expression_Filter) { + if ($node instanceof Twig_Node_Module) { + $this->defaultStrategy = false; + $this->safeVars = array(); + } elseif ($node instanceof Twig_Node_Expression_Filter) { return $this->preEscapeFilterNode($node, $env); } elseif ($node instanceof Twig_Node_Print) { return $this->escapePrintNode($node, $env, $this->needEscaping($env)); @@ -96,22 +106,18 @@ class Twig_NodeVisitor_Escaper implements Twig_NodeVisitorInterface { $name = $filter->getNode('filter')->getAttribute('value'); - if (false !== $f = $env->getFilter($name)) { - $type = $f->getPreEscape(); - if (null === $type) { - return $filter; - } - - $node = $filter->getNode('node'); - if ($this->isSafeFor($type, $node, $env)) { - return $filter; - } - - $filter->setNode('node', $this->getEscaperFilter($type, $node)); + $type = $env->getFilter($name)->getPreEscape(); + if (null === $type) { + return $filter; + } + $node = $filter->getNode('node'); + if ($this->isSafeFor($type, $node, $env)) { return $filter; } + $filter->setNode('node', $this->getEscaperFilter($type, $node)); + return $filter; } @@ -123,6 +129,9 @@ class Twig_NodeVisitor_Escaper implements Twig_NodeVisitorInterface if (null === $this->traverser) { $this->traverser = new Twig_NodeTraverser($env, array($this->safeAnalysis)); } + + $this->safeAnalysis->setSafeVars($this->safeVars); + $this->traverser->traverse($expression); $safe = $this->safeAnalysis->getSafe($expression); } @@ -136,18 +145,15 @@ class Twig_NodeVisitor_Escaper implements Twig_NodeVisitorInterface return $this->statusStack[count($this->statusStack) - 1]; } - if ($env->hasExtension('escaper') && $env->getExtension('escaper')->isGlobal()) { - return 'html'; - } - - return false; + return $this->defaultStrategy ? $this->defaultStrategy : false; } protected function getEscaperFilter($type, Twig_NodeInterface $node) { $line = $node->getLine(); $name = new Twig_Node_Expression_Constant('escape', $line); - $args = new Twig_Node(array(new Twig_Node_Expression_Constant((string) $type, $line))); + $args = new Twig_Node(array(new Twig_Node_Expression_Constant((string) $type, $line), new Twig_Node_Expression_Constant(null, $line), new Twig_Node_Expression_Constant(true, $line))); + return new Twig_Node_Expression_Filter($node, $name, $args, $line); } diff --git a/inc/lib/Twig/NodeVisitor/Optimizer.php b/inc/lib/Twig/NodeVisitor/Optimizer.php index 3679746e..a254def7 100644 --- a/inc/lib/Twig/NodeVisitor/Optimizer.php +++ b/inc/lib/Twig/NodeVisitor/Optimizer.php @@ -17,8 +17,7 @@ * You can configure which optimizations you want to activate via the * optimizer mode. * - * @package twig - * @author Fabien Potencier <fabien@symfony.com> + * @author Fabien Potencier <fabien@symfony.com> */ class Twig_NodeVisitor_Optimizer implements Twig_NodeVisitorInterface { @@ -26,9 +25,12 @@ class Twig_NodeVisitor_Optimizer implements Twig_NodeVisitorInterface const OPTIMIZE_NONE = 0; const OPTIMIZE_FOR = 2; const OPTIMIZE_RAW_FILTER = 4; + const OPTIMIZE_VAR_ACCESS = 8; protected $loops = array(); protected $optimizers; + protected $prependedNodes = array(); + protected $inABody = false; /** * Constructor. @@ -53,6 +55,20 @@ class Twig_NodeVisitor_Optimizer implements Twig_NodeVisitorInterface $this->enterOptimizeFor($node, $env); } + if (!version_compare(phpversion(), '5.4.0RC1', '>=') && self::OPTIMIZE_VAR_ACCESS === (self::OPTIMIZE_VAR_ACCESS & $this->optimizers) && !$env->isStrictVariables() && !$env->hasExtension('sandbox')) { + if ($this->inABody) { + if (!$node instanceof Twig_Node_Expression) { + if (get_class($node) !== 'Twig_Node') { + array_unshift($this->prependedNodes, array()); + } + } else { + $node = $this->optimizeVariables($node, $env); + } + } elseif ($node instanceof Twig_Node_Body) { + $this->inABody = true; + } + } + return $node; } @@ -61,6 +77,8 @@ class Twig_NodeVisitor_Optimizer implements Twig_NodeVisitorInterface */ public function leaveNode(Twig_NodeInterface $node, Twig_Environment $env) { + $expression = $node instanceof Twig_Node_Expression; + if (self::OPTIMIZE_FOR === (self::OPTIMIZE_FOR & $this->optimizers)) { $this->leaveOptimizeFor($node, $env); } @@ -69,20 +87,58 @@ class Twig_NodeVisitor_Optimizer implements Twig_NodeVisitorInterface $node = $this->optimizeRawFilter($node, $env); } - $node = $this->optimizeRenderBlock($node, $env); + $node = $this->optimizePrintNode($node, $env); + + if (self::OPTIMIZE_VAR_ACCESS === (self::OPTIMIZE_VAR_ACCESS & $this->optimizers) && !$env->isStrictVariables() && !$env->hasExtension('sandbox')) { + if ($node instanceof Twig_Node_Body) { + $this->inABody = false; + } elseif ($this->inABody) { + if (!$expression && get_class($node) !== 'Twig_Node' && $prependedNodes = array_shift($this->prependedNodes)) { + $nodes = array(); + foreach (array_unique($prependedNodes) as $name) { + $nodes[] = new Twig_Node_SetTemp($name, $node->getLine()); + } + + $nodes[] = $node; + $node = new Twig_Node($nodes); + } + } + } + + return $node; + } + + protected function optimizeVariables($node, $env) + { + if ('Twig_Node_Expression_Name' === get_class($node) && $node->isSimple()) { + $this->prependedNodes[0][] = $node->getAttribute('name'); + + return new Twig_Node_Expression_TempName($node->getAttribute('name'), $node->getLine()); + } return $node; } /** - * Replaces "echo $this->renderBlock()" with "$this->displayBlock()". + * Optimizes print nodes. + * + * It replaces: + * + * * "echo $this->render(Parent)Block()" with "$this->display(Parent)Block()" * * @param Twig_NodeInterface $node A Node * @param Twig_Environment $env The current Twig environment */ - protected function optimizeRenderBlock($node, $env) + protected function optimizePrintNode($node, $env) { - if ($node instanceof Twig_Node_Print && $node->getNode('expr') instanceof Twig_Node_Expression_BlockReference) { + if (!$node instanceof Twig_Node_Print) { + return $node; + } + + if ( + $node->getNode('expr') instanceof Twig_Node_Expression_BlockReference || + $node->getNode('expr') instanceof Twig_Node_Expression_Parent + ) { $node->getNode('expr')->setAttribute('output', true); return $node->getNode('expr'); diff --git a/inc/lib/Twig/NodeVisitor/SafeAnalysis.php b/inc/lib/Twig/NodeVisitor/SafeAnalysis.php index 5961ba29..c4bbd812 100644 --- a/inc/lib/Twig/NodeVisitor/SafeAnalysis.php +++ b/inc/lib/Twig/NodeVisitor/SafeAnalysis.php @@ -3,27 +3,33 @@ class Twig_NodeVisitor_SafeAnalysis implements Twig_NodeVisitorInterface { protected $data = array(); + protected $safeVars = array(); + + public function setSafeVars($safeVars) + { + $this->safeVars = $safeVars; + } public function getSafe(Twig_NodeInterface $node) { $hash = spl_object_hash($node); if (isset($this->data[$hash])) { - foreach($this->data[$hash] as $bucket) { + foreach ($this->data[$hash] as $bucket) { if ($bucket['key'] === $node) { return $bucket['value']; } } } - return null; } protected function setSafe(Twig_NodeInterface $node, array $safe) { $hash = spl_object_hash($node); if (isset($this->data[$hash])) { - foreach($this->data[$hash] as &$bucket) { + foreach ($this->data[$hash] as &$bucket) { if ($bucket['key'] === $node) { $bucket['value'] = $safe; + return; } } @@ -59,7 +65,11 @@ class Twig_NodeVisitor_SafeAnalysis implements Twig_NodeVisitorInterface $name = $node->getNode('filter')->getAttribute('value'); $args = $node->getNode('arguments'); if (false !== $filter = $env->getFilter($name)) { - $this->setSafe($node, $filter->getSafe($args)); + $safe = $filter->getSafe($args); + if (null === $safe) { + $safe = $this->intersectSafe($this->getSafe($node->getNode('node')), $filter->getPreservesSafety()); + } + $this->setSafe($node, $safe); } else { $this->setSafe($node, array()); } @@ -73,6 +83,20 @@ class Twig_NodeVisitor_SafeAnalysis implements Twig_NodeVisitorInterface } else { $this->setSafe($node, array()); } + } elseif ($node instanceof Twig_Node_Expression_MethodCall) { + if ($node->getAttribute('safe')) { + $this->setSafe($node, array('all')); + } else { + $this->setSafe($node, array()); + } + } elseif ($node instanceof Twig_Node_Expression_GetAttr && $node->getNode('node') instanceof Twig_Node_Expression_Name) { + $name = $node->getNode('node')->getAttribute('name'); + // attributes on template instances are safe + if ('_self' == $name || in_array($name, $this->safeVars)) { + $this->setSafe($node, array('all')); + } else { + $this->setSafe($node, array()); + } } else { $this->setSafe($node, array()); } diff --git a/inc/lib/Twig/NodeVisitor/Sandbox.php b/inc/lib/Twig/NodeVisitor/Sandbox.php index 356b661f..fb27045b 100644 --- a/inc/lib/Twig/NodeVisitor/Sandbox.php +++ b/inc/lib/Twig/NodeVisitor/Sandbox.php @@ -12,8 +12,7 @@ /** * Twig_NodeVisitor_Sandbox implements sandboxing. * - * @package twig - * @author Fabien Potencier <fabien@symfony.com> + * @author Fabien Potencier <fabien@symfony.com> */ class Twig_NodeVisitor_Sandbox implements Twig_NodeVisitorInterface { @@ -28,7 +27,7 @@ class Twig_NodeVisitor_Sandbox implements Twig_NodeVisitorInterface * @param Twig_NodeInterface $node The node to visit * @param Twig_Environment $env The Twig environment instance * - * @param Twig_NodeInterface The modified node + * @return Twig_NodeInterface The modified node */ public function enterNode(Twig_NodeInterface $node, Twig_Environment $env) { @@ -70,7 +69,7 @@ class Twig_NodeVisitor_Sandbox implements Twig_NodeVisitorInterface * @param Twig_NodeInterface $node The node to visit * @param Twig_Environment $env The Twig environment instance * - * @param Twig_NodeInterface The modified node + * @return Twig_NodeInterface The modified node */ public function leaveNode(Twig_NodeInterface $node, Twig_Environment $env) { diff --git a/inc/lib/Twig/NodeVisitorInterface.php b/inc/lib/Twig/NodeVisitorInterface.php index d44e510c..f33c13fc 100644 --- a/inc/lib/Twig/NodeVisitorInterface.php +++ b/inc/lib/Twig/NodeVisitorInterface.php @@ -12,8 +12,7 @@ /** * Twig_NodeVisitorInterface is the interface the all node visitor classes must implement. * - * @package twig - * @author Fabien Potencier <fabien@symfony.com> + * @author Fabien Potencier <fabien@symfony.com> */ interface Twig_NodeVisitorInterface { @@ -23,9 +22,9 @@ interface Twig_NodeVisitorInterface * @param Twig_NodeInterface $node The node to visit * @param Twig_Environment $env The Twig environment instance * - * @param Twig_NodeInterface The modified node + * @return Twig_NodeInterface The modified node */ - function enterNode(Twig_NodeInterface $node, Twig_Environment $env); + public function enterNode(Twig_NodeInterface $node, Twig_Environment $env); /** * Called after child nodes are visited. @@ -33,9 +32,9 @@ interface Twig_NodeVisitorInterface * @param Twig_NodeInterface $node The node to visit * @param Twig_Environment $env The Twig environment instance * - * @param Twig_NodeInterface The modified node + * @return Twig_NodeInterface|false The modified node or false if the node must be removed */ - function leaveNode(Twig_NodeInterface $node, Twig_Environment $env); + public function leaveNode(Twig_NodeInterface $node, Twig_Environment $env); /** * Returns the priority for this visitor. @@ -44,5 +43,5 @@ interface Twig_NodeVisitorInterface * * @return integer The priority level */ - function getPriority(); + public function getPriority(); } diff --git a/inc/lib/Twig/Parser.php b/inc/lib/Twig/Parser.php index 8c982887..958e46b3 100644 --- a/inc/lib/Twig/Parser.php +++ b/inc/lib/Twig/Parser.php @@ -13,11 +13,11 @@ /** * Default parser implementation. * - * @package twig - * @author Fabien Potencier <fabien@symfony.com> + * @author Fabien Potencier <fabien@symfony.com> */ class Twig_Parser implements Twig_ParserInterface { + protected $stack = array(); protected $stream; protected $parent; protected $handlers; @@ -28,9 +28,9 @@ class Twig_Parser implements Twig_ParserInterface protected $macros; protected $env; protected $reservedMacroNames; - protected $importedFunctions; - protected $tmpVarCount; + protected $importedSymbols; protected $traits; + protected $embeddedTemplates = array(); /** * Constructor. @@ -42,28 +42,45 @@ class Twig_Parser implements Twig_ParserInterface $this->env = $env; } + public function getEnvironment() + { + return $this->env; + } + public function getVarName() { - return sprintf('__internal_%s_%d', substr($this->env->getTemplateClass($this->stream->getFilename()), strlen($this->env->getTemplateClassPrefix())), ++$this->tmpVarCount); + return sprintf('__internal_%s', hash('sha1', uniqid(mt_rand(), true), false)); + } + + public function getFilename() + { + return $this->stream->getFilename(); } /** * Converts a token stream to a node tree. * - * @param Twig_TokenStream $stream A token stream instance + * @param Twig_TokenStream $stream A token stream instance * * @return Twig_Node_Module A node tree */ - public function parse(Twig_TokenStream $stream) + public function parse(Twig_TokenStream $stream, $test = null, $dropNeedle = false) { - $this->tmpVarCount = 0; + // push all variables into the stack to keep the current state of the parser + $vars = get_object_vars($this); + unset($vars['stack'], $vars['env'], $vars['handlers'], $vars['visitors'], $vars['expressionParser']); + $this->stack[] = $vars; // tag handlers - $this->handlers = $this->env->getTokenParsers(); - $this->handlers->setParser($this); + if (null === $this->handlers) { + $this->handlers = $this->env->getTokenParsers(); + $this->handlers->setParser($this); + } // node visitors - $this->visitors = $this->env->getNodeVisitors(); + if (null === $this->visitors) { + $this->visitors = $this->env->getNodeVisitors(); + } if (null === $this->expressionParser) { $this->expressionParser = new Twig_ExpressionParser($this, $this->env->getUnaryOperators(), $this->env->getBinaryOperators()); @@ -75,10 +92,11 @@ class Twig_Parser implements Twig_ParserInterface $this->macros = array(); $this->traits = array(); $this->blockStack = array(); - $this->importedFunctions = array(array()); + $this->importedSymbols = array(array()); + $this->embeddedTemplates = array(); try { - $body = $this->subparse(null); + $body = $this->subparse($test, $dropNeedle); if (null !== $this->parent) { if (null === $body = $this->filterBodyNodes($body)) { @@ -86,18 +104,29 @@ class Twig_Parser implements Twig_ParserInterface } } } catch (Twig_Error_Syntax $e) { - if (null === $e->getTemplateFile()) { - $e->setTemplateFile($this->stream->getFilename()); + if (!$e->getTemplateFile()) { + $e->setTemplateFile($this->getFilename()); + } + + if (!$e->getTemplateLine()) { + $e->setTemplateLine($this->stream->getCurrent()->getLine()); } throw $e; } - $node = new Twig_Node_Module($body, $this->parent, new Twig_Node($this->blocks), new Twig_Node($this->macros), new Twig_Node($this->traits), $this->stream->getFilename()); + $node = new Twig_Node_Module(new Twig_Node_Body(array($body)), $this->parent, new Twig_Node($this->blocks), new Twig_Node($this->macros), new Twig_Node($this->traits), $this->embeddedTemplates, $this->getFilename()); $traverser = new Twig_NodeTraverser($this->env, $this->visitors); - return $traverser->traverse($node); + $node = $traverser->traverse($node); + + // restore previous stack so previous parse() call can resume working + foreach (array_pop($this->stack) as $key => $val) { + $this->$key = $val; + } + + return $node; } public function subparse($test, $dropNeedle = false) @@ -123,7 +152,7 @@ class Twig_Parser implements Twig_ParserInterface $token = $this->getCurrentToken(); if ($token->getType() !== Twig_Token::NAME_TYPE) { - throw new Twig_Error_Syntax('A block must start with a tag name', $token->getLine(), $this->stream->getFilename()); + throw new Twig_Error_Syntax('A block must start with a tag name', $token->getLine(), $this->getFilename()); } if (null !== $test && call_user_func($test, $token)) { @@ -141,10 +170,20 @@ class Twig_Parser implements Twig_ParserInterface $subparser = $this->handlers->getTokenParser($token->getValue()); if (null === $subparser) { if (null !== $test) { - throw new Twig_Error_Syntax(sprintf('Unexpected tag name "%s" (expecting closing tag for the "%s" tag defined near line %s)', $token->getValue(), $test[0]->getTag(), $lineno), $token->getLine(), $this->stream->getFilename()); + $error = sprintf('Unexpected tag name "%s"', $token->getValue()); + if (is_array($test) && isset($test[0]) && $test[0] instanceof Twig_TokenParserInterface) { + $error .= sprintf(' (expecting closing tag for the "%s" tag defined near line %s)', $test[0]->getTag(), $lineno); + } + + throw new Twig_Error_Syntax($error, $token->getLine(), $this->getFilename()); } - throw new Twig_Error_Syntax(sprintf('Unknown tag name "%s"', $token->getValue()), $token->getLine(), $this->stream->getFilename()); + $message = sprintf('Unknown tag name "%s"', $token->getValue()); + if ($alternatives = $this->env->computeAlternatives($token->getValue(), array_keys($this->env->getTags()))) { + $message = sprintf('%s. Did you mean "%s"', $message, implode('", "', $alternatives)); + } + + throw new Twig_Error_Syntax($message, $token->getLine(), $this->getFilename()); } $this->stream->next(); @@ -156,7 +195,7 @@ class Twig_Parser implements Twig_ParserInterface break; default: - throw new Twig_Error_Syntax('Lexer or parser ended up in unsupported state.', -1, $this->stream->getFilename()); + throw new Twig_Error_Syntax('Lexer or parser ended up in unsupported state.', 0, $this->getFilename()); } } @@ -202,9 +241,14 @@ class Twig_Parser implements Twig_ParserInterface return isset($this->blocks[$name]); } + public function getBlock($name) + { + return $this->blocks[$name]; + } + public function setBlock($name, $value) { - $this->blocks[$name] = $value; + $this->blocks[$name] = new Twig_Node_Body(array($value), array(), $value->getLine()); } public function hasMacro($name) @@ -223,7 +267,7 @@ class Twig_Parser implements Twig_ParserInterface } if (in_array($name, $this->reservedMacroNames)) { - throw new Twig_Error_Syntax(sprintf('"%s" cannot be used as a macro name as it is a reserved keyword', $name), $node->getLine()); + throw new Twig_Error_Syntax(sprintf('"%s" cannot be used as a macro name as it is a reserved keyword', $name), $node->getLine(), $this->getFilename()); } $this->macros[$name] = $node; @@ -234,33 +278,45 @@ class Twig_Parser implements Twig_ParserInterface $this->traits[] = $trait; } - public function addImportedFunction($alias, $name, Twig_Node_Expression $node) + public function hasTraits() + { + return count($this->traits) > 0; + } + + public function embedTemplate(Twig_Node_Module $template) { - $this->importedFunctions[0][$alias] = array('name' => $name, 'node' => $node); + $template->setIndex(mt_rand()); + + $this->embeddedTemplates[] = $template; } - public function getImportedFunction($alias) + public function addImportedSymbol($type, $alias, $name = null, Twig_Node_Expression $node = null) { - foreach ($this->importedFunctions as $functions) { - if (isset($functions[$alias])) { - return $functions[$alias]; + $this->importedSymbols[0][$type][$alias] = array('name' => $name, 'node' => $node); + } + + public function getImportedSymbol($type, $alias) + { + foreach ($this->importedSymbols as $functions) { + if (isset($functions[$type][$alias])) { + return $functions[$type][$alias]; } } } public function isMainScope() { - return 1 === count($this->importedFunctions); + return 1 === count($this->importedSymbols); } public function pushLocalScope() { - array_unshift($this->importedFunctions, array()); + array_unshift($this->importedSymbols, array()); } public function popLocalScope() { - array_shift($this->importedFunctions); + array_shift($this->importedSymbols); } /** @@ -311,7 +367,11 @@ class Twig_Parser implements Twig_ParserInterface || (!$node instanceof Twig_Node_Text && !$node instanceof Twig_Node_BlockReference && $node instanceof Twig_NodeOutputInterface) ) { - throw new Twig_Error_Syntax('A template that extends another one cannot have a body.', $node->getLine(), $this->stream->getFilename()); + if (false !== strpos((string) $node, chr(0xEF).chr(0xBB).chr(0xBF))) { + throw new Twig_Error_Syntax('A template that extends another one cannot have a body but a byte order mark (BOM) has been detected; it must be removed.', $node->getLine(), $this->getFilename()); + } + + throw new Twig_Error_Syntax('A template that extends another one cannot have a body.', $node->getLine(), $this->getFilename()); } // bypass "set" nodes as they "capture" the output diff --git a/inc/lib/Twig/ParserInterface.php b/inc/lib/Twig/ParserInterface.php index c7a34418..f0d79009 100644 --- a/inc/lib/Twig/ParserInterface.php +++ b/inc/lib/Twig/ParserInterface.php @@ -12,17 +12,17 @@ /** * Interface implemented by parser classes. * - * @package twig - * @author Fabien Potencier <fabien@symfony.com> + * @author Fabien Potencier <fabien@symfony.com> + * @deprecated since 1.12 (to be removed in 2.0) */ interface Twig_ParserInterface { /** * Converts a token stream to a node tree. * - * @param Twig_TokenStream $stream A token stream instance + * @param Twig_TokenStream $stream A token stream instance * * @return Twig_Node_Module A node tree */ - function parse(Twig_TokenStream $code); + public function parse(Twig_TokenStream $stream); } diff --git a/inc/lib/Twig/Sandbox/SecurityError.php b/inc/lib/Twig/Sandbox/SecurityError.php index debabb79..015bfaea 100644 --- a/inc/lib/Twig/Sandbox/SecurityError.php +++ b/inc/lib/Twig/Sandbox/SecurityError.php @@ -12,8 +12,7 @@ /** * Exception thrown when a security error occurs at runtime. * - * @package twig - * @author Fabien Potencier <fabien@symfony.com> + * @author Fabien Potencier <fabien@symfony.com> */ class Twig_Sandbox_SecurityError extends Twig_Error { diff --git a/inc/lib/Twig/Sandbox/SecurityPolicy.php b/inc/lib/Twig/Sandbox/SecurityPolicy.php index ba912ef4..66ee2332 100644 --- a/inc/lib/Twig/Sandbox/SecurityPolicy.php +++ b/inc/lib/Twig/Sandbox/SecurityPolicy.php @@ -12,8 +12,7 @@ /** * Represents a security policy which need to be enforced when sandbox mode is enabled. * - * @package twig - * @author Fabien Potencier <fabien@symfony.com> + * @author Fabien Potencier <fabien@symfony.com> */ class Twig_Sandbox_SecurityPolicy implements Twig_Sandbox_SecurityPolicyInterface { diff --git a/inc/lib/Twig/Sandbox/SecurityPolicyInterface.php b/inc/lib/Twig/Sandbox/SecurityPolicyInterface.php index d5015aff..6ab48e3c 100644 --- a/inc/lib/Twig/Sandbox/SecurityPolicyInterface.php +++ b/inc/lib/Twig/Sandbox/SecurityPolicyInterface.php @@ -12,14 +12,13 @@ /** * Interfaces that all security policy classes must implements. * - * @package twig - * @author Fabien Potencier <fabien@symfony.com> + * @author Fabien Potencier <fabien@symfony.com> */ interface Twig_Sandbox_SecurityPolicyInterface { - function checkSecurity($tags, $filters, $functions); + public function checkSecurity($tags, $filters, $functions); - function checkMethodAllowed($obj, $method); + public function checkMethodAllowed($obj, $method); - function checkPropertyAllowed($obj, $method); + public function checkPropertyAllowed($obj, $method); } diff --git a/inc/lib/Twig/SimpleFilter.php b/inc/lib/Twig/SimpleFilter.php new file mode 100644 index 00000000..d35c5633 --- /dev/null +++ b/inc/lib/Twig/SimpleFilter.php @@ -0,0 +1,94 @@ +<?php + +/* + * This file is part of Twig. + * + * (c) 2009-2012 Fabien Potencier + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/** + * Represents a template filter. + * + * @author Fabien Potencier <fabien@symfony.com> + */ +class Twig_SimpleFilter +{ + protected $name; + protected $callable; + protected $options; + protected $arguments = array(); + + public function __construct($name, $callable, array $options = array()) + { + $this->name = $name; + $this->callable = $callable; + $this->options = array_merge(array( + 'needs_environment' => false, + 'needs_context' => false, + 'is_safe' => null, + 'is_safe_callback' => null, + 'pre_escape' => null, + 'preserves_safety' => null, + 'node_class' => 'Twig_Node_Expression_Filter', + ), $options); + } + + public function getName() + { + return $this->name; + } + + public function getCallable() + { + return $this->callable; + } + + public function getNodeClass() + { + return $this->options['node_class']; + } + + public function setArguments($arguments) + { + $this->arguments = $arguments; + } + + public function getArguments() + { + return $this->arguments; + } + + public function needsEnvironment() + { + return $this->options['needs_environment']; + } + + public function needsContext() + { + return $this->options['needs_context']; + } + + public function getSafe(Twig_Node $filterArgs) + { + if (null !== $this->options['is_safe']) { + return $this->options['is_safe']; + } + + if (null !== $this->options['is_safe_callback']) { + return call_user_func($this->options['is_safe_callback'], $filterArgs); + } + } + + public function getPreservesSafety() + { + return $this->options['preserves_safety']; + } + + public function getPreEscape() + { + return $this->options['pre_escape']; + } +} diff --git a/inc/lib/Twig/SimpleFunction.php b/inc/lib/Twig/SimpleFunction.php new file mode 100644 index 00000000..8ef6aca2 --- /dev/null +++ b/inc/lib/Twig/SimpleFunction.php @@ -0,0 +1,84 @@ +<?php + +/* + * This file is part of Twig. + * + * (c) 2010-2012 Fabien Potencier + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/** + * Represents a template function. + * + * @author Fabien Potencier <fabien@symfony.com> + */ +class Twig_SimpleFunction +{ + protected $name; + protected $callable; + protected $options; + protected $arguments = array(); + + public function __construct($name, $callable, array $options = array()) + { + $this->name = $name; + $this->callable = $callable; + $this->options = array_merge(array( + 'needs_environment' => false, + 'needs_context' => false, + 'is_safe' => null, + 'is_safe_callback' => null, + 'node_class' => 'Twig_Node_Expression_Function', + ), $options); + } + + public function getName() + { + return $this->name; + } + + public function getCallable() + { + return $this->callable; + } + + public function getNodeClass() + { + return $this->options['node_class']; + } + + public function setArguments($arguments) + { + $this->arguments = $arguments; + } + + public function getArguments() + { + return $this->arguments; + } + + public function needsEnvironment() + { + return $this->options['needs_environment']; + } + + public function needsContext() + { + return $this->options['needs_context']; + } + + public function getSafe(Twig_Node $functionArgs) + { + if (null !== $this->options['is_safe']) { + return $this->options['is_safe']; + } + + if (null !== $this->options['is_safe_callback']) { + return call_user_func($this->options['is_safe_callback'], $functionArgs); + } + + return array(); + } +} diff --git a/inc/lib/Twig/SimpleTest.php b/inc/lib/Twig/SimpleTest.php new file mode 100644 index 00000000..225459c9 --- /dev/null +++ b/inc/lib/Twig/SimpleTest.php @@ -0,0 +1,46 @@ +<?php + +/* + * This file is part of Twig. + * + * (c) 2010-2012 Fabien Potencier + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/** + * Represents a template test. + * + * @author Fabien Potencier <fabien@symfony.com> + */ +class Twig_SimpleTest +{ + protected $name; + protected $callable; + protected $options; + + public function __construct($name, $callable, array $options = array()) + { + $this->name = $name; + $this->callable = $callable; + $this->options = array_merge(array( + 'node_class' => 'Twig_Node_Expression_Test', + ), $options); + } + + public function getName() + { + return $this->name; + } + + public function getCallable() + { + return $this->callable; + } + + public function getNodeClass() + { + return $this->options['node_class']; + } +} diff --git a/inc/lib/Twig/Template.php b/inc/lib/Twig/Template.php index a129fd73..a001ca03 100644 --- a/inc/lib/Twig/Template.php +++ b/inc/lib/Twig/Template.php @@ -13,16 +13,17 @@ /** * Default base class for compiled templates. * - * @package twig - * @author Fabien Potencier <fabien@symfony.com> + * @author Fabien Potencier <fabien@symfony.com> */ abstract class Twig_Template implements Twig_TemplateInterface { - static protected $cache = array(); + protected static $cache = array(); + protected $parent; protected $parents; protected $env; protected $blocks; + protected $traits; /** * Constructor. @@ -33,6 +34,7 @@ abstract class Twig_Template implements Twig_TemplateInterface { $this->env = $env; $this->blocks = array(); + $this->traits = array(); } /** @@ -43,9 +45,7 @@ abstract class Twig_Template implements Twig_TemplateInterface abstract public function getTemplateName(); /** - * Returns the Twig environment. - * - * @return Twig_Environment The Twig environment + * {@inheritdoc} */ public function getEnvironment() { @@ -55,10 +55,17 @@ abstract class Twig_Template implements Twig_TemplateInterface /** * Returns the parent template. * + * This method is for internal use only and should never be called + * directly. + * * @return Twig_TemplateInterface|false The parent template or false if there is no parent */ public function getParent(array $context) { + if (null !== $this->parent) { + return $this->parent; + } + $parent = $this->doGetParent($context); if (false === $parent) { return false; @@ -73,33 +80,53 @@ abstract class Twig_Template implements Twig_TemplateInterface return $this->parents[$parent]; } - abstract protected function doGetParent(array $context); + protected function doGetParent(array $context) + { + return false; + } + + public function isTraitable() + { + return true; + } /** * Displays a parent block. * + * This method is for internal use only and should never be called + * directly. + * * @param string $name The block name to display from the parent * @param array $context The context * @param array $blocks The current set of blocks */ public function displayParentBlock($name, array $context, array $blocks = array()) { - if (false !== $parent = $this->getParent($context)) { + $name = (string) $name; + + if (isset($this->traits[$name])) { + $this->traits[$name][0]->displayBlock($name, $context, $blocks); + } elseif (false !== $parent = $this->getParent($context)) { $parent->displayBlock($name, $context, $blocks); } else { - throw new Twig_Error_Runtime('This template has no parent', -1, $this->getTemplateName()); + throw new Twig_Error_Runtime(sprintf('The template has no parent and no traits defining the "%s" block', $name), -1, $this->getTemplateName()); } } /** * Displays a block. * + * This method is for internal use only and should never be called + * directly. + * * @param string $name The block name to display * @param array $context The context * @param array $blocks The current set of blocks */ public function displayBlock($name, array $context, array $blocks = array()) { + $name = (string) $name; + if (isset($blocks[$name])) { $b = $blocks; unset($b[$name]); @@ -114,6 +141,9 @@ abstract class Twig_Template implements Twig_TemplateInterface /** * Renders a parent block. * + * This method is for internal use only and should never be called + * directly. + * * @param string $name The block name to render from the parent * @param array $context The context * @param array $blocks The current set of blocks @@ -131,6 +161,9 @@ abstract class Twig_Template implements Twig_TemplateInterface /** * Renders a block. * + * This method is for internal use only and should never be called + * directly. + * * @param string $name The block name to render * @param array $context The context * @param array $blocks The current set of blocks @@ -148,19 +181,34 @@ abstract class Twig_Template implements Twig_TemplateInterface /** * Returns whether a block exists or not. * + * This method is for internal use only and should never be called + * directly. + * + * This method does only return blocks defined in the current template + * or defined in "used" traits. + * + * It does not return blocks from parent templates as the parent + * template name can be dynamic, which is only known based on the + * current context. + * * @param string $name The block name * * @return Boolean true if the block exists, false otherwise */ public function hasBlock($name) { - return isset($this->blocks[$name]); + return isset($this->blocks[(string) $name]); } /** * Returns all block names. * + * This method is for internal use only and should never be called + * directly. + * * @return array An array of block names + * + * @see hasBlock */ public function getBlockNames() { @@ -170,7 +218,12 @@ abstract class Twig_Template implements Twig_TemplateInterface /** * Returns all blocks. * + * This method is for internal use only and should never be called + * directly. + * * @return array An array of blocks + * + * @see hasBlock */ public function getBlocks() { @@ -178,28 +231,15 @@ abstract class Twig_Template implements Twig_TemplateInterface } /** - * Displays the template with the given context. - * - * @param array $context An array of parameters to pass to the template - * @param array $blocks An array of blocks to pass to the template + * {@inheritdoc} */ public function display(array $context, array $blocks = array()) { - try { - $this->doDisplay($context, $blocks); - } catch (Twig_Error $e) { - throw $e; - } catch (Exception $e) { - throw new Twig_Error_Runtime(sprintf('An exception has been thrown during the rendering of a template ("%s").', $e->getMessage()), -1, null, $e); - } + $this->displayWithErrorHandling($this->env->mergeGlobals($context), $blocks); } /** - * Renders the template with the given context and returns it as string. - * - * @param array $context An array of parameters to pass to the template - * - * @return string The rendered template + * {@inheritdoc} */ public function render(array $context) { @@ -218,6 +258,28 @@ abstract class Twig_Template implements Twig_TemplateInterface return ob_get_clean(); } + protected function displayWithErrorHandling(array $context, array $blocks = array()) + { + try { + $this->doDisplay($context, $blocks); + } catch (Twig_Error $e) { + if (!$e->getTemplateFile()) { + $e->setTemplateFile($this->getTemplateName()); + } + + // this is mostly useful for Twig_Error_Loader exceptions + // see Twig_Error_Loader + if (false === $e->getTemplateLine()) { + $e->setTemplateLine(-1); + $e->guess(); + } + + throw $e; + } catch (Exception $e) { + throw new Twig_Error_Runtime(sprintf('An exception has been thrown during the rendering of a template ("%s").', $e->getMessage()), -1, null, $e); + } + } + /** * Auto-generated method to display the template with the given context. * @@ -229,21 +291,30 @@ abstract class Twig_Template implements Twig_TemplateInterface /** * Returns a variable from the context. * - * @param array $context The context - * @param string $item The variable to return from the context + * This method is for internal use only and should never be called + * directly. + * + * This method should not be overridden in a sub-class as this is an + * implementation detail that has been introduced to optimize variable + * access for versions of PHP before 5.4. This is not a way to override + * the way to get a variable value. + * + * @param array $context The context + * @param string $item The variable to return from the context + * @param Boolean $ignoreStrictCheck Whether to ignore the strict variable check or not * * @return The content of the context variable * * @throws Twig_Error_Runtime if the variable does not exist and Twig is running in strict mode */ - protected function getContext($context, $item) + final protected function getContext($context, $item, $ignoreStrictCheck = false) { if (!array_key_exists($item, $context)) { - if (!$this->env->isStrictVariables()) { + if ($ignoreStrictCheck || !$this->env->isStrictVariables()) { return null; } - throw new Twig_Error_Runtime(sprintf('Variable "%s" does not exist', $item)); + throw new Twig_Error_Runtime(sprintf('Variable "%s" does not exist', $item), -1, $this->getTemplateName()); } return $context[$item]; @@ -252,40 +323,50 @@ abstract class Twig_Template implements Twig_TemplateInterface /** * Returns the attribute value for a given array/object. * - * @param mixed $object The object or array from where to get the item - * @param mixed $item The item to get from the array or object - * @param array $arguments An array of arguments to pass if the item is an object method - * @param string $type The type of attribute (@see Twig_TemplateInterface) - * @param Boolean $isDefinedTest Whether this is only a defined check + * @param mixed $object The object or array from where to get the item + * @param mixed $item The item to get from the array or object + * @param array $arguments An array of arguments to pass if the item is an object method + * @param string $type The type of attribute (@see Twig_TemplateInterface) + * @param Boolean $isDefinedTest Whether this is only a defined check + * @param Boolean $ignoreStrictCheck Whether to ignore the strict attribute check or not + * + * @return mixed The attribute value, or a Boolean when $isDefinedTest is true, or null when the attribute is not set and $ignoreStrictCheck is true + * + * @throws Twig_Error_Runtime if the attribute does not exist and Twig is running in strict mode and $isDefinedTest is false */ - protected function getAttribute($object, $item, array $arguments = array(), $type = Twig_TemplateInterface::ANY_CALL, $isDefinedTest = false) + protected function getAttribute($object, $item, array $arguments = array(), $type = Twig_TemplateInterface::ANY_CALL, $isDefinedTest = false, $ignoreStrictCheck = false) { // array if (Twig_TemplateInterface::METHOD_CALL !== $type) { - if ((is_array($object) && array_key_exists($item, $object)) - || ($object instanceof ArrayAccess && isset($object[$item])) + $arrayItem = is_bool($item) || is_float($item) ? (int) $item : $item; + + if ((is_array($object) && array_key_exists($arrayItem, $object)) + || ($object instanceof ArrayAccess && isset($object[$arrayItem])) ) { if ($isDefinedTest) { return true; } - return $object[$item]; + return $object[$arrayItem]; } - if (Twig_TemplateInterface::ARRAY_CALL === $type) { + if (Twig_TemplateInterface::ARRAY_CALL === $type || !is_object($object)) { if ($isDefinedTest) { return false; } - if (!$this->env->isStrictVariables()) { + if ($ignoreStrictCheck || !$this->env->isStrictVariables()) { return null; } if (is_object($object)) { - throw new Twig_Error_Runtime(sprintf('Key "%s" in object (with ArrayAccess) of type "%s" does not exist', $item, get_class($object))); - // array + throw new Twig_Error_Runtime(sprintf('Key "%s" in object (with ArrayAccess) of type "%s" does not exist', $arrayItem, get_class($object)), -1, $this->getTemplateName()); + } elseif (is_array($object)) { + throw new Twig_Error_Runtime(sprintf('Key "%s" for array with keys "%s" does not exist', $arrayItem, implode(', ', array_keys($object))), -1, $this->getTemplateName()); + } elseif (Twig_TemplateInterface::ARRAY_CALL === $type) { + throw new Twig_Error_Runtime(sprintf('Impossible to access a key ("%s") on a %s variable ("%s")', $item, gettype($object), $object), -1, $this->getTemplateName()); } else { - throw new Twig_Error_Runtime(sprintf('Key "%s" for array with keys "%s" does not exist', $item, implode(', ', array_keys($object)))); + throw new Twig_Error_Runtime(sprintf('Impossible to access an attribute ("%s") on a %s variable ("%s")', $item, gettype($object), $object), -1, $this->getTemplateName()); } } } @@ -295,32 +376,18 @@ abstract class Twig_Template implements Twig_TemplateInterface return false; } - if (!$this->env->isStrictVariables()) { + if ($ignoreStrictCheck || !$this->env->isStrictVariables()) { return null; } - throw new Twig_Error_Runtime(sprintf('Item "%s" for "%s" does not exist', $item, $object)); + throw new Twig_Error_Runtime(sprintf('Impossible to invoke a method ("%s") on a %s variable ("%s")', $item, gettype($object), $object), -1, $this->getTemplateName()); } - // get some information about the object $class = get_class($object); - if (!isset(self::$cache[$class])) { - $r = new ReflectionClass($class); - self::$cache[$class] = array('methods' => array(), 'properties' => array()); - foreach ($r->getMethods(ReflectionMethod::IS_PUBLIC) as $method) { - self::$cache[$class]['methods'][strtolower($method->getName())] = true; - } - - foreach ($r->getProperties(ReflectionProperty::IS_PUBLIC) as $property) { - self::$cache[$class]['properties'][$property->getName()] = true; - } - } // object property if (Twig_TemplateInterface::METHOD_CALL !== $type) { - if (isset(self::$cache[$class]['properties'][$item]) - || isset($object->$item) || array_key_exists($item, $object) - ) { + if (isset($object->$item) || array_key_exists((string) $item, $object)) { if ($isDefinedTest) { return true; } @@ -334,25 +401,29 @@ abstract class Twig_Template implements Twig_TemplateInterface } // object method + if (!isset(self::$cache[$class]['methods'])) { + self::$cache[$class]['methods'] = array_change_key_case(array_flip(get_class_methods($object))); + } + $lcItem = strtolower($item); if (isset(self::$cache[$class]['methods'][$lcItem])) { - $method = $item; + $method = (string) $item; } elseif (isset(self::$cache[$class]['methods']['get'.$lcItem])) { $method = 'get'.$item; } elseif (isset(self::$cache[$class]['methods']['is'.$lcItem])) { $method = 'is'.$item; } elseif (isset(self::$cache[$class]['methods']['__call'])) { - $method = $item; + $method = (string) $item; } else { if ($isDefinedTest) { return false; } - if (!$this->env->isStrictVariables()) { + if ($ignoreStrictCheck || !$this->env->isStrictVariables()) { return null; } - throw new Twig_Error_Runtime(sprintf('Method "%s" for object "%s" does not exist', $item, get_class($object))); + throw new Twig_Error_Runtime(sprintf('Method "%s" for object "%s" does not exist', $item, get_class($object)), -1, $this->getTemplateName()); } if ($isDefinedTest) { @@ -365,10 +436,20 @@ abstract class Twig_Template implements Twig_TemplateInterface $ret = call_user_func_array(array($object, $method), $arguments); + // useful when calling a template method from a template + // this is not supported but unfortunately heavily used in the Symfony profiler if ($object instanceof Twig_TemplateInterface) { - return new Twig_Markup($ret); + return $ret === '' ? '' : new Twig_Markup($ret, $this->env->getCharset()); } return $ret; } + + /** + * This method is only useful when testing Twig. Do not use it. + */ + public static function clearCache() + { + self::$cache = array(); + } } diff --git a/inc/lib/Twig/TemplateInterface.php b/inc/lib/Twig/TemplateInterface.php index 08da1163..879f503e 100644 --- a/inc/lib/Twig/TemplateInterface.php +++ b/inc/lib/Twig/TemplateInterface.php @@ -12,8 +12,8 @@ /** * Interface implemented by all compiled templates. * - * @package twig - * @author Fabien Potencier <fabien@symfony.com> + * @author Fabien Potencier <fabien@symfony.com> + * @deprecated since 1.12 (to be removed in 2.0) */ interface Twig_TemplateInterface { @@ -28,7 +28,7 @@ interface Twig_TemplateInterface * * @return string The rendered template */ - function render(array $context); + public function render(array $context); /** * Displays the template with the given context. @@ -36,12 +36,12 @@ interface Twig_TemplateInterface * @param array $context An array of parameters to pass to the template * @param array $blocks An array of blocks to pass to the template */ - function display(array $context, array $blocks = array()); + public function display(array $context, array $blocks = array()); /** * Returns the bound environment for this template. * * @return Twig_Environment The current environment */ - function getEnvironment(); + public function getEnvironment(); } diff --git a/inc/lib/Twig/Test.php b/inc/lib/Twig/Test.php new file mode 100644 index 00000000..3baff885 --- /dev/null +++ b/inc/lib/Twig/Test.php @@ -0,0 +1,34 @@ +<?php + +/* + * This file is part of Twig. + * + * (c) 2012 Fabien Potencier + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/** + * Represents a template test. + * + * @author Fabien Potencier <fabien@symfony.com> + * @deprecated since 1.12 (to be removed in 2.0) + */ +abstract class Twig_Test implements Twig_TestInterface, Twig_TestCallableInterface +{ + protected $options; + protected $arguments = array(); + + public function __construct(array $options = array()) + { + $this->options = array_merge(array( + 'callable' => null, + ), $options); + } + + public function getCallable() + { + return $this->options['callable']; + } +} diff --git a/inc/lib/Twig/Test/Function.php b/inc/lib/Twig/Test/Function.php index 1240a0f1..4be6b9b9 100644 --- a/inc/lib/Twig/Test/Function.php +++ b/inc/lib/Twig/Test/Function.php @@ -12,15 +12,19 @@ /** * Represents a function template test. * - * @package twig - * @author Fabien Potencier <fabien@symfony.com> + * @author Fabien Potencier <fabien@symfony.com> + * @deprecated since 1.12 (to be removed in 2.0) */ -class Twig_Test_Function implements Twig_TestInterface +class Twig_Test_Function extends Twig_Test { protected $function; - public function __construct($function) + public function __construct($function, array $options = array()) { + $options['callable'] = $function; + + parent::__construct($options); + $this->function = $function; } diff --git a/inc/lib/Twig/Test/IntegrationTestCase.php b/inc/lib/Twig/Test/IntegrationTestCase.php new file mode 100644 index 00000000..724f0941 --- /dev/null +++ b/inc/lib/Twig/Test/IntegrationTestCase.php @@ -0,0 +1,154 @@ +<?php + +/* + * This file is part of Twig. + * + * (c) 2010 Fabien Potencier + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/** + * Integration test helper + * + * @author Fabien Potencier <fabien@symfony.com> + * @author Karma Dordrak <drak@zikula.org> + */ +abstract class Twig_Test_IntegrationTestCase extends PHPUnit_Framework_TestCase +{ + abstract protected function getExtensions(); + abstract protected function getFixturesDir(); + + /** + * @dataProvider getTests + */ + public function testIntegration($file, $message, $condition, $templates, $exception, $outputs) + { + $this->doIntegrationTest($file, $message, $condition, $templates, $exception, $outputs); + } + + public function getTests() + { + $fixturesDir = realpath($this->getFixturesDir()); + $tests = array(); + + foreach (new RecursiveIteratorIterator(new RecursiveDirectoryIterator($fixturesDir), RecursiveIteratorIterator::LEAVES_ONLY) as $file) { + if (!preg_match('/\.test$/', $file)) { + continue; + } + + $test = file_get_contents($file->getRealpath()); + + if (preg_match('/ + --TEST--\s*(.*?)\s*(?:--CONDITION--\s*(.*))?\s*((?:--TEMPLATE(?:\(.*?\))?--(?:.*?))+)\s*(?:--DATA--\s*(.*))?\s*--EXCEPTION--\s*(.*)/sx', $test, $match)) { + $message = $match[1]; + $condition = $match[2]; + $templates = $this->parseTemplates($match[3]); + $exception = $match[5]; + $outputs = array(array(null, $match[4], null, '')); + } elseif (preg_match('/--TEST--\s*(.*?)\s*(?:--CONDITION--\s*(.*))?\s*((?:--TEMPLATE(?:\(.*?\))?--(?:.*?))+)--DATA--.*?--EXPECT--.*/s', $test, $match)) { + $message = $match[1]; + $condition = $match[2]; + $templates = $this->parseTemplates($match[3]); + $exception = false; + preg_match_all('/--DATA--(.*?)(?:--CONFIG--(.*?))?--EXPECT--(.*?)(?=\-\-DATA\-\-|$)/s', $test, $outputs, PREG_SET_ORDER); + } else { + throw new InvalidArgumentException(sprintf('Test "%s" is not valid.', str_replace($fixturesDir.'/', '', $file))); + } + + $tests[] = array(str_replace($fixturesDir.'/', '', $file), $message, $condition, $templates, $exception, $outputs); + } + + return $tests; + } + + protected function doIntegrationTest($file, $message, $condition, $templates, $exception, $outputs) + { + if ($condition) { + eval('$ret = '.$condition.';'); + if (!$ret) { + $this->markTestSkipped($condition); + } + } + + $loader = new Twig_Loader_Array($templates); + + foreach ($outputs as $match) { + $config = array_merge(array( + 'cache' => false, + 'strict_variables' => true, + ), $match[2] ? eval($match[2].';') : array()); + $twig = new Twig_Environment($loader, $config); + $twig->addGlobal('global', 'global'); + foreach ($this->getExtensions() as $extension) { + $twig->addExtension($extension); + } + + try { + $template = $twig->loadTemplate('index.twig'); + } catch (Exception $e) { + if (false !== $exception) { + $this->assertEquals(trim($exception), trim(sprintf('%s: %s', get_class($e), $e->getMessage()))); + + return; + } + + if ($e instanceof Twig_Error_Syntax) { + $e->setTemplateFile($file); + + throw $e; + } + + throw new Twig_Error(sprintf('%s: %s', get_class($e), $e->getMessage()), -1, $file, $e); + } + + try { + $output = trim($template->render(eval($match[1].';')), "\n "); + } catch (Exception $e) { + if (false !== $exception) { + $this->assertEquals(trim($exception), trim(sprintf('%s: %s', get_class($e), $e->getMessage()))); + + return; + } + + if ($e instanceof Twig_Error_Syntax) { + $e->setTemplateFile($file); + } else { + $e = new Twig_Error(sprintf('%s: %s', get_class($e), $e->getMessage()), -1, $file, $e); + } + + $output = trim(sprintf('%s: %s', get_class($e), $e->getMessage())); + } + + if (false !== $exception) { + list($class, ) = explode(':', $exception); + $this->assertThat(NULL, new PHPUnit_Framework_Constraint_Exception($class)); + } + + $expected = trim($match[3], "\n "); + + if ($expected != $output) { + echo 'Compiled template that failed:'; + + foreach (array_keys($templates) as $name) { + echo "Template: $name\n"; + $source = $loader->getSource($name); + echo $twig->compile($twig->parse($twig->tokenize($source, $name))); + } + } + $this->assertEquals($expected, $output, $message.' (in '.$file.')'); + } + } + + protected static function parseTemplates($test) + { + $templates = array(); + preg_match_all('/--TEMPLATE(?:\((.*?)\))?--(.*?)(?=\-\-TEMPLATE|$)/s', $test, $matches, PREG_SET_ORDER); + foreach ($matches as $match) { + $templates[($match[1] ? $match[1] : 'index.twig')] = $match[2]; + } + + return $templates; + } +} diff --git a/inc/lib/Twig/Test/Method.php b/inc/lib/Twig/Test/Method.php index a3b39483..17c6c041 100644 --- a/inc/lib/Twig/Test/Method.php +++ b/inc/lib/Twig/Test/Method.php @@ -12,15 +12,20 @@ /** * Represents a method template test. * - * @package twig - * @author Fabien Potencier <fabien@symfony.com> + * @author Fabien Potencier <fabien@symfony.com> + * @deprecated since 1.12 (to be removed in 2.0) */ -class Twig_Test_Method implements Twig_TestInterface +class Twig_Test_Method extends Twig_Test { - protected $extension, $method; + protected $extension; + protected $method; - public function __construct(Twig_ExtensionInterface $extension, $method) + public function __construct(Twig_ExtensionInterface $extension, $method, array $options = array()) { + $options['callable'] = array($extension, $method); + + parent::__construct($options); + $this->extension = $extension; $this->method = $method; } diff --git a/inc/lib/Twig/Test/Node.php b/inc/lib/Twig/Test/Node.php new file mode 100644 index 00000000..c832a57b --- /dev/null +++ b/inc/lib/Twig/Test/Node.php @@ -0,0 +1,37 @@ +<?php + +/* + * This file is part of Twig. + * + * (c) 2010 Fabien Potencier + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/** + * Represents a template test as a Node. + * + * @author Fabien Potencier <fabien@symfony.com> + * @deprecated since 1.12 (to be removed in 2.0) + */ +class Twig_Test_Node extends Twig_Test +{ + protected $class; + + public function __construct($class, array $options = array()) + { + parent::__construct($options); + + $this->class = $class; + } + + public function getClass() + { + return $this->class; + } + + public function compile() + { + } +} diff --git a/inc/lib/Twig/Test/NodeTestCase.php b/inc/lib/Twig/Test/NodeTestCase.php new file mode 100644 index 00000000..b15c85ff --- /dev/null +++ b/inc/lib/Twig/Test/NodeTestCase.php @@ -0,0 +1,58 @@ +<?php + +/* + * This file is part of Twig. + * + * (c) Fabien Potencier + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ +abstract class Twig_Test_NodeTestCase extends PHPUnit_Framework_TestCase +{ + abstract public function getTests(); + + /** + * @dataProvider getTests + */ + public function testCompile($node, $source, $environment = null) + { + $this->assertNodeCompilation($source, $node, $environment); + } + + public function assertNodeCompilation($source, Twig_Node $node, Twig_Environment $environment = null) + { + $compiler = $this->getCompiler($environment); + $compiler->compile($node); + + $this->assertEquals($source, trim($compiler->getSource())); + } + + protected function getCompiler(Twig_Environment $environment = null) + { + return new Twig_Compiler(null === $environment ? $this->getEnvironment() : $environment); + } + + protected function getEnvironment() + { + return new Twig_Environment(); + } + + protected function getVariableGetter($name) + { + if (version_compare(phpversion(), '5.4.0RC1', '>=')) { + return sprintf('(isset($context["%s"]) ? $context["%s"] : null)', $name, $name); + } + + return sprintf('$this->getContext($context, "%s")', $name); + } + + protected function getAttributeGetter() + { + if (function_exists('twig_template_get_attributes')) { + return 'twig_template_get_attributes($this, '; + } + + return '$this->getAttribute('; + } +} diff --git a/inc/lib/Twig/TestCallableInterface.php b/inc/lib/Twig/TestCallableInterface.php new file mode 100644 index 00000000..0db43682 --- /dev/null +++ b/inc/lib/Twig/TestCallableInterface.php @@ -0,0 +1,21 @@ +<?php + +/* + * This file is part of Twig. + * + * (c) 2012 Fabien Potencier + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/** + * Represents a callable template test. + * + * @author Fabien Potencier <fabien@symfony.com> + * @deprecated since 1.12 (to be removed in 2.0) + */ +interface Twig_TestCallableInterface +{ + public function getCallable(); +} diff --git a/inc/lib/Twig/TestInterface.php b/inc/lib/Twig/TestInterface.php index c2ff7258..30d8a2c4 100644 --- a/inc/lib/Twig/TestInterface.php +++ b/inc/lib/Twig/TestInterface.php @@ -12,8 +12,8 @@ /** * Represents a template test. * - * @package twig - * @author Fabien Potencier <fabien@symfony.com> + * @author Fabien Potencier <fabien@symfony.com> + * @deprecated since 1.12 (to be removed in 2.0) */ interface Twig_TestInterface { @@ -22,5 +22,5 @@ interface Twig_TestInterface * * @return string The PHP code for the test */ - function compile(); + public function compile(); } diff --git a/inc/lib/Twig/Token.php b/inc/lib/Twig/Token.php index 79a10030..bbca90db 100644 --- a/inc/lib/Twig/Token.php +++ b/inc/lib/Twig/Token.php @@ -13,8 +13,7 @@ /** * Represents a Token. * - * @package twig - * @author Fabien Potencier <fabien@symfony.com> + * @author Fabien Potencier <fabien@symfony.com> */ class Twig_Token { @@ -22,17 +21,19 @@ class Twig_Token protected $type; protected $lineno; - const EOF_TYPE = -1; - const TEXT_TYPE = 0; - const BLOCK_START_TYPE = 1; - const VAR_START_TYPE = 2; - const BLOCK_END_TYPE = 3; - const VAR_END_TYPE = 4; - const NAME_TYPE = 5; - const NUMBER_TYPE = 6; - const STRING_TYPE = 7; - const OPERATOR_TYPE = 8; - const PUNCTUATION_TYPE = 9; + const EOF_TYPE = -1; + const TEXT_TYPE = 0; + const BLOCK_START_TYPE = 1; + const VAR_START_TYPE = 2; + const BLOCK_END_TYPE = 3; + const VAR_END_TYPE = 4; + const NAME_TYPE = 5; + const NUMBER_TYPE = 6; + const STRING_TYPE = 7; + const OPERATOR_TYPE = 8; + const PUNCTUATION_TYPE = 9; + const INTERPOLATION_START_TYPE = 10; + const INTERPOLATION_END_TYPE = 11; /** * Constructor. @@ -120,10 +121,11 @@ class Twig_Token * * @param integer $type The type as an integer * @param Boolean $short Whether to return a short representation or not + * @param integer $line The code line * * @return string The string representation */ - static public function typeToString($type, $short = false, $line = -1) + public static function typeToString($type, $short = false, $line = -1) { switch ($type) { case self::EOF_TYPE: @@ -159,8 +161,14 @@ class Twig_Token case self::PUNCTUATION_TYPE: $name = 'PUNCTUATION_TYPE'; break; + case self::INTERPOLATION_START_TYPE: + $name = 'INTERPOLATION_START_TYPE'; + break; + case self::INTERPOLATION_END_TYPE: + $name = 'INTERPOLATION_END_TYPE'; + break; default: - throw new Twig_Error_Syntax(sprintf('Token of type "%s" does not exist.', $type), $line); + throw new LogicException(sprintf('Token of type "%s" does not exist.', $type)); } return $short ? $name : 'Twig_Token::'.$name; @@ -169,12 +177,12 @@ class Twig_Token /** * Returns the english representation of a given type. * - * @param integer $type The type as an integer - * @param Boolean $short Whether to return a short representation or not + * @param integer $type The type as an integer + * @param integer $line The code line * * @return string The string representation */ - static public function typeToEnglish($type, $line = -1) + public static function typeToEnglish($type, $line = -1) { switch ($type) { case self::EOF_TYPE: @@ -199,8 +207,12 @@ class Twig_Token return 'operator'; case self::PUNCTUATION_TYPE: return 'punctuation'; + case self::INTERPOLATION_START_TYPE: + return 'begin of string interpolation'; + case self::INTERPOLATION_END_TYPE: + return 'end of string interpolation'; default: - throw new Twig_Error_Syntax(sprintf('Token of type "%s" does not exist.', $type), $line); + throw new LogicException(sprintf('Token of type "%s" does not exist.', $type)); } } } diff --git a/inc/lib/Twig/TokenParser.php b/inc/lib/Twig/TokenParser.php index 6c9e6935..decebd5e 100644 --- a/inc/lib/Twig/TokenParser.php +++ b/inc/lib/Twig/TokenParser.php @@ -12,11 +12,13 @@ /** * Base class for all token parsers. * - * @package twig - * @author Fabien Potencier <fabien@symfony.com> + * @author Fabien Potencier <fabien@symfony.com> */ abstract class Twig_TokenParser implements Twig_TokenParserInterface { + /** + * @var Twig_Parser + */ protected $parser; /** diff --git a/inc/lib/Twig/TokenParser/AutoEscape.php b/inc/lib/Twig/TokenParser/AutoEscape.php index 3b4b96e3..27560288 100644 --- a/inc/lib/Twig/TokenParser/AutoEscape.php +++ b/inc/lib/Twig/TokenParser/AutoEscape.php @@ -39,23 +39,35 @@ class Twig_TokenParser_AutoEscape extends Twig_TokenParser public function parse(Twig_Token $token) { $lineno = $token->getLine(); - $value = $this->parser->getStream()->expect(Twig_Token::NAME_TYPE)->getValue(); - if (!in_array($value, array('true', 'false'))) { - throw new Twig_Error_Syntax("Autoescape value must be 'true' or 'false'", $lineno); - } - $value = 'true' === $value ? 'html' : false; + $stream = $this->parser->getStream(); + + if ($stream->test(Twig_Token::BLOCK_END_TYPE)) { + $value = 'html'; + } else { + $expr = $this->parser->getExpressionParser()->parseExpression(); + if (!$expr instanceof Twig_Node_Expression_Constant) { + throw new Twig_Error_Syntax('An escaping strategy must be a string or a Boolean.', $stream->getCurrent()->getLine(), $stream->getFilename()); + } + $value = $expr->getAttribute('value'); - if ($this->parser->getStream()->test(Twig_Token::NAME_TYPE)) { - if (false === $value) { - throw new Twig_Error_Syntax('Unexpected escaping strategy as you set autoescaping to false.', $lineno); + $compat = true === $value || false === $value; + + if (true === $value) { + $value = 'html'; } - $value = $this->parser->getStream()->next()->getValue(); + if ($compat && $stream->test(Twig_Token::NAME_TYPE)) { + if (false === $value) { + throw new Twig_Error_Syntax('Unexpected escaping strategy as you set autoescaping to false.', $stream->getCurrent()->getLine(), $stream->getFilename()); + } + + $value = $stream->next()->getValue(); + } } - $this->parser->getStream()->expect(Twig_Token::BLOCK_END_TYPE); + $stream->expect(Twig_Token::BLOCK_END_TYPE); $body = $this->parser->subparse(array($this, 'decideBlockEnd'), true); - $this->parser->getStream()->expect(Twig_Token::BLOCK_END_TYPE); + $stream->expect(Twig_Token::BLOCK_END_TYPE); return new Twig_Node_AutoEscape($value, $body, $lineno, $this->getTag()); } @@ -68,7 +80,7 @@ class Twig_TokenParser_AutoEscape extends Twig_TokenParser /** * Gets the tag name associated with this token parser. * - * @param string The tag name + * @return string The tag name */ public function getTag() { diff --git a/inc/lib/Twig/TokenParser/Block.php b/inc/lib/Twig/TokenParser/Block.php index b31f7ed6..a2e017f3 100644 --- a/inc/lib/Twig/TokenParser/Block.php +++ b/inc/lib/Twig/TokenParser/Block.php @@ -35,8 +35,9 @@ class Twig_TokenParser_Block extends Twig_TokenParser $stream = $this->parser->getStream(); $name = $stream->expect(Twig_Token::NAME_TYPE)->getValue(); if ($this->parser->hasBlock($name)) { - throw new Twig_Error_Syntax("The block '$name' has already been defined", $lineno); + throw new Twig_Error_Syntax(sprintf("The block '$name' has already been defined line %d", $this->parser->getBlock($name)->getLine()), $stream->getCurrent()->getLine(), $stream->getFilename()); } + $this->parser->setBlock($name, $block = new Twig_Node_Block($name, new Twig_Node(array()), $lineno)); $this->parser->pushLocalScope(); $this->parser->pushBlockStack($name); @@ -48,7 +49,7 @@ class Twig_TokenParser_Block extends Twig_TokenParser $value = $stream->next()->getValue(); if ($value != $name) { - throw new Twig_Error_Syntax(sprintf("Expected endblock for block '$name' (but %s given)", $value), $lineno); + throw new Twig_Error_Syntax(sprintf("Expected endblock for block '$name' (but %s given)", $value), $stream->getCurrent()->getLine(), $stream->getFilename()); } } } else { @@ -58,8 +59,7 @@ class Twig_TokenParser_Block extends Twig_TokenParser } $stream->expect(Twig_Token::BLOCK_END_TYPE); - $block = new Twig_Node_Block($name, $body, $lineno); - $this->parser->setBlock($name, $block); + $block->setNode('body', $body); $this->parser->popBlockStack(); $this->parser->popLocalScope(); @@ -74,7 +74,7 @@ class Twig_TokenParser_Block extends Twig_TokenParser /** * Gets the tag name associated with this token parser. * - * @param string The tag name + * @return string The tag name */ public function getTag() { diff --git a/inc/lib/Twig/TokenParser/Do.php b/inc/lib/Twig/TokenParser/Do.php new file mode 100644 index 00000000..f50939dd --- /dev/null +++ b/inc/lib/Twig/TokenParser/Do.php @@ -0,0 +1,42 @@ +<?php + +/* + * This file is part of Twig. + * + * (c) 2011 Fabien Potencier + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/** + * Evaluates an expression, discarding the returned value. + */ +class Twig_TokenParser_Do extends Twig_TokenParser +{ + /** + * Parses a token and returns a node. + * + * @param Twig_Token $token A Twig_Token instance + * + * @return Twig_NodeInterface A Twig_NodeInterface instance + */ + public function parse(Twig_Token $token) + { + $expr = $this->parser->getExpressionParser()->parseExpression(); + + $this->parser->getStream()->expect(Twig_Token::BLOCK_END_TYPE); + + return new Twig_Node_Do($expr, $token->getLine(), $this->getTag()); + } + + /** + * Gets the tag name associated with this token parser. + * + * @return string The tag name + */ + public function getTag() + { + return 'do'; + } +} diff --git a/inc/lib/Twig/TokenParser/Embed.php b/inc/lib/Twig/TokenParser/Embed.php new file mode 100644 index 00000000..69cb5f35 --- /dev/null +++ b/inc/lib/Twig/TokenParser/Embed.php @@ -0,0 +1,66 @@ +<?php + +/* + * This file is part of Twig. + * + * (c) 2012 Fabien Potencier + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/** + * Embeds a template. + */ +class Twig_TokenParser_Embed extends Twig_TokenParser_Include +{ + /** + * Parses a token and returns a node. + * + * @param Twig_Token $token A Twig_Token instance + * + * @return Twig_NodeInterface A Twig_NodeInterface instance + */ + public function parse(Twig_Token $token) + { + $stream = $this->parser->getStream(); + + $parent = $this->parser->getExpressionParser()->parseExpression(); + + list($variables, $only, $ignoreMissing) = $this->parseArguments(); + + // inject a fake parent to make the parent() function work + $stream->injectTokens(array( + new Twig_Token(Twig_Token::BLOCK_START_TYPE, '', $token->getLine()), + new Twig_Token(Twig_Token::NAME_TYPE, 'extends', $token->getLine()), + new Twig_Token(Twig_Token::STRING_TYPE, '__parent__', $token->getLine()), + new Twig_Token(Twig_Token::BLOCK_END_TYPE, '', $token->getLine()), + )); + + $module = $this->parser->parse($stream, array($this, 'decideBlockEnd'), true); + + // override the parent with the correct one + $module->setNode('parent', $parent); + + $this->parser->embedTemplate($module); + + $stream->expect(Twig_Token::BLOCK_END_TYPE); + + return new Twig_Node_Embed($module->getAttribute('filename'), $module->getAttribute('index'), $variables, $only, $ignoreMissing, $token->getLine(), $this->getTag()); + } + + public function decideBlockEnd(Twig_Token $token) + { + return $token->test('endembed'); + } + + /** + * Gets the tag name associated with this token parser. + * + * @return string The tag name + */ + public function getTag() + { + return 'embed'; + } +} diff --git a/inc/lib/Twig/TokenParser/Extends.php b/inc/lib/Twig/TokenParser/Extends.php index 67eacda0..f5ecee21 100644 --- a/inc/lib/Twig/TokenParser/Extends.php +++ b/inc/lib/Twig/TokenParser/Extends.php @@ -29,23 +29,21 @@ class Twig_TokenParser_Extends extends Twig_TokenParser public function parse(Twig_Token $token) { if (!$this->parser->isMainScope()) { - throw new Twig_Error_Syntax('Cannot extend from a block', $token->getLine()); + throw new Twig_Error_Syntax('Cannot extend from a block', $token->getLine(), $this->parser->getFilename()); } if (null !== $this->parser->getParent()) { - throw new Twig_Error_Syntax('Multiple extends tags are forbidden', $token->getLine()); + throw new Twig_Error_Syntax('Multiple extends tags are forbidden', $token->getLine(), $this->parser->getFilename()); } $this->parser->setParent($this->parser->getExpressionParser()->parseExpression()); $this->parser->getStream()->expect(Twig_Token::BLOCK_END_TYPE); - - return null; } /** * Gets the tag name associated with this token parser. * - * @param string The tag name + * @return string The tag name */ public function getTag() { diff --git a/inc/lib/Twig/TokenParser/Filter.php b/inc/lib/Twig/TokenParser/Filter.php index 0969ab1e..2b97475a 100644 --- a/inc/lib/Twig/TokenParser/Filter.php +++ b/inc/lib/Twig/TokenParser/Filter.php @@ -52,7 +52,7 @@ class Twig_TokenParser_Filter extends Twig_TokenParser /** * Gets the tag name associated with this token parser. * - * @param string The tag name + * @return string The tag name */ public function getTag() { diff --git a/inc/lib/Twig/TokenParser/Flush.php b/inc/lib/Twig/TokenParser/Flush.php new file mode 100644 index 00000000..4e15e785 --- /dev/null +++ b/inc/lib/Twig/TokenParser/Flush.php @@ -0,0 +1,42 @@ +<?php + +/* + * This file is part of Twig. + * + * (c) 2011 Fabien Potencier + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/** + * Flushes the output to the client. + * + * @see flush() + */ +class Twig_TokenParser_Flush extends Twig_TokenParser +{ + /** + * Parses a token and returns a node. + * + * @param Twig_Token $token A Twig_Token instance + * + * @return Twig_NodeInterface A Twig_NodeInterface instance + */ + public function parse(Twig_Token $token) + { + $this->parser->getStream()->expect(Twig_Token::BLOCK_END_TYPE); + + return new Twig_Node_Flush($token->getLine(), $this->getTag()); + } + + /** + * Gets the tag name associated with this token parser. + * + * @return string The tag name + */ + public function getTag() + { + return 'flush'; + } +} diff --git a/inc/lib/Twig/TokenParser/For.php b/inc/lib/Twig/TokenParser/For.php index 5ce82979..98a6d079 100644 --- a/inc/lib/Twig/TokenParser/For.php +++ b/inc/lib/Twig/TokenParser/For.php @@ -33,32 +33,41 @@ class Twig_TokenParser_For extends Twig_TokenParser public function parse(Twig_Token $token) { $lineno = $token->getLine(); + $stream = $this->parser->getStream(); $targets = $this->parser->getExpressionParser()->parseAssignmentExpression(); - $this->parser->getStream()->expect(Twig_Token::OPERATOR_TYPE, 'in'); + $stream->expect(Twig_Token::OPERATOR_TYPE, 'in'); $seq = $this->parser->getExpressionParser()->parseExpression(); $ifexpr = null; - if ($this->parser->getStream()->test(Twig_Token::NAME_TYPE, 'if')) { - $this->parser->getStream()->next(); + if ($stream->test(Twig_Token::NAME_TYPE, 'if')) { + $stream->next(); $ifexpr = $this->parser->getExpressionParser()->parseExpression(); } - $this->parser->getStream()->expect(Twig_Token::BLOCK_END_TYPE); + $stream->expect(Twig_Token::BLOCK_END_TYPE); $body = $this->parser->subparse(array($this, 'decideForFork')); - if ($this->parser->getStream()->next()->getValue() == 'else') { - $this->parser->getStream()->expect(Twig_Token::BLOCK_END_TYPE); + if ($stream->next()->getValue() == 'else') { + $stream->expect(Twig_Token::BLOCK_END_TYPE); $else = $this->parser->subparse(array($this, 'decideForEnd'), true); } else { $else = null; } - $this->parser->getStream()->expect(Twig_Token::BLOCK_END_TYPE); + $stream->expect(Twig_Token::BLOCK_END_TYPE); if (count($targets) > 1) { $keyTarget = $targets->getNode(0); + $keyTarget = new Twig_Node_Expression_AssignName($keyTarget->getAttribute('name'), $keyTarget->getLine()); $valueTarget = $targets->getNode(1); + $valueTarget = new Twig_Node_Expression_AssignName($valueTarget->getAttribute('name'), $valueTarget->getLine()); } else { $keyTarget = new Twig_Node_Expression_AssignName('_key', $lineno); $valueTarget = $targets->getNode(0); + $valueTarget = new Twig_Node_Expression_AssignName($valueTarget->getAttribute('name'), $valueTarget->getLine()); + } + + if ($ifexpr) { + $this->checkLoopUsageCondition($stream, $ifexpr); + $this->checkLoopUsageBody($stream, $body); } return new Twig_Node_For($keyTarget, $valueTarget, $seq, $ifexpr, $body, $else, $lineno, $this->getTag()); @@ -74,10 +83,51 @@ class Twig_TokenParser_For extends Twig_TokenParser return $token->test('endfor'); } + // the loop variable cannot be used in the condition + protected function checkLoopUsageCondition(Twig_TokenStream $stream, Twig_NodeInterface $node) + { + if ($node instanceof Twig_Node_Expression_GetAttr && $node->getNode('node') instanceof Twig_Node_Expression_Name && 'loop' == $node->getNode('node')->getAttribute('name')) { + throw new Twig_Error_Syntax('The "loop" variable cannot be used in a looping condition', $node->getLine(), $stream->getFilename()); + } + + foreach ($node as $n) { + if (!$n) { + continue; + } + + $this->checkLoopUsageCondition($stream, $n); + } + } + + // check usage of non-defined loop-items + // it does not catch all problems (for instance when a for is included into another or when the variable is used in an include) + protected function checkLoopUsageBody(Twig_TokenStream $stream, Twig_NodeInterface $node) + { + if ($node instanceof Twig_Node_Expression_GetAttr && $node->getNode('node') instanceof Twig_Node_Expression_Name && 'loop' == $node->getNode('node')->getAttribute('name')) { + $attribute = $node->getNode('attribute'); + if ($attribute instanceof Twig_Node_Expression_Constant && in_array($attribute->getAttribute('value'), array('length', 'revindex0', 'revindex', 'last'))) { + throw new Twig_Error_Syntax(sprintf('The "loop.%s" variable is not defined when looping with a condition', $attribute->getAttribute('value')), $node->getLine(), $stream->getFilename()); + } + } + + // should check for parent.loop.XXX usage + if ($node instanceof Twig_Node_For) { + return; + } + + foreach ($node as $n) { + if (!$n) { + continue; + } + + $this->checkLoopUsageBody($stream, $n); + } + } + /** * Gets the tag name associated with this token parser. * - * @param string The tag name + * @return string The tag name */ public function getTag() { diff --git a/inc/lib/Twig/TokenParser/From.php b/inc/lib/Twig/TokenParser/From.php index 87aceb4d..a54054db 100644 --- a/inc/lib/Twig/TokenParser/From.php +++ b/inc/lib/Twig/TokenParser/From.php @@ -55,8 +55,8 @@ class Twig_TokenParser_From extends Twig_TokenParser $node = new Twig_Node_Import($macro, new Twig_Node_Expression_AssignName($this->parser->getVarName(), $token->getLine()), $token->getLine(), $this->getTag()); - foreach($targets as $name => $alias) { - $this->parser->addImportedFunction($alias, $name, $node->getNode('var')); + foreach ($targets as $name => $alias) { + $this->parser->addImportedSymbol('function', $alias, 'get'.$name, $node->getNode('var')); } return $node; @@ -65,7 +65,7 @@ class Twig_TokenParser_From extends Twig_TokenParser /** * Gets the tag name associated with this token parser. * - * @param string The tag name + * @return string The tag name */ public function getTag() { diff --git a/inc/lib/Twig/TokenParser/If.php b/inc/lib/Twig/TokenParser/If.php index 65a1a8b2..3d7d1f51 100644 --- a/inc/lib/Twig/TokenParser/If.php +++ b/inc/lib/Twig/TokenParser/If.php @@ -36,22 +36,23 @@ class Twig_TokenParser_If extends Twig_TokenParser { $lineno = $token->getLine(); $expr = $this->parser->getExpressionParser()->parseExpression(); - $this->parser->getStream()->expect(Twig_Token::BLOCK_END_TYPE); + $stream = $this->parser->getStream(); + $stream->expect(Twig_Token::BLOCK_END_TYPE); $body = $this->parser->subparse(array($this, 'decideIfFork')); $tests = array($expr, $body); $else = null; $end = false; while (!$end) { - switch ($this->parser->getStream()->next()->getValue()) { + switch ($stream->next()->getValue()) { case 'else': - $this->parser->getStream()->expect(Twig_Token::BLOCK_END_TYPE); + $stream->expect(Twig_Token::BLOCK_END_TYPE); $else = $this->parser->subparse(array($this, 'decideIfEnd')); break; case 'elseif': $expr = $this->parser->getExpressionParser()->parseExpression(); - $this->parser->getStream()->expect(Twig_Token::BLOCK_END_TYPE); + $stream->expect(Twig_Token::BLOCK_END_TYPE); $body = $this->parser->subparse(array($this, 'decideIfFork')); $tests[] = $expr; $tests[] = $body; @@ -62,11 +63,11 @@ class Twig_TokenParser_If extends Twig_TokenParser break; default: - throw new Twig_Error_Syntax(sprintf('Unexpected end of template. Twig was looking for the following tags "else", "elseif", or "endif" to close the "if" block started at line %d)', $lineno), -1); + throw new Twig_Error_Syntax(sprintf('Unexpected end of template. Twig was looking for the following tags "else", "elseif", or "endif" to close the "if" block started at line %d)', $lineno), $stream->getCurrent()->getLine(), $stream->getFilename()); } } - $this->parser->getStream()->expect(Twig_Token::BLOCK_END_TYPE); + $stream->expect(Twig_Token::BLOCK_END_TYPE); return new Twig_Node_If(new Twig_Node($tests), $else, $lineno, $this->getTag()); } @@ -84,7 +85,7 @@ class Twig_TokenParser_If extends Twig_TokenParser /** * Gets the tag name associated with this token parser. * - * @param string The tag name + * @return string The tag name */ public function getTag() { diff --git a/inc/lib/Twig/TokenParser/Import.php b/inc/lib/Twig/TokenParser/Import.php index d0a88cde..e7050c70 100644 --- a/inc/lib/Twig/TokenParser/Import.php +++ b/inc/lib/Twig/TokenParser/Import.php @@ -32,13 +32,15 @@ class Twig_TokenParser_Import extends Twig_TokenParser $var = new Twig_Node_Expression_AssignName($this->parser->getStream()->expect(Twig_Token::NAME_TYPE)->getValue(), $token->getLine()); $this->parser->getStream()->expect(Twig_Token::BLOCK_END_TYPE); + $this->parser->addImportedSymbol('template', $var->getAttribute('name')); + return new Twig_Node_Import($macro, $var, $token->getLine(), $this->getTag()); } /** * Gets the tag name associated with this token parser. * - * @param string The tag name + * @return string The tag name */ public function getTag() { diff --git a/inc/lib/Twig/TokenParser/Include.php b/inc/lib/Twig/TokenParser/Include.php index 54154559..4a317868 100644 --- a/inc/lib/Twig/TokenParser/Include.php +++ b/inc/lib/Twig/TokenParser/Include.php @@ -32,37 +32,46 @@ class Twig_TokenParser_Include extends Twig_TokenParser { $expr = $this->parser->getExpressionParser()->parseExpression(); + list($variables, $only, $ignoreMissing) = $this->parseArguments(); + + return new Twig_Node_Include($expr, $variables, $only, $ignoreMissing, $token->getLine(), $this->getTag()); + } + + protected function parseArguments() + { + $stream = $this->parser->getStream(); + $ignoreMissing = false; - if ($this->parser->getStream()->test(Twig_Token::NAME_TYPE, 'ignore')) { - $this->parser->getStream()->next(); - $this->parser->getStream()->expect(Twig_Token::NAME_TYPE, 'missing'); + if ($stream->test(Twig_Token::NAME_TYPE, 'ignore')) { + $stream->next(); + $stream->expect(Twig_Token::NAME_TYPE, 'missing'); $ignoreMissing = true; } $variables = null; - if ($this->parser->getStream()->test(Twig_Token::NAME_TYPE, 'with')) { - $this->parser->getStream()->next(); + if ($stream->test(Twig_Token::NAME_TYPE, 'with')) { + $stream->next(); $variables = $this->parser->getExpressionParser()->parseExpression(); } $only = false; - if ($this->parser->getStream()->test(Twig_Token::NAME_TYPE, 'only')) { - $this->parser->getStream()->next(); + if ($stream->test(Twig_Token::NAME_TYPE, 'only')) { + $stream->next(); $only = true; } - $this->parser->getStream()->expect(Twig_Token::BLOCK_END_TYPE); + $stream->expect(Twig_Token::BLOCK_END_TYPE); - return new Twig_Node_Include($expr, $variables, $only, $ignoreMissing, $token->getLine(), $this->getTag()); + return array($variables, $only, $ignoreMissing); } /** * Gets the tag name associated with this token parser. * - * @param string The tag name + * @return string The tag name */ public function getTag() { diff --git a/inc/lib/Twig/TokenParser/Macro.php b/inc/lib/Twig/TokenParser/Macro.php index da1ac55c..82b4fa6d 100644 --- a/inc/lib/Twig/TokenParser/Macro.php +++ b/inc/lib/Twig/TokenParser/Macro.php @@ -30,26 +30,25 @@ class Twig_TokenParser_Macro extends Twig_TokenParser public function parse(Twig_Token $token) { $lineno = $token->getLine(); - $name = $this->parser->getStream()->expect(Twig_Token::NAME_TYPE)->getValue(); + $stream = $this->parser->getStream(); + $name = $stream->expect(Twig_Token::NAME_TYPE)->getValue(); - $arguments = $this->parser->getExpressionParser()->parseArguments(); + $arguments = $this->parser->getExpressionParser()->parseArguments(true, true); - $this->parser->getStream()->expect(Twig_Token::BLOCK_END_TYPE); + $stream->expect(Twig_Token::BLOCK_END_TYPE); $this->parser->pushLocalScope(); $body = $this->parser->subparse(array($this, 'decideBlockEnd'), true); - if ($this->parser->getStream()->test(Twig_Token::NAME_TYPE)) { - $value = $this->parser->getStream()->next()->getValue(); + if ($stream->test(Twig_Token::NAME_TYPE)) { + $value = $stream->next()->getValue(); if ($value != $name) { - throw new Twig_Error_Syntax(sprintf("Expected endmacro for macro '$name' (but %s given)", $value), $lineno); + throw new Twig_Error_Syntax(sprintf("Expected endmacro for macro '$name' (but %s given)", $value), $stream->getCurrent()->getLine(), $stream->getFilename()); } } $this->parser->popLocalScope(); - $this->parser->getStream()->expect(Twig_Token::BLOCK_END_TYPE); + $stream->expect(Twig_Token::BLOCK_END_TYPE); - $this->parser->setMacro($name, new Twig_Node_Macro($name, $body, $arguments, $lineno, $this->getTag())); - - return null; + $this->parser->setMacro($name, new Twig_Node_Macro($name, new Twig_Node_Body(array($body)), $arguments, $lineno, $this->getTag())); } public function decideBlockEnd(Twig_Token $token) @@ -60,7 +59,7 @@ class Twig_TokenParser_Macro extends Twig_TokenParser /** * Gets the tag name associated with this token parser. * - * @param string The tag name + * @return string The tag name */ public function getTag() { diff --git a/inc/lib/Twig/TokenParser/Sandbox.php b/inc/lib/Twig/TokenParser/Sandbox.php index 62e7f8f7..9457325a 100644 --- a/inc/lib/Twig/TokenParser/Sandbox.php +++ b/inc/lib/Twig/TokenParser/Sandbox.php @@ -35,6 +35,19 @@ class Twig_TokenParser_Sandbox extends Twig_TokenParser $body = $this->parser->subparse(array($this, 'decideBlockEnd'), true); $this->parser->getStream()->expect(Twig_Token::BLOCK_END_TYPE); + // in a sandbox tag, only include tags are allowed + if (!$body instanceof Twig_Node_Include) { + foreach ($body as $node) { + if ($node instanceof Twig_Node_Text && ctype_space($node->getAttribute('data'))) { + continue; + } + + if (!$node instanceof Twig_Node_Include) { + throw new Twig_Error_Syntax('Only "include" tags are allowed within a "sandbox" section', $node->getLine(), $this->parser->getFilename()); + } + } + } + return new Twig_Node_Sandbox($body, $token->getLine(), $this->getTag()); } @@ -46,7 +59,7 @@ class Twig_TokenParser_Sandbox extends Twig_TokenParser /** * Gets the tag name associated with this token parser. * - * @param string The tag name + * @return string The tag name */ public function getTag() { diff --git a/inc/lib/Twig/TokenParser/Set.php b/inc/lib/Twig/TokenParser/Set.php index 489e1d30..70e0b41b 100644 --- a/inc/lib/Twig/TokenParser/Set.php +++ b/inc/lib/Twig/TokenParser/Set.php @@ -49,13 +49,13 @@ class Twig_TokenParser_Set extends Twig_TokenParser $stream->expect(Twig_Token::BLOCK_END_TYPE); if (count($names) !== count($values)) { - throw new Twig_Error_Syntax("When using set, you must have the same number of variables and assignements.", $lineno); + throw new Twig_Error_Syntax("When using set, you must have the same number of variables and assignments.", $stream->getCurrent()->getLine(), $stream->getFilename()); } } else { $capture = true; if (count($names) > 1) { - throw new Twig_Error_Syntax("When using set with a block, you cannot have a multi-target.", $lineno); + throw new Twig_Error_Syntax("When using set with a block, you cannot have a multi-target.", $stream->getCurrent()->getLine(), $stream->getFilename()); } $stream->expect(Twig_Token::BLOCK_END_TYPE); @@ -75,7 +75,7 @@ class Twig_TokenParser_Set extends Twig_TokenParser /** * Gets the tag name associated with this token parser. * - * @param string The tag name + * @return string The tag name */ public function getTag() { diff --git a/inc/lib/Twig/TokenParser/Spaceless.php b/inc/lib/Twig/TokenParser/Spaceless.php index aa7ffbc4..1e3fa8f3 100644 --- a/inc/lib/Twig/TokenParser/Spaceless.php +++ b/inc/lib/Twig/TokenParser/Spaceless.php @@ -50,7 +50,7 @@ class Twig_TokenParser_Spaceless extends Twig_TokenParser /** * Gets the tag name associated with this token parser. * - * @param string The tag name + * @return string The tag name */ public function getTag() { diff --git a/inc/lib/Twig/TokenParser/Use.php b/inc/lib/Twig/TokenParser/Use.php index 16c47e3e..bc0e09ef 100644 --- a/inc/lib/Twig/TokenParser/Use.php +++ b/inc/lib/Twig/TokenParser/Use.php @@ -35,13 +35,12 @@ class Twig_TokenParser_Use extends Twig_TokenParser public function parse(Twig_Token $token) { $template = $this->parser->getExpressionParser()->parseExpression(); + $stream = $this->parser->getStream(); if (!$template instanceof Twig_Node_Expression_Constant) { - throw new Twig_Error_Syntax('The template references in a "use" statement must be a string.', $token->getLine()); + throw new Twig_Error_Syntax('The template references in a "use" statement must be a string.', $stream->getCurrent()->getLine(), $stream->getFilename()); } - $stream = $this->parser->getStream(); - $targets = array(); if ($stream->test('with')) { $stream->next(); @@ -69,14 +68,12 @@ class Twig_TokenParser_Use extends Twig_TokenParser $stream->expect(Twig_Token::BLOCK_END_TYPE); $this->parser->addTrait(new Twig_Node(array('template' => $template, 'targets' => new Twig_Node($targets)))); - - return null; } /** * Gets the tag name associated with this token parser. * - * @param string The tag name + * @return string The tag name */ public function getTag() { diff --git a/inc/lib/Twig/TokenParserBroker.php b/inc/lib/Twig/TokenParserBroker.php index 34fcdfbf..ec3fba67 100644 --- a/inc/lib/Twig/TokenParserBroker.php +++ b/inc/lib/Twig/TokenParserBroker.php @@ -13,8 +13,8 @@ /** * Default implementation of a token parser broker. * - * @package twig - * @author Arnaud Le Blanc <arnaud.lb@gmail.com> + * @author Arnaud Le Blanc <arnaud.lb@gmail.com> + * @deprecated since 1.12 (to be removed in 2.0) */ class Twig_TokenParserBroker implements Twig_TokenParserBrokerInterface { @@ -32,13 +32,13 @@ class Twig_TokenParserBroker implements Twig_TokenParserBrokerInterface { foreach ($parsers as $parser) { if (!$parser instanceof Twig_TokenParserInterface) { - throw new Twig_Error('$parsers must a an array of Twig_TokenParserInterface'); + throw new LogicException('$parsers must a an array of Twig_TokenParserInterface'); } $this->parsers[$parser->getTag()] = $parser; } foreach ($brokers as $broker) { if (!$broker instanceof Twig_TokenParserBrokerInterface) { - throw new Twig_Error('$brokers must a an array of Twig_TokenParserBrokerInterface'); + throw new LogicException('$brokers must a an array of Twig_TokenParserBrokerInterface'); } $this->brokers[] = $broker; } @@ -55,6 +55,19 @@ class Twig_TokenParserBroker implements Twig_TokenParserBrokerInterface } /** + * Removes a TokenParser. + * + * @param Twig_TokenParserInterface $parser A Twig_TokenParserInterface instance + */ + public function removeTokenParser(Twig_TokenParserInterface $parser) + { + $name = $parser->getTag(); + if (isset($this->parsers[$name]) && $parser === $this->parsers[$name]) { + unset($this->parsers[$name]); + } + } + + /** * Adds a TokenParserBroker. * * @param Twig_TokenParserBroker $broker A Twig_TokenParserBroker instance @@ -65,6 +78,18 @@ class Twig_TokenParserBroker implements Twig_TokenParserBrokerInterface } /** + * Removes a TokenParserBroker. + * + * @param Twig_TokenParserBroker $broker A Twig_TokenParserBroker instance + */ + public function removeTokenParserBroker(Twig_TokenParserBroker $broker) + { + if (false !== $pos = array_search($broker, $this->brokers)) { + unset($this->brokers[$pos]); + } + } + + /** * Gets a suitable TokenParser for a tag. * * First looks in parsers, then in brokers. @@ -86,7 +111,11 @@ class Twig_TokenParserBroker implements Twig_TokenParserBrokerInterface } $broker = prev($this->brokers); } - return null; + } + + public function getParsers() + { + return $this->parsers; } public function getParser() diff --git a/inc/lib/Twig/TokenParserBrokerInterface.php b/inc/lib/Twig/TokenParserBrokerInterface.php index 3ce8ca26..3f006e33 100644 --- a/inc/lib/Twig/TokenParserBrokerInterface.php +++ b/inc/lib/Twig/TokenParserBrokerInterface.php @@ -15,31 +15,31 @@ * * Token parser brokers allows to implement custom logic in the process of resolving a token parser for a given tag name. * - * @package twig - * @author Arnaud Le Blanc <arnaud.lb@gmail.com> + * @author Arnaud Le Blanc <arnaud.lb@gmail.com> + * @deprecated since 1.12 (to be removed in 2.0) */ interface Twig_TokenParserBrokerInterface { /** * Gets a TokenParser suitable for a tag. * - * @param string $tag A tag name + * @param string $tag A tag name * * @return null|Twig_TokenParserInterface A Twig_TokenParserInterface or null if no suitable TokenParser was found */ - function getTokenParser($tag); + public function getTokenParser($tag); /** * Calls Twig_TokenParserInterface::setParser on all parsers the implementation knows of. * * @param Twig_ParserInterface $parser A Twig_ParserInterface interface */ - function setParser(Twig_ParserInterface $parser); + public function setParser(Twig_ParserInterface $parser); /** * Gets the Twig_ParserInterface. * - * @return null|Twig_ParserInterface A Twig_ParserInterface instance of null + * @return null|Twig_ParserInterface A Twig_ParserInterface instance or null */ - function getParser(); + public function getParser(); } diff --git a/inc/lib/Twig/TokenParserInterface.php b/inc/lib/Twig/TokenParserInterface.php index 114a939e..bbde7714 100644 --- a/inc/lib/Twig/TokenParserInterface.php +++ b/inc/lib/Twig/TokenParserInterface.php @@ -12,8 +12,7 @@ /** * Interface implemented by token parsers. * - * @package twig - * @author Fabien Potencier <fabien@symfony.com> + * @author Fabien Potencier <fabien@symfony.com> */ interface Twig_TokenParserInterface { @@ -22,7 +21,7 @@ interface Twig_TokenParserInterface * * @param $parser A Twig_Parser instance */ - function setParser(Twig_Parser $parser); + public function setParser(Twig_Parser $parser); /** * Parses a token and returns a node. @@ -31,12 +30,12 @@ interface Twig_TokenParserInterface * * @return Twig_NodeInterface A Twig_NodeInterface instance */ - function parse(Twig_Token $token); + public function parse(Twig_Token $token); /** * Gets the tag name associated with this token parser. * - * @param string The tag name + * @return string The tag name */ - function getTag(); + public function getTag(); } diff --git a/inc/lib/Twig/TokenStream.php b/inc/lib/Twig/TokenStream.php index a2002b42..a78189f6 100644 --- a/inc/lib/Twig/TokenStream.php +++ b/inc/lib/Twig/TokenStream.php @@ -13,8 +13,7 @@ /** * Represents a token stream. * - * @package twig - * @author Fabien Potencier <fabien@symfony.com> + * @author Fabien Potencier <fabien@symfony.com> */ class Twig_TokenStream { @@ -45,6 +44,11 @@ class Twig_TokenStream return implode("\n", $this->tokens); } + public function injectTokens(array $tokens) + { + $this->tokens = array_merge(array_slice($this->tokens, 0, $this->current), $tokens, array_slice($this->tokens, $this->current)); + } + /** * Sets the pointer to the next token and returns the old one. * @@ -53,7 +57,7 @@ class Twig_TokenStream public function next() { if (!isset($this->tokens[++$this->current])) { - throw new Twig_Error_Syntax('Unexpected end of template', -1, $this->filename); + throw new Twig_Error_Syntax('Unexpected end of template', $this->tokens[$this->current - 1]->getLine(), $this->filename); } return $this->tokens[$this->current - 1]; @@ -92,7 +96,7 @@ class Twig_TokenStream public function look($number = 1) { if (!isset($this->tokens[$this->current + $number])) { - throw new Twig_Error_Syntax('Unexpected end of template', -1, $this->filename); + throw new Twig_Error_Syntax('Unexpected end of template', $this->tokens[$this->current + $number - 1]->getLine(), $this->filename); } return $this->tokens[$this->current + $number]; diff --git a/inc/locale/pl_PL/LC_MESSAGES/javascript.js b/inc/locale/pl_PL/LC_MESSAGES/javascript.js index 44857b98..9345b0b3 100644 --- a/inc/locale/pl_PL/LC_MESSAGES/javascript.js +++ b/inc/locale/pl_PL/LC_MESSAGES/javascript.js @@ -1 +1 @@ -l10n = {"Submit":"Wy\u015blij","Quick reply":"Szybka odpowied\u017a","Posting mode: Replying to <small>>>{0}<\/small>":"Tryb postowania: Odpowied\u017a na <small>>>{0}<\/small>","Return":"Powr\u00f3t","Click reply to view.":"Kliknij Odpowied\u017a aby zobaczy\u0107.","Click to expand":"Kliknij aby rozwin\u0105\u0107","Hide expanded replies":"Schowaj rozwini\u0119te odpowiedzi","Mon":"pon","Tue":"wto","Wed":"\u015bro","Thu":"czw","Fri":"pi\u0105","Sat":"sob","Sun":"nie","Show locked threads":"Poka\u017c zablokowane tematy","Hide locked threads":"Schowaj zablokowane tematy","Forced anonymity":"Wymuszona anonimowo\u015b\u0107","enabled":"w\u0142\u0105czona","disabled":"wy\u0142\u0105czona","Password":"Has\u0142o","Delete file only":"Usu\u0144 tylko plik","File":"Plik","Delete":"Usu\u0144","Reason":"Pow\u00f3d","Report":"Zg\u0142oszenie"};
\ No newline at end of file +l10n = {"Submit":"Wy\u015blij","Quick reply":"Szybka odpowied\u017a","Posting mode: Replying to <small>>>{0}<\/small>":"Tryb postowania: Odpowied\u017a na <small>>>{0}<\/small>","Return":"Powr\u00f3t","Click reply to view.":"Kliknij Odpowied\u017a aby zobaczy\u0107.","Click to expand":"Kliknij aby rozwin\u0105\u0107","Hide expanded replies":"Schowaj rozwini\u0119te odpowiedzi","Mon":"pon","Tue":"wto","Wed":"\u015bro","Thu":"czw","Fri":"pi\u0105","Sat":"sob","Sun":"nie","Show locked threads":"Poka\u017c zablokowane tematy","Hide locked threads":"Schowaj zablokowane tematy","Forced anonymity":"Wymuszona anonimowo\u015b\u0107","enabled":"w\u0142\u0105czona","disabled":"wy\u0142\u0105czona","Password":"Has\u0142o","Delete file only":"Usu\u0144 tylko plik","File":"Plik","Delete":"Usu\u0144","Reason":"Pow\u00f3d","Report":"Zg\u0142oszenie","hide":"ukryj","show":"poka\u017c","hidden":"ukryte","Show images":"Poka\u017c obrazki","Hide images":"Ukryj obrazki","Style: ":"Styl: ","Hello!":"Witaj!","{0} users":"{0} u\u017cytkownik\u00f3w","(hide threads from this board)":"(schowaj w\u0105tki z tego boardu)","(show threads from this board)":"(poka\u017c w\u0105tki z tego boardu)","No more threads to display":"Nie ma wi\u0119cej w\u0105tk\u00f3w do wy\u015bwietlenia","Loading...":"\u0141adowanie..."};
\ No newline at end of file diff --git a/inc/locale/pl_PL/LC_MESSAGES/javascript.po b/inc/locale/pl_PL/LC_MESSAGES/javascript.po index 3c16c8d7..474f4fe8 100644 --- a/inc/locale/pl_PL/LC_MESSAGES/javascript.po +++ b/inc/locale/pl_PL/LC_MESSAGES/javascript.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2013-07-18 16:31-0400\n" +"POT-Creation-Date: 2013-08-05 05:28-0400\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Language-Team: LANGUAGE <LL@li.org>\n" @@ -41,7 +41,8 @@ msgstr "Kliknij Odpowiedź aby zobaczyć." msgid "Click to expand" msgstr "Kliknij aby rozwinąć" -#: ../../../../js/expand.js:41 +#: ../../../../js/expand.js:41 ../../../../js/expand.js:45 +#: ../../../../js/expand.js:43 msgid "Hide expanded replies" msgstr "Schowaj rozwinięte odpowiedzi" @@ -104,7 +105,7 @@ msgstr "Hasło" msgid "Delete file only" msgstr "Usuń tylko plik" -#: ../../../../js/quick-post-controls.js:30 +#: ../../../../js/quick-post-controls.js:30 ../../../../js/hide-images.js:50 msgid "File" msgstr "Plik" @@ -119,3 +120,53 @@ msgstr "Powód" #: ../../../../js/quick-post-controls.js:37 msgid "Report" msgstr "Zgłoszenie" + +#: ../../../../js/hide-images.js:50 +msgid "hide" +msgstr "ukryj" + +#: ../../../../js/hide-images.js:56 +msgid "show" +msgstr "pokaż" + +#: ../../../../js/toggle-images.js:41 +msgid "hidden" +msgstr "ukryte" + +#: ../../../../js/toggle-images.js:57 ../../../../js/toggle-images.js:70 +msgid "Show images" +msgstr "Pokaż obrazki" + +#: ../../../../js/toggle-images.js:57 ../../../../js/toggle-images.js:70 +msgid "Hide images" +msgstr "Ukryj obrazki" + +#: ../../../../js/style-select.js:40 +msgid "Style: " +msgstr "Styl: " + +#: ../../../../templates/main.js:6 +msgid "Hello!" +msgstr "Witaj!" + +#: ../../../../templates/main.js:18 +msgid "{0} users" +msgstr "{0} użytkowników" + +#: ../../../../templates/themes/ukko/ukko.js:28 +#: ../../../../templates/themes/ukko/ukko.js:39 +msgid "(hide threads from this board)" +msgstr "(schowaj wątki z tego boardu)" + +#: ../../../../templates/themes/ukko/ukko.js:32 +#: ../../../../templates/themes/ukko/ukko.js:44 +msgid "(show threads from this board)" +msgstr "(pokaż wątki z tego boardu)" + +#: ../../../../templates/themes/ukko/ukko.js:57 +msgid "No more threads to display" +msgstr "Nie ma więcej wątków do wyświetlenia" + +#: ../../../../templates/themes/ukko/ukko.js:79 +msgid "Loading..." +msgstr "Ładowanie..." diff --git a/inc/locale/pl_PL/LC_MESSAGES/tinyboard.mo b/inc/locale/pl_PL/LC_MESSAGES/tinyboard.mo Binary files differindex b1ccc28d..7f72498a 100644 --- a/inc/locale/pl_PL/LC_MESSAGES/tinyboard.mo +++ b/inc/locale/pl_PL/LC_MESSAGES/tinyboard.mo diff --git a/inc/locale/pl_PL/LC_MESSAGES/tinyboard.po b/inc/locale/pl_PL/LC_MESSAGES/tinyboard.po index 8af9b27b..d527d0b4 100644 --- a/inc/locale/pl_PL/LC_MESSAGES/tinyboard.po +++ b/inc/locale/pl_PL/LC_MESSAGES/tinyboard.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2013-07-20 20:07-0400\n" +"POT-Creation-Date: 2013-08-05 05:23-0400\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Language-Team: LANGUAGE <LL@li.org>\n" @@ -16,7 +16,7 @@ msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Plural-Forms: nplurals=INTEGER; plural=EXPRESSION;\n" +"Plural-Forms: nplurals=3; plural=(n==1 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n" #. There is no previous page. #: /var/www/html/Tinyboard/inc/functions.php:958 @@ -24,6 +24,8 @@ msgstr "" #: ../../../../inc/functions.php:1041 ../../../../inc/functions.php:1055 #: ../../../../inc/functions.php:1039 ../../../../inc/functions.php:1053 #: ../../../../inc/functions.php:1068 ../../../../inc/functions.php:1082 +#: ../../../../inc/functions.php:1079 ../../../../inc/functions.php:1093 +#: ../../../../inc/functions.php:1122 ../../../../inc/functions.php:1136 msgid "Previous" msgstr "Wstecz" @@ -33,6 +35,8 @@ msgstr "Wstecz" #: ../../../../inc/functions.php:1060 ../../../../inc/functions.php:1069 #: ../../../../inc/functions.php:1058 ../../../../inc/functions.php:1067 #: ../../../../inc/functions.php:1087 ../../../../inc/functions.php:1096 +#: ../../../../inc/functions.php:1098 ../../../../inc/functions.php:1107 +#: ../../../../inc/functions.php:1141 ../../../../inc/functions.php:1150 msgid "Next" msgstr "Dalej" @@ -42,6 +46,7 @@ msgstr "Niewspierany format pliku: " #: /var/www/html/Tinyboard/inc/mod.php:129 #: ../../../../templates/cache/3a/df/ab38a77244cb9c729b4c6f99759a.php:74 +#: ../../../../templates/cache/3a/df/ab38a77244cb9c729b4c6f99759a.php:79 msgid "Create new board" msgstr "Stwórz nowy board" @@ -52,22 +57,35 @@ msgstr "Stwórz nowy board" #: ../../../../templates/cache/e5/22/4711dd22e4c786b4de405db7a449.php:75 #: ../../../../templates/cache/18/9c/c365d711719f494c684aab98a4ae.php:150 #: ../../../../templates/cache/4c/fb/a3bf13b0badfc09442bd42da1cce.php:207 +#: ../../../../templates/cache/18/9c/c365d711719f494c684aab98a4ae.php:155 +#: ../../../../templates/cache/24/a0/f1ddafed7a8f9625e747a5ca33f5.php:312 +#: ../../../../templates/cache/e5/22/4711dd22e4c786b4de405db7a449.php:74 +#: ../../../../templates/cache/18/9c/c365d711719f494c684aab98a4ae.php:166 msgid "all boards" msgstr "wszystkie boardy" -#: /var/www/html/Tinyboard/inc/config.php:305 +#. How long before Tinyboard forgets about a mute? +#. 2 weeks +#. If you want to alter the algorithm a bit. Default value is 2. +#. (n^x where x is the number of previous mutes) +#: /var/www/html/Tinyboard/inc/config.php:305 ../../../../inc/config.php:330 +#: ../../../../inc/config.php:334 ../../../../inc/config.php:342 msgid "You have been muted for unoriginal content." -msgstr "Zostałeś zagłuszony za nieoryginalną treść." +msgstr "Zostałeś wyciszony za nieoryginalną treść." #: /var/www/html/Tinyboard/inc/config.php:447 msgid "Anonymous" msgstr "Anonimowy" -#: /var/www/html/Tinyboard/inc/config.php:481 +#. The names on the post buttons. (On most imageboards, these are both "Post") +#. The names on the post buttons. (On most imageboards, these are both just "Post"). +#: /var/www/html/Tinyboard/inc/config.php:481 ../../../../inc/config.php:552 +#: ../../../../inc/config.php:641 msgid "New Topic" msgstr "Nowy wątek" -#: /var/www/html/Tinyboard/inc/config.php:482 +#: /var/www/html/Tinyboard/inc/config.php:482 ../../../../inc/config.php:553 +#: ../../../../inc/config.php:642 msgid "New Reply" msgstr "Odpowiedz" @@ -83,16 +101,22 @@ msgstr "Szybka odpowiedź" #. Error messages #: /var/www/html/Tinyboard/inc/config.php:600 ../../../../inc/config.php:638 #: ../../../../inc/config.php:692 ../../../../inc/config.php:698 +#: ../../../../inc/config.php:695 ../../../../inc/config.php:701 +#: ../../../../inc/config.php:803 msgid "Lurk some more before posting." msgstr "Nie postuj pierwszego dnia." #: /var/www/html/Tinyboard/inc/config.php:601 ../../../../inc/config.php:639 #: ../../../../inc/config.php:693 ../../../../inc/config.php:699 +#: ../../../../inc/config.php:696 ../../../../inc/config.php:702 +#: ../../../../inc/config.php:804 msgid "You look like a bot." msgstr "Wyglądasz jak bot." #: /var/www/html/Tinyboard/inc/config.php:602 ../../../../inc/config.php:640 #: ../../../../inc/config.php:694 ../../../../inc/config.php:700 +#: ../../../../inc/config.php:697 ../../../../inc/config.php:703 +#: ../../../../inc/config.php:805 msgid "Your browser sent an invalid or no HTTP referer." msgstr "" "Twoja przeglądarka przesłała niepoprawny, bądź nie przesłała informacji o " @@ -100,135 +124,187 @@ msgstr "" #: /var/www/html/Tinyboard/inc/config.php:603 ../../../../inc/config.php:641 #: ../../../../inc/config.php:695 ../../../../inc/config.php:701 +#: ../../../../inc/config.php:698 ../../../../inc/config.php:704 +#: ../../../../inc/config.php:806 #, php-format msgid "The %s field was too long." msgstr "Pole %s jest za długie" #: /var/www/html/Tinyboard/inc/config.php:604 ../../../../inc/config.php:642 #: ../../../../inc/config.php:696 ../../../../inc/config.php:702 +#: ../../../../inc/config.php:699 ../../../../inc/config.php:705 +#: ../../../../inc/config.php:807 msgid "The body was too long." msgstr "Zawartość jest za długa." #: /var/www/html/Tinyboard/inc/config.php:605 ../../../../inc/config.php:643 #: ../../../../inc/config.php:697 ../../../../inc/config.php:703 +#: ../../../../inc/config.php:700 ../../../../inc/config.php:706 +#: ../../../../inc/config.php:808 msgid "The body was too short or empty." msgstr "Zawartość jest za krótka, bądź pusta." #: /var/www/html/Tinyboard/inc/config.php:606 ../../../../inc/config.php:644 #: ../../../../inc/config.php:698 ../../../../inc/config.php:704 +#: ../../../../inc/config.php:701 ../../../../inc/config.php:707 +#: ../../../../inc/config.php:809 msgid "You must upload an image." msgstr "Musisz wysłać obrazek." #: /var/www/html/Tinyboard/inc/config.php:607 ../../../../inc/config.php:645 #: ../../../../inc/config.php:699 ../../../../inc/config.php:705 +#: ../../../../inc/config.php:702 ../../../../inc/config.php:708 +#: ../../../../inc/config.php:810 msgid "The server failed to handle your upload." msgstr "Nie udało się obsłużyć twojego pliku." #: /var/www/html/Tinyboard/inc/config.php:608 ../../../../inc/config.php:646 #: ../../../../inc/config.php:700 ../../../../inc/config.php:706 +#: ../../../../inc/config.php:703 ../../../../inc/config.php:709 +#: ../../../../inc/config.php:811 msgid "Unsupported image format." msgstr "Niewspierany format obrazka." #: /var/www/html/Tinyboard/inc/config.php:609 ../../../../inc/config.php:647 #: ../../../../inc/config.php:701 ../../../../inc/config.php:707 +#: ../../../../inc/config.php:704 ../../../../inc/config.php:710 +#: ../../../../inc/config.php:812 msgid "Invalid board!" msgstr "Niepoprawny board!" #: /var/www/html/Tinyboard/inc/config.php:610 ../../../../inc/config.php:648 #: ../../../../inc/config.php:702 ../../../../inc/config.php:708 +#: ../../../../inc/config.php:705 ../../../../inc/config.php:711 +#: ../../../../inc/config.php:813 msgid "Thread specified does not exist." msgstr "Wybrany wątek nie istnieje." #: /var/www/html/Tinyboard/inc/config.php:611 ../../../../inc/config.php:649 #: ../../../../inc/config.php:703 ../../../../inc/config.php:709 +#: ../../../../inc/config.php:706 ../../../../inc/config.php:712 +#: ../../../../inc/config.php:814 msgid "Thread locked. You may not reply at this time." msgstr "Wątek jest zablokowany. Nie możesz w nim teraz postować." #: /var/www/html/Tinyboard/inc/config.php:612 ../../../../inc/config.php:650 #: ../../../../inc/config.php:706 ../../../../inc/config.php:712 +#: ../../../../inc/config.php:709 ../../../../inc/config.php:715 +#: ../../../../inc/config.php:817 msgid "You didn't make a post." msgstr "Nie zrobiłeś posta." #: /var/www/html/Tinyboard/inc/config.php:613 ../../../../inc/config.php:651 #: ../../../../inc/config.php:707 ../../../../inc/config.php:713 +#: ../../../../inc/config.php:710 ../../../../inc/config.php:716 +#: ../../../../inc/config.php:818 msgid "Flood detected; Post discarded." msgstr "Wykryto flood; Post odrzucony." #: /var/www/html/Tinyboard/inc/config.php:614 ../../../../inc/config.php:652 #: ../../../../inc/config.php:708 ../../../../inc/config.php:714 +#: ../../../../inc/config.php:711 ../../../../inc/config.php:717 +#: ../../../../inc/config.php:819 msgid "Your request looks automated; Post discarded." msgstr "Twoje żądanie wygląda na zautomatyzowane; Post odrzucony." #: /var/www/html/Tinyboard/inc/config.php:615 ../../../../inc/config.php:653 #: ../../../../inc/config.php:709 ../../../../inc/config.php:715 +#: ../../../../inc/config.php:712 ../../../../inc/config.php:718 +#: ../../../../inc/config.php:820 msgid "Unoriginal content!" msgstr "Nieoryginalna treść!" #: /var/www/html/Tinyboard/inc/config.php:616 ../../../../inc/config.php:654 #: ../../../../inc/config.php:710 ../../../../inc/config.php:716 +#: ../../../../inc/config.php:713 ../../../../inc/config.php:719 +#: ../../../../inc/config.php:821 #, php-format msgid "Unoriginal content! You have been muted for %d seconds." -msgstr "Nieoryginalna treść! Zostałeś zagłuszony na %d sekund." +msgstr "Nieoryginalna treść! Zostałeś wyciszony na %d sekund." #: /var/www/html/Tinyboard/inc/config.php:617 ../../../../inc/config.php:655 #: ../../../../inc/config.php:711 ../../../../inc/config.php:717 +#: ../../../../inc/config.php:714 ../../../../inc/config.php:720 +#: ../../../../inc/config.php:822 #, php-format msgid "You are muted! Expires in %d seconds." -msgstr "Jesteś zagłuszony! Wygasa w ciągu %d sekund." +msgstr "Jesteś wyciszony! Wygasa w ciągu %d sekund." #: /var/www/html/Tinyboard/inc/config.php:618 ../../../../inc/config.php:656 #: ../../../../inc/config.php:712 ../../../../inc/config.php:718 +#: ../../../../inc/config.php:715 ../../../../inc/config.php:721 +#: ../../../../inc/config.php:823 #, php-format msgid "Your IP address is listed in %s." msgstr "Twój adres IP jest na liście %s." #: /var/www/html/Tinyboard/inc/config.php:619 ../../../../inc/config.php:657 #: ../../../../inc/config.php:713 ../../../../inc/config.php:719 +#: ../../../../inc/config.php:716 ../../../../inc/config.php:722 +#: ../../../../inc/config.php:824 msgid "Too many links; flood detected." msgstr "Zbyt dużo linków; wykryto flood." #: /var/www/html/Tinyboard/inc/config.php:620 ../../../../inc/config.php:658 #: ../../../../inc/config.php:714 ../../../../inc/config.php:720 +#: ../../../../inc/config.php:717 ../../../../inc/config.php:723 +#: ../../../../inc/config.php:825 msgid "Too many cites; post discarded." msgstr "Zbyt dużo cytatów; post odrzucony." #: /var/www/html/Tinyboard/inc/config.php:621 ../../../../inc/config.php:659 #: ../../../../inc/config.php:715 ../../../../inc/config.php:721 +#: ../../../../inc/config.php:718 ../../../../inc/config.php:724 +#: ../../../../inc/config.php:826 msgid "Too many cross-board links; post discarded." msgstr "Zbyt dużo linków między boardami; post odrzucony." #: /var/www/html/Tinyboard/inc/config.php:622 ../../../../inc/config.php:660 #: ../../../../inc/config.php:716 ../../../../inc/config.php:722 +#: ../../../../inc/config.php:719 ../../../../inc/config.php:725 +#: ../../../../inc/config.php:827 msgid "You didn't select anything to delete." msgstr "Nie wybrano nic do usunięcia." #: /var/www/html/Tinyboard/inc/config.php:623 ../../../../inc/config.php:661 #: ../../../../inc/config.php:717 ../../../../inc/config.php:723 +#: ../../../../inc/config.php:720 ../../../../inc/config.php:726 +#: ../../../../inc/config.php:828 msgid "You didn't select anything to report." msgstr "Nie wybrano nic do zgłoszenia." #: /var/www/html/Tinyboard/inc/config.php:624 ../../../../inc/config.php:662 #: ../../../../inc/config.php:718 ../../../../inc/config.php:724 +#: ../../../../inc/config.php:721 ../../../../inc/config.php:727 +#: ../../../../inc/config.php:829 msgid "You can't report that many posts at once." msgstr "Nie możesz raportować tyle postów na raz." #: /var/www/html/Tinyboard/inc/config.php:625 ../../../../inc/config.php:663 #: ../../../../inc/config.php:719 ../../../../inc/config.php:725 +#: ../../../../inc/config.php:722 ../../../../inc/config.php:728 +#: ../../../../inc/config.php:830 msgid "Wrong password…" msgstr "Niepoprawne hasło" #: /var/www/html/Tinyboard/inc/config.php:626 ../../../../inc/config.php:664 #: ../../../../inc/config.php:720 ../../../../inc/config.php:726 +#: ../../../../inc/config.php:723 ../../../../inc/config.php:729 +#: ../../../../inc/config.php:831 msgid "Invalid image." msgstr "Niepoprawny obrazek." #: /var/www/html/Tinyboard/inc/config.php:627 ../../../../inc/config.php:665 #: ../../../../inc/config.php:721 ../../../../inc/config.php:727 +#: ../../../../inc/config.php:724 ../../../../inc/config.php:730 +#: ../../../../inc/config.php:832 msgid "Unknown file extension." msgstr "Nieznane rozszerzenie pliku." #: /var/www/html/Tinyboard/inc/config.php:628 ../../../../inc/config.php:666 #: ../../../../inc/config.php:722 ../../../../inc/config.php:728 +#: ../../../../inc/config.php:725 ../../../../inc/config.php:731 +#: ../../../../inc/config.php:833 msgid "Maximum file size: %maxsz% bytes<br>Your file's size: %filesz% bytes" msgstr "" "Maksymalny rozmiar pliku: %maxsz% bajtów<br>Rozmiar twojego pliku: %filesz% " @@ -236,28 +312,38 @@ msgstr "" #: /var/www/html/Tinyboard/inc/config.php:629 ../../../../inc/config.php:667 #: ../../../../inc/config.php:723 ../../../../inc/config.php:729 +#: ../../../../inc/config.php:726 ../../../../inc/config.php:732 +#: ../../../../inc/config.php:834 msgid "The file was too big." msgstr "Plik jest za duży." #: /var/www/html/Tinyboard/inc/config.php:630 ../../../../inc/config.php:668 #: ../../../../inc/config.php:724 ../../../../inc/config.php:730 +#: ../../../../inc/config.php:727 ../../../../inc/config.php:733 +#: ../../../../inc/config.php:835 msgid "Invalid archive!" msgstr "Niepoprawne archiwum!" #: /var/www/html/Tinyboard/inc/config.php:631 ../../../../inc/config.php:669 #: ../../../../inc/config.php:725 ../../../../inc/config.php:731 +#: ../../../../inc/config.php:728 ../../../../inc/config.php:734 +#: ../../../../inc/config.php:836 #, php-format msgid "That file <a href=\"%s\">already exists</a>!" msgstr "Ten plik <a href=\"%s\">już istnieje</a>!" #: /var/www/html/Tinyboard/inc/config.php:632 ../../../../inc/config.php:670 #: ../../../../inc/config.php:727 ../../../../inc/config.php:733 +#: ../../../../inc/config.php:730 ../../../../inc/config.php:736 +#: ../../../../inc/config.php:838 #, php-format msgid "You'll have to wait another %s before deleting that." msgstr "Musisz poczekać kolejne %s przed usunięciem tego." #: /var/www/html/Tinyboard/inc/config.php:633 ../../../../inc/config.php:671 #: ../../../../inc/config.php:728 ../../../../inc/config.php:734 +#: ../../../../inc/config.php:731 ../../../../inc/config.php:737 +#: ../../../../inc/config.php:839 msgid "MIME type detection XSS exploit (IE) detected; post discarded." msgstr "" "Wykryto próbę wykorzystania luki wykrywania typu MIME (XSS w IE); post " @@ -265,26 +351,36 @@ msgstr "" #: /var/www/html/Tinyboard/inc/config.php:634 ../../../../inc/config.php:672 #: ../../../../inc/config.php:729 ../../../../inc/config.php:735 +#: ../../../../inc/config.php:732 ../../../../inc/config.php:738 +#: ../../../../inc/config.php:840 msgid "Couldn't make sense of the URL of the video you tried to embed." msgstr "Nie można było zrozumieć URL-a wideo, którego próbowano zapostować." #: /var/www/html/Tinyboard/inc/config.php:635 ../../../../inc/config.php:673 #: ../../../../inc/config.php:730 ../../../../inc/config.php:736 +#: ../../../../inc/config.php:733 ../../../../inc/config.php:739 +#: ../../../../inc/config.php:841 msgid "You seem to have mistyped the verification." msgstr "Wygląda na to, że przepisano źle weryfikację." #: /var/www/html/Tinyboard/inc/config.php:638 ../../../../inc/config.php:676 #: ../../../../inc/config.php:734 ../../../../inc/config.php:740 +#: ../../../../inc/config.php:737 ../../../../inc/config.php:743 +#: ../../../../inc/config.php:845 msgid "Invalid username and/or password." msgstr "Błędna nazwa użytkownika, bądź hasło" #: /var/www/html/Tinyboard/inc/config.php:639 ../../../../inc/config.php:677 #: ../../../../inc/config.php:735 ../../../../inc/config.php:741 +#: ../../../../inc/config.php:738 ../../../../inc/config.php:744 +#: ../../../../inc/config.php:846 msgid "You are not a mod…" msgstr "Nie jesteś moderatorem" #: /var/www/html/Tinyboard/inc/config.php:640 ../../../../inc/config.php:678 #: ../../../../inc/config.php:736 ../../../../inc/config.php:742 +#: ../../../../inc/config.php:739 ../../../../inc/config.php:745 +#: ../../../../inc/config.php:847 msgid "" "Invalid username and/or password. Your user may have been deleted or changed." msgstr "" @@ -293,55 +389,75 @@ msgstr "" #: /var/www/html/Tinyboard/inc/config.php:641 ../../../../inc/config.php:679 #: ../../../../inc/config.php:737 ../../../../inc/config.php:743 +#: ../../../../inc/config.php:740 ../../../../inc/config.php:746 +#: ../../../../inc/config.php:848 msgid "Invalid/malformed cookies." msgstr "Niepoprawne/zmodyfikowane pliki cookie." #: /var/www/html/Tinyboard/inc/config.php:642 ../../../../inc/config.php:680 #: ../../../../inc/config.php:738 ../../../../inc/config.php:744 +#: ../../../../inc/config.php:741 ../../../../inc/config.php:747 +#: ../../../../inc/config.php:849 msgid "Your browser didn't submit an input when it should have." msgstr "Twoja przeglądarka nie wysłała pola, kiedy powinna." #: /var/www/html/Tinyboard/inc/config.php:643 ../../../../inc/config.php:681 #: ../../../../inc/config.php:739 ../../../../inc/config.php:745 +#: ../../../../inc/config.php:742 ../../../../inc/config.php:748 +#: ../../../../inc/config.php:850 #, php-format msgid "The %s field is required." msgstr "Pole %s jest wymagane." #: /var/www/html/Tinyboard/inc/config.php:644 ../../../../inc/config.php:682 #: ../../../../inc/config.php:740 ../../../../inc/config.php:746 +#: ../../../../inc/config.php:743 ../../../../inc/config.php:749 +#: ../../../../inc/config.php:851 #, php-format msgid "The %s field was invalid." msgstr "Pole %s jest niepoprawne." #: /var/www/html/Tinyboard/inc/config.php:645 ../../../../inc/config.php:683 #: ../../../../inc/config.php:741 ../../../../inc/config.php:747 +#: ../../../../inc/config.php:744 ../../../../inc/config.php:750 +#: ../../../../inc/config.php:852 #, php-format msgid "There is already a %s board." msgstr "Już istnieje board %s" #: /var/www/html/Tinyboard/inc/config.php:646 ../../../../inc/config.php:684 #: ../../../../inc/config.php:742 ../../../../inc/config.php:748 +#: ../../../../inc/config.php:745 ../../../../inc/config.php:751 +#: ../../../../inc/config.php:853 msgid "You don't have permission to do that." msgstr "Nie masz uprawnień do wykonania tej czynności." #: /var/www/html/Tinyboard/inc/config.php:647 ../../../../inc/config.php:685 #: ../../../../inc/config.php:743 ../../../../inc/config.php:749 +#: ../../../../inc/config.php:746 ../../../../inc/config.php:752 +#: ../../../../inc/config.php:854 msgid "That post doesn't exist…" msgstr "Ten post nie istnieje..." #: /var/www/html/Tinyboard/inc/config.php:648 ../../../../inc/config.php:686 #: ../../../../inc/config.php:744 ../../../../inc/config.php:750 +#: ../../../../inc/config.php:747 ../../../../inc/config.php:753 +#: ../../../../inc/config.php:855 msgid "Page not found." msgstr "Strona nie znaleziona." #: /var/www/html/Tinyboard/inc/config.php:649 ../../../../inc/config.php:687 #: ../../../../inc/config.php:745 ../../../../inc/config.php:751 +#: ../../../../inc/config.php:748 ../../../../inc/config.php:754 +#: ../../../../inc/config.php:856 #, php-format msgid "That mod <a href=\"?/users/%d\">already exists</a>!" msgstr "Ten moderator <a href=\"?/users/%d\">już istnieje</a>!" #: /var/www/html/Tinyboard/inc/config.php:650 ../../../../inc/config.php:688 #: ../../../../inc/config.php:746 ../../../../inc/config.php:752 +#: ../../../../inc/config.php:749 ../../../../inc/config.php:755 +#: ../../../../inc/config.php:857 msgid "That theme doesn't exist!" msgstr "Ten dodatek nie istnieje!" @@ -377,7 +493,12 @@ msgstr "[Edytuj]" msgid "[Move]" msgstr "[Przenieś]" -#: /var/www/html/Tinyboard/inc/config.php:801 +#. Default public ban message. +#. In public ban messages, %length% is replaced with "for x days" or "permanently" (with %LENGTH% being the uppercase equivalent). +#. Default public ban message. In public ban messages, %length% is replaced with "for x days" or +#. "permanently" (with %LENGTH% being the uppercase equivalent). +#: /var/www/html/Tinyboard/inc/config.php:801 ../../../../inc/config.php:911 +#: ../../../../inc/config.php:917 ../../../../inc/config.php:1019 msgid "USER WAS BANNED FOR THIS POST" msgstr "UŻYTKOWNIK ZOSTAŁ ZBANOWANY ZA TEGO POSTA" @@ -386,20 +507,25 @@ msgstr "UŻYTKOWNIK ZOSTAŁ ZBANOWANY ZA TEGO POSTA" msgid "Moved to %s." msgstr "Przeniesiono do %s." -#: /var/www/html/Tinyboard/inc/display.php:80 +#: /var/www/html/Tinyboard/inc/display.php:80 ../../../../inc/display.php:75 +#: ../../../../inc/display.php:79 msgid "Error" msgstr "Błąd" -#: /var/www/html/Tinyboard/inc/display.php:81 +#: /var/www/html/Tinyboard/inc/display.php:81 ../../../../inc/display.php:76 +#: ../../../../inc/display.php:80 msgid "An error has occured." msgstr "Wystąpił błąd." -#: /var/www/html/Tinyboard/inc/display.php:87 +#. line 6 +#: /var/www/html/Tinyboard/inc/display.php:87 ../../../../inc/display.php:82 +#: ../../../../templates/cache/3c/80/0ebbee302f4fad8d0d7f13e62db5.php:41 msgid "Go back" msgstr "Wróć" #: /var/www/html/Tinyboard/inc/display.php:97 ../../../../inc/display.php:91 #: ../../../../inc/mod/pages.php:59 ../../../../inc/mod/pages.php:62 +#: ../../../../inc/display.php:92 ../../../../inc/display.php:96 msgid "Login" msgstr "Logowanie" @@ -417,31 +543,40 @@ msgstr "" #: /var/www/html/Tinyboard/templates/cache/dd/1a/77e08f0c1b4ecf707c5a3e5a70be.php:27 #: ../../../../templates/cache/a8/a6/1022091d3402e085395b12e6279a.php:27 #: ../../../../templates/cache/82/40/4c4a4b82f787181e6500ce83494d.php:27 +#: ../../../../inc/display.php:423 ../../../../inc/display.php:429 +#: ../../../../templates/cache/82/40/4c4a4b82f787181e6500ce83494d.php:33 msgid "Delete" msgstr "Usuń" #: /var/www/html/Tinyboard/inc/display.php:272 -#: /var/www/html/Tinyboard/inc/display.php:365 +#: /var/www/html/Tinyboard/inc/display.php:365 ../../../../inc/display.php:423 +#: ../../../../inc/display.php:429 msgid "Are you sure you want to delete this?" msgstr "Czy jesteś pewien, że chcesz to usunąć?" #: /var/www/html/Tinyboard/inc/display.php:276 -#: /var/www/html/Tinyboard/inc/display.php:369 +#: /var/www/html/Tinyboard/inc/display.php:369 ../../../../inc/display.php:427 +#: ../../../../inc/display.php:433 msgid "Delete all posts by IP" msgstr "Usuń wszystkie posty z tego adresu IP" #: /var/www/html/Tinyboard/inc/display.php:276 -#: /var/www/html/Tinyboard/inc/display.php:369 +#: /var/www/html/Tinyboard/inc/display.php:369 ../../../../inc/display.php:427 +#: ../../../../inc/display.php:433 msgid "Are you sure you want to delete all posts by this IP address?" msgstr "Czy na pewno chcesz usunąć wszystkie posty z tego adresu IP?" #: /var/www/html/Tinyboard/inc/display.php:280 -#: /var/www/html/Tinyboard/inc/display.php:373 +#: /var/www/html/Tinyboard/inc/display.php:373 ../../../../inc/display.php:334 +#: ../../../../inc/display.php:435 ../../../../inc/display.php:339 +#: ../../../../inc/display.php:441 msgid "Ban" msgstr "Ban" #: /var/www/html/Tinyboard/inc/display.php:284 -#: /var/www/html/Tinyboard/inc/display.php:377 +#: /var/www/html/Tinyboard/inc/display.php:377 ../../../../inc/display.php:338 +#: ../../../../inc/display.php:439 ../../../../inc/display.php:343 +#: ../../../../inc/display.php:445 msgid "Ban & Delete" msgstr "Usuń i zbanuj" @@ -453,59 +588,89 @@ msgstr "Usuń plik" #: /var/www/html/Tinyboard/inc/display.php:292 #: /var/www/html/Tinyboard/inc/display.php:408 #: ../../../../inc/mod/pages.php:1080 ../../../../inc/mod/pages.php:1105 -#: ../../../../inc/mod/pages.php:1239 +#: ../../../../inc/mod/pages.php:1239 ../../../../inc/mod/pages.php:1242 +#: ../../../../inc/display.php:346 ../../../../inc/display.php:470 +#: ../../../../inc/mod/pages.php:1314 ../../../../inc/display.php:351 +#: ../../../../inc/display.php:476 ../../../../inc/mod/pages.php:1320 msgid "Edit post" msgstr "Edytuj post" -#: /var/www/html/Tinyboard/inc/display.php:386 +#: /var/www/html/Tinyboard/inc/display.php:386 ../../../../inc/display.php:448 +#: ../../../../inc/display.php:454 msgid "Make thread not sticky" msgstr "Odklej wątek" -#: /var/www/html/Tinyboard/inc/display.php:388 +#: /var/www/html/Tinyboard/inc/display.php:388 ../../../../inc/display.php:450 +#: ../../../../inc/display.php:456 msgid "Make thread sticky" msgstr "Przyklej wątek" -#: /var/www/html/Tinyboard/inc/display.php:392 +#: /var/www/html/Tinyboard/inc/display.php:392 ../../../../inc/display.php:454 +#: ../../../../inc/display.php:460 msgid "Allow thread to be bumped" msgstr "Zezwól wątkowi na bumpowanie" -#: /var/www/html/Tinyboard/inc/display.php:394 +#: /var/www/html/Tinyboard/inc/display.php:394 ../../../../inc/display.php:456 +#: ../../../../inc/display.php:462 msgid "Prevent thread from being bumped" msgstr "Zabroń wątkowi na bumpowanie" -#: /var/www/html/Tinyboard/inc/display.php:399 +#: /var/www/html/Tinyboard/inc/display.php:399 ../../../../inc/display.php:461 +#: ../../../../inc/display.php:467 msgid "Unlock thread" msgstr "Odblokuj wątek" -#: /var/www/html/Tinyboard/inc/display.php:401 +#: /var/www/html/Tinyboard/inc/display.php:401 ../../../../inc/display.php:463 +#: ../../../../inc/display.php:469 msgid "Lock thread" msgstr "Zablokuj wątek" -#: /var/www/html/Tinyboard/inc/display.php:404 +#: /var/www/html/Tinyboard/inc/display.php:404 ../../../../inc/display.php:466 +#: ../../../../inc/display.php:472 msgid "Move thread to another board" msgstr "Przenieś wątek na inny board" #. line 11 +#. line 7 +#. line 11 +#. line 7 +#. line 14 #: /var/www/html/Tinyboard/templates/cache/1d/5e/91ec2bc929b77377b8b877d82db4.php:48 #: /var/www/html/Tinyboard/mod.php:667 /var/www/html/Tinyboard/mod.php:750 #: /var/www/html/Tinyboard/mod.php:833 #: ../../../../templates/cache/d1/2d/eda9403e966240c642b13ca43eb6.php:55 #: ../../../../templates/cache/0c/37/9331df01df7c2986d77a02d3beb0.php:55 +#: ../../../../templates/cache/c8/8b/242bf87b3b6a29a67cdd09a3afeb.php:31 +#: ../../../../templates/cache/c8/8b/242bf87b3b6a29a67cdd09a3afeb.php:36 +#: ../../../../templates/cache/86/31/3f70fa8521e56d617b21133af4d8.php:33 +#: ../../../../templates/cache/39/42/cbc36382096edfa72a8bc26e4514.php:30 +#: ../../../../templates/cache/0c/37/9331df01df7c2986d77a02d3beb0.php:66 msgid "Name" msgstr "Nazwa" #. line 21 +#. line 15 +#. line 24 #: /var/www/html/Tinyboard/templates/cache/1d/5e/91ec2bc929b77377b8b877d82db4.php:62 #: ../../../../templates/cache/d1/2d/eda9403e966240c642b13ca43eb6.php:76 #: ../../../../templates/cache/0c/37/9331df01df7c2986d77a02d3beb0.php:76 +#: ../../../../templates/cache/39/42/cbc36382096edfa72a8bc26e4514.php:44 +#: ../../../../templates/cache/0c/37/9331df01df7c2986d77a02d3beb0.php:88 msgid "Email" msgstr "E-mail" #. line 34 +#. line 23 +#. line 34 +#. line 23 +#. line 37 #: /var/www/html/Tinyboard/templates/cache/1d/5e/91ec2bc929b77377b8b877d82db4.php:96 #: /var/www/html/Tinyboard/mod.php:753 /var/www/html/Tinyboard/mod.php:839 #: ../../../../templates/cache/d1/2d/eda9403e966240c642b13ca43eb6.php:95 #: ../../../../templates/cache/0c/37/9331df01df7c2986d77a02d3beb0.php:116 +#: ../../../../templates/cache/c8/8b/242bf87b3b6a29a67cdd09a3afeb.php:63 +#: ../../../../templates/cache/39/42/cbc36382096edfa72a8bc26e4514.php:58 +#: ../../../../templates/cache/0c/37/9331df01df7c2986d77a02d3beb0.php:130 msgid "Subject" msgstr "Temat" @@ -517,13 +682,21 @@ msgstr "Temat" #: ../../../../templates/cache/0c/37/9331df01df7c2986d77a02d3beb0.php:100 #: ../../../../templates/cache/0c/37/9331df01df7c2986d77a02d3beb0.php:133 #: ../../../../templates/cache/0c/37/9331df01df7c2986d77a02d3beb0.php:172 +#: ../../../../templates/cache/d8/f2/7780eb1adcdbda7e332659e3fb4f.php:115 +#: ../../../../templates/cache/0c/37/9331df01df7c2986d77a02d3beb0.php:113 +#: ../../../../templates/cache/0c/37/9331df01df7c2986d77a02d3beb0.php:148 +#: ../../../../templates/cache/0c/37/9331df01df7c2986d77a02d3beb0.php:189 msgid "Spoiler Image" msgstr "Schowaj obrazek" #. line 45 +#. line 32 +#. line 48 #: /var/www/html/Tinyboard/templates/cache/1d/5e/91ec2bc929b77377b8b877d82db4.php:119 #: ../../../../templates/cache/d1/2d/eda9403e966240c642b13ca43eb6.php:121 #: ../../../../templates/cache/0c/37/9331df01df7c2986d77a02d3beb0.php:145 +#: ../../../../templates/cache/39/42/cbc36382096edfa72a8bc26e4514.php:76 +#: ../../../../templates/cache/0c/37/9331df01df7c2986d77a02d3beb0.php:161 msgid "Comment" msgstr "Komentarz" @@ -579,10 +752,13 @@ msgstr "Komentarz" #. line 73 #. line 61 #. line 73 +#. line 61 +#. line 64 #: /var/www/html/Tinyboard/templates/cache/1d/5e/91ec2bc929b77377b8b877d82db4.php:133 #: ../../../../templates/cache/d1/2d/eda9403e966240c642b13ca43eb6.php:142 #: ../../../../templates/cache/0c/37/9331df01df7c2986d77a02d3beb0.php:191 #: ../../../../templates/cache/0c/37/9331df01df7c2986d77a02d3beb0.php:217 +#: ../../../../templates/cache/0c/37/9331df01df7c2986d77a02d3beb0.php:209 msgid "Verification" msgstr "Weryfikacja" @@ -638,26 +814,45 @@ msgstr "Weryfikacja" #. line 87 #. line 3 #. line 87 +#. line 3 +#. line 72 +#. line 3 +#. line 72 +#. line 3 +#. line 72 +#. line 3 +#. line 75 #: /var/www/html/Tinyboard/templates/cache/1d/5e/91ec2bc929b77377b8b877d82db4.php:149 #: /var/www/html/Tinyboard/templates/cache/dd/1a/77e08f0c1b4ecf707c5a3e5a70be.php:22 #: ../../../../templates/cache/d1/2d/eda9403e966240c642b13ca43eb6.php:165 #: ../../../../templates/cache/a8/a6/1022091d3402e085395b12e6279a.php:22 #: ../../../../templates/cache/82/40/4c4a4b82f787181e6500ce83494d.php:22 #: ../../../../templates/cache/0c/37/9331df01df7c2986d77a02d3beb0.php:250 +#: ../../../../templates/cache/0c/37/9331df01df7c2986d77a02d3beb0.php:214 +#: ../../../../templates/cache/82/40/4c4a4b82f787181e6500ce83494d.php:26 +#: ../../../../templates/cache/0c/37/9331df01df7c2986d77a02d3beb0.php:233 msgid "File" msgstr "Plik" #. line 97 +#. line 82 +#. line 85 #: /var/www/html/Tinyboard/templates/cache/1d/5e/91ec2bc929b77377b8b877d82db4.php:163 #: ../../../../templates/cache/d1/2d/eda9403e966240c642b13ca43eb6.php:183 #: ../../../../templates/cache/0c/37/9331df01df7c2986d77a02d3beb0.php:268 +#: ../../../../templates/cache/0c/37/9331df01df7c2986d77a02d3beb0.php:232 +#: ../../../../templates/cache/0c/37/9331df01df7c2986d77a02d3beb0.php:252 msgid "Embed" msgstr "Osadź" #. line 109 +#. line 94 +#. line 97 #: /var/www/html/Tinyboard/templates/cache/1d/5e/91ec2bc929b77377b8b877d82db4.php:179 #: ../../../../templates/cache/d1/2d/eda9403e966240c642b13ca43eb6.php:206 #: ../../../../templates/cache/0c/37/9331df01df7c2986d77a02d3beb0.php:291 +#: ../../../../templates/cache/0c/37/9331df01df7c2986d77a02d3beb0.php:255 +#: ../../../../templates/cache/0c/37/9331df01df7c2986d77a02d3beb0.php:276 msgid "Flags" msgstr "Flagi" @@ -713,12 +908,24 @@ msgstr "Flagi" #. line 114 #. line 113 #. line 114 +#. line 98 +#. line 99 +#. line 98 +#. line 99 +#. line 98 +#. line 99 +#. line 101 +#. line 102 #: /var/www/html/Tinyboard/templates/cache/1d/5e/91ec2bc929b77377b8b877d82db4.php:188 #: /var/www/html/Tinyboard/templates/cache/1d/5e/91ec2bc929b77377b8b877d82db4.php:191 #: ../../../../templates/cache/d1/2d/eda9403e966240c642b13ca43eb6.php:215 #: ../../../../templates/cache/d1/2d/eda9403e966240c642b13ca43eb6.php:218 #: ../../../../templates/cache/0c/37/9331df01df7c2986d77a02d3beb0.php:300 #: ../../../../templates/cache/0c/37/9331df01df7c2986d77a02d3beb0.php:303 +#: ../../../../templates/cache/0c/37/9331df01df7c2986d77a02d3beb0.php:264 +#: ../../../../templates/cache/0c/37/9331df01df7c2986d77a02d3beb0.php:267 +#: ../../../../templates/cache/0c/37/9331df01df7c2986d77a02d3beb0.php:286 +#: ../../../../templates/cache/0c/37/9331df01df7c2986d77a02d3beb0.php:290 msgid "Sticky" msgstr "Przyklejony" @@ -774,12 +981,24 @@ msgstr "Przyklejony" #. line 118 #. line 117 #. line 118 +#. line 102 +#. line 103 +#. line 102 +#. line 103 +#. line 102 +#. line 103 +#. line 105 +#. line 106 #: /var/www/html/Tinyboard/templates/cache/1d/5e/91ec2bc929b77377b8b877d82db4.php:200 #: /var/www/html/Tinyboard/templates/cache/1d/5e/91ec2bc929b77377b8b877d82db4.php:203 #: ../../../../templates/cache/d1/2d/eda9403e966240c642b13ca43eb6.php:227 #: ../../../../templates/cache/d1/2d/eda9403e966240c642b13ca43eb6.php:230 #: ../../../../templates/cache/0c/37/9331df01df7c2986d77a02d3beb0.php:312 #: ../../../../templates/cache/0c/37/9331df01df7c2986d77a02d3beb0.php:315 +#: ../../../../templates/cache/0c/37/9331df01df7c2986d77a02d3beb0.php:276 +#: ../../../../templates/cache/0c/37/9331df01df7c2986d77a02d3beb0.php:279 +#: ../../../../templates/cache/0c/37/9331df01df7c2986d77a02d3beb0.php:300 +#: ../../../../templates/cache/0c/37/9331df01df7c2986d77a02d3beb0.php:304 msgid "Lock" msgstr "Zablokowany" @@ -835,18 +1054,32 @@ msgstr "Zablokowany" #. line 122 #. line 121 #. line 122 +#. line 106 +#. line 107 +#. line 106 +#. line 107 +#. line 106 +#. line 107 +#. line 109 +#. line 110 #: /var/www/html/Tinyboard/templates/cache/1d/5e/91ec2bc929b77377b8b877d82db4.php:212 #: /var/www/html/Tinyboard/templates/cache/1d/5e/91ec2bc929b77377b8b877d82db4.php:215 #: ../../../../templates/cache/d1/2d/eda9403e966240c642b13ca43eb6.php:239 #: ../../../../templates/cache/d1/2d/eda9403e966240c642b13ca43eb6.php:242 #: ../../../../templates/cache/0c/37/9331df01df7c2986d77a02d3beb0.php:324 #: ../../../../templates/cache/0c/37/9331df01df7c2986d77a02d3beb0.php:327 +#: ../../../../templates/cache/0c/37/9331df01df7c2986d77a02d3beb0.php:288 +#: ../../../../templates/cache/0c/37/9331df01df7c2986d77a02d3beb0.php:291 +#: ../../../../templates/cache/0c/37/9331df01df7c2986d77a02d3beb0.php:314 +#: ../../../../templates/cache/0c/37/9331df01df7c2986d77a02d3beb0.php:318 msgid "Raw HTML" msgstr "Czysty HTML" #. line 129 #. line 14 #. line 129 +#. line 114 +#. line 117 #: /var/www/html/Tinyboard/templates/cache/1d/5e/91ec2bc929b77377b8b877d82db4.php:230 #: /var/www/html/Tinyboard/templates/cache/dd/1a/77e08f0c1b4ecf707c5a3e5a70be.php:23 #: ../../../../templates/cache/d1/2d/eda9403e966240c642b13ca43eb6.php:257 @@ -854,19 +1087,27 @@ msgstr "Czysty HTML" #: ../../../../templates/cache/82/40/4c4a4b82f787181e6500ce83494d.php:23 #: ../../../../templates/cache/0c/37/9331df01df7c2986d77a02d3beb0.php:342 #: ../../../../templates/cache/04/54/656aa217f895c90eae78024fa060.php:41 +#: ../../../../templates/cache/0c/37/9331df01df7c2986d77a02d3beb0.php:306 +#: ../../../../templates/cache/82/40/4c4a4b82f787181e6500ce83494d.php:28 +#: ../../../../templates/cache/0c/37/9331df01df7c2986d77a02d3beb0.php:334 msgid "Password" msgstr "Hasło" #. line 134 +#. line 119 +#. line 122 #: /var/www/html/Tinyboard/templates/cache/1d/5e/91ec2bc929b77377b8b877d82db4.php:236 #: ../../../../templates/cache/d1/2d/eda9403e966240c642b13ca43eb6.php:266 #: ../../../../templates/cache/0c/37/9331df01df7c2986d77a02d3beb0.php:351 +#: ../../../../templates/cache/0c/37/9331df01df7c2986d77a02d3beb0.php:315 +#: ../../../../templates/cache/0c/37/9331df01df7c2986d77a02d3beb0.php:344 msgid "(For file deletion.)" msgstr "(do usuwania postów)" #: /var/www/html/Tinyboard/templates/cache/96/13/d13c7abb8d82989e547dc9be1787.php:107 #: ../../../../templates/cache/cf/0c/61af144f478f5c035cb3a2799e48.php:105 #: ../../../../templates/cache/d8/f2/7780eb1adcdbda7e332659e3fb4f.php:107 +#: ../../../../templates/cache/d8/f2/7780eb1adcdbda7e332659e3fb4f.php:102 msgid "File:" msgstr "Plik:" @@ -887,6 +1128,8 @@ msgstr "Odśwież" #: ../../../../templates/cache/cf/0c/61af144f478f5c035cb3a2799e48.php:415 #: ../../../../templates/cache/d8/f2/7780eb1adcdbda7e332659e3fb4f.php:461 #: ../../../../templates/cache/d8/f2/7780eb1adcdbda7e332659e3fb4f.php:472 +#: ../../../../templates/cache/d8/f2/7780eb1adcdbda7e332659e3fb4f.php:506 +#: ../../../../templates/cache/d8/f2/7780eb1adcdbda7e332659e3fb4f.php:503 msgid "Reply" msgstr "Odpowiedź" @@ -894,6 +1137,8 @@ msgstr "Odpowiedź" #: ../../../../templates/cache/cf/0c/61af144f478f5c035cb3a2799e48.php:442 #: ../../../../templates/cache/d8/f2/7780eb1adcdbda7e332659e3fb4f.php:488 #: ../../../../templates/cache/d8/f2/7780eb1adcdbda7e332659e3fb4f.php:499 +#: ../../../../templates/cache/d8/f2/7780eb1adcdbda7e332659e3fb4f.php:533 +#: ../../../../templates/cache/d8/f2/7780eb1adcdbda7e332659e3fb4f.php:531 msgid "1 post" msgid_plural "%count% posts" msgstr[0] "1 post" @@ -905,6 +1150,9 @@ msgstr[2] "%count% postów" #: ../../../../templates/cache/d8/f2/7780eb1adcdbda7e332659e3fb4f.php:494 #: ../../../../templates/cache/d8/f2/7780eb1adcdbda7e332659e3fb4f.php:505 #: ../../../../templates/cache/e5/22/4711dd22e4c786b4de405db7a449.php:114 +#: ../../../../templates/cache/d8/f2/7780eb1adcdbda7e332659e3fb4f.php:539 +#: ../../../../templates/cache/e5/22/4711dd22e4c786b4de405db7a449.php:117 +#: ../../../../templates/cache/d8/f2/7780eb1adcdbda7e332659e3fb4f.php:537 msgid "and" msgstr "oraz" @@ -912,6 +1160,8 @@ msgstr "oraz" #: ../../../../templates/cache/cf/0c/61af144f478f5c035cb3a2799e48.php:459 #: ../../../../templates/cache/d8/f2/7780eb1adcdbda7e332659e3fb4f.php:505 #: ../../../../templates/cache/d8/f2/7780eb1adcdbda7e332659e3fb4f.php:516 +#: ../../../../templates/cache/d8/f2/7780eb1adcdbda7e332659e3fb4f.php:550 +#: ../../../../templates/cache/d8/f2/7780eb1adcdbda7e332659e3fb4f.php:549 msgid "1 image reply" msgid_plural "%count% image replies" msgstr[0] "1 obrazek" @@ -922,6 +1172,8 @@ msgstr[2] "%count% obrazków" #: ../../../../templates/cache/cf/0c/61af144f478f5c035cb3a2799e48.php:464 #: ../../../../templates/cache/d8/f2/7780eb1adcdbda7e332659e3fb4f.php:510 #: ../../../../templates/cache/d8/f2/7780eb1adcdbda7e332659e3fb4f.php:521 +#: ../../../../templates/cache/d8/f2/7780eb1adcdbda7e332659e3fb4f.php:555 +#: ../../../../templates/cache/d8/f2/7780eb1adcdbda7e332659e3fb4f.php:554 msgid "omitted. Click reply to view." msgstr "pominięte. Kliknij Odpowiedź aby zobaczyć." @@ -935,15 +1187,23 @@ msgstr "pominięte. Kliknij Odpowiedź aby zobaczyć." #: ../../../../templates/cache/62/8c/21348d46377c3e1b3f8c476ba376.php:62 #: ../../../../templates/cache/f5/e3/343716327c6183713f70a3fb57f1.php:131 #: ../../../../templates/cache/aa/f6/f10fd83961bcd8c947af6ddf919d.php:115 +#: ../../../../templates/cache/f5/e3/343716327c6183713f70a3fb57f1.php:132 +#: ../../../../templates/cache/aa/f6/f10fd83961bcd8c947af6ddf919d.php:116 +#: ../../../../templates/cache/f5/e3/343716327c6183713f70a3fb57f1.php:135 +#: ../../../../templates/cache/aa/f6/f10fd83961bcd8c947af6ddf919d.php:119 +#: ../../../../templates/cache/62/8c/21348d46377c3e1b3f8c476ba376.php:65 msgid "Return to dashboard" msgstr "Powróć na tablicę" #. line 27 #. line 31 +#. line 32 #: /var/www/html/Tinyboard/templates/cache/0b/22/d0c24fb343dd5fe77600d77dcc1b.php:165 #: ../../../../templates/cache/82/20/1c3352a2eb8f4503c0f7634bca15.php:177 #: ../../../../templates/cache/aa/f6/f10fd83961bcd8c947af6ddf919d.php:106 #: ../../../../templates/cache/aa/f6/f10fd83961bcd8c947af6ddf919d.php:123 +#: ../../../../templates/cache/aa/f6/f10fd83961bcd8c947af6ddf919d.php:124 +#: ../../../../templates/cache/aa/f6/f10fd83961bcd8c947af6ddf919d.php:128 msgid "Posting mode: Reply" msgstr "Tryb postowania: Odpowiedź" @@ -955,6 +1215,11 @@ msgstr "Tryb postowania: Odpowiedź" #: ../../../../templates/cache/aa/f6/f10fd83961bcd8c947af6ddf919d.php:155 #: ../../../../templates/cache/aa/f6/f10fd83961bcd8c947af6ddf919d.php:126 #: ../../../../templates/cache/aa/f6/f10fd83961bcd8c947af6ddf919d.php:172 +#: ../../../../templates/cache/aa/f6/f10fd83961bcd8c947af6ddf919d.php:127 +#: ../../../../templates/cache/aa/f6/f10fd83961bcd8c947af6ddf919d.php:173 +#: ../../../../templates/cache/aa/f6/f10fd83961bcd8c947af6ddf919d.php:174 +#: ../../../../templates/cache/aa/f6/f10fd83961bcd8c947af6ddf919d.php:132 +#: ../../../../templates/cache/aa/f6/f10fd83961bcd8c947af6ddf919d.php:180 msgid "Return" msgstr "Powrót" @@ -962,6 +1227,7 @@ msgstr "Powrót" #: /var/www/html/Tinyboard/templates/cache/dd/1a/77e08f0c1b4ecf707c5a3e5a70be.php:19 #: ../../../../templates/cache/a8/a6/1022091d3402e085395b12e6279a.php:19 #: ../../../../templates/cache/82/40/4c4a4b82f787181e6500ce83494d.php:19 +#: ../../../../templates/cache/82/40/4c4a4b82f787181e6500ce83494d.php:22 msgid "Delete Post" msgstr "Usuń post" @@ -970,6 +1236,16 @@ msgstr "Usuń post" #. line 8 #. line 32 #. line 48 +#. line 106 +#. line 8 +#. line 32 +#. line 106 +#. line 8 +#. line 32 +#. line 8 +#. line 106 +#. line 8 +#. line 32 #: /var/www/html/Tinyboard/templates/cache/dd/1a/77e08f0c1b4ecf707c5a3e5a70be.php:32 #: /var/www/html/Tinyboard/mod.php:1801 #: ../../../../templates/cache/a8/a6/1022091d3402e085395b12e6279a.php:32 @@ -977,6 +1253,9 @@ msgstr "Usuń post" #: ../../../../templates/cache/24/a0/f1ddafed7a8f9625e747a5ca33f5.php:256 #: ../../../../templates/cache/18/9c/c365d711719f494c684aab98a4ae.php:90 #: ../../../../templates/cache/4c/fb/a3bf13b0badfc09442bd42da1cce.php:128 +#: ../../../../templates/cache/24/a0/f1ddafed7a8f9625e747a5ca33f5.php:274 +#: ../../../../templates/cache/82/40/4c4a4b82f787181e6500ce83494d.php:39 +#: ../../../../templates/cache/18/9c/c365d711719f494c684aab98a4ae.php:96 msgid "Reason" msgstr "Powód" @@ -984,12 +1263,17 @@ msgstr "Powód" #: /var/www/html/Tinyboard/templates/cache/dd/1a/77e08f0c1b4ecf707c5a3e5a70be.php:36 #: ../../../../templates/cache/a8/a6/1022091d3402e085395b12e6279a.php:36 #: ../../../../templates/cache/82/40/4c4a4b82f787181e6500ce83494d.php:36 +#: ../../../../templates/cache/82/40/4c4a4b82f787181e6500ce83494d.php:44 msgid "Report" msgstr "Zgłoszenie" #: /var/www/html/Tinyboard/mod.php:104 /var/www/html/Tinyboard/mod.php:776 #: /var/www/html/Tinyboard/mod.php:862 #: ../../../../templates/cache/3a/df/ab38a77244cb9c729b4c6f99759a.php:120 +#: ../../../../templates/cache/c8/8b/242bf87b3b6a29a67cdd09a3afeb.php:125 +#: ../../../../templates/cache/f3/ad/68dee281a64ebad9a5c774b53279.php:89 +#: ../../../../templates/cache/3a/df/ab38a77244cb9c729b4c6f99759a.php:128 +#: ../../../../templates/cache/f3/ad/68dee281a64ebad9a5c774b53279.php:85 msgid "no subject" msgstr "brak tematu" @@ -1005,6 +1289,8 @@ msgstr "Wiadomości prywatne" #: ../../../../inc/mod/pages.php:376 ../../../../inc/mod/pages.php:393 #: ../../../../inc/mod/pages.php:406 ../../../../inc/mod/pages.php:540 #: ../../../../templates/cache/3a/df/ab38a77244cb9c729b4c6f99759a.php:166 +#: ../../../../inc/mod/pages.php:604 ../../../../inc/mod/pages.php:609 +#: ../../../../templates/cache/3a/df/ab38a77244cb9c729b4c6f99759a.php:176 msgid "News" msgstr "Aktualności" @@ -1012,6 +1298,9 @@ msgstr "Aktualności" #: ../../../../inc/mod/pages.php:1557 ../../../../inc/mod/pages.php:1657 #: ../../../../inc/mod/pages.php:1682 ../../../../inc/mod/pages.php:1816 #: ../../../../templates/cache/3a/df/ab38a77244cb9c729b4c6f99759a.php:207 +#: ../../../../inc/mod/pages.php:1831 ../../../../inc/mod/pages.php:1904 +#: ../../../../inc/mod/pages.php:1910 +#: ../../../../templates/cache/3a/df/ab38a77244cb9c729b4c6f99759a.php:220 msgid "Report queue" msgstr "Kolejka zgłoszeń" @@ -1019,6 +1308,8 @@ msgstr "Kolejka zgłoszeń" #: ../../../../inc/mod/pages.php:664 ../../../../inc/mod/pages.php:705 #: ../../../../inc/mod/pages.php:721 ../../../../inc/mod/pages.php:855 #: ../../../../templates/cache/3a/df/ab38a77244cb9c729b4c6f99759a.php:224 +#: ../../../../inc/mod/pages.php:918 ../../../../inc/mod/pages.php:925 +#: ../../../../templates/cache/3a/df/ab38a77244cb9c729b4c6f99759a.php:238 msgid "Ban list" msgstr "Lista banów" @@ -1026,6 +1317,9 @@ msgstr "Lista banów" #: ../../../../inc/mod/pages.php:1271 ../../../../inc/mod/pages.php:1369 #: ../../../../inc/mod/pages.php:1394 ../../../../inc/mod/pages.php:1528 #: ../../../../templates/cache/3a/df/ab38a77244cb9c729b4c6f99759a.php:232 +#: ../../../../inc/mod/pages.php:1543 ../../../../inc/mod/pages.php:1615 +#: ../../../../inc/mod/pages.php:1621 +#: ../../../../templates/cache/3a/df/ab38a77244cb9c729b4c6f99759a.php:247 msgid "Manage users" msgstr "Zarządzaj użytkownikami" @@ -1040,6 +1334,10 @@ msgstr "Zmień swoje hasło" #: ../../../../inc/mod/pages.php:580 ../../../../inc/mod/pages.php:607 #: ../../../../templates/cache/55/dd/8ffe738533bd12359200e5745905.php:65 #: ../../../../templates/cache/3a/df/ab38a77244cb9c729b4c6f99759a.php:255 +#: ../../../../inc/mod/pages.php:644 ../../../../inc/mod/pages.php:671 +#: ../../../../inc/mod/pages.php:649 ../../../../inc/mod/pages.php:676 +#: ../../../../templates/cache/55/dd/8ffe738533bd12359200e5745905.php:72 +#: ../../../../templates/cache/3a/df/ab38a77244cb9c729b4c6f99759a.php:273 msgid "Moderation log" msgstr "Log moderacji" @@ -1059,14 +1357,19 @@ msgstr "Pokaż konfigurację" #: ../../../../inc/mod/pages.php:1739 ../../../../inc/mod/pages.php:1805 #: ../../../../inc/mod/pages.php:1830 ../../../../inc/mod/pages.php:1964 #: ../../../../templates/cache/3a/df/ab38a77244cb9c729b4c6f99759a.php:247 +#: ../../../../inc/mod/pages.php:1979 ../../../../inc/mod/pages.php:2052 +#: ../../../../inc/mod/pages.php:2109 +#: ../../../../templates/cache/3a/df/ab38a77244cb9c729b4c6f99759a.php:264 msgid "Manage themes" msgstr "Zarządzaj dodatkami" #. line 2 #. line 5 +#. line 2 #: /var/www/html/Tinyboard/mod.php:170 #: ../../../../templates/cache/55/dd/8ffe738533bd12359200e5745905.php:19 #: ../../../../templates/cache/c3/de/6ff26042c5b94cc80055e6f209d2.php:24 +#: ../../../../templates/cache/55/dd/8ffe738533bd12359200e5745905.php:22 msgid "Phrase:" msgstr "Wyrażenie:" @@ -1074,11 +1377,18 @@ msgstr "Wyrażenie:" #. line 2 #. line 106 #. line 2 +#. line 16 +#. line 106 +#. line 16 +#. line 106 #: /var/www/html/Tinyboard/mod.php:172 #: ../../../../templates/cache/55/dd/8ffe738533bd12359200e5745905.php:72 #: ../../../../templates/cache/c3/de/6ff26042c5b94cc80055e6f209d2.php:19 #: ../../../../templates/cache/3a/df/ab38a77244cb9c729b4c6f99759a.php:286 #: ../../../../templates/cache/4c/fb/a3bf13b0badfc09442bd42da1cce.php:19 +#: ../../../../search.php:165 ../../../../search.php:168 +#: ../../../../templates/cache/55/dd/8ffe738533bd12359200e5745905.php:80 +#: ../../../../templates/cache/3a/df/ab38a77244cb9c729b4c6f99759a.php:307 msgid "Search" msgstr "Szukaj" @@ -1097,8 +1407,11 @@ msgid "Could not find current version! (Check .installed)" msgstr "Nie można znaleźć obecnej wersji! (Sprawdź .installed)" #. line 146 +#. line 158 #: /var/www/html/Tinyboard/mod.php:233 #: ../../../../templates/cache/3a/df/ab38a77244cb9c729b4c6f99759a.php:364 +#: ../../../../templates/cache/3a/df/ab38a77244cb9c729b4c6f99759a.php:397 +#: ../../../../templates/cache/3a/df/ab38a77244cb9c729b4c6f99759a.php:425 msgid "Logout" msgstr "Wyloguj" @@ -1128,61 +1441,91 @@ msgstr "temu" #. line 65 #. line 49 #. line 136 +#. line 116 +#. line 182 +#. line 65 +#. line 116 +#. line 182 +#. line 65 +#. line 116 +#. line 182 +#. line 65 #: /var/www/html/Tinyboard/mod.php:405 /var/www/html/Tinyboard/mod.php:1801 #: ../../../../templates/cache/24/a0/f1ddafed7a8f9625e747a5ca33f5.php:278 #: ../../../../templates/cache/24/a0/f1ddafed7a8f9625e747a5ca33f5.php:427 #: ../../../../templates/cache/18/9c/c365d711719f494c684aab98a4ae.php:142 #: ../../../../templates/cache/4c/fb/a3bf13b0badfc09442bd42da1cce.php:131 #: ../../../../templates/cache/4c/fb/a3bf13b0badfc09442bd42da1cce.php:355 +#: ../../../../templates/cache/18/9c/c365d711719f494c684aab98a4ae.php:147 +#: ../../../../templates/cache/24/a0/f1ddafed7a8f9625e747a5ca33f5.php:298 +#: ../../../../templates/cache/24/a0/f1ddafed7a8f9625e747a5ca33f5.php:461 +#: ../../../../templates/cache/18/9c/c365d711719f494c684aab98a4ae.php:157 msgid "Board" msgstr "Board" #. line 183 #. line 137 +#. line 183 #: /var/www/html/Tinyboard/mod.php:406 #: ../../../../templates/cache/24/a0/f1ddafed7a8f9625e747a5ca33f5.php:430 #: ../../../../templates/cache/4c/fb/a3bf13b0badfc09442bd42da1cce.php:358 +#: ../../../../templates/cache/24/a0/f1ddafed7a8f9625e747a5ca33f5.php:465 msgid "Action" msgstr "Akcja" #: /var/www/html/Tinyboard/mod.php:528 ../../../../inc/mod/pages.php:1723 #: ../../../../inc/mod/pages.php:1789 ../../../../inc/mod/pages.php:1814 -#: ../../../../inc/mod/pages.php:1948 +#: ../../../../inc/mod/pages.php:1948 ../../../../inc/mod/pages.php:1963 +#: ../../../../inc/mod/pages.php:2036 ../../../../inc/mod/pages.php:2093 msgid "Themes directory doesn't exist!" msgstr "Katalog dodatków (themes) nie istnieje!" #: /var/www/html/Tinyboard/mod.php:530 ../../../../inc/mod/pages.php:1725 #: ../../../../inc/mod/pages.php:1791 ../../../../inc/mod/pages.php:1816 -#: ../../../../inc/mod/pages.php:1950 +#: ../../../../inc/mod/pages.php:1950 ../../../../inc/mod/pages.php:1965 +#: ../../../../inc/mod/pages.php:2038 ../../../../inc/mod/pages.php:2095 msgid "Cannot open themes directory; check permissions." msgstr "Nie można otworzyć katalogu dodatków (themes); sprawdź uprawnienia." +#. line 11 #: /var/www/html/Tinyboard/mod.php:671 +#: ../../../../templates/cache/86/31/3f70fa8521e56d617b21133af4d8.php:42 msgid "Version" msgstr "Wersja" +#. line 15 #: /var/www/html/Tinyboard/mod.php:675 +#: ../../../../templates/cache/86/31/3f70fa8521e56d617b21133af4d8.php:51 msgid "Description" msgstr "Opis" +#. line 19 #: /var/www/html/Tinyboard/mod.php:679 +#: ../../../../templates/cache/86/31/3f70fa8521e56d617b21133af4d8.php:60 msgid "Thumbnail" msgstr "Miniatura" +#. line 25 #: /var/www/html/Tinyboard/mod.php:687 #: ../../../../templates/cache/24/a0/f1ddafed7a8f9625e747a5ca33f5.php:86 +#: ../../../../templates/cache/86/31/3f70fa8521e56d617b21133af4d8.php:77 +#: ../../../../templates/cache/24/a0/f1ddafed7a8f9625e747a5ca33f5.php:93 msgid "Actions" msgstr "Akcje" +#. line 27 #: /var/www/html/Tinyboard/mod.php:689 +#: ../../../../templates/cache/86/31/3f70fa8521e56d617b21133af4d8.php:81 msgid "Use theme" msgstr "Użyj dodatku" #: /var/www/html/Tinyboard/mod.php:690 +#: ../../../../templates/cache/86/31/3f70fa8521e56d617b21133af4d8.php:87 msgid "Reconfigure" msgstr "Rekonfiguruj" #: /var/www/html/Tinyboard/mod.php:690 +#: ../../../../templates/cache/86/31/3f70fa8521e56d617b21133af4d8.php:88 msgid "Install" msgstr "Instaluj" @@ -1192,10 +1535,16 @@ msgstr "Instaluj" #: ../../../../inc/mod/pages.php:1596 ../../../../inc/mod/pages.php:1726 #: ../../../../inc/mod/pages.php:1730 #: ../../../../templates/cache/3a/df/ab38a77244cb9c729b4c6f99759a.php:263 +#: ../../../../inc/mod/pages.php:1741 ../../../../inc/mod/pages.php:1745 +#: ../../../../templates/cache/86/31/3f70fa8521e56d617b21133af4d8.php:98 +#: ../../../../inc/mod/pages.php:1814 ../../../../inc/mod/pages.php:1818 +#: ../../../../inc/mod/pages.php:1820 ../../../../inc/mod/pages.php:1824 +#: ../../../../templates/cache/3a/df/ab38a77244cb9c729b4c6f99759a.php:282 msgid "Rebuild" msgstr "Przebuduj" #: /var/www/html/Tinyboard/mod.php:694 +#: ../../../../templates/cache/86/31/3f70fa8521e56d617b21133af4d8.php:103 msgid "Uninstall" msgstr "Odinstaluj" @@ -1203,7 +1552,9 @@ msgstr "Odinstaluj" msgid "Uninstall all themes." msgstr "Odinstaluj wszystkie dodatki" +#. line 27 #: /var/www/html/Tinyboard/mod.php:756 /var/www/html/Tinyboard/mod.php:842 +#: ../../../../templates/cache/c8/8b/242bf87b3b6a29a67cdd09a3afeb.php:69 msgid "Body" msgstr "Zawartość" @@ -1216,6 +1567,8 @@ msgstr "Postuj na tablicy ogłoszeń" #: ../../../../inc/mod/pages.php:333 ../../../../inc/mod/pages.php:346 #: ../../../../inc/mod/pages.php:480 #: ../../../../templates/cache/3a/df/ab38a77244cb9c729b4c6f99759a.php:96 +#: ../../../../inc/mod/pages.php:543 ../../../../inc/mod/pages.php:548 +#: ../../../../templates/cache/3a/df/ab38a77244cb9c729b4c6f99759a.php:103 msgid "Noticeboard" msgstr "Tablica ogłoszeń" @@ -1252,6 +1605,7 @@ msgstr "Typ" #. line 2 #: /var/www/html/Tinyboard/mod.php:1221 #: ../../../../templates/cache/3a/df/ab38a77244cb9c729b4c6f99759a.php:19 +#: ../../../../templates/cache/3a/df/ab38a77244cb9c729b4c6f99759a.php:22 msgid "Boards" msgstr "Boardy" @@ -1269,17 +1623,21 @@ msgstr "Nie można się ponownie zalogować po zmianie hasła. (?)" #. line 126 #. line 50 +#. line 126 #: /var/www/html/Tinyboard/mod.php:1801 #: ../../../../templates/cache/24/a0/f1ddafed7a8f9625e747a5ca33f5.php:300 #: ../../../../templates/cache/4c/fb/a3bf13b0badfc09442bd42da1cce.php:134 +#: ../../../../templates/cache/24/a0/f1ddafed7a8f9625e747a5ca33f5.php:322 msgid "Set" msgstr "Ustawione" #. line 130 #. line 52 +#. line 130 #: /var/www/html/Tinyboard/mod.php:1801 #: ../../../../templates/cache/24/a0/f1ddafed7a8f9625e747a5ca33f5.php:309 #: ../../../../templates/cache/4c/fb/a3bf13b0badfc09442bd42da1cce.php:140 +#: ../../../../templates/cache/24/a0/f1ddafed7a8f9625e747a5ca33f5.php:332 msgid "Expires" msgstr "Wygasa" @@ -1290,6 +1648,18 @@ msgstr "Wygasa" #. line 17 #. line 54 #. line 133 +#. line 24 +#. line 62 +#. line 150 +#. line 180 +#. line 24 +#. line 62 +#. line 150 +#. line 180 +#. line 24 +#. line 62 +#. line 150 +#. line 180 #: /var/www/html/Tinyboard/mod.php:1801 #: ../../../../templates/cache/24/a0/f1ddafed7a8f9625e747a5ca33f5.php:74 #: ../../../../templates/cache/24/a0/f1ddafed7a8f9625e747a5ca33f5.php:169 @@ -1298,6 +1668,10 @@ msgstr "Wygasa" #: ../../../../templates/cache/4c/fb/a3bf13b0badfc09442bd42da1cce.php:51 #: ../../../../templates/cache/4c/fb/a3bf13b0badfc09442bd42da1cce.php:146 #: ../../../../templates/cache/4c/fb/a3bf13b0badfc09442bd42da1cce.php:346 +#: ../../../../templates/cache/24/a0/f1ddafed7a8f9625e747a5ca33f5.php:78 +#: ../../../../templates/cache/24/a0/f1ddafed7a8f9625e747a5ca33f5.php:179 +#: ../../../../templates/cache/24/a0/f1ddafed7a8f9625e747a5ca33f5.php:380 +#: ../../../../templates/cache/24/a0/f1ddafed7a8f9625e747a5ca33f5.php:453 msgid "Staff" msgstr "Ekipa" @@ -1308,18 +1682,20 @@ msgstr "Cache jest wyłączone." #: /var/www/html/Tinyboard/mod.php:1966 /var/www/html/Tinyboard/mod.php:2057 #: /var/www/html/Tinyboard/mod.php:2106 /var/www/html/Tinyboard/mod.php:2110 #: ../../../../templates/cache/3a/df/ab38a77244cb9c729b4c6f99759a.php:271 +#: ../../../../templates/cache/3a/df/ab38a77244cb9c729b4c6f99759a.php:291 msgid "Configuration" msgstr "Konfiguracja" #: /var/www/html/Tinyboard/mod.php:2174 ../../../../inc/mod/pages.php:255 #: ../../../../inc/mod/pages.php:272 ../../../../inc/mod/pages.php:285 -#: ../../../../inc/mod/pages.php:419 +#: ../../../../inc/mod/pages.php:419 ../../../../inc/mod/pages.php:481 msgid "Couldn't open board after creation." msgstr "Nie można otworzyć boardu po utworzeniu." #: /var/www/html/Tinyboard/mod.php:2678 ../../../../inc/mod/pages.php:759 #: ../../../../inc/mod/pages.php:800 ../../../../inc/mod/pages.php:823 -#: ../../../../inc/mod/pages.php:957 +#: ../../../../inc/mod/pages.php:957 ../../../../inc/mod/pages.php:1020 +#: ../../../../inc/mod/pages.php:1027 msgid "Target and source board are the same." msgstr "Docelowy i źródłowy board są takie same." @@ -1328,7 +1704,8 @@ msgid "No board to move to; there is only one." msgstr "Nie ma boardu na który można to przenieść; istnieje tylko jeden." #: ../../../../inc/config.php:689 ../../../../inc/config.php:747 -#: ../../../../inc/config.php:753 +#: ../../../../inc/config.php:753 ../../../../inc/config.php:750 +#: ../../../../inc/config.php:756 ../../../../inc/config.php:858 msgid "Invalid security token! Please go back and try again." msgstr "Niepoprawny token bezpieczeństwa! Proszę cofnąć i spróbować ponownie." @@ -1338,20 +1715,31 @@ msgstr "Potwierdź akcję" #: ../../../../inc/mod/pages.php:222 ../../../../inc/mod/pages.php:239 #: ../../../../inc/mod/pages.php:252 ../../../../inc/mod/pages.php:386 +#: ../../../../inc/mod/pages.php:431 msgid "Edit board" msgstr "Edytuj board" #: ../../../../inc/mod/pages.php:270 ../../../../inc/mod/pages.php:287 #: ../../../../inc/mod/pages.php:300 ../../../../inc/mod/pages.php:434 +#: ../../../../inc/mod/pages.php:496 ../../../../inc/mod/pages.php:501 msgid "New board" msgstr "Nowy board" #. line 102 #. line 20 +#. line 102 +#. line 20 +#. line 102 +#. line 20 +#. line 102 +#. line 20 #: ../../../../inc/mod/pages.php:586 ../../../../inc/mod/pages.php:612 #: ../../../../inc/mod/pages.php:628 ../../../../inc/mod/pages.php:762 #: ../../../../templates/cache/24/a0/f1ddafed7a8f9625e747a5ca33f5.php:247 #: ../../../../templates/cache/18/9c/c365d711719f494c684aab98a4ae.php:65 +#: ../../../../inc/mod/pages.php:825 ../../../../inc/mod/pages.php:832 +#: ../../../../templates/cache/24/a0/f1ddafed7a8f9625e747a5ca33f5.php:264 +#: ../../../../templates/cache/18/9c/c365d711719f494c684aab98a4ae.php:68 msgid "IP" msgstr "adres IP" @@ -1361,11 +1749,16 @@ msgstr "adres IP" #: ../../../../inc/mod/pages.php:638 ../../../../inc/mod/pages.php:1053 #: ../../../../inc/mod/pages.php:772 ../../../../inc/mod/pages.php:1187 #: ../../../../templates/cache/24/a0/f1ddafed7a8f9625e747a5ca33f5.php:398 +#: ../../../../inc/mod/pages.php:1190 ../../../../inc/mod/pages.php:835 +#: ../../../../inc/mod/pages.php:1255 ../../../../inc/mod/pages.php:842 +#: ../../../../inc/mod/pages.php:1262 +#: ../../../../templates/cache/24/a0/f1ddafed7a8f9625e747a5ca33f5.php:429 msgid "New ban" msgstr "Nowy ban" #: ../../../../inc/mod/pages.php:919 ../../../../inc/mod/pages.php:962 #: ../../../../inc/mod/pages.php:987 ../../../../inc/mod/pages.php:1121 +#: ../../../../inc/mod/pages.php:1184 ../../../../inc/mod/pages.php:1191 msgid "Impossible to move thread; there is only one board." msgstr "Nie można przenieść wątku; istnieje tylko jeden board." @@ -1373,6 +1766,7 @@ msgstr "Nie można przenieść wątku; istnieje tylko jeden board." #: ../../../../inc/mod/pages.php:923 ../../../../inc/mod/pages.php:966 #: ../../../../inc/mod/pages.php:991 ../../../../inc/mod/pages.php:1125 #: ../../../../templates/cache/dd/1a/7d548894242b9d7bff167de40716.php:106 +#: ../../../../inc/mod/pages.php:1188 ../../../../inc/mod/pages.php:1195 msgid "Move thread" msgstr "Przenieś wątek" @@ -1380,6 +1774,9 @@ msgstr "Przenieś wątek" #: ../../../../inc/mod/pages.php:1307 ../../../../inc/mod/pages.php:1356 #: ../../../../inc/mod/pages.php:1332 ../../../../inc/mod/pages.php:1381 #: ../../../../inc/mod/pages.php:1466 ../../../../inc/mod/pages.php:1515 +#: ../../../../inc/mod/pages.php:1477 ../../../../inc/mod/pages.php:1530 +#: ../../../../inc/mod/pages.php:1549 ../../../../inc/mod/pages.php:1602 +#: ../../../../inc/mod/pages.php:1555 ../../../../inc/mod/pages.php:1608 msgid "Edit user" msgstr "Edytuj użytkownika" @@ -1388,11 +1785,16 @@ msgstr "Edytuj użytkownika" #: ../../../../inc/mod/pages.php:1431 ../../../../inc/mod/pages.php:1503 #: ../../../../inc/mod/pages.php:1456 ../../../../inc/mod/pages.php:1528 #: ../../../../inc/mod/pages.php:1590 ../../../../inc/mod/pages.php:1662 +#: ../../../../inc/mod/pages.php:1605 ../../../../inc/mod/pages.php:1677 +#: ../../../../inc/mod/pages.php:1750 ../../../../inc/mod/pages.php:1683 +#: ../../../../inc/mod/pages.php:1756 msgid "New PM for" msgstr "Nowe PW dla" #: ../../../../inc/mod/pages.php:1337 ../../../../inc/mod/pages.php:1435 #: ../../../../inc/mod/pages.php:1460 ../../../../inc/mod/pages.php:1594 +#: ../../../../inc/mod/pages.php:1609 ../../../../inc/mod/pages.php:1681 +#: ../../../../inc/mod/pages.php:1687 msgid "Private message" msgstr "Prywatna wiadomość" @@ -1400,33 +1802,46 @@ msgstr "Prywatna wiadomość" #: ../../../../inc/mod/pages.php:1358 ../../../../inc/mod/pages.php:1456 #: ../../../../inc/mod/pages.php:1481 ../../../../inc/mod/pages.php:1615 #: ../../../../templates/cache/3a/df/ab38a77244cb9c729b4c6f99759a.php:171 +#: ../../../../inc/mod/pages.php:1630 ../../../../inc/mod/pages.php:1702 +#: ../../../../inc/mod/pages.php:1708 +#: ../../../../templates/cache/3a/df/ab38a77244cb9c729b4c6f99759a.php:182 msgid "PM inbox" msgstr "Odebrane PW" #: ../../../../inc/mod/pages.php:1679 ../../../../inc/mod/pages.php:1779 #: ../../../../inc/mod/pages.php:1804 ../../../../inc/mod/pages.php:1938 +#: ../../../../inc/mod/pages.php:1953 ../../../../inc/mod/pages.php:2026 +#: ../../../../inc/mod/pages.php:1978 ../../../../inc/mod/pages.php:2077 msgid "Config editor" msgstr "Edytor konfiguracji" #: ../../../../inc/mod/pages.php:1713 ../../../../inc/mod/pages.php:1945 #: ../../../../inc/mod/pages.php:1970 ../../../../inc/mod/pages.php:2104 +#: ../../../../inc/mod/pages.php:2119 ../../../../inc/mod/pages.php:2192 +#: ../../../../inc/mod/pages.php:2249 msgid "Debug: Anti-spam" msgstr "Debug: Antyspam" #: ../../../../inc/mod/pages.php:1801 ../../../../inc/mod/pages.php:1867 #: ../../../../inc/mod/pages.php:1892 ../../../../inc/mod/pages.php:2026 +#: ../../../../inc/mod/pages.php:2041 ../../../../inc/mod/pages.php:2114 +#: ../../../../inc/mod/pages.php:2171 #, php-format msgid "Installed theme: %s" msgstr "Zainstalowano dodatek: %s" #: ../../../../inc/mod/pages.php:1811 ../../../../inc/mod/pages.php:1878 #: ../../../../inc/mod/pages.php:1903 ../../../../inc/mod/pages.php:2037 +#: ../../../../inc/mod/pages.php:2052 ../../../../inc/mod/pages.php:2125 +#: ../../../../inc/mod/pages.php:2182 #, php-format msgid "Configuring theme: %s" msgstr "Konfigurowanie dodatku: %s" #: ../../../../inc/mod/pages.php:1839 ../../../../inc/mod/pages.php:1906 #: ../../../../inc/mod/pages.php:1931 ../../../../inc/mod/pages.php:2065 +#: ../../../../inc/mod/pages.php:2080 ../../../../inc/mod/pages.php:2153 +#: ../../../../inc/mod/pages.php:2210 #, php-format msgid "Rebuilt theme: %s" msgstr "Przebudowano dodatek: %s" @@ -1438,20 +1853,28 @@ msgid "" msgstr "" #: ../../../../inc/config.php:704 ../../../../inc/config.php:710 +#: ../../../../inc/config.php:707 ../../../../inc/config.php:713 +#: ../../../../inc/config.php:815 msgid "Thread has reached its maximum reply limit." msgstr "Ten temat osiągnął swój maksymalny limit odpowiedzi." #: ../../../../inc/config.php:705 ../../../../inc/config.php:711 +#: ../../../../inc/config.php:708 ../../../../inc/config.php:714 +#: ../../../../inc/config.php:816 msgid "Thread has reached its maximum image limit." msgstr "Ten temat osiągnął swój maksymalny limit obrazków." #: ../../../../inc/config.php:726 ../../../../inc/config.php:732 +#: ../../../../inc/config.php:729 ../../../../inc/config.php:735 +#: ../../../../inc/config.php:837 #, php-format msgid "That file <a href=\"%s\">already exists</a> in this thread!" msgstr "Ten plik <a href=\"%s\">już istnieje</a> w tym temacie!" #. Moderator errors #: ../../../../inc/config.php:733 ../../../../inc/config.php:739 +#: ../../../../inc/config.php:736 ../../../../inc/config.php:742 +#: ../../../../inc/config.php:844 #, php-format msgid "" "You are only allowed to unban %s users at a time. You tried to unban %u " @@ -1460,17 +1883,20 @@ msgstr "" "Możesz odbanować tylko %s użytkowników na raz. Próbowałeś odbanować %u users." #: ../../../../inc/mod/pages.php:1969 ../../../../inc/mod/pages.php:1994 -#: ../../../../inc/mod/pages.php:2128 +#: ../../../../inc/mod/pages.php:2128 ../../../../inc/mod/pages.php:2143 +#: ../../../../inc/mod/pages.php:2216 ../../../../inc/mod/pages.php:2273 msgid "Debug: Recent posts" msgstr "Debug: Ostatnie posty" #: ../../../../inc/mod/pages.php:1993 ../../../../inc/mod/pages.php:2018 -#: ../../../../inc/mod/pages.php:2152 +#: ../../../../inc/mod/pages.php:2152 ../../../../inc/mod/pages.php:2167 +#: ../../../../inc/mod/pages.php:2240 ../../../../inc/mod/pages.php:2297 msgid "Debug: SQL" msgstr "Debug: SQL" #. line 28 #: ../../../../templates/cache/4b/3e/915cc5ac5fe144c331207c656528.php:104 +#: ../../../../templates/cache/4b/3e/915cc5ac5fe144c331207c656528.php:99 msgid "1 reply" msgid_plural "%count% replies" msgstr[0] "1 odpowiedź" @@ -1478,31 +1904,35 @@ msgstr[1] "%count% odpowiedzi" msgstr[2] "%count% odpowiedzi" #. $results now contains the search results -#: ../../../../inc/mod/pages.php:290 +#: ../../../../inc/mod/pages.php:290 ../../../../inc/mod/pages.php:335 msgid "Search results" msgstr "Wyniki wyszukiwania" #: ../../../../templates/cache/55/dd/8ffe738533bd12359200e5745905.php:31 +#: ../../../../templates/cache/55/dd/8ffe738533bd12359200e5745905.php:35 msgid "Posts" msgstr "Posty" #: ../../../../templates/cache/55/dd/8ffe738533bd12359200e5745905.php:41 +#: ../../../../templates/cache/55/dd/8ffe738533bd12359200e5745905.php:46 msgid "IP address notes" msgstr "Notatki adresu IP" #: ../../../../templates/cache/55/dd/8ffe738533bd12359200e5745905.php:53 +#: ../../../../templates/cache/55/dd/8ffe738533bd12359200e5745905.php:59 msgid "Bans" msgstr "Bany" #. line 18 #: ../../../../templates/cache/55/dd/8ffe738533bd12359200e5745905.php:76 +#: ../../../../templates/cache/55/dd/8ffe738533bd12359200e5745905.php:85 msgid "" "(Search is case-insensitive and based on keywords. To match exact phrases, " "use \"quotes\". Use an asterisk (*) for wildcard.)" msgstr "" -"(Wyszukiwanie jest niezależne od wielkości znaków i bazowane na słowach kluczowych. " -"Aby dopasować pełne frazy, użyj \"cudzysłowi\". Użyj gwiazdki (*) jako symbolu " -"wieloznacznego.)" +"(Wyszukiwanie jest niezależne od wielkości znaków i bazowane na słowach " +"kluczowych. Aby dopasować pełne frazy, użyj \"cudzysłowi\". Użyj gwiazdki " +"(*) jako symbolu wieloznacznego.)" #. line 8 #: ../../../../templates/cache/c3/de/6ff26042c5b94cc80055e6f209d2.php:32 @@ -1520,74 +1950,103 @@ msgid "" "example, <em>name:Anonymous</em> or <em>subject:\"Some Thread\"</em>. " "Wildcards cannot be used in filters." msgstr "" -"Wyszukiwanie jest niezależne od wielkości znaków i bazowane na słowach kluczowych. " -"Aby dopasować pełne frazy, użyj \"cudzysłowi\". Użyj gwiazdki (*) jako symbolu " -"wieloznacznego.</p><p style=\"font-size:8pt;margin:5px\">Możesz zastosować poniższe " -"filtry do swojego wyszukiwania: <strong>id</strong>, <strong>thread</strong>, " -"<strong>subject</strong>, i <strong>name</strong>. Aby wykorzystać filtr, " -"po prostu dodaj do swojego zapytania, na przykład: <em>name:Anonymous</em> " -"albo <em>subject:\"Jakiś temat\"</em>. Symbole wieloznaczne nie mogą być " -"wykorzystane w filtrach." +"Wyszukiwanie jest niezależne od wielkości znaków i bazowane na słowach " +"kluczowych. Aby dopasować pełne frazy, użyj \"cudzysłowi\". Użyj gwiazdki " +"(*) jako symbolu wieloznacznego.</p><p style=\"font-size:8pt;margin:5px" +"\">Możesz zastosować poniższe filtry do swojego wyszukiwania: <strong>id</" +"strong>, <strong>thread</strong>, <strong>subject</strong>, i <strong>name</" +"strong>. Aby wykorzystać filtr, po prostu dodaj do swojego zapytania, na " +"przykład: <em>name:Anonymous</em> albo <em>subject:\"Jakiś temat\"</em>. " +"Symbole wieloznaczne nie mogą być wykorzystane w filtrach." #: ../../../../templates/cache/3a/df/ab38a77244cb9c729b4c6f99759a.php:57 +#: ../../../../templates/cache/3a/df/ab38a77244cb9c729b4c6f99759a.php:61 msgid "edit" msgstr "edytuj" #. line 26 #: ../../../../templates/cache/3a/df/ab38a77244cb9c729b4c6f99759a.php:84 +#: ../../../../templates/cache/3a/df/ab38a77244cb9c729b4c6f99759a.php:90 msgid "Messages" msgstr "Wiadomości" #: ../../../../templates/cache/3a/df/ab38a77244cb9c729b4c6f99759a.php:161 +#: ../../../../templates/cache/3a/df/ab38a77244cb9c729b4c6f99759a.php:170 msgid "View all noticeboard entries" msgstr "Pokaż wszystkie wpisy na tablicy ogłoszeń" #. line 70 #: ../../../../templates/cache/3a/df/ab38a77244cb9c729b4c6f99759a.php:192 +#: ../../../../templates/cache/3a/df/ab38a77244cb9c729b4c6f99759a.php:204 msgid "Administration" msgstr "Administracja" #: ../../../../templates/cache/3a/df/ab38a77244cb9c729b4c6f99759a.php:239 +#: ../../../../templates/cache/3a/df/ab38a77244cb9c729b4c6f99759a.php:255 msgid "Change password" msgstr "Zmień hasło" #. line 118 +#. line 130 #: ../../../../templates/cache/3a/df/ab38a77244cb9c729b4c6f99759a.php:308 +#: ../../../../templates/cache/3a/df/ab38a77244cb9c729b4c6f99759a.php:341 +#: ../../../../templates/cache/3a/df/ab38a77244cb9c729b4c6f99759a.php:364 msgid "Debug" msgstr "Debug" #. line 120 +#. line 132 #: ../../../../templates/cache/3a/df/ab38a77244cb9c729b4c6f99759a.php:312 +#: ../../../../templates/cache/3a/df/ab38a77244cb9c729b4c6f99759a.php:345 +#: ../../../../templates/cache/3a/df/ab38a77244cb9c729b4c6f99759a.php:369 msgid "Anti-spam" msgstr "Antyspam" #. line 121 +#. line 133 #: ../../../../templates/cache/3a/df/ab38a77244cb9c729b4c6f99759a.php:315 +#: ../../../../templates/cache/3a/df/ab38a77244cb9c729b4c6f99759a.php:348 +#: ../../../../templates/cache/3a/df/ab38a77244cb9c729b4c6f99759a.php:373 msgid "Recent posts" msgstr "Ostatnie posty" #: ../../../../templates/cache/3a/df/ab38a77244cb9c729b4c6f99759a.php:321 +#: ../../../../templates/cache/3a/df/ab38a77244cb9c729b4c6f99759a.php:354 +#: ../../../../templates/cache/3a/df/ab38a77244cb9c729b4c6f99759a.php:380 msgid "SQL" msgstr "SQL" #. line 143 +#. line 155 #: ../../../../templates/cache/3a/df/ab38a77244cb9c729b4c6f99759a.php:359 +#: ../../../../templates/cache/3a/df/ab38a77244cb9c729b4c6f99759a.php:392 +#: ../../../../templates/cache/3a/df/ab38a77244cb9c729b4c6f99759a.php:419 msgid "User account" msgstr "Konto użytkownika" #. line 25 #. line 67 #. line 18 +#. line 25 +#. line 67 +#. line 25 +#. line 67 +#. line 25 +#. line 67 #: ../../../../templates/cache/24/a0/f1ddafed7a8f9625e747a5ca33f5.php:77 #: ../../../../templates/cache/24/a0/f1ddafed7a8f9625e747a5ca33f5.php:179 #: ../../../../templates/cache/4c/fb/a3bf13b0badfc09442bd42da1cce.php:54 +#: ../../../../templates/cache/24/a0/f1ddafed7a8f9625e747a5ca33f5.php:82 +#: ../../../../templates/cache/24/a0/f1ddafed7a8f9625e747a5ca33f5.php:190 msgid "Note" msgstr "Notka" #. line 26 #. line 19 +#. line 26 #: ../../../../templates/cache/24/a0/f1ddafed7a8f9625e747a5ca33f5.php:80 #: ../../../../templates/cache/4c/fb/a3bf13b0badfc09442bd42da1cce.php:57 +#: ../../../../templates/cache/24/a0/f1ddafed7a8f9625e747a5ca33f5.php:86 msgid "Date" msgstr "Data" @@ -1597,83 +2056,104 @@ msgstr "Data" #: ../../../../templates/cache/4c/fb/a3bf13b0badfc09442bd42da1cce.php:88 #: ../../../../templates/cache/4c/fb/a3bf13b0badfc09442bd42da1cce.php:321 #: ../../../../templates/cache/4c/fb/a3bf13b0badfc09442bd42da1cce.php:385 +#: ../../../../templates/cache/24/a0/f1ddafed7a8f9625e747a5ca33f5.php:120 +#: ../../../../templates/cache/24/a0/f1ddafed7a8f9625e747a5ca33f5.php:394 +#: ../../../../templates/cache/24/a0/f1ddafed7a8f9625e747a5ca33f5.php:493 msgid "deleted?" msgstr "usunięty?" #. line 49 #: ../../../../templates/cache/24/a0/f1ddafed7a8f9625e747a5ca33f5.php:142 +#: ../../../../templates/cache/24/a0/f1ddafed7a8f9625e747a5ca33f5.php:151 msgid "remove" msgstr "usuń" #. line 75 #: ../../../../templates/cache/24/a0/f1ddafed7a8f9625e747a5ca33f5.php:189 +#: ../../../../templates/cache/24/a0/f1ddafed7a8f9625e747a5ca33f5.php:201 msgid "New note" msgstr "Nowa notka" #. line 92 #: ../../../../templates/cache/24/a0/f1ddafed7a8f9625e747a5ca33f5.php:226 +#: ../../../../templates/cache/24/a0/f1ddafed7a8f9625e747a5ca33f5.php:240 msgid "Status" msgstr "Status" #: ../../../../templates/cache/24/a0/f1ddafed7a8f9625e747a5ca33f5.php:233 +#: ../../../../templates/cache/24/a0/f1ddafed7a8f9625e747a5ca33f5.php:248 msgid "Expired" msgstr "Wygasły" #: ../../../../templates/cache/24/a0/f1ddafed7a8f9625e747a5ca33f5.php:238 +#: ../../../../templates/cache/24/a0/f1ddafed7a8f9625e747a5ca33f5.php:254 msgid "Active" msgstr "Aktywny" #: ../../../../templates/cache/24/a0/f1ddafed7a8f9625e747a5ca33f5.php:269 +#: ../../../../templates/cache/24/a0/f1ddafed7a8f9625e747a5ca33f5.php:288 msgid "no reason" msgstr "brak powodu" #: ../../../../templates/cache/24/a0/f1ddafed7a8f9625e747a5ca33f5.php:322 #: ../../../../templates/cache/4c/fb/a3bf13b0badfc09442bd42da1cce.php:246 +#: ../../../../templates/cache/24/a0/f1ddafed7a8f9625e747a5ca33f5.php:346 msgid "never" msgstr "nigdy" #. line 140 #. line 53 +#. line 140 #: ../../../../templates/cache/24/a0/f1ddafed7a8f9625e747a5ca33f5.php:331 #: ../../../../templates/cache/4c/fb/a3bf13b0badfc09442bd42da1cce.php:143 +#: ../../../../templates/cache/24/a0/f1ddafed7a8f9625e747a5ca33f5.php:356 msgid "Seen" msgstr "Widziano" #: ../../../../templates/cache/24/a0/f1ddafed7a8f9625e747a5ca33f5.php:338 #: ../../../../templates/cache/4c/fb/a3bf13b0badfc09442bd42da1cce.php:273 +#: ../../../../templates/cache/24/a0/f1ddafed7a8f9625e747a5ca33f5.php:364 msgid "Yes" msgstr "Tak" #: ../../../../templates/cache/24/a0/f1ddafed7a8f9625e747a5ca33f5.php:343 #: ../../../../templates/cache/4c/fb/a3bf13b0badfc09442bd42da1cce.php:278 +#: ../../../../templates/cache/24/a0/f1ddafed7a8f9625e747a5ca33f5.php:370 msgid "No" msgstr "Nie" #. line 161 #: ../../../../templates/cache/24/a0/f1ddafed7a8f9625e747a5ca33f5.php:378 +#: ../../../../templates/cache/24/a0/f1ddafed7a8f9625e747a5ca33f5.php:408 msgid "Remove ban" msgstr "Usuń ban" #. line 181 #. line 135 +#. line 181 #: ../../../../templates/cache/24/a0/f1ddafed7a8f9625e747a5ca33f5.php:424 #: ../../../../templates/cache/4c/fb/a3bf13b0badfc09442bd42da1cce.php:352 +#: ../../../../templates/cache/24/a0/f1ddafed7a8f9625e747a5ca33f5.php:457 msgid "Time" msgstr "Czas" #: ../../../../templates/cache/e5/22/4711dd22e4c786b4de405db7a449.php:41 +#: ../../../../templates/cache/e5/22/4711dd22e4c786b4de405db7a449.php:36 msgid "You were banned! ;_;" msgstr "Byłeś zbanowany! ;_;" #: ../../../../templates/cache/e5/22/4711dd22e4c786b4de405db7a449.php:46 +#: ../../../../templates/cache/e5/22/4711dd22e4c786b4de405db7a449.php:42 msgid "You are banned! ;_;" msgstr "Jesteś zbanowany! ;_;" #: ../../../../templates/cache/e5/22/4711dd22e4c786b4de405db7a449.php:56 +#: ../../../../templates/cache/e5/22/4711dd22e4c786b4de405db7a449.php:53 msgid "You were banned from" msgstr "Byłeś zbanowany na" #: ../../../../templates/cache/e5/22/4711dd22e4c786b4de405db7a449.php:61 +#: ../../../../templates/cache/e5/22/4711dd22e4c786b4de405db7a449.php:59 msgid "You have been banned from" msgstr "Zostałeś zbanowany na" @@ -1682,34 +2162,42 @@ msgid "for the following reason:" msgstr "z następującego powodu:" #: ../../../../templates/cache/e5/22/4711dd22e4c786b4de405db7a449.php:88 +#: ../../../../templates/cache/e5/22/4711dd22e4c786b4de405db7a449.php:89 msgid "for an unspecified reason." msgstr "z nieokreślonego powodu." #. line 32 #: ../../../../templates/cache/e5/22/4711dd22e4c786b4de405db7a449.php:109 +#: ../../../../templates/cache/e5/22/4711dd22e4c786b4de405db7a449.php:111 msgid "Your ban was filed on" msgstr "Twój ban został nałożony" #. line 51 #: ../../../../templates/cache/e5/22/4711dd22e4c786b4de405db7a449.php:120 #: ../../../../templates/cache/e5/22/4711dd22e4c786b4de405db7a449.php:150 +#: ../../../../templates/cache/e5/22/4711dd22e4c786b4de405db7a449.php:124 +#: ../../../../templates/cache/e5/22/4711dd22e4c786b4de405db7a449.php:157 msgid "has since expired. Refresh the page to continue." msgstr "już wygasł. Odśwież stronę, aby kontynuować." #: ../../../../templates/cache/e5/22/4711dd22e4c786b4de405db7a449.php:125 +#: ../../../../templates/cache/e5/22/4711dd22e4c786b4de405db7a449.php:130 msgid "expires" msgstr "wygasa" #: ../../../../templates/cache/e5/22/4711dd22e4c786b4de405db7a449.php:128 +#: ../../../../templates/cache/e5/22/4711dd22e4c786b4de405db7a449.php:134 msgid "from now, which is on" msgstr "od teraz, czyli" #: ../../../../templates/cache/e5/22/4711dd22e4c786b4de405db7a449.php:176 +#: ../../../../templates/cache/e5/22/4711dd22e4c786b4de405db7a449.php:184 msgid "will not expire" msgstr "nie wygaśnie" #. line 78 #: ../../../../templates/cache/e5/22/4711dd22e4c786b4de405db7a449.php:184 +#: ../../../../templates/cache/e5/22/4711dd22e4c786b4de405db7a449.php:193 msgid "Your IP address is" msgstr "Twój adres IP to" @@ -1739,30 +2227,39 @@ msgid "Target board" msgstr "Board docelowy" #: ../../../../templates/cache/18/9c/c365d711719f494c684aab98a4ae.php:66 +#: ../../../../templates/cache/18/9c/c365d711719f494c684aab98a4ae.php:70 msgid "(or subnet)" msgstr "(lub podsieć)" #: ../../../../templates/cache/18/9c/c365d711719f494c684aab98a4ae.php:80 +#: ../../../../templates/cache/18/9c/c365d711719f494c684aab98a4ae.php:85 msgid "hidden" msgstr "ukryty" #. line 41 #: ../../../../templates/cache/18/9c/c365d711719f494c684aab98a4ae.php:107 +#: ../../../../templates/cache/18/9c/c365d711719f494c684aab98a4ae.php:114 msgid "Message" msgstr "Wiadomość" #. line 46 #: ../../../../templates/cache/18/9c/c365d711719f494c684aab98a4ae.php:117 +#: ../../../../templates/cache/18/9c/c365d711719f494c684aab98a4ae.php:122 +#: ../../../../templates/cache/18/9c/c365d711719f494c684aab98a4ae.php:130 msgid "public; attached to post" msgstr "publiczny; dołączony do posta" #. line 58 #: ../../../../templates/cache/18/9c/c365d711719f494c684aab98a4ae.php:133 +#: ../../../../templates/cache/18/9c/c365d711719f494c684aab98a4ae.php:138 +#: ../../../../templates/cache/18/9c/c365d711719f494c684aab98a4ae.php:147 msgid "Length" msgstr "Długość" #. line 88 #: ../../../../templates/cache/18/9c/c365d711719f494c684aab98a4ae.php:192 +#: ../../../../templates/cache/18/9c/c365d711719f494c684aab98a4ae.php:197 +#: ../../../../templates/cache/18/9c/c365d711719f494c684aab98a4ae.php:209 msgid "New Ban" msgstr "Nowy ban" @@ -1784,11 +2281,11 @@ msgstr "Wyszukiwanie postów jest wyłączone" msgid "Wait a while before searching again, please." msgstr "Proszę poczekać chwilę przed ponownym szukaniem." -#: ../../../../search.php:128 +#: ../../../../search.php:128 ../../../../search.php:131 msgid "Query too broad." msgstr "Zapytanie zbyt szerokie." -#: ../../../../search.php:149 +#: ../../../../search.php:149 ../../../../search.php:152 #, php-format msgid "%d result in" msgid_plural "%d results in" @@ -1796,6 +2293,200 @@ msgstr[0] "%d wynik na" msgstr[1] "%d wyniki na" msgstr[2] "%d wyników na" -#: ../../../../search.php:160 +#: ../../../../search.php:160 ../../../../search.php:163 msgid "No results." msgstr "Brak wyników." + +#: ../../../../inc/functions.php:594 ../../../../inc/functions.php:603 +#: ../../../../inc/functions.php:623 +msgid "Banned!" +msgstr "Zbanowany!" + +#: ../../../../banned.php:4 +msgid "Banned?" +msgstr "Zbanowany?" + +#: ../../../../banned.php:5 +msgid "You are not banned." +msgstr "Nie jesteś zbanowany." + +#: ../../../../inc/functions.php:549 ../../../../inc/functions.php:566 +#: ../../../../inc/functions.php:558 ../../../../inc/functions.php:575 +#: ../../../../inc/functions.php:578 ../../../../inc/functions.php:595 +msgid "second" +msgid_plural "seconds" +msgstr[0] "sekunda" +msgstr[1] "sekundy" +msgstr[2] "sekund" + +#: ../../../../inc/functions.php:551 ../../../../inc/functions.php:568 +#: ../../../../inc/functions.php:560 ../../../../inc/functions.php:577 +#: ../../../../inc/functions.php:580 ../../../../inc/functions.php:597 +msgid "minute" +msgid_plural "minutes" +msgstr[0] "minuta" +msgstr[1] "minuty" +msgstr[2] "minut" + +#: ../../../../inc/functions.php:553 ../../../../inc/functions.php:570 +#: ../../../../inc/functions.php:562 ../../../../inc/functions.php:579 +#: ../../../../inc/functions.php:582 ../../../../inc/functions.php:599 +msgid "hour" +msgid_plural "hours" +msgstr[0] "godzina" +msgstr[1] "godziny" +msgstr[2] "godzin" + +#: ../../../../inc/functions.php:555 ../../../../inc/functions.php:572 +#: ../../../../inc/functions.php:564 ../../../../inc/functions.php:581 +#: ../../../../inc/functions.php:584 ../../../../inc/functions.php:601 +msgid "day" +msgid_plural "days" +msgstr[0] "dzień" +msgstr[1] "dni" +msgstr[2] "dni" + +#: ../../../../inc/functions.php:557 ../../../../inc/functions.php:574 +#: ../../../../inc/functions.php:566 ../../../../inc/functions.php:583 +#: ../../../../inc/functions.php:586 ../../../../inc/functions.php:603 +msgid "week" +msgid_plural "weeks" +msgstr[0] "tydzień" +msgstr[1] "tygodnie" +msgstr[2] "tygodni" + +#: ../../../../inc/functions.php:560 ../../../../inc/functions.php:577 +#: ../../../../inc/functions.php:569 ../../../../inc/functions.php:586 +#: ../../../../inc/functions.php:589 ../../../../inc/functions.php:606 +msgid "year" +msgid_plural "years" +msgstr[0] "rok" +msgstr[1] "lata" +msgstr[2] "lat" + +#. line 118 +#: ../../../../templates/cache/3a/df/ab38a77244cb9c729b4c6f99759a.php:308 +#: ../../../../templates/cache/3a/df/ab38a77244cb9c729b4c6f99759a.php:330 +msgid "Other" +msgstr "Inne" + +#: ../../../../templates/cache/b7/7d/de31d12a1684acbc7c0d7ee71653.php:30 +msgid "Successfully installed and built theme." +msgstr "Pomyślnie zainstalowano i zbudowano dodatek." + +#. line 9 +#: ../../../../templates/cache/b7/7d/de31d12a1684acbc7c0d7ee71653.php:37 +msgid "Go back to themes" +msgstr "Wróć do dodatków" + +#. line 3 +#: ../../../../templates/cache/c8/8b/242bf87b3b6a29a67cdd09a3afeb.php:21 +msgid "New post" +msgstr "Nowy post" + +#. line 32 +#: ../../../../templates/cache/c8/8b/242bf87b3b6a29a67cdd09a3afeb.php:76 +msgid "Post news entry" +msgstr "Zapostuj newsa" + +#: ../../../../templates/cache/c8/8b/242bf87b3b6a29a67cdd09a3afeb.php:100 +msgid "delete" +msgstr "usuń" + +#. line 55 +#: ../../../../templates/cache/c8/8b/242bf87b3b6a29a67cdd09a3afeb.php:133 +#: ../../../../templates/cache/f3/ad/68dee281a64ebad9a5c774b53279.php:94 +#: ../../../../templates/cache/f3/ad/68dee281a64ebad9a5c774b53279.php:91 +msgid "by" +msgstr "przez" + +#: ../../../../templates/cache/c8/8b/242bf87b3b6a29a67cdd09a3afeb.php:136 +#: ../../../../templates/cache/f3/ad/68dee281a64ebad9a5c774b53279.php:97 +#: ../../../../templates/cache/f3/ad/68dee281a64ebad9a5c774b53279.php:95 +msgid "at" +msgstr "dnia" + +#: ../../../../templates/cache/f3/ad/68dee281a64ebad9a5c774b53279.php:66 +#: ../../../../templates/cache/f3/ad/68dee281a64ebad9a5c774b53279.php:61 +msgid "(No news to show.)" +msgstr "(Nie ma newsów do wyświetlenia.)" + +#: ../../../../templates/cache/86/31/3f70fa8521e56d617b21133af4d8.php:19 +msgid "There are no themes available." +msgstr "Nie ma dostępnych dodatków." + +#. line 25 +#: ../../../../templates/cache/d1/99/467985632043e204070d354b8290.php:91 +msgid "Install theme" +msgstr "Zainstaluj dodatek" + +#: ../../../../inc/display.php:211 ../../../../inc/display.php:215 +#, php-format +msgid "Post too long. Click <a href=\"%s\">here</a> to view the full text." +msgstr "" +"Post za długi. Kliknij <a href=\"%s\">tutaj</a>, aby zobaczyć jego pełną " +"treść." + +#: ../../../../inc/display.php:342 ../../../../inc/display.php:443 +#: ../../../../inc/display.php:347 ../../../../inc/display.php:449 +msgid "Delete file" +msgstr "Usuń plik" + +#: ../../../../inc/display.php:342 ../../../../inc/display.php:443 +#: ../../../../inc/display.php:347 ../../../../inc/display.php:449 +msgid "Are you sure you want to delete this file?" +msgstr "Czy jesteś pewien, że chcesz usunąć ten plik?" + +#: ../../../../inc/display.php:431 ../../../../inc/display.php:437 +msgid "Delete all posts by IP across all boards" +msgstr "Usuń wszystkie posty z tego IP ze wszystkich boardów" + +#: ../../../../inc/display.php:431 ../../../../inc/display.php:437 +msgid "" +"Are you sure you want to delete all posts by this IP address, across all " +"boards?" +msgstr "" +"Czy jesteś pewien, że chcesz usunąć wszystkie posty z tego adresu IP, ze " +"wszystkich boardów?" + +#. Page footer +#. Additional lines added to the footer of all pages. +#: ../../../../inc/config.php:564 ../../../../inc/config.php:653 +msgid "" +"All trademarks, copyrights, comments, and images on this page are owned by " +"and are the responsibility of their respective parties." +msgstr "" +"Wszystkie znaki towarowe, prawa autorskie, komentarze oraz obrazki na tej " +"stronie są własnością i odpowiedzialność za nie spoczywa na ich odpowiednich " +"właścicielach." + +#: ../../../../inc/mod/pages.php:267 +msgid "There are no boards to search!" +msgstr "Nie ma boardów do przeszukania!" + +#. Print error +#: ../../../../inc/database.php:72 +msgid "Database error: " +msgstr "Błąd bazy danych: " + +#. line 13 +#: ../../../../templates/cache/3c/80/0ebbee302f4fad8d0d7f13e62db5.php:56 +msgid "Error information" +msgstr "Informacje o błędzie" + +#. line 27 +#: ../../../../templates/cache/39/42/cbc36382096edfa72a8bc26e4514.php:68 +msgid "Update" +msgstr "Aktualizacja" + +#: ../../../../templates/cache/39/42/cbc36382096edfa72a8bc26e4514.php:97 +msgid "Currently editing raw HTML." +msgstr "Obecnie edytujesz czysty HTML" + +#: ../../../../templates/cache/39/42/cbc36382096edfa72a8bc26e4514.php:105 +msgid "Edit markup instead?" +msgstr "Edytować zamiast tego znaczniki?" + +#: ../../../../templates/cache/39/42/cbc36382096edfa72a8bc26e4514.php:115 +msgid "Edit raw HTML instead?" +msgstr "Edytować zamiast tego czysty HTML?" diff --git a/inc/mod/auth.php b/inc/mod/auth.php index 173190ab..bfab0f7e 100644 --- a/inc/mod/auth.php +++ b/inc/mod/auth.php @@ -29,6 +29,11 @@ function mkhash($username, $password, $salt = false) { return $hash; } +function generate_salt() { + mt_srand(microtime(true) * 100000 + memory_get_usage(true)); + return md5(uniqid(mt_rand(), true)); +} + function login($username, $password, $makehash=true) { global $mod; @@ -37,20 +42,23 @@ function login($username, $password, $makehash=true) { $password = sha1($password); } - $query = prepare("SELECT `id`,`type`,`boards` FROM `mods` WHERE `username` = :username AND `password` = :password LIMIT 1"); + $query = prepare("SELECT `id`, `type`, `boards`, `password`, `salt` FROM ``mods`` WHERE `username` = :username"); $query->bindValue(':username', $username); - $query->bindValue(':password', $password); $query->execute() or error(db_error($query)); - if ($user = $query->fetch()) { - return $mod = array( - 'id' => $user['id'], - 'type' => $user['type'], - 'username' => $username, - 'hash' => mkhash($username, $password), - 'boards' => explode(',', $user['boards']) - ); - } else return false; + if ($user = $query->fetch(PDO::FETCH_ASSOC)) { + if ($user['password'] === hash('sha256', $user['salt'] . $password)) { + return $mod = array( + 'id' => $user['id'], + 'type' => $user['type'], + 'username' => $username, + 'hash' => mkhash($username, $user['password']), + 'boards' => explode(',', $user['boards']) + ); + } + } + + return false; } function setCookies() { @@ -75,7 +83,7 @@ function destroyCookies() { function modLog($action, $_board=null) { global $mod, $board, $config; - $query = prepare("INSERT INTO `modlogs` VALUES (:id, :ip, :board, :time, :text)"); + $query = prepare("INSERT INTO ``modlogs`` VALUES (:id, :ip, :board, :time, :text)"); $query->bindValue(':id', $mod['id'], PDO::PARAM_INT); $query->bindValue(':ip', $_SERVER['REMOTE_ADDR']); $query->bindValue(':time', time(), PDO::PARAM_INT); @@ -104,10 +112,10 @@ if (isset($_COOKIE[$config['cookies']['mod']])) { exit; } - $query = prepare("SELECT `id`, `type`, `boards`, `password` FROM `mods` WHERE `username` = :username LIMIT 1"); + $query = prepare("SELECT `id`, `type`, `boards`, `password` FROM ``mods`` WHERE `username` = :username"); $query->bindValue(':username', $cookie[0]); $query->execute() or error(db_error($query)); - $user = $query->fetch(); + $user = $query->fetch(PDO::FETCH_ASSOC); // validate password hash if ($cookie[1] !== mkhash($cookie[0], $user['password'], $cookie[2])) { @@ -135,11 +143,11 @@ function create_pm_header() { return $header; } - $query = prepare("SELECT `id` FROM `pms` WHERE `to` = :id AND `unread` = 1"); + $query = prepare("SELECT `id` FROM ``pms`` WHERE `to` = :id AND `unread` = 1"); $query->bindValue(':id', $mod['id'], PDO::PARAM_INT); $query->execute() or error(db_error($query)); - if ($pm = $query->fetch()) + if ($pm = $query->fetch(PDO::FETCH_ASSOC)) $header = array('id' => $pm['id'], 'waiting' => $query->rowCount() - 1); else $header = true; diff --git a/inc/mod/ban.php b/inc/mod/ban.php index cfc2636f..71173326 100644 --- a/inc/mod/ban.php +++ b/inc/mod/ban.php @@ -56,11 +56,12 @@ function parse_time($str) { function ban($mask, $reason, $length, $board) { global $mod, $pdo; - $query = prepare("INSERT INTO `bans` VALUES (NULL, :ip, :mod, :time, :expires, :reason, :board, 0)"); + $query = prepare("INSERT INTO ``bans`` VALUES (NULL, :ip, :mod, :time, :expires, :reason, :board, 0)"); $query->bindValue(':ip', $mask); $query->bindValue(':mod', $mod['id']); $query->bindValue(':time', time()); if ($reason !== '') { + $reason = escape_markup_modifiers($reason); markup($reason); $query->bindValue(':reason', $reason); } else @@ -89,12 +90,12 @@ function ban($mask, $reason, $length, $board) { } function unban($id) { - $query = prepare("SELECT `ip` FROM `bans` WHERE `id` = :id"); + $query = prepare("SELECT `ip` FROM ``bans`` WHERE `id` = :id"); $query->bindValue(':id', $id); $query->execute() or error(db_error($query)); $mask = $query->fetchColumn(); - $query = prepare("DELETE FROM `bans` WHERE `id` = :id"); + $query = prepare("DELETE FROM ``bans`` WHERE `id` = :id"); $query->bindValue(':id', $id); $query->execute() or error(db_error($query)); diff --git a/inc/mod/config-editor.php b/inc/mod/config-editor.php index 484bd908..27740378 100644 --- a/inc/mod/config-editor.php +++ b/inc/mod/config-editor.php @@ -1,5 +1,43 @@ <?php +function permission_to_edit_config_var($varname) { + global $config, $mod; + + if (is_array($config['mod']['config'][DISABLED])) { + foreach ($config['mod']['config'][DISABLED] as $disabled_var_name) { + $disabled_var_name = explode('>', $disabled_var_name); + if (count($disabled_var_name) == 1) + $disabled_var_name = $disabled_var_name[0]; + if ($varname == $disabled_var_name) + return false; + } + } + + $allow_only = false; + // for ($perm = (int)$mod['type']; $perm >= JANITOR; $perm --) { + for ($perm = JANITOR; $perm <= (int)$mod['type']; $perm ++) { + $allow_only = false; + if (is_array($config['mod']['config'][$perm])) { + foreach ($config['mod']['config'][$perm] as $perm_var_name) { + if ($perm_var_name == '!') { + $allow_only = true; + continue; + } + $perm_var_name = explode('>', $perm_var_name); + if ((count($perm_var_name) == 1 && $varname == $perm_var_name[0]) || + (is_array($varname) && array_slice($varname, 0, count($perm_var_name)) == $perm_var_name)) { + if ($allow_only) + return true; + else + return false; + } + } + } + } + + return !$allow_only; +} + function config_vars() { global $config; @@ -13,13 +51,14 @@ function config_vars() { 'default_temp' => false ); $temp_comment = false; + $line_no = 0; foreach ($config_file as $line) { if ($temp_comment) { $var['comment'][] = $temp_comment; $temp_comment = false; } - if (preg_match('!^\s*// (.*)$!', $line, $matches)) { + if (preg_match('!^\s*// ([^$].*)$!', $line, $matches)) { if ($var['default'] !== false) { $line = ''; $temp_comment = $matches[1]; @@ -28,7 +67,10 @@ function config_vars() { } } else if ($var['default_temp'] !== false) { $var['default_temp'] .= "\n" . $line; - } elseif (preg_match('!^\s*\$config\[(.+?)\] = (.+?)(;( //.+)?)?$!', $line, $matches)) { + } elseif (preg_match('!^[\s/]*\$config\[(.+?)\] = (.+?)(;( //.+)?)?$!', $line, $matches)) { + if (preg_match('!^\s*//\s*!', $line)) { + $var['commented'] = true; + } $var['name'] = explode('][', $matches[1]); if (count($var['name']) == 1) { $var['name'] = preg_replace('/^\'(.*)\'$/', '$1', end($var['name'])); @@ -43,21 +85,38 @@ function config_vars() { $var['default_temp'] = $matches[2]; } - if (trim($line) === '') { - if ($var['name'] !== false) { - if ($var['default_temp']) - $var['default'] = $var['default_temp']; - - $temp = eval('return ' . $var['default'] . ';'); - if (!isset($temp)) + if ($var['name'] !== false) { + if ($var['default_temp']) + $var['default'] = $var['default_temp']; + if ($var['default'][0] == '&') + continue; // This is just an alias. + if (!preg_match('/^array|\[\]|function/', $var['default']) && !preg_match('/^Example: /', trim(implode(' ', $var['comment'])))) { + $syntax_error = true; + $temp = eval('$syntax_error = false;return ' . $var['default'] . ';'); + if ($syntax_error && $temp === false) { + error('Error parsing config.php (line ' . $line_no . ')!', null, $var); + } elseif (!isset($temp)) { $var['type'] = 'unknown'; - else + } else { $var['type'] = gettype($temp); + } - unset($var['default_temp']); + if ($var['type'] == 'integer' && $var['name'][0] == 'mod' && + (in_array($var['default'], array('JANITOR', 'MOD', 'ADMIN', 'DISABLED')) || mb_strpos($var['default'], "\$config['mod']") === 0)) { + // Permissions variable + $var['permissions'] = true; + } + unset($var['default_temp']); if (!is_array($var['name']) || (end($var['name']) != '' && !in_array(reset($var['name']), array('stylesheets')))) { - $conf[] = $var; + $already_exists = false; + foreach ($conf as $_var) { + if ($var['name'] == $_var['name']) + $already_exists = true; + + } + if (!$already_exists && permission_to_edit_config_var($var['name'])) + $conf[] = $var; } } @@ -65,9 +124,17 @@ function config_vars() { 'name' => false, 'comment' => array(), 'default' => false, - 'default_temp' => false + 'default_temp' => false, + 'commented' => false, + 'permissions' => false, ); } + + if (trim($line) === '') { + $var['comment'] = array(); + } + + $line_no++; } return $conf; diff --git a/inc/mod/pages.php b/inc/mod/pages.php index d5ec6018..b3f09a66 100644 --- a/inc/mod/pages.php +++ b/inc/mod/pages.php @@ -82,7 +82,7 @@ function mod_dashboard() { if (hasPermission($config['mod']['noticeboard'])) { if (!$config['cache']['enabled'] || !$args['noticeboard'] = cache::get('noticeboard_preview')) { - $query = prepare("SELECT `noticeboard`.*, `username` FROM `noticeboard` LEFT JOIN `mods` ON `mods`.`id` = `mod` ORDER BY `id` DESC LIMIT :limit"); + $query = prepare("SELECT ``noticeboard``.*, `username` FROM ``noticeboard`` LEFT JOIN ``mods`` ON ``mods``.`id` = `mod` ORDER BY `id` DESC LIMIT :limit"); $query->bindValue(':limit', $config['mod']['noticeboard_dashboard'], PDO::PARAM_INT); $query->execute() or error(db_error($query)); $args['noticeboard'] = $query->fetchAll(PDO::FETCH_ASSOC); @@ -93,17 +93,17 @@ function mod_dashboard() { } if (!$config['cache']['enabled'] || ($args['unread_pms'] = cache::get('pm_unreadcount_' . $mod['id'])) == false) { - $query = prepare('SELECT COUNT(*) FROM `pms` WHERE `to` = :id AND `unread` = 1'); + $query = prepare('SELECT COUNT(*) FROM ``pms`` WHERE `to` = :id AND `unread` = 1'); $query->bindValue(':id', $mod['id']); $query->execute() or error(db_error($query)); - $args['unread_pms'] = $query->fetchColumn(0); + $args['unread_pms'] = $query->fetchColumn(); if ($config['cache']['enabled']) cache::set('pm_unreadcount_' . $mod['id'], $args['unread_pms']); } - $query = query('SELECT COUNT(*) FROM `reports`') or error(db_error($query)); - $args['reports'] = $query->fetchColumn(0); + $query = query('SELECT COUNT(*) FROM ``reports``') or error(db_error($query)); + $args['reports'] = $query->fetchColumn(); if ($mod['type'] >= ADMIN && $config['check_updates']) { if (!$config['version']) @@ -174,6 +174,11 @@ function mod_search_redirect() { $query = str_replace('_', '%5F', $query); $query = str_replace('+', '_', $query); + if ($query === '') { + header('Location: ?/', true, $config['redirect_http']); + return; + } + header('Location: ?/search/' . $_POST['type'] . '/' . $query, true, $config['redirect_http']); } else { header('Location: ?/', true, $config['redirect_http']); @@ -203,6 +208,8 @@ function mod_search($type, $search_query_escaped, $page_no = 1) { // Use asterisk as wildcard instead $query = str_replace('*', '%', $query); + $query = str_replace('`', '!`', $query); + // Array of phrases to match $match = array(); @@ -225,7 +232,7 @@ function mod_search($type, $search_query_escaped, $page_no = 1) { // Which `field` to search? if ($type == 'posts') - $sql_field = 'body'; + $sql_field = array('body_nomarkup', 'filename', 'subject', 'filehash', 'ip', 'name', 'trip'); if ($type == 'IP_notes') $sql_field = 'body'; if ($type == 'bans') @@ -239,32 +246,59 @@ function mod_search($type, $search_query_escaped, $page_no = 1) { if (!empty($sql_like)) $sql_like .= ' AND '; $phrase = preg_replace('/^\'(.+)\'$/', '\'%$1%\'', $phrase); - $sql_like .= '`' . $sql_field . '` LIKE ' . $phrase . ' ESCAPE \'!\''; + if (is_array($sql_field)) { + foreach ($sql_field as $field) { + $sql_like .= '`' . $field . '` LIKE ' . $phrase . ' ESCAPE \'!\' OR'; + } + $sql_like = preg_replace('/ OR$/', '', $sql_like); + } else { + $sql_like .= '`' . $sql_field . '` LIKE ' . $phrase . ' ESCAPE \'!\''; + } } // Compile SQL query if ($type == 'posts') { - error('Searching posts is under development. Sorry.'); + $query = ''; + + $boards = listBoards(); + if (empty($boards)) + error(_('There are no boards to search!')); + + foreach ($boards as $board) { + openBoard($board['uri']); + if (!hasPermission($config['mod']['search_posts'], $board['uri'])) + continue; + + if (!empty($query)) + $query .= ' UNION ALL '; + $query .= sprintf("SELECT *, '%s' AS `board` FROM ``posts_%s`` WHERE %s", $board['uri'], $board['uri'], $sql_like); + } + + // You weren't allowed to search any boards + if (empty($query)) + error($config['error']['noaccess']); + + $query .= ' ORDER BY `sticky` DESC, `id` DESC'; } if ($type == 'IP_notes') { - $query = 'SELECT * FROM `ip_notes` LEFT JOIN `mods` ON `mod` = `mods`.`id` WHERE ' . $sql_like . ' ORDER BY `time` DESC'; + $query = 'SELECT * FROM ``ip_notes`` LEFT JOIN ``mods`` ON `mod` = ``mods``.`id` WHERE ' . $sql_like . ' ORDER BY `time` DESC'; $sql_table = 'ip_notes'; if (!hasPermission($config['mod']['view_notes']) || !hasPermission($config['mod']['show_ip'])) error($config['error']['noaccess']); } if ($type == 'bans') { - $query = 'SELECT `bans`.*, `username` FROM `bans` LEFT JOIN `mods` ON `mod` = `mods`.`id` WHERE ' . $sql_like . ' ORDER BY (`expires` IS NOT NULL AND `expires` < UNIX_TIMESTAMP()), `set` DESC'; + $query = 'SELECT ``bans``.*, `username` FROM ``bans`` LEFT JOIN ``mods`` ON `mod` = ``mods``.`id` WHERE ' . $sql_like . ' ORDER BY (`expires` IS NOT NULL AND `expires` < UNIX_TIMESTAMP()), `set` DESC'; $sql_table = 'bans'; if (!hasPermission($config['mod']['view_banlist'])) error($config['error']['noaccess']); } if ($type == 'log') { - $query = 'SELECT `username`, `mod`, `ip`, `board`, `time`, `text` FROM `modlogs` LEFT JOIN `mods` ON `mod` = `mods`.`id` WHERE ' . $sql_like . ' ORDER BY `time` DESC'; + $query = 'SELECT `username`, `mod`, `ip`, `board`, `time`, `text` FROM ``modlogs`` LEFT JOIN ``mods`` ON `mod` = ``mods``.`id` WHERE ' . $sql_like . ' ORDER BY `time` DESC'; $sql_table = 'modlogs'; if (!hasPermission($config['mod']['modlog'])) error($config['error']['noaccess']); @@ -273,10 +307,15 @@ function mod_search($type, $search_query_escaped, $page_no = 1) { // Execute SQL query (with pages) $q = query($query . ' LIMIT ' . (($page_no - 1) * $config['mod']['search_page']) . ', ' . $config['mod']['search_page']) or error(db_error()); $results = $q->fetchAll(PDO::FETCH_ASSOC); - + // Get total result count - $q = query('SELECT COUNT(*) FROM `' . $sql_table . '` WHERE ' . $sql_like) or error(db_error()); - $result_count = $q->fetchColumn(); + if ($type == 'posts') { + $q = query("SELECT COUNT(*) FROM ($query) AS `tmp_table`") or error(db_error()); + $result_count = $q->fetchColumn(); + } else { + $q = query('SELECT COUNT(*) FROM `' . $sql_table . '` WHERE ' . $sql_like) or error(db_error()); + $result_count = $q->fetchColumn(); + } if ($type == 'bans') { foreach ($results as &$ban) { @@ -285,6 +324,12 @@ function mod_search($type, $search_query_escaped, $page_no = 1) { } } + if ($type == 'posts') { + foreach ($results as &$post) { + $post['snippet'] = pm_snippet($post['body']); + } + } + // $results now contains the search results mod_page(_('Search results'), 'mod/search_results.html', array( @@ -310,7 +355,7 @@ function mod_edit_board($boardName) { if (!hasPermission($config['mod']['manageboards'], $board['uri'])) error($config['error']['deleteboard']); - $query = prepare('DELETE FROM `boards` WHERE `uri` = :uri'); + $query = prepare('DELETE FROM ``boards`` WHERE `uri` = :uri'); $query->bindValue(':uri', $board['uri']); $query->execute() or error(db_error($query)); @@ -320,19 +365,19 @@ function mod_edit_board($boardName) { rrmdir($board['uri'] . '/'); // Delete posting table - $query = query(sprintf('DROP TABLE IF EXISTS `posts_%s`', $board['uri'])) or error(db_error()); + $query = query(sprintf('DROP TABLE IF EXISTS ``posts_%s``', $board['uri'])) or error(db_error()); // Clear reports - $query = prepare('DELETE FROM `reports` WHERE `board` = :id'); + $query = prepare('DELETE FROM ``reports`` WHERE `board` = :id'); $query->bindValue(':id', $board['uri'], PDO::PARAM_INT); $query->execute() or error(db_error($query)); // Delete from table - $query = prepare('DELETE FROM `boards` WHERE `uri` = :uri'); + $query = prepare('DELETE FROM ``boards`` WHERE `uri` = :uri'); $query->bindValue(':uri', $board['uri'], PDO::PARAM_INT); $query->execute() or error(db_error($query)); - $query = prepare("SELECT `board`, `post` FROM `cites` WHERE `target_board` = :board"); + $query = prepare("SELECT `board`, `post` FROM ``cites`` WHERE `target_board` = :board"); $query->bindValue(':board', $board['uri']); $query->execute() or error(db_error($query)); while ($cite = $query->fetch(PDO::FETCH_ASSOC)) { @@ -344,28 +389,28 @@ function mod_edit_board($boardName) { } } - $query = prepare('DELETE FROM `cites` WHERE `board` = :board OR `target_board` = :board'); + $query = prepare('DELETE FROM ``cites`` WHERE `board` = :board OR `target_board` = :board'); $query->bindValue(':board', $board['uri']); $query->execute() or error(db_error($query)); - $query = prepare('DELETE FROM `antispam` WHERE `board` = :board'); + $query = prepare('DELETE FROM ``antispam`` WHERE `board` = :board'); $query->bindValue(':board', $board['uri']); $query->execute() or error(db_error($query)); // Remove board from users/permissions table - $query = query('SELECT `id`,`boards` FROM `mods`') or error(db_error()); + $query = query('SELECT `id`,`boards` FROM ``mods``') or error(db_error()); while ($user = $query->fetch(PDO::FETCH_ASSOC)) { $user_boards = explode(',', $user['boards']); if (in_array($board['uri'], $user_boards)) { unset($user_boards[array_search($board['uri'], $user_boards)]); - $_query = prepare('UPDATE `mods` SET `boards` = :boards WHERE `id` = :id'); + $_query = prepare('UPDATE ``mods`` SET `boards` = :boards WHERE `id` = :id'); $_query->bindValue(':boards', implode(',', $user_boards)); $_query->bindValue(':id', $user['id']); $_query->execute() or error(db_error($_query)); } } } else { - $query = prepare('UPDATE `boards` SET `title` = :title, `subtitle` = :subtitle WHERE `uri` = :uri'); + $query = prepare('UPDATE ``boards`` SET `title` = :title, `subtitle` = :subtitle WHERE `uri` = :uri'); $query->bindValue(':uri', $board['uri']); $query->bindValue(':title', $_POST['title']); $query->bindValue(':subtitle', $_POST['subtitle']); @@ -400,14 +445,31 @@ function mod_new_board() { if ($_POST['title'] == '') error(sprintf($config['error']['required'], 'title')); - #if (!preg_match('/^\w+$/', $_POST['uri'])) - # error(sprintf($config['error']['invalidfield'], 'URI')); + if (!preg_match('/^' . $config['board_regex'] . '$/u', $_POST['uri'])) + error(sprintf($config['error']['invalidfield'], 'URI')); + + $bytes = 0; + $chars = preg_split('//u', $_POST['uri'], -1, PREG_SPLIT_NO_EMPTY); + foreach ($chars as $char) { + $o = 0; + $ord = ordutf8($char, $o); + if ($ord > 0x0080) + $bytes += 5; // @01ff + else + $bytes ++; + } + $bytes + strlen('posts_.frm'); + + if ($bytes > 255) { + error('Your filesystem cannot handle a board URI of that length (' . $bytes . '/255 bytes)'); + exit; + } if (openBoard($_POST['uri'])) { error(sprintf($config['error']['boardexists'], $board['url'])); } - $query = prepare('INSERT INTO `boards` VALUES (:uri, :title, :subtitle)'); + $query = prepare('INSERT INTO ``boards`` VALUES (:uri, :title, :subtitle)'); $query->bindValue(':uri', $_POST['uri']); $query->bindValue(':title', $_POST['title']); $query->bindValue(':subtitle', $_POST['subtitle']); @@ -418,7 +480,12 @@ function mod_new_board() { if (!openBoard($_POST['uri'])) error(_("Couldn't open board after creation.")); - query(Element('posts.sql', array('board' => $board['uri']))) or error(db_error()); + $query = Element('posts.sql', array('board' => $board['uri'])); + + if (mysql_version() < 50503) + $query = preg_replace('/(CHARSET=|CHARACTER SET )utf8mb4/', '$1utf8', $query); + + query($query) or error(db_error()); if ($config['cache']['enabled']) cache::delete('all_boards'); @@ -447,9 +514,10 @@ function mod_noticeboard($page_no = 1) { if (!hasPermission($config['mod']['noticeboard_post'])) error($config['error']['noaccess']); + $_POST['body'] = escape_markup_modifiers($_POST['body']); markup($_POST['body']); - $query = prepare('INSERT INTO `noticeboard` VALUES (NULL, :mod, :time, :subject, :body)'); + $query = prepare('INSERT INTO ``noticeboard`` VALUES (NULL, :mod, :time, :subject, :body)'); $query->bindValue(':mod', $mod['id']); $query->bindvalue(':time', time()); $query->bindValue(':subject', $_POST['subject']); @@ -464,7 +532,7 @@ function mod_noticeboard($page_no = 1) { header('Location: ?/noticeboard#' . $pdo->lastInsertId(), true, $config['redirect_http']); } - $query = prepare("SELECT `noticeboard`.*, `username` FROM `noticeboard` LEFT JOIN `mods` ON `mods`.`id` = `mod` ORDER BY `id` DESC LIMIT :offset, :limit"); + $query = prepare("SELECT ``noticeboard``.*, `username` FROM ``noticeboard`` LEFT JOIN ``mods`` ON ``mods``.`id` = `mod` ORDER BY `id` DESC LIMIT :offset, :limit"); $query->bindValue(':limit', $config['mod']['noticeboard_page'], PDO::PARAM_INT); $query->bindValue(':offset', ($page_no - 1) * $config['mod']['noticeboard_page'], PDO::PARAM_INT); $query->execute() or error(db_error($query)); @@ -473,9 +541,9 @@ function mod_noticeboard($page_no = 1) { if (empty($noticeboard) && $page_no > 1) error($config['error']['404']); - $query = prepare("SELECT COUNT(*) FROM `noticeboard`"); + $query = prepare("SELECT COUNT(*) FROM ``noticeboard``"); $query->execute() or error(db_error($query)); - $count = $query->fetchColumn(0); + $count = $query->fetchColumn(); mod_page(_('Noticeboard'), 'mod/noticeboard.html', array('noticeboard' => $noticeboard, 'count' => $count)); } @@ -486,7 +554,7 @@ function mod_noticeboard_delete($id) { if (!hasPermission($config['mod']['noticeboard_delete'])) error($config['error']['noaccess']); - $query = prepare('DELETE FROM `noticeboard` WHERE `id` = :id'); + $query = prepare('DELETE FROM ``noticeboard`` WHERE `id` = :id'); $query->bindValue(':id', $id); $query->execute() or error(db_error($query)); @@ -508,9 +576,10 @@ function mod_news($page_no = 1) { if (!hasPermission($config['mod']['news'])) error($config['error']['noaccess']); + $_POST['body'] = escape_markup_modifiers($_POST['body']); markup($_POST['body']); - $query = prepare('INSERT INTO `news` VALUES (NULL, :name, :time, :subject, :body)'); + $query = prepare('INSERT INTO ``news`` VALUES (NULL, :name, :time, :subject, :body)'); $query->bindValue(':name', isset($_POST['name']) && hasPermission($config['mod']['news_custom']) ? $_POST['name'] : $mod['username']); $query->bindvalue(':time', time()); $query->bindValue(':subject', $_POST['subject']); @@ -524,7 +593,7 @@ function mod_news($page_no = 1) { header('Location: ?/news#' . $pdo->lastInsertId(), true, $config['redirect_http']); } - $query = prepare("SELECT * FROM `news` ORDER BY `id` DESC LIMIT :offset, :limit"); + $query = prepare("SELECT * FROM ``news`` ORDER BY `id` DESC LIMIT :offset, :limit"); $query->bindValue(':limit', $config['mod']['news_page'], PDO::PARAM_INT); $query->bindValue(':offset', ($page_no - 1) * $config['mod']['news_page'], PDO::PARAM_INT); $query->execute() or error(db_error($query)); @@ -533,9 +602,9 @@ function mod_news($page_no = 1) { if (empty($news) && $page_no > 1) error($config['error']['404']); - $query = prepare("SELECT COUNT(*) FROM `news`"); + $query = prepare("SELECT COUNT(*) FROM ``news``"); $query->execute() or error(db_error($query)); - $count = $query->fetchColumn(0); + $count = $query->fetchColumn(); mod_page(_('News'), 'mod/news.html', array('news' => $news, 'count' => $count)); } @@ -546,7 +615,7 @@ function mod_news_delete($id) { if (!hasPermission($config['mod']['news_delete'])) error($config['error']['noaccess']); - $query = prepare('DELETE FROM `news` WHERE `id` = :id'); + $query = prepare('DELETE FROM ``news`` WHERE `id` = :id'); $query->bindValue(':id', $id); $query->execute() or error(db_error($query)); @@ -564,7 +633,7 @@ function mod_log($page_no = 1) { if (!hasPermission($config['mod']['modlog'])) error($config['error']['noaccess']); - $query = prepare("SELECT `username`, `mod`, `ip`, `board`, `time`, `text` FROM `modlogs` LEFT JOIN `mods` ON `mod` = `mods`.`id` ORDER BY `time` DESC LIMIT :offset, :limit"); + $query = prepare("SELECT `username`, `mod`, `ip`, `board`, `time`, `text` FROM ``modlogs`` LEFT JOIN ``mods`` ON `mod` = ``mods``.`id` ORDER BY `time` DESC LIMIT :offset, :limit"); $query->bindValue(':limit', $config['mod']['modlog_page'], PDO::PARAM_INT); $query->bindValue(':offset', ($page_no - 1) * $config['mod']['modlog_page'], PDO::PARAM_INT); $query->execute() or error(db_error($query)); @@ -573,9 +642,9 @@ function mod_log($page_no = 1) { if (empty($logs) && $page_no > 1) error($config['error']['404']); - $query = prepare("SELECT COUNT(*) FROM `modlogs`"); + $query = prepare("SELECT COUNT(*) FROM ``modlogs``"); $query->execute() or error(db_error($query)); - $count = $query->fetchColumn(0); + $count = $query->fetchColumn(); mod_page(_('Moderation log'), 'mod/log.html', array('logs' => $logs, 'count' => $count)); } @@ -589,7 +658,7 @@ function mod_user_log($username, $page_no = 1) { if (!hasPermission($config['mod']['modlog'])) error($config['error']['noaccess']); - $query = prepare("SELECT `username`, `mod`, `ip`, `board`, `time`, `text` FROM `modlogs` LEFT JOIN `mods` ON `mod` = `mods`.`id` WHERE `username` = :username ORDER BY `time` DESC LIMIT :offset, :limit"); + $query = prepare("SELECT `username`, `mod`, `ip`, `board`, `time`, `text` FROM ``modlogs`` LEFT JOIN ``mods`` ON `mod` = ``mods``.`id` WHERE `username` = :username ORDER BY `time` DESC LIMIT :offset, :limit"); $query->bindValue(':username', $username); $query->bindValue(':limit', $config['mod']['modlog_page'], PDO::PARAM_INT); $query->bindValue(':offset', ($page_no - 1) * $config['mod']['modlog_page'], PDO::PARAM_INT); @@ -599,10 +668,10 @@ function mod_user_log($username, $page_no = 1) { if (empty($logs) && $page_no > 1) error($config['error']['404']); - $query = prepare("SELECT COUNT(*) FROM `modlogs` LEFT JOIN `mods` ON `mod` = `mods`.`id` WHERE `username` = :username"); + $query = prepare("SELECT COUNT(*) FROM ``modlogs`` LEFT JOIN ``mods`` ON `mod` = ``mods``.`id` WHERE `username` = :username"); $query->bindValue(':username', $username); $query->execute() or error(db_error($query)); - $count = $query->fetchColumn(0); + $count = $query->fetchColumn(); mod_page(_('Moderation log'), 'mod/log.html', array('logs' => $logs, 'count' => $count, 'username' => $username)); } @@ -645,7 +714,7 @@ function mod_ip_remove_note($ip, $id) { if (filter_var($ip, FILTER_VALIDATE_IP) === false) error("Invalid IP address."); - $query = prepare('DELETE FROM `ip_notes` WHERE `ip` = :ip AND `id` = :id'); + $query = prepare('DELETE FROM ``ip_notes`` WHERE `ip` = :ip AND `id` = :id'); $query->bindValue(':ip', $ip); $query->bindValue(':id', $id); $query->execute() or error(db_error($query)); @@ -677,8 +746,9 @@ function mod_page_ip($ip) { if (!hasPermission($config['mod']['create_notes'])) error($config['error']['noaccess']); + $_POST['note'] = escape_markup_modifiers($_POST['note']); markup($_POST['note']); - $query = prepare('INSERT INTO `ip_notes` VALUES (NULL, :ip, :mod, :time, :body)'); + $query = prepare('INSERT INTO ``ip_notes`` VALUES (NULL, :ip, :mod, :time, :body)'); $query->bindValue(':ip', $ip); $query->bindValue(':mod', $mod['id']); $query->bindValue(':time', time()); @@ -701,8 +771,9 @@ function mod_page_ip($ip) { $boards = listBoards(); foreach ($boards as $board) { openBoard($board['uri']); - - $query = prepare(sprintf('SELECT * FROM `posts_%s` WHERE `ip` = :ip ORDER BY `sticky` DESC, `id` DESC LIMIT :limit', $board['uri'])); + if (!hasPermission($config['mod']['show_ip'], $board['uri'])) + continue; + $query = prepare(sprintf('SELECT * FROM ``posts_%s`` WHERE `ip` = :ip ORDER BY `sticky` DESC, `id` DESC LIMIT :limit', $board['uri'])); $query->bindValue(':ip', $ip); $query->bindValue(':limit', $config['mod']['ip_recentposts'], PDO::PARAM_INT); $query->execute() or error(db_error($query)); @@ -734,21 +805,21 @@ function mod_page_ip($ip) { $args['token'] = make_secure_link_token('ban'); if (hasPermission($config['mod']['view_ban'])) { - $query = prepare("SELECT `bans`.*, `username` FROM `bans` LEFT JOIN `mods` ON `mod` = `mods`.`id` WHERE `ip` = :ip"); + $query = prepare("SELECT ``bans``.*, `username` FROM ``bans`` LEFT JOIN ``mods`` ON `mod` = ``mods``.`id` WHERE `ip` = :ip ORDER BY `set` DESC"); $query->bindValue(':ip', $ip); $query->execute() or error(db_error($query)); $args['bans'] = $query->fetchAll(PDO::FETCH_ASSOC); } if (hasPermission($config['mod']['view_notes'])) { - $query = prepare("SELECT `ip_notes`.*, `username` FROM `ip_notes` LEFT JOIN `mods` ON `mod` = `mods`.`id` WHERE `ip` = :ip"); + $query = prepare("SELECT ``ip_notes``.*, `username` FROM ``ip_notes`` LEFT JOIN ``mods`` ON `mod` = ``mods``.`id` WHERE `ip` = :ip ORDER BY `time` DESC"); $query->bindValue(':ip', $ip); $query->execute() or error(db_error($query)); $args['notes'] = $query->fetchAll(PDO::FETCH_ASSOC); } if (hasPermission($config['mod']['modlog_ip'])) { - $query = prepare("SELECT `username`, `mod`, `ip`, `board`, `time`, `text` FROM `modlogs` LEFT JOIN `mods` ON `mod` = `mods`.`id` WHERE `text` LIKE :search ORDER BY `time` DESC LIMIT 20"); + $query = prepare("SELECT `username`, `mod`, `ip`, `board`, `time`, `text` FROM ``modlogs`` LEFT JOIN ``mods`` ON `mod` = ``mods``.`id` WHERE `text` LIKE :search ORDER BY `time` DESC LIMIT 50"); $query->bindValue(':search', '%' . $ip . '%'); $query->execute() or error(db_error($query)); $args['logs'] = $query->fetchAll(PDO::FETCH_ASSOC); @@ -801,7 +872,7 @@ function mod_bans($page_no = 1) { if (isset($config['mod']['unban_limit'])){ if (count($unban) <= $config['mod']['unban_limit'] || $config['mod']['unban_limit'] == -1){ if (!empty($unban)) { - query('DELETE FROM `bans` WHERE `id` = ' . implode(' OR `id` = ', $unban)) or error(db_error()); + query('DELETE FROM ``bans`` WHERE `id` = ' . implode(' OR `id` = ', $unban)) or error(db_error()); foreach ($unban as $id) { modLog("Removed ban #{$id}"); @@ -814,7 +885,7 @@ function mod_bans($page_no = 1) { } else { if (!empty($unban)) { - query('DELETE FROM `bans` WHERE `id` = ' . implode(' OR `id` = ', $unban)) or error(db_error()); + query('DELETE FROM ``bans`` WHERE `id` = ' . implode(' OR `id` = ', $unban)) or error(db_error()); foreach ($unban as $id) { modLog("Removed ban #{$id}"); @@ -826,10 +897,10 @@ function mod_bans($page_no = 1) { } if ($config['mod']['view_banexpired']) { - $query = prepare("SELECT `bans`.*, `username` FROM `bans` LEFT JOIN `mods` ON `mod` = `mods`.`id` ORDER BY (`expires` IS NOT NULL AND `expires` < :time), `set` DESC LIMIT :offset, :limit"); + $query = prepare("SELECT ``bans``.*, `username` FROM ``bans`` LEFT JOIN ``mods`` ON `mod` = ``mods``.`id` ORDER BY (`expires` IS NOT NULL AND `expires` < :time), `set` DESC LIMIT :offset, :limit"); } else { // Filter out expired bans - $query = prepare("SELECT `bans`.*, `username` FROM `bans` INNER JOIN `mods` ON `mod` = `mods`.`id` WHERE `expires` = 0 OR `expires` > :time ORDER BY `set` DESC LIMIT :offset, :limit"); + $query = prepare("SELECT ``bans``.*, `username` FROM ``bans`` INNER JOIN ``mods`` ON `mod` = ``mods``.`id` WHERE `expires` = 0 OR `expires` > :time ORDER BY `set` DESC LIMIT :offset, :limit"); } $query->bindValue(':time', time(), PDO::PARAM_INT); $query->bindValue(':limit', $config['mod']['banlist_page'], PDO::PARAM_INT); @@ -840,9 +911,9 @@ function mod_bans($page_no = 1) { if (empty($bans) && $page_no > 1) error($config['error']['404']); - $query = prepare("SELECT COUNT(*) FROM `bans`"); + $query = prepare("SELECT COUNT(*) FROM ``bans``"); $query->execute() or error(db_error($query)); - $count = $query->fetchColumn(0); + $count = $query->fetchColumn(); foreach ($bans as &$ban) { if (filter_var($ban['ip'], FILTER_VALIDATE_IP) !== false) @@ -862,7 +933,7 @@ function mod_lock($board, $unlock, $post) { if (!hasPermission($config['mod']['lock'], $board)) error($config['error']['noaccess']); - $query = prepare(sprintf('UPDATE `posts_%s` SET `locked` = :locked WHERE `id` = :id AND `thread` IS NULL', $board)); + $query = prepare(sprintf('UPDATE ``posts_%s`` SET `locked` = :locked WHERE `id` = :id AND `thread` IS NULL', $board)); $query->bindValue(':id', $post); $query->bindValue(':locked', $unlock ? 0 : 1); $query->execute() or error(db_error($query)); @@ -873,7 +944,7 @@ function mod_lock($board, $unlock, $post) { } if ($config['mod']['dismiss_reports_on_lock']) { - $query = prepare('DELETE FROM `reports` WHERE `board` = :board AND `post` = :id'); + $query = prepare('DELETE FROM ``reports`` WHERE `board` = :board AND `post` = :id'); $query->bindValue(':board', $board); $query->bindValue(':id', $post); $query->execute() or error(db_error($query)); @@ -896,7 +967,7 @@ function mod_sticky($board, $unsticky, $post) { if (!hasPermission($config['mod']['sticky'], $board)) error($config['error']['noaccess']); - $query = prepare(sprintf('UPDATE `posts_%s` SET `sticky` = :sticky WHERE `id` = :id AND `thread` IS NULL', $board)); + $query = prepare(sprintf('UPDATE ``posts_%s`` SET `sticky` = :sticky WHERE `id` = :id AND `thread` IS NULL', $board)); $query->bindValue(':id', $post); $query->bindValue(':sticky', $unsticky ? 0 : 1); $query->execute() or error(db_error($query)); @@ -918,7 +989,7 @@ function mod_bumplock($board, $unbumplock, $post) { if (!hasPermission($config['mod']['bumplock'], $board)) error($config['error']['noaccess']); - $query = prepare(sprintf('UPDATE `posts_%s` SET `sage` = :bumplock WHERE `id` = :id AND `thread` IS NULL', $board)); + $query = prepare(sprintf('UPDATE ``posts_%s`` SET `sage` = :bumplock WHERE `id` = :id AND `thread` IS NULL', $board)); $query->bindValue(':id', $post); $query->bindValue(':bumplock', $unbumplock ? 0 : 1); $query->execute() or error(db_error($query)); @@ -940,7 +1011,7 @@ function mod_move($originBoard, $postID) { if (!hasPermission($config['mod']['move'], $originBoard)) error($config['error']['noaccess']); - $query = prepare(sprintf('SELECT * FROM `posts_%s` WHERE `id` = :id AND `thread` IS NULL', $originBoard)); + $query = prepare(sprintf('SELECT * FROM ``posts_%s`` WHERE `id` = :id AND `thread` IS NULL', $originBoard)); $query->bindValue(':id', $postID); $query->execute() or error(db_error($query)); if (!$post = $query->fetch(PDO::FETCH_ASSOC)) @@ -988,13 +1059,13 @@ function mod_move($originBoard, $postID) { // go back to the original board to fetch replies openBoard($originBoard); - $query = prepare(sprintf('SELECT * FROM `posts_%s` WHERE `thread` = :id ORDER BY `id`', $originBoard)); + $query = prepare(sprintf('SELECT * FROM ``posts_%s`` WHERE `thread` = :id ORDER BY `id`', $originBoard)); $query->bindValue(':id', $postID, PDO::PARAM_INT); $query->execute() or error(db_error($query)); $replies = array(); - while ($post = $query->fetch()) { + while ($post = $query->fetch(PDO::FETCH_ASSOC)) { $post['mod'] = true; $post['thread'] = $newID; @@ -1017,7 +1088,7 @@ function mod_move($originBoard, $postID) { openBoard($targetBoard); foreach ($replies as &$post) { - $query = prepare('SELECT `target` FROM `cites` WHERE `target_board` = :board AND `board` = :board AND `post` = :post'); + $query = prepare('SELECT `target` FROM ``cites`` WHERE `target_board` = :board AND `board` = :board AND `post` = :post'); $query->bindValue(':board', $originBoard); $query->bindValue(':post', $post['id'], PDO::PARAM_INT); $query->execute() or error(db_error($qurey)); @@ -1049,7 +1120,7 @@ function mod_move($originBoard, $postID) { } foreach ($post['tracked_cites'] as $cite) { - $query = prepare('INSERT INTO `cites` VALUES (:board, :post, :target_board, :target)'); + $query = prepare('INSERT INTO ``cites`` VALUES (:board, :post, :target_board, :target)'); $query->bindValue(':board', $board['uri']); $query->bindValue(':post', $newPostID, PDO::PARAM_INT); $query->bindValue(':target_board',$cite[0]); @@ -1074,7 +1145,7 @@ function mod_move($originBoard, $postID) { if ($shadow) { // lock old thread - $query = prepare(sprintf('UPDATE `posts_%s` SET `locked` = 1 WHERE `id` = :id', $originBoard)); + $query = prepare(sprintf('UPDATE ``posts_%s`` SET `locked` = 1 WHERE `id` = :id', $originBoard)); $query->bindValue(':id', $postID, PDO::PARAM_INT); $query->execute() or error(db_error($query)); @@ -1133,7 +1204,7 @@ function mod_ban_post($board, $delete, $post, $token = false) { $security_token = make_secure_link_token($board . '/ban/' . $post); - $query = prepare(sprintf('SELECT `ip`, `thread` FROM `posts_%s` WHERE `id` = :id', $board)); + $query = prepare(sprintf('SELECT `ip`, `thread` FROM ``posts_%s`` WHERE `id` = :id', $board)); $query->bindValue(':id', $post); $query->execute() or error(db_error($query)); if (!$_post = $query->fetch(PDO::FETCH_ASSOC)) @@ -1152,10 +1223,15 @@ function mod_ban_post($board, $delete, $post, $token = false) { if (isset($_POST['public_message'], $_POST['message'])) { // public ban message - $query = prepare(sprintf('UPDATE `posts_%s` SET `body` = CONCAT(`body`, :body) WHERE `id` = :id', $board)); + $length_english = parse_time($_POST['length']) ? 'for ' . until(parse_time($_POST['length'])) : 'permanently'; + $_POST['message'] = preg_replace('/[\r\n]/', '', $_POST['message']); + $_POST['message'] = str_replace('%length%', $length_english, $_POST['message']); + $_POST['message'] = str_replace('%LENGTH%', strtoupper($length_english), $_POST['message']); + $query = prepare(sprintf('UPDATE ``posts_%s`` SET `body_nomarkup` = CONCAT(`body_nomarkup`, :body_nomarkup) WHERE `id` = :id', $board)); $query->bindValue(':id', $post); - $query->bindValue(':body', sprintf($config['mod']['ban_message'], utf8tohtml($_POST['message']))); + $query->bindValue(':body_nomarkup', sprintf("\n<tinyboard ban message>%s</tinyboard>", utf8tohtml($_POST['message']))); $query->execute() or error(db_error($query)); + rebuildPost($post); modLog("Attached a public ban message to post #{$post}: " . utf8tohtml($_POST['message'])); buildThread($thread ? $thread : $post); @@ -1198,7 +1274,7 @@ function mod_edit_post($board, $edit_raw_html, $postID) { $security_token = make_secure_link_token($board . '/edit' . ($edit_raw_html ? '_raw' : '') . '/' . $postID); - $query = prepare(sprintf('SELECT * FROM `posts_%s` WHERE `id` = :id', $board)); + $query = prepare(sprintf('SELECT * FROM ``posts_%s`` WHERE `id` = :id', $board)); $query->bindValue(':id', $postID); $query->execute() or error(db_error($query)); @@ -1207,14 +1283,18 @@ function mod_edit_post($board, $edit_raw_html, $postID) { if (isset($_POST['name'], $_POST['email'], $_POST['subject'], $_POST['body'])) { if ($edit_raw_html) - $query = prepare(sprintf('UPDATE `posts_%s` SET `name` = :name, `email` = :email, `subject` = :subject, `body` = :body WHERE `id` = :id', $board)); + $query = prepare(sprintf('UPDATE ``posts_%s`` SET `name` = :name, `email` = :email, `subject` = :subject, `body` = :body, `body_nomarkup` = :body_nomarkup WHERE `id` = :id', $board)); else - $query = prepare(sprintf('UPDATE `posts_%s` SET `name` = :name, `email` = :email, `subject` = :subject, `body_nomarkup` = :body WHERE `id` = :id', $board)); + $query = prepare(sprintf('UPDATE ``posts_%s`` SET `name` = :name, `email` = :email, `subject` = :subject, `body_nomarkup` = :body WHERE `id` = :id', $board)); $query->bindValue(':id', $postID); $query->bindValue('name', $_POST['name']); $query->bindValue(':email', $_POST['email']); $query->bindValue(':subject', $_POST['subject']); $query->bindValue(':body', $_POST['body']); + if ($edit_raw_html) { + $body_nomarkup = '<tinyboard raw html>' . $_POST['body'] . '</tinyboard>'; + $query->bindValue(':body_nomarkup', $body_nomarkup); + } $query->execute() or error(db_error($query)); if ($edit_raw_html) { @@ -1229,10 +1309,12 @@ function mod_edit_post($board, $edit_raw_html, $postID) { header('Location: ?/' . sprintf($config['board_path'], $board) . $config['dir']['res'] . sprintf($config['file_page'], $post['thread'] ? $post['thread'] : $postID) . '#' . $postID, true, $config['redirect_http']); } else { if ($config['minify_html']) { - $post['body_nomarkup'] = str_replace("\n", '
', $post['body_nomarkup']); - $post['body'] = str_replace("\n", '
', $post['body']); + $post['body_nomarkup'] = str_replace("\n", '
', utf8tohtml($post['body_nomarkup'])); + $post['body'] = str_replace("\n", '
', utf8tohtml($post['body'])); + $post['body_nomarkup'] = str_replace("\r", '', $post['body_nomarkup']); + $post['body'] = str_replace("\r", '', $post['body']); } - + mod_page(_('Edit post'), 'mod/edit_post_form.html', array('token' => $security_token, 'board' => $board, 'raw' => $edit_raw_html, 'post' => $post)); } } @@ -1292,17 +1374,17 @@ function mod_deletebyip($boardName, $post, $global = false) { error($config['error']['noaccess']); // Find IP address - $query = prepare(sprintf('SELECT `ip` FROM `posts_%s` WHERE `id` = :id', $boardName)); + $query = prepare(sprintf('SELECT `ip` FROM ``posts_%s`` WHERE `id` = :id', $boardName)); $query->bindValue(':id', $post); $query->execute() or error(db_error($query)); - if (!$ip = $query->fetchColumn(0)) + if (!$ip = $query->fetchColumn()) error($config['error']['invalidpost']); $boards = $global ? listBoards() : array(array('uri' => $boardName)); $query = ''; foreach ($boards as $_board) { - $query .= sprintf("SELECT `thread`, `id`, '%s' AS `board` FROM `posts_%s` WHERE `ip` = :ip UNION ALL ", $_board['uri'], $_board['uri']); + $query .= sprintf("SELECT `thread`, `id`, '%s' AS `board` FROM ``posts_%s`` WHERE `ip` = :ip UNION ALL ", $_board['uri'], $_board['uri']); } $query = preg_replace('/UNION ALL $/', '', $query); @@ -1317,7 +1399,7 @@ function mod_deletebyip($boardName, $post, $global = false) { $threads_to_rebuild = array(); $threads_deleted = array(); - while ($post = $query->fetch()) { + while ($post = $query->fetch(PDO::FETCH_ASSOC)) { openBoard($post['board']); deletePost($post['id'], false, false); @@ -1354,7 +1436,7 @@ function mod_user($uid) { if (!hasPermission($config['mod']['editusers']) && !(hasPermission($config['mod']['change_password']) && $uid == $mod['id'])) error($config['error']['noaccess']); - $query = prepare('SELECT * FROM `mods` WHERE `id` = :id'); + $query = prepare('SELECT * FROM ``mods`` WHERE `id` = :id'); $query->bindValue(':id', $uid); $query->execute() or error(db_error($query)); if (!$user = $query->fetch(PDO::FETCH_ASSOC)) @@ -1371,7 +1453,7 @@ function mod_user($uid) { $boards = array(); foreach ($_POST as $name => $value) { - if (preg_match('/^board_(\w+)$/', $name, $matches) && in_array($matches[1], $_boards)) + if (preg_match('/^board_(' . $config['board_regex'] . ')$/u', $name, $matches) && in_array($matches[1], $_boards)) $boards[] = $matches[1]; } } @@ -1380,7 +1462,7 @@ function mod_user($uid) { if (!hasPermission($config['mod']['deleteusers'])) error($config['error']['noaccess']); - $query = prepare('DELETE FROM `mods` WHERE `id` = :id'); + $query = prepare('DELETE FROM ``mods`` WHERE `id` = :id'); $query->bindValue(':id', $uid); $query->execute() or error(db_error($query)); @@ -1394,7 +1476,7 @@ function mod_user($uid) { if ($_POST['username'] == '') error(sprintf($config['error']['required'], 'username')); - $query = prepare('UPDATE `mods` SET `username` = :username, `boards` = :boards WHERE `id` = :id'); + $query = prepare('UPDATE ``mods`` SET `username` = :username, `boards` = :boards WHERE `id` = :id'); $query->bindValue(':id', $uid); $query->bindValue(':username', $_POST['username']); $query->bindValue(':boards', implode(',', $boards)); @@ -1406,9 +1488,13 @@ function mod_user($uid) { } if ($_POST['password'] != '') { - $query = prepare('UPDATE `mods` SET `password` = SHA1(:password) WHERE `id` = :id'); + $salt = generate_salt(); + $password = hash('sha256', $salt . sha1($_POST['password'])); + + $query = prepare('UPDATE ``mods`` SET `password` = :password, `salt` = :salt WHERE `id` = :id'); $query->bindValue(':id', $uid); - $query->bindValue(':password', $_POST['password']); + $query->bindValue(':password', $password); + $query->bindValue(':salt', $salt); $query->execute() or error(db_error($query)); modLog('Changed password for ' . utf8tohtml($_POST['username']) . ' <small>(#' . $user['id'] . ')</small>'); @@ -1429,9 +1515,13 @@ function mod_user($uid) { if (hasPermission($config['mod']['change_password']) && $uid == $mod['id'] && isset($_POST['password'])) { if ($_POST['password'] != '') { - $query = prepare('UPDATE `mods` SET `password` = SHA1(:password) WHERE `id` = :id'); + $salt = generate_salt(); + $password = hash('sha256', $salt . sha1($_POST['password'])); + + $query = prepare('UPDATE ``mods`` SET `password` = :password, `salt` = :salt WHERE `id` = :id'); $query->bindValue(':id', $uid); - $query->bindValue(':password', $_POST['password']); + $query->bindValue(':password', $password); + $query->bindValue(':salt', $salt); $query->execute() or error(db_error($query)); modLog('Changed own password'); @@ -1449,7 +1539,7 @@ function mod_user($uid) { } if (hasPermission($config['mod']['modlog'])) { - $query = prepare('SELECT * FROM `modlogs` WHERE `mod` = :id ORDER BY `time` DESC LIMIT 5'); + $query = prepare('SELECT * FROM ``modlogs`` WHERE `mod` = :id ORDER BY `time` DESC LIMIT 5'); $query->bindValue(':id', $uid); $query->execute() or error(db_error($query)); $log = $query->fetchAll(PDO::FETCH_ASSOC); @@ -1484,7 +1574,7 @@ function mod_user_new() { $boards = array(); foreach ($_POST as $name => $value) { - if (preg_match('/^board_(\w+)$/', $name, $matches) && in_array($matches[1], $_boards)) + if (preg_match('/^board_(' . $config['board_regex'] . ')$/u', $name, $matches) && in_array($matches[1], $_boards)) $boards[] = $matches[1]; } } @@ -1493,9 +1583,13 @@ function mod_user_new() { if ($_POST['type'] !== JANITOR && $_POST['type'] !== MOD && $_POST['type'] !== ADMIN) error(sprintf($config['error']['invalidfield'], 'type')); - $query = prepare('INSERT INTO `mods` VALUES (NULL, :username, SHA1(:password), :type, :boards)'); + $salt = generate_salt(); + $password = hash('sha256', $salt . sha1($_POST['password'])); + + $query = prepare('INSERT INTO ``mods`` VALUES (NULL, :username, :password, :salt, :type, :boards)'); $query->bindValue(':username', $_POST['username']); - $query->bindValue(':password', $_POST['password']); + $query->bindValue(':password', $password); + $query->bindValue(':salt', $salt); $query->bindValue(':type', $_POST['type']); $query->bindValue(':boards', implode(',', $boards)); $query->execute() or error(db_error($query)); @@ -1518,7 +1612,7 @@ function mod_users() { if (!hasPermission($config['mod']['manageusers'])) error($config['error']['noaccess']); - $query = query("SELECT *, (SELECT `time` FROM `modlogs` WHERE `mod` = `id` ORDER BY `time` DESC LIMIT 1) AS `last`, (SELECT `text` FROM `modlogs` WHERE `mod` = `id` ORDER BY `time` DESC LIMIT 1) AS `action` FROM `mods` ORDER BY `type` DESC,`id`") or error(db_error()); + $query = query("SELECT *, (SELECT `time` FROM ``modlogs`` WHERE `mod` = `id` ORDER BY `time` DESC LIMIT 1) AS `last`, (SELECT `text` FROM ``modlogs`` WHERE `mod` = `id` ORDER BY `time` DESC LIMIT 1) AS `action` FROM ``mods`` ORDER BY `type` DESC,`id`") or error(db_error()); $users = $query->fetchAll(PDO::FETCH_ASSOC); mod_page(sprintf('%s (%d)', _('Manage users'), count($users)), 'mod/users.html', array('users' => $users)); @@ -1530,7 +1624,7 @@ function mod_user_promote($uid, $action) { if (!hasPermission($config['mod']['promoteusers'])) error($config['error']['noaccess']); - $query = prepare("UPDATE `mods` SET `type` = `type` " . ($action == 'promote' ? "+1 WHERE `type` < " . (int)ADMIN : "-1 WHERE `type` > " . (int)JANITOR) . " AND `id` = :id"); + $query = prepare("UPDATE ``mods`` SET `type` = `type` " . ($action == 'promote' ? "+1 WHERE `type` < " . (int)ADMIN : "-1 WHERE `type` > " . (int)JANITOR) . " AND `id` = :id"); $query->bindValue(':id', $uid); $query->execute() or error(db_error($query)); @@ -1545,7 +1639,7 @@ function mod_pm($id, $reply = false) { if ($reply && !hasPermission($config['mod']['create_pm'])) error($config['error']['noaccess']); - $query = prepare("SELECT `mods`.`username`, `mods_to`.`username` AS `to_username`, `pms`.* FROM `pms` LEFT JOIN `mods` ON `mods`.`id` = `sender` LEFT JOIN `mods` AS `mods_to` ON `mods_to`.`id` = `to` WHERE `pms`.`id` = :id"); + $query = prepare("SELECT ``mods``.`username`, `mods_to`.`username` AS `to_username`, ``pms``.* FROM ``pms`` LEFT JOIN ``mods`` ON ``mods``.`id` = `sender` LEFT JOIN ``mods`` AS `mods_to` ON `mods_to`.`id` = `to` WHERE ``pms``.`id` = :id"); $query->bindValue(':id', $id); $query->execute() or error(db_error($query)); @@ -1553,7 +1647,7 @@ function mod_pm($id, $reply = false) { error($config['error']['404']); if (isset($_POST['delete'])) { - $query = prepare("DELETE FROM `pms` WHERE `id` = :id"); + $query = prepare("DELETE FROM ``pms`` WHERE `id` = :id"); $query->bindValue(':id', $id); $query->execute() or error(db_error($query)); @@ -1567,7 +1661,7 @@ function mod_pm($id, $reply = false) { } if ($pm['unread'] && $pm['to'] == $mod['id']) { - $query = prepare("UPDATE `pms` SET `unread` = 0 WHERE `id` = :id"); + $query = prepare("UPDATE ``pms`` SET `unread` = 0 WHERE `id` = :id"); $query->bindValue(':id', $id); $query->execute() or error(db_error($query)); @@ -1594,15 +1688,15 @@ function mod_pm($id, $reply = false) { function mod_inbox() { global $config, $mod; - $query = prepare('SELECT `unread`,`pms`.`id`, `time`, `sender`, `to`, `message`, `username` FROM `pms` LEFT JOIN `mods` ON `mods`.`id` = `sender` WHERE `to` = :mod ORDER BY `unread` DESC, `time` DESC'); + $query = prepare('SELECT `unread`,``pms``.`id`, `time`, `sender`, `to`, `message`, `username` FROM ``pms`` LEFT JOIN ``mods`` ON ``mods``.`id` = `sender` WHERE `to` = :mod ORDER BY `unread` DESC, `time` DESC'); $query->bindValue(':mod', $mod['id']); $query->execute() or error(db_error($query)); $messages = $query->fetchAll(PDO::FETCH_ASSOC); - $query = prepare('SELECT COUNT(*) FROM `pms` WHERE `to` = :mod AND `unread` = 1'); + $query = prepare('SELECT COUNT(*) FROM ``pms`` WHERE `to` = :mod AND `unread` = 1'); $query->bindValue(':mod', $mod['id']); $query->execute() or error(db_error($query)); - $unread = $query->fetchColumn(0); + $unread = $query->fetchColumn(); foreach ($messages as &$message) { $message['snippet'] = pm_snippet($message['message']); @@ -1621,24 +1715,25 @@ function mod_new_pm($username) { if (!hasPermission($config['mod']['create_pm'])) error($config['error']['noaccess']); - $query = prepare("SELECT `id` FROM `mods` WHERE `username` = :username"); + $query = prepare("SELECT `id` FROM ``mods`` WHERE `username` = :username"); $query->bindValue(':username', $username); $query->execute() or error(db_error($query)); - if (!$id = $query->fetchColumn(0)) { + if (!$id = $query->fetchColumn()) { // Old style ?/PM: by user ID - $query = prepare("SELECT `username` FROM `mods` WHERE `id` = :username"); + $query = prepare("SELECT `username` FROM ``mods`` WHERE `id` = :username"); $query->bindValue(':username', $username); $query->execute() or error(db_error($query)); - if ($username = $query->fetchColumn(0)) + if ($username = $query->fetchColumn()) header('Location: ?/new_PM/' . $username, true, $config['redirect_http']); else error($config['error']['404']); } if (isset($_POST['message'])) { + $_POST['message'] = escape_markup_modifiers($_POST['message']); markup($_POST['message']); - $query = prepare("INSERT INTO `pms` VALUES (NULL, :me, :id, :message, :time, 1)"); + $query = prepare("INSERT INTO ``pms`` VALUES (NULL, :me, :id, :message, :time, 1)"); $query->bindValue(':me', $mod['id']); $query->bindValue(':id', $id); $query->bindValue(':message', $_POST['message']); @@ -1711,7 +1806,7 @@ function mod_rebuild() { } if (isset($_POST['rebuild_thread'])) { - $query = query(sprintf("SELECT `id` FROM `posts_%s` WHERE `thread` IS NULL", $board['uri'])) or error(db_error()); + $query = query(sprintf("SELECT `id` FROM ``posts_%s`` WHERE `thread` IS NULL", $board['uri'])) or error(db_error()); while ($post = $query->fetch(PDO::FETCH_ASSOC)) { $log[] = '<strong>' . sprintf($config['board_abbreviation'], $board['uri']) . '</strong>: Rebuilding thread #' . $post['id']; buildThread($post['id']); @@ -1732,7 +1827,7 @@ function mod_reports() { if (!hasPermission($config['mod']['reports'])) error($config['error']['noaccess']); - $query = prepare("SELECT * FROM `reports` ORDER BY `time` DESC LIMIT :limit"); + $query = prepare("SELECT * FROM ``reports`` ORDER BY `time` DESC LIMIT :limit"); $query->bindValue(':limit', $config['mod']['recent_reports'], PDO::PARAM_INT); $query->execute() or error(db_error($query)); $reports = $query->fetchAll(PDO::FETCH_ASSOC); @@ -1748,8 +1843,8 @@ function mod_reports() { foreach ($report_queries as $board => $posts) { $report_posts[$board] = array(); - $query = query(sprintf('SELECT * FROM `posts_%s` WHERE `id` = ' . implode(' OR `id` = ', $posts), $board)) or error(db_error()); - while ($post = $query->fetch()) { + $query = query(sprintf('SELECT * FROM ``posts_%s`` WHERE `id` = ' . implode(' OR `id` = ', $posts), $board)) or error(db_error()); + while ($post = $query->fetch(PDO::FETCH_ASSOC)) { $report_posts[$board][$post['id']] = $post; } } @@ -1759,7 +1854,7 @@ function mod_reports() { foreach ($reports as $report) { if (!isset($report_posts[$report['board']][$report['post']])) { // // Invalid report (post has since been deleted) - $query = prepare("DELETE FROM `reports` WHERE `post` = :id AND `board` = :board"); + $query = prepare("DELETE FROM ``reports`` WHERE `post` = :id AND `board` = :board"); $query->bindValue(':id', $report['post'], PDO::PARAM_INT); $query->bindValue(':board', $report['board']); $query->execute() or error(db_error($query)); @@ -1815,7 +1910,7 @@ function mod_reports() { function mod_report_dismiss($id, $all = false) { global $config; - $query = prepare("SELECT `post`, `board`, `ip` FROM `reports` WHERE `id` = :id"); + $query = prepare("SELECT `post`, `board`, `ip` FROM ``reports`` WHERE `id` = :id"); $query->bindValue(':id', $id); $query->execute() or error(db_error($query)); if ($report = $query->fetch(PDO::FETCH_ASSOC)) { @@ -1832,10 +1927,10 @@ function mod_report_dismiss($id, $all = false) { error($config['error']['noaccess']); if ($all) { - $query = prepare("DELETE FROM `reports` WHERE `ip` = :ip"); + $query = prepare("DELETE FROM ``reports`` WHERE `ip` = :ip"); $query->bindValue(':ip', $ip); } else { - $query = prepare("DELETE FROM `reports` WHERE `id` = :id"); + $query = prepare("DELETE FROM ``reports`` WHERE `id` = :id"); $query->bindValue(':id', $id); } $query->execute() or error(db_error($query)); @@ -1850,12 +1945,43 @@ function mod_report_dismiss($id, $all = false) { } -function mod_config() { - global $config, $mod; +function mod_config($board_config = false) { + global $config, $mod, $board; + + if ($board_config && !openBoard($board_config)) + error($config['error']['noboard']); - if (!hasPermission($config['mod']['edit_config'])) + if (!hasPermission($config['mod']['edit_config'], $board_config)) error($config['error']['noaccess']); + $config_file = $board_config ? $board['dir'] . 'config.php' : 'inc/instance-config.php'; + + if ($config['mod']['config_editor_php']) { + $readonly = !(is_file($config_file) ? is_writable($config_file) : is_writable(dirname($config_file))); + + if (!$readonly && isset($_POST['code'])) { + $code = $_POST['code']; + file_put_contents($config_file, $code); + header('Location: ?/config' . ($board_config ? '/' . $board_config : ''), true, $config['redirect_http']); + return; + } + + $instance_config = @file_get_contents($config_file); + if ($instance_config === false) { + $instance_config = "<?php\n\n// This file does not exist yet. You are creating it."; + } + $instance_config = str_replace("\n", '
', utf8tohtml($instance_config)); + + mod_page(_('Config editor'), 'mod/config-editor-php.html', array( + 'php' => $instance_config, + 'readonly' => $readonly, + 'boards' => listBoards(), + 'board' => $board_config, + 'file' => $config_file + )); + return; + } + require_once 'inc/mod/config-editor.php'; $conf = config_vars(); @@ -1866,7 +1992,7 @@ function mod_config() { foreach ($var['name'] as $n) $c = &$c[$n]; } else { - $c = $config[$var['name']]; + $c = @$config[$var['name']]; } $var['value'] = $c; @@ -1901,14 +2027,28 @@ function mod_config() { $config_append .= '[' . var_export($var['name'], true) . ']'; } - $config_append .= ' = ' . var_export($value, true) . ";\n"; + + $config_append .= ' = '; + if (@$var['permissions'] && in_array($value, array(JANITOR, MOD, ADMIN, DISABLED))) { + $perm_array = array( + JANITOR => 'JANITOR', + MOD => 'MOD', + ADMIN => 'ADMIN', + DISABLED => 'DISABLED' + ); + $config_append .= $perm_array[$value]; + } else { + $config_append .= var_export($value, true); + } + $config_append .= ";\n"; } } if (!empty($config_append)) { $config_append = "\n// Changes made via web editor by \"" . $mod['username'] . "\" @ " . date('r') . ":\n" . $config_append . "\n"; - - if (!@file_put_contents('inc/instance-config.php', $config_append, FILE_APPEND)) { + if (!is_file($config_file)) + $config_append = "<?php\n\n$config_append"; + if (!@file_put_contents($config_file, $config_append, FILE_APPEND)) { $config_append = htmlentities($config_append); if ($config['minify_html']) @@ -1917,8 +2057,8 @@ function mod_config() { $page['title'] = 'Cannot write to file!'; $page['config'] = $config; $page['body'] = ' - <p style="text-align:center">Tinyboard could not write to <strong>inc/instance-config.php</strong> with the ammended configuration, probably due to a permissions error.</p> - <p style="text-align:center">You may proceed with these changes manually by copying and pasting the following code to the end of <strong>inc/instance-config.php</strong>:</p> + <p style="text-align:center">Tinyboard could not write to <strong>' . $config_file . '</strong> with the ammended configuration, probably due to a permissions error.</p> + <p style="text-align:center">You may proceed with these changes manually by copying and pasting the following code to the end of <strong>' . $config_file . '</strong>:</p> <textarea style="width:700px;height:370px;margin:auto;display:block;background:white;color:black" readonly>' . $config_append . '</textarea> '; echo Element('page.html', $page); @@ -1926,12 +2066,18 @@ function mod_config() { } } - header('Location: ?/', true, $config['redirect_http']); + header('Location: ?/config', true, $config['redirect_http']); exit; } - mod_page(_('Config editor'), 'mod/config-editor.html', array('conf' => $conf)); + mod_page(_('Config editor') . ($board_config ? ': ' . sprintf($config['board_abbreviation'], $board_config) : ''), + 'mod/config-editor.html', array( + 'boards' => listBoards(), + 'board' => $board_config, + 'conf' => $conf, + 'file' => $config_file + )); } function mod_themes_list() { @@ -1945,7 +2091,7 @@ function mod_themes_list() { if (!$dir = opendir($config['dir']['themes'])) error(_('Cannot open themes directory; check permissions.')); - $query = query('SELECT `theme` FROM `theme_settings` WHERE `name` IS NULL AND `value` IS NULL') or error(db_error()); + $query = query('SELECT `theme` FROM ``theme_settings`` WHERE `name` IS NULL AND `value` IS NULL') or error(db_error()); $themes_in_use = $query->fetchAll(PDO::FETCH_COLUMN); // Scan directory for themes @@ -1981,19 +2127,19 @@ function mod_theme_configure($theme_name) { } // Clear previous settings - $query = prepare("DELETE FROM `theme_settings` WHERE `theme` = :theme"); + $query = prepare("DELETE FROM ``theme_settings`` WHERE `theme` = :theme"); $query->bindValue(':theme', $theme_name); $query->execute() or error(db_error($query)); foreach ($theme['config'] as &$conf) { - $query = prepare("INSERT INTO `theme_settings` VALUES(:theme, :name, :value)"); + $query = prepare("INSERT INTO ``theme_settings`` VALUES(:theme, :name, :value)"); $query->bindValue(':theme', $theme_name); $query->bindValue(':name', $conf['name']); $query->bindValue(':value', $_POST[$conf['name']]); $query->execute() or error(db_error($query)); } - $query = prepare("INSERT INTO `theme_settings` VALUES(:theme, NULL, NULL)"); + $query = prepare("INSERT INTO ``theme_settings`` VALUES(:theme, NULL, NULL)"); $query->bindValue(':theme', $theme_name); $query->execute() or error(db_error($query)); @@ -2011,7 +2157,7 @@ function mod_theme_configure($theme_name) { if (!$result) { // Install failed - $query = prepare("DELETE FROM `theme_settings` WHERE `theme` = :theme"); + $query = prepare("DELETE FROM ``theme_settings`` WHERE `theme` = :theme"); $query->bindValue(':theme', $theme_name); $query->execute() or error(db_error($query)); } @@ -2043,7 +2189,7 @@ function mod_theme_uninstall($theme_name) { if (!hasPermission($config['mod']['themes'])) error($config['error']['noaccess']); - $query = prepare("DELETE FROM `theme_settings` WHERE `theme` = :theme"); + $query = prepare("DELETE FROM ``theme_settings`` WHERE `theme` = :theme"); $query->bindValue(':theme', $theme_name); $query->execute() or error(db_error($query)); @@ -2074,7 +2220,7 @@ function mod_debug_antispam() { $where .= ' AND `thread` = ' . $pdo->quote($_POST['thread']); if (isset($_POST['purge'])) { - $query = prepare('UPDATE `antispam` SET `expires` = UNIX_TIMESTAMP() + :expires WHERE' . $where); + $query = prepare(', DATE ``antispam`` SET `expires` = UNIX_TIMESTAMP() + :expires WHERE' . $where); $query->bindValue(':expires', $config['spam']['hidden_inputs_expire']); $query->execute() or error(db_error()); } @@ -2085,16 +2231,16 @@ function mod_debug_antispam() { $where = ''; } - $query = query('SELECT COUNT(*) FROM `antispam`' . ($where ? " WHERE $where" : '')) or error(db_error()); - $args['total'] = number_format($query->fetchColumn(0)); + $query = query('SELECT COUNT(*) FROM ``antispam``' . ($where ? " WHERE $where" : '')) or error(db_error()); + $args['total'] = number_format($query->fetchColumn()); - $query = query('SELECT COUNT(*) FROM `antispam` WHERE `expires` IS NOT NULL' . ($where ? " AND $where" : '')) or error(db_error()); - $args['expiring'] = number_format($query->fetchColumn(0)); + $query = query('SELECT COUNT(*) FROM ``antispam`` WHERE `expires` IS NOT NULL' . ($where ? " AND $where" : '')) or error(db_error()); + $args['expiring'] = number_format($query->fetchColumn()); - $query = query('SELECT * FROM `antispam` ' . ($where ? "WHERE $where" : '') . ' ORDER BY `passed` DESC LIMIT 40') or error(db_error()); + $query = query('SELECT * FROM ``antispam`` ' . ($where ? "WHERE $where" : '') . ' ORDER BY `passed` DESC LIMIT 40') or error(db_error()); $args['top'] = $query->fetchAll(PDO::FETCH_ASSOC); - $query = query('SELECT * FROM `antispam` ' . ($where ? "WHERE $where" : '') . ' ORDER BY `created` DESC LIMIT 20') or error(db_error()); + $query = query('SELECT * FROM ``antispam`` ' . ($where ? "WHERE $where" : '') . ' ORDER BY `created` DESC LIMIT 20') or error(db_error()); $args['recent'] = $query->fetchAll(PDO::FETCH_ASSOC); mod_page(_('Debug: Anti-spam'), 'mod/debug/antispam.html', $args); @@ -2110,7 +2256,7 @@ function mod_debug_recent_posts() { // Manually build an SQL query $query = 'SELECT * FROM ('; foreach ($boards as $board) { - $query .= sprintf('SELECT *, %s AS `board` FROM `posts_%s` UNION ALL ', $pdo->quote($board['uri']), $board['uri']); + $query .= sprintf('SELECT *, %s AS `board` FROM ``posts_%s`` UNION ALL ', $pdo->quote($board['uri']), $board['uri']); } // Remove the last "UNION ALL" seperator and complete the query $query = preg_replace('/UNION ALL $/', ') AS `all_posts` ORDER BY `time` DESC LIMIT ' . $limit, $query); diff --git a/inc/template.php b/inc/template.php index 071fa761..09e27c26 100644 --- a/inc/template.php +++ b/inc/template.php @@ -1,72 +1,72 @@ -<?php
-
-/*
- * Copyright (c) 2010-2013 Tinyboard Development Group
- */
-
-if (realpath($_SERVER['SCRIPT_FILENAME']) == str_replace('\\', '/', __FILE__)) {
- // You cannot request this file directly.
- exit;
-}
-
-$twig = false;
-
-function load_twig() {
- global $twig, $config;
-
- require 'lib/Twig/Autoloader.php';
- Twig_Autoloader::register();
-
- Twig_Autoloader::autoload('Twig_Extensions_Node_Trans');
- Twig_Autoloader::autoload('Twig_Extensions_TokenParser_Trans');
- Twig_Autoloader::autoload('Twig_Extensions_Extension_I18n');
- Twig_Autoloader::autoload('Twig_Extensions_Extension_Tinyboard');
-
- $loader = new Twig_Loader_Filesystem($config['dir']['template']);
- $loader->setPaths($config['dir']['template']);
- $twig = new Twig_Environment($loader, array(
- 'autoescape' => false,
- 'cache' => "{$config['dir']['template']}/cache",
- 'debug' => $config['debug']
- ));
- $twig->addExtension(new Twig_Extensions_Extension_Tinyboard());
- $twig->addExtension(new Twig_Extensions_Extension_I18n());
-}
-
-function Element($templateFile, array $options) {
- global $config, $debug, $twig;
-
- if (!$twig)
- load_twig();
-
- if (function_exists('create_pm_header') && ((isset($options['mod']) && $options['mod']) || isset($options['__mod'])) && !preg_match('!^mod/!', $templateFile)) {
- $options['pm'] = create_pm_header();
- }
-
- if (isset($options['body']) && $config['debug']) {
- if (isset($debug['start'])) {
- $debug['time'] = '~' . round((microtime(true) - $debug['start']) * 1000, 2) . 'ms';
- unset($debug['start']);
- }
- $debug['included'] = get_included_files();
- $debug['memory'] = round(memory_get_usage(true) / (1024 * 1024), 2) . ' MiB';
- $options['body'] .=
- '<h3>Debug</h3><pre style="white-space: pre-wrap;font-size: 10px;">' .
- str_replace("\n", '<br/>', utf8tohtml(print_r($debug, true))) .
- '</pre>';
- }
-
- // Read the template file
- if (@file_get_contents("{$config['dir']['template']}/${templateFile}")) {
- $body = $twig->render($templateFile, $options);
-
- if ($config['minify_html'] && preg_match('/\.html$/', $templateFile)) {
- $body = trim(preg_replace("/[\t\r\n]/", '', $body));
- }
-
- return $body;
- } else {
- throw new Exception("Template file '${templateFile}' does not exist or is empty in '{$config['dir']['template']}'!");
- }
-}
-
+<?php + +/* + * Copyright (c) 2010-2013 Tinyboard Development Group + */ + +if (realpath($_SERVER['SCRIPT_FILENAME']) == str_replace('\\', '/', __FILE__)) { + // You cannot request this file directly. + exit; +} + +$twig = false; + +function load_twig() { + global $twig, $config; + + require 'lib/Twig/Autoloader.php'; + Twig_Autoloader::register(); + + Twig_Autoloader::autoload('Twig_Extensions_Node_Trans'); + Twig_Autoloader::autoload('Twig_Extensions_TokenParser_Trans'); + Twig_Autoloader::autoload('Twig_Extensions_Extension_I18n'); + Twig_Autoloader::autoload('Twig_Extensions_Extension_Tinyboard'); + + $loader = new Twig_Loader_Filesystem($config['dir']['template']); + $loader->setPaths($config['dir']['template']); + $twig = new Twig_Environment($loader, array( + 'autoescape' => false, + 'cache' => "{$config['dir']['template']}/cache", + 'debug' => $config['debug'] + )); + $twig->addExtension(new Twig_Extensions_Extension_Tinyboard()); + $twig->addExtension(new Twig_Extensions_Extension_I18n()); +} + +function Element($templateFile, array $options) { + global $config, $debug, $twig; + + if (!$twig) + load_twig(); + + if (function_exists('create_pm_header') && ((isset($options['mod']) && $options['mod']) || isset($options['__mod'])) && !preg_match('!^mod/!', $templateFile)) { + $options['pm'] = create_pm_header(); + } + + if (isset($options['body']) && $config['debug']) { + if (isset($debug['start'])) { + $debug['time'] = '~' . round((microtime(true) - $debug['start']) * 1000, 2) . 'ms'; + unset($debug['start']); + } + $debug['included'] = get_included_files(); + $debug['memory'] = round(memory_get_usage(true) / (1024 * 1024), 2) . ' MiB'; + $options['body'] .= + '<h3>Debug</h3><pre style="white-space: pre-wrap;font-size: 10px;">' . + str_replace("\n", '<br/>', utf8tohtml(print_r($debug, true))) . + '</pre>'; + } + + // Read the template file + if (@file_get_contents("{$config['dir']['template']}/${templateFile}")) { + $body = $twig->render($templateFile, $options); + + if ($config['minify_html'] && preg_match('/\.html$/', $templateFile)) { + $body = trim(preg_replace("/[\t\r\n]/", '', $body)); + } + + return $body; + } else { + throw new Exception("Template file '${templateFile}' does not exist or is empty in '{$config['dir']['template']}'!"); + } +} + diff --git a/install.php b/install.php index 542762ae..778654b7 100644 --- a/install.php +++ b/install.php @@ -1,7 +1,7 @@ <?php // Installation/upgrade file -define('VERSION', 'v0.9.6-dev-8 + <a href="https://github.com/vichan-devel/Tinyboard/">vichan-devel-4.0.2</a>'); +define('VERSION', 'v0.9.6-dev-11 + <a href="https://int.vichan.net/devel/">vichan-devel-4.0.8-gold</a>'); require 'inc/functions.php'; @@ -233,6 +233,139 @@ if (file_exists($config['has_installed'])) { case 'v0.9.6-dev-8': case 'v0.9.6-dev-8 + <a href="https://github.com/vichan-devel/Tinyboard/">vichan-devel-4.0.1</a>': query("CREATE TABLE IF NOT EXISTS `search_queries` ( `ip` varchar(39) NOT NULL, `time` int(11) NOT NULL, `query` text NOT NULL) ENGINE=MyISAM DEFAULT CHARSET=utf8;") or error(db_error()); + case 'v0.9.6-dev-8 + <a href="https://github.com/vichan-devel/Tinyboard/">vichan-devel-4.0.2</a>': + query("ALTER TABLE `mods` CHANGE `password` `password` CHAR( 64 ) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT 'SHA256'") or error(db_error()); + query("ALTER TABLE `mods` ADD `salt` CHAR( 32 ) NOT NULL AFTER `password`") or error(db_error()); + $query = query("SELECT `id`,`password` FROM `mods`") or error(db_error()); + while ($user = $query->fetch(PDO::FETCH_ASSOC)) { + if (strlen($user['password']) == 40) { + mt_srand(microtime(true) * 100000 + memory_get_usage(true)); + $salt = md5(uniqid(mt_rand(), true)); + + $user['salt'] = $salt; + $user['password'] = hash('sha256', $user['salt'] . $user['password']); + + $_query = prepare("UPDATE `mods` SET `password` = :password, `salt` = :salt WHERE `id` = :id"); + $_query->bindValue(':id', $user['id']); + $_query->bindValue(':password', $user['password']); + $_query->bindValue(':salt', $user['salt']); + $_query->execute() or error(db_error($_query)); + } + } + case 'v0.9.6-dev-9': + case 'v0.9.6-dev-9 + <a href="https://github.com/vichan-devel/Tinyboard/">vichan-devel-4.0.3</a>': + case 'v0.9.6-dev-9 + <a href="https://github.com/vichan-devel/Tinyboard/">vichan-devel-4.0.4-gold</a>': + case 'v0.9.6-dev-9 + <a href="https://github.com/vichan-devel/Tinyboard/">vichan-devel-4.0.5-gold</a>': + sql_open(); + function __query($sql) { + if (mysql_version() >= 50503) + return query($sql); + else + return query(str_replace('utf8mb4', 'utf8', $sql)); + } + + foreach ($boards as &$board) { + __query(sprintf("ALTER TABLE `posts_%s` + CHANGE `subject` `subject` VARCHAR(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL, + CHANGE `email` `email` VARCHAR(30) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL, + CHANGE `name` `name` VARCHAR(35) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL, + CHANGE `trip` `trip` VARCHAR(15) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL, + CHANGE `capcode` `capcode` VARCHAR(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL, + CHANGE `body` `body` TEXT CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, + CHANGE `body_nomarkup` `body_nomarkup` TEXT CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL, + CHANGE `thumb` `thumb` VARCHAR(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL, + CHANGE `thumbwidth` `thumbwidth` INT(11) NULL DEFAULT NULL, + CHANGE `thumbheight` `thumbheight` INT(11) NULL DEFAULT NULL, + CHANGE `file` `file` VARCHAR(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL, + CHANGE `filename` `filename` TEXT CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL, + CHANGE `filehash` `filehash` TEXT CHARACTER SET ascii COLLATE ascii_general_ci NULL DEFAULT NULL, + CHANGE `password` `password` VARCHAR(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL, + CHANGE `ip` `ip` VARCHAR(39) CHARACTER SET ascii COLLATE ascii_general_ci NOT NULL, + CHANGE `embed` `embed` TEXT CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL, + DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;", $board['uri'])) or error(db_error()); + } + + __query("ALTER TABLE `antispam` + CHANGE `board` `board` VARCHAR( 120 ) CHARACTER SET ASCII COLLATE ascii_general_ci NOT NULL , + CHANGE `hash` `hash` CHAR( 40 ) CHARACTER SET ASCII COLLATE ascii_bin NOT NULL , + DEFAULT CHARACTER SET ASCII COLLATE ascii_bin;") or error(db_error()); + __query("ALTER TABLE `bans` + CHANGE `ip` `ip` VARCHAR( 39 ) CHARACTER SET ASCII COLLATE ascii_general_ci NOT NULL , + CHANGE `reason` `reason` TEXT CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL , + CHANGE `board` `board` VARCHAR( 120 ) CHARACTER SET ASCII COLLATE ascii_general_ci NULL DEFAULT NULL, + DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;") or error(db_error()); + __query("ALTER TABLE `boards` + CHANGE `uri` `uri` VARCHAR( 120 ) CHARACTER SET ASCII COLLATE ascii_general_ci NOT NULL , + CHANGE `title` `title` TINYTEXT CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL , + CHANGE `subtitle` `subtitle` TINYTEXT CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL, + DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;") or error(db_error()); + __query("ALTER TABLE `cites` + CHANGE `board` `board` VARCHAR( 120 ) CHARACTER SET ASCII COLLATE ascii_general_ci NOT NULL , + CHANGE `target_board` `target_board` VARCHAR( 120 ) CHARACTER SET ASCII COLLATE ascii_general_ci NOT NULL , + DEFAULT CHARACTER SET ASCII COLLATE ascii_general_ci;") or error(db_error()); + __query("ALTER TABLE `ip_notes` + CHANGE `ip` `ip` VARCHAR( 39 ) CHARACTER SET ASCII COLLATE ascii_general_ci NOT NULL , + CHANGE `body` `body` TEXT CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL , + DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;") or error(db_error()); + __query("ALTER TABLE `modlogs` + CHANGE `ip` `ip` VARCHAR( 39 ) CHARACTER SET ASCII COLLATE ascii_general_ci NOT NULL , + CHANGE `board` `board` VARCHAR( 120 ) CHARACTER SET ASCII COLLATE ascii_general_ci NULL DEFAULT NULL , + CHANGE `text` `text` TEXT CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL , + DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;") or error(db_error()); + __query("ALTER TABLE `mods` + CHANGE `username` `username` VARCHAR( 30 ) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL , + CHANGE `password` `password` CHAR( 64 ) CHARACTER SET ASCII COLLATE ascii_general_ci NOT NULL COMMENT 'SHA256', + CHANGE `salt` `salt` CHAR( 32 ) CHARACTER SET ASCII COLLATE ascii_general_ci NOT NULL , + CHANGE `boards` `boards` TEXT CHARACTER SET ASCII COLLATE ascii_general_ci NOT NULL , + DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;") or error(db_error()); + __query("ALTER TABLE `mutes` + CHANGE `ip` `ip` VARCHAR( 39 ) CHARACTER SET ASCII COLLATE ascii_general_ci NOT NULL , + DEFAULT CHARACTER SET ASCII COLLATE ascii_general_ci;") or error(db_error()); + __query("ALTER TABLE `news` + CHANGE `name` `name` TEXT CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL , + CHANGE `subject` `subject` TEXT CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL , + CHANGE `body` `body` TEXT CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL , + DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;") or error(db_error()); + __query("ALTER TABLE `noticeboard` + CHANGE `subject` `subject` TEXT CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL , + CHANGE `body` `body` TEXT CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL , + DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;") or error(db_error()); + __query("ALTER TABLE `pms` + CHANGE `message` `message` TEXT CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL , + DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;") or error(db_error()); + __query("ALTER TABLE `reports` + CHANGE `ip` `ip` VARCHAR( 39 ) CHARACTER SET ASCII COLLATE ascii_general_ci NOT NULL , + CHANGE `board` `board` VARCHAR( 120 ) CHARACTER SET ASCII COLLATE ascii_general_ci NULL DEFAULT NULL , + CHANGE `reason` `reason` TEXT CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL , + DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;") or error(db_error()); + __query("ALTER TABLE `robot` + CHANGE `hash` `hash` VARCHAR( 40 ) CHARACTER SET ASCII COLLATE ascii_bin NOT NULL COMMENT 'SHA1', + DEFAULT CHARACTER SET ASCII COLLATE ascii_bin;") or error(db_error()); + __query("ALTER TABLE `theme_settings` + CHANGE `theme` `theme` VARCHAR( 40 ) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL , + CHANGE `name` `name` VARCHAR( 40 ) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL , + CHANGE `value` `value` TEXT CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL , + DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;") or eror(db_error()); + case 'v0.9.6-dev-10': + query("ALTER TABLE `antispam` + CHANGE `board` `board` VARCHAR( 58 ) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL;") or error(db_error()); + query("ALTER TABLE `bans` + CHANGE `board` `board` VARCHAR( 58 ) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL;") or error(db_error()); + query("ALTER TABLE `boards` + CHANGE `uri` `uri` VARCHAR( 58 ) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL;") or error(db_error()); + query("ALTER TABLE `cites` + CHANGE `board` `board` VARCHAR( 58 ) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL , + CHANGE `target_board` `target_board` VARCHAR( 58 ) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL , + DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci;") or error(db_error()); + query("ALTER TABLE `modlogs` + CHANGE `board` `board` VARCHAR( 58 ) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL;") or error(db_error()); + query("ALTER TABLE `mods` + CHANGE `boards` `boards` TEXT CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL;") or error(db_error()); + query("ALTER TABLE `reports` + CHANGE `board` `board` VARCHAR( 58 ) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL;") or error(db_error()); + case 'v0.9.6-dev-11': + case 'v0.9.6-dev-11 + <a href="https://int.vichan.net/devel/">vichan-devel-4.0.6</a>': + case 'v0.9.6-dev-11 + <a href="https://int.vichan.net/devel/">vichan-devel-4.0.7-gold</a>': case false: // Update version number file_write($config['has_installed'], VERSION); @@ -265,215 +398,177 @@ if ($step == 0) { } elseif ($step == 1) { $page['title'] = 'Pre-installation test'; - $page['body'] = '<table class="test">'; + $can_exec = true; + if (!function_exists('shell_exec')) + $can_exec = false; + elseif (in_array('shell_exec', array_map('trim', explode(', ', ini_get('disable_functions'))))) + $can_exec = false; + elseif (ini_get('safe_mode')) + $can_exec = false; + elseif (trim(shell_exec('echo "TEST"')) !== 'TEST') + $can_exec = false; - function rheader($item) { - global $page, $config; - - $page['body'] .= '<tr class="h"><th colspan="2">' . $item . '</th></tr>'; + if (!defined('PHP_VERSION_ID')) { + $version = explode('.', PHP_VERSION); + define('PHP_VERSION_ID', ($version[0] * 10000 + $version[1] * 100 + $version[2])); } - function row($item, $result) { - global $page, $config, $__is_error; - if (!$result) - $__is_error = true; - $page['body'] .= '<tr><th>' . $item . '</th><td><img style="width:16px;height:16px" src="' . $config['dir']['static'] . ($result ? 'ok.png' : 'error.png') . '" /></td></tr>'; - } - - // Required extensions - rheader('PHP extensions'); - row('PDO', extension_loaded('pdo')); - row('GD', extension_loaded('gd')); - - // GD tests - rheader('GD tests'); - row('JPEG', function_exists('imagecreatefromjpeg')); - row('PNG', function_exists('imagecreatefrompng')); - row('GIF', function_exists('imagecreatefromgif')); + $extensions = array( + 'PDO' => array( + 'installed' => extension_loaded('pdo'), + 'required' => true + ), + 'PDO' => array( + 'installed' => extension_loaded('gd'), + 'required' => true + ), + 'Imagick' => array( + 'installed' => extension_loaded('imagick'), + 'required' => false + ) + ); - // Database drivers - $drivers = PDO::getAvailableDrivers(); + $tests = array( + array( + 'category' => 'PHP', + 'name' => 'PHP ≥ 5.2.5', + 'result' => PHP_VERSION_ID >= 50205, + 'required' => true, + 'message' => 'Tinyboard requires PHP 5.2.5 or better.', + ), + array( + 'category' => 'PHP', + 'name' => 'PHP ≥ 5.3', + 'result' => PHP_VERSION_ID >= 50300, + 'required' => false, + 'message' => 'PHP ≥ 5.3, though not required, is recommended to make the most out of Tinyboard configuration files.', + ), + array( + 'category' => 'PHP', + 'name' => 'mbstring extension installed', + 'result' => extension_loaded('mbstring'), + 'required' => true, + 'message' => 'You must install the PHP <a href="http://www.php.net/manual/en/mbstring.installation.php">mbstring</a> extension.', + ), + array( + 'category' => 'Database', + 'name' => 'PDO extension installed', + 'result' => extension_loaded('pdo'), + 'required' => true, + 'message' => 'You must install the PHP <a href="http://www.php.net/manual/en/intro.pdo.php">PDO</a> extension.', + ), + array( + 'category' => 'Database', + 'name' => 'MySQL PDO driver installed', + 'result' => extension_loaded('pdo') && in_array('mysql', PDO::getAvailableDrivers()), + 'required' => true, + 'message' => 'The required <a href="http://www.php.net/manual/en/ref.pdo-mysql.php">PDO MySQL driver</a> is not installed.', + ), + array( + 'category' => 'Image processing', + 'name' => 'GD extension installed', + 'result' => extension_loaded('gd'), + 'required' => true, + 'message' => 'You must install the PHP <a href="http://www.php.net/manual/en/intro.image.php">GD</a> extension. GD is a requirement even if you have chosen another image processor for thumbnailing.', + ), + array( + 'category' => 'Image processing', + 'name' => 'GD: JPEG', + 'result' => function_exists('imagecreatefromjpeg'), + 'required' => true, + 'message' => 'imagecreatefromjpeg() does not exist. This is a problem.', + ), + array( + 'category' => 'Image processing', + 'name' => 'GD: PNG', + 'result' => function_exists('imagecreatefrompng'), + 'required' => true, + 'message' => 'imagecreatefrompng() does not exist. This is a problem.', + ), + array( + 'category' => 'Image processing', + 'name' => 'GD: GIF', + 'result' => function_exists('imagecreatefromgif'), + 'required' => true, + 'message' => 'imagecreatefromgif() does not exist. This is a problem.', + ), + array( + 'category' => 'Image processing', + 'name' => 'Imagick extension installed', + 'result' => extension_loaded('imagick'), + 'required' => false, + 'message' => '(Optional) The PHP <a href="http://www.php.net/manual/en/imagick.installation.php">Imagick</a> (ImageMagick) extension is not installed. You may not use Imagick for better (and faster) image processing.', + ), + array( + 'category' => 'Image processing', + 'name' => '`convert` (command-line ImageMagick)', + 'result' => $can_exec && shell_exec('which convert'), + 'required' => false, + 'message' => '(Optional) `convert` was not found or executable; command-line ImageMagick image processing cannot be enabled.', + ), + array( + 'category' => 'Image processing', + 'name' => '`identify` (command-line ImageMagick)', + 'result' => $can_exec && shell_exec('which identify'), + 'required' => false, + 'message' => '(Optional) `identify` was not found or executable; command-line ImageMagick image processing cannot be enabled.', + ), + array( + 'category' => 'Image processing', + 'name' => '`gifsicle` (command-line animted GIF thumbnailing)', + 'result' => $can_exec && shell_exec('which gifsicle'), + 'required' => false, + 'message' => '(Optional) `gifsicle` was not found or executable; you may not use `convert+gifsicle` for better animated GIF thumbnailing.', + ), + array( + 'category' => 'File permissions', + 'name' => getcwd(), + 'result' => is_writable('.'), + 'required' => true, + 'message' => 'Tinyboard does not have permission to create directories (boards) here. You will need to <code>chmod</code> (or operating system equivalent) appropriately.' + ), + array( + 'category' => 'File permissions', + 'name' => getcwd() . '/inc/instance-config.php', + 'result' => is_writable('inc/instance-config.php'), + 'required' => false, + 'message' => 'Tinyboard does not have permission to make changes to inc/instance-config.php. To complete the installation, you will be asked to manually copy and paste code into the file instead.' + ), + array( + 'category' => 'Misc', + 'name' => 'Tinyboard installed using git', + 'result' => is_dir('.git.'), + 'required' => false, + 'message' => 'Tinyboard is still beta software and it\'s not going to come out of beta any time soon. As there are often many months between releases yet changes and bug fixes are very frequent, it\'s recommended to use the git repository to maintain your Tinyboard installation. Using git makes upgrading much easier.' + ) + ); - rheader('PDO drivers <em>(currently installed drivers)</em>'); - foreach ($drivers as &$driver) { - row($driver, true); - } - - // Permissions - rheader('File permissions'); - row('<em>root directory</em> (' . getcwd() . ')', is_writable('.')); - - $page['body'] .= '</table> - <p style="text-align:center"> - <a href="?step=2"' . - (isset($__is_error) ? ' onclick="return confirm(\'Are you sure you want to continue when errors exist?\')"' : '') . - '>Continue' . (isset($__is_error) ? ' anyway' : '') . '</a> - </p>'; + $config['font_awesome'] = true; - echo Element('page.html', $page); + echo Element('page.html', array( + 'body' => Element('installer/check-requirements.html', array( + 'extensions' => $extensions, + 'tests' => $tests, + 'config' => $config + )), + 'title' => 'Checking environment', + 'config' => $config + )); } elseif ($step == 2) { // Basic config $page['title'] = 'Configuration'; - function create_salt() { - return substr(base64_encode(sha1(rand())), 0, rand(25, 31)); - } - - $page['body'] = ' -<form action="?step=3" method="post"> - <fieldset> - <legend>Database</legend> - <label for="db_type">Type:</label> - <select id="db_type" name="db[type]">'; - - $drivers = PDO::getAvailableDrivers(); - - foreach ($drivers as &$driver) { - $driver_txt = $driver; - switch ($driver) { - case 'cubrid': - $driver_txt = 'Cubrid'; - break; - case 'dblib': - $driver_txt = 'FreeTDS / Microsoft SQL Server / Sybase'; - break; - case 'firebird': - $driver_txt = 'Firebird/Interbase 6'; - break; - case 'ibm': - $driver_txt = 'IBM DB2'; - break; - case 'informix': - $driver_txt = 'IBM Informix Dynamic Server'; - break; - case 'mysql': - $driver_txt = 'MySQL'; - break; - case 'oci': - $driver_txt = 'OCI'; - break; - case 'odbc': - $driver_txt = 'ODBC v3 (IBM DB2, unixODBC)'; - break; - case 'pgsql': - $driver_txt = 'PostgreSQL'; - break; - case 'sqlite': - $driver_txt = 'SQLite 3'; - break; - case 'sqlite2': - $driver_txt = 'SQLite 2'; - break; - } - $page['body'] .= '<option value="' . $driver . '">' . $driver_txt . '</option>'; - } - - $page['body'] .= ' - </select> - - <label for="db_server">Server:</label> - <input type="text" id="db_server" name="db[server]" value="localhost" /> - - <label for="db_db">Database:</label> - <input type="text" id="db_db" name="db[database]" value="" /> - - <label for="db_user">Username:</label> - <input type="text" id="db_user" name="db[user]" value="" /> - - <label for="db_pass">Password:</label> - <input type="password" id="db_pass" name="db[password]" value="" /> - </fieldset> - <p style="text-align:center" class="unimportant">The following is all later configurable. For more options, <a href="http://tinyboard.org/docs/?p=Config">edit your configuration files</a> after installing.</p> - <fieldset> - <legend>Cookies</legend> - <label for="cookies_mod">Moderator cookie:</label> - <input type="text" id="cookies_mod" name="cookies[mod]" value="' . $config['cookies']['mod'] . '" /> - - <label for="cookies_salt">Secure salt:</label> - <input type="text" id="cookies_salt" name="cookies[salt]" value="' . create_salt() . '" size="40" /> - </fieldset> - - <fieldset> - <legend>Flood control</legend> - <label for="flood_time">Seconds before each post:</label> - <input type="text" id="flood_time" name="flood_time" value="' . $config['flood_time'] . '" /> - - <label for="flood_time_ip">Seconds before you can repost something (post the exact same text):</label> - <input type="text" id="flood_time_ip" name="flood_time_ip" value="' . $config['flood_time_ip'] . '" /> - - <label for="flood_time_same">Same as above, but with a different IP address:</label> - <input type="text" id="flood_time_same" name="flood_time_same" value="' . $config['flood_time_same'] . '" /> - - <label for="max_body">Maximum post body length:</label> - <input type="text" id="max_body" name="max_body" value="' . $config['max_body'] . '" /> - - <label for="reply_limit">Replies in a thread before it can no longer be bumped:</label> - <input type="text" id="reply_limit" name="reply_limit" value="' . $config['reply_limit'] . '" /> - - <label for="max_links">Maximum number of links in a single post:</label> - <input type="text" id="max_links" name="max_links" value="' . $config['max_links'] . '" /> - </fieldset> - - <fieldset> - <legend>Images</legend> - <label for="max_filesize">Maximum image filesize:</label> - <input type="text" id="max_filesize" name="max_filesize" value="' . $config['max_filesize'] . '" /> - - <label for="thumb_width">Thumbnail width:</label> - <input type="text" id="thumb_width" name="thumb_width" value="' . $config['thumb_width'] . '" /> - - <label for="thumb_height">Thumbnail height:</label> - <input type="text" id="thumb_height" name="thumb_height" value="' . $config['thumb_height'] . '" /> - - <label for="max_width">Maximum image width:</label> - <input type="text" id="max_width" name="max_width" value="' . $config['max_width'] . '" /> - - <label for="max_height">Maximum image height:</label> - <input type="text" id="max_height" name="max_height" value="' . $config['max_height'] . '" /> - </fieldset> + $config['cookies']['salt'] = substr(base64_encode(sha1(rand())), 0, 30); + $config['secure_trip_salt'] = substr(base64_encode(sha1(rand())), 0, 30); - <fieldset> - <legend>Display</legend> - <label for="threads_per_page">Threads per page:</label> - <input type="text" id="threads_per_page" name="threads_per_page" value="' . $config['threads_per_page'] . '" /> - - <label for="max_pages">Page limit:</label> - <input type="text" id="max_pages" name="max_pages" value="' . $config['max_pages'] . '" /> - - <label for="threads_preview">Number of replies to show per thread on the index page:</label> - <input type="text" id="threads_preview" name="threads_preview" value="' . $config['threads_preview'] . '" /> - </fieldset> - - <fieldset> - <legend>Directories</legend> - <label for="root">Root URI (include trailing slash):</label> - <input type="text" id="root" name="root" value="' . $config['root'] . '" /> - - <label for="dir_img">Image directory:</label> - <input type="text" id="dir_img" name="dir[img]" value="' . $config['dir']['img'] . '" /> - - <label for="dir_thumb">Thumbnail directory:</label> - <input type="text" id="dir_thumb" name="dir[thumb]" value="' . $config['dir']['thumb'] . '" /> - - <label for="dir_res">Thread directory:</label> - <input type="text" id="dir_res" name="dir[res]" value="' . $config['dir']['res'] . '" /> - </fieldset> - - <fieldset> - <legend>Miscellaneous</legend> - <label for="secure_trip_salt">Secure trip (##) salt:</label> - <input type="text" id="secure_trip_salt" name="secure_trip_salt" value="' . create_salt() . '" size="40" /> - </fieldset> - - <p style="text-align:center"> - <input type="submit" value="Complete installation" /> - </p> -</form> - '; - - - echo Element('page.html', $page); + echo Element('page.html', array( + 'body' => Element('installer/config.html', array( + 'config' => $config + )), + 'title' => 'Configuration', + 'config' => $config + )); } elseif ($step == 3) { $instance_config = '<?php @@ -532,6 +627,9 @@ if ($step == 0) { $sql = @file_get_contents('install.sql') or error("Couldn't load install.sql."); + sql_open(); + $mysql_version = mysql_version(); + // This code is probably horrible, but what I'm trying // to do is find all of the SQL queires and put them // in an array. @@ -541,7 +639,10 @@ if ($step == 0) { $queries[] = Element('posts.sql', array('board' => 'b')); $sql_errors = ''; - foreach ($queries as &$query) { + foreach ($queries as $query) { + if ($mysql_version < 50503) + $query = preg_replace('/(CHARSET=|CHARACTER SET )utf8mb4/', '$1utf8', $query); + $query = preg_replace('/^([\w\s]*)`([0-9a-zA-Z$_\x{0080}-\x{FFFF}]+)`/u', '$1``$2``', $query); if (!query($query)) $sql_errors .= '<li>' . db_error() . '</li>'; } diff --git a/install.sql b/install.sql index 9c6a0acd..84090999 100644 --- a/install.sql +++ b/install.sql @@ -1,25 +1,20 @@ -- phpMyAdmin SQL Dump --- version 3.4.2 +-- version 4.0.4.1 -- http://www.phpmyadmin.net -- -- Host: localhost --- Generation Time: Apr 12, 2012 at 11:22 PM --- Server version: 5.1.61 --- PHP Version: 5.3.3-7+squeeze8 +-- Generation Time: Jul 30, 2013 at 09:45 PM +-- Server version: 5.6.10 +-- PHP Version: 5.3.15 -SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO"; +SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; SET time_zone = "+00:00"; - /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; /*!40101 SET NAMES utf8 */; --- --- Database: `tinyboard` --- - -- -------------------------------------------------------- -- @@ -27,15 +22,15 @@ SET time_zone = "+00:00"; -- CREATE TABLE IF NOT EXISTS `antispam` ( - `board` varchar(255) NOT NULL, + `board` varchar(58) CHARACTER SET utf8 NOT NULL, `thread` int(11) DEFAULT NULL, - `hash` char(40) NOT NULL, + `hash` char(40) COLLATE ascii_bin NOT NULL, `created` int(11) NOT NULL, `expires` int(11) DEFAULT NULL, `passed` smallint(6) NOT NULL, PRIMARY KEY (`hash`), KEY `board` (`board`,`thread`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8; +) ENGINE=MyISAM DEFAULT CHARSET=ascii COLLATE=ascii_bin; -- -------------------------------------------------------- @@ -44,17 +39,17 @@ CREATE TABLE IF NOT EXISTS `antispam` ( -- CREATE TABLE IF NOT EXISTS `bans` ( - `id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT, - `ip` varchar(45) NOT NULL, + `id` int(11) unsigned NOT NULL AUTO_INCREMENT, + `ip` varchar(39) CHARACTER SET ascii NOT NULL, `mod` int(11) NOT NULL COMMENT 'which mod made the ban', `set` int(11) NOT NULL, `expires` int(11) DEFAULT NULL, `reason` text, - `board` varchar(120) DEFAULT NULL, + `board` varchar(58) CHARACTER SET utf8 DEFAULT NULL, `seen` tinyint(1) NOT NULL, PRIMARY KEY (`id`), FULLTEXT KEY `ip` (`ip`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ; +) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 AUTO_INCREMENT=1 ; -- -------------------------------------------------------- @@ -63,18 +58,18 @@ CREATE TABLE IF NOT EXISTS `bans` ( -- CREATE TABLE IF NOT EXISTS `boards` ( - `uri` varchar(120) NOT NULL, + `uri` varchar(58) CHARACTER SET utf8 NOT NULL, `title` tinytext NOT NULL, `subtitle` tinytext, PRIMARY KEY (`uri`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8; +) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4; -- -- Dumping data for table `boards` -- -INSERT INTO `boards` (`uri`, `title`, `subtitle`) VALUES -('b', 'Beta', 'In development.'); +INSERT INTO `boards` VALUES +('b', 'Random', NULL); -- -------------------------------------------------------- @@ -83,9 +78,9 @@ INSERT INTO `boards` (`uri`, `title`, `subtitle`) VALUES -- CREATE TABLE IF NOT EXISTS `cites` ( - `board` varchar(8) NOT NULL, + `board` varchar(58) NOT NULL, `post` int(11) NOT NULL, - `target_board` varchar(8) NOT NULL, + `target_board` varchar(58) NOT NULL, `target` int(11) NOT NULL, KEY `target` (`target_board`,`target`), KEY `post` (`board`,`post`) @@ -98,14 +93,14 @@ CREATE TABLE IF NOT EXISTS `cites` ( -- CREATE TABLE IF NOT EXISTS `ip_notes` ( - `id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT, - `ip` varchar(45) NOT NULL, + `id` int(11) unsigned NOT NULL AUTO_INCREMENT, + `ip` varchar(39) CHARACTER SET ascii NOT NULL, `mod` int(11) DEFAULT NULL, `time` int(11) NOT NULL, `body` text NOT NULL, UNIQUE KEY `id` (`id`), KEY `ip` (`ip`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ; +) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 AUTO_INCREMENT=1 ; -- -------------------------------------------------------- @@ -115,12 +110,12 @@ CREATE TABLE IF NOT EXISTS `ip_notes` ( CREATE TABLE IF NOT EXISTS `modlogs` ( `mod` int(11) NOT NULL, - `ip` varchar(45) NOT NULL, - `board` varchar(120) DEFAULT NULL, + `ip` varchar(39) CHARACTER SET ascii NOT NULL, + `board` varchar(58) CHARACTER SET utf8 DEFAULT NULL, `time` int(11) NOT NULL, `text` text NOT NULL, KEY `time` (`time`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8; +) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4; -- -------------------------------------------------------- @@ -129,21 +124,22 @@ CREATE TABLE IF NOT EXISTS `modlogs` ( -- CREATE TABLE IF NOT EXISTS `mods` ( - `id` smallint(6) UNSIGNED NOT NULL AUTO_INCREMENT, + `id` smallint(6) unsigned NOT NULL AUTO_INCREMENT, `username` varchar(30) NOT NULL, - `password` char(40) NOT NULL COMMENT 'SHA1', + `password` char(64) CHARACTER SET ascii NOT NULL COMMENT 'SHA256', + `salt` char(32) CHARACTER SET ascii NOT NULL, `type` smallint(1) NOT NULL COMMENT '0: janitor, 1: mod, 2: admin', - `boards` text NOT NULL, + `boards` text CHARACTER SET utf8 NOT NULL, PRIMARY KEY (`id`), UNIQUE KEY `id` (`id`,`username`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=2 ; +) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 AUTO_INCREMENT=5 ; -- -- Dumping data for table `mods` -- -INSERT INTO `mods` (`id`, `username`, `password`, `type`, `boards`) VALUES -(1, 'admin', '5baa61e4c9b93f3f0682250b6cf8331b7ee68fd8', 2, '*'); +INSERT INTO `mods` VALUES +(1, 'admin', 'cedad442efeef7112fed0f50b011b2b9bf83f6898082f995f69dd7865ca19fb7', '4a44c6c55df862ae901b413feecb0d49', 2, '*'); -- -------------------------------------------------------- @@ -152,10 +148,10 @@ INSERT INTO `mods` (`id`, `username`, `password`, `type`, `boards`) VALUES -- CREATE TABLE IF NOT EXISTS `mutes` ( - `ip` varchar(45) NOT NULL, + `ip` varchar(39) NOT NULL, `time` int(11) NOT NULL, KEY `ip` (`ip`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8; +) ENGINE=MyISAM DEFAULT CHARSET=ascii; -- -------------------------------------------------------- @@ -164,14 +160,14 @@ CREATE TABLE IF NOT EXISTS `mutes` ( -- CREATE TABLE IF NOT EXISTS `news` ( - `id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT, + `id` int(11) unsigned NOT NULL AUTO_INCREMENT, `name` text NOT NULL, `time` int(11) NOT NULL, `subject` text NOT NULL, `body` text NOT NULL, UNIQUE KEY `id` (`id`), KEY `time` (`time`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ; +) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 AUTO_INCREMENT=1 ; -- -------------------------------------------------------- @@ -180,13 +176,13 @@ CREATE TABLE IF NOT EXISTS `news` ( -- CREATE TABLE IF NOT EXISTS `noticeboard` ( - `id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT, + `id` int(11) unsigned NOT NULL AUTO_INCREMENT, `mod` int(11) NOT NULL, `time` int(11) NOT NULL, `subject` text NOT NULL, `body` text NOT NULL, UNIQUE KEY `id` (`id`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ; +) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 AUTO_INCREMENT=1 ; -- -------------------------------------------------------- @@ -195,14 +191,14 @@ CREATE TABLE IF NOT EXISTS `noticeboard` ( -- CREATE TABLE IF NOT EXISTS `pms` ( - `id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT, + `id` int(11) unsigned NOT NULL AUTO_INCREMENT, `sender` int(11) NOT NULL, `to` int(11) NOT NULL, `message` text NOT NULL, `time` int(11) NOT NULL, `unread` tinyint(1) NOT NULL, PRIMARY KEY (`id`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ; +) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 AUTO_INCREMENT=1 ; -- -------------------------------------------------------- @@ -211,14 +207,14 @@ CREATE TABLE IF NOT EXISTS `pms` ( -- CREATE TABLE IF NOT EXISTS `reports` ( - `id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT, + `id` int(11) unsigned NOT NULL AUTO_INCREMENT, `time` int(11) NOT NULL, - `ip` varchar(45) NOT NULL, - `board` varchar(120) DEFAULT NULL, + `ip` varchar(39) CHARACTER SET ascii NOT NULL, + `board` varchar(58) CHARACTER SET utf8 DEFAULT NULL, `post` int(11) NOT NULL, `reason` text NOT NULL, PRIMARY KEY (`id`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ; +) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 AUTO_INCREMENT=1 ; -- -------------------------------------------------------- @@ -227,9 +223,9 @@ CREATE TABLE IF NOT EXISTS `reports` ( -- CREATE TABLE IF NOT EXISTS `robot` ( - `hash` varchar(40) NOT NULL COMMENT 'SHA1', + `hash` varchar(40) COLLATE ascii_bin NOT NULL COMMENT 'SHA1', PRIMARY KEY (`hash`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8; +) ENGINE=MyISAM DEFAULT CHARSET=ascii COLLATE=ascii_bin; -- -------------------------------------------------------- @@ -254,7 +250,7 @@ CREATE TABLE IF NOT EXISTS `theme_settings` ( `name` varchar(40) DEFAULT NULL, `value` text, KEY `theme` (`theme`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8; +) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4; /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; diff --git a/js/expand.js b/js/expand.js index 6371f92c..44f5ae80 100644 --- a/js/expand.js +++ b/js/expand.js @@ -3,7 +3,7 @@ * https://github.com/savetheinternet/Tinyboard/blob/master/js/expand.js * * Released under the MIT license - * Copyright (c) 2012 Michael Save <savetheinternet@tinyboard.org> + * Copyright (c) 2012-2013 Michael Save <savetheinternet@tinyboard.org> * * Usage: * $config['additional_javascript'][] = 'js/jquery.min.js'; @@ -14,8 +14,8 @@ $(document).ready(function(){ if($('div.banner').length != 0) return; // not index - - $('div.post.op span.omitted').each(function() { + + var do_expand = function() { $(this) .html($(this).text().replace(_("Click reply to view."), '<a href="javascript:void(0)">'+_("Click to expand")+'</a>.')) .find('a').click(function() { @@ -27,15 +27,17 @@ $(document).ready(function(){ success: function(data) { var last_expanded = false; $(data).find('div.post.reply').each(function() { - if($('#' + $(this).attr('id')).length == 0) { + var post_in_doc = thread.find('#' + $(this).attr('id')); + if(post_in_doc.length == 0) { if(last_expanded) { $(this).addClass('expanded').insertAfter(last_expanded).before('<br class="expanded">'); } else { $(this).addClass('expanded').insertAfter(thread.find('div.post:first')).after('<br class="expanded">'); } last_expanded = $(this); - $(document).trigger('new_post', this); + } else { + last_expanded = post_in_doc; } }); $('<span class="omitted"><a href="javascript:void(0)">' + _('Hide expanded replies') + '</a>.</span>') @@ -48,5 +50,13 @@ $(document).ready(function(){ } }); }); + } + + $('div.post.op span.omitted').each(do_expand); + + $(document).bind("new_post", function(e, post) { + if (!$(post).hasClass("reply")) { + $(post).find('div.post.op span.omitted').each(do_expand); + } }); }); diff --git a/js/hide-images.js b/js/hide-images.js new file mode 100644 index 00000000..365ebac6 --- /dev/null +++ b/js/hide-images.js @@ -0,0 +1,84 @@ +/* + * hide-images.js + * https://github.com/savetheinternet/Tinyboard/blob/master/js/hide-images.js + * + * Hide individual images. + * + * Released under the MIT license + * Copyright (c) 2013 Michael Save <savetheinternet@tinyboard.org> + * + * Usage: + * $config['additional_javascript'][] = 'js/jquery.min.js'; + * $config['additional_javascript'][] = 'js/hide-images.js'; + * + */ + +$(document).ready(function(){ + $('<style type="text/css"> img.hidden{ opacity: 0.1; background: grey; border: 1px solid #000; } </style>').appendTo($('head')); + + var board = $('form input[name="board"]').val().toString(); + + if (!localStorage.hiddenimages) + localStorage.hiddenimages = '{}'; + + // Load data from HTML5 localStorage + var hidden_data = JSON.parse(localStorage.hiddenimages); + + var store_data = function() { + localStorage.hiddenimages = JSON.stringify(hidden_data); + }; + + // Delete old hidden images (30+ days old) + for (var key in hidden_data) { + for (var id in hidden_data[key]) { + if (hidden_data[key][id] < Math.round(Date.now() / 1000) - 60 * 60 * 24 * 30) { + delete hidden_data[key][id]; + store_data(); + } + } + } + + if (!hidden_data[board]) { + hidden_data[board] = {}; // id : timestamp + } + + $('div.post > a > img, div > a > img').each(function() { + var img = this; + var fileinfo = $(this).parent().prev(); + var id = $(this).parent().parent().find('>p.intro>a.post_no:eq(1),>div.post.op>p.intro>a.post_no:eq(1)').text(); + + var replacement = $('<span>'+_('File')+' <small>(<a class="hide-image-link" href="javascript:void(0)">'+_('hide')+'</a>)</small>: </span>'); + + replacement.find('a').click(function() { + hidden_data[board][id] = Math.round(Date.now() / 1000); + store_data(); + + var show_link = $('<a class="show-image-link" href="javascript:void(0)">'+_('show')+'</a>').click(function() { + delete hidden_data[board][id]; + store_data(); + + $(img) + .removeClass('hidden') + .attr('src', $(img).data('orig')); + $(this).prev().show(); + $(this).remove(); + }); + + $(this).hide().after(show_link); + + if ($(img).parent()[0].dataset.expanded == 'true') { + $(img).parent().click(); + } + $(img) + .data('orig', img.src) + .attr('src', 'data:image/gif;base64,R0lGODlhAQABAIAAAAAAAAAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==') + .addClass('hidden'); + }); + + $(this).parent().prev().contents().first().replaceWith(replacement); + + if (hidden_data[board][id]) + $(this).parent().prev().find('.hide-image-link').click(); + + }); +}); diff --git a/js/hide-threads.js b/js/hide-threads.js new file mode 100644 index 00000000..44bd829b --- /dev/null +++ b/js/hide-threads.js @@ -0,0 +1,83 @@ +/* + * hide-threads.js + * https://github.com/savetheinternet/Tinyboard/blob/master/js/hide-threads.js + * + * Released under the MIT license + * Copyright (c) 2013 Michael Save <savetheinternet@tinyboard.org> + * + * Usage: + * $config['additional_javascript'][] = 'js/jquery.min.js'; + * $config['additional_javascript'][] = 'js/hide-threads.js'; + * + */ + +$(document).ready(function(){ + if (active_page != "index" && active_page != "ukko") + return; // not index + + if (!localStorage.hiddenthreads) + localStorage.hiddenthreads = '{}'; + + // Load data from HTML5 localStorage + var hidden_data = JSON.parse(localStorage.hiddenthreads); + + var store_data = function() { + localStorage.hiddenthreads = JSON.stringify(hidden_data); + }; + + // Delete old hidden threads (7+ days old) + for (var key in hidden_data) { + for (var id in hidden_data[key]) { + if (hidden_data[key][id] < Math.round(Date.now() / 1000) - 60 * 60 * 24 * 7) { + delete hidden_data[key][id]; + store_data(); + } + } + } + + var do_hide_threads = function() { + var id = $(this).children('p.intro').children('a.post_no:eq(1)').text(); + var thread_container = $(this).parent(); + + var board = thread_container.data("board"); + + if (!hidden_data[board]) { + hidden_data[board] = {}; // id : timestamp + } + + $('<a class="hide-thread-link" style="float:left;margin-right:5px" href="javascript:void(0)">[–]</a><span> </span>') + .insertBefore(thread_container.find(':not(h2,h2 *):first')) + .click(function() { + hidden_data[board][id] = Math.round(Date.now() / 1000); + store_data(); + + thread_container.find('div.post,img,p.fileinfo,a.hide-thread-link,br').hide(); + + var hidden_div = thread_container.find('div.post.op > p.intro').clone(); + hidden_div.addClass('thread-hidden'); + hidden_div.find('a[href]:not([href$=".html"]),input').remove(); + hidden_div.html(hidden_div.html().replace(' [] ', ' ')); + hidden_div.html(hidden_div.html().replace(' [] ', ' ')); + + $('<a class="unhide-thread-link" style="float:left;margin-right:5px;margin-left:0px;" href="javascript:void(0)">[+]</a><span> </span>') + .insertBefore(hidden_div.find(':first')) + .click(function() { + delete hidden_data[board][id]; + store_data(); + thread_container.find('div.post,img,p.fileinfo,a.hide-thread-link,br').show(); + $(this).remove(); + hidden_div.remove(); + }); + + hidden_div.insertAfter(thread_container.find(':not(h2,h2 *):first')); + }); + if (hidden_data[board][id]) + thread_container.find('.hide-thread-link').click(); + } + + $('div.post.op').each(do_hide_threads); + + $(document).bind('new_post', function(e, post) { + do_hide_threads.call($(post).find('div.post.op')[0]); + }); +}); diff --git a/js/imgcaptcha.js b/js/imgcaptcha.js deleted file mode 100644 index 99aad414..00000000 --- a/js/imgcaptcha.js +++ /dev/null @@ -1,12 +0,0 @@ -function ic_odswiezKapcze() { - $.get(configRoot + "imgcaptcha_p.php", function(data) { - $("#imgcaptcha_hash").val(data); - $("#imgcaptcha_img").prop("src",configRoot + "imgcaptcha_im.php?cr=" + data); - }); -} -//function resetujKapcze() { -// $("#imgcaptcha_img").prop("src",configRoot + "zakrytek.png"); -//} -//$(document).ready(function(){ -// //resetujKapcze(); - to nie powinno byc na razie potrzebne -//}); diff --git a/js/inline-expanding-filename.js b/js/inline-expanding-filename.js new file mode 100644 index 00000000..048a0e1a --- /dev/null +++ b/js/inline-expanding-filename.js @@ -0,0 +1,33 @@ +/* + * inline-expanding-filename.js + * Binds image filename link to expanding, to make kusaba x users somewhat more accustomed. + * https://github.com/vichan-devel/Tinyboard/blob/master/js/inline-expanding.js + * + * Released under the MIT license + * Copyright (c) 2012-2013 Marcin Łabanowski <marcin@6irc.net> + * + * Usage: + * $config['additional_javascript'][] = 'js/jquery.min.js'; + * $config['additional_javascript'][] = 'js/inline-expanding.js'; + * $config['additional_javascript'][] = 'js/inline-expanding-filename.js'; + * + */ + +onready(function(){ + var inline_expanding_filename = function() { + $(this).find(".fileinfo > a").click(function(){ + var imagelink = $(this).parent().parent().find('a[target="_blank"]:first'); + if(imagelink.length > 0) { + imagelink.click(); + return false; + } + }); + }; + + $('div[id^="thread_"]').each(inline_expanding_filename); + + // allow to work with auto-reload.js, etc. + $(document).bind('new_post', function(e, post) { + inline_expanding_filename.call(post); + }); +}); diff --git a/js/inline-expanding.js b/js/inline-expanding.js index 7c9923fa..398db181 100644 --- a/js/inline-expanding.js +++ b/js/inline-expanding.js @@ -3,10 +3,10 @@ * https://github.com/savetheinternet/Tinyboard/blob/master/js/inline-expanding.js * * Released under the MIT license - * Copyright (c) 2012 Michael Save <savetheinternet@tinyboard.org> + * Copyright (c) 2012-2013 Michael Save <savetheinternet@tinyboard.org> * * Usage: - * $config['additional_javascript'][] = 'js/jquery.min.js'; + * // $config['additional_javascript'][] = 'js/jquery.min.js'; * $config['additional_javascript'][] = 'js/inline-expanding.js'; * */ @@ -14,30 +14,40 @@ onready(function(){ var inline_expand_post = function() { var link = this.getElementsByTagName('a'); - - for(var i = 0; i < link.length; i++) { - if(typeof link[i] == "object" && typeof link[i].childNodes[0] !== 'undefined' && link[i].childNodes[0].src && link[i].className != 'file') { + + for (var i = 0; i < link.length; i++) { + if (typeof link[i] == "object" && link[i].childNodes && typeof link[i].childNodes[0] !== 'undefined' && link[i].childNodes[0].src && link[i].className != 'file') { + if (window.jQuery && !$(link).prev().hasClass('fileinfo')) { + continue; + } link[i].childNodes[0].style.maxWidth = '95%'; link[i].onclick = function(e) { - if(e.which == 2) { + if (this.childNodes[0].className == 'hidden') + return false; + if (e.which == 2 || e.metaKey) return true; - } - if(!this.tag) { - this.tag = this.childNodes[0].src; + if (!this.dataset.src) { + this.dataset.expanded = 'true'; + this.dataset.src= this.childNodes[0].src; + this.dataset.width = this.childNodes[0].style.width; + this.dataset.height = this.childNodes[0].style.height; this.childNodes[0].src = this.href; this.childNodes[0].style.width = 'auto'; this.childNodes[0].style.height = 'auto'; this.childNodes[0].style.opacity = '0.4'; this.childNodes[0].style.filter = 'alpha(opacity=40)'; this.childNodes[0].onload = function() { - this.style.opacity = '1'; - this.style.filter = ''; + this.style.opacity = ''; + delete this.style.filter; } } else { - this.childNodes[0].src = this.tag; - this.childNodes[0].style.width = 'auto'; - this.childNodes[0].style.height = 'auto'; - this.tag = ''; + this.childNodes[0].src = this.dataset.src; + this.childNodes[0].style.width = this.dataset.width; + this.childNodes[0].style.height = this.dataset.height; + delete this.dataset.expanded; + delete this.dataset.src; + delete this.childNodes[0].style.opacity; + delete this.childNodes[0].style.filter; } return false; } @@ -45,11 +55,14 @@ onready(function(){ } } - $('div[id^="thread_"]').each(inline_expand_post); - - // allow to work with auto-reload.js, etc. - $(document).bind('new_post', function(e, post) { - inline_expand_post.call(post); - }); -}); + if (window.jQuery) { + $('div[id^="thread_"]').each(inline_expand_post); + // allow to work with auto-reload.js, etc. + $(document).bind('new_post', function(e, post) { + inline_expand_post.call(post); + }); + } else { + inline_expand_post.call(document); + } +}); diff --git a/js/local-time.js b/js/local-time.js index a4e2fb51..d581e304 100644 --- a/js/local-time.js +++ b/js/local-time.js @@ -6,7 +6,7 @@ * Copyright (c) 2012 Michael Save <savetheinternet@tinyboard.org> * * Usage: - * $config['additional_javascript'][] = 'js/jquery.min.js'; + * // $config['additional_javascript'][] = 'js/jquery.min.js'; * $config['additional_javascript'][] = 'js/local-time.js'; * */ @@ -44,10 +44,12 @@ onready(function(){ }; do_localtime(document); - - // allow to work with auto-reload.js, etc. - $(document).bind('new_post', function(e, post) { - do_localtime(post); - }); + + if (window.jQuery) { + // allow to work with auto-reload.js, etc. + $(document).bind('new_post', function(e, post) { + do_localtime(post); + }); + } }); diff --git a/js/post-hider.js b/js/post-hider.js index 742c21bc..693c14d6 100644..120000 --- a/js/post-hider.js +++ b/js/post-hider.js @@ -1,53 +1 @@ -function phGetCookieName(board, id) { - return "ph_hide_" + board + "_" + id; -} -function phPostHidden(board, id) { - return (localStorage.getItem(phGetCookieName(board, id)) != null); -} -function phPostToggle(board, id) { - if(phPostHidden(board, id)) { localStorage.removeItem(phGetCookieName(board, id)); } - else { localStorage.setItem(phGetCookieName(board, id),"yes"); } -} -function phGetInnerText(board, id) { - if(phPostHidden(board, id)) { return "[+]"; } - else { return "[–]"; } -} -function phGetOpID(element) { - return Number(element.children("div.post.op").children("p.intro").children("a.post_no.p2").text()); -} -function phGetOpBoard(element) { - return element.data("board"); -} -function phPostHandle(element) { - var id = phGetOpID(element); - var board = phGetOpBoard(element); - var preplies = element.children("div.post.reply"); - var pbody = element.children("div.post.op").children("div.body"); - var pimage = element.children("a:first").children("img"); - var pbutton = element.children("div.post.op").children("p.intro").children("a.posthider"); - var pomitted = element.children("div.post.op").children("span.omitted"); - if(phPostHidden(board, id)) { element.addClass("thread-hidden"); pomitted.hide(); preplies.hide(); pbody.hide(); pimage.hide(); pbutton.text("[+]"); } - else { element.removeClass("thread-hidden"); pomitted.show(); preplies.show(); pbody.show(); pimage.show(); pbutton.text("[–]"); } -} - -function phHandleThread(index, element) { - // Get thread ID. - var pin = $(this).children("div.post.op").children("p.intro"); - var tid = phGetOpID($(this)); - if(tid != NaN) { - $("<a href='javascript:;' class='posthider'>[?]</a>").insertAfter(pin.children('a:last')).click(function(e) { - var eO = $(e.target); - var par = eO.parent().parent().parent(); - phPostToggle(phGetOpBoard(par), phGetOpID(par)); - phPostHandle(par); - return false; - }); - phPostHandle($(this)); - } -} - -$(document).ready(function(){ - if (active_page != "thread") { - $('form[name="postcontrols"] > div[id^="thread"]').each(phHandleThread); - } -}); +hide-threads.js
\ No newline at end of file diff --git a/js/post-hover.js b/js/post-hover.js index 48f0ed96..040b6a73 100644 --- a/js/post-hover.js +++ b/js/post-hover.js @@ -17,13 +17,28 @@ onready(function(){ var $link = $(this); var id; - - if(id = $link.text().match(/^>>(\d+)$/)) { - id = id[1]; + var matches; + + if(matches = $link.text().match(/^>>(?:>\/([^\/]+)\/)?(\d+)$/)) { + id = matches[2]; } else { return; } + var board = $(this); + while (board.data('board') === undefined) { + board = board.parent(); + } + var threadid = board.attr('id').replace("thread_", ""); + board = board.data('board'); + + var parentboard = board; + + if (matches[1] !== undefined) { + board = matches[1]; + } + + var $post = false; var hovering = false; var hovered_at; @@ -32,28 +47,34 @@ onready(function(){ hovered_at = {'x': e.pageX, 'y': e.pageY}; var start_hover = function($link) { - if($post.is(':visible') && + if($.contains($post[0], $link[0])) { + // link links to itself or to op; ignore + } + else if($post.is(':visible') && $post.offset().top + $post.height() >= $(window).scrollTop() && - $post.offset().top <= $(window).scrollTop() + $(window).height() - ) { + $post.offset().top <= $(window).scrollTop() + $(window).height()) { // post is in view $post.attr('style', 'border-style: none dashed dashed none; background: ' + $post.css('border-right-color')); } else { var $newPost = $post.clone(); + $newPost.find('>.reply, >br').remove(); $newPost.find('span.mentioned').remove(); + $newPost .attr('id', 'post-hover-' + id) + .attr('data-board', board) .addClass('post-hover') .css('position', 'absolute') .css('border-style', 'solid') .css('box-shadow', '1px 1px 1px #999') .css('display', 'block') - .insertAfter($link.parent()); + .addClass('reply').addClass('post') + .insertAfter($link.parent()) $link.trigger('mousemove'); } }; - $post = $('div.post#reply_' + id); + $post = $('[data-board="' + board + '"] div.post#reply_' + id + ', [data-board="' + board + '"]div#thread_' + id); if($post.length > 0) { start_hover($(this)); } else { @@ -68,13 +89,27 @@ onready(function(){ url: url, context: document.body, success: function(data) { - $(data).find('div.post.reply').each(function() { - if($('#' + $(this).attr('id')).length == 0) - $('div.post:first').prepend($(this).css('display', 'none').addClass('hidden')); + var mythreadid = $(data).find('div[id^="thread_"]').attr('id').replace("thread_", ""); - }); + if (mythreadid == threadid && parentboard == board) { + $(data).find('div.post.reply').each(function() { + if($('[data-board="' + board + '"] #' + $(this).attr('id')).length == 0) { + $('[data-board="' + board + '"]#thread_' + threadid + " .post.reply:first").before($(this).hide().addClass('hidden')); + } + }); + } + else if ($('[data-board="' + board + '"]#thread_'+mythreadid).length > 0) { + $(data).find('div.post.reply').each(function() { + if($('[data-board="' + board + '"] #' + $(this).attr('id')).length == 0) { + $('[data-board="' + board + '"]#thread_' + mythreadid + " .post.reply:first").before($(this).hide().addClass('hidden')); + } + }); + } + else { + $(data).find('div[id^="thread_"]').hide().attr('data-cached', 'yes').prependTo('form[name="postcontrols"]'); + } - $post = $('div.post#reply_' + id); + $post = $('[data-board="' + board + '"] div.post#reply_' + id + ', [data-board="' + board + '"]div#thread_' + id); if(hovering && $post.length > 0) { start_hover($link); } @@ -87,14 +122,14 @@ onready(function(){ return; $post.attr('style', ''); - if($post.hasClass('hidden')) + if($post.hasClass('hidden') || $post.data('cached') == 'yes') $post.css('display', 'none'); $('.post-hover').remove(); }).mousemove(function(e) { if(!$post) return; - var $hover = $('#post-hover-' + id); + var $hover = $('#post-hover-' + id + '[data-board="' + board + '"]'); if($hover.length == 0) return; diff --git a/js/quick-post-controls.js b/js/quick-post-controls.js index c28f874f..1cbc0711 100644 --- a/js/quick-post-controls.js +++ b/js/quick-post-controls.js @@ -71,10 +71,16 @@ $(document).ready(function(){ } }; - $('div.post input[type=checkbox].delete').each(function() { + var init_qpc = function() { $(this).change(open_form); if(this.checked) $(this).trigger('change'); + }; + + $('div.post input[type=checkbox].delete').each(init_qpc); + + $(document).bind('new_post', function(e, post) { + $(post).find('input[type=checkbox].delete').each(init_qpc); }); }); diff --git a/js/show-backlinks.js b/js/show-backlinks.js index 4ead494b..f23cfc38 100644 --- a/js/show-backlinks.js +++ b/js/show-backlinks.js @@ -48,7 +48,12 @@ onready(function(){ $('div.post.reply').each(showBackLinks); $(document).bind('new_post', function(e, post) { - showBackLinks.call(post); + if ($(post).hasClass("reply")) { + showBackLinks.call(post); + } + else { + $(post).find('div.post.reply').each(showBackLinks); + } }); }); diff --git a/js/style-select.js b/js/style-select.js new file mode 100644 index 00000000..6dcb11e4 --- /dev/null +++ b/js/style-select.js @@ -0,0 +1,44 @@ +/* + * style-select.js + * https://github.com/savetheinternet/Tinyboard/blob/master/js/style-select.js + * + * Changes the stylesheet chooser links to a <select> + * + * Released under the MIT license + * Copyright (c) 2013 Michael Save <savetheinternet@tinyboard.org> + * + * Usage: + * $config['additional_javascript'][] = 'js/jquery.min.js'; + * $config['additional_javascript'][] = 'js/style-select.js'; + * + */ + +onready(function(){ + var stylesDiv = $('div.styles'); + var stylesSelect = $('<select></select>'); + + var i = 1; + stylesDiv.children().each(function() { + var opt = $('<option></option>') + .html(this.innerHTML.replace(/(^\[|\]$)/g, '')) + .val(i); + if ($(this).hasClass('selected')) + opt.attr('selected', true); + stylesSelect.append(opt); + $(this).attr('id', 'style-select-' + i); + i++; + }); + + stylesSelect.change(function() { + $('#style-select-' + $(this).val()).click(); + }); + + stylesDiv.hide(); + + stylesDiv.after( + $('<div id="style-select" style="float:right;margin-bottom:10px"></div>') + .text(_('Style: ')) + .append(stylesSelect) + ); +}); + diff --git a/js/toggle-images.js b/js/toggle-images.js new file mode 100644 index 00000000..de1d47b3 --- /dev/null +++ b/js/toggle-images.js @@ -0,0 +1,77 @@ +/* + * toggle-images.js + * + * Released under the MIT license + * Copyright (c) 2012 Michael Save <savetheinternet@tinyboard.org> + * + * Usage: + * $config['additional_javascript'][] = 'js/jquery.min.js'; + * $config['additional_javascript'][] = 'js/toggle-images.js'; + * + */ + +$(document).ready(function(){ + var hide_images = localStorage['hideimages'] ? true : false; + + $('<style type="text/css"> img.hidden{ opacity: 0.1; background: grey; border: 1px solid #000; } </style>').appendTo($('head')); + + var hideImage = function() { + if ($(this).parent()[0].dataset.expanded == 'true') { + $(this).parent().click(); + } + $(this) + .attr('data-orig', this.src) + .attr('src', 'data:image/gif;base64,R0lGODlhAQABAIAAAAAAAAAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==') + .addClass('hidden'); + }; + + var restoreImage = function() { + $(this) + .attr('src', $(this).attr('data-orig')) + .removeClass('hidden'); + }; + + // Fix for hide-images.js + var show_hide_hide_images_buttons = function() { + if (hide_images) { + $('a.hide-image-link').each(function() { + if ($(this).next().hasClass('show-image-link')) { + $(this).next().hide(); + } + $(this).hide().after('<span class="toggle-images-placeholder">'+_('hidden')+'</span>'); + }); + } else { + $('span.toggle-images-placeholder').remove(); + $('a.hide-image-link').each(function() { + if ($(this).next().hasClass('show-image-link')) { + $(this).next().show(); + } else { + $(this).show(); + } + }); + } + }; + + $('hr:first').before('<div id="toggle-images" style="text-align:right"><a class="unimportant" href="javascript:void(0)">-</a></div>'); + $('div#toggle-images a') + .text(hide_images ? _('Show images') : _('Hide images')) + .click(function() { + hide_images = !hide_images; + if (hide_images) { + $('div > a > img').each(hideImage); + localStorage.hideimages = true; + } else { + $('div > a > img').each(restoreImage); + delete localStorage.hideimages; + } + + show_hide_hide_images_buttons(); + + $(this).text(hide_images ? _('Show images') : _('Hide images')) + }); + + if (hide_images) { + $('div > a > img').each(hideImage); + show_hide_hide_images_buttons(); + } +}); @@ -18,7 +18,7 @@ if (get_magic_quotes_gpc()) { $_POST = strip_array($_POST); } -$query = isset($_SERVER['QUERY_STRING']) ? $_SERVER['QUERY_STRING'] : ''; +$query = isset($_SERVER['QUERY_STRING']) ? rawurldecode($_SERVER['QUERY_STRING']) : ''; $pages = array( '' => ':?/', // redirect to dashboard @@ -28,7 +28,7 @@ $pages = array( '/users' => 'users', // manage users '/users/(\d+)' => 'user', // edit user - '/users/(\d+)/(promote|demote)' => 'user_promote', // prmote/demote user + '/users/(\d+)/(promote|demote)' => 'user_promote', // prmote/demote user '/users/new' => 'user_new', // create a new user '/new_PM/([^/]+)' => 'new_pm', // create a new pm '/PM/(\d+)(/reply)?' => 'pm', // read a pm @@ -36,7 +36,7 @@ $pages = array( '/noticeboard' => 'noticeboard', // view noticeboard '/noticeboard/(\d+)' => 'noticeboard', // view noticeboard - '/noticeboard/delete/(\d+)' => 'noticeboard_delete',// delete from noticeboard + '/noticeboard/delete/(\d+)' => 'noticeboard_delete', // delete from noticeboard '/log' => 'log', // modlog '/log/(\d+)' => 'log', // modlog '/log:([^/]+)' => 'user_log', // modlog @@ -45,7 +45,7 @@ $pages = array( '/news/(\d+)' => 'news', // view news '/news/delete/(\d+)' => 'news_delete', // delete from news - '/edit/([\w+.]+)' => 'edit_board', // edit board details + '/edit/(\%b)' => 'edit_board', // edit board details '/new-board' => 'new_board', // create a new board '/rebuild' => 'rebuild', // rebuild static files @@ -57,21 +57,21 @@ $pages = array( '/bans' => 'bans', // ban list '/bans/(\d+)' => 'bans', // ban list - '/search' => 'search_redirect', // search + '/search' => 'search_redirect', // search '/search/(posts|IP_notes|bans|log)/(.+)/(\d+)' => 'search', // search '/search/(posts|IP_notes|bans|log)/(.+)' => 'search', // search // CSRF-protected moderator actions - '/ban' => 'secure_POST ban', // new ban - '/([\w+.]+)/ban(&delete)?/(\d+)' => 'secure_POST ban_post', // ban poster - '/([\w+.]+)/move/(\d+)' => 'secure_POST move', // move thread - '/([\w+.]+)/edit(_raw)?/(\d+)' => 'secure_POST edit_post', // edit post - '/([\w+.]+)/delete/(\d+)' => 'secure delete', // delete post - '/([\w+.]+)/deletefile/(\d+)' => 'secure deletefile', // delete file from post - '/([\w+.]+)/deletebyip/(\d+)(/global)?' => 'secure deletebyip', // delete all posts by IP address - '/([\w+.]+)/(un)?lock/(\d+)' => 'secure lock', // lock thread - '/([\w+.]+)/(un)?sticky/(\d+)' => 'secure sticky', // sticky thread - '/([\w+.]+)/bump(un)?lock/(\d+)' => 'secure bumplock', // "bumplock" thread + '/ban' => 'secure_POST ban', // new ban + '/(\%b)/ban(&delete)?/(\d+)' => 'secure_POST ban_post', // ban poster + '/(\%b)/move/(\d+)' => 'secure_POST move', // move thread + '/(\%b)/edit(_raw)?/(\d+)' => 'secure_POST edit_post', // edit post + '/(\%b)/delete/(\d+)' => 'secure delete', // delete post + '/(\%b)/deletefile/(\d+)' => 'secure deletefile', // delete file from post + '/(\%b)/deletebyip/(\d+)(/global)?' => 'secure deletebyip', // delete all posts by IP address + '/(\%b)/(un)?lock/(\d+)' => 'secure lock', // lock thread + '/(\%b)/(un)?sticky/(\d+)' => 'secure sticky', // sticky thread + '/(\%b)/bump(un)?lock/(\d+)' => 'secure bumplock', // "bumplock" thread '/themes' => 'themes_list', // manage themes '/themes/(\w+)' => 'theme_configure', // configure/reconfigure theme @@ -79,6 +79,7 @@ $pages = array( '/themes/(\w+)/uninstall' => 'theme_uninstall', // uninstall theme '/config' => 'config', // config editor + '/config/(\%b)' => 'config', // config editor // these pages aren't listed in the dashboard without $config['debug'] '/debug/antispam' => 'debug_antispam', @@ -86,10 +87,10 @@ $pages = array( '/debug/sql' => 'secure_POST debug_sql', // This should always be at the end: - '/([\w+.]+)/' => 'view_board', - '/([\w+.]+)/' . preg_quote($config['file_index'], '!') => 'view_board', - '/([\w+.]+)/' . str_replace('%d', '(\d+)', preg_quote($config['file_page'], '!')) => 'view_board', - '/([\w+.]+)/' . preg_quote($config['dir']['res'], '!') . + '/(\%b)/' => 'view_board', + '/(\%b)/' . preg_quote($config['file_index'], '!') => 'view_board', + '/(\%b)/' . str_replace('%d', '(\d+)', preg_quote($config['file_page'], '!')) => 'view_board', + '/(\%b)/' . preg_quote($config['dir']['res'], '!') . str_replace('%d', '(\d+)', preg_quote($config['file_page'], '!')) => 'view_thread', ); @@ -109,7 +110,8 @@ $new_pages = array(); foreach ($pages as $key => $callback) { if (is_string($callback) && preg_match('/^secure /', $callback)) $key .= '(/(?P<token>[a-f0-9]{8}))?'; - $new_pages[@$key[0] == '!' ? $key : '!^' . $key . '(?:&[^&=]+=[^&]*)*$!'] = $callback; + $key = str_replace('\%b', '?P<board>' . sprintf(substr($config['board_path'], 0, -1), $config['board_regex']), $key); + $new_pages[@$key[0] == '!' ? $key : '!^' . $key . '(?:&[^&=]+=[^&]*)*$!u'] = $callback; } $pages = $new_pages; @@ -117,6 +119,15 @@ foreach ($pages as $uri => $handler) { if (preg_match($uri, $query, $matches)) { $matches = array_slice($matches, 1); + if (isset($matches['board'])) { + $board_match = $matches['board']; + unset($matches['board']); + $key = array_search($board_match, $matches); + if (preg_match('/^' . sprintf(substr($config['board_path'], 0, -1), '(' . $config['board_regex'] . ')') . '$/u', $matches[$key], $board_match)) { + $matches[$key] = $board_match[1]; + } + } + if (is_string($handler) && preg_match('/^secure(_POST)? /', $handler, $m)) { $secure_post_only = isset($m[1]); if (!$secure_post_only || $_SERVER['REQUEST_METHOD'] == 'POST') { @@ -6,7 +6,6 @@ require 'inc/functions.php'; require 'inc/anti-bot.php'; -require 'inc/imgcaptcha.php'; // Fix for magic quotes if (get_magic_quotes_gpc()) { @@ -49,11 +48,11 @@ if (isset($_POST['delete'])) { error($config['error']['nodelete']); foreach ($delete as &$id) { - $query = prepare(sprintf("SELECT `thread`, `time`,`password` FROM `posts_%s` WHERE `id` = :id", $board['uri'])); + $query = prepare(sprintf("SELECT `thread`, `time`,`password` FROM ``posts_%s`` WHERE `id` = :id", $board['uri'])); $query->bindValue(':id', $id, PDO::PARAM_INT); $query->execute() or error(db_error($query)); - if ($post = $query->fetch()) { + if ($post = $query->fetch(PDO::FETCH_ASSOC)) { if ($password != '' && $post['password'] != $password) error($config['error']['invalidpassword']); @@ -109,23 +108,23 @@ if (isset($_POST['delete'])) { if (count($report) > $config['report_limit']) error($config['error']['toomanyreports']); - $reason = &$_POST['reason']; + $reason = escape_markup_modifiers($_POST['reason']); markup($reason); foreach ($report as &$id) { - $query = prepare(sprintf("SELECT `thread` FROM `posts_%s` WHERE `id` = :id", $board['uri'])); + $query = prepare(sprintf("SELECT `thread` FROM ``posts_%s`` WHERE `id` = :id", $board['uri'])); $query->bindValue(':id', $id, PDO::PARAM_INT); $query->execute() or error(db_error($query)); - $post = $query->fetch(); + $thread = $query->fetchColumn(); - if ($post) { + if ($thread) { if ($config['syslog']) _syslog(LOG_INFO, 'Reported post: ' . - '/' . $board['dir'] . $config['dir']['res'] . sprintf($config['file_page'], $post['thread'] ? $post['thread'] : $id) . ($post['thread'] ? '#' . $id : '') . + '/' . $board['dir'] . $config['dir']['res'] . sprintf($config['file_page'], $thread ? $thread : $id) . ($thread ? '#' . $id : '') . ' for "' . $reason . '"' ); - $query = prepare("INSERT INTO `reports` VALUES (NULL, :time, :ip, :board, :post, :reason)"); + $query = prepare("INSERT INTO ``reports`` VALUES (NULL, :time, :ip, :board, :post, :reason)"); $query->bindValue(':time', time(), PDO::PARAM_INT); $query->bindValue(':ip', $_SERVER['REMOTE_ADDR'], PDO::PARAM_STR); $query->bindValue(':board', $board['uri'], PDO::PARAM_INT); @@ -173,7 +172,7 @@ if (isset($_POST['delete'])) { error($config['error']['bot']); // Check the referrer - if (!isset($_SERVER['HTTP_REFERER']) || !preg_match($config['referer_match'], $_SERVER['HTTP_REFERER'])) + if (!isset($_SERVER['HTTP_REFERER']) || !preg_match($config['referer_match'], urldecode($_SERVER['HTTP_REFERER']))) error($config['error']['referer']); checkDNSBL(); @@ -198,12 +197,7 @@ if (isset($_POST['delete'])) { error($config['error']['captcha']); } } - if ($config['imgcaptcha']) { - if (!isset($_POST['imgcaptcha_verify']) || !isset($_POST['imgcaptcha_hash'])) - error($config['error']['bot']); - if (ic_verifyHash($_POST['imgcaptcha_hash'],$_POST['imgcaptcha_verify'])) - error($config['error']['captcha']); - } + if ($post['mod'] = isset($_POST['mod']) && $_POST['mod']) { require 'inc/mod.php'; if (!$mod) { @@ -224,7 +218,7 @@ if (isset($_POST['delete'])) { } if (!$post['mod']) { - $post['antispam_hash'] = checkSpam(array($board['uri'], isset($post['thread']) && !($config['quick_reply'] && isset($_POST['quick-reply'])) ? $post['thread'] : null)); + $post['antispam_hash'] = checkSpam(array($board['uri'], isset($post['thread']) && !($config['quick_reply'] && isset($_POST['quick-reply'])) ? $post['thread'] : ($config['try_smarter'] && isset($_POST['page']) ? 0 - (int)$_POST['page'] : null))); if ($post['antispam_hash'] === true) error($config['error']['spam']); } @@ -235,11 +229,11 @@ if (isset($_POST['delete'])) { //Check if thread exists if (!$post['op']) { - $query = prepare(sprintf("SELECT `sticky`,`locked`,`sage` FROM `posts_%s` WHERE `id` = :id AND `thread` IS NULL LIMIT 1", $board['uri'])); + $query = prepare(sprintf("SELECT `sticky`,`locked`,`sage` FROM ``posts_%s`` WHERE `id` = :id AND `thread` IS NULL LIMIT 1", $board['uri'])); $query->bindValue(':id', $post['thread'], PDO::PARAM_INT); $query->execute() or error(db_error()); - if (!$thread = $query->fetch()) { + if (!$thread = $query->fetch(PDO::FETCH_ASSOC)) { // Non-existant error($config['error']['nonexistant']); } @@ -292,7 +286,7 @@ if (isset($_POST['delete'])) { $post['has_file'] = !isset($post['embed']) && (($post['op'] && !isset($post['no_longer_require_an_image_for_op']) && $config['force_image_op']) || (isset($_FILES['file']) && $_FILES['file']['tmp_name'] != '')); if ($post['has_file']) - $post['filename'] = utf8tohtml(get_magic_quotes_gpc() ? stripslashes($_FILES['file']['name']) : $_FILES['file']['name']); + $post['filename'] = urldecode(get_magic_quotes_gpc() ? stripslashes($_FILES['file']['name']) : $_FILES['file']['name']); if (!($post['has_file'] || isset($post['embed'])) || (($post['op'] && $config['force_body_op']) || (!$post['op'] && $config['force_body']))) { $stripped_whitespace = preg_replace('/[\s]/u', '', $post['body']); @@ -355,7 +349,7 @@ if (isset($_POST['delete'])) { } else $noko = false; if ($post['has_file']) { - $post['extension'] = strtolower(substr($post['filename'], strrpos($post['filename'], '.') + 1)); + $post['extension'] = strtolower(mb_substr($post['filename'], mb_strrpos($post['filename'], '.') + 1)); if (isset($config['filename_func'])) $post['file_id'] = $config['filename_func']($post); else @@ -365,6 +359,13 @@ if (isset($_POST['delete'])) { $post['thumb'] = $board['dir'] . $config['dir']['thumb'] . $post['file_id'] . '.' . ($config['thumb_ext'] ? $config['thumb_ext'] : $post['extension']); } + if ($config['strip_combining_chars']) { + $post['name'] = strip_combining_chars($post['name']); + $post['email'] = strip_combining_chars($post['email']); + $post['subject'] = strip_combining_chars($post['subject']); + $post['body'] = strip_combining_chars($post['body']); + } + // Check string lengths if (mb_strlen($post['name']) > 35) error(sprintf($config['error']['toolong'], 'name')); @@ -376,13 +377,32 @@ if (isset($_POST['delete'])) { error($config['error']['toolong_body']); if (mb_strlen($post['password']) > 20) error(sprintf($config['error']['toolong'], 'password')); - + wordfilters($post['body']); + $post['body'] = escape_markup_modifiers($post['body']); - $post['body_nomarkup'] = $post['body']; + if ($mod && isset($post['raw']) && $post['raw']) { + $post['body'] = '<tinyboard raw html>' . $post['body'] . '</tinyboard>'; + } + + if (mysql_version() >= 50503) { + $post['body_nomarkup'] = $post['body']; // Assume we're using the utf8mb4 charset + } else { + // MySQL's `utf8` charset only supports up to 3-byte symbols + // Remove anything >= 0x010000 + + $chars = preg_split('//u', $post['body'], -1, PREG_SPLIT_NO_EMPTY); + $post['body_nomarkup'] = ''; + foreach ($chars as $char) { + $o = 0; + $ord = ordutf8($char, $o); + if ($ord >= 0x010000) + continue; + $post['body_nomarkup'] .= $char; + } + } - if (!($mod && isset($post['raw']) && $post['raw'])) - $post['tracked_cites'] = markup($post['body'], true); + $post['tracked_cites'] = markup($post['body'], true); // Check for a flood if (!hasPermission($config['mod']['flood'], $board['uri']) && checkFlood($post)) { @@ -400,7 +420,7 @@ if (isset($_POST['delete'])) { $is_an_image = !in_array($post['extension'], $config['allowed_ext_files']); // Truncate filename if it is too long - $post['filename'] = substr($post['filename'], 0, $config['max_filename_len']); + $post['filename'] = mb_substr($post['filename'], 0, $config['max_filename_len']); $upload = $_FILES['file']['tmp_name']; @@ -410,7 +430,7 @@ if (isset($_POST['delete'])) { $post['filehash'] = $config['file_hash']($upload); $post['filesize'] = filesize($upload); - if ($is_an_image) { + if ($is_an_image && $config['ie_mime_type_detection'] !== false) { // Check IE MIME type detection XSS exploit $buffer = file_get_contents($upload, null, null, null, 255); if (preg_match($config['ie_mime_type_detection'], $buffer)) { @@ -428,20 +448,47 @@ if (isset($_POST['delete'])) { error($config['error']['maxsize']); } - // The following code corrects the image orientation based on EXIF. - // Currently only works with the 'convert' option selected but it could easily be expanded to work with the rest if you can be bothered. - if ($config['thumb_method'] == 'convert') { - if ($post['extension'] == 'jpg' || $post['extension'] == 'jpeg') { - $exif = exif_read_data($upload); - if (isset($exif['Orientation']) && $exif['Orientation'] != 1) { - shell_exec('convert ' . escapeshellarg($upload) . ' -auto-orient ' . escapeshellarg($upload)); + + if ($config['convert_auto_orient'] && ($post['extension'] == 'jpg' || $post['extension'] == 'jpeg')) { + // The following code corrects the image orientation. + // Currently only works with the 'convert' option selected but it could easily be expanded to work with the rest if you can be bothered. + if (!($config['redraw_image'] || (($config['strip_exif'] && !$config['use_exiftool']) && ($post['extension'] == 'jpg' || $post['extension'] == 'jpeg')))) { + if (in_array($config['thumb_method'], array('convert', 'convert+gifsicle', 'gm', 'gm+gifsicle'))) { + $exif = @exif_read_data($upload); + $gm = in_array($config['thumb_method'], array('gm', 'gm+gifsicle')); + if (isset($exif['Orientation']) && $exif['Orientation'] != 1) { + if ($config['convert_manual_orient']) { + $error = shell_exec_error(($gm ? 'gm ' : '') . 'convert ' . + escapeshellarg($upload) . ' ' . + ImageConvert::jpeg_exif_orientation(false, $exif) . ' ' . + ($config['strip_exif'] ? '+profile "*"' : + ($config['use_exiftool'] ? '' : '+profile "*"') + ) . ' ' . + escapeshellarg($upload)); + if ($config['use_exiftool'] && !$config['strip_exif']) { + if ($exiftool_error = shell_exec_error( + 'exiftool -q -orientation=1 -n ' . escapeshellarg($upload))) + error('exiftool failed!', null, $exiftool_error); + } else { + // TODO: Find another way to remove the Orientation tag from the EXIF profile + // without needing `exiftool`. + } + } else { + $error = shell_exec_error(($gm ? 'gm ' : '') . 'convert ' . + escapeshellarg($upload) . ' -auto-orient ' . escapeshellarg($upload)); + } + if ($error) + error('Could not auto-orient image!', null, $error); + $size = @getimagesize($upload); + if ($config['strip_exif']) + $post['exif_stripped'] = true; + } } } } // create image object - $image = new Image($upload, $post['extension']); - + $image = new Image($upload, $post['extension'], $size); if ($image->size->width > $config['max_width'] || $image->size->height > $config['max_height']) { $image->delete(); error($config['error']['maxsize']); @@ -481,9 +528,14 @@ if (isset($_POST['delete'])) { $thumb->_destroy(); } - if ($config['redraw_image']) { - $image->to($post['file']); - $dont_copy_file = true; + if ($config['redraw_image'] || (!@$post['exif_stripped'] && $config['strip_exif'] && ($post['extension'] == 'jpg' || $post['extension'] == 'jpeg'))) { + if (!$config['redraw_image'] && $config['use_exiftool']) { + if($error = shell_exec_error('exiftool -ignoreMinorErrors -q -q -all= ' . escapeshellarg($upload))) + error('Could not strip EXIF metadata!', null, $error); + } else { + $image->to($post['file']); + $dont_copy_file = true; + } } $image->destroy(); } else { @@ -497,7 +549,7 @@ if (isset($_POST['delete'])) { } if (!isset($dont_copy_file) || !$dont_copy_file) { - if (!@move_uploaded_file($_FILES['file']['tmp_name'], $post['file'])) + if (!@move_uploaded_file($upload, $post['file'])) error($config['error']['nomove']); } } @@ -544,9 +596,9 @@ if (isset($_POST['delete'])) { // Remove board directories before inserting them into the database. if ($post['has_file']) { $post['file_path'] = $post['file']; - $post['file'] = substr_replace($post['file'], '', 0, mb_strlen($board['dir'] . $config['dir']['img'])); + $post['file'] = mb_substr($post['file'], mb_strlen($board['dir'] . $config['dir']['img'])); if ($is_an_image && $post['thumb'] != 'spoiler') - $post['thumb'] = substr_replace($post['thumb'], '', 0, mb_strlen($board['dir'] . $config['dir']['thumb'])); + $post['thumb'] = mb_substr($post['thumb'], mb_strlen($board['dir'] . $config['dir']['thumb'])); } $post = (object)$post; @@ -564,7 +616,7 @@ if (isset($_POST['delete'])) { if (isset($post['tracked_cites'])) { foreach ($post['tracked_cites'] as $cite) { - $query = prepare('INSERT INTO `cites` VALUES (:board, :post, :target_board, :target)'); + $query = prepare('INSERT INTO ``cites`` VALUES (:board, :post, :target_board, :target)'); $query->bindValue(':board', $board['uri']); $query->bindValue(':post', $id, PDO::PARAM_INT); $query->bindValue(':target_board',$cite[0]); @@ -573,12 +625,15 @@ if (isset($_POST['delete'])) { } } - buildThread($post['op'] ? $id : $post['thread']); - if (!$post['op'] && strtolower($post['email']) != 'sage' && !$thread['sage'] && ($config['reply_limit'] == 0 || $numposts['replies']+1 < $config['reply_limit'])) { bumpThread($post['thread']); } + buildThread($post['op'] ? $id : $post['thread']); + + if ($config['try_smarter'] && $post['op']) + $build_pages = range(1, $config['max_pages']); + if ($post['op']) clean(); @@ -17,21 +17,21 @@ $phrase = $_GET['search']; $_body = ''; - $query = prepare("SELECT COUNT(*) FROM `search_queries` WHERE `ip` = :ip AND `time` > :time"); + $query = prepare("SELECT COUNT(*) FROM ``search_queries`` WHERE `ip` = :ip AND `time` > :time"); $query->bindValue(':ip', $_SERVER['REMOTE_ADDR']); $query->bindValue(':time', time() - ($queries_per_minutes[1] * 60)); $query->execute() or error(db_error($query)); if($query->fetchColumn() > $queries_per_minutes[0]) error(_('Wait a while before searching again, please.')); - $query = prepare("SELECT COUNT(*) FROM `search_queries` WHERE `time` > :time"); + $query = prepare("SELECT COUNT(*) FROM ``search_queries`` WHERE `time` > :time"); $query->bindValue(':time', time() - ($queries_per_minutes_all[1] * 60)); $query->execute() or error(db_error($query)); if($query->fetchColumn() > $queries_per_minutes_all[0]) error(_('Wait a while before searching again, please.')); - $query = prepare("INSERT INTO `search_queries` VALUES (:ip, :time, :query)"); + $query = prepare("INSERT INTO ``search_queries`` VALUES (:ip, :time, :query)"); $query->bindValue(':ip', $_SERVER['REMOTE_ADDR']); $query->bindValue(':time', time()); $query->bindValue(':query', $phrase); @@ -40,7 +40,7 @@ _syslog(LOG_NOTICE, 'Searched /' . $_GET['board'] . '/ for "' . $phrase . '"'); // Cleanup search queries table - $query = prepare("DELETE FROM `search_queries` WHERE `time` <= :time"); + $query = prepare("DELETE FROM ``search_queries`` WHERE `time` <= :time"); $query->bindValue(':time', time() - ($queries_per_minutes_all[1] * 60)); $query->execute() or error(db_error($query)); @@ -85,6 +85,9 @@ // Use asterisk as wildcard to suit convention $phrase = str_replace('*', '%', $phrase); + // Remove `, it's used by table prefix magic + $phrase = str_replace('`', '!`', $phrase); + $like = ''; $match = Array(); @@ -119,7 +122,7 @@ $like = str_replace('%', '%%', $like); - $query = prepare(sprintf("SELECT * FROM `posts_%s` WHERE " . $like . " ORDER BY `time` DESC LIMIT :limit", $board['uri'])); + $query = prepare(sprintf("SELECT * FROM ``posts_%s`` WHERE " . $like . " ORDER BY `time` DESC LIMIT :limit", $board['uri'])); $query->bindValue(':limit', $search_limit, PDO::PARAM_INT); $query->execute() or error(db_error($query)); diff --git a/static/error.png b/static/error.png Binary files differdeleted file mode 100644 index f1ff27a8..00000000 --- a/static/error.png +++ /dev/null diff --git a/static/ok.png b/static/ok.png Binary files differdeleted file mode 100644 index cbe92c77..00000000 --- a/static/ok.png +++ /dev/null diff --git a/stylesheets/dark.css b/stylesheets/dark.css index 920debe8..0982c278 100644 --- a/stylesheets/dark.css +++ b/stylesheets/dark.css @@ -1,171 +1,176 @@ -/**
- * dark.css
- * For AwsumChan by Circlepuller
- */
-body {
- background: #1E1E1E;
- color: #999999;
- font-family: sans-serif;
- font-size: 12px;
-}
-span.quote {
- color:#B8D962;
-}
-h1 {
- font-size: 20pt;
- text-align: center;
- letter-spacing: 0px;
-}
-div.title, h1 {
- color: #32DD72;
- font-family: Arial, Helvetica, sans-serif;
-}
-div.title p {
- font-size: 10px;
-}
-a:link, a:visited, p.intro a.email span.name {
- color: #CCCCCC;
- text-decoration: underline;
- font-family: sans-serif;
-}
-a:link:hover, a:visited:hover {
- color: #fff;
- font-family: sans-serif;
- text-decoration: underline overline;
-
-}
-a.post_no {
- color: #AAAAAA;
- text-decoration: none;
-}
-a.post_no:hover {
- color: #32DD72 !important;
- text-decoration: underline overline;
-}
-div.post.reply {
- background: #333333;
- border: #555555 1px solid;
-}
-div.post.reply.highlighted {
- background: transparent;
- border: transparent 1px solid;
-}
-div.post.reply div.body a:link, div.post.reply div.body a:visited {
- color: #CCCCCC;
-}
-div.post.reply div.body a:link:hover, div.post.reply div.body a:visited:hover {
- color: #32DD72;
-}
-p.intro span.subject {
- font-size: 12px;
- font-family: sans-serif;
- color: #446655;
- font-weight: 800;
-}
-p.intro span.name {
- color: #32DD72;
- font-weight: 800;
-}
-p.intro a.capcode, p.intro a.nametag {
- color: magenta;
- margin-left: 0;
-}
-p.intro a.email, p.intro a.email span.name, p.intro a.email:hover, p.intro a.email:hover span.name {
- color: #32ddaf;
-}
-input[type="text"], textarea, select {
- background: #333333;
- color: #CCCCCC;
- border: #666666 1px solid;
- padding-left: 5px;
- padding-right: -5px;
- font-family: sans-serif;
- font-size: 10pt;
-}
-input[type="password"] {
- background: #333333;
- color: #CCCCCC;
- border: #666666 1px solid;
-}
-form table tr th {
- background: #333333;
- color: #AAAAAA;
- font-weight: 800;
- text-align: left;
- padding: 0;
-}
-div.banner {
- background: #32DD72;
- color: #000;
- text-align: center;
- width: 250px;
- padding: 4px;
- padding-left: 12px;
- padding-right: 12px;
- margin-left: auto;
- margin-right: auto;
- font-size: 12px;
-}
-div.banner a {
- color:#000;
-}
-input[type="submit"] {
- background: #333333;
- border: #888888 1px solid;
- color: #CCCCCC;
-}
-input[type="submit"]:hover {
- background: #555555;
- border: #888888 1px solid;
- color: #32DD72;
-}
-input[type="text"]:focus {
- border:#aaa 1px solid;
-}
-p.fileinfo a:hover {
- text-decoration: underline;
-}
-span.trip {
- color: #AAAAAA;
-}
-div.pages {
- color: #AAAAAA;
- background: #333333;
- border: #666666 1px solid;
- font-family: sans-serif;
- font-size: 10pt;
-}
-div.pages a.selected {
- color: #CCCCCC;
-}
-hr {
- height: 1px;
- border: #333333 1px solid;
-}
-div.boardlist {
- color: #999999;
- background-color: rgba(12%, 12%, 12%, 0.10);
-}
-
-div.ban {
- background-color: transparent;
- border: transparent 0px solid;
-}
-div.ban h2 {
- background: transparent;
- color: lime;
- font-size: 12px;
-}
-table.modlog tr th {
- background: #333333;
- color: #AAAAAA;
-}
-
-.desktop-style div.boardlist:nth-child(1) {
- text-shadow: black 1px 1px 1px, black -1px -1px 1px, black -1px 1px 1px, black 1px -1px 1px;
-}
-
-
-.desktop-style div.boardlist:nth-child(1):hover {
- background-color: rgba(30%, 30%, 30%, 0.65);
-}
+/** + * dark.css + * For AwsumChan by Circlepuller + */ +body { + background: #1E1E1E; + color: #999999; + font-family: sans-serif; + font-size: 12px; +} +span.quote { + color:#B8D962; +} +h1 { + font-size: 20pt; + text-align: center; + letter-spacing: 0px; +} +div.title, h1 { + color: #32DD72; + font-family: Arial, Helvetica, sans-serif; +} +div.title p { + font-size: 10px; +} +a:link, a:visited, p.intro a.email span.name { + color: #CCCCCC; + text-decoration: none; + font-family: sans-serif; +} +a:link:hover, a:visited:hover { + color: #fff; + font-family: sans-serif; + text-decoration: none; + +} +a.post_no { + color: #AAAAAA; + text-decoration: none; +} +a.post_no:hover { + color: #32DD72 !important; + text-decoration: underline overline; +} +div.post.reply { + background: #333333; + border: #555555 1px solid; + -webkit-border-radius: 10px; + -khtml-border-radius: 10px; + -moz-border-radius: 10px; + border-radius: 10px; + +} +div.post.reply.highlighted { + background: #555; + border: transparent 1px solid; +} +div.post.reply div.body a:link, div.post.reply div.body a:visited { + color: #CCCCCC; +} +div.post.reply div.body a:link:hover, div.post.reply div.body a:visited:hover { + color: #32DD72; +} +p.intro span.subject { + font-size: 12px; + font-family: sans-serif; + color: #446655; + font-weight: 800; +} +p.intro span.name { + color: #32DD72; + font-weight: 800; +} +p.intro a.capcode, p.intro a.nametag { + color: magenta; + margin-left: 0; +} +p.intro a.email, p.intro a.email span.name, p.intro a.email:hover, p.intro a.email:hover span.name { + color: #32ddaf; +} +input[type="text"], textarea, select { + background: #333333; + color: #CCCCCC; + border: #666666 1px solid; + padding-left: 5px; + padding-right: -5px; + font-family: sans-serif; + font-size: 10pt; +} +input[type="password"] { + background: #333333; + color: #CCCCCC; + border: #666666 1px solid; +} +form table tr th { + background: #333333; + color: #AAAAAA; + font-weight: 800; + text-align: left; + padding: 0; +} +div.banner { + background: #32DD72; + color: #000; + text-align: center; + width: 250px; + padding: 4px; + padding-left: 12px; + padding-right: 12px; + margin-left: auto; + margin-right: auto; + font-size: 12px; +} +div.banner a { + color:#000; +} +input[type="submit"] { + background: #333333; + border: #888888 1px solid; + color: #CCCCCC; +} +input[type="submit"]:hover { + background: #555555; + border: #888888 1px solid; + color: #32DD72; +} +input[type="text"]:focus { + border:#aaa 1px solid; +} +p.fileinfo a:hover { + text-decoration: underline; +} +span.trip { + color: #AAAAAA; +} +div.pages { + color: #AAAAAA; + background: #333333; + border: #666666 1px solid; + font-family: sans-serif; + font-size: 10pt; +} +div.pages a.selected { + color: #CCCCCC; +} +hr { + height: 1px; + border: #333333 1px solid; +} +div.boardlist { + color: #999999; + background-color: rgba(12%, 12%, 12%, 0.10); +} + +div.ban { + background-color: transparent; + border: transparent 0px solid; +} +div.ban h2 { + background: transparent; + color: lime; + font-size: 12px; +} +table.modlog tr th { + background: #333333; + color: #AAAAAA; +} + +.desktop-style div.boardlist:nth-child(1) { + text-shadow: black 1px 1px 1px, black -1px -1px 1px, black -1px 1px 1px, black 1px -1px 1px; +} + + +.desktop-style div.boardlist:nth-child(1):hover { + background-color: rgba(30%, 30%, 30%, 0.65); +} diff --git a/stylesheets/ferus.css b/stylesheets/ferus.css new file mode 100644 index 00000000..5dbf11ed --- /dev/null +++ b/stylesheets/ferus.css @@ -0,0 +1,150 @@ +body { + background: #050505; + color: #00FF00; + font-family: monospace; + font-size: 11px; +} +h1 { + font-size: 20pt; + text-align: center; + letter-spacing: 0px; +} +div.title, h1 { + color: #00FF00; + font-family: Arial, Helvetica, sans-serif; +} +div.title p { + font-size: 13px; +} +a:link, a:visited, p.intro a.email span.name { + color: #16C816; + text-decoration: underline; + font-family: monospace; +} +a:link:hover, a:visited:hover { + color: #003C00; + font-family: monospace;; + text-decoration: underline overline; +} +a.post_no { + color: #464646; + text-decoration: none; +} +a.post_no:hover { + color: maroon; + text-decoration: underline overline; +} +div.post.reply { + background: #0E0E0E; + border: #414141 2px solid; +} +.de-pview { + background: rgba(14, 14, 14, 0.84) !important; +} +div.post.reply.highlighted { + background: transparent; + border: #414141 2px solid; +} +div.post.reply div.body a:link, div.post.reply div.body a:visited { + color: #646464; +} +div.post.reply div.body a:link:hover, div.post.reply div.body a:visited:hover { + color: #00FF00; +} +p.intro span.subject { + font-size: 12px; + font-family: monospace; + color: #446655; + font-weight: 800; +} +p.intro span.name { + color: #008200; + font-weight: 900; +} +p.intro a.capcode, p.intro a.nametag { + color: magenta; + margin-left: 0; +} +p.intro a.email, p.intro a.email span.name, p.intro a.email:hover, p.intro a.email:hover span.name { + color: #00CC64; + font-family: monospace; +} +input[type="text"], textarea, select { + background: #333333; + color: #CCCCCC; + border: #666666 1px solid; + padding-left: 5px; + padding-right: -5px; + font-family: monospace; + font-size: 10pt; +} +input[type="password"] { + background: #333333; + color: #8B8B8B; + border: #666666 1px solid; +} +form table tr th { + background: #333333; + color: #828282; + font-weight: 800; + text-align: left; + padding: 0; +} +div.banner { + background: #00AA00; + color: #646464; + text-align: center; + width: 250px; + padding: 4px; + padding-left: 12px; + padding-right: 12px; + margin-left: auto; + margin-right: auto; + font-size: 12px; +} +input[type="submit"] { + background: #333333; + border: #888888 1px solid; + color: #A0A0A0; +} +input[type="submit"]:hover { + background: #555555; + border: #888888 1px solid; + color: #00FF00; +} +p.fileinfo a:hover { + text-decoration: underline; +} +span.trip { + color: #AAAAAA; +} +div.pages { + color: #AAAAAA; + background: #333333; + border: #666666 1px solid; + font-family: sans-serif; + font-size: 10pt; +} +div.pages a.selected { + color: #8C8C8C; +} +hr { + height: 1px; + border: #333333 1px solid; +} +div.boardlist { + color: #999999; +} +div.ban { + background-color: transparent; + border: transparent 0px solid; +} +div.ban h2 { + background: transparent; + color: lime; + font-size: 12px; +} +table.modlog tr th { + background: #00FF00; + color: #AAAAAA; +}
\ No newline at end of file diff --git a/stylesheets/font-awesome/css/font-awesome-ie7.css b/stylesheets/font-awesome/css/font-awesome-ie7.css new file mode 100644 index 00000000..17f07766 --- /dev/null +++ b/stylesheets/font-awesome/css/font-awesome-ie7.css @@ -0,0 +1,1203 @@ +/*! + * Font Awesome 3.2.1 + * the iconic font designed for Bootstrap + * ------------------------------------------------------------------------------ + * The full suite of pictographic icons, examples, and documentation can be + * found at http://fontawesome.io. Stay up to date on Twitter at + * http://twitter.com/fontawesome. + * + * License + * ------------------------------------------------------------------------------ + * - The Font Awesome font is licensed under SIL OFL 1.1 - + * http://scripts.sil.org/OFL + * - Font Awesome CSS, LESS, and SASS files are licensed under MIT License - + * http://opensource.org/licenses/mit-license.html + * - Font Awesome documentation licensed under CC BY 3.0 - + * http://creativecommons.org/licenses/by/3.0/ + * - Attribution is no longer required in Font Awesome 3.0, but much appreciated: + * "Font Awesome by Dave Gandy - http://fontawesome.io" + * + * Author - Dave Gandy + * ------------------------------------------------------------------------------ + * Email: dave@fontawesome.io + * Twitter: http://twitter.com/davegandy + * Work: Lead Product Designer @ Kyruus - http://kyruus.com + */ +.icon-large { + font-size: 1.3333333333333333em; + margin-top: -4px; + padding-top: 3px; + margin-bottom: -4px; + padding-bottom: 3px; + vertical-align: middle; +} +.nav [class^="icon-"], +.nav [class*=" icon-"] { + vertical-align: inherit; + margin-top: -4px; + padding-top: 3px; + margin-bottom: -4px; + padding-bottom: 3px; +} +.nav [class^="icon-"].icon-large, +.nav [class*=" icon-"].icon-large { + vertical-align: -25%; +} +.nav-pills [class^="icon-"].icon-large, +.nav-tabs [class^="icon-"].icon-large, +.nav-pills [class*=" icon-"].icon-large, +.nav-tabs [class*=" icon-"].icon-large { + line-height: .75em; + margin-top: -7px; + padding-top: 5px; + margin-bottom: -5px; + padding-bottom: 4px; +} +.btn [class^="icon-"].pull-left, +.btn [class*=" icon-"].pull-left, +.btn [class^="icon-"].pull-right, +.btn [class*=" icon-"].pull-right { + vertical-align: inherit; +} +.btn [class^="icon-"].icon-large, +.btn [class*=" icon-"].icon-large { + margin-top: -0.5em; +} +a [class^="icon-"], +a [class*=" icon-"] { + cursor: pointer; +} +.icon-glass { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ''); +} +.icon-music { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ''); +} +.icon-search { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ''); +} +.icon-envelope-alt { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ''); +} +.icon-heart { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ''); +} +.icon-star { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ''); +} +.icon-star-empty { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ''); +} +.icon-user { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ''); +} +.icon-film { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ''); +} +.icon-th-large { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ''); +} +.icon-th { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ''); +} +.icon-th-list { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ''); +} +.icon-ok { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ''); +} +.icon-remove { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ''); +} +.icon-zoom-in { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ''); +} +.icon-zoom-out { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ''); +} +.icon-off { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ''); +} +.icon-power-off { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ''); +} +.icon-signal { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ''); +} +.icon-cog { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ''); +} +.icon-gear { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ''); +} +.icon-trash { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ''); +} +.icon-home { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ''); +} +.icon-file-alt { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ''); +} +.icon-time { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ''); +} +.icon-road { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ''); +} +.icon-download-alt { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ''); +} +.icon-download { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ''); +} +.icon-upload { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ''); +} +.icon-inbox { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ''); +} +.icon-play-circle { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ''); +} +.icon-repeat { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ''); +} +.icon-rotate-right { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ''); +} +.icon-refresh { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ''); +} +.icon-list-alt { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ''); +} +.icon-lock { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ''); +} +.icon-flag { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ''); +} +.icon-headphones { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ''); +} +.icon-volume-off { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ''); +} +.icon-volume-down { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ''); +} +.icon-volume-up { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ''); +} +.icon-qrcode { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ''); +} +.icon-barcode { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ''); +} +.icon-tag { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ''); +} +.icon-tags { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ''); +} +.icon-book { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ''); +} +.icon-bookmark { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ''); +} +.icon-print { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ''); +} +.icon-camera { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ''); +} +.icon-font { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ''); +} +.icon-bold { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ''); +} +.icon-italic { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ''); +} +.icon-text-height { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ''); +} +.icon-text-width { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ''); +} +.icon-align-left { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ''); +} +.icon-align-center { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ''); +} +.icon-align-right { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ''); +} +.icon-align-justify { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ''); +} +.icon-list { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ''); +} +.icon-indent-left { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ''); +} +.icon-indent-right { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ''); +} +.icon-facetime-video { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ''); +} +.icon-picture { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ''); +} +.icon-pencil { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ''); +} +.icon-map-marker { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ''); +} +.icon-adjust { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ''); +} +.icon-tint { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ''); +} +.icon-edit { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ''); +} +.icon-share { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ''); +} +.icon-check { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ''); +} +.icon-move { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ''); +} +.icon-step-backward { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ''); +} +.icon-fast-backward { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ''); +} +.icon-backward { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ''); +} +.icon-play { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ''); +} +.icon-pause { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ''); +} +.icon-stop { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ''); +} +.icon-forward { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ''); +} +.icon-fast-forward { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ''); +} +.icon-step-forward { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ''); +} +.icon-eject { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ''); +} +.icon-chevron-left { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ''); +} +.icon-chevron-right { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ''); +} +.icon-plus-sign { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ''); +} +.icon-minus-sign { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ''); +} +.icon-remove-sign { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ''); +} +.icon-ok-sign { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ''); +} +.icon-question-sign { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ''); +} +.icon-info-sign { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ''); +} +.icon-screenshot { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ''); +} +.icon-remove-circle { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ''); +} +.icon-ok-circle { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ''); +} +.icon-ban-circle { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ''); +} +.icon-arrow-left { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ''); +} +.icon-arrow-right { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ''); +} +.icon-arrow-up { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ''); +} +.icon-arrow-down { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ''); +} +.icon-share-alt { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ''); +} +.icon-mail-forward { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ''); +} +.icon-resize-full { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ''); +} +.icon-resize-small { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ''); +} +.icon-plus { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ''); +} +.icon-minus { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ''); +} +.icon-asterisk { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ''); +} +.icon-exclamation-sign { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ''); +} +.icon-gift { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ''); +} +.icon-leaf { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ''); +} +.icon-fire { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ''); +} +.icon-eye-open { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ''); +} +.icon-eye-close { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ''); +} +.icon-warning-sign { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ''); +} +.icon-plane { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ''); +} +.icon-calendar { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ''); +} +.icon-random { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ''); +} +.icon-comment { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ''); +} +.icon-magnet { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ''); +} +.icon-chevron-up { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ''); +} +.icon-chevron-down { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ''); +} +.icon-retweet { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ''); +} +.icon-shopping-cart { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ''); +} +.icon-folder-close { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ''); +} +.icon-folder-open { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ''); +} +.icon-resize-vertical { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ''); +} +.icon-resize-horizontal { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ''); +} +.icon-bar-chart { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ''); +} +.icon-twitter-sign { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ''); +} +.icon-facebook-sign { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ''); +} +.icon-camera-retro { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ''); +} +.icon-key { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ''); +} +.icon-cogs { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ''); +} +.icon-gears { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ''); +} +.icon-comments { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ''); +} +.icon-thumbs-up-alt { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ''); +} +.icon-thumbs-down-alt { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ''); +} +.icon-star-half { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ''); +} +.icon-heart-empty { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ''); +} +.icon-signout { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ''); +} +.icon-linkedin-sign { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ''); +} +.icon-pushpin { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ''); +} +.icon-external-link { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ''); +} +.icon-signin { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ''); +} +.icon-trophy { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ''); +} +.icon-github-sign { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ''); +} +.icon-upload-alt { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ''); +} +.icon-lemon { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ''); +} +.icon-phone { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ''); +} +.icon-check-empty { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ''); +} +.icon-unchecked { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ''); +} +.icon-bookmark-empty { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ''); +} +.icon-phone-sign { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ''); +} +.icon-twitter { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ''); +} +.icon-facebook { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ''); +} +.icon-github { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ''); +} +.icon-unlock { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ''); +} +.icon-credit-card { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ''); +} +.icon-rss { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ''); +} +.icon-hdd { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ''); +} +.icon-bullhorn { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ''); +} +.icon-bell { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ''); +} +.icon-certificate { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ''); +} +.icon-hand-right { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ''); +} +.icon-hand-left { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ''); +} +.icon-hand-up { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ''); +} +.icon-hand-down { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ''); +} +.icon-circle-arrow-left { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ''); +} +.icon-circle-arrow-right { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ''); +} +.icon-circle-arrow-up { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ''); +} +.icon-circle-arrow-down { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ''); +} +.icon-globe { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ''); +} +.icon-wrench { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ''); +} +.icon-tasks { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ''); +} +.icon-filter { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ''); +} +.icon-briefcase { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ''); +} +.icon-fullscreen { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ''); +} +.icon-group { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ''); +} +.icon-link { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ''); +} +.icon-cloud { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ''); +} +.icon-beaker { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ''); +} +.icon-cut { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ''); +} +.icon-copy { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ''); +} +.icon-paper-clip { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ''); +} +.icon-paperclip { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ''); +} +.icon-save { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ''); +} +.icon-sign-blank { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ''); +} +.icon-reorder { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ''); +} +.icon-list-ul { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ''); +} +.icon-list-ol { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ''); +} +.icon-strikethrough { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ''); +} +.icon-underline { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ''); +} +.icon-table { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ''); +} +.icon-magic { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ''); +} +.icon-truck { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ''); +} +.icon-pinterest { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ''); +} +.icon-pinterest-sign { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ''); +} +.icon-google-plus-sign { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ''); +} +.icon-google-plus { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ''); +} +.icon-money { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ''); +} +.icon-caret-down { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ''); +} +.icon-caret-up { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ''); +} +.icon-caret-left { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ''); +} +.icon-caret-right { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ''); +} +.icon-columns { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ''); +} +.icon-sort { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ''); +} +.icon-sort-down { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ''); +} +.icon-sort-up { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ''); +} +.icon-envelope { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ''); +} +.icon-linkedin { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ''); +} +.icon-undo { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ''); +} +.icon-rotate-left { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ''); +} +.icon-legal { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ''); +} +.icon-dashboard { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ''); +} +.icon-comment-alt { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ''); +} +.icon-comments-alt { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ''); +} +.icon-bolt { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ''); +} +.icon-sitemap { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ''); +} +.icon-umbrella { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ''); +} +.icon-paste { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ''); +} +.icon-lightbulb { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ''); +} +.icon-exchange { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ''); +} +.icon-cloud-download { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ''); +} +.icon-cloud-upload { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ''); +} +.icon-user-md { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ''); +} +.icon-stethoscope { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ''); +} +.icon-suitcase { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ''); +} +.icon-bell-alt { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ''); +} +.icon-coffee { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ''); +} +.icon-food { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ''); +} +.icon-file-text-alt { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ''); +} +.icon-building { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ''); +} +.icon-hospital { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ''); +} +.icon-ambulance { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ''); +} +.icon-medkit { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ''); +} +.icon-fighter-jet { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ''); +} +.icon-beer { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ''); +} +.icon-h-sign { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ''); +} +.icon-plus-sign-alt { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ''); +} +.icon-double-angle-left { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ''); +} +.icon-double-angle-right { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ''); +} +.icon-double-angle-up { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ''); +} +.icon-double-angle-down { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ''); +} +.icon-angle-left { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ''); +} +.icon-angle-right { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ''); +} +.icon-angle-up { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ''); +} +.icon-angle-down { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ''); +} +.icon-desktop { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ''); +} +.icon-laptop { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ''); +} +.icon-tablet { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ''); +} +.icon-mobile-phone { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ''); +} +.icon-circle-blank { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ''); +} +.icon-quote-left { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ''); +} +.icon-quote-right { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ''); +} +.icon-spinner { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ''); +} +.icon-circle { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ''); +} +.icon-reply { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ''); +} +.icon-mail-reply { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ''); +} +.icon-github-alt { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ''); +} +.icon-folder-close-alt { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ''); +} +.icon-folder-open-alt { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ''); +} +.icon-expand-alt { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ''); +} +.icon-collapse-alt { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ''); +} +.icon-smile { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ''); +} +.icon-frown { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ''); +} +.icon-meh { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ''); +} +.icon-gamepad { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ''); +} +.icon-keyboard { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ''); +} +.icon-flag-alt { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ''); +} +.icon-flag-checkered { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ''); +} +.icon-terminal { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ''); +} +.icon-code { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ''); +} +.icon-reply-all { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ''); +} +.icon-mail-reply-all { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ''); +} +.icon-star-half-empty { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ''); +} +.icon-star-half-full { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ''); +} +.icon-location-arrow { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ''); +} +.icon-crop { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ''); +} +.icon-code-fork { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ''); +} +.icon-unlink { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ''); +} +.icon-question { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ''); +} +.icon-info { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ''); +} +.icon-exclamation { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ''); +} +.icon-superscript { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ''); +} +.icon-subscript { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ''); +} +.icon-eraser { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ''); +} +.icon-puzzle-piece { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ''); +} +.icon-microphone { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ''); +} +.icon-microphone-off { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ''); +} +.icon-shield { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ''); +} +.icon-calendar-empty { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ''); +} +.icon-fire-extinguisher { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ''); +} +.icon-rocket { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ''); +} +.icon-maxcdn { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ''); +} +.icon-chevron-sign-left { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ''); +} +.icon-chevron-sign-right { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ''); +} +.icon-chevron-sign-up { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ''); +} +.icon-chevron-sign-down { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ''); +} +.icon-html5 { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ''); +} +.icon-css3 { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ''); +} +.icon-anchor { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ''); +} +.icon-unlock-alt { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ''); +} +.icon-bullseye { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ''); +} +.icon-ellipsis-horizontal { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ''); +} +.icon-ellipsis-vertical { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ''); +} +.icon-rss-sign { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ''); +} +.icon-play-sign { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ''); +} +.icon-ticket { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ''); +} +.icon-minus-sign-alt { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ''); +} +.icon-check-minus { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ''); +} +.icon-level-up { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ''); +} +.icon-level-down { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ''); +} +.icon-check-sign { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ''); +} +.icon-edit-sign { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ''); +} +.icon-external-link-sign { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ''); +} +.icon-share-sign { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ''); +} +.icon-compass { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ''); +} +.icon-collapse { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ''); +} +.icon-collapse-top { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ''); +} +.icon-expand { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ''); +} +.icon-eur { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ''); +} +.icon-euro { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ''); +} +.icon-gbp { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ''); +} +.icon-usd { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ''); +} +.icon-dollar { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ''); +} +.icon-inr { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ''); +} +.icon-rupee { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ''); +} +.icon-jpy { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ''); +} +.icon-yen { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ''); +} +.icon-cny { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ''); +} +.icon-renminbi { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ''); +} +.icon-krw { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ''); +} +.icon-won { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ''); +} +.icon-btc { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ''); +} +.icon-bitcoin { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ''); +} +.icon-file { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ''); +} +.icon-file-text { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ''); +} +.icon-sort-by-alphabet { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ''); +} +.icon-sort-by-alphabet-alt { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ''); +} +.icon-sort-by-attributes { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ''); +} +.icon-sort-by-attributes-alt { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ''); +} +.icon-sort-by-order { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ''); +} +.icon-sort-by-order-alt { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ''); +} +.icon-thumbs-up { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ''); +} +.icon-thumbs-down { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ''); +} +.icon-youtube-sign { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ''); +} +.icon-youtube { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ''); +} +.icon-xing { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ''); +} +.icon-xing-sign { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ''); +} +.icon-youtube-play { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ''); +} +.icon-dropbox { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ''); +} +.icon-stackexchange { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ''); +} +.icon-instagram { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ''); +} +.icon-flickr { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ''); +} +.icon-adn { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ''); +} +.icon-bitbucket { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ''); +} +.icon-bitbucket-sign { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ''); +} +.icon-tumblr { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ''); +} +.icon-tumblr-sign { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ''); +} +.icon-long-arrow-down { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ''); +} +.icon-long-arrow-up { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ''); +} +.icon-long-arrow-left { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ''); +} +.icon-long-arrow-right { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ''); +} +.icon-apple { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ''); +} +.icon-windows { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ''); +} +.icon-android { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ''); +} +.icon-linux { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ''); +} +.icon-dribbble { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ''); +} +.icon-skype { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ''); +} +.icon-foursquare { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ''); +} +.icon-trello { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ''); +} +.icon-female { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ''); +} +.icon-male { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ''); +} +.icon-gittip { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ''); +} +.icon-sun { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ''); +} +.icon-moon { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ''); +} +.icon-archive { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ''); +} +.icon-bug { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ''); +} +.icon-vk { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ''); +} +.icon-weibo { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ''); +} +.icon-renren { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ''); +} diff --git a/stylesheets/font-awesome/css/font-awesome-ie7.min.css b/stylesheets/font-awesome/css/font-awesome-ie7.min.css new file mode 100644 index 00000000..d3dae63b --- /dev/null +++ b/stylesheets/font-awesome/css/font-awesome-ie7.min.css @@ -0,0 +1,384 @@ +.icon-large{font-size:1.3333333333333333em;margin-top:-4px;padding-top:3px;margin-bottom:-4px;padding-bottom:3px;vertical-align:middle;} +.nav [class^="icon-"],.nav [class*=" icon-"]{vertical-align:inherit;margin-top:-4px;padding-top:3px;margin-bottom:-4px;padding-bottom:3px;}.nav [class^="icon-"].icon-large,.nav [class*=" icon-"].icon-large{vertical-align:-25%;} +.nav-pills [class^="icon-"].icon-large,.nav-tabs [class^="icon-"].icon-large,.nav-pills [class*=" icon-"].icon-large,.nav-tabs [class*=" icon-"].icon-large{line-height:.75em;margin-top:-7px;padding-top:5px;margin-bottom:-5px;padding-bottom:4px;} +.btn [class^="icon-"].pull-left,.btn [class*=" icon-"].pull-left,.btn [class^="icon-"].pull-right,.btn [class*=" icon-"].pull-right{vertical-align:inherit;} +.btn [class^="icon-"].icon-large,.btn [class*=" icon-"].icon-large{margin-top:-0.5em;} +a [class^="icon-"],a [class*=" icon-"]{cursor:pointer;} +.icon-glass{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-music{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-search{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-envelope-alt{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-heart{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-star{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-star-empty{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-user{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-film{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-th-large{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-th{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-th-list{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-ok{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-remove{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-zoom-in{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-zoom-out{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-off{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-power-off{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-signal{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-cog{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-gear{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-trash{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-home{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-file-alt{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-time{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-road{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-download-alt{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-download{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-upload{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-inbox{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-play-circle{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-repeat{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-rotate-right{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-refresh{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-list-alt{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-lock{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-flag{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-headphones{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-volume-off{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-volume-down{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-volume-up{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-qrcode{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-barcode{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-tag{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-tags{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-book{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-bookmark{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-print{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-camera{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-font{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-bold{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-italic{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-text-height{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-text-width{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-align-left{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-align-center{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-align-right{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-align-justify{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-list{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-indent-left{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-indent-right{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-facetime-video{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-picture{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-pencil{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-map-marker{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-adjust{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-tint{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-edit{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-share{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-check{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-move{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-step-backward{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-fast-backward{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-backward{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-play{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-pause{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-stop{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-forward{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-fast-forward{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-step-forward{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-eject{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-chevron-left{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-chevron-right{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-plus-sign{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-minus-sign{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-remove-sign{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-ok-sign{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-question-sign{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-info-sign{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-screenshot{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-remove-circle{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-ok-circle{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-ban-circle{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-arrow-left{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-arrow-right{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-arrow-up{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-arrow-down{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-share-alt{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-mail-forward{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-resize-full{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-resize-small{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-plus{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-minus{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-asterisk{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-exclamation-sign{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-gift{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-leaf{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-fire{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-eye-open{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-eye-close{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-warning-sign{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-plane{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-calendar{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-random{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-comment{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-magnet{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-chevron-up{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-chevron-down{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-retweet{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-shopping-cart{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-folder-close{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-folder-open{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-resize-vertical{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-resize-horizontal{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-bar-chart{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-twitter-sign{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-facebook-sign{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-camera-retro{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-key{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-cogs{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-gears{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-comments{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-thumbs-up-alt{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-thumbs-down-alt{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-star-half{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-heart-empty{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-signout{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-linkedin-sign{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-pushpin{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-external-link{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-signin{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-trophy{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-github-sign{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-upload-alt{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-lemon{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-phone{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-check-empty{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-unchecked{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-bookmark-empty{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-phone-sign{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-twitter{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-facebook{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-github{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-unlock{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-credit-card{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-rss{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-hdd{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-bullhorn{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-bell{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-certificate{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-hand-right{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-hand-left{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-hand-up{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-hand-down{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-circle-arrow-left{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-circle-arrow-right{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-circle-arrow-up{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-circle-arrow-down{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-globe{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-wrench{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-tasks{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-filter{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-briefcase{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-fullscreen{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-group{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-link{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-cloud{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-beaker{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-cut{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-copy{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-paper-clip{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-paperclip{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-save{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-sign-blank{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-reorder{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-list-ul{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-list-ol{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-strikethrough{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-underline{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-table{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-magic{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-truck{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-pinterest{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-pinterest-sign{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-google-plus-sign{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-google-plus{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-money{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-caret-down{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-caret-up{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-caret-left{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-caret-right{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-columns{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-sort{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-sort-down{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-sort-up{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-envelope{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-linkedin{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-undo{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-rotate-left{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-legal{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-dashboard{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-comment-alt{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-comments-alt{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-bolt{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-sitemap{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-umbrella{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-paste{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-lightbulb{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-exchange{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-cloud-download{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-cloud-upload{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-user-md{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-stethoscope{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-suitcase{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-bell-alt{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-coffee{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-food{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-file-text-alt{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-building{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-hospital{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-ambulance{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-medkit{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-fighter-jet{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-beer{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-h-sign{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-plus-sign-alt{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-double-angle-left{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-double-angle-right{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-double-angle-up{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-double-angle-down{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-angle-left{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-angle-right{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-angle-up{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-angle-down{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-desktop{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-laptop{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-tablet{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-mobile-phone{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-circle-blank{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-quote-left{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-quote-right{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-spinner{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-circle{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-reply{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-mail-reply{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-github-alt{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-folder-close-alt{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-folder-open-alt{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-expand-alt{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-collapse-alt{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-smile{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-frown{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-meh{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-gamepad{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-keyboard{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-flag-alt{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-flag-checkered{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-terminal{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-code{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-reply-all{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-mail-reply-all{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-star-half-empty{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-star-half-full{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-location-arrow{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-crop{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-code-fork{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-unlink{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-question{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-info{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-exclamation{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-superscript{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-subscript{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-eraser{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-puzzle-piece{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-microphone{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-microphone-off{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-shield{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-calendar-empty{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-fire-extinguisher{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-rocket{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-maxcdn{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-chevron-sign-left{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-chevron-sign-right{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-chevron-sign-up{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-chevron-sign-down{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-html5{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-css3{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-anchor{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-unlock-alt{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-bullseye{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-ellipsis-horizontal{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-ellipsis-vertical{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-rss-sign{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-play-sign{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-ticket{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-minus-sign-alt{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-check-minus{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-level-up{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-level-down{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-check-sign{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-edit-sign{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-external-link-sign{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-share-sign{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-compass{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-collapse{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-collapse-top{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-expand{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-eur{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-euro{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-gbp{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-usd{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-dollar{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-inr{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-rupee{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-jpy{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-yen{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-cny{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-renminbi{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-krw{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-won{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-btc{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-bitcoin{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-file{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-file-text{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-sort-by-alphabet{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-sort-by-alphabet-alt{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-sort-by-attributes{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-sort-by-attributes-alt{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-sort-by-order{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-sort-by-order-alt{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-thumbs-up{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-thumbs-down{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-youtube-sign{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-youtube{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-xing{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-xing-sign{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-youtube-play{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-dropbox{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-stackexchange{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-instagram{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-flickr{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-adn{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-bitbucket{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-bitbucket-sign{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-tumblr{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-tumblr-sign{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-long-arrow-down{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-long-arrow-up{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-long-arrow-left{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-long-arrow-right{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-apple{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-windows{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-android{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-linux{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-dribbble{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-skype{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-foursquare{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-trello{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-female{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-male{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-gittip{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-sun{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-moon{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-archive{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-bug{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-vk{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-weibo{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-renren{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} diff --git a/stylesheets/font-awesome/css/font-awesome.css b/stylesheets/font-awesome/css/font-awesome.css new file mode 100644 index 00000000..7ede1828 --- /dev/null +++ b/stylesheets/font-awesome/css/font-awesome.css @@ -0,0 +1,1479 @@ +/*! + * Font Awesome 3.2.1 + * the iconic font designed for Bootstrap + * ------------------------------------------------------------------------------ + * The full suite of pictographic icons, examples, and documentation can be + * found at http://fontawesome.io. Stay up to date on Twitter at + * http://twitter.com/fontawesome. + * + * License + * ------------------------------------------------------------------------------ + * - The Font Awesome font is licensed under SIL OFL 1.1 - + * http://scripts.sil.org/OFL + * - Font Awesome CSS, LESS, and SASS files are licensed under MIT License - + * http://opensource.org/licenses/mit-license.html + * - Font Awesome documentation licensed under CC BY 3.0 - + * http://creativecommons.org/licenses/by/3.0/ + * - Attribution is no longer required in Font Awesome 3.0, but much appreciated: + * "Font Awesome by Dave Gandy - http://fontawesome.io" + * + * Author - Dave Gandy + * ------------------------------------------------------------------------------ + * Email: dave@fontawesome.io + * Twitter: http://twitter.com/davegandy + * Work: Lead Product Designer @ Kyruus - http://kyruus.com + */ +/* FONT PATH + * -------------------------- */ +@font-face { + font-family: 'FontAwesome'; + src: url('../font/fontawesome-webfont.eot?v=3.2.1'); + src: url('../font/fontawesome-webfont.eot?#iefix&v=3.2.1') format('embedded-opentype'), url('../font/fontawesome-webfont.woff?v=3.2.1') format('woff'), url('../font/fontawesome-webfont.ttf?v=3.2.1') format('truetype'), url('../font/fontawesome-webfont.svg#fontawesomeregular?v=3.2.1') format('svg'); + font-weight: normal; + font-style: normal; +} +/* FONT AWESOME CORE + * -------------------------- */ +[class^="icon-"], +[class*=" icon-"] { + font-family: FontAwesome; + font-weight: normal; + font-style: normal; + text-decoration: inherit; + -webkit-font-smoothing: antialiased; + *margin-right: .3em; +} +[class^="icon-"]:before, +[class*=" icon-"]:before { + text-decoration: inherit; + display: inline-block; + speak: none; +} +/* makes the font 33% larger relative to the icon container */ +.icon-large:before { + vertical-align: -10%; + font-size: 1.3333333333333333em; +} +/* makes sure icons active on rollover in links */ +a [class^="icon-"], +a [class*=" icon-"] { + display: inline; +} +/* increased font size for icon-large */ +[class^="icon-"].icon-fixed-width, +[class*=" icon-"].icon-fixed-width { + display: inline-block; + width: 1.1428571428571428em; + text-align: right; + padding-right: 0.2857142857142857em; +} +[class^="icon-"].icon-fixed-width.icon-large, +[class*=" icon-"].icon-fixed-width.icon-large { + width: 1.4285714285714286em; +} +.icons-ul { + margin-left: 2.142857142857143em; + list-style-type: none; +} +.icons-ul > li { + position: relative; +} +.icons-ul .icon-li { + position: absolute; + left: -2.142857142857143em; + width: 2.142857142857143em; + text-align: center; + line-height: inherit; +} +[class^="icon-"].hide, +[class*=" icon-"].hide { + display: none; +} +.icon-muted { + color: #eeeeee; +} +.icon-light { + color: #ffffff; +} +.icon-dark { + color: #333333; +} +.icon-border { + border: solid 1px #eeeeee; + padding: .2em .25em .15em; + -webkit-border-radius: 3px; + -moz-border-radius: 3px; + border-radius: 3px; +} +.icon-2x { + font-size: 2em; +} +.icon-2x.icon-border { + border-width: 2px; + -webkit-border-radius: 4px; + -moz-border-radius: 4px; + border-radius: 4px; +} +.icon-3x { + font-size: 3em; +} +.icon-3x.icon-border { + border-width: 3px; + -webkit-border-radius: 5px; + -moz-border-radius: 5px; + border-radius: 5px; +} +.icon-4x { + font-size: 4em; +} +.icon-4x.icon-border { + border-width: 4px; + -webkit-border-radius: 6px; + -moz-border-radius: 6px; + border-radius: 6px; +} +.icon-5x { + font-size: 5em; +} +.icon-5x.icon-border { + border-width: 5px; + -webkit-border-radius: 7px; + -moz-border-radius: 7px; + border-radius: 7px; +} +.pull-right { + float: right; +} +.pull-left { + float: left; +} +[class^="icon-"].pull-left, +[class*=" icon-"].pull-left { + margin-right: .3em; +} +[class^="icon-"].pull-right, +[class*=" icon-"].pull-right { + margin-left: .3em; +} +/* BOOTSTRAP SPECIFIC CLASSES + * -------------------------- */ +/* Bootstrap 2.0 sprites.less reset */ +[class^="icon-"], +[class*=" icon-"] { + display: inline; + width: auto; + height: auto; + line-height: normal; + vertical-align: baseline; + background-image: none; + background-position: 0% 0%; + background-repeat: repeat; + margin-top: 0; +} +/* more sprites.less reset */ +.icon-white, +.nav-pills > .active > a > [class^="icon-"], +.nav-pills > .active > a > [class*=" icon-"], +.nav-list > .active > a > [class^="icon-"], +.nav-list > .active > a > [class*=" icon-"], +.navbar-inverse .nav > .active > a > [class^="icon-"], +.navbar-inverse .nav > .active > a > [class*=" icon-"], +.dropdown-menu > li > a:hover > [class^="icon-"], +.dropdown-menu > li > a:hover > [class*=" icon-"], +.dropdown-menu > .active > a > [class^="icon-"], +.dropdown-menu > .active > a > [class*=" icon-"], +.dropdown-submenu:hover > a > [class^="icon-"], +.dropdown-submenu:hover > a > [class*=" icon-"] { + background-image: none; +} +/* keeps Bootstrap styles with and without icons the same */ +.btn [class^="icon-"].icon-large, +.nav [class^="icon-"].icon-large, +.btn [class*=" icon-"].icon-large, +.nav [class*=" icon-"].icon-large { + line-height: .9em; +} +.btn [class^="icon-"].icon-spin, +.nav [class^="icon-"].icon-spin, +.btn [class*=" icon-"].icon-spin, +.nav [class*=" icon-"].icon-spin { + display: inline-block; +} +.nav-tabs [class^="icon-"], +.nav-pills [class^="icon-"], +.nav-tabs [class*=" icon-"], +.nav-pills [class*=" icon-"], +.nav-tabs [class^="icon-"].icon-large, +.nav-pills [class^="icon-"].icon-large, +.nav-tabs [class*=" icon-"].icon-large, +.nav-pills [class*=" icon-"].icon-large { + line-height: .9em; +} +.btn [class^="icon-"].pull-left.icon-2x, +.btn [class*=" icon-"].pull-left.icon-2x, +.btn [class^="icon-"].pull-right.icon-2x, +.btn [class*=" icon-"].pull-right.icon-2x { + margin-top: .18em; +} +.btn [class^="icon-"].icon-spin.icon-large, +.btn [class*=" icon-"].icon-spin.icon-large { + line-height: .8em; +} +.btn.btn-small [class^="icon-"].pull-left.icon-2x, +.btn.btn-small [class*=" icon-"].pull-left.icon-2x, +.btn.btn-small [class^="icon-"].pull-right.icon-2x, +.btn.btn-small [class*=" icon-"].pull-right.icon-2x { + margin-top: .25em; +} +.btn.btn-large [class^="icon-"], +.btn.btn-large [class*=" icon-"] { + margin-top: 0; +} +.btn.btn-large [class^="icon-"].pull-left.icon-2x, +.btn.btn-large [class*=" icon-"].pull-left.icon-2x, +.btn.btn-large [class^="icon-"].pull-right.icon-2x, +.btn.btn-large [class*=" icon-"].pull-right.icon-2x { + margin-top: .05em; +} +.btn.btn-large [class^="icon-"].pull-left.icon-2x, +.btn.btn-large [class*=" icon-"].pull-left.icon-2x { + margin-right: .2em; +} +.btn.btn-large [class^="icon-"].pull-right.icon-2x, +.btn.btn-large [class*=" icon-"].pull-right.icon-2x { + margin-left: .2em; +} +/* Fixes alignment in nav lists */ +.nav-list [class^="icon-"], +.nav-list [class*=" icon-"] { + line-height: inherit; +} +/* EXTRAS + * -------------------------- */ +/* Stacked and layered icon */ +.icon-stack { + position: relative; + display: inline-block; + width: 2em; + height: 2em; + line-height: 2em; + vertical-align: -35%; +} +.icon-stack [class^="icon-"], +.icon-stack [class*=" icon-"] { + display: block; + text-align: center; + position: absolute; + width: 100%; + height: 100%; + font-size: 1em; + line-height: inherit; + *line-height: 2em; +} +.icon-stack .icon-stack-base { + font-size: 2em; + *line-height: 1em; +} +/* Animated rotating icon */ +.icon-spin { + display: inline-block; + -moz-animation: spin 2s infinite linear; + -o-animation: spin 2s infinite linear; + -webkit-animation: spin 2s infinite linear; + animation: spin 2s infinite linear; +} +/* Prevent stack and spinners from being taken inline when inside a link */ +a .icon-stack, +a .icon-spin { + display: inline-block; + text-decoration: none; +} +@-moz-keyframes spin { + 0% { + -moz-transform: rotate(0deg); + } + 100% { + -moz-transform: rotate(359deg); + } +} +@-webkit-keyframes spin { + 0% { + -webkit-transform: rotate(0deg); + } + 100% { + -webkit-transform: rotate(359deg); + } +} +@-o-keyframes spin { + 0% { + -o-transform: rotate(0deg); + } + 100% { + -o-transform: rotate(359deg); + } +} +@-ms-keyframes spin { + 0% { + -ms-transform: rotate(0deg); + } + 100% { + -ms-transform: rotate(359deg); + } +} +@keyframes spin { + 0% { + transform: rotate(0deg); + } + 100% { + transform: rotate(359deg); + } +} +/* Icon rotations and mirroring */ +.icon-rotate-90:before { + -webkit-transform: rotate(90deg); + -moz-transform: rotate(90deg); + -ms-transform: rotate(90deg); + -o-transform: rotate(90deg); + transform: rotate(90deg); + filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=1); +} +.icon-rotate-180:before { + -webkit-transform: rotate(180deg); + -moz-transform: rotate(180deg); + -ms-transform: rotate(180deg); + -o-transform: rotate(180deg); + transform: rotate(180deg); + filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=2); +} +.icon-rotate-270:before { + -webkit-transform: rotate(270deg); + -moz-transform: rotate(270deg); + -ms-transform: rotate(270deg); + -o-transform: rotate(270deg); + transform: rotate(270deg); + filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=3); +} +.icon-flip-horizontal:before { + -webkit-transform: scale(-1, 1); + -moz-transform: scale(-1, 1); + -ms-transform: scale(-1, 1); + -o-transform: scale(-1, 1); + transform: scale(-1, 1); +} +.icon-flip-vertical:before { + -webkit-transform: scale(1, -1); + -moz-transform: scale(1, -1); + -ms-transform: scale(1, -1); + -o-transform: scale(1, -1); + transform: scale(1, -1); +} +/* ensure rotation occurs inside anchor tags */ +a .icon-rotate-90:before, +a .icon-rotate-180:before, +a .icon-rotate-270:before, +a .icon-flip-horizontal:before, +a .icon-flip-vertical:before { + display: inline-block; +} +/* Font Awesome uses the Unicode Private Use Area (PUA) to ensure screen + readers do not read off random characters that represent icons */ +.icon-glass:before { + content: "\f000"; +} +.icon-music:before { + content: "\f001"; +} +.icon-search:before { + content: "\f002"; +} +.icon-envelope-alt:before { + content: "\f003"; +} +.icon-heart:before { + content: "\f004"; +} +.icon-star:before { + content: "\f005"; +} +.icon-star-empty:before { + content: "\f006"; +} +.icon-user:before { + content: "\f007"; +} +.icon-film:before { + content: "\f008"; +} +.icon-th-large:before { + content: "\f009"; +} +.icon-th:before { + content: "\f00a"; +} +.icon-th-list:before { + content: "\f00b"; +} +.icon-ok:before { + content: "\f00c"; +} +.icon-remove:before { + content: "\f00d"; +} +.icon-zoom-in:before { + content: "\f00e"; +} +.icon-zoom-out:before { + content: "\f010"; +} +.icon-power-off:before, +.icon-off:before { + content: "\f011"; +} +.icon-signal:before { + content: "\f012"; +} +.icon-gear:before, +.icon-cog:before { + content: "\f013"; +} +.icon-trash:before { + content: "\f014"; +} +.icon-home:before { + content: "\f015"; +} +.icon-file-alt:before { + content: "\f016"; +} +.icon-time:before { + content: "\f017"; +} +.icon-road:before { + content: "\f018"; +} +.icon-download-alt:before { + content: "\f019"; +} +.icon-download:before { + content: "\f01a"; +} +.icon-upload:before { + content: "\f01b"; +} +.icon-inbox:before { + content: "\f01c"; +} +.icon-play-circle:before { + content: "\f01d"; +} +.icon-rotate-right:before, +.icon-repeat:before { + content: "\f01e"; +} +.icon-refresh:before { + content: "\f021"; +} +.icon-list-alt:before { + content: "\f022"; +} +.icon-lock:before { + content: "\f023"; +} +.icon-flag:before { + content: "\f024"; +} +.icon-headphones:before { + content: "\f025"; +} +.icon-volume-off:before { + content: "\f026"; +} +.icon-volume-down:before { + content: "\f027"; +} +.icon-volume-up:before { + content: "\f028"; +} +.icon-qrcode:before { + content: "\f029"; +} +.icon-barcode:before { + content: "\f02a"; +} +.icon-tag:before { + content: "\f02b"; +} +.icon-tags:before { + content: "\f02c"; +} +.icon-book:before { + content: "\f02d"; +} +.icon-bookmark:before { + content: "\f02e"; +} +.icon-print:before { + content: "\f02f"; +} +.icon-camera:before { + content: "\f030"; +} +.icon-font:before { + content: "\f031"; +} +.icon-bold:before { + content: "\f032"; +} +.icon-italic:before { + content: "\f033"; +} +.icon-text-height:before { + content: "\f034"; +} +.icon-text-width:before { + content: "\f035"; +} +.icon-align-left:before { + content: "\f036"; +} +.icon-align-center:before { + content: "\f037"; +} +.icon-align-right:before { + content: "\f038"; +} +.icon-align-justify:before { + content: "\f039"; +} +.icon-list:before { + content: "\f03a"; +} +.icon-indent-left:before { + content: "\f03b"; +} +.icon-indent-right:before { + content: "\f03c"; +} +.icon-facetime-video:before { + content: "\f03d"; +} +.icon-picture:before { + content: "\f03e"; +} +.icon-pencil:before { + content: "\f040"; +} +.icon-map-marker:before { + content: "\f041"; +} +.icon-adjust:before { + content: "\f042"; +} +.icon-tint:before { + content: "\f043"; +} +.icon-edit:before { + content: "\f044"; +} +.icon-share:before { + content: "\f045"; +} +.icon-check:before { + content: "\f046"; +} +.icon-move:before { + content: "\f047"; +} +.icon-step-backward:before { + content: "\f048"; +} +.icon-fast-backward:before { + content: "\f049"; +} +.icon-backward:before { + content: "\f04a"; +} +.icon-play:before { + content: "\f04b"; +} +.icon-pause:before { + content: "\f04c"; +} +.icon-stop:before { + content: "\f04d"; +} +.icon-forward:before { + content: "\f04e"; +} +.icon-fast-forward:before { + content: "\f050"; +} +.icon-step-forward:before { + content: "\f051"; +} +.icon-eject:before { + content: "\f052"; +} +.icon-chevron-left:before { + content: "\f053"; +} +.icon-chevron-right:before { + content: "\f054"; +} +.icon-plus-sign:before { + content: "\f055"; +} +.icon-minus-sign:before { + content: "\f056"; +} +.icon-remove-sign:before { + content: "\f057"; +} +.icon-ok-sign:before { + content: "\f058"; +} +.icon-question-sign:before { + content: "\f059"; +} +.icon-info-sign:before { + content: "\f05a"; +} +.icon-screenshot:before { + content: "\f05b"; +} +.icon-remove-circle:before { + content: "\f05c"; +} +.icon-ok-circle:before { + content: "\f05d"; +} +.icon-ban-circle:before { + content: "\f05e"; +} +.icon-arrow-left:before { + content: "\f060"; +} +.icon-arrow-right:before { + content: "\f061"; +} +.icon-arrow-up:before { + content: "\f062"; +} +.icon-arrow-down:before { + content: "\f063"; +} +.icon-mail-forward:before, +.icon-share-alt:before { + content: "\f064"; +} +.icon-resize-full:before { + content: "\f065"; +} +.icon-resize-small:before { + content: "\f066"; +} +.icon-plus:before { + content: "\f067"; +} +.icon-minus:before { + content: "\f068"; +} +.icon-asterisk:before { + content: "\f069"; +} +.icon-exclamation-sign:before { + content: "\f06a"; +} +.icon-gift:before { + content: "\f06b"; +} +.icon-leaf:before { + content: "\f06c"; +} +.icon-fire:before { + content: "\f06d"; +} +.icon-eye-open:before { + content: "\f06e"; +} +.icon-eye-close:before { + content: "\f070"; +} +.icon-warning-sign:before { + content: "\f071"; +} +.icon-plane:before { + content: "\f072"; +} +.icon-calendar:before { + content: "\f073"; +} +.icon-random:before { + content: "\f074"; +} +.icon-comment:before { + content: "\f075"; +} +.icon-magnet:before { + content: "\f076"; +} +.icon-chevron-up:before { + content: "\f077"; +} +.icon-chevron-down:before { + content: "\f078"; +} +.icon-retweet:before { + content: "\f079"; +} +.icon-shopping-cart:before { + content: "\f07a"; +} +.icon-folder-close:before { + content: "\f07b"; +} +.icon-folder-open:before { + content: "\f07c"; +} +.icon-resize-vertical:before { + content: "\f07d"; +} +.icon-resize-horizontal:before { + content: "\f07e"; +} +.icon-bar-chart:before { + content: "\f080"; +} +.icon-twitter-sign:before { + content: "\f081"; +} +.icon-facebook-sign:before { + content: "\f082"; +} +.icon-camera-retro:before { + content: "\f083"; +} +.icon-key:before { + content: "\f084"; +} +.icon-gears:before, +.icon-cogs:before { + content: "\f085"; +} +.icon-comments:before { + content: "\f086"; +} +.icon-thumbs-up-alt:before { + content: "\f087"; +} +.icon-thumbs-down-alt:before { + content: "\f088"; +} +.icon-star-half:before { + content: "\f089"; +} +.icon-heart-empty:before { + content: "\f08a"; +} +.icon-signout:before { + content: "\f08b"; +} +.icon-linkedin-sign:before { + content: "\f08c"; +} +.icon-pushpin:before { + content: "\f08d"; +} +.icon-external-link:before { + content: "\f08e"; +} +.icon-signin:before { + content: "\f090"; +} +.icon-trophy:before { + content: "\f091"; +} +.icon-github-sign:before { + content: "\f092"; +} +.icon-upload-alt:before { + content: "\f093"; +} +.icon-lemon:before { + content: "\f094"; +} +.icon-phone:before { + content: "\f095"; +} +.icon-unchecked:before, +.icon-check-empty:before { + content: "\f096"; +} +.icon-bookmark-empty:before { + content: "\f097"; +} +.icon-phone-sign:before { + content: "\f098"; +} +.icon-twitter:before { + content: "\f099"; +} +.icon-facebook:before { + content: "\f09a"; +} +.icon-github:before { + content: "\f09b"; +} +.icon-unlock:before { + content: "\f09c"; +} +.icon-credit-card:before { + content: "\f09d"; +} +.icon-rss:before { + content: "\f09e"; +} +.icon-hdd:before { + content: "\f0a0"; +} +.icon-bullhorn:before { + content: "\f0a1"; +} +.icon-bell:before { + content: "\f0a2"; +} +.icon-certificate:before { + content: "\f0a3"; +} +.icon-hand-right:before { + content: "\f0a4"; +} +.icon-hand-left:before { + content: "\f0a5"; +} +.icon-hand-up:before { + content: "\f0a6"; +} +.icon-hand-down:before { + content: "\f0a7"; +} +.icon-circle-arrow-left:before { + content: "\f0a8"; +} +.icon-circle-arrow-right:before { + content: "\f0a9"; +} +.icon-circle-arrow-up:before { + content: "\f0aa"; +} +.icon-circle-arrow-down:before { + content: "\f0ab"; +} +.icon-globe:before { + content: "\f0ac"; +} +.icon-wrench:before { + content: "\f0ad"; +} +.icon-tasks:before { + content: "\f0ae"; +} +.icon-filter:before { + content: "\f0b0"; +} +.icon-briefcase:before { + content: "\f0b1"; +} +.icon-fullscreen:before { + content: "\f0b2"; +} +.icon-group:before { + content: "\f0c0"; +} +.icon-link:before { + content: "\f0c1"; +} +.icon-cloud:before { + content: "\f0c2"; +} +.icon-beaker:before { + content: "\f0c3"; +} +.icon-cut:before { + content: "\f0c4"; +} +.icon-copy:before { + content: "\f0c5"; +} +.icon-paperclip:before, +.icon-paper-clip:before { + content: "\f0c6"; +} +.icon-save:before { + content: "\f0c7"; +} +.icon-sign-blank:before { + content: "\f0c8"; +} +.icon-reorder:before { + content: "\f0c9"; +} +.icon-list-ul:before { + content: "\f0ca"; +} +.icon-list-ol:before { + content: "\f0cb"; +} +.icon-strikethrough:before { + content: "\f0cc"; +} +.icon-underline:before { + content: "\f0cd"; +} +.icon-table:before { + content: "\f0ce"; +} +.icon-magic:before { + content: "\f0d0"; +} +.icon-truck:before { + content: "\f0d1"; +} +.icon-pinterest:before { + content: "\f0d2"; +} +.icon-pinterest-sign:before { + content: "\f0d3"; +} +.icon-google-plus-sign:before { + content: "\f0d4"; +} +.icon-google-plus:before { + content: "\f0d5"; +} +.icon-money:before { + content: "\f0d6"; +} +.icon-caret-down:before { + content: "\f0d7"; +} +.icon-caret-up:before { + content: "\f0d8"; +} +.icon-caret-left:before { + content: "\f0d9"; +} +.icon-caret-right:before { + content: "\f0da"; +} +.icon-columns:before { + content: "\f0db"; +} +.icon-sort:before { + content: "\f0dc"; +} +.icon-sort-down:before { + content: "\f0dd"; +} +.icon-sort-up:before { + content: "\f0de"; +} +.icon-envelope:before { + content: "\f0e0"; +} +.icon-linkedin:before { + content: "\f0e1"; +} +.icon-rotate-left:before, +.icon-undo:before { + content: "\f0e2"; +} +.icon-legal:before { + content: "\f0e3"; +} +.icon-dashboard:before { + content: "\f0e4"; +} +.icon-comment-alt:before { + content: "\f0e5"; +} +.icon-comments-alt:before { + content: "\f0e6"; +} +.icon-bolt:before { + content: "\f0e7"; +} +.icon-sitemap:before { + content: "\f0e8"; +} +.icon-umbrella:before { + content: "\f0e9"; +} +.icon-paste:before { + content: "\f0ea"; +} +.icon-lightbulb:before { + content: "\f0eb"; +} +.icon-exchange:before { + content: "\f0ec"; +} +.icon-cloud-download:before { + content: "\f0ed"; +} +.icon-cloud-upload:before { + content: "\f0ee"; +} +.icon-user-md:before { + content: "\f0f0"; +} +.icon-stethoscope:before { + content: "\f0f1"; +} +.icon-suitcase:before { + content: "\f0f2"; +} +.icon-bell-alt:before { + content: "\f0f3"; +} +.icon-coffee:before { + content: "\f0f4"; +} +.icon-food:before { + content: "\f0f5"; +} +.icon-file-text-alt:before { + content: "\f0f6"; +} +.icon-building:before { + content: "\f0f7"; +} +.icon-hospital:before { + content: "\f0f8"; +} +.icon-ambulance:before { + content: "\f0f9"; +} +.icon-medkit:before { + content: "\f0fa"; +} +.icon-fighter-jet:before { + content: "\f0fb"; +} +.icon-beer:before { + content: "\f0fc"; +} +.icon-h-sign:before { + content: "\f0fd"; +} +.icon-plus-sign-alt:before { + content: "\f0fe"; +} +.icon-double-angle-left:before { + content: "\f100"; +} +.icon-double-angle-right:before { + content: "\f101"; +} +.icon-double-angle-up:before { + content: "\f102"; +} +.icon-double-angle-down:before { + content: "\f103"; +} +.icon-angle-left:before { + content: "\f104"; +} +.icon-angle-right:before { + content: "\f105"; +} +.icon-angle-up:before { + content: "\f106"; +} +.icon-angle-down:before { + content: "\f107"; +} +.icon-desktop:before { + content: "\f108"; +} +.icon-laptop:before { + content: "\f109"; +} +.icon-tablet:before { + content: "\f10a"; +} +.icon-mobile-phone:before { + content: "\f10b"; +} +.icon-circle-blank:before { + content: "\f10c"; +} +.icon-quote-left:before { + content: "\f10d"; +} +.icon-quote-right:before { + content: "\f10e"; +} +.icon-spinner:before { + content: "\f110"; +} +.icon-circle:before { + content: "\f111"; +} +.icon-mail-reply:before, +.icon-reply:before { + content: "\f112"; +} +.icon-github-alt:before { + content: "\f113"; +} +.icon-folder-close-alt:before { + content: "\f114"; +} +.icon-folder-open-alt:before { + content: "\f115"; +} +.icon-expand-alt:before { + content: "\f116"; +} +.icon-collapse-alt:before { + content: "\f117"; +} +.icon-smile:before { + content: "\f118"; +} +.icon-frown:before { + content: "\f119"; +} +.icon-meh:before { + content: "\f11a"; +} +.icon-gamepad:before { + content: "\f11b"; +} +.icon-keyboard:before { + content: "\f11c"; +} +.icon-flag-alt:before { + content: "\f11d"; +} +.icon-flag-checkered:before { + content: "\f11e"; +} +.icon-terminal:before { + content: "\f120"; +} +.icon-code:before { + content: "\f121"; +} +.icon-reply-all:before { + content: "\f122"; +} +.icon-mail-reply-all:before { + content: "\f122"; +} +.icon-star-half-full:before, +.icon-star-half-empty:before { + content: "\f123"; +} +.icon-location-arrow:before { + content: "\f124"; +} +.icon-crop:before { + content: "\f125"; +} +.icon-code-fork:before { + content: "\f126"; +} +.icon-unlink:before { + content: "\f127"; +} +.icon-question:before { + content: "\f128"; +} +.icon-info:before { + content: "\f129"; +} +.icon-exclamation:before { + content: "\f12a"; +} +.icon-superscript:before { + content: "\f12b"; +} +.icon-subscript:before { + content: "\f12c"; +} +.icon-eraser:before { + content: "\f12d"; +} +.icon-puzzle-piece:before { + content: "\f12e"; +} +.icon-microphone:before { + content: "\f130"; +} +.icon-microphone-off:before { + content: "\f131"; +} +.icon-shield:before { + content: "\f132"; +} +.icon-calendar-empty:before { + content: "\f133"; +} +.icon-fire-extinguisher:before { + content: "\f134"; +} +.icon-rocket:before { + content: "\f135"; +} +.icon-maxcdn:before { + content: "\f136"; +} +.icon-chevron-sign-left:before { + content: "\f137"; +} +.icon-chevron-sign-right:before { + content: "\f138"; +} +.icon-chevron-sign-up:before { + content: "\f139"; +} +.icon-chevron-sign-down:before { + content: "\f13a"; +} +.icon-html5:before { + content: "\f13b"; +} +.icon-css3:before { + content: "\f13c"; +} +.icon-anchor:before { + content: "\f13d"; +} +.icon-unlock-alt:before { + content: "\f13e"; +} +.icon-bullseye:before { + content: "\f140"; +} +.icon-ellipsis-horizontal:before { + content: "\f141"; +} +.icon-ellipsis-vertical:before { + content: "\f142"; +} +.icon-rss-sign:before { + content: "\f143"; +} +.icon-play-sign:before { + content: "\f144"; +} +.icon-ticket:before { + content: "\f145"; +} +.icon-minus-sign-alt:before { + content: "\f146"; +} +.icon-check-minus:before { + content: "\f147"; +} +.icon-level-up:before { + content: "\f148"; +} +.icon-level-down:before { + content: "\f149"; +} +.icon-check-sign:before { + content: "\f14a"; +} +.icon-edit-sign:before { + content: "\f14b"; +} +.icon-external-link-sign:before { + content: "\f14c"; +} +.icon-share-sign:before { + content: "\f14d"; +} +.icon-compass:before { + content: "\f14e"; +} +.icon-collapse:before { + content: "\f150"; +} +.icon-collapse-top:before { + content: "\f151"; +} +.icon-expand:before { + content: "\f152"; +} +.icon-euro:before, +.icon-eur:before { + content: "\f153"; +} +.icon-gbp:before { + content: "\f154"; +} +.icon-dollar:before, +.icon-usd:before { + content: "\f155"; +} +.icon-rupee:before, +.icon-inr:before { + content: "\f156"; +} +.icon-yen:before, +.icon-jpy:before { + content: "\f157"; +} +.icon-renminbi:before, +.icon-cny:before { + content: "\f158"; +} +.icon-won:before, +.icon-krw:before { + content: "\f159"; +} +.icon-bitcoin:before, +.icon-btc:before { + content: "\f15a"; +} +.icon-file:before { + content: "\f15b"; +} +.icon-file-text:before { + content: "\f15c"; +} +.icon-sort-by-alphabet:before { + content: "\f15d"; +} +.icon-sort-by-alphabet-alt:before { + content: "\f15e"; +} +.icon-sort-by-attributes:before { + content: "\f160"; +} +.icon-sort-by-attributes-alt:before { + content: "\f161"; +} +.icon-sort-by-order:before { + content: "\f162"; +} +.icon-sort-by-order-alt:before { + content: "\f163"; +} +.icon-thumbs-up:before { + content: "\f164"; +} +.icon-thumbs-down:before { + content: "\f165"; +} +.icon-youtube-sign:before { + content: "\f166"; +} +.icon-youtube:before { + content: "\f167"; +} +.icon-xing:before { + content: "\f168"; +} +.icon-xing-sign:before { + content: "\f169"; +} +.icon-youtube-play:before { + content: "\f16a"; +} +.icon-dropbox:before { + content: "\f16b"; +} +.icon-stackexchange:before { + content: "\f16c"; +} +.icon-instagram:before { + content: "\f16d"; +} +.icon-flickr:before { + content: "\f16e"; +} +.icon-adn:before { + content: "\f170"; +} +.icon-bitbucket:before { + content: "\f171"; +} +.icon-bitbucket-sign:before { + content: "\f172"; +} +.icon-tumblr:before { + content: "\f173"; +} +.icon-tumblr-sign:before { + content: "\f174"; +} +.icon-long-arrow-down:before { + content: "\f175"; +} +.icon-long-arrow-up:before { + content: "\f176"; +} +.icon-long-arrow-left:before { + content: "\f177"; +} +.icon-long-arrow-right:before { + content: "\f178"; +} +.icon-apple:before { + content: "\f179"; +} +.icon-windows:before { + content: "\f17a"; +} +.icon-android:before { + content: "\f17b"; +} +.icon-linux:before { + content: "\f17c"; +} +.icon-dribbble:before { + content: "\f17d"; +} +.icon-skype:before { + content: "\f17e"; +} +.icon-foursquare:before { + content: "\f180"; +} +.icon-trello:before { + content: "\f181"; +} +.icon-female:before { + content: "\f182"; +} +.icon-male:before { + content: "\f183"; +} +.icon-gittip:before { + content: "\f184"; +} +.icon-sun:before { + content: "\f185"; +} +.icon-moon:before { + content: "\f186"; +} +.icon-archive:before { + content: "\f187"; +} +.icon-bug:before { + content: "\f188"; +} +.icon-vk:before { + content: "\f189"; +} +.icon-weibo:before { + content: "\f18a"; +} +.icon-renren:before { + content: "\f18b"; +} diff --git a/stylesheets/font-awesome/css/font-awesome.min.css b/stylesheets/font-awesome/css/font-awesome.min.css new file mode 100644 index 00000000..866437fa --- /dev/null +++ b/stylesheets/font-awesome/css/font-awesome.min.css @@ -0,0 +1,403 @@ +@font-face{font-family:'FontAwesome';src:url('../font/fontawesome-webfont.eot?v=3.2.1');src:url('../font/fontawesome-webfont.eot?#iefix&v=3.2.1') format('embedded-opentype'),url('../font/fontawesome-webfont.woff?v=3.2.1') format('woff'),url('../font/fontawesome-webfont.ttf?v=3.2.1') format('truetype'),url('../font/fontawesome-webfont.svg#fontawesomeregular?v=3.2.1') format('svg');font-weight:normal;font-style:normal;}[class^="icon-"],[class*=" icon-"]{font-family:FontAwesome;font-weight:normal;font-style:normal;text-decoration:inherit;-webkit-font-smoothing:antialiased;*margin-right:.3em;} +[class^="icon-"]:before,[class*=" icon-"]:before{text-decoration:inherit;display:inline-block;speak:none;} +.icon-large:before{vertical-align:-10%;font-size:1.3333333333333333em;} +a [class^="icon-"],a [class*=" icon-"]{display:inline;} +[class^="icon-"].icon-fixed-width,[class*=" icon-"].icon-fixed-width{display:inline-block;width:1.1428571428571428em;text-align:right;padding-right:0.2857142857142857em;}[class^="icon-"].icon-fixed-width.icon-large,[class*=" icon-"].icon-fixed-width.icon-large{width:1.4285714285714286em;} +.icons-ul{margin-left:2.142857142857143em;list-style-type:none;}.icons-ul>li{position:relative;} +.icons-ul .icon-li{position:absolute;left:-2.142857142857143em;width:2.142857142857143em;text-align:center;line-height:inherit;} +[class^="icon-"].hide,[class*=" icon-"].hide{display:none;} +.icon-muted{color:#eeeeee;} +.icon-light{color:#ffffff;} +.icon-dark{color:#333333;} +.icon-border{border:solid 1px #eeeeee;padding:.2em .25em .15em;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px;} +.icon-2x{font-size:2em;}.icon-2x.icon-border{border-width:2px;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;} +.icon-3x{font-size:3em;}.icon-3x.icon-border{border-width:3px;-webkit-border-radius:5px;-moz-border-radius:5px;border-radius:5px;} +.icon-4x{font-size:4em;}.icon-4x.icon-border{border-width:4px;-webkit-border-radius:6px;-moz-border-radius:6px;border-radius:6px;} +.icon-5x{font-size:5em;}.icon-5x.icon-border{border-width:5px;-webkit-border-radius:7px;-moz-border-radius:7px;border-radius:7px;} +.pull-right{float:right;} +.pull-left{float:left;} +[class^="icon-"].pull-left,[class*=" icon-"].pull-left{margin-right:.3em;} +[class^="icon-"].pull-right,[class*=" icon-"].pull-right{margin-left:.3em;} +[class^="icon-"],[class*=" icon-"]{display:inline;width:auto;height:auto;line-height:normal;vertical-align:baseline;background-image:none;background-position:0% 0%;background-repeat:repeat;margin-top:0;} +.icon-white,.nav-pills>.active>a>[class^="icon-"],.nav-pills>.active>a>[class*=" icon-"],.nav-list>.active>a>[class^="icon-"],.nav-list>.active>a>[class*=" icon-"],.navbar-inverse .nav>.active>a>[class^="icon-"],.navbar-inverse .nav>.active>a>[class*=" icon-"],.dropdown-menu>li>a:hover>[class^="icon-"],.dropdown-menu>li>a:hover>[class*=" icon-"],.dropdown-menu>.active>a>[class^="icon-"],.dropdown-menu>.active>a>[class*=" icon-"],.dropdown-submenu:hover>a>[class^="icon-"],.dropdown-submenu:hover>a>[class*=" icon-"]{background-image:none;} +.btn [class^="icon-"].icon-large,.nav [class^="icon-"].icon-large,.btn [class*=" icon-"].icon-large,.nav [class*=" icon-"].icon-large{line-height:.9em;} +.btn [class^="icon-"].icon-spin,.nav [class^="icon-"].icon-spin,.btn [class*=" icon-"].icon-spin,.nav [class*=" icon-"].icon-spin{display:inline-block;} +.nav-tabs [class^="icon-"],.nav-pills [class^="icon-"],.nav-tabs [class*=" icon-"],.nav-pills [class*=" icon-"],.nav-tabs [class^="icon-"].icon-large,.nav-pills [class^="icon-"].icon-large,.nav-tabs [class*=" icon-"].icon-large,.nav-pills [class*=" icon-"].icon-large{line-height:.9em;} +.btn [class^="icon-"].pull-left.icon-2x,.btn [class*=" icon-"].pull-left.icon-2x,.btn [class^="icon-"].pull-right.icon-2x,.btn [class*=" icon-"].pull-right.icon-2x{margin-top:.18em;} +.btn [class^="icon-"].icon-spin.icon-large,.btn [class*=" icon-"].icon-spin.icon-large{line-height:.8em;} +.btn.btn-small [class^="icon-"].pull-left.icon-2x,.btn.btn-small [class*=" icon-"].pull-left.icon-2x,.btn.btn-small [class^="icon-"].pull-right.icon-2x,.btn.btn-small [class*=" icon-"].pull-right.icon-2x{margin-top:.25em;} +.btn.btn-large [class^="icon-"],.btn.btn-large [class*=" icon-"]{margin-top:0;}.btn.btn-large [class^="icon-"].pull-left.icon-2x,.btn.btn-large [class*=" icon-"].pull-left.icon-2x,.btn.btn-large [class^="icon-"].pull-right.icon-2x,.btn.btn-large [class*=" icon-"].pull-right.icon-2x{margin-top:.05em;} +.btn.btn-large [class^="icon-"].pull-left.icon-2x,.btn.btn-large [class*=" icon-"].pull-left.icon-2x{margin-right:.2em;} +.btn.btn-large [class^="icon-"].pull-right.icon-2x,.btn.btn-large [class*=" icon-"].pull-right.icon-2x{margin-left:.2em;} +.nav-list [class^="icon-"],.nav-list [class*=" icon-"]{line-height:inherit;} +.icon-stack{position:relative;display:inline-block;width:2em;height:2em;line-height:2em;vertical-align:-35%;}.icon-stack [class^="icon-"],.icon-stack [class*=" icon-"]{display:block;text-align:center;position:absolute;width:100%;height:100%;font-size:1em;line-height:inherit;*line-height:2em;} +.icon-stack .icon-stack-base{font-size:2em;*line-height:1em;} +.icon-spin{display:inline-block;-moz-animation:spin 2s infinite linear;-o-animation:spin 2s infinite linear;-webkit-animation:spin 2s infinite linear;animation:spin 2s infinite linear;} +a .icon-stack,a .icon-spin{display:inline-block;text-decoration:none;} +@-moz-keyframes spin{0%{-moz-transform:rotate(0deg);} 100%{-moz-transform:rotate(359deg);}}@-webkit-keyframes spin{0%{-webkit-transform:rotate(0deg);} 100%{-webkit-transform:rotate(359deg);}}@-o-keyframes spin{0%{-o-transform:rotate(0deg);} 100%{-o-transform:rotate(359deg);}}@-ms-keyframes spin{0%{-ms-transform:rotate(0deg);} 100%{-ms-transform:rotate(359deg);}}@keyframes spin{0%{transform:rotate(0deg);} 100%{transform:rotate(359deg);}}.icon-rotate-90:before{-webkit-transform:rotate(90deg);-moz-transform:rotate(90deg);-ms-transform:rotate(90deg);-o-transform:rotate(90deg);transform:rotate(90deg);filter:progid:DXImageTransform.Microsoft.BasicImage(rotation=1);} +.icon-rotate-180:before{-webkit-transform:rotate(180deg);-moz-transform:rotate(180deg);-ms-transform:rotate(180deg);-o-transform:rotate(180deg);transform:rotate(180deg);filter:progid:DXImageTransform.Microsoft.BasicImage(rotation=2);} +.icon-rotate-270:before{-webkit-transform:rotate(270deg);-moz-transform:rotate(270deg);-ms-transform:rotate(270deg);-o-transform:rotate(270deg);transform:rotate(270deg);filter:progid:DXImageTransform.Microsoft.BasicImage(rotation=3);} +.icon-flip-horizontal:before{-webkit-transform:scale(-1, 1);-moz-transform:scale(-1, 1);-ms-transform:scale(-1, 1);-o-transform:scale(-1, 1);transform:scale(-1, 1);} +.icon-flip-vertical:before{-webkit-transform:scale(1, -1);-moz-transform:scale(1, -1);-ms-transform:scale(1, -1);-o-transform:scale(1, -1);transform:scale(1, -1);} +a .icon-rotate-90:before,a .icon-rotate-180:before,a .icon-rotate-270:before,a .icon-flip-horizontal:before,a .icon-flip-vertical:before{display:inline-block;} +.icon-glass:before{content:"\f000";} +.icon-music:before{content:"\f001";} +.icon-search:before{content:"\f002";} +.icon-envelope-alt:before{content:"\f003";} +.icon-heart:before{content:"\f004";} +.icon-star:before{content:"\f005";} +.icon-star-empty:before{content:"\f006";} +.icon-user:before{content:"\f007";} +.icon-film:before{content:"\f008";} +.icon-th-large:before{content:"\f009";} +.icon-th:before{content:"\f00a";} +.icon-th-list:before{content:"\f00b";} +.icon-ok:before{content:"\f00c";} +.icon-remove:before{content:"\f00d";} +.icon-zoom-in:before{content:"\f00e";} +.icon-zoom-out:before{content:"\f010";} +.icon-power-off:before,.icon-off:before{content:"\f011";} +.icon-signal:before{content:"\f012";} +.icon-gear:before,.icon-cog:before{content:"\f013";} +.icon-trash:before{content:"\f014";} +.icon-home:before{content:"\f015";} +.icon-file-alt:before{content:"\f016";} +.icon-time:before{content:"\f017";} +.icon-road:before{content:"\f018";} +.icon-download-alt:before{content:"\f019";} +.icon-download:before{content:"\f01a";} +.icon-upload:before{content:"\f01b";} +.icon-inbox:before{content:"\f01c";} +.icon-play-circle:before{content:"\f01d";} +.icon-rotate-right:before,.icon-repeat:before{content:"\f01e";} +.icon-refresh:before{content:"\f021";} +.icon-list-alt:before{content:"\f022";} +.icon-lock:before{content:"\f023";} +.icon-flag:before{content:"\f024";} +.icon-headphones:before{content:"\f025";} +.icon-volume-off:before{content:"\f026";} +.icon-volume-down:before{content:"\f027";} +.icon-volume-up:before{content:"\f028";} +.icon-qrcode:before{content:"\f029";} +.icon-barcode:before{content:"\f02a";} +.icon-tag:before{content:"\f02b";} +.icon-tags:before{content:"\f02c";} +.icon-book:before{content:"\f02d";} +.icon-bookmark:before{content:"\f02e";} +.icon-print:before{content:"\f02f";} +.icon-camera:before{content:"\f030";} +.icon-font:before{content:"\f031";} +.icon-bold:before{content:"\f032";} +.icon-italic:before{content:"\f033";} +.icon-text-height:before{content:"\f034";} +.icon-text-width:before{content:"\f035";} +.icon-align-left:before{content:"\f036";} +.icon-align-center:before{content:"\f037";} +.icon-align-right:before{content:"\f038";} +.icon-align-justify:before{content:"\f039";} +.icon-list:before{content:"\f03a";} +.icon-indent-left:before{content:"\f03b";} +.icon-indent-right:before{content:"\f03c";} +.icon-facetime-video:before{content:"\f03d";} +.icon-picture:before{content:"\f03e";} +.icon-pencil:before{content:"\f040";} +.icon-map-marker:before{content:"\f041";} +.icon-adjust:before{content:"\f042";} +.icon-tint:before{content:"\f043";} +.icon-edit:before{content:"\f044";} +.icon-share:before{content:"\f045";} +.icon-check:before{content:"\f046";} +.icon-move:before{content:"\f047";} +.icon-step-backward:before{content:"\f048";} +.icon-fast-backward:before{content:"\f049";} +.icon-backward:before{content:"\f04a";} +.icon-play:before{content:"\f04b";} +.icon-pause:before{content:"\f04c";} +.icon-stop:before{content:"\f04d";} +.icon-forward:before{content:"\f04e";} +.icon-fast-forward:before{content:"\f050";} +.icon-step-forward:before{content:"\f051";} +.icon-eject:before{content:"\f052";} +.icon-chevron-left:before{content:"\f053";} +.icon-chevron-right:before{content:"\f054";} +.icon-plus-sign:before{content:"\f055";} +.icon-minus-sign:before{content:"\f056";} +.icon-remove-sign:before{content:"\f057";} +.icon-ok-sign:before{content:"\f058";} +.icon-question-sign:before{content:"\f059";} +.icon-info-sign:before{content:"\f05a";} +.icon-screenshot:before{content:"\f05b";} +.icon-remove-circle:before{content:"\f05c";} +.icon-ok-circle:before{content:"\f05d";} +.icon-ban-circle:before{content:"\f05e";} +.icon-arrow-left:before{content:"\f060";} +.icon-arrow-right:before{content:"\f061";} +.icon-arrow-up:before{content:"\f062";} +.icon-arrow-down:before{content:"\f063";} +.icon-mail-forward:before,.icon-share-alt:before{content:"\f064";} +.icon-resize-full:before{content:"\f065";} +.icon-resize-small:before{content:"\f066";} +.icon-plus:before{content:"\f067";} +.icon-minus:before{content:"\f068";} +.icon-asterisk:before{content:"\f069";} +.icon-exclamation-sign:before{content:"\f06a";} +.icon-gift:before{content:"\f06b";} +.icon-leaf:before{content:"\f06c";} +.icon-fire:before{content:"\f06d";} +.icon-eye-open:before{content:"\f06e";} +.icon-eye-close:before{content:"\f070";} +.icon-warning-sign:before{content:"\f071";} +.icon-plane:before{content:"\f072";} +.icon-calendar:before{content:"\f073";} +.icon-random:before{content:"\f074";} +.icon-comment:before{content:"\f075";} +.icon-magnet:before{content:"\f076";} +.icon-chevron-up:before{content:"\f077";} +.icon-chevron-down:before{content:"\f078";} +.icon-retweet:before{content:"\f079";} +.icon-shopping-cart:before{content:"\f07a";} +.icon-folder-close:before{content:"\f07b";} +.icon-folder-open:before{content:"\f07c";} +.icon-resize-vertical:before{content:"\f07d";} +.icon-resize-horizontal:before{content:"\f07e";} +.icon-bar-chart:before{content:"\f080";} +.icon-twitter-sign:before{content:"\f081";} +.icon-facebook-sign:before{content:"\f082";} +.icon-camera-retro:before{content:"\f083";} +.icon-key:before{content:"\f084";} +.icon-gears:before,.icon-cogs:before{content:"\f085";} +.icon-comments:before{content:"\f086";} +.icon-thumbs-up-alt:before{content:"\f087";} +.icon-thumbs-down-alt:before{content:"\f088";} +.icon-star-half:before{content:"\f089";} +.icon-heart-empty:before{content:"\f08a";} +.icon-signout:before{content:"\f08b";} +.icon-linkedin-sign:before{content:"\f08c";} +.icon-pushpin:before{content:"\f08d";} +.icon-external-link:before{content:"\f08e";} +.icon-signin:before{content:"\f090";} +.icon-trophy:before{content:"\f091";} +.icon-github-sign:before{content:"\f092";} +.icon-upload-alt:before{content:"\f093";} +.icon-lemon:before{content:"\f094";} +.icon-phone:before{content:"\f095";} +.icon-unchecked:before,.icon-check-empty:before{content:"\f096";} +.icon-bookmark-empty:before{content:"\f097";} +.icon-phone-sign:before{content:"\f098";} +.icon-twitter:before{content:"\f099";} +.icon-facebook:before{content:"\f09a";} +.icon-github:before{content:"\f09b";} +.icon-unlock:before{content:"\f09c";} +.icon-credit-card:before{content:"\f09d";} +.icon-rss:before{content:"\f09e";} +.icon-hdd:before{content:"\f0a0";} +.icon-bullhorn:before{content:"\f0a1";} +.icon-bell:before{content:"\f0a2";} +.icon-certificate:before{content:"\f0a3";} +.icon-hand-right:before{content:"\f0a4";} +.icon-hand-left:before{content:"\f0a5";} +.icon-hand-up:before{content:"\f0a6";} +.icon-hand-down:before{content:"\f0a7";} +.icon-circle-arrow-left:before{content:"\f0a8";} +.icon-circle-arrow-right:before{content:"\f0a9";} +.icon-circle-arrow-up:before{content:"\f0aa";} +.icon-circle-arrow-down:before{content:"\f0ab";} +.icon-globe:before{content:"\f0ac";} +.icon-wrench:before{content:"\f0ad";} +.icon-tasks:before{content:"\f0ae";} +.icon-filter:before{content:"\f0b0";} +.icon-briefcase:before{content:"\f0b1";} +.icon-fullscreen:before{content:"\f0b2";} +.icon-group:before{content:"\f0c0";} +.icon-link:before{content:"\f0c1";} +.icon-cloud:before{content:"\f0c2";} +.icon-beaker:before{content:"\f0c3";} +.icon-cut:before{content:"\f0c4";} +.icon-copy:before{content:"\f0c5";} +.icon-paperclip:before,.icon-paper-clip:before{content:"\f0c6";} +.icon-save:before{content:"\f0c7";} +.icon-sign-blank:before{content:"\f0c8";} +.icon-reorder:before{content:"\f0c9";} +.icon-list-ul:before{content:"\f0ca";} +.icon-list-ol:before{content:"\f0cb";} +.icon-strikethrough:before{content:"\f0cc";} +.icon-underline:before{content:"\f0cd";} +.icon-table:before{content:"\f0ce";} +.icon-magic:before{content:"\f0d0";} +.icon-truck:before{content:"\f0d1";} +.icon-pinterest:before{content:"\f0d2";} +.icon-pinterest-sign:before{content:"\f0d3";} +.icon-google-plus-sign:before{content:"\f0d4";} +.icon-google-plus:before{content:"\f0d5";} +.icon-money:before{content:"\f0d6";} +.icon-caret-down:before{content:"\f0d7";} +.icon-caret-up:before{content:"\f0d8";} +.icon-caret-left:before{content:"\f0d9";} +.icon-caret-right:before{content:"\f0da";} +.icon-columns:before{content:"\f0db";} +.icon-sort:before{content:"\f0dc";} +.icon-sort-down:before{content:"\f0dd";} +.icon-sort-up:before{content:"\f0de";} +.icon-envelope:before{content:"\f0e0";} +.icon-linkedin:before{content:"\f0e1";} +.icon-rotate-left:before,.icon-undo:before{content:"\f0e2";} +.icon-legal:before{content:"\f0e3";} +.icon-dashboard:before{content:"\f0e4";} +.icon-comment-alt:before{content:"\f0e5";} +.icon-comments-alt:before{content:"\f0e6";} +.icon-bolt:before{content:"\f0e7";} +.icon-sitemap:before{content:"\f0e8";} +.icon-umbrella:before{content:"\f0e9";} +.icon-paste:before{content:"\f0ea";} +.icon-lightbulb:before{content:"\f0eb";} +.icon-exchange:before{content:"\f0ec";} +.icon-cloud-download:before{content:"\f0ed";} +.icon-cloud-upload:before{content:"\f0ee";} +.icon-user-md:before{content:"\f0f0";} +.icon-stethoscope:before{content:"\f0f1";} +.icon-suitcase:before{content:"\f0f2";} +.icon-bell-alt:before{content:"\f0f3";} +.icon-coffee:before{content:"\f0f4";} +.icon-food:before{content:"\f0f5";} +.icon-file-text-alt:before{content:"\f0f6";} +.icon-building:before{content:"\f0f7";} +.icon-hospital:before{content:"\f0f8";} +.icon-ambulance:before{content:"\f0f9";} +.icon-medkit:before{content:"\f0fa";} +.icon-fighter-jet:before{content:"\f0fb";} +.icon-beer:before{content:"\f0fc";} +.icon-h-sign:before{content:"\f0fd";} +.icon-plus-sign-alt:before{content:"\f0fe";} +.icon-double-angle-left:before{content:"\f100";} +.icon-double-angle-right:before{content:"\f101";} +.icon-double-angle-up:before{content:"\f102";} +.icon-double-angle-down:before{content:"\f103";} +.icon-angle-left:before{content:"\f104";} +.icon-angle-right:before{content:"\f105";} +.icon-angle-up:before{content:"\f106";} +.icon-angle-down:before{content:"\f107";} +.icon-desktop:before{content:"\f108";} +.icon-laptop:before{content:"\f109";} +.icon-tablet:before{content:"\f10a";} +.icon-mobile-phone:before{content:"\f10b";} +.icon-circle-blank:before{content:"\f10c";} +.icon-quote-left:before{content:"\f10d";} +.icon-quote-right:before{content:"\f10e";} +.icon-spinner:before{content:"\f110";} +.icon-circle:before{content:"\f111";} +.icon-mail-reply:before,.icon-reply:before{content:"\f112";} +.icon-github-alt:before{content:"\f113";} +.icon-folder-close-alt:before{content:"\f114";} +.icon-folder-open-alt:before{content:"\f115";} +.icon-expand-alt:before{content:"\f116";} +.icon-collapse-alt:before{content:"\f117";} +.icon-smile:before{content:"\f118";} +.icon-frown:before{content:"\f119";} +.icon-meh:before{content:"\f11a";} +.icon-gamepad:before{content:"\f11b";} +.icon-keyboard:before{content:"\f11c";} +.icon-flag-alt:before{content:"\f11d";} +.icon-flag-checkered:before{content:"\f11e";} +.icon-terminal:before{content:"\f120";} +.icon-code:before{content:"\f121";} +.icon-reply-all:before{content:"\f122";} +.icon-mail-reply-all:before{content:"\f122";} +.icon-star-half-full:before,.icon-star-half-empty:before{content:"\f123";} +.icon-location-arrow:before{content:"\f124";} +.icon-crop:before{content:"\f125";} +.icon-code-fork:before{content:"\f126";} +.icon-unlink:before{content:"\f127";} +.icon-question:before{content:"\f128";} +.icon-info:before{content:"\f129";} +.icon-exclamation:before{content:"\f12a";} +.icon-superscript:before{content:"\f12b";} +.icon-subscript:before{content:"\f12c";} +.icon-eraser:before{content:"\f12d";} +.icon-puzzle-piece:before{content:"\f12e";} +.icon-microphone:before{content:"\f130";} +.icon-microphone-off:before{content:"\f131";} +.icon-shield:before{content:"\f132";} +.icon-calendar-empty:before{content:"\f133";} +.icon-fire-extinguisher:before{content:"\f134";} +.icon-rocket:before{content:"\f135";} +.icon-maxcdn:before{content:"\f136";} +.icon-chevron-sign-left:before{content:"\f137";} +.icon-chevron-sign-right:before{content:"\f138";} +.icon-chevron-sign-up:before{content:"\f139";} +.icon-chevron-sign-down:before{content:"\f13a";} +.icon-html5:before{content:"\f13b";} +.icon-css3:before{content:"\f13c";} +.icon-anchor:before{content:"\f13d";} +.icon-unlock-alt:before{content:"\f13e";} +.icon-bullseye:before{content:"\f140";} +.icon-ellipsis-horizontal:before{content:"\f141";} +.icon-ellipsis-vertical:before{content:"\f142";} +.icon-rss-sign:before{content:"\f143";} +.icon-play-sign:before{content:"\f144";} +.icon-ticket:before{content:"\f145";} +.icon-minus-sign-alt:before{content:"\f146";} +.icon-check-minus:before{content:"\f147";} +.icon-level-up:before{content:"\f148";} +.icon-level-down:before{content:"\f149";} +.icon-check-sign:before{content:"\f14a";} +.icon-edit-sign:before{content:"\f14b";} +.icon-external-link-sign:before{content:"\f14c";} +.icon-share-sign:before{content:"\f14d";} +.icon-compass:before{content:"\f14e";} +.icon-collapse:before{content:"\f150";} +.icon-collapse-top:before{content:"\f151";} +.icon-expand:before{content:"\f152";} +.icon-euro:before,.icon-eur:before{content:"\f153";} +.icon-gbp:before{content:"\f154";} +.icon-dollar:before,.icon-usd:before{content:"\f155";} +.icon-rupee:before,.icon-inr:before{content:"\f156";} +.icon-yen:before,.icon-jpy:before{content:"\f157";} +.icon-renminbi:before,.icon-cny:before{content:"\f158";} +.icon-won:before,.icon-krw:before{content:"\f159";} +.icon-bitcoin:before,.icon-btc:before{content:"\f15a";} +.icon-file:before{content:"\f15b";} +.icon-file-text:before{content:"\f15c";} +.icon-sort-by-alphabet:before{content:"\f15d";} +.icon-sort-by-alphabet-alt:before{content:"\f15e";} +.icon-sort-by-attributes:before{content:"\f160";} +.icon-sort-by-attributes-alt:before{content:"\f161";} +.icon-sort-by-order:before{content:"\f162";} +.icon-sort-by-order-alt:before{content:"\f163";} +.icon-thumbs-up:before{content:"\f164";} +.icon-thumbs-down:before{content:"\f165";} +.icon-youtube-sign:before{content:"\f166";} +.icon-youtube:before{content:"\f167";} +.icon-xing:before{content:"\f168";} +.icon-xing-sign:before{content:"\f169";} +.icon-youtube-play:before{content:"\f16a";} +.icon-dropbox:before{content:"\f16b";} +.icon-stackexchange:before{content:"\f16c";} +.icon-instagram:before{content:"\f16d";} +.icon-flickr:before{content:"\f16e";} +.icon-adn:before{content:"\f170";} +.icon-bitbucket:before{content:"\f171";} +.icon-bitbucket-sign:before{content:"\f172";} +.icon-tumblr:before{content:"\f173";} +.icon-tumblr-sign:before{content:"\f174";} +.icon-long-arrow-down:before{content:"\f175";} +.icon-long-arrow-up:before{content:"\f176";} +.icon-long-arrow-left:before{content:"\f177";} +.icon-long-arrow-right:before{content:"\f178";} +.icon-apple:before{content:"\f179";} +.icon-windows:before{content:"\f17a";} +.icon-android:before{content:"\f17b";} +.icon-linux:before{content:"\f17c";} +.icon-dribbble:before{content:"\f17d";} +.icon-skype:before{content:"\f17e";} +.icon-foursquare:before{content:"\f180";} +.icon-trello:before{content:"\f181";} +.icon-female:before{content:"\f182";} +.icon-male:before{content:"\f183";} +.icon-gittip:before{content:"\f184";} +.icon-sun:before{content:"\f185";} +.icon-moon:before{content:"\f186";} +.icon-archive:before{content:"\f187";} +.icon-bug:before{content:"\f188";} +.icon-vk:before{content:"\f189";} +.icon-weibo:before{content:"\f18a";} +.icon-renren:before{content:"\f18b";} diff --git a/stylesheets/font-awesome/font/FontAwesome.otf b/stylesheets/font-awesome/font/FontAwesome.otf Binary files differnew file mode 100644 index 00000000..70125459 --- /dev/null +++ b/stylesheets/font-awesome/font/FontAwesome.otf diff --git a/stylesheets/font-awesome/font/fontawesome-webfont.eot b/stylesheets/font-awesome/font/fontawesome-webfont.eot Binary files differnew file mode 100755 index 00000000..0662cb96 --- /dev/null +++ b/stylesheets/font-awesome/font/fontawesome-webfont.eot diff --git a/stylesheets/font-awesome/font/fontawesome-webfont.svg b/stylesheets/font-awesome/font/fontawesome-webfont.svg new file mode 100755 index 00000000..2edb4ec3 --- /dev/null +++ b/stylesheets/font-awesome/font/fontawesome-webfont.svg @@ -0,0 +1,399 @@ +<?xml version="1.0" standalone="no"?> +<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" > +<svg xmlns="http://www.w3.org/2000/svg"> +<metadata></metadata> +<defs> +<font id="fontawesomeregular" horiz-adv-x="1536" > +<font-face units-per-em="1792" ascent="1536" descent="-256" /> +<missing-glyph horiz-adv-x="448" /> +<glyph unicode=" " horiz-adv-x="448" /> +<glyph unicode="	" horiz-adv-x="448" /> +<glyph unicode=" " horiz-adv-x="448" /> +<glyph unicode="¨" horiz-adv-x="1792" /> +<glyph unicode="©" horiz-adv-x="1792" /> +<glyph unicode="®" horiz-adv-x="1792" /> +<glyph unicode="´" horiz-adv-x="1792" /> +<glyph unicode="Æ" horiz-adv-x="1792" /> +<glyph unicode=" " horiz-adv-x="768" /> +<glyph unicode=" " /> +<glyph unicode=" " horiz-adv-x="768" /> +<glyph unicode=" " /> +<glyph unicode=" " horiz-adv-x="512" /> +<glyph unicode=" " horiz-adv-x="384" /> +<glyph unicode=" " horiz-adv-x="256" /> +<glyph unicode=" " horiz-adv-x="256" /> +<glyph unicode=" " horiz-adv-x="192" /> +<glyph unicode=" " horiz-adv-x="307" /> +<glyph unicode=" " horiz-adv-x="85" /> +<glyph unicode=" " horiz-adv-x="307" /> +<glyph unicode=" " horiz-adv-x="384" /> +<glyph unicode="™" horiz-adv-x="1792" /> +<glyph unicode="∞" horiz-adv-x="1792" /> +<glyph unicode="≠" horiz-adv-x="1792" /> +<glyph unicode="" horiz-adv-x="500" d="M0 0z" /> +<glyph unicode="" horiz-adv-x="1792" d="M1699 1350q0 -35 -43 -78l-632 -632v-768h320q26 0 45 -19t19 -45t-19 -45t-45 -19h-896q-26 0 -45 19t-19 45t19 45t45 19h320v768l-632 632q-43 43 -43 78q0 23 18 36.5t38 17.5t43 4h1408q23 0 43 -4t38 -17.5t18 -36.5z" /> +<glyph unicode="" d="M1536 1312v-1120q0 -50 -34 -89t-86 -60.5t-103.5 -32t-96.5 -10.5t-96.5 10.5t-103.5 32t-86 60.5t-34 89t34 89t86 60.5t103.5 32t96.5 10.5q105 0 192 -39v537l-768 -237v-709q0 -50 -34 -89t-86 -60.5t-103.5 -32t-96.5 -10.5t-96.5 10.5t-103.5 32t-86 60.5t-34 89 t34 89t86 60.5t103.5 32t96.5 10.5q105 0 192 -39v967q0 31 19 56.5t49 35.5l832 256q12 4 28 4q40 0 68 -28t28 -68z" /> +<glyph unicode="" horiz-adv-x="1664" d="M1152 704q0 185 -131.5 316.5t-316.5 131.5t-316.5 -131.5t-131.5 -316.5t131.5 -316.5t316.5 -131.5t316.5 131.5t131.5 316.5zM1664 -128q0 -52 -38 -90t-90 -38q-54 0 -90 38l-343 342q-179 -124 -399 -124q-143 0 -273.5 55.5t-225 150t-150 225t-55.5 273.5 t55.5 273.5t150 225t225 150t273.5 55.5t273.5 -55.5t225 -150t150 -225t55.5 -273.5q0 -220 -124 -399l343 -343q37 -37 37 -90z" /> +<glyph unicode="" horiz-adv-x="1792" d="M1664 32v768q-32 -36 -69 -66q-268 -206 -426 -338q-51 -43 -83 -67t-86.5 -48.5t-102.5 -24.5h-1h-1q-48 0 -102.5 24.5t-86.5 48.5t-83 67q-158 132 -426 338q-37 30 -69 66v-768q0 -13 9.5 -22.5t22.5 -9.5h1472q13 0 22.5 9.5t9.5 22.5zM1664 1083v11v13.5t-0.5 13 t-3 12.5t-5.5 9t-9 7.5t-14 2.5h-1472q-13 0 -22.5 -9.5t-9.5 -22.5q0 -168 147 -284q193 -152 401 -317q6 -5 35 -29.5t46 -37.5t44.5 -31.5t50.5 -27.5t43 -9h1h1q20 0 43 9t50.5 27.5t44.5 31.5t46 37.5t35 29.5q208 165 401 317q54 43 100.5 115.5t46.5 131.5z M1792 1120v-1088q0 -66 -47 -113t-113 -47h-1472q-66 0 -113 47t-47 113v1088q0 66 47 113t113 47h1472q66 0 113 -47t47 -113z" /> +<glyph unicode="" horiz-adv-x="1792" d="M896 -128q-26 0 -44 18l-624 602q-10 8 -27.5 26t-55.5 65.5t-68 97.5t-53.5 121t-23.5 138q0 220 127 344t351 124q62 0 126.5 -21.5t120 -58t95.5 -68.5t76 -68q36 36 76 68t95.5 68.5t120 58t126.5 21.5q224 0 351 -124t127 -344q0 -221 -229 -450l-623 -600 q-18 -18 -44 -18z" /> +<glyph unicode="" horiz-adv-x="1664" d="M1664 889q0 -22 -26 -48l-363 -354l86 -500q1 -7 1 -20q0 -21 -10.5 -35.5t-30.5 -14.5q-19 0 -40 12l-449 236l-449 -236q-22 -12 -40 -12q-21 0 -31.5 14.5t-10.5 35.5q0 6 2 20l86 500l-364 354q-25 27 -25 48q0 37 56 46l502 73l225 455q19 41 49 41t49 -41l225 -455 l502 -73q56 -9 56 -46z" /> +<glyph unicode="" horiz-adv-x="1664" d="M1137 532l306 297l-422 62l-189 382l-189 -382l-422 -62l306 -297l-73 -421l378 199l377 -199zM1664 889q0 -22 -26 -48l-363 -354l86 -500q1 -7 1 -20q0 -50 -41 -50q-19 0 -40 12l-449 236l-449 -236q-22 -12 -40 -12q-21 0 -31.5 14.5t-10.5 35.5q0 6 2 20l86 500 l-364 354q-25 27 -25 48q0 37 56 46l502 73l225 455q19 41 49 41t49 -41l225 -455l502 -73q56 -9 56 -46z" /> +<glyph unicode="" horiz-adv-x="1408" d="M1408 131q0 -120 -73 -189.5t-194 -69.5h-874q-121 0 -194 69.5t-73 189.5q0 53 3.5 103.5t14 109t26.5 108.5t43 97.5t62 81t85.5 53.5t111.5 20q9 0 42 -21.5t74.5 -48t108 -48t133.5 -21.5t133.5 21.5t108 48t74.5 48t42 21.5q61 0 111.5 -20t85.5 -53.5t62 -81 t43 -97.5t26.5 -108.5t14 -109t3.5 -103.5zM1088 1024q0 -159 -112.5 -271.5t-271.5 -112.5t-271.5 112.5t-112.5 271.5t112.5 271.5t271.5 112.5t271.5 -112.5t112.5 -271.5z" /> +<glyph unicode="" horiz-adv-x="1920" d="M384 -64v128q0 26 -19 45t-45 19h-128q-26 0 -45 -19t-19 -45v-128q0 -26 19 -45t45 -19h128q26 0 45 19t19 45zM384 320v128q0 26 -19 45t-45 19h-128q-26 0 -45 -19t-19 -45v-128q0 -26 19 -45t45 -19h128q26 0 45 19t19 45zM384 704v128q0 26 -19 45t-45 19h-128 q-26 0 -45 -19t-19 -45v-128q0 -26 19 -45t45 -19h128q26 0 45 19t19 45zM1408 -64v512q0 26 -19 45t-45 19h-768q-26 0 -45 -19t-19 -45v-512q0 -26 19 -45t45 -19h768q26 0 45 19t19 45zM384 1088v128q0 26 -19 45t-45 19h-128q-26 0 -45 -19t-19 -45v-128q0 -26 19 -45 t45 -19h128q26 0 45 19t19 45zM1792 -64v128q0 26 -19 45t-45 19h-128q-26 0 -45 -19t-19 -45v-128q0 -26 19 -45t45 -19h128q26 0 45 19t19 45zM1408 704v512q0 26 -19 45t-45 19h-768q-26 0 -45 -19t-19 -45v-512q0 -26 19 -45t45 -19h768q26 0 45 19t19 45zM1792 320v128 q0 26 -19 45t-45 19h-128q-26 0 -45 -19t-19 -45v-128q0 -26 19 -45t45 -19h128q26 0 45 19t19 45zM1792 704v128q0 26 -19 45t-45 19h-128q-26 0 -45 -19t-19 -45v-128q0 -26 19 -45t45 -19h128q26 0 45 19t19 45zM1792 1088v128q0 26 -19 45t-45 19h-128q-26 0 -45 -19 t-19 -45v-128q0 -26 19 -45t45 -19h128q26 0 45 19t19 45zM1920 1248v-1344q0 -66 -47 -113t-113 -47h-1600q-66 0 -113 47t-47 113v1344q0 66 47 113t113 47h1600q66 0 113 -47t47 -113z" /> +<glyph unicode="" horiz-adv-x="1664" d="M768 512v-384q0 -52 -38 -90t-90 -38h-512q-52 0 -90 38t-38 90v384q0 52 38 90t90 38h512q52 0 90 -38t38 -90zM768 1280v-384q0 -52 -38 -90t-90 -38h-512q-52 0 -90 38t-38 90v384q0 52 38 90t90 38h512q52 0 90 -38t38 -90zM1664 512v-384q0 -52 -38 -90t-90 -38 h-512q-52 0 -90 38t-38 90v384q0 52 38 90t90 38h512q52 0 90 -38t38 -90zM1664 1280v-384q0 -52 -38 -90t-90 -38h-512q-52 0 -90 38t-38 90v384q0 52 38 90t90 38h512q52 0 90 -38t38 -90z" /> +<glyph unicode="" horiz-adv-x="1792" d="M512 288v-192q0 -40 -28 -68t-68 -28h-320q-40 0 -68 28t-28 68v192q0 40 28 68t68 28h320q40 0 68 -28t28 -68zM512 800v-192q0 -40 -28 -68t-68 -28h-320q-40 0 -68 28t-28 68v192q0 40 28 68t68 28h320q40 0 68 -28t28 -68zM1152 288v-192q0 -40 -28 -68t-68 -28h-320 q-40 0 -68 28t-28 68v192q0 40 28 68t68 28h320q40 0 68 -28t28 -68zM512 1312v-192q0 -40 -28 -68t-68 -28h-320q-40 0 -68 28t-28 68v192q0 40 28 68t68 28h320q40 0 68 -28t28 -68zM1152 800v-192q0 -40 -28 -68t-68 -28h-320q-40 0 -68 28t-28 68v192q0 40 28 68t68 28 h320q40 0 68 -28t28 -68zM1792 288v-192q0 -40 -28 -68t-68 -28h-320q-40 0 -68 28t-28 68v192q0 40 28 68t68 28h320q40 0 68 -28t28 -68zM1152 1312v-192q0 -40 -28 -68t-68 -28h-320q-40 0 -68 28t-28 68v192q0 40 28 68t68 28h320q40 0 68 -28t28 -68zM1792 800v-192 q0 -40 -28 -68t-68 -28h-320q-40 0 -68 28t-28 68v192q0 40 28 68t68 28h320q40 0 68 -28t28 -68zM1792 1312v-192q0 -40 -28 -68t-68 -28h-320q-40 0 -68 28t-28 68v192q0 40 28 68t68 28h320q40 0 68 -28t28 -68z" /> +<glyph unicode="" horiz-adv-x="1792" d="M512 288v-192q0 -40 -28 -68t-68 -28h-320q-40 0 -68 28t-28 68v192q0 40 28 68t68 28h320q40 0 68 -28t28 -68zM512 800v-192q0 -40 -28 -68t-68 -28h-320q-40 0 -68 28t-28 68v192q0 40 28 68t68 28h320q40 0 68 -28t28 -68zM1792 288v-192q0 -40 -28 -68t-68 -28h-960 q-40 0 -68 28t-28 68v192q0 40 28 68t68 28h960q40 0 68 -28t28 -68zM512 1312v-192q0 -40 -28 -68t-68 -28h-320q-40 0 -68 28t-28 68v192q0 40 28 68t68 28h320q40 0 68 -28t28 -68zM1792 800v-192q0 -40 -28 -68t-68 -28h-960q-40 0 -68 28t-28 68v192q0 40 28 68t68 28 h960q40 0 68 -28t28 -68zM1792 1312v-192q0 -40 -28 -68t-68 -28h-960q-40 0 -68 28t-28 68v192q0 40 28 68t68 28h960q40 0 68 -28t28 -68z" /> +<glyph unicode="" horiz-adv-x="1792" d="M1671 970q0 -40 -28 -68l-724 -724l-136 -136q-28 -28 -68 -28t-68 28l-136 136l-362 362q-28 28 -28 68t28 68l136 136q28 28 68 28t68 -28l294 -295l656 657q28 28 68 28t68 -28l136 -136q28 -28 28 -68z" /> +<glyph unicode="" horiz-adv-x="1408" d="M1298 214q0 -40 -28 -68l-136 -136q-28 -28 -68 -28t-68 28l-294 294l-294 -294q-28 -28 -68 -28t-68 28l-136 136q-28 28 -28 68t28 68l294 294l-294 294q-28 28 -28 68t28 68l136 136q28 28 68 28t68 -28l294 -294l294 294q28 28 68 28t68 -28l136 -136q28 -28 28 -68 t-28 -68l-294 -294l294 -294q28 -28 28 -68z" /> +<glyph unicode="" horiz-adv-x="1664" d="M1024 736v-64q0 -13 -9.5 -22.5t-22.5 -9.5h-224v-224q0 -13 -9.5 -22.5t-22.5 -9.5h-64q-13 0 -22.5 9.5t-9.5 22.5v224h-224q-13 0 -22.5 9.5t-9.5 22.5v64q0 13 9.5 22.5t22.5 9.5h224v224q0 13 9.5 22.5t22.5 9.5h64q13 0 22.5 -9.5t9.5 -22.5v-224h224 q13 0 22.5 -9.5t9.5 -22.5zM1152 704q0 185 -131.5 316.5t-316.5 131.5t-316.5 -131.5t-131.5 -316.5t131.5 -316.5t316.5 -131.5t316.5 131.5t131.5 316.5zM1664 -128q0 -53 -37.5 -90.5t-90.5 -37.5q-54 0 -90 38l-343 342q-179 -124 -399 -124q-143 0 -273.5 55.5 t-225 150t-150 225t-55.5 273.5t55.5 273.5t150 225t225 150t273.5 55.5t273.5 -55.5t225 -150t150 -225t55.5 -273.5q0 -220 -124 -399l343 -343q37 -37 37 -90z" /> +<glyph unicode="" horiz-adv-x="1664" d="M1024 736v-64q0 -13 -9.5 -22.5t-22.5 -9.5h-576q-13 0 -22.5 9.5t-9.5 22.5v64q0 13 9.5 22.5t22.5 9.5h576q13 0 22.5 -9.5t9.5 -22.5zM1152 704q0 185 -131.5 316.5t-316.5 131.5t-316.5 -131.5t-131.5 -316.5t131.5 -316.5t316.5 -131.5t316.5 131.5t131.5 316.5z M1664 -128q0 -53 -37.5 -90.5t-90.5 -37.5q-54 0 -90 38l-343 342q-179 -124 -399 -124q-143 0 -273.5 55.5t-225 150t-150 225t-55.5 273.5t55.5 273.5t150 225t225 150t273.5 55.5t273.5 -55.5t225 -150t150 -225t55.5 -273.5q0 -220 -124 -399l343 -343q37 -37 37 -90z " /> +<glyph unicode="" d="M1536 640q0 -156 -61 -298t-164 -245t-245 -164t-298 -61t-298 61t-245 164t-164 245t-61 298q0 182 80.5 343t226.5 270q43 32 95.5 25t83.5 -50q32 -42 24.5 -94.5t-49.5 -84.5q-98 -74 -151.5 -181t-53.5 -228q0 -104 40.5 -198.5t109.5 -163.5t163.5 -109.5 t198.5 -40.5t198.5 40.5t163.5 109.5t109.5 163.5t40.5 198.5q0 121 -53.5 228t-151.5 181q-42 32 -49.5 84.5t24.5 94.5q31 43 84 50t95 -25q146 -109 226.5 -270t80.5 -343zM896 1408v-640q0 -52 -38 -90t-90 -38t-90 38t-38 90v640q0 52 38 90t90 38t90 -38t38 -90z" /> +<glyph unicode="" horiz-adv-x="1792" d="M256 96v-192q0 -14 -9 -23t-23 -9h-192q-14 0 -23 9t-9 23v192q0 14 9 23t23 9h192q14 0 23 -9t9 -23zM640 224v-320q0 -14 -9 -23t-23 -9h-192q-14 0 -23 9t-9 23v320q0 14 9 23t23 9h192q14 0 23 -9t9 -23zM1024 480v-576q0 -14 -9 -23t-23 -9h-192q-14 0 -23 9t-9 23 v576q0 14 9 23t23 9h192q14 0 23 -9t9 -23zM1408 864v-960q0 -14 -9 -23t-23 -9h-192q-14 0 -23 9t-9 23v960q0 14 9 23t23 9h192q14 0 23 -9t9 -23zM1792 1376v-1472q0 -14 -9 -23t-23 -9h-192q-14 0 -23 9t-9 23v1472q0 14 9 23t23 9h192q14 0 23 -9t9 -23z" /> +<glyph unicode="" d="M1024 640q0 106 -75 181t-181 75t-181 -75t-75 -181t75 -181t181 -75t181 75t75 181zM1536 749v-222q0 -12 -8 -23t-20 -13l-185 -28q-19 -54 -39 -91q35 -50 107 -138q10 -12 10 -25t-9 -23q-27 -37 -99 -108t-94 -71q-12 0 -26 9l-138 108q-44 -23 -91 -38 q-16 -136 -29 -186q-7 -28 -36 -28h-222q-14 0 -24.5 8.5t-11.5 21.5l-28 184q-49 16 -90 37l-141 -107q-10 -9 -25 -9q-14 0 -25 11q-126 114 -165 168q-7 10 -7 23q0 12 8 23q15 21 51 66.5t54 70.5q-27 50 -41 99l-183 27q-13 2 -21 12.5t-8 23.5v222q0 12 8 23t19 13 l186 28q14 46 39 92q-40 57 -107 138q-10 12 -10 24q0 10 9 23q26 36 98.5 107.5t94.5 71.5q13 0 26 -10l138 -107q44 23 91 38q16 136 29 186q7 28 36 28h222q14 0 24.5 -8.5t11.5 -21.5l28 -184q49 -16 90 -37l142 107q9 9 24 9q13 0 25 -10q129 -119 165 -170q7 -8 7 -22 q0 -12 -8 -23q-15 -21 -51 -66.5t-54 -70.5q26 -50 41 -98l183 -28q13 -2 21 -12.5t8 -23.5z" /> +<glyph unicode="" horiz-adv-x="1408" d="M512 800v-576q0 -14 -9 -23t-23 -9h-64q-14 0 -23 9t-9 23v576q0 14 9 23t23 9h64q14 0 23 -9t9 -23zM768 800v-576q0 -14 -9 -23t-23 -9h-64q-14 0 -23 9t-9 23v576q0 14 9 23t23 9h64q14 0 23 -9t9 -23zM1024 800v-576q0 -14 -9 -23t-23 -9h-64q-14 0 -23 9t-9 23v576 q0 14 9 23t23 9h64q14 0 23 -9t9 -23zM1152 76v948h-896v-948q0 -22 7 -40.5t14.5 -27t10.5 -8.5h832q3 0 10.5 8.5t14.5 27t7 40.5zM480 1152h448l-48 117q-7 9 -17 11h-317q-10 -2 -17 -11zM1408 1120v-64q0 -14 -9 -23t-23 -9h-96v-948q0 -83 -47 -143.5t-113 -60.5h-832 q-66 0 -113 58.5t-47 141.5v952h-96q-14 0 -23 9t-9 23v64q0 14 9 23t23 9h309l70 167q15 37 54 63t79 26h320q40 0 79 -26t54 -63l70 -167h309q14 0 23 -9t9 -23z" /> +<glyph unicode="" horiz-adv-x="1664" d="M1408 544v-480q0 -26 -19 -45t-45 -19h-384v384h-256v-384h-384q-26 0 -45 19t-19 45v480q0 1 0.5 3t0.5 3l575 474l575 -474q1 -2 1 -6zM1631 613l-62 -74q-8 -9 -21 -11h-3q-13 0 -21 7l-692 577l-692 -577q-12 -8 -24 -7q-13 2 -21 11l-62 74q-8 10 -7 23.5t11 21.5 l719 599q32 26 76 26t76 -26l244 -204v195q0 14 9 23t23 9h192q14 0 23 -9t9 -23v-408l219 -182q10 -8 11 -21.5t-7 -23.5z" /> +<glyph unicode="" horiz-adv-x="1280" d="M128 0h1024v768h-416q-40 0 -68 28t-28 68v416h-512v-1280zM768 896h376q-10 29 -22 41l-313 313q-12 12 -41 22v-376zM1280 864v-896q0 -40 -28 -68t-68 -28h-1088q-40 0 -68 28t-28 68v1344q0 40 28 68t68 28h640q40 0 88 -20t76 -48l312 -312q28 -28 48 -76t20 -88z " /> +<glyph unicode="" d="M896 992v-448q0 -14 -9 -23t-23 -9h-320q-14 0 -23 9t-9 23v64q0 14 9 23t23 9h224v352q0 14 9 23t23 9h64q14 0 23 -9t9 -23zM1312 640q0 148 -73 273t-198 198t-273 73t-273 -73t-198 -198t-73 -273t73 -273t198 -198t273 -73t273 73t198 198t73 273zM1536 640 q0 -209 -103 -385.5t-279.5 -279.5t-385.5 -103t-385.5 103t-279.5 279.5t-103 385.5t103 385.5t279.5 279.5t385.5 103t385.5 -103t279.5 -279.5t103 -385.5z" /> +<glyph unicode="" horiz-adv-x="1920" d="M1111 540v4l-24 320q-1 13 -11 22.5t-23 9.5h-186q-13 0 -23 -9.5t-11 -22.5l-24 -320v-4q-1 -12 8 -20t21 -8h244q12 0 21 8t8 20zM1870 73q0 -73 -46 -73h-704q13 0 22 9.5t8 22.5l-20 256q-1 13 -11 22.5t-23 9.5h-272q-13 0 -23 -9.5t-11 -22.5l-20 -256 q-1 -13 8 -22.5t22 -9.5h-704q-46 0 -46 73q0 54 26 116l417 1044q8 19 26 33t38 14h339q-13 0 -23 -9.5t-11 -22.5l-15 -192q-1 -14 8 -23t22 -9h166q13 0 22 9t8 23l-15 192q-1 13 -11 22.5t-23 9.5h339q20 0 38 -14t26 -33l417 -1044q26 -62 26 -116z" /> +<glyph unicode="" horiz-adv-x="1664" d="M1280 192q0 26 -19 45t-45 19t-45 -19t-19 -45t19 -45t45 -19t45 19t19 45zM1536 192q0 26 -19 45t-45 19t-45 -19t-19 -45t19 -45t45 -19t45 19t19 45zM1664 416v-320q0 -40 -28 -68t-68 -28h-1472q-40 0 -68 28t-28 68v320q0 40 28 68t68 28h465l135 -136 q58 -56 136 -56t136 56l136 136h464q40 0 68 -28t28 -68zM1339 985q17 -41 -14 -70l-448 -448q-18 -19 -45 -19t-45 19l-448 448q-31 29 -14 70q17 39 59 39h256v448q0 26 19 45t45 19h256q26 0 45 -19t19 -45v-448h256q42 0 59 -39z" /> +<glyph unicode="" d="M1120 608q0 -12 -10 -24l-319 -319q-11 -9 -23 -9t-23 9l-320 320q-15 16 -7 35q8 20 30 20h192v352q0 14 9 23t23 9h192q14 0 23 -9t9 -23v-352h192q14 0 23 -9t9 -23zM768 1184q-148 0 -273 -73t-198 -198t-73 -273t73 -273t198 -198t273 -73t273 73t198 198t73 273 t-73 273t-198 198t-273 73zM1536 640q0 -209 -103 -385.5t-279.5 -279.5t-385.5 -103t-385.5 103t-279.5 279.5t-103 385.5t103 385.5t279.5 279.5t385.5 103t385.5 -103t279.5 -279.5t103 -385.5z" /> +<glyph unicode="" d="M1118 660q-8 -20 -30 -20h-192v-352q0 -14 -9 -23t-23 -9h-192q-14 0 -23 9t-9 23v352h-192q-14 0 -23 9t-9 23q0 12 10 24l319 319q11 9 23 9t23 -9l320 -320q15 -16 7 -35zM768 1184q-148 0 -273 -73t-198 -198t-73 -273t73 -273t198 -198t273 -73t273 73t198 198 t73 273t-73 273t-198 198t-273 73zM1536 640q0 -209 -103 -385.5t-279.5 -279.5t-385.5 -103t-385.5 103t-279.5 279.5t-103 385.5t103 385.5t279.5 279.5t385.5 103t385.5 -103t279.5 -279.5t103 -385.5z" /> +<glyph unicode="" d="M1023 576h316q-1 3 -2.5 8t-2.5 8l-212 496h-708l-212 -496q-1 -2 -2.5 -8t-2.5 -8h316l95 -192h320zM1536 546v-482q0 -26 -19 -45t-45 -19h-1408q-26 0 -45 19t-19 45v482q0 62 25 123l238 552q10 25 36.5 42t52.5 17h832q26 0 52.5 -17t36.5 -42l238 -552 q25 -61 25 -123z" /> +<glyph unicode="" d="M1184 640q0 -37 -32 -55l-544 -320q-15 -9 -32 -9q-16 0 -32 8q-32 19 -32 56v640q0 37 32 56q33 18 64 -1l544 -320q32 -18 32 -55zM1312 640q0 148 -73 273t-198 198t-273 73t-273 -73t-198 -198t-73 -273t73 -273t198 -198t273 -73t273 73t198 198t73 273zM1536 640 q0 -209 -103 -385.5t-279.5 -279.5t-385.5 -103t-385.5 103t-279.5 279.5t-103 385.5t103 385.5t279.5 279.5t385.5 103t385.5 -103t279.5 -279.5t103 -385.5z" /> +<glyph unicode="" d="M1536 1280v-448q0 -26 -19 -45t-45 -19h-448q-42 0 -59 40q-17 39 14 69l138 138q-148 137 -349 137q-104 0 -198.5 -40.5t-163.5 -109.5t-109.5 -163.5t-40.5 -198.5t40.5 -198.5t109.5 -163.5t163.5 -109.5t198.5 -40.5q119 0 225 52t179 147q7 10 23 12q14 0 25 -9 l137 -138q9 -8 9.5 -20.5t-7.5 -22.5q-109 -132 -264 -204.5t-327 -72.5q-156 0 -298 61t-245 164t-164 245t-61 298t61 298t164 245t245 164t298 61q147 0 284.5 -55.5t244.5 -156.5l130 129q29 31 70 14q39 -17 39 -59z" /> +<glyph unicode="" d="M1511 480q0 -5 -1 -7q-64 -268 -268 -434.5t-478 -166.5q-146 0 -282.5 55t-243.5 157l-129 -129q-19 -19 -45 -19t-45 19t-19 45v448q0 26 19 45t45 19h448q26 0 45 -19t19 -45t-19 -45l-137 -137q71 -66 161 -102t187 -36q134 0 250 65t186 179q11 17 53 117 q8 23 30 23h192q13 0 22.5 -9.5t9.5 -22.5zM1536 1280v-448q0 -26 -19 -45t-45 -19h-448q-26 0 -45 19t-19 45t19 45l138 138q-148 137 -349 137q-134 0 -250 -65t-186 -179q-11 -17 -53 -117q-8 -23 -30 -23h-199q-13 0 -22.5 9.5t-9.5 22.5v7q65 268 270 434.5t480 166.5 q146 0 284 -55.5t245 -156.5l130 129q19 19 45 19t45 -19t19 -45z" /> +<glyph unicode="" horiz-adv-x="1792" d="M384 352v-64q0 -13 -9.5 -22.5t-22.5 -9.5h-64q-13 0 -22.5 9.5t-9.5 22.5v64q0 13 9.5 22.5t22.5 9.5h64q13 0 22.5 -9.5t9.5 -22.5zM384 608v-64q0 -13 -9.5 -22.5t-22.5 -9.5h-64q-13 0 -22.5 9.5t-9.5 22.5v64q0 13 9.5 22.5t22.5 9.5h64q13 0 22.5 -9.5t9.5 -22.5z M384 864v-64q0 -13 -9.5 -22.5t-22.5 -9.5h-64q-13 0 -22.5 9.5t-9.5 22.5v64q0 13 9.5 22.5t22.5 9.5h64q13 0 22.5 -9.5t9.5 -22.5zM1536 352v-64q0 -13 -9.5 -22.5t-22.5 -9.5h-960q-13 0 -22.5 9.5t-9.5 22.5v64q0 13 9.5 22.5t22.5 9.5h960q13 0 22.5 -9.5t9.5 -22.5z M1536 608v-64q0 -13 -9.5 -22.5t-22.5 -9.5h-960q-13 0 -22.5 9.5t-9.5 22.5v64q0 13 9.5 22.5t22.5 9.5h960q13 0 22.5 -9.5t9.5 -22.5zM1536 864v-64q0 -13 -9.5 -22.5t-22.5 -9.5h-960q-13 0 -22.5 9.5t-9.5 22.5v64q0 13 9.5 22.5t22.5 9.5h960q13 0 22.5 -9.5 t9.5 -22.5zM1664 160v832q0 13 -9.5 22.5t-22.5 9.5h-1472q-13 0 -22.5 -9.5t-9.5 -22.5v-832q0 -13 9.5 -22.5t22.5 -9.5h1472q13 0 22.5 9.5t9.5 22.5zM1792 1248v-1088q0 -66 -47 -113t-113 -47h-1472q-66 0 -113 47t-47 113v1088q0 66 47 113t113 47h1472q66 0 113 -47 t47 -113z" /> +<glyph unicode="" horiz-adv-x="1152" d="M320 768h512v192q0 106 -75 181t-181 75t-181 -75t-75 -181v-192zM1152 672v-576q0 -40 -28 -68t-68 -28h-960q-40 0 -68 28t-28 68v576q0 40 28 68t68 28h32v192q0 184 132 316t316 132t316 -132t132 -316v-192h32q40 0 68 -28t28 -68z" /> +<glyph unicode="" horiz-adv-x="1792" d="M320 1280q0 -72 -64 -110v-1266q0 -13 -9.5 -22.5t-22.5 -9.5h-64q-13 0 -22.5 9.5t-9.5 22.5v1266q-64 38 -64 110q0 53 37.5 90.5t90.5 37.5t90.5 -37.5t37.5 -90.5zM1792 1216v-763q0 -25 -12.5 -38.5t-39.5 -27.5q-215 -116 -369 -116q-61 0 -123.5 22t-108.5 48 t-115.5 48t-142.5 22q-192 0 -464 -146q-17 -9 -33 -9q-26 0 -45 19t-19 45v742q0 32 31 55q21 14 79 43q236 120 421 120q107 0 200 -29t219 -88q38 -19 88 -19q54 0 117.5 21t110 47t88 47t54.5 21q26 0 45 -19t19 -45z" /> +<glyph unicode="" horiz-adv-x="1664" d="M1664 650q0 -166 -60 -314l-20 -49l-185 -33q-22 -83 -90.5 -136.5t-156.5 -53.5v-32q0 -14 -9 -23t-23 -9h-64q-14 0 -23 9t-9 23v576q0 14 9 23t23 9h64q14 0 23 -9t9 -23v-32q71 0 130 -35.5t93 -95.5l68 12q29 95 29 193q0 148 -88 279t-236.5 209t-315.5 78 t-315.5 -78t-236.5 -209t-88 -279q0 -98 29 -193l68 -12q34 60 93 95.5t130 35.5v32q0 14 9 23t23 9h64q14 0 23 -9t9 -23v-576q0 -14 -9 -23t-23 -9h-64q-14 0 -23 9t-9 23v32q-88 0 -156.5 53.5t-90.5 136.5l-185 33l-20 49q-60 148 -60 314q0 151 67 291t179 242.5 t266 163.5t320 61t320 -61t266 -163.5t179 -242.5t67 -291z" /> +<glyph unicode="" horiz-adv-x="768" d="M768 1184v-1088q0 -26 -19 -45t-45 -19t-45 19l-333 333h-262q-26 0 -45 19t-19 45v384q0 26 19 45t45 19h262l333 333q19 19 45 19t45 -19t19 -45z" /> +<glyph unicode="" horiz-adv-x="1152" d="M768 1184v-1088q0 -26 -19 -45t-45 -19t-45 19l-333 333h-262q-26 0 -45 19t-19 45v384q0 26 19 45t45 19h262l333 333q19 19 45 19t45 -19t19 -45zM1152 640q0 -76 -42.5 -141.5t-112.5 -93.5q-10 -5 -25 -5q-26 0 -45 18.5t-19 45.5q0 21 12 35.5t29 25t34 23t29 35.5 t12 57t-12 57t-29 35.5t-34 23t-29 25t-12 35.5q0 27 19 45.5t45 18.5q15 0 25 -5q70 -27 112.5 -93t42.5 -142z" /> +<glyph unicode="" horiz-adv-x="1664" d="M768 1184v-1088q0 -26 -19 -45t-45 -19t-45 19l-333 333h-262q-26 0 -45 19t-19 45v384q0 26 19 45t45 19h262l333 333q19 19 45 19t45 -19t19 -45zM1152 640q0 -76 -42.5 -141.5t-112.5 -93.5q-10 -5 -25 -5q-26 0 -45 18.5t-19 45.5q0 21 12 35.5t29 25t34 23t29 35.5 t12 57t-12 57t-29 35.5t-34 23t-29 25t-12 35.5q0 27 19 45.5t45 18.5q15 0 25 -5q70 -27 112.5 -93t42.5 -142zM1408 640q0 -153 -85 -282.5t-225 -188.5q-13 -5 -25 -5q-27 0 -46 19t-19 45q0 39 39 59q56 29 76 44q74 54 115.5 135.5t41.5 173.5t-41.5 173.5 t-115.5 135.5q-20 15 -76 44q-39 20 -39 59q0 26 19 45t45 19q13 0 26 -5q140 -59 225 -188.5t85 -282.5zM1664 640q0 -230 -127 -422.5t-338 -283.5q-13 -5 -26 -5q-26 0 -45 19t-19 45q0 36 39 59q7 4 22.5 10.5t22.5 10.5q46 25 82 51q123 91 192 227t69 289t-69 289 t-192 227q-36 26 -82 51q-7 4 -22.5 10.5t-22.5 10.5q-39 23 -39 59q0 26 19 45t45 19q13 0 26 -5q211 -91 338 -283.5t127 -422.5z" /> +<glyph unicode="" horiz-adv-x="1408" d="M384 384v-128h-128v128h128zM384 1152v-128h-128v128h128zM1152 1152v-128h-128v128h128zM128 129h384v383h-384v-383zM128 896h384v384h-384v-384zM896 896h384v384h-384v-384zM640 640v-640h-640v640h640zM1152 128v-128h-128v128h128zM1408 128v-128h-128v128h128z M1408 640v-384h-384v128h-128v-384h-128v640h384v-128h128v128h128zM640 1408v-640h-640v640h640zM1408 1408v-640h-640v640h640z" /> +<glyph unicode="" horiz-adv-x="1792" d="M63 0h-63v1408h63v-1408zM126 1h-32v1407h32v-1407zM220 1h-31v1407h31v-1407zM377 1h-31v1407h31v-1407zM534 1h-62v1407h62v-1407zM660 1h-31v1407h31v-1407zM723 1h-31v1407h31v-1407zM786 1h-31v1407h31v-1407zM943 1h-63v1407h63v-1407zM1100 1h-63v1407h63v-1407z M1226 1h-63v1407h63v-1407zM1352 1h-63v1407h63v-1407zM1446 1h-63v1407h63v-1407zM1635 1h-94v1407h94v-1407zM1698 1h-32v1407h32v-1407zM1792 0h-63v1408h63v-1408z" /> +<glyph unicode="" d="M448 1088q0 53 -37.5 90.5t-90.5 37.5t-90.5 -37.5t-37.5 -90.5t37.5 -90.5t90.5 -37.5t90.5 37.5t37.5 90.5zM1515 512q0 -53 -37 -90l-491 -492q-39 -37 -91 -37q-53 0 -90 37l-715 716q-38 37 -64.5 101t-26.5 117v416q0 52 38 90t90 38h416q53 0 117 -26.5t102 -64.5 l715 -714q37 -39 37 -91z" /> +<glyph unicode="" horiz-adv-x="1920" d="M448 1088q0 53 -37.5 90.5t-90.5 37.5t-90.5 -37.5t-37.5 -90.5t37.5 -90.5t90.5 -37.5t90.5 37.5t37.5 90.5zM1515 512q0 -53 -37 -90l-491 -492q-39 -37 -91 -37q-53 0 -90 37l-715 716q-38 37 -64.5 101t-26.5 117v416q0 52 38 90t90 38h416q53 0 117 -26.5t102 -64.5 l715 -714q37 -39 37 -91zM1899 512q0 -53 -37 -90l-491 -492q-39 -37 -91 -37q-36 0 -59 14t-53 45l470 470q37 37 37 90q0 52 -37 91l-715 714q-38 38 -102 64.5t-117 26.5h224q53 0 117 -26.5t102 -64.5l715 -714q37 -39 37 -91z" /> +<glyph unicode="" horiz-adv-x="1664" d="M1639 1058q40 -57 18 -129l-275 -906q-19 -64 -76.5 -107.5t-122.5 -43.5h-923q-77 0 -148.5 53.5t-99.5 131.5q-24 67 -2 127q0 4 3 27t4 37q1 8 -3 21.5t-3 19.5q2 11 8 21t16.5 23.5t16.5 23.5q23 38 45 91.5t30 91.5q3 10 0.5 30t-0.5 28q3 11 17 28t17 23 q21 36 42 92t25 90q1 9 -2.5 32t0.5 28q4 13 22 30.5t22 22.5q19 26 42.5 84.5t27.5 96.5q1 8 -3 25.5t-2 26.5q2 8 9 18t18 23t17 21q8 12 16.5 30.5t15 35t16 36t19.5 32t26.5 23.5t36 11.5t47.5 -5.5l-1 -3q38 9 51 9h761q74 0 114 -56t18 -130l-274 -906 q-36 -119 -71.5 -153.5t-128.5 -34.5h-869q-27 0 -38 -15q-11 -16 -1 -43q24 -70 144 -70h923q29 0 56 15.5t35 41.5l300 987q7 22 5 57q38 -15 59 -43zM575 1056q-4 -13 2 -22.5t20 -9.5h608q13 0 25.5 9.5t16.5 22.5l21 64q4 13 -2 22.5t-20 9.5h-608q-13 0 -25.5 -9.5 t-16.5 -22.5zM492 800q-4 -13 2 -22.5t20 -9.5h608q13 0 25.5 9.5t16.5 22.5l21 64q4 13 -2 22.5t-20 9.5h-608q-13 0 -25.5 -9.5t-16.5 -22.5z" /> +<glyph unicode="" horiz-adv-x="1280" d="M1164 1408q23 0 44 -9q33 -13 52.5 -41t19.5 -62v-1289q0 -34 -19.5 -62t-52.5 -41q-19 -8 -44 -8q-48 0 -83 32l-441 424l-441 -424q-36 -33 -83 -33q-23 0 -44 9q-33 13 -52.5 41t-19.5 62v1289q0 34 19.5 62t52.5 41q21 9 44 9h1048z" /> +<glyph unicode="" horiz-adv-x="1664" d="M384 0h896v256h-896v-256zM384 640h896v384h-160q-40 0 -68 28t-28 68v160h-640v-640zM1536 576q0 26 -19 45t-45 19t-45 -19t-19 -45t19 -45t45 -19t45 19t19 45zM1664 576v-416q0 -13 -9.5 -22.5t-22.5 -9.5h-224v-160q0 -40 -28 -68t-68 -28h-960q-40 0 -68 28t-28 68 v160h-224q-13 0 -22.5 9.5t-9.5 22.5v416q0 79 56.5 135.5t135.5 56.5h64v544q0 40 28 68t68 28h672q40 0 88 -20t76 -48l152 -152q28 -28 48 -76t20 -88v-256h64q79 0 135.5 -56.5t56.5 -135.5z" /> +<glyph unicode="" horiz-adv-x="1920" d="M960 864q119 0 203.5 -84.5t84.5 -203.5t-84.5 -203.5t-203.5 -84.5t-203.5 84.5t-84.5 203.5t84.5 203.5t203.5 84.5zM1664 1280q106 0 181 -75t75 -181v-896q0 -106 -75 -181t-181 -75h-1408q-106 0 -181 75t-75 181v896q0 106 75 181t181 75h224l51 136 q19 49 69.5 84.5t103.5 35.5h512q53 0 103.5 -35.5t69.5 -84.5l51 -136h224zM960 128q185 0 316.5 131.5t131.5 316.5t-131.5 316.5t-316.5 131.5t-316.5 -131.5t-131.5 -316.5t131.5 -316.5t316.5 -131.5z" /> +<glyph unicode="" horiz-adv-x="1664" d="M725 977l-170 -450q73 -1 153.5 -2t119 -1.5t52.5 -0.5l29 2q-32 95 -92 241q-53 132 -92 211zM21 -128h-21l2 79q22 7 80 18q89 16 110 31q20 16 48 68l237 616l280 724h75h53l11 -21l205 -480q103 -242 124 -297q39 -102 96 -235q26 -58 65 -164q24 -67 65 -149 q22 -49 35 -57q22 -19 69 -23q47 -6 103 -27q6 -39 6 -57q0 -14 -1 -26q-80 0 -192 8q-93 8 -189 8q-79 0 -135 -2l-200 -11l-58 -2q0 45 4 78l131 28q56 13 68 23q12 12 12 27t-6 32l-47 114l-92 228l-450 2q-29 -65 -104 -274q-23 -64 -23 -84q0 -31 17 -43 q26 -21 103 -32q3 0 13.5 -2t30 -5t40.5 -6q1 -28 1 -58q0 -17 -2 -27q-66 0 -349 20l-48 -8q-81 -14 -167 -14z" /> +<glyph unicode="" horiz-adv-x="1408" d="M555 15q76 -32 140 -32q131 0 216 41t122 113q38 70 38 181q0 114 -41 180q-58 94 -141 126q-80 32 -247 32q-74 0 -101 -10v-144l-1 -173l3 -270q0 -15 12 -44zM541 761q43 -7 109 -7q175 0 264 65t89 224q0 112 -85 187q-84 75 -255 75q-52 0 -130 -13q0 -44 2 -77 q7 -122 6 -279l-1 -98q0 -43 1 -77zM0 -128l2 94q45 9 68 12q77 12 123 31q17 27 21 51q9 66 9 194l-2 497q-5 256 -9 404q-1 87 -11 109q-1 4 -12 12q-18 12 -69 15q-30 2 -114 13l-4 83l260 6l380 13l45 1q5 0 14 0.5t14 0.5q1 0 21.5 -0.5t40.5 -0.5h74q88 0 191 -27 q43 -13 96 -39q57 -29 102 -76q44 -47 65 -104t21 -122q0 -70 -32 -128t-95 -105q-26 -20 -150 -77q177 -41 267 -146q92 -106 92 -236q0 -76 -29 -161q-21 -62 -71 -117q-66 -72 -140 -108q-73 -36 -203 -60q-82 -15 -198 -11l-197 4q-84 2 -298 -11q-33 -3 -272 -11z" /> +<glyph unicode="" horiz-adv-x="1024" d="M0 -126l17 85q4 1 77 20q76 19 116 39q29 37 41 101l27 139l56 268l12 64q8 44 17 84.5t16 67t12.5 46.5t9 30.5t3.5 11.5l29 157l16 63l22 135l8 50v38q-41 22 -144 28q-28 2 -38 4l19 103l317 -14q39 -2 73 -2q66 0 214 9q33 2 68 4.5t36 2.5q-2 -19 -6 -38 q-7 -29 -13 -51q-55 -19 -109 -31q-64 -16 -101 -31q-12 -31 -24 -88q-9 -44 -13 -82q-44 -199 -66 -306l-61 -311l-38 -158l-43 -235l-12 -45q-2 -7 1 -27q64 -15 119 -21q36 -5 66 -10q-1 -29 -7 -58q-7 -31 -9 -41q-18 0 -23 -1q-24 -2 -42 -2q-9 0 -28 3q-19 4 -145 17 l-198 2q-41 1 -174 -11q-74 -7 -98 -9z" /> +<glyph unicode="" horiz-adv-x="1792" d="M81 1407l54 -27q20 -5 211 -5h130l19 3l115 1l215 -1h293l34 -2q14 -1 28 7t21 16l7 8l42 1q15 0 28 -1v-104.5t1 -131.5l1 -100l-1 -58q0 -32 -4 -51q-39 -15 -68 -18q-25 43 -54 128q-8 24 -15.5 62.5t-11.5 65.5t-6 29q-13 15 -27 19q-7 2 -42.5 2t-103.5 -1t-111 -1 q-34 0 -67 -5q-10 -97 -8 -136l1 -152v-332l3 -359l-1 -147q-1 -46 11 -85q49 -25 89 -32q2 0 18 -5t44 -13t43 -12q30 -8 50 -18q5 -45 5 -50q0 -10 -3 -29q-14 -1 -34 -1q-110 0 -187 10q-72 8 -238 8q-88 0 -233 -14q-48 -4 -70 -4q-2 22 -2 26l-1 26v9q21 33 79 49 q139 38 159 50q9 21 12 56q8 192 6 433l-5 428q-1 62 -0.5 118.5t0.5 102.5t-2 57t-6 15q-6 5 -14 6q-38 6 -148 6q-43 0 -100 -13.5t-73 -24.5q-13 -9 -22 -33t-22 -75t-24 -84q-6 -19 -19.5 -32t-20.5 -13q-44 27 -56 44v297v86zM1744 128q33 0 42 -18.5t-11 -44.5 l-126 -162q-20 -26 -49 -26t-49 26l-126 162q-20 26 -11 44.5t42 18.5h80v1024h-80q-33 0 -42 18.5t11 44.5l126 162q20 26 49 26t49 -26l126 -162q20 -26 11 -44.5t-42 -18.5h-80v-1024h80z" /> +<glyph unicode="" d="M81 1407l54 -27q20 -5 211 -5h130l19 3l115 1l446 -1h318l34 -2q14 -1 28 7t21 16l7 8l42 1q15 0 28 -1v-104.5t1 -131.5l1 -100l-1 -58q0 -32 -4 -51q-39 -15 -68 -18q-25 43 -54 128q-8 24 -15.5 62.5t-11.5 65.5t-6 29q-13 15 -27 19q-7 2 -58.5 2t-138.5 -1t-128 -1 q-94 0 -127 -5q-10 -97 -8 -136l1 -152v52l3 -359l-1 -147q-1 -46 11 -85q49 -25 89 -32q2 0 18 -5t44 -13t43 -12q30 -8 50 -18q5 -45 5 -50q0 -10 -3 -29q-14 -1 -34 -1q-110 0 -187 10q-72 8 -238 8q-82 0 -233 -13q-45 -5 -70 -5q-2 22 -2 26l-1 26v9q21 33 79 49 q139 38 159 50q9 21 12 56q6 137 6 433l-5 44q0 265 -2 278q-2 11 -6 15q-6 5 -14 6q-38 6 -148 6q-50 0 -168.5 -14t-132.5 -24q-13 -9 -22 -33t-22 -75t-24 -84q-6 -19 -19.5 -32t-20.5 -13q-44 27 -56 44v297v86zM1505 113q26 -20 26 -49t-26 -49l-162 -126 q-26 -20 -44.5 -11t-18.5 42v80h-1024v-80q0 -33 -18.5 -42t-44.5 11l-162 126q-26 20 -26 49t26 49l162 126q26 20 44.5 11t18.5 -42v-80h1024v80q0 33 18.5 42t44.5 -11z" /> +<glyph unicode="" horiz-adv-x="1792" d="M1792 192v-128q0 -26 -19 -45t-45 -19h-1664q-26 0 -45 19t-19 45v128q0 26 19 45t45 19h1664q26 0 45 -19t19 -45zM1408 576v-128q0 -26 -19 -45t-45 -19h-1280q-26 0 -45 19t-19 45v128q0 26 19 45t45 19h1280q26 0 45 -19t19 -45zM1664 960v-128q0 -26 -19 -45 t-45 -19h-1536q-26 0 -45 19t-19 45v128q0 26 19 45t45 19h1536q26 0 45 -19t19 -45zM1280 1344v-128q0 -26 -19 -45t-45 -19h-1152q-26 0 -45 19t-19 45v128q0 26 19 45t45 19h1152q26 0 45 -19t19 -45z" /> +<glyph unicode="" horiz-adv-x="1792" d="M1792 192v-128q0 -26 -19 -45t-45 -19h-1664q-26 0 -45 19t-19 45v128q0 26 19 45t45 19h1664q26 0 45 -19t19 -45zM1408 576v-128q0 -26 -19 -45t-45 -19h-896q-26 0 -45 19t-19 45v128q0 26 19 45t45 19h896q26 0 45 -19t19 -45zM1664 960v-128q0 -26 -19 -45t-45 -19 h-1408q-26 0 -45 19t-19 45v128q0 26 19 45t45 19h1408q26 0 45 -19t19 -45zM1280 1344v-128q0 -26 -19 -45t-45 -19h-640q-26 0 -45 19t-19 45v128q0 26 19 45t45 19h640q26 0 45 -19t19 -45z" /> +<glyph unicode="" horiz-adv-x="1792" d="M1792 192v-128q0 -26 -19 -45t-45 -19h-1664q-26 0 -45 19t-19 45v128q0 26 19 45t45 19h1664q26 0 45 -19t19 -45zM1792 576v-128q0 -26 -19 -45t-45 -19h-1280q-26 0 -45 19t-19 45v128q0 26 19 45t45 19h1280q26 0 45 -19t19 -45zM1792 960v-128q0 -26 -19 -45 t-45 -19h-1536q-26 0 -45 19t-19 45v128q0 26 19 45t45 19h1536q26 0 45 -19t19 -45zM1792 1344v-128q0 -26 -19 -45t-45 -19h-1152q-26 0 -45 19t-19 45v128q0 26 19 45t45 19h1152q26 0 45 -19t19 -45z" /> +<glyph unicode="" horiz-adv-x="1792" d="M1792 192v-128q0 -26 -19 -45t-45 -19h-1664q-26 0 -45 19t-19 45v128q0 26 19 45t45 19h1664q26 0 45 -19t19 -45zM1792 576v-128q0 -26 -19 -45t-45 -19h-1664q-26 0 -45 19t-19 45v128q0 26 19 45t45 19h1664q26 0 45 -19t19 -45zM1792 960v-128q0 -26 -19 -45 t-45 -19h-1664q-26 0 -45 19t-19 45v128q0 26 19 45t45 19h1664q26 0 45 -19t19 -45zM1792 1344v-128q0 -26 -19 -45t-45 -19h-1664q-26 0 -45 19t-19 45v128q0 26 19 45t45 19h1664q26 0 45 -19t19 -45z" /> +<glyph unicode="" horiz-adv-x="1792" d="M256 224v-192q0 -13 -9.5 -22.5t-22.5 -9.5h-192q-13 0 -22.5 9.5t-9.5 22.5v192q0 13 9.5 22.5t22.5 9.5h192q13 0 22.5 -9.5t9.5 -22.5zM256 608v-192q0 -13 -9.5 -22.5t-22.5 -9.5h-192q-13 0 -22.5 9.5t-9.5 22.5v192q0 13 9.5 22.5t22.5 9.5h192q13 0 22.5 -9.5 t9.5 -22.5zM256 992v-192q0 -13 -9.5 -22.5t-22.5 -9.5h-192q-13 0 -22.5 9.5t-9.5 22.5v192q0 13 9.5 22.5t22.5 9.5h192q13 0 22.5 -9.5t9.5 -22.5zM1792 224v-192q0 -13 -9.5 -22.5t-22.5 -9.5h-1344q-13 0 -22.5 9.5t-9.5 22.5v192q0 13 9.5 22.5t22.5 9.5h1344 q13 0 22.5 -9.5t9.5 -22.5zM256 1376v-192q0 -13 -9.5 -22.5t-22.5 -9.5h-192q-13 0 -22.5 9.5t-9.5 22.5v192q0 13 9.5 22.5t22.5 9.5h192q13 0 22.5 -9.5t9.5 -22.5zM1792 608v-192q0 -13 -9.5 -22.5t-22.5 -9.5h-1344q-13 0 -22.5 9.5t-9.5 22.5v192q0 13 9.5 22.5 t22.5 9.5h1344q13 0 22.5 -9.5t9.5 -22.5zM1792 992v-192q0 -13 -9.5 -22.5t-22.5 -9.5h-1344q-13 0 -22.5 9.5t-9.5 22.5v192q0 13 9.5 22.5t22.5 9.5h1344q13 0 22.5 -9.5t9.5 -22.5zM1792 1376v-192q0 -13 -9.5 -22.5t-22.5 -9.5h-1344q-13 0 -22.5 9.5t-9.5 22.5v192 q0 13 9.5 22.5t22.5 9.5h1344q13 0 22.5 -9.5t9.5 -22.5z" /> +<glyph unicode="" horiz-adv-x="1792" d="M384 992v-576q0 -13 -9.5 -22.5t-22.5 -9.5q-14 0 -23 9l-288 288q-9 9 -9 23t9 23l288 288q9 9 23 9q13 0 22.5 -9.5t9.5 -22.5zM1792 224v-192q0 -13 -9.5 -22.5t-22.5 -9.5h-1728q-13 0 -22.5 9.5t-9.5 22.5v192q0 13 9.5 22.5t22.5 9.5h1728q13 0 22.5 -9.5 t9.5 -22.5zM1792 608v-192q0 -13 -9.5 -22.5t-22.5 -9.5h-1088q-13 0 -22.5 9.5t-9.5 22.5v192q0 13 9.5 22.5t22.5 9.5h1088q13 0 22.5 -9.5t9.5 -22.5zM1792 992v-192q0 -13 -9.5 -22.5t-22.5 -9.5h-1088q-13 0 -22.5 9.5t-9.5 22.5v192q0 13 9.5 22.5t22.5 9.5h1088 q13 0 22.5 -9.5t9.5 -22.5zM1792 1376v-192q0 -13 -9.5 -22.5t-22.5 -9.5h-1728q-13 0 -22.5 9.5t-9.5 22.5v192q0 13 9.5 22.5t22.5 9.5h1728q13 0 22.5 -9.5t9.5 -22.5z" /> +<glyph unicode="" horiz-adv-x="1792" d="M352 704q0 -14 -9 -23l-288 -288q-9 -9 -23 -9q-13 0 -22.5 9.5t-9.5 22.5v576q0 13 9.5 22.5t22.5 9.5q14 0 23 -9l288 -288q9 -9 9 -23zM1792 224v-192q0 -13 -9.5 -22.5t-22.5 -9.5h-1728q-13 0 -22.5 9.5t-9.5 22.5v192q0 13 9.5 22.5t22.5 9.5h1728q13 0 22.5 -9.5 t9.5 -22.5zM1792 608v-192q0 -13 -9.5 -22.5t-22.5 -9.5h-1088q-13 0 -22.5 9.5t-9.5 22.5v192q0 13 9.5 22.5t22.5 9.5h1088q13 0 22.5 -9.5t9.5 -22.5zM1792 992v-192q0 -13 -9.5 -22.5t-22.5 -9.5h-1088q-13 0 -22.5 9.5t-9.5 22.5v192q0 13 9.5 22.5t22.5 9.5h1088 q13 0 22.5 -9.5t9.5 -22.5zM1792 1376v-192q0 -13 -9.5 -22.5t-22.5 -9.5h-1728q-13 0 -22.5 9.5t-9.5 22.5v192q0 13 9.5 22.5t22.5 9.5h1728q13 0 22.5 -9.5t9.5 -22.5z" /> +<glyph unicode="" horiz-adv-x="1792" d="M1792 1184v-1088q0 -42 -39 -59q-13 -5 -25 -5q-27 0 -45 19l-403 403v-166q0 -119 -84.5 -203.5t-203.5 -84.5h-704q-119 0 -203.5 84.5t-84.5 203.5v704q0 119 84.5 203.5t203.5 84.5h704q119 0 203.5 -84.5t84.5 -203.5v-165l403 402q18 19 45 19q12 0 25 -5 q39 -17 39 -59z" /> +<glyph unicode="" horiz-adv-x="1920" d="M640 960q0 -80 -56 -136t-136 -56t-136 56t-56 136t56 136t136 56t136 -56t56 -136zM1664 576v-448h-1408v192l320 320l160 -160l512 512zM1760 1280h-1600q-13 0 -22.5 -9.5t-9.5 -22.5v-1216q0 -13 9.5 -22.5t22.5 -9.5h1600q13 0 22.5 9.5t9.5 22.5v1216 q0 13 -9.5 22.5t-22.5 9.5zM1920 1248v-1216q0 -66 -47 -113t-113 -47h-1600q-66 0 -113 47t-47 113v1216q0 66 47 113t113 47h1600q66 0 113 -47t47 -113z" /> +<glyph unicode="" d="M363 0l91 91l-235 235l-91 -91v-107h128v-128h107zM886 928q0 22 -22 22q-10 0 -17 -7l-542 -542q-7 -7 -7 -17q0 -22 22 -22q10 0 17 7l542 542q7 7 7 17zM832 1120l416 -416l-832 -832h-416v416zM1515 1024q0 -53 -37 -90l-166 -166l-416 416l166 165q36 38 90 38 q53 0 91 -38l235 -234q37 -39 37 -91z" /> +<glyph unicode="" horiz-adv-x="1024" d="M768 896q0 106 -75 181t-181 75t-181 -75t-75 -181t75 -181t181 -75t181 75t75 181zM1024 896q0 -109 -33 -179l-364 -774q-16 -33 -47.5 -52t-67.5 -19t-67.5 19t-46.5 52l-365 774q-33 70 -33 179q0 212 150 362t362 150t362 -150t150 -362z" /> +<glyph unicode="" d="M768 96v1088q-148 0 -273 -73t-198 -198t-73 -273t73 -273t198 -198t273 -73zM1536 640q0 -209 -103 -385.5t-279.5 -279.5t-385.5 -103t-385.5 103t-279.5 279.5t-103 385.5t103 385.5t279.5 279.5t385.5 103t385.5 -103t279.5 -279.5t103 -385.5z" /> +<glyph unicode="" horiz-adv-x="1024" d="M512 384q0 36 -20 69q-1 1 -15.5 22.5t-25.5 38t-25 44t-21 50.5q-4 16 -21 16t-21 -16q-7 -23 -21 -50.5t-25 -44t-25.5 -38t-15.5 -22.5q-20 -33 -20 -69q0 -53 37.5 -90.5t90.5 -37.5t90.5 37.5t37.5 90.5zM1024 512q0 -212 -150 -362t-362 -150t-362 150t-150 362 q0 145 81 275q6 9 62.5 90.5t101 151t99.5 178t83 201.5q9 30 34 47t51 17t51.5 -17t33.5 -47q28 -93 83 -201.5t99.5 -178t101 -151t62.5 -90.5q81 -127 81 -275z" /> +<glyph unicode="" horiz-adv-x="1792" d="M888 352l116 116l-152 152l-116 -116v-56h96v-96h56zM1328 1072q-16 16 -33 -1l-350 -350q-17 -17 -1 -33t33 1l350 350q17 17 1 33zM1408 478v-190q0 -119 -84.5 -203.5t-203.5 -84.5h-832q-119 0 -203.5 84.5t-84.5 203.5v832q0 119 84.5 203.5t203.5 84.5h832 q63 0 117 -25q15 -7 18 -23q3 -17 -9 -29l-49 -49q-14 -14 -32 -8q-23 6 -45 6h-832q-66 0 -113 -47t-47 -113v-832q0 -66 47 -113t113 -47h832q66 0 113 47t47 113v126q0 13 9 22l64 64q15 15 35 7t20 -29zM1312 1216l288 -288l-672 -672h-288v288zM1756 1084l-92 -92 l-288 288l92 92q28 28 68 28t68 -28l152 -152q28 -28 28 -68t-28 -68z" /> +<glyph unicode="" horiz-adv-x="1664" d="M1408 547v-259q0 -119 -84.5 -203.5t-203.5 -84.5h-832q-119 0 -203.5 84.5t-84.5 203.5v832q0 119 84.5 203.5t203.5 84.5h255v0q13 0 22.5 -9.5t9.5 -22.5q0 -27 -26 -32q-77 -26 -133 -60q-10 -4 -16 -4h-112q-66 0 -113 -47t-47 -113v-832q0 -66 47 -113t113 -47h832 q66 0 113 47t47 113v214q0 19 18 29q28 13 54 37q16 16 35 8q21 -9 21 -29zM1645 1043l-384 -384q-18 -19 -45 -19q-12 0 -25 5q-39 17 -39 59v192h-160q-323 0 -438 -131q-119 -137 -74 -473q3 -23 -20 -34q-8 -2 -12 -2q-16 0 -26 13q-10 14 -21 31t-39.5 68.5t-49.5 99.5 t-38.5 114t-17.5 122q0 49 3.5 91t14 90t28 88t47 81.5t68.5 74t94.5 61.5t124.5 48.5t159.5 30.5t196.5 11h160v192q0 42 39 59q13 5 25 5q26 0 45 -19l384 -384q19 -19 19 -45t-19 -45z" /> +<glyph unicode="" horiz-adv-x="1664" d="M1408 606v-318q0 -119 -84.5 -203.5t-203.5 -84.5h-832q-119 0 -203.5 84.5t-84.5 203.5v832q0 119 84.5 203.5t203.5 84.5h832q63 0 117 -25q15 -7 18 -23q3 -17 -9 -29l-49 -49q-10 -10 -23 -10q-3 0 -9 2q-23 6 -45 6h-832q-66 0 -113 -47t-47 -113v-832 q0 -66 47 -113t113 -47h832q66 0 113 47t47 113v254q0 13 9 22l64 64q10 10 23 10q6 0 12 -3q20 -8 20 -29zM1639 1095l-814 -814q-24 -24 -57 -24t-57 24l-430 430q-24 24 -24 57t24 57l110 110q24 24 57 24t57 -24l263 -263l647 647q24 24 57 24t57 -24l110 -110 q24 -24 24 -57t-24 -57z" /> +<glyph unicode="" horiz-adv-x="1792" d="M1792 640q0 -26 -19 -45l-256 -256q-19 -19 -45 -19t-45 19t-19 45v128h-384v-384h128q26 0 45 -19t19 -45t-19 -45l-256 -256q-19 -19 -45 -19t-45 19l-256 256q-19 19 -19 45t19 45t45 19h128v384h-384v-128q0 -26 -19 -45t-45 -19t-45 19l-256 256q-19 19 -19 45 t19 45l256 256q19 19 45 19t45 -19t19 -45v-128h384v384h-128q-26 0 -45 19t-19 45t19 45l256 256q19 19 45 19t45 -19l256 -256q19 -19 19 -45t-19 -45t-45 -19h-128v-384h384v128q0 26 19 45t45 19t45 -19l256 -256q19 -19 19 -45z" /> +<glyph unicode="" horiz-adv-x="1024" d="M979 1395q19 19 32 13t13 -32v-1472q0 -26 -13 -32t-32 13l-710 710q-9 9 -13 19v-678q0 -26 -19 -45t-45 -19h-128q-26 0 -45 19t-19 45v1408q0 26 19 45t45 19h128q26 0 45 -19t19 -45v-678q4 11 13 19z" /> +<glyph unicode="" horiz-adv-x="1792" d="M1747 1395q19 19 32 13t13 -32v-1472q0 -26 -13 -32t-32 13l-710 710q-9 9 -13 19v-710q0 -26 -13 -32t-32 13l-710 710q-9 9 -13 19v-678q0 -26 -19 -45t-45 -19h-128q-26 0 -45 19t-19 45v1408q0 26 19 45t45 19h128q26 0 45 -19t19 -45v-678q4 11 13 19l710 710 q19 19 32 13t13 -32v-710q4 11 13 19z" /> +<glyph unicode="" horiz-adv-x="1664" d="M1619 1395q19 19 32 13t13 -32v-1472q0 -26 -13 -32t-32 13l-710 710q-8 9 -13 19v-710q0 -26 -13 -32t-32 13l-710 710q-19 19 -19 45t19 45l710 710q19 19 32 13t13 -32v-710q5 11 13 19z" /> +<glyph unicode="" horiz-adv-x="1408" d="M1384 609l-1328 -738q-23 -13 -39.5 -3t-16.5 36v1472q0 26 16.5 36t39.5 -3l1328 -738q23 -13 23 -31t-23 -31z" /> +<glyph unicode="" d="M1536 1344v-1408q0 -26 -19 -45t-45 -19h-512q-26 0 -45 19t-19 45v1408q0 26 19 45t45 19h512q26 0 45 -19t19 -45zM640 1344v-1408q0 -26 -19 -45t-45 -19h-512q-26 0 -45 19t-19 45v1408q0 26 19 45t45 19h512q26 0 45 -19t19 -45z" /> +<glyph unicode="" d="M1536 1344v-1408q0 -26 -19 -45t-45 -19h-1408q-26 0 -45 19t-19 45v1408q0 26 19 45t45 19h1408q26 0 45 -19t19 -45z" /> +<glyph unicode="" horiz-adv-x="1664" d="M45 -115q-19 -19 -32 -13t-13 32v1472q0 26 13 32t32 -13l710 -710q8 -8 13 -19v710q0 26 13 32t32 -13l710 -710q19 -19 19 -45t-19 -45l-710 -710q-19 -19 -32 -13t-13 32v710q-5 -10 -13 -19z" /> +<glyph unicode="" horiz-adv-x="1792" d="M45 -115q-19 -19 -32 -13t-13 32v1472q0 26 13 32t32 -13l710 -710q8 -8 13 -19v710q0 26 13 32t32 -13l710 -710q8 -8 13 -19v678q0 26 19 45t45 19h128q26 0 45 -19t19 -45v-1408q0 -26 -19 -45t-45 -19h-128q-26 0 -45 19t-19 45v678q-5 -10 -13 -19l-710 -710 q-19 -19 -32 -13t-13 32v710q-5 -10 -13 -19z" /> +<glyph unicode="" horiz-adv-x="1024" d="M45 -115q-19 -19 -32 -13t-13 32v1472q0 26 13 32t32 -13l710 -710q8 -8 13 -19v678q0 26 19 45t45 19h128q26 0 45 -19t19 -45v-1408q0 -26 -19 -45t-45 -19h-128q-26 0 -45 19t-19 45v678q-5 -10 -13 -19z" /> +<glyph unicode="" horiz-adv-x="1538" d="M14 557l710 710q19 19 45 19t45 -19l710 -710q19 -19 13 -32t-32 -13h-1472q-26 0 -32 13t13 32zM1473 0h-1408q-26 0 -45 19t-19 45v256q0 26 19 45t45 19h1408q26 0 45 -19t19 -45v-256q0 -26 -19 -45t-45 -19z" /> +<glyph unicode="" horiz-adv-x="1152" d="M742 -37l-652 651q-37 37 -37 90.5t37 90.5l652 651q37 37 90.5 37t90.5 -37l75 -75q37 -37 37 -90.5t-37 -90.5l-486 -486l486 -485q37 -38 37 -91t-37 -90l-75 -75q-37 -37 -90.5 -37t-90.5 37z" /> +<glyph unicode="" horiz-adv-x="1152" d="M1099 704q0 -52 -37 -91l-652 -651q-37 -37 -90 -37t-90 37l-76 75q-37 39 -37 91q0 53 37 90l486 486l-486 485q-37 39 -37 91q0 53 37 90l76 75q36 38 90 38t90 -38l652 -651q37 -37 37 -90z" /> +<glyph unicode="" d="M1216 576v128q0 26 -19 45t-45 19h-256v256q0 26 -19 45t-45 19h-128q-26 0 -45 -19t-19 -45v-256h-256q-26 0 -45 -19t-19 -45v-128q0 -26 19 -45t45 -19h256v-256q0 -26 19 -45t45 -19h128q26 0 45 19t19 45v256h256q26 0 45 19t19 45zM1536 640q0 -209 -103 -385.5 t-279.5 -279.5t-385.5 -103t-385.5 103t-279.5 279.5t-103 385.5t103 385.5t279.5 279.5t385.5 103t385.5 -103t279.5 -279.5t103 -385.5z" /> +<glyph unicode="" d="M1216 576v128q0 26 -19 45t-45 19h-768q-26 0 -45 -19t-19 -45v-128q0 -26 19 -45t45 -19h768q26 0 45 19t19 45zM1536 640q0 -209 -103 -385.5t-279.5 -279.5t-385.5 -103t-385.5 103t-279.5 279.5t-103 385.5t103 385.5t279.5 279.5t385.5 103t385.5 -103t279.5 -279.5 t103 -385.5z" /> +<glyph unicode="" d="M1149 414q0 26 -19 45l-181 181l181 181q19 19 19 45q0 27 -19 46l-90 90q-19 19 -46 19q-26 0 -45 -19l-181 -181l-181 181q-19 19 -45 19q-27 0 -46 -19l-90 -90q-19 -19 -19 -46q0 -26 19 -45l181 -181l-181 -181q-19 -19 -19 -45q0 -27 19 -46l90 -90q19 -19 46 -19 q26 0 45 19l181 181l181 -181q19 -19 45 -19q27 0 46 19l90 90q19 19 19 46zM1536 640q0 -209 -103 -385.5t-279.5 -279.5t-385.5 -103t-385.5 103t-279.5 279.5t-103 385.5t103 385.5t279.5 279.5t385.5 103t385.5 -103t279.5 -279.5t103 -385.5z" /> +<glyph unicode="" d="M1284 802q0 28 -18 46l-91 90q-19 19 -45 19t-45 -19l-408 -407l-226 226q-19 19 -45 19t-45 -19l-91 -90q-18 -18 -18 -46q0 -27 18 -45l362 -362q19 -19 45 -19q27 0 46 19l543 543q18 18 18 45zM1536 640q0 -209 -103 -385.5t-279.5 -279.5t-385.5 -103t-385.5 103 t-279.5 279.5t-103 385.5t103 385.5t279.5 279.5t385.5 103t385.5 -103t279.5 -279.5t103 -385.5z" /> +<glyph unicode="" d="M896 160v192q0 14 -9 23t-23 9h-192q-14 0 -23 -9t-9 -23v-192q0 -14 9 -23t23 -9h192q14 0 23 9t9 23zM1152 832q0 88 -55.5 163t-138.5 116t-170 41q-243 0 -371 -213q-15 -24 8 -42l132 -100q7 -6 19 -6q16 0 25 12q53 68 86 92q34 24 86 24q48 0 85.5 -26t37.5 -59 q0 -38 -20 -61t-68 -45q-63 -28 -115.5 -86.5t-52.5 -125.5v-36q0 -14 9 -23t23 -9h192q14 0 23 9t9 23q0 19 21.5 49.5t54.5 49.5q32 18 49 28.5t46 35t44.5 48t28 60.5t12.5 81zM1536 640q0 -209 -103 -385.5t-279.5 -279.5t-385.5 -103t-385.5 103t-279.5 279.5 t-103 385.5t103 385.5t279.5 279.5t385.5 103t385.5 -103t279.5 -279.5t103 -385.5z" /> +<glyph unicode="" d="M1024 160v160q0 14 -9 23t-23 9h-96v512q0 14 -9 23t-23 9h-320q-14 0 -23 -9t-9 -23v-160q0 -14 9 -23t23 -9h96v-320h-96q-14 0 -23 -9t-9 -23v-160q0 -14 9 -23t23 -9h448q14 0 23 9t9 23zM896 1056v160q0 14 -9 23t-23 9h-192q-14 0 -23 -9t-9 -23v-160q0 -14 9 -23 t23 -9h192q14 0 23 9t9 23zM1536 640q0 -209 -103 -385.5t-279.5 -279.5t-385.5 -103t-385.5 103t-279.5 279.5t-103 385.5t103 385.5t279.5 279.5t385.5 103t385.5 -103t279.5 -279.5t103 -385.5z" /> +<glyph unicode="" d="M1197 512h-109q-26 0 -45 19t-19 45v128q0 26 19 45t45 19h109q-32 108 -112.5 188.5t-188.5 112.5v-109q0 -26 -19 -45t-45 -19h-128q-26 0 -45 19t-19 45v109q-108 -32 -188.5 -112.5t-112.5 -188.5h109q26 0 45 -19t19 -45v-128q0 -26 -19 -45t-45 -19h-109 q32 -108 112.5 -188.5t188.5 -112.5v109q0 26 19 45t45 19h128q26 0 45 -19t19 -45v-109q108 32 188.5 112.5t112.5 188.5zM1536 704v-128q0 -26 -19 -45t-45 -19h-143q-37 -161 -154.5 -278.5t-278.5 -154.5v-143q0 -26 -19 -45t-45 -19h-128q-26 0 -45 19t-19 45v143 q-161 37 -278.5 154.5t-154.5 278.5h-143q-26 0 -45 19t-19 45v128q0 26 19 45t45 19h143q37 161 154.5 278.5t278.5 154.5v143q0 26 19 45t45 19h128q26 0 45 -19t19 -45v-143q161 -37 278.5 -154.5t154.5 -278.5h143q26 0 45 -19t19 -45z" /> +<glyph unicode="" d="M1097 457l-146 -146q-10 -10 -23 -10t-23 10l-137 137l-137 -137q-10 -10 -23 -10t-23 10l-146 146q-10 10 -10 23t10 23l137 137l-137 137q-10 10 -10 23t10 23l146 146q10 10 23 10t23 -10l137 -137l137 137q10 10 23 10t23 -10l146 -146q10 -10 10 -23t-10 -23 l-137 -137l137 -137q10 -10 10 -23t-10 -23zM1312 640q0 148 -73 273t-198 198t-273 73t-273 -73t-198 -198t-73 -273t73 -273t198 -198t273 -73t273 73t198 198t73 273zM1536 640q0 -209 -103 -385.5t-279.5 -279.5t-385.5 -103t-385.5 103t-279.5 279.5t-103 385.5 t103 385.5t279.5 279.5t385.5 103t385.5 -103t279.5 -279.5t103 -385.5z" /> +<glyph unicode="" d="M1171 723l-422 -422q-19 -19 -45 -19t-45 19l-294 294q-19 19 -19 45t19 45l102 102q19 19 45 19t45 -19l147 -147l275 275q19 19 45 19t45 -19l102 -102q19 -19 19 -45t-19 -45zM1312 640q0 148 -73 273t-198 198t-273 73t-273 -73t-198 -198t-73 -273t73 -273t198 -198 t273 -73t273 73t198 198t73 273zM1536 640q0 -209 -103 -385.5t-279.5 -279.5t-385.5 -103t-385.5 103t-279.5 279.5t-103 385.5t103 385.5t279.5 279.5t385.5 103t385.5 -103t279.5 -279.5t103 -385.5z" /> +<glyph unicode="" d="M1312 643q0 161 -87 295l-754 -753q137 -89 297 -89q111 0 211.5 43.5t173.5 116.5t116 174.5t43 212.5zM313 344l755 754q-135 91 -300 91q-148 0 -273 -73t-198 -199t-73 -274q0 -162 89 -299zM1536 643q0 -157 -61 -300t-163.5 -246t-245 -164t-298.5 -61t-298.5 61 t-245 164t-163.5 246t-61 300t61 299.5t163.5 245.5t245 164t298.5 61t298.5 -61t245 -164t163.5 -245.5t61 -299.5z" /> +<glyph unicode="" d="M1536 640v-128q0 -53 -32.5 -90.5t-84.5 -37.5h-704l293 -294q38 -36 38 -90t-38 -90l-75 -76q-37 -37 -90 -37q-52 0 -91 37l-651 652q-37 37 -37 90q0 52 37 91l651 650q38 38 91 38q52 0 90 -38l75 -74q38 -38 38 -91t-38 -91l-293 -293h704q52 0 84.5 -37.5 t32.5 -90.5z" /> +<glyph unicode="" d="M1472 576q0 -54 -37 -91l-651 -651q-39 -37 -91 -37q-51 0 -90 37l-75 75q-38 38 -38 91t38 91l293 293h-704q-52 0 -84.5 37.5t-32.5 90.5v128q0 53 32.5 90.5t84.5 37.5h704l-293 294q-38 36 -38 90t38 90l75 75q38 38 90 38q53 0 91 -38l651 -651q37 -35 37 -90z" /> +<glyph unicode="" horiz-adv-x="1664" d="M1611 565q0 -51 -37 -90l-75 -75q-38 -38 -91 -38q-54 0 -90 38l-294 293v-704q0 -52 -37.5 -84.5t-90.5 -32.5h-128q-53 0 -90.5 32.5t-37.5 84.5v704l-294 -293q-36 -38 -90 -38t-90 38l-75 75q-38 38 -38 90q0 53 38 91l651 651q35 37 90 37q54 0 91 -37l651 -651 q37 -39 37 -91z" /> +<glyph unicode="" horiz-adv-x="1664" d="M1611 704q0 -53 -37 -90l-651 -652q-39 -37 -91 -37q-53 0 -90 37l-651 652q-38 36 -38 90q0 53 38 91l74 75q39 37 91 37q53 0 90 -37l294 -294v704q0 52 38 90t90 38h128q52 0 90 -38t38 -90v-704l294 294q37 37 90 37q52 0 91 -37l75 -75q37 -39 37 -91z" /> +<glyph unicode="" horiz-adv-x="1792" d="M1792 896q0 -26 -19 -45l-512 -512q-19 -19 -45 -19t-45 19t-19 45v256h-224q-98 0 -175.5 -6t-154 -21.5t-133 -42.5t-105.5 -69.5t-80 -101t-48.5 -138.5t-17.5 -181q0 -55 5 -123q0 -6 2.5 -23.5t2.5 -26.5q0 -15 -8.5 -25t-23.5 -10q-16 0 -28 17q-7 9 -13 22 t-13.5 30t-10.5 24q-127 285 -127 451q0 199 53 333q162 403 875 403h224v256q0 26 19 45t45 19t45 -19l512 -512q19 -19 19 -45z" /> +<glyph unicode="" d="M755 480q0 -13 -10 -23l-332 -332l144 -144q19 -19 19 -45t-19 -45t-45 -19h-448q-26 0 -45 19t-19 45v448q0 26 19 45t45 19t45 -19l144 -144l332 332q10 10 23 10t23 -10l114 -114q10 -10 10 -23zM1536 1344v-448q0 -26 -19 -45t-45 -19t-45 19l-144 144l-332 -332 q-10 -10 -23 -10t-23 10l-114 114q-10 10 -10 23t10 23l332 332l-144 144q-19 19 -19 45t19 45t45 19h448q26 0 45 -19t19 -45z" /> +<glyph unicode="" d="M768 576v-448q0 -26 -19 -45t-45 -19t-45 19l-144 144l-332 -332q-10 -10 -23 -10t-23 10l-114 114q-10 10 -10 23t10 23l332 332l-144 144q-19 19 -19 45t19 45t45 19h448q26 0 45 -19t19 -45zM1523 1248q0 -13 -10 -23l-332 -332l144 -144q19 -19 19 -45t-19 -45 t-45 -19h-448q-26 0 -45 19t-19 45v448q0 26 19 45t45 19t45 -19l144 -144l332 332q10 10 23 10t23 -10l114 -114q10 -10 10 -23z" /> +<glyph unicode="" horiz-adv-x="1408" d="M1408 800v-192q0 -40 -28 -68t-68 -28h-416v-416q0 -40 -28 -68t-68 -28h-192q-40 0 -68 28t-28 68v416h-416q-40 0 -68 28t-28 68v192q0 40 28 68t68 28h416v416q0 40 28 68t68 28h192q40 0 68 -28t28 -68v-416h416q40 0 68 -28t28 -68z" /> +<glyph unicode="" horiz-adv-x="1408" d="M1408 800v-192q0 -40 -28 -68t-68 -28h-1216q-40 0 -68 28t-28 68v192q0 40 28 68t68 28h1216q40 0 68 -28t28 -68z" /> +<glyph unicode="" horiz-adv-x="1664" d="M1482 486q46 -26 59.5 -77.5t-12.5 -97.5l-64 -110q-26 -46 -77.5 -59.5t-97.5 12.5l-266 153v-307q0 -52 -38 -90t-90 -38h-128q-52 0 -90 38t-38 90v307l-266 -153q-46 -26 -97.5 -12.5t-77.5 59.5l-64 110q-26 46 -12.5 97.5t59.5 77.5l266 154l-266 154 q-46 26 -59.5 77.5t12.5 97.5l64 110q26 46 77.5 59.5t97.5 -12.5l266 -153v307q0 52 38 90t90 38h128q52 0 90 -38t38 -90v-307l266 153q46 26 97.5 12.5t77.5 -59.5l64 -110q26 -46 12.5 -97.5t-59.5 -77.5l-266 -154z" /> +<glyph unicode="" d="M768 1408q209 0 385.5 -103t279.5 -279.5t103 -385.5t-103 -385.5t-279.5 -279.5t-385.5 -103t-385.5 103t-279.5 279.5t-103 385.5t103 385.5t279.5 279.5t385.5 103zM896 161v190q0 14 -9 23.5t-22 9.5h-192q-13 0 -23 -10t-10 -23v-190q0 -13 10 -23t23 -10h192 q13 0 22 9.5t9 23.5zM894 505l18 621q0 12 -10 18q-10 8 -24 8h-220q-14 0 -24 -8q-10 -6 -10 -18l17 -621q0 -10 10 -17.5t24 -7.5h185q14 0 23.5 7.5t10.5 17.5z" /> +<glyph unicode="" d="M928 180v56v468v192h-320v-192v-468v-56q0 -25 18 -38.5t46 -13.5h192q28 0 46 13.5t18 38.5zM472 1024h195l-126 161q-26 31 -69 31q-40 0 -68 -28t-28 -68t28 -68t68 -28zM1160 1120q0 40 -28 68t-68 28q-43 0 -69 -31l-125 -161h194q40 0 68 28t28 68zM1536 864v-320 q0 -14 -9 -23t-23 -9h-96v-416q0 -40 -28 -68t-68 -28h-1088q-40 0 -68 28t-28 68v416h-96q-14 0 -23 9t-9 23v320q0 14 9 23t23 9h440q-93 0 -158.5 65.5t-65.5 158.5t65.5 158.5t158.5 65.5q107 0 168 -77l128 -165l128 165q61 77 168 77q93 0 158.5 -65.5t65.5 -158.5 t-65.5 -158.5t-158.5 -65.5h440q14 0 23 -9t9 -23z" /> +<glyph unicode="" horiz-adv-x="1792" d="M1280 832q0 26 -19 45t-45 19q-172 0 -318 -49.5t-259.5 -134t-235.5 -219.5q-19 -21 -19 -45q0 -26 19 -45t45 -19q24 0 45 19q27 24 74 71t67 66q137 124 268.5 176t313.5 52q26 0 45 19t19 45zM1792 1030q0 -95 -20 -193q-46 -224 -184.5 -383t-357.5 -268 q-214 -108 -438 -108q-148 0 -286 47q-15 5 -88 42t-96 37q-16 0 -39.5 -32t-45 -70t-52.5 -70t-60 -32q-30 0 -51 11t-31 24t-27 42q-2 4 -6 11t-5.5 10t-3 9.5t-1.5 13.5q0 35 31 73.5t68 65.5t68 56t31 48q0 4 -14 38t-16 44q-9 51 -9 104q0 115 43.5 220t119 184.5 t170.5 139t204 95.5q55 18 145 25.5t179.5 9t178.5 6t163.5 24t113.5 56.5l29.5 29.5t29.5 28t27 20t36.5 16t43.5 4.5q39 0 70.5 -46t47.5 -112t24 -124t8 -96z" /> +<glyph unicode="" horiz-adv-x="1408" d="M1408 -160v-64q0 -13 -9.5 -22.5t-22.5 -9.5h-1344q-13 0 -22.5 9.5t-9.5 22.5v64q0 13 9.5 22.5t22.5 9.5h1344q13 0 22.5 -9.5t9.5 -22.5zM1152 896q0 -78 -24.5 -144t-64 -112.5t-87.5 -88t-96 -77.5t-87.5 -72t-64 -81.5t-24.5 -96.5q0 -96 67 -224l-4 1l1 -1 q-90 41 -160 83t-138.5 100t-113.5 122.5t-72.5 150.5t-27.5 184q0 78 24.5 144t64 112.5t87.5 88t96 77.5t87.5 72t64 81.5t24.5 96.5q0 94 -66 224l3 -1l-1 1q90 -41 160 -83t138.5 -100t113.5 -122.5t72.5 -150.5t27.5 -184z" /> +<glyph unicode="" horiz-adv-x="1792" d="M1664 576q-152 236 -381 353q61 -104 61 -225q0 -185 -131.5 -316.5t-316.5 -131.5t-316.5 131.5t-131.5 316.5q0 121 61 225q-229 -117 -381 -353q133 -205 333.5 -326.5t434.5 -121.5t434.5 121.5t333.5 326.5zM944 960q0 20 -14 34t-34 14q-125 0 -214.5 -89.5 t-89.5 -214.5q0 -20 14 -34t34 -14t34 14t14 34q0 86 61 147t147 61q20 0 34 14t14 34zM1792 576q0 -34 -20 -69q-140 -230 -376.5 -368.5t-499.5 -138.5t-499.5 139t-376.5 368q-20 35 -20 69t20 69q140 229 376.5 368t499.5 139t499.5 -139t376.5 -368q20 -35 20 -69z" /> +<glyph unicode="" horiz-adv-x="1792" d="M555 201l78 141q-87 63 -136 159t-49 203q0 121 61 225q-229 -117 -381 -353q167 -258 427 -375zM944 960q0 20 -14 34t-34 14q-125 0 -214.5 -89.5t-89.5 -214.5q0 -20 14 -34t34 -14t34 14t14 34q0 86 61 147t147 61q20 0 34 14t14 34zM1307 1151q0 -7 -1 -9 q-105 -188 -315 -566t-316 -567l-49 -89q-10 -16 -28 -16q-12 0 -134 70q-16 10 -16 28q0 12 44 87q-143 65 -263.5 173t-208.5 245q-20 31 -20 69t20 69q153 235 380 371t496 136q89 0 180 -17l54 97q10 16 28 16q5 0 18 -6t31 -15.5t33 -18.5t31.5 -18.5t19.5 -11.5 q16 -10 16 -27zM1344 704q0 -139 -79 -253.5t-209 -164.5l280 502q8 -45 8 -84zM1792 576q0 -35 -20 -69q-39 -64 -109 -145q-150 -172 -347.5 -267t-419.5 -95l74 132q212 18 392.5 137t301.5 307q-115 179 -282 294l63 112q95 -64 182.5 -153t144.5 -184q20 -34 20 -69z " /> +<glyph unicode="" horiz-adv-x="1792" d="M1024 161v190q0 14 -9.5 23.5t-22.5 9.5h-192q-13 0 -22.5 -9.5t-9.5 -23.5v-190q0 -14 9.5 -23.5t22.5 -9.5h192q13 0 22.5 9.5t9.5 23.5zM1022 535l18 459q0 12 -10 19q-13 11 -24 11h-220q-11 0 -24 -11q-10 -7 -10 -21l17 -457q0 -10 10 -16.5t24 -6.5h185 q14 0 23.5 6.5t10.5 16.5zM1008 1469l768 -1408q35 -63 -2 -126q-17 -29 -46.5 -46t-63.5 -17h-1536q-34 0 -63.5 17t-46.5 46q-37 63 -2 126l768 1408q17 31 47 49t65 18t65 -18t47 -49z" /> +<glyph unicode="" horiz-adv-x="1408" d="M1376 1376q44 -52 12 -148t-108 -172l-161 -161l160 -696q5 -19 -12 -33l-128 -96q-7 -6 -19 -6q-4 0 -7 1q-15 3 -21 16l-279 508l-259 -259l53 -194q5 -17 -8 -31l-96 -96q-9 -9 -23 -9h-2q-15 2 -24 13l-189 252l-252 189q-11 7 -13 23q-1 13 9 25l96 97q9 9 23 9 q6 0 8 -1l194 -53l259 259l-508 279q-14 8 -17 24q-2 16 9 27l128 128q14 13 30 8l665 -159l160 160q76 76 172 108t148 -12z" /> +<glyph unicode="" horiz-adv-x="1664" d="M128 -128h288v288h-288v-288zM480 -128h320v288h-320v-288zM128 224h288v320h-288v-320zM480 224h320v320h-320v-320zM128 608h288v288h-288v-288zM864 -128h320v288h-320v-288zM480 608h320v288h-320v-288zM1248 -128h288v288h-288v-288zM864 224h320v320h-320v-320z M512 1088v288q0 13 -9.5 22.5t-22.5 9.5h-64q-13 0 -22.5 -9.5t-9.5 -22.5v-288q0 -13 9.5 -22.5t22.5 -9.5h64q13 0 22.5 9.5t9.5 22.5zM1248 224h288v320h-288v-320zM864 608h320v288h-320v-288zM1248 608h288v288h-288v-288zM1280 1088v288q0 13 -9.5 22.5t-22.5 9.5h-64 q-13 0 -22.5 -9.5t-9.5 -22.5v-288q0 -13 9.5 -22.5t22.5 -9.5h64q13 0 22.5 9.5t9.5 22.5zM1664 1152v-1280q0 -52 -38 -90t-90 -38h-1408q-52 0 -90 38t-38 90v1280q0 52 38 90t90 38h128v96q0 66 47 113t113 47h64q66 0 113 -47t47 -113v-96h384v96q0 66 47 113t113 47 h64q66 0 113 -47t47 -113v-96h128q52 0 90 -38t38 -90z" /> +<glyph unicode="" horiz-adv-x="1792" d="M666 1055q-60 -92 -137 -273q-22 45 -37 72.5t-40.5 63.5t-51 56.5t-63 35t-81.5 14.5h-224q-14 0 -23 9t-9 23v192q0 14 9 23t23 9h224q250 0 410 -225zM1792 256q0 -14 -9 -23l-320 -320q-9 -9 -23 -9q-13 0 -22.5 9.5t-9.5 22.5v192q-32 0 -85 -0.5t-81 -1t-73 1 t-71 5t-64 10.5t-63 18.5t-58 28.5t-59 40t-55 53.5t-56 69.5q59 93 136 273q22 -45 37 -72.5t40.5 -63.5t51 -56.5t63 -35t81.5 -14.5h256v192q0 14 9 23t23 9q12 0 24 -10l319 -319q9 -9 9 -23zM1792 1152q0 -14 -9 -23l-320 -320q-9 -9 -23 -9q-13 0 -22.5 9.5t-9.5 22.5 v192h-256q-48 0 -87 -15t-69 -45t-51 -61.5t-45 -77.5q-32 -62 -78 -171q-29 -66 -49.5 -111t-54 -105t-64 -100t-74 -83t-90 -68.5t-106.5 -42t-128 -16.5h-224q-14 0 -23 9t-9 23v192q0 14 9 23t23 9h224q48 0 87 15t69 45t51 61.5t45 77.5q32 62 78 171q29 66 49.5 111 t54 105t64 100t74 83t90 68.5t106.5 42t128 16.5h256v192q0 14 9 23t23 9q12 0 24 -10l319 -319q9 -9 9 -23z" /> +<glyph unicode="" horiz-adv-x="1792" d="M1792 640q0 -174 -120 -321.5t-326 -233t-450 -85.5q-70 0 -145 8q-198 -175 -460 -242q-49 -14 -114 -22q-17 -2 -30.5 9t-17.5 29v1q-3 4 -0.5 12t2 10t4.5 9.5l6 9t7 8.5t8 9q7 8 31 34.5t34.5 38t31 39.5t32.5 51t27 59t26 76q-157 89 -247.5 220t-90.5 281 q0 130 71 248.5t191 204.5t286 136.5t348 50.5q244 0 450 -85.5t326 -233t120 -321.5z" /> +<glyph unicode="" d="M1536 704v-128q0 -201 -98.5 -362t-274 -251.5t-395.5 -90.5t-395.5 90.5t-274 251.5t-98.5 362v128q0 26 19 45t45 19h384q26 0 45 -19t19 -45v-128q0 -52 23.5 -90t53.5 -57t71 -30t64 -13t44 -2t44 2t64 13t71 30t53.5 57t23.5 90v128q0 26 19 45t45 19h384 q26 0 45 -19t19 -45zM512 1344v-384q0 -26 -19 -45t-45 -19h-384q-26 0 -45 19t-19 45v384q0 26 19 45t45 19h384q26 0 45 -19t19 -45zM1536 1344v-384q0 -26 -19 -45t-45 -19h-384q-26 0 -45 19t-19 45v384q0 26 19 45t45 19h384q26 0 45 -19t19 -45z" /> +<glyph unicode="" horiz-adv-x="1664" d="M1611 320q0 -53 -37 -90l-75 -75q-38 -38 -91 -38q-54 0 -90 38l-486 485l-486 -485q-36 -38 -90 -38t-90 38l-75 75q-38 36 -38 90q0 53 38 91l651 651q37 37 90 37q52 0 91 -37l650 -651q38 -38 38 -91z" /> +<glyph unicode="" horiz-adv-x="1664" d="M1611 832q0 -53 -37 -90l-651 -651q-38 -38 -91 -38q-54 0 -90 38l-651 651q-38 36 -38 90q0 53 38 91l74 75q39 37 91 37q53 0 90 -37l486 -486l486 486q37 37 90 37q52 0 91 -37l75 -75q37 -39 37 -91z" /> +<glyph unicode="" horiz-adv-x="1920" d="M1280 32q0 -13 -9.5 -22.5t-22.5 -9.5h-960q-8 0 -13.5 2t-9 7t-5.5 8t-3 11.5t-1 11.5v13v11v160v416h-192q-26 0 -45 19t-19 45q0 24 15 41l320 384q19 22 49 22t49 -22l320 -384q15 -17 15 -41q0 -26 -19 -45t-45 -19h-192v-384h576q16 0 25 -11l160 -192q7 -11 7 -21 zM1920 448q0 -24 -15 -41l-320 -384q-20 -23 -49 -23t-49 23l-320 384q-15 17 -15 41q0 26 19 45t45 19h192v384h-576q-16 0 -25 12l-160 192q-7 9 -7 20q0 13 9.5 22.5t22.5 9.5h960q8 0 13.5 -2t9 -7t5.5 -8t3 -11.5t1 -11.5v-13v-11v-160v-416h192q26 0 45 -19t19 -45z " /> +<glyph unicode="" horiz-adv-x="1664" d="M640 0q0 -53 -37.5 -90.5t-90.5 -37.5t-90.5 37.5t-37.5 90.5t37.5 90.5t90.5 37.5t90.5 -37.5t37.5 -90.5zM1536 0q0 -53 -37.5 -90.5t-90.5 -37.5t-90.5 37.5t-37.5 90.5t37.5 90.5t90.5 37.5t90.5 -37.5t37.5 -90.5zM1664 1088v-512q0 -24 -16 -42.5t-41 -21.5 l-1044 -122q1 -7 4.5 -21.5t6 -26.5t2.5 -22q0 -16 -24 -64h920q26 0 45 -19t19 -45t-19 -45t-45 -19h-1024q-26 0 -45 19t-19 45q0 14 11 39.5t29.5 59.5t20.5 38l-177 823h-204q-26 0 -45 19t-19 45t19 45t45 19h256q16 0 28.5 -6.5t20 -15.5t13 -24.5t7.5 -26.5 t5.5 -29.5t4.5 -25.5h1201q26 0 45 -19t19 -45z" /> +<glyph unicode="" horiz-adv-x="1664" d="M1664 928v-704q0 -92 -66 -158t-158 -66h-1216q-92 0 -158 66t-66 158v960q0 92 66 158t158 66h320q92 0 158 -66t66 -158v-32h672q92 0 158 -66t66 -158z" /> +<glyph unicode="" horiz-adv-x="1920" d="M1879 584q0 -31 -31 -66l-336 -396q-43 -51 -120.5 -86.5t-143.5 -35.5h-1088q-34 0 -60.5 13t-26.5 43q0 31 31 66l336 396q43 51 120.5 86.5t143.5 35.5h1088q34 0 60.5 -13t26.5 -43zM1536 928v-160h-832q-94 0 -197 -47.5t-164 -119.5l-337 -396l-5 -6q0 4 -0.5 12.5 t-0.5 12.5v960q0 92 66 158t158 66h320q92 0 158 -66t66 -158v-32h544q92 0 158 -66t66 -158z" /> +<glyph unicode="" horiz-adv-x="768" d="M704 1216q0 -26 -19 -45t-45 -19h-128v-1024h128q26 0 45 -19t19 -45t-19 -45l-256 -256q-19 -19 -45 -19t-45 19l-256 256q-19 19 -19 45t19 45t45 19h128v1024h-128q-26 0 -45 19t-19 45t19 45l256 256q19 19 45 19t45 -19l256 -256q19 -19 19 -45z" /> +<glyph unicode="" horiz-adv-x="1792" d="M1792 640q0 -26 -19 -45l-256 -256q-19 -19 -45 -19t-45 19t-19 45v128h-1024v-128q0 -26 -19 -45t-45 -19t-45 19l-256 256q-19 19 -19 45t19 45l256 256q19 19 45 19t45 -19t19 -45v-128h1024v128q0 26 19 45t45 19t45 -19l256 -256q19 -19 19 -45z" /> +<glyph unicode="" horiz-adv-x="1920" d="M512 512v-384h-256v384h256zM896 1024v-896h-256v896h256zM1280 768v-640h-256v640h256zM1664 1152v-1024h-256v1024h256zM1792 32v1216q0 13 -9.5 22.5t-22.5 9.5h-1600q-13 0 -22.5 -9.5t-9.5 -22.5v-1216q0 -13 9.5 -22.5t22.5 -9.5h1600q13 0 22.5 9.5t9.5 22.5z M1920 1248v-1216q0 -66 -47 -113t-113 -47h-1600q-66 0 -113 47t-47 113v1216q0 66 47 113t113 47h1600q66 0 113 -47t47 -113z" /> +<glyph unicode="" d="M1280 926q-56 -25 -121 -34q68 40 93 117q-65 -38 -134 -51q-61 66 -153 66q-87 0 -148.5 -61.5t-61.5 -148.5q0 -29 5 -48q-129 7 -242 65t-192 155q-29 -50 -29 -106q0 -114 91 -175q-47 1 -100 26v-2q0 -75 50 -133.5t123 -72.5q-29 -8 -51 -8q-13 0 -39 4 q21 -63 74.5 -104t121.5 -42q-116 -90 -261 -90q-26 0 -50 3q148 -94 322 -94q112 0 210 35.5t168 95t120.5 137t75 162t24.5 168.5q0 18 -1 27q63 45 105 109zM1536 1120v-960q0 -119 -84.5 -203.5t-203.5 -84.5h-960q-119 0 -203.5 84.5t-84.5 203.5v960q0 119 84.5 203.5 t203.5 84.5h960q119 0 203.5 -84.5t84.5 -203.5z" /> +<glyph unicode="" d="M1307 618l23 219h-198v109q0 49 15.5 68.5t71.5 19.5h110v219h-175q-152 0 -218 -72t-66 -213v-131h-131v-219h131v-635h262v635h175zM1536 1120v-960q0 -119 -84.5 -203.5t-203.5 -84.5h-960q-119 0 -203.5 84.5t-84.5 203.5v960q0 119 84.5 203.5t203.5 84.5h960 q119 0 203.5 -84.5t84.5 -203.5z" /> +<glyph unicode="" horiz-adv-x="1792" d="M928 704q0 14 -9 23t-23 9q-66 0 -113 -47t-47 -113q0 -14 9 -23t23 -9t23 9t9 23q0 40 28 68t68 28q14 0 23 9t9 23zM1152 574q0 -106 -75 -181t-181 -75t-181 75t-75 181t75 181t181 75t181 -75t75 -181zM128 0h1536v128h-1536v-128zM1280 574q0 159 -112.5 271.5 t-271.5 112.5t-271.5 -112.5t-112.5 -271.5t112.5 -271.5t271.5 -112.5t271.5 112.5t112.5 271.5zM256 1216h384v128h-384v-128zM128 1024h1536v118v138h-828l-64 -128h-644v-128zM1792 1280v-1280q0 -53 -37.5 -90.5t-90.5 -37.5h-1536q-53 0 -90.5 37.5t-37.5 90.5v1280 q0 53 37.5 90.5t90.5 37.5h1536q53 0 90.5 -37.5t37.5 -90.5z" /> +<glyph unicode="" horiz-adv-x="1792" d="M832 1024q0 80 -56 136t-136 56t-136 -56t-56 -136q0 -42 19 -83q-41 19 -83 19q-80 0 -136 -56t-56 -136t56 -136t136 -56t136 56t56 136q0 42 -19 83q41 -19 83 -19q80 0 136 56t56 136zM1683 320q0 -17 -49 -66t-66 -49q-9 0 -28.5 16t-36.5 33t-38.5 40t-24.5 26 l-96 -96l220 -220q28 -28 28 -68q0 -42 -39 -81t-81 -39q-40 0 -68 28l-671 671q-176 -131 -365 -131q-163 0 -265.5 102.5t-102.5 265.5q0 160 95 313t248 248t313 95q163 0 265.5 -102.5t102.5 -265.5q0 -189 -131 -365l355 -355l96 96q-3 3 -26 24.5t-40 38.5t-33 36.5 t-16 28.5q0 17 49 66t66 49q13 0 23 -10q6 -6 46 -44.5t82 -79.5t86.5 -86t73 -78t28.5 -41z" /> +<glyph unicode="" horiz-adv-x="1920" d="M896 640q0 106 -75 181t-181 75t-181 -75t-75 -181t75 -181t181 -75t181 75t75 181zM1664 128q0 52 -38 90t-90 38t-90 -38t-38 -90q0 -53 37.5 -90.5t90.5 -37.5t90.5 37.5t37.5 90.5zM1664 1152q0 52 -38 90t-90 38t-90 -38t-38 -90q0 -53 37.5 -90.5t90.5 -37.5 t90.5 37.5t37.5 90.5zM1280 731v-185q0 -10 -7 -19.5t-16 -10.5l-155 -24q-11 -35 -32 -76q34 -48 90 -115q7 -10 7 -20q0 -12 -7 -19q-23 -30 -82.5 -89.5t-78.5 -59.5q-11 0 -21 7l-115 90q-37 -19 -77 -31q-11 -108 -23 -155q-7 -24 -30 -24h-186q-11 0 -20 7.5t-10 17.5 l-23 153q-34 10 -75 31l-118 -89q-7 -7 -20 -7q-11 0 -21 8q-144 133 -144 160q0 9 7 19q10 14 41 53t47 61q-23 44 -35 82l-152 24q-10 1 -17 9.5t-7 19.5v185q0 10 7 19.5t16 10.5l155 24q11 35 32 76q-34 48 -90 115q-7 11 -7 20q0 12 7 20q22 30 82 89t79 59q11 0 21 -7 l115 -90q34 18 77 32q11 108 23 154q7 24 30 24h186q11 0 20 -7.5t10 -17.5l23 -153q34 -10 75 -31l118 89q8 7 20 7q11 0 21 -8q144 -133 144 -160q0 -9 -7 -19q-12 -16 -42 -54t-45 -60q23 -48 34 -82l152 -23q10 -2 17 -10.5t7 -19.5zM1920 198v-140q0 -16 -149 -31 q-12 -27 -30 -52q51 -113 51 -138q0 -4 -4 -7q-122 -71 -124 -71q-8 0 -46 47t-52 68q-20 -2 -30 -2t-30 2q-14 -21 -52 -68t-46 -47q-2 0 -124 71q-4 3 -4 7q0 25 51 138q-18 25 -30 52q-149 15 -149 31v140q0 16 149 31q13 29 30 52q-51 113 -51 138q0 4 4 7q4 2 35 20 t59 34t30 16q8 0 46 -46.5t52 -67.5q20 2 30 2t30 -2q51 71 92 112l6 2q4 0 124 -70q4 -3 4 -7q0 -25 -51 -138q17 -23 30 -52q149 -15 149 -31zM1920 1222v-140q0 -16 -149 -31q-12 -27 -30 -52q51 -113 51 -138q0 -4 -4 -7q-122 -71 -124 -71q-8 0 -46 47t-52 68 q-20 -2 -30 -2t-30 2q-14 -21 -52 -68t-46 -47q-2 0 -124 71q-4 3 -4 7q0 25 51 138q-18 25 -30 52q-149 15 -149 31v140q0 16 149 31q13 29 30 52q-51 113 -51 138q0 4 4 7q4 2 35 20t59 34t30 16q8 0 46 -46.5t52 -67.5q20 2 30 2t30 -2q51 71 92 112l6 2q4 0 124 -70 q4 -3 4 -7q0 -25 -51 -138q17 -23 30 -52q149 -15 149 -31z" /> +<glyph unicode="" horiz-adv-x="1792" d="M1408 768q0 -139 -94 -257t-256.5 -186.5t-353.5 -68.5q-86 0 -176 16q-124 -88 -278 -128q-36 -9 -86 -16h-3q-11 0 -20.5 8t-11.5 21q-1 3 -1 6.5t0.5 6.5t2 6l2.5 5t3.5 5.5t4 5t4.5 5t4 4.5q5 6 23 25t26 29.5t22.5 29t25 38.5t20.5 44q-124 72 -195 177t-71 224 q0 139 94 257t256.5 186.5t353.5 68.5t353.5 -68.5t256.5 -186.5t94 -257zM1792 512q0 -120 -71 -224.5t-195 -176.5q10 -24 20.5 -44t25 -38.5t22.5 -29t26 -29.5t23 -25q1 -1 4 -4.5t4.5 -5t4 -5t3.5 -5.5l2.5 -5t2 -6t0.5 -6.5t-1 -6.5q-3 -14 -13 -22t-22 -7 q-50 7 -86 16q-154 40 -278 128q-90 -16 -176 -16q-271 0 -472 132q58 -4 88 -4q161 0 309 45t264 129q125 92 192 212t67 254q0 77 -23 152q129 -71 204 -178t75 -230z" /> +<glyph unicode="" d="M256 192q0 26 -19 45t-45 19t-45 -19t-19 -45t19 -45t45 -19t45 19t19 45zM1408 768q0 51 -39 89.5t-89 38.5h-352q0 58 48 159.5t48 160.5q0 98 -32 145t-128 47q-26 -26 -38 -85t-30.5 -125.5t-59.5 -109.5q-22 -23 -77 -91q-4 -5 -23 -30t-31.5 -41t-34.5 -42.5 t-40 -44t-38.5 -35.5t-40 -27t-35.5 -9h-32v-640h32q13 0 31.5 -3t33 -6.5t38 -11t35 -11.5t35.5 -12.5t29 -10.5q211 -73 342 -73h121q192 0 192 167q0 26 -5 56q30 16 47.5 52.5t17.5 73.5t-18 69q53 50 53 119q0 25 -10 55.5t-25 47.5q32 1 53.5 47t21.5 81zM1536 769 q0 -89 -49 -163q9 -33 9 -69q0 -77 -38 -144q3 -21 3 -43q0 -101 -60 -178q1 -139 -85 -219.5t-227 -80.5h-36h-93q-96 0 -189.5 22.5t-216.5 65.5q-116 40 -138 40h-288q-53 0 -90.5 37.5t-37.5 90.5v640q0 53 37.5 90.5t90.5 37.5h274q36 24 137 155q58 75 107 128 q24 25 35.5 85.5t30.5 126.5t62 108q39 37 90 37q84 0 151 -32.5t102 -101.5t35 -186q0 -93 -48 -192h176q104 0 180 -76t76 -179z" /> +<glyph unicode="" d="M256 1088q0 26 -19 45t-45 19t-45 -19t-19 -45t19 -45t45 -19t45 19t19 45zM1408 512q0 35 -21.5 81t-53.5 47q15 17 25 47.5t10 55.5q0 69 -53 119q18 32 18 69t-17.5 73.5t-47.5 52.5q5 30 5 56q0 85 -49 126t-136 41h-128q-131 0 -342 -73q-5 -2 -29 -10.5 t-35.5 -12.5t-35 -11.5t-38 -11t-33 -6.5t-31.5 -3h-32v-640h32q16 0 35.5 -9t40 -27t38.5 -35.5t40 -44t34.5 -42.5t31.5 -41t23 -30q55 -68 77 -91q41 -43 59.5 -109.5t30.5 -125.5t38 -85q96 0 128 47t32 145q0 59 -48 160.5t-48 159.5h352q50 0 89 38.5t39 89.5z M1536 511q0 -103 -76 -179t-180 -76h-176q48 -99 48 -192q0 -118 -35 -186q-35 -69 -102 -101.5t-151 -32.5q-51 0 -90 37q-34 33 -54 82t-25.5 90.5t-17.5 84.5t-31 64q-48 50 -107 127q-101 131 -137 155h-274q-53 0 -90.5 37.5t-37.5 90.5v640q0 53 37.5 90.5t90.5 37.5 h288q22 0 138 40q128 44 223 66t200 22h112q140 0 226.5 -79t85.5 -216v-5q60 -77 60 -178q0 -22 -3 -43q38 -67 38 -144q0 -36 -9 -69q49 -74 49 -163z" /> +<glyph unicode="" horiz-adv-x="896" d="M832 1504v-1339l-449 -236q-22 -12 -40 -12q-21 0 -31.5 14.5t-10.5 35.5q0 6 2 20l86 500l-364 354q-25 27 -25 48q0 37 56 46l502 73l225 455q19 41 49 41z" /> +<glyph unicode="" horiz-adv-x="1792" d="M1664 940q0 81 -21.5 143t-55 98.5t-81.5 59.5t-94 31t-98 8t-112 -25.5t-110.5 -64t-86.5 -72t-60 -61.5q-18 -22 -49 -22t-49 22q-24 28 -60 61.5t-86.5 72t-110.5 64t-112 25.5t-98 -8t-94 -31t-81.5 -59.5t-55 -98.5t-21.5 -143q0 -168 187 -355l581 -560l580 559 q188 188 188 356zM1792 940q0 -221 -229 -450l-623 -600q-18 -18 -44 -18t-44 18l-624 602q-10 8 -27.5 26t-55.5 65.5t-68 97.5t-53.5 121t-23.5 138q0 220 127 344t351 124q62 0 126.5 -21.5t120 -58t95.5 -68.5t76 -68q36 36 76 68t95.5 68.5t120 58t126.5 21.5 q224 0 351 -124t127 -344z" /> +<glyph unicode="" horiz-adv-x="1664" d="M640 96q0 -4 1 -20t0.5 -26.5t-3 -23.5t-10 -19.5t-20.5 -6.5h-320q-119 0 -203.5 84.5t-84.5 203.5v704q0 119 84.5 203.5t203.5 84.5h320q13 0 22.5 -9.5t9.5 -22.5q0 -4 1 -20t0.5 -26.5t-3 -23.5t-10 -19.5t-20.5 -6.5h-320q-66 0 -113 -47t-47 -113v-704 q0 -66 47 -113t113 -47h288h11h13t11.5 -1t11.5 -3t8 -5.5t7 -9t2 -13.5zM1568 640q0 -26 -19 -45l-544 -544q-19 -19 -45 -19t-45 19t-19 45v288h-448q-26 0 -45 19t-19 45v384q0 26 19 45t45 19h448v288q0 26 19 45t45 19t45 -19l544 -544q19 -19 19 -45z" /> +<glyph unicode="" d="M237 122h231v694h-231v-694zM483 1030q-1 52 -36 86t-93 34t-94.5 -34t-36.5 -86q0 -51 35.5 -85.5t92.5 -34.5h1q59 0 95 34.5t36 85.5zM1068 122h231v398q0 154 -73 233t-193 79q-136 0 -209 -117h2v101h-231q3 -66 0 -694h231v388q0 38 7 56q15 35 45 59.5t74 24.5 q116 0 116 -157v-371zM1536 1120v-960q0 -119 -84.5 -203.5t-203.5 -84.5h-960q-119 0 -203.5 84.5t-84.5 203.5v960q0 119 84.5 203.5t203.5 84.5h960q119 0 203.5 -84.5t84.5 -203.5z" /> +<glyph unicode="" horiz-adv-x="1152" d="M480 672v448q0 14 -9 23t-23 9t-23 -9t-9 -23v-448q0 -14 9 -23t23 -9t23 9t9 23zM1152 320q0 -26 -19 -45t-45 -19h-429l-51 -483q-2 -12 -10.5 -20.5t-20.5 -8.5h-1q-27 0 -32 27l-76 485h-404q-26 0 -45 19t-19 45q0 123 78.5 221.5t177.5 98.5v512q-52 0 -90 38 t-38 90t38 90t90 38h640q52 0 90 -38t38 -90t-38 -90t-90 -38v-512q99 0 177.5 -98.5t78.5 -221.5z" /> +<glyph unicode="" horiz-adv-x="1792" d="M1408 608v-320q0 -119 -84.5 -203.5t-203.5 -84.5h-832q-119 0 -203.5 84.5t-84.5 203.5v832q0 119 84.5 203.5t203.5 84.5h704q14 0 23 -9t9 -23v-64q0 -14 -9 -23t-23 -9h-704q-66 0 -113 -47t-47 -113v-832q0 -66 47 -113t113 -47h832q66 0 113 47t47 113v320 q0 14 9 23t23 9h64q14 0 23 -9t9 -23zM1792 1472v-512q0 -26 -19 -45t-45 -19t-45 19l-176 176l-652 -652q-10 -10 -23 -10t-23 10l-114 114q-10 10 -10 23t10 23l652 652l-176 176q-19 19 -19 45t19 45t45 19h512q26 0 45 -19t19 -45z" /> +<glyph unicode="" d="M1184 640q0 -26 -19 -45l-544 -544q-19 -19 -45 -19t-45 19t-19 45v288h-448q-26 0 -45 19t-19 45v384q0 26 19 45t45 19h448v288q0 26 19 45t45 19t45 -19l544 -544q19 -19 19 -45zM1536 992v-704q0 -119 -84.5 -203.5t-203.5 -84.5h-320q-13 0 -22.5 9.5t-9.5 22.5 q0 4 -1 20t-0.5 26.5t3 23.5t10 19.5t20.5 6.5h320q66 0 113 47t47 113v704q0 66 -47 113t-113 47h-288h-11h-13t-11.5 1t-11.5 3t-8 5.5t-7 9t-2 13.5q0 4 -1 20t-0.5 26.5t3 23.5t10 19.5t20.5 6.5h320q119 0 203.5 -84.5t84.5 -203.5z" /> +<glyph unicode="" horiz-adv-x="1664" d="M458 653q-74 162 -74 371h-256v-96q0 -78 94.5 -162t235.5 -113zM1536 928v96h-256q0 -209 -74 -371q141 29 235.5 113t94.5 162zM1664 1056v-128q0 -71 -41.5 -143t-112 -130t-173 -97.5t-215.5 -44.5q-42 -54 -95 -95q-38 -34 -52.5 -72.5t-14.5 -89.5q0 -54 30.5 -91 t97.5 -37q75 0 133.5 -45.5t58.5 -114.5v-64q0 -14 -9 -23t-23 -9h-832q-14 0 -23 9t-9 23v64q0 69 58.5 114.5t133.5 45.5q67 0 97.5 37t30.5 91q0 51 -14.5 89.5t-52.5 72.5q-53 41 -95 95q-113 5 -215.5 44.5t-173 97.5t-112 130t-41.5 143v128q0 40 28 68t68 28h288v96 q0 66 47 113t113 47h576q66 0 113 -47t47 -113v-96h288q40 0 68 -28t28 -68z" /> +<glyph unicode="" d="M394 184q-8 -9 -20 3q-13 11 -4 19q8 9 20 -3q12 -11 4 -19zM352 245q9 -12 0 -19q-8 -6 -17 7t0 18q9 7 17 -6zM291 305q-5 -7 -13 -2q-10 5 -7 12q3 5 13 2q10 -5 7 -12zM322 271q-6 -7 -16 3q-9 11 -2 16q6 6 16 -3q9 -11 2 -16zM451 159q-4 -12 -19 -6q-17 4 -13 15 t19 7q16 -5 13 -16zM514 154q0 -11 -16 -11q-17 -2 -17 11q0 11 16 11q17 2 17 -11zM572 164q2 -10 -14 -14t-18 8t14 15q16 2 18 -9zM1536 1120v-960q0 -119 -84.5 -203.5t-203.5 -84.5h-224q-16 0 -24.5 1t-19.5 5t-16 14.5t-5 27.5v239q0 97 -52 142q57 6 102.5 18t94 39 t81 66.5t53 105t20.5 150.5q0 121 -79 206q37 91 -8 204q-28 9 -81 -11t-92 -44l-38 -24q-93 26 -192 26t-192 -26q-16 11 -42.5 27t-83.5 38.5t-86 13.5q-44 -113 -7 -204q-79 -85 -79 -206q0 -85 20.5 -150t52.5 -105t80.5 -67t94 -39t102.5 -18q-40 -36 -49 -103 q-21 -10 -45 -15t-57 -5t-65.5 21.5t-55.5 62.5q-19 32 -48.5 52t-49.5 24l-20 3q-21 0 -29 -4.5t-5 -11.5t9 -14t13 -12l7 -5q22 -10 43.5 -38t31.5 -51l10 -23q13 -38 44 -61.5t67 -30t69.5 -7t55.5 3.5l23 4q0 -38 0.5 -103t0.5 -68q0 -22 -11 -33.5t-22 -13t-33 -1.5 h-224q-119 0 -203.5 84.5t-84.5 203.5v960q0 119 84.5 203.5t203.5 84.5h960q119 0 203.5 -84.5t84.5 -203.5z" /> +<glyph unicode="" horiz-adv-x="1664" d="M1280 64q0 26 -19 45t-45 19t-45 -19t-19 -45t19 -45t45 -19t45 19t19 45zM1536 64q0 26 -19 45t-45 19t-45 -19t-19 -45t19 -45t45 -19t45 19t19 45zM1664 288v-320q0 -40 -28 -68t-68 -28h-1472q-40 0 -68 28t-28 68v320q0 40 28 68t68 28h427q21 -56 70.5 -92 t110.5 -36h256q61 0 110.5 36t70.5 92h427q40 0 68 -28t28 -68zM1339 936q-17 -40 -59 -40h-256v-448q0 -26 -19 -45t-45 -19h-256q-26 0 -45 19t-19 45v448h-256q-42 0 -59 40q-17 39 14 69l448 448q18 19 45 19t45 -19l448 -448q31 -30 14 -69z" /> +<glyph unicode="" d="M1407 710q0 44 -7 113.5t-18 96.5q-12 30 -17 44t-9 36.5t-4 48.5q0 23 5 68.5t5 67.5q0 37 -10 55q-4 1 -13 1q-19 0 -58 -4.5t-59 -4.5q-60 0 -176 24t-175 24q-43 0 -94.5 -11.5t-85 -23.5t-89.5 -34q-137 -54 -202 -103q-96 -73 -159.5 -189.5t-88 -236t-24.5 -248.5 q0 -40 12.5 -120t12.5 -121q0 -23 -11 -66.5t-11 -65.5t12 -36.5t34 -14.5q24 0 72.5 11t73.5 11q57 0 169.5 -15.5t169.5 -15.5q181 0 284 36q129 45 235.5 152.5t166 245.5t59.5 275zM1535 712q0 -165 -70 -327.5t-196 -288t-281 -180.5q-124 -44 -326 -44 q-57 0 -170 14.5t-169 14.5q-24 0 -72.5 -14.5t-73.5 -14.5q-73 0 -123.5 55.5t-50.5 128.5q0 24 11 68t11 67q0 40 -12.5 120.5t-12.5 121.5q0 111 18 217.5t54.5 209.5t100.5 194t150 156q78 59 232 120q194 78 316 78q60 0 175.5 -24t173.5 -24q19 0 57 5t58 5 q81 0 118 -50.5t37 -134.5q0 -23 -5 -68t-5 -68q0 -10 1 -18.5t3 -17t4 -13.5t6.5 -16t6.5 -17q16 -40 25 -118.5t9 -136.5z" /> +<glyph unicode="" horiz-adv-x="1408" d="M1408 296q0 -27 -10 -70.5t-21 -68.5q-21 -50 -122 -106q-94 -51 -186 -51q-27 0 -52.5 3.5t-57.5 12.5t-47.5 14.5t-55.5 20.5t-49 18q-98 35 -175 83q-128 79 -264.5 215.5t-215.5 264.5q-48 77 -83 175q-3 9 -18 49t-20.5 55.5t-14.5 47.5t-12.5 57.5t-3.5 52.5 q0 92 51 186q56 101 106 122q25 11 68.5 21t70.5 10q14 0 21 -3q18 -6 53 -76q11 -19 30 -54t35 -63.5t31 -53.5q3 -4 17.5 -25t21.5 -35.5t7 -28.5q0 -20 -28.5 -50t-62 -55t-62 -53t-28.5 -46q0 -9 5 -22.5t8.5 -20.5t14 -24t11.5 -19q76 -137 174 -235t235 -174 q2 -1 19 -11.5t24 -14t20.5 -8.5t22.5 -5q18 0 46 28.5t53 62t55 62t50 28.5q14 0 28.5 -7t35.5 -21.5t25 -17.5q25 -15 53.5 -31t63.5 -35t54 -30q70 -35 76 -53q3 -7 3 -21z" /> +<glyph unicode="" horiz-adv-x="1408" d="M1120 1280h-832q-66 0 -113 -47t-47 -113v-832q0 -66 47 -113t113 -47h832q66 0 113 47t47 113v832q0 66 -47 113t-113 47zM1408 1120v-832q0 -119 -84.5 -203.5t-203.5 -84.5h-832q-119 0 -203.5 84.5t-84.5 203.5v832q0 119 84.5 203.5t203.5 84.5h832 q119 0 203.5 -84.5t84.5 -203.5z" /> +<glyph unicode="" horiz-adv-x="1280" d="M1152 1280h-1024v-1242l423 406l89 85l89 -85l423 -406v1242zM1164 1408q23 0 44 -9q33 -13 52.5 -41t19.5 -62v-1289q0 -34 -19.5 -62t-52.5 -41q-19 -8 -44 -8q-48 0 -83 32l-441 424l-441 -424q-36 -33 -83 -33q-23 0 -44 9q-33 13 -52.5 41t-19.5 62v1289 q0 34 19.5 62t52.5 41q21 9 44 9h1048z" /> +<glyph unicode="" d="M1280 343q0 11 -2 16q-3 8 -38.5 29.5t-88.5 49.5l-53 29q-5 3 -19 13t-25 15t-21 5q-18 0 -47 -32.5t-57 -65.5t-44 -33q-7 0 -16.5 3.5t-15.5 6.5t-17 9.5t-14 8.5q-99 55 -170.5 126.5t-126.5 170.5q-2 3 -8.5 14t-9.5 17t-6.5 15.5t-3.5 16.5q0 13 20.5 33.5t45 38.5 t45 39.5t20.5 36.5q0 10 -5 21t-15 25t-13 19q-3 6 -15 28.5t-25 45.5t-26.5 47.5t-25 40.5t-16.5 18t-16 2q-48 0 -101 -22q-46 -21 -80 -94.5t-34 -130.5q0 -16 2.5 -34t5 -30.5t9 -33t10 -29.5t12.5 -33t11 -30q60 -164 216.5 -320.5t320.5 -216.5q6 -2 30 -11t33 -12.5 t29.5 -10t33 -9t30.5 -5t34 -2.5q57 0 130.5 34t94.5 80q22 53 22 101zM1536 1120v-960q0 -119 -84.5 -203.5t-203.5 -84.5h-960q-119 0 -203.5 84.5t-84.5 203.5v960q0 119 84.5 203.5t203.5 84.5h960q119 0 203.5 -84.5t84.5 -203.5z" /> +<glyph unicode="" horiz-adv-x="1664" d="M1620 1128q-67 -98 -162 -167q1 -14 1 -42q0 -130 -38 -259.5t-115.5 -248.5t-184.5 -210.5t-258 -146t-323 -54.5q-271 0 -496 145q35 -4 78 -4q225 0 401 138q-105 2 -188 64.5t-114 159.5q33 -5 61 -5q43 0 85 11q-112 23 -185.5 111.5t-73.5 205.5v4q68 -38 146 -41 q-66 44 -105 115t-39 154q0 88 44 163q121 -149 294.5 -238.5t371.5 -99.5q-8 38 -8 74q0 134 94.5 228.5t228.5 94.5q140 0 236 -102q109 21 205 78q-37 -115 -142 -178q93 10 186 50z" /> +<glyph unicode="" horiz-adv-x="768" d="M511 980h257l-30 -284h-227v-824h-341v824h-170v284h170v171q0 182 86 275.5t283 93.5h227v-284h-142q-39 0 -62.5 -6.5t-34 -23.5t-13.5 -34.5t-3 -49.5v-142z" /> +<glyph unicode="" d="M1536 640q0 -251 -146.5 -451.5t-378.5 -277.5q-27 -5 -39.5 7t-12.5 30v211q0 97 -52 142q57 6 102.5 18t94 39t81 66.5t53 105t20.5 150.5q0 121 -79 206q37 91 -8 204q-28 9 -81 -11t-92 -44l-38 -24q-93 26 -192 26t-192 -26q-16 11 -42.5 27t-83.5 38.5t-86 13.5 q-44 -113 -7 -204q-79 -85 -79 -206q0 -85 20.5 -150t52.5 -105t80.5 -67t94 -39t102.5 -18q-40 -36 -49 -103q-21 -10 -45 -15t-57 -5t-65.5 21.5t-55.5 62.5q-19 32 -48.5 52t-49.5 24l-20 3q-21 0 -29 -4.5t-5 -11.5t9 -14t13 -12l7 -5q22 -10 43.5 -38t31.5 -51l10 -23 q13 -38 44 -61.5t67 -30t69.5 -7t55.5 3.5l23 4q0 -38 0.5 -89t0.5 -54q0 -18 -13 -30t-40 -7q-232 77 -378.5 277.5t-146.5 451.5q0 209 103 385.5t279.5 279.5t385.5 103t385.5 -103t279.5 -279.5t103 -385.5z" /> +<glyph unicode="" horiz-adv-x="1664" d="M1664 960v-256q0 -26 -19 -45t-45 -19h-64q-26 0 -45 19t-19 45v256q0 106 -75 181t-181 75t-181 -75t-75 -181v-192h96q40 0 68 -28t28 -68v-576q0 -40 -28 -68t-68 -28h-960q-40 0 -68 28t-28 68v576q0 40 28 68t68 28h672v192q0 185 131.5 316.5t316.5 131.5 t316.5 -131.5t131.5 -316.5z" /> +<glyph unicode="" horiz-adv-x="1920" d="M1760 1408q66 0 113 -47t47 -113v-1216q0 -66 -47 -113t-113 -47h-1600q-66 0 -113 47t-47 113v1216q0 66 47 113t113 47h1600zM160 1280q-13 0 -22.5 -9.5t-9.5 -22.5v-224h1664v224q0 13 -9.5 22.5t-22.5 9.5h-1600zM1760 0q13 0 22.5 9.5t9.5 22.5v608h-1664v-608 q0 -13 9.5 -22.5t22.5 -9.5h1600zM256 128v128h256v-128h-256zM640 128v128h384v-128h-384z" /> +<glyph unicode="" horiz-adv-x="1408" d="M384 192q0 -80 -56 -136t-136 -56t-136 56t-56 136t56 136t136 56t136 -56t56 -136zM896 69q2 -28 -17 -48q-18 -21 -47 -21h-135q-25 0 -43 16.5t-20 41.5q-22 229 -184.5 391.5t-391.5 184.5q-25 2 -41.5 20t-16.5 43v135q0 29 21 47q17 17 43 17h5q160 -13 306 -80.5 t259 -181.5q114 -113 181.5 -259t80.5 -306zM1408 67q2 -27 -18 -47q-18 -20 -46 -20h-143q-26 0 -44.5 17.5t-19.5 42.5q-12 215 -101 408.5t-231.5 336t-336 231.5t-408.5 102q-25 1 -42.5 19.5t-17.5 43.5v143q0 28 20 46q18 18 44 18h3q262 -13 501.5 -120t425.5 -294 q187 -186 294 -425.5t120 -501.5z" /> +<glyph unicode="" d="M1040 320q0 -33 -23.5 -56.5t-56.5 -23.5t-56.5 23.5t-23.5 56.5t23.5 56.5t56.5 23.5t56.5 -23.5t23.5 -56.5zM1296 320q0 -33 -23.5 -56.5t-56.5 -23.5t-56.5 23.5t-23.5 56.5t23.5 56.5t56.5 23.5t56.5 -23.5t23.5 -56.5zM1408 160v320q0 13 -9.5 22.5t-22.5 9.5 h-1216q-13 0 -22.5 -9.5t-9.5 -22.5v-320q0 -13 9.5 -22.5t22.5 -9.5h1216q13 0 22.5 9.5t9.5 22.5zM178 640h1180l-157 482q-4 13 -16 21.5t-26 8.5h-782q-14 0 -26 -8.5t-16 -21.5zM1536 480v-320q0 -66 -47 -113t-113 -47h-1216q-66 0 -113 47t-47 113v320q0 25 16 75 l197 606q17 53 63 86t101 33h782q55 0 101 -33t63 -86l197 -606q16 -50 16 -75z" /> +<glyph unicode="" horiz-adv-x="1792" d="M1664 896q53 0 90.5 -37.5t37.5 -90.5t-37.5 -90.5t-90.5 -37.5v-384q0 -52 -38 -90t-90 -38q-417 347 -812 380q-58 -19 -91 -66t-31 -100.5t40 -92.5q-20 -33 -23 -65.5t6 -58t33.5 -55t48 -50t61.5 -50.5q-29 -58 -111.5 -83t-168.5 -11.5t-132 55.5q-7 23 -29.5 87.5 t-32 94.5t-23 89t-15 101t3.5 98.5t22 110.5h-122q-66 0 -113 47t-47 113v192q0 66 47 113t113 47h480q435 0 896 384q52 0 90 -38t38 -90v-384zM1536 292v954q-394 -302 -768 -343v-270q377 -42 768 -341z" /> +<glyph unicode="" horiz-adv-x="1664" d="M848 -160q0 16 -16 16q-59 0 -101.5 42.5t-42.5 101.5q0 16 -16 16t-16 -16q0 -73 51.5 -124.5t124.5 -51.5q16 0 16 16zM183 128h1298q-164 181 -246.5 411.5t-82.5 484.5q0 256 -320 256t-320 -256q0 -254 -82.5 -484.5t-246.5 -411.5zM1664 128q0 -52 -38 -90t-90 -38 h-448q0 -106 -75 -181t-181 -75t-181 75t-75 181h-448q-52 0 -90 38t-38 90q190 161 287 397.5t97 498.5q0 165 96 262t264 117q-8 18 -8 37q0 40 28 68t68 28t68 -28t28 -68q0 -19 -8 -37q168 -20 264 -117t96 -262q0 -262 97 -498.5t287 -397.5z" /> +<glyph unicode="" d="M1376 640l138 -135q30 -28 20 -70q-12 -41 -52 -51l-188 -48l53 -186q12 -41 -19 -70q-29 -31 -70 -19l-186 53l-48 -188q-10 -40 -51 -52q-12 -2 -19 -2q-31 0 -51 22l-135 138l-135 -138q-28 -30 -70 -20q-41 11 -51 52l-48 188l-186 -53q-41 -12 -70 19q-31 29 -19 70 l53 186l-188 48q-40 10 -52 51q-10 42 20 70l138 135l-138 135q-30 28 -20 70q12 41 52 51l188 48l-53 186q-12 41 19 70q29 31 70 19l186 -53l48 188q10 41 51 51q41 12 70 -19l135 -139l135 139q29 30 70 19q41 -10 51 -51l48 -188l186 53q41 12 70 -19q31 -29 19 -70 l-53 -186l188 -48q40 -10 52 -51q10 -42 -20 -70z" /> +<glyph unicode="" horiz-adv-x="1792" d="M256 192q0 26 -19 45t-45 19t-45 -19t-19 -45t19 -45t45 -19t45 19t19 45zM1664 768q0 51 -39 89.5t-89 38.5h-576q0 20 15 48.5t33 55t33 68t15 84.5q0 67 -44.5 97.5t-115.5 30.5q-24 0 -90 -139q-24 -44 -37 -65q-40 -64 -112 -145q-71 -81 -101 -106 q-69 -57 -140 -57h-32v-640h32q72 0 167 -32t193.5 -64t179.5 -32q189 0 189 167q0 26 -5 56q30 16 47.5 52.5t17.5 73.5t-18 69q53 50 53 119q0 25 -10 55.5t-25 47.5h331q52 0 90 38t38 90zM1792 769q0 -105 -75.5 -181t-180.5 -76h-169q-4 -62 -37 -119q3 -21 3 -43 q0 -101 -60 -178q1 -139 -85 -219.5t-227 -80.5q-133 0 -322 69q-164 59 -223 59h-288q-53 0 -90.5 37.5t-37.5 90.5v640q0 53 37.5 90.5t90.5 37.5h288q10 0 21.5 4.5t23.5 14t22.5 18t24 22.5t20.5 21.5t19 21.5t14 17q65 74 100 129q13 21 33 62t37 72t40.5 63t55 49.5 t69.5 17.5q125 0 206.5 -67t81.5 -189q0 -68 -22 -128h374q104 0 180 -76t76 -179z" /> +<glyph unicode="" horiz-adv-x="1792" d="M1376 128h32v640h-32q-35 0 -67.5 12t-62.5 37t-50 46t-49 54q-2 3 -3.5 4.5t-4 4.5t-4.5 5q-72 81 -112 145q-14 22 -38 68q-1 3 -10.5 22.5t-18.5 36t-20 35.5t-21.5 30.5t-18.5 11.5q-71 0 -115.5 -30.5t-44.5 -97.5q0 -43 15 -84.5t33 -68t33 -55t15 -48.5h-576 q-50 0 -89 -38.5t-39 -89.5q0 -52 38 -90t90 -38h331q-15 -17 -25 -47.5t-10 -55.5q0 -69 53 -119q-18 -32 -18 -69t17.5 -73.5t47.5 -52.5q-4 -24 -4 -56q0 -85 48.5 -126t135.5 -41q84 0 183 32t194 64t167 32zM1664 192q0 26 -19 45t-45 19t-45 -19t-19 -45t19 -45 t45 -19t45 19t19 45zM1792 768v-640q0 -53 -37.5 -90.5t-90.5 -37.5h-288q-59 0 -223 -59q-190 -69 -317 -69q-142 0 -230 77.5t-87 217.5l1 5q-61 76 -61 178q0 22 3 43q-33 57 -37 119h-169q-105 0 -180.5 76t-75.5 181q0 103 76 179t180 76h374q-22 60 -22 128 q0 122 81.5 189t206.5 67q38 0 69.5 -17.5t55 -49.5t40.5 -63t37 -72t33 -62q35 -55 100 -129q2 -3 14 -17t19 -21.5t20.5 -21.5t24 -22.5t22.5 -18t23.5 -14t21.5 -4.5h288q53 0 90.5 -37.5t37.5 -90.5z" /> +<glyph unicode="" d="M1280 -64q0 26 -19 45t-45 19t-45 -19t-19 -45t19 -45t45 -19t45 19t19 45zM1408 700q0 189 -167 189q-26 0 -56 -5q-16 30 -52.5 47.5t-73.5 17.5t-69 -18q-50 53 -119 53q-25 0 -55.5 -10t-47.5 -25v331q0 52 -38 90t-90 38q-51 0 -89.5 -39t-38.5 -89v-576 q-20 0 -48.5 15t-55 33t-68 33t-84.5 15q-67 0 -97.5 -44.5t-30.5 -115.5q0 -24 139 -90q44 -24 65 -37q64 -40 145 -112q81 -71 106 -101q57 -69 57 -140v-32h640v32q0 72 32 167t64 193.5t32 179.5zM1536 705q0 -133 -69 -322q-59 -164 -59 -223v-288q0 -53 -37.5 -90.5 t-90.5 -37.5h-640q-53 0 -90.5 37.5t-37.5 90.5v288q0 10 -4.5 21.5t-14 23.5t-18 22.5t-22.5 24t-21.5 20.5t-21.5 19t-17 14q-74 65 -129 100q-21 13 -62 33t-72 37t-63 40.5t-49.5 55t-17.5 69.5q0 125 67 206.5t189 81.5q68 0 128 -22v374q0 104 76 180t179 76 q105 0 181 -75.5t76 -180.5v-169q62 -4 119 -37q21 3 43 3q101 0 178 -60q139 1 219.5 -85t80.5 -227z" /> +<glyph unicode="" d="M1408 576q0 84 -32 183t-64 194t-32 167v32h-640v-32q0 -35 -12 -67.5t-37 -62.5t-46 -50t-54 -49q-9 -8 -14 -12q-81 -72 -145 -112q-22 -14 -68 -38q-3 -1 -22.5 -10.5t-36 -18.5t-35.5 -20t-30.5 -21.5t-11.5 -18.5q0 -71 30.5 -115.5t97.5 -44.5q43 0 84.5 15t68 33 t55 33t48.5 15v-576q0 -50 38.5 -89t89.5 -39q52 0 90 38t38 90v331q46 -35 103 -35q69 0 119 53q32 -18 69 -18t73.5 17.5t52.5 47.5q24 -4 56 -4q85 0 126 48.5t41 135.5zM1280 1344q0 26 -19 45t-45 19t-45 -19t-19 -45t19 -45t45 -19t45 19t19 45zM1536 580 q0 -142 -77.5 -230t-217.5 -87l-5 1q-76 -61 -178 -61q-22 0 -43 3q-54 -30 -119 -37v-169q0 -105 -76 -180.5t-181 -75.5q-103 0 -179 76t-76 180v374q-54 -22 -128 -22q-121 0 -188.5 81.5t-67.5 206.5q0 38 17.5 69.5t49.5 55t63 40.5t72 37t62 33q55 35 129 100 q3 2 17 14t21.5 19t21.5 20.5t22.5 24t18 22.5t14 23.5t4.5 21.5v288q0 53 37.5 90.5t90.5 37.5h640q53 0 90.5 -37.5t37.5 -90.5v-288q0 -59 59 -223q69 -190 69 -317z" /> +<glyph unicode="" d="M1280 576v128q0 26 -19 45t-45 19h-502l189 189q19 19 19 45t-19 45l-91 91q-18 18 -45 18t-45 -18l-362 -362l-91 -91q-18 -18 -18 -45t18 -45l91 -91l362 -362q18 -18 45 -18t45 18l91 91q18 18 18 45t-18 45l-189 189h502q26 0 45 19t19 45zM1536 640 q0 -209 -103 -385.5t-279.5 -279.5t-385.5 -103t-385.5 103t-279.5 279.5t-103 385.5t103 385.5t279.5 279.5t385.5 103t385.5 -103t279.5 -279.5t103 -385.5z" /> +<glyph unicode="" d="M1285 640q0 27 -18 45l-91 91l-362 362q-18 18 -45 18t-45 -18l-91 -91q-18 -18 -18 -45t18 -45l189 -189h-502q-26 0 -45 -19t-19 -45v-128q0 -26 19 -45t45 -19h502l-189 -189q-19 -19 -19 -45t19 -45l91 -91q18 -18 45 -18t45 18l362 362l91 91q18 18 18 45zM1536 640 q0 -209 -103 -385.5t-279.5 -279.5t-385.5 -103t-385.5 103t-279.5 279.5t-103 385.5t103 385.5t279.5 279.5t385.5 103t385.5 -103t279.5 -279.5t103 -385.5z" /> +<glyph unicode="" d="M1284 641q0 27 -18 45l-362 362l-91 91q-18 18 -45 18t-45 -18l-91 -91l-362 -362q-18 -18 -18 -45t18 -45l91 -91q18 -18 45 -18t45 18l189 189v-502q0 -26 19 -45t45 -19h128q26 0 45 19t19 45v502l189 -189q19 -19 45 -19t45 19l91 91q18 18 18 45zM1536 640 q0 -209 -103 -385.5t-279.5 -279.5t-385.5 -103t-385.5 103t-279.5 279.5t-103 385.5t103 385.5t279.5 279.5t385.5 103t385.5 -103t279.5 -279.5t103 -385.5z" /> +<glyph unicode="" d="M1284 639q0 27 -18 45l-91 91q-18 18 -45 18t-45 -18l-189 -189v502q0 26 -19 45t-45 19h-128q-26 0 -45 -19t-19 -45v-502l-189 189q-19 19 -45 19t-45 -19l-91 -91q-18 -18 -18 -45t18 -45l362 -362l91 -91q18 -18 45 -18t45 18l91 91l362 362q18 18 18 45zM1536 640 q0 -209 -103 -385.5t-279.5 -279.5t-385.5 -103t-385.5 103t-279.5 279.5t-103 385.5t103 385.5t279.5 279.5t385.5 103t385.5 -103t279.5 -279.5t103 -385.5z" /> +<glyph unicode="" d="M768 1408q209 0 385.5 -103t279.5 -279.5t103 -385.5t-103 -385.5t-279.5 -279.5t-385.5 -103t-385.5 103t-279.5 279.5t-103 385.5t103 385.5t279.5 279.5t385.5 103zM1042 887q-2 -1 -9.5 -9.5t-13.5 -9.5q2 0 4.5 5t5 11t3.5 7q6 7 22 15q14 6 52 12q34 8 51 -11 q-2 2 9.5 13t14.5 12q3 2 15 4.5t15 7.5l2 22q-12 -1 -17.5 7t-6.5 21q0 -2 -6 -8q0 7 -4.5 8t-11.5 -1t-9 -1q-10 3 -15 7.5t-8 16.5t-4 15q-2 5 -9.5 10.5t-9.5 10.5q-1 2 -2.5 5.5t-3 6.5t-4 5.5t-5.5 2.5t-7 -5t-7.5 -10t-4.5 -5q-3 2 -6 1.5t-4.5 -1t-4.5 -3t-5 -3.5 q-3 -2 -8.5 -3t-8.5 -2q15 5 -1 11q-10 4 -16 3q9 4 7.5 12t-8.5 14h5q-1 4 -8.5 8.5t-17.5 8.5t-13 6q-8 5 -34 9.5t-33 0.5q-5 -6 -4.5 -10.5t4 -14t3.5 -12.5q1 -6 -5.5 -13t-6.5 -12q0 -7 14 -15.5t10 -21.5q-3 -8 -16 -16t-16 -12q-5 -8 -1.5 -18.5t10.5 -16.5 q2 -2 1.5 -4t-3.5 -4.5t-5.5 -4t-6.5 -3.5l-3 -2q-11 -5 -20.5 6t-13.5 26q-7 25 -16 30q-23 8 -29 -1q-5 13 -41 26q-25 9 -58 4q6 1 0 15q-7 15 -19 12q3 6 4 17.5t1 13.5q3 13 12 23q1 1 7 8.5t9.5 13.5t0.5 6q35 -4 50 11q5 5 11.5 17t10.5 17q9 6 14 5.5t14.5 -5.5 t14.5 -5q14 -1 15.5 11t-7.5 20q12 -1 3 17q-5 7 -8 9q-12 4 -27 -5q-8 -4 2 -8q-1 1 -9.5 -10.5t-16.5 -17.5t-16 5q-1 1 -5.5 13.5t-9.5 13.5q-8 0 -16 -15q3 8 -11 15t-24 8q19 12 -8 27q-7 4 -20.5 5t-19.5 -4q-5 -7 -5.5 -11.5t5 -8t10.5 -5.5t11.5 -4t8.5 -3 q14 -10 8 -14q-2 -1 -8.5 -3.5t-11.5 -4.5t-6 -4q-3 -4 0 -14t-2 -14q-5 5 -9 17.5t-7 16.5q7 -9 -25 -6l-10 1q-4 0 -16 -2t-20.5 -1t-13.5 8q-4 8 0 20q1 4 4 2q-4 3 -11 9.5t-10 8.5q-46 -15 -94 -41q6 -1 12 1q5 2 13 6.5t10 5.5q34 14 42 7l5 5q14 -16 20 -25 q-7 4 -30 1q-20 -6 -22 -12q7 -12 5 -18q-4 3 -11.5 10t-14.5 11t-15 5q-16 0 -22 -1q-146 -80 -235 -222q7 -7 12 -8q4 -1 5 -9t2.5 -11t11.5 3q9 -8 3 -19q1 1 44 -27q19 -17 21 -21q3 -11 -10 -18q-1 2 -9 9t-9 4q-3 -5 0.5 -18.5t10.5 -12.5q-7 0 -9.5 -16t-2.5 -35.5 t-1 -23.5l2 -1q-3 -12 5.5 -34.5t21.5 -19.5q-13 -3 20 -43q6 -8 8 -9q3 -2 12 -7.5t15 -10t10 -10.5q4 -5 10 -22.5t14 -23.5q-2 -6 9.5 -20t10.5 -23q-1 0 -2.5 -1t-2.5 -1q3 -7 15.5 -14t15.5 -13q1 -3 2 -10t3 -11t8 -2q2 20 -24 62q-15 25 -17 29q-3 5 -5.5 15.5 t-4.5 14.5q2 0 6 -1.5t8.5 -3.5t7.5 -4t2 -3q-3 -7 2 -17.5t12 -18.5t17 -19t12 -13q6 -6 14 -19.5t0 -13.5q9 0 20 -10t17 -20q5 -8 8 -26t5 -24q2 -7 8.5 -13.5t12.5 -9.5l16 -8t13 -7q5 -2 18.5 -10.5t21.5 -11.5q10 -4 16 -4t14.5 2.5t13.5 3.5q15 2 29 -15t21 -21 q36 -19 55 -11q-2 -1 0.5 -7.5t8 -15.5t9 -14.5t5.5 -8.5q5 -6 18 -15t18 -15q6 4 7 9q-3 -8 7 -20t18 -10q14 3 14 32q-31 -15 -49 18q0 1 -2.5 5.5t-4 8.5t-2.5 8.5t0 7.5t5 3q9 0 10 3.5t-2 12.5t-4 13q-1 8 -11 20t-12 15q-5 -9 -16 -8t-16 9q0 -1 -1.5 -5.5t-1.5 -6.5 q-13 0 -15 1q1 3 2.5 17.5t3.5 22.5q1 4 5.5 12t7.5 14.5t4 12.5t-4.5 9.5t-17.5 2.5q-19 -1 -26 -20q-1 -3 -3 -10.5t-5 -11.5t-9 -7q-7 -3 -24 -2t-24 5q-13 8 -22.5 29t-9.5 37q0 10 2.5 26.5t3 25t-5.5 24.5q3 2 9 9.5t10 10.5q2 1 4.5 1.5t4.5 0t4 1.5t3 6q-1 1 -4 3 q-3 3 -4 3q7 -3 28.5 1.5t27.5 -1.5q15 -11 22 2q0 1 -2.5 9.5t-0.5 13.5q5 -27 29 -9q3 -3 15.5 -5t17.5 -5q3 -2 7 -5.5t5.5 -4.5t5 0.5t8.5 6.5q10 -14 12 -24q11 -40 19 -44q7 -3 11 -2t4.5 9.5t0 14t-1.5 12.5l-1 8v18l-1 8q-15 3 -18.5 12t1.5 18.5t15 18.5q1 1 8 3.5 t15.5 6.5t12.5 8q21 19 15 35q7 0 11 9q-1 0 -5 3t-7.5 5t-4.5 2q9 5 2 16q5 3 7.5 11t7.5 10q9 -12 21 -2q7 8 1 16q5 7 20.5 10.5t18.5 9.5q7 -2 8 2t1 12t3 12q4 5 15 9t13 5l17 11q3 4 0 4q18 -2 31 11q10 11 -6 20q3 6 -3 9.5t-15 5.5q3 1 11.5 0.5t10.5 1.5 q15 10 -7 16q-17 5 -43 -12zM879 10q206 36 351 189q-3 3 -12.5 4.5t-12.5 3.5q-18 7 -24 8q1 7 -2.5 13t-8 9t-12.5 8t-11 7q-2 2 -7 6t-7 5.5t-7.5 4.5t-8.5 2t-10 -1l-3 -1q-3 -1 -5.5 -2.5t-5.5 -3t-4 -3t0 -2.5q-21 17 -36 22q-5 1 -11 5.5t-10.5 7t-10 1.5t-11.5 -7 q-5 -5 -6 -15t-2 -13q-7 5 0 17.5t2 18.5q-3 6 -10.5 4.5t-12 -4.5t-11.5 -8.5t-9 -6.5t-8.5 -5.5t-8.5 -7.5q-3 -4 -6 -12t-5 -11q-2 4 -11.5 6.5t-9.5 5.5q2 -10 4 -35t5 -38q7 -31 -12 -48q-27 -25 -29 -40q-4 -22 12 -26q0 -7 -8 -20.5t-7 -21.5q0 -6 2 -16z" /> +<glyph unicode="" horiz-adv-x="1664" d="M384 64q0 26 -19 45t-45 19t-45 -19t-19 -45t19 -45t45 -19t45 19t19 45zM1028 484l-682 -682q-37 -37 -90 -37q-52 0 -91 37l-106 108q-38 36 -38 90q0 53 38 91l681 681q39 -98 114.5 -173.5t173.5 -114.5zM1662 919q0 -39 -23 -106q-47 -134 -164.5 -217.5 t-258.5 -83.5q-185 0 -316.5 131.5t-131.5 316.5t131.5 316.5t316.5 131.5q58 0 121.5 -16.5t107.5 -46.5q16 -11 16 -28t-16 -28l-293 -169v-224l193 -107q5 3 79 48.5t135.5 81t70.5 35.5q15 0 23.5 -10t8.5 -25z" /> +<glyph unicode="" horiz-adv-x="1792" d="M1024 128h640v128h-640v-128zM640 640h1024v128h-1024v-128zM1280 1152h384v128h-384v-128zM1792 320v-256q0 -26 -19 -45t-45 -19h-1664q-26 0 -45 19t-19 45v256q0 26 19 45t45 19h1664q26 0 45 -19t19 -45zM1792 832v-256q0 -26 -19 -45t-45 -19h-1664q-26 0 -45 19 t-19 45v256q0 26 19 45t45 19h1664q26 0 45 -19t19 -45zM1792 1344v-256q0 -26 -19 -45t-45 -19h-1664q-26 0 -45 19t-19 45v256q0 26 19 45t45 19h1664q26 0 45 -19t19 -45z" /> +<glyph unicode="" horiz-adv-x="1408" d="M1403 1241q17 -41 -14 -70l-493 -493v-742q0 -42 -39 -59q-13 -5 -25 -5q-27 0 -45 19l-256 256q-19 19 -19 45v486l-493 493q-31 29 -14 70q17 39 59 39h1280q42 0 59 -39z" /> +<glyph unicode="" horiz-adv-x="1792" d="M640 1280h512v128h-512v-128zM1792 640v-480q0 -66 -47 -113t-113 -47h-1472q-66 0 -113 47t-47 113v480h672v-160q0 -26 19 -45t45 -19h320q26 0 45 19t19 45v160h672zM1024 640v-128h-256v128h256zM1792 1120v-384h-1792v384q0 66 47 113t113 47h352v160q0 40 28 68 t68 28h576q40 0 68 -28t28 -68v-160h352q66 0 113 -47t47 -113z" /> +<glyph unicode="" d="M1283 995l-355 -355l355 -355l144 144q29 31 70 14q39 -17 39 -59v-448q0 -26 -19 -45t-45 -19h-448q-42 0 -59 40q-17 39 14 69l144 144l-355 355l-355 -355l144 -144q31 -30 14 -69q-17 -40 -59 -40h-448q-26 0 -45 19t-19 45v448q0 42 40 59q39 17 69 -14l144 -144 l355 355l-355 355l-144 -144q-19 -19 -45 -19q-12 0 -24 5q-40 17 -40 59v448q0 26 19 45t45 19h448q42 0 59 -40q17 -39 -14 -69l-144 -144l355 -355l355 355l-144 144q-31 30 -14 69q17 40 59 40h448q26 0 45 -19t19 -45v-448q0 -42 -39 -59q-13 -5 -25 -5q-26 0 -45 19z " /> +<glyph unicode="" horiz-adv-x="1920" d="M593 640q-162 -5 -265 -128h-134q-82 0 -138 40.5t-56 118.5q0 353 124 353q6 0 43.5 -21t97.5 -42.5t119 -21.5q67 0 133 23q-5 -37 -5 -66q0 -139 81 -256zM1664 3q0 -120 -73 -189.5t-194 -69.5h-874q-121 0 -194 69.5t-73 189.5q0 53 3.5 103.5t14 109t26.5 108.5 t43 97.5t62 81t85.5 53.5t111.5 20q10 0 43 -21.5t73 -48t107 -48t135 -21.5t135 21.5t107 48t73 48t43 21.5q61 0 111.5 -20t85.5 -53.5t62 -81t43 -97.5t26.5 -108.5t14 -109t3.5 -103.5zM640 1280q0 -106 -75 -181t-181 -75t-181 75t-75 181t75 181t181 75t181 -75 t75 -181zM1344 896q0 -159 -112.5 -271.5t-271.5 -112.5t-271.5 112.5t-112.5 271.5t112.5 271.5t271.5 112.5t271.5 -112.5t112.5 -271.5zM1920 671q0 -78 -56 -118.5t-138 -40.5h-134q-103 123 -265 128q81 117 81 256q0 29 -5 66q66 -23 133 -23q59 0 119 21.5t97.5 42.5 t43.5 21q124 0 124 -353zM1792 1280q0 -106 -75 -181t-181 -75t-181 75t-75 181t75 181t181 75t181 -75t75 -181z" /> +<glyph unicode="" horiz-adv-x="1664" d="M1456 320q0 40 -28 68l-208 208q-28 28 -68 28q-42 0 -72 -32q3 -3 19 -18.5t21.5 -21.5t15 -19t13 -25.5t3.5 -27.5q0 -40 -28 -68t-68 -28q-15 0 -27.5 3.5t-25.5 13t-19 15t-21.5 21.5t-18.5 19q-33 -31 -33 -73q0 -40 28 -68l206 -207q27 -27 68 -27q40 0 68 26 l147 146q28 28 28 67zM753 1025q0 40 -28 68l-206 207q-28 28 -68 28q-39 0 -68 -27l-147 -146q-28 -28 -28 -67q0 -40 28 -68l208 -208q27 -27 68 -27q42 0 72 31q-3 3 -19 18.5t-21.5 21.5t-15 19t-13 25.5t-3.5 27.5q0 40 28 68t68 28q15 0 27.5 -3.5t25.5 -13t19 -15 t21.5 -21.5t18.5 -19q33 31 33 73zM1648 320q0 -120 -85 -203l-147 -146q-83 -83 -203 -83q-121 0 -204 85l-206 207q-83 83 -83 203q0 123 88 209l-88 88q-86 -88 -208 -88q-120 0 -204 84l-208 208q-84 84 -84 204t85 203l147 146q83 83 203 83q121 0 204 -85l206 -207 q83 -83 83 -203q0 -123 -88 -209l88 -88q86 88 208 88q120 0 204 -84l208 -208q84 -84 84 -204z" /> +<glyph unicode="" horiz-adv-x="1920" d="M1920 384q0 -159 -112.5 -271.5t-271.5 -112.5h-1088q-185 0 -316.5 131.5t-131.5 316.5q0 132 71 241.5t187 163.5q-2 28 -2 43q0 212 150 362t362 150q158 0 286.5 -88t187.5 -230q70 62 166 62q106 0 181 -75t75 -181q0 -75 -41 -138q129 -30 213 -134.5t84 -239.5z " /> +<glyph unicode="" horiz-adv-x="1664" d="M1527 88q56 -89 21.5 -152.5t-140.5 -63.5h-1152q-106 0 -140.5 63.5t21.5 152.5l503 793v399h-64q-26 0 -45 19t-19 45t19 45t45 19h512q26 0 45 -19t19 -45t-19 -45t-45 -19h-64v-399zM748 813l-272 -429h712l-272 429l-20 31v37v399h-128v-399v-37z" /> +<glyph unicode="" horiz-adv-x="1792" d="M960 640q26 0 45 -19t19 -45t-19 -45t-45 -19t-45 19t-19 45t19 45t45 19zM1260 576l507 -398q28 -20 25 -56q-5 -35 -35 -51l-128 -64q-13 -7 -29 -7q-17 0 -31 8l-690 387l-110 -66q-8 -4 -12 -5q14 -49 10 -97q-7 -77 -56 -147.5t-132 -123.5q-132 -84 -277 -84 q-136 0 -222 78q-90 84 -79 207q7 76 56 147t131 124q132 84 278 84q83 0 151 -31q9 13 22 22l122 73l-122 73q-13 9 -22 22q-68 -31 -151 -31q-146 0 -278 84q-82 53 -131 124t-56 147q-5 59 15.5 113t63.5 93q85 79 222 79q145 0 277 -84q83 -52 132 -123t56 -148 q4 -48 -10 -97q4 -1 12 -5l110 -66l690 387q14 8 31 8q16 0 29 -7l128 -64q30 -16 35 -51q3 -36 -25 -56zM579 836q46 42 21 108t-106 117q-92 59 -192 59q-74 0 -113 -36q-46 -42 -21 -108t106 -117q92 -59 192 -59q74 0 113 36zM494 91q81 51 106 117t-21 108 q-39 36 -113 36q-100 0 -192 -59q-81 -51 -106 -117t21 -108q39 -36 113 -36q100 0 192 59zM672 704l96 -58v11q0 36 33 56l14 8l-79 47l-26 -26q-3 -3 -10 -11t-12 -12q-2 -2 -4 -3.5t-3 -2.5zM896 480l96 -32l736 576l-128 64l-768 -431v-113l-160 -96l9 -8q2 -2 7 -6 q4 -4 11 -12t11 -12l26 -26zM1600 64l128 64l-520 408l-177 -138q-2 -3 -13 -7z" /> +<glyph unicode="" horiz-adv-x="1792" d="M1696 1152q40 0 68 -28t28 -68v-1216q0 -40 -28 -68t-68 -28h-960q-40 0 -68 28t-28 68v288h-544q-40 0 -68 28t-28 68v672q0 40 20 88t48 76l408 408q28 28 76 48t88 20h416q40 0 68 -28t28 -68v-328q68 40 128 40h416zM1152 939l-299 -299h299v299zM512 1323l-299 -299 h299v299zM708 676l316 316v416h-384v-416q0 -40 -28 -68t-68 -28h-416v-640h512v256q0 40 20 88t48 76zM1664 -128v1152h-384v-416q0 -40 -28 -68t-68 -28h-416v-640h896z" /> +<glyph unicode="" horiz-adv-x="1408" d="M1404 151q0 -117 -79 -196t-196 -79q-135 0 -235 100l-777 776q-113 115 -113 271q0 159 110 270t269 111q158 0 273 -113l605 -606q10 -10 10 -22q0 -16 -30.5 -46.5t-46.5 -30.5q-13 0 -23 10l-606 607q-79 77 -181 77q-106 0 -179 -75t-73 -181q0 -105 76 -181 l776 -777q63 -63 145 -63q64 0 106 42t42 106q0 82 -63 145l-581 581q-26 24 -60 24q-29 0 -48 -19t-19 -48q0 -32 25 -59l410 -410q10 -10 10 -22q0 -16 -31 -47t-47 -31q-12 0 -22 10l-410 410q-63 61 -63 149q0 82 57 139t139 57q88 0 149 -63l581 -581q100 -98 100 -235 z" /> +<glyph unicode="" d="M384 0h768v384h-768v-384zM1280 0h128v896q0 14 -10 38.5t-20 34.5l-281 281q-10 10 -34 20t-39 10v-416q0 -40 -28 -68t-68 -28h-576q-40 0 -68 28t-28 68v416h-128v-1280h128v416q0 40 28 68t68 28h832q40 0 68 -28t28 -68v-416zM896 928v320q0 13 -9.5 22.5t-22.5 9.5 h-192q-13 0 -22.5 -9.5t-9.5 -22.5v-320q0 -13 9.5 -22.5t22.5 -9.5h192q13 0 22.5 9.5t9.5 22.5zM1536 896v-928q0 -40 -28 -68t-68 -28h-1344q-40 0 -68 28t-28 68v1344q0 40 28 68t68 28h928q40 0 88 -20t76 -48l280 -280q28 -28 48 -76t20 -88z" /> +<glyph unicode="" d="M1536 1120v-960q0 -119 -84.5 -203.5t-203.5 -84.5h-960q-119 0 -203.5 84.5t-84.5 203.5v960q0 119 84.5 203.5t203.5 84.5h960q119 0 203.5 -84.5t84.5 -203.5z" /> +<glyph unicode="" d="M1536 192v-128q0 -26 -19 -45t-45 -19h-1408q-26 0 -45 19t-19 45v128q0 26 19 45t45 19h1408q26 0 45 -19t19 -45zM1536 704v-128q0 -26 -19 -45t-45 -19h-1408q-26 0 -45 19t-19 45v128q0 26 19 45t45 19h1408q26 0 45 -19t19 -45zM1536 1216v-128q0 -26 -19 -45 t-45 -19h-1408q-26 0 -45 19t-19 45v128q0 26 19 45t45 19h1408q26 0 45 -19t19 -45z" /> +<glyph unicode="" horiz-adv-x="1792" d="M384 128q0 -80 -56 -136t-136 -56t-136 56t-56 136t56 136t136 56t136 -56t56 -136zM384 640q0 -80 -56 -136t-136 -56t-136 56t-56 136t56 136t136 56t136 -56t56 -136zM1792 224v-192q0 -13 -9.5 -22.5t-22.5 -9.5h-1216q-13 0 -22.5 9.5t-9.5 22.5v192q0 13 9.5 22.5 t22.5 9.5h1216q13 0 22.5 -9.5t9.5 -22.5zM384 1152q0 -80 -56 -136t-136 -56t-136 56t-56 136t56 136t136 56t136 -56t56 -136zM1792 736v-192q0 -13 -9.5 -22.5t-22.5 -9.5h-1216q-13 0 -22.5 9.5t-9.5 22.5v192q0 13 9.5 22.5t22.5 9.5h1216q13 0 22.5 -9.5t9.5 -22.5z M1792 1248v-192q0 -13 -9.5 -22.5t-22.5 -9.5h-1216q-13 0 -22.5 9.5t-9.5 22.5v192q0 13 9.5 22.5t22.5 9.5h1216q13 0 22.5 -9.5t9.5 -22.5z" /> +<glyph unicode="" horiz-adv-x="1792" d="M381 -84q0 -80 -54.5 -126t-135.5 -46q-106 0 -172 66l57 88q49 -45 106 -45q29 0 50.5 14.5t21.5 42.5q0 64 -105 56l-26 56q8 10 32.5 43.5t42.5 54t37 38.5v1q-16 0 -48.5 -1t-48.5 -1v-53h-106v152h333v-88l-95 -115q51 -12 81 -49t30 -88zM383 543v-159h-362 q-6 36 -6 54q0 51 23.5 93t56.5 68t66 47.5t56.5 43.5t23.5 45q0 25 -14.5 38.5t-39.5 13.5q-46 0 -81 -58l-85 59q24 51 71.5 79.5t105.5 28.5q73 0 123 -41.5t50 -112.5q0 -50 -34 -91.5t-75 -64.5t-75.5 -50.5t-35.5 -52.5h127v60h105zM1792 224v-192q0 -13 -9.5 -22.5 t-22.5 -9.5h-1216q-13 0 -22.5 9.5t-9.5 22.5v192q0 14 9 23t23 9h1216q13 0 22.5 -9.5t9.5 -22.5zM384 1123v-99h-335v99h107q0 41 0.5 122t0.5 121v12h-2q-8 -17 -50 -54l-71 76l136 127h106v-404h108zM1792 736v-192q0 -13 -9.5 -22.5t-22.5 -9.5h-1216q-13 0 -22.5 9.5 t-9.5 22.5v192q0 14 9 23t23 9h1216q13 0 22.5 -9.5t9.5 -22.5zM1792 1248v-192q0 -13 -9.5 -22.5t-22.5 -9.5h-1216q-13 0 -22.5 9.5t-9.5 22.5v192q0 13 9.5 22.5t22.5 9.5h1216q13 0 22.5 -9.5t9.5 -22.5z" /> +<glyph unicode="" horiz-adv-x="1792" d="M1760 640q14 0 23 -9t9 -23v-64q0 -14 -9 -23t-23 -9h-1728q-14 0 -23 9t-9 23v64q0 14 9 23t23 9h1728zM483 704q-28 35 -51 80q-48 97 -48 188q0 181 134 309q133 127 393 127q50 0 167 -19q66 -12 177 -48q10 -38 21 -118q14 -123 14 -183q0 -18 -5 -45l-12 -3l-84 6 l-14 2q-50 149 -103 205q-88 91 -210 91q-114 0 -182 -59q-67 -58 -67 -146q0 -73 66 -140t279 -129q69 -20 173 -66q58 -28 95 -52h-743zM990 448h411q7 -39 7 -92q0 -111 -41 -212q-23 -55 -71 -104q-37 -35 -109 -81q-80 -48 -153 -66q-80 -21 -203 -21q-114 0 -195 23 l-140 40q-57 16 -72 28q-8 8 -8 22v13q0 108 -2 156q-1 30 0 68l2 37v44l102 2q15 -34 30 -71t22.5 -56t12.5 -27q35 -57 80 -94q43 -36 105 -57q59 -22 132 -22q64 0 139 27q77 26 122 86q47 61 47 129q0 84 -81 157q-34 29 -137 71z" /> +<glyph unicode="" d="M48 1313q-37 2 -45 4l-3 88q13 1 40 1q60 0 112 -4q132 -7 166 -7q86 0 168 3q116 4 146 5q56 0 86 2l-1 -14l2 -64v-9q-60 -9 -124 -9q-60 0 -79 -25q-13 -14 -13 -132q0 -13 0.5 -32.5t0.5 -25.5l1 -229l14 -280q6 -124 51 -202q35 -59 96 -92q88 -47 177 -47 q104 0 191 28q56 18 99 51q48 36 65 64q36 56 53 114q21 73 21 229q0 79 -3.5 128t-11 122.5t-13.5 159.5l-4 59q-5 67 -24 88q-34 35 -77 34l-100 -2l-14 3l2 86h84l205 -10q76 -3 196 10l18 -2q6 -38 6 -51q0 -7 -4 -31q-45 -12 -84 -13q-73 -11 -79 -17q-15 -15 -15 -41 q0 -7 1.5 -27t1.5 -31q8 -19 22 -396q6 -195 -15 -304q-15 -76 -41 -122q-38 -65 -112 -123q-75 -57 -182 -89q-109 -33 -255 -33q-167 0 -284 46q-119 47 -179 122q-61 76 -83 195q-16 80 -16 237v333q0 188 -17 213q-25 36 -147 39zM1536 -96v64q0 14 -9 23t-23 9h-1472 q-14 0 -23 -9t-9 -23v-64q0 -14 9 -23t23 -9h1472q14 0 23 9t9 23z" /> +<glyph unicode="" horiz-adv-x="1664" d="M512 160v192q0 14 -9 23t-23 9h-320q-14 0 -23 -9t-9 -23v-192q0 -14 9 -23t23 -9h320q14 0 23 9t9 23zM512 544v192q0 14 -9 23t-23 9h-320q-14 0 -23 -9t-9 -23v-192q0 -14 9 -23t23 -9h320q14 0 23 9t9 23zM1024 160v192q0 14 -9 23t-23 9h-320q-14 0 -23 -9t-9 -23 v-192q0 -14 9 -23t23 -9h320q14 0 23 9t9 23zM512 928v192q0 14 -9 23t-23 9h-320q-14 0 -23 -9t-9 -23v-192q0 -14 9 -23t23 -9h320q14 0 23 9t9 23zM1024 544v192q0 14 -9 23t-23 9h-320q-14 0 -23 -9t-9 -23v-192q0 -14 9 -23t23 -9h320q14 0 23 9t9 23zM1536 160v192 q0 14 -9 23t-23 9h-320q-14 0 -23 -9t-9 -23v-192q0 -14 9 -23t23 -9h320q14 0 23 9t9 23zM1024 928v192q0 14 -9 23t-23 9h-320q-14 0 -23 -9t-9 -23v-192q0 -14 9 -23t23 -9h320q14 0 23 9t9 23zM1536 544v192q0 14 -9 23t-23 9h-320q-14 0 -23 -9t-9 -23v-192 q0 -14 9 -23t23 -9h320q14 0 23 9t9 23zM1536 928v192q0 14 -9 23t-23 9h-320q-14 0 -23 -9t-9 -23v-192q0 -14 9 -23t23 -9h320q14 0 23 9t9 23zM1664 1248v-1088q0 -66 -47 -113t-113 -47h-1344q-66 0 -113 47t-47 113v1088q0 66 47 113t113 47h1344q66 0 113 -47t47 -113 z" /> +<glyph unicode="" horiz-adv-x="1664" d="M1190 955l293 293l-107 107l-293 -293zM1637 1248q0 -27 -18 -45l-1286 -1286q-18 -18 -45 -18t-45 18l-198 198q-18 18 -18 45t18 45l1286 1286q18 18 45 18t45 -18l198 -198q18 -18 18 -45zM286 1438l98 -30l-98 -30l-30 -98l-30 98l-98 30l98 30l30 98zM636 1276 l196 -60l-196 -60l-60 -196l-60 196l-196 60l196 60l60 196zM1566 798l98 -30l-98 -30l-30 -98l-30 98l-98 30l98 30l30 98zM926 1438l98 -30l-98 -30l-30 -98l-30 98l-98 30l98 30l30 98z" /> +<glyph unicode="" horiz-adv-x="1792" d="M640 128q0 52 -38 90t-90 38t-90 -38t-38 -90t38 -90t90 -38t90 38t38 90zM256 640h384v256h-158q-13 0 -22 -9l-195 -195q-9 -9 -9 -22v-30zM1536 128q0 52 -38 90t-90 38t-90 -38t-38 -90t38 -90t90 -38t90 38t38 90zM1792 1216v-1024q0 -15 -4 -26.5t-13.5 -18.5 t-16.5 -11.5t-23.5 -6t-22.5 -2t-25.5 0t-22.5 0.5q0 -106 -75 -181t-181 -75t-181 75t-75 181h-384q0 -106 -75 -181t-181 -75t-181 75t-75 181h-64q-3 0 -22.5 -0.5t-25.5 0t-22.5 2t-23.5 6t-16.5 11.5t-13.5 18.5t-4 26.5q0 26 19 45t45 19v320q0 8 -0.5 35t0 38 t2.5 34.5t6.5 37t14 30.5t22.5 30l198 198q19 19 50.5 32t58.5 13h160v192q0 26 19 45t45 19h1024q26 0 45 -19t19 -45z" /> +<glyph unicode="" d="M1536 640q0 -209 -103 -385.5t-279.5 -279.5t-385.5 -103q-111 0 -218 32q59 93 78 164q9 34 54 211q20 -39 73 -67.5t114 -28.5q121 0 216 68.5t147 188.5t52 270q0 114 -59.5 214t-172.5 163t-255 63q-105 0 -196 -29t-154.5 -77t-109 -110.5t-67 -129.5t-21.5 -134 q0 -104 40 -183t117 -111q30 -12 38 20q2 7 8 31t8 30q6 23 -11 43q-51 61 -51 151q0 151 104.5 259.5t273.5 108.5q151 0 235.5 -82t84.5 -213q0 -170 -68.5 -289t-175.5 -119q-61 0 -98 43.5t-23 104.5q8 35 26.5 93.5t30 103t11.5 75.5q0 50 -27 83t-77 33 q-62 0 -105 -57t-43 -142q0 -73 25 -122l-99 -418q-17 -70 -13 -177q-206 91 -333 281t-127 423q0 209 103 385.5t279.5 279.5t385.5 103t385.5 -103t279.5 -279.5t103 -385.5z" /> +<glyph unicode="" d="M1248 1408q119 0 203.5 -84.5t84.5 -203.5v-960q0 -119 -84.5 -203.5t-203.5 -84.5h-725q85 122 108 210q9 34 53 209q21 -39 73.5 -67t112.5 -28q181 0 295.5 147.5t114.5 373.5q0 84 -35 162.5t-96.5 139t-152.5 97t-197 36.5q-104 0 -194.5 -28.5t-153 -76.5 t-107.5 -109.5t-66.5 -128t-21.5 -132.5q0 -102 39.5 -180t116.5 -110q13 -5 23.5 0t14.5 19q10 44 15 61q6 23 -11 42q-50 62 -50 150q0 150 103.5 256.5t270.5 106.5q149 0 232.5 -81t83.5 -210q0 -168 -67.5 -286t-173.5 -118q-60 0 -97 43.5t-23 103.5q8 34 26.5 92.5 t29.5 102t11 74.5q0 49 -26.5 81.5t-75.5 32.5q-61 0 -103.5 -56.5t-42.5 -139.5q0 -72 24 -121l-98 -414q-24 -100 -7 -254h-183q-119 0 -203.5 84.5t-84.5 203.5v960q0 119 84.5 203.5t203.5 84.5h960z" /> +<glyph unicode="" d="M678 -57q0 -38 -10 -71h-380q-95 0 -171.5 56.5t-103.5 147.5q24 45 69 77.5t100 49.5t107 24t107 7q32 0 49 -2q6 -4 30.5 -21t33 -23t31 -23t32 -25.5t27.5 -25.5t26.5 -29.5t21 -30.5t17.5 -34.5t9.5 -36t4.5 -40.5zM385 294q-234 -7 -385 -85v433q103 -118 273 -118 q32 0 70 5q-21 -61 -21 -86q0 -67 63 -149zM558 805q0 -100 -43.5 -160.5t-140.5 -60.5q-51 0 -97 26t-78 67.5t-56 93.5t-35.5 104t-11.5 99q0 96 51.5 165t144.5 69q66 0 119 -41t84 -104t47 -130t16 -128zM1536 896v-736q0 -119 -84.5 -203.5t-203.5 -84.5h-468 q39 73 39 157q0 66 -22 122.5t-55.5 93t-72 71t-72 59.5t-55.5 54.5t-22 59.5q0 36 23 68t56 61.5t65.5 64.5t55.5 93t23 131t-26.5 145.5t-75.5 118.5q-6 6 -14 11t-12.5 7.5t-10 9.5t-10.5 17h135l135 64h-437q-138 0 -244.5 -38.5t-182.5 -133.5q0 126 81 213t207 87h960 q119 0 203.5 -84.5t84.5 -203.5v-96h-256v256h-128v-256h-256v-128h256v-256h128v256h256z" /> +<glyph unicode="" horiz-adv-x="1664" d="M876 71q0 21 -4.5 40.5t-9.5 36t-17.5 34.5t-21 30.5t-26.5 29.5t-27.5 25.5t-32 25.5t-31 23t-33 23t-30.5 21q-17 2 -50 2q-54 0 -106 -7t-108 -25t-98 -46t-69 -75t-27 -107q0 -68 35.5 -121.5t93 -84t120.5 -45.5t127 -15q59 0 112.5 12.5t100.5 39t74.5 73.5 t27.5 110zM756 933q0 60 -16.5 127.5t-47 130.5t-84 104t-119.5 41q-93 0 -144 -69t-51 -165q0 -47 11.5 -99t35.5 -104t56 -93.5t78 -67.5t97 -26q97 0 140.5 60.5t43.5 160.5zM625 1408h437l-135 -79h-135q71 -45 110 -126t39 -169q0 -74 -23 -131.5t-56 -92.5t-66 -64.5 t-56 -61t-23 -67.5q0 -26 16.5 -51t43 -48t58.5 -48t64 -55.5t58.5 -66t43 -85t16.5 -106.5q0 -160 -140 -282q-152 -131 -420 -131q-59 0 -119.5 10t-122 33.5t-108.5 58t-77 89t-30 121.5q0 61 37 135q32 64 96 110.5t145 71t155 36t150 13.5q-64 83 -64 149q0 12 2 23.5 t5 19.5t8 21.5t7 21.5q-40 -5 -70 -5q-149 0 -255.5 98t-106.5 246q0 140 95 250.5t234 141.5q94 20 187 20zM1664 1152v-128h-256v-256h-128v256h-256v128h256v256h128v-256h256z" /> +<glyph unicode="" horiz-adv-x="1920" d="M768 384h384v96h-128v448h-114l-148 -137l77 -80q42 37 55 57h2v-288h-128v-96zM1280 640q0 -70 -21 -142t-59.5 -134t-101.5 -101t-138 -39t-138 39t-101.5 101t-59.5 134t-21 142t21 142t59.5 134t101.5 101t138 39t138 -39t101.5 -101t59.5 -134t21 -142zM1792 384 v512q-106 0 -181 75t-75 181h-1152q0 -106 -75 -181t-181 -75v-512q106 0 181 -75t75 -181h1152q0 106 75 181t181 75zM1920 1216v-1152q0 -26 -19 -45t-45 -19h-1792q-26 0 -45 19t-19 45v1152q0 26 19 45t45 19h1792q26 0 45 -19t19 -45z" /> +<glyph unicode="" horiz-adv-x="1024" d="M1024 832q0 -26 -19 -45l-448 -448q-19 -19 -45 -19t-45 19l-448 448q-19 19 -19 45t19 45t45 19h896q26 0 45 -19t19 -45z" /> +<glyph unicode="" horiz-adv-x="1024" d="M1024 320q0 -26 -19 -45t-45 -19h-896q-26 0 -45 19t-19 45t19 45l448 448q19 19 45 19t45 -19l448 -448q19 -19 19 -45z" /> +<glyph unicode="" horiz-adv-x="640" d="M640 1088v-896q0 -26 -19 -45t-45 -19t-45 19l-448 448q-19 19 -19 45t19 45l448 448q19 19 45 19t45 -19t19 -45z" /> +<glyph unicode="" horiz-adv-x="640" d="M576 640q0 -26 -19 -45l-448 -448q-19 -19 -45 -19t-45 19t-19 45v896q0 26 19 45t45 19t45 -19l448 -448q19 -19 19 -45z" /> +<glyph unicode="" horiz-adv-x="1664" d="M160 0h608v1152h-640v-1120q0 -13 9.5 -22.5t22.5 -9.5zM1536 32v1120h-640v-1152h608q13 0 22.5 9.5t9.5 22.5zM1664 1248v-1216q0 -66 -47 -113t-113 -47h-1344q-66 0 -113 47t-47 113v1216q0 66 47 113t113 47h1344q66 0 113 -47t47 -113z" /> +<glyph unicode="" horiz-adv-x="1024" d="M1024 448q0 -26 -19 -45l-448 -448q-19 -19 -45 -19t-45 19l-448 448q-19 19 -19 45t19 45t45 19h896q26 0 45 -19t19 -45zM1024 832q0 -26 -19 -45t-45 -19h-896q-26 0 -45 19t-19 45t19 45l448 448q19 19 45 19t45 -19l448 -448q19 -19 19 -45z" /> +<glyph unicode="" horiz-adv-x="1024" d="M1024 448q0 -26 -19 -45l-448 -448q-19 -19 -45 -19t-45 19l-448 448q-19 19 -19 45t19 45t45 19h896q26 0 45 -19t19 -45z" /> +<glyph unicode="" horiz-adv-x="1024" d="M1024 832q0 -26 -19 -45t-45 -19h-896q-26 0 -45 19t-19 45t19 45l448 448q19 19 45 19t45 -19l448 -448q19 -19 19 -45z" /> +<glyph unicode="" horiz-adv-x="1792" d="M1792 826v-794q0 -66 -47 -113t-113 -47h-1472q-66 0 -113 47t-47 113v794q44 -49 101 -87q362 -246 497 -345q57 -42 92.5 -65.5t94.5 -48t110 -24.5h1h1q51 0 110 24.5t94.5 48t92.5 65.5q170 123 498 345q57 39 100 87zM1792 1120q0 -79 -49 -151t-122 -123 q-376 -261 -468 -325q-10 -7 -42.5 -30.5t-54 -38t-52 -32.5t-57.5 -27t-50 -9h-1h-1q-23 0 -50 9t-57.5 27t-52 32.5t-54 38t-42.5 30.5q-91 64 -262 182.5t-205 142.5q-62 42 -117 115.5t-55 136.5q0 78 41.5 130t118.5 52h1472q65 0 112.5 -47t47.5 -113z" /> +<glyph unicode="" d="M349 911v-991h-330v991h330zM370 1217q1 -73 -50.5 -122t-135.5 -49h-2q-82 0 -132 49t-50 122q0 74 51.5 122.5t134.5 48.5t133 -48.5t51 -122.5zM1536 488v-568h-329v530q0 105 -40.5 164.5t-126.5 59.5q-63 0 -105.5 -34.5t-63.5 -85.5q-11 -30 -11 -81v-553h-329 q2 399 2 647t-1 296l-1 48h329v-144h-2q20 32 41 56t56.5 52t87 43.5t114.5 15.5q171 0 275 -113.5t104 -332.5z" /> +<glyph unicode="" d="M1536 640q0 -156 -61 -298t-164 -245t-245 -164t-298 -61q-172 0 -327 72.5t-264 204.5q-7 10 -6.5 22.5t8.5 20.5l137 138q10 9 25 9q16 -2 23 -12q73 -95 179 -147t225 -52q104 0 198.5 40.5t163.5 109.5t109.5 163.5t40.5 198.5t-40.5 198.5t-109.5 163.5 t-163.5 109.5t-198.5 40.5q-98 0 -188 -35.5t-160 -101.5l137 -138q31 -30 14 -69q-17 -40 -59 -40h-448q-26 0 -45 19t-19 45v448q0 42 40 59q39 17 69 -14l130 -129q107 101 244.5 156.5t284.5 55.5q156 0 298 -61t245 -164t164 -245t61 -298z" /> +<glyph unicode="" horiz-adv-x="1792" d="M1771 0q0 -53 -37 -90l-107 -108q-39 -37 -91 -37q-53 0 -90 37l-363 364q-38 36 -38 90q0 53 43 96l-256 256l-126 -126q-14 -14 -34 -14t-34 14q2 -2 12.5 -12t12.5 -13t10 -11.5t10 -13.5t6 -13.5t5.5 -16.5t1.5 -18q0 -38 -28 -68q-3 -3 -16.5 -18t-19 -20.5 t-18.5 -16.5t-22 -15.5t-22 -9t-26 -4.5q-40 0 -68 28l-408 408q-28 28 -28 68q0 13 4.5 26t9 22t15.5 22t16.5 18.5t20.5 19t18 16.5q30 28 68 28q10 0 18 -1.5t16.5 -5.5t13.5 -6t13.5 -10t11.5 -10t13 -12.5t12 -12.5q-14 14 -14 34t14 34l348 348q14 14 34 14t34 -14 q-2 2 -12.5 12t-12.5 13t-10 11.5t-10 13.5t-6 13.5t-5.5 16.5t-1.5 18q0 38 28 68q3 3 16.5 18t19 20.5t18.5 16.5t22 15.5t22 9t26 4.5q40 0 68 -28l408 -408q28 -28 28 -68q0 -13 -4.5 -26t-9 -22t-15.5 -22t-16.5 -18.5t-20.5 -19t-18 -16.5q-30 -28 -68 -28 q-10 0 -18 1.5t-16.5 5.5t-13.5 6t-13.5 10t-11.5 10t-13 12.5t-12 12.5q14 -14 14 -34t-14 -34l-126 -126l256 -256q43 43 96 43q52 0 91 -37l363 -363q37 -39 37 -91z" /> +<glyph unicode="" horiz-adv-x="1792" d="M384 384q0 53 -37.5 90.5t-90.5 37.5t-90.5 -37.5t-37.5 -90.5t37.5 -90.5t90.5 -37.5t90.5 37.5t37.5 90.5zM576 832q0 53 -37.5 90.5t-90.5 37.5t-90.5 -37.5t-37.5 -90.5t37.5 -90.5t90.5 -37.5t90.5 37.5t37.5 90.5zM1004 351l101 382q6 26 -7.5 48.5t-38.5 29.5 t-48 -6.5t-30 -39.5l-101 -382q-60 -5 -107 -43.5t-63 -98.5q-20 -77 20 -146t117 -89t146 20t89 117q16 60 -6 117t-72 91zM1664 384q0 53 -37.5 90.5t-90.5 37.5t-90.5 -37.5t-37.5 -90.5t37.5 -90.5t90.5 -37.5t90.5 37.5t37.5 90.5zM1024 1024q0 53 -37.5 90.5 t-90.5 37.5t-90.5 -37.5t-37.5 -90.5t37.5 -90.5t90.5 -37.5t90.5 37.5t37.5 90.5zM1472 832q0 53 -37.5 90.5t-90.5 37.5t-90.5 -37.5t-37.5 -90.5t37.5 -90.5t90.5 -37.5t90.5 37.5t37.5 90.5zM1792 384q0 -261 -141 -483q-19 -29 -54 -29h-1402q-35 0 -54 29 q-141 221 -141 483q0 182 71 348t191 286t286 191t348 71t348 -71t286 -191t191 -286t71 -348z" /> +<glyph unicode="" horiz-adv-x="1792" d="M896 1152q-204 0 -381.5 -69.5t-282 -187.5t-104.5 -255q0 -112 71.5 -213.5t201.5 -175.5l87 -50l-27 -96q-24 -91 -70 -172q152 63 275 171l43 38l57 -6q69 -8 130 -8q204 0 381.5 69.5t282 187.5t104.5 255t-104.5 255t-282 187.5t-381.5 69.5zM1792 640 q0 -174 -120 -321.5t-326 -233t-450 -85.5q-70 0 -145 8q-198 -175 -460 -242q-49 -14 -114 -22h-5q-15 0 -27 10.5t-16 27.5v1q-3 4 -0.5 12t2 10t4.5 9.5l6 9t7 8.5t8 9q7 8 31 34.5t34.5 38t31 39.5t32.5 51t27 59t26 76q-157 89 -247.5 220t-90.5 281q0 174 120 321.5 t326 233t450 85.5t450 -85.5t326 -233t120 -321.5z" /> +<glyph unicode="" horiz-adv-x="1792" d="M704 1152q-153 0 -286 -52t-211.5 -141t-78.5 -191q0 -82 53 -158t149 -132l97 -56l-35 -84q34 20 62 39l44 31l53 -10q78 -14 153 -14q153 0 286 52t211.5 141t78.5 191t-78.5 191t-211.5 141t-286 52zM704 1280q191 0 353.5 -68.5t256.5 -186.5t94 -257t-94 -257 t-256.5 -186.5t-353.5 -68.5q-86 0 -176 16q-124 -88 -278 -128q-36 -9 -86 -16h-3q-11 0 -20.5 8t-11.5 21q-1 3 -1 6.5t0.5 6.5t2 6l2.5 5t3.5 5.5t4 5t4.5 5t4 4.5q5 6 23 25t26 29.5t22.5 29t25 38.5t20.5 44q-124 72 -195 177t-71 224q0 139 94 257t256.5 186.5 t353.5 68.5zM1526 111q10 -24 20.5 -44t25 -38.5t22.5 -29t26 -29.5t23 -25q1 -1 4 -4.5t4.5 -5t4 -5t3.5 -5.5l2.5 -5t2 -6t0.5 -6.5t-1 -6.5q-3 -14 -13 -22t-22 -7q-50 7 -86 16q-154 40 -278 128q-90 -16 -176 -16q-271 0 -472 132q58 -4 88 -4q161 0 309 45t264 129 q125 92 192 212t67 254q0 77 -23 152q129 -71 204 -178t75 -230q0 -120 -71 -224.5t-195 -176.5z" /> +<glyph unicode="" horiz-adv-x="896" d="M885 970q18 -20 7 -44l-540 -1157q-13 -25 -42 -25q-4 0 -14 2q-17 5 -25.5 19t-4.5 30l197 808l-406 -101q-4 -1 -12 -1q-18 0 -31 11q-18 15 -13 39l201 825q4 14 16 23t28 9h328q19 0 32 -12.5t13 -29.5q0 -8 -5 -18l-171 -463l396 98q8 2 12 2q19 0 34 -15z" /> +<glyph unicode="" horiz-adv-x="1792" d="M1792 288v-320q0 -40 -28 -68t-68 -28h-320q-40 0 -68 28t-28 68v320q0 40 28 68t68 28h96v192h-512v-192h96q40 0 68 -28t28 -68v-320q0 -40 -28 -68t-68 -28h-320q-40 0 -68 28t-28 68v320q0 40 28 68t68 28h96v192h-512v-192h96q40 0 68 -28t28 -68v-320 q0 -40 -28 -68t-68 -28h-320q-40 0 -68 28t-28 68v320q0 40 28 68t68 28h96v192q0 52 38 90t90 38h512v192h-96q-40 0 -68 28t-28 68v320q0 40 28 68t68 28h320q40 0 68 -28t28 -68v-320q0 -40 -28 -68t-68 -28h-96v-192h512q52 0 90 -38t38 -90v-192h96q40 0 68 -28t28 -68 z" /> +<glyph unicode="" horiz-adv-x="1664" d="M896 708v-580q0 -104 -76 -180t-180 -76t-180 76t-76 180q0 26 19 45t45 19t45 -19t19 -45q0 -50 39 -89t89 -39t89 39t39 89v580q33 11 64 11t64 -11zM1664 681q0 -13 -9.5 -22.5t-22.5 -9.5q-11 0 -23 10q-49 46 -93 69t-102 23q-68 0 -128 -37t-103 -97 q-7 -10 -17.5 -28t-14.5 -24q-11 -17 -28 -17q-18 0 -29 17q-4 6 -14.5 24t-17.5 28q-43 60 -102.5 97t-127.5 37t-127.5 -37t-102.5 -97q-7 -10 -17.5 -28t-14.5 -24q-11 -17 -29 -17q-17 0 -28 17q-4 6 -14.5 24t-17.5 28q-43 60 -103 97t-128 37q-58 0 -102 -23t-93 -69 q-12 -10 -23 -10q-13 0 -22.5 9.5t-9.5 22.5q0 5 1 7q45 183 172.5 319.5t298 204.5t360.5 68q140 0 274.5 -40t246.5 -113.5t194.5 -187t115.5 -251.5q1 -2 1 -7zM896 1408v-98q-42 2 -64 2t-64 -2v98q0 26 19 45t45 19t45 -19t19 -45z" /> +<glyph unicode="" horiz-adv-x="1792" d="M768 -128h896v640h-416q-40 0 -68 28t-28 68v416h-384v-1152zM1024 1312v64q0 13 -9.5 22.5t-22.5 9.5h-704q-13 0 -22.5 -9.5t-9.5 -22.5v-64q0 -13 9.5 -22.5t22.5 -9.5h704q13 0 22.5 9.5t9.5 22.5zM1280 640h299l-299 299v-299zM1792 512v-672q0 -40 -28 -68t-68 -28 h-960q-40 0 -68 28t-28 68v160h-544q-40 0 -68 28t-28 68v1344q0 40 28 68t68 28h1088q40 0 68 -28t28 -68v-328q21 -13 36 -28l408 -408q28 -28 48 -76t20 -88z" /> +<glyph unicode="" horiz-adv-x="1024" d="M736 960q0 -13 -9.5 -22.5t-22.5 -9.5t-22.5 9.5t-9.5 22.5q0 46 -54 71t-106 25q-13 0 -22.5 9.5t-9.5 22.5t9.5 22.5t22.5 9.5q50 0 99.5 -16t87 -54t37.5 -90zM896 960q0 72 -34.5 134t-90 101.5t-123 62t-136.5 22.5t-136.5 -22.5t-123 -62t-90 -101.5t-34.5 -134 q0 -101 68 -180q10 -11 30.5 -33t30.5 -33q128 -153 141 -298h228q13 145 141 298q10 11 30.5 33t30.5 33q68 79 68 180zM1024 960q0 -155 -103 -268q-45 -49 -74.5 -87t-59.5 -95.5t-34 -107.5q47 -28 47 -82q0 -37 -25 -64q25 -27 25 -64q0 -52 -45 -81q13 -23 13 -47 q0 -46 -31.5 -71t-77.5 -25q-20 -44 -60 -70t-87 -26t-87 26t-60 70q-46 0 -77.5 25t-31.5 71q0 24 13 47q-45 29 -45 81q0 37 25 64q-25 27 -25 64q0 54 47 82q-4 50 -34 107.5t-59.5 95.5t-74.5 87q-103 113 -103 268q0 99 44.5 184.5t117 142t164 89t186.5 32.5 t186.5 -32.5t164 -89t117 -142t44.5 -184.5z" /> +<glyph unicode="" horiz-adv-x="1792" d="M1792 352v-192q0 -13 -9.5 -22.5t-22.5 -9.5h-1376v-192q0 -13 -9.5 -22.5t-22.5 -9.5q-12 0 -24 10l-319 320q-9 9 -9 22q0 14 9 23l320 320q9 9 23 9q13 0 22.5 -9.5t9.5 -22.5v-192h1376q13 0 22.5 -9.5t9.5 -22.5zM1792 896q0 -14 -9 -23l-320 -320q-9 -9 -23 -9 q-13 0 -22.5 9.5t-9.5 22.5v192h-1376q-13 0 -22.5 9.5t-9.5 22.5v192q0 13 9.5 22.5t22.5 9.5h1376v192q0 14 9 23t23 9q12 0 24 -10l319 -319q9 -9 9 -23z" /> +<glyph unicode="" horiz-adv-x="1920" d="M1280 608q0 14 -9 23t-23 9h-224v352q0 13 -9.5 22.5t-22.5 9.5h-192q-13 0 -22.5 -9.5t-9.5 -22.5v-352h-224q-13 0 -22.5 -9.5t-9.5 -22.5q0 -14 9 -23l352 -352q9 -9 23 -9t23 9l351 351q10 12 10 24zM1920 384q0 -159 -112.5 -271.5t-271.5 -112.5h-1088 q-185 0 -316.5 131.5t-131.5 316.5q0 130 70 240t188 165q-2 30 -2 43q0 212 150 362t362 150q156 0 285.5 -87t188.5 -231q71 62 166 62q106 0 181 -75t75 -181q0 -76 -41 -138q130 -31 213.5 -135.5t83.5 -238.5z" /> +<glyph unicode="" horiz-adv-x="1920" d="M1280 672q0 14 -9 23l-352 352q-9 9 -23 9t-23 -9l-351 -351q-10 -12 -10 -24q0 -14 9 -23t23 -9h224v-352q0 -13 9.5 -22.5t22.5 -9.5h192q13 0 22.5 9.5t9.5 22.5v352h224q13 0 22.5 9.5t9.5 22.5zM1920 384q0 -159 -112.5 -271.5t-271.5 -112.5h-1088 q-185 0 -316.5 131.5t-131.5 316.5q0 130 70 240t188 165q-2 30 -2 43q0 212 150 362t362 150q156 0 285.5 -87t188.5 -231q71 62 166 62q106 0 181 -75t75 -181q0 -76 -41 -138q130 -31 213.5 -135.5t83.5 -238.5z" /> +<glyph unicode="" horiz-adv-x="1408" d="M384 192q0 -26 -19 -45t-45 -19t-45 19t-19 45t19 45t45 19t45 -19t19 -45zM1408 131q0 -121 -73 -190t-194 -69h-874q-121 0 -194 69t-73 190q0 68 5.5 131t24 138t47.5 132.5t81 103t120 60.5q-22 -52 -22 -120v-203q-58 -20 -93 -70t-35 -111q0 -80 56 -136t136 -56 t136 56t56 136q0 61 -35.5 111t-92.5 70v203q0 62 25 93q132 -104 295 -104t295 104q25 -31 25 -93v-64q-106 0 -181 -75t-75 -181v-89q-32 -29 -32 -71q0 -40 28 -68t68 -28t68 28t28 68q0 42 -32 71v89q0 52 38 90t90 38t90 -38t38 -90v-89q-32 -29 -32 -71q0 -40 28 -68 t68 -28t68 28t28 68q0 42 -32 71v89q0 68 -34.5 127.5t-93.5 93.5q0 10 0.5 42.5t0 48t-2.5 41.5t-7 47t-13 40q68 -15 120 -60.5t81 -103t47.5 -132.5t24 -138t5.5 -131zM1088 1024q0 -159 -112.5 -271.5t-271.5 -112.5t-271.5 112.5t-112.5 271.5t112.5 271.5t271.5 112.5 t271.5 -112.5t112.5 -271.5z" /> +<glyph unicode="" horiz-adv-x="1408" d="M1280 832q0 26 -19 45t-45 19t-45 -19t-19 -45t19 -45t45 -19t45 19t19 45zM1408 832q0 -62 -35.5 -111t-92.5 -70v-395q0 -159 -131.5 -271.5t-316.5 -112.5t-316.5 112.5t-131.5 271.5v132q-164 20 -274 128t-110 252v512q0 26 19 45t45 19q6 0 16 -2q17 30 47 48 t65 18q53 0 90.5 -37.5t37.5 -90.5t-37.5 -90.5t-90.5 -37.5q-33 0 -64 18v-402q0 -106 94 -181t226 -75t226 75t94 181v402q-31 -18 -64 -18q-53 0 -90.5 37.5t-37.5 90.5t37.5 90.5t90.5 37.5q35 0 65 -18t47 -48q10 2 16 2q26 0 45 -19t19 -45v-512q0 -144 -110 -252 t-274 -128v-132q0 -106 94 -181t226 -75t226 75t94 181v395q-57 21 -92.5 70t-35.5 111q0 80 56 136t136 56t136 -56t56 -136z" /> +<glyph unicode="" horiz-adv-x="1792" d="M640 1152h512v128h-512v-128zM288 1152v-1280h-64q-92 0 -158 66t-66 158v832q0 92 66 158t158 66h64zM1408 1152v-1280h-1024v1280h128v160q0 40 28 68t68 28h576q40 0 68 -28t28 -68v-160h128zM1792 928v-832q0 -92 -66 -158t-158 -66h-64v1280h64q92 0 158 -66 t66 -158z" /> +<glyph unicode="" horiz-adv-x="1664" d="M848 -160q0 16 -16 16q-59 0 -101.5 42.5t-42.5 101.5q0 16 -16 16t-16 -16q0 -73 51.5 -124.5t124.5 -51.5q16 0 16 16zM1664 128q0 -52 -38 -90t-90 -38h-448q0 -106 -75 -181t-181 -75t-181 75t-75 181h-448q-52 0 -90 38t-38 90q190 161 287 397.5t97 498.5 q0 165 96 262t264 117q-8 18 -8 37q0 40 28 68t68 28t68 -28t28 -68q0 -19 -8 -37q168 -20 264 -117t96 -262q0 -262 97 -498.5t287 -397.5z" /> +<glyph unicode="" horiz-adv-x="1920" d="M1664 896q0 80 -56 136t-136 56h-64v-384h64q80 0 136 56t56 136zM0 128h1792q0 -106 -75 -181t-181 -75h-1280q-106 0 -181 75t-75 181zM1856 896q0 -159 -112.5 -271.5t-271.5 -112.5h-64v-32q0 -92 -66 -158t-158 -66h-704q-92 0 -158 66t-66 158v736q0 26 19 45 t45 19h1152q159 0 271.5 -112.5t112.5 -271.5z" /> +<glyph unicode="" horiz-adv-x="1408" d="M640 1472v-640q0 -61 -35.5 -111t-92.5 -70v-779q0 -52 -38 -90t-90 -38h-128q-52 0 -90 38t-38 90v779q-57 20 -92.5 70t-35.5 111v640q0 26 19 45t45 19t45 -19t19 -45v-416q0 -26 19 -45t45 -19t45 19t19 45v416q0 26 19 45t45 19t45 -19t19 -45v-416q0 -26 19 -45 t45 -19t45 19t19 45v416q0 26 19 45t45 19t45 -19t19 -45zM1408 1472v-1600q0 -52 -38 -90t-90 -38h-128q-52 0 -90 38t-38 90v512h-224q-13 0 -22.5 9.5t-9.5 22.5v800q0 132 94 226t226 94h256q26 0 45 -19t19 -45z" /> +<glyph unicode="" horiz-adv-x="1280" d="M1024 352v-64q0 -14 -9 -23t-23 -9h-704q-14 0 -23 9t-9 23v64q0 14 9 23t23 9h704q14 0 23 -9t9 -23zM1024 608v-64q0 -14 -9 -23t-23 -9h-704q-14 0 -23 9t-9 23v64q0 14 9 23t23 9h704q14 0 23 -9t9 -23zM128 0h1024v768h-416q-40 0 -68 28t-28 68v416h-512v-1280z M768 896h376q-10 29 -22 41l-313 313q-12 12 -41 22v-376zM1280 864v-896q0 -40 -28 -68t-68 -28h-1088q-40 0 -68 28t-28 68v1344q0 40 28 68t68 28h640q40 0 88 -20t76 -48l312 -312q28 -28 48 -76t20 -88z" /> +<glyph unicode="" horiz-adv-x="1408" d="M384 224v-64q0 -13 -9.5 -22.5t-22.5 -9.5h-64q-13 0 -22.5 9.5t-9.5 22.5v64q0 13 9.5 22.5t22.5 9.5h64q13 0 22.5 -9.5t9.5 -22.5zM384 480v-64q0 -13 -9.5 -22.5t-22.5 -9.5h-64q-13 0 -22.5 9.5t-9.5 22.5v64q0 13 9.5 22.5t22.5 9.5h64q13 0 22.5 -9.5t9.5 -22.5z M640 480v-64q0 -13 -9.5 -22.5t-22.5 -9.5h-64q-13 0 -22.5 9.5t-9.5 22.5v64q0 13 9.5 22.5t22.5 9.5h64q13 0 22.5 -9.5t9.5 -22.5zM384 736v-64q0 -13 -9.5 -22.5t-22.5 -9.5h-64q-13 0 -22.5 9.5t-9.5 22.5v64q0 13 9.5 22.5t22.5 9.5h64q13 0 22.5 -9.5t9.5 -22.5z M1152 224v-64q0 -13 -9.5 -22.5t-22.5 -9.5h-64q-13 0 -22.5 9.5t-9.5 22.5v64q0 13 9.5 22.5t22.5 9.5h64q13 0 22.5 -9.5t9.5 -22.5zM896 480v-64q0 -13 -9.5 -22.5t-22.5 -9.5h-64q-13 0 -22.5 9.5t-9.5 22.5v64q0 13 9.5 22.5t22.5 9.5h64q13 0 22.5 -9.5t9.5 -22.5z M640 736v-64q0 -13 -9.5 -22.5t-22.5 -9.5h-64q-13 0 -22.5 9.5t-9.5 22.5v64q0 13 9.5 22.5t22.5 9.5h64q13 0 22.5 -9.5t9.5 -22.5zM384 992v-64q0 -13 -9.5 -22.5t-22.5 -9.5h-64q-13 0 -22.5 9.5t-9.5 22.5v64q0 13 9.5 22.5t22.5 9.5h64q13 0 22.5 -9.5t9.5 -22.5z M1152 480v-64q0 -13 -9.5 -22.5t-22.5 -9.5h-64q-13 0 -22.5 9.5t-9.5 22.5v64q0 13 9.5 22.5t22.5 9.5h64q13 0 22.5 -9.5t9.5 -22.5zM896 736v-64q0 -13 -9.5 -22.5t-22.5 -9.5h-64q-13 0 -22.5 9.5t-9.5 22.5v64q0 13 9.5 22.5t22.5 9.5h64q13 0 22.5 -9.5t9.5 -22.5z M640 992v-64q0 -13 -9.5 -22.5t-22.5 -9.5h-64q-13 0 -22.5 9.5t-9.5 22.5v64q0 13 9.5 22.5t22.5 9.5h64q13 0 22.5 -9.5t9.5 -22.5zM384 1248v-64q0 -13 -9.5 -22.5t-22.5 -9.5h-64q-13 0 -22.5 9.5t-9.5 22.5v64q0 13 9.5 22.5t22.5 9.5h64q13 0 22.5 -9.5t9.5 -22.5z M1152 736v-64q0 -13 -9.5 -22.5t-22.5 -9.5h-64q-13 0 -22.5 9.5t-9.5 22.5v64q0 13 9.5 22.5t22.5 9.5h64q13 0 22.5 -9.5t9.5 -22.5zM896 992v-64q0 -13 -9.5 -22.5t-22.5 -9.5h-64q-13 0 -22.5 9.5t-9.5 22.5v64q0 13 9.5 22.5t22.5 9.5h64q13 0 22.5 -9.5t9.5 -22.5z M640 1248v-64q0 -13 -9.5 -22.5t-22.5 -9.5h-64q-13 0 -22.5 9.5t-9.5 22.5v64q0 13 9.5 22.5t22.5 9.5h64q13 0 22.5 -9.5t9.5 -22.5zM1152 992v-64q0 -13 -9.5 -22.5t-22.5 -9.5h-64q-13 0 -22.5 9.5t-9.5 22.5v64q0 13 9.5 22.5t22.5 9.5h64q13 0 22.5 -9.5t9.5 -22.5z M896 1248v-64q0 -13 -9.5 -22.5t-22.5 -9.5h-64q-13 0 -22.5 9.5t-9.5 22.5v64q0 13 9.5 22.5t22.5 9.5h64q13 0 22.5 -9.5t9.5 -22.5zM1152 1248v-64q0 -13 -9.5 -22.5t-22.5 -9.5h-64q-13 0 -22.5 9.5t-9.5 22.5v64q0 13 9.5 22.5t22.5 9.5h64q13 0 22.5 -9.5t9.5 -22.5z M896 -128h384v1536h-1152v-1536h384v224q0 13 9.5 22.5t22.5 9.5h320q13 0 22.5 -9.5t9.5 -22.5v-224zM1408 1472v-1664q0 -26 -19 -45t-45 -19h-1280q-26 0 -45 19t-19 45v1664q0 26 19 45t45 19h1280q26 0 45 -19t19 -45z" /> +<glyph unicode="" horiz-adv-x="1408" d="M384 224v-64q0 -13 -9.5 -22.5t-22.5 -9.5h-64q-13 0 -22.5 9.5t-9.5 22.5v64q0 13 9.5 22.5t22.5 9.5h64q13 0 22.5 -9.5t9.5 -22.5zM384 480v-64q0 -13 -9.5 -22.5t-22.5 -9.5h-64q-13 0 -22.5 9.5t-9.5 22.5v64q0 13 9.5 22.5t22.5 9.5h64q13 0 22.5 -9.5t9.5 -22.5z M640 480v-64q0 -13 -9.5 -22.5t-22.5 -9.5h-64q-13 0 -22.5 9.5t-9.5 22.5v64q0 13 9.5 22.5t22.5 9.5h64q13 0 22.5 -9.5t9.5 -22.5zM384 736v-64q0 -13 -9.5 -22.5t-22.5 -9.5h-64q-13 0 -22.5 9.5t-9.5 22.5v64q0 13 9.5 22.5t22.5 9.5h64q13 0 22.5 -9.5t9.5 -22.5z M1152 224v-64q0 -13 -9.5 -22.5t-22.5 -9.5h-64q-13 0 -22.5 9.5t-9.5 22.5v64q0 13 9.5 22.5t22.5 9.5h64q13 0 22.5 -9.5t9.5 -22.5zM896 480v-64q0 -13 -9.5 -22.5t-22.5 -9.5h-64q-13 0 -22.5 9.5t-9.5 22.5v64q0 13 9.5 22.5t22.5 9.5h64q13 0 22.5 -9.5t9.5 -22.5z M640 736v-64q0 -13 -9.5 -22.5t-22.5 -9.5h-64q-13 0 -22.5 9.5t-9.5 22.5v64q0 13 9.5 22.5t22.5 9.5h64q13 0 22.5 -9.5t9.5 -22.5zM1152 480v-64q0 -13 -9.5 -22.5t-22.5 -9.5h-64q-13 0 -22.5 9.5t-9.5 22.5v64q0 13 9.5 22.5t22.5 9.5h64q13 0 22.5 -9.5t9.5 -22.5z M896 736v-64q0 -13 -9.5 -22.5t-22.5 -9.5h-64q-13 0 -22.5 9.5t-9.5 22.5v64q0 13 9.5 22.5t22.5 9.5h64q13 0 22.5 -9.5t9.5 -22.5zM1152 736v-64q0 -13 -9.5 -22.5t-22.5 -9.5h-64q-13 0 -22.5 9.5t-9.5 22.5v64q0 13 9.5 22.5t22.5 9.5h64q13 0 22.5 -9.5t9.5 -22.5z M896 -128h384v1152h-256v-32q0 -40 -28 -68t-68 -28h-448q-40 0 -68 28t-28 68v32h-256v-1152h384v224q0 13 9.5 22.5t22.5 9.5h320q13 0 22.5 -9.5t9.5 -22.5v-224zM896 1056v320q0 13 -9.5 22.5t-22.5 9.5h-64q-13 0 -22.5 -9.5t-9.5 -22.5v-96h-128v96q0 13 -9.5 22.5 t-22.5 9.5h-64q-13 0 -22.5 -9.5t-9.5 -22.5v-320q0 -13 9.5 -22.5t22.5 -9.5h64q13 0 22.5 9.5t9.5 22.5v96h128v-96q0 -13 9.5 -22.5t22.5 -9.5h64q13 0 22.5 9.5t9.5 22.5zM1408 1088v-1280q0 -26 -19 -45t-45 -19h-1280q-26 0 -45 19t-19 45v1280q0 26 19 45t45 19h320 v288q0 40 28 68t68 28h448q40 0 68 -28t28 -68v-288h320q26 0 45 -19t19 -45z" /> +<glyph unicode="" horiz-adv-x="1920" d="M640 128q0 53 -37.5 90.5t-90.5 37.5t-90.5 -37.5t-37.5 -90.5t37.5 -90.5t90.5 -37.5t90.5 37.5t37.5 90.5zM256 640h384v256h-158q-14 -2 -22 -9l-195 -195q-7 -12 -9 -22v-30zM1536 128q0 53 -37.5 90.5t-90.5 37.5t-90.5 -37.5t-37.5 -90.5t37.5 -90.5t90.5 -37.5 t90.5 37.5t37.5 90.5zM1664 800v192q0 14 -9 23t-23 9h-224v224q0 14 -9 23t-23 9h-192q-14 0 -23 -9t-9 -23v-224h-224q-14 0 -23 -9t-9 -23v-192q0 -14 9 -23t23 -9h224v-224q0 -14 9 -23t23 -9h192q14 0 23 9t9 23v224h224q14 0 23 9t9 23zM1920 1344v-1152 q0 -26 -19 -45t-45 -19h-192q0 -106 -75 -181t-181 -75t-181 75t-75 181h-384q0 -106 -75 -181t-181 -75t-181 75t-75 181h-128q-26 0 -45 19t-19 45t19 45t45 19v416q0 26 13 58t32 51l198 198q19 19 51 32t58 13h160v320q0 26 19 45t45 19h1152q26 0 45 -19t19 -45z" /> +<glyph unicode="" horiz-adv-x="1792" d="M1280 416v192q0 14 -9 23t-23 9h-224v224q0 14 -9 23t-23 9h-192q-14 0 -23 -9t-9 -23v-224h-224q-14 0 -23 -9t-9 -23v-192q0 -14 9 -23t23 -9h224v-224q0 -14 9 -23t23 -9h192q14 0 23 9t9 23v224h224q14 0 23 9t9 23zM640 1152h512v128h-512v-128zM256 1152v-1280h-32 q-92 0 -158 66t-66 158v832q0 92 66 158t158 66h32zM1440 1152v-1280h-1088v1280h160v160q0 40 28 68t68 28h576q40 0 68 -28t28 -68v-160h160zM1792 928v-832q0 -92 -66 -158t-158 -66h-32v1280h32q92 0 158 -66t66 -158z" /> +<glyph unicode="" horiz-adv-x="1920" d="M1920 576q-1 -32 -288 -96l-352 -32l-224 -64h-64l-293 -352h69q26 0 45 -4.5t19 -11.5t-19 -11.5t-45 -4.5h-96h-160h-64v32h64v416h-160l-192 -224h-96l-32 32v192h32v32h128v8l-192 24v128l192 24v8h-128v32h-32v192l32 32h96l192 -224h160v416h-64v32h64h160h96 q26 0 45 -4.5t19 -11.5t-19 -11.5t-45 -4.5h-69l293 -352h64l224 -64l352 -32q261 -58 287 -93z" /> +<glyph unicode="" horiz-adv-x="1664" d="M640 640v384h-256v-256q0 -53 37.5 -90.5t90.5 -37.5h128zM1664 192v-192h-1152v192l128 192h-128q-159 0 -271.5 112.5t-112.5 271.5v320l-64 64l32 128h480l32 128h960l32 -192l-64 -32v-800z" /> +<glyph unicode="" d="M1280 192v896q0 26 -19 45t-45 19h-128q-26 0 -45 -19t-19 -45v-320h-512v320q0 26 -19 45t-45 19h-128q-26 0 -45 -19t-19 -45v-896q0 -26 19 -45t45 -19h128q26 0 45 19t19 45v320h512v-320q0 -26 19 -45t45 -19h128q26 0 45 19t19 45zM1536 1120v-960 q0 -119 -84.5 -203.5t-203.5 -84.5h-960q-119 0 -203.5 84.5t-84.5 203.5v960q0 119 84.5 203.5t203.5 84.5h960q119 0 203.5 -84.5t84.5 -203.5z" /> +<glyph unicode="" d="M1280 576v128q0 26 -19 45t-45 19h-320v320q0 26 -19 45t-45 19h-128q-26 0 -45 -19t-19 -45v-320h-320q-26 0 -45 -19t-19 -45v-128q0 -26 19 -45t45 -19h320v-320q0 -26 19 -45t45 -19h128q26 0 45 19t19 45v320h320q26 0 45 19t19 45zM1536 1120v-960 q0 -119 -84.5 -203.5t-203.5 -84.5h-960q-119 0 -203.5 84.5t-84.5 203.5v960q0 119 84.5 203.5t203.5 84.5h960q119 0 203.5 -84.5t84.5 -203.5z" /> +<glyph unicode="" horiz-adv-x="1024" d="M627 160q0 -13 -10 -23l-50 -50q-10 -10 -23 -10t-23 10l-466 466q-10 10 -10 23t10 23l466 466q10 10 23 10t23 -10l50 -50q10 -10 10 -23t-10 -23l-393 -393l393 -393q10 -10 10 -23zM1011 160q0 -13 -10 -23l-50 -50q-10 -10 -23 -10t-23 10l-466 466q-10 10 -10 23 t10 23l466 466q10 10 23 10t23 -10l50 -50q10 -10 10 -23t-10 -23l-393 -393l393 -393q10 -10 10 -23z" /> +<glyph unicode="" horiz-adv-x="1024" d="M595 576q0 -13 -10 -23l-466 -466q-10 -10 -23 -10t-23 10l-50 50q-10 10 -10 23t10 23l393 393l-393 393q-10 10 -10 23t10 23l50 50q10 10 23 10t23 -10l466 -466q10 -10 10 -23zM979 576q0 -13 -10 -23l-466 -466q-10 -10 -23 -10t-23 10l-50 50q-10 10 -10 23t10 23 l393 393l-393 393q-10 10 -10 23t10 23l50 50q10 10 23 10t23 -10l466 -466q10 -10 10 -23z" /> +<glyph unicode="" horiz-adv-x="1152" d="M1075 224q0 -13 -10 -23l-50 -50q-10 -10 -23 -10t-23 10l-393 393l-393 -393q-10 -10 -23 -10t-23 10l-50 50q-10 10 -10 23t10 23l466 466q10 10 23 10t23 -10l466 -466q10 -10 10 -23zM1075 608q0 -13 -10 -23l-50 -50q-10 -10 -23 -10t-23 10l-393 393l-393 -393 q-10 -10 -23 -10t-23 10l-50 50q-10 10 -10 23t10 23l466 466q10 10 23 10t23 -10l466 -466q10 -10 10 -23z" /> +<glyph unicode="" horiz-adv-x="1152" d="M1075 672q0 -13 -10 -23l-466 -466q-10 -10 -23 -10t-23 10l-466 466q-10 10 -10 23t10 23l50 50q10 10 23 10t23 -10l393 -393l393 393q10 10 23 10t23 -10l50 -50q10 -10 10 -23zM1075 1056q0 -13 -10 -23l-466 -466q-10 -10 -23 -10t-23 10l-466 466q-10 10 -10 23 t10 23l50 50q10 10 23 10t23 -10l393 -393l393 393q10 10 23 10t23 -10l50 -50q10 -10 10 -23z" /> +<glyph unicode="" horiz-adv-x="640" d="M627 992q0 -13 -10 -23l-393 -393l393 -393q10 -10 10 -23t-10 -23l-50 -50q-10 -10 -23 -10t-23 10l-466 466q-10 10 -10 23t10 23l466 466q10 10 23 10t23 -10l50 -50q10 -10 10 -23z" /> +<glyph unicode="" horiz-adv-x="640" d="M595 576q0 -13 -10 -23l-466 -466q-10 -10 -23 -10t-23 10l-50 50q-10 10 -10 23t10 23l393 393l-393 393q-10 10 -10 23t10 23l50 50q10 10 23 10t23 -10l466 -466q10 -10 10 -23z" /> +<glyph unicode="" horiz-adv-x="1152" d="M1075 352q0 -13 -10 -23l-50 -50q-10 -10 -23 -10t-23 10l-393 393l-393 -393q-10 -10 -23 -10t-23 10l-50 50q-10 10 -10 23t10 23l466 466q10 10 23 10t23 -10l466 -466q10 -10 10 -23z" /> +<glyph unicode="" horiz-adv-x="1152" d="M1075 800q0 -13 -10 -23l-466 -466q-10 -10 -23 -10t-23 10l-466 466q-10 10 -10 23t10 23l50 50q10 10 23 10t23 -10l393 -393l393 393q10 10 23 10t23 -10l50 -50q10 -10 10 -23z" /> +<glyph unicode="" horiz-adv-x="1920" d="M1792 544v832q0 13 -9.5 22.5t-22.5 9.5h-1600q-13 0 -22.5 -9.5t-9.5 -22.5v-832q0 -13 9.5 -22.5t22.5 -9.5h1600q13 0 22.5 9.5t9.5 22.5zM1920 1376v-1088q0 -66 -47 -113t-113 -47h-544q0 -37 16 -77.5t32 -71t16 -43.5q0 -26 -19 -45t-45 -19h-512q-26 0 -45 19 t-19 45q0 14 16 44t32 70t16 78h-544q-66 0 -113 47t-47 113v1088q0 66 47 113t113 47h1600q66 0 113 -47t47 -113z" /> +<glyph unicode="" horiz-adv-x="1920" d="M416 256q-66 0 -113 47t-47 113v704q0 66 47 113t113 47h1088q66 0 113 -47t47 -113v-704q0 -66 -47 -113t-113 -47h-1088zM384 1120v-704q0 -13 9.5 -22.5t22.5 -9.5h1088q13 0 22.5 9.5t9.5 22.5v704q0 13 -9.5 22.5t-22.5 9.5h-1088q-13 0 -22.5 -9.5t-9.5 -22.5z M1760 192h160v-96q0 -40 -47 -68t-113 -28h-1600q-66 0 -113 28t-47 68v96h160h1600zM1040 96q16 0 16 16t-16 16h-160q-16 0 -16 -16t16 -16h160z" /> +<glyph unicode="" horiz-adv-x="1152" d="M640 128q0 26 -19 45t-45 19t-45 -19t-19 -45t19 -45t45 -19t45 19t19 45zM1024 288v960q0 13 -9.5 22.5t-22.5 9.5h-832q-13 0 -22.5 -9.5t-9.5 -22.5v-960q0 -13 9.5 -22.5t22.5 -9.5h832q13 0 22.5 9.5t9.5 22.5zM1152 1248v-1088q0 -66 -47 -113t-113 -47h-832 q-66 0 -113 47t-47 113v1088q0 66 47 113t113 47h832q66 0 113 -47t47 -113z" /> +<glyph unicode="" horiz-adv-x="768" d="M464 128q0 33 -23.5 56.5t-56.5 23.5t-56.5 -23.5t-23.5 -56.5t23.5 -56.5t56.5 -23.5t56.5 23.5t23.5 56.5zM672 288v704q0 13 -9.5 22.5t-22.5 9.5h-512q-13 0 -22.5 -9.5t-9.5 -22.5v-704q0 -13 9.5 -22.5t22.5 -9.5h512q13 0 22.5 9.5t9.5 22.5zM480 1136 q0 16 -16 16h-160q-16 0 -16 -16t16 -16h160q16 0 16 16zM768 1152v-1024q0 -52 -38 -90t-90 -38h-512q-52 0 -90 38t-38 90v1024q0 52 38 90t90 38h512q52 0 90 -38t38 -90z" /> +<glyph unicode="" d="M768 1184q-148 0 -273 -73t-198 -198t-73 -273t73 -273t198 -198t273 -73t273 73t198 198t73 273t-73 273t-198 198t-273 73zM1536 640q0 -209 -103 -385.5t-279.5 -279.5t-385.5 -103t-385.5 103t-279.5 279.5t-103 385.5t103 385.5t279.5 279.5t385.5 103t385.5 -103 t279.5 -279.5t103 -385.5z" /> +<glyph unicode="" horiz-adv-x="1664" d="M768 576v-384q0 -80 -56 -136t-136 -56h-384q-80 0 -136 56t-56 136v704q0 104 40.5 198.5t109.5 163.5t163.5 109.5t198.5 40.5h64q26 0 45 -19t19 -45v-128q0 -26 -19 -45t-45 -19h-64q-106 0 -181 -75t-75 -181v-32q0 -40 28 -68t68 -28h224q80 0 136 -56t56 -136z M1664 576v-384q0 -80 -56 -136t-136 -56h-384q-80 0 -136 56t-56 136v704q0 104 40.5 198.5t109.5 163.5t163.5 109.5t198.5 40.5h64q26 0 45 -19t19 -45v-128q0 -26 -19 -45t-45 -19h-64q-106 0 -181 -75t-75 -181v-32q0 -40 28 -68t68 -28h224q80 0 136 -56t56 -136z" /> +<glyph unicode="" horiz-adv-x="1664" d="M768 1216v-704q0 -104 -40.5 -198.5t-109.5 -163.5t-163.5 -109.5t-198.5 -40.5h-64q-26 0 -45 19t-19 45v128q0 26 19 45t45 19h64q106 0 181 75t75 181v32q0 40 -28 68t-68 28h-224q-80 0 -136 56t-56 136v384q0 80 56 136t136 56h384q80 0 136 -56t56 -136zM1664 1216 v-704q0 -104 -40.5 -198.5t-109.5 -163.5t-163.5 -109.5t-198.5 -40.5h-64q-26 0 -45 19t-19 45v128q0 26 19 45t45 19h64q106 0 181 75t75 181v32q0 40 -28 68t-68 28h-224q-80 0 -136 56t-56 136v384q0 80 56 136t136 56h384q80 0 136 -56t56 -136z" /> +<glyph unicode="" horiz-adv-x="1568" d="M496 192q0 -60 -42.5 -102t-101.5 -42q-60 0 -102 42t-42 102t42 102t102 42q59 0 101.5 -42t42.5 -102zM928 0q0 -53 -37.5 -90.5t-90.5 -37.5t-90.5 37.5t-37.5 90.5t37.5 90.5t90.5 37.5t90.5 -37.5t37.5 -90.5zM320 640q0 -66 -47 -113t-113 -47t-113 47t-47 113 t47 113t113 47t113 -47t47 -113zM1360 192q0 -46 -33 -79t-79 -33t-79 33t-33 79t33 79t79 33t79 -33t33 -79zM528 1088q0 -73 -51.5 -124.5t-124.5 -51.5t-124.5 51.5t-51.5 124.5t51.5 124.5t124.5 51.5t124.5 -51.5t51.5 -124.5zM992 1280q0 -80 -56 -136t-136 -56 t-136 56t-56 136t56 136t136 56t136 -56t56 -136zM1536 640q0 -40 -28 -68t-68 -28t-68 28t-28 68t28 68t68 28t68 -28t28 -68zM1328 1088q0 -33 -23.5 -56.5t-56.5 -23.5t-56.5 23.5t-23.5 56.5t23.5 56.5t56.5 23.5t56.5 -23.5t23.5 -56.5z" /> +<glyph unicode="" d="M1536 640q0 -209 -103 -385.5t-279.5 -279.5t-385.5 -103t-385.5 103t-279.5 279.5t-103 385.5t103 385.5t279.5 279.5t385.5 103t385.5 -103t279.5 -279.5t103 -385.5z" /> +<glyph unicode="" horiz-adv-x="1792" d="M1792 416q0 -166 -127 -451q-3 -7 -10.5 -24t-13.5 -30t-13 -22q-12 -17 -28 -17q-15 0 -23.5 10t-8.5 25q0 9 2.5 26.5t2.5 23.5q5 68 5 123q0 101 -17.5 181t-48.5 138.5t-80 101t-105.5 69.5t-133 42.5t-154 21.5t-175.5 6h-224v-256q0 -26 -19 -45t-45 -19t-45 19 l-512 512q-19 19 -19 45t19 45l512 512q19 19 45 19t45 -19t19 -45v-256h224q713 0 875 -403q53 -134 53 -333z" /> +<glyph unicode="" horiz-adv-x="1664" d="M640 320q0 -40 -12.5 -82t-43 -76t-72.5 -34t-72.5 34t-43 76t-12.5 82t12.5 82t43 76t72.5 34t72.5 -34t43 -76t12.5 -82zM1280 320q0 -40 -12.5 -82t-43 -76t-72.5 -34t-72.5 34t-43 76t-12.5 82t12.5 82t43 76t72.5 34t72.5 -34t43 -76t12.5 -82zM1440 320 q0 120 -69 204t-187 84q-41 0 -195 -21q-71 -11 -157 -11t-157 11q-152 21 -195 21q-118 0 -187 -84t-69 -204q0 -88 32 -153.5t81 -103t122 -60t140 -29.5t149 -7h168q82 0 149 7t140 29.5t122 60t81 103t32 153.5zM1664 496q0 -207 -61 -331q-38 -77 -105.5 -133t-141 -86 t-170 -47.5t-171.5 -22t-167 -4.5q-78 0 -142 3t-147.5 12.5t-152.5 30t-137 51.5t-121 81t-86 115q-62 123 -62 331q0 237 136 396q-27 82 -27 170q0 116 51 218q108 0 190 -39.5t189 -123.5q147 35 309 35q148 0 280 -32q105 82 187 121t189 39q51 -102 51 -218 q0 -87 -27 -168q136 -160 136 -398z" /> +<glyph unicode="" horiz-adv-x="1664" d="M1536 224v704q0 40 -28 68t-68 28h-704q-40 0 -68 28t-28 68v64q0 40 -28 68t-68 28h-320q-40 0 -68 -28t-28 -68v-960q0 -40 28 -68t68 -28h1216q40 0 68 28t28 68zM1664 928v-704q0 -92 -66 -158t-158 -66h-1216q-92 0 -158 66t-66 158v960q0 92 66 158t158 66h320 q92 0 158 -66t66 -158v-32h672q92 0 158 -66t66 -158z" /> +<glyph unicode="" horiz-adv-x="1920" d="M1781 605q0 35 -53 35h-1088q-40 0 -85.5 -21.5t-71.5 -52.5l-294 -363q-18 -24 -18 -40q0 -35 53 -35h1088q40 0 86 22t71 53l294 363q18 22 18 39zM640 768h768v160q0 40 -28 68t-68 28h-576q-40 0 -68 28t-28 68v64q0 40 -28 68t-68 28h-320q-40 0 -68 -28t-28 -68 v-853l256 315q44 53 116 87.5t140 34.5zM1909 605q0 -62 -46 -120l-295 -363q-43 -53 -116 -87.5t-140 -34.5h-1088q-92 0 -158 66t-66 158v960q0 92 66 158t158 66h320q92 0 158 -66t66 -158v-32h544q92 0 158 -66t66 -158v-160h192q54 0 99 -24.5t67 -70.5q15 -32 15 -68z " /> +<glyph unicode="" horiz-adv-x="1152" d="M896 608v-64q0 -14 -9 -23t-23 -9h-224v-224q0 -14 -9 -23t-23 -9h-64q-14 0 -23 9t-9 23v224h-224q-14 0 -23 9t-9 23v64q0 14 9 23t23 9h224v224q0 14 9 23t23 9h64q14 0 23 -9t9 -23v-224h224q14 0 23 -9t9 -23zM1024 224v704q0 40 -28 68t-68 28h-704q-40 0 -68 -28 t-28 -68v-704q0 -40 28 -68t68 -28h704q40 0 68 28t28 68zM1152 928v-704q0 -92 -65.5 -158t-158.5 -66h-704q-93 0 -158.5 66t-65.5 158v704q0 93 65.5 158.5t158.5 65.5h704q93 0 158.5 -65.5t65.5 -158.5z" /> +<glyph unicode="" horiz-adv-x="1152" d="M928 1152q93 0 158.5 -65.5t65.5 -158.5v-704q0 -92 -65.5 -158t-158.5 -66h-704q-93 0 -158.5 66t-65.5 158v704q0 93 65.5 158.5t158.5 65.5h704zM1024 224v704q0 40 -28 68t-68 28h-704q-40 0 -68 -28t-28 -68v-704q0 -40 28 -68t68 -28h704q40 0 68 28t28 68z M864 640q14 0 23 -9t9 -23v-64q0 -14 -9 -23t-23 -9h-576q-14 0 -23 9t-9 23v64q0 14 9 23t23 9h576z" /> +<glyph unicode="" d="M1134 461q-37 -121 -138 -195t-228 -74t-228 74t-138 195q-8 25 4 48.5t38 31.5q25 8 48.5 -4t31.5 -38q25 -80 92.5 -129.5t151.5 -49.5t151.5 49.5t92.5 129.5q8 26 32 38t49 4t37 -31.5t4 -48.5zM640 896q0 -53 -37.5 -90.5t-90.5 -37.5t-90.5 37.5t-37.5 90.5 t37.5 90.5t90.5 37.5t90.5 -37.5t37.5 -90.5zM1152 896q0 -53 -37.5 -90.5t-90.5 -37.5t-90.5 37.5t-37.5 90.5t37.5 90.5t90.5 37.5t90.5 -37.5t37.5 -90.5zM1408 640q0 130 -51 248.5t-136.5 204t-204 136.5t-248.5 51t-248.5 -51t-204 -136.5t-136.5 -204t-51 -248.5 t51 -248.5t136.5 -204t204 -136.5t248.5 -51t248.5 51t204 136.5t136.5 204t51 248.5zM1536 640q0 -209 -103 -385.5t-279.5 -279.5t-385.5 -103t-385.5 103t-279.5 279.5t-103 385.5t103 385.5t279.5 279.5t385.5 103t385.5 -103t279.5 -279.5t103 -385.5z" /> +<glyph unicode="" d="M1134 307q8 -25 -4 -48.5t-37 -31.5t-49 4t-32 38q-25 80 -92.5 129.5t-151.5 49.5t-151.5 -49.5t-92.5 -129.5q-8 -26 -31.5 -38t-48.5 -4q-26 8 -38 31.5t-4 48.5q37 121 138 195t228 74t228 -74t138 -195zM640 896q0 -53 -37.5 -90.5t-90.5 -37.5t-90.5 37.5 t-37.5 90.5t37.5 90.5t90.5 37.5t90.5 -37.5t37.5 -90.5zM1152 896q0 -53 -37.5 -90.5t-90.5 -37.5t-90.5 37.5t-37.5 90.5t37.5 90.5t90.5 37.5t90.5 -37.5t37.5 -90.5zM1408 640q0 130 -51 248.5t-136.5 204t-204 136.5t-248.5 51t-248.5 -51t-204 -136.5t-136.5 -204 t-51 -248.5t51 -248.5t136.5 -204t204 -136.5t248.5 -51t248.5 51t204 136.5t136.5 204t51 248.5zM1536 640q0 -209 -103 -385.5t-279.5 -279.5t-385.5 -103t-385.5 103t-279.5 279.5t-103 385.5t103 385.5t279.5 279.5t385.5 103t385.5 -103t279.5 -279.5t103 -385.5z" /> +<glyph unicode="" d="M1152 448q0 -26 -19 -45t-45 -19h-640q-26 0 -45 19t-19 45t19 45t45 19h640q26 0 45 -19t19 -45zM640 896q0 -53 -37.5 -90.5t-90.5 -37.5t-90.5 37.5t-37.5 90.5t37.5 90.5t90.5 37.5t90.5 -37.5t37.5 -90.5zM1152 896q0 -53 -37.5 -90.5t-90.5 -37.5t-90.5 37.5 t-37.5 90.5t37.5 90.5t90.5 37.5t90.5 -37.5t37.5 -90.5zM1408 640q0 130 -51 248.5t-136.5 204t-204 136.5t-248.5 51t-248.5 -51t-204 -136.5t-136.5 -204t-51 -248.5t51 -248.5t136.5 -204t204 -136.5t248.5 -51t248.5 51t204 136.5t136.5 204t51 248.5zM1536 640 q0 -209 -103 -385.5t-279.5 -279.5t-385.5 -103t-385.5 103t-279.5 279.5t-103 385.5t103 385.5t279.5 279.5t385.5 103t385.5 -103t279.5 -279.5t103 -385.5z" /> +<glyph unicode="" horiz-adv-x="1920" d="M832 448v128q0 14 -9 23t-23 9h-192v192q0 14 -9 23t-23 9h-128q-14 0 -23 -9t-9 -23v-192h-192q-14 0 -23 -9t-9 -23v-128q0 -14 9 -23t23 -9h192v-192q0 -14 9 -23t23 -9h128q14 0 23 9t9 23v192h192q14 0 23 9t9 23zM1408 384q0 53 -37.5 90.5t-90.5 37.5t-90.5 -37.5 t-37.5 -90.5t37.5 -90.5t90.5 -37.5t90.5 37.5t37.5 90.5zM1664 640q0 53 -37.5 90.5t-90.5 37.5t-90.5 -37.5t-37.5 -90.5t37.5 -90.5t90.5 -37.5t90.5 37.5t37.5 90.5zM1920 512q0 -212 -150 -362t-362 -150q-192 0 -338 128h-220q-146 -128 -338 -128q-212 0 -362 150 t-150 362t150 362t362 150h896q212 0 362 -150t150 -362z" /> +<glyph unicode="" horiz-adv-x="1920" d="M384 368v-96q0 -16 -16 -16h-96q-16 0 -16 16v96q0 16 16 16h96q16 0 16 -16zM512 624v-96q0 -16 -16 -16h-224q-16 0 -16 16v96q0 16 16 16h224q16 0 16 -16zM384 880v-96q0 -16 -16 -16h-96q-16 0 -16 16v96q0 16 16 16h96q16 0 16 -16zM1408 368v-96q0 -16 -16 -16 h-864q-16 0 -16 16v96q0 16 16 16h864q16 0 16 -16zM768 624v-96q0 -16 -16 -16h-96q-16 0 -16 16v96q0 16 16 16h96q16 0 16 -16zM640 880v-96q0 -16 -16 -16h-96q-16 0 -16 16v96q0 16 16 16h96q16 0 16 -16zM1024 624v-96q0 -16 -16 -16h-96q-16 0 -16 16v96q0 16 16 16 h96q16 0 16 -16zM896 880v-96q0 -16 -16 -16h-96q-16 0 -16 16v96q0 16 16 16h96q16 0 16 -16zM1280 624v-96q0 -16 -16 -16h-96q-16 0 -16 16v96q0 16 16 16h96q16 0 16 -16zM1664 368v-96q0 -16 -16 -16h-96q-16 0 -16 16v96q0 16 16 16h96q16 0 16 -16zM1152 880v-96 q0 -16 -16 -16h-96q-16 0 -16 16v96q0 16 16 16h96q16 0 16 -16zM1408 880v-96q0 -16 -16 -16h-96q-16 0 -16 16v96q0 16 16 16h96q16 0 16 -16zM1664 880v-352q0 -16 -16 -16h-224q-16 0 -16 16v96q0 16 16 16h112v240q0 16 16 16h96q16 0 16 -16zM1792 128v896h-1664v-896 h1664zM1920 1024v-896q0 -53 -37.5 -90.5t-90.5 -37.5h-1664q-53 0 -90.5 37.5t-37.5 90.5v896q0 53 37.5 90.5t90.5 37.5h1664q53 0 90.5 -37.5t37.5 -90.5z" /> +<glyph unicode="" horiz-adv-x="1792" d="M1664 491v616q-169 -91 -306 -91q-82 0 -145 32q-100 49 -184 76.5t-178 27.5q-173 0 -403 -127v-599q245 113 433 113q55 0 103.5 -7.5t98 -26t77 -31t82.5 -39.5l28 -14q44 -22 101 -22q120 0 293 92zM320 1280q0 -35 -17.5 -64t-46.5 -46v-1266q0 -14 -9 -23t-23 -9 h-64q-14 0 -23 9t-9 23v1266q-29 17 -46.5 46t-17.5 64q0 53 37.5 90.5t90.5 37.5t90.5 -37.5t37.5 -90.5zM1792 1216v-763q0 -39 -35 -57q-10 -5 -17 -9q-218 -116 -369 -116q-88 0 -158 35l-28 14q-64 33 -99 48t-91 29t-114 14q-102 0 -235.5 -44t-228.5 -102 q-15 -9 -33 -9q-16 0 -32 8q-32 19 -32 56v742q0 35 31 55q35 21 78.5 42.5t114 52t152.5 49.5t155 19q112 0 209 -31t209 -86q38 -19 89 -19q122 0 310 112q22 12 31 17q31 16 62 -2q31 -20 31 -55z" /> +<glyph unicode="" horiz-adv-x="1792" d="M832 536v192q-181 -16 -384 -117v-185q205 96 384 110zM832 954v197q-172 -8 -384 -126v-189q215 111 384 118zM1664 491v184q-235 -116 -384 -71v224q-20 6 -39 15q-5 3 -33 17t-34.5 17t-31.5 15t-34.5 15.5t-32.5 13t-36 12.5t-35 8.5t-39.5 7.5t-39.5 4t-44 2 q-23 0 -49 -3v-222h19q102 0 192.5 -29t197.5 -82q19 -9 39 -15v-188q42 -17 91 -17q120 0 293 92zM1664 918v189q-169 -91 -306 -91q-45 0 -78 8v-196q148 -42 384 90zM320 1280q0 -35 -17.5 -64t-46.5 -46v-1266q0 -14 -9 -23t-23 -9h-64q-14 0 -23 9t-9 23v1266 q-29 17 -46.5 46t-17.5 64q0 53 37.5 90.5t90.5 37.5t90.5 -37.5t37.5 -90.5zM1792 1216v-763q0 -39 -35 -57q-10 -5 -17 -9q-218 -116 -369 -116q-88 0 -158 35l-28 14q-64 33 -99 48t-91 29t-114 14q-102 0 -235.5 -44t-228.5 -102q-15 -9 -33 -9q-16 0 -32 8 q-32 19 -32 56v742q0 35 31 55q35 21 78.5 42.5t114 52t152.5 49.5t155 19q112 0 209 -31t209 -86q38 -19 89 -19q122 0 310 112q22 12 31 17q31 16 62 -2q31 -20 31 -55z" /> +<glyph unicode="" horiz-adv-x="1664" d="M585 553l-466 -466q-10 -10 -23 -10t-23 10l-50 50q-10 10 -10 23t10 23l393 393l-393 393q-10 10 -10 23t10 23l50 50q10 10 23 10t23 -10l466 -466q10 -10 10 -23t-10 -23zM1664 96v-64q0 -14 -9 -23t-23 -9h-960q-14 0 -23 9t-9 23v64q0 14 9 23t23 9h960q14 0 23 -9 t9 -23z" /> +<glyph unicode="" horiz-adv-x="1920" d="M617 137l-50 -50q-10 -10 -23 -10t-23 10l-466 466q-10 10 -10 23t10 23l466 466q10 10 23 10t23 -10l50 -50q10 -10 10 -23t-10 -23l-393 -393l393 -393q10 -10 10 -23t-10 -23zM1208 1204l-373 -1291q-4 -13 -15.5 -19.5t-23.5 -2.5l-62 17q-13 4 -19.5 15.5t-2.5 24.5 l373 1291q4 13 15.5 19.5t23.5 2.5l62 -17q13 -4 19.5 -15.5t2.5 -24.5zM1865 553l-466 -466q-10 -10 -23 -10t-23 10l-50 50q-10 10 -10 23t10 23l393 393l-393 393q-10 10 -10 23t10 23l50 50q10 10 23 10t23 -10l466 -466q10 -10 10 -23t-10 -23z" /> +<glyph unicode="" horiz-adv-x="1792" d="M640 454v-70q0 -42 -39 -59q-13 -5 -25 -5q-27 0 -45 19l-512 512q-19 19 -19 45t19 45l512 512q29 31 70 14q39 -17 39 -59v-69l-397 -398q-19 -19 -19 -45t19 -45zM1792 416q0 -58 -17 -133.5t-38.5 -138t-48 -125t-40.5 -90.5l-20 -40q-8 -17 -28 -17q-6 0 -9 1 q-25 8 -23 34q43 400 -106 565q-64 71 -170.5 110.5t-267.5 52.5v-251q0 -42 -39 -59q-13 -5 -25 -5q-27 0 -45 19l-512 512q-19 19 -19 45t19 45l512 512q29 31 70 14q39 -17 39 -59v-262q411 -28 599 -221q169 -173 169 -509z" /> +<glyph unicode="" horiz-adv-x="1664" d="M1186 579l257 250l-356 52l-66 10l-30 60l-159 322v-963l59 -31l318 -168l-60 355l-12 66zM1638 841l-363 -354l86 -500q5 -33 -6 -51.5t-34 -18.5q-17 0 -40 12l-449 236l-449 -236q-23 -12 -40 -12q-23 0 -34 18.5t-6 51.5l86 500l-364 354q-32 32 -23 59.5t54 34.5 l502 73l225 455q20 41 49 41q28 0 49 -41l225 -455l502 -73q45 -7 54 -34.5t-24 -59.5z" /> +<glyph unicode="" horiz-adv-x="1408" d="M1401 1187l-640 -1280q-17 -35 -57 -35q-5 0 -15 2q-22 5 -35.5 22.5t-13.5 39.5v576h-576q-22 0 -39.5 13.5t-22.5 35.5t4 42t29 30l1280 640q13 7 29 7q27 0 45 -19q15 -14 18.5 -34.5t-6.5 -39.5z" /> +<glyph unicode="" horiz-adv-x="1664" d="M557 256h595v595zM512 301l595 595h-595v-595zM1664 224v-192q0 -14 -9 -23t-23 -9h-224v-224q0 -14 -9 -23t-23 -9h-192q-14 0 -23 9t-9 23v224h-864q-14 0 -23 9t-9 23v864h-224q-14 0 -23 9t-9 23v192q0 14 9 23t23 9h224v224q0 14 9 23t23 9h192q14 0 23 -9t9 -23 v-224h851l246 247q10 9 23 9t23 -9q9 -10 9 -23t-9 -23l-247 -246v-851h224q14 0 23 -9t9 -23z" /> +<glyph unicode="" horiz-adv-x="1024" d="M288 64q0 40 -28 68t-68 28t-68 -28t-28 -68t28 -68t68 -28t68 28t28 68zM288 1216q0 40 -28 68t-68 28t-68 -28t-28 -68t28 -68t68 -28t68 28t28 68zM928 1088q0 40 -28 68t-68 28t-68 -28t-28 -68t28 -68t68 -28t68 28t28 68zM1024 1088q0 -52 -26 -96.5t-70 -69.5 q-2 -287 -226 -414q-68 -38 -203 -81q-128 -40 -169.5 -71t-41.5 -100v-26q44 -25 70 -69.5t26 -96.5q0 -80 -56 -136t-136 -56t-136 56t-56 136q0 52 26 96.5t70 69.5v820q-44 25 -70 69.5t-26 96.5q0 80 56 136t136 56t136 -56t56 -136q0 -52 -26 -96.5t-70 -69.5v-497 q54 26 154 57q55 17 87.5 29.5t70.5 31t59 39.5t40.5 51t28 69.5t8.5 91.5q-44 25 -70 69.5t-26 96.5q0 80 56 136t136 56t136 -56t56 -136z" /> +<glyph unicode="" horiz-adv-x="1664" d="M439 265l-256 -256q-10 -9 -23 -9q-12 0 -23 9q-9 10 -9 23t9 23l256 256q10 9 23 9t23 -9q9 -10 9 -23t-9 -23zM608 224v-320q0 -14 -9 -23t-23 -9t-23 9t-9 23v320q0 14 9 23t23 9t23 -9t9 -23zM384 448q0 -14 -9 -23t-23 -9h-320q-14 0 -23 9t-9 23t9 23t23 9h320 q14 0 23 -9t9 -23zM1648 320q0 -120 -85 -203l-147 -146q-83 -83 -203 -83q-121 0 -204 85l-334 335q-21 21 -42 56l239 18l273 -274q27 -27 68 -27.5t68 26.5l147 146q28 28 28 67q0 40 -28 68l-274 275l18 239q35 -21 56 -42l336 -336q84 -86 84 -204zM1031 1044l-239 -18 l-273 274q-28 28 -68 28q-39 0 -68 -27l-147 -146q-28 -28 -28 -67q0 -40 28 -68l274 -274l-18 -240q-35 21 -56 42l-336 336q-84 86 -84 204q0 120 85 203l147 146q83 83 203 83q121 0 204 -85l334 -335q21 -21 42 -56zM1664 960q0 -14 -9 -23t-23 -9h-320q-14 0 -23 9 t-9 23t9 23t23 9h320q14 0 23 -9t9 -23zM1120 1504v-320q0 -14 -9 -23t-23 -9t-23 9t-9 23v320q0 14 9 23t23 9t23 -9t9 -23zM1527 1353l-256 -256q-11 -9 -23 -9t-23 9q-9 10 -9 23t9 23l256 256q10 9 23 9t23 -9q9 -10 9 -23t-9 -23z" /> +<glyph unicode="" horiz-adv-x="1024" d="M704 280v-240q0 -16 -12 -28t-28 -12h-240q-16 0 -28 12t-12 28v240q0 16 12 28t28 12h240q16 0 28 -12t12 -28zM1020 880q0 -54 -15.5 -101t-35 -76.5t-55 -59.5t-57.5 -43.5t-61 -35.5q-41 -23 -68.5 -65t-27.5 -67q0 -17 -12 -32.5t-28 -15.5h-240q-15 0 -25.5 18.5 t-10.5 37.5v45q0 83 65 156.5t143 108.5q59 27 84 56t25 76q0 42 -46.5 74t-107.5 32q-65 0 -108 -29q-35 -25 -107 -115q-13 -16 -31 -16q-12 0 -25 8l-164 125q-13 10 -15.5 25t5.5 28q160 266 464 266q80 0 161 -31t146 -83t106 -127.5t41 -158.5z" /> +<glyph unicode="" horiz-adv-x="640" d="M640 192v-128q0 -26 -19 -45t-45 -19h-512q-26 0 -45 19t-19 45v128q0 26 19 45t45 19h64v384h-64q-26 0 -45 19t-19 45v128q0 26 19 45t45 19h384q26 0 45 -19t19 -45v-576h64q26 0 45 -19t19 -45zM512 1344v-192q0 -26 -19 -45t-45 -19h-256q-26 0 -45 19t-19 45v192 q0 26 19 45t45 19h256q26 0 45 -19t19 -45z" /> +<glyph unicode="" horiz-adv-x="640" d="M512 288v-224q0 -26 -19 -45t-45 -19h-256q-26 0 -45 19t-19 45v224q0 26 19 45t45 19h256q26 0 45 -19t19 -45zM542 1344l-28 -768q-1 -26 -20.5 -45t-45.5 -19h-256q-26 0 -45.5 19t-20.5 45l-28 768q-1 26 17.5 45t44.5 19h320q26 0 44.5 -19t17.5 -45z" /> +<glyph unicode="" d="M897 167v-167h-248l-159 252l-24 42q-8 9 -11 21h-3l-9 -21q-10 -20 -25 -44l-155 -250h-258v167h128l197 291l-185 272h-137v168h276l139 -228q2 -4 23 -42q8 -9 11 -21h3q3 9 11 21l25 42l140 228h257v-168h-125l-184 -267l204 -296h109zM1534 846v-206h-514l-3 27 q-4 28 -4 46q0 64 26 117t65 86.5t84 65t84 54.5t65 54t26 64q0 38 -29.5 62.5t-70.5 24.5q-51 0 -97 -39q-14 -11 -36 -38l-105 92q26 37 63 66q83 65 188 65q110 0 178 -59.5t68 -158.5q0 -56 -24.5 -103t-62 -76.5t-81.5 -58.5t-82 -50.5t-65.5 -51.5t-30.5 -63h232v80 h126z" /> +<glyph unicode="" d="M897 167v-167h-248l-159 252l-24 42q-8 9 -11 21h-3l-9 -21q-10 -20 -25 -44l-155 -250h-258v167h128l197 291l-185 272h-137v168h276l139 -228q2 -4 23 -42q8 -9 11 -21h3q3 9 11 21l25 42l140 228h257v-168h-125l-184 -267l204 -296h109zM1536 -50v-206h-514l-4 27 q-3 45 -3 46q0 64 26 117t65 86.5t84 65t84 54.5t65 54t26 64q0 38 -29.5 62.5t-70.5 24.5q-51 0 -97 -39q-14 -11 -36 -38l-105 92q26 37 63 66q80 65 188 65q110 0 178 -59.5t68 -158.5q0 -66 -34.5 -118.5t-84 -86t-99.5 -62.5t-87 -63t-41 -73h232v80h126z" /> +<glyph unicode="" horiz-adv-x="1920" d="M896 128l336 384h-768l-336 -384h768zM1909 1205q15 -34 9.5 -71.5t-30.5 -65.5l-896 -1024q-38 -44 -96 -44h-768q-38 0 -69.5 20.5t-47.5 54.5q-15 34 -9.5 71.5t30.5 65.5l896 1024q38 44 96 44h768q38 0 69.5 -20.5t47.5 -54.5z" /> +<glyph unicode="" horiz-adv-x="1664" d="M1664 438q0 -81 -44.5 -135t-123.5 -54q-41 0 -77.5 17.5t-59 38t-56.5 38t-71 17.5q-110 0 -110 -124q0 -39 16 -115t15 -115v-5q-22 0 -33 -1q-34 -3 -97.5 -11.5t-115.5 -13.5t-98 -5q-61 0 -103 26.5t-42 83.5q0 37 17.5 71t38 56.5t38 59t17.5 77.5q0 79 -54 123.5 t-135 44.5q-84 0 -143 -45.5t-59 -127.5q0 -43 15 -83t33.5 -64.5t33.5 -53t15 -50.5q0 -45 -46 -89q-37 -35 -117 -35q-95 0 -245 24q-9 2 -27.5 4t-27.5 4l-13 2q-1 0 -3 1q-2 0 -2 1v1024q2 -1 17.5 -3.5t34 -5t21.5 -3.5q150 -24 245 -24q80 0 117 35q46 44 46 89 q0 22 -15 50.5t-33.5 53t-33.5 64.5t-15 83q0 82 59 127.5t144 45.5q80 0 134 -44.5t54 -123.5q0 -41 -17.5 -77.5t-38 -59t-38 -56.5t-17.5 -71q0 -57 42 -83.5t103 -26.5q64 0 180 15t163 17v-2q-1 -2 -3.5 -17.5t-5 -34t-3.5 -21.5q-24 -150 -24 -245q0 -80 35 -117 q44 -46 89 -46q22 0 50.5 15t53 33.5t64.5 33.5t83 15q82 0 127.5 -59t45.5 -143z" /> +<glyph unicode="" horiz-adv-x="1152" d="M1152 832v-128q0 -221 -147.5 -384.5t-364.5 -187.5v-132h256q26 0 45 -19t19 -45t-19 -45t-45 -19h-640q-26 0 -45 19t-19 45t19 45t45 19h256v132q-217 24 -364.5 187.5t-147.5 384.5v128q0 26 19 45t45 19t45 -19t19 -45v-128q0 -185 131.5 -316.5t316.5 -131.5 t316.5 131.5t131.5 316.5v128q0 26 19 45t45 19t45 -19t19 -45zM896 1216v-512q0 -132 -94 -226t-226 -94t-226 94t-94 226v512q0 132 94 226t226 94t226 -94t94 -226z" /> +<glyph unicode="" horiz-adv-x="1408" d="M271 591l-101 -101q-42 103 -42 214v128q0 26 19 45t45 19t45 -19t19 -45v-128q0 -53 15 -113zM1385 1193l-361 -361v-128q0 -132 -94 -226t-226 -94q-55 0 -109 19l-96 -96q97 -51 205 -51q185 0 316.5 131.5t131.5 316.5v128q0 26 19 45t45 19t45 -19t19 -45v-128 q0 -221 -147.5 -384.5t-364.5 -187.5v-132h256q26 0 45 -19t19 -45t-19 -45t-45 -19h-640q-26 0 -45 19t-19 45t19 45t45 19h256v132q-125 13 -235 81l-254 -254q-10 -10 -23 -10t-23 10l-82 82q-10 10 -10 23t10 23l1234 1234q10 10 23 10t23 -10l82 -82q10 -10 10 -23 t-10 -23zM1005 1325l-621 -621v512q0 132 94 226t226 94q102 0 184.5 -59t116.5 -152z" /> +<glyph unicode="" horiz-adv-x="1280" d="M1088 576v640h-448v-1137q119 63 213 137q235 184 235 360zM1280 1344v-768q0 -86 -33.5 -170.5t-83 -150t-118 -127.5t-126.5 -103t-121 -77.5t-89.5 -49.5t-42.5 -20q-12 -6 -26 -6t-26 6q-16 7 -42.5 20t-89.5 49.5t-121 77.5t-126.5 103t-118 127.5t-83 150 t-33.5 170.5v768q0 26 19 45t45 19h1152q26 0 45 -19t19 -45z" /> +<glyph unicode="" horiz-adv-x="1664" d="M128 -128h1408v1024h-1408v-1024zM512 1088v288q0 14 -9 23t-23 9h-64q-14 0 -23 -9t-9 -23v-288q0 -14 9 -23t23 -9h64q14 0 23 9t9 23zM1280 1088v288q0 14 -9 23t-23 9h-64q-14 0 -23 -9t-9 -23v-288q0 -14 9 -23t23 -9h64q14 0 23 9t9 23zM1664 1152v-1280 q0 -52 -38 -90t-90 -38h-1408q-52 0 -90 38t-38 90v1280q0 52 38 90t90 38h128v96q0 66 47 113t113 47h64q66 0 113 -47t47 -113v-96h384v96q0 66 47 113t113 47h64q66 0 113 -47t47 -113v-96h128q52 0 90 -38t38 -90z" /> +<glyph unicode="" horiz-adv-x="1408" d="M512 1344q0 26 -19 45t-45 19t-45 -19t-19 -45t19 -45t45 -19t45 19t19 45zM1408 1376v-320q0 -16 -12 -25q-8 -7 -20 -7q-4 0 -7 1l-448 96q-11 2 -18 11t-7 20h-256v-102q111 -23 183.5 -111t72.5 -203v-800q0 -26 -19 -45t-45 -19h-512q-26 0 -45 19t-19 45v800 q0 106 62.5 190.5t161.5 114.5v111h-32q-59 0 -115 -23.5t-91.5 -53t-66 -66.5t-40.5 -53.5t-14 -24.5q-17 -35 -57 -35q-16 0 -29 7q-23 12 -31.5 37t3.5 49q5 10 14.5 26t37.5 53.5t60.5 70t85 67t108.5 52.5q-25 42 -25 86q0 66 47 113t113 47t113 -47t47 -113 q0 -33 -14 -64h302q0 11 7 20t18 11l448 96q3 1 7 1q12 0 20 -7q12 -9 12 -25z" /> +<glyph unicode="" horiz-adv-x="1664" d="M1440 1088q0 40 -28 68t-68 28t-68 -28t-28 -68t28 -68t68 -28t68 28t28 68zM1664 1376q0 -249 -75.5 -430.5t-253.5 -360.5q-81 -80 -195 -176l-20 -379q-2 -16 -16 -26l-384 -224q-7 -4 -16 -4q-12 0 -23 9l-64 64q-13 14 -8 32l85 276l-281 281l-276 -85q-3 -1 -9 -1 q-14 0 -23 9l-64 64q-17 19 -5 39l224 384q10 14 26 16l379 20q96 114 176 195q188 187 358 258t431 71q14 0 24 -9.5t10 -22.5z" /> +<glyph unicode="" horiz-adv-x="1792" d="M1708 881l-188 -881h-304l181 849q4 21 1 43q-4 20 -16 35q-10 14 -28 24q-18 9 -40 9h-197l-205 -960h-303l204 960h-304l-205 -960h-304l272 1280h1139q157 0 245 -118q86 -116 52 -281z" /> +<glyph unicode="" d="M909 141l102 102q19 19 19 45t-19 45l-307 307l307 307q19 19 19 45t-19 45l-102 102q-19 19 -45 19t-45 -19l-454 -454q-19 -19 -19 -45t19 -45l454 -454q19 -19 45 -19t45 19zM1536 640q0 -209 -103 -385.5t-279.5 -279.5t-385.5 -103t-385.5 103t-279.5 279.5 t-103 385.5t103 385.5t279.5 279.5t385.5 103t385.5 -103t279.5 -279.5t103 -385.5z" /> +<glyph unicode="" d="M717 141l454 454q19 19 19 45t-19 45l-454 454q-19 19 -45 19t-45 -19l-102 -102q-19 -19 -19 -45t19 -45l307 -307l-307 -307q-19 -19 -19 -45t19 -45l102 -102q19 -19 45 -19t45 19zM1536 640q0 -209 -103 -385.5t-279.5 -279.5t-385.5 -103t-385.5 103t-279.5 279.5 t-103 385.5t103 385.5t279.5 279.5t385.5 103t385.5 -103t279.5 -279.5t103 -385.5z" /> +<glyph unicode="" d="M1165 397l102 102q19 19 19 45t-19 45l-454 454q-19 19 -45 19t-45 -19l-454 -454q-19 -19 -19 -45t19 -45l102 -102q19 -19 45 -19t45 19l307 307l307 -307q19 -19 45 -19t45 19zM1536 640q0 -209 -103 -385.5t-279.5 -279.5t-385.5 -103t-385.5 103t-279.5 279.5 t-103 385.5t103 385.5t279.5 279.5t385.5 103t385.5 -103t279.5 -279.5t103 -385.5z" /> +<glyph unicode="" d="M813 237l454 454q19 19 19 45t-19 45l-102 102q-19 19 -45 19t-45 -19l-307 -307l-307 307q-19 19 -45 19t-45 -19l-102 -102q-19 -19 -19 -45t19 -45l454 -454q19 -19 45 -19t45 19zM1536 640q0 -209 -103 -385.5t-279.5 -279.5t-385.5 -103t-385.5 103t-279.5 279.5 t-103 385.5t103 385.5t279.5 279.5t385.5 103t385.5 -103t279.5 -279.5t103 -385.5z" /> +<glyph unicode="" horiz-adv-x="1408" d="M1130 939l16 175h-884l47 -534h612l-22 -228l-197 -53l-196 53l-13 140h-175l22 -278l362 -100h4v1l359 99l50 544h-644l-15 181h674zM0 1408h1408l-128 -1438l-578 -162l-574 162z" /> +<glyph unicode="" horiz-adv-x="1792" d="M275 1408h1505l-266 -1333l-804 -267l-698 267l71 356h297l-29 -147l422 -161l486 161l68 339h-1208l58 297h1209l38 191h-1208z" /> +<glyph unicode="" horiz-adv-x="1792" d="M960 1280q0 26 -19 45t-45 19t-45 -19t-19 -45t19 -45t45 -19t45 19t19 45zM1792 352v-352q0 -22 -20 -30q-8 -2 -12 -2q-13 0 -23 9l-93 93q-119 -143 -318.5 -226.5t-429.5 -83.5t-429.5 83.5t-318.5 226.5l-93 -93q-9 -9 -23 -9q-4 0 -12 2q-20 8 -20 30v352 q0 14 9 23t23 9h352q22 0 30 -20q8 -19 -7 -35l-100 -100q67 -91 189.5 -153.5t271.5 -82.5v647h-192q-26 0 -45 19t-19 45v128q0 26 19 45t45 19h192v163q-58 34 -93 92.5t-35 128.5q0 106 75 181t181 75t181 -75t75 -181q0 -70 -35 -128.5t-93 -92.5v-163h192q26 0 45 -19 t19 -45v-128q0 -26 -19 -45t-45 -19h-192v-647q149 20 271.5 82.5t189.5 153.5l-100 100q-15 16 -7 35q8 20 30 20h352q14 0 23 -9t9 -23z" /> +<glyph unicode="" horiz-adv-x="1152" d="M1056 768q40 0 68 -28t28 -68v-576q0 -40 -28 -68t-68 -28h-960q-40 0 -68 28t-28 68v576q0 40 28 68t68 28h32v320q0 185 131.5 316.5t316.5 131.5t316.5 -131.5t131.5 -316.5q0 -26 -19 -45t-45 -19h-64q-26 0 -45 19t-19 45q0 106 -75 181t-181 75t-181 -75t-75 -181 v-320h736z" /> +<glyph unicode="" d="M1024 640q0 -106 -75 -181t-181 -75t-181 75t-75 181t75 181t181 75t181 -75t75 -181zM1152 640q0 159 -112.5 271.5t-271.5 112.5t-271.5 -112.5t-112.5 -271.5t112.5 -271.5t271.5 -112.5t271.5 112.5t112.5 271.5zM1280 640q0 -212 -150 -362t-362 -150t-362 150 t-150 362t150 362t362 150t362 -150t150 -362zM1408 640q0 130 -51 248.5t-136.5 204t-204 136.5t-248.5 51t-248.5 -51t-204 -136.5t-136.5 -204t-51 -248.5t51 -248.5t136.5 -204t204 -136.5t248.5 -51t248.5 51t204 136.5t136.5 204t51 248.5zM1536 640 q0 -209 -103 -385.5t-279.5 -279.5t-385.5 -103t-385.5 103t-279.5 279.5t-103 385.5t103 385.5t279.5 279.5t385.5 103t385.5 -103t279.5 -279.5t103 -385.5z" /> +<glyph unicode="" horiz-adv-x="1408" d="M384 800v-192q0 -40 -28 -68t-68 -28h-192q-40 0 -68 28t-28 68v192q0 40 28 68t68 28h192q40 0 68 -28t28 -68zM896 800v-192q0 -40 -28 -68t-68 -28h-192q-40 0 -68 28t-28 68v192q0 40 28 68t68 28h192q40 0 68 -28t28 -68zM1408 800v-192q0 -40 -28 -68t-68 -28h-192 q-40 0 -68 28t-28 68v192q0 40 28 68t68 28h192q40 0 68 -28t28 -68z" /> +<glyph unicode="" horiz-adv-x="384" d="M384 288v-192q0 -40 -28 -68t-68 -28h-192q-40 0 -68 28t-28 68v192q0 40 28 68t68 28h192q40 0 68 -28t28 -68zM384 800v-192q0 -40 -28 -68t-68 -28h-192q-40 0 -68 28t-28 68v192q0 40 28 68t68 28h192q40 0 68 -28t28 -68zM384 1312v-192q0 -40 -28 -68t-68 -28h-192 q-40 0 -68 28t-28 68v192q0 40 28 68t68 28h192q40 0 68 -28t28 -68z" /> +<glyph unicode="" d="M512 256q0 53 -37.5 90.5t-90.5 37.5t-90.5 -37.5t-37.5 -90.5t37.5 -90.5t90.5 -37.5t90.5 37.5t37.5 90.5zM863 162q-13 232 -177 396t-396 177q-14 1 -24 -9t-10 -23v-128q0 -13 8.5 -22t21.5 -10q154 -11 264 -121t121 -264q1 -13 10 -21.5t22 -8.5h128q13 0 23 10 t9 24zM1247 161q-5 154 -56 297.5t-139.5 260t-205 205t-260 139.5t-297.5 56q-14 1 -23 -9q-10 -10 -10 -23v-128q0 -13 9 -22t22 -10q204 -7 378 -111.5t278.5 -278.5t111.5 -378q1 -13 10 -22t22 -9h128q13 0 23 10q11 9 9 23zM1536 1120v-960q0 -119 -84.5 -203.5 t-203.5 -84.5h-960q-119 0 -203.5 84.5t-84.5 203.5v960q0 119 84.5 203.5t203.5 84.5h960q119 0 203.5 -84.5t84.5 -203.5z" /> +<glyph unicode="" d="M768 1408q209 0 385.5 -103t279.5 -279.5t103 -385.5t-103 -385.5t-279.5 -279.5t-385.5 -103t-385.5 103t-279.5 279.5t-103 385.5t103 385.5t279.5 279.5t385.5 103zM1152 585q32 18 32 55t-32 55l-544 320q-31 19 -64 1q-32 -19 -32 -56v-640q0 -37 32 -56 q16 -8 32 -8q17 0 32 9z" /> +<glyph unicode="" horiz-adv-x="1792" d="M1024 1084l316 -316l-572 -572l-316 316zM813 105l618 618q19 19 19 45t-19 45l-362 362q-18 18 -45 18t-45 -18l-618 -618q-19 -19 -19 -45t19 -45l362 -362q18 -18 45 -18t45 18zM1702 742l-907 -908q-37 -37 -90.5 -37t-90.5 37l-126 126q56 56 56 136t-56 136 t-136 56t-136 -56l-125 126q-37 37 -37 90.5t37 90.5l907 906q37 37 90.5 37t90.5 -37l125 -125q-56 -56 -56 -136t56 -136t136 -56t136 56l126 -125q37 -37 37 -90.5t-37 -90.5z" /> +<glyph unicode="" d="M1280 576v128q0 26 -19 45t-45 19h-896q-26 0 -45 -19t-19 -45v-128q0 -26 19 -45t45 -19h896q26 0 45 19t19 45zM1536 1120v-960q0 -119 -84.5 -203.5t-203.5 -84.5h-960q-119 0 -203.5 84.5t-84.5 203.5v960q0 119 84.5 203.5t203.5 84.5h960q119 0 203.5 -84.5 t84.5 -203.5z" /> +<glyph unicode="" horiz-adv-x="1408" d="M1152 736v-64q0 -14 -9 -23t-23 -9h-832q-14 0 -23 9t-9 23v64q0 14 9 23t23 9h832q14 0 23 -9t9 -23zM1280 288v832q0 66 -47 113t-113 47h-832q-66 0 -113 -47t-47 -113v-832q0 -66 47 -113t113 -47h832q66 0 113 47t47 113zM1408 1120v-832q0 -119 -84.5 -203.5 t-203.5 -84.5h-832q-119 0 -203.5 84.5t-84.5 203.5v832q0 119 84.5 203.5t203.5 84.5h832q119 0 203.5 -84.5t84.5 -203.5z" /> +<glyph unicode="" horiz-adv-x="1024" d="M1018 933q-18 -37 -58 -37h-192v-864q0 -14 -9 -23t-23 -9h-704q-21 0 -29 18q-8 20 4 35l160 192q9 11 25 11h320v640h-192q-40 0 -58 37q-17 37 9 68l320 384q18 22 49 22t49 -22l320 -384q27 -32 9 -68z" /> +<glyph unicode="" horiz-adv-x="1024" d="M32 1280h704q13 0 22.5 -9.5t9.5 -23.5v-863h192q40 0 58 -37t-9 -69l-320 -384q-18 -22 -49 -22t-49 22l-320 384q-26 31 -9 69q18 37 58 37h192v640h-320q-14 0 -25 11l-160 192q-13 14 -4 34q9 19 29 19z" /> +<glyph unicode="" d="M685 237l614 614q19 19 19 45t-19 45l-102 102q-19 19 -45 19t-45 -19l-467 -467l-211 211q-19 19 -45 19t-45 -19l-102 -102q-19 -19 -19 -45t19 -45l358 -358q19 -19 45 -19t45 19zM1536 1120v-960q0 -119 -84.5 -203.5t-203.5 -84.5h-960q-119 0 -203.5 84.5 t-84.5 203.5v960q0 119 84.5 203.5t203.5 84.5h960q119 0 203.5 -84.5t84.5 -203.5z" /> +<glyph unicode="" d="M404 428l152 -152l-52 -52h-56v96h-96v56zM818 818q14 -13 -3 -30l-291 -291q-17 -17 -30 -3q-14 13 3 30l291 291q17 17 30 3zM544 128l544 544l-288 288l-544 -544v-288h288zM1152 736l92 92q28 28 28 68t-28 68l-152 152q-28 28 -68 28t-68 -28l-92 -92zM1536 1120 v-960q0 -119 -84.5 -203.5t-203.5 -84.5h-960q-119 0 -203.5 84.5t-84.5 203.5v960q0 119 84.5 203.5t203.5 84.5h960q119 0 203.5 -84.5t84.5 -203.5z" /> +<glyph unicode="" d="M1280 608v480q0 26 -19 45t-45 19h-480q-42 0 -59 -39q-17 -41 14 -70l144 -144l-534 -534q-19 -19 -19 -45t19 -45l102 -102q19 -19 45 -19t45 19l534 534l144 -144q18 -19 45 -19q12 0 25 5q39 17 39 59zM1536 1120v-960q0 -119 -84.5 -203.5t-203.5 -84.5h-960 q-119 0 -203.5 84.5t-84.5 203.5v960q0 119 84.5 203.5t203.5 84.5h960q119 0 203.5 -84.5t84.5 -203.5z" /> +<glyph unicode="" d="M1005 435l352 352q19 19 19 45t-19 45l-352 352q-30 31 -69 14q-40 -17 -40 -59v-160q-119 0 -216 -19.5t-162.5 -51t-114 -79t-76.5 -95.5t-44.5 -109t-21.5 -111.5t-5 -110.5q0 -181 167 -404q10 -12 25 -12q7 0 13 3q22 9 19 33q-44 354 62 473q46 52 130 75.5 t224 23.5v-160q0 -42 40 -59q12 -5 24 -5q26 0 45 19zM1536 1120v-960q0 -119 -84.5 -203.5t-203.5 -84.5h-960q-119 0 -203.5 84.5t-84.5 203.5v960q0 119 84.5 203.5t203.5 84.5h960q119 0 203.5 -84.5t84.5 -203.5z" /> +<glyph unicode="" d="M640 448l256 128l-256 128v-256zM1024 1039v-542l-512 -256v542zM1312 640q0 148 -73 273t-198 198t-273 73t-273 -73t-198 -198t-73 -273t73 -273t198 -198t273 -73t273 73t198 198t73 273zM1536 640q0 -209 -103 -385.5t-279.5 -279.5t-385.5 -103t-385.5 103 t-279.5 279.5t-103 385.5t103 385.5t279.5 279.5t385.5 103t385.5 -103t279.5 -279.5t103 -385.5z" /> +<glyph unicode="" d="M1145 861q18 -35 -5 -66l-320 -448q-19 -27 -52 -27t-52 27l-320 448q-23 31 -5 66q17 35 57 35h640q40 0 57 -35zM1280 160v960q0 13 -9.5 22.5t-22.5 9.5h-960q-13 0 -22.5 -9.5t-9.5 -22.5v-960q0 -13 9.5 -22.5t22.5 -9.5h960q13 0 22.5 9.5t9.5 22.5zM1536 1120 v-960q0 -119 -84.5 -203.5t-203.5 -84.5h-960q-119 0 -203.5 84.5t-84.5 203.5v960q0 119 84.5 203.5t203.5 84.5h960q119 0 203.5 -84.5t84.5 -203.5z" /> +<glyph unicode="" d="M1145 419q-17 -35 -57 -35h-640q-40 0 -57 35q-18 35 5 66l320 448q19 27 52 27t52 -27l320 -448q23 -31 5 -66zM1280 160v960q0 13 -9.5 22.5t-22.5 9.5h-960q-13 0 -22.5 -9.5t-9.5 -22.5v-960q0 -13 9.5 -22.5t22.5 -9.5h960q13 0 22.5 9.5t9.5 22.5zM1536 1120v-960 q0 -119 -84.5 -203.5t-203.5 -84.5h-960q-119 0 -203.5 84.5t-84.5 203.5v960q0 119 84.5 203.5t203.5 84.5h960q119 0 203.5 -84.5t84.5 -203.5z" /> +<glyph unicode="" d="M1088 640q0 -33 -27 -52l-448 -320q-31 -23 -66 -5q-35 17 -35 57v640q0 40 35 57q35 18 66 -5l448 -320q27 -19 27 -52zM1280 160v960q0 14 -9 23t-23 9h-960q-14 0 -23 -9t-9 -23v-960q0 -14 9 -23t23 -9h960q14 0 23 9t9 23zM1536 1120v-960q0 -119 -84.5 -203.5 t-203.5 -84.5h-960q-119 0 -203.5 84.5t-84.5 203.5v960q0 119 84.5 203.5t203.5 84.5h960q119 0 203.5 -84.5t84.5 -203.5z" /> +<glyph unicode="" horiz-adv-x="1024" d="M976 229l35 -159q3 -12 -3 -22.5t-17 -14.5l-5 -1q-4 -2 -10.5 -3.5t-16 -4.5t-21.5 -5.5t-25.5 -5t-30 -5t-33.5 -4.5t-36.5 -3t-38.5 -1q-234 0 -409 130.5t-238 351.5h-95q-13 0 -22.5 9.5t-9.5 22.5v113q0 13 9.5 22.5t22.5 9.5h66q-2 57 1 105h-67q-14 0 -23 9 t-9 23v114q0 14 9 23t23 9h98q67 210 243.5 338t400.5 128q102 0 194 -23q11 -3 20 -15q6 -11 3 -24l-43 -159q-3 -13 -14 -19.5t-24 -2.5l-4 1q-4 1 -11.5 2.5l-17.5 3.5t-22.5 3.5t-26 3t-29 2.5t-29.5 1q-126 0 -226 -64t-150 -176h468q16 0 25 -12q10 -12 7 -26 l-24 -114q-5 -26 -32 -26h-488q-3 -37 0 -105h459q15 0 25 -12q9 -12 6 -27l-24 -112q-2 -11 -11 -18.5t-20 -7.5h-387q48 -117 149.5 -185.5t228.5 -68.5q18 0 36 1.5t33.5 3.5t29.5 4.5t24.5 5t18.5 4.5l12 3l5 2q13 5 26 -2q12 -7 15 -21z" /> +<glyph unicode="" horiz-adv-x="1024" d="M1020 399v-367q0 -14 -9 -23t-23 -9h-956q-14 0 -23 9t-9 23v150q0 13 9.5 22.5t22.5 9.5h97v383h-95q-14 0 -23 9.5t-9 22.5v131q0 14 9 23t23 9h95v223q0 171 123.5 282t314.5 111q185 0 335 -125q9 -8 10 -20.5t-7 -22.5l-103 -127q-9 -11 -22 -12q-13 -2 -23 7 q-5 5 -26 19t-69 32t-93 18q-85 0 -137 -47t-52 -123v-215h305q13 0 22.5 -9t9.5 -23v-131q0 -13 -9.5 -22.5t-22.5 -9.5h-305v-379h414v181q0 13 9 22.5t23 9.5h162q14 0 23 -9.5t9 -22.5z" /> +<glyph unicode="" horiz-adv-x="1024" d="M978 351q0 -153 -99.5 -263.5t-258.5 -136.5v-175q0 -14 -9 -23t-23 -9h-135q-13 0 -22.5 9.5t-9.5 22.5v175q-66 9 -127.5 31t-101.5 44.5t-74 48t-46.5 37.5t-17.5 18q-17 21 -2 41l103 135q7 10 23 12q15 2 24 -9l2 -2q113 -99 243 -125q37 -8 74 -8q81 0 142.5 43 t61.5 122q0 28 -15 53t-33.5 42t-58.5 37.5t-66 32t-80 32.5q-39 16 -61.5 25t-61.5 26.5t-62.5 31t-56.5 35.5t-53.5 42.5t-43.5 49t-35.5 58t-21 66.5t-8.5 78q0 138 98 242t255 134v180q0 13 9.5 22.5t22.5 9.5h135q14 0 23 -9t9 -23v-176q57 -6 110.5 -23t87 -33.5 t63.5 -37.5t39 -29t15 -14q17 -18 5 -38l-81 -146q-8 -15 -23 -16q-14 -3 -27 7q-3 3 -14.5 12t-39 26.5t-58.5 32t-74.5 26t-85.5 11.5q-95 0 -155 -43t-60 -111q0 -26 8.5 -48t29.5 -41.5t39.5 -33t56 -31t60.5 -27t70 -27.5q53 -20 81 -31.5t76 -35t75.5 -42.5t62 -50 t53 -63.5t31.5 -76.5t13 -94z" /> +<glyph unicode="" horiz-adv-x="898" d="M898 1066v-102q0 -14 -9 -23t-23 -9h-168q-23 -144 -129 -234t-276 -110q167 -178 459 -536q14 -16 4 -34q-8 -18 -29 -18h-195q-16 0 -25 12q-306 367 -498 571q-9 9 -9 22v127q0 13 9.5 22.5t22.5 9.5h112q132 0 212.5 43t102.5 125h-427q-14 0 -23 9t-9 23v102 q0 14 9 23t23 9h413q-57 113 -268 113h-145q-13 0 -22.5 9.5t-9.5 22.5v133q0 14 9 23t23 9h832q14 0 23 -9t9 -23v-102q0 -14 -9 -23t-23 -9h-233q47 -61 64 -144h171q14 0 23 -9t9 -23z" /> +<glyph unicode="" horiz-adv-x="1027" d="M603 0h-172q-13 0 -22.5 9t-9.5 23v330h-288q-13 0 -22.5 9t-9.5 23v103q0 13 9.5 22.5t22.5 9.5h288v85h-288q-13 0 -22.5 9t-9.5 23v104q0 13 9.5 22.5t22.5 9.5h214l-321 578q-8 16 0 32q10 16 28 16h194q19 0 29 -18l215 -425q19 -38 56 -125q10 24 30.5 68t27.5 61 l191 420q8 19 29 19h191q17 0 27 -16q9 -14 1 -31l-313 -579h215q13 0 22.5 -9.5t9.5 -22.5v-104q0 -14 -9.5 -23t-22.5 -9h-290v-85h290q13 0 22.5 -9.5t9.5 -22.5v-103q0 -14 -9.5 -23t-22.5 -9h-290v-330q0 -13 -9.5 -22.5t-22.5 -9.5z" /> +<glyph unicode="" horiz-adv-x="1664" d="M1664 352v-32q0 -132 -94 -226t-226 -94h-128q-132 0 -226 94t-94 226v480h-224q-2 -102 -14.5 -190.5t-30.5 -156t-48.5 -126.5t-57 -99.5t-67.5 -77.5t-69.5 -58.5t-74 -44t-69 -32t-65.5 -25.5q-4 -2 -32 -13q-8 -2 -12 -2q-22 0 -30 20l-71 178q-5 13 0 25t17 17 q7 3 20 7.5t18 6.5q31 12 46.5 18.5t44.5 20t45.5 26t42 32.5t40.5 42.5t34.5 53.5t30.5 68.5t22.5 83.5t17 103t6.5 123h-256q-14 0 -23 9t-9 23v160q0 14 9 23t23 9h1216q14 0 23 -9t9 -23v-160q0 -14 -9 -23t-23 -9h-224v-512q0 -26 19 -45t45 -19h128q26 0 45 19t19 45 v64q0 14 9 23t23 9h192q14 0 23 -9t9 -23zM1280 1376v-160q0 -14 -9 -23t-23 -9h-960q-14 0 -23 9t-9 23v160q0 14 9 23t23 9h960q14 0 23 -9t9 -23z" /> +<glyph unicode="" horiz-adv-x="1792" d="M514 341l81 299h-159l75 -300q1 -1 1 -3t1 -3q0 1 0.5 3.5t0.5 3.5zM630 768l35 128h-292l32 -128h225zM822 768h139l-35 128h-70zM1271 340l78 300h-162l81 -299q0 -1 0.5 -3.5t1.5 -3.5q0 1 0.5 3t0.5 3zM1382 768l33 128h-297l34 -128h230zM1792 736v-64q0 -14 -9 -23 t-23 -9h-213l-164 -616q-7 -24 -31 -24h-159q-24 0 -31 24l-166 616h-209l-167 -616q-7 -24 -31 -24h-159q-11 0 -19.5 7t-10.5 17l-160 616h-208q-14 0 -23 9t-9 23v64q0 14 9 23t23 9h175l-33 128h-142q-14 0 -23 9t-9 23v64q0 14 9 23t23 9h109l-89 344q-5 15 5 28 q10 12 26 12h137q26 0 31 -24l90 -360h359l97 360q7 24 31 24h126q24 0 31 -24l98 -360h365l93 360q5 24 31 24h137q16 0 26 -12q10 -13 5 -28l-91 -344h111q14 0 23 -9t9 -23v-64q0 -14 -9 -23t-23 -9h-145l-34 -128h179q14 0 23 -9t9 -23z" /> +<glyph unicode="" horiz-adv-x="1280" d="M1167 896q18 -182 -131 -258q117 -28 175 -103t45 -214q-7 -71 -32.5 -125t-64.5 -89t-97 -58.5t-121.5 -34.5t-145.5 -15v-255h-154v251q-80 0 -122 1v-252h-154v255q-18 0 -54 0.5t-55 0.5h-200l31 183h111q50 0 58 51v402h16q-6 1 -16 1v287q-13 68 -89 68h-111v164 l212 -1q64 0 97 1v252h154v-247q82 2 122 2v245h154v-252q79 -7 140 -22.5t113 -45t82.5 -78t36.5 -114.5zM952 351q0 36 -15 64t-37 46t-57.5 30.5t-65.5 18.5t-74 9t-69 3t-64.5 -1t-47.5 -1v-338q8 0 37 -0.5t48 -0.5t53 1.5t58.5 4t57 8.5t55.5 14t47.5 21t39.5 30 t24.5 40t9.5 51zM881 827q0 33 -12.5 58.5t-30.5 42t-48 28t-55 16.5t-61.5 8t-58 2.5t-54 -1t-39.5 -0.5v-307q5 0 34.5 -0.5t46.5 0t50 2t55 5.5t51.5 11t48.5 18.5t37 27t27 38.5t9 51z" /> +<glyph unicode="" horiz-adv-x="1280" d="M1280 768v-800q0 -40 -28 -68t-68 -28h-1088q-40 0 -68 28t-28 68v1344q0 40 28 68t68 28h544v-544q0 -40 28 -68t68 -28h544zM1277 896h-509v509q82 -15 132 -65l312 -312q50 -50 65 -132z" /> +<glyph unicode="" horiz-adv-x="1280" d="M1024 160v64q0 14 -9 23t-23 9h-704q-14 0 -23 -9t-9 -23v-64q0 -14 9 -23t23 -9h704q14 0 23 9t9 23zM1024 416v64q0 14 -9 23t-23 9h-704q-14 0 -23 -9t-9 -23v-64q0 -14 9 -23t23 -9h704q14 0 23 9t9 23zM1280 768v-800q0 -40 -28 -68t-68 -28h-1088q-40 0 -68 28 t-28 68v1344q0 40 28 68t68 28h544v-544q0 -40 28 -68t68 -28h544zM1277 896h-509v509q82 -15 132 -65l312 -312q50 -50 65 -132z" /> +<glyph unicode="" horiz-adv-x="1664" d="M1191 1128h177l-72 218l-12 47q-2 16 -2 20h-4l-3 -20q0 -1 -3.5 -18t-7.5 -29zM736 96q0 -12 -10 -24l-319 -319q-10 -9 -23 -9q-12 0 -23 9l-320 320q-15 16 -7 35q8 20 30 20h192v1376q0 14 9 23t23 9h192q14 0 23 -9t9 -23v-1376h192q14 0 23 -9t9 -23zM1572 -23 v-233h-584v90l369 529q12 18 21 27l11 9v3q-2 0 -6.5 -0.5t-7.5 -0.5q-12 -3 -30 -3h-232v-115h-120v229h567v-89l-369 -530q-6 -8 -21 -26l-11 -11v-2l14 2q9 2 30 2h248v119h121zM1661 874v-106h-288v106h75l-47 144h-243l-47 -144h75v-106h-287v106h70l230 662h162 l230 -662h70z" /> +<glyph unicode="" horiz-adv-x="1664" d="M1191 104h177l-72 218l-12 47q-2 16 -2 20h-4l-3 -20q0 -1 -3.5 -18t-7.5 -29zM736 96q0 -12 -10 -24l-319 -319q-10 -9 -23 -9q-12 0 -23 9l-320 320q-15 16 -7 35q8 20 30 20h192v1376q0 14 9 23t23 9h192q14 0 23 -9t9 -23v-1376h192q14 0 23 -9t9 -23zM1661 -150 v-106h-288v106h75l-47 144h-243l-47 -144h75v-106h-287v106h70l230 662h162l230 -662h70zM1572 1001v-233h-584v90l369 529q12 18 21 27l11 9v3q-2 0 -6.5 -0.5t-7.5 -0.5q-12 -3 -30 -3h-232v-115h-120v229h567v-89l-369 -530q-6 -8 -21 -26l-11 -10v-3l14 3q9 1 30 1h248 v119h121z" /> +<glyph unicode="" horiz-adv-x="1792" d="M736 96q0 -12 -10 -24l-319 -319q-10 -9 -23 -9q-12 0 -23 9l-320 320q-15 16 -7 35q8 20 30 20h192v1376q0 14 9 23t23 9h192q14 0 23 -9t9 -23v-1376h192q14 0 23 -9t9 -23zM1792 -32v-192q0 -14 -9 -23t-23 -9h-832q-14 0 -23 9t-9 23v192q0 14 9 23t23 9h832 q14 0 23 -9t9 -23zM1600 480v-192q0 -14 -9 -23t-23 -9h-640q-14 0 -23 9t-9 23v192q0 14 9 23t23 9h640q14 0 23 -9t9 -23zM1408 992v-192q0 -14 -9 -23t-23 -9h-448q-14 0 -23 9t-9 23v192q0 14 9 23t23 9h448q14 0 23 -9t9 -23zM1216 1504v-192q0 -14 -9 -23t-23 -9h-256 q-14 0 -23 9t-9 23v192q0 14 9 23t23 9h256q14 0 23 -9t9 -23z" /> +<glyph unicode="" horiz-adv-x="1792" d="M1216 -32v-192q0 -14 -9 -23t-23 -9h-256q-14 0 -23 9t-9 23v192q0 14 9 23t23 9h256q14 0 23 -9t9 -23zM736 96q0 -12 -10 -24l-319 -319q-10 -9 -23 -9q-12 0 -23 9l-320 320q-15 16 -7 35q8 20 30 20h192v1376q0 14 9 23t23 9h192q14 0 23 -9t9 -23v-1376h192 q14 0 23 -9t9 -23zM1408 480v-192q0 -14 -9 -23t-23 -9h-448q-14 0 -23 9t-9 23v192q0 14 9 23t23 9h448q14 0 23 -9t9 -23zM1600 992v-192q0 -14 -9 -23t-23 -9h-640q-14 0 -23 9t-9 23v192q0 14 9 23t23 9h640q14 0 23 -9t9 -23zM1792 1504v-192q0 -14 -9 -23t-23 -9h-832 q-14 0 -23 9t-9 23v192q0 14 9 23t23 9h832q14 0 23 -9t9 -23z" /> +<glyph unicode="" d="M1346 223q0 63 -44 116t-103 53q-52 0 -83 -37t-31 -94t36.5 -95t104.5 -38q50 0 85 27t35 68zM736 96q0 -12 -10 -24l-319 -319q-10 -9 -23 -9q-12 0 -23 9l-320 320q-15 16 -7 35q8 20 30 20h192v1376q0 14 9 23t23 9h192q14 0 23 -9t9 -23v-1376h192q14 0 23 -9t9 -23 zM1486 165q0 -62 -13 -121.5t-41 -114t-68 -95.5t-98.5 -65.5t-127.5 -24.5q-62 0 -108 16q-24 8 -42 15l39 113q15 -7 31 -11q37 -13 75 -13q84 0 134.5 58.5t66.5 145.5h-2q-21 -23 -61.5 -37t-84.5 -14q-106 0 -173 71.5t-67 172.5q0 105 72 178t181 73q123 0 205 -94.5 t82 -252.5zM1456 882v-114h-469v114h167v432q0 7 0.5 19t0.5 17v16h-2l-7 -12q-8 -13 -26 -31l-62 -58l-82 86l192 185h123v-654h165z" /> +<glyph unicode="" d="M1346 1247q0 63 -44 116t-103 53q-52 0 -83 -37t-31 -94t36.5 -95t104.5 -38q50 0 85 27t35 68zM736 96q0 -12 -10 -24l-319 -319q-10 -9 -23 -9q-12 0 -23 9l-320 320q-15 16 -7 35q8 20 30 20h192v1376q0 14 9 23t23 9h192q14 0 23 -9t9 -23v-1376h192q14 0 23 -9 t9 -23zM1456 -142v-114h-469v114h167v432q0 7 0.5 19t0.5 17v16h-2l-7 -12q-8 -13 -26 -31l-62 -58l-82 86l192 185h123v-654h165zM1486 1189q0 -62 -13 -121.5t-41 -114t-68 -95.5t-98.5 -65.5t-127.5 -24.5q-62 0 -108 16q-24 8 -42 15l39 113q15 -7 31 -11q37 -13 75 -13 q84 0 134.5 58.5t66.5 145.5h-2q-21 -23 -61.5 -37t-84.5 -14q-106 0 -173 71.5t-67 172.5q0 105 72 178t181 73q123 0 205 -94.5t82 -252.5z" /> +<glyph unicode="" horiz-adv-x="1664" d="M256 192q0 26 -19 45t-45 19q-27 0 -45.5 -19t-18.5 -45q0 -27 18.5 -45.5t45.5 -18.5q26 0 45 18.5t19 45.5zM416 704v-640q0 -26 -19 -45t-45 -19h-288q-26 0 -45 19t-19 45v640q0 26 19 45t45 19h288q26 0 45 -19t19 -45zM1600 704q0 -86 -55 -149q15 -44 15 -76 q3 -76 -43 -137q17 -56 0 -117q-15 -57 -54 -94q9 -112 -49 -181q-64 -76 -197 -78h-36h-76h-17q-66 0 -144 15.5t-121.5 29t-120.5 39.5q-123 43 -158 44q-26 1 -45 19.5t-19 44.5v641q0 25 18 43.5t43 20.5q24 2 76 59t101 121q68 87 101 120q18 18 31 48t17.5 48.5 t13.5 60.5q7 39 12.5 61t19.5 52t34 50q19 19 45 19q46 0 82.5 -10.5t60 -26t40 -40.5t24 -45t12 -50t5 -45t0.5 -39q0 -38 -9.5 -76t-19 -60t-27.5 -56q-3 -6 -10 -18t-11 -22t-8 -24h277q78 0 135 -57t57 -135z" /> +<glyph unicode="" horiz-adv-x="1664" d="M256 960q0 -26 -19 -45t-45 -19q-27 0 -45.5 19t-18.5 45q0 27 18.5 45.5t45.5 18.5q26 0 45 -18.5t19 -45.5zM416 448v640q0 26 -19 45t-45 19h-288q-26 0 -45 -19t-19 -45v-640q0 -26 19 -45t45 -19h288q26 0 45 19t19 45zM1545 597q55 -61 55 -149q-1 -78 -57.5 -135 t-134.5 -57h-277q4 -14 8 -24t11 -22t10 -18q18 -37 27 -57t19 -58.5t10 -76.5q0 -24 -0.5 -39t-5 -45t-12 -50t-24 -45t-40 -40.5t-60 -26t-82.5 -10.5q-26 0 -45 19q-20 20 -34 50t-19.5 52t-12.5 61q-9 42 -13.5 60.5t-17.5 48.5t-31 48q-33 33 -101 120q-49 64 -101 121 t-76 59q-25 2 -43 20.5t-18 43.5v641q0 26 19 44.5t45 19.5q35 1 158 44q77 26 120.5 39.5t121.5 29t144 15.5h17h76h36q133 -2 197 -78q58 -69 49 -181q39 -37 54 -94q17 -61 0 -117q46 -61 43 -137q0 -32 -15 -76z" /> +<glyph unicode="" d="M919 233v157q0 50 -29 50q-17 0 -33 -16v-224q16 -16 33 -16q29 0 29 49zM1103 355h66v34q0 51 -33 51t-33 -51v-34zM532 621v-70h-80v-423h-74v423h-78v70h232zM733 495v-367h-67v40q-39 -45 -76 -45q-33 0 -42 28q-6 16 -6 54v290h66v-270q0 -24 1 -26q1 -15 15 -15 q20 0 42 31v280h67zM985 384v-146q0 -52 -7 -73q-12 -42 -53 -42q-35 0 -68 41v-36h-67v493h67v-161q32 40 68 40q41 0 53 -42q7 -21 7 -74zM1236 255v-9q0 -29 -2 -43q-3 -22 -15 -40q-27 -40 -80 -40q-52 0 -81 38q-21 27 -21 86v129q0 59 20 86q29 38 80 38t78 -38 q21 -28 21 -86v-76h-133v-65q0 -51 34 -51q24 0 30 26q0 1 0.5 7t0.5 16.5v21.5h68zM785 1079v-156q0 -51 -32 -51t-32 51v156q0 52 32 52t32 -52zM1318 366q0 177 -19 260q-10 44 -43 73.5t-76 34.5q-136 15 -412 15q-275 0 -411 -15q-44 -5 -76.5 -34.5t-42.5 -73.5 q-20 -87 -20 -260q0 -176 20 -260q10 -43 42.5 -73t75.5 -35q137 -15 412 -15t412 15q43 5 75.5 35t42.5 73q20 84 20 260zM563 1017l90 296h-75l-51 -195l-53 195h-78l24 -69t23 -69q35 -103 46 -158v-201h74v201zM852 936v130q0 58 -21 87q-29 38 -78 38q-51 0 -78 -38 q-21 -29 -21 -87v-130q0 -58 21 -87q27 -38 78 -38q49 0 78 38q21 27 21 87zM1033 816h67v370h-67v-283q-22 -31 -42 -31q-15 0 -16 16q-1 2 -1 26v272h-67v-293q0 -37 6 -55q11 -27 43 -27q36 0 77 45v-40zM1536 1120v-960q0 -119 -84.5 -203.5t-203.5 -84.5h-960 q-119 0 -203.5 84.5t-84.5 203.5v960q0 119 84.5 203.5t203.5 84.5h960q119 0 203.5 -84.5t84.5 -203.5z" /> +<glyph unicode="" d="M971 292v-211q0 -67 -39 -67q-23 0 -45 22v301q22 22 45 22q39 0 39 -67zM1309 291v-46h-90v46q0 68 45 68t45 -68zM343 509h107v94h-312v-94h105v-569h100v569zM631 -60h89v494h-89v-378q-30 -42 -57 -42q-18 0 -21 21q-1 3 -1 35v364h-89v-391q0 -49 8 -73 q12 -37 58 -37q48 0 102 61v-54zM1060 88v197q0 73 -9 99q-17 56 -71 56q-50 0 -93 -54v217h-89v-663h89v48q45 -55 93 -55q54 0 71 55q9 27 9 100zM1398 98v13h-91q0 -51 -2 -61q-7 -36 -40 -36q-46 0 -46 69v87h179v103q0 79 -27 116q-39 51 -106 51q-68 0 -107 -51 q-28 -37 -28 -116v-173q0 -79 29 -116q39 -51 108 -51q72 0 108 53q18 27 21 54q2 9 2 58zM790 1011v210q0 69 -43 69t-43 -69v-210q0 -70 43 -70t43 70zM1509 260q0 -234 -26 -350q-14 -59 -58 -99t-102 -46q-184 -21 -555 -21t-555 21q-58 6 -102.5 46t-57.5 99 q-26 112 -26 350q0 234 26 350q14 59 58 99t103 47q183 20 554 20t555 -20q58 -7 102.5 -47t57.5 -99q26 -112 26 -350zM511 1536h102l-121 -399v-271h-100v271q-14 74 -61 212q-37 103 -65 187h106l71 -263zM881 1203v-175q0 -81 -28 -118q-37 -51 -106 -51q-67 0 -105 51 q-28 38 -28 118v175q0 80 28 117q38 51 105 51q69 0 106 -51q28 -37 28 -117zM1216 1365v-499h-91v55q-53 -62 -103 -62q-46 0 -59 37q-8 24 -8 75v394h91v-367q0 -33 1 -35q3 -22 21 -22q27 0 57 43v381h91z" /> +<glyph unicode="" horiz-adv-x="1408" d="M597 869q-10 -18 -257 -456q-27 -46 -65 -46h-239q-21 0 -31 17t0 36l253 448q1 0 0 1l-161 279q-12 22 -1 37q9 15 32 15h239q40 0 66 -45zM1403 1511q11 -16 0 -37l-528 -934v-1l336 -615q11 -20 1 -37q-10 -15 -32 -15h-239q-42 0 -66 45l-339 622q18 32 531 942 q25 45 64 45h241q22 0 31 -15z" /> +<glyph unicode="" d="M685 771q0 1 -126 222q-21 34 -52 34h-184q-18 0 -26 -11q-7 -12 1 -29l125 -216v-1l-196 -346q-9 -14 0 -28q8 -13 24 -13h185q31 0 50 36zM1309 1268q-7 12 -24 12h-187q-30 0 -49 -35l-411 -729q1 -2 262 -481q20 -35 52 -35h184q18 0 25 12q8 13 -1 28l-260 476v1 l409 723q8 16 0 28zM1536 1120v-960q0 -119 -84.5 -203.5t-203.5 -84.5h-960q-119 0 -203.5 84.5t-84.5 203.5v960q0 119 84.5 203.5t203.5 84.5h960q119 0 203.5 -84.5t84.5 -203.5z" /> +<glyph unicode="" horiz-adv-x="1792" d="M1280 640q0 37 -30 54l-512 320q-31 20 -65 2q-33 -18 -33 -56v-640q0 -38 33 -56q16 -8 31 -8q20 0 34 10l512 320q30 17 30 54zM1792 640q0 -96 -1 -150t-8.5 -136.5t-22.5 -147.5q-16 -73 -69 -123t-124 -58q-222 -25 -671 -25t-671 25q-71 8 -124.5 58t-69.5 123 q-14 65 -21.5 147.5t-8.5 136.5t-1 150t1 150t8.5 136.5t22.5 147.5q16 73 69 123t124 58q222 25 671 25t671 -25q71 -8 124.5 -58t69.5 -123q14 -65 21.5 -147.5t8.5 -136.5t1 -150z" /> +<glyph unicode="" horiz-adv-x="1792" d="M402 829l494 -305l-342 -285l-490 319zM1388 274v-108l-490 -293v-1l-1 1l-1 -1v1l-489 293v108l147 -96l342 284v2l1 -1l1 1v-2l343 -284zM554 1418l342 -285l-494 -304l-338 270zM1390 829l338 -271l-489 -319l-343 285zM1239 1418l489 -319l-338 -270l-494 304z" /> +<glyph unicode="" horiz-adv-x="1408" d="M928 135v-151l-707 -1v151zM1169 481v-701l-1 -35v-1h-1132l-35 1h-1v736h121v-618h928v618h120zM241 393l704 -65l-13 -150l-705 65zM309 709l683 -183l-39 -146l-683 183zM472 1058l609 -360l-77 -130l-609 360zM832 1389l398 -585l-124 -85l-399 584zM1285 1536 l121 -697l-149 -26l-121 697z" /> +<glyph unicode="" d="M1362 110v648h-135q20 -63 20 -131q0 -126 -64 -232.5t-174 -168.5t-240 -62q-197 0 -337 135.5t-140 327.5q0 68 20 131h-141v-648q0 -26 17.5 -43.5t43.5 -17.5h1069q25 0 43 17.5t18 43.5zM1078 643q0 124 -90.5 211.5t-218.5 87.5q-127 0 -217.5 -87.5t-90.5 -211.5 t90.5 -211.5t217.5 -87.5q128 0 218.5 87.5t90.5 211.5zM1362 1003v165q0 28 -20 48.5t-49 20.5h-174q-29 0 -49 -20.5t-20 -48.5v-165q0 -29 20 -49t49 -20h174q29 0 49 20t20 49zM1536 1211v-1142q0 -81 -58 -139t-139 -58h-1142q-81 0 -139 58t-58 139v1142q0 81 58 139 t139 58h1142q81 0 139 -58t58 -139z" /> +<glyph unicode="" d="M1248 1408q119 0 203.5 -84.5t84.5 -203.5v-960q0 -119 -84.5 -203.5t-203.5 -84.5h-960q-119 0 -203.5 84.5t-84.5 203.5v960q0 119 84.5 203.5t203.5 84.5h960zM698 640q0 88 -62 150t-150 62t-150 -62t-62 -150t62 -150t150 -62t150 62t62 150zM1262 640q0 88 -62 150 t-150 62t-150 -62t-62 -150t62 -150t150 -62t150 62t62 150z" /> +<glyph unicode="" d="M768 914l201 -306h-402zM1133 384h94l-459 691l-459 -691h94l104 160h522zM1536 640q0 -209 -103 -385.5t-279.5 -279.5t-385.5 -103t-385.5 103t-279.5 279.5t-103 385.5t103 385.5t279.5 279.5t385.5 103t385.5 -103t279.5 -279.5t103 -385.5z" /> +<glyph unicode="" horiz-adv-x="1408" d="M815 677q8 -63 -50.5 -101t-111.5 -6q-39 17 -53.5 58t-0.5 82t52 58q36 18 72.5 12t64 -35.5t27.5 -67.5zM926 698q-14 107 -113 164t-197 13q-63 -28 -100.5 -88.5t-34.5 -129.5q4 -91 77.5 -155t165.5 -56q91 8 152 84t50 168zM1165 1240q-20 27 -56 44.5t-58 22 t-71 12.5q-291 47 -566 -2q-43 -7 -66 -12t-55 -22t-50 -43q30 -28 76 -45.5t73.5 -22t87.5 -11.5q228 -29 448 -1q63 8 89.5 12t72.5 21.5t75 46.5zM1222 205q-8 -26 -15.5 -76.5t-14 -84t-28.5 -70t-58 -56.5q-86 -48 -189.5 -71.5t-202 -22t-201.5 18.5q-46 8 -81.5 18 t-76.5 27t-73 43.5t-52 61.5q-25 96 -57 292l6 16l18 9q223 -148 506.5 -148t507.5 148q21 -6 24 -23t-5 -45t-8 -37zM1403 1166q-26 -167 -111 -655q-5 -30 -27 -56t-43.5 -40t-54.5 -31q-252 -126 -610 -88q-248 27 -394 139q-15 12 -25.5 26.5t-17 35t-9 34t-6 39.5 t-5.5 35q-9 50 -26.5 150t-28 161.5t-23.5 147.5t-22 158q3 26 17.5 48.5t31.5 37.5t45 30t46 22.5t48 18.5q125 46 313 64q379 37 676 -50q155 -46 215 -122q16 -20 16.5 -51t-5.5 -54z" /> +<glyph unicode="" d="M848 666q0 43 -41 66t-77 1q-43 -20 -42.5 -72.5t43.5 -70.5q39 -23 81 4t36 72zM928 682q8 -66 -36 -121t-110 -61t-119 40t-56 113q-2 49 25.5 93t72.5 64q70 31 141.5 -10t81.5 -118zM1100 1073q-20 -21 -53.5 -34t-53 -16t-63.5 -8q-155 -20 -324 0q-44 6 -63 9.5 t-52.5 16t-54.5 32.5q13 19 36 31t40 15.5t47 8.5q198 35 408 1q33 -5 51 -8.5t43 -16t39 -31.5zM1142 327q0 7 5.5 26.5t3 32t-17.5 16.5q-161 -106 -365 -106t-366 106l-12 -6l-5 -12q26 -154 41 -210q47 -81 204 -108q249 -46 428 53q34 19 49 51.5t22.5 85.5t12.5 71z M1272 1020q9 53 -8 75q-43 55 -155 88q-216 63 -487 36q-132 -12 -226 -46q-38 -15 -59.5 -25t-47 -34t-29.5 -54q8 -68 19 -138t29 -171t24 -137q1 -5 5 -31t7 -36t12 -27t22 -28q105 -80 284 -100q259 -28 440 63q24 13 39.5 23t31 29t19.5 40q48 267 80 473zM1536 1120 v-960q0 -119 -84.5 -203.5t-203.5 -84.5h-960q-119 0 -203.5 84.5t-84.5 203.5v960q0 119 84.5 203.5t203.5 84.5h960q119 0 203.5 -84.5t84.5 -203.5z" /> +<glyph unicode="" horiz-adv-x="1024" d="M390 1408h219v-388h364v-241h-364v-394q0 -136 14 -172q13 -37 52 -60q50 -31 117 -31q117 0 232 76v-242q-102 -48 -178 -65q-77 -19 -173 -19q-105 0 -186 27q-78 25 -138 75q-58 51 -79 105q-22 54 -22 161v539h-170v217q91 30 155 84q64 55 103 132q39 78 54 196z " /> +<glyph unicode="" d="M1123 127v181q-88 -56 -174 -56q-51 0 -88 23q-29 17 -39 45q-11 30 -11 129v295h274v181h-274v291h-164q-11 -90 -40 -147t-78 -99q-48 -40 -116 -63v-163h127v-404q0 -78 17 -121q17 -42 59 -78q43 -37 104 -57q62 -20 140 -20q67 0 129 14q57 13 134 49zM1536 1120 v-960q0 -119 -84.5 -203.5t-203.5 -84.5h-960q-119 0 -203.5 84.5t-84.5 203.5v960q0 119 84.5 203.5t203.5 84.5h960q119 0 203.5 -84.5t84.5 -203.5z" /> +<glyph unicode="" horiz-adv-x="768" d="M765 237q8 -19 -5 -35l-350 -384q-10 -10 -23 -10q-14 0 -24 10l-355 384q-13 16 -5 35q9 19 29 19h224v1248q0 14 9 23t23 9h192q14 0 23 -9t9 -23v-1248h224q21 0 29 -19z" /> +<glyph unicode="" horiz-adv-x="768" d="M765 1043q-9 -19 -29 -19h-224v-1248q0 -14 -9 -23t-23 -9h-192q-14 0 -23 9t-9 23v1248h-224q-21 0 -29 19t5 35l350 384q10 10 23 10q14 0 24 -10l355 -384q13 -16 5 -35z" /> +<glyph unicode="" horiz-adv-x="1792" d="M1792 736v-192q0 -14 -9 -23t-23 -9h-1248v-224q0 -21 -19 -29t-35 5l-384 350q-10 10 -10 23q0 14 10 24l384 354q16 14 35 6q19 -9 19 -29v-224h1248q14 0 23 -9t9 -23z" /> +<glyph unicode="" horiz-adv-x="1792" d="M1728 643q0 -14 -10 -24l-384 -354q-16 -14 -35 -6q-19 9 -19 29v224h-1248q-14 0 -23 9t-9 23v192q0 14 9 23t23 9h1248v224q0 21 19 29t35 -5l384 -350q10 -10 10 -23z" /> +<glyph unicode="" horiz-adv-x="1408" d="M1393 321q-39 -125 -123 -250q-129 -196 -257 -196q-49 0 -140 32q-86 32 -151 32q-61 0 -142 -33q-81 -34 -132 -34q-152 0 -301 259q-147 261 -147 503q0 228 113 374q112 144 284 144q72 0 177 -30q104 -30 138 -30q45 0 143 34q102 34 173 34q119 0 213 -65 q52 -36 104 -100q-79 -67 -114 -118q-65 -94 -65 -207q0 -124 69 -223t158 -126zM1017 1494q0 -61 -29 -136q-30 -75 -93 -138q-54 -54 -108 -72q-37 -11 -104 -17q3 149 78 257q74 107 250 148q1 -3 2.5 -11t2.5 -11q0 -4 0.5 -10t0.5 -10z" /> +<glyph unicode="" horiz-adv-x="1664" d="M682 530v-651l-682 94v557h682zM682 1273v-659h-682v565zM1664 530v-786l-907 125v661h907zM1664 1408v-794h-907v669z" /> +<glyph unicode="" horiz-adv-x="1408" d="M493 1053q16 0 27.5 11.5t11.5 27.5t-11.5 27.5t-27.5 11.5t-27 -11.5t-11 -27.5t11 -27.5t27 -11.5zM915 1053q16 0 27 11.5t11 27.5t-11 27.5t-27 11.5t-27.5 -11.5t-11.5 -27.5t11.5 -27.5t27.5 -11.5zM103 869q42 0 72 -30t30 -72v-430q0 -43 -29.5 -73t-72.5 -30 t-73 30t-30 73v430q0 42 30 72t73 30zM1163 850v-666q0 -46 -32 -78t-77 -32h-75v-227q0 -43 -30 -73t-73 -30t-73 30t-30 73v227h-138v-227q0 -43 -30 -73t-73 -30q-42 0 -72 30t-30 73l-1 227h-74q-46 0 -78 32t-32 78v666h918zM931 1255q107 -55 171 -153.5t64 -215.5 h-925q0 117 64 215.5t172 153.5l-71 131q-7 13 5 20q13 6 20 -6l72 -132q95 42 201 42t201 -42l72 132q7 12 20 6q12 -7 5 -20zM1408 767v-430q0 -43 -30 -73t-73 -30q-42 0 -72 30t-30 73v430q0 43 30 72.5t72 29.5q43 0 73 -29.5t30 -72.5z" /> +<glyph unicode="" d="M663 1125q-11 -1 -15.5 -10.5t-8.5 -9.5q-5 -1 -5 5q0 12 19 15h10zM750 1111q-4 -1 -11.5 6.5t-17.5 4.5q24 11 32 -2q3 -6 -3 -9zM399 684q-4 1 -6 -3t-4.5 -12.5t-5.5 -13.5t-10 -13q-7 -10 -1 -12q4 -1 12.5 7t12.5 18q1 3 2 7t2 6t1.5 4.5t0.5 4v3t-1 2.5t-3 2z M1254 325q0 18 -55 42q4 15 7.5 27.5t5 26t3 21.5t0.5 22.5t-1 19.5t-3.5 22t-4 20.5t-5 25t-5.5 26.5q-10 48 -47 103t-72 75q24 -20 57 -83q87 -162 54 -278q-11 -40 -50 -42q-31 -4 -38.5 18.5t-8 83.5t-11.5 107q-9 39 -19.5 69t-19.5 45.5t-15.5 24.5t-13 15t-7.5 7 q-14 62 -31 103t-29.5 56t-23.5 33t-15 40q-4 21 6 53.5t4.5 49.5t-44.5 25q-15 3 -44.5 18t-35.5 16q-8 1 -11 26t8 51t36 27q37 3 51 -30t4 -58q-11 -19 -2 -26.5t30 -0.5q13 4 13 36v37q-5 30 -13.5 50t-21 30.5t-23.5 15t-27 7.5q-107 -8 -89 -134q0 -15 -1 -15 q-9 9 -29.5 10.5t-33 -0.5t-15.5 5q1 57 -16 90t-45 34q-27 1 -41.5 -27.5t-16.5 -59.5q-1 -15 3.5 -37t13 -37.5t15.5 -13.5q10 3 16 14q4 9 -7 8q-7 0 -15.5 14.5t-9.5 33.5q-1 22 9 37t34 14q17 0 27 -21t9.5 -39t-1.5 -22q-22 -15 -31 -29q-8 -12 -27.5 -23.5 t-20.5 -12.5q-13 -14 -15.5 -27t7.5 -18q14 -8 25 -19.5t16 -19t18.5 -13t35.5 -6.5q47 -2 102 15q2 1 23 7t34.5 10.5t29.5 13t21 17.5q9 14 20 8q5 -3 6.5 -8.5t-3 -12t-16.5 -9.5q-20 -6 -56.5 -21.5t-45.5 -19.5q-44 -19 -70 -23q-25 -5 -79 2q-10 2 -9 -2t17 -19 q25 -23 67 -22q17 1 36 7t36 14t33.5 17.5t30 17t24.5 12t17.5 2.5t8.5 -11q0 -2 -1 -4.5t-4 -5t-6 -4.5t-8.5 -5t-9 -4.5t-10 -5t-9.5 -4.5q-28 -14 -67.5 -44t-66.5 -43t-49 -1q-21 11 -63 73q-22 31 -25 22q-1 -3 -1 -10q0 -25 -15 -56.5t-29.5 -55.5t-21 -58t11.5 -63 q-23 -6 -62.5 -90t-47.5 -141q-2 -18 -1.5 -69t-5.5 -59q-8 -24 -29 -3q-32 31 -36 94q-2 28 4 56q4 19 -1 18l-4 -5q-36 -65 10 -166q5 -12 25 -28t24 -20q20 -23 104 -90.5t93 -76.5q16 -15 17.5 -38t-14 -43t-45.5 -23q8 -15 29 -44.5t28 -54t7 -70.5q46 24 7 92 q-4 8 -10.5 16t-9.5 12t-2 6q3 5 13 9.5t20 -2.5q46 -52 166 -36q133 15 177 87q23 38 34 30q12 -6 10 -52q-1 -25 -23 -92q-9 -23 -6 -37.5t24 -15.5q3 19 14.5 77t13.5 90q2 21 -6.5 73.5t-7.5 97t23 70.5q15 18 51 18q1 37 34.5 53t72.5 10.5t60 -22.5zM626 1152 q3 17 -2.5 30t-11.5 15q-9 2 -9 -7q2 -5 5 -6q10 0 7 -15q-3 -20 8 -20q3 0 3 3zM1045 955q-2 8 -6.5 11.5t-13 5t-14.5 5.5q-5 3 -9.5 8t-7 8t-5.5 6.5t-4 4t-4 -1.5q-14 -16 7 -43.5t39 -31.5q9 -1 14.5 8t3.5 20zM867 1168q0 11 -5 19.5t-11 12.5t-9 3q-14 -1 -7 -7l4 -2 q14 -4 18 -31q0 -3 8 2zM921 1401q0 2 -2.5 5t-9 7t-9.5 6q-15 15 -24 15q-9 -1 -11.5 -7.5t-1 -13t-0.5 -12.5q-1 -4 -6 -10.5t-6 -9t3 -8.5q4 -3 8 0t11 9t15 9q1 1 9 1t15 2t9 7zM1486 60q20 -12 31 -24.5t12 -24t-2.5 -22.5t-15.5 -22t-23.5 -19.5t-30 -18.5 t-31.5 -16.5t-32 -15.5t-27 -13q-38 -19 -85.5 -56t-75.5 -64q-17 -16 -68 -19.5t-89 14.5q-18 9 -29.5 23.5t-16.5 25.5t-22 19.5t-47 9.5q-44 1 -130 1q-19 0 -57 -1.5t-58 -2.5q-44 -1 -79.5 -15t-53.5 -30t-43.5 -28.5t-53.5 -11.5q-29 1 -111 31t-146 43q-19 4 -51 9.5 t-50 9t-39.5 9.5t-33.5 14.5t-17 19.5q-10 23 7 66.5t18 54.5q1 16 -4 40t-10 42.5t-4.5 36.5t10.5 27q14 12 57 14t60 12q30 18 42 35t12 51q21 -73 -32 -106q-32 -20 -83 -15q-34 3 -43 -10q-13 -15 5 -57q2 -6 8 -18t8.5 -18t4.5 -17t1 -22q0 -15 -17 -49t-14 -48 q3 -17 37 -26q20 -6 84.5 -18.5t99.5 -20.5q24 -6 74 -22t82.5 -23t55.5 -4q43 6 64.5 28t23 48t-7.5 58.5t-19 52t-20 36.5q-121 190 -169 242q-68 74 -113 40q-11 -9 -15 15q-3 16 -2 38q1 29 10 52t24 47t22 42q8 21 26.5 72t29.5 78t30 61t39 54q110 143 124 195 q-12 112 -16 310q-2 90 24 151.5t106 104.5q39 21 104 21q53 1 106 -13.5t89 -41.5q57 -42 91.5 -121.5t29.5 -147.5q-5 -95 30 -214q34 -113 133 -218q55 -59 99.5 -163t59.5 -191q8 -49 5 -84.5t-12 -55.5t-20 -22q-10 -2 -23.5 -19t-27 -35.5t-40.5 -33.5t-61 -14 q-18 1 -31.5 5t-22.5 13.5t-13.5 15.5t-11.5 20.5t-9 19.5q-22 37 -41 30t-28 -49t7 -97q20 -70 1 -195q-10 -65 18 -100.5t73 -33t85 35.5q59 49 89.5 66.5t103.5 42.5q53 18 77 36.5t18.5 34.5t-25 28.5t-51.5 23.5q-33 11 -49.5 48t-15 72.5t15.5 47.5q1 -31 8 -56.5 t14.5 -40.5t20.5 -28.5t21 -19t21.5 -13t16.5 -9.5z" /> +<glyph unicode="" d="M1024 36q-42 241 -140 498h-2l-2 -1q-16 -6 -43 -16.5t-101 -49t-137 -82t-131 -114.5t-103 -148l-15 11q184 -150 418 -150q132 0 256 52zM839 643q-21 49 -53 111q-311 -93 -673 -93q-1 -7 -1 -21q0 -124 44 -236.5t124 -201.5q50 89 123.5 166.5t142.5 124.5t130.5 81 t99.5 48l37 13q4 1 13 3.5t13 4.5zM732 855q-120 213 -244 378q-138 -65 -234 -186t-128 -272q302 0 606 80zM1416 536q-210 60 -409 29q87 -239 128 -469q111 75 185 189.5t96 250.5zM611 1277q-1 0 -2 -1q1 1 2 1zM1201 1132q-185 164 -433 164q-76 0 -155 -19 q131 -170 246 -382q69 26 130 60.5t96.5 61.5t65.5 57t37.5 40.5zM1424 647q-3 232 -149 410l-1 -1q-9 -12 -19 -24.5t-43.5 -44.5t-71 -60.5t-100 -65t-131.5 -64.5q25 -53 44 -95q2 -6 6.5 -17.5t7.5 -16.5q36 5 74.5 7t73.5 2t69 -1.5t64 -4t56.5 -5.5t48 -6.5t36.5 -6 t25 -4.5zM1536 640q0 -209 -103 -385.5t-279.5 -279.5t-385.5 -103t-385.5 103t-279.5 279.5t-103 385.5t103 385.5t279.5 279.5t385.5 103t385.5 -103t279.5 -279.5t103 -385.5z" /> +<glyph unicode="" d="M1173 473q0 50 -19.5 91.5t-48.5 68.5t-73 49t-82.5 34t-87.5 23l-104 24q-30 7 -44 10.5t-35 11.5t-30 16t-16.5 21t-7.5 30q0 77 144 77q43 0 77 -12t54 -28.5t38 -33.5t40 -29t48 -12q47 0 75.5 32t28.5 77q0 55 -56 99.5t-142 67.5t-182 23q-68 0 -132 -15.5 t-119.5 -47t-89 -87t-33.5 -128.5q0 -61 19 -106.5t56 -75.5t80 -48.5t103 -32.5l146 -36q90 -22 112 -36q32 -20 32 -60q0 -39 -40 -64.5t-105 -25.5q-51 0 -91.5 16t-65 38.5t-45.5 45t-46 38.5t-54 16q-50 0 -75.5 -30t-25.5 -75q0 -92 122 -157.5t291 -65.5 q73 0 140 18.5t122.5 53.5t88.5 93.5t33 131.5zM1536 256q0 -159 -112.5 -271.5t-271.5 -112.5q-130 0 -234 80q-77 -16 -150 -16q-143 0 -273.5 55.5t-225 150t-150 225t-55.5 273.5q0 73 16 150q-80 104 -80 234q0 159 112.5 271.5t271.5 112.5q130 0 234 -80 q77 16 150 16q143 0 273.5 -55.5t225 -150t150 -225t55.5 -273.5q0 -73 -16 -150q80 -104 80 -234z" /> +<glyph unicode="" horiz-adv-x="1664" d="M1483 512l-587 -587q-52 -53 -127.5 -53t-128.5 53l-587 587q-53 53 -53 128t53 128l587 587q53 53 128 53t128 -53l265 -265l-398 -399l-188 188q-42 42 -99 42q-59 0 -100 -41l-120 -121q-42 -40 -42 -99q0 -58 42 -100l406 -408q30 -28 67 -37l6 -4h28q60 0 99 41 l619 619l2 -3q53 -53 53 -128t-53 -128zM1406 1138l120 -120q14 -15 14 -36t-14 -36l-730 -730q-17 -15 -37 -15v0q-4 0 -6 1q-18 2 -30 14l-407 408q-14 15 -14 36t14 35l121 120q13 15 35 15t36 -15l252 -252l574 575q15 15 36 15t36 -15z" /> +<glyph unicode="" d="M704 192v1024q0 14 -9 23t-23 9h-480q-14 0 -23 -9t-9 -23v-1024q0 -14 9 -23t23 -9h480q14 0 23 9t9 23zM1376 576v640q0 14 -9 23t-23 9h-480q-14 0 -23 -9t-9 -23v-640q0 -14 9 -23t23 -9h480q14 0 23 9t9 23zM1536 1344v-1408q0 -26 -19 -45t-45 -19h-1408 q-26 0 -45 19t-19 45v1408q0 26 19 45t45 19h1408q26 0 45 -19t19 -45z" /> +<glyph unicode="" horiz-adv-x="1280" d="M1280 480q0 -40 -28 -68t-68 -28q-51 0 -80 43l-227 341h-45v-132l247 -411q9 -15 9 -33q0 -26 -19 -45t-45 -19h-192v-272q0 -46 -33 -79t-79 -33h-160q-46 0 -79 33t-33 79v272h-192q-26 0 -45 19t-19 45q0 18 9 33l247 411v132h-45l-227 -341q-29 -43 -80 -43 q-40 0 -68 28t-28 68q0 29 16 53l256 384q73 107 176 107h384q103 0 176 -107l256 -384q16 -24 16 -53zM864 1280q0 -93 -65.5 -158.5t-158.5 -65.5t-158.5 65.5t-65.5 158.5t65.5 158.5t158.5 65.5t158.5 -65.5t65.5 -158.5z" /> +<glyph unicode="" horiz-adv-x="1024" d="M1024 832v-416q0 -40 -28 -68t-68 -28t-68 28t-28 68v352h-64v-912q0 -46 -33 -79t-79 -33t-79 33t-33 79v464h-64v-464q0 -46 -33 -79t-79 -33t-79 33t-33 79v912h-64v-352q0 -40 -28 -68t-68 -28t-68 28t-28 68v416q0 80 56 136t136 56h640q80 0 136 -56t56 -136z M736 1280q0 -93 -65.5 -158.5t-158.5 -65.5t-158.5 65.5t-65.5 158.5t65.5 158.5t158.5 65.5t158.5 -65.5t65.5 -158.5z" /> +<glyph unicode="" d="M773 234l350 473q16 22 24.5 59t-6 85t-61.5 79q-40 26 -83 25.5t-73.5 -17.5t-54.5 -45q-36 -40 -96 -40q-59 0 -95 40q-24 28 -54.5 45t-73.5 17.5t-84 -25.5q-46 -31 -60.5 -79t-6 -85t24.5 -59zM1536 640q0 -209 -103 -385.5t-279.5 -279.5t-385.5 -103t-385.5 103 t-279.5 279.5t-103 385.5t103 385.5t279.5 279.5t385.5 103t385.5 -103t279.5 -279.5t103 -385.5z" /> +<glyph unicode="" horiz-adv-x="1792" d="M1472 640q0 117 -45.5 223.5t-123 184t-184 123t-223.5 45.5t-223.5 -45.5t-184 -123t-123 -184t-45.5 -223.5t45.5 -223.5t123 -184t184 -123t223.5 -45.5t223.5 45.5t184 123t123 184t45.5 223.5zM1748 363q-4 -15 -20 -20l-292 -96v-306q0 -16 -13 -26q-15 -10 -29 -4 l-292 94l-180 -248q-10 -13 -26 -13t-26 13l-180 248l-292 -94q-14 -6 -29 4q-13 10 -13 26v306l-292 96q-16 5 -20 20q-5 17 4 29l180 248l-180 248q-9 13 -4 29q4 15 20 20l292 96v306q0 16 13 26q15 10 29 4l292 -94l180 248q9 12 26 12t26 -12l180 -248l292 94 q14 6 29 -4q13 -10 13 -26v-306l292 -96q16 -5 20 -20q5 -16 -4 -29l-180 -248l180 -248q9 -12 4 -29z" /> +<glyph unicode="" d="M1262 233q-54 -9 -110 -9q-182 0 -337 90t-245 245t-90 337q0 192 104 357q-201 -60 -328.5 -229t-127.5 -384q0 -130 51 -248.5t136.5 -204t204 -136.5t248.5 -51q144 0 273.5 61.5t220.5 171.5zM1465 318q-94 -203 -283.5 -324.5t-413.5 -121.5q-156 0 -298 61 t-245 164t-164 245t-61 298q0 153 57.5 292.5t156 241.5t235.5 164.5t290 68.5q44 2 61 -39q18 -41 -15 -72q-86 -78 -131.5 -181.5t-45.5 -218.5q0 -148 73 -273t198 -198t273 -73q118 0 228 51q41 18 72 -13q14 -14 17.5 -34t-4.5 -38z" /> +<glyph unicode="" horiz-adv-x="1792" d="M1088 704q0 26 -19 45t-45 19h-256q-26 0 -45 -19t-19 -45t19 -45t45 -19h256q26 0 45 19t19 45zM1664 896v-960q0 -26 -19 -45t-45 -19h-1408q-26 0 -45 19t-19 45v960q0 26 19 45t45 19h1408q26 0 45 -19t19 -45zM1728 1344v-256q0 -26 -19 -45t-45 -19h-1536 q-26 0 -45 19t-19 45v256q0 26 19 45t45 19h1536q26 0 45 -19t19 -45z" /> +<glyph unicode="" horiz-adv-x="1664" d="M1632 576q0 -26 -19 -45t-45 -19h-224q0 -171 -67 -290l208 -209q19 -19 19 -45t-19 -45q-18 -19 -45 -19t-45 19l-198 197q-5 -5 -15 -13t-42 -28.5t-65 -36.5t-82 -29t-97 -13v896h-128v-896q-51 0 -101.5 13.5t-87 33t-66 39t-43.5 32.5l-15 14l-183 -207 q-20 -21 -48 -21q-24 0 -43 16q-19 18 -20.5 44.5t15.5 46.5l202 227q-58 114 -58 274h-224q-26 0 -45 19t-19 45t19 45t45 19h224v294l-173 173q-19 19 -19 45t19 45t45 19t45 -19l173 -173h844l173 173q19 19 45 19t45 -19t19 -45t-19 -45l-173 -173v-294h224q26 0 45 -19 t19 -45zM1152 1152h-640q0 133 93.5 226.5t226.5 93.5t226.5 -93.5t93.5 -226.5z" /> +<glyph unicode="" horiz-adv-x="1920" d="M1917 1016q23 -64 -150 -294q-24 -32 -65 -85q-78 -100 -90 -131q-17 -41 14 -81q17 -21 81 -82h1l1 -1l1 -1l2 -2q141 -131 191 -221q3 -5 6.5 -12.5t7 -26.5t-0.5 -34t-25 -27.5t-59 -12.5l-256 -4q-24 -5 -56 5t-52 22l-20 12q-30 21 -70 64t-68.5 77.5t-61 58 t-56.5 15.5q-3 -1 -8 -3.5t-17 -14.5t-21.5 -29.5t-17 -52t-6.5 -77.5q0 -15 -3.5 -27.5t-7.5 -18.5l-4 -5q-18 -19 -53 -22h-115q-71 -4 -146 16.5t-131.5 53t-103 66t-70.5 57.5l-25 24q-10 10 -27.5 30t-71.5 91t-106 151t-122.5 211t-130.5 272q-6 16 -6 27t3 16l4 6 q15 19 57 19l274 2q12 -2 23 -6.5t16 -8.5l5 -3q16 -11 24 -32q20 -50 46 -103.5t41 -81.5l16 -29q29 -60 56 -104t48.5 -68.5t41.5 -38.5t34 -14t27 5q2 1 5 5t12 22t13.5 47t9.5 81t0 125q-2 40 -9 73t-14 46l-6 12q-25 34 -85 43q-13 2 5 24q17 19 38 30q53 26 239 24 q82 -1 135 -13q20 -5 33.5 -13.5t20.5 -24t10.5 -32t3.5 -45.5t-1 -55t-2.5 -70.5t-1.5 -82.5q0 -11 -1 -42t-0.5 -48t3.5 -40.5t11.5 -39t22.5 -24.5q8 -2 17 -4t26 11t38 34.5t52 67t68 107.5q60 104 107 225q4 10 10 17.5t11 10.5l4 3l5 2.5t13 3t20 0.5l288 2 q39 5 64 -2.5t31 -16.5z" /> +<glyph unicode="" horiz-adv-x="1792" d="M675 252q21 34 11 69t-45 50q-34 14 -73 1t-60 -46q-22 -34 -13 -68.5t43 -50.5t74.5 -2.5t62.5 47.5zM769 373q8 13 3.5 26.5t-17.5 18.5q-14 5 -28.5 -0.5t-21.5 -18.5q-17 -31 13 -45q14 -5 29 0.5t22 18.5zM943 266q-45 -102 -158 -150t-224 -12 q-107 34 -147.5 126.5t6.5 187.5q47 93 151.5 139t210.5 19q111 -29 158.5 -119.5t2.5 -190.5zM1255 426q-9 96 -89 170t-208.5 109t-274.5 21q-223 -23 -369.5 -141.5t-132.5 -264.5q9 -96 89 -170t208.5 -109t274.5 -21q223 23 369.5 141.5t132.5 264.5zM1563 422 q0 -68 -37 -139.5t-109 -137t-168.5 -117.5t-226 -83t-270.5 -31t-275 33.5t-240.5 93t-171.5 151t-65 199.5q0 115 69.5 245t197.5 258q169 169 341.5 236t246.5 -7q65 -64 20 -209q-4 -14 -1 -20t10 -7t14.5 0.5t13.5 3.5l6 2q139 59 246 59t153 -61q45 -63 0 -178 q-2 -13 -4.5 -20t4.5 -12.5t12 -7.5t17 -6q57 -18 103 -47t80 -81.5t34 -116.5zM1489 1046q42 -47 54.5 -108.5t-6.5 -117.5q-8 -23 -29.5 -34t-44.5 -4q-23 8 -34 29.5t-4 44.5q20 63 -24 111t-107 35q-24 -5 -45 8t-25 37q-5 24 8 44.5t37 25.5q60 13 119 -5.5t101 -65.5z M1670 1209q87 -96 112.5 -222.5t-13.5 -241.5q-9 -27 -34 -40t-52 -4t-40 34t-5 52q28 82 10 172t-80 158q-62 69 -148 95.5t-173 8.5q-28 -6 -52 9.5t-30 43.5t9.5 51.5t43.5 29.5q123 26 244 -11.5t208 -134.5z" /> +<glyph unicode="" horiz-adv-x="1920" d="M805 163q-122 -67 -261 -67q-141 0 -261 67q98 61 167 149t94 191q25 -103 94 -191t167 -149zM453 1176v-344q0 -179 -89.5 -326t-234.5 -217q-129 152 -129 351q0 200 129.5 352t323.5 184zM958 991q-128 -152 -128 -351q0 -201 128 -351q-145 70 -234.5 218t-89.5 328 v341q196 -33 324 -185zM1638 163q-122 -67 -261 -67q-141 0 -261 67q98 61 167 149t94 191q25 -103 94 -191t167 -149zM1286 1176v-344q0 -179 -91 -326t-237 -217v0q133 154 133 351q0 195 -133 351q129 151 328 185zM1920 640q0 -201 -129 -351q-145 70 -234.5 218 t-89.5 328v341q194 -32 323.5 -184t129.5 -352z" /> +<glyph unicode="" horiz-adv-x="1792" /> +<glyph unicode="" horiz-adv-x="1792" /> +<glyph unicode="" horiz-adv-x="1792" /> +<glyph unicode="" horiz-adv-x="1792" /> +</font> +</defs></svg>
\ No newline at end of file diff --git a/stylesheets/font-awesome/font/fontawesome-webfont.ttf b/stylesheets/font-awesome/font/fontawesome-webfont.ttf Binary files differnew file mode 100755 index 00000000..d3659246 --- /dev/null +++ b/stylesheets/font-awesome/font/fontawesome-webfont.ttf diff --git a/stylesheets/font-awesome/font/fontawesome-webfont.woff b/stylesheets/font-awesome/font/fontawesome-webfont.woff Binary files differnew file mode 100755 index 00000000..b9bd17e1 --- /dev/null +++ b/stylesheets/font-awesome/font/fontawesome-webfont.woff diff --git a/stylesheets/font-awesome/less/bootstrap.less b/stylesheets/font-awesome/less/bootstrap.less new file mode 100644 index 00000000..a2c96046 --- /dev/null +++ b/stylesheets/font-awesome/less/bootstrap.less @@ -0,0 +1,84 @@ +/* BOOTSTRAP SPECIFIC CLASSES + * -------------------------- */ + +/* Bootstrap 2.0 sprites.less reset */ +[class^="icon-"], +[class*=" icon-"] { + display: inline; + width: auto; + height: auto; + line-height: normal; + vertical-align: baseline; + background-image: none; + background-position: 0% 0%; + background-repeat: repeat; + margin-top: 0; +} + +/* more sprites.less reset */ +.icon-white, +.nav-pills > .active > a > [class^="icon-"], +.nav-pills > .active > a > [class*=" icon-"], +.nav-list > .active > a > [class^="icon-"], +.nav-list > .active > a > [class*=" icon-"], +.navbar-inverse .nav > .active > a > [class^="icon-"], +.navbar-inverse .nav > .active > a > [class*=" icon-"], +.dropdown-menu > li > a:hover > [class^="icon-"], +.dropdown-menu > li > a:hover > [class*=" icon-"], +.dropdown-menu > .active > a > [class^="icon-"], +.dropdown-menu > .active > a > [class*=" icon-"], +.dropdown-submenu:hover > a > [class^="icon-"], +.dropdown-submenu:hover > a > [class*=" icon-"] { + background-image: none; +} + + +/* keeps Bootstrap styles with and without icons the same */ +.btn, .nav { + [class^="icon-"], + [class*=" icon-"] { +// display: inline; + &.icon-large { line-height: .9em; } + &.icon-spin { display: inline-block; } + } +} +.nav-tabs, .nav-pills { + [class^="icon-"], + [class*=" icon-"] { + &, &.icon-large { line-height: .9em; } + } +} +.btn { + [class^="icon-"], + [class*=" icon-"] { + &.pull-left, &.pull-right { + &.icon-2x { margin-top: .18em; } + } + &.icon-spin.icon-large { line-height: .8em; } + } +} +.btn.btn-small { + [class^="icon-"], + [class*=" icon-"] { + &.pull-left, &.pull-right { + &.icon-2x { margin-top: .25em; } + } + } +} +.btn.btn-large { + [class^="icon-"], + [class*=" icon-"] { + margin-top: 0; // overrides bootstrap default + &.pull-left, &.pull-right { + &.icon-2x { margin-top: .05em; } + } + &.pull-left.icon-2x { margin-right: .2em; } + &.pull-right.icon-2x { margin-left: .2em; } + } +} + +/* Fixes alignment in nav lists */ +.nav-list [class^="icon-"], +.nav-list [class*=" icon-"] { + line-height: inherit; +} diff --git a/stylesheets/font-awesome/less/core.less b/stylesheets/font-awesome/less/core.less new file mode 100644 index 00000000..1ef7e223 --- /dev/null +++ b/stylesheets/font-awesome/less/core.less @@ -0,0 +1,129 @@ +/* FONT AWESOME CORE + * -------------------------- */ + +[class^="icon-"], +[class*=" icon-"] { + .icon-FontAwesome(); +} + +[class^="icon-"]:before, +[class*=" icon-"]:before { + text-decoration: inherit; + display: inline-block; + speak: none; +} + +/* makes the font 33% larger relative to the icon container */ +.icon-large:before { + vertical-align: -10%; + font-size: 4/3em; +} + +/* makes sure icons active on rollover in links */ +a { + [class^="icon-"], + [class*=" icon-"] { + display: inline; + } +} + +/* increased font size for icon-large */ +[class^="icon-"], +[class*=" icon-"] { + &.icon-fixed-width { + display: inline-block; + width: 16/14em; + text-align: right; + padding-right: 4/14em; + &.icon-large { + width: 20/14em; + } + } +} + +.icons-ul { + margin-left: @icons-li-width; + list-style-type: none; + + > li { position: relative; } + + .icon-li { + position: absolute; + left: -@icons-li-width; + width: @icons-li-width; + text-align: center; + line-height: inherit; + } +} + +// allows usage of the hide class directly on font awesome icons +[class^="icon-"], +[class*=" icon-"] { + &.hide { + display: none; + } +} + +.icon-muted { color: @iconMuted; } +.icon-light { color: @iconLight; } +.icon-dark { color: @iconDark; } + +// Icon Borders +// ------------------------- + +.icon-border { + border: solid 1px @borderColor; + padding: .2em .25em .15em; + .border-radius(3px); +} + +// Icon Sizes +// ------------------------- + +.icon-2x { + font-size: 2em; + &.icon-border { + border-width: 2px; + .border-radius(4px); + } +} +.icon-3x { + font-size: 3em; + &.icon-border { + border-width: 3px; + .border-radius(5px); + } +} +.icon-4x { + font-size: 4em; + &.icon-border { + border-width: 4px; + .border-radius(6px); + } +} + +.icon-5x { + font-size: 5em; + &.icon-border { + border-width: 5px; + .border-radius(7px); + } +} + + +// Floats & Margins +// ------------------------- + +// Quick floats +.pull-right { float: right; } +.pull-left { float: left; } + +[class^="icon-"], +[class*=" icon-"] { + &.pull-left { + margin-right: .3em; + } + &.pull-right { + margin-left: .3em; + } +} diff --git a/stylesheets/font-awesome/less/extras.less b/stylesheets/font-awesome/less/extras.less new file mode 100644 index 00000000..c93c260c --- /dev/null +++ b/stylesheets/font-awesome/less/extras.less @@ -0,0 +1,93 @@ +/* EXTRAS + * -------------------------- */ + +/* Stacked and layered icon */ +.icon-stack(); + +/* Animated rotating icon */ +.icon-spin { + display: inline-block; + -moz-animation: spin 2s infinite linear; + -o-animation: spin 2s infinite linear; + -webkit-animation: spin 2s infinite linear; + animation: spin 2s infinite linear; +} + +/* Prevent stack and spinners from being taken inline when inside a link */ +a .icon-stack, +a .icon-spin { + display: inline-block; + text-decoration: none; +} + +@-moz-keyframes spin { + 0% { -moz-transform: rotate(0deg); } + 100% { -moz-transform: rotate(359deg); } +} +@-webkit-keyframes spin { + 0% { -webkit-transform: rotate(0deg); } + 100% { -webkit-transform: rotate(359deg); } +} +@-o-keyframes spin { + 0% { -o-transform: rotate(0deg); } + 100% { -o-transform: rotate(359deg); } +} +@-ms-keyframes spin { + 0% { -ms-transform: rotate(0deg); } + 100% { -ms-transform: rotate(359deg); } +} +@keyframes spin { + 0% { transform: rotate(0deg); } + 100% { transform: rotate(359deg); } +} + +/* Icon rotations and mirroring */ +.icon-rotate-90:before { + -webkit-transform: rotate(90deg); + -moz-transform: rotate(90deg); + -ms-transform: rotate(90deg); + -o-transform: rotate(90deg); + transform: rotate(90deg); + filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=1); +} + +.icon-rotate-180:before { + -webkit-transform: rotate(180deg); + -moz-transform: rotate(180deg); + -ms-transform: rotate(180deg); + -o-transform: rotate(180deg); + transform: rotate(180deg); + filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=2); +} + +.icon-rotate-270:before { + -webkit-transform: rotate(270deg); + -moz-transform: rotate(270deg); + -ms-transform: rotate(270deg); + -o-transform: rotate(270deg); + transform: rotate(270deg); + filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=3); +} + +.icon-flip-horizontal:before { + -webkit-transform: scale(-1, 1); + -moz-transform: scale(-1, 1); + -ms-transform: scale(-1, 1); + -o-transform: scale(-1, 1); + transform: scale(-1, 1); +} + +.icon-flip-vertical:before { + -webkit-transform: scale(1, -1); + -moz-transform: scale(1, -1); + -ms-transform: scale(1, -1); + -o-transform: scale(1, -1); + transform: scale(1, -1); +} + +/* ensure rotation occurs inside anchor tags */ +a { + .icon-rotate-90, .icon-rotate-180, .icon-rotate-270, .icon-flip-horizontal, .icon-flip-vertical { + &:before { display: inline-block; } + } +} diff --git a/stylesheets/font-awesome/less/font-awesome-ie7.less b/stylesheets/font-awesome/less/font-awesome-ie7.less new file mode 100644 index 00000000..6675c498 --- /dev/null +++ b/stylesheets/font-awesome/less/font-awesome-ie7.less @@ -0,0 +1,1953 @@ +/*! + * Font Awesome 3.2.1 + * the iconic font designed for Bootstrap + * ------------------------------------------------------------------------------ + * The full suite of pictographic icons, examples, and documentation can be + * found at http://fontawesome.io. Stay up to date on Twitter at + * http://twitter.com/fontawesome. + * + * License + * ------------------------------------------------------------------------------ + * - The Font Awesome font is licensed under SIL OFL 1.1 - + * http://scripts.sil.org/OFL + * - Font Awesome CSS, LESS, and SASS files are licensed under MIT License - + * http://opensource.org/licenses/mit-license.html + * - Font Awesome documentation licensed under CC BY 3.0 - + * http://creativecommons.org/licenses/by/3.0/ + * - Attribution is no longer required in Font Awesome 3.0, but much appreciated: + * "Font Awesome by Dave Gandy - http://fontawesome.io" + * + * Author - Dave Gandy + * ------------------------------------------------------------------------------ + * Email: dave@fontawesome.io + * Twitter: http://twitter.com/davegandy + * Work: Lead Product Designer @ Kyruus - http://kyruus.com + */ + +.icon-large { + font-size: 4/3em; + margin-top: -4px; + padding-top: 3px; + margin-bottom: -4px; + padding-bottom: 3px; + vertical-align: middle; +} + +.nav { + [class^="icon-"], + [class*=" icon-"] { + vertical-align: inherit; + margin-top: -4px; + padding-top: 3px; + margin-bottom: -4px; + padding-bottom: 3px; + &.icon-large { + vertical-align: -25%; + } + } +} + +.nav-pills, .nav-tabs { + [class^="icon-"], + [class*=" icon-"] { + &.icon-large { + line-height: .75em; + margin-top: -7px; + padding-top: 5px; + margin-bottom: -5px; + padding-bottom: 4px; + } + } +} + +.btn { + [class^="icon-"], + [class*=" icon-"] { + &.pull-left, &.pull-right { vertical-align: inherit; } + &.icon-large { + margin-top: -.5em; + } + } +} + +a [class^="icon-"], +a [class*=" icon-"] { + cursor: pointer; +} + +.ie7icon(@inner) { *zoom: ~"expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '@{inner}')"; } + + +.icon-glass { + .ie7icon(''); +} + + +.icon-music { + .ie7icon(''); +} + + +.icon-search { + .ie7icon(''); +} + + +.icon-envelope-alt { + .ie7icon(''); +} + + +.icon-heart { + .ie7icon(''); +} + + +.icon-star { + .ie7icon(''); +} + + +.icon-star-empty { + .ie7icon(''); +} + + +.icon-user { + .ie7icon(''); +} + + +.icon-film { + .ie7icon(''); +} + + +.icon-th-large { + .ie7icon(''); +} + + +.icon-th { + .ie7icon(''); +} + + +.icon-th-list { + .ie7icon(''); +} + + +.icon-ok { + .ie7icon(''); +} + + +.icon-remove { + .ie7icon(''); +} + + +.icon-zoom-in { + .ie7icon(''); +} + + +.icon-zoom-out { + .ie7icon(''); +} + + +.icon-off { + .ie7icon(''); +} + +.icon-power-off { + .ie7icon(''); +} + + +.icon-signal { + .ie7icon(''); +} + + +.icon-cog { + .ie7icon(''); +} + +.icon-gear { + .ie7icon(''); +} + + +.icon-trash { + .ie7icon(''); +} + + +.icon-home { + .ie7icon(''); +} + + +.icon-file-alt { + .ie7icon(''); +} + + +.icon-time { + .ie7icon(''); +} + + +.icon-road { + .ie7icon(''); +} + + +.icon-download-alt { + .ie7icon(''); +} + + +.icon-download { + .ie7icon(''); +} + + +.icon-upload { + .ie7icon(''); +} + + +.icon-inbox { + .ie7icon(''); +} + + +.icon-play-circle { + .ie7icon(''); +} + + +.icon-repeat { + .ie7icon(''); +} + +.icon-rotate-right { + .ie7icon(''); +} + + +.icon-refresh { + .ie7icon(''); +} + + +.icon-list-alt { + .ie7icon(''); +} + + +.icon-lock { + .ie7icon(''); +} + + +.icon-flag { + .ie7icon(''); +} + + +.icon-headphones { + .ie7icon(''); +} + + +.icon-volume-off { + .ie7icon(''); +} + + +.icon-volume-down { + .ie7icon(''); +} + + +.icon-volume-up { + .ie7icon(''); +} + + +.icon-qrcode { + .ie7icon(''); +} + + +.icon-barcode { + .ie7icon(''); +} + + +.icon-tag { + .ie7icon(''); +} + + +.icon-tags { + .ie7icon(''); +} + + +.icon-book { + .ie7icon(''); +} + + +.icon-bookmark { + .ie7icon(''); +} + + +.icon-print { + .ie7icon(''); +} + + +.icon-camera { + .ie7icon(''); +} + + +.icon-font { + .ie7icon(''); +} + + +.icon-bold { + .ie7icon(''); +} + + +.icon-italic { + .ie7icon(''); +} + + +.icon-text-height { + .ie7icon(''); +} + + +.icon-text-width { + .ie7icon(''); +} + + +.icon-align-left { + .ie7icon(''); +} + + +.icon-align-center { + .ie7icon(''); +} + + +.icon-align-right { + .ie7icon(''); +} + + +.icon-align-justify { + .ie7icon(''); +} + + +.icon-list { + .ie7icon(''); +} + + +.icon-indent-left { + .ie7icon(''); +} + + +.icon-indent-right { + .ie7icon(''); +} + + +.icon-facetime-video { + .ie7icon(''); +} + + +.icon-picture { + .ie7icon(''); +} + + +.icon-pencil { + .ie7icon(''); +} + + +.icon-map-marker { + .ie7icon(''); +} + + +.icon-adjust { + .ie7icon(''); +} + + +.icon-tint { + .ie7icon(''); +} + + +.icon-edit { + .ie7icon(''); +} + + +.icon-share { + .ie7icon(''); +} + + +.icon-check { + .ie7icon(''); +} + + +.icon-move { + .ie7icon(''); +} + + +.icon-step-backward { + .ie7icon(''); +} + + +.icon-fast-backward { + .ie7icon(''); +} + + +.icon-backward { + .ie7icon(''); +} + + +.icon-play { + .ie7icon(''); +} + + +.icon-pause { + .ie7icon(''); +} + + +.icon-stop { + .ie7icon(''); +} + + +.icon-forward { + .ie7icon(''); +} + + +.icon-fast-forward { + .ie7icon(''); +} + + +.icon-step-forward { + .ie7icon(''); +} + + +.icon-eject { + .ie7icon(''); +} + + +.icon-chevron-left { + .ie7icon(''); +} + + +.icon-chevron-right { + .ie7icon(''); +} + + +.icon-plus-sign { + .ie7icon(''); +} + + +.icon-minus-sign { + .ie7icon(''); +} + + +.icon-remove-sign { + .ie7icon(''); +} + + +.icon-ok-sign { + .ie7icon(''); +} + + +.icon-question-sign { + .ie7icon(''); +} + + +.icon-info-sign { + .ie7icon(''); +} + + +.icon-screenshot { + .ie7icon(''); +} + + +.icon-remove-circle { + .ie7icon(''); +} + + +.icon-ok-circle { + .ie7icon(''); +} + + +.icon-ban-circle { + .ie7icon(''); +} + + +.icon-arrow-left { + .ie7icon(''); +} + + +.icon-arrow-right { + .ie7icon(''); +} + + +.icon-arrow-up { + .ie7icon(''); +} + + +.icon-arrow-down { + .ie7icon(''); +} + + +.icon-share-alt { + .ie7icon(''); +} + +.icon-mail-forward { + .ie7icon(''); +} + + +.icon-resize-full { + .ie7icon(''); +} + + +.icon-resize-small { + .ie7icon(''); +} + + +.icon-plus { + .ie7icon(''); +} + + +.icon-minus { + .ie7icon(''); +} + + +.icon-asterisk { + .ie7icon(''); +} + + +.icon-exclamation-sign { + .ie7icon(''); +} + + +.icon-gift { + .ie7icon(''); +} + + +.icon-leaf { + .ie7icon(''); +} + + +.icon-fire { + .ie7icon(''); +} + + +.icon-eye-open { + .ie7icon(''); +} + + +.icon-eye-close { + .ie7icon(''); +} + + +.icon-warning-sign { + .ie7icon(''); +} + + +.icon-plane { + .ie7icon(''); +} + + +.icon-calendar { + .ie7icon(''); +} + + +.icon-random { + .ie7icon(''); +} + + +.icon-comment { + .ie7icon(''); +} + + +.icon-magnet { + .ie7icon(''); +} + + +.icon-chevron-up { + .ie7icon(''); +} + + +.icon-chevron-down { + .ie7icon(''); +} + + +.icon-retweet { + .ie7icon(''); +} + + +.icon-shopping-cart { + .ie7icon(''); +} + + +.icon-folder-close { + .ie7icon(''); +} + + +.icon-folder-open { + .ie7icon(''); +} + + +.icon-resize-vertical { + .ie7icon(''); +} + + +.icon-resize-horizontal { + .ie7icon(''); +} + + +.icon-bar-chart { + .ie7icon(''); +} + + +.icon-twitter-sign { + .ie7icon(''); +} + + +.icon-facebook-sign { + .ie7icon(''); +} + + +.icon-camera-retro { + .ie7icon(''); +} + + +.icon-key { + .ie7icon(''); +} + + +.icon-cogs { + .ie7icon(''); +} + +.icon-gears { + .ie7icon(''); +} + + +.icon-comments { + .ie7icon(''); +} + + +.icon-thumbs-up-alt { + .ie7icon(''); +} + + +.icon-thumbs-down-alt { + .ie7icon(''); +} + + +.icon-star-half { + .ie7icon(''); +} + + +.icon-heart-empty { + .ie7icon(''); +} + + +.icon-signout { + .ie7icon(''); +} + + +.icon-linkedin-sign { + .ie7icon(''); +} + + +.icon-pushpin { + .ie7icon(''); +} + + +.icon-external-link { + .ie7icon(''); +} + + +.icon-signin { + .ie7icon(''); +} + + +.icon-trophy { + .ie7icon(''); +} + + +.icon-github-sign { + .ie7icon(''); +} + + +.icon-upload-alt { + .ie7icon(''); +} + + +.icon-lemon { + .ie7icon(''); +} + + +.icon-phone { + .ie7icon(''); +} + + +.icon-check-empty { + .ie7icon(''); +} + +.icon-unchecked { + .ie7icon(''); +} + + +.icon-bookmark-empty { + .ie7icon(''); +} + + +.icon-phone-sign { + .ie7icon(''); +} + + +.icon-twitter { + .ie7icon(''); +} + + +.icon-facebook { + .ie7icon(''); +} + + +.icon-github { + .ie7icon(''); +} + + +.icon-unlock { + .ie7icon(''); +} + + +.icon-credit-card { + .ie7icon(''); +} + + +.icon-rss { + .ie7icon(''); +} + + +.icon-hdd { + .ie7icon(''); +} + + +.icon-bullhorn { + .ie7icon(''); +} + + +.icon-bell { + .ie7icon(''); +} + + +.icon-certificate { + .ie7icon(''); +} + + +.icon-hand-right { + .ie7icon(''); +} + + +.icon-hand-left { + .ie7icon(''); +} + + +.icon-hand-up { + .ie7icon(''); +} + + +.icon-hand-down { + .ie7icon(''); +} + + +.icon-circle-arrow-left { + .ie7icon(''); +} + + +.icon-circle-arrow-right { + .ie7icon(''); +} + + +.icon-circle-arrow-up { + .ie7icon(''); +} + + +.icon-circle-arrow-down { + .ie7icon(''); +} + + +.icon-globe { + .ie7icon(''); +} + + +.icon-wrench { + .ie7icon(''); +} + + +.icon-tasks { + .ie7icon(''); +} + + +.icon-filter { + .ie7icon(''); +} + + +.icon-briefcase { + .ie7icon(''); +} + + +.icon-fullscreen { + .ie7icon(''); +} + + +.icon-group { + .ie7icon(''); +} + + +.icon-link { + .ie7icon(''); +} + + +.icon-cloud { + .ie7icon(''); +} + + +.icon-beaker { + .ie7icon(''); +} + + +.icon-cut { + .ie7icon(''); +} + + +.icon-copy { + .ie7icon(''); +} + + +.icon-paper-clip { + .ie7icon(''); +} + +.icon-paperclip { + .ie7icon(''); +} + + +.icon-save { + .ie7icon(''); +} + + +.icon-sign-blank { + .ie7icon(''); +} + + +.icon-reorder { + .ie7icon(''); +} + + +.icon-list-ul { + .ie7icon(''); +} + + +.icon-list-ol { + .ie7icon(''); +} + + +.icon-strikethrough { + .ie7icon(''); +} + + +.icon-underline { + .ie7icon(''); +} + + +.icon-table { + .ie7icon(''); +} + + +.icon-magic { + .ie7icon(''); +} + + +.icon-truck { + .ie7icon(''); +} + + +.icon-pinterest { + .ie7icon(''); +} + + +.icon-pinterest-sign { + .ie7icon(''); +} + + +.icon-google-plus-sign { + .ie7icon(''); +} + + +.icon-google-plus { + .ie7icon(''); +} + + +.icon-money { + .ie7icon(''); +} + + +.icon-caret-down { + .ie7icon(''); +} + + +.icon-caret-up { + .ie7icon(''); +} + + +.icon-caret-left { + .ie7icon(''); +} + + +.icon-caret-right { + .ie7icon(''); +} + + +.icon-columns { + .ie7icon(''); +} + + +.icon-sort { + .ie7icon(''); +} + + +.icon-sort-down { + .ie7icon(''); +} + + +.icon-sort-up { + .ie7icon(''); +} + + +.icon-envelope { + .ie7icon(''); +} + + +.icon-linkedin { + .ie7icon(''); +} + + +.icon-undo { + .ie7icon(''); +} + +.icon-rotate-left { + .ie7icon(''); +} + + +.icon-legal { + .ie7icon(''); +} + + +.icon-dashboard { + .ie7icon(''); +} + + +.icon-comment-alt { + .ie7icon(''); +} + + +.icon-comments-alt { + .ie7icon(''); +} + + +.icon-bolt { + .ie7icon(''); +} + + +.icon-sitemap { + .ie7icon(''); +} + + +.icon-umbrella { + .ie7icon(''); +} + + +.icon-paste { + .ie7icon(''); +} + + +.icon-lightbulb { + .ie7icon(''); +} + + +.icon-exchange { + .ie7icon(''); +} + + +.icon-cloud-download { + .ie7icon(''); +} + + +.icon-cloud-upload { + .ie7icon(''); +} + + +.icon-user-md { + .ie7icon(''); +} + + +.icon-stethoscope { + .ie7icon(''); +} + + +.icon-suitcase { + .ie7icon(''); +} + + +.icon-bell-alt { + .ie7icon(''); +} + + +.icon-coffee { + .ie7icon(''); +} + + +.icon-food { + .ie7icon(''); +} + + +.icon-file-text-alt { + .ie7icon(''); +} + + +.icon-building { + .ie7icon(''); +} + + +.icon-hospital { + .ie7icon(''); +} + + +.icon-ambulance { + .ie7icon(''); +} + + +.icon-medkit { + .ie7icon(''); +} + + +.icon-fighter-jet { + .ie7icon(''); +} + + +.icon-beer { + .ie7icon(''); +} + + +.icon-h-sign { + .ie7icon(''); +} + + +.icon-plus-sign-alt { + .ie7icon(''); +} + + +.icon-double-angle-left { + .ie7icon(''); +} + + +.icon-double-angle-right { + .ie7icon(''); +} + + +.icon-double-angle-up { + .ie7icon(''); +} + + +.icon-double-angle-down { + .ie7icon(''); +} + + +.icon-angle-left { + .ie7icon(''); +} + + +.icon-angle-right { + .ie7icon(''); +} + + +.icon-angle-up { + .ie7icon(''); +} + + +.icon-angle-down { + .ie7icon(''); +} + + +.icon-desktop { + .ie7icon(''); +} + + +.icon-laptop { + .ie7icon(''); +} + + +.icon-tablet { + .ie7icon(''); +} + + +.icon-mobile-phone { + .ie7icon(''); +} + + +.icon-circle-blank { + .ie7icon(''); +} + + +.icon-quote-left { + .ie7icon(''); +} + + +.icon-quote-right { + .ie7icon(''); +} + + +.icon-spinner { + .ie7icon(''); +} + + +.icon-circle { + .ie7icon(''); +} + + +.icon-reply { + .ie7icon(''); +} + +.icon-mail-reply { + .ie7icon(''); +} + + +.icon-github-alt { + .ie7icon(''); +} + + +.icon-folder-close-alt { + .ie7icon(''); +} + + +.icon-folder-open-alt { + .ie7icon(''); +} + + +.icon-expand-alt { + .ie7icon(''); +} + + +.icon-collapse-alt { + .ie7icon(''); +} + + +.icon-smile { + .ie7icon(''); +} + + +.icon-frown { + .ie7icon(''); +} + + +.icon-meh { + .ie7icon(''); +} + + +.icon-gamepad { + .ie7icon(''); +} + + +.icon-keyboard { + .ie7icon(''); +} + + +.icon-flag-alt { + .ie7icon(''); +} + + +.icon-flag-checkered { + .ie7icon(''); +} + + +.icon-terminal { + .ie7icon(''); +} + + +.icon-code { + .ie7icon(''); +} + + +.icon-reply-all { + .ie7icon(''); +} + + +.icon-mail-reply-all { + .ie7icon(''); +} + + +.icon-star-half-empty { + .ie7icon(''); +} + +.icon-star-half-full { + .ie7icon(''); +} + + +.icon-location-arrow { + .ie7icon(''); +} + + +.icon-crop { + .ie7icon(''); +} + + +.icon-code-fork { + .ie7icon(''); +} + + +.icon-unlink { + .ie7icon(''); +} + + +.icon-question { + .ie7icon(''); +} + + +.icon-info { + .ie7icon(''); +} + + +.icon-exclamation { + .ie7icon(''); +} + + +.icon-superscript { + .ie7icon(''); +} + + +.icon-subscript { + .ie7icon(''); +} + + +.icon-eraser { + .ie7icon(''); +} + + +.icon-puzzle-piece { + .ie7icon(''); +} + + +.icon-microphone { + .ie7icon(''); +} + + +.icon-microphone-off { + .ie7icon(''); +} + + +.icon-shield { + .ie7icon(''); +} + + +.icon-calendar-empty { + .ie7icon(''); +} + + +.icon-fire-extinguisher { + .ie7icon(''); +} + + +.icon-rocket { + .ie7icon(''); +} + + +.icon-maxcdn { + .ie7icon(''); +} + + +.icon-chevron-sign-left { + .ie7icon(''); +} + + +.icon-chevron-sign-right { + .ie7icon(''); +} + + +.icon-chevron-sign-up { + .ie7icon(''); +} + + +.icon-chevron-sign-down { + .ie7icon(''); +} + + +.icon-html5 { + .ie7icon(''); +} + + +.icon-css3 { + .ie7icon(''); +} + + +.icon-anchor { + .ie7icon(''); +} + + +.icon-unlock-alt { + .ie7icon(''); +} + + +.icon-bullseye { + .ie7icon(''); +} + + +.icon-ellipsis-horizontal { + .ie7icon(''); +} + + +.icon-ellipsis-vertical { + .ie7icon(''); +} + + +.icon-rss-sign { + .ie7icon(''); +} + + +.icon-play-sign { + .ie7icon(''); +} + + +.icon-ticket { + .ie7icon(''); +} + + +.icon-minus-sign-alt { + .ie7icon(''); +} + + +.icon-check-minus { + .ie7icon(''); +} + + +.icon-level-up { + .ie7icon(''); +} + + +.icon-level-down { + .ie7icon(''); +} + + +.icon-check-sign { + .ie7icon(''); +} + + +.icon-edit-sign { + .ie7icon(''); +} + + +.icon-external-link-sign { + .ie7icon(''); +} + + +.icon-share-sign { + .ie7icon(''); +} + + +.icon-compass { + .ie7icon(''); +} + + +.icon-collapse { + .ie7icon(''); +} + + +.icon-collapse-top { + .ie7icon(''); +} + + +.icon-expand { + .ie7icon(''); +} + + +.icon-eur { + .ie7icon(''); +} + +.icon-euro { + .ie7icon(''); +} + + +.icon-gbp { + .ie7icon(''); +} + + +.icon-usd { + .ie7icon(''); +} + +.icon-dollar { + .ie7icon(''); +} + + +.icon-inr { + .ie7icon(''); +} + +.icon-rupee { + .ie7icon(''); +} + + +.icon-jpy { + .ie7icon(''); +} + +.icon-yen { + .ie7icon(''); +} + + +.icon-cny { + .ie7icon(''); +} + +.icon-renminbi { + .ie7icon(''); +} + + +.icon-krw { + .ie7icon(''); +} + +.icon-won { + .ie7icon(''); +} + + +.icon-btc { + .ie7icon(''); +} + +.icon-bitcoin { + .ie7icon(''); +} + + +.icon-file { + .ie7icon(''); +} + + +.icon-file-text { + .ie7icon(''); +} + + +.icon-sort-by-alphabet { + .ie7icon(''); +} + + +.icon-sort-by-alphabet-alt { + .ie7icon(''); +} + + +.icon-sort-by-attributes { + .ie7icon(''); +} + + +.icon-sort-by-attributes-alt { + .ie7icon(''); +} + + +.icon-sort-by-order { + .ie7icon(''); +} + + +.icon-sort-by-order-alt { + .ie7icon(''); +} + + +.icon-thumbs-up { + .ie7icon(''); +} + + +.icon-thumbs-down { + .ie7icon(''); +} + + +.icon-youtube-sign { + .ie7icon(''); +} + + +.icon-youtube { + .ie7icon(''); +} + + +.icon-xing { + .ie7icon(''); +} + + +.icon-xing-sign { + .ie7icon(''); +} + + +.icon-youtube-play { + .ie7icon(''); +} + + +.icon-dropbox { + .ie7icon(''); +} + + +.icon-stackexchange { + .ie7icon(''); +} + + +.icon-instagram { + .ie7icon(''); +} + + +.icon-flickr { + .ie7icon(''); +} + + +.icon-adn { + .ie7icon(''); +} + + +.icon-bitbucket { + .ie7icon(''); +} + + +.icon-bitbucket-sign { + .ie7icon(''); +} + + +.icon-tumblr { + .ie7icon(''); +} + + +.icon-tumblr-sign { + .ie7icon(''); +} + + +.icon-long-arrow-down { + .ie7icon(''); +} + + +.icon-long-arrow-up { + .ie7icon(''); +} + + +.icon-long-arrow-left { + .ie7icon(''); +} + + +.icon-long-arrow-right { + .ie7icon(''); +} + + +.icon-apple { + .ie7icon(''); +} + + +.icon-windows { + .ie7icon(''); +} + + +.icon-android { + .ie7icon(''); +} + + +.icon-linux { + .ie7icon(''); +} + + +.icon-dribbble { + .ie7icon(''); +} + + +.icon-skype { + .ie7icon(''); +} + + +.icon-foursquare { + .ie7icon(''); +} + + +.icon-trello { + .ie7icon(''); +} + + +.icon-female { + .ie7icon(''); +} + + +.icon-male { + .ie7icon(''); +} + + +.icon-gittip { + .ie7icon(''); +} + + +.icon-sun { + .ie7icon(''); +} + + +.icon-moon { + .ie7icon(''); +} + + +.icon-archive { + .ie7icon(''); +} + + +.icon-bug { + .ie7icon(''); +} + + +.icon-vk { + .ie7icon(''); +} + + +.icon-weibo { + .ie7icon(''); +} + + +.icon-renren { + .ie7icon(''); +} + + diff --git a/stylesheets/font-awesome/less/font-awesome.less b/stylesheets/font-awesome/less/font-awesome.less new file mode 100644 index 00000000..0f454612 --- /dev/null +++ b/stylesheets/font-awesome/less/font-awesome.less @@ -0,0 +1,33 @@ +/*! + * Font Awesome 3.2.1 + * the iconic font designed for Bootstrap + * ------------------------------------------------------------------------------ + * The full suite of pictographic icons, examples, and documentation can be + * found at http://fontawesome.io. Stay up to date on Twitter at + * http://twitter.com/fontawesome. + * + * License + * ------------------------------------------------------------------------------ + * - The Font Awesome font is licensed under SIL OFL 1.1 - + * http://scripts.sil.org/OFL + * - Font Awesome CSS, LESS, and SASS files are licensed under MIT License - + * http://opensource.org/licenses/mit-license.html + * - Font Awesome documentation licensed under CC BY 3.0 - + * http://creativecommons.org/licenses/by/3.0/ + * - Attribution is no longer required in Font Awesome 3.0, but much appreciated: + * "Font Awesome by Dave Gandy - http://fontawesome.io" + * + * Author - Dave Gandy + * ------------------------------------------------------------------------------ + * Email: dave@fontawesome.io + * Twitter: http://twitter.com/davegandy + * Work: Lead Product Designer @ Kyruus - http://kyruus.com + */ + +@import "variables.less"; +@import "mixins.less"; +@import "path.less"; +@import "core.less"; +@import "bootstrap.less"; +@import "extras.less"; +@import "icons.less"; diff --git a/stylesheets/font-awesome/less/icons.less b/stylesheets/font-awesome/less/icons.less new file mode 100644 index 00000000..476d201e --- /dev/null +++ b/stylesheets/font-awesome/less/icons.less @@ -0,0 +1,381 @@ +/* Font Awesome uses the Unicode Private Use Area (PUA) to ensure screen + readers do not read off random characters that represent icons */ + +.icon-glass:before { content: @glass; } +.icon-music:before { content: @music; } +.icon-search:before { content: @search; } +.icon-envelope-alt:before { content: @envelope-alt; } +.icon-heart:before { content: @heart; } +.icon-star:before { content: @star; } +.icon-star-empty:before { content: @star-empty; } +.icon-user:before { content: @user; } +.icon-film:before { content: @film; } +.icon-th-large:before { content: @th-large; } +.icon-th:before { content: @th; } +.icon-th-list:before { content: @th-list; } +.icon-ok:before { content: @ok; } +.icon-remove:before { content: @remove; } +.icon-zoom-in:before { content: @zoom-in; } +.icon-zoom-out:before { content: @zoom-out; } +.icon-power-off:before, +.icon-off:before { content: @off; } +.icon-signal:before { content: @signal; } +.icon-gear:before, +.icon-cog:before { content: @cog; } +.icon-trash:before { content: @trash; } +.icon-home:before { content: @home; } +.icon-file-alt:before { content: @file-alt; } +.icon-time:before { content: @time; } +.icon-road:before { content: @road; } +.icon-download-alt:before { content: @download-alt; } +.icon-download:before { content: @download; } +.icon-upload:before { content: @upload; } +.icon-inbox:before { content: @inbox; } +.icon-play-circle:before { content: @play-circle; } +.icon-rotate-right:before, +.icon-repeat:before { content: @repeat; } +.icon-refresh:before { content: @refresh; } +.icon-list-alt:before { content: @list-alt; } +.icon-lock:before { content: @lock; } +.icon-flag:before { content: @flag; } +.icon-headphones:before { content: @headphones; } +.icon-volume-off:before { content: @volume-off; } +.icon-volume-down:before { content: @volume-down; } +.icon-volume-up:before { content: @volume-up; } +.icon-qrcode:before { content: @qrcode; } +.icon-barcode:before { content: @barcode; } +.icon-tag:before { content: @tag; } +.icon-tags:before { content: @tags; } +.icon-book:before { content: @book; } +.icon-bookmark:before { content: @bookmark; } +.icon-print:before { content: @print; } +.icon-camera:before { content: @camera; } +.icon-font:before { content: @font; } +.icon-bold:before { content: @bold; } +.icon-italic:before { content: @italic; } +.icon-text-height:before { content: @text-height; } +.icon-text-width:before { content: @text-width; } +.icon-align-left:before { content: @align-left; } +.icon-align-center:before { content: @align-center; } +.icon-align-right:before { content: @align-right; } +.icon-align-justify:before { content: @align-justify; } +.icon-list:before { content: @list; } +.icon-indent-left:before { content: @indent-left; } +.icon-indent-right:before { content: @indent-right; } +.icon-facetime-video:before { content: @facetime-video; } +.icon-picture:before { content: @picture; } +.icon-pencil:before { content: @pencil; } +.icon-map-marker:before { content: @map-marker; } +.icon-adjust:before { content: @adjust; } +.icon-tint:before { content: @tint; } +.icon-edit:before { content: @edit; } +.icon-share:before { content: @share; } +.icon-check:before { content: @check; } +.icon-move:before { content: @move; } +.icon-step-backward:before { content: @step-backward; } +.icon-fast-backward:before { content: @fast-backward; } +.icon-backward:before { content: @backward; } +.icon-play:before { content: @play; } +.icon-pause:before { content: @pause; } +.icon-stop:before { content: @stop; } +.icon-forward:before { content: @forward; } +.icon-fast-forward:before { content: @fast-forward; } +.icon-step-forward:before { content: @step-forward; } +.icon-eject:before { content: @eject; } +.icon-chevron-left:before { content: @chevron-left; } +.icon-chevron-right:before { content: @chevron-right; } +.icon-plus-sign:before { content: @plus-sign; } +.icon-minus-sign:before { content: @minus-sign; } +.icon-remove-sign:before { content: @remove-sign; } +.icon-ok-sign:before { content: @ok-sign; } +.icon-question-sign:before { content: @question-sign; } +.icon-info-sign:before { content: @info-sign; } +.icon-screenshot:before { content: @screenshot; } +.icon-remove-circle:before { content: @remove-circle; } +.icon-ok-circle:before { content: @ok-circle; } +.icon-ban-circle:before { content: @ban-circle; } +.icon-arrow-left:before { content: @arrow-left; } +.icon-arrow-right:before { content: @arrow-right; } +.icon-arrow-up:before { content: @arrow-up; } +.icon-arrow-down:before { content: @arrow-down; } +.icon-mail-forward:before, +.icon-share-alt:before { content: @share-alt; } +.icon-resize-full:before { content: @resize-full; } +.icon-resize-small:before { content: @resize-small; } +.icon-plus:before { content: @plus; } +.icon-minus:before { content: @minus; } +.icon-asterisk:before { content: @asterisk; } +.icon-exclamation-sign:before { content: @exclamation-sign; } +.icon-gift:before { content: @gift; } +.icon-leaf:before { content: @leaf; } +.icon-fire:before { content: @fire; } +.icon-eye-open:before { content: @eye-open; } +.icon-eye-close:before { content: @eye-close; } +.icon-warning-sign:before { content: @warning-sign; } +.icon-plane:before { content: @plane; } +.icon-calendar:before { content: @calendar; } +.icon-random:before { content: @random; } +.icon-comment:before { content: @comment; } +.icon-magnet:before { content: @magnet; } +.icon-chevron-up:before { content: @chevron-up; } +.icon-chevron-down:before { content: @chevron-down; } +.icon-retweet:before { content: @retweet; } +.icon-shopping-cart:before { content: @shopping-cart; } +.icon-folder-close:before { content: @folder-close; } +.icon-folder-open:before { content: @folder-open; } +.icon-resize-vertical:before { content: @resize-vertical; } +.icon-resize-horizontal:before { content: @resize-horizontal; } +.icon-bar-chart:before { content: @bar-chart; } +.icon-twitter-sign:before { content: @twitter-sign; } +.icon-facebook-sign:before { content: @facebook-sign; } +.icon-camera-retro:before { content: @camera-retro; } +.icon-key:before { content: @key; } +.icon-gears:before, +.icon-cogs:before { content: @cogs; } +.icon-comments:before { content: @comments; } +.icon-thumbs-up-alt:before { content: @thumbs-up-alt; } +.icon-thumbs-down-alt:before { content: @thumbs-down-alt; } +.icon-star-half:before { content: @star-half; } +.icon-heart-empty:before { content: @heart-empty; } +.icon-signout:before { content: @signout; } +.icon-linkedin-sign:before { content: @linkedin-sign; } +.icon-pushpin:before { content: @pushpin; } +.icon-external-link:before { content: @external-link; } +.icon-signin:before { content: @signin; } +.icon-trophy:before { content: @trophy; } +.icon-github-sign:before { content: @github-sign; } +.icon-upload-alt:before { content: @upload-alt; } +.icon-lemon:before { content: @lemon; } +.icon-phone:before { content: @phone; } +.icon-unchecked:before, +.icon-check-empty:before { content: @check-empty; } +.icon-bookmark-empty:before { content: @bookmark-empty; } +.icon-phone-sign:before { content: @phone-sign; } +.icon-twitter:before { content: @twitter; } +.icon-facebook:before { content: @facebook; } +.icon-github:before { content: @github; } +.icon-unlock:before { content: @unlock; } +.icon-credit-card:before { content: @credit-card; } +.icon-rss:before { content: @rss; } +.icon-hdd:before { content: @hdd; } +.icon-bullhorn:before { content: @bullhorn; } +.icon-bell:before { content: @bell; } +.icon-certificate:before { content: @certificate; } +.icon-hand-right:before { content: @hand-right; } +.icon-hand-left:before { content: @hand-left; } +.icon-hand-up:before { content: @hand-up; } +.icon-hand-down:before { content: @hand-down; } +.icon-circle-arrow-left:before { content: @circle-arrow-left; } +.icon-circle-arrow-right:before { content: @circle-arrow-right; } +.icon-circle-arrow-up:before { content: @circle-arrow-up; } +.icon-circle-arrow-down:before { content: @circle-arrow-down; } +.icon-globe:before { content: @globe; } +.icon-wrench:before { content: @wrench; } +.icon-tasks:before { content: @tasks; } +.icon-filter:before { content: @filter; } +.icon-briefcase:before { content: @briefcase; } +.icon-fullscreen:before { content: @fullscreen; } +.icon-group:before { content: @group; } +.icon-link:before { content: @link; } +.icon-cloud:before { content: @cloud; } +.icon-beaker:before { content: @beaker; } +.icon-cut:before { content: @cut; } +.icon-copy:before { content: @copy; } +.icon-paperclip:before, +.icon-paper-clip:before { content: @paper-clip; } +.icon-save:before { content: @save; } +.icon-sign-blank:before { content: @sign-blank; } +.icon-reorder:before { content: @reorder; } +.icon-list-ul:before { content: @list-ul; } +.icon-list-ol:before { content: @list-ol; } +.icon-strikethrough:before { content: @strikethrough; } +.icon-underline:before { content: @underline; } +.icon-table:before { content: @table; } +.icon-magic:before { content: @magic; } +.icon-truck:before { content: @truck; } +.icon-pinterest:before { content: @pinterest; } +.icon-pinterest-sign:before { content: @pinterest-sign; } +.icon-google-plus-sign:before { content: @google-plus-sign; } +.icon-google-plus:before { content: @google-plus; } +.icon-money:before { content: @money; } +.icon-caret-down:before { content: @caret-down; } +.icon-caret-up:before { content: @caret-up; } +.icon-caret-left:before { content: @caret-left; } +.icon-caret-right:before { content: @caret-right; } +.icon-columns:before { content: @columns; } +.icon-sort:before { content: @sort; } +.icon-sort-down:before { content: @sort-down; } +.icon-sort-up:before { content: @sort-up; } +.icon-envelope:before { content: @envelope; } +.icon-linkedin:before { content: @linkedin; } +.icon-rotate-left:before, +.icon-undo:before { content: @undo; } +.icon-legal:before { content: @legal; } +.icon-dashboard:before { content: @dashboard; } +.icon-comment-alt:before { content: @comment-alt; } +.icon-comments-alt:before { content: @comments-alt; } +.icon-bolt:before { content: @bolt; } +.icon-sitemap:before { content: @sitemap; } +.icon-umbrella:before { content: @umbrella; } +.icon-paste:before { content: @paste; } +.icon-lightbulb:before { content: @lightbulb; } +.icon-exchange:before { content: @exchange; } +.icon-cloud-download:before { content: @cloud-download; } +.icon-cloud-upload:before { content: @cloud-upload; } +.icon-user-md:before { content: @user-md; } +.icon-stethoscope:before { content: @stethoscope; } +.icon-suitcase:before { content: @suitcase; } +.icon-bell-alt:before { content: @bell-alt; } +.icon-coffee:before { content: @coffee; } +.icon-food:before { content: @food; } +.icon-file-text-alt:before { content: @file-text-alt; } +.icon-building:before { content: @building; } +.icon-hospital:before { content: @hospital; } +.icon-ambulance:before { content: @ambulance; } +.icon-medkit:before { content: @medkit; } +.icon-fighter-jet:before { content: @fighter-jet; } +.icon-beer:before { content: @beer; } +.icon-h-sign:before { content: @h-sign; } +.icon-plus-sign-alt:before { content: @plus-sign-alt; } +.icon-double-angle-left:before { content: @double-angle-left; } +.icon-double-angle-right:before { content: @double-angle-right; } +.icon-double-angle-up:before { content: @double-angle-up; } +.icon-double-angle-down:before { content: @double-angle-down; } +.icon-angle-left:before { content: @angle-left; } +.icon-angle-right:before { content: @angle-right; } +.icon-angle-up:before { content: @angle-up; } +.icon-angle-down:before { content: @angle-down; } +.icon-desktop:before { content: @desktop; } +.icon-laptop:before { content: @laptop; } +.icon-tablet:before { content: @tablet; } +.icon-mobile-phone:before { content: @mobile-phone; } +.icon-circle-blank:before { content: @circle-blank; } +.icon-quote-left:before { content: @quote-left; } +.icon-quote-right:before { content: @quote-right; } +.icon-spinner:before { content: @spinner; } +.icon-circle:before { content: @circle; } +.icon-mail-reply:before, +.icon-reply:before { content: @reply; } +.icon-github-alt:before { content: @github-alt; } +.icon-folder-close-alt:before { content: @folder-close-alt; } +.icon-folder-open-alt:before { content: @folder-open-alt; } +.icon-expand-alt:before { content: @expand-alt; } +.icon-collapse-alt:before { content: @collapse-alt; } +.icon-smile:before { content: @smile; } +.icon-frown:before { content: @frown; } +.icon-meh:before { content: @meh; } +.icon-gamepad:before { content: @gamepad; } +.icon-keyboard:before { content: @keyboard; } +.icon-flag-alt:before { content: @flag-alt; } +.icon-flag-checkered:before { content: @flag-checkered; } +.icon-terminal:before { content: @terminal; } +.icon-code:before { content: @code; } +.icon-reply-all:before { content: @reply-all; } +.icon-mail-reply-all:before { content: @mail-reply-all; } +.icon-star-half-full:before, +.icon-star-half-empty:before { content: @star-half-empty; } +.icon-location-arrow:before { content: @location-arrow; } +.icon-crop:before { content: @crop; } +.icon-code-fork:before { content: @code-fork; } +.icon-unlink:before { content: @unlink; } +.icon-question:before { content: @question; } +.icon-info:before { content: @info; } +.icon-exclamation:before { content: @exclamation; } +.icon-superscript:before { content: @superscript; } +.icon-subscript:before { content: @subscript; } +.icon-eraser:before { content: @eraser; } +.icon-puzzle-piece:before { content: @puzzle-piece; } +.icon-microphone:before { content: @microphone; } +.icon-microphone-off:before { content: @microphone-off; } +.icon-shield:before { content: @shield; } +.icon-calendar-empty:before { content: @calendar-empty; } +.icon-fire-extinguisher:before { content: @fire-extinguisher; } +.icon-rocket:before { content: @rocket; } +.icon-maxcdn:before { content: @maxcdn; } +.icon-chevron-sign-left:before { content: @chevron-sign-left; } +.icon-chevron-sign-right:before { content: @chevron-sign-right; } +.icon-chevron-sign-up:before { content: @chevron-sign-up; } +.icon-chevron-sign-down:before { content: @chevron-sign-down; } +.icon-html5:before { content: @html5; } +.icon-css3:before { content: @css3; } +.icon-anchor:before { content: @anchor; } +.icon-unlock-alt:before { content: @unlock-alt; } +.icon-bullseye:before { content: @bullseye; } +.icon-ellipsis-horizontal:before { content: @ellipsis-horizontal; } +.icon-ellipsis-vertical:before { content: @ellipsis-vertical; } +.icon-rss-sign:before { content: @rss-sign; } +.icon-play-sign:before { content: @play-sign; } +.icon-ticket:before { content: @ticket; } +.icon-minus-sign-alt:before { content: @minus-sign-alt; } +.icon-check-minus:before { content: @check-minus; } +.icon-level-up:before { content: @level-up; } +.icon-level-down:before { content: @level-down; } +.icon-check-sign:before { content: @check-sign; } +.icon-edit-sign:before { content: @edit-sign; } +.icon-external-link-sign:before { content: @external-link-sign; } +.icon-share-sign:before { content: @share-sign; } +.icon-compass:before { content: @compass; } +.icon-collapse:before { content: @collapse; } +.icon-collapse-top:before { content: @collapse-top; } +.icon-expand:before { content: @expand; } +.icon-euro:before, +.icon-eur:before { content: @eur; } +.icon-gbp:before { content: @gbp; } +.icon-dollar:before, +.icon-usd:before { content: @usd; } +.icon-rupee:before, +.icon-inr:before { content: @inr; } +.icon-yen:before, +.icon-jpy:before { content: @jpy; } +.icon-renminbi:before, +.icon-cny:before { content: @cny; } +.icon-won:before, +.icon-krw:before { content: @krw; } +.icon-bitcoin:before, +.icon-btc:before { content: @btc; } +.icon-file:before { content: @file; } +.icon-file-text:before { content: @file-text; } +.icon-sort-by-alphabet:before { content: @sort-by-alphabet; } +.icon-sort-by-alphabet-alt:before { content: @sort-by-alphabet-alt; } +.icon-sort-by-attributes:before { content: @sort-by-attributes; } +.icon-sort-by-attributes-alt:before { content: @sort-by-attributes-alt; } +.icon-sort-by-order:before { content: @sort-by-order; } +.icon-sort-by-order-alt:before { content: @sort-by-order-alt; } +.icon-thumbs-up:before { content: @thumbs-up; } +.icon-thumbs-down:before { content: @thumbs-down; } +.icon-youtube-sign:before { content: @youtube-sign; } +.icon-youtube:before { content: @youtube; } +.icon-xing:before { content: @xing; } +.icon-xing-sign:before { content: @xing-sign; } +.icon-youtube-play:before { content: @youtube-play; } +.icon-dropbox:before { content: @dropbox; } +.icon-stackexchange:before { content: @stackexchange; } +.icon-instagram:before { content: @instagram; } +.icon-flickr:before { content: @flickr; } +.icon-adn:before { content: @adn; } +.icon-bitbucket:before { content: @bitbucket; } +.icon-bitbucket-sign:before { content: @bitbucket-sign; } +.icon-tumblr:before { content: @tumblr; } +.icon-tumblr-sign:before { content: @tumblr-sign; } +.icon-long-arrow-down:before { content: @long-arrow-down; } +.icon-long-arrow-up:before { content: @long-arrow-up; } +.icon-long-arrow-left:before { content: @long-arrow-left; } +.icon-long-arrow-right:before { content: @long-arrow-right; } +.icon-apple:before { content: @apple; } +.icon-windows:before { content: @windows; } +.icon-android:before { content: @android; } +.icon-linux:before { content: @linux; } +.icon-dribbble:before { content: @dribbble; } +.icon-skype:before { content: @skype; } +.icon-foursquare:before { content: @foursquare; } +.icon-trello:before { content: @trello; } +.icon-female:before { content: @female; } +.icon-male:before { content: @male; } +.icon-gittip:before { content: @gittip; } +.icon-sun:before { content: @sun; } +.icon-moon:before { content: @moon; } +.icon-archive:before { content: @archive; } +.icon-bug:before { content: @bug; } +.icon-vk:before { content: @vk; } +.icon-weibo:before { content: @weibo; } +.icon-renren:before { content: @renren; } diff --git a/stylesheets/font-awesome/less/mixins.less b/stylesheets/font-awesome/less/mixins.less new file mode 100644 index 00000000..f7fdda59 --- /dev/null +++ b/stylesheets/font-awesome/less/mixins.less @@ -0,0 +1,48 @@ +// Mixins +// -------------------------- + +.icon(@icon) { + .icon-FontAwesome(); + content: @icon; +} + +.icon-FontAwesome() { + font-family: FontAwesome; + font-weight: normal; + font-style: normal; + text-decoration: inherit; + -webkit-font-smoothing: antialiased; + *margin-right: .3em; // fixes ie7 issues +} + +.border-radius(@radius) { + -webkit-border-radius: @radius; + -moz-border-radius: @radius; + border-radius: @radius; +} + +.icon-stack(@width: 2em, @height: 2em, @top-font-size: 1em, @base-font-size: 2em) { + .icon-stack { + position: relative; + display: inline-block; + width: @width; + height: @height; + line-height: @width; + vertical-align: -35%; + [class^="icon-"], + [class*=" icon-"] { + display: block; + text-align: center; + position: absolute; + width: 100%; + height: 100%; + font-size: @top-font-size; + line-height: inherit; + *line-height: @height; + } + .icon-stack-base { + font-size: @base-font-size; + *line-height: @height / @base-font-size; + } + } +} diff --git a/stylesheets/font-awesome/less/path.less b/stylesheets/font-awesome/less/path.less new file mode 100644 index 00000000..8ccef8cf --- /dev/null +++ b/stylesheets/font-awesome/less/path.less @@ -0,0 +1,14 @@ +/* FONT PATH + * -------------------------- */ + +@font-face { + font-family: 'FontAwesome'; + src: url('@{FontAwesomePath}/fontawesome-webfont.eot?v=@{FontAwesomeVersion}'); + src: url('@{FontAwesomePath}/fontawesome-webfont.eot?#iefix&v=@{FontAwesomeVersion}') format('embedded-opentype'), + url('@{FontAwesomePath}/fontawesome-webfont.woff?v=@{FontAwesomeVersion}') format('woff'), + url('@{FontAwesomePath}/fontawesome-webfont.ttf?v=@{FontAwesomeVersion}') format('truetype'), + url('@{FontAwesomePath}/fontawesome-webfont.svg#fontawesomeregular?v=@{FontAwesomeVersion}') format('svg'); +// src: url('@{FontAwesomePath}/FontAwesome.otf') format('opentype'); // used when developing fonts + font-weight: normal; + font-style: normal; +} diff --git a/stylesheets/font-awesome/less/variables.less b/stylesheets/font-awesome/less/variables.less new file mode 100644 index 00000000..9d0879b0 --- /dev/null +++ b/stylesheets/font-awesome/less/variables.less @@ -0,0 +1,735 @@ +// Variables +// -------------------------- + +@FontAwesomePath: "../font"; +//@FontAwesomePath: "//netdna.bootstrapcdn.com/font-awesome/3.2.1/font"; // for referencing Bootstrap CDN font files directly +@FontAwesomeVersion: "3.2.1"; +@borderColor: #eee; +@iconMuted: #eee; +@iconLight: #fff; +@iconDark: #333; +@icons-li-width: 30/14em; + + + @glass: "\f000"; + + @music: "\f001"; + + @search: "\f002"; + + @envelope-alt: "\f003"; + + @heart: "\f004"; + + @star: "\f005"; + + @star-empty: "\f006"; + + @user: "\f007"; + + @film: "\f008"; + + @th-large: "\f009"; + + @th: "\f00a"; + + @th-list: "\f00b"; + + @ok: "\f00c"; + + @remove: "\f00d"; + + @zoom-in: "\f00e"; + + @zoom-out: "\f010"; + + @off: "\f011"; + + @signal: "\f012"; + + @cog: "\f013"; + + @trash: "\f014"; + + @home: "\f015"; + + @file-alt: "\f016"; + + @time: "\f017"; + + @road: "\f018"; + + @download-alt: "\f019"; + + @download: "\f01a"; + + @upload: "\f01b"; + + @inbox: "\f01c"; + + @play-circle: "\f01d"; + + @repeat: "\f01e"; + + @refresh: "\f021"; + + @list-alt: "\f022"; + + @lock: "\f023"; + + @flag: "\f024"; + + @headphones: "\f025"; + + @volume-off: "\f026"; + + @volume-down: "\f027"; + + @volume-up: "\f028"; + + @qrcode: "\f029"; + + @barcode: "\f02a"; + + @tag: "\f02b"; + + @tags: "\f02c"; + + @book: "\f02d"; + + @bookmark: "\f02e"; + + @print: "\f02f"; + + @camera: "\f030"; + + @font: "\f031"; + + @bold: "\f032"; + + @italic: "\f033"; + + @text-height: "\f034"; + + @text-width: "\f035"; + + @align-left: "\f036"; + + @align-center: "\f037"; + + @align-right: "\f038"; + + @align-justify: "\f039"; + + @list: "\f03a"; + + @indent-left: "\f03b"; + + @indent-right: "\f03c"; + + @facetime-video: "\f03d"; + + @picture: "\f03e"; + + @pencil: "\f040"; + + @map-marker: "\f041"; + + @adjust: "\f042"; + + @tint: "\f043"; + + @edit: "\f044"; + + @share: "\f045"; + + @check: "\f046"; + + @move: "\f047"; + + @step-backward: "\f048"; + + @fast-backward: "\f049"; + + @backward: "\f04a"; + + @play: "\f04b"; + + @pause: "\f04c"; + + @stop: "\f04d"; + + @forward: "\f04e"; + + @fast-forward: "\f050"; + + @step-forward: "\f051"; + + @eject: "\f052"; + + @chevron-left: "\f053"; + + @chevron-right: "\f054"; + + @plus-sign: "\f055"; + + @minus-sign: "\f056"; + + @remove-sign: "\f057"; + + @ok-sign: "\f058"; + + @question-sign: "\f059"; + + @info-sign: "\f05a"; + + @screenshot: "\f05b"; + + @remove-circle: "\f05c"; + + @ok-circle: "\f05d"; + + @ban-circle: "\f05e"; + + @arrow-left: "\f060"; + + @arrow-right: "\f061"; + + @arrow-up: "\f062"; + + @arrow-down: "\f063"; + + @share-alt: "\f064"; + + @resize-full: "\f065"; + + @resize-small: "\f066"; + + @plus: "\f067"; + + @minus: "\f068"; + + @asterisk: "\f069"; + + @exclamation-sign: "\f06a"; + + @gift: "\f06b"; + + @leaf: "\f06c"; + + @fire: "\f06d"; + + @eye-open: "\f06e"; + + @eye-close: "\f070"; + + @warning-sign: "\f071"; + + @plane: "\f072"; + + @calendar: "\f073"; + + @random: "\f074"; + + @comment: "\f075"; + + @magnet: "\f076"; + + @chevron-up: "\f077"; + + @chevron-down: "\f078"; + + @retweet: "\f079"; + + @shopping-cart: "\f07a"; + + @folder-close: "\f07b"; + + @folder-open: "\f07c"; + + @resize-vertical: "\f07d"; + + @resize-horizontal: "\f07e"; + + @bar-chart: "\f080"; + + @twitter-sign: "\f081"; + + @facebook-sign: "\f082"; + + @camera-retro: "\f083"; + + @key: "\f084"; + + @cogs: "\f085"; + + @comments: "\f086"; + + @thumbs-up-alt: "\f087"; + + @thumbs-down-alt: "\f088"; + + @star-half: "\f089"; + + @heart-empty: "\f08a"; + + @signout: "\f08b"; + + @linkedin-sign: "\f08c"; + + @pushpin: "\f08d"; + + @external-link: "\f08e"; + + @signin: "\f090"; + + @trophy: "\f091"; + + @github-sign: "\f092"; + + @upload-alt: "\f093"; + + @lemon: "\f094"; + + @phone: "\f095"; + + @check-empty: "\f096"; + + @bookmark-empty: "\f097"; + + @phone-sign: "\f098"; + + @twitter: "\f099"; + + @facebook: "\f09a"; + + @github: "\f09b"; + + @unlock: "\f09c"; + + @credit-card: "\f09d"; + + @rss: "\f09e"; + + @hdd: "\f0a0"; + + @bullhorn: "\f0a1"; + + @bell: "\f0a2"; + + @certificate: "\f0a3"; + + @hand-right: "\f0a4"; + + @hand-left: "\f0a5"; + + @hand-up: "\f0a6"; + + @hand-down: "\f0a7"; + + @circle-arrow-left: "\f0a8"; + + @circle-arrow-right: "\f0a9"; + + @circle-arrow-up: "\f0aa"; + + @circle-arrow-down: "\f0ab"; + + @globe: "\f0ac"; + + @wrench: "\f0ad"; + + @tasks: "\f0ae"; + + @filter: "\f0b0"; + + @briefcase: "\f0b1"; + + @fullscreen: "\f0b2"; + + @group: "\f0c0"; + + @link: "\f0c1"; + + @cloud: "\f0c2"; + + @beaker: "\f0c3"; + + @cut: "\f0c4"; + + @copy: "\f0c5"; + + @paper-clip: "\f0c6"; + + @save: "\f0c7"; + + @sign-blank: "\f0c8"; + + @reorder: "\f0c9"; + + @list-ul: "\f0ca"; + + @list-ol: "\f0cb"; + + @strikethrough: "\f0cc"; + + @underline: "\f0cd"; + + @table: "\f0ce"; + + @magic: "\f0d0"; + + @truck: "\f0d1"; + + @pinterest: "\f0d2"; + + @pinterest-sign: "\f0d3"; + + @google-plus-sign: "\f0d4"; + + @google-plus: "\f0d5"; + + @money: "\f0d6"; + + @caret-down: "\f0d7"; + + @caret-up: "\f0d8"; + + @caret-left: "\f0d9"; + + @caret-right: "\f0da"; + + @columns: "\f0db"; + + @sort: "\f0dc"; + + @sort-down: "\f0dd"; + + @sort-up: "\f0de"; + + @envelope: "\f0e0"; + + @linkedin: "\f0e1"; + + @undo: "\f0e2"; + + @legal: "\f0e3"; + + @dashboard: "\f0e4"; + + @comment-alt: "\f0e5"; + + @comments-alt: "\f0e6"; + + @bolt: "\f0e7"; + + @sitemap: "\f0e8"; + + @umbrella: "\f0e9"; + + @paste: "\f0ea"; + + @lightbulb: "\f0eb"; + + @exchange: "\f0ec"; + + @cloud-download: "\f0ed"; + + @cloud-upload: "\f0ee"; + + @user-md: "\f0f0"; + + @stethoscope: "\f0f1"; + + @suitcase: "\f0f2"; + + @bell-alt: "\f0f3"; + + @coffee: "\f0f4"; + + @food: "\f0f5"; + + @file-text-alt: "\f0f6"; + + @building: "\f0f7"; + + @hospital: "\f0f8"; + + @ambulance: "\f0f9"; + + @medkit: "\f0fa"; + + @fighter-jet: "\f0fb"; + + @beer: "\f0fc"; + + @h-sign: "\f0fd"; + + @plus-sign-alt: "\f0fe"; + + @double-angle-left: "\f100"; + + @double-angle-right: "\f101"; + + @double-angle-up: "\f102"; + + @double-angle-down: "\f103"; + + @angle-left: "\f104"; + + @angle-right: "\f105"; + + @angle-up: "\f106"; + + @angle-down: "\f107"; + + @desktop: "\f108"; + + @laptop: "\f109"; + + @tablet: "\f10a"; + + @mobile-phone: "\f10b"; + + @circle-blank: "\f10c"; + + @quote-left: "\f10d"; + + @quote-right: "\f10e"; + + @spinner: "\f110"; + + @circle: "\f111"; + + @reply: "\f112"; + + @github-alt: "\f113"; + + @folder-close-alt: "\f114"; + + @folder-open-alt: "\f115"; + + @expand-alt: "\f116"; + + @collapse-alt: "\f117"; + + @smile: "\f118"; + + @frown: "\f119"; + + @meh: "\f11a"; + + @gamepad: "\f11b"; + + @keyboard: "\f11c"; + + @flag-alt: "\f11d"; + + @flag-checkered: "\f11e"; + + @terminal: "\f120"; + + @code: "\f121"; + + @reply-all: "\f122"; + + @mail-reply-all: "\f122"; + + @star-half-empty: "\f123"; + + @location-arrow: "\f124"; + + @crop: "\f125"; + + @code-fork: "\f126"; + + @unlink: "\f127"; + + @question: "\f128"; + + @info: "\f129"; + + @exclamation: "\f12a"; + + @superscript: "\f12b"; + + @subscript: "\f12c"; + + @eraser: "\f12d"; + + @puzzle-piece: "\f12e"; + + @microphone: "\f130"; + + @microphone-off: "\f131"; + + @shield: "\f132"; + + @calendar-empty: "\f133"; + + @fire-extinguisher: "\f134"; + + @rocket: "\f135"; + + @maxcdn: "\f136"; + + @chevron-sign-left: "\f137"; + + @chevron-sign-right: "\f138"; + + @chevron-sign-up: "\f139"; + + @chevron-sign-down: "\f13a"; + + @html5: "\f13b"; + + @css3: "\f13c"; + + @anchor: "\f13d"; + + @unlock-alt: "\f13e"; + + @bullseye: "\f140"; + + @ellipsis-horizontal: "\f141"; + + @ellipsis-vertical: "\f142"; + + @rss-sign: "\f143"; + + @play-sign: "\f144"; + + @ticket: "\f145"; + + @minus-sign-alt: "\f146"; + + @check-minus: "\f147"; + + @level-up: "\f148"; + + @level-down: "\f149"; + + @check-sign: "\f14a"; + + @edit-sign: "\f14b"; + + @external-link-sign: "\f14c"; + + @share-sign: "\f14d"; + + @compass: "\f14e"; + + @collapse: "\f150"; + + @collapse-top: "\f151"; + + @expand: "\f152"; + + @eur: "\f153"; + + @gbp: "\f154"; + + @usd: "\f155"; + + @inr: "\f156"; + + @jpy: "\f157"; + + @cny: "\f158"; + + @krw: "\f159"; + + @btc: "\f15a"; + + @file: "\f15b"; + + @file-text: "\f15c"; + + @sort-by-alphabet: "\f15d"; + + @sort-by-alphabet-alt: "\f15e"; + + @sort-by-attributes: "\f160"; + + @sort-by-attributes-alt: "\f161"; + + @sort-by-order: "\f162"; + + @sort-by-order-alt: "\f163"; + + @thumbs-up: "\f164"; + + @thumbs-down: "\f165"; + + @youtube-sign: "\f166"; + + @youtube: "\f167"; + + @xing: "\f168"; + + @xing-sign: "\f169"; + + @youtube-play: "\f16a"; + + @dropbox: "\f16b"; + + @stackexchange: "\f16c"; + + @instagram: "\f16d"; + + @flickr: "\f16e"; + + @adn: "\f170"; + + @bitbucket: "\f171"; + + @bitbucket-sign: "\f172"; + + @tumblr: "\f173"; + + @tumblr-sign: "\f174"; + + @long-arrow-down: "\f175"; + + @long-arrow-up: "\f176"; + + @long-arrow-left: "\f177"; + + @long-arrow-right: "\f178"; + + @apple: "\f179"; + + @windows: "\f17a"; + + @android: "\f17b"; + + @linux: "\f17c"; + + @dribbble: "\f17d"; + + @skype: "\f17e"; + + @foursquare: "\f180"; + + @trello: "\f181"; + + @female: "\f182"; + + @male: "\f183"; + + @gittip: "\f184"; + + @sun: "\f185"; + + @moon: "\f186"; + + @archive: "\f187"; + + @bug: "\f188"; + + @vk: "\f189"; + + @weibo: "\f18a"; + + @renren: "\f18b"; + diff --git a/stylesheets/font-awesome/scss/_bootstrap.scss b/stylesheets/font-awesome/scss/_bootstrap.scss new file mode 100644 index 00000000..837d2df6 --- /dev/null +++ b/stylesheets/font-awesome/scss/_bootstrap.scss @@ -0,0 +1,84 @@ +/* BOOTSTRAP SPECIFIC CLASSES + * -------------------------- */ + +/* Bootstrap 2.0 sprites.less reset */ +[class^="icon-"], +[class*=" icon-"] { + display: inline; + width: auto; + height: auto; + line-height: normal; + vertical-align: baseline; + background-image: none; + background-position: 0% 0%; + background-repeat: repeat; + margin-top: 0; +} + +/* more sprites.less reset */ +.icon-white, +.nav-pills > .active > a > [class^="icon-"], +.nav-pills > .active > a > [class*=" icon-"], +.nav-list > .active > a > [class^="icon-"], +.nav-list > .active > a > [class*=" icon-"], +.navbar-inverse .nav > .active > a > [class^="icon-"], +.navbar-inverse .nav > .active > a > [class*=" icon-"], +.dropdown-menu > li > a:hover > [class^="icon-"], +.dropdown-menu > li > a:hover > [class*=" icon-"], +.dropdown-menu > .active > a > [class^="icon-"], +.dropdown-menu > .active > a > [class*=" icon-"], +.dropdown-submenu:hover > a > [class^="icon-"], +.dropdown-submenu:hover > a > [class*=" icon-"] { + background-image: none; +} + + +/* keeps Bootstrap styles with and without icons the same */ +.btn, .nav { + [class^="icon-"], + [class*=" icon-"] { + // display: inline; + &.icon-large { line-height: .9em; } + &.icon-spin { display: inline-block; } + } +} +.nav-tabs, .nav-pills { + [class^="icon-"], + [class*=" icon-"] { + &, &.icon-large { line-height: .9em; } + } +} +.btn { + [class^="icon-"], + [class*=" icon-"] { + &.pull-left, &.pull-right { + &.icon-2x { margin-top: .18em; } + } + &.icon-spin.icon-large { line-height: .8em; } + } +} +.btn.btn-small { + [class^="icon-"], + [class*=" icon-"] { + &.pull-left, &.pull-right { + &.icon-2x { margin-top: .25em; } + } + } +} +.btn.btn-large { + [class^="icon-"], + [class*=" icon-"] { + margin-top: 0; // overrides bootstrap default + &.pull-left, &.pull-right { + &.icon-2x { margin-top: .05em; } + } + &.pull-left.icon-2x { margin-right: .2em; } + &.pull-right.icon-2x { margin-left: .2em; } + } +} + +/* Fixes alignment in nav lists */ +.nav-list [class^="icon-"], +.nav-list [class*=" icon-"] { + line-height: inherit; +} diff --git a/stylesheets/font-awesome/scss/_core.scss b/stylesheets/font-awesome/scss/_core.scss new file mode 100644 index 00000000..0189c73d --- /dev/null +++ b/stylesheets/font-awesome/scss/_core.scss @@ -0,0 +1,129 @@ +/* FONT AWESOME CORE + * -------------------------- */ + +[class^="icon-"], +[class*=" icon-"] { + @include icon-FontAwesome(); +} + +[class^="icon-"]:before, +[class*=" icon-"]:before { + text-decoration: inherit; + display: inline-block; + speak: none; +} + +/* makes the font 33% larger relative to the icon container */ +.icon-large:before { + vertical-align: -10%; + font-size: (4em/3); +} + +/* makes sure icons active on rollover in links */ +a { + [class^="icon-"], + [class*=" icon-"] { + display: inline; + } +} + +/* increased font size for icon-large */ +[class^="icon-"], +[class*=" icon-"] { + &.icon-fixed-width { + display: inline-block; + width: (16em/14); + text-align: right; + padding-right: (4em/14); + &.icon-large { + width: (20em/14); + } + } +} + +.icons-ul { + margin-left: $icons-li-width; + list-style-type: none; + + > li { position: relative; } + + .icon-li { + position: absolute; + left: -$icons-li-width; + width: $icons-li-width; + text-align: center; + line-height: inherit; + } +} + +// allows usage of the hide class directly on font awesome icons +[class^="icon-"], +[class*=" icon-"] { + &.hide { + display: none; + } +} + +.icon-muted { color: $iconMuted; } +.icon-light { color: $iconLight; } +.icon-dark { color: $iconDark; } + +// Icon Borders +// ------------------------- + +.icon-border { + border: solid 1px $borderColor; + padding: .2em .25em .15em; + @include border-radius(3px); +} + +// Icon Sizes +// ------------------------- + +.icon-2x { + font-size: 2em; + &.icon-border { + border-width: 2px; + @include border-radius(4px); + } +} +.icon-3x { + font-size: 3em; + &.icon-border { + border-width: 3px; + @include border-radius(5px); + } +} +.icon-4x { + font-size: 4em; + &.icon-border { + border-width: 4px; + @include border-radius(6px); + } +} + +.icon-5x { + font-size: 5em; + &.icon-border { + border-width: 5px; + @include border-radius(7px); + } +} + + +// Floats & Margins +// ------------------------- + +// Quick floats +.pull-right { float: right; } +.pull-left { float: left; } + +[class^="icon-"], +[class*=" icon-"] { + &.pull-left { + margin-right: .3em; + } + &.pull-right { + margin-left: .3em; + } +} diff --git a/stylesheets/font-awesome/scss/_extras.scss b/stylesheets/font-awesome/scss/_extras.scss new file mode 100644 index 00000000..9a25845d --- /dev/null +++ b/stylesheets/font-awesome/scss/_extras.scss @@ -0,0 +1,93 @@ +/* EXTRAS + * -------------------------- */ + +/* Stacked and layered icon */ +@include icon-stack(); + +/* Animated rotating icon */ +.icon-spin { + display: inline-block; + -moz-animation: spin 2s infinite linear; + -o-animation: spin 2s infinite linear; + -webkit-animation: spin 2s infinite linear; + animation: spin 2s infinite linear; +} + +/* Prevent stack and spinners from being taken inline when inside a link */ +a .icon-stack, +a .icon-spin { + display: inline-block; + text-decoration: none; +} + +@-moz-keyframes spin { + 0% { -moz-transform: rotate(0deg); } + 100% { -moz-transform: rotate(359deg); } +} +@-webkit-keyframes spin { + 0% { -webkit-transform: rotate(0deg); } + 100% { -webkit-transform: rotate(359deg); } +} +@-o-keyframes spin { + 0% { -o-transform: rotate(0deg); } + 100% { -o-transform: rotate(359deg); } +} +@-ms-keyframes spin { + 0% { -ms-transform: rotate(0deg); } + 100% { -ms-transform: rotate(359deg); } +} +@keyframes spin { + 0% { transform: rotate(0deg); } + 100% { transform: rotate(359deg); } +} + +/* Icon rotations and mirroring */ +.icon-rotate-90:before { + -webkit-transform: rotate(90deg); + -moz-transform: rotate(90deg); + -ms-transform: rotate(90deg); + -o-transform: rotate(90deg); + transform: rotate(90deg); + filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=1); +} + +.icon-rotate-180:before { + -webkit-transform: rotate(180deg); + -moz-transform: rotate(180deg); + -ms-transform: rotate(180deg); + -o-transform: rotate(180deg); + transform: rotate(180deg); + filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=2); +} + +.icon-rotate-270:before { + -webkit-transform: rotate(270deg); + -moz-transform: rotate(270deg); + -ms-transform: rotate(270deg); + -o-transform: rotate(270deg); + transform: rotate(270deg); + filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=3); +} + +.icon-flip-horizontal:before { + -webkit-transform: scale(-1, 1); + -moz-transform: scale(-1, 1); + -ms-transform: scale(-1, 1); + -o-transform: scale(-1, 1); + transform: scale(-1, 1); +} + +.icon-flip-vertical:before { + -webkit-transform: scale(1, -1); + -moz-transform: scale(1, -1); + -ms-transform: scale(1, -1); + -o-transform: scale(1, -1); + transform: scale(1, -1); +} + +/* ensure rotation occurs inside anchor tags */ +a { + .icon-rotate-90, .icon-rotate-180, .icon-rotate-270, .icon-flip-horizontal, .icon-flip-vertical { + &:before { display: inline-block; } + } +} diff --git a/stylesheets/font-awesome/scss/_icons.scss b/stylesheets/font-awesome/scss/_icons.scss new file mode 100644 index 00000000..eefda0c9 --- /dev/null +++ b/stylesheets/font-awesome/scss/_icons.scss @@ -0,0 +1,381 @@ +/* Font Awesome uses the Unicode Private Use Area (PUA) to ensure screen + * readers do not read off random characters that represent icons */ + +.icon-glass:before { content: $glass; } +.icon-music:before { content: $music; } +.icon-search:before { content: $search; } +.icon-envelope-alt:before { content: $envelope-alt; } +.icon-heart:before { content: $heart; } +.icon-star:before { content: $star; } +.icon-star-empty:before { content: $star-empty; } +.icon-user:before { content: $user; } +.icon-film:before { content: $film; } +.icon-th-large:before { content: $th-large; } +.icon-th:before { content: $th; } +.icon-th-list:before { content: $th-list; } +.icon-ok:before { content: $ok; } +.icon-remove:before { content: $remove; } +.icon-zoom-in:before { content: $zoom-in; } +.icon-zoom-out:before { content: $zoom-out; } +.icon-power-off:before, +.icon-off:before { content: $off; } +.icon-signal:before { content: $signal; } +.icon-gear:before, +.icon-cog:before { content: $cog; } +.icon-trash:before { content: $trash; } +.icon-home:before { content: $home; } +.icon-file-alt:before { content: $file-alt; } +.icon-time:before { content: $time; } +.icon-road:before { content: $road; } +.icon-download-alt:before { content: $download-alt; } +.icon-download:before { content: $download; } +.icon-upload:before { content: $upload; } +.icon-inbox:before { content: $inbox; } +.icon-play-circle:before { content: $play-circle; } +.icon-rotate-right:before, +.icon-repeat:before { content: $repeat; } +.icon-refresh:before { content: $refresh; } +.icon-list-alt:before { content: $list-alt; } +.icon-lock:before { content: $lock; } +.icon-flag:before { content: $flag; } +.icon-headphones:before { content: $headphones; } +.icon-volume-off:before { content: $volume-off; } +.icon-volume-down:before { content: $volume-down; } +.icon-volume-up:before { content: $volume-up; } +.icon-qrcode:before { content: $qrcode; } +.icon-barcode:before { content: $barcode; } +.icon-tag:before { content: $tag; } +.icon-tags:before { content: $tags; } +.icon-book:before { content: $book; } +.icon-bookmark:before { content: $bookmark; } +.icon-print:before { content: $print; } +.icon-camera:before { content: $camera; } +.icon-font:before { content: $font; } +.icon-bold:before { content: $bold; } +.icon-italic:before { content: $italic; } +.icon-text-height:before { content: $text-height; } +.icon-text-width:before { content: $text-width; } +.icon-align-left:before { content: $align-left; } +.icon-align-center:before { content: $align-center; } +.icon-align-right:before { content: $align-right; } +.icon-align-justify:before { content: $align-justify; } +.icon-list:before { content: $list; } +.icon-indent-left:before { content: $indent-left; } +.icon-indent-right:before { content: $indent-right; } +.icon-facetime-video:before { content: $facetime-video; } +.icon-picture:before { content: $picture; } +.icon-pencil:before { content: $pencil; } +.icon-map-marker:before { content: $map-marker; } +.icon-adjust:before { content: $adjust; } +.icon-tint:before { content: $tint; } +.icon-edit:before { content: $edit; } +.icon-share:before { content: $share; } +.icon-check:before { content: $check; } +.icon-move:before { content: $move; } +.icon-step-backward:before { content: $step-backward; } +.icon-fast-backward:before { content: $fast-backward; } +.icon-backward:before { content: $backward; } +.icon-play:before { content: $play; } +.icon-pause:before { content: $pause; } +.icon-stop:before { content: $stop; } +.icon-forward:before { content: $forward; } +.icon-fast-forward:before { content: $fast-forward; } +.icon-step-forward:before { content: $step-forward; } +.icon-eject:before { content: $eject; } +.icon-chevron-left:before { content: $chevron-left; } +.icon-chevron-right:before { content: $chevron-right; } +.icon-plus-sign:before { content: $plus-sign; } +.icon-minus-sign:before { content: $minus-sign; } +.icon-remove-sign:before { content: $remove-sign; } +.icon-ok-sign:before { content: $ok-sign; } +.icon-question-sign:before { content: $question-sign; } +.icon-info-sign:before { content: $info-sign; } +.icon-screenshot:before { content: $screenshot; } +.icon-remove-circle:before { content: $remove-circle; } +.icon-ok-circle:before { content: $ok-circle; } +.icon-ban-circle:before { content: $ban-circle; } +.icon-arrow-left:before { content: $arrow-left; } +.icon-arrow-right:before { content: $arrow-right; } +.icon-arrow-up:before { content: $arrow-up; } +.icon-arrow-down:before { content: $arrow-down; } +.icon-mail-forward:before, +.icon-share-alt:before { content: $share-alt; } +.icon-resize-full:before { content: $resize-full; } +.icon-resize-small:before { content: $resize-small; } +.icon-plus:before { content: $plus; } +.icon-minus:before { content: $minus; } +.icon-asterisk:before { content: $asterisk; } +.icon-exclamation-sign:before { content: $exclamation-sign; } +.icon-gift:before { content: $gift; } +.icon-leaf:before { content: $leaf; } +.icon-fire:before { content: $fire; } +.icon-eye-open:before { content: $eye-open; } +.icon-eye-close:before { content: $eye-close; } +.icon-warning-sign:before { content: $warning-sign; } +.icon-plane:before { content: $plane; } +.icon-calendar:before { content: $calendar; } +.icon-random:before { content: $random; } +.icon-comment:before { content: $comment; } +.icon-magnet:before { content: $magnet; } +.icon-chevron-up:before { content: $chevron-up; } +.icon-chevron-down:before { content: $chevron-down; } +.icon-retweet:before { content: $retweet; } +.icon-shopping-cart:before { content: $shopping-cart; } +.icon-folder-close:before { content: $folder-close; } +.icon-folder-open:before { content: $folder-open; } +.icon-resize-vertical:before { content: $resize-vertical; } +.icon-resize-horizontal:before { content: $resize-horizontal; } +.icon-bar-chart:before { content: $bar-chart; } +.icon-twitter-sign:before { content: $twitter-sign; } +.icon-facebook-sign:before { content: $facebook-sign; } +.icon-camera-retro:before { content: $camera-retro; } +.icon-key:before { content: $key; } +.icon-gears:before, +.icon-cogs:before { content: $cogs; } +.icon-comments:before { content: $comments; } +.icon-thumbs-up-alt:before { content: $thumbs-up-alt; } +.icon-thumbs-down-alt:before { content: $thumbs-down-alt; } +.icon-star-half:before { content: $star-half; } +.icon-heart-empty:before { content: $heart-empty; } +.icon-signout:before { content: $signout; } +.icon-linkedin-sign:before { content: $linkedin-sign; } +.icon-pushpin:before { content: $pushpin; } +.icon-external-link:before { content: $external-link; } +.icon-signin:before { content: $signin; } +.icon-trophy:before { content: $trophy; } +.icon-github-sign:before { content: $github-sign; } +.icon-upload-alt:before { content: $upload-alt; } +.icon-lemon:before { content: $lemon; } +.icon-phone:before { content: $phone; } +.icon-unchecked:before, +.icon-check-empty:before { content: $check-empty; } +.icon-bookmark-empty:before { content: $bookmark-empty; } +.icon-phone-sign:before { content: $phone-sign; } +.icon-twitter:before { content: $twitter; } +.icon-facebook:before { content: $facebook; } +.icon-github:before { content: $github; } +.icon-unlock:before { content: $unlock; } +.icon-credit-card:before { content: $credit-card; } +.icon-rss:before { content: $rss; } +.icon-hdd:before { content: $hdd; } +.icon-bullhorn:before { content: $bullhorn; } +.icon-bell:before { content: $bell; } +.icon-certificate:before { content: $certificate; } +.icon-hand-right:before { content: $hand-right; } +.icon-hand-left:before { content: $hand-left; } +.icon-hand-up:before { content: $hand-up; } +.icon-hand-down:before { content: $hand-down; } +.icon-circle-arrow-left:before { content: $circle-arrow-left; } +.icon-circle-arrow-right:before { content: $circle-arrow-right; } +.icon-circle-arrow-up:before { content: $circle-arrow-up; } +.icon-circle-arrow-down:before { content: $circle-arrow-down; } +.icon-globe:before { content: $globe; } +.icon-wrench:before { content: $wrench; } +.icon-tasks:before { content: $tasks; } +.icon-filter:before { content: $filter; } +.icon-briefcase:before { content: $briefcase; } +.icon-fullscreen:before { content: $fullscreen; } +.icon-group:before { content: $group; } +.icon-link:before { content: $link; } +.icon-cloud:before { content: $cloud; } +.icon-beaker:before { content: $beaker; } +.icon-cut:before { content: $cut; } +.icon-copy:before { content: $copy; } +.icon-paperclip:before, +.icon-paper-clip:before { content: $paper-clip; } +.icon-save:before { content: $save; } +.icon-sign-blank:before { content: $sign-blank; } +.icon-reorder:before { content: $reorder; } +.icon-list-ul:before { content: $list-ul; } +.icon-list-ol:before { content: $list-ol; } +.icon-strikethrough:before { content: $strikethrough; } +.icon-underline:before { content: $underline; } +.icon-table:before { content: $table; } +.icon-magic:before { content: $magic; } +.icon-truck:before { content: $truck; } +.icon-pinterest:before { content: $pinterest; } +.icon-pinterest-sign:before { content: $pinterest-sign; } +.icon-google-plus-sign:before { content: $google-plus-sign; } +.icon-google-plus:before { content: $google-plus; } +.icon-money:before { content: $money; } +.icon-caret-down:before { content: $caret-down; } +.icon-caret-up:before { content: $caret-up; } +.icon-caret-left:before { content: $caret-left; } +.icon-caret-right:before { content: $caret-right; } +.icon-columns:before { content: $columns; } +.icon-sort:before { content: $sort; } +.icon-sort-down:before { content: $sort-down; } +.icon-sort-up:before { content: $sort-up; } +.icon-envelope:before { content: $envelope; } +.icon-linkedin:before { content: $linkedin; } +.icon-rotate-left:before, +.icon-undo:before { content: $undo; } +.icon-legal:before { content: $legal; } +.icon-dashboard:before { content: $dashboard; } +.icon-comment-alt:before { content: $comment-alt; } +.icon-comments-alt:before { content: $comments-alt; } +.icon-bolt:before { content: $bolt; } +.icon-sitemap:before { content: $sitemap; } +.icon-umbrella:before { content: $umbrella; } +.icon-paste:before { content: $paste; } +.icon-lightbulb:before { content: $lightbulb; } +.icon-exchange:before { content: $exchange; } +.icon-cloud-download:before { content: $cloud-download; } +.icon-cloud-upload:before { content: $cloud-upload; } +.icon-user-md:before { content: $user-md; } +.icon-stethoscope:before { content: $stethoscope; } +.icon-suitcase:before { content: $suitcase; } +.icon-bell-alt:before { content: $bell-alt; } +.icon-coffee:before { content: $coffee; } +.icon-food:before { content: $food; } +.icon-file-text-alt:before { content: $file-text-alt; } +.icon-building:before { content: $building; } +.icon-hospital:before { content: $hospital; } +.icon-ambulance:before { content: $ambulance; } +.icon-medkit:before { content: $medkit; } +.icon-fighter-jet:before { content: $fighter-jet; } +.icon-beer:before { content: $beer; } +.icon-h-sign:before { content: $h-sign; } +.icon-plus-sign-alt:before { content: $plus-sign-alt; } +.icon-double-angle-left:before { content: $double-angle-left; } +.icon-double-angle-right:before { content: $double-angle-right; } +.icon-double-angle-up:before { content: $double-angle-up; } +.icon-double-angle-down:before { content: $double-angle-down; } +.icon-angle-left:before { content: $angle-left; } +.icon-angle-right:before { content: $angle-right; } +.icon-angle-up:before { content: $angle-up; } +.icon-angle-down:before { content: $angle-down; } +.icon-desktop:before { content: $desktop; } +.icon-laptop:before { content: $laptop; } +.icon-tablet:before { content: $tablet; } +.icon-mobile-phone:before { content: $mobile-phone; } +.icon-circle-blank:before { content: $circle-blank; } +.icon-quote-left:before { content: $quote-left; } +.icon-quote-right:before { content: $quote-right; } +.icon-spinner:before { content: $spinner; } +.icon-circle:before { content: $circle; } +.icon-mail-reply:before, +.icon-reply:before { content: $reply; } +.icon-github-alt:before { content: $github-alt; } +.icon-folder-close-alt:before { content: $folder-close-alt; } +.icon-folder-open-alt:before { content: $folder-open-alt; } +.icon-expand-alt:before { content: $expand-alt; } +.icon-collapse-alt:before { content: $collapse-alt; } +.icon-smile:before { content: $smile; } +.icon-frown:before { content: $frown; } +.icon-meh:before { content: $meh; } +.icon-gamepad:before { content: $gamepad; } +.icon-keyboard:before { content: $keyboard; } +.icon-flag-alt:before { content: $flag-alt; } +.icon-flag-checkered:before { content: $flag-checkered; } +.icon-terminal:before { content: $terminal; } +.icon-code:before { content: $code; } +.icon-reply-all:before { content: $reply-all; } +.icon-mail-reply-all:before { content: $mail-reply-all; } +.icon-star-half-full:before, +.icon-star-half-empty:before { content: $star-half-empty; } +.icon-location-arrow:before { content: $location-arrow; } +.icon-crop:before { content: $crop; } +.icon-code-fork:before { content: $code-fork; } +.icon-unlink:before { content: $unlink; } +.icon-question:before { content: $question; } +.icon-info:before { content: $info; } +.icon-exclamation:before { content: $exclamation; } +.icon-superscript:before { content: $superscript; } +.icon-subscript:before { content: $subscript; } +.icon-eraser:before { content: $eraser; } +.icon-puzzle-piece:before { content: $puzzle-piece; } +.icon-microphone:before { content: $microphone; } +.icon-microphone-off:before { content: $microphone-off; } +.icon-shield:before { content: $shield; } +.icon-calendar-empty:before { content: $calendar-empty; } +.icon-fire-extinguisher:before { content: $fire-extinguisher; } +.icon-rocket:before { content: $rocket; } +.icon-maxcdn:before { content: $maxcdn; } +.icon-chevron-sign-left:before { content: $chevron-sign-left; } +.icon-chevron-sign-right:before { content: $chevron-sign-right; } +.icon-chevron-sign-up:before { content: $chevron-sign-up; } +.icon-chevron-sign-down:before { content: $chevron-sign-down; } +.icon-html5:before { content: $html5; } +.icon-css3:before { content: $css3; } +.icon-anchor:before { content: $anchor; } +.icon-unlock-alt:before { content: $unlock-alt; } +.icon-bullseye:before { content: $bullseye; } +.icon-ellipsis-horizontal:before { content: $ellipsis-horizontal; } +.icon-ellipsis-vertical:before { content: $ellipsis-vertical; } +.icon-rss-sign:before { content: $rss-sign; } +.icon-play-sign:before { content: $play-sign; } +.icon-ticket:before { content: $ticket; } +.icon-minus-sign-alt:before { content: $minus-sign-alt; } +.icon-check-minus:before { content: $check-minus; } +.icon-level-up:before { content: $level-up; } +.icon-level-down:before { content: $level-down; } +.icon-check-sign:before { content: $check-sign; } +.icon-edit-sign:before { content: $edit-sign; } +.icon-external-link-sign:before { content: $external-link-sign; } +.icon-share-sign:before { content: $share-sign; } +.icon-compass:before { content: $compass; } +.icon-collapse:before { content: $collapse; } +.icon-collapse-top:before { content: $collapse-top; } +.icon-expand:before { content: $expand; } +.icon-euro:before, +.icon-eur:before { content: $eur; } +.icon-gbp:before { content: $gbp; } +.icon-dollar:before, +.icon-usd:before { content: $usd; } +.icon-rupee:before, +.icon-inr:before { content: $inr; } +.icon-yen:before, +.icon-jpy:before { content: $jpy; } +.icon-renminbi:before, +.icon-cny:before { content: $cny; } +.icon-won:before, +.icon-krw:before { content: $krw; } +.icon-bitcoin:before, +.icon-btc:before { content: $btc; } +.icon-file:before { content: $file; } +.icon-file-text:before { content: $file-text; } +.icon-sort-by-alphabet:before { content: $sort-by-alphabet; } +.icon-sort-by-alphabet-alt:before { content: $sort-by-alphabet-alt; } +.icon-sort-by-attributes:before { content: $sort-by-attributes; } +.icon-sort-by-attributes-alt:before { content: $sort-by-attributes-alt; } +.icon-sort-by-order:before { content: $sort-by-order; } +.icon-sort-by-order-alt:before { content: $sort-by-order-alt; } +.icon-thumbs-up:before { content: $thumbs-up; } +.icon-thumbs-down:before { content: $thumbs-down; } +.icon-youtube-sign:before { content: $youtube-sign; } +.icon-youtube:before { content: $youtube; } +.icon-xing:before { content: $xing; } +.icon-xing-sign:before { content: $xing-sign; } +.icon-youtube-play:before { content: $youtube-play; } +.icon-dropbox:before { content: $dropbox; } +.icon-stackexchange:before { content: $stackexchange; } +.icon-instagram:before { content: $instagram; } +.icon-flickr:before { content: $flickr; } +.icon-adn:before { content: $adn; } +.icon-bitbucket:before { content: $bitbucket; } +.icon-bitbucket-sign:before { content: $bitbucket-sign; } +.icon-tumblr:before { content: $tumblr; } +.icon-tumblr-sign:before { content: $tumblr-sign; } +.icon-long-arrow-down:before { content: $long-arrow-down; } +.icon-long-arrow-up:before { content: $long-arrow-up; } +.icon-long-arrow-left:before { content: $long-arrow-left; } +.icon-long-arrow-right:before { content: $long-arrow-right; } +.icon-apple:before { content: $apple; } +.icon-windows:before { content: $windows; } +.icon-android:before { content: $android; } +.icon-linux:before { content: $linux; } +.icon-dribbble:before { content: $dribbble; } +.icon-skype:before { content: $skype; } +.icon-foursquare:before { content: $foursquare; } +.icon-trello:before { content: $trello; } +.icon-female:before { content: $female; } +.icon-male:before { content: $male; } +.icon-gittip:before { content: $gittip; } +.icon-sun:before { content: $sun; } +.icon-moon:before { content: $moon; } +.icon-archive:before { content: $archive; } +.icon-bug:before { content: $bug; } +.icon-vk:before { content: $vk; } +.icon-weibo:before { content: $weibo; } +.icon-renren:before { content: $renren; } diff --git a/stylesheets/font-awesome/scss/_mixins.scss b/stylesheets/font-awesome/scss/_mixins.scss new file mode 100644 index 00000000..ca9c5931 --- /dev/null +++ b/stylesheets/font-awesome/scss/_mixins.scss @@ -0,0 +1,48 @@ +// Mixins +// -------------------------- + +@mixin icon($icon) { + @include icon-FontAwesome(); + content: $icon; +} + +@mixin icon-FontAwesome() { + font-family: FontAwesome; + font-weight: normal; + font-style: normal; + text-decoration: inherit; + -webkit-font-smoothing: antialiased; + *margin-right: .3em; // fixes ie7 issues +} + +@mixin border-radius($radius) { + -webkit-border-radius: $radius; + -moz-border-radius: $radius; + border-radius: $radius; +} + +@mixin icon-stack($width: 2em, $height: 2em, $top-font-size: 1em, $base-font-size: 2em) { + .icon-stack { + position: relative; + display: inline-block; + width: $width; + height: $height; + line-height: $width; + vertical-align: -35%; + [class^="icon-"], + [class*=" icon-"] { + display: block; + text-align: center; + position: absolute; + width: 100%; + height: 100%; + font-size: $top-font-size; + line-height: inherit; + *line-height: $height; + } + .icon-stack-base { + font-size: $base-font-size; + *line-height: #{$height / $base-font-size}em; + } + } +} diff --git a/stylesheets/font-awesome/scss/_path.scss b/stylesheets/font-awesome/scss/_path.scss new file mode 100644 index 00000000..bb3f36b7 --- /dev/null +++ b/stylesheets/font-awesome/scss/_path.scss @@ -0,0 +1,14 @@ +/* FONT PATH + * -------------------------- */ + +@font-face { + font-family: 'FontAwesome'; + src: url('#{$FontAwesomePath}/fontawesome-webfont.eot?v=#{$FontAwesomeVersion}'); + src: url('#{$FontAwesomePath}/fontawesome-webfont.eot?#iefix&v=#{$FontAwesomeVersion}') format('embedded-opentype'), + url('#{$FontAwesomePath}/fontawesome-webfont.woff?v=#{$FontAwesomeVersion}') format('woff'), + url('#{$FontAwesomePath}/fontawesome-webfont.ttf?v=#{$FontAwesomeVersion}') format('truetype'), + url('#{$FontAwesomePath}/fontawesome-webfont.svg#fontawesomeregular?v=#{$FontAwesomeVersion}') format('svg'); +// src: url('#{$FontAwesomePath}/FontAwesome.otf') format('opentype'); // used when developing fonts + font-weight: normal; + font-style: normal; +} diff --git a/stylesheets/font-awesome/scss/_variables.scss b/stylesheets/font-awesome/scss/_variables.scss new file mode 100644 index 00000000..7d6bbc5b --- /dev/null +++ b/stylesheets/font-awesome/scss/_variables.scss @@ -0,0 +1,734 @@ +// Variables +// -------------------------- + +$FontAwesomePath: "../font" !default; +$FontAwesomeVersion: "3.2.1" !default; +$borderColor: #eeeeee !default; +$iconMuted: #eeeeee !default; +$iconLight: white !default; +$iconDark: #333333 !default; +$icons-li-width: (30em/14); + + +$glass: "\f000"; + +$music: "\f001"; + +$search: "\f002"; + +$envelope-alt: "\f003"; + +$heart: "\f004"; + +$star: "\f005"; + +$star-empty: "\f006"; + +$user: "\f007"; + +$film: "\f008"; + +$th-large: "\f009"; + +$th: "\f00a"; + +$th-list: "\f00b"; + +$ok: "\f00c"; + +$remove: "\f00d"; + +$zoom-in: "\f00e"; + +$zoom-out: "\f010"; + +$off: "\f011"; + +$signal: "\f012"; + +$cog: "\f013"; + +$trash: "\f014"; + +$home: "\f015"; + +$file-alt: "\f016"; + +$time: "\f017"; + +$road: "\f018"; + +$download-alt: "\f019"; + +$download: "\f01a"; + +$upload: "\f01b"; + +$inbox: "\f01c"; + +$play-circle: "\f01d"; + +$repeat: "\f01e"; + +$refresh: "\f021"; + +$list-alt: "\f022"; + +$lock: "\f023"; + +$flag: "\f024"; + +$headphones: "\f025"; + +$volume-off: "\f026"; + +$volume-down: "\f027"; + +$volume-up: "\f028"; + +$qrcode: "\f029"; + +$barcode: "\f02a"; + +$tag: "\f02b"; + +$tags: "\f02c"; + +$book: "\f02d"; + +$bookmark: "\f02e"; + +$print: "\f02f"; + +$camera: "\f030"; + +$font: "\f031"; + +$bold: "\f032"; + +$italic: "\f033"; + +$text-height: "\f034"; + +$text-width: "\f035"; + +$align-left: "\f036"; + +$align-center: "\f037"; + +$align-right: "\f038"; + +$align-justify: "\f039"; + +$list: "\f03a"; + +$indent-left: "\f03b"; + +$indent-right: "\f03c"; + +$facetime-video: "\f03d"; + +$picture: "\f03e"; + +$pencil: "\f040"; + +$map-marker: "\f041"; + +$adjust: "\f042"; + +$tint: "\f043"; + +$edit: "\f044"; + +$share: "\f045"; + +$check: "\f046"; + +$move: "\f047"; + +$step-backward: "\f048"; + +$fast-backward: "\f049"; + +$backward: "\f04a"; + +$play: "\f04b"; + +$pause: "\f04c"; + +$stop: "\f04d"; + +$forward: "\f04e"; + +$fast-forward: "\f050"; + +$step-forward: "\f051"; + +$eject: "\f052"; + +$chevron-left: "\f053"; + +$chevron-right: "\f054"; + +$plus-sign: "\f055"; + +$minus-sign: "\f056"; + +$remove-sign: "\f057"; + +$ok-sign: "\f058"; + +$question-sign: "\f059"; + +$info-sign: "\f05a"; + +$screenshot: "\f05b"; + +$remove-circle: "\f05c"; + +$ok-circle: "\f05d"; + +$ban-circle: "\f05e"; + +$arrow-left: "\f060"; + +$arrow-right: "\f061"; + +$arrow-up: "\f062"; + +$arrow-down: "\f063"; + +$share-alt: "\f064"; + +$resize-full: "\f065"; + +$resize-small: "\f066"; + +$plus: "\f067"; + +$minus: "\f068"; + +$asterisk: "\f069"; + +$exclamation-sign: "\f06a"; + +$gift: "\f06b"; + +$leaf: "\f06c"; + +$fire: "\f06d"; + +$eye-open: "\f06e"; + +$eye-close: "\f070"; + +$warning-sign: "\f071"; + +$plane: "\f072"; + +$calendar: "\f073"; + +$random: "\f074"; + +$comment: "\f075"; + +$magnet: "\f076"; + +$chevron-up: "\f077"; + +$chevron-down: "\f078"; + +$retweet: "\f079"; + +$shopping-cart: "\f07a"; + +$folder-close: "\f07b"; + +$folder-open: "\f07c"; + +$resize-vertical: "\f07d"; + +$resize-horizontal: "\f07e"; + +$bar-chart: "\f080"; + +$twitter-sign: "\f081"; + +$facebook-sign: "\f082"; + +$camera-retro: "\f083"; + +$key: "\f084"; + +$cogs: "\f085"; + +$comments: "\f086"; + +$thumbs-up-alt: "\f087"; + +$thumbs-down-alt: "\f088"; + +$star-half: "\f089"; + +$heart-empty: "\f08a"; + +$signout: "\f08b"; + +$linkedin-sign: "\f08c"; + +$pushpin: "\f08d"; + +$external-link: "\f08e"; + +$signin: "\f090"; + +$trophy: "\f091"; + +$github-sign: "\f092"; + +$upload-alt: "\f093"; + +$lemon: "\f094"; + +$phone: "\f095"; + +$check-empty: "\f096"; + +$bookmark-empty: "\f097"; + +$phone-sign: "\f098"; + +$twitter: "\f099"; + +$facebook: "\f09a"; + +$github: "\f09b"; + +$unlock: "\f09c"; + +$credit-card: "\f09d"; + +$rss: "\f09e"; + +$hdd: "\f0a0"; + +$bullhorn: "\f0a1"; + +$bell: "\f0a2"; + +$certificate: "\f0a3"; + +$hand-right: "\f0a4"; + +$hand-left: "\f0a5"; + +$hand-up: "\f0a6"; + +$hand-down: "\f0a7"; + +$circle-arrow-left: "\f0a8"; + +$circle-arrow-right: "\f0a9"; + +$circle-arrow-up: "\f0aa"; + +$circle-arrow-down: "\f0ab"; + +$globe: "\f0ac"; + +$wrench: "\f0ad"; + +$tasks: "\f0ae"; + +$filter: "\f0b0"; + +$briefcase: "\f0b1"; + +$fullscreen: "\f0b2"; + +$group: "\f0c0"; + +$link: "\f0c1"; + +$cloud: "\f0c2"; + +$beaker: "\f0c3"; + +$cut: "\f0c4"; + +$copy: "\f0c5"; + +$paper-clip: "\f0c6"; + +$save: "\f0c7"; + +$sign-blank: "\f0c8"; + +$reorder: "\f0c9"; + +$list-ul: "\f0ca"; + +$list-ol: "\f0cb"; + +$strikethrough: "\f0cc"; + +$underline: "\f0cd"; + +$table: "\f0ce"; + +$magic: "\f0d0"; + +$truck: "\f0d1"; + +$pinterest: "\f0d2"; + +$pinterest-sign: "\f0d3"; + +$google-plus-sign: "\f0d4"; + +$google-plus: "\f0d5"; + +$money: "\f0d6"; + +$caret-down: "\f0d7"; + +$caret-up: "\f0d8"; + +$caret-left: "\f0d9"; + +$caret-right: "\f0da"; + +$columns: "\f0db"; + +$sort: "\f0dc"; + +$sort-down: "\f0dd"; + +$sort-up: "\f0de"; + +$envelope: "\f0e0"; + +$linkedin: "\f0e1"; + +$undo: "\f0e2"; + +$legal: "\f0e3"; + +$dashboard: "\f0e4"; + +$comment-alt: "\f0e5"; + +$comments-alt: "\f0e6"; + +$bolt: "\f0e7"; + +$sitemap: "\f0e8"; + +$umbrella: "\f0e9"; + +$paste: "\f0ea"; + +$lightbulb: "\f0eb"; + +$exchange: "\f0ec"; + +$cloud-download: "\f0ed"; + +$cloud-upload: "\f0ee"; + +$user-md: "\f0f0"; + +$stethoscope: "\f0f1"; + +$suitcase: "\f0f2"; + +$bell-alt: "\f0f3"; + +$coffee: "\f0f4"; + +$food: "\f0f5"; + +$file-text-alt: "\f0f6"; + +$building: "\f0f7"; + +$hospital: "\f0f8"; + +$ambulance: "\f0f9"; + +$medkit: "\f0fa"; + +$fighter-jet: "\f0fb"; + +$beer: "\f0fc"; + +$h-sign: "\f0fd"; + +$plus-sign-alt: "\f0fe"; + +$double-angle-left: "\f100"; + +$double-angle-right: "\f101"; + +$double-angle-up: "\f102"; + +$double-angle-down: "\f103"; + +$angle-left: "\f104"; + +$angle-right: "\f105"; + +$angle-up: "\f106"; + +$angle-down: "\f107"; + +$desktop: "\f108"; + +$laptop: "\f109"; + +$tablet: "\f10a"; + +$mobile-phone: "\f10b"; + +$circle-blank: "\f10c"; + +$quote-left: "\f10d"; + +$quote-right: "\f10e"; + +$spinner: "\f110"; + +$circle: "\f111"; + +$reply: "\f112"; + +$github-alt: "\f113"; + +$folder-close-alt: "\f114"; + +$folder-open-alt: "\f115"; + +$expand-alt: "\f116"; + +$collapse-alt: "\f117"; + +$smile: "\f118"; + +$frown: "\f119"; + +$meh: "\f11a"; + +$gamepad: "\f11b"; + +$keyboard: "\f11c"; + +$flag-alt: "\f11d"; + +$flag-checkered: "\f11e"; + +$terminal: "\f120"; + +$code: "\f121"; + +$reply-all: "\f122"; + +$mail-reply-all: "\f122"; + +$star-half-empty: "\f123"; + +$location-arrow: "\f124"; + +$crop: "\f125"; + +$code-fork: "\f126"; + +$unlink: "\f127"; + +$question: "\f128"; + +$info: "\f129"; + +$exclamation: "\f12a"; + +$superscript: "\f12b"; + +$subscript: "\f12c"; + +$eraser: "\f12d"; + +$puzzle-piece: "\f12e"; + +$microphone: "\f130"; + +$microphone-off: "\f131"; + +$shield: "\f132"; + +$calendar-empty: "\f133"; + +$fire-extinguisher: "\f134"; + +$rocket: "\f135"; + +$maxcdn: "\f136"; + +$chevron-sign-left: "\f137"; + +$chevron-sign-right: "\f138"; + +$chevron-sign-up: "\f139"; + +$chevron-sign-down: "\f13a"; + +$html5: "\f13b"; + +$css3: "\f13c"; + +$anchor: "\f13d"; + +$unlock-alt: "\f13e"; + +$bullseye: "\f140"; + +$ellipsis-horizontal: "\f141"; + +$ellipsis-vertical: "\f142"; + +$rss-sign: "\f143"; + +$play-sign: "\f144"; + +$ticket: "\f145"; + +$minus-sign-alt: "\f146"; + +$check-minus: "\f147"; + +$level-up: "\f148"; + +$level-down: "\f149"; + +$check-sign: "\f14a"; + +$edit-sign: "\f14b"; + +$external-link-sign: "\f14c"; + +$share-sign: "\f14d"; + +$compass: "\f14e"; + +$collapse: "\f150"; + +$collapse-top: "\f151"; + +$expand: "\f152"; + +$eur: "\f153"; + +$gbp: "\f154"; + +$usd: "\f155"; + +$inr: "\f156"; + +$jpy: "\f157"; + +$cny: "\f158"; + +$krw: "\f159"; + +$btc: "\f15a"; + +$file: "\f15b"; + +$file-text: "\f15c"; + +$sort-by-alphabet: "\f15d"; + +$sort-by-alphabet-alt: "\f15e"; + +$sort-by-attributes: "\f160"; + +$sort-by-attributes-alt: "\f161"; + +$sort-by-order: "\f162"; + +$sort-by-order-alt: "\f163"; + +$thumbs-up: "\f164"; + +$thumbs-down: "\f165"; + +$youtube-sign: "\f166"; + +$youtube: "\f167"; + +$xing: "\f168"; + +$xing-sign: "\f169"; + +$youtube-play: "\f16a"; + +$dropbox: "\f16b"; + +$stackexchange: "\f16c"; + +$instagram: "\f16d"; + +$flickr: "\f16e"; + +$adn: "\f170"; + +$bitbucket: "\f171"; + +$bitbucket-sign: "\f172"; + +$tumblr: "\f173"; + +$tumblr-sign: "\f174"; + +$long-arrow-down: "\f175"; + +$long-arrow-up: "\f176"; + +$long-arrow-left: "\f177"; + +$long-arrow-right: "\f178"; + +$apple: "\f179"; + +$windows: "\f17a"; + +$android: "\f17b"; + +$linux: "\f17c"; + +$dribbble: "\f17d"; + +$skype: "\f17e"; + +$foursquare: "\f180"; + +$trello: "\f181"; + +$female: "\f182"; + +$male: "\f183"; + +$gittip: "\f184"; + +$sun: "\f185"; + +$moon: "\f186"; + +$archive: "\f187"; + +$bug: "\f188"; + +$vk: "\f189"; + +$weibo: "\f18a"; + +$renren: "\f18b"; + diff --git a/stylesheets/font-awesome/scss/font-awesome-ie7.scss b/stylesheets/font-awesome/scss/font-awesome-ie7.scss new file mode 100644 index 00000000..0e236f61 --- /dev/null +++ b/stylesheets/font-awesome/scss/font-awesome-ie7.scss @@ -0,0 +1,1953 @@ +/*! + * Font Awesome 3.2.1 + * the iconic font designed for Bootstrap + * ------------------------------------------------------------------------------ + * The full suite of pictographic icons, examples, and documentation can be + * found at http://fontawesome.io. Stay up to date on Twitter at + * http://twitter.com/fontawesome. + * + * License + * ------------------------------------------------------------------------------ + * - The Font Awesome font is licensed under SIL OFL 1.1 - + * http://scripts.sil.org/OFL + * - Font Awesome CSS, LESS, and SASS files are licensed under MIT License - + * http://opensource.org/licenses/mit-license.html + * - Font Awesome documentation licensed under CC BY 3.0 - + * http://creativecommons.org/licenses/by/3.0/ + * - Attribution is no longer required in Font Awesome 3.0, but much appreciated: + * "Font Awesome by Dave Gandy - http://fontawesome.io" + * + * Author - Dave Gandy + * ------------------------------------------------------------------------------ + * Email: dave@fontawesome.io + * Twitter: http://twitter.com/davegandy + * Work: Lead Product Designer @ Kyruus - http://kyruus.com + */ + +.icon-large { + font-size: (4em/3); + margin-top: -4px; + padding-top: 3px; + margin-bottom: -4px; + padding-bottom: 3px; + vertical-align: middle; +} + +.nav { + [class^="icon-"], + [class*=" icon-"] { + vertical-align: inherit; + margin-top: -4px; + padding-top: 3px; + margin-bottom: -4px; + padding-bottom: 3px; + &.icon-large { + vertical-align: -25%; + } + } +} + +.nav-pills, .nav-tabs { + [class^="icon-"], + [class*=" icon-"] { + &.icon-large { + line-height: .75em; + margin-top: -7px; + padding-top: 5px; + margin-bottom: -5px; + padding-bottom: 4px; + } + } +} + +.btn { + [class^="icon-"], + [class*=" icon-"] { + &.pull-left, &.pull-right { vertical-align: inherit; } + &.icon-large { + margin-top: -.5em; + } + } +} + +a [class^="icon-"], +a [class*=" icon-"] { + cursor: pointer; +} + +@mixin ie7icon($inner) { *zoom: expression(this.runtimeStyle['zoom'] = '1', this.innerHTML = '#{$inner}'); } + + +.icon-glass { + @include ie7icon(''); +} + + +.icon-music { + @include ie7icon(''); +} + + +.icon-search { + @include ie7icon(''); +} + + +.icon-envelope-alt { + @include ie7icon(''); +} + + +.icon-heart { + @include ie7icon(''); +} + + +.icon-star { + @include ie7icon(''); +} + + +.icon-star-empty { + @include ie7icon(''); +} + + +.icon-user { + @include ie7icon(''); +} + + +.icon-film { + @include ie7icon(''); +} + + +.icon-th-large { + @include ie7icon(''); +} + + +.icon-th { + @include ie7icon(''); +} + + +.icon-th-list { + @include ie7icon(''); +} + + +.icon-ok { + @include ie7icon(''); +} + + +.icon-remove { + @include ie7icon(''); +} + + +.icon-zoom-in { + @include ie7icon(''); +} + + +.icon-zoom-out { + @include ie7icon(''); +} + + +.icon-off { + @include ie7icon(''); +} + +.icon-power-off { + @include ie7icon(''); +} + + +.icon-signal { + @include ie7icon(''); +} + + +.icon-cog { + @include ie7icon(''); +} + +.icon-gear { + @include ie7icon(''); +} + + +.icon-trash { + @include ie7icon(''); +} + + +.icon-home { + @include ie7icon(''); +} + + +.icon-file-alt { + @include ie7icon(''); +} + + +.icon-time { + @include ie7icon(''); +} + + +.icon-road { + @include ie7icon(''); +} + + +.icon-download-alt { + @include ie7icon(''); +} + + +.icon-download { + @include ie7icon(''); +} + + +.icon-upload { + @include ie7icon(''); +} + + +.icon-inbox { + @include ie7icon(''); +} + + +.icon-play-circle { + @include ie7icon(''); +} + + +.icon-repeat { + @include ie7icon(''); +} + +.icon-rotate-right { + @include ie7icon(''); +} + + +.icon-refresh { + @include ie7icon(''); +} + + +.icon-list-alt { + @include ie7icon(''); +} + + +.icon-lock { + @include ie7icon(''); +} + + +.icon-flag { + @include ie7icon(''); +} + + +.icon-headphones { + @include ie7icon(''); +} + + +.icon-volume-off { + @include ie7icon(''); +} + + +.icon-volume-down { + @include ie7icon(''); +} + + +.icon-volume-up { + @include ie7icon(''); +} + + +.icon-qrcode { + @include ie7icon(''); +} + + +.icon-barcode { + @include ie7icon(''); +} + + +.icon-tag { + @include ie7icon(''); +} + + +.icon-tags { + @include ie7icon(''); +} + + +.icon-book { + @include ie7icon(''); +} + + +.icon-bookmark { + @include ie7icon(''); +} + + +.icon-print { + @include ie7icon(''); +} + + +.icon-camera { + @include ie7icon(''); +} + + +.icon-font { + @include ie7icon(''); +} + + +.icon-bold { + @include ie7icon(''); +} + + +.icon-italic { + @include ie7icon(''); +} + + +.icon-text-height { + @include ie7icon(''); +} + + +.icon-text-width { + @include ie7icon(''); +} + + +.icon-align-left { + @include ie7icon(''); +} + + +.icon-align-center { + @include ie7icon(''); +} + + +.icon-align-right { + @include ie7icon(''); +} + + +.icon-align-justify { + @include ie7icon(''); +} + + +.icon-list { + @include ie7icon(''); +} + + +.icon-indent-left { + @include ie7icon(''); +} + + +.icon-indent-right { + @include ie7icon(''); +} + + +.icon-facetime-video { + @include ie7icon(''); +} + + +.icon-picture { + @include ie7icon(''); +} + + +.icon-pencil { + @include ie7icon(''); +} + + +.icon-map-marker { + @include ie7icon(''); +} + + +.icon-adjust { + @include ie7icon(''); +} + + +.icon-tint { + @include ie7icon(''); +} + + +.icon-edit { + @include ie7icon(''); +} + + +.icon-share { + @include ie7icon(''); +} + + +.icon-check { + @include ie7icon(''); +} + + +.icon-move { + @include ie7icon(''); +} + + +.icon-step-backward { + @include ie7icon(''); +} + + +.icon-fast-backward { + @include ie7icon(''); +} + + +.icon-backward { + @include ie7icon(''); +} + + +.icon-play { + @include ie7icon(''); +} + + +.icon-pause { + @include ie7icon(''); +} + + +.icon-stop { + @include ie7icon(''); +} + + +.icon-forward { + @include ie7icon(''); +} + + +.icon-fast-forward { + @include ie7icon(''); +} + + +.icon-step-forward { + @include ie7icon(''); +} + + +.icon-eject { + @include ie7icon(''); +} + + +.icon-chevron-left { + @include ie7icon(''); +} + + +.icon-chevron-right { + @include ie7icon(''); +} + + +.icon-plus-sign { + @include ie7icon(''); +} + + +.icon-minus-sign { + @include ie7icon(''); +} + + +.icon-remove-sign { + @include ie7icon(''); +} + + +.icon-ok-sign { + @include ie7icon(''); +} + + +.icon-question-sign { + @include ie7icon(''); +} + + +.icon-info-sign { + @include ie7icon(''); +} + + +.icon-screenshot { + @include ie7icon(''); +} + + +.icon-remove-circle { + @include ie7icon(''); +} + + +.icon-ok-circle { + @include ie7icon(''); +} + + +.icon-ban-circle { + @include ie7icon(''); +} + + +.icon-arrow-left { + @include ie7icon(''); +} + + +.icon-arrow-right { + @include ie7icon(''); +} + + +.icon-arrow-up { + @include ie7icon(''); +} + + +.icon-arrow-down { + @include ie7icon(''); +} + + +.icon-share-alt { + @include ie7icon(''); +} + +.icon-mail-forward { + @include ie7icon(''); +} + + +.icon-resize-full { + @include ie7icon(''); +} + + +.icon-resize-small { + @include ie7icon(''); +} + + +.icon-plus { + @include ie7icon(''); +} + + +.icon-minus { + @include ie7icon(''); +} + + +.icon-asterisk { + @include ie7icon(''); +} + + +.icon-exclamation-sign { + @include ie7icon(''); +} + + +.icon-gift { + @include ie7icon(''); +} + + +.icon-leaf { + @include ie7icon(''); +} + + +.icon-fire { + @include ie7icon(''); +} + + +.icon-eye-open { + @include ie7icon(''); +} + + +.icon-eye-close { + @include ie7icon(''); +} + + +.icon-warning-sign { + @include ie7icon(''); +} + + +.icon-plane { + @include ie7icon(''); +} + + +.icon-calendar { + @include ie7icon(''); +} + + +.icon-random { + @include ie7icon(''); +} + + +.icon-comment { + @include ie7icon(''); +} + + +.icon-magnet { + @include ie7icon(''); +} + + +.icon-chevron-up { + @include ie7icon(''); +} + + +.icon-chevron-down { + @include ie7icon(''); +} + + +.icon-retweet { + @include ie7icon(''); +} + + +.icon-shopping-cart { + @include ie7icon(''); +} + + +.icon-folder-close { + @include ie7icon(''); +} + + +.icon-folder-open { + @include ie7icon(''); +} + + +.icon-resize-vertical { + @include ie7icon(''); +} + + +.icon-resize-horizontal { + @include ie7icon(''); +} + + +.icon-bar-chart { + @include ie7icon(''); +} + + +.icon-twitter-sign { + @include ie7icon(''); +} + + +.icon-facebook-sign { + @include ie7icon(''); +} + + +.icon-camera-retro { + @include ie7icon(''); +} + + +.icon-key { + @include ie7icon(''); +} + + +.icon-cogs { + @include ie7icon(''); +} + +.icon-gears { + @include ie7icon(''); +} + + +.icon-comments { + @include ie7icon(''); +} + + +.icon-thumbs-up-alt { + @include ie7icon(''); +} + + +.icon-thumbs-down-alt { + @include ie7icon(''); +} + + +.icon-star-half { + @include ie7icon(''); +} + + +.icon-heart-empty { + @include ie7icon(''); +} + + +.icon-signout { + @include ie7icon(''); +} + + +.icon-linkedin-sign { + @include ie7icon(''); +} + + +.icon-pushpin { + @include ie7icon(''); +} + + +.icon-external-link { + @include ie7icon(''); +} + + +.icon-signin { + @include ie7icon(''); +} + + +.icon-trophy { + @include ie7icon(''); +} + + +.icon-github-sign { + @include ie7icon(''); +} + + +.icon-upload-alt { + @include ie7icon(''); +} + + +.icon-lemon { + @include ie7icon(''); +} + + +.icon-phone { + @include ie7icon(''); +} + + +.icon-check-empty { + @include ie7icon(''); +} + +.icon-unchecked { + @include ie7icon(''); +} + + +.icon-bookmark-empty { + @include ie7icon(''); +} + + +.icon-phone-sign { + @include ie7icon(''); +} + + +.icon-twitter { + @include ie7icon(''); +} + + +.icon-facebook { + @include ie7icon(''); +} + + +.icon-github { + @include ie7icon(''); +} + + +.icon-unlock { + @include ie7icon(''); +} + + +.icon-credit-card { + @include ie7icon(''); +} + + +.icon-rss { + @include ie7icon(''); +} + + +.icon-hdd { + @include ie7icon(''); +} + + +.icon-bullhorn { + @include ie7icon(''); +} + + +.icon-bell { + @include ie7icon(''); +} + + +.icon-certificate { + @include ie7icon(''); +} + + +.icon-hand-right { + @include ie7icon(''); +} + + +.icon-hand-left { + @include ie7icon(''); +} + + +.icon-hand-up { + @include ie7icon(''); +} + + +.icon-hand-down { + @include ie7icon(''); +} + + +.icon-circle-arrow-left { + @include ie7icon(''); +} + + +.icon-circle-arrow-right { + @include ie7icon(''); +} + + +.icon-circle-arrow-up { + @include ie7icon(''); +} + + +.icon-circle-arrow-down { + @include ie7icon(''); +} + + +.icon-globe { + @include ie7icon(''); +} + + +.icon-wrench { + @include ie7icon(''); +} + + +.icon-tasks { + @include ie7icon(''); +} + + +.icon-filter { + @include ie7icon(''); +} + + +.icon-briefcase { + @include ie7icon(''); +} + + +.icon-fullscreen { + @include ie7icon(''); +} + + +.icon-group { + @include ie7icon(''); +} + + +.icon-link { + @include ie7icon(''); +} + + +.icon-cloud { + @include ie7icon(''); +} + + +.icon-beaker { + @include ie7icon(''); +} + + +.icon-cut { + @include ie7icon(''); +} + + +.icon-copy { + @include ie7icon(''); +} + + +.icon-paper-clip { + @include ie7icon(''); +} + +.icon-paperclip { + @include ie7icon(''); +} + + +.icon-save { + @include ie7icon(''); +} + + +.icon-sign-blank { + @include ie7icon(''); +} + + +.icon-reorder { + @include ie7icon(''); +} + + +.icon-list-ul { + @include ie7icon(''); +} + + +.icon-list-ol { + @include ie7icon(''); +} + + +.icon-strikethrough { + @include ie7icon(''); +} + + +.icon-underline { + @include ie7icon(''); +} + + +.icon-table { + @include ie7icon(''); +} + + +.icon-magic { + @include ie7icon(''); +} + + +.icon-truck { + @include ie7icon(''); +} + + +.icon-pinterest { + @include ie7icon(''); +} + + +.icon-pinterest-sign { + @include ie7icon(''); +} + + +.icon-google-plus-sign { + @include ie7icon(''); +} + + +.icon-google-plus { + @include ie7icon(''); +} + + +.icon-money { + @include ie7icon(''); +} + + +.icon-caret-down { + @include ie7icon(''); +} + + +.icon-caret-up { + @include ie7icon(''); +} + + +.icon-caret-left { + @include ie7icon(''); +} + + +.icon-caret-right { + @include ie7icon(''); +} + + +.icon-columns { + @include ie7icon(''); +} + + +.icon-sort { + @include ie7icon(''); +} + + +.icon-sort-down { + @include ie7icon(''); +} + + +.icon-sort-up { + @include ie7icon(''); +} + + +.icon-envelope { + @include ie7icon(''); +} + + +.icon-linkedin { + @include ie7icon(''); +} + + +.icon-undo { + @include ie7icon(''); +} + +.icon-rotate-left { + @include ie7icon(''); +} + + +.icon-legal { + @include ie7icon(''); +} + + +.icon-dashboard { + @include ie7icon(''); +} + + +.icon-comment-alt { + @include ie7icon(''); +} + + +.icon-comments-alt { + @include ie7icon(''); +} + + +.icon-bolt { + @include ie7icon(''); +} + + +.icon-sitemap { + @include ie7icon(''); +} + + +.icon-umbrella { + @include ie7icon(''); +} + + +.icon-paste { + @include ie7icon(''); +} + + +.icon-lightbulb { + @include ie7icon(''); +} + + +.icon-exchange { + @include ie7icon(''); +} + + +.icon-cloud-download { + @include ie7icon(''); +} + + +.icon-cloud-upload { + @include ie7icon(''); +} + + +.icon-user-md { + @include ie7icon(''); +} + + +.icon-stethoscope { + @include ie7icon(''); +} + + +.icon-suitcase { + @include ie7icon(''); +} + + +.icon-bell-alt { + @include ie7icon(''); +} + + +.icon-coffee { + @include ie7icon(''); +} + + +.icon-food { + @include ie7icon(''); +} + + +.icon-file-text-alt { + @include ie7icon(''); +} + + +.icon-building { + @include ie7icon(''); +} + + +.icon-hospital { + @include ie7icon(''); +} + + +.icon-ambulance { + @include ie7icon(''); +} + + +.icon-medkit { + @include ie7icon(''); +} + + +.icon-fighter-jet { + @include ie7icon(''); +} + + +.icon-beer { + @include ie7icon(''); +} + + +.icon-h-sign { + @include ie7icon(''); +} + + +.icon-plus-sign-alt { + @include ie7icon(''); +} + + +.icon-double-angle-left { + @include ie7icon(''); +} + + +.icon-double-angle-right { + @include ie7icon(''); +} + + +.icon-double-angle-up { + @include ie7icon(''); +} + + +.icon-double-angle-down { + @include ie7icon(''); +} + + +.icon-angle-left { + @include ie7icon(''); +} + + +.icon-angle-right { + @include ie7icon(''); +} + + +.icon-angle-up { + @include ie7icon(''); +} + + +.icon-angle-down { + @include ie7icon(''); +} + + +.icon-desktop { + @include ie7icon(''); +} + + +.icon-laptop { + @include ie7icon(''); +} + + +.icon-tablet { + @include ie7icon(''); +} + + +.icon-mobile-phone { + @include ie7icon(''); +} + + +.icon-circle-blank { + @include ie7icon(''); +} + + +.icon-quote-left { + @include ie7icon(''); +} + + +.icon-quote-right { + @include ie7icon(''); +} + + +.icon-spinner { + @include ie7icon(''); +} + + +.icon-circle { + @include ie7icon(''); +} + + +.icon-reply { + @include ie7icon(''); +} + +.icon-mail-reply { + @include ie7icon(''); +} + + +.icon-github-alt { + @include ie7icon(''); +} + + +.icon-folder-close-alt { + @include ie7icon(''); +} + + +.icon-folder-open-alt { + @include ie7icon(''); +} + + +.icon-expand-alt { + @include ie7icon(''); +} + + +.icon-collapse-alt { + @include ie7icon(''); +} + + +.icon-smile { + @include ie7icon(''); +} + + +.icon-frown { + @include ie7icon(''); +} + + +.icon-meh { + @include ie7icon(''); +} + + +.icon-gamepad { + @include ie7icon(''); +} + + +.icon-keyboard { + @include ie7icon(''); +} + + +.icon-flag-alt { + @include ie7icon(''); +} + + +.icon-flag-checkered { + @include ie7icon(''); +} + + +.icon-terminal { + @include ie7icon(''); +} + + +.icon-code { + @include ie7icon(''); +} + + +.icon-reply-all { + @include ie7icon(''); +} + + +.icon-mail-reply-all { + @include ie7icon(''); +} + + +.icon-star-half-empty { + @include ie7icon(''); +} + +.icon-star-half-full { + @include ie7icon(''); +} + + +.icon-location-arrow { + @include ie7icon(''); +} + + +.icon-crop { + @include ie7icon(''); +} + + +.icon-code-fork { + @include ie7icon(''); +} + + +.icon-unlink { + @include ie7icon(''); +} + + +.icon-question { + @include ie7icon(''); +} + + +.icon-info { + @include ie7icon(''); +} + + +.icon-exclamation { + @include ie7icon(''); +} + + +.icon-superscript { + @include ie7icon(''); +} + + +.icon-subscript { + @include ie7icon(''); +} + + +.icon-eraser { + @include ie7icon(''); +} + + +.icon-puzzle-piece { + @include ie7icon(''); +} + + +.icon-microphone { + @include ie7icon(''); +} + + +.icon-microphone-off { + @include ie7icon(''); +} + + +.icon-shield { + @include ie7icon(''); +} + + +.icon-calendar-empty { + @include ie7icon(''); +} + + +.icon-fire-extinguisher { + @include ie7icon(''); +} + + +.icon-rocket { + @include ie7icon(''); +} + + +.icon-maxcdn { + @include ie7icon(''); +} + + +.icon-chevron-sign-left { + @include ie7icon(''); +} + + +.icon-chevron-sign-right { + @include ie7icon(''); +} + + +.icon-chevron-sign-up { + @include ie7icon(''); +} + + +.icon-chevron-sign-down { + @include ie7icon(''); +} + + +.icon-html5 { + @include ie7icon(''); +} + + +.icon-css3 { + @include ie7icon(''); +} + + +.icon-anchor { + @include ie7icon(''); +} + + +.icon-unlock-alt { + @include ie7icon(''); +} + + +.icon-bullseye { + @include ie7icon(''); +} + + +.icon-ellipsis-horizontal { + @include ie7icon(''); +} + + +.icon-ellipsis-vertical { + @include ie7icon(''); +} + + +.icon-rss-sign { + @include ie7icon(''); +} + + +.icon-play-sign { + @include ie7icon(''); +} + + +.icon-ticket { + @include ie7icon(''); +} + + +.icon-minus-sign-alt { + @include ie7icon(''); +} + + +.icon-check-minus { + @include ie7icon(''); +} + + +.icon-level-up { + @include ie7icon(''); +} + + +.icon-level-down { + @include ie7icon(''); +} + + +.icon-check-sign { + @include ie7icon(''); +} + + +.icon-edit-sign { + @include ie7icon(''); +} + + +.icon-external-link-sign { + @include ie7icon(''); +} + + +.icon-share-sign { + @include ie7icon(''); +} + + +.icon-compass { + @include ie7icon(''); +} + + +.icon-collapse { + @include ie7icon(''); +} + + +.icon-collapse-top { + @include ie7icon(''); +} + + +.icon-expand { + @include ie7icon(''); +} + + +.icon-eur { + @include ie7icon(''); +} + +.icon-euro { + @include ie7icon(''); +} + + +.icon-gbp { + @include ie7icon(''); +} + + +.icon-usd { + @include ie7icon(''); +} + +.icon-dollar { + @include ie7icon(''); +} + + +.icon-inr { + @include ie7icon(''); +} + +.icon-rupee { + @include ie7icon(''); +} + + +.icon-jpy { + @include ie7icon(''); +} + +.icon-yen { + @include ie7icon(''); +} + + +.icon-cny { + @include ie7icon(''); +} + +.icon-renminbi { + @include ie7icon(''); +} + + +.icon-krw { + @include ie7icon(''); +} + +.icon-won { + @include ie7icon(''); +} + + +.icon-btc { + @include ie7icon(''); +} + +.icon-bitcoin { + @include ie7icon(''); +} + + +.icon-file { + @include ie7icon(''); +} + + +.icon-file-text { + @include ie7icon(''); +} + + +.icon-sort-by-alphabet { + @include ie7icon(''); +} + + +.icon-sort-by-alphabet-alt { + @include ie7icon(''); +} + + +.icon-sort-by-attributes { + @include ie7icon(''); +} + + +.icon-sort-by-attributes-alt { + @include ie7icon(''); +} + + +.icon-sort-by-order { + @include ie7icon(''); +} + + +.icon-sort-by-order-alt { + @include ie7icon(''); +} + + +.icon-thumbs-up { + @include ie7icon(''); +} + + +.icon-thumbs-down { + @include ie7icon(''); +} + + +.icon-youtube-sign { + @include ie7icon(''); +} + + +.icon-youtube { + @include ie7icon(''); +} + + +.icon-xing { + @include ie7icon(''); +} + + +.icon-xing-sign { + @include ie7icon(''); +} + + +.icon-youtube-play { + @include ie7icon(''); +} + + +.icon-dropbox { + @include ie7icon(''); +} + + +.icon-stackexchange { + @include ie7icon(''); +} + + +.icon-instagram { + @include ie7icon(''); +} + + +.icon-flickr { + @include ie7icon(''); +} + + +.icon-adn { + @include ie7icon(''); +} + + +.icon-bitbucket { + @include ie7icon(''); +} + + +.icon-bitbucket-sign { + @include ie7icon(''); +} + + +.icon-tumblr { + @include ie7icon(''); +} + + +.icon-tumblr-sign { + @include ie7icon(''); +} + + +.icon-long-arrow-down { + @include ie7icon(''); +} + + +.icon-long-arrow-up { + @include ie7icon(''); +} + + +.icon-long-arrow-left { + @include ie7icon(''); +} + + +.icon-long-arrow-right { + @include ie7icon(''); +} + + +.icon-apple { + @include ie7icon(''); +} + + +.icon-windows { + @include ie7icon(''); +} + + +.icon-android { + @include ie7icon(''); +} + + +.icon-linux { + @include ie7icon(''); +} + + +.icon-dribbble { + @include ie7icon(''); +} + + +.icon-skype { + @include ie7icon(''); +} + + +.icon-foursquare { + @include ie7icon(''); +} + + +.icon-trello { + @include ie7icon(''); +} + + +.icon-female { + @include ie7icon(''); +} + + +.icon-male { + @include ie7icon(''); +} + + +.icon-gittip { + @include ie7icon(''); +} + + +.icon-sun { + @include ie7icon(''); +} + + +.icon-moon { + @include ie7icon(''); +} + + +.icon-archive { + @include ie7icon(''); +} + + +.icon-bug { + @include ie7icon(''); +} + + +.icon-vk { + @include ie7icon(''); +} + + +.icon-weibo { + @include ie7icon(''); +} + + +.icon-renren { + @include ie7icon(''); +} + + diff --git a/stylesheets/font-awesome/scss/font-awesome.scss b/stylesheets/font-awesome/scss/font-awesome.scss new file mode 100644 index 00000000..e5903d85 --- /dev/null +++ b/stylesheets/font-awesome/scss/font-awesome.scss @@ -0,0 +1,33 @@ +/*! + * Font Awesome 3.2.1 + * the iconic font designed for Bootstrap + * ------------------------------------------------------------------------------ + * The full suite of pictographic icons, examples, and documentation can be + * found at http://fontawesome.io. Stay up to date on Twitter at + * http://twitter.com/fontawesome. + * + * License + * ------------------------------------------------------------------------------ + * - The Font Awesome font is licensed under SIL OFL 1.1 - + * http://scripts.sil.org/OFL + * - Font Awesome CSS, LESS, and SASS files are licensed under MIT License - + * http://opensource.org/licenses/mit-license.html + * - Font Awesome documentation licensed under CC BY 3.0 - + * http://creativecommons.org/licenses/by/3.0/ + * - Attribution is no longer required in Font Awesome 3.0, but much appreciated: + * "Font Awesome by Dave Gandy - http://fontawesome.io" + * + * Author - Dave Gandy + * ------------------------------------------------------------------------------ + * Email: dave@fontawesome.io + * Twitter: http://twitter.com/davegandy + * Work: Lead Product Designer @ Kyruus - http://kyruus.com + */ + +@import "variables"; +@import "mixins"; +@import "path"; +@import "core"; +@import "bootstrap"; +@import "extras"; +@import "icons"; diff --git a/stylesheets/futaba+vichan.css b/stylesheets/futaba+vichan.css index d8d6fd59..adf9baef 100644 --- a/stylesheets/futaba+vichan.css +++ b/stylesheets/futaba+vichan.css @@ -86,22 +86,19 @@ unimportant, .unimportant * { table.modlog tr th { background: #EA8; } - div.boardlist { - background-color: rgba(90%,90%,90%,0.2); + background-color: rgba(90%,90%,90%,0.2); } div.boardlist .sub { - background: none; + background: none; } div.boardlist.bottom { - background-color:transparent; + background-color:transparent; } .desktop-style div.boardlist:nth-child(1) { - text-shadow: #fff 1px 1px 1px, #fff -1px -1px 1px; + text-shadow: #fff 1px 1px 1px, #fff -1px -1px 1px; } - - .desktop-style div.boardlist:nth-child(1):hover { - background-color: rgba(90%, 90%, 90%, 0.55); + background-color: rgba(90%, 90%, 90%, 0.55); } diff --git a/stylesheets/gentoochan.css b/stylesheets/gentoochan.css index 8213eb26..eb3d6471 100644 --- a/stylesheets/gentoochan.css +++ b/stylesheets/gentoochan.css @@ -19,9 +19,12 @@ a.post_no { color: #ccc; } div.post.reply, input, textarea { - background: rgba(0, 0, 0, 0.1)!important; - border: 1px solid rgba(0, 0, 0, 0.2)!important; - border-radius: 2px !important; + background: rgba(0, 0, 0, 0.1); + border: 1px solid rgba(0, 0, 0, 0.2); + border-radius: 2px; +} +div.post.reply.post-hover { + background: rgba(200, 200, 200, 0.85); } div.post.reply.highlighted { background: #f0c0b0; diff --git a/stylesheets/img/bghead.png b/stylesheets/img/bghead.png Binary files differnew file mode 100644 index 00000000..94202009 --- /dev/null +++ b/stylesheets/img/bghead.png diff --git a/stylesheets/img/roachtlo.png b/stylesheets/img/roachtlo.png Binary files differnew file mode 100644 index 00000000..f3a9cefc --- /dev/null +++ b/stylesheets/img/roachtlo.png diff --git a/stylesheets/miku.css b/stylesheets/miku.css index 95d9b2de..2f55b48c 100644 --- a/stylesheets/miku.css +++ b/stylesheets/miku.css @@ -1,97 +1,97 @@ -/**
- * miku.css
- * For AwsumChan by Circlepuller
- */
-body {
- background: #D2FFEE url('img/fade-miku.png') top repeat-x;
-}
-
-a:link, a:visited {
- text-decoration: none;
- color: #00637B;
-}
-
-a:link:hover, a:visited:hover {
- color: #DD0000;
-}
-
-a.post_no {
- color: #000033;
-}
-
-p.intro a.email span.name {
- color: #0093AB;
-}
-
-p.intro a.email:hover span.name {
- color: #DD0000;
-}
-
-h2, div.title, h1 {
- color: #800000;
-}
-
-form table tr th {
- background: #95D2D3;
-}
-
-div.banner {
- background-color: #E04000;
-}
-
-div.post.op hr {
- border-color: #B7C9D5;
-}
-
-p.intro span.subject {
- color: #117743;
- font-weight: 800;
-}
-
-p.intro span.name {
- color: #117743;
- font-weight: 800;
-}
-
-div.post.reply.highlighted {
- background: #a9d8ff;
-}
-
-div.post.reply {
- background: #B6DDDE;
- border-color: #8FCCCD;
-}
-
-div.ban {
- border: 1px solid #0093AB;
-}
-
-div.ban h2 {
- background: #B6DDDE;
- color: #0093AB;
-}
-
-div.pages {
- color: #8899AA;
- background: #B6DDDE;
- border-right: 1px solid #8FCCCD;
- border-bottom: 1px solid #8FCCCD;
-}
-
-hr {
- border-color: #B7D9C5;
-}
-
-div.boardlist {
- color: #0093AB;
- background-color: rgba(65%, 85%, 95%, 0.2);
-}
-
-.desktop-style div.boardlist:nth-child(1) {
- text-shadow: #D2FFEE 1px 1px 1px, #D2FFEE -1px -1px 1px;
-}
-
-
-.desktop-style div.boardlist:nth-child(1):hover {
- background-color: rgba(70%, 95%, 100%, 0.45);
-}
\ No newline at end of file +/** + * miku.css + * For AwsumChan by Circlepuller + */ +body { + background: #D2FFEE url('img/fade-miku.png') top repeat-x; +} + +a:link, a:visited { + text-decoration: none; + color: #00637B; +} + +a:link:hover, a:visited:hover { + color: #DD0000; +} + +a.post_no { + color: #000033; +} + +p.intro a.email span.name { + color: #0093AB; +} + +p.intro a.email:hover span.name { + color: #DD0000; +} + +h2, div.title, h1 { + color: #800000; +} + +form table tr th { + background: #95D2D3; +} + +div.banner { + background-color: #E04000; +} + +div.post.op hr { + border-color: #B7C9D5; +} + +p.intro span.subject { + color: #117743; + font-weight: 800; +} + +p.intro span.name { + color: #117743; + font-weight: 800; +} + +div.post.reply.highlighted { + background: #a9d8ff; +} + +div.post.reply { + background: #B6DDDE; + border-color: #8FCCCD; +} + +div.ban { + border: 1px solid #0093AB; +} + +div.ban h2 { + background: #B6DDDE; + color: #0093AB; +} + +div.pages { + color: #8899AA; + background: #B6DDDE; + border-right: 1px solid #8FCCCD; + border-bottom: 1px solid #8FCCCD; +} + +hr { + border-color: #B7D9C5; +} + +div.boardlist { + color: #0093AB; + background-color: rgba(65%, 85%, 95%, 0.2); +} + +.desktop-style div.boardlist:nth-child(1) { + text-shadow: #D2FFEE 1px 1px 1px, #D2FFEE -1px -1px 1px; +} + + +.desktop-style div.boardlist:nth-child(1):hover { + background-color: rgba(70%, 95%, 100%, 0.45); +} diff --git a/stylesheets/ricechan.css b/stylesheets/ricechan.css new file mode 100644 index 00000000..c6ba19b6 --- /dev/null +++ b/stylesheets/ricechan.css @@ -0,0 +1,249 @@ +/* http://userstyles.org/styles/37014/4chan-ricechan-alpha */ + +.rules, +.logo+hr, +.logo+hr+div, +.logo+hr+div+hr, +hr+script+center>a, +hr+script+center+hr, +#recaptcha_logo, +#recaptcha_tagline, +table+br+hr+center>a, +table+br+hr+center+hr, +.postarea>form>div[style]>a[target], +.doubledash {display:none !important} + +* { + border: none !important; + background: none !important; + color: inherit !important; +} +html { + color: #555 !important; + background: #222 !important; +} +#navtop { + position: absolute; + top:0;left:0;right:0; + color: #666 !important; + background: #111 !important; + border-bottom: 1px solid #282828 !important; + text-align: center; + margin: -4px; + padding: 3px; +} +#navtop a { + color: #9f0 !important; +} +hr { + border-bottom: 1px solid rgba(0,0,0,0.5) !important; + border-top: 1px solid rgba(255,255,255,0.1) !important; +} +h1 { + color: #AF2020 !important; +} +a>img { + box-shadow: 0 0 6px #000; + -moz-box-shadow: 0 0 6px #000; + -webkit-box-shadow: 0 0 6px #000; +} +.logo b { + color: #fff !important; +} +div.boardlist a { + text-decoration: none; + color: #615A5A !important; +} +div.boardlist a:hover { + color: #C08E8E !important; +} +.postarea { + color: #fff !important; + position: fixed; + top:0; right:0; +} +.postblock { + color: #999 !important; +} +.postarea form { + padding-left: 12px; + opacity: .1; + width: 0; +} +.postarea form:hover { + width: auto; + opacity: 1; + background: rgba(0,0,0,0.8) !important; + border-radius: 0 0 0 32px; + -moz-border-radius: 0 0 0 32px; + -webkit-border-radius: 0 0 0 32px; + box-shadow: 0 0 32px #000; + -moz-box-shadow: 0 0 32px #000; + -webkit-box-shadow: 0 0 32px #000; +} +tr>th>font { /*POSTINGMODE*/ + position: fixed; + top:-2px; right:0; + font-size: 0; +} +tr>th>font:after { + color: #f00 !important; + content: 'REPLY'; + font-size: 48px; +} +form table tr th { + background: #7E3737 !important; + color: #B99B9B !important; +} +input[type="text"], input[type="password"], textarea, select { + border: 2px solid rgba(94, 50, 50, 0.56) !important; + background: #7C7373 !important; + color: #311313 !important; +} +a:hover { + color: #8E748F !important; +} +a { + color: #7C7E7C !important; +} +form>table { + padding: 4px !important; +} +.reply, .replyhl { + background: rgba(0,0,0,0.25) !important; + border: 1px solid #161616 !important; + margin: 8px !important; + border-radius: 12px; + -moz-border-radius: 12px; + -webkit-border-radius: 12px; + box-shadow: 0 0 6px rgba(0,0,0,0.5); + -moz-box-shadow: 0 0 6px rgba(0,0,0,0.5); + -webkit-box-shadow: 0 0 6px rgba(0,0,0,0.5); +} +h1 { + color: #962B22 !important; + letter-spacing: 1px; +} +.replyhl { + border: 1px solid #9f0 !important; + border-width: 4px 0 !important; +} +.post.reply.highlighted { + background: rgba(18, 21, 22, 0.6) !important; +} +.omitted { + font-style: italic; +} +#de-menu { + rgba(0, 0, 0, 0.85) !important; +} +#de-alert { + rgba(0, 0, 0, 0.85) !important; +} +.de-pview { + background: rgba(0,0,0,0.86) !important; + border: 1px solid #161616 !important; + margin: 8px !important; + border-radius: 12px; + -moz-border-radius: 12px; + -webkit-border-radius: 12px; + box-shadow: 0 0 6px rgba(0,0,0,0.5); + -moz-box-shadow: 0 0 6px rgba(0,0,0,0.5); + -webkit-box-shadow: 0 0 6px rgba(0,0,0,0.5); +} +.name,.commentpostername { + color: #999 !important; +} +.trip { + color: #644 !important; +} +.capcode { + color: #BB1212!important; +} +.de-ppanel-cnt:after { + color: #3A5252 !important; +} +.public_ban { + color: #E62C2C !important; +} +blockquote { + color: #fff !important; +} +.quotejs { + color: #999 !important; +} +.quotelink { + color: #9f0 !important; +} +.unkfunc { + color: #6c6 !important; +} +.de-refmap:before { + color: #707A86 !important; +} +.de-refmap { + color: #4C505E !important; +} +p.intro a.email span.name { + text-decoration: underline; +} +.quote { + color: #82A259 !important; +} +.delete { + color: #857979 !important; +} + +.commentpostername>span[style] { + color: #f0c !important; + font-size: 1.1em; +} +a[href="mailto:sage"] { + text-decoration: none !important; +} +a[href="mailto:sage"]:before { + color: #f90; + content: '「SAGE」'; + text-shadow: 0 -1px 1px #f00; +} +.heading { + color: #B41818 !important; + font-size: 13pt !important; + text-shadow: 0 0 0.55em #522121 !important +} +strong { + color: #706E6E !important; +} +.subject { + color: #819173 !important; +} +.spoiler { + background: #D3CABC !important; + color: #D3CABC !important; +} +.spoiler:hover { + color: #3F3535 !important; +} +.filesize span { + font-size: .01em; + letter-spacing: -5em; +} +.filesize span:before { + font-size: 100em; + letter-spacing: 0; + content: attr(title); +} + +.spoiler { + color: #161515 !important; + background: #141313 !important; +} +span.spoiler:hover { + color: #858585 !important; + background: #2C2929 !important; +} +br+br+b[style] { + color: #f00 !important; +} + +}
\ No newline at end of file diff --git a/stylesheets/roach.css b/stylesheets/roach.css new file mode 100644 index 00000000..ab5ab6c1 --- /dev/null +++ b/stylesheets/roach.css @@ -0,0 +1,256 @@ +html, body { + background:#FFFEED !important; + background-image: url('img/bghead.png'), url('img/roachtlo.png') !important; + background-repeat: repeat-x, no-repeat !important; + background-attachment: fixed, fixed !important; + background-position:top, right bottom !important; + color:#835B36 !important; + font-family: sans-serif !important; + font-size: 90% !important; +} +a { + color:#888 !important; + text-decoration: none !important; +} +a:hover { + color:#000 !important; +} +.reflink a:hover{ + font-weight: bold !important; +} +input, textarea { +background-color: #fff !important; +color: #000 !important; +border: 1px solid #CCC !important; +} +input:focus, textarea:focus +{ +background-color: #fff !important; +} +.adminbar { + text-align:right !important; + clear:both !important; + float:right !important; + font-size: 13px !important; +} +.navbar { + font-size: 13px !important; +} +header { + clear:both !important; + text-align:center !important; + font-size:1.7em !important; + color:#455736 !important; + width:100% !important; +} +header div.subtitle, h1 { + color:#455736 !important; +} +div.banner { + background:#F3DBA7 !important; + text-align:center !important; + padding:2px !important; + color:#835B36 !important; + width:100% !important; + margin: 0 !important; + font-weight: normal !important; + font-size: 90% !important; +} +.catalogmode { + background:#0040E0 !important; + text-align:center !important; + padding:2px !important; + color:#FFFFFF !important; + width:100% !important; +} +.postarea { + background:inherit !important; +} +.rules { + /*font-size:0.7em !important;*/ + width: 468px !important; + font-size: 10px !important; + font-family: sans-serif !important; +} +.rules li { + margin-left: 1em !important; + /*text-indent: 0em !important;*/ +} +form table tr th, form table th, .postblock { + background:#CDC8A3 !important; + color:#455736 !important; + font-weight:800 !important; + text-align: left !important; + padding-left: 3px !important; + padding-right: 3px !important; + border: none !important; +} +.footer { + text-align:center !important; + font-size:12px !important; + font-family:serif !important; +} +.passvalid { + background:#F3DBA7 !important; + text-align:center !important; + width:100% !important; + color:#ffffff !important; +} +.dellist { + font-weight: bold !important; + text-align:center !important; +} +.delbuttons { + text-align:center !important; + padding-bottom:4px !important; + +} +.managehead { + background:#AAAA66 !important; + color:#400000 !important; + padding:0px !important; +} +.postlists { + background:#FFFFFF !important; + width:100% !important; + padding:0px !important; + color:#FFF !important; +} +.row1 { + background:#EEEECC !important; + color:#FFF !important; +} +.row2 { + background:#DDDDAA !important; + color:#FFF !important; +} +.unkfunc { + background:inherit !important; + color:#789922 !important; +} +.filesize { + text-decoration:none !important; +} +.filetitle { + background:inherit !important; + font-size:1.2em !important; + color:#6D9E55 !important; + font-weight:800 !important; +} +.postername { + color:#117743 !important; + font-weight:bold !important; +} +.postertrip { + color:#117743 !important; +} +.oldpost { + color:#6D9E55 !important; + font-weight:800 !important; +} +.omittedposts { + color:#707070 !important; +} + +.reply { + background: rgba(210,140,0,0.3) !important; + color: #835B36 !important; + -moz-border-radius: 5px !important; + -webkit-border-radius: 5px !important; + padding: 5px !important; + border-style: none !important; +} +.post-hover { + background: rgba(241,219,165,1) !important; + border-style: none !important; + border: 1px dashed #000000 !important; +} +.replyhl { + background: #F0C0B0 !important; + color: #FFF !important; +} +.doubledash { + vertical-align:top !important; + clear:both !important; + float:left !important; +} +.replytitle { + font-size: 1.0em !important; + color:#6D9E55 !important; + font-weight:800 !important; +} +.commentpostername { + color:#117743 !important; + font-weight:800 !important; +} +.thumbnailmsg { + font-size: small !important; + color:#FFF !important; +} +.abbrev { + color:#707070 !important; +} +.highlighted { + background:#F3DBA7 !important; + color:#707070 !important; + border: 2px dashed #707070 !important; +} +#watchedthreads { + background-color: #F3DBa7 !important; +} + +.hidethread { + background: transparent url('./icons/blueplus/icons.gif') -32px -16px no-repeat !important; +} + +.unhidethread { + background: transparent url('./icons/blueplus/icons.gif') -48px 0px no-repeat !important; +} + +.watchthread { + background: transparent url('./icons/blueplus/icons.gif') -32px 0px no-repeat !important; +} + +.expandthread { + background: transparent url('./icons/blueplus/icons.gif') 0px -16px no-repeat !important; +} + +.quickreply { + background: transparent url('./icons/blueplus/icons.gif') 0px 0px no-repeat !important; +} + +.hidewatchedthreads { + background: transparent url('./icons/blueplus/icons.gif') -48px -16px no-repeat !important; +} + +.refreshwatchedthreads { + background: transparent url('./icons/blueplus/icons.gif') -16px -16px no-repeat !important; +} + +.restorewatchedthreads { + background: transparent url('./icons/blueplus/icons.gif') -16px 0px no-repeat !important; +} +.reflinkpreview { + background-color: #F3DBA7 !important; +} +div.pages { +background: none; +border-right: none; +border-bottom: none; +display: inline; +padding: 4px; +border: 4px double #000; +border-collapse: separate; +border-spacing: 2px; +border-color: gray; +color: #835B36 !important; +} +hr { +border-top: 1px solid #835B36 !important; +} +.desktop-style div.boardlist:nth-child(1) { + background: none repeat scroll 0 0 #FFFFFF !important; +} +.desktop-style div.boardlist:nth-child(1):hover { + background: none repeat scroll 0 0 #FFFFFF; +}
\ No newline at end of file diff --git a/stylesheets/stripes.css b/stylesheets/stripes.css index da3f2aab..61a9d326 100644 --- a/stylesheets/stripes.css +++ b/stylesheets/stripes.css @@ -1,67 +1,67 @@ -/**
- * stripes.css
- * for vichan by klaczy
- */
-body {
- background: url('img/stripes_bg.png');
- color: #BBB;
- font-family: 'Hevletica', sans-serif;
- font-size: 12px;
-}
-div.boardlist:nth-child(1):hover {
- background: #222 !important;
-}
-div.reply, div.pages {
- background: -moz-linear-gradient(bottom, #323232 40%, #2E2E2E 75%) !important;
- border: 1px solid #2D2D2D !important;
- box-shadow: 0px 0px 10px #2C2C2C;
- color: #BBB !important;
-}
-.reply {
- margin-top: 0.5em !important;
-}
-.body a, a:hover {
- color: #FF6666;
-}
-table th { background: none !important }
-a, a:visited {
- color: #BBB;
-}
-hr {
- border: 0 !important;
- height: 1px !important;
- background-color: #AAA !important;
- margin: 1.5em 0 1.5em !important;
-}
-.name, .body a {
- color: #FF6666 !important;
-}
-.subject, h1, .subtitle, .selected {
- color: #FF6699 !important;
-}
-.capcode {
- color: #FF66CC !important;
-}
-input, textarea {
- background: url('img/stripes_textarea.png');
- border: 1px #CCC;
- border-radius: 3px;
- padding: 3px;
-}
-input[type="text"] { width: 200px }
-textarea {
- background-size: 100% 100%;
- background-color: #FCFCFC;
- background-repeat: repeat-x;
- width: 100%;
- height: 200px;
-}
-input[type="submit"] {
- border: 1px solid rgb(204, 204, 204);
- background: url('img/stripes_submit.png');
- height: 23px;
- margin-left: 0.5em;
-}
-.delete {
- margin-top: 0.5em;
-}
+/** + * stripes.css + * for vichan by klaczy + */ +body { + background: url('img/stripes_bg.png'); + color: #BBB; + font-family: 'Hevletica', sans-serif; + font-size: 12px; +} +div.boardlist:nth-child(1):hover { + background: #222 !important; +} +div.reply, div.pages { + background: -moz-linear-gradient(bottom, #323232 40%, #2E2E2E 75%) !important; + border: 1px solid #2D2D2D !important; + box-shadow: 0px 0px 10px #2C2C2C; + color: #BBB !important; +} +.reply { + margin-top: 0.5em !important; +} +.body a, a:hover { + color: #FF6666; +} +table th { background: none !important } +a, a:visited { + color: #BBB; +} +hr { + border: 0 !important; + height: 1px !important; + background-color: #AAA !important; + margin: 1.5em 0 1.5em !important; +} +.name, .body a { + color: #FF6666 !important; +} +.subject, h1, .subtitle, .selected { + color: #FF6699 !important; +} +.capcode { + color: #FF66CC !important; +} +input, textarea { + background: url('img/stripes_textarea.png'); + border: 1px #CCC; + border-radius: 3px; + padding: 3px; +} +input[type="text"] { width: 200px } +textarea { + background-size: 100% 100%; + background-color: #FCFCFC; + background-repeat: repeat-x; + width: 100%; + height: 200px; +} +input[type="submit"] { + border: 1px solid rgb(204, 204, 204); + background: url('img/stripes_submit.png'); + height: 23px; + margin-left: 0.5em; +} +.delete { + margin-top: 0.5em; +} diff --git a/stylesheets/style.css b/stylesheets/style.css index 8c417d52..fbb5370f 100644 --- a/stylesheets/style.css +++ b/stylesheets/style.css @@ -145,6 +145,10 @@ div.post img.icon { margin: 0 5px; padding: 0; } +div.post i.icon { + margin: 0 4px; + font-size: 16px; +} div.post.op { margin-right: 20px; margin-bottom: 5px; @@ -401,7 +405,6 @@ table.mod.config-editor td { table.mod.config-editor input[type="text"] { width: 98%; } - .desktop-style div.boardlist:nth-child(1) { position: fixed; top: 0px; @@ -454,6 +457,7 @@ table.mod.config-editor input[type="text"] { background-color: #fff; opacity: 0.8; } -.thread-hidden { - opacity: 0.5; +p.intro.thread-hidden { + margin: 0px; + padding: 0px; } diff --git a/stylesheets/testorange.css b/stylesheets/testorange.css index 30e7274b..c7250de4 100644 --- a/stylesheets/testorange.css +++ b/stylesheets/testorange.css @@ -1,211 +1,211 @@ -/* +piwnichan style, based on testorange.css from Karachan */
-
-body {
- font-family: sans-serif;
- font-size: 12px;
- color:#bebebe;
-
- background-color: #1e1e1e;
- background-image: url('img/testorange_testo.png'), url('img/testorange_top_bg.gif'), url('img/testorange_bg.gif');
- background-repeat: no-repeat, repeat-x, repeat;
- background-attachment: fixed, scroll, scroll;
- background-position: right bottom, 0% 0%, 0% 0%;
-}
-
-.desktop-style .bl-menu{
-background-image: url('img/testorange_bg.gif');
- background-repeat: repeat;
-}
-
-.boardlist .board a {
-background-image: url('img/testorange_bg.gif');
- background-repeat: repeat;
-}
-
-
-
-
-a:link, a:visited, div.post.reply div.body a {
- color:#ff9100;
- text-decoration: none;
-}
-a:link:hover, a:visited:hover, div.post.reply div.body a:hover {
- color:#ffff00;
-}
-
-a.email span.name {
- color:#ff9100 !important;
-}
-
-div.post.reply.highlighted {
-background: black;
-}
-
-input {
- color: #000;
- background: #fff;
-}
-textarea {
- background: #dedede url('img/testorange_textarea_bg.gif') repeat-x;
-}
-input, textarea {
- border: 1px #fff solid;
-}
-
-hr {
- width: 100%;
- height: 1px;
- border: none;
- background: #707070;
- overflow: hidden;
-}
-
-.reflink a:hover{
- font-weight: bold;
-}
-.adminbar {
- text-align:right;
- clear:both;
- float:right;
-}
-h1 {
- clear:both;
- text-align:center;
- font-size: 2.5em;
- color:#ff9100;
- width:100%;
-}
-div.title {
- color:#ff9100;
-}
-div.banner, .replymode, .catalogmode {
- text-align:center;
- margin: 5px 0 5px 0;
- padding: 5px 2px 5px 2px;
- color:#000;
- font-weight: bold;
- width:100%;
-}
-.postblock, form table th {
- color: #000;
- font-size: 11px;
- font-weight: bold;
- text-align: center !important;
-}
-
-.postarea {
-}
-.rules {
- width: 468px;
- font-size: 10px;
-}
-.rules li {
- margin-left: 1em;
-}
-.footer {
- text-align:center;
- font-size:12px;
-}
-.passvalid {
- text-align:center;
- width:100%;
- color:#ffffff;
-}
-.dellist {
- font-weight: bold;
- text-align:center;
-}
-.delbuttons {
- text-align:center;
- padding-bottom:4px;
-
-}
-.managehead {
- background-color: #1e1e1e;
- color: #bebebe;
- padding:0px;
-}
-.postlists {
- background: #000;
- width:100%;
- padding:0px;
- color: #bebebe;
-}
-.row1 {
- background-color: #1e1e1e;
- color: #bebebe;
-}
-.row2 {
- background: #1e1e1e;
- color: #bebebe;
-}
-.unkfunc {
- background:inherit;
- color:#789922;
-}
-.filesize {
- text-decoration:none;
-}
-.filetitle {
- background:inherit;
- font-size:1.2em;
- color: #bebebe;
- font-weight:800;
-}
-span.name, .postername {
- color:#fff !important;
- font-weight:bold;
-}
-span.trip, .postertrip {
- color:#707070;
-}
-.oldpost {
- color:#CC1105;
- font-weight:800;
-}
-.omittedposts {
- color:#707070;
-}
-div.post.reply {
- padding: 5px;
- border: 1px #707070 solid !important;
- background: #282828;
- -webkit-border-radius: 10px;
- -khtml-border-radius: 10px;
- -moz-border-radius: 10px;
- border-radius: 10px;
-}
-.replyhl {
- background-color: #1e1e1e;
- color: #bebebe;
-}
-form table th, div.banner, div.pages, .replymode, .postblock, .passvalid, .catalogmode {
- background: #ff9100 url('img/testorange_f_bg.gif') repeat-x !important;
-}
-div.pages, div.pages a {
- color: black;
- border: 0;
-}
-div.boardlist {
- background-color: rgba(5%,5%,5%,0.2);
-}
-div.boardlist.bottom {
- background-color:transparent;
-}
-
-.desktop-style div.boardlist:nth-child(1) {
- text-shadow: #000 1px 1px 1px, #500 -1px -1px 1px;
-}
-
-
-.desktop-style div.boardlist:nth-child(1):hover {
- background-color: rgba(0%, 0%, 0%, 0.45);
-}
-
-p.intro span.subject {
- color:#ee8100;
-}
-
-span.quote {
- color: #a8c952;
+/* +piwnichan style, based on testorange.css from Karachan */ + +body { + font-family: sans-serif; + font-size: 12px; + color:#bebebe; + + background-color: #1e1e1e; + background-image: url('img/testorange_testo.png'), url('img/testorange_top_bg.gif'), url('img/testorange_bg.gif'); + background-repeat: no-repeat, repeat-x, repeat; + background-attachment: fixed, scroll, scroll; + background-position: right bottom, 0% 0%, 0% 0%; +} + +.desktop-style .bl-menu{ +background-image: url('img/testorange_bg.gif'); + background-repeat: repeat; +} + +.boardlist .board a { +background-image: url('img/testorange_bg.gif'); + background-repeat: repeat; +} + + + + +a:link, a:visited, div.post.reply div.body a { + color:#ff9100; + text-decoration: none; +} +a:link:hover, a:visited:hover, div.post.reply div.body a:hover { + color:#ffff00; +} + +a.email span.name { + color:#ff9100 !important; +} + +div.post.reply.highlighted { +background: black; +} + +input { + color: #000; + background: #fff; +} +textarea { + background: #dedede url('img/testorange_textarea_bg.gif') repeat-x; +} +input, textarea { + border: 1px #fff solid; +} + +hr { + width: 100%; + height: 1px; + border: none; + background: #707070; + overflow: hidden; +} + +.reflink a:hover{ + font-weight: bold; +} +.adminbar { + text-align:right; + clear:both; + float:right; +} +h1 { + clear:both; + text-align:center; + font-size: 2.5em; + color:#ff9100; + width:100%; +} +div.title { + color:#ff9100; +} +div.banner, .replymode, .catalogmode { + text-align:center; + margin: 5px 0 5px 0; + padding: 5px 2px 5px 2px; + color:#000; + font-weight: bold; + width:100%; +} +.postblock, form table th { + color: #000; + font-size: 11px; + font-weight: bold; + text-align: center !important; +} + +.postarea { +} +.rules { + width: 468px; + font-size: 10px; +} +.rules li { + margin-left: 1em; +} +.footer { + text-align:center; + font-size:12px; +} +.passvalid { + text-align:center; + width:100%; + color:#ffffff; +} +.dellist { + font-weight: bold; + text-align:center; +} +.delbuttons { + text-align:center; + padding-bottom:4px; + +} +.managehead { + background-color: #1e1e1e; + color: #bebebe; + padding:0px; +} +.postlists { + background: #000; + width:100%; + padding:0px; + color: #bebebe; +} +.row1 { + background-color: #1e1e1e; + color: #bebebe; +} +.row2 { + background: #1e1e1e; + color: #bebebe; +} +.unkfunc { + background:inherit; + color:#789922; +} +.filesize { + text-decoration:none; +} +.filetitle { + background:inherit; + font-size:1.2em; + color: #bebebe; + font-weight:800; +} +span.name, .postername { + color:#fff !important; + font-weight:bold; +} +span.trip, .postertrip { + color:#707070; +} +.oldpost { + color:#CC1105; + font-weight:800; +} +.omittedposts { + color:#707070; +} +div.post.reply { + padding: 5px; + border: 1px #707070 solid !important; + background: #282828; + -webkit-border-radius: 10px; + -khtml-border-radius: 10px; + -moz-border-radius: 10px; + border-radius: 10px; +} +.replyhl { + background-color: #1e1e1e; + color: #bebebe; +} +form table th, div.banner, div.pages, .replymode, .postblock, .passvalid, .catalogmode { + background: #ff9100 url('img/testorange_f_bg.gif') repeat-x !important; +} +div.pages, div.pages a { + color: black; + border: 0; +} +div.boardlist { + background-color: rgba(5%,5%,5%,0.2); +} +div.boardlist.bottom { + background-color:transparent; +} + +.desktop-style div.boardlist:nth-child(1) { + text-shadow: #000 1px 1px 1px, #500 -1px -1px 1px; +} + + +.desktop-style div.boardlist:nth-child(1):hover { + background-color: rgba(0%, 0%, 0%, 0.45); +} + +p.intro span.subject { + color:#ee8100; +} + +span.quote { + color: #a8c952; } diff --git a/stylesheets/wasabi.css b/stylesheets/wasabi.css index cf7041fe..3da974c3 100644 --- a/stylesheets/wasabi.css +++ b/stylesheets/wasabi.css @@ -1,402 +1,402 @@ -/**
- * wasabi.css
- * For AwsumChan by Circlepuller
- */
-body {
- background: #F7F9B0 url('img/fade-yellow.png') repeat-x 50% 0%;
- color: black;
- font-family: arial, helvetica, sans-serif;
- font-size: 10pt;
- margin: 0 8px;
- padding-left: 5px;
- padding-right: 5px;
-}
-table * {
- margin: 0;
-}
-a:link, a:visited {
- text-decoration: underline;
- color: #400040;
-}
-a:link:hover, a:visited:hover {
- color: limegreen;
-}
-a.post_no {
- color: black;
- text-decoration: none;
- margin: 0;
- padding: 0;
-}
-p.intro a.post_no, p.intro a.email {
- margin: 0;
-}
-p.intro a.email span.name {
- color: #34345C;
-}
-p.intro a.email:hover span.name {
- color: #ff0000;
-}
-p.intro label {
- display: inline;
-}
-h2 {
- color: #AF0A0F;
- font-size: 11pt;
- margin: 0px;
- padding: 0px;
-}
-h1 {
- font-family: tahoma;
- letter-spacing: -2px;
- font-size: 20pt;
- margin-bottom: 0;
-}
-h1.logo img {
- display: inline;
- float: none;
- background-image: url('/static/logo_bg.gif');
- background-repeat: no-repeat;
- background-position: center;
-}
-div.title, h1 {
- color: #AF0A0F;
- text-align: center;
-}
-div.title {
- font-size: 8pt;
- margin-bottom: 2em;
-}
-form {
- margin-bottom: 4em;
-}
-form table {
- margin: auto;
-}
-form table input {
- height: auto;
-}
-input[type="text"], input[type="password"], textarea {
- border: 1px solid #a9a9a9;
- text-indent: 0px;
- text-shadow: none;
- text-transform: none;
- word-spacing: normal;
-}
-form table tr td {
- text-align: left;
- margin: 0px;
- padding: 0px;
-}
-form table tr th {
- text-align: left;
- padding: 4px;
-}
-form table tr th {
- background: #D7FE85;
-}
-form table tr td div {
- text-align: center;
- float: left;
- padding-left: 3px;
-}
-form table tr td div input {
- display: block;
- margin: 2px auto 0 auto;
-}
-form table tr td div label {
- font-size: 10px;
-}
-.unimportant, .unimportant * {
- font-size: 10px;
-}
-p.fileinfo {
- display: block;
- margin: 0px;
- padding-right: 7em;
-}
-div.banner {
- background-color: #400040;
- font-size: 12pt;
- font-weight: bold;
- text-align: center;
- margin: 1em 0;
-}
-div.banner, div.banner a {
- color: white;
-}
-div.banner a:hover {
- color: #EEF2FF;
- text-decoration: none;
-}
-img.banner {
- float: none;
- margin: 4px auto 0 auto;
-}
-img {
- display: block;
- float: left;
- margin: 10px 20px;
- border: none;
-}
-div.post img {
- padding: 5px;
- margin: 5px 20px 0 0;
-}
-div.post img.icon {
- display: inline;
- float: none;
- margin: 0 5px;
- padding: 0;
-}
-div.post.op {
- margin-right: 20px;
- margin-bottom: 5px;
-}
-div.post.op hr {
- border-color: #D9BFB7;
-}
-p.intro {
- margin: 0.5em 0;
- padding: 0;
- padding-bottom: 0.2em;
-}
-input.delete {
- float: left;
- margin: 1px 6px 0 0;
-}
-p.intro span.subject {
- color: #0F0C5D;
- font-weight: bold;
-}
-p.intro span.name {
- color: #117743;
- font-weight: bold;
-}
-p.intro a.capcode, p.intro a.nametag {
- color: #F00000;
- margin-left: 0;
-}
-p.intro a {
- margin-left: 8px;
-}
-div.delete {
- float: right;
-}
-div.post.reply p {
- margin: 0.3em 0 0 0;
-}
-div.post.reply div.body {
- margin-left: 1.8em;
- margin-top: 0.8em;
- padding-right: 3em;
- padding-bottom: 0.3em;
-}
-div.post.reply.highlighted {
- background-color: #FFF;
- border-color: #CCC;
-}
-div.post.reply div.body a {
- color: #D00;
-}
-div.post {
- max-width: 97%;
-}
-div.post div.body {
- word-wrap: break-word;
-}
-div.post.reply {
- background: #D7FE85;
- margin: 0.2em 16px;
- padding: 0.2em 0.3em 0.5em 0.6em;
- border-width: 1px;
- border-style: none solid solid none;
- border-color: lightgreen;
- display: inline-block;
-}
-span.trip {
- color: #228854;
-}
-span.quote {
- color: #3C6D8A;
-}
-span.omitted {
- display: block;
- margin-top: 1em;
-}
-br.clear {
- clear: left;
-}
-span.controls {
- float: right;
- margin: 0;
- padding: 0;
- font-size: 80%;
-}
-span.controls.op {
- float: none;
- margin-left: 10px;
-}
-span.controls a {
- margin: 0;
-}
-div#wrap {
- width: 900px;
- margin:0 auto;
-}
-div.ban {
- background-color: white;
- border: 1px solid #400040;
- max-width: 700px;
- margin: 30px auto;
-}
-div.ban p, div.ban h2 {
- padding: 3px 7px;
-}
-div.ban h2 {
- background: #D7FE85;
- color: #400040;
- font-size: 12pt;
-}
-div.ban p {
- font-size: 12px;
- margin-bottom: 12px;
-}
-div.ban p.reason {
- font-weight: bold;
-}
-span.heading {
- color: #AF0A0F;
- font-size: 11pt;
- font-weight: bold;
- display: block;
-}
-span.spoiler {
- background: black;
- color: black;
-}
-div.post.reply div.body span.spoiler a {
- color: black;
-}
-span.spoiler:hover, div.post.reply div.body span.spoiler:hover a {
- color: white;
-}
-div.styles {
- float: right;
- padding-bottom: 20px;
-}
-div.styles a {
- margin: 0 10px;
-}
-div.styles a.selected {
- text-decoration: none;
-}
-table.test {
- width: 100%;
-}
-table.test td, table.test th {
- text-align: left;
- padding: 5px;
-}
-table.test tr.h th {
- background: #98E;
-}
-table.test td img {
- margin: 0;
-}
-fieldset label {
- display: block;
-}
-div.pages {
- color: limegreen;
- background: #D7FE85;
- display: inline;
- padding: 8px;
- border-right: 1px solid limegreen;
- border-bottom: 1px solid limegreen;
-}
-div.pages a.selected {
- color: black;
- font-weight: bolder;
-}
-div.pages a:link {
- text-decoration: none;
-}
-div.pages form {
- margin: 0;
- padding: 0;
- display: inline;
-}
-div.pages form input {
- margin: 0 5px;
- display: inline;
-}
-hr {
- border: none;
- border-top: 1px solid limegreen;
- height: 0px;
-}
-div.boardlist {
- color: limegreen;
- font-size: 9pt;
- margin-top: 3px;
-}
-div.boardlist.bottom {
- margin-top: 20px;
-}
-div.boardlist a {
- text-decoration: none;
- color:#ffff22;
- text-shadow: #000 1px 1px 1px, #000 -1px -1px 1px, #950000 1px 1px 2px, #009500 -1px -1px 2px;
-}
-div.report {
- color: #333;
-}
-table.modlog {
- margin: auto;
- width: 100%;
-}
-table.modlog tr td {
- text-align: left;
- margin: 0px;
- padding: 4px 15px 0 0;
-}
-table.modlog tr th {
- text-align: left;
- padding: 4px 15px 5px 5px;
- white-space: nowrap;
-}
-table.modlog tr th {
- background: #D7FE85;
-}
-td.minimal, th.minimal {
- width: 1%;
- white-space: nowrap;
-}
-div.top_notice {
- text-align: center;
- margin: 5px auto;
-}
-span.public_ban {
- display: block;
- color: red;
- font-weight: bold;
- margin-top: 15px;
-}
-span.toolong {
- display: block;
- margin-top: 15px;
-}
-div.blotter {
- color: red;
- font-weight: bold;
- text-align: center;
-}
-
-.desktop-style div.boardlist:nth-child(1) {
-
-}
-
-
-.desktop-style div.boardlist:nth-child(1):hover {
- background-color: rgba(100%, 100%, 30%, 0.35);
-}
+/** + * wasabi.css + * For AwsumChan by Circlepuller + */ +body { + background: #F7F9B0 url('img/fade-yellow.png') repeat-x 50% 0%; + color: black; + font-family: arial, helvetica, sans-serif; + font-size: 10pt; + margin: 0 8px; + padding-left: 5px; + padding-right: 5px; +} +table * { + margin: 0; +} +a:link, a:visited { + text-decoration: underline; + color: #400040; +} +a:link:hover, a:visited:hover { + color: limegreen; +} +a.post_no { + color: black; + text-decoration: none; + margin: 0; + padding: 0; +} +p.intro a.post_no, p.intro a.email { + margin: 0; +} +p.intro a.email span.name { + color: #34345C; +} +p.intro a.email:hover span.name { + color: #ff0000; +} +p.intro label { + display: inline; +} +h2 { + color: #AF0A0F; + font-size: 11pt; + margin: 0px; + padding: 0px; +} +h1 { + font-family: tahoma; + letter-spacing: -2px; + font-size: 20pt; + margin-bottom: 0; +} +h1.logo img { + display: inline; + float: none; + background-image: url('/static/logo_bg.gif'); + background-repeat: no-repeat; + background-position: center; +} +div.title, h1 { + color: #AF0A0F; + text-align: center; +} +div.title { + font-size: 8pt; + margin-bottom: 2em; +} +form { + margin-bottom: 4em; +} +form table { + margin: auto; +} +form table input { + height: auto; +} +input[type="text"], input[type="password"], textarea { + border: 1px solid #a9a9a9; + text-indent: 0px; + text-shadow: none; + text-transform: none; + word-spacing: normal; +} +form table tr td { + text-align: left; + margin: 0px; + padding: 0px; +} +form table tr th { + text-align: left; + padding: 4px; +} +form table tr th { + background: #D7FE85; +} +form table tr td div { + text-align: center; + float: left; + padding-left: 3px; +} +form table tr td div input { + display: block; + margin: 2px auto 0 auto; +} +form table tr td div label { + font-size: 10px; +} +.unimportant, .unimportant * { + font-size: 10px; +} +p.fileinfo { + display: block; + margin: 0px; + padding-right: 7em; +} +div.banner { + background-color: #400040; + font-size: 12pt; + font-weight: bold; + text-align: center; + margin: 1em 0; +} +div.banner, div.banner a { + color: white; +} +div.banner a:hover { + color: #EEF2FF; + text-decoration: none; +} +img.banner { + float: none; + margin: 4px auto 0 auto; +} +img { + display: block; + float: left; + margin: 10px 20px; + border: none; +} +div.post img { + padding: 5px; + margin: 5px 20px 0 0; +} +div.post img.icon { + display: inline; + float: none; + margin: 0 5px; + padding: 0; +} +div.post.op { + margin-right: 20px; + margin-bottom: 5px; +} +div.post.op hr { + border-color: #D9BFB7; +} +p.intro { + margin: 0.5em 0; + padding: 0; + padding-bottom: 0.2em; +} +input.delete { + float: left; + margin: 1px 6px 0 0; +} +p.intro span.subject { + color: #0F0C5D; + font-weight: bold; +} +p.intro span.name { + color: #117743; + font-weight: bold; +} +p.intro a.capcode, p.intro a.nametag { + color: #F00000; + margin-left: 0; +} +p.intro a { + margin-left: 8px; +} +div.delete { + float: right; +} +div.post.reply p { + margin: 0.3em 0 0 0; +} +div.post.reply div.body { + margin-left: 1.8em; + margin-top: 0.8em; + padding-right: 3em; + padding-bottom: 0.3em; +} +div.post.reply.highlighted { + background-color: #FFF; + border-color: #CCC; +} +div.post.reply div.body a { + color: #D00; +} +div.post { + max-width: 97%; +} +div.post div.body { + word-wrap: break-word; +} +div.post.reply { + background: #D7FE85; + margin: 0.2em 16px; + padding: 0.2em 0.3em 0.5em 0.6em; + border-width: 1px; + border-style: none solid solid none; + border-color: lightgreen; + display: inline-block; +} +span.trip { + color: #228854; +} +span.quote { + color: #3C6D8A; +} +span.omitted { + display: block; + margin-top: 1em; +} +br.clear { + clear: left; +} +span.controls { + float: right; + margin: 0; + padding: 0; + font-size: 80%; +} +span.controls.op { + float: none; + margin-left: 10px; +} +span.controls a { + margin: 0; +} +div#wrap { + width: 900px; + margin:0 auto; +} +div.ban { + background-color: white; + border: 1px solid #400040; + max-width: 700px; + margin: 30px auto; +} +div.ban p, div.ban h2 { + padding: 3px 7px; +} +div.ban h2 { + background: #D7FE85; + color: #400040; + font-size: 12pt; +} +div.ban p { + font-size: 12px; + margin-bottom: 12px; +} +div.ban p.reason { + font-weight: bold; +} +span.heading { + color: #AF0A0F; + font-size: 11pt; + font-weight: bold; + display: block; +} +span.spoiler { + background: black; + color: black; +} +div.post.reply div.body span.spoiler a { + color: black; +} +span.spoiler:hover, div.post.reply div.body span.spoiler:hover a { + color: white; +} +div.styles { + float: right; + padding-bottom: 20px; +} +div.styles a { + margin: 0 10px; +} +div.styles a.selected { + text-decoration: none; +} +table.test { + width: 100%; +} +table.test td, table.test th { + text-align: left; + padding: 5px; +} +table.test tr.h th { + background: #98E; +} +table.test td img { + margin: 0; +} +fieldset label { + display: block; +} +div.pages { + color: limegreen; + background: #D7FE85; + display: inline; + padding: 8px; + border-right: 1px solid limegreen; + border-bottom: 1px solid limegreen; +} +div.pages a.selected { + color: black; + font-weight: bolder; +} +div.pages a:link { + text-decoration: none; +} +div.pages form { + margin: 0; + padding: 0; + display: inline; +} +div.pages form input { + margin: 0 5px; + display: inline; +} +hr { + border: none; + border-top: 1px solid limegreen; + height: 0px; +} +div.boardlist { + color: limegreen; + font-size: 9pt; + margin-top: 3px; +} +div.boardlist.bottom { + margin-top: 20px; +} +div.boardlist a { + text-decoration: none; + color:#ffff22; + text-shadow: #000 1px 1px 1px, #000 -1px -1px 1px, #950000 1px 1px 2px, #009500 -1px -1px 2px; +} +div.report { + color: #333; +} +table.modlog { + margin: auto; + width: 100%; +} +table.modlog tr td { + text-align: left; + margin: 0px; + padding: 4px 15px 0 0; +} +table.modlog tr th { + text-align: left; + padding: 4px 15px 5px 5px; + white-space: nowrap; +} +table.modlog tr th { + background: #D7FE85; +} +td.minimal, th.minimal { + width: 1%; + white-space: nowrap; +} +div.top_notice { + text-align: center; + margin: 5px auto; +} +span.public_ban { + display: block; + color: red; + font-weight: bold; + margin-top: 15px; +} +span.toolong { + display: block; + margin-top: 15px; +} +div.blotter { + color: red; + font-weight: bold; + text-align: center; +} + +.desktop-style div.boardlist:nth-child(1) { + +} + + +.desktop-style div.boardlist:nth-child(1):hover { + background-color: rgba(100%, 100%, 30%, 0.35); +} diff --git a/templates/error.html b/templates/error.html new file mode 100644 index 00000000..3b8eb693 --- /dev/null +++ b/templates/error.html @@ -0,0 +1,18 @@ +<div style="text-align:center"> + <h2 style="margin:20px 0">{{ message }}</h2> + {% if board %} + <p> + <a href="{{ config.root }}{% if mod %}{{ config.file_mod }}?/{% endif %}{{ board.dir }}{{ config.file_index }}"> + {% trans 'Go back' %} + </a> + </p> + {% endif %} +</div> +{% if debug and config.debug %} + <hr> + <h3>{% trans 'Error information' %}</h3> + <pre style="white-space:pre-wrap;font-size: 10px;"> + {{ debug }} + </pre> + <hr> +{% endif %}
\ No newline at end of file diff --git a/templates/generic_page.html b/templates/generic_page.html index 41300f6b..70cb15aa 100644 --- a/templates/generic_page.html +++ b/templates/generic_page.html @@ -22,7 +22,8 @@ {% include 'attention_bar.html' %} {% include 'post_form.html' %} - {% if config.blotter %}<hr /><div class="blotter">{{ config.blotter }}</div>{% endif %} + + {% if config.global_message %}<hr /><div class="blotter">{{ config.global_message }}</div>{% endif %} <hr /> <form name="postcontrols" action="{{ config.post_url }}" method="post"> <input type="hidden" name="board" value="{{ board.uri }}" /> diff --git a/templates/header.html b/templates/header.html index 95e0bc09..d054fd6d 100644 --- a/templates/header.html +++ b/templates/header.html @@ -4,6 +4,7 @@ <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=yes"> {% if config.meta_keywords %}<meta name="keywords" content="{{ config.meta_keywords }}">{% endif %} {% if config.default_stylesheet.1 != '' %}<link rel="stylesheet" type="text/css" id="stylesheet" href="{{ config.uri_stylesheets }}{{ config.default_stylesheet.1 }}">{% endif %} + {% if config.font_awesome %}<link rel="stylesheet" media="screen" href="{{ config.root }}{{ config.font_awesome_css }}">{% endif %} <script type="text/javascript">var configRoot="{{ config.root }}";</script> {% if not nojavascript %} <script type="text/javascript" src="{{ config.url_javascript }}"></script> @@ -12,17 +13,31 @@ {% endif %} {% endif %} {% if config.recaptcha %}<style type="text/css">{% raw %} - .recaptcha_image_cell { - background: none !important; + #recaptcha_area { + float: none !important; + padding: 0 !important; } - table.recaptchatable { + #recaptcha_logo, #recaptcha_privacy { + display: none; + } + #recaptcha_table { border: none !important; } - #recaptcha_logo, #recaptcha_tagline { - display: none; - float: right; + #recaptcha_table tr:first-child { + height: auto; + } + .recaptchatable img { + float: none !important; + } + #recaptcha_response_field { + font-size: 10pt !important; + border: 1px solid #a9a9a9 !important; + padding: 1px !important; + } + td.recaptcha_image_cell { + background: transparent !important; } - .recaptchatable a { - display: block; + .recaptchatable, #recaptcha_area tr, #recaptcha_area td, #recaptcha_area th { + padding: 0 !important; } {% endraw %}</style>{% endif %} diff --git a/templates/index.html b/templates/index.html index 451ca8b1..12150d0b 100644 --- a/templates/index.html +++ b/templates/index.html @@ -1,61 +1,61 @@ -<!doctype html>
-<html>
-<head>
- <meta charset="utf-8">
-
- <script type="text/javascript">
- {% if config.quick_reply %}
- var new_reply_string = "{{ config.button_reply }}";
- {% endif %}
- {% if not no_post_form %}
- var active_page = "index";
- {% else %}
- var active_page = "ukko";
- {% endif %}
- </script>
-
- {% include 'header.html' %}
- <title>{{ board.url }} - {{ board.title|e }}</title>
-</head>
-<body>
- {{ boardlist.top }}
- {% if pm %}<div class="top_notice">You have <a href="?/PM/{{ pm.id }}">an unread PM</a>{% if pm.waiting > 0 %}, plus {{ pm.waiting }} more waiting{% endif %}.</div><hr />{% endif %}
- {% if config.url_banner %}<img class="banner" src="{{ config.url_banner }}" {% if config.banner_width or config.banner_height %}style="{% if config.banner_width %}width:{{ config.banner_width }}px{% endif %};{% if config.banner_width %}height:{{ config.banner_height }}px{% endif %}" {% endif %}alt="" />{% endif %}
- <header>
- <h1>{{ board.url }} - {{ board.title|e }}</h1>
- <div class="subtitle">
- {% if board.subtitle %}
- {{ board.subtitle|e }}
- {% endif %}
- {% if mod %}<p><a href="?/">{% trans %}Return to dashboard{% endtrans %}</a></p>{% endif %}
- </div>
- </header>
-
- {% include 'attention_bar.html' %}
- {% if not no_post_form %}
- {% include 'post_form.html' %}
- {% else %}
- {% include 'boardlist.html' %}
- {% endif %}
-
- {% if config.blotter %}<hr /><div class="blotter">{{ config.blotter }}</div>{% endif %}
- <hr />
- <form name="postcontrols" action="{{ config.post_url }}" method="post">
- <input type="hidden" name="board" value="{{ board.uri }}" />
- {% if mod %}<input type="hidden" name="mod" value="1" />{% endif %}
- {{ body }}
- {% include 'report_delete.html' %}
- </form>
- <div class="pages">{{ btn.prev }} {% for page in pages %}
- [<a {% if page.selected %}class="selected"{% endif %}{% if not page.selected %}href="{{ page.link }}"{% endif %}>{{ page.num }}</a>]{% if loop.last %} {% endif %}
- {% endfor %} {{ btn.next }}</div>
- {{ boardlist.bottom }}
- <footer>
- <p class="unimportant" style="margin-top:20px;text-align:center;">Powered by <a href="http://tinyboard.org/">Tinyboard</a> {{ config.version }} | <a href="http://tinyboard.org/">Tinyboard</a> Copyright © 2010-2013 Tinyboard Development Group</p>
- {% for footer in config.footer %}<p class="unimportant" style="text-align:center;">{{ footer }}</p>{% endfor %}
- </footer>
- <script type="text/javascript">{% raw %}
- ready();
- {% endraw %}</script>
-</body>
-</html>
+<!doctype html> +<html> +<head> + <meta charset="utf-8"> + + <script type="text/javascript"> + {% if config.quick_reply %} + var new_reply_string = "{{ config.button_reply }}"; + {% endif %} + {% if not no_post_form %} + var active_page = "index"; + {% else %} + var active_page = "ukko"; + {% endif %} + </script> + + {% include 'header.html' %} + <title>{{ board.url }} - {{ board.title|e }}</title> +</head> +<body> + {{ boardlist.top }} + {% if pm %}<div class="top_notice">You have <a href="?/PM/{{ pm.id }}">an unread PM</a>{% if pm.waiting > 0 %}, plus {{ pm.waiting }} more waiting{% endif %}.</div><hr />{% endif %} + {% if config.url_banner %}<img class="banner" src="{{ config.url_banner }}" {% if config.banner_width or config.banner_height %}style="{% if config.banner_width %}width:{{ config.banner_width }}px{% endif %};{% if config.banner_width %}height:{{ config.banner_height }}px{% endif %}" {% endif %}alt="" />{% endif %} + <header> + <h1>{{ board.url }} - {{ board.title|e }}</h1> + <div class="subtitle"> + {% if board.subtitle %} + {{ board.subtitle|e }} + {% endif %} + {% if mod %}<p><a href="?/">{% trans %}Return to dashboard{% endtrans %}</a></p>{% endif %} + </div> + </header> + + {% include 'attention_bar.html' %} + {% if not no_post_form %} + {% include 'post_form.html' %} + {% else %} + {% include 'boardlist.html' %} + {% endif %} + + {% if config.global_message %}<hr /><div class="blotter">{{ config.global_message }}</div>{% endif %} + <hr /> + <form name="postcontrols" action="{{ config.post_url }}" method="post"> + <input type="hidden" name="board" value="{{ board.uri }}" /> + {% if mod %}<input type="hidden" name="mod" value="1" />{% endif %} + {{ body }} + {% include 'report_delete.html' %} + </form> + <div class="pages">{{ btn.prev }} {% for page in pages %} + [<a {% if page.selected %}class="selected"{% endif %}{% if not page.selected %}href="{{ page.link }}"{% endif %}>{{ page.num }}</a>]{% if loop.last %} {% endif %} + {% endfor %} {{ btn.next }}</div> + {{ boardlist.bottom }} + <footer> + <p class="unimportant" style="margin-top:20px;text-align:center;">Powered by <a href="http://tinyboard.org/">Tinyboard</a> {{ config.version }} | <a href="http://tinyboard.org/">Tinyboard</a> Copyright © 2010-2013 Tinyboard Development Group</p> + {% for footer in config.footer %}<p class="unimportant" style="text-align:center;">{{ footer }}</p>{% endfor %} + </footer> + <script type="text/javascript">{% raw %} + ready(); + {% endraw %}</script> +</body> +</html> diff --git a/templates/installer/check-requirements.html b/templates/installer/check-requirements.html new file mode 100644 index 00000000..b6003f3a --- /dev/null +++ b/templates/installer/check-requirements.html @@ -0,0 +1,54 @@ +<div style="max-width:700px;margin:auto"> + <h2 style="text-align:center">Pre-installation tests</h2> + <table class="modlog" style="margin-top:10px;max-width:600px"> + <tr> + <th>Category</th> + <th>Test</th> + <th>Result</th> + </tr> + {% set errors = 0 %} + {% set warnings = 0 %} + {% for test in tests %} + <tr> + <td class="minimal"><strong>{{ test.category }}</strong></td> + <td>{{ test.name }}</td> + <td class="minimal" style="text-align:center"> + {% if test.result %} + <i style="font-size:11pt;color:#090" class="icon-check-sign"></i> + {% else %} + {% if test.required %} + {% set errors = errors + 1 %} + <i style="font-size:11pt;color:#d00" class="icon-exclamation-sign"></i> + {% else %} + {% set warnings = warnings + 1 %} + <i style="font-size:11pt;color:#f80" class="icon-warning-sign"></i> + {% endif %} + {% endif %} + </td> + </tr> + {% endfor %} + </table> + {% if errors or warnings %} + <p><strong>There were {{ errors }} error(s) and {{ warnings }} warning(s).</strong></p> + <ul> + {% for test in tests if not test.result%} + <li style="margin-bottom:5px"> + {% if test.required %} + <i style="font-size:11pt;color:#d00" class="icon-exclamation-sign"></i> <strong>Error:</strong> + {% else %} + <i style="font-size:11pt;color:#f80" class="icon-warning-sign"></i> <strong>Warning:</strong> + {% endif %} + {{ test.message }} + </li> + {% endfor %} + </ul> + {% if errors %} + <p style="text-align:center"><a href="?step=2">Clik here to ignore errors and attempt installing anyway (not recommended).</a></p> + {% else %} + <p style="text-align:center"><a href="?step=2">Clik here to proceed with installation.</a></p> + {% endif %} + {% else %} + <p>There were no errors or warnings. Good!</p> + <p style="text-align:center"><a href="?step=2">Clik here to proceed with installation.</a></p> + {% endif %} +</div> diff --git a/templates/installer/config.html b/templates/installer/config.html new file mode 100644 index 00000000..193bb98b --- /dev/null +++ b/templates/installer/config.html @@ -0,0 +1,95 @@ +<form action="?step=3" method="post" autocomplete="off"> + <fieldset> + <legend>Database (MySQL)</legend> + <label for="db_server">Server:</label> + <input type="text" id="db_server" name="db[server]" value="{{ config.db.server }}"> + + <label for="db_db">Database:</label> + <input type="text" id="db_db" name="db[database]" value="{{ config.db.database }}"> + + <label for="db_prefix">Table prefix (optional):</label> + <input type="text" id="db_prefix" name="db[prefix]" value="{{ config.db.prefix }}"> + + <label for="db_user">Username:</label> + <input type="text" id="db_user" name="db[user]" value="{{ config.db.user }}"> + + <label for="db_pass">Password:</label> + <input type="password" id="db_pass" name="db[password]" value=""> + </fieldset> + <p style="text-align:center" class="unimportant">The following is all later configurable. For more options, <a href="http://tinyboard.org/docs/?p=Config">edit your configuration files</a> after installing.</p> + <fieldset> + <legend>Cookies</legend> + <label for="cookies_mod">Moderator cookie:</label> + <input type="text" id="cookies_mod" name="cookies[mod]" value="{{ config.cookies.mod }}"> + + <label for="cookies_salt">Secure salt:</label> + <input type="text" id="cookies_salt" name="cookies[salt]" value="{{ config.cookies.salt }}" size="40"> + </fieldset> + + <fieldset> + <legend>Flood control</legend> + <label for="flood_time">Seconds before each post:</label> + <input type="text" id="flood_time" name="flood_time" value="{{ config.flood_time }}"> + + <label for="flood_time_ip">Seconds before you can repost something (post the exact same text):</label> + <input type="text" id="flood_time_ip" name="flood_time_ip" value="{{ config.flood_time_ip }}"> + + <label for="flood_time_same">Same as above, but with a different IP address:</label> + <input type="text" id="flood_time_same" name="flood_time_same" value="{{ config.flood_time_same }}"> + + <label for="max_body">Maximum post body length:</label> + <input type="text" id="max_body" name="max_body" value="{{ config.max_body }}"> + + <label for="reply_limit">Replies in a thread before it can no longer be bumped:</label> + <input type="text" id="reply_limit" name="reply_limit" value="{{ config.reply_limit }}"> + + <label for="max_links">Maximum number of links in a single post:</label> + <input type="text" id="max_links" name="max_links" value="{{ config.max_links }}"> + </fieldset> + + <fieldset> + <legend>Images</legend> + <label for="max_filesize">Maximum image filesize (bytes):</label> + <input type="text" id="max_filesize" name="max_filesize" value="{{ config.max_filesize }}"> + + <label for="thumb_width">Thumbnail width:</label> + <input type="text" id="thumb_width" name="thumb_width" value="{{ config.thumb_width }}"> + + <label for="thumb_height">Thumbnail height:</label> + <input type="text" id="thumb_height" name="thumb_height" value="{{ config.thumb_height }}"> + + <label for="max_width">Maximum image width:</label> + <input type="text" id="max_width" name="max_width" value="{{ config.max_width }}"> + + <label for="max_height">Maximum image height:</label> + <input type="text" id="max_height" name="max_height" value="{{ config.max_height }}"> + </fieldset> + + <fieldset> + <legend>Display</legend> + <label for="threads_per_page">Threads per page:</label> + <input type="text" id="threads_per_page" name="threads_per_page" value="{{ config.threads_per_page }}"> + + <label for="max_pages">Page limit:</label> + <input type="text" id="max_pages" name="max_pages" value="{{ config.max_pages }}"> + + <label for="threads_preview">Number of replies to show per thread on the index page:</label> + <input type="text" id="threads_preview" name="threads_preview" value="{{ config.threads_preview }}"> + </fieldset> + + <fieldset> + <legend>Directories</legend> + <label for="root">Root URI (include trailing slash):</label> + <input type="text" id="root" name="root" value="{{ config.root }}" size="40"> + </fieldset> + + <fieldset> + <legend>Miscellaneous</legend> + <label for="secure_trip_salt">Secure trip (##) salt:</label> + <input type="text" id="secure_trip_salt" name="secure_trip_salt" value="{{ config.secure_trip_salt }}" size="40"> + </fieldset> + + <p style="text-align:center"> + <input type="submit" value="Complete installation"> + </p> +</form> diff --git a/templates/main.js b/templates/main.js index 31c0254a..71dcd92a 100644 --- a/templates/main.js +++ b/templates/main.js @@ -1,232 +1,271 @@ -{% raw %}
-
-/* gettext-compatible _ function, example of usage:
- *
- * > // Loading pl_PL.json here (containing polish translation strings generated by tools/i18n_compile.php)
- * > alert(_("Hello!"));
- * Witaj!
- */
-function _(s) {
- return (typeof l10n != 'undefined' && typeof l10n[s] != 'undefined') ? l10n[s] : s;
-}
-
-/* printf-like formatting function, example of usage:
- *
- * > alert(fmt("There are {0} birds on {1} trees", [3,4]));
- * There are 3 birds on 4 trees
- * > // Loading pl_PL.json here (containing polish translation strings generated by tools/locale_compile.php)
- * > alert(fmt(_("{0} users"), [3]));
- * 3 uzytkownikow
- */
-function fmt(s,a) {
- return s.replace(/\{([0-9]+)\}/g, function(x) { return a[x[1]]; });
-}
-
-var saved = {};
-
-
-var selectedstyle = '{% endraw %}{{ config.default_stylesheet.0|addslashes }}{% raw %}';
-var styles = {
- {% endraw %}
- {% for stylesheet in stylesheets %}{% raw %}'{% endraw %}{{ stylesheet.name|addslashes }}{% raw %}' : '{% endraw %}{{ stylesheet.uri|addslashes }}{% raw %}',
- {% endraw %}{% endfor %}{% raw %}
-};
-
-function changeStyle(styleName, link) {
- localStorage.stylesheet = styleName;
-
- if (!document.getElementById('stylesheet')) {
- var s = document.createElement('link');
- s.rel = 'stylesheet';
- s.type = 'text/css';
- s.id = 'stylesheet';
- var x = document.getElementsByTagName('head')[0];
- x.appendChild(s);
- }
-
- document.getElementById('stylesheet').href = styles[styleName];
- selectedstyle = styleName;
-
- if (document.getElementsByClassName('styles').length != 0) {
- var styleLinks = document.getElementsByClassName('styles')[0].childNodes;
- for (i = 0; i < styleLinks.length; i++) {
- styleLinks[i].className = '';
- }
- }
-
- if (link) {
- link.className = 'selected';
- }
-}
-
-if (localStorage.stylesheet) {
- for (styleName in styles) {
- if (styleName == localStorage.stylesheet) {
- changeStyle(styleName);
- break;
- }
- }
-}
-
-function init_stylechooser() {
- var newElement = document.createElement('div');
- newElement.className = 'styles';
-
- for (styleName in styles) {
- var style = document.createElement('a');
- style.innerHTML = '[' + styleName + ']';
- style.onclick = function() {
- changeStyle(this.innerHTML.substring(1, this.innerHTML.length - 1), this);
- };
- if (styleName == selectedstyle) {
- style.className = 'selected';
- }
- style.href = 'javascript:void(0);';
- newElement.appendChild(style);
- }
-
- document.getElementsByTagName('body')[0].insertBefore(newElement, document.getElementsByTagName('body')[0].lastChild.nextSibling);
-}
-
-function get_cookie(cookie_name) {
- var results = document.cookie.match ( '(^|;) ?' + cookie_name + '=([^;]*)(;|$)');
- if (results)
- return (unescape(results[2]));
- else
- return null;
-}
-
-function highlightReply(id) {
- if (typeof window.event != "undefined" && event.which == 2) {
- // don't highlight on middle click
- return true;
- }
-
- var divs = document.getElementsByTagName('div');
- for (var i = 0; i < divs.length; i++)
- {
- if (divs[i].className.indexOf('post') != -1)
- divs[i].className = divs[i].className.replace(/highlighted/, '');
- }
- if (id) {
- var post = document.getElementById('reply_'+id);
- if (post)
- post.className += ' highlighted';
- }
-}
-
-function generatePassword() {
- var pass = '';
- var chars = '{% endraw %}{{ config.genpassword_chars }}{% raw %}';
- for (var i = 0; i < 8; i++) {
- var rnd = Math.floor(Math.random() * chars.length);
- pass += chars.substring(rnd, rnd + 1);
- }
- return pass;
-}
-
-function dopost(form) {
- if (form.elements['name']) {
- localStorage.name = form.elements['name'].value.replace(/( |^)## .+$/, '');
- }
- if (form.elements['email'] && form.elements['email'].value != 'sage') {
- localStorage.email = form.elements['email'].value;
- }
-
- saved[document.location] = form.elements['body'].value;
- sessionStorage.body = JSON.stringify(saved);
-
- return form.elements['body'].value != "" || form.elements['file'].value != "";
-}
-
-function citeReply(id) {
- var body = document.getElementById('body');
-
- if (document.selection) {
- // IE
- body.focus();
- var sel = document.selection.createRange();
- sel.text = '>>' + id + '\n';
- } else if (body.selectionStart || body.selectionStart == '0') {
- // Mozilla
- var start = body.selectionStart;
- var end = body.selectionEnd;
- body.value = body.value.substring(0, start) + '>>' + id + '\n' + body.value.substring(end, body.value.length);
- } else {
- // ???
- body.value += '>>' + id + '\n';
- }
-}
-
-function rememberStuff() {
- if (document.forms.post) {
- if (document.forms.post.password) {
- if (!localStorage.password)
- localStorage.password = generatePassword();
- document.forms.post.password.value = localStorage.password;
- }
-
- if (localStorage.name && document.forms.post.elements['name'])
- document.forms.post.elements['name'].value = localStorage.name;
- if (localStorage.email && document.forms.post.elements['email'])
- document.forms.post.elements['email'].value = localStorage.email;
-
- if (window.location.hash.indexOf('q') == 1)
- citeReply(window.location.hash.substring(2));
-
- if (sessionStorage.body) {
- var saved = JSON.parse(sessionStorage.body);
- if (get_cookie('{% endraw %}{{ config.cookies.js }}{% raw %}')) {
- // Remove successful posts
- var successful = JSON.parse(get_cookie('{% endraw %}{{ config.cookies.js }}{% raw %}'));
- for (var url in successful) {
- saved[url] = null;
- }
- sessionStorage.body = JSON.stringify(saved);
-
- document.cookie = '{% endraw %}{{ config.cookies.js }}{% raw %}={};expires=0;path=/;';
- }
- if (saved[document.location]) {
- document.forms.post.body.value = saved[document.location];
- }
- }
-
- if (localStorage.body) {
- document.forms.post.body.value = localStorage.body;
- localStorage.body = '';
- }
- }
-}
-
-function init() {
- init_stylechooser();
-
- if (document.forms.postcontrols) {
- document.forms.postcontrols.password.value = localStorage.password;
- }
-
- if (window.location.hash.indexOf('q') != 1 && window.location.hash.substring(1))
- highlightReply(window.location.hash.substring(1));
-}
-
-var RecaptchaOptions = {
- theme : 'clean'
-};
-
-onready_callbacks = [];
-function onready(fnc) {
- onready_callbacks.push(fnc);
-}
-
-function ready() {
- for (var i = 0; i < onready_callbacks.length; i++) {
- onready_callbacks[i]();
- }
-}
-
-onready(init);
-
-{% endraw %}{% if config.google_analytics %}{% raw %}
-
-var _gaq = _gaq || [];_gaq.push(['_setAccount', '{% endraw %}{{ config.google_analytics }}{% raw %}']);{% endraw %}{% if config.google_analytics_domain %}{% raw %}_gaq.push(['_setDomainName', '{% endraw %}{{ config.google_analytics_domain }}{% raw %}']){% endraw %}{% endif %}{% if not config.google_analytics_domain %}{% raw %}_gaq.push(['_setDomainName', 'none']){% endraw %}{% endif %}{% raw %};_gaq.push(['_trackPageview']);(function() {var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);})();{% endraw %}{% endif %}
-
+{% raw %} + +/* gettext-compatible _ function, example of usage: + * + * > // Loading pl_PL.json here (containing polish translation strings generated by tools/i18n_compile.php) + * > alert(_("Hello!")); + * Witaj! + */ +function _(s) { + return (typeof l10n != 'undefined' && typeof l10n[s] != 'undefined') ? l10n[s] : s; +} + +/* printf-like formatting function, example of usage: + * + * > alert(fmt("There are {0} birds on {1} trees", [3,4])); + * There are 3 birds on 4 trees + * > // Loading pl_PL.json here (containing polish translation strings generated by tools/locale_compile.php) + * > alert(fmt(_("{0} users"), [3])); + * 3 uzytkownikow + */ +function fmt(s,a) { + return s.replace(/\{([0-9]+)\}/g, function(x) { return a[x[1]]; }); +} + +var saved = {}; + + +var selectedstyle = '{% endraw %}{{ config.default_stylesheet.0|addslashes }}{% raw %}'; +var styles = { + {% endraw %} + {% for stylesheet in stylesheets %}{% raw %}'{% endraw %}{{ stylesheet.name|addslashes }}{% raw %}' : '{% endraw %}{{ stylesheet.uri|addslashes }}{% raw %}', + {% endraw %}{% endfor %}{% raw %} +}; +var board_name = false; + +function changeStyle(styleName, link) { + {% endraw %} + {% if config.stylesheets_board %}{% raw %} + if (board_name) { + stylesheet_choices[board_name] = styleName; + localStorage.board_stylesheets = JSON.stringify(stylesheet_choices); + } + {% endraw %}{% else %} + localStorage.stylesheet = styleName; + {% endif %} + {% raw %} + + if (!document.getElementById('stylesheet')) { + var s = document.createElement('link'); + s.rel = 'stylesheet'; + s.type = 'text/css'; + s.id = 'stylesheet'; + var x = document.getElementsByTagName('head')[0]; + x.appendChild(s); + } + + document.getElementById('stylesheet').href = styles[styleName]; + selectedstyle = styleName; + + if (document.getElementsByClassName('styles').length != 0) { + var styleLinks = document.getElementsByClassName('styles')[0].childNodes; + for (var i = 0; i < styleLinks.length; i++) { + styleLinks[i].className = ''; + } + } + + if (link) { + link.className = 'selected'; + } +} + + +{% endraw %} +{% if config.stylesheets_board %} + {# This is such an unacceptable mess. There needs to be an easier way. #} + var matches = document.URL.match(/\/(\w+)\/($|{{ config.dir.res|replace({'/': '\\/'}) }}{{ config.file_page|replace({'%d': '\\d+', '.': '\\.'}) }}|{{ config.file_index|replace({'.': '\\.'}) }}|{{ config.file_page|replace({'%d': '\\d+', '.': '\\.'}) }})/); + {% raw %} + if (matches) { + board_name = matches[1]; + } + + if (!localStorage.board_stylesheets) { + localStorage.board_stylesheets = '{}'; + } + + var stylesheet_choices = JSON.parse(localStorage.board_stylesheets); + if (board_name && stylesheet_choices[board_name]) { + for (var styleName in styles) { + if (styleName == stylesheet_choices[board_name]) { + changeStyle(styleName); + break; + } + } + } + {% endraw%} +{% else %} + {% raw %} + if (localStorage.stylesheet) { + for (var styleName in styles) { + if (styleName == localStorage.stylesheet) { + changeStyle(styleName); + break; + } + } + } + {% endraw %} +{% endif %} +{% raw %} + +function init_stylechooser() { + var newElement = document.createElement('div'); + newElement.className = 'styles'; + + for (styleName in styles) { + var style = document.createElement('a'); + style.innerHTML = '[' + styleName + ']'; + style.onclick = function() { + changeStyle(this.innerHTML.substring(1, this.innerHTML.length - 1), this); + }; + if (styleName == selectedstyle) { + style.className = 'selected'; + } + style.href = 'javascript:void(0);'; + newElement.appendChild(style); + } + + document.getElementsByTagName('body')[0].insertBefore(newElement, document.getElementsByTagName('body')[0].lastChild.nextSibling); +} + +function get_cookie(cookie_name) { + var results = document.cookie.match ( '(^|;) ?' + cookie_name + '=([^;]*)(;|$)'); + if (results) + return (unescape(results[2])); + else + return null; +} + +function highlightReply(id) { + if (typeof window.event != "undefined" && event.which == 2) { + // don't highlight on middle click + return true; + } + + var divs = document.getElementsByTagName('div'); + for (var i = 0; i < divs.length; i++) + { + if (divs[i].className.indexOf('post') != -1) + divs[i].className = divs[i].className.replace(/highlighted/, ''); + } + if (id) { + var post = document.getElementById('reply_'+id); + if (post) + post.className += ' highlighted'; + } +} + +function generatePassword() { + var pass = ''; + var chars = '{% endraw %}{{ config.genpassword_chars }}{% raw %}'; + for (var i = 0; i < 8; i++) { + var rnd = Math.floor(Math.random() * chars.length); + pass += chars.substring(rnd, rnd + 1); + } + return pass; +} + +function dopost(form) { + if (form.elements['name']) { + localStorage.name = form.elements['name'].value.replace(/( |^)## .+$/, ''); + } + if (form.elements['email'] && form.elements['email'].value != 'sage') { + localStorage.email = form.elements['email'].value; + } + + saved[document.location] = form.elements['body'].value; + sessionStorage.body = JSON.stringify(saved); + + return form.elements['body'].value != "" || form.elements['file'].value != ""; +} + +function citeReply(id) { + var body = document.getElementById('body'); + + if (document.selection) { + // IE + body.focus(); + var sel = document.selection.createRange(); + sel.text = '>>' + id + '\n'; + } else if (body.selectionStart || body.selectionStart == '0') { + // Mozilla + var start = body.selectionStart; + var end = body.selectionEnd; + body.value = body.value.substring(0, start) + '>>' + id + '\n' + body.value.substring(end, body.value.length); + } else { + // ??? + body.value += '>>' + id + '\n'; + } +} + +function rememberStuff() { + if (document.forms.post) { + if (document.forms.post.password) { + if (!localStorage.password) + localStorage.password = generatePassword(); + document.forms.post.password.value = localStorage.password; + } + + if (localStorage.name && document.forms.post.elements['name']) + document.forms.post.elements['name'].value = localStorage.name; + if (localStorage.email && document.forms.post.elements['email']) + document.forms.post.elements['email'].value = localStorage.email; + + if (window.location.hash.indexOf('q') == 1) + citeReply(window.location.hash.substring(2)); + + if (sessionStorage.body) { + var saved = JSON.parse(sessionStorage.body); + if (get_cookie('{% endraw %}{{ config.cookies.js }}{% raw %}')) { + // Remove successful posts + var successful = JSON.parse(get_cookie('{% endraw %}{{ config.cookies.js }}{% raw %}')); + for (var url in successful) { + saved[url] = null; + } + sessionStorage.body = JSON.stringify(saved); + + document.cookie = '{% endraw %}{{ config.cookies.js }}{% raw %}={};expires=0;path=/;'; + } + if (saved[document.location]) { + document.forms.post.body.value = saved[document.location]; + } + } + + if (localStorage.body) { + document.forms.post.body.value = localStorage.body; + localStorage.body = ''; + } + } +} + +function init() { + init_stylechooser(); + + if (document.forms.postcontrols) { + document.forms.postcontrols.password.value = localStorage.password; + } + + if (window.location.hash.indexOf('q') != 1 && window.location.hash.substring(1)) + highlightReply(window.location.hash.substring(1)); +} + +var RecaptchaOptions = { + theme : 'clean' +}; + +onready_callbacks = []; +function onready(fnc) { + onready_callbacks.push(fnc); +} + +function ready() { + for (var i = 0; i < onready_callbacks.length; i++) { + onready_callbacks[i](); + } +} + +onready(init); + +{% endraw %}{% if config.google_analytics %}{% raw %} + +var _gaq = _gaq || [];_gaq.push(['_setAccount', '{% endraw %}{{ config.google_analytics }}{% raw %}']);{% endraw %}{% if config.google_analytics_domain %}{% raw %}_gaq.push(['_setDomainName', '{% endraw %}{{ config.google_analytics_domain }}{% raw %}']){% endraw %}{% endif %}{% if not config.google_analytics_domain %}{% raw %}_gaq.push(['_setDomainName', 'none']){% endraw %}{% endif %}{% raw %};_gaq.push(['_trackPageview']);(function() {var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);})();{% endraw %}{% endif %} + diff --git a/templates/mod/ban_form.html b/templates/mod/ban_form.html index edc1ab3b..6c7560ad 100644 --- a/templates/mod/ban_form.html +++ b/templates/mod/ban_form.html @@ -41,11 +41,11 @@ <label for="reason">{% trans 'Message' %}</label> </th> <td> - <input type="checkbox" id="public_message" name="public_message"> + <input type="checkbox" id="public_message" name="public_message"{% if config.mod.check_ban_message %} checked{% endif %}> <input type="text" name="message" id="message" size="35" maxlength="200" value="{{ config.mod.default_ban_message|e }}"> <span class="unimportant">({% trans 'public; attached to post' %})</span> <script type="text/javascript"> - document.getElementById('message').disabled = true; + document.getElementById('message').disabled = !document.getElementById('public_message').checked; document.getElementById('public_message').onchange = function() { document.getElementById('message').disabled = !this.checked; } diff --git a/templates/mod/config-editor-php.html b/templates/mod/config-editor-php.html new file mode 100644 index 00000000..4f76b5dd --- /dev/null +++ b/templates/mod/config-editor-php.html @@ -0,0 +1,63 @@ +<div style="max-width:800px;margin:auto"> + <p> + Any changes you make here will simply be appended to <code>{{ file }}</code>. If you wish to make the most of Tinyboard's customizability, you can instead edit the file directly. This page is intended for making quick changes and for those who don't have a basic understanding of PHP code. + </p> + {% if boards|count %} + <ul> + {% if board %} + <li><a href="?/config">Edit site-wide config</a></li> + {% endif %} + {% for _board in boards if _board.uri != board %} + <li> + <a href="?/config/{{ _board.uri }}">Edit config for {{ config.board_abbreviation|sprintf(_board.uri) }}</a> + </li> + {% endfor %} + </ul> + {% endif %} + + {% if readonly %} + <p>Tinyboard does not have the required permissions to edit <code>{{ file }}</code>. To make changes, you will need to change the file's permissions first or manually edit the code.</p> + {% endif %} + + + {% if not readonly %}<form method="post" action="">{% endif %} + <textarea name="code" id="code" style="margin:auto;width:100%;height:500px{% if readonly %};background:#eee" readonly{% else %}"{% endif %}> + {{ php }} + </textarea> + + <ul style="padding:0;text-align:center;list-style:none"> + <li><input name="save" type="submit" value="{% trans 'Save changes' %}"{% if readonly %} disabled{% endif %}></li> + </ul> + {% if not readonly %}</form>{% endif %} +</div> + +<script type="text/javascript"> +var observe; +if (window.attachEvent) { + observe = function (element, event, handler) { + element.attachEvent('on'+event, handler); + }; +} +else { + observe = function (element, event, handler) { + element.addEventListener(event, handler, false); + }; +} + +var text = document.getElementById('code'); +function resize () { + text.style.height = 'auto'; + text.style.height = text.scrollHeight+'px'; +} +/* 0-timeout to get the already changed text */ +function delayedResize () { + window.setTimeout(resize, 0); +} +observe(text, 'change', resize); +observe(text, 'cut', delayedResize); +observe(text, 'paste', delayedResize); +observe(text, 'drop', delayedResize); +observe(text, 'keydown', delayedResize); + +resize(); +</script>
\ No newline at end of file diff --git a/templates/mod/config-editor.html b/templates/mod/config-editor.html index ec7213bb..a43f8cf7 100644 --- a/templates/mod/config-editor.html +++ b/templates/mod/config-editor.html @@ -1,10 +1,25 @@ +<p> + Any changes you make here will simply be appended to <code>{{ file }}</code>. If you wish to make the most of Tinyboard's customizability, you can instead edit the file directly. This page is intended for making quick changes and for those who don't have a basic understanding of PHP code. +</p> +{% if boards|count %} + <ul> + {% if board %} + <li><a href="?/config">Edit site-wide config</a></li> + {% endif %} + {% for _board in boards if _board.uri != board %} + <li> + <a href="?/config/{{ _board.uri }}">Edit config for {{ config.board_abbreviation|sprintf(_board.uri) }}</a> + </li> + {% endfor %} + </ul> +{% endif %} <form method="post" action=""> <table class="mod config-editor"> <tr> - <th class="minimal">Name</th> - <th>Value</th> - <th class="minimal">Type</th> - <th>Description</th> + <th class="minimal">{% trans 'Name' %}</th> + <th>{% trans 'Value' %}</th> + <th class="minimal">{% trans 'Type' %}</th> + <th>{% trans 'Description' %}</th> </tr> {% for var in conf if var.type != 'array' %} {% if var.name|count == 1 %} @@ -25,6 +40,13 @@ <td> {% if var.type == 'string' %} <input name="{{ name }}" type="text" value="{{ var.value|e }}"> + {% elseif var.permissions %} + <select name="{{ name }}"> + <option value="{{ constant('JANITOR') }}"{% if var.value == constant('JANITOR')%} selected{% endif %}>JANITOR</option> + <option value="{{ constant('MOD') }}"{% if var.value == constant('MOD')%} selected{% endif %}>MOD</option> + <option value="{{ constant('ADMIN') }}"{% if var.value == constant('ADMIN')%} selected{% endif %}>ADMIN</option> + <option value="{{ constant('DISABLED') }}"{% if var.value == constant('DISABLED')%} selected{% endif %}>DISABLED</option> + </select> {% elseif var.type == 'integer' %} <input name="{{ name }}" type="number" value="{{ var.value|e }}"> {% elseif var.type == 'boolean' %} @@ -42,8 +64,8 @@ {{ var.type|e }} </td> - <td> - {{ var.comment|join('<br>') }} + <td style="word-wrap:break-word;width:50%"> + {{ var.comment|join(' ') }} </td> </tr> {% endfor %} diff --git a/templates/mod/dashboard.html b/templates/mod/dashboard.html index 619663f5..e9fb7c9c 100644 --- a/templates/mod/dashboard.html +++ b/templates/mod/dashboard.html @@ -94,7 +94,7 @@ {% if mod|hasPermission(config.mod.rebuild) %} <li><a href="?/rebuild">{% trans 'Rebuild' %}</a></li> {% endif %} - {% if mod|hasPermission(config.mod.show_config) %} + {% if mod|hasPermission(config.mod.edit_config) %} <li><a href="?/config">{% trans 'Configuration' %}</a></li> {% endif %} @@ -102,17 +102,29 @@ </fieldset> {% if mod|hasPermission(config.mod.search) %} -<fieldset> - <legend>{% trans 'Search' %}</legend> - - <ul> - <li> - {% include 'mod/search_form.html' %} - </li> - </ul> -</fieldset> + <fieldset> + <legend>{% trans 'Search' %}</legend> + + <ul> + <li> + {% include 'mod/search_form.html' %} + </li> + </ul> + </fieldset> {% endif %} +{% if config.mod.dashboard_links|count %} + <fieldset> + <legend>{% trans 'Other' %}</legend> + + <ul> + {% for label,link in config.mod.dashboard_links %} + <li><a href="{{ link }}">{{ label }}</a></li> + {% endfor %} + </ul> + </fieldset> +{% endif %} + {% if config.debug %} <fieldset> <legend>{% trans 'Debug' %}</legend> diff --git a/templates/mod/debug/recent_posts.html b/templates/mod/debug/recent_posts.html index 740ed21e..b84d24ab 100644 --- a/templates/mod/debug/recent_posts.html +++ b/templates/mod/debug/recent_posts.html @@ -1,4 +1,4 @@ -<table class="modlog"> +<table class="modlog" style="word-wrap: break-word;"> <tr> <th>Time</th> <th>Board</th> @@ -24,7 +24,7 @@ {% else %} {% set thread = post.id %} {% endif %} - <a href="{{ config.root ~ post.board ~ '/' ~ config.dir.res}}{{ config.file_page|sprintf(thread) }}#{{ post.id }}"> + <a href="?/{{ post.board ~ '/' ~ config.dir.res}}{{ config.file_page|sprintf(thread) }}#{{ post.id }}"> {{ post.id }} </a> </td> diff --git a/templates/mod/edit_post_form.html b/templates/mod/edit_post_form.html index 146e725b..a2980d35 100644 --- a/templates/mod/edit_post_form.html +++ b/templates/mod/edit_post_form.html @@ -32,7 +32,7 @@ {% trans %}Comment{% endtrans %} </th> <td> - <textarea name="body" id="body" rows="8" cols="35">{% if raw %}{{ post.body | e }}{% else %}{{ post.body_nomarkup }}{% endif %}</textarea> + <textarea name="body" id="body" rows="8" cols="35">{% if raw %}{{ post.body }}{% else %}{{ post.body_nomarkup }}{% endif %}</textarea> </td> </tr> </table> diff --git a/templates/mod/log.html b/templates/mod/log.html index e75330b5..0aa3f110 100644 --- a/templates/mod/log.html +++ b/templates/mod/log.html @@ -18,7 +18,11 @@ {% endif %} </td> <td class="minimal"> - <a href="?/IP/{{ log.ip }}">{{ log.ip }}</a> + {% if mod|hasPermission(config.mod.show_ip_modlog) %} + <a href="?/IP/{{ log.ip }}">{{ log.ip }}</a> + {% else %} + <em>hidden</em> + {% endif %} </td> <td class="minimal"> <span title="{{ log.time|date(config.post_date) }}">{{ log.time|ago }}</span> diff --git a/templates/mod/login.html b/templates/mod/login.html index 43a28d56..476897a6 100644 --- a/templates/mod/login.html +++ b/templates/mod/login.html @@ -1,26 +1,26 @@ -{% if error %}<h2 style="text-align:center">{{ error }}</h2>{% endif %}
-<form action="" method="post">
-<table style="margin-top:25px;">
- <tr>
- <th>
- {% trans 'Username' %}
- </th>
- <td>
- <input type="text" name="username" size="20" maxlength="30" value="{{ username|e }}">
- </td>
- </tr>
- <tr>
- <th>
- {% trans 'Password' %}
- </th>
- <td>
- <input type="password" name="password" size="20" maxlength="30" value="">
- </td>
- </tr>
- <tr>
- <td></td>
- <td>
- <input type="submit" name="login" value="{% trans %}Continue{% endtrans %}" />
- </td>
-</table>
-</form>
+{% if error %}<h2 style="text-align:center">{{ error }}</h2>{% endif %} +<form action="" method="post"> +<table style="margin-top:25px;"> + <tr> + <th> + {% trans 'Username' %} + </th> + <td> + <input type="text" name="username" size="20" maxlength="30" value="{{ username|e }}"> + </td> + </tr> + <tr> + <th> + {% trans 'Password' %} + </th> + <td> + <input type="password" name="password" size="20" maxlength="30" value=""> + </td> + </tr> + <tr> + <td></td> + <td> + <input type="submit" name="login" value="{% trans %}Continue{% endtrans %}" /> + </td> +</table> +</form> diff --git a/templates/mod/news.html b/templates/mod/news.html index b6c35798..b0335e0a 100644 --- a/templates/mod/news.html +++ b/templates/mod/news.html @@ -52,7 +52,7 @@ <em>{% trans 'no subject' %}</em> {% endif %} <small class="unimportant"> - — {% trans 'by' %} {{ post.name }} {% trans 'at' %} {{ notice.time|date(config.post_date) }} + — {% trans 'by' %} {{ post.name }} {% trans 'at' %} {{ post.time|date(config.post_date) }} </small> </h2> <p> diff --git a/templates/mod/search_results.html b/templates/mod/search_results.html index b441a28f..0c87f75f 100644 --- a/templates/mod/search_results.html +++ b/templates/mod/search_results.html @@ -39,7 +39,7 @@ </tr> {% endfor %} </table> -{% endif %} +{% endif %} {% if search_type == 'bans' %} <table class="modlog" style="width:100%"> @@ -125,7 +125,7 @@ </tr> {% endfor %} </table> -{% endif %} +{% endif %} {% if search_type == 'log' %} <table class="modlog"> @@ -166,7 +166,98 @@ </tr> {% endfor %} </table> -{% endif %} +{% endif %} + +{% if search_type == 'posts' %} + <table class="modlog" style="word-wrap: break-word;"> + <tr> + <th>Time</th> + <th>Board</th> + <th>ID</th> + <th>Thread</th> + <th>IP</th> + <th>Name</th> + <th>Subject</th> + <th>File</th> + <th>Body (snippet)</th> + </tr> + {% for post in results %} + <tr> + <td class="minimal"> + <small>{{ post.time | ago }} ago</small> + </td> + <td class="minimal"> + <a href="?/{{ config.board_path|sprintf(post.board) }}{{ config.file_index }}">{{ config.board_abbreviation|sprintf(post.board) }}</a> + </td> + <td class="minimal"> + {% if post.thread %} + {% set thread = post.thread %} + {% else %} + {% set thread = post.id %} + {% endif %} + <a href="?/{{ post.board ~ '/' ~ config.dir.res}}{{ config.file_page|sprintf(thread) }}#{{ post.id }}"> + {{ post.id }} + </a> + </td> + <td class="minimal"> + <small> + {% if post.thread %} + {{ post.thread }} + {% else %} + (OP) + {% endif %} + </small> + </td> + <td class="minimal"> + {% if mod|hasPermission(config.mod.show_ip, post.board) %} + <a href="?/IP/{{ post.ip }}"> + {{ post.ip }} + </a> + {% else %} + <em>hidden</em> + {% endif %} + </td> + <td style="max-width:100px"> + <small> + {% if post.email|length > 0 %} + {# start email #} + <a class="email" href="mailto:{{ post.email }}"> + {% endif %} + {% set capcode = post.capcode|capcode %} + <span {% if capcode.name %}style="{{ capcode.name }}" {% endif %}class="name">{{ post.name }}</span> + {% if post.trip|length > 0 %} + <span {% if capcode.trip %}style="{{ capcode.trip }}" {% endif %}class="trip">{{ post.trip }}</span> + {% endif %} + {% if post.email|length > 0 %} + {# end email #} + </a> + {% endif %} + {% if capcode %} + {{ capcode.cap }} + {% endif %} + </small> + </td> + <td style="max-width:250px"> + {% if post.subject %} + <small>{{ post.subject }}</small> + {% else %} + – + {% endif %} + </td> + <td style="max-width:200px"> + {% if post.file %} + <small>{{ post.filename }} ({{ post.filesize | filesize }})</small> + {% else %} + – + {% endif %} + </td> + <td> + <small><em>{{ post.snippet }}</em></small> + </td> + </tr> + {% endfor %} + </table> +{% endif %} {% if result_count > results|count %} <p class="unimportant" style="text-align:center;word-wrap:break-word"> diff --git a/templates/page.html b/templates/page.html index 07eea62e..0d33c16f 100644 --- a/templates/page.html +++ b/templates/page.html @@ -1,25 +1,25 @@ -<!doctype html>
-<html>
-<head>
- <meta charset="utf-8">
- {% include 'header.html' %}
- <title>{{ title }}</title>
-</head>
-<body>
- {% if pm %}<div class="top_notice">You have <a href="?/PM/{{ pm.id }}">an unread PM</a>{% if pm.waiting > 0 %}, plus {{ pm.waiting }} more waiting{% endif %}.</div><hr>{% endif %}
- <header>
- <h1>{{ title }}</h1>
- <div class="subtitle">
- {% if subtitle %}
- {{ subtitle }}
- {% endif %}
- {% if mod and not hide_dashboard_link %}<p><a href="?/">{% trans %}Return to dashboard{% endtrans %}</a></p>{% endif %}
- </div>
- </header>
- {{ body }}
- <hr>
- <footer>
- <p class="unimportant" style="margin-top:20px;text-align:center;">Powered by <a href="http://tinyboard.org/">Tinyboard</a> {{ config.version }} | <a href="http://tinyboard.org/">Tinyboard</a> Copyright © 2010-2013 Tinyboard Development Group</p>
- </footer>
-</body>
-</html>
+<!doctype html> +<html> +<head> + <meta charset="utf-8"> + {% include 'header.html' %} + <title>{{ title }}</title> +</head> +<body> + {% if pm %}<div class="top_notice">You have <a href="?/PM/{{ pm.id }}">an unread PM</a>{% if pm.waiting > 0 %}, plus {{ pm.waiting }} more waiting{% endif %}.</div><hr>{% endif %} + <header> + <h1>{{ title }}</h1> + <div class="subtitle"> + {% if subtitle %} + {{ subtitle }} + {% endif %} + {% if mod and not hide_dashboard_link %}<p><a href="?/">{% trans %}Return to dashboard{% endtrans %}</a></p>{% endif %} + </div> + </header> + {{ body }} + <hr> + <footer> + <p class="unimportant" style="margin-top:20px;text-align:center;">Powered by <a href="http://tinyboard.org/">Tinyboard</a> {{ config.version }} | <a href="http://tinyboard.org/">Tinyboard</a> Copyright © 2010-2013 Tinyboard Development Group</p> + </footer> +</body> +</html>
\ No newline at end of file diff --git a/templates/post_form.html b/templates/post_form.html index 64451fb9..fa486263 100755 --- a/templates/post_form.html +++ b/templates/post_form.html @@ -4,6 +4,9 @@ {{ antibot.html() }} <input type="hidden" name="board" value="{{ board.uri }}"> {{ antibot.html() }} +{% if current_page %} + <input type="hidden" name="page" value="{{ current_page }}"> +{% endif %} {% if mod %}<input type="hidden" name="mod" value="1">{% endif %} <table> {% if not config.field_disable_name or (mod and post.mod|hasPermission(config.mod.bypass_field_disable, board.uri)) %}<tr> @@ -67,21 +70,6 @@ </td> </tr> {% endif %} - {% if config.imgcaptcha %} - <tr> - <th> - {% trans %}Verification{% endtrans %} - {{ antibot.html() }} - </th> - <td> - <input type="hidden" name="imgcaptcha_hash" id="imgcaptcha_hash" value="kucaj stad, kucu hakierze"> - <img src="{{ config.imgcaptcha_filler }}" width="{{ config.imgcaptcha_width }}px" height="{{ config.imgcaptcha_height }}px" id="imgcaptcha_img"></img><br> - {{ config.imgcaptcha_question }} <input type="text" name="imgcaptcha_verify" id="imgcaptcha_verify" value=""></input><br> - <a href="javascript:ic_odswiezKapcze()">Odswiez</a> - {{ antibot.html() }} - </td> - </tr> - {% endif %} <tr> <th> {% trans %}File{% endtrans %} @@ -103,7 +91,7 @@ </td> </tr> {% endif %} - {% if mod %} + {% if mod and ((not id and post.mod|hasPermission(config.mod.sticky, board.uri)) or (not id and post.mod|hasPermission(config.mod.lock, board.uri)) or post.mod|hasPermission(config.mod.rawhtml, board.uri)) %} <tr> <th> {% trans %}Flags{% endtrans %} diff --git a/templates/post_reply.html b/templates/post_reply.html index 450f8246..b0391f19 100644 --- a/templates/post_reply.html +++ b/templates/post_reply.html @@ -1,111 +1,111 @@ -{% filter remove_whitespace %}
-{# tabs and new lines will be ignored #}
-<div class="post reply" id="reply_{{ post.id }}">
-
-<p class="intro"{% if not index %} id="{{ post.id }}"{% endif %}>
- <input type="checkbox" class="delete" name="delete_{{ post.id }}" id="delete_{{ post.id }}" />
- <label for="delete_{{ post.id }}">
- {% if post.subject|length > 0 %}
- {# show subject #}
- <span class="subject">{{ post.subject|bidi_cleanup }}</span>
- {% endif %}
- {% if post.email|length > 0 %}
- {# start email #}
- <a class="email" href="mailto:{{ post.email }}">
- {% endif %}
- {% set capcode = post.capcode|capcode %}
- <span {% if capcode.name %}style="{{ capcode.name }}" {% endif %}class="name">{{ post.name|bidi_cleanup }}</span>
- {% if post.trip|length > 0 %}
- <span {% if capcode.trip %}style="{{ capcode.trip }}" {% endif %}class="trip">{{ post.trip }}</span>
- {% endif %}
- {% if post.email|length > 0 %}
- {# end email #}
- </a>
- {% endif %}
- {% if capcode %}
- {{ capcode.cap }}
- {% endif %}
- {% if post.mod and post.mod|hasPermission(config.mod.show_ip, board.uri) %}
- [<a style="margin:0;" href="?/IP/{{ post.ip }}">{{ post.ip }}</a>]
- {% endif %}
- <time datetime="{{ post.time|date('%Y-%m-%dT%H:%M:%S') }}{{ timezone() }}">{{ post.time|date(config.post_date) }}</time>
- </label>
- {% if config.poster_ids %}
- ID: {{ post.ip|poster_id(post.thread) }}
- {% endif %}
- <a class="post_no" {% if not index %}onclick="highlightReply({{ post.id }})" {% endif %}href="{{ post.link }}">No.</a>
- <a class="post_no"
- {% if not index %}
- onclick="citeReply({{ post.id }});"
- {% endif %}
- href="{% if index %}
- {{ post.link('q') }}
- {% else %}
- javascript:void(0);
- {% endif %}">
- {{ post.id }}
- </a>
- </p>
- {% if post.embed %}
- {{ post.embed }}
- {% elseif post.file == 'deleted' %}
- <img src="{{ config.image_deleted }}" alt="" />
- {% elseif post.file and post.file %}
- <p class="fileinfo">File: <a href="{{ config.uri_img }}{{ post.file }}">{{ post.file }}</a> <span class="unimportant">
- (
- {% if post.thumb == 'spoiler' %}
- Spoiler Image,
- {% endif %}
- {{ post.filesize|filesize }}
- {% if post.filex and post.filey %}
- , {{ post.filex}}x{{ post.filey }}
- {% if config.show_ratio %}
- , {{ post.ratio }}
- {% endif %}
- {% endif %}
- {% if config.show_filename and post.filename %}
- ,
- {% if post.filename|length > config.max_filename_display %}
- <span class="postfilename" title="{{ post.filename|bidi_cleanup }}">{{ post.filename|truncate(config.max_filename_display)|bidi_cleanup }}</span>
- {% else %}
- <span class="postfilename">{{ post.filename|bidi_cleanup }}</span>
- {% endif %}
- {% endif %}
- {% if post.thumb != 'file' and config.image_identification %}
- ,
- <span class='image_id'>
- <a href="http://imgops.com/{{ config.domain }}{{ config.uri_img }}{{ post.file }}">io</a>
- {% if post.file|extension == 'jpg' %}
- <a href="http://regex.info/exif.cgi?url={{ config.domain }}{{ config.uri_img }}{{ post.file }}">e</a>
- {% endif %}
- <a href="http://www.google.com/searchbyimage?image_url={{ config.domain }}{{ config.uri_img }}{{ post.file }}">g</a>
- <a href="http://www.tineye.com/search?url={{ config.domain }}{{ config.uri_img }}{{ post.file }}">t</a>
- </span>
- {% endif %}
-
- )
- </span>
-</p>
- <a href="{{ config.uri_img }}{{ post.file }}" target="_blank"{% if post.thumb == 'file' %} class="file"{% endif %}>
- <img src="
- {% if post.thumb == 'file' %}
- {{ config.root }}
- {% if config.file_icons[post.filename|extension] %}
- {{ config.file_thumb|sprintf(config.file_icons[post.filename|extension]) }}
- {% else %}
- {{ config.file_thumb|sprintf(config.file_icons.default) }}
- {% endif %}
- {% elseif post.thumb == 'spoiler' %}
- {{ config.root }}{{ config.spoiler_image }}
- {% else %}
- {{ config.uri_thumb }}{{ post.thumb }}
- {% endif %}" style="width:{{ post.thumbx }}px;height:{{ post.thumby }}px" alt="" />
- </a>
- {% endif %}
- {{ post.postControls }}
- <div class="body">
- {% endfilter %}{% if index %}{{ post.body|truncate_body(post.link) }}{% else %}{{ post.body }}{% endif %}{% filter remove_whitespace %}
- </div>
-</div>
-<br/>
-{% endfilter %}
+{% filter remove_whitespace %} +{# tabs and new lines will be ignored #} +<div class="post reply" id="reply_{{ post.id }}"> + +<p class="intro"{% if not index %} id="{{ post.id }}"{% endif %}> + <input type="checkbox" class="delete" name="delete_{{ post.id }}" id="delete_{{ post.id }}" /> + <label for="delete_{{ post.id }}"> + {% if post.subject|length > 0 %} + {# show subject #} + <span class="subject">{{ post.subject|bidi_cleanup }}</span> + {% endif %} + {% if post.email|length > 0 %} + {# start email #} + <a class="email" href="mailto:{{ post.email }}"> + {% endif %} + {% set capcode = post.capcode|capcode %} + <span {% if capcode.name %}style="{{ capcode.name }}" {% endif %}class="name">{{ post.name|bidi_cleanup }}</span> + {% if post.trip|length > 0 %} + <span {% if capcode.trip %}style="{{ capcode.trip }}" {% endif %}class="trip">{{ post.trip }}</span> + {% endif %} + {% if post.email|length > 0 %} + {# end email #} + </a> + {% endif %} + {% if capcode %} + {{ capcode.cap }} + {% endif %} + {% if post.mod and post.mod|hasPermission(config.mod.show_ip, board.uri) %} + [<a style="margin:0;" href="?/IP/{{ post.ip }}">{{ post.ip }}</a>] + {% endif %} + <time datetime="{{ post.time|date('%Y-%m-%dT%H:%M:%S') }}{{ timezone() }}">{{ post.time|date(config.post_date) }}</time> + </label> + {% if config.poster_ids %} + ID: {{ post.ip|poster_id(post.thread) }} + {% endif %} + <a class="post_no" {% if not index %}onclick="highlightReply({{ post.id }})" {% endif %}href="{{ post.link }}">No.</a> + <a class="post_no" + {% if not index %} + onclick="citeReply({{ post.id }});" + {% endif %} + href="{% if index %} + {{ post.link('q') }} + {% else %} + javascript:void(0); + {% endif %}"> + {{ post.id }} + </a> + </p> + {% if post.embed %} + {{ post.embed }} + {% elseif post.file == 'deleted' %} + <img src="{{ config.image_deleted }}" alt="" /> + {% elseif post.file and post.file %} + <p class="fileinfo">File: <a href="{{ config.uri_img }}{{ post.file }}">{{ post.file }}</a> <span class="unimportant"> + ( + {% if post.thumb == 'spoiler' %} + Spoiler Image, + {% endif %} + {{ post.filesize|filesize }} + {% if post.filex and post.filey %} + , {{ post.filex}}x{{ post.filey }} + {% if config.show_ratio %} + , {{ post.ratio }} + {% endif %} + {% endif %} + {% if config.show_filename and post.filename %} + , + {% if post.filename|length > config.max_filename_display %} + <span class="postfilename" title="{{ post.filename|e|bidi_cleanup }}">{{ post.filename|truncate(config.max_filename_display)|bidi_cleanup }}</span> + {% else %} + <span class="postfilename">{{ post.filename|e|bidi_cleanup }}</span> + {% endif %} + {% endif %} + {% if post.thumb != 'file' and config.image_identification %} + , + <span class='image_id'> + <a href="http://imgops.com/{{ config.domain }}{{ config.uri_img }}{{ post.file }}">io</a> + {% if post.file|extension == 'jpg' %} + <a href="http://regex.info/exif.cgi?url={{ config.domain }}{{ config.uri_img }}{{ post.file }}">e</a> + {% endif %} + <a href="http://www.google.com/searchbyimage?image_url={{ config.domain }}{{ config.uri_img }}{{ post.file }}">g</a> + <a href="http://www.tineye.com/search?url={{ config.domain }}{{ config.uri_img }}{{ post.file }}">t</a> + </span> + {% endif %} + + ) + </span> +</p> + <a href="{{ config.uri_img }}{{ post.file }}" target="_blank"{% if post.thumb == 'file' %} class="file"{% endif %}> + <img src=" + {% if post.thumb == 'file' %} + {{ config.root }} + {% if config.file_icons[post.filename|extension] %} + {{ config.file_thumb|sprintf(config.file_icons[post.filename|extension]) }} + {% else %} + {{ config.file_thumb|sprintf(config.file_icons.default) }} + {% endif %} + {% elseif post.thumb == 'spoiler' %} + {{ config.root }}{{ config.spoiler_image }} + {% else %} + {{ config.uri_thumb }}{{ post.thumb }} + {% endif %}" style="width:{{ post.thumbx }}px;height:{{ post.thumby }}px" alt="" /> + </a> + {% endif %} + {{ post.postControls }} + <div class="body"> + {% endfilter %}{% if index %}{{ post.body|truncate_body(post.link) }}{% else %}{{ post.body }}{% endif %}{% filter remove_whitespace %} + </div> +</div> +<br/> +{% endfilter %} diff --git a/templates/post_thread.html b/templates/post_thread.html index edc07011..a24d7557 100644 --- a/templates/post_thread.html +++ b/templates/post_thread.html @@ -23,9 +23,9 @@ {% if config.show_filename and post.filename %} , {% if post.filename|length > config.max_filename_display %} - <span class="postfilename" title="{{ post.filename|bidi_cleanup }}">{{ post.filename|truncate(config.max_filename_display)|bidi_cleanup }}</span> + <span class="postfilename" title="{{ post.filename|e|bidi_cleanup }}">{{ post.filename|truncate(config.max_filename_display)|bidi_cleanup }}</span> {% else %} - <span class="postfilename">{{ post.filename|bidi_cleanup }}</span> + <span class="postfilename">{{ post.filename|e|bidi_cleanup }}</span> {% endif %} {% endif %} {% if post.thumb != 'file' and config.image_identification %} @@ -100,13 +100,25 @@ {{ post.id }} </a> {% if post.sticky %} - <img class="icon" title="Sticky" src="{{ config.image_sticky }}" alt="Sticky" /> + {% if config.font_awesome %} + <i class="icon-pushpin icon"></i> + {% else %} + <img class="icon" title="Sticky" src="{{ config.image_sticky }}" alt="Sticky" /> + {% endif %} {% endif %} {% if post.locked %} - <img class="icon" title="Locked" src="{{ config.image_locked }}" alt="Locked" /> + {% if config.font_awesome %} + <i class="icon-lock icon"></i> + {% else %} + <img class="icon" title="Locked" src="{{ config.image_locked }}" alt="Locked" /> + {% endif %} {% endif %} {% if post.bumplocked and (config.mod.view_bumplock < 0 or (post.mod and post.mod|hasPermission(config.mod.view_bumplock, board.uri))) %} - <img class="icon" title="Bumplocked" src="{{ config.image_bumplocked }}" alt="Bumplocked" /> + {% if config.font_awesome %} + <i class="icon-anchor icon"></i> + {% else %} + <img class="icon" title="Bumplocked" src="{{ config.image_bumplocked }}" alt="Bumplocked" /> + {% endif %} {% endif %} {% if index %} <a href="{{ post.root }}{{ board.dir }}{{ config.dir.res }}{{ config.file_page|sprintf(post.id) }}">[{% trans %}Reply{% endtrans %}]</a> @@ -145,4 +157,4 @@ {% include 'post_reply.html' %} {% endfor %} <br class="clear"/>{% if hr %}<hr/>{% endif %} -</div>
\ No newline at end of file +</div> diff --git a/templates/posts.sql b/templates/posts.sql index c766d38e..ca2ec304 100644 --- a/templates/posts.sql +++ b/templates/posts.sql @@ -1,32 +1,33 @@ -CREATE TABLE IF NOT EXISTS `posts_{{ board }}` (
- `id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT,
- `thread` int(11) DEFAULT NULL,
- `subject` varchar(100) DEFAULT NULL,
- `email` varchar(30) DEFAULT NULL,
- `name` varchar(35) DEFAULT NULL,
- `trip` varchar(15) DEFAULT NULL,
- `capcode` varchar(50) DEFAULT NULL,
- `body` text NOT NULL,
- `body_nomarkup` text DEFAULT NULL,
- `time` int(11) NOT NULL,
- `bump` int(11) DEFAULT NULL,
- `thumb` varchar(50) DEFAULT NULL,
- `thumbwidth` int(11) DEFAULT NULL,
- `thumbheight` int(11) DEFAULT NULL,
- `file` varchar(50) DEFAULT NULL,
- `filewidth` int(11) DEFAULT NULL,
- `fileheight` int(11) DEFAULT NULL,
- `filesize` int(11) DEFAULT NULL,
- `filename` text DEFAULT NULL,
- `filehash` text DEFAULT NULL,
- `password` varchar(20) DEFAULT NULL,
- `ip` varchar(45) NOT NULL,
- `sticky` int(1) NOT NULL,
- `locked` int(1) NOT NULL,
- `sage` int(1) NOT NULL,
- `embed` text,
- UNIQUE KEY `id` (`id`),
- KEY `thread_id` (`thread`, `id`),
- KEY `time` (`time`),
- FULLTEXT KEY `body` (`body`)
-) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
+CREATE TABLE IF NOT EXISTS ``posts_{{ board }}`` ( + `id` int(11) unsigned NOT NULL AUTO_INCREMENT, + `thread` int(11) DEFAULT NULL, + `subject` varchar(100) DEFAULT NULL, + `email` varchar(30) DEFAULT NULL, + `name` varchar(35) DEFAULT NULL, + `trip` varchar(15) DEFAULT NULL, + `capcode` varchar(50) DEFAULT NULL, + `body` text NOT NULL, + `body_nomarkup` text, + `time` int(11) NOT NULL, + `bump` int(11) DEFAULT NULL, + `thumb` varchar(50) DEFAULT NULL, + `thumbwidth` int(11) DEFAULT NULL, + `thumbheight` int(11) DEFAULT NULL, + `file` varchar(50) DEFAULT NULL, + `filewidth` int(11) DEFAULT NULL, + `fileheight` int(11) DEFAULT NULL, + `filesize` int(11) DEFAULT NULL, + `filename` text, + `filehash` text CHARACTER SET ascii, + `password` varchar(20) DEFAULT NULL, + `ip` varchar(39) CHARACTER SET ascii NOT NULL, + `sticky` int(1) NOT NULL, + `locked` int(1) NOT NULL, + `sage` int(1) NOT NULL, + `embed` text, + UNIQUE KEY `id` (`id`), + KEY `thread_id` (`thread`,`id`), + KEY `time` (`time`), + FULLTEXT KEY `body` (`body`) + ) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 AUTO_INCREMENT=1 ; +
\ No newline at end of file diff --git a/templates/themes/basic/theme.php b/templates/themes/basic/theme.php index 7ba0d1e7..6ba09ce6 100644 --- a/templates/themes/basic/theme.php +++ b/templates/themes/basic/theme.php @@ -25,7 +25,7 @@ $settings['no_recent'] = (int) $settings['no_recent']; - $query = query("SELECT * FROM `news` ORDER BY `time` DESC" . ($settings['no_recent'] ? ' LIMIT ' . $settings['no_recent'] : '')) or error(db_error()); + $query = query("SELECT * FROM ``news`` ORDER BY `time` DESC" . ($settings['no_recent'] ? ' LIMIT ' . $settings['no_recent'] : '')) or error(db_error()); $news = $query->fetchAll(PDO::FETCH_ASSOC); return Element('themes/basic/index.html', Array( diff --git a/templates/themes/catalog/theme.php b/templates/themes/catalog/theme.php index e585cf17..4e2d40db 100644 --- a/templates/themes/catalog/theme.php +++ b/templates/themes/catalog/theme.php @@ -37,9 +37,9 @@ $recent_posts = array(); $stats = array(); - $query = query(sprintf("SELECT *, `id` AS `thread_id`, (SELECT COUNT(*) FROM `posts_%s` WHERE `thread` = `thread_id`) AS `reply_count`, '%s' AS `board` FROM `posts_%s` WHERE `thread` IS NULL ORDER BY `bump` DESC", $board_name, $board_name, $board_name)) or error(db_error()); + $query = query(sprintf("SELECT *, `id` AS `thread_id`, (SELECT COUNT(*) FROM ``posts_%s`` WHERE `thread` = `thread_id`) AS `reply_count`, '%s' AS `board` FROM ``posts_%s`` WHERE `thread` IS NULL ORDER BY `bump` DESC", $board_name, $board_name, $board_name)) or error(db_error()); - while ($post = $query->fetch()) { + while ($post = $query->fetch(PDO::FETCH_ASSOC)) { $post['link'] = $config['root'] . $board['dir'] . $config['dir']['res'] . sprintf($config['file_page'], ($post['thread'] ? $post['thread'] : $post['id'])); $post['board_name'] = $board['name']; $post['file'] = $config['uri_thumb'] . $post['thumb']; diff --git a/templates/themes/categories/news.html b/templates/themes/categories/news.html index 9c7d8340..b3bea2b1 100644 --- a/templates/themes/categories/news.html +++ b/templates/themes/categories/news.html @@ -7,7 +7,7 @@ <link rel="stylesheet" media="screen" href="{{ config.url_stylesheet }}"/> </head> <body> - <h1>{{ settings.title }}</h1> + {{ boardlist.top }} <header> <h1>{{ settings.title }}</h1> <div class="subtitle">{{ settings.subtitle }}</div> @@ -15,16 +15,16 @@ <div class="ban"> {% if news|count == 0 %} - <p style="text-align:center" class="unimportant">(No news to show.)</p> + <p style="text-align:center" class="unimportant">{% trans %}(No news to show.){% endtrans %}</p> {% else %} {% for entry in news %} <h2 id="{{ entry.id }}"> {% if entry.subject %} {{ entry.subject }} {% else %} - <em>no subject</em> + <em>{% trans %}no subject{% endtrans %}</em> {% endif %} - <span class="unimportant"> — by {{ entry.name }} at {{ entry.time|date(config.post_date) }}</span> + <span class="unimportant"> — {% trans %}by{% endtrans %} {{ entry.name }} {% trans %}at{% endtrans %} {{ entry.time|date(config.post_date) }}</span> </h2> <p>{{ entry.body }}</p> {% endfor %} diff --git a/templates/themes/categories/theme.php b/templates/themes/categories/theme.php index 7d468d0d..74ed61ed 100644 --- a/templates/themes/categories/theme.php +++ b/templates/themes/categories/theme.php @@ -36,7 +36,7 @@ public static function news($settings) { global $config; - $query = query("SELECT * FROM `news` ORDER BY `time` DESC") or error(db_error()); + $query = query("SELECT * FROM ``news`` ORDER BY `time` DESC") or error(db_error()); $news = $query->fetchAll(PDO::FETCH_ASSOC); return Element('themes/categories/news.html', Array( diff --git a/templates/themes/frameset/theme.php b/templates/themes/frameset/theme.php index 5fd9d29e..ffab0538 100644 --- a/templates/themes/frameset/theme.php +++ b/templates/themes/frameset/theme.php @@ -36,7 +36,7 @@ public static function news($settings) { global $config; - $query = query("SELECT * FROM `news` ORDER BY `time` DESC") or error(db_error()); + $query = query("SELECT * FROM ``news`` ORDER BY `time` DESC") or error(db_error()); $news = $query->fetchAll(PDO::FETCH_ASSOC); return Element('themes/frameset/news.html', Array( diff --git a/templates/themes/recent/theme.php b/templates/themes/recent/theme.php index 75907e77..08d910f8 100644 --- a/templates/themes/recent/theme.php +++ b/templates/themes/recent/theme.php @@ -42,12 +42,12 @@ foreach ($boards as &$_board) { if (in_array($_board['uri'], $this->excluded)) continue; - $query .= sprintf("SELECT *, '%s' AS `board` FROM `posts_%s` WHERE `file` IS NOT NULL AND `file` != 'deleted' AND `thumb` != 'spoiler' UNION ALL ", $_board['uri'], $_board['uri']); + $query .= sprintf("SELECT *, '%s' AS `board` FROM ``posts_%s`` WHERE `file` IS NOT NULL AND `file` != 'deleted' AND `thumb` != 'spoiler' UNION ALL ", $_board['uri'], $_board['uri']); } $query = preg_replace('/UNION ALL $/', 'ORDER BY `time` DESC LIMIT ' . (int)$settings['limit_images'], $query); $query = query($query) or error(db_error()); - while ($post = $query->fetch()) { + while ($post = $query->fetch(PDO::FETCH_ASSOC)) { openBoard($post['board']); // board settings won't be available in the template file, so generate links now @@ -62,12 +62,12 @@ foreach ($boards as &$_board) { if (in_array($_board['uri'], $this->excluded)) continue; - $query .= sprintf("SELECT *, '%s' AS `board` FROM `posts_%s` UNION ALL ", $_board['uri'], $_board['uri']); + $query .= sprintf("SELECT *, '%s' AS `board` FROM ``posts_%s`` UNION ALL ", $_board['uri'], $_board['uri']); } $query = preg_replace('/UNION ALL $/', 'ORDER BY `time` DESC LIMIT ' . (int)$settings['limit_posts'], $query); $query = query($query) or error(db_error()); - while ($post = $query->fetch()) { + while ($post = $query->fetch(PDO::FETCH_ASSOC)) { openBoard($post['board']); $post['link'] = $config['root'] . $board['dir'] . $config['dir']['res'] . sprintf($config['file_page'], ($post['thread'] ? $post['thread'] : $post['id'])) . '#' . $post['id']; @@ -78,40 +78,37 @@ } // Total posts - $query = 'SELECT SUM(`top`) AS `count` FROM ('; + $query = 'SELECT SUM(`top`) FROM ('; foreach ($boards as &$_board) { if (in_array($_board['uri'], $this->excluded)) continue; - $query .= sprintf("SELECT MAX(`id`) AS `top` FROM `posts_%s` UNION ALL ", $_board['uri']); + $query .= sprintf("SELECT MAX(`id`) AS `top` FROM ``posts_%s`` UNION ALL ", $_board['uri']); } $query = preg_replace('/UNION ALL $/', ') AS `posts_all`', $query); $query = query($query) or error(db_error()); - $res = $query->fetch(); - $stats['total_posts'] = number_format($res['count']); + $stats['total_posts'] = number_format($query->fetchColumn()); // Unique IPs - $query = 'SELECT COUNT(DISTINCT(`ip`)) AS `count` FROM ('; + $query = 'SELECT COUNT(DISTINCT(`ip`)) FROM ('; foreach ($boards as &$_board) { if (in_array($_board['uri'], $this->excluded)) continue; - $query .= sprintf("SELECT `ip` FROM `posts_%s` UNION ALL ", $_board['uri']); + $query .= sprintf("SELECT `ip` FROM ``posts_%s`` UNION ALL ", $_board['uri']); } $query = preg_replace('/UNION ALL $/', ') AS `posts_all`', $query); $query = query($query) or error(db_error()); - $res = $query->fetch(); - $stats['unique_posters'] = number_format($res['count']); + $stats['unique_posters'] = number_format($query->fetchColumn()); // Active content - $query = 'SELECT SUM(`filesize`) AS `count` FROM ('; + $query = 'SELECT SUM(`filesize`) FROM ('; foreach ($boards as &$_board) { if (in_array($_board['uri'], $this->excluded)) continue; - $query .= sprintf("SELECT `filesize` FROM `posts_%s` UNION ALL ", $_board['uri']); + $query .= sprintf("SELECT `filesize` FROM ``posts_%s`` UNION ALL ", $_board['uri']); } $query = preg_replace('/UNION ALL $/', ') AS `posts_all`', $query); $query = query($query) or error(db_error()); - $res = $query->fetch(); - $stats['active_content'] = $res['count']; + $stats['active_content'] = $query->fetchColumn(); return Element('themes/recent/recent.html', Array( 'settings' => $settings, diff --git a/templates/themes/rrdtool/theme.php b/templates/themes/rrdtool/theme.php index 68fc1850..a14169a3 100644 --- a/templates/themes/rrdtool/theme.php +++ b/templates/themes/rrdtool/theme.php @@ -61,9 +61,8 @@ // debug just the graphing (not updating) with the --debug switch if (!isset($argv[1]) || $argv[1] != '--debug') { // Update graph - $query = query(sprintf("SELECT MAX(`id`) AS `count` FROM `posts_%s`", $board)); - $count = $query->fetch(); - $count = $count['count']; + $query = query(sprintf("SELECT MAX(`id`) FROM ``posts_%s``", $board)); + $count = $query->fetchColumn(); if (!rrd_update($file, Array( '-t', diff --git a/templates/themes/sitemap/theme.php b/templates/themes/sitemap/theme.php index e210316b..226f8357 100644 --- a/templates/themes/sitemap/theme.php +++ b/templates/themes/sitemap/theme.php @@ -19,7 +19,7 @@ $threads = array(); foreach ($boards as $board) { - $query = query(sprintf("SELECT `id` AS `thread_id`, (SELECT `time` FROM `posts_%s` WHERE `thread` = `thread_id` OR `id` = `thread_id` ORDER BY `time` DESC LIMIT 1) AS `lastmod` FROM `posts_%s` WHERE `thread` IS NULL", $board, $board)) or error(db_error()); + $query = query(sprintf("SELECT `id` AS `thread_id`, (SELECT `time` FROM ``posts_%s`` WHERE `thread` = `thread_id` OR `id` = `thread_id` ORDER BY `time` DESC LIMIT 1) AS `lastmod` FROM ``posts_%s`` WHERE `thread` IS NULL", $board, $board)) or error(db_error()); $threads[$board] = $query->fetchAll(PDO::FETCH_ASSOC); } diff --git a/templates/themes/ukko/theme.php b/templates/themes/ukko/theme.php index 6fa5fa7e..1682b4ec 100644 --- a/templates/themes/ukko/theme.php +++ b/templates/themes/ukko/theme.php @@ -25,7 +25,7 @@ foreach($boards as &$_board) { if(in_array($_board['uri'], explode(' ', $this->settings['exclude']))) continue; - $query .= sprintf("SELECT *, '%s' AS `board` FROM `posts_%s` WHERE `thread` IS NULL UNION ALL ", $_board['uri'], $_board['uri']); + $query .= sprintf("SELECT *, '%s' AS `board` FROM ``posts_%s`` WHERE `thread` IS NULL UNION ALL ", $_board['uri'], $_board['uri']); } $query = preg_replace('/UNION ALL $/', 'ORDER BY `bump` DESC', $query); $query = query($query) or error(db_error()); @@ -48,7 +48,7 @@ $post['filename'], $post['ip'], $post['sticky'], $post['locked'], $post['sage'], $post['embed'], $mod ? '?/' : $config['root'], $mod ); - $posts = prepare(sprintf("SELECT * FROM `posts_%s` WHERE `thread` = :id ORDER BY `id` DESC LIMIT :limit", $post['board'])); + $posts = prepare(sprintf("SELECT * FROM ``posts_%s`` WHERE `thread` = :id ORDER BY `id` DESC LIMIT :limit", $post['board'])); $posts->bindValue(':id', $post['id']); $posts->bindValue(':limit', ($post['sticky'] ? $config['threads_preview_sticky'] : $config['threads_preview']), PDO::PARAM_INT); $posts->execute() or error(db_error($posts)); @@ -66,7 +66,7 @@ } if ($posts->rowCount() == ($post['sticky'] ? $config['threads_preview_sticky'] : $config['threads_preview'])) { - $ct = prepare(sprintf("SELECT COUNT(`id`) as `num` FROM `posts_%s` WHERE `thread` = :thread UNION ALL SELECT COUNT(`id`) FROM `posts_%s` WHERE `file` IS NOT NULL AND `thread` = :thread", $post['board'], $post['board'])); + $ct = prepare(sprintf("SELECT COUNT(`id`) as `num` FROM ``posts_%s`` WHERE `thread` = :thread UNION ALL SELECT COUNT(`id`) FROM `posts_%s` WHERE `file` IS NOT NULL AND `thread` = :thread", $post['board'], $post['board'])); $ct->bindValue(':thread', $post['id'], PDO::PARAM_INT); $ct->execute() or error(db_error($count)); diff --git a/templates/themes/ukko/ukko.js b/templates/themes/ukko/ukko.js index baf0f78d..4a36b394 100644 --- a/templates/themes/ukko/ukko.js +++ b/templates/themes/ukko/ukko.js @@ -1,37 +1,115 @@ +(function(){ + var cache = new Array(), thread = false, - loading = false; + loading = false, + ukkotimer = false; +if (localStorage.hiddenboards !== null) { + localStorage.hiddenboards = "{}"; +} + +// Load data from HTML5 localStorage +var hiddenboards = JSON.parse(localStorage.hiddenboards); + +var storeboards = function() { + localStorage.hiddenboards = JSON.stringify(hiddenboards); +}; + $(document).ready(function() { - $(window).on('scroll', function() { - if($(window).scrollTop() + $(window).height() + 100 > $(document).height() && !loading && overflow.length > 0) { + var addukkohide = function() { + var ukkohide = $('<a href="javascript:void(0);" class="unimportant ukkohide"></a>'); + var board = $(this).next().data("board"); + var hr = $("<hr />"); + + $(this).append(ukkohide); + $(this).append(hr); + + if (hiddenboards[board] !== true) { + ukkohide.html(_("(hide threads from this board)")); + hr.hide(); + } + else { + ukkohide.html(_("(show threads from this board)")); + $(this).next().hide(); + } + ukkohide.click(function() { + hiddenboards[board] = (hiddenboards[board] !== true); + if (hiddenboards[board] !== true) { + $('[data-board="'+board+'"]:not([data-cached="yes"])').show().prev(). + find('.ukkohide').html(_("(hide threads from this board)")). + parent().find('hr').hide(); + } + else { + $('[data-board="'+board+'"]:not([data-cached="yes"])').hide().prev(). + find('.ukkohide').html(_("(show threads from this board)")) + .parent().find('hr').show(); + } + storeboards(); + return false; + }); + + }; + $("h2").each(addukkohide); + + $('.pages').hide(); + var loadnext = function() { + if (overflow.length == 0) { + $('.pages').show().html(_("No more threads to display")); + } + while($(window).scrollTop() + $(window).height() + 1000 > $(document).height() && !loading && overflow.length > 0) { var page = '../' + overflow[0].board + '/' + overflow[0].page; + thread = $('div#thread_' + overflow[0].id + '[data-board="' + overflow[0].board + '"]'); + if (thread.length > 0 && thread.attr("data-cached") !== 'yes') { // already present + overflow.shift(); + continue; + } + + var boardheader = $('<h2><a href="/' + overflow[0].board + '/">/' + overflow[0].board + '/</a> </h2>'); + if($.inArray(page, cache) != -1) { - thread = $('div#thread_' + overflow[0].id); - if(thread.length > 0) { - thread.prepend('<h2><a href="/' + overflow[0].board + '/">/' + overflow[0].board + '/</a></h2>'); - $('div[id*="thread_"]').last().after(thread.attr('data-board', overflow[0].board).css('display', 'block')); - overflow.shift(); + if (thread.length > 0) { + $('div[id*="thread_"]').last().after(thread.attr('data-board', overflow[0].board).attr("data-cached", "no").css('display', 'block')); + boardheader.insertBefore(thread); + addukkohide.call(boardheader); + $(document).trigger('new_post', thread); } + overflow.shift(); } else { loading = true; + $('.pages').show().html(_("Loading...")); $.get(page, function(data) { cache.push(page); $(data).find('div[id*="thread_"]').each(function() { - $('body').prepend($(this).css('display', 'none').attr('data-board', overflow[0].board)); + var checkout = $(this).attr('id').replace('thread_', ''); + if ($('div#thread_' + checkout + '[data-board="' + overflow[0].board + '"]').length == 0) { + $('form[name="postcontrols"]').prepend($(this).css('display', 'none').attr("data-cached", "yes").attr('data-board', overflow[0].board)); + } }); - thread = $('div#thread_' + overflow[0].id + '[data-board="' + overflow[0].board + '"]'); + thread = $('div#thread_' + overflow[0].id + '[data-board="' + overflow[0].board + '"][data-cached="yes"]'); + if(thread.length > 0) { - thread.prepend('<h2><a href="/' + overflow[0].board + '/">/' + overflow[0].board + '/</a></h2>'); - $('div[id*="thread_"]').last().after(thread.attr('data-board', overflow[0].board).css('display', 'block')); - overflow.shift(); + $('div[id*="thread_"]').last().after(thread.attr('data-board', overflow[0].board).attr("data-cached", "no").css('display', 'block')); + boardheader.insertBefore(thread); + addukkohide.call(boardheader); + $(document).trigger('new_post', thread); } + overflow.shift(); loading = false; + $('.pages').hide().html(""); }); + break; } } - }); + clearTimeout(ukkotimer); + ukkotimer = setTimeout(loadnext, 1000); + }; + + $(window).on('scroll', loadnext); + + ukkotimer = setTimeout(loadnext, 1000); +}); -});
\ No newline at end of file +})(); diff --git a/templates/thread.html b/templates/thread.html index 1b217c2f..7fe60a39 100644 --- a/templates/thread.html +++ b/templates/thread.html @@ -1,51 +1,52 @@ -<!doctype html>
-<html>
-<head>
- <meta charset="utf-8">
-
- <script type="text/javascript">
- var active_page = "thread";
- </script>
-
- {% include 'header.html' %}
- <title>{{ board.url }} - {% if config.thread_subject_in_title and thread.subject %}{{ thread.subject }}{% else %}{{ board.title|e }}{% endif %}</title>
-</head>
-<body>
- {{ boardlist.top }}
- {% if pm %}<div class="top_notice">You have <a href="?/PM/{{ pm.id }}">an unread PM</a>{% if pm.waiting > 0 %}, plus {{ pm.waiting }} more waiting{% endif %}.</div><hr />{% endif %}
- {% if config.url_banner %}<img class="banner" src="{{ config.url_banner }}" {% if config.banner_width or config.banner_height %}style="{% if config.banner_width %}width:{{ config.banner_width }}px{% endif %};{% if config.banner_width %}height:{{ config.banner_height }}px{% endif %}" {% endif %}alt="" />{% endif %}
- <header>
- <h1>{{ board.url }} - {{ board.title|e }}</h1>
- <div class="subtitle">
- {% if board.subtitle %}
- {{ board.subtitle|e }}
- {% endif %}
- {% if mod %}<p><a href="?/">{% trans %}Return to dashboard{% endtrans %}</a></p>{% endif %}
- </div>
- </header>
-
- <div class="banner">{% trans %}Posting mode: Reply{% endtrans %} <a class="unimportant" href="{{ return }}">[{% trans %}Return{% endtrans %}]</a></div>
-
- {% include 'attention_bar.html' %}
- {% include 'post_form.html' %}
-
- {% if config.blotter %}<hr /><div class="blotter">{{ config.blotter }}</div>{% endif %}
- <hr />
- <form name="postcontrols" action="{{ config.post_url }}" method="post">
- <input type="hidden" name="board" value="{{ board.uri }}" />
- {% if mod %}<input type="hidden" name="mod" value="1" />{% endif %}
- {{ body }}
- {% include 'report_delete.html' %}
- </form>
- <a href="{{ return }}">[{% trans %}Return{% endtrans %}]</a>
-
- {{ boardlist.bottom }}
- <footer>
- <p class="unimportant" style="margin-top:20px;text-align:center;">Powered by <a href="http://tinyboard.org/">Tinyboard</a> {{ config.version }} | <a href="http://tinyboard.org/">Tinyboard</a> Copyright © 2010-2013 Tinyboard Development Group</p>
- {% for footer in config.footer %}<p class="unimportant" style="text-align:center;">{{ footer }}</p>{% endfor %}
- </footer>
- <script type="text/javascript">{% raw %}
- ready();
- {% endraw %}</script>
-</body>
-</html>
+<!doctype html> +<html> +<head> + <meta charset="utf-8"> + + <script type="text/javascript"> + var active_page = "thread"; + </script> + + {% include 'header.html' %} + <title>{{ board.url }} - {% if config.thread_subject_in_title and thread.subject %}{{ thread.subject }}{% else %}{{ board.title|e }}{% endif %}</title> +</head> +<body> + {{ boardlist.top }} + {% if pm %}<div class="top_notice">You have <a href="?/PM/{{ pm.id }}">an unread PM</a>{% if pm.waiting > 0 %}, plus {{ pm.waiting }} more waiting{% endif %}.</div><hr />{% endif %} + {% if config.url_banner %}<img class="banner" src="{{ config.url_banner }}" {% if config.banner_width or config.banner_height %}style="{% if config.banner_width %}width:{{ config.banner_width }}px{% endif %};{% if config.banner_width %}height:{{ config.banner_height }}px{% endif %}" {% endif %}alt="" />{% endif %} + <header> + <h1>{{ board.url }} - {{ board.title|e }}</h1> + <div class="subtitle"> + {% if board.subtitle %} + {{ board.subtitle|e }} + {% endif %} + {% if mod %}<p><a href="?/">{% trans %}Return to dashboard{% endtrans %}</a></p>{% endif %} + </div> + </header> + + <div class="banner">{% trans %}Posting mode: Reply{% endtrans %} <a class="unimportant" href="{{ return }}">[{% trans %}Return{% endtrans %}]</a></div> + + {% include 'attention_bar.html' %} + + {% include 'post_form.html' %} + + {% if config.global_message %}<hr /><div class="blotter">{{ config.global_message }}</div>{% endif %} + <hr /> + <form name="postcontrols" action="{{ config.post_url }}" method="post"> + <input type="hidden" name="board" value="{{ board.uri }}" /> + {% if mod %}<input type="hidden" name="mod" value="1" />{% endif %} + {{ body }} + {% include 'report_delete.html' %} + </form> + <a href="{{ return }}">[{% trans %}Return{% endtrans %}]</a> + + {{ boardlist.bottom }} + <footer> + <p class="unimportant" style="margin-top:20px;text-align:center;">Powered by <a href="http://tinyboard.org/">Tinyboard</a> {{ config.version }} | <a href="http://tinyboard.org/">Tinyboard</a> Copyright © 2010-2013 Tinyboard Development Group</p> + {% for footer in config.footer %}<p class="unimportant" style="text-align:center;">{{ footer }}</p>{% endfor %} + </footer> + <script type="text/javascript">{% raw %} + ready(); + {% endraw %}</script> +</body> +</html> diff --git a/tools/i18n_extract.php b/tools/i18n_extract.php index 33650b50..4c32b688 100755 --- a/tools/i18n_extract.php +++ b/tools/i18n_extract.php @@ -43,5 +43,5 @@ foreach ($locales as $loc) { // Generate javascript.po passthru("cd $locdir/LC_MESSAGES; - xgettext -d javascript -L Python --force-po --from-code utf-8 $join -c $(find ../../../../js/ -name \*.js)"); + xgettext -d javascript -L Python --force-po --from-code utf-8 $join -c $(find ../../../../js/ ../../../../templates/ -name \*.js)"); } |
