diff --git a/administrator/templates/hathor/less/colour_baseline.less b/administrator/templates/hathor/less/colour_baseline.less index 0e2e4bc024646..bab0cfdab89cf 100644 --- a/administrator/templates/hathor/less/colour_baseline.less +++ b/administrator/templates/hathor/less/colour_baseline.less @@ -174,10 +174,10 @@ div.toolbar-list a { } div.toolbar-list a:hover { - border-left: 1px solid @NWBorder; - border-top: 1px solid @NWBorder; - border-right: 1px solid @SEBorder; - border-bottom: 1px solid @SEBorder; + border-left: 1px solid @nwBorder; + border-top: 1px solid @nwBorder; + border-right: 1px solid @seBorder; + border-bottom: 1px solid @seBorder; background: @hoverBackground; color: @toolbarColor; } @@ -201,10 +201,10 @@ div.btn-toolbar div.btn-group button { } div.btn-toolbar div.btn-group button:hover { - border-left: 1px solid @NWBorder; - border-top: 1px solid @NWBorder; - border-right: 1px solid @SEBorder; - border-bottom: 1px solid @SEBorder; + border-left: 1px solid @nwBorder; + border-top: 1px solid @nwBorder; + border-right: 1px solid @seBorder; + border-bottom: 1px solid @seBorder; background: @hoverBackground; color: @toolbarColor; cursor: pointer; @@ -224,10 +224,10 @@ div.btn-toolbar a { } div.btn-toolbar a:hover { - border-left: 1px solid @NWBorder; - border-top: 1px solid @NWBorder; - border-right: 1px solid @SEBorder; - border-bottom: 1px solid @SEBorder; + border-left: 1px solid @nwBorder; + border-top: 1px solid @nwBorder; + border-right: 1px solid @seBorder; + border-bottom: 1px solid @seBorder; background: @hoverBackground; color: @toolbarColor; cursor: pointer; @@ -376,10 +376,10 @@ div.current fieldset.adminform { #cpanel div.icon a:focus, .cpanel div.icon a:hover, .cpanel div.icon a:focus { - border-left: 1px solid @NWBorder; - border-top: 1px solid @NWBorder; - border-right: 1px solid @SEBorder; - border-bottom: 1px solid @SEBorder; + border-left: 1px solid @nwBorder; + border-top: 1px solid @nwBorder; + border-right: 1px solid @seBorder; + border-bottom: 1px solid @seBorder; color: @linkColor; background: @hoverBackground; } diff --git a/administrator/templates/hathor/less/colour_brown.less b/administrator/templates/hathor/less/colour_brown.less index 3d267cea75d55..ffa966561bf37 100644 --- a/administrator/templates/hathor/less/colour_brown.less +++ b/administrator/templates/hathor/less/colour_brown.less @@ -33,10 +33,10 @@ @gradientTop: #d5c1b2; @gradientBottom: #d5c1b2; @mainBorder: #000000; -@toolbarColor: #000000; -@hoverBackground: #e1d3c8; -@NWBorder: #000000; -@SEBorder: #000000; +@toolbarColor: #054993; +@hoverBackground: #e5d9c3; +@nwBorder: #868778; +@seBorder: #f6f7db; // Import the baseline to compile the CSS @import "colour_baseline.less"; diff --git a/administrator/templates/hathor/less/hathor_variables.less b/administrator/templates/hathor/less/hathor_variables.less index 8e4eb7144b920..b2c0715b62ace 100644 --- a/administrator/templates/hathor/less/hathor_variables.less +++ b/administrator/templates/hathor/less/hathor_variables.less @@ -131,8 +131,8 @@ // ------------------------- @toolbarColor: @linkColor; @hoverBackground: #e5d9c3; -@NWBorder: #868778; -@SEBorder: #f6f7db; +@nwBorder: #868778; +@seBorder: #f6f7db; @fadedText: #cccccc; @disabledBackground: #eeeeee; @permissionDefault: #ffffcf; diff --git a/administrator/templates/isis/css/template-rtl.css b/administrator/templates/isis/css/template-rtl.css index a50d5fa4ca508..9434de61c0772 100644 --- a/administrator/templates/isis/css/template-rtl.css +++ b/administrator/templates/isis/css/template-rtl.css @@ -4706,6 +4706,9 @@ a.badge:focus { .affix { position: fixed; } +@-ms-viewport { + width: device-width; +} .hidden { display: none; visibility: hidden; diff --git a/administrator/templates/isis/css/template.css b/administrator/templates/isis/css/template.css index fa27790ee7a31..b18235c598021 100644 --- a/administrator/templates/isis/css/template.css +++ b/administrator/templates/isis/css/template.css @@ -4706,6 +4706,9 @@ a.badge:focus { .affix { position: fixed; } +@-ms-viewport { + width: device-width; +} .hidden { display: none; visibility: hidden; diff --git a/composer.json b/composer.json index 12d67fd0c6715..ba4e4930ec1d9 100644 --- a/composer.json +++ b/composer.json @@ -22,7 +22,7 @@ "joomla/uri": "~1.1", "joomla/utilities": "~1.3 >=1.3.3", "ircmaxell/password-compat": "1.*", - "leafo/lessphp": "0.3.9", + "leafo/lessphp": "0.5.0", "paragonie/random_compat": "~1.0", "phpmailer/phpmailer": "5.2.14", "symfony/polyfill-php56": "~1.0", diff --git a/composer.lock b/composer.lock index 3da1e6518d629..e4fb43e3f960d 100644 --- a/composer.lock +++ b/composer.lock @@ -4,8 +4,8 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", "This file is @generated automatically" ], - "hash": "684c7db12dc7f9de7e939f46930cd9be", - "content-hash": "3fe2809a805463b5353fd2cf269e2ee6", + "hash": "d500f4784ce37841dad0b29e32660849", + "content-hash": "800b07fe877fd7416bf7c046ad42a55a", "packages": [ { "name": "ircmaxell/password-compat", @@ -564,22 +564,22 @@ }, { "name": "leafo/lessphp", - "version": "v0.3.9", + "version": "v0.5.0", "source": { "type": "git", "url": "https://github.com/leafo/lessphp.git", - "reference": "a11a6141b5715162b933c405379765d817891c5d" + "reference": "0f5a7f5545d2bcf4e9fad9a228c8ad89cc9aa283" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/leafo/lessphp/zipball/a11a6141b5715162b933c405379765d817891c5d", - "reference": "a11a6141b5715162b933c405379765d817891c5d", + "url": "https://api.github.com/repos/leafo/lessphp/zipball/0f5a7f5545d2bcf4e9fad9a228c8ad89cc9aa283", + "reference": "0f5a7f5545d2bcf4e9fad9a228c8ad89cc9aa283", "shasum": "" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "0.3-dev" + "dev-master": "0.4.x-dev" } }, "autoload": { @@ -601,7 +601,7 @@ ], "description": "lessphp is a compiler for LESS written in PHP.", "homepage": "http://leafo.net/lessphp/", - "time": "2013-03-02 16:13:31" + "time": "2014-11-24 18:39:20" }, { "name": "paragonie/random_compat", @@ -908,16 +908,16 @@ "packages-dev": [ { "name": "doctrine/instantiator", - "version": "1.0.4", + "version": "1.0.5", "source": { "type": "git", "url": "https://github.com/doctrine/instantiator.git", - "reference": "f976e5de371104877ebc89bd8fecb0019ed9c119" + "reference": "8e884e78f9f0eb1329e445619e04456e64d8051d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/instantiator/zipball/f976e5de371104877ebc89bd8fecb0019ed9c119", - "reference": "f976e5de371104877ebc89bd8fecb0019ed9c119", + "url": "https://api.github.com/repos/doctrine/instantiator/zipball/8e884e78f9f0eb1329e445619e04456e64d8051d", + "reference": "8e884e78f9f0eb1329e445619e04456e64d8051d", "shasum": "" }, "require": { @@ -928,7 +928,7 @@ "ext-pdo": "*", "ext-phar": "*", "phpunit/phpunit": "~4.0", - "squizlabs/php_codesniffer": "2.0.*@ALPHA" + "squizlabs/php_codesniffer": "~2.0" }, "type": "library", "extra": { @@ -937,8 +937,8 @@ } }, "autoload": { - "psr-0": { - "Doctrine\\Instantiator\\": "src" + "psr-4": { + "Doctrine\\Instantiator\\": "src/Doctrine/Instantiator/" } }, "notification-url": "https://packagist.org/downloads/", @@ -958,7 +958,7 @@ "constructor", "instantiate" ], - "time": "2014-10-13 12:58:55" + "time": "2015-06-14 21:17:01" }, { "name": "pear/cache_lite", @@ -1061,16 +1061,16 @@ }, { "name": "phpspec/prophecy", - "version": "v1.4.1", + "version": "v1.5.0", "source": { "type": "git", "url": "https://github.com/phpspec/prophecy.git", - "reference": "3132b1f44c7bf2ec4c7eb2d3cb78fdeca760d373" + "reference": "4745ded9307786b730d7a60df5cb5a6c43cf95f7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpspec/prophecy/zipball/3132b1f44c7bf2ec4c7eb2d3cb78fdeca760d373", - "reference": "3132b1f44c7bf2ec4c7eb2d3cb78fdeca760d373", + "url": "https://api.github.com/repos/phpspec/prophecy/zipball/4745ded9307786b730d7a60df5cb5a6c43cf95f7", + "reference": "4745ded9307786b730d7a60df5cb5a6c43cf95f7", "shasum": "" }, "require": { @@ -1117,7 +1117,7 @@ "spy", "stub" ], - "time": "2015-04-27 22:15:08" + "time": "2015-08-13 10:07:40" }, { "name": "phpunit/dbunit", @@ -1180,16 +1180,16 @@ }, { "name": "phpunit/php-code-coverage", - "version": "2.1.5", + "version": "2.2.4", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-code-coverage.git", - "reference": "be2286cb8c7e1773eded49d9719219e6f74f9e3e" + "reference": "eabf68b476ac7d0f73793aada060f1c1a9bf8979" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/be2286cb8c7e1773eded49d9719219e6f74f9e3e", - "reference": "be2286cb8c7e1773eded49d9719219e6f74f9e3e", + "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/eabf68b476ac7d0f73793aada060f1c1a9bf8979", + "reference": "eabf68b476ac7d0f73793aada060f1c1a9bf8979", "shasum": "" }, "require": { @@ -1197,7 +1197,7 @@ "phpunit/php-file-iterator": "~1.3", "phpunit/php-text-template": "~1.2", "phpunit/php-token-stream": "~1.3", - "sebastian/environment": "~1.0", + "sebastian/environment": "^1.3.2", "sebastian/version": "~1.0" }, "require-dev": { @@ -1212,7 +1212,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "2.1.x-dev" + "dev-master": "2.2.x-dev" } }, "autoload": { @@ -1238,20 +1238,20 @@ "testing", "xunit" ], - "time": "2015-06-09 13:05:42" + "time": "2015-10-06 15:47:00" }, { "name": "phpunit/php-file-iterator", - "version": "1.4.0", + "version": "1.4.1", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-file-iterator.git", - "reference": "a923bb15680d0089e2316f7a4af8f437046e96bb" + "reference": "6150bf2c35d3fc379e50c7602b75caceaa39dbf0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/a923bb15680d0089e2316f7a4af8f437046e96bb", - "reference": "a923bb15680d0089e2316f7a4af8f437046e96bb", + "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/6150bf2c35d3fc379e50c7602b75caceaa39dbf0", + "reference": "6150bf2c35d3fc379e50c7602b75caceaa39dbf0", "shasum": "" }, "require": { @@ -1285,20 +1285,20 @@ "filesystem", "iterator" ], - "time": "2015-04-02 05:19:05" + "time": "2015-06-21 13:08:43" }, { "name": "phpunit/php-text-template", - "version": "1.2.0", + "version": "1.2.1", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-text-template.git", - "reference": "206dfefc0ffe9cebf65c413e3d0e809c82fbf00a" + "reference": "31f8b717e51d9a2afca6c9f046f5d69fc27c8686" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-text-template/zipball/206dfefc0ffe9cebf65c413e3d0e809c82fbf00a", - "reference": "206dfefc0ffe9cebf65c413e3d0e809c82fbf00a", + "url": "https://api.github.com/repos/sebastianbergmann/php-text-template/zipball/31f8b717e51d9a2afca6c9f046f5d69fc27c8686", + "reference": "31f8b717e51d9a2afca6c9f046f5d69fc27c8686", "shasum": "" }, "require": { @@ -1307,20 +1307,17 @@ "type": "library", "autoload": { "classmap": [ - "Text/" + "src/" ] }, "notification-url": "https://packagist.org/downloads/", - "include-path": [ - "" - ], "license": [ "BSD-3-Clause" ], "authors": [ { "name": "Sebastian Bergmann", - "email": "sb@sebastian-bergmann.de", + "email": "sebastian@phpunit.de", "role": "lead" } ], @@ -1329,20 +1326,20 @@ "keywords": [ "template" ], - "time": "2014-01-30 17:20:04" + "time": "2015-06-21 13:50:34" }, { "name": "phpunit/php-timer", - "version": "1.0.6", + "version": "1.0.7", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-timer.git", - "reference": "83fe1bdc5d47658b727595c14da140da92b3d66d" + "reference": "3e82f4e9fc92665fafd9157568e4dcb01d014e5b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/83fe1bdc5d47658b727595c14da140da92b3d66d", - "reference": "83fe1bdc5d47658b727595c14da140da92b3d66d", + "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/3e82f4e9fc92665fafd9157568e4dcb01d014e5b", + "reference": "3e82f4e9fc92665fafd9157568e4dcb01d014e5b", "shasum": "" }, "require": { @@ -1370,20 +1367,20 @@ "keywords": [ "timer" ], - "time": "2015-06-13 07:35:30" + "time": "2015-06-21 08:01:12" }, { "name": "phpunit/php-token-stream", - "version": "1.4.2", + "version": "1.4.8", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-token-stream.git", - "reference": "db63be1159c81df649cd0260e30249a586d4129e" + "reference": "3144ae21711fb6cac0b1ab4cbe63b75ce3d4e8da" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/db63be1159c81df649cd0260e30249a586d4129e", - "reference": "db63be1159c81df649cd0260e30249a586d4129e", + "url": "https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/3144ae21711fb6cac0b1ab4cbe63b75ce3d4e8da", + "reference": "3144ae21711fb6cac0b1ab4cbe63b75ce3d4e8da", "shasum": "" }, "require": { @@ -1419,7 +1416,7 @@ "keywords": [ "tokenizer" ], - "time": "2015-06-12 07:34:24" + "time": "2015-09-15 10:49:45" }, { "name": "phpunit/phpunit", @@ -1495,22 +1492,23 @@ }, { "name": "phpunit/phpunit-mock-objects", - "version": "2.3.4", + "version": "2.3.8", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit-mock-objects.git", - "reference": "92408bb1968a81b3217a6fdf6c1a198da83caa35" + "reference": "ac8e7a3db35738d56ee9a76e78a4e03d97628983" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit-mock-objects/zipball/92408bb1968a81b3217a6fdf6c1a198da83caa35", - "reference": "92408bb1968a81b3217a6fdf6c1a198da83caa35", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit-mock-objects/zipball/ac8e7a3db35738d56ee9a76e78a4e03d97628983", + "reference": "ac8e7a3db35738d56ee9a76e78a4e03d97628983", "shasum": "" }, "require": { - "doctrine/instantiator": "~1.0,>=1.0.2", + "doctrine/instantiator": "^1.0.2", "php": ">=5.3.3", - "phpunit/php-text-template": "~1.2" + "phpunit/php-text-template": "~1.2", + "sebastian/exporter": "~1.2" }, "require-dev": { "phpunit/phpunit": "~4.4" @@ -1546,20 +1544,20 @@ "mock", "xunit" ], - "time": "2015-06-11 15:55:48" + "time": "2015-10-02 06:51:40" }, { "name": "sebastian/comparator", - "version": "1.1.1", + "version": "1.2.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/comparator.git", - "reference": "1dd8869519a225f7f2b9eb663e225298fade819e" + "reference": "937efb279bd37a375bcadf584dec0726f84dbf22" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/1dd8869519a225f7f2b9eb663e225298fade819e", - "reference": "1dd8869519a225f7f2b9eb663e225298fade819e", + "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/937efb279bd37a375bcadf584dec0726f84dbf22", + "reference": "937efb279bd37a375bcadf584dec0726f84dbf22", "shasum": "" }, "require": { @@ -1573,7 +1571,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.1.x-dev" + "dev-master": "1.2.x-dev" } }, "autoload": { @@ -1610,32 +1608,32 @@ "compare", "equality" ], - "time": "2015-01-29 16:28:08" + "time": "2015-07-26 15:48:44" }, { "name": "sebastian/diff", - "version": "1.3.0", + "version": "1.4.1", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/diff.git", - "reference": "863df9687835c62aa423a22412d26fa2ebde3fd3" + "reference": "13edfd8706462032c2f52b4b862974dd46b71c9e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/863df9687835c62aa423a22412d26fa2ebde3fd3", - "reference": "863df9687835c62aa423a22412d26fa2ebde3fd3", + "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/13edfd8706462032c2f52b4b862974dd46b71c9e", + "reference": "13edfd8706462032c2f52b4b862974dd46b71c9e", "shasum": "" }, "require": { "php": ">=5.3.3" }, "require-dev": { - "phpunit/phpunit": "~4.2" + "phpunit/phpunit": "~4.8" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.3-dev" + "dev-master": "1.4-dev" } }, "autoload": { @@ -1658,24 +1656,24 @@ } ], "description": "Diff implementation", - "homepage": "http://www.github.com/sebastianbergmann/diff", + "homepage": "https://github.com/sebastianbergmann/diff", "keywords": [ "diff" ], - "time": "2015-02-22 15:13:53" + "time": "2015-12-08 07:14:41" }, { "name": "sebastian/environment", - "version": "1.3.2", + "version": "1.3.3", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/environment.git", - "reference": "6324c907ce7a52478eeeaede764f48733ef5ae44" + "reference": "6e7133793a8e5a5714a551a8324337374be209df" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/6324c907ce7a52478eeeaede764f48733ef5ae44", - "reference": "6324c907ce7a52478eeeaede764f48733ef5ae44", + "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/6e7133793a8e5a5714a551a8324337374be209df", + "reference": "6e7133793a8e5a5714a551a8324337374be209df", "shasum": "" }, "require": { @@ -1712,20 +1710,20 @@ "environment", "hhvm" ], - "time": "2015-08-03 06:14:51" + "time": "2015-12-02 08:37:27" }, { "name": "sebastian/exporter", - "version": "1.2.0", + "version": "1.2.1", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/exporter.git", - "reference": "84839970d05254c73cde183a721c7af13aede943" + "reference": "7ae5513327cb536431847bcc0c10edba2701064e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/84839970d05254c73cde183a721c7af13aede943", - "reference": "84839970d05254c73cde183a721c7af13aede943", + "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/7ae5513327cb536431847bcc0c10edba2701064e", + "reference": "7ae5513327cb536431847bcc0c10edba2701064e", "shasum": "" }, "require": { @@ -1778,20 +1776,20 @@ "export", "exporter" ], - "time": "2015-01-27 07:23:06" + "time": "2015-06-21 07:55:53" }, { "name": "sebastian/global-state", - "version": "1.0.0", + "version": "1.1.1", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/global-state.git", - "reference": "c7428acdb62ece0a45e6306f1ae85e1c05b09c01" + "reference": "bc37d50fea7d017d3d340f230811c9f1d7280af4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/c7428acdb62ece0a45e6306f1ae85e1c05b09c01", - "reference": "c7428acdb62ece0a45e6306f1ae85e1c05b09c01", + "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/bc37d50fea7d017d3d340f230811c9f1d7280af4", + "reference": "bc37d50fea7d017d3d340f230811c9f1d7280af4", "shasum": "" }, "require": { @@ -1829,20 +1827,20 @@ "keywords": [ "global state" ], - "time": "2014-10-06 09:23:50" + "time": "2015-10-12 03:26:01" }, { "name": "sebastian/recursion-context", - "version": "1.0.0", + "version": "1.0.2", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/recursion-context.git", - "reference": "3989662bbb30a29d20d9faa04a846af79b276252" + "reference": "913401df809e99e4f47b27cdd781f4a258d58791" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/3989662bbb30a29d20d9faa04a846af79b276252", - "reference": "3989662bbb30a29d20d9faa04a846af79b276252", + "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/913401df809e99e4f47b27cdd781f4a258d58791", + "reference": "913401df809e99e4f47b27cdd781f4a258d58791", "shasum": "" }, "require": { @@ -1882,20 +1880,20 @@ ], "description": "Provides functionality to recursively process PHP variables", "homepage": "http://www.github.com/sebastianbergmann/recursion-context", - "time": "2015-01-24 09:48:32" + "time": "2015-11-11 19:50:13" }, { "name": "sebastian/version", - "version": "1.0.5", + "version": "1.0.6", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/version.git", - "reference": "ab931d46cd0d3204a91e1b9a40c4bc13032b58e4" + "reference": "58b3a85e7999757d6ad81c787a1fbf5ff6c628c6" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/version/zipball/ab931d46cd0d3204a91e1b9a40c4bc13032b58e4", - "reference": "ab931d46cd0d3204a91e1b9a40c4bc13032b58e4", + "url": "https://api.github.com/repos/sebastianbergmann/version/zipball/58b3a85e7999757d6ad81c787a1fbf5ff6c628c6", + "reference": "58b3a85e7999757d6ad81c787a1fbf5ff6c628c6", "shasum": "" }, "type": "library", @@ -1917,7 +1915,7 @@ ], "description": "Library that helps with managing the version number of Git-hosted PHP projects", "homepage": "https://github.com/sebastianbergmann/version", - "time": "2015-02-24 06:35:25" + "time": "2015-06-21 13:59:46" }, { "name": "squizlabs/php_codesniffer", @@ -2003,5 +2001,8 @@ "platform": { "php": ">=5.3.10" }, - "platform-dev": [] + "platform-dev": [], + "platform-overrides": { + "php": "5.3.10" + } } diff --git a/libraries/cms/less/less.php b/libraries/cms/less/less.php index b2499035b180f..da7f48339fc77 100644 --- a/libraries/cms/less/less.php +++ b/libraries/cms/less/less.php @@ -37,4 +37,23 @@ public function __construct($fname = null, $formatter = null) $this->setFormatter($formatter); } + + /** + * Override compile to reset $this->allParsedFiles array to allow + * parsing multiple files/strings using same imports. + * PR: https://github.com/leafo/lessphp/pull/607 + * + * For documentation on this please see /vendor/leafo/lessc.inc.php + * + * @param string $string LESS string to parse. + * @param string $name The sourceName used for error messages. + * + * @return string $out The compiled css output. + */ + public function compile($string, $name = null) + { + $this->allParsedFiles = array(); + + return parent::compile($string, $name); + } } diff --git a/libraries/vendor/autoload.php b/libraries/vendor/autoload.php index 4cc388d9f7229..efeceae5ae2ba 100644 --- a/libraries/vendor/autoload.php +++ b/libraries/vendor/autoload.php @@ -4,4 +4,4 @@ require_once __DIR__ . '/composer' . '/autoload_real.php'; -return ComposerAutoloaderInit0efb534ee20646bcb987f4359c38b3aa::getLoader(); +return ComposerAutoloaderInit205c915b9c7d3e718e7c95793ee67ffe::getLoader(); diff --git a/libraries/vendor/composer/autoload_real.php b/libraries/vendor/composer/autoload_real.php index 191a3f253b576..1298690b3bb5d 100644 --- a/libraries/vendor/composer/autoload_real.php +++ b/libraries/vendor/composer/autoload_real.php @@ -2,7 +2,7 @@ // autoload_real.php @generated by Composer -class ComposerAutoloaderInit0efb534ee20646bcb987f4359c38b3aa +class ComposerAutoloaderInit205c915b9c7d3e718e7c95793ee67ffe { private static $loader; @@ -19,9 +19,9 @@ public static function getLoader() return self::$loader; } - spl_autoload_register(array('ComposerAutoloaderInit0efb534ee20646bcb987f4359c38b3aa', 'loadClassLoader'), true, true); + spl_autoload_register(array('ComposerAutoloaderInit205c915b9c7d3e718e7c95793ee67ffe', 'loadClassLoader'), true, true); self::$loader = $loader = new \Composer\Autoload\ClassLoader(); - spl_autoload_unregister(array('ComposerAutoloaderInit0efb534ee20646bcb987f4359c38b3aa', 'loadClassLoader')); + spl_autoload_unregister(array('ComposerAutoloaderInit205c915b9c7d3e718e7c95793ee67ffe', 'loadClassLoader')); $map = require __DIR__ . '/autoload_namespaces.php'; foreach ($map as $namespace => $path) { @@ -42,14 +42,14 @@ public static function getLoader() $includeFiles = require __DIR__ . '/autoload_files.php'; foreach ($includeFiles as $fileIdentifier => $file) { - composerRequire0efb534ee20646bcb987f4359c38b3aa($fileIdentifier, $file); + composerRequire205c915b9c7d3e718e7c95793ee67ffe($fileIdentifier, $file); } return $loader; } } -function composerRequire0efb534ee20646bcb987f4359c38b3aa($fileIdentifier, $file) +function composerRequire205c915b9c7d3e718e7c95793ee67ffe($fileIdentifier, $file) { if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) { require $file; diff --git a/libraries/vendor/composer/installed.json b/libraries/vendor/composer/installed.json index 1eaea909a2c74..7f6e26dfb969b 100644 --- a/libraries/vendor/composer/installed.json +++ b/libraries/vendor/composer/installed.json @@ -78,49 +78,6 @@ "uri" ] }, - { - "name": "leafo/lessphp", - "version": "v0.3.9", - "version_normalized": "0.3.9.0", - "source": { - "type": "git", - "url": "https://github.com/leafo/lessphp.git", - "reference": "a11a6141b5715162b933c405379765d817891c5d" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/leafo/lessphp/zipball/a11a6141b5715162b933c405379765d817891c5d", - "reference": "a11a6141b5715162b933c405379765d817891c5d", - "shasum": "" - }, - "time": "2013-03-02 16:13:31", - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "0.3-dev" - } - }, - "installation-source": "dist", - "autoload": { - "classmap": [ - "lessc.inc.php" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT", - "GPL-3.0" - ], - "authors": [ - { - "name": "Leaf Corcoran", - "email": "leafot@gmail.com", - "homepage": "http://leafo.net" - } - ], - "description": "lessphp is a compiler for LESS written in PHP.", - "homepage": "http://leafo.net/lessphp/" - }, { "name": "joomla/input", "version": "1.2.0", @@ -933,5 +890,48 @@ } ], "description": "PHPMailer is a full-featured email creation and transfer class for PHP" + }, + { + "name": "leafo/lessphp", + "version": "v0.5.0", + "version_normalized": "0.5.0.0", + "source": { + "type": "git", + "url": "https://github.com/leafo/lessphp.git", + "reference": "0f5a7f5545d2bcf4e9fad9a228c8ad89cc9aa283" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/leafo/lessphp/zipball/0f5a7f5545d2bcf4e9fad9a228c8ad89cc9aa283", + "reference": "0f5a7f5545d2bcf4e9fad9a228c8ad89cc9aa283", + "shasum": "" + }, + "time": "2014-11-24 18:39:20", + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "0.4.x-dev" + } + }, + "installation-source": "dist", + "autoload": { + "classmap": [ + "lessc.inc.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT", + "GPL-3.0" + ], + "authors": [ + { + "name": "Leaf Corcoran", + "email": "leafot@gmail.com", + "homepage": "http://leafo.net" + } + ], + "description": "lessphp is a compiler for LESS written in PHP.", + "homepage": "http://leafo.net/lessphp/" } ] diff --git a/libraries/vendor/leafo/lessphp/LICENSE b/libraries/vendor/leafo/lessphp/LICENSE index b2338b1c8ac54..49c9ea41735a7 100644 --- a/libraries/vendor/leafo/lessphp/LICENSE +++ b/libraries/vendor/leafo/lessphp/LICENSE @@ -1,4 +1,4 @@ -For ease of distribution, lessphp 0.2.0 is under a dual license. +For ease of distribution, lessphp 0.4.0 is under a dual license. You are free to pick which one suits your needs. @@ -9,8 +9,8 @@ MIT LICENSE -Copyright (c) 2010 Leaf Corcoran, http://leafo.net/lessphp - +Copyright (c) 2013 Leaf Corcoran, http://leafo.net/lessphp + Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including @@ -18,10 +18,10 @@ without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - + The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. - + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND diff --git a/libraries/vendor/leafo/lessphp/lessc.inc.php b/libraries/vendor/leafo/lessphp/lessc.inc.php index 411ca2fab8890..2292f219d4c08 100644 --- a/libraries/vendor/leafo/lessphp/lessc.inc.php +++ b/libraries/vendor/leafo/lessphp/lessc.inc.php @@ -1,18 +1,18 @@ + * Copyright 2013, Leaf Corcoran * Licensed under MIT or GPLv3, see LICENSE */ /** - * The less compiler and parser. + * The LESS compiler and parser. * * Converting LESS to CSS is a three stage process. The incoming file is parsed * by `lessc_parser` into a syntax tree, then it is compiled into another tree @@ -27,7 +27,7 @@ * * In summary: * - * The `lessc` class creates an intstance of the parser, feeds it LESS code, + * The `lessc` class creates an instance of the parser, feeds it LESS code, * then transforms the resulting tree to a CSS tree. This class also holds the * evaluation context, such as all available mixins and variables at any given * time. @@ -38,9 +38,10 @@ * handling things like indentation. */ class lessc { - static public $VERSION = "v0.3.9"; - static protected $TRUE = array("keyword", "true"); - static protected $FALSE = array("keyword", "false"); + static public $VERSION = "v0.5.0"; + + static public $TRUE = array("keyword", "true"); + static public $FALSE = array("keyword", "false"); protected $libFunctions = array(); protected $registeredVars = array(); @@ -55,13 +56,13 @@ class lessc { protected $numberPrecision = null; + protected $allParsedFiles = array(); + // set to the parser that generated the current line when compiling // so we know how to create error messages protected $sourceParser = null; protected $sourceLoc = null; - static public $defaultValue = array("keyword", ""); - static protected $nextImportId = 0; // uniquely identify imports // attempts to find the path of an import url, returns null for css files @@ -103,12 +104,17 @@ protected function tryImport($importPath, $parentBlock, $out) { if (substr_compare($url, '.css', -4, 4) === 0) return false; $realPath = $this->findImport($url); + if ($realPath === null) return false; if ($this->importDisabled) { return array(false, "/* import disabled */"); } + if (isset($this->allParsedFiles[realpath($realPath)])) { + return array(false, null); + } + $this->addParsedFile($realPath); $parser = $this->makeParser($realPath); $root = $parser->parse(file_get_contents($realPath)); @@ -276,37 +282,73 @@ protected function compileProps($block, $out) { foreach ($this->sortProps($block->props) as $prop) { $this->compileProp($prop, $block, $out); } + $out->lines = $this->deduplicate($out->lines); + } + + /** + * Deduplicate lines in a block. Comments are not deduplicated. If a + * duplicate rule is detected, the comments immediately preceding each + * occurence are consolidated. + */ + protected function deduplicate($lines) { + $unique = array(); + $comments = array(); + + foreach($lines as $line) { + if (strpos($line, '/*') === 0) { + $comments[] = $line; + continue; + } + if (!in_array($line, $unique)) { + $unique[] = $line; + } + array_splice($unique, array_search($line, $unique), 0, $comments); + $comments = array(); + } + return array_merge($unique, $comments); } protected function sortProps($props, $split = false) { $vars = array(); $imports = array(); $other = array(); + $stack = array(); foreach ($props as $prop) { switch ($prop[0]) { + case "comment": + $stack[] = $prop; + break; case "assign": + $stack[] = $prop; if (isset($prop[1][0]) && $prop[1][0] == $this->vPrefix) { - $vars[] = $prop; + $vars = array_merge($vars, $stack); } else { - $other[] = $prop; + $other = array_merge($other, $stack); } + $stack = array(); break; case "import": $id = self::$nextImportId++; $prop[] = $id; - $imports[] = $prop; + $stack[] = $prop; + $imports = array_merge($imports, $stack); $other[] = array("import_mixin", $id); + $stack = array(); break; default: - $other[] = $prop; + $stack[] = $prop; + $other = array_merge($other, $stack); + $stack = array(); + break; } } + $other = array_merge($other, $stack); if ($split) { - return array(array_merge($vars, $imports), $other); + return array(array_merge($imports, $vars), $other); } else { - return array_merge($vars, $imports, $other); + return array_merge($imports, $vars, $other); } } @@ -450,7 +492,7 @@ protected function eq($left, $right) { return $left == $right; } - protected function patternMatch($block, $callingArgs) { + protected function patternMatch($block, $orderedArgs, $keywordArgs) { // match the guards if it has them // any one of the groups must have all its guards pass for a match if (!empty($block->guards)) { @@ -458,7 +500,7 @@ protected function patternMatch($block, $callingArgs) { foreach ($block->guards as $guardGroup) { foreach ($guardGroup as $guard) { $this->pushEnv(); - $this->zipSetArgs($block->args, $callingArgs); + $this->zipSetArgs($block->args, $orderedArgs, $keywordArgs); $negate = false; if ($guard[0] == "negate") { @@ -487,24 +529,34 @@ protected function patternMatch($block, $callingArgs) { } } - $numCalling = count($callingArgs); - if (empty($block->args)) { - return $block->isVararg || $numCalling == 0; + return $block->isVararg || empty($orderedArgs) && empty($keywordArgs); + } + + $remainingArgs = $block->args; + if ($keywordArgs) { + $remainingArgs = array(); + foreach ($block->args as $arg) { + if ($arg[0] == "arg" && isset($keywordArgs[$arg[1]])) { + continue; + } + + $remainingArgs[] = $arg; + } } $i = -1; // no args // try to match by arity or by argument literal - foreach ($block->args as $i => $arg) { + foreach ($remainingArgs as $i => $arg) { switch ($arg[0]) { case "lit": - if (empty($callingArgs[$i]) || !$this->eq($arg[1], $callingArgs[$i])) { + if (empty($orderedArgs[$i]) || !$this->eq($arg[1], $orderedArgs[$i])) { return false; } break; case "arg": // no arg and no default value - if (!isset($callingArgs[$i]) && !isset($arg[2])) { + if (!isset($orderedArgs[$i]) && !isset($arg[2])) { return false; } break; @@ -519,14 +571,19 @@ protected function patternMatch($block, $callingArgs) { } else { $numMatched = $i + 1; // greater than becuase default values always match - return $numMatched >= $numCalling; + return $numMatched >= count($orderedArgs); } } - protected function patternMatchAll($blocks, $callingArgs) { + protected function patternMatchAll($blocks, $orderedArgs, $keywordArgs, $skip=array()) { $matches = null; foreach ($blocks as $block) { - if ($this->patternMatch($block, $callingArgs)) { + // skip seen blocks that don't have arguments + if (isset($skip[$block->id]) && !isset($block->args)) { + continue; + } + + if ($this->patternMatch($block, $orderedArgs, $keywordArgs)) { $matches[] = $block; } } @@ -535,7 +592,7 @@ protected function patternMatchAll($blocks, $callingArgs) { } // attempt to find blocks matched by path and args - protected function findBlocks($searchIn, $path, $args, $seen=array()) { + protected function findBlocks($searchIn, $path, $orderedArgs, $keywordArgs, $seen=array()) { if ($searchIn == null) return null; if (isset($seen[$searchIn->id])) return null; $seen[$searchIn->id] = true; @@ -545,7 +602,7 @@ protected function findBlocks($searchIn, $path, $args, $seen=array()) { if (isset($searchIn->children[$name])) { $blocks = $searchIn->children[$name]; if (count($path) == 1) { - $matches = $this->patternMatchAll($blocks, $args); + $matches = $this->patternMatchAll($blocks, $orderedArgs, $keywordArgs, $seen); if (!empty($matches)) { // This will return all blocks that match in the closest // scope that has any matching block, like lessjs @@ -555,7 +612,7 @@ protected function findBlocks($searchIn, $path, $args, $seen=array()) { $matches = array(); foreach ($blocks as $subBlock) { $subMatches = $this->findBlocks($subBlock, - array_slice($path, 1), $args, $seen); + array_slice($path, 1), $orderedArgs, $keywordArgs, $seen); if (!is_null($subMatches)) { foreach ($subMatches as $sm) { @@ -567,39 +624,51 @@ protected function findBlocks($searchIn, $path, $args, $seen=array()) { return count($matches) > 0 ? $matches : null; } } - if ($searchIn->parent === $searchIn) return null; - return $this->findBlocks($searchIn->parent, $path, $args, $seen); + return $this->findBlocks($searchIn->parent, $path, $orderedArgs, $keywordArgs, $seen); } // sets all argument names in $args to either the default value // or the one passed in through $values - protected function zipSetArgs($args, $values) { - $i = 0; + protected function zipSetArgs($args, $orderedValues, $keywordValues) { $assignedValues = array(); - foreach ($args as $a) { + + $i = 0; + foreach ($args as $a) { if ($a[0] == "arg") { - if ($i < count($values) && !is_null($values[$i])) { - $value = $values[$i]; + if (isset($keywordValues[$a[1]])) { + // has keyword arg + $value = $keywordValues[$a[1]]; + } elseif (isset($orderedValues[$i])) { + // has ordered arg + $value = $orderedValues[$i]; + $i++; } elseif (isset($a[2])) { + // has default value $value = $a[2]; - } else $value = null; + } else { + $this->throwError("Failed to assign arg " . $a[1]); + $value = null; // :( + } $value = $this->reduce($value); $this->set($a[1], $value); $assignedValues[] = $value; + } else { + // a lit + $i++; } - $i++; } // check for a rest $last = end($args); if ($last[0] == "rest") { - $rest = array_slice($values, count($args) - 1); + $rest = array_slice($orderedValues, count($args) - 1); $this->set($last[1], $this->reduce(array("list", " ", $rest))); } - $this->env->arguments = $assignedValues; + // wow is this the only true use of PHP's + operator for arrays? + $this->env->arguments = $assignedValues + $orderedValues; } // compile a prop and update $lines or $blocks appropriately @@ -624,15 +693,38 @@ protected function compileProp($prop, $block, $out) { case 'mixin': list(, $path, $args, $suffix) = $prop; - $args = array_map(array($this, "reduce"), (array)$args); - $mixins = $this->findBlocks($block, $path, $args); + $orderedArgs = array(); + $keywordArgs = array(); + foreach ((array)$args as $arg) { + $argval = null; + switch ($arg[0]) { + case "arg": + if (!isset($arg[2])) { + $orderedArgs[] = $this->reduce(array("variable", $arg[1])); + } else { + $keywordArgs[$arg[1]] = $this->reduce($arg[2]); + } + break; + + case "lit": + $orderedArgs[] = $this->reduce($arg[1]); + break; + default: + $this->throwError("Unknown arg type: " . $arg[0]); + } + } + + $mixins = $this->findBlocks($block, $path, $orderedArgs, $keywordArgs); if ($mixins === null) { - // fwrite(STDERR,"failed to find block: ".implode(" > ", $path)."\n"); - break; // throw error here?? + $this->throwError("{$prop[1][0]} is undefined"); } foreach ($mixins as $mixin) { + if ($mixin === $block && !$orderedArgs) { + continue; + } + $haveScope = false; if (isset($mixin->parent->scope)) { $haveScope = true; @@ -644,7 +736,7 @@ protected function compileProp($prop, $block, $out) { if (isset($mixin->args)) { $haveArgs = true; $this->pushEnv(); - $this->zipSetArgs($mixin->args, $args); + $this->zipSetArgs($mixin->args, $orderedArgs, $keywordArgs); } $oldParent = $mixin->parent; @@ -701,7 +793,9 @@ protected function compileProp($prop, $block, $out) { list(,$importId) = $prop; $import = $this->env->imports[$importId]; if ($import[0] === false) { - $out->lines[] = $import[1]; + if (isset($import[1])) { + $out->lines[] = $import[1]; + } } else { list(, $bottom, $parser, $importDir) = $import; $this->compileImportedProps($bottom, $block, $out, $parser, $importDir); @@ -725,7 +819,7 @@ protected function compileProp($prop, $block, $out) { * The input is expected to be reduced. This function will not work on * things like expressions and variables. */ - protected function compileValue($value) { + public function compileValue($value) { switch ($value[0]) { case 'list': // [1] - delimiter @@ -789,6 +883,60 @@ protected function compileValue($value) { } } + protected function lib_pow($args) { + list($base, $exp) = $this->assertArgs($args, 2, "pow"); + return pow($this->assertNumber($base), $this->assertNumber($exp)); + } + + protected function lib_pi() { + return pi(); + } + + protected function lib_mod($args) { + list($a, $b) = $this->assertArgs($args, 2, "mod"); + return $this->assertNumber($a) % $this->assertNumber($b); + } + + protected function lib_tan($num) { + return tan($this->assertNumber($num)); + } + + protected function lib_sin($num) { + return sin($this->assertNumber($num)); + } + + protected function lib_cos($num) { + return cos($this->assertNumber($num)); + } + + protected function lib_atan($num) { + $num = atan($this->assertNumber($num)); + return array("number", $num, "rad"); + } + + protected function lib_asin($num) { + $num = asin($this->assertNumber($num)); + return array("number", $num, "rad"); + } + + protected function lib_acos($num) { + $num = acos($this->assertNumber($num)); + return array("number", $num, "rad"); + } + + protected function lib_sqrt($num) { + return sqrt($this->assertNumber($num)); + } + + protected function lib_extract($value) { + list($list, $idx) = $this->assertArgs($value, 2, "extract"); + $idx = $this->assertNumber($idx); + // 1 indexed + if ($list[0] == "list" && isset($list[2][$idx - 1])) { + return $list[2][$idx - 1]; + } + } + protected function lib_isnumber($value) { return $this->toBool($value[0] == "number"); } @@ -835,6 +983,39 @@ protected function lib_argb($color){ return $this->lib_rgbahex($color); } + /** + * Given an url, decide whether to output a regular link or the base64-encoded contents of the file + * + * @param array $value either an argument list (two strings) or a single string + * @return string formatted url(), either as a link or base64-encoded + */ + protected function lib_data_uri($value) { + $mime = ($value[0] === 'list') ? $value[2][0][2] : null; + $url = ($value[0] === 'list') ? $value[2][1][2][0] : $value[2][0]; + + $fullpath = $this->findImport($url); + + if($fullpath && ($fsize = filesize($fullpath)) !== false) { + // IE8 can't handle data uris larger than 32KB + if($fsize/1024 < 32) { + if(is_null($mime)) { + if(class_exists('finfo')) { // php 5.3+ + $finfo = new finfo(FILEINFO_MIME); + $mime = explode('; ', $finfo->file($fullpath)); + $mime = $mime[0]; + } elseif(function_exists('mime_content_type')) { // PHP 5.2 + $mime = mime_content_type($fullpath); + } + } + + if(!is_null($mime)) // fallback if the mime type is still unknown + $url = sprintf('data:%s;base64,%s', $mime, base64_encode(file_get_contents($fullpath))); + } + } + + return 'url("'.$url.'")'; + } + // utility func to unquote a string protected function lib_e($arg) { switch ($arg[0]) { @@ -843,7 +1024,7 @@ protected function lib_e($arg) { if (isset($items[0])) { return $this->lib_e($items[0]); } - return self::$defaultValue; + $this->throwError("unrecognised input"); case "string": $arg[1] = ""; return $arg; @@ -893,8 +1074,14 @@ protected function lib_ceil($arg) { } protected function lib_round($arg) { - $value = $this->assertNumber($arg); - return array("number", round($value), $arg[2]); + if($arg[0] != "list") { + $value = $this->assertNumber($arg); + return array("number", round($value), $arg[2]); + } else { + $value = $this->assertNumber($arg[2][0]); + $precision = $this->assertNumber($arg[2][1]); + return array("number", round($value, $precision), $arg[2][0][2]); + } } protected function lib_unit($arg) { @@ -911,7 +1098,7 @@ protected function lib_unit($arg) { * Helper function to get arguments for color manipulation functions. * takes a list that contains a color like thing and a percentage */ - protected function colorArgs($args) { + public function colorArgs($args) { if ($args[0] != 'list' || count($args[2]) < 2) { return array(array('color', 0, 0, 0), 0); } @@ -1013,19 +1200,24 @@ protected function lib_percentage($arg) { } // mixes two colors by weight - // mix(@color1, @color2, @weight); + // mix(@color1, @color2, [@weight: 50%]); // http://sass-lang.com/docs/yardoc/Sass/Script/Functions.html#mix-instance_method protected function lib_mix($args) { - if ($args[0] != "list" || count($args[2]) < 3) + if ($args[0] != "list" || count($args[2]) < 2) $this->throwError("mix expects (color1, color2, weight)"); - list($first, $second, $weight) = $args[2]; + list($first, $second) = $args[2]; $first = $this->assertColor($first); $second = $this->assertColor($second); $first_a = $this->lib_alpha($first); $second_a = $this->lib_alpha($second); - $weight = $weight[1] / 100.0; + + if (isset($args[2][2])) { + $weight = $args[2][2][1] / 100.0; + } else { + $weight = 0.5; + } $w = $weight * 2 - 1; $a = $first_a - $second_a; @@ -1047,35 +1239,74 @@ protected function lib_mix($args) { } protected function lib_contrast($args) { - if ($args[0] != 'list' || count($args[2]) < 3) { - return array(array('color', 0, 0, 0), 0); - } + $darkColor = array('color', 0, 0, 0); + $lightColor = array('color', 255, 255, 255); + $threshold = 0.43; - list($inputColor, $darkColor, $lightColor) = $args[2]; + if ( $args[0] == 'list' ) { + $inputColor = ( isset($args[2][0]) ) ? $this->assertColor($args[2][0]) : $lightColor; + $darkColor = ( isset($args[2][1]) ) ? $this->assertColor($args[2][1]) : $darkColor; + $lightColor = ( isset($args[2][2]) ) ? $this->assertColor($args[2][2]) : $lightColor; + $threshold = ( isset($args[2][3]) ) ? $this->assertNumber($args[2][3]) : $threshold; + } + else { + $inputColor = $this->assertColor($args); + } - $inputColor = $this->assertColor($inputColor); - $darkColor = $this->assertColor($darkColor); - $lightColor = $this->assertColor($lightColor); - $hsl = $this->toHSL($inputColor); + $inputColor = $this->coerceColor($inputColor); + $darkColor = $this->coerceColor($darkColor); + $lightColor = $this->coerceColor($lightColor); - if ($hsl[3] > 50) { - return $darkColor; - } + //Figure out which is actually light and dark! + if ( $this->lib_luma($darkColor) > $this->lib_luma($lightColor) ) { + $t = $lightColor; + $lightColor = $darkColor; + $darkColor = $t; + } + + $inputColor_alpha = $this->lib_alpha($inputColor); + if ( ( $this->lib_luma($inputColor) * $inputColor_alpha) < $threshold) { + return $lightColor; + } + return $darkColor; + } - return $lightColor; + protected function lib_luma($color) { + $color = $this->coerceColor($color); + return (0.2126 * $color[0] / 255) + (0.7152 * $color[1] / 255) + (0.0722 * $color[2] / 255); } - protected function assertColor($value, $error = "expected color value") { + + public function assertColor($value, $error = "expected color value") { $color = $this->coerceColor($value); if (is_null($color)) $this->throwError($error); return $color; } - protected function assertNumber($value, $error = "expecting number") { + public function assertNumber($value, $error = "expecting number") { if ($value[0] == "number") return $value[1]; $this->throwError($error); } + public function assertArgs($value, $expectedArgs, $name="") { + if ($expectedArgs == 1) { + return $value; + } else { + if ($value[0] !== "list" || $value[1] != ",") $this->throwError("expecting list"); + $values = $value[2]; + $numValues = count($values); + if ($expectedArgs != $numValues) { + if ($name) { + $name = $name . ": "; + } + + $this->throwError("${name}expecting $expectedArgs arguments, got $numValues"); + } + + return $values; + } + } + protected function toHSL($color) { if ($color[0] == 'hsl') return $color; @@ -1220,6 +1451,10 @@ protected function reduce($value, $forExpression = false) { $var = $this->compileValue($reduced); $res = $this->reduce(array("variable", $this->vPrefix . $var)); + if ($res[0] == "raw_color") { + $res = $this->coerceColor($res); + } + if (empty($value[2])) $res = $this->lib_e($res); return $res; @@ -1237,7 +1472,7 @@ protected function reduce($value, $forExpression = false) { } $seen[$key] = true; - $out = $this->reduce($this->get($key, self::$defaultValue)); + $out = $this->reduce($this->get($key)); $seen[$key] = false; return $out; case "list": @@ -1265,8 +1500,9 @@ protected function reduce($value, $forExpression = false) { list(, $name, $args) = $value; if ($name == "%") $name = "_sprintf"; + $f = isset($this->libFunctions[$name]) ? - $this->libFunctions[$name] : array($this, 'lib_'.$name); + $this->libFunctions[$name] : array($this, 'lib_'.str_replace('-', '_', $name)); if (is_callable($f)) { if ($args[0] == 'list') @@ -1373,7 +1609,7 @@ protected function flattenList($value) { return $value; } - protected function toBool($a) { + public function toBool($a) { if ($a) return self::$TRUE; else return self::$FALSE; } @@ -1596,7 +1832,7 @@ protected function set($name, $value) { // get the highest occurrence entry for a name - protected function get($name, $default=null) { + protected function get($name) { $current = $this->env; $isArguments = $name == $this->vPrefix . 'arguments'; @@ -1613,7 +1849,7 @@ protected function get($name, $default=null) { } } - return $default; + $this->throwError("variable $name is undefined"); } // inject array of unparsed strings into environment as variables @@ -1681,7 +1917,6 @@ public function compileFile($fname, $outFname = null) { $this->importDir = (array)$this->importDir; $this->importDir[] = $pi['dirname'].'/'; - $this->allParsedFiles = array(); $this->addParsedFile($fname); $out = $this->compile(file_get_contents($fname), $fname); @@ -1850,14 +2085,14 @@ public function allParsedFiles() { return $this->allParsedFiles; } - protected function addParsedFile($file) { + public function addParsedFile($file) { $this->allParsedFiles[realpath($file)] = filemtime($file); } /** * Uses the current value of $this->count to show line and line number */ - protected function throwError($msg = null) { + public function throwError($msg = null) { if ($this->sourceLoc >= 0) { $this->sourceParser->throwError($msg, $this->sourceLoc); } @@ -2065,7 +2300,7 @@ class lessc_parser { static protected $supressDivisionProps = array('/border-radius$/i', '/^font$/i'); - protected $blockDirectives = array("font-face", "keyframes", "page", "-moz-document"); + protected $blockDirectives = array("font-face", "keyframes", "page", "-moz-document", "viewport", "-moz-viewport", "-o-viewport", "-ms-viewport"); protected $lineDirectives = array("charset"); /** @@ -2123,14 +2358,13 @@ public function parse($buffer) { $this->whitespace(); // parse the entire file - $lastCount = $this->count; while (false !== $this->parseChunk()); if ($this->count != strlen($this->buffer)) $this->throwError(); // TODO report where the block was opened - if (!is_null($this->env->parent)) + if ( !property_exists($this->env, 'parent') || !is_null($this->env->parent) ) throw new exception('parse error: unclosed block'); return $this->env; @@ -2176,6 +2410,10 @@ protected function parseChunk() { if (empty($this->buffer)) return false; $s = $this->seek(); + if ($this->whitespace()) { + return true; + } + // setting a property if ($this->keyword($key) && $this->assign() && $this->propertyValue($value, $key) && $this->end()) @@ -2256,7 +2494,7 @@ protected function parseChunk() { } // opening a simple block - if ($this->tags($tags) && $this->literal('{')) { + if ($this->tags($tags) && $this->literal('{', false)) { $tags = $this->fixTags($tags); $this->pushBlock($tags); return true; @@ -2304,7 +2542,7 @@ protected function parseChunk() { // mixin if ($this->mixinTags($tags) && - ($this->argumentValues($argv) || true) && + ($this->argumentDef($argv, $isVararg) || true) && ($this->keyword($suffix) || true) && $this->end()) { $tags = $this->fixTags($tags); @@ -2531,7 +2769,6 @@ protected function value(&$value) { // an import statement protected function import(&$out) { - $s = $this->seek(); if (!$this->literal('@import')) return false; // @import "something.css" media; @@ -2653,7 +2890,6 @@ protected function openString($end, &$out, $nestingOpen=null, $rejectStrs = null } if (!empty($rejectStrs) && in_array($tok, $rejectStrs)) { - $ount = null; break; } @@ -2773,38 +3009,18 @@ protected function color(&$out) { return false; } - // consume a list of property values delimited by ; and wrapped in () - protected function argumentValues(&$args, $delim = ',') { - $s = $this->seek(); - if (!$this->literal('(')) return false; - - $values = array(); - while (true) { - if ($this->expressionList($value)) $values[] = $value; - if (!$this->literal($delim)) break; - else { - if ($value == null) $values[] = null; - $value = null; - } - } - - if (!$this->literal(')')) { - $this->seek($s); - return false; - } - - $args = $values; - return true; - } - // consume an argument definition list surrounded by () // each argument is a variable name with optional value // or at the end a ... or a variable named followed by ... - protected function argumentDef(&$args, &$isVararg, $delim = ',') { + // arguments are separated by , unless a ; is in the list, then ; is the + // delimiter. + protected function argumentDef(&$args, &$isVararg) { $s = $this->seek(); if (!$this->literal('(')) return false; $values = array(); + $delim = ","; + $method = "expressionList"; $isVararg = false; while (true) { @@ -2813,28 +3029,77 @@ protected function argumentDef(&$args, &$isVararg, $delim = ',') { break; } - if ($this->variable($vname)) { - $arg = array("arg", $vname); - $ss = $this->seek(); - if ($this->assign() && $this->expressionList($value)) { - $arg[] = $value; - } else { - $this->seek($ss); - if ($this->literal("...")) { - $arg[0] = "rest"; - $isVararg = true; + if ($this->$method($value)) { + if ($value[0] == "variable") { + $arg = array("arg", $value[1]); + $ss = $this->seek(); + + if ($this->assign() && $this->$method($rhs)) { + $arg[] = $rhs; + } else { + $this->seek($ss); + if ($this->literal("...")) { + $arg[0] = "rest"; + $isVararg = true; + } } + + $values[] = $arg; + if ($isVararg) break; + continue; + } else { + $values[] = array("lit", $value); } - $values[] = $arg; - if ($isVararg) break; - continue; } - if ($this->value($literal)) { - $values[] = array("lit", $literal); - } - if (!$this->literal($delim)) break; + if (!$this->literal($delim)) { + if ($delim == "," && $this->literal(";")) { + // found new delim, convert existing args + $delim = ";"; + $method = "propertyValue"; + + // transform arg list + if (isset($values[1])) { // 2 items + $newList = array(); + foreach ($values as $i => $arg) { + switch($arg[0]) { + case "arg": + if ($i) { + $this->throwError("Cannot mix ; and , as delimiter types"); + } + $newList[] = $arg[2]; + break; + case "lit": + $newList[] = $arg[1]; + break; + case "rest": + $this->throwError("Unexpected rest before semicolon"); + } + } + + $newList = array("list", ", ", $newList); + + switch ($values[0][0]) { + case "arg": + $newArg = array("arg", $values[0][1], $newList); + break; + case "lit": + $newArg = array("lit", $newList); + break; + } + + } elseif ($values) { // 1 item + $newArg = $values[0]; + } + + if ($newArg) { + $values = array($newArg); + } + } else { + break; + } + } } if (!$this->literal(')')) { @@ -2863,7 +3128,6 @@ protected function tags(&$tags, $simple = false, $delim = ',') { // list of tags of specifying mixin path // optionally separated by > (lazy, accepts extra >) protected function mixinTags(&$tags) { - $s = $this->seek(); $tags = array(); while ($this->tag($tt, true)) { $tags[] = $tt; @@ -2876,32 +3140,69 @@ protected function mixinTags(&$tags) { } // a bracketed value (contained within in a tag definition) - protected function tagBracket(&$value) { + protected function tagBracket(&$parts, &$hasExpression) { // speed shortcut if (isset($this->buffer[$this->count]) && $this->buffer[$this->count] != "[") { return false; } $s = $this->seek(); - if ($this->literal('[') && $this->to(']', $c, true) && $this->literal(']', false)) { - $value = '['.$c.']'; - // whitespace? - if ($this->whitespace()) $value .= " "; - // escape parent selector, (yuck) - $value = str_replace($this->lessc->parentSelector, "$&$", $value); - return true; - } + $hasInterpolation = false; - $this->seek($s); - return false; - } + if ($this->literal("[", false)) { + $attrParts = array("["); + // keyword, string, operator + while (true) { + if ($this->literal("]", false)) { + $this->count--; + break; // get out early + } - protected function tagExpression(&$value) { - $s = $this->seek(); - if ($this->literal("(") && $this->expression($exp) && $this->literal(")")) { - $value = array('exp', $exp); - return true; + if ($this->match('\s+', $m)) { + $attrParts[] = " "; + continue; + } + if ($this->string($str)) { + // escape parent selector, (yuck) + foreach ($str[2] as &$chunk) { + $chunk = str_replace($this->lessc->parentSelector, "$&$", $chunk); + } + + $attrParts[] = $str; + $hasInterpolation = true; + continue; + } + + if ($this->keyword($word)) { + $attrParts[] = $word; + continue; + } + + if ($this->interpolation($inter, false)) { + $attrParts[] = $inter; + $hasInterpolation = true; + continue; + } + + // operator, handles attr namespace too + if ($this->match('[|-~\$\*\^=]+', $m)) { + $attrParts[] = $m[0]; + continue; + } + + break; + } + + if ($this->literal("]", false)) { + $attrParts[] = "]"; + foreach ($attrParts as $part) { + $parts[] = $part; + } + $hasExpression = $hasExpression || $hasInterpolation; + return true; + } + $this->seek($s); } $this->seek($s); @@ -2917,13 +3218,9 @@ protected function tag(&$tag, $simple = false) { $s = $this->seek(); - if (!$simple && $this->tagExpression($tag)) { - return true; - } - $hasExpression = false; $parts = array(); - while ($this->tagBracket($first)) $parts[] = $first; + while ($this->tagBracket($parts, $hasExpression)); $oldWhite = $this->eatWhiteDefault; $this->eatWhiteDefault = false; @@ -2933,9 +3230,7 @@ protected function tag(&$tag, $simple = false) { $parts[] = $m[1]; if ($simple) break; - while ($this->tagBracket($brack)) { - $parts[] = $brack; - } + while ($this->tagBracket($parts, $hasExpression)); continue; } @@ -3060,9 +3355,9 @@ protected function keyword(&$word) { // consume an end of statement delimiter protected function end() { - if ($this->literal(';')) { + if ($this->literal(';', false)) { return true; - } elseif ($this->count == strlen($this->buffer) || $this->buffer{$this->count} == '}') { + } elseif ($this->count == strlen($this->buffer) || $this->buffer[$this->count] == '}') { // if there is end of file or a closing block next then we don't need a ; return true; } @@ -3209,9 +3504,9 @@ protected function whitespace() { if ($this->writeComments) { $gotWhite = false; while (preg_match(self::$whitePattern, $this->buffer, $m, null, $this->count)) { - if (isset($m[1]) && empty($this->commentsSeen[$this->count])) { + if (isset($m[1]) && empty($this->seenComments[$this->count])) { $this->append(array("comment", $m[1])); - $this->commentsSeen[$this->count] = true; + $this->seenComments[$this->count] = true; } $this->count += strlen($m[0]); $gotWhite = true; @@ -3326,7 +3621,7 @@ protected function removeComments($text) { break; case '"': case "'": - if (preg_match('/'.$min[0].'.*?'.$min[0].'/', $text, $m, 0, $count)) + if (preg_match('/'.$min[0].'.*?(?count >= strlen($this->buffer)) return false; // shortcut on single letter @@ -157,7 +157,7 @@ function string(&$out) { if (!$escapeNext) { break 3; } - + $buff .= $char; $escapeNext = false; break; @@ -419,7 +419,7 @@ public function parse($str = null) { $order[] = array('compressed', $common, $block); continue; } - + } $order[] = array('none', $block['__tags'], $block); diff --git a/libraries/vendor/leafo/lessphp/plessc b/libraries/vendor/leafo/lessphp/plessc index 6337f996ce260..1871dc77b8994 100755 --- a/libraries/vendor/leafo/lessphp/plessc +++ b/libraries/vendor/leafo/lessphp/plessc @@ -1,7 +1,7 @@ #!/usr/bin/env php , 2012 +// Leaf Corcoran , 2013 $exe = array_shift($argv); // remove filename diff --git a/templates/beez3/css/turq.css b/templates/beez3/css/turq.css index 2f0eb0099b679..aabf15a7a6329 100644 --- a/templates/beez3/css/turq.css +++ b/templates/beez3/css/turq.css @@ -60,7 +60,6 @@ a:focus { #header ul.menu a:link, #header ul.menu a:visited { color: #333; - display: inline-block; font-weight: bold; text-decoration: none; padding: 0px 10px; diff --git a/templates/beez3/css/turq.less b/templates/beez3/css/turq.less index 2860cd618db14..bcd2f39c8df93 100644 --- a/templates/beez3/css/turq.less +++ b/templates/beez3/css/turq.less @@ -85,7 +85,6 @@ a:hover,a:active,a:focus { #header ul.menu a:link,#header ul.menu a:visited { color: #333; - display: inline-block; font-weight: bold; text-decoration: none; padding: 0px 10px; diff --git a/templates/protostar/css/template.css b/templates/protostar/css/template.css index 2f880bb4631ce..7a5d689187808 100644 --- a/templates/protostar/css/template.css +++ b/templates/protostar/css/template.css @@ -4692,6 +4692,9 @@ a.badge:focus { .affix { position: fixed; } +@-ms-viewport { + width: device-width; +} .hidden { display: none; visibility: hidden;